Compare commits
16 Commits
8.5.x
...
st/test-he
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4dffb10875 | ||
|
|
5234224700 | ||
|
|
6d6fd4af1b | ||
|
|
7cfee535ac | ||
|
|
167e311474 | ||
|
|
7eae6ec591 | ||
|
|
4cf1b9737d | ||
|
|
f664329f71 | ||
|
|
d73de9194d | ||
|
|
e8169bfddb | ||
|
|
e375508647 | ||
|
|
6965205824 | ||
|
|
245a5c6f23 | ||
|
|
284eb8ecaf | ||
|
|
76b48a6c77 | ||
|
|
668ab98f0e |
39
.github/COMPONENT-GUIDE.md
vendored
@@ -18,6 +18,7 @@
|
||||
* [Component Structure](#component-structure-1)
|
||||
- [Converting Scoped to Shadow](#converting-scoped-to-shadow)
|
||||
- [RTL](#rtl)
|
||||
- [Themes vs. Modes](#themes-vs-modes)
|
||||
|
||||
## Button States
|
||||
|
||||
@@ -349,7 +350,7 @@ The ripple effect should be added to elements for Material Design. It *requires*
|
||||
|
||||
```jsx
|
||||
render() {
|
||||
const mode = getIonMode(this);
|
||||
const theme = getIonTheme(this);
|
||||
|
||||
return (
|
||||
<Host
|
||||
@@ -359,7 +360,7 @@ return (
|
||||
>
|
||||
<button>
|
||||
<slot></slot>
|
||||
{mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||
{theme === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||
</button>
|
||||
</Host>
|
||||
);
|
||||
@@ -743,3 +744,37 @@ class={{
|
||||
transform-origin: right center;
|
||||
}
|
||||
```
|
||||
|
||||
## Themes vs. Modes
|
||||
|
||||
Themes and modes are two different concepts in Ionic. Themes refer to the "look" of the component, such as the stylesheet that is used. Modes refer to the "behavior" of the component, such as the platform specific behaviors on iOS and Android.
|
||||
|
||||
To detect the theme, you can use the `getIonTheme` function:
|
||||
|
||||
```tsx
|
||||
const theme = getIonTheme(this);
|
||||
|
||||
return (
|
||||
<Host class={theme}>
|
||||
{theme === "md" && <ion-ripple-effect></ion-ripple-effect>}
|
||||
</Host>
|
||||
);
|
||||
```
|
||||
|
||||
Theme can be both used for styling decisions and conditional rendering of elements. For example, the ripple effect is only used in the Material Design theme.
|
||||
|
||||
To detect the mode, you can use the `getIonMode` function:
|
||||
|
||||
```tsx
|
||||
const mode = getIonMode(this);
|
||||
|
||||
if (mode === "ios") {
|
||||
enableRubberBandScrolling();
|
||||
}
|
||||
```
|
||||
|
||||
Mode can be used for behavior tied to the platform the app is running on. For example, iOS has rubber band scrolling, while Android does not.
|
||||
|
||||
Use mode for functionality that remains consistent across all themes but is intended specifically for a certain platform.
|
||||
|
||||
Functionality that is applied only to a specific theme should use theme.
|
||||
135
core/api.txt
@@ -3,6 +3,7 @@ ion-accordion,shadow
|
||||
ion-accordion,prop,disabled,boolean,false,false,false
|
||||
ion-accordion,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-accordion,prop,readonly,boolean,false,false,false
|
||||
ion-accordion,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-accordion,prop,toggleIcon,string,chevronDown,false,false
|
||||
ion-accordion,prop,toggleIconSlot,"end" | "start",'end',false,false
|
||||
ion-accordion,prop,value,string,`ion-accordion-${accordionIds++}`,false,false
|
||||
@@ -17,6 +18,7 @@ ion-accordion-group,prop,expand,"compact" | "inset",'compact',false,false
|
||||
ion-accordion-group,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-accordion-group,prop,multiple,boolean | undefined,undefined,false,false
|
||||
ion-accordion-group,prop,readonly,boolean,false,false,false
|
||||
ion-accordion-group,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-accordion-group,prop,value,null | string | string[] | undefined,undefined,false,false
|
||||
ion-accordion-group,event,ionChange,AccordionGroupChangeEventDetail<any>,true
|
||||
|
||||
@@ -33,6 +35,7 @@ ion-action-sheet,prop,keyboardClose,boolean,true,false,false
|
||||
ion-action-sheet,prop,leaveAnimation,((baseEl: any, opts?: any) => Animation) | undefined,undefined,false,false
|
||||
ion-action-sheet,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-action-sheet,prop,subHeader,string | undefined,undefined,false,false
|
||||
ion-action-sheet,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-action-sheet,prop,translucent,boolean,false,false,false
|
||||
ion-action-sheet,prop,trigger,string | undefined,undefined,false,false
|
||||
ion-action-sheet,method,dismiss,dismiss(data?: any, role?: string) => Promise<boolean>
|
||||
@@ -87,6 +90,7 @@ ion-alert,prop,leaveAnimation,((baseEl: any, opts?: any) => Animation) | undefin
|
||||
ion-alert,prop,message,IonicSafeString | string | undefined,undefined,false,false
|
||||
ion-alert,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-alert,prop,subHeader,string | undefined,undefined,false,false
|
||||
ion-alert,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-alert,prop,translucent,boolean,false,false,false
|
||||
ion-alert,prop,trigger,string | undefined,undefined,false,false
|
||||
ion-alert,method,dismiss,dismiss(data?: any, role?: string) => Promise<boolean>
|
||||
@@ -111,8 +115,12 @@ ion-alert,css-prop,--min-width
|
||||
ion-alert,css-prop,--width
|
||||
|
||||
ion-app,none
|
||||
ion-app,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-app,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
|
||||
ion-avatar,shadow
|
||||
ion-avatar,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-avatar,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-avatar,css-prop,--border-radius
|
||||
|
||||
ion-back-button,shadow
|
||||
@@ -123,6 +131,7 @@ ion-back-button,prop,icon,null | string | undefined,undefined,false,false
|
||||
ion-back-button,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-back-button,prop,routerAnimation,((baseEl: any, opts?: any) => Animation) | undefined,undefined,false,false
|
||||
ion-back-button,prop,text,null | string | undefined,undefined,false,false
|
||||
ion-back-button,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-back-button,prop,type,"button" | "reset" | "submit",'button',false,false
|
||||
ion-back-button,css-prop,--background
|
||||
ion-back-button,css-prop,--background-focused
|
||||
@@ -161,14 +170,17 @@ ion-back-button,part,native
|
||||
ion-back-button,part,text
|
||||
|
||||
ion-backdrop,shadow
|
||||
ion-backdrop,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-backdrop,prop,stopPropagation,boolean,true,false,false
|
||||
ion-backdrop,prop,tappable,boolean,true,false,false
|
||||
ion-backdrop,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-backdrop,prop,visible,boolean,true,false,false
|
||||
ion-backdrop,event,ionBackdropTap,void,true
|
||||
|
||||
ion-badge,shadow
|
||||
ion-badge,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-badge,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-badge,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-badge,css-prop,--background
|
||||
ion-badge,css-prop,--color
|
||||
ion-badge,css-prop,--padding-bottom
|
||||
@@ -188,6 +200,7 @@ ion-breadcrumb,prop,routerAnimation,((baseEl: any, opts?: any) => Animation) | u
|
||||
ion-breadcrumb,prop,routerDirection,"back" | "forward" | "root",'forward',false,false
|
||||
ion-breadcrumb,prop,separator,boolean | undefined,undefined,false,false
|
||||
ion-breadcrumb,prop,target,string | undefined,undefined,false,false
|
||||
ion-breadcrumb,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-breadcrumb,event,ionBlur,void,true
|
||||
ion-breadcrumb,event,ionFocus,void,true
|
||||
ion-breadcrumb,css-prop,--background-focused
|
||||
@@ -205,6 +218,7 @@ ion-breadcrumbs,prop,itemsAfterCollapse,number,1,false,false
|
||||
ion-breadcrumbs,prop,itemsBeforeCollapse,number,1,false,false
|
||||
ion-breadcrumbs,prop,maxItems,number | undefined,undefined,false,false
|
||||
ion-breadcrumbs,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-breadcrumbs,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-breadcrumbs,event,ionCollapsedClick,BreadcrumbCollapsedClickEventDetail,true
|
||||
|
||||
ion-button,shadow
|
||||
@@ -220,10 +234,11 @@ ion-button,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-button,prop,rel,string | undefined,undefined,false,false
|
||||
ion-button,prop,routerAnimation,((baseEl: any, opts?: any) => Animation) | undefined,undefined,false,false
|
||||
ion-button,prop,routerDirection,"back" | "forward" | "root",'forward',false,false
|
||||
ion-button,prop,shape,"round" | undefined,undefined,false,true
|
||||
ion-button,prop,size,"default" | "large" | "small" | undefined,undefined,false,true
|
||||
ion-button,prop,shape,"rectangular" | "round" | undefined,undefined,false,true
|
||||
ion-button,prop,size,"default" | "large" | "small" | "xlarge" | "xsmall" | undefined,undefined,false,true
|
||||
ion-button,prop,strong,boolean,false,false,false
|
||||
ion-button,prop,target,string | undefined,undefined,false,false
|
||||
ion-button,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-button,prop,type,"button" | "reset" | "submit",'button',false,false
|
||||
ion-button,event,ionBlur,void,true
|
||||
ion-button,event,ionFocus,void,true
|
||||
@@ -254,6 +269,8 @@ ion-button,part,native
|
||||
|
||||
ion-buttons,scoped
|
||||
ion-buttons,prop,collapse,boolean,false,false,false
|
||||
ion-buttons,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-buttons,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
|
||||
ion-card,shadow
|
||||
ion-card,prop,button,boolean,false,false,false
|
||||
@@ -266,6 +283,7 @@ ion-card,prop,rel,string | undefined,undefined,false,false
|
||||
ion-card,prop,routerAnimation,((baseEl: any, opts?: any) => Animation) | undefined,undefined,false,false
|
||||
ion-card,prop,routerDirection,"back" | "forward" | "root",'forward',false,false
|
||||
ion-card,prop,target,string | undefined,undefined,false,false
|
||||
ion-card,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-card,prop,type,"button" | "reset" | "submit",'button',false,false
|
||||
ion-card,css-prop,--background
|
||||
ion-card,css-prop,--color
|
||||
@@ -273,20 +291,24 @@ ion-card,part,native
|
||||
|
||||
ion-card-content,none
|
||||
ion-card-content,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-card-content,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
|
||||
ion-card-header,shadow
|
||||
ion-card-header,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-card-header,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-card-header,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-card-header,prop,translucent,boolean,false,false,false
|
||||
|
||||
ion-card-subtitle,shadow
|
||||
ion-card-subtitle,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-card-subtitle,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-card-subtitle,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-card-subtitle,css-prop,--color
|
||||
|
||||
ion-card-title,shadow
|
||||
ion-card-title,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-card-title,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-card-title,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-card-title,css-prop,--color
|
||||
|
||||
ion-checkbox,shadow
|
||||
@@ -299,6 +321,7 @@ ion-checkbox,prop,justify,"end" | "space-between" | "start",'space-between',fals
|
||||
ion-checkbox,prop,labelPlacement,"end" | "fixed" | "stacked" | "start",'start',false,false
|
||||
ion-checkbox,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-checkbox,prop,name,string,this.inputId,false,false
|
||||
ion-checkbox,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-checkbox,prop,value,any,'on',false,false
|
||||
ion-checkbox,event,ionBlur,void,true
|
||||
ion-checkbox,event,ionChange,CheckboxChangeEventDetail<any>,true
|
||||
@@ -323,10 +346,12 @@ ion-chip,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "second
|
||||
ion-chip,prop,disabled,boolean,false,false,false
|
||||
ion-chip,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-chip,prop,outline,boolean,false,false,false
|
||||
ion-chip,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-chip,css-prop,--background
|
||||
ion-chip,css-prop,--color
|
||||
|
||||
ion-col,shadow
|
||||
ion-col,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-col,prop,offset,string | undefined,undefined,false,false
|
||||
ion-col,prop,offsetLg,string | undefined,undefined,false,false
|
||||
ion-col,prop,offsetMd,string | undefined,undefined,false,false
|
||||
@@ -351,6 +376,7 @@ ion-col,prop,sizeMd,string | undefined,undefined,false,false
|
||||
ion-col,prop,sizeSm,string | undefined,undefined,false,false
|
||||
ion-col,prop,sizeXl,string | undefined,undefined,false,false
|
||||
ion-col,prop,sizeXs,string | undefined,undefined,false,false
|
||||
ion-col,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-col,css-prop,--ion-grid-column-padding
|
||||
ion-col,css-prop,--ion-grid-column-padding-lg
|
||||
ion-col,css-prop,--ion-grid-column-padding-md
|
||||
@@ -363,9 +389,11 @@ ion-content,shadow
|
||||
ion-content,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-content,prop,forceOverscroll,boolean | undefined,undefined,false,false
|
||||
ion-content,prop,fullscreen,boolean,false,false,false
|
||||
ion-content,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-content,prop,scrollEvents,boolean,false,false,false
|
||||
ion-content,prop,scrollX,boolean,false,false,false
|
||||
ion-content,prop,scrollY,boolean,true,false,false
|
||||
ion-content,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-content,method,getScrollElement,getScrollElement() => Promise<HTMLElement>
|
||||
ion-content,method,scrollByPoint,scrollByPoint(x: number, y: number, duration: number) => Promise<void>
|
||||
ion-content,method,scrollToBottom,scrollToBottom(duration?: number) => Promise<void>
|
||||
@@ -415,6 +443,7 @@ ion-datetime,prop,showDefaultButtons,boolean,false,false,false
|
||||
ion-datetime,prop,showDefaultTimeLabel,boolean,true,false,false
|
||||
ion-datetime,prop,showDefaultTitle,boolean,false,false,false
|
||||
ion-datetime,prop,size,"cover" | "fixed",'fixed',false,false
|
||||
ion-datetime,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-datetime,prop,titleSelectedDatesFormatter,((selectedDates: string[]) => string) | undefined,undefined,false,false
|
||||
ion-datetime,prop,value,null | string | string[] | undefined,undefined,false,false
|
||||
ion-datetime,prop,yearValues,number | number[] | string | undefined,undefined,false,false
|
||||
@@ -446,12 +475,15 @@ ion-datetime-button,prop,color,"danger" | "dark" | "light" | "medium" | "primary
|
||||
ion-datetime-button,prop,datetime,string | undefined,undefined,false,false
|
||||
ion-datetime-button,prop,disabled,boolean,false,false,true
|
||||
ion-datetime-button,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-datetime-button,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-datetime-button,part,native
|
||||
|
||||
ion-fab,shadow
|
||||
ion-fab,prop,activated,boolean,false,false,false
|
||||
ion-fab,prop,edge,boolean,false,false,false
|
||||
ion-fab,prop,horizontal,"center" | "end" | "start" | undefined,undefined,false,false
|
||||
ion-fab,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-fab,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-fab,prop,vertical,"bottom" | "center" | "top" | undefined,undefined,false,false
|
||||
ion-fab,method,close,close() => Promise<void>
|
||||
|
||||
@@ -469,6 +501,7 @@ ion-fab-button,prop,routerDirection,"back" | "forward" | "root",'forward',false,
|
||||
ion-fab-button,prop,show,boolean,false,false,false
|
||||
ion-fab-button,prop,size,"small" | undefined,undefined,false,false
|
||||
ion-fab-button,prop,target,string | undefined,undefined,false,false
|
||||
ion-fab-button,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-fab-button,prop,translucent,boolean,false,false,false
|
||||
ion-fab-button,prop,type,"button" | "reset" | "submit",'button',false,false
|
||||
ion-fab-button,event,ionBlur,void,true
|
||||
@@ -501,15 +534,20 @@ ion-fab-button,part,native
|
||||
|
||||
ion-fab-list,shadow
|
||||
ion-fab-list,prop,activated,boolean,false,false,false
|
||||
ion-fab-list,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-fab-list,prop,side,"bottom" | "end" | "start" | "top",'bottom',false,false
|
||||
ion-fab-list,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
|
||||
ion-footer,none
|
||||
ion-footer,prop,collapse,"fade" | undefined,undefined,false,false
|
||||
ion-footer,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-footer,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-footer,prop,translucent,boolean,false,false,false
|
||||
|
||||
ion-grid,shadow
|
||||
ion-grid,prop,fixed,boolean,false,false,false
|
||||
ion-grid,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-grid,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-grid,css-prop,--ion-grid-padding
|
||||
ion-grid,css-prop,--ion-grid-padding-lg
|
||||
ion-grid,css-prop,--ion-grid-padding-md
|
||||
@@ -526,11 +564,14 @@ ion-grid,css-prop,--ion-grid-width-xs
|
||||
ion-header,none
|
||||
ion-header,prop,collapse,"condense" | "fade" | undefined,undefined,false,false
|
||||
ion-header,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-header,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-header,prop,translucent,boolean,false,false,false
|
||||
|
||||
ion-img,shadow
|
||||
ion-img,prop,alt,string | undefined,undefined,false,false
|
||||
ion-img,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-img,prop,src,string | undefined,undefined,false,false
|
||||
ion-img,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-img,event,ionError,void,true
|
||||
ion-img,event,ionImgDidLoad,void,true
|
||||
ion-img,event,ionImgWillLoad,void,true
|
||||
@@ -538,7 +579,9 @@ ion-img,part,image
|
||||
|
||||
ion-infinite-scroll,none
|
||||
ion-infinite-scroll,prop,disabled,boolean,false,false,false
|
||||
ion-infinite-scroll,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-infinite-scroll,prop,position,"bottom" | "top",'bottom',false,false
|
||||
ion-infinite-scroll,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-infinite-scroll,prop,threshold,string,'15%',false,false
|
||||
ion-infinite-scroll,method,complete,complete() => Promise<void>
|
||||
ion-infinite-scroll,event,ionInfinite,void,true
|
||||
@@ -546,6 +589,8 @@ ion-infinite-scroll,event,ionInfinite,void,true
|
||||
ion-infinite-scroll-content,none
|
||||
ion-infinite-scroll-content,prop,loadingSpinner,"bubbles" | "circles" | "circular" | "crescent" | "dots" | "lines" | "lines-sharp" | "lines-sharp-small" | "lines-small" | null | undefined,undefined,false,false
|
||||
ion-infinite-scroll-content,prop,loadingText,IonicSafeString | string | undefined,undefined,false,false
|
||||
ion-infinite-scroll-content,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-infinite-scroll-content,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
|
||||
ion-input,scoped
|
||||
ion-input,prop,autocapitalize,string,'off',false,false
|
||||
@@ -580,6 +625,7 @@ ion-input,prop,required,boolean,false,false,false
|
||||
ion-input,prop,shape,"round" | undefined,undefined,false,false
|
||||
ion-input,prop,spellcheck,boolean,false,false,false
|
||||
ion-input,prop,step,string | undefined,undefined,false,false
|
||||
ion-input,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-input,prop,type,"date" | "datetime-local" | "email" | "month" | "number" | "password" | "search" | "tel" | "text" | "time" | "url" | "week",'text',false,false
|
||||
ion-input,prop,value,null | number | string | undefined,'',false,false
|
||||
ion-input,method,getInputElement,getInputElement() => Promise<HTMLInputElement>
|
||||
@@ -627,6 +673,7 @@ ion-item,prop,rel,string | undefined,undefined,false,false
|
||||
ion-item,prop,routerAnimation,((baseEl: any, opts?: any) => Animation) | undefined,undefined,false,false
|
||||
ion-item,prop,routerDirection,"back" | "forward" | "root",'forward',false,false
|
||||
ion-item,prop,target,string | undefined,undefined,false,false
|
||||
ion-item,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-item,prop,type,"button" | "reset" | "submit",'button',false,false
|
||||
ion-item,css-prop,--background
|
||||
ion-item,css-prop,--background-activated
|
||||
@@ -666,6 +713,7 @@ ion-item-divider,shadow
|
||||
ion-item-divider,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-item-divider,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-item-divider,prop,sticky,boolean,false,false,false
|
||||
ion-item-divider,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-item-divider,css-prop,--background
|
||||
ion-item-divider,css-prop,--color
|
||||
ion-item-divider,css-prop,--inner-padding-bottom
|
||||
@@ -678,6 +726,8 @@ ion-item-divider,css-prop,--padding-start
|
||||
ion-item-divider,css-prop,--padding-top
|
||||
|
||||
ion-item-group,none
|
||||
ion-item-group,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-item-group,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
|
||||
ion-item-option,shadow
|
||||
ion-item-option,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
@@ -688,17 +738,22 @@ ion-item-option,prop,href,string | undefined,undefined,false,false
|
||||
ion-item-option,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-item-option,prop,rel,string | undefined,undefined,false,false
|
||||
ion-item-option,prop,target,string | undefined,undefined,false,false
|
||||
ion-item-option,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-item-option,prop,type,"button" | "reset" | "submit",'button',false,false
|
||||
ion-item-option,css-prop,--background
|
||||
ion-item-option,css-prop,--color
|
||||
ion-item-option,part,native
|
||||
|
||||
ion-item-options,none
|
||||
ion-item-options,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-item-options,prop,side,"end" | "start",'end',false,false
|
||||
ion-item-options,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-item-options,event,ionSwipe,any,true
|
||||
|
||||
ion-item-sliding,none
|
||||
ion-item-sliding,prop,disabled,boolean,false,false,false
|
||||
ion-item-sliding,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-item-sliding,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-item-sliding,method,close,close() => Promise<void>
|
||||
ion-item-sliding,method,closeOpened,closeOpened() => Promise<boolean>
|
||||
ion-item-sliding,method,getOpenAmount,getOpenAmount() => Promise<number>
|
||||
@@ -710,18 +765,21 @@ ion-label,scoped
|
||||
ion-label,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-label,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-label,prop,position,"fixed" | "floating" | "stacked" | undefined,undefined,false,false
|
||||
ion-label,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-label,css-prop,--color
|
||||
|
||||
ion-list,none
|
||||
ion-list,prop,inset,boolean,false,false,false
|
||||
ion-list,prop,lines,"full" | "inset" | "none" | undefined,undefined,false,false
|
||||
ion-list,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-list,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-list,method,closeSlidingItems,closeSlidingItems() => Promise<boolean>
|
||||
|
||||
ion-list-header,shadow
|
||||
ion-list-header,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-list-header,prop,lines,"full" | "inset" | "none" | undefined,undefined,false,false
|
||||
ion-list-header,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-list-header,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-list-header,css-prop,--background
|
||||
ion-list-header,css-prop,--border-color
|
||||
ion-list-header,css-prop,--border-style
|
||||
@@ -743,6 +801,7 @@ ion-loading,prop,message,IonicSafeString | string | undefined,undefined,false,fa
|
||||
ion-loading,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-loading,prop,showBackdrop,boolean,true,false,false
|
||||
ion-loading,prop,spinner,"bubbles" | "circles" | "circular" | "crescent" | "dots" | "lines" | "lines-sharp" | "lines-sharp-small" | "lines-small" | null | undefined,undefined,false,false
|
||||
ion-loading,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-loading,prop,translucent,boolean,false,false,false
|
||||
ion-loading,prop,trigger,string | undefined,undefined,false,false
|
||||
ion-loading,method,dismiss,dismiss(data?: any, role?: string) => Promise<boolean>
|
||||
@@ -772,8 +831,10 @@ ion-menu,prop,contentId,string | undefined,undefined,false,true
|
||||
ion-menu,prop,disabled,boolean,false,false,false
|
||||
ion-menu,prop,maxEdgeStart,number,50,false,false
|
||||
ion-menu,prop,menuId,string | undefined,undefined,false,true
|
||||
ion-menu,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-menu,prop,side,"end" | "start",'start',false,true
|
||||
ion-menu,prop,swipeGesture,boolean,true,false,false
|
||||
ion-menu,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-menu,prop,type,"overlay" | "push" | "reveal" | undefined,undefined,false,false
|
||||
ion-menu,method,close,close(animated?: boolean) => Promise<boolean>
|
||||
ion-menu,method,isActive,isActive() => Promise<boolean>
|
||||
@@ -801,6 +862,7 @@ ion-menu-button,prop,color,"danger" | "dark" | "light" | "medium" | "primary" |
|
||||
ion-menu-button,prop,disabled,boolean,false,false,false
|
||||
ion-menu-button,prop,menu,string | undefined,undefined,false,false
|
||||
ion-menu-button,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-menu-button,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-menu-button,prop,type,"button" | "reset" | "submit",'button',false,false
|
||||
ion-menu-button,css-prop,--background
|
||||
ion-menu-button,css-prop,--background-focused
|
||||
@@ -821,6 +883,8 @@ ion-menu-button,part,native
|
||||
ion-menu-toggle,shadow
|
||||
ion-menu-toggle,prop,autoHide,boolean,true,false,false
|
||||
ion-menu-toggle,prop,menu,string | undefined,undefined,false,false
|
||||
ion-menu-toggle,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-menu-toggle,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
|
||||
ion-modal,shadow
|
||||
ion-modal,prop,animated,boolean,true,false,false
|
||||
@@ -840,6 +904,7 @@ ion-modal,prop,leaveAnimation,((baseEl: any, opts?: any) => Animation) | undefin
|
||||
ion-modal,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-modal,prop,presentingElement,HTMLElement | undefined,undefined,false,false
|
||||
ion-modal,prop,showBackdrop,boolean,true,false,false
|
||||
ion-modal,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-modal,prop,trigger,string | undefined,undefined,false,false
|
||||
ion-modal,method,dismiss,dismiss(data?: any, role?: string) => Promise<boolean>
|
||||
ion-modal,method,getCurrentBreakpoint,getCurrentBreakpoint() => Promise<number | undefined>
|
||||
@@ -875,9 +940,11 @@ ion-modal,part,handle
|
||||
ion-nav,shadow
|
||||
ion-nav,prop,animated,boolean,true,false,false
|
||||
ion-nav,prop,animation,((baseEl: any, opts?: any) => Animation) | undefined,undefined,false,false
|
||||
ion-nav,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-nav,prop,root,Function | HTMLElement | ViewController | null | string | undefined,undefined,false,false
|
||||
ion-nav,prop,rootParams,undefined | { [key: string]: any; },undefined,false,false
|
||||
ion-nav,prop,swipeGesture,boolean | undefined,undefined,false,false
|
||||
ion-nav,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-nav,method,canGoBack,canGoBack(view?: ViewController) => Promise<boolean>
|
||||
ion-nav,method,getActive,getActive() => Promise<ViewController | undefined>
|
||||
ion-nav,method,getByIndex,getByIndex(index: number) => Promise<ViewController | undefined>
|
||||
@@ -898,16 +965,20 @@ ion-nav,event,ionNavWillChange,void,false
|
||||
ion-nav-link,none
|
||||
ion-nav-link,prop,component,Function | HTMLElement | ViewController | null | string | undefined,undefined,false,false
|
||||
ion-nav-link,prop,componentProps,undefined | { [key: string]: any; },undefined,false,false
|
||||
ion-nav-link,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-nav-link,prop,routerAnimation,((baseEl: any, opts?: any) => Animation) | undefined,undefined,false,false
|
||||
ion-nav-link,prop,routerDirection,"back" | "forward" | "root",'forward',false,false
|
||||
ion-nav-link,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
|
||||
ion-note,shadow
|
||||
ion-note,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-note,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-note,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-note,css-prop,--color
|
||||
|
||||
ion-picker,shadow
|
||||
ion-picker,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-picker,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-picker,css-prop,--fade-background-rgb
|
||||
ion-picker,css-prop,--highlight-background
|
||||
ion-picker,css-prop,--highlight-border-radius
|
||||
@@ -916,6 +987,7 @@ ion-picker-column,shadow
|
||||
ion-picker-column,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,'primary',false,true
|
||||
ion-picker-column,prop,disabled,boolean,false,false,false
|
||||
ion-picker-column,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-picker-column,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-picker-column,prop,value,number | string | undefined,undefined,false,false
|
||||
ion-picker-column,method,setFocus,setFocus() => Promise<void>
|
||||
ion-picker-column,event,ionChange,PickerColumnChangeEventDetail,true
|
||||
@@ -923,6 +995,8 @@ ion-picker-column,event,ionChange,PickerColumnChangeEventDetail,true
|
||||
ion-picker-column-option,shadow
|
||||
ion-picker-column-option,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,'primary',false,true
|
||||
ion-picker-column-option,prop,disabled,boolean,false,false,false
|
||||
ion-picker-column-option,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-picker-column-option,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-picker-column-option,prop,value,any,undefined,false,false
|
||||
|
||||
ion-picker-legacy,scoped
|
||||
@@ -939,6 +1013,7 @@ ion-picker-legacy,prop,keyboardClose,boolean,true,false,false
|
||||
ion-picker-legacy,prop,leaveAnimation,((baseEl: any, opts?: any) => Animation) | undefined,undefined,false,false
|
||||
ion-picker-legacy,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-picker-legacy,prop,showBackdrop,boolean,true,false,false
|
||||
ion-picker-legacy,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-picker-legacy,prop,trigger,string | undefined,undefined,false,false
|
||||
ion-picker-legacy,method,dismiss,dismiss(data?: any, role?: string) => Promise<boolean>
|
||||
ion-picker-legacy,method,getColumn,getColumn(name: string) => Promise<PickerColumn | undefined>
|
||||
@@ -987,6 +1062,7 @@ ion-popover,prop,reference,"event" | "trigger",'trigger',false,false
|
||||
ion-popover,prop,showBackdrop,boolean,true,false,false
|
||||
ion-popover,prop,side,"bottom" | "end" | "left" | "right" | "start" | "top",'bottom',false,false
|
||||
ion-popover,prop,size,"auto" | "cover",'auto',false,false
|
||||
ion-popover,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-popover,prop,translucent,boolean,false,false,false
|
||||
ion-popover,prop,trigger,string | undefined,undefined,false,false
|
||||
ion-popover,prop,triggerAction,"click" | "context-menu" | "hover",'click',false,false
|
||||
@@ -1022,6 +1098,7 @@ ion-progress-bar,prop,buffer,number,1,false,false
|
||||
ion-progress-bar,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-progress-bar,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-progress-bar,prop,reversed,boolean,false,false,false
|
||||
ion-progress-bar,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-progress-bar,prop,type,"determinate" | "indeterminate",'determinate',false,false
|
||||
ion-progress-bar,prop,value,number,0,false,false
|
||||
ion-progress-bar,css-prop,--background
|
||||
@@ -1038,6 +1115,7 @@ ion-radio,prop,justify,"end" | "space-between" | "start",'space-between',false,f
|
||||
ion-radio,prop,labelPlacement,"end" | "fixed" | "stacked" | "start",'start',false,false
|
||||
ion-radio,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-radio,prop,name,string,this.inputId,false,false
|
||||
ion-radio,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-radio,prop,value,any,undefined,false,false
|
||||
ion-radio,event,ionBlur,void,true
|
||||
ion-radio,event,ionFocus,void,true
|
||||
@@ -1052,7 +1130,9 @@ ion-radio,part,mark
|
||||
ion-radio-group,none
|
||||
ion-radio-group,prop,allowEmptySelection,boolean,false,false,false
|
||||
ion-radio-group,prop,compareWith,((currentValue: any, compareValue: any) => boolean) | null | string | undefined,undefined,false,false
|
||||
ion-radio-group,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-radio-group,prop,name,string,this.inputId,false,false
|
||||
ion-radio-group,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-radio-group,prop,value,any,undefined,false,false
|
||||
ion-radio-group,event,ionChange,RadioGroupChangeEventDetail<any>,true
|
||||
|
||||
@@ -1072,6 +1152,7 @@ ion-range,prop,pin,boolean,false,false,false
|
||||
ion-range,prop,pinFormatter,(value: number) => string | number,(value: number): number => Math.round(value),false,false
|
||||
ion-range,prop,snaps,boolean,false,false,false
|
||||
ion-range,prop,step,number,1,false,false
|
||||
ion-range,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-range,prop,ticks,boolean,true,false,false
|
||||
ion-range,prop,value,number | { lower: number; upper: number; },0,false,false
|
||||
ion-range,event,ionBlur,void,true
|
||||
@@ -1107,6 +1188,7 @@ ion-refresher,prop,pullFactor,number,1,false,false
|
||||
ion-refresher,prop,pullMax,number,this.pullMin + 60,false,false
|
||||
ion-refresher,prop,pullMin,number,60,false,false
|
||||
ion-refresher,prop,snapbackDuration,string,'280ms',false,false
|
||||
ion-refresher,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-refresher,method,cancel,cancel() => Promise<void>
|
||||
ion-refresher,method,complete,complete() => Promise<void>
|
||||
ion-refresher,method,getProgress,getProgress() => Promise<number>
|
||||
@@ -1115,20 +1197,28 @@ ion-refresher,event,ionRefresh,RefresherEventDetail,true
|
||||
ion-refresher,event,ionStart,void,true
|
||||
|
||||
ion-refresher-content,none
|
||||
ion-refresher-content,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-refresher-content,prop,pullingIcon,null | string | undefined,undefined,false,false
|
||||
ion-refresher-content,prop,pullingText,IonicSafeString | string | undefined,undefined,false,false
|
||||
ion-refresher-content,prop,refreshingSpinner,"bubbles" | "circles" | "circular" | "crescent" | "dots" | "lines" | "lines-sharp" | "lines-sharp-small" | "lines-small" | null | undefined,undefined,false,false
|
||||
ion-refresher-content,prop,refreshingText,IonicSafeString | string | undefined,undefined,false,false
|
||||
ion-refresher-content,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
|
||||
ion-reorder,shadow
|
||||
ion-reorder,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-reorder,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-reorder,part,icon
|
||||
|
||||
ion-reorder-group,none
|
||||
ion-reorder-group,prop,disabled,boolean,true,false,false
|
||||
ion-reorder-group,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-reorder-group,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-reorder-group,method,complete,complete(listOrReorder?: boolean | any[]) => Promise<any>
|
||||
ion-reorder-group,event,ionItemReorder,ItemReorderEventDetail,true
|
||||
|
||||
ion-ripple-effect,shadow
|
||||
ion-ripple-effect,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-ripple-effect,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-ripple-effect,prop,type,"bounded" | "unbounded",'bounded',false,false
|
||||
ion-ripple-effect,method,addRipple,addRipple(x: number, y: number) => Promise<() => void>
|
||||
|
||||
@@ -1137,6 +1227,8 @@ ion-route,prop,beforeEnter,(() => NavigationHookResult | Promise<NavigationHookR
|
||||
ion-route,prop,beforeLeave,(() => NavigationHookResult | Promise<NavigationHookResult>) | undefined,undefined,false,false
|
||||
ion-route,prop,component,string,undefined,true,false
|
||||
ion-route,prop,componentProps,undefined | { [key: string]: any; },undefined,false,false
|
||||
ion-route,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-route,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-route,prop,url,string,'',false,false
|
||||
ion-route,event,ionRouteDataChanged,any,true
|
||||
|
||||
@@ -1146,7 +1238,9 @@ ion-route-redirect,prop,to,null | string | undefined,undefined,true,false
|
||||
ion-route-redirect,event,ionRouteRedirectChanged,any,true
|
||||
|
||||
ion-router,none
|
||||
ion-router,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-router,prop,root,string,'/',false,false
|
||||
ion-router,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-router,prop,useHash,boolean,true,false,false
|
||||
ion-router,method,back,back() => Promise<void>
|
||||
ion-router,method,push,push(path: string, direction?: RouterDirection, animation?: AnimationBuilder) => Promise<boolean>
|
||||
@@ -1156,10 +1250,12 @@ ion-router,event,ionRouteWillChange,RouterEventDetail,true
|
||||
ion-router-link,shadow
|
||||
ion-router-link,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-router-link,prop,href,string | undefined,undefined,false,false
|
||||
ion-router-link,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-router-link,prop,rel,string | undefined,undefined,false,false
|
||||
ion-router-link,prop,routerAnimation,((baseEl: any, opts?: any) => Animation) | undefined,undefined,false,false
|
||||
ion-router-link,prop,routerDirection,"back" | "forward" | "root",'forward',false,false
|
||||
ion-router-link,prop,target,string | undefined,undefined,false,false
|
||||
ion-router-link,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-router-link,css-prop,--background
|
||||
ion-router-link,css-prop,--color
|
||||
|
||||
@@ -1167,8 +1263,11 @@ ion-router-outlet,shadow
|
||||
ion-router-outlet,prop,animated,boolean,true,false,false
|
||||
ion-router-outlet,prop,animation,((baseEl: any, opts?: any) => Animation) | undefined,undefined,false,false
|
||||
ion-router-outlet,prop,mode,"ios" | "md",getIonMode(this),false,false
|
||||
ion-router-outlet,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
|
||||
ion-row,shadow
|
||||
ion-row,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-row,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
|
||||
ion-searchbar,scoped
|
||||
ion-searchbar,prop,animated,boolean,false,false,false
|
||||
@@ -1192,6 +1291,7 @@ ion-searchbar,prop,searchIcon,string | undefined,undefined,false,false
|
||||
ion-searchbar,prop,showCancelButton,"always" | "focus" | "never",'never',false,false
|
||||
ion-searchbar,prop,showClearButton,"always" | "focus" | "never",'always',false,false
|
||||
ion-searchbar,prop,spellcheck,boolean,false,false,false
|
||||
ion-searchbar,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-searchbar,prop,type,"email" | "number" | "password" | "search" | "tel" | "text" | "url",'search',false,false
|
||||
ion-searchbar,prop,value,null | string | undefined,'',false,false
|
||||
ion-searchbar,method,getInputElement,getInputElement() => Promise<HTMLInputElement>
|
||||
@@ -1221,6 +1321,7 @@ ion-segment,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-segment,prop,scrollable,boolean,false,false,false
|
||||
ion-segment,prop,selectOnFocus,boolean,false,false,false
|
||||
ion-segment,prop,swipeGesture,boolean,true,false,false
|
||||
ion-segment,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-segment,prop,value,number | string | undefined,undefined,false,false
|
||||
ion-segment,event,ionChange,SegmentChangeEventDetail,true
|
||||
ion-segment,css-prop,--background
|
||||
@@ -1229,6 +1330,7 @@ ion-segment-button,shadow
|
||||
ion-segment-button,prop,disabled,boolean,false,false,false
|
||||
ion-segment-button,prop,layout,"icon-bottom" | "icon-end" | "icon-hide" | "icon-start" | "icon-top" | "label-hide" | undefined,'icon-top',false,false
|
||||
ion-segment-button,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-segment-button,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-segment-button,prop,type,"button" | "reset" | "submit",'button',false,false
|
||||
ion-segment-button,prop,value,number | string,'ion-sb-' + ids++,false,false
|
||||
ion-segment-button,css-prop,--background
|
||||
@@ -1282,6 +1384,7 @@ ion-select,prop,okText,string,'OK',false,false
|
||||
ion-select,prop,placeholder,string | undefined,undefined,false,false
|
||||
ion-select,prop,selectedText,null | string | undefined,undefined,false,false
|
||||
ion-select,prop,shape,"round" | undefined,undefined,false,false
|
||||
ion-select,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-select,prop,toggleIcon,string | undefined,undefined,false,false
|
||||
ion-select,prop,value,any,undefined,false,false
|
||||
ion-select,method,open,open(event?: UIEvent) => Promise<any>
|
||||
@@ -1314,10 +1417,14 @@ ion-select,part,text
|
||||
|
||||
ion-select-option,shadow
|
||||
ion-select-option,prop,disabled,boolean,false,false,false
|
||||
ion-select-option,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-select-option,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-select-option,prop,value,any,undefined,false,false
|
||||
|
||||
ion-skeleton-text,shadow
|
||||
ion-skeleton-text,prop,animated,boolean,false,false,false
|
||||
ion-skeleton-text,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-skeleton-text,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-skeleton-text,css-prop,--background
|
||||
ion-skeleton-text,css-prop,--background-rgb
|
||||
ion-skeleton-text,css-prop,--border-radius
|
||||
@@ -1325,13 +1432,17 @@ ion-skeleton-text,css-prop,--border-radius
|
||||
ion-spinner,shadow
|
||||
ion-spinner,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-spinner,prop,duration,number | undefined,undefined,false,false
|
||||
ion-spinner,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-spinner,prop,name,"bubbles" | "circles" | "circular" | "crescent" | "dots" | "lines" | "lines-sharp" | "lines-sharp-small" | "lines-small" | undefined,undefined,false,false
|
||||
ion-spinner,prop,paused,boolean,false,false,false
|
||||
ion-spinner,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-spinner,css-prop,--color
|
||||
|
||||
ion-split-pane,shadow
|
||||
ion-split-pane,prop,contentId,string | undefined,undefined,false,true
|
||||
ion-split-pane,prop,disabled,boolean,false,false,false
|
||||
ion-split-pane,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-split-pane,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-split-pane,prop,when,boolean | string,QUERY['lg'],false,false
|
||||
ion-split-pane,event,ionSplitPaneVisible,{ visible: boolean; },true
|
||||
ion-split-pane,css-prop,--border
|
||||
@@ -1341,13 +1452,16 @@ ion-split-pane,css-prop,--side-width
|
||||
|
||||
ion-tab,shadow
|
||||
ion-tab,prop,component,Function | HTMLElement | null | string | undefined,undefined,false,false
|
||||
ion-tab,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-tab,prop,tab,string,undefined,true,false
|
||||
ion-tab,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-tab,method,setActive,setActive() => Promise<void>
|
||||
|
||||
ion-tab-bar,shadow
|
||||
ion-tab-bar,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-tab-bar,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-tab-bar,prop,selectedTab,string | undefined,undefined,false,false
|
||||
ion-tab-bar,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-tab-bar,prop,translucent,boolean,false,false,false
|
||||
ion-tab-bar,css-prop,--background
|
||||
ion-tab-bar,css-prop,--border
|
||||
@@ -1363,6 +1477,7 @@ ion-tab-button,prop,rel,string | undefined,undefined,false,false
|
||||
ion-tab-button,prop,selected,boolean,false,false,false
|
||||
ion-tab-button,prop,tab,string | undefined,undefined,false,false
|
||||
ion-tab-button,prop,target,string | undefined,undefined,false,false
|
||||
ion-tab-button,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-tab-button,css-prop,--background
|
||||
ion-tab-button,css-prop,--background-focused
|
||||
ion-tab-button,css-prop,--background-focused-opacity
|
||||
@@ -1377,6 +1492,8 @@ ion-tab-button,css-prop,--ripple-color
|
||||
ion-tab-button,part,native
|
||||
|
||||
ion-tabs,shadow
|
||||
ion-tabs,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-tabs,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-tabs,method,getSelected,getSelected() => Promise<string | undefined>
|
||||
ion-tabs,method,getTab,getTab(tab: string | HTMLIonTabElement) => Promise<HTMLIonTabElement | undefined>
|
||||
ion-tabs,method,select,select(tab: string | HTMLIonTabElement) => Promise<boolean>
|
||||
@@ -1386,6 +1503,7 @@ ion-tabs,event,ionTabsWillChange,{ tab: string; },false
|
||||
ion-text,shadow
|
||||
ion-text,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-text,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-text,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
|
||||
ion-textarea,scoped
|
||||
ion-textarea,prop,autoGrow,boolean,false,false,true
|
||||
@@ -1415,6 +1533,7 @@ ion-textarea,prop,required,boolean,false,false,false
|
||||
ion-textarea,prop,rows,number | undefined,undefined,false,false
|
||||
ion-textarea,prop,shape,"round" | undefined,undefined,false,false
|
||||
ion-textarea,prop,spellcheck,boolean,false,false,false
|
||||
ion-textarea,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-textarea,prop,value,null | string | undefined,'',false,false
|
||||
ion-textarea,prop,wrap,"hard" | "off" | "soft" | undefined,undefined,false,false
|
||||
ion-textarea,method,getInputElement,getInputElement() => Promise<HTMLTextAreaElement>
|
||||
@@ -1443,12 +1562,16 @@ ion-textarea,css-prop,--placeholder-font-weight
|
||||
ion-textarea,css-prop,--placeholder-opacity
|
||||
|
||||
ion-thumbnail,shadow
|
||||
ion-thumbnail,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-thumbnail,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-thumbnail,css-prop,--border-radius
|
||||
ion-thumbnail,css-prop,--size
|
||||
|
||||
ion-title,shadow
|
||||
ion-title,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-title,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-title,prop,size,"large" | "small" | undefined,undefined,false,false
|
||||
ion-title,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-title,css-prop,--color
|
||||
|
||||
ion-toast,shadow
|
||||
@@ -1470,6 +1593,7 @@ ion-toast,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-toast,prop,position,"bottom" | "middle" | "top",'bottom',false,false
|
||||
ion-toast,prop,positionAnchor,HTMLElement | string | undefined,undefined,false,false
|
||||
ion-toast,prop,swipeGesture,"vertical" | undefined,undefined,false,false
|
||||
ion-toast,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-toast,prop,translucent,boolean,false,false,false
|
||||
ion-toast,prop,trigger,string | undefined,undefined,false,false
|
||||
ion-toast,method,dismiss,dismiss(data?: any, role?: string) => Promise<boolean>
|
||||
@@ -1518,6 +1642,7 @@ ion-toggle,prop,justify,"end" | "space-between" | "start",'space-between',false,
|
||||
ion-toggle,prop,labelPlacement,"end" | "fixed" | "stacked" | "start",'start',false,false
|
||||
ion-toggle,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-toggle,prop,name,string,this.inputId,false,false
|
||||
ion-toggle,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-toggle,prop,value,null | string | undefined,'on',false,false
|
||||
ion-toggle,event,ionBlur,void,true
|
||||
ion-toggle,event,ionChange,ToggleChangeEventDetail<any>,true
|
||||
@@ -1541,6 +1666,7 @@ ion-toggle,part,track
|
||||
ion-toolbar,shadow
|
||||
ion-toolbar,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
|
||||
ion-toolbar,prop,mode,"ios" | "md",undefined,false,false
|
||||
ion-toolbar,prop,theme,"ios" | "md" | "ionic",undefined,false,false
|
||||
ion-toolbar,css-prop,--background
|
||||
ion-toolbar,css-prop,--border-color
|
||||
ion-toolbar,css-prop,--border-style
|
||||
@@ -1551,4 +1677,7 @@ ion-toolbar,css-prop,--opacity
|
||||
ion-toolbar,css-prop,--padding-bottom
|
||||
ion-toolbar,css-prop,--padding-end
|
||||
ion-toolbar,css-prop,--padding-start
|
||||
ion-toolbar,css-prop,--padding-top
|
||||
ion-toolbar,css-prop,--padding-top
|
||||
|
||||
test-header,scoped
|
||||
test-header,prop,testTitle,string | undefined,undefined,false,false
|
||||
1415
core/src/components.d.ts
vendored
@@ -2,18 +2,20 @@ import type { ComponentInterface, EventEmitter } from '@stencil/core';
|
||||
import { Component, Element, Event, Host, Listen, Method, Prop, Watch, h } from '@stencil/core';
|
||||
import { printIonWarning } from '@utils/logging';
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonTheme } from '../../global/ionic-global';
|
||||
|
||||
import type { AccordionGroupChangeEventDetail } from './accordion-group-interface';
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
*/
|
||||
@Component({
|
||||
tag: 'ion-accordion-group',
|
||||
styleUrls: {
|
||||
ios: 'accordion-group.ios.scss',
|
||||
md: 'accordion-group.md.scss',
|
||||
ionic: 'accordion-group.md.scss',
|
||||
},
|
||||
shadow: true,
|
||||
})
|
||||
@@ -279,12 +281,12 @@ export class AccordionGroup implements ComponentInterface {
|
||||
|
||||
render() {
|
||||
const { disabled, readonly, expand } = this;
|
||||
const mode = getIonMode(this);
|
||||
const theme = getIonTheme(this);
|
||||
|
||||
return (
|
||||
<Host
|
||||
class={{
|
||||
[mode]: true,
|
||||
[theme]: true,
|
||||
'accordion-group-disabled': disabled,
|
||||
'accordion-group-readonly': readonly,
|
||||
[`accordion-group-expand-${expand}`]: true,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { addEventListener, getElementRoot, raf, removeEventListener, transitionE
|
||||
import { chevronDown } from 'ionicons/icons';
|
||||
|
||||
import { config } from '../../global/config';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonTheme } from '../../global/ionic-global';
|
||||
|
||||
const enum AccordionState {
|
||||
Collapsed = 1 << 0,
|
||||
@@ -14,7 +14,8 @@ const enum AccordionState {
|
||||
}
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
*
|
||||
* @slot header - Content is placed at the top and is used to
|
||||
* expand or collapse the accordion item.
|
||||
@@ -31,6 +32,7 @@ const enum AccordionState {
|
||||
styleUrls: {
|
||||
ios: 'accordion.ios.scss',
|
||||
md: 'accordion.md.scss',
|
||||
ionic: 'accordion.md.scss',
|
||||
},
|
||||
shadow: {
|
||||
delegatesFocus: true,
|
||||
@@ -402,7 +404,7 @@ export class Accordion implements ComponentInterface {
|
||||
|
||||
render() {
|
||||
const { disabled, readonly } = this;
|
||||
const mode = getIonMode(this);
|
||||
const theme = getIonTheme(this);
|
||||
const expanded = this.state === AccordionState.Expanded || this.state === AccordionState.Expanding;
|
||||
const headerPart = expanded ? 'header expanded' : 'header';
|
||||
const contentPart = expanded ? 'content expanded' : 'content';
|
||||
@@ -412,7 +414,7 @@ export class Accordion implements ComponentInterface {
|
||||
return (
|
||||
<Host
|
||||
class={{
|
||||
[mode]: true,
|
||||
[theme]: true,
|
||||
'accordion-expanding': this.state === AccordionState.Expanding,
|
||||
'accordion-expanded': this.state === AccordionState.Expanded,
|
||||
'accordion-collapsing': this.state === AccordionState.Collapsing,
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
import type { AnimationBuilder, LiteralUnion, Mode } from '../../interface';
|
||||
import type { OverlayOptions } from '@utils/overlays-interface';
|
||||
|
||||
export interface ActionSheetOptions {
|
||||
import type { LiteralUnion } from '../../interface';
|
||||
|
||||
export interface ActionSheetOptions extends OverlayOptions {
|
||||
header?: string;
|
||||
subHeader?: string;
|
||||
cssClass?: string | string[];
|
||||
buttons: (ActionSheetButton | string)[];
|
||||
backdropDismiss?: boolean;
|
||||
translucent?: boolean;
|
||||
animated?: boolean;
|
||||
mode?: Mode;
|
||||
keyboardClose?: boolean;
|
||||
id?: string;
|
||||
htmlAttributes?: { [key: string]: any };
|
||||
|
||||
enterAnimation?: AnimationBuilder;
|
||||
leaveAnimation?: AnimationBuilder;
|
||||
}
|
||||
|
||||
export interface ActionSheetButton<T = any> {
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
} from '@utils/overlays';
|
||||
import { getClassMap } from '@utils/theme';
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonMode, getIonTheme } from '../../global/ionic-global';
|
||||
import type { AnimationBuilder, CssClassMap, FrameworkDelegate, OverlayInterface } from '../../interface';
|
||||
import type { OverlayEventDetail } from '../../utils/overlays-interface';
|
||||
|
||||
@@ -29,13 +29,15 @@ import { mdEnterAnimation } from './animations/md.enter';
|
||||
import { mdLeaveAnimation } from './animations/md.leave';
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
*/
|
||||
@Component({
|
||||
tag: 'ion-action-sheet',
|
||||
styleUrls: {
|
||||
ios: 'action-sheet.ios.scss',
|
||||
md: 'action-sheet.md.scss',
|
||||
ionic: 'action-sheet.md.scss',
|
||||
},
|
||||
scoped: true,
|
||||
})
|
||||
@@ -105,7 +107,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
|
||||
|
||||
/**
|
||||
* If `true`, the action sheet will be translucent.
|
||||
* Only applies when the mode is `"ios"` and the device supports
|
||||
* Only applies when the theme is `"ios"` and the device supports
|
||||
* [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility).
|
||||
*/
|
||||
@Prop() translucent = false;
|
||||
@@ -314,6 +316,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
|
||||
}
|
||||
|
||||
componentDidLoad() {
|
||||
const mode = getIonMode(this);
|
||||
/**
|
||||
* Only create gesture if:
|
||||
* 1. A gesture does not already exist
|
||||
@@ -322,7 +325,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
|
||||
* 4. A group ref exists
|
||||
*/
|
||||
const { groupEl, wrapperEl } = this;
|
||||
if (!this.gesture && getIonMode(this) === 'ios' && wrapperEl && groupEl) {
|
||||
if (!this.gesture && mode === 'ios' && wrapperEl && groupEl) {
|
||||
readTask(() => {
|
||||
const isScrollable = groupEl.scrollHeight > groupEl.clientHeight;
|
||||
if (!isScrollable) {
|
||||
@@ -356,7 +359,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
|
||||
|
||||
render() {
|
||||
const { header, htmlAttributes, overlayIndex } = this;
|
||||
const mode = getIonMode(this);
|
||||
const theme = getIonTheme(this);
|
||||
const allButtons = this.getButtons();
|
||||
const cancelButton = allButtons.find((b) => b.role === 'cancel');
|
||||
const buttons = allButtons.filter((b) => b.role !== 'cancel');
|
||||
@@ -373,7 +376,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
|
||||
zIndex: `${20000 + this.overlayIndex}`,
|
||||
}}
|
||||
class={{
|
||||
[mode]: true,
|
||||
[theme]: true,
|
||||
...getClassMap(this.cssClass),
|
||||
'overlay-hidden': true,
|
||||
'action-sheet-translucent': this.translucent,
|
||||
@@ -413,7 +416,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
|
||||
{b.icon && <ion-icon icon={b.icon} aria-hidden="true" lazy={false} class="action-sheet-icon" />}
|
||||
{b.text}
|
||||
</span>
|
||||
{mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||
{theme === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
@@ -437,7 +440,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
|
||||
)}
|
||||
{cancelButton.text}
|
||||
</span>
|
||||
{mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||
{theme === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import type { AnimationBuilder, LiteralUnion, Mode, TextFieldTypes } from '../../interface';
|
||||
import type { OverlayOptions } from '@utils/overlays-interface';
|
||||
|
||||
import type { LiteralUnion, TextFieldTypes } from '../../interface';
|
||||
import type { IonicSafeString } from '../../utils/sanitization';
|
||||
|
||||
export interface AlertOptions {
|
||||
export interface AlertOptions extends OverlayOptions {
|
||||
header?: string;
|
||||
subHeader?: string;
|
||||
message?: string | IonicSafeString;
|
||||
@@ -10,15 +12,9 @@ export interface AlertOptions {
|
||||
buttons?: (AlertButton | string)[];
|
||||
backdropDismiss?: boolean;
|
||||
translucent?: boolean;
|
||||
animated?: boolean;
|
||||
htmlAttributes?: { [key: string]: any };
|
||||
|
||||
mode?: Mode;
|
||||
keyboardClose?: boolean;
|
||||
id?: string;
|
||||
|
||||
enterAnimation?: AnimationBuilder;
|
||||
leaveAnimation?: AnimationBuilder;
|
||||
}
|
||||
|
||||
export interface AlertInput {
|
||||
|
||||
@@ -21,7 +21,7 @@ import { sanitizeDOMString } from '@utils/sanitization';
|
||||
import { getClassMap } from '@utils/theme';
|
||||
|
||||
import { config } from '../../global/config';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonMode, getIonTheme } from '../../global/ionic-global';
|
||||
import type { AnimationBuilder, CssClassMap, OverlayInterface, FrameworkDelegate } from '../../interface';
|
||||
import type { OverlayEventDetail } from '../../utils/overlays-interface';
|
||||
import type { IonicSafeString } from '../../utils/sanitization';
|
||||
@@ -35,13 +35,15 @@ import { mdLeaveAnimation } from './animations/md.leave';
|
||||
// TODO(FW-2832): types
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
*/
|
||||
@Component({
|
||||
tag: 'ion-alert',
|
||||
styleUrls: {
|
||||
ios: 'alert.ios.scss',
|
||||
md: 'alert.md.scss',
|
||||
ionic: 'alert.md.scss',
|
||||
},
|
||||
scoped: true,
|
||||
})
|
||||
@@ -135,7 +137,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
||||
|
||||
/**
|
||||
* If `true`, the alert will be translucent.
|
||||
* Only applies when the mode is `"ios"` and the device supports
|
||||
* Only applies when the theme is `"ios"` and the device supports
|
||||
* [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility).
|
||||
*/
|
||||
@Prop() translucent = false;
|
||||
@@ -533,7 +535,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
||||
|
||||
private renderCheckbox() {
|
||||
const inputs = this.processedInputs;
|
||||
const mode = getIonMode(this);
|
||||
const theme = getIonTheme(this);
|
||||
|
||||
if (inputs.length === 0) {
|
||||
return null;
|
||||
@@ -565,7 +567,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
||||
</div>
|
||||
<div class="alert-checkbox-label">{i.label}</div>
|
||||
</div>
|
||||
{mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||
{theme === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
@@ -682,7 +684,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
||||
|
||||
private renderAlertButtons() {
|
||||
const buttons = this.processedButtons;
|
||||
const mode = getIonMode(this);
|
||||
const theme = getIonTheme(this);
|
||||
const alertButtonGroupClass = {
|
||||
'alert-button-group': true,
|
||||
'alert-button-group-vertical': buttons.length > 2,
|
||||
@@ -699,7 +701,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
||||
onClick={() => this.buttonClick(button)}
|
||||
>
|
||||
<span class="alert-button-inner">{button.text}</span>
|
||||
{mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||
{theme === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
@@ -721,7 +723,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
||||
|
||||
render() {
|
||||
const { overlayIndex, header, subHeader, message, htmlAttributes } = this;
|
||||
const mode = getIonMode(this);
|
||||
const theme = getIonTheme(this);
|
||||
const hdrId = `alert-${overlayIndex}-hdr`;
|
||||
const subHdrId = `alert-${overlayIndex}-sub-hdr`;
|
||||
const msgId = `alert-${overlayIndex}-msg`;
|
||||
@@ -746,7 +748,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
||||
}}
|
||||
class={{
|
||||
...getClassMap(this.cssClass),
|
||||
[mode]: true,
|
||||
[theme]: true,
|
||||
'overlay-hidden': true,
|
||||
'alert-translucent': this.translucent,
|
||||
}}
|
||||
|
||||
@@ -6,8 +6,12 @@ import { printIonWarning } from '@utils/logging';
|
||||
import { isPlatform } from '@utils/platform';
|
||||
|
||||
import { config } from '../../global/config';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonTheme } from '../../global/ionic-global';
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
*/
|
||||
@Component({
|
||||
tag: 'ion-app',
|
||||
styleUrl: 'app.scss',
|
||||
@@ -78,11 +82,11 @@ export class App implements ComponentInterface {
|
||||
}
|
||||
|
||||
render() {
|
||||
const mode = getIonMode(this);
|
||||
const theme = getIonTheme(this);
|
||||
return (
|
||||
<Host
|
||||
class={{
|
||||
[mode]: true,
|
||||
[theme]: true,
|
||||
'ion-page': true,
|
||||
'force-statusbar-padding': config.getBoolean('_forceStatusbarPadding'),
|
||||
}}
|
||||
|
||||
@@ -1,20 +1,30 @@
|
||||
import type { ComponentInterface } from '@stencil/core';
|
||||
import { Component, Host, h } from '@stencil/core';
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonTheme } from '../../global/ionic-global';
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
*/
|
||||
@Component({
|
||||
tag: 'ion-avatar',
|
||||
styleUrls: {
|
||||
ios: 'avatar.ios.scss',
|
||||
md: 'avatar.md.scss',
|
||||
ionic: 'avatar.md.scss',
|
||||
},
|
||||
shadow: true,
|
||||
})
|
||||
export class Avatar implements ComponentInterface {
|
||||
render() {
|
||||
const theme = getIonTheme(this);
|
||||
return (
|
||||
<Host class={getIonMode(this)}>
|
||||
<Host
|
||||
class={{
|
||||
[theme]: true,
|
||||
}}
|
||||
>
|
||||
<slot></slot>
|
||||
</Host>
|
||||
);
|
||||
|
||||
@@ -7,11 +7,12 @@ import { createColorClasses, hostContext, openURL } from '@utils/theme';
|
||||
import { arrowBackSharp, chevronBack } from 'ionicons/icons';
|
||||
|
||||
import { config } from '../../global/config';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonTheme } from '../../global/ionic-global';
|
||||
import type { AnimationBuilder, Color } from '../../interface';
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
*
|
||||
* @part native - The native HTML button element that wraps all child elements.
|
||||
* @part icon - The back button icon (uses ion-icon).
|
||||
@@ -22,6 +23,7 @@ import type { AnimationBuilder, Color } from '../../interface';
|
||||
styleUrls: {
|
||||
ios: 'back-button.ios.scss',
|
||||
md: 'back-button.md.scss',
|
||||
ionic: 'back-button.md.scss',
|
||||
},
|
||||
shadow: true,
|
||||
})
|
||||
@@ -84,7 +86,7 @@ export class BackButton implements ComponentInterface, ButtonInterface {
|
||||
return icon;
|
||||
}
|
||||
|
||||
if (getIonMode(this) === 'ios') {
|
||||
if (getIonTheme(this) === 'ios') {
|
||||
// default ios back button icon
|
||||
return config.get('backButtonIcon', chevronBack);
|
||||
}
|
||||
@@ -94,7 +96,7 @@ export class BackButton implements ComponentInterface, ButtonInterface {
|
||||
}
|
||||
|
||||
get backButtonText() {
|
||||
const defaultBackButtonText = getIonMode(this) === 'ios' ? 'Back' : null;
|
||||
const defaultBackButtonText = getIonTheme(this) === 'ios' ? 'Back' : null;
|
||||
return this.text != null ? this.text : config.get('backButtonText', defaultBackButtonText);
|
||||
}
|
||||
|
||||
@@ -135,14 +137,14 @@ export class BackButton implements ComponentInterface, ButtonInterface {
|
||||
inheritedAttributes,
|
||||
} = this;
|
||||
const showBackButton = defaultHref !== undefined;
|
||||
const mode = getIonMode(this);
|
||||
const theme = getIonTheme(this);
|
||||
const ariaLabel = inheritedAttributes['aria-label'] || backButtonText || 'back';
|
||||
|
||||
return (
|
||||
<Host
|
||||
onClick={this.onClick}
|
||||
class={createColorClasses(color, {
|
||||
[mode]: true,
|
||||
[theme]: true,
|
||||
button: true, // ion-buttons target .button
|
||||
'back-button-disabled': disabled,
|
||||
'back-button-has-icon-only': hasIconOnly,
|
||||
@@ -170,7 +172,7 @@ export class BackButton implements ComponentInterface, ButtonInterface {
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
{mode === 'md' && <ion-ripple-effect type={this.rippleType}></ion-ripple-effect>}
|
||||
{theme === 'md' && <ion-ripple-effect type={this.rippleType}></ion-ripple-effect>}
|
||||
</button>
|
||||
</Host>
|
||||
);
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
import type { ComponentInterface, EventEmitter } from '@stencil/core';
|
||||
import { Component, Event, Host, Listen, Prop, h } from '@stencil/core';
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonTheme } from '../../global/ionic-global';
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
*/
|
||||
@Component({
|
||||
tag: 'ion-backdrop',
|
||||
styleUrls: {
|
||||
ios: 'backdrop.ios.scss',
|
||||
md: 'backdrop.md.scss',
|
||||
ionic: 'backdrop.md.scss',
|
||||
},
|
||||
shadow: true,
|
||||
})
|
||||
@@ -48,13 +53,13 @@ export class Backdrop implements ComponentInterface {
|
||||
}
|
||||
|
||||
render() {
|
||||
const mode = getIonMode(this);
|
||||
const theme = getIonTheme(this);
|
||||
return (
|
||||
<Host
|
||||
tabindex="-1"
|
||||
aria-hidden="true"
|
||||
class={{
|
||||
[mode]: true,
|
||||
[theme]: true,
|
||||
'backdrop-hide': !this.visible,
|
||||
'backdrop-no-tappable': !this.tappable,
|
||||
}}
|
||||
|
||||
@@ -2,17 +2,19 @@ import type { ComponentInterface } from '@stencil/core';
|
||||
import { Component, Host, Prop, h } from '@stencil/core';
|
||||
import { createColorClasses } from '@utils/theme';
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonTheme } from '../../global/ionic-global';
|
||||
import type { Color } from '../../interface';
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
*/
|
||||
@Component({
|
||||
tag: 'ion-badge',
|
||||
styleUrls: {
|
||||
ios: 'badge.ios.scss',
|
||||
md: 'badge.md.scss',
|
||||
ionic: 'badge.md.scss',
|
||||
},
|
||||
shadow: true,
|
||||
})
|
||||
@@ -25,11 +27,11 @@ export class Badge implements ComponentInterface {
|
||||
@Prop({ reflect: true }) color?: Color;
|
||||
|
||||
render() {
|
||||
const mode = getIonMode(this);
|
||||
const theme = getIonTheme(this);
|
||||
return (
|
||||
<Host
|
||||
class={createColorClasses(this.color, {
|
||||
[mode]: true,
|
||||
[theme]: true,
|
||||
})}
|
||||
>
|
||||
<slot></slot>
|
||||
|
||||
@@ -5,14 +5,15 @@ import { inheritAriaAttributes } from '@utils/helpers';
|
||||
import { createColorClasses, hostContext, openURL } from '@utils/theme';
|
||||
import { chevronForwardOutline, ellipsisHorizontal } from 'ionicons/icons';
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonTheme } from '../../global/ionic-global';
|
||||
import type { AnimationBuilder, Color } from '../../interface';
|
||||
import type { RouterDirection } from '../router/utils/interface';
|
||||
|
||||
import type { BreadcrumbCollapsedClickEventDetail } from './breadcrumb-interface';
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
*
|
||||
* @part native - The native HTML anchor or div element that wraps all child elements.
|
||||
* @part separator - The separator element between each breadcrumb.
|
||||
@@ -23,6 +24,7 @@ import type { BreadcrumbCollapsedClickEventDetail } from './breadcrumb-interface
|
||||
styleUrls: {
|
||||
ios: 'breadcrumb.ios.scss',
|
||||
md: 'breadcrumb.md.scss',
|
||||
ionic: 'breadcrumb.md.scss',
|
||||
},
|
||||
shadow: true,
|
||||
})
|
||||
@@ -168,7 +170,7 @@ export class Breadcrumb implements ComponentInterface {
|
||||
// Links can still be tabbed to when set to disabled if they have an href
|
||||
// in order to truly disable them we can keep it as an anchor but remove the href
|
||||
const href = disabled ? undefined : this.href;
|
||||
const mode = getIonMode(this);
|
||||
const theme = getIonTheme(this);
|
||||
const attrs =
|
||||
TagType === 'span'
|
||||
? {}
|
||||
@@ -188,7 +190,7 @@ export class Breadcrumb implements ComponentInterface {
|
||||
onClick={(ev: Event) => openURL(href, ev, routerDirection, routerAnimation)}
|
||||
aria-disabled={disabled ? 'true' : null}
|
||||
class={createColorClasses(color, {
|
||||
[mode]: true,
|
||||
[theme]: true,
|
||||
'breadcrumb-active': active,
|
||||
'breadcrumb-collapsed': collapsed,
|
||||
'breadcrumb-disabled': disabled,
|
||||
@@ -233,7 +235,7 @@ export class Breadcrumb implements ComponentInterface {
|
||||
*/
|
||||
<span class="breadcrumb-separator" part="separator" aria-hidden="true">
|
||||
<slot name="separator">
|
||||
{mode === 'ios' ? (
|
||||
{theme === 'ios' ? (
|
||||
<ion-icon icon={chevronForwardOutline} lazy={false} flip-rtl></ion-icon>
|
||||
) : (
|
||||
<span>/</span>
|
||||
|
||||
@@ -2,19 +2,20 @@ import type { ComponentInterface, EventEmitter } from '@stencil/core';
|
||||
import { Component, Element, Event, Host, Listen, Prop, State, Watch, h } from '@stencil/core';
|
||||
import { createColorClasses, hostContext } from '@utils/theme';
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonTheme } from '../../global/ionic-global';
|
||||
import type { Color } from '../../interface';
|
||||
import type { BreadcrumbCollapsedClickEventDetail } from '../breadcrumb/breadcrumb-interface';
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
*
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
*/
|
||||
@Component({
|
||||
tag: 'ion-breadcrumbs',
|
||||
styleUrls: {
|
||||
ios: 'breadcrumbs.ios.scss',
|
||||
md: 'breadcrumbs.md.scss',
|
||||
ionic: 'breadcrumbs.md.scss',
|
||||
},
|
||||
shadow: true,
|
||||
})
|
||||
@@ -170,12 +171,12 @@ export class Breadcrumbs implements ComponentInterface {
|
||||
|
||||
render() {
|
||||
const { color, collapsed } = this;
|
||||
const mode = getIonMode(this);
|
||||
const theme = getIonTheme(this);
|
||||
|
||||
return (
|
||||
<Host
|
||||
class={createColorClasses(color, {
|
||||
[mode]: true,
|
||||
[theme]: true,
|
||||
'in-toolbar': hostContext('ion-toolbar', this.el),
|
||||
'in-toolbar-color': hostContext('ion-toolbar[color]', this.el),
|
||||
'breadcrumbs-collapsed': collapsed,
|
||||
|
||||
220
core/src/components/button/button.ionic.scss
Normal file
@@ -0,0 +1,220 @@
|
||||
@import "./button";
|
||||
@import "./button.ionic.vars";
|
||||
|
||||
// Ionic Button
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
:host {
|
||||
--border-radius: #{$button-ionic-border-radius};
|
||||
--padding-bottom: var(--padding-top);
|
||||
--padding-end: #{$button-ionic-padding-end};
|
||||
--padding-start: var(--padding-end);
|
||||
--padding-top: #{$button-ionic-padding-top};
|
||||
--focus-ring-color: #9ec4fd;
|
||||
--focus-ring-width: 2px;
|
||||
|
||||
position: relative;
|
||||
|
||||
min-height: #{$button-ionic-min-height};
|
||||
|
||||
font-size: #{$button-ionic-font-size};
|
||||
|
||||
// Target area
|
||||
&::after {
|
||||
@include position(50%, 0, null, 0);
|
||||
position: absolute;
|
||||
|
||||
height: 100%;
|
||||
min-height: px-to-rem(48);
|
||||
|
||||
transform: translateY(-50%);
|
||||
|
||||
content: "";
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
::slotted(ion-icon[slot="start"]) {
|
||||
@include margin-horizontal(null, px-to-rem(8));
|
||||
}
|
||||
|
||||
::slotted(ion-icon[slot="end"]) {
|
||||
@include margin-horizontal(px-to-rem(8), null);
|
||||
}
|
||||
}
|
||||
|
||||
// Button Sizes
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
/* Extra Small and Small Button */
|
||||
:host(.button-xsmall),
|
||||
:host(.button-small) {
|
||||
::slotted(ion-icon[slot="start"]) {
|
||||
@include margin-horizontal(null, px-to-rem(4));
|
||||
}
|
||||
|
||||
::slotted(ion-icon[slot="end"]) {
|
||||
@include margin-horizontal(px-to-rem(4), null);
|
||||
}
|
||||
}
|
||||
|
||||
/* Extra Small Button */
|
||||
:host(.button-xsmall) {
|
||||
--border-radius: #{$button-ionic-xsmall-border-radius};
|
||||
--padding-top: #{$button-ionic-xsmall-padding-top};
|
||||
--padding-end: #{$button-ionic-xsmall-padding-end};
|
||||
|
||||
min-height: #{$button-ionic-xsmall-min-height};
|
||||
|
||||
font-size: #{$button-ionic-xsmall-font-size};
|
||||
}
|
||||
|
||||
/* Small Button */
|
||||
:host(.button-small) {
|
||||
--border-radius: #{$button-ionic-small-border-radius};
|
||||
--padding-top: #{$button-ionic-small-padding-top};
|
||||
--padding-end: #{$button-ionic-small-padding-end};
|
||||
|
||||
min-height: #{$button-ionic-small-min-height};
|
||||
|
||||
font-size: #{$button-ionic-small-font-size};
|
||||
}
|
||||
|
||||
/* Large Button */
|
||||
:host(.button-large) {
|
||||
--padding-top: #{$button-ionic-large-padding-top};
|
||||
--padding-end: #{$button-ionic-large-padding-end};
|
||||
|
||||
min-height: #{$button-ionic-large-min-height};
|
||||
|
||||
font-size: #{$button-ionic-large-font-size};
|
||||
}
|
||||
|
||||
/* Extra Large Button */
|
||||
:host(.button-xlarge) {
|
||||
--padding-top: #{$button-ionic-xlarge-padding-top};
|
||||
--padding-end: #{$button-ionic-xlarge-padding-end};
|
||||
|
||||
min-height: #{$button-ionic-xlarge-min-height};
|
||||
|
||||
font-size: #{$button-ionic-xlarge-font-size};
|
||||
}
|
||||
|
||||
// Button with Icons
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
/* Button containing only an icon */
|
||||
::slotted(ion-icon[slot="start"]),
|
||||
::slotted(ion-icon[slot="end"]),
|
||||
::slotted(ion-icon[slot="icon-only"]) {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/* Button extra small */
|
||||
:host(.button-has-icon-only.button-xsmall) {
|
||||
--padding-end: #{$button-has-icon-only-padding-end-xsmall};
|
||||
}
|
||||
|
||||
/* Button small */
|
||||
:host(.button-has-icon-only.button-small) {
|
||||
--padding-end: #{$button-has-icon-only-padding-end-small};
|
||||
}
|
||||
|
||||
/* Default */
|
||||
:host(.button-has-icon-only) {
|
||||
--padding-end: #{$button-has-icon-only-padding-end};
|
||||
}
|
||||
|
||||
/* Button large */
|
||||
:host(.button-has-icon-only.button-large) {
|
||||
--padding-end: #{$button-has-icon-only-padding-end-large};
|
||||
}
|
||||
|
||||
/* Button extra large */
|
||||
:host(.button-has-icon-only.button-xlarge) {
|
||||
--padding-end: #{$button-has-icon-only-padding-end-xlarge};
|
||||
}
|
||||
|
||||
// Button Shapes
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
// Button Shape Rectangular
|
||||
// -------------------------------------------------------------------------------
|
||||
:host(.button-rectangular) {
|
||||
--border-radius: #{$button-ionic-rectangular-border};
|
||||
}
|
||||
|
||||
// Button Shape Round
|
||||
// -------------------------------------------------------------------------------
|
||||
:host(.button-round) {
|
||||
--border-radius: #{$button-ionic-round-border};
|
||||
}
|
||||
|
||||
// Button Focused
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
// Only show the focus ring when the button is focused
|
||||
:host(.ion-focused) .button-native {
|
||||
outline: var(--focus-ring-width) solid var(--focus-ring-color);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
// Fill Solid Button
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
:host(.button-solid) {
|
||||
--background-activated: #{ion-color(primary, shade)};
|
||||
}
|
||||
|
||||
// Fill Outline Button
|
||||
// --------------------------------------------------
|
||||
|
||||
:host(.button-outline) {
|
||||
--border-width: #{$button-ionic-outline-border-width};
|
||||
--border-style: #{$button-ionic-outline-border-style};
|
||||
--background-activated: #e3e3e3;
|
||||
--background-activated-opacity: 1;
|
||||
--background-focused: transparent;
|
||||
--background-hover: transparent;
|
||||
--background-focused-opacity: 0.1;
|
||||
--color-activated: #{ion-color(primary, base)};
|
||||
}
|
||||
|
||||
:host(.button-outline.ion-focused) {
|
||||
--border-color: transparent;
|
||||
}
|
||||
|
||||
// Fill Clear Button
|
||||
// --------------------------------------------------
|
||||
|
||||
:host(.button-clear) {
|
||||
--background-activated: #e3e3e3;
|
||||
--background-activated-opacity: 1;
|
||||
--background-focused: transparent;
|
||||
--background-hover: transparent;
|
||||
}
|
||||
|
||||
// Button Hover
|
||||
// --------------------------------------------------
|
||||
|
||||
:host(.button-outline),
|
||||
:host(.button-clear) {
|
||||
--background-hover: #121212;
|
||||
--background-hover-opacity: 0.04;
|
||||
}
|
||||
|
||||
// Button: Disabled
|
||||
// --------------------------------------------------
|
||||
|
||||
:host(.button-disabled) {
|
||||
--color: #c9c9c9;
|
||||
--border-color: var(--color);
|
||||
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
:host(.button-solid.button-disabled) {
|
||||
--background: #f5f5f5;
|
||||
}
|
||||
164
core/src/components/button/button.ionic.vars.scss
Normal file
@@ -0,0 +1,164 @@
|
||||
@import "../../themes/ionic.globals.ios";
|
||||
|
||||
// Ionic Button
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
/// @prop - Border radius of the button
|
||||
$button-ionic-border-radius: px-to-rem(8) !default;
|
||||
|
||||
/// @prop - Padding top of the button
|
||||
$button-ionic-padding-top: px-to-rem(12) !default;
|
||||
|
||||
/// @prop - Padding end of the button
|
||||
$button-ionic-padding-end: px-to-rem(16) !default;
|
||||
|
||||
/// @prop - Padding bottom of the button
|
||||
$button-ionic-padding-bottom: $button-ionic-padding-top !default;
|
||||
|
||||
/// @prop - Padding start of the button
|
||||
$button-ionic-padding-start: $button-ionic-padding-end !default;
|
||||
|
||||
/// @prop - Minimum height of the button
|
||||
$button-ionic-min-height: px-to-rem(40) !default;
|
||||
|
||||
/// @prop - Font size of the button text
|
||||
/// The maximum font size is calculated by taking the default font size
|
||||
/// and multiplying it by 3, since 310% of the default is the maximum
|
||||
$button-ionic-font-size: dynamic-font-max(14px, 3) !default;
|
||||
|
||||
// Ionic Extra Small Button
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
/// @prop - Border radius of the extra small button
|
||||
$button-ionic-xsmall-border-radius: px-to-rem(4) !default;
|
||||
|
||||
/// @prop - Padding top of the extra small button
|
||||
$button-ionic-xsmall-padding-top: px-to-rem(4) !default;
|
||||
|
||||
/// @prop - Padding end of the extra small button
|
||||
$button-ionic-xsmall-padding-end: px-to-rem(12) !default;
|
||||
|
||||
/// @prop - Padding bottom of the extra small button
|
||||
$button-ionic-xsmall-padding-bottom: $button-ionic-xsmall-padding-top !default;
|
||||
|
||||
/// @prop - Padding start of the extra small button
|
||||
$button-ionic-xsmall-padding-start: $button-ionic-xsmall-padding-end !default;
|
||||
|
||||
/// @prop - Minimum height of the extra small button
|
||||
$button-ionic-xsmall-min-height: px-to-rem(24) !default;
|
||||
|
||||
/// @prop - Font size of the extra small button text
|
||||
/// The maximum font size is calculated by taking the default font size
|
||||
/// and multiplying it by 3, since 310% of the default is the maximum
|
||||
$button-ionic-xsmall-font-size: dynamic-font-max(12px, 3) !default;
|
||||
|
||||
// Ionic Small Button
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
/// @prop - Border radius of the small button
|
||||
$button-ionic-small-border-radius: px-to-rem(4) !default;
|
||||
|
||||
/// @prop - Padding top of the small button
|
||||
$button-ionic-small-padding-top: px-to-rem(8) !default;
|
||||
|
||||
/// @prop - Padding end of the small button
|
||||
$button-ionic-small-padding-end: px-to-rem(16) !default;
|
||||
|
||||
/// @prop - Padding bottom of the small button
|
||||
$button-ionic-small-padding-bottom: $button-ionic-small-padding-top !default;
|
||||
|
||||
/// @prop - Padding start of the small button
|
||||
$button-ionic-small-padding-start: $button-ionic-small-padding-end !default;
|
||||
|
||||
/// @prop - Minimum height of the small button
|
||||
$button-ionic-small-min-height: px-to-rem(32) !default;
|
||||
|
||||
/// @prop - Font size of the small button text
|
||||
/// The maximum font size is calculated by taking the default font size
|
||||
/// and multiplying it by 3, since 310% of the default is the maximum
|
||||
$button-ionic-small-font-size: dynamic-font-max(12px, 3) !default;
|
||||
|
||||
// Ionic Large Button
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
/// @prop - Padding top of the large button
|
||||
$button-ionic-large-padding-top: px-to-rem(16) !default;
|
||||
|
||||
/// @prop - Padding end of the large button
|
||||
$button-ionic-large-padding-end: px-to-rem(24) !default;
|
||||
|
||||
/// @prop - Padding bottom of the large button
|
||||
$button-ionic-large-padding-bottom: $button-ionic-large-padding-top !default;
|
||||
|
||||
/// @prop - Padding start of the large button
|
||||
$button-ionic-large-padding-start: $button-ionic-large-padding-end !default;
|
||||
|
||||
/// @prop - Minimum height of the large button
|
||||
$button-ionic-large-min-height: px-to-rem(48) !default;
|
||||
|
||||
/// @prop - Font size of the large button text
|
||||
/// The maximum font size is calculated by taking the default font size
|
||||
/// and multiplying it by 3, since 310% of the default is the maximum
|
||||
$button-ionic-large-font-size: dynamic-font-max(16px, 3) !default;
|
||||
|
||||
// Ionic Extra Large Button
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
/// @prop - Padding top of the extra large button
|
||||
$button-ionic-xlarge-padding-top: px-to-rem(16) !default;
|
||||
|
||||
/// @prop - Padding end of the extra large button
|
||||
$button-ionic-xlarge-padding-end: px-to-rem(32) !default;
|
||||
|
||||
/// @prop - Padding bottom of the extra large button
|
||||
$button-ionic-xlarge-padding-bottom: $button-ionic-xlarge-padding-top !default;
|
||||
|
||||
/// @prop - Padding start of the extra large button
|
||||
$button-ionic-xlarge-padding-start: $button-ionic-xlarge-padding-end !default;
|
||||
|
||||
/// @prop - Minimum height of the extra large button
|
||||
$button-ionic-xlarge-min-height: px-to-rem(56) !default;
|
||||
|
||||
/// @prop - Font size of the extra large button text
|
||||
/// The maximum font size is calculated by taking the default font size
|
||||
/// and multiplying it by 3, since 310% of the default is the maximum
|
||||
$button-ionic-xlarge-font-size: dynamic-font-max(20px, 3) !default;
|
||||
|
||||
// Ionic Rectangular Button
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
/// @prop - Border radius of the rectangular button
|
||||
$button-ionic-rectangular-border: 0 !default;
|
||||
|
||||
// Ionic Round Button
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
/// @prop - Border radius of the round button
|
||||
$button-ionic-round-border: px-to-rem(999) !default;
|
||||
|
||||
// Ionic Outline Button
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
/// @prop - Border width of the outline button
|
||||
$button-ionic-outline-border-width: 1px !default;
|
||||
|
||||
/// @prop - Border style of the outline button
|
||||
$button-ionic-outline-border-style: solid !default;
|
||||
|
||||
// Ionic Icon Only Button
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
/// @prop - Padding end of the icon only button
|
||||
$button-has-icon-only-padding-end: px-to-rem(13) !default;
|
||||
|
||||
/// @prop - Padding end of the icon only extra small button
|
||||
$button-has-icon-only-padding-end-xsmall: px-to-rem(6) !default;
|
||||
|
||||
/// @prop - Padding end of the icon only small button
|
||||
$button-has-icon-only-padding-end-small: px-to-rem(10) !default;
|
||||
|
||||
/// @prop - Padding end of the icon only large button
|
||||
$button-has-icon-only-padding-end-large: px-to-rem(16) !default;
|
||||
|
||||
/// @prop - Padding end of the icon only extra large button
|
||||
$button-has-icon-only-padding-end-xlarge: px-to-rem(18) !default;
|
||||
@@ -6,12 +6,13 @@ import { inheritAriaAttributes, hasShadowDom } from '@utils/helpers';
|
||||
import { printIonWarning } from '@utils/logging';
|
||||
import { createColorClasses, hostContext, openURL } from '@utils/theme';
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonTheme } from '../../global/ionic-global';
|
||||
import type { AnimationBuilder, Color } from '../../interface';
|
||||
import type { RouterDirection } from '../router/utils/interface';
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
*
|
||||
* @slot - Content is placed between the named slots if provided without a slot.
|
||||
* @slot icon-only - Should be used on an icon in a button that has no text.
|
||||
@@ -25,6 +26,7 @@ import type { RouterDirection } from '../router/utils/interface';
|
||||
styleUrls: {
|
||||
ios: 'button.ios.scss',
|
||||
md: 'button.md.scss',
|
||||
ionic: 'button.ionic.scss',
|
||||
},
|
||||
shadow: true,
|
||||
})
|
||||
@@ -115,7 +117,7 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
|
||||
/**
|
||||
* Set to `"round"` for a button with more rounded corners.
|
||||
*/
|
||||
@Prop({ reflect: true }) shape?: 'round';
|
||||
@Prop({ reflect: true }) shape?: 'round' | 'rectangular';
|
||||
|
||||
/**
|
||||
* Set to `"small"` for a button with less height and padding, to `"default"`
|
||||
@@ -124,7 +126,7 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
|
||||
* is inside of an item, where the size is `"small"` by default. Set the size to
|
||||
* `"default"` inside of an item to make it a standard size button.
|
||||
*/
|
||||
@Prop({ reflect: true }) size?: 'small' | 'default' | 'large';
|
||||
@Prop({ reflect: true }) size?: 'xsmall' | 'small' | 'default' | 'large' | 'xlarge';
|
||||
|
||||
/**
|
||||
* If `true`, activates a button with a heavier font weight.
|
||||
@@ -214,6 +216,24 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
|
||||
return 'bounded';
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable the "xsmall" and "xlarge" sizes if the theme is "ios" or "md"
|
||||
*/
|
||||
private getSize(): string | undefined {
|
||||
const theme = getIonTheme(this);
|
||||
const { size } = this;
|
||||
|
||||
if (size === undefined && this.inItem) {
|
||||
return 'small';
|
||||
}
|
||||
|
||||
if ((theme === 'ios' || theme === 'md') && (size === 'xsmall' || size === 'xlarge')) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the form element based on the provided `form` selector
|
||||
* or element reference provided.
|
||||
@@ -313,14 +333,12 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
|
||||
};
|
||||
|
||||
render() {
|
||||
const mode = getIonMode(this);
|
||||
const {
|
||||
buttonType,
|
||||
type,
|
||||
disabled,
|
||||
rel,
|
||||
target,
|
||||
size,
|
||||
href,
|
||||
color,
|
||||
expand,
|
||||
@@ -329,7 +347,9 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
|
||||
strong,
|
||||
inheritedAttributes,
|
||||
} = this;
|
||||
const finalSize = size === undefined && this.inItem ? 'small' : size;
|
||||
|
||||
const theme = getIonTheme(this);
|
||||
const finalSize = this.getSize();
|
||||
const TagType = href === undefined ? 'button' : ('a' as any);
|
||||
const attrs =
|
||||
TagType === 'button'
|
||||
@@ -365,7 +385,7 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
|
||||
onClick={this.handleClick}
|
||||
aria-disabled={disabled ? 'true' : null}
|
||||
class={createColorClasses(color, {
|
||||
[mode]: true,
|
||||
[theme]: true,
|
||||
[buttonType]: true,
|
||||
[`${buttonType}-${expand}`]: expand !== undefined,
|
||||
[`${buttonType}-${finalSize}`]: finalSize !== undefined,
|
||||
@@ -396,7 +416,7 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
|
||||
<slot></slot>
|
||||
<slot name="end"></slot>
|
||||
</span>
|
||||
{mode === 'md' && <ion-ripple-effect type={this.rippleType}></ion-ripple-effect>}
|
||||
{theme === 'md' && <ion-ripple-effect type={this.rippleType}></ion-ripple-effect>}
|
||||
</TagType>
|
||||
</Host>
|
||||
);
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs().forEach(({ title, config, screenshot }) => {
|
||||
test.describe(title('button: clear'), () => {
|
||||
/**
|
||||
* Fill="clear" does not render differently based on the direction.
|
||||
*/
|
||||
configs({ directions: ['ltr'], modes: ['ios', 'md', 'ionic-md'] }).forEach(({ title, config, screenshot }) => {
|
||||
test.describe(title('button: fill: clear'), () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/button/test/clear`, config);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
await expect(page).toHaveScreenshot(screenshot(`button-clear`));
|
||||
await expect(page).toHaveScreenshot(screenshot(`button-fill-clear`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 129 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 44 KiB |
@@ -1,69 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
/**
|
||||
* All content takes up the full width, so RTL has no effect.
|
||||
*/
|
||||
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('button: round'), () => {
|
||||
test.describe('default', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/button/test/round`, config);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
const container = page.locator('#default');
|
||||
|
||||
await expect(container).toHaveScreenshot(screenshot(`button-round`));
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('outline', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/button/test/round`, config);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
const container = page.locator('#outline');
|
||||
|
||||
await expect(container).toHaveScreenshot(screenshot(`button-outline-round`));
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('clear', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/button/test/round`, config);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
const container = page.locator('#clear');
|
||||
|
||||
await expect(container).toHaveScreenshot(screenshot(`button-clear-round`));
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('color', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/button/test/round`, config);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
const container = page.locator('#color');
|
||||
|
||||
await expect(container).toHaveScreenshot(screenshot(`button-color-round`));
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('expand', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/button/test/round`, config);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
const container = page.locator('#expand');
|
||||
|
||||
await expect(container).toHaveScreenshot(screenshot(`button-expand-round`));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 16 KiB |
111
core/src/components/button/test/shape/button.e2e.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
/**
|
||||
* All content takes up the full width, so RTL has no effect.
|
||||
*/
|
||||
// TODO: FW-6077 - Add ionic theme on MD mode to this test.
|
||||
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('button: shape'), () => {
|
||||
test.describe('round', () => {
|
||||
test.describe('default', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/button/test/shape`, config);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
const container = page.locator('#default');
|
||||
|
||||
await expect(container).toHaveScreenshot(screenshot(`button-round`));
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('outline', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/button/test/shape`, config);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
const container = page.locator('#outline');
|
||||
|
||||
await expect(container).toHaveScreenshot(screenshot(`button-outline-round`));
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('clear', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/button/test/shape`, config);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
const container = page.locator('#clear');
|
||||
|
||||
await expect(container).toHaveScreenshot(screenshot(`button-clear-round`));
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('color', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/button/test/shape`, config);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
const container = page.locator('#color');
|
||||
|
||||
await expect(container).toHaveScreenshot(screenshot(`button-color-round`));
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('expand', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/button/test/shape`, config);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
const container = page.locator('#expand');
|
||||
|
||||
await expect(container).toHaveScreenshot(screenshot(`button-expand-round`));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Shape="rectangular" is only available in the Ionic theme.
|
||||
*/
|
||||
configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('button: shape'), () => {
|
||||
test.describe('rectangular', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<style>
|
||||
ion-button {
|
||||
margin: 8px;
|
||||
}
|
||||
</style>
|
||||
<div id="container">
|
||||
<ion-button shape="rectangular" fill="solid">Rectangular Button, Solid</ion-button>
|
||||
<ion-button class="ion-focused" shape="rectangular" fill="solid">Rectangular Button, Solid, Focused</ion-button>
|
||||
<ion-button class="ion-activated" shape="rectangular" fill="solid">Rectangular Button, Solid, Activated</ion-button>
|
||||
|
||||
<ion-button shape="rectangular" fill="outline">Rectangular Button, Outline</ion-button>
|
||||
<ion-button class="ion-focused" shape="rectangular" fill="outline">Rectangular Button, Outline, Focused</ion-button>
|
||||
<ion-button class="ion-activated" shape="rectangular" fill="outline">Rectangular Button, Outline, Activated</ion-button>
|
||||
|
||||
<ion-button shape="rectangular" fill="clear">Rectangular Button</ion-button>
|
||||
<ion-button class="ion-focused" shape="rectangular" fill="clear">Rectangular Button, Focused</ion-button>
|
||||
<ion-button class="ion-activated" shape="rectangular" fill="clear">Rectangular Button, Activated</ion-button>
|
||||
</div>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const container = page.locator('#container');
|
||||
|
||||
await expect(container).toHaveScreenshot(screenshot(`button-shape-rectangular`));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 22 KiB |
@@ -1,7 +1,7 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
||||
configs({ directions: ['ltr'], modes: ['ionic-md', 'md', 'ios'] }).forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('button: size'), () => {
|
||||
test('should render small buttons', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@@ -60,3 +60,26 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* The following tests are specific to the Ionic theme and do not depend on the text direction.
|
||||
*/
|
||||
configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('button: size'), () => {
|
||||
test('should render xsmall buttons', async ({ page }) => {
|
||||
await page.setContent(`<ion-button size="xsmall" fill="solid">X-Small Button</ion-button>`, config);
|
||||
|
||||
const wrapper = page.locator('ion-button');
|
||||
|
||||
await expect(wrapper).toHaveScreenshot(screenshot(`button-size-x-small`));
|
||||
});
|
||||
|
||||
test('should render xlarge buttons', async ({ page }) => {
|
||||
await page.setContent(`<ion-button size="xlarge" fill="solid">X-Large Button</ion-button>`, config);
|
||||
|
||||
const wrapper = page.locator('ion-button');
|
||||
|
||||
await expect(wrapper).toHaveScreenshot(screenshot(`button-size-x-large`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.4 KiB |