diff --git a/angular/src/directives/css-utils-deprecations.ts b/angular/src/directives/css-utils-deprecations.ts deleted file mode 100644 index 5ae5c0e86b0..00000000000 --- a/angular/src/directives/css-utils-deprecations.ts +++ /dev/null @@ -1,134 +0,0 @@ -import { Directive, ElementRef } from '@angular/core'; - -@Directive({ - selector: '[align-self-start], [align-self-end], [align-self-center], [align-self-stretch], [align-self-baseline], [align-self-auto], [wrap-reverse], [justify-content-start], [justify-content-center], [justify-content-end], [justify-content-around], [justify-content-between], [justify-content-evenly], [align-items-start], [align-items-center], [align-items-end], [align-items-stretch], [align-items-baseline], [float-left], [float-right], [float-start], [float-end], [float-sm-left], [float-sm-right], [float-sm-start], [float-sm-end], [float-md-left], [float-md-right], [float-md-start], [float-md-end], [float-lg-left], [float-lg-right], [float-lg-start], [float-lg-end], [float-xl-left], [float-xl-right], [float-xl-start], [float-xl-end], [text-center], [text-justify], [text-start], [text-end], [text-left], [text-right], [text-nowrap], [text-wrap], [text-sm-center], [text-sm-justify], [text-sm-start], [text-sm-end], [text-sm-left], [text-sm-right], [text-sm-nowrap], [text-sm-wrap], [text-md-center], [text-md-justify], [text-md-start], [text-md-end], [text-md-left], [text-md-right], [text-md-nowrap], [text-md-wrap], [text-lg-center], [text-lg-justify], [text-lg-start], [text-lg-end], [text-lg-left], [text-lg-right], [text-lg-nowrap], [text-lg-wrap], [text-xl-center], [text-xl-justify], [text-xl-start], [text-xl-end], [text-xl-left], [text-xl-right], [text-xl-nowrap], [text-xl-wrap], [text-uppercase], [text-lowercase], [text-capitalize], [text-sm-uppercase], [text-sm-lowercase], [text-sm-capitalize], [text-md-uppercase], [text-md-lowercase], [text-md-capitalize], [text-lg-uppercase], [text-lg-lowercase], [text-lg-capitalize], [text-xl-uppercase], [text-xl-lowercase], [text-xl-capitalize], [no-padding], [padding], [padding-top], [padding-bottom], [padding-start], [padding-end], [padding-vertical], [padding-horizontal], [no-margin], [margin], [margin-top], [margin-bottom], [margin-start], [margin-end], [margin-vertical], [margin-horizontal]', -}) -export class CssUtilsDeprecations { - constructor(ref: ElementRef) { - const el = (ref.nativeElement as HTMLElement); - const attributes = Array.from(el.attributes) - .map(a => a.name) - .filter(n => DEPRECATED_ATTRIBUTES.includes(n)); - - if (attributes.length > 0) { - console.warn(`[DEPRECATED][CSS] Ionic CSS attributes are deprecated. -Replace: -'<${el.tagName.toLowerCase()} ${attributes.map(n => `${n}`).join(' ')}>' - -With: -'<${el.tagName.toLowerCase()} class="${attributes.map(n => `ion-${n}`).join(' ')}">' - `); - } - } -} -const DEPRECATED_ATTRIBUTES = [ - 'align-self-start', - 'align-self-end', - 'align-self-center', - 'align-self-stretch', - 'align-self-baseline', - 'align-self-auto', - 'wrap-reverse', - 'justify-content-start', - 'justify-content-center', - 'justify-content-end', - 'justify-content-around', - 'justify-content-between', - 'justify-content-evenly', - 'align-items-start', - 'align-items-center', - 'align-items-end', - 'align-items-stretch', - 'align-items-baseline', - 'float-left', - 'float-right', - 'float-start', - 'float-end', - 'float-sm-left', - 'float-sm-right', - 'float-sm-start', - 'float-sm-end', - 'float-md-left', - 'float-md-right', - 'float-md-start', - 'float-md-end', - 'float-lg-left', - 'float-lg-right', - 'float-lg-start', - 'float-lg-end', - 'float-xl-left', - 'float-xl-right', - 'float-xl-start', - 'float-xl-end', - 'text-center', - 'text-justify', - 'text-start', - 'text-end', - 'text-left', - 'text-right', - 'text-nowrap', - 'text-wrap', - 'text-sm-center', - 'text-sm-justify', - 'text-sm-start', - 'text-sm-end', - 'text-sm-left', - 'text-sm-right', - 'text-sm-nowrap', - 'text-sm-wrap', - 'text-md-center', - 'text-md-justify', - 'text-md-start', - 'text-md-end', - 'text-md-left', - 'text-md-right', - 'text-md-nowrap', - 'text-md-wrap', - 'text-lg-center', - 'text-lg-justify', - 'text-lg-start', - 'text-lg-end', - 'text-lg-left', - 'text-lg-right', - 'text-lg-nowrap', - 'text-lg-wrap', - 'text-xl-center', - 'text-xl-justify', - 'text-xl-start', - 'text-xl-end', - 'text-xl-left', - 'text-xl-right', - 'text-xl-nowrap', - 'text-xl-wrap', - 'text-uppercase', - 'text-lowercase', - 'text-capitalize', - 'text-sm-uppercase', - 'text-sm-lowercase', - 'text-sm-capitalize', - 'text-md-uppercase', - 'text-md-lowercase', - 'text-md-capitalize', - 'text-lg-uppercase', - 'text-lg-lowercase', - 'text-lg-capitalize', - 'text-xl-uppercase', - 'text-xl-lowercase', - 'text-xl-capitalize', - 'no-padding', - 'padding', - 'padding-top', - 'padding-bottom', - 'padding-start', - 'padding-end', - 'padding-vertical', - 'padding-horizontal', - 'no-margin', - 'margin', - 'margin-top', - 'margin-bottom', - 'margin-start', - 'margin-end', - 'margin-vertical', - 'margin-horizontal' -]; diff --git a/angular/src/directives/proxies-list.txt b/angular/src/directives/proxies-list.txt index 443628c5c07..0f06d58842e 100644 --- a/angular/src/directives/proxies-list.txt +++ b/angular/src/directives/proxies-list.txt @@ -44,9 +44,6 @@ d.IonApp, d.IonMenuToggle, d.IonNav, d.IonNavLink, - d.IonNavPop, - d.IonNavPush, - d.IonNavSetRoot, d.IonNote, d.IonProgressBar, d.IonRadio, diff --git a/angular/src/directives/proxies.ts b/angular/src/directives/proxies.ts index 482b67d795b..d8d79475299 100644 --- a/angular/src/directives/proxies.ts +++ b/angular/src/directives/proxies.ts @@ -517,38 +517,6 @@ export class IonNavLink { } proxyInputs(IonNavLink, ['component', 'componentProps', 'routerDirection']); -export declare interface IonNavPop extends Components.IonNavPop {} -@Component({ selector: 'ion-nav-pop', changeDetection: ChangeDetectionStrategy.OnPush, template: '' }) -export class IonNavPop { - protected el: HTMLElement; - constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) { - c.detach(); - this.el = r.nativeElement; - } -} - -export declare interface IonNavPush extends Components.IonNavPush {} -@Component({ selector: 'ion-nav-push', changeDetection: ChangeDetectionStrategy.OnPush, template: '', inputs: ['component', 'componentProps'] }) -export class IonNavPush { - protected el: HTMLElement; - constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) { - c.detach(); - this.el = r.nativeElement; - } -} -proxyInputs(IonNavPush, ['component', 'componentProps']); - -export declare interface IonNavSetRoot extends Components.IonNavSetRoot {} -@Component({ selector: 'ion-nav-set-root', changeDetection: ChangeDetectionStrategy.OnPush, template: '', inputs: ['component', 'componentProps'] }) -export class IonNavSetRoot { - protected el: HTMLElement; - constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) { - c.detach(); - this.el = r.nativeElement; - } -} -proxyInputs(IonNavSetRoot, ['component', 'componentProps']); - export declare interface IonNote extends Components.IonNote {} @Component({ selector: 'ion-note', changeDetection: ChangeDetectionStrategy.OnPush, template: '', inputs: ['color', 'mode'] }) export class IonNote { @@ -761,7 +729,7 @@ export class IonSelectOption { proxyInputs(IonSelectOption, ['disabled', 'selected', 'value']); export declare interface IonSkeletonText extends Components.IonSkeletonText {} -@Component({ selector: 'ion-skeleton-text', changeDetection: ChangeDetectionStrategy.OnPush, template: '', inputs: ['animated', 'width'] }) +@Component({ selector: 'ion-skeleton-text', changeDetection: ChangeDetectionStrategy.OnPush, template: '', inputs: ['animated'] }) export class IonSkeletonText { protected el: HTMLElement; constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) { @@ -769,7 +737,7 @@ export class IonSkeletonText { this.el = r.nativeElement; } } -proxyInputs(IonSkeletonText, ['animated', 'width']); +proxyInputs(IonSkeletonText, ['animated']); export declare interface IonSlide extends Components.IonSlide {} @Component({ selector: 'ion-slide', changeDetection: ChangeDetectionStrategy.OnPush, template: '' }) diff --git a/angular/src/index.ts b/angular/src/index.ts index 0ca141a061c..9229d5e6e3e 100644 --- a/angular/src/index.ts +++ b/angular/src/index.ts @@ -14,14 +14,12 @@ export { IonVirtualScroll } from './directives/virtual-scroll/virtual-scroll'; export { VirtualItem } from './directives/virtual-scroll/virtual-item'; export { VirtualHeader } from './directives/virtual-scroll/virtual-header'; export { VirtualFooter } from './directives/virtual-scroll/virtual-footer'; -export { CssUtilsDeprecations } from './directives/css-utils-deprecations'; export * from './directives/proxies'; // PROVIDERS export { AngularDelegate } from './providers/angular-delegate'; export { ActionSheetController } from './providers/action-sheet-controller'; export { AlertController } from './providers/alert-controller'; -export { Events } from './providers/events'; export { LoadingController } from './providers/loading-controller'; export { MenuController } from './providers/menu-controller'; export { PickerController } from './providers/picker-controller'; diff --git a/angular/src/ionic-module.ts b/angular/src/ionic-module.ts index 8260c3b861e..04d1fd4eaef 100644 --- a/angular/src/ionic-module.ts +++ b/angular/src/ionic-module.ts @@ -8,13 +8,12 @@ import { NumericValueAccessor } from './directives/control-value-accessors/numer import { RadioValueAccessor } from './directives/control-value-accessors/radio-value-accessor'; import { SelectValueAccessor } from './directives/control-value-accessors/select-value-accessor'; import { TextValueAccessor } from './directives/control-value-accessors/text-value-accessor'; -import { CssUtilsDeprecations } from './directives/css-utils-deprecations'; import { IonBackButtonDelegate } from './directives/navigation/ion-back-button'; import { IonRouterOutlet } from './directives/navigation/ion-router-outlet'; import { IonTabs } from './directives/navigation/ion-tabs'; import { NavDelegate } from './directives/navigation/nav-delegate'; import { RouterLinkDelegate } from './directives/navigation/router-link-delegate'; -import { IonApp, IonAvatar, IonBackButton, IonBackdrop, IonBadge, IonButton, IonButtons, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle, IonCheckbox, IonChip, IonCol, IonContent, IonDatetime, IonFab, IonFabButton, IonFabList, IonFooter, IonGrid, IonHeader, IonIcon, IonImg, IonInfiniteScroll, IonInfiniteScrollContent, IonInput, IonItem, IonItemDivider, IonItemGroup, IonItemOption, IonItemOptions, IonItemSliding, IonLabel, IonList, IonListHeader, IonMenu, IonMenuButton, IonMenuToggle, IonNav, IonNavLink, IonNavPop, IonNavPush, IonNavSetRoot, IonNote, IonProgressBar, IonRadio, IonRadioGroup, IonRange, IonRefresher, IonRefresherContent, IonReorder, IonReorderGroup, IonRippleEffect, IonRow, IonSearchbar, IonSegment, IonSegmentButton, IonSelect, IonSelectOption, IonSkeletonText, IonSlide, IonSlides, IonSpinner, IonSplitPane, IonTabBar, IonTabButton, IonText, IonTextarea, IonThumbnail, IonTitle, IonToggle, IonToolbar } from './directives/proxies'; +import { IonApp, IonAvatar, IonBackButton, IonBackdrop, IonBadge, IonButton, IonButtons, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle, IonCheckbox, IonChip, IonCol, IonContent, IonDatetime, IonFab, IonFabButton, IonFabList, IonFooter, IonGrid, IonHeader, IonIcon, IonImg, IonInfiniteScroll, IonInfiniteScrollContent, IonInput, IonItem, IonItemDivider, IonItemGroup, IonItemOption, IonItemOptions, IonItemSliding, IonLabel, IonList, IonListHeader, IonMenu, IonMenuButton, IonMenuToggle, IonNav, IonNavLink, IonNote, IonProgressBar, IonRadio, IonRadioGroup, IonRange, IonRefresher, IonRefresherContent, IonReorder, IonReorderGroup, IonRippleEffect, IonRow, IonSearchbar, IonSegment, IonSegmentButton, IonSelect, IonSelectOption, IonSkeletonText, IonSlide, IonSlides, IonSpinner, IonSplitPane, IonTabBar, IonTabButton, IonText, IonTextarea, IonThumbnail, IonTitle, IonToggle, IonToolbar } from './directives/proxies'; import { VirtualFooter } from './directives/virtual-scroll/virtual-footer'; import { VirtualHeader } from './directives/virtual-scroll/virtual-header'; import { VirtualItem } from './directives/virtual-scroll/virtual-item'; @@ -68,9 +67,6 @@ const DECLARATIONS = [ IonMenuToggle, IonNav, IonNavLink, - IonNavPop, - IonNavPush, - IonNavSetRoot, IonNote, IonProgressBar, IonRadio, @@ -120,10 +116,7 @@ const DECLARATIONS = [ VirtualFooter, VirtualHeader, VirtualItem, - IonVirtualScroll, - - // Deprecations - CssUtilsDeprecations + IonVirtualScroll ]; @NgModule({ diff --git a/angular/src/providers/events.ts b/angular/src/providers/events.ts deleted file mode 100644 index 609a8b9ef63..00000000000 --- a/angular/src/providers/events.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { Injectable } from '@angular/core'; - -export type EventHandler = (...args: any[]) => any; -@Injectable({ - providedIn: 'root', -}) -export class Events { - private c = new Map(); - - constructor() { - console.warn(`[DEPRECATION][Events]: The Events provider is deprecated and it will be removed in the next major release. - - Use "Observables" for a similar pub/sub architecture: https://angular.io/guide/observables - - Use "Redux" for advanced state management: https://ngrx.io`); - } - /** - * Subscribe to an event topic. Events that get posted to that topic will trigger the provided handler. - * - * @param topic the topic to subscribe to - * @param handler the event handler - */ - subscribe(topic: string, ...handlers: EventHandler[]) { - let topics = this.c.get(topic); - if (!topics) { - this.c.set(topic, topics = []); - } - topics.push(...handlers); - } - - /** - * Unsubscribe from the given topic. Your handler will no longer receive events published to this topic. - * - * @param topic the topic to unsubscribe from - * @param handler the event handler - * - * @return true if a handler was removed - */ - unsubscribe(topic: string, handler?: EventHandler): boolean { - if (!handler) { - return this.c.delete(topic); - } - - const topics = this.c.get(topic); - if (!topics) { - return false; - } - - // We need to find and remove a specific handler - const index = topics.indexOf(handler); - - if (index < 0) { - // Wasn't found, wasn't removed - return false; - } - topics.splice(index, 1); - if (topics.length === 0) { - this.c.delete(topic); - } - return true; - } - - /** - * Publish an event to the given topic. - * - * @param topic the topic to publish to - * @param eventData the data to send as the event - */ - publish(topic: string, ...args: any[]): any[] | null { - const topics = this.c.get(topic); - if (!topics) { - return null; - } - return topics.map(handler => { - try { - return handler(...args); - } catch (e) { - console.error(e); - return null; - } - }); - } -} diff --git a/angular/src/providers/menu-controller.ts b/angular/src/providers/menu-controller.ts index 68f508fc154..f8bc60fc378 100644 --- a/angular/src/providers/menu-controller.ts +++ b/angular/src/providers/menu-controller.ts @@ -48,18 +48,6 @@ export class MenuController { return menuController.enable(shouldEnable, menuId); } - /** - * Used to enable or disable the ability to swipe open the menu. - * @param shouldEnable True if it should be swipe-able, false if not. - * @param [menuId] Optionally get the menu by its id, or side. - * @return Returns the instance of the menu, which is useful for chaining. - * @deprecated Use swipeGesture() instead. - */ - swipeEnable(shouldEnable: boolean, menuId?: string) { - console.warn('[DEPRECATED][ion-menu-controller] swipeEnable() is deprecated. Use MenuController.swipeGesture() instead'); - return this.swipeGesture(shouldEnable, menuId); - } - /** * Used to enable or disable the ability to swipe open the menu. * @param shouldEnable True if it should be swipe-able, false if not. diff --git a/angular/test/test-app/src/app/providers/providers.component.ts b/angular/test/test-app/src/app/providers/providers.component.ts index 9fb270e5168..7e6436d7ded 100644 --- a/angular/test/test-app/src/app/providers/providers.component.ts +++ b/angular/test/test-app/src/app/providers/providers.component.ts @@ -1,7 +1,7 @@ import { Component, NgZone } from '@angular/core'; import { Platform, ModalController, AlertController, ActionSheetController, - PopoverController, ToastController, Events, PickerController, MenuController, + PopoverController, ToastController, PickerController, MenuController, LoadingController, NavController, DomController, Config } from '@ionic/angular'; @@ -13,7 +13,6 @@ export class ProvidersComponent { isLoaded = false; isReady = false; - isEvent = false; isResumed = false; isPaused = false; isResized = false; @@ -25,7 +24,6 @@ export class ProvidersComponent { constructor( actionSheetCtrl: ActionSheetController, alertCtrl: AlertController, - events: Events, loadingCtrl: LoadingController, menuCtrl: MenuController, pickerCtrl: PickerController, @@ -40,7 +38,7 @@ export class ProvidersComponent { ) { // test all providers load if ( - actionSheetCtrl && alertCtrl && events && loadingCtrl && menuCtrl && pickerCtrl && + actionSheetCtrl && alertCtrl && loadingCtrl && menuCtrl && pickerCtrl && modalCtrl && platform && popoverCtrl && toastCtrl && navCtrl && domCtrl && config ) { this.isLoaded = true; @@ -69,13 +67,6 @@ export class ProvidersComponent { this.isDesktop = platform.is('desktop'); this.isMobile = platform.is('mobile'); - // test events - events.subscribe('topic', () => { - this.isEvent = true; - NgZone.assertInAngularZone(); - }); - events.publish('topic'); - // test config this.isTesting = config.getBoolean('_testing'); config.set('keyboardHeight', 12345); diff --git a/core/api.txt b/core/api.txt index e35a256247c..dcb44b77d54 100644 --- a/core/api.txt +++ b/core/api.txt @@ -19,6 +19,7 @@ ion-action-sheet,event,ionActionSheetDidDismiss,OverlayEventDetail,true ion-action-sheet,event,ionActionSheetDidPresent,void,true ion-action-sheet,event,ionActionSheetWillDismiss,OverlayEventDetail,true ion-action-sheet,event,ionActionSheetWillPresent,void,true +ion-action-sheet,css-prop,--backdrop-opacity ion-action-sheet,css-prop,--background ion-action-sheet,css-prop,--background-activated ion-action-sheet,css-prop,--background-selected @@ -57,6 +58,7 @@ ion-alert,event,ionAlertDidDismiss,OverlayEventDetail,true ion-alert,event,ionAlertDidPresent,void,true ion-alert,event,ionAlertWillDismiss,OverlayEventDetail,true ion-alert,event,ionAlertWillPresent,void,true +ion-alert,css-prop,--backdrop-opacity ion-alert,css-prop,--background ion-alert,css-prop,--height ion-alert,css-prop,--max-height @@ -70,14 +72,6 @@ ion-alert-controller,method,create,create(options: AlertOptions) => Promise Promise ion-alert-controller,method,getTop,getTop() => Promise -ion-anchor,shadow -ion-anchor,prop,color,string | undefined,undefined,false,false -ion-anchor,prop,href,string | undefined,undefined,false,false -ion-anchor,prop,rel,string | undefined,undefined,false,false -ion-anchor,prop,routerDirection,"back" | "forward" | "root",'forward',false,false -ion-anchor,css-prop,--background -ion-anchor,css-prop,--color - ion-app,none ion-avatar,shadow @@ -597,6 +591,7 @@ ion-loading,event,ionLoadingDidDismiss,OverlayEventDetail,true ion-loading,event,ionLoadingDidPresent,void,true ion-loading,event,ionLoadingWillDismiss,OverlayEventDetail,true ion-loading,event,ionLoadingWillPresent,void,true +ion-loading,css-prop,--backdrop-opacity ion-loading,css-prop,--background ion-loading,css-prop,--height ion-loading,css-prop,--max-height @@ -692,6 +687,7 @@ ion-modal,event,ionModalDidDismiss,OverlayEventDetail,true ion-modal,event,ionModalDidPresent,void,true ion-modal,event,ionModalWillDismiss,OverlayEventDetail,true ion-modal,event,ionModalWillPresent,void,true +ion-modal,css-prop,--backdrop-opacity ion-modal,css-prop,--background ion-modal,css-prop,--border-color ion-modal,css-prop,--border-radius @@ -736,16 +732,6 @@ ion-nav-link,prop,component,Function | HTMLElement | ViewController | null | str ion-nav-link,prop,componentProps,undefined | { [key: string]: any; },undefined,false,false ion-nav-link,prop,routerDirection,"back" | "forward" | "root",'forward',false,false -ion-nav-pop,none - -ion-nav-push,none -ion-nav-push,prop,component,Function | HTMLElement | ViewController | null | string | undefined,undefined,false,false -ion-nav-push,prop,componentProps,undefined | { [key: string]: any; },undefined,false,false - -ion-nav-set-root,none -ion-nav-set-root,prop,component,Function | HTMLElement | ViewController | null | string | undefined,undefined,false,false -ion-nav-set-root,prop,componentProps,undefined | { [key: string]: any; },undefined,false,false - ion-note,shadow ion-note,prop,color,string | undefined,undefined,false,false ion-note,prop,mode,"ios" | "md",undefined,false,false @@ -772,6 +758,7 @@ ion-picker,event,ionPickerDidDismiss,OverlayEventDetail,true ion-picker,event,ionPickerDidPresent,void,true ion-picker,event,ionPickerWillDismiss,OverlayEventDetail,true ion-picker,event,ionPickerWillPresent,void,true +ion-picker,css-prop,--backdrop-opacity ion-picker,css-prop,--background ion-picker,css-prop,--background-rgb ion-picker,css-prop,--border-color @@ -811,6 +798,7 @@ ion-popover,event,ionPopoverDidDismiss,OverlayEventDetail,true ion-popover,event,ionPopoverDidPresent,void,true ion-popover,event,ionPopoverWillDismiss,OverlayEventDetail,true ion-popover,event,ionPopoverWillPresent,void,true +ion-popover,css-prop,--backdrop-opacity ion-popover,css-prop,--background ion-popover,css-prop,--box-shadow ion-popover,css-prop,--height @@ -964,7 +952,7 @@ ion-searchbar,prop,inputmode,"decimal" | "email" | "none" | "numeric" | "search" ion-searchbar,prop,mode,"ios" | "md",undefined,false,false ion-searchbar,prop,placeholder,string,'Search',false,false ion-searchbar,prop,searchIcon,string,'search',false,false -ion-searchbar,prop,showCancelButton,boolean | string,'never',false,false +ion-searchbar,prop,showCancelButton,"always" | "focus" | "never",'never',false,false ion-searchbar,prop,spellcheck,boolean,false,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 @@ -1057,7 +1045,6 @@ 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,width,string | undefined,undefined,false,false ion-skeleton-text,css-prop,--background ion-skeleton-text,css-prop,--background-rgb ion-skeleton-text,css-prop,--border-radius @@ -1213,7 +1200,6 @@ ion-title,css-prop,--color ion-toast,shadow ion-toast,prop,animated,boolean,true,false,false ion-toast,prop,buttons,(string | ToastButton)[] | undefined,undefined,false,false -ion-toast,prop,closeButtonText,string | undefined,undefined,false,false ion-toast,prop,color,string | undefined,undefined,false,false ion-toast,prop,cssClass,string | string[] | undefined,undefined,false,false ion-toast,prop,duration,number,0,false,false @@ -1224,7 +1210,6 @@ ion-toast,prop,leaveAnimation,((Animation: Animation, baseEl: any, opts?: any) = ion-toast,prop,message,string | undefined,undefined,false,false ion-toast,prop,mode,"ios" | "md",undefined,false,false ion-toast,prop,position,"bottom" | "middle" | "top",'bottom',false,false -ion-toast,prop,showCloseButton,boolean,false,false,false ion-toast,prop,translucent,boolean,false,false,false ion-toast,method,dismiss,dismiss(data?: any, role?: string | undefined) => Promise ion-toast,method,onDidDismiss,onDidDismiss() => Promise> diff --git a/core/src/components.d.ts b/core/src/components.d.ts index 7df5c4f4087..7cb1da1cd6f 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -253,24 +253,6 @@ export namespace Components { */ 'getTop': () => Promise; } - interface IonAnchor { - /** - * The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). - */ - 'color'?: Color; - /** - * Contains a URL or a URL fragment that the hyperlink points to. If this property is set, an anchor tag will be rendered. - */ - 'href': string | undefined; - /** - * Specifies the relationship of the target object to the link object. The value is a space-separated list of [link types](https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types). - */ - 'rel': string | undefined; - /** - * When using a router, it specifies the transition direction when navigating to another page using `href`. - */ - 'routerDirection': RouterDirection; - } interface IonApp {} interface IonAvatar {} interface IonBackButton { @@ -1662,27 +1644,6 @@ export namespace Components { */ 'routerDirection': RouterDirection; } - interface IonNavPop {} - interface IonNavPush { - /** - * Component to navigate to - */ - 'component'?: NavComponent; - /** - * Data you want to pass to the component as props - */ - 'componentProps'?: ComponentProps; - } - interface IonNavSetRoot { - /** - * Component you want to make root for the navigation stack - */ - 'component'?: NavComponent; - /** - * Data you want to pass to the component as props - */ - 'componentProps'?: ComponentProps; - } interface IonNote { /** * The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). @@ -2227,7 +2188,7 @@ export namespace Components { /** * Sets the behavior for the cancel button. Defaults to `"never"`. Setting to `"focus"` shows the cancel button on focus. Setting to `"never"` hides the cancel button. Setting to `"always"` shows the cancel button regardless of focus state. */ - 'showCancelButton': boolean | string; + 'showCancelButton': 'never' | 'focus' | 'always'; /** * If `true`, enable spellcheck on the input. */ @@ -2381,10 +2342,6 @@ export namespace Components { * If `true`, the skeleton text will animate. */ 'animated': boolean; - /** - * @deprecated Use CSS instead. The width of the skeleton text. If supplied, it will override the CSS style. - */ - 'width'?: string; } interface IonSlide {} interface IonSlides { @@ -2500,7 +2457,7 @@ export namespace Components { } interface IonSplitPane { /** - * The content `id` of the split-pane's main content. This property can be used instead of the `[main]` attribute to select the `main` content of the split-pane. + * The content `id` of the split-pane's main content. */ 'contentId'?: string; /** @@ -2720,10 +2677,6 @@ export namespace Components { */ 'buttons'?: (ToastButton | string)[]; /** - * @deprecated Use `buttons` instead. Text to display in the close button. - */ - 'closeButtonText'?: string; - /** * The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). */ 'color'?: Color; @@ -2783,10 +2736,6 @@ export namespace Components { */ 'present': () => Promise; /** - * @deprecated Use `buttons` instead. If `true`, the close button will be displayed. - */ - 'showCloseButton': boolean; - /** * If `true`, the toast will be translucent. Only applies when the mode is `"ios"` and the device supports [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility). */ 'translucent': boolean; @@ -2941,12 +2890,6 @@ declare global { new (): HTMLIonAlertControllerElement; }; - interface HTMLIonAnchorElement extends Components.IonAnchor, HTMLStencilElement {} - var HTMLIonAnchorElement: { - prototype: HTMLIonAnchorElement; - new (): HTMLIonAnchorElement; - }; - interface HTMLIonAppElement extends Components.IonApp, HTMLStencilElement {} var HTMLIonAppElement: { prototype: HTMLIonAppElement; @@ -3223,24 +3166,6 @@ declare global { new (): HTMLIonNavLinkElement; }; - interface HTMLIonNavPopElement extends Components.IonNavPop, HTMLStencilElement {} - var HTMLIonNavPopElement: { - prototype: HTMLIonNavPopElement; - new (): HTMLIonNavPopElement; - }; - - interface HTMLIonNavPushElement extends Components.IonNavPush, HTMLStencilElement {} - var HTMLIonNavPushElement: { - prototype: HTMLIonNavPushElement; - new (): HTMLIonNavPushElement; - }; - - interface HTMLIonNavSetRootElement extends Components.IonNavSetRoot, HTMLStencilElement {} - var HTMLIonNavSetRootElement: { - prototype: HTMLIonNavSetRootElement; - new (): HTMLIonNavSetRootElement; - }; - interface HTMLIonNoteElement extends Components.IonNote, HTMLStencilElement {} var HTMLIonNoteElement: { prototype: HTMLIonNoteElement; @@ -3515,7 +3440,6 @@ declare global { 'ion-action-sheet-controller': HTMLIonActionSheetControllerElement; 'ion-alert': HTMLIonAlertElement; 'ion-alert-controller': HTMLIonAlertControllerElement; - 'ion-anchor': HTMLIonAnchorElement; 'ion-app': HTMLIonAppElement; 'ion-avatar': HTMLIonAvatarElement; 'ion-back-button': HTMLIonBackButtonElement; @@ -3562,9 +3486,6 @@ declare global { 'ion-modal-controller': HTMLIonModalControllerElement; 'ion-nav': HTMLIonNavElement; 'ion-nav-link': HTMLIonNavLinkElement; - 'ion-nav-pop': HTMLIonNavPopElement; - 'ion-nav-push': HTMLIonNavPushElement; - 'ion-nav-set-root': HTMLIonNavSetRootElement; 'ion-note': HTMLIonNoteElement; 'ion-picker': HTMLIonPickerElement; 'ion-picker-column': HTMLIonPickerColumnElement; @@ -3748,24 +3669,6 @@ declare namespace LocalJSX { 'translucent'?: boolean; } interface IonAlertController {} - interface IonAnchor { - /** - * The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). - */ - 'color'?: Color; - /** - * Contains a URL or a URL fragment that the hyperlink points to. If this property is set, an anchor tag will be rendered. - */ - 'href'?: string | undefined; - /** - * Specifies the relationship of the target object to the link object. The value is a space-separated list of [link types](https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types). - */ - 'rel'?: string | undefined; - /** - * When using a router, it specifies the transition direction when navigating to another page using `href`. - */ - 'routerDirection'?: RouterDirection; - } interface IonApp {} interface IonAvatar {} interface IonBackButton { @@ -4992,27 +4895,6 @@ declare namespace LocalJSX { */ 'routerDirection'?: RouterDirection; } - interface IonNavPop {} - interface IonNavPush { - /** - * Component to navigate to - */ - 'component'?: NavComponent; - /** - * Data you want to pass to the component as props - */ - 'componentProps'?: ComponentProps; - } - interface IonNavSetRoot { - /** - * Component you want to make root for the navigation stack - */ - 'component'?: NavComponent; - /** - * Data you want to pass to the component as props - */ - 'componentProps'?: ComponentProps; - } interface IonNote { /** * The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). @@ -5547,7 +5429,7 @@ declare namespace LocalJSX { /** * Sets the behavior for the cancel button. Defaults to `"never"`. Setting to `"focus"` shows the cancel button on focus. Setting to `"never"` hides the cancel button. Setting to `"always"` shows the cancel button regardless of focus state. */ - 'showCancelButton'?: boolean | string; + 'showCancelButton'?: 'never' | 'focus' | 'always'; /** * If `true`, enable spellcheck on the input. */ @@ -5720,10 +5602,6 @@ declare namespace LocalJSX { * If `true`, the skeleton text will animate. */ 'animated'?: boolean; - /** - * @deprecated Use CSS instead. The width of the skeleton text. If supplied, it will override the CSS style. - */ - 'width'?: string; } interface IonSlide {} interface IonSlides { @@ -5828,7 +5706,7 @@ declare namespace LocalJSX { } interface IonSplitPane { /** - * The content `id` of the split-pane's main content. This property can be used instead of the `[main]` attribute to select the `main` content of the split-pane. + * The content `id` of the split-pane's main content. */ 'contentId'?: string; /** @@ -6045,10 +5923,6 @@ declare namespace LocalJSX { */ 'buttons'?: (ToastButton | string)[]; /** - * @deprecated Use `buttons` instead. Text to display in the close button. - */ - 'closeButtonText'?: string; - /** * The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). */ 'color'?: Color; @@ -6105,10 +5979,6 @@ declare namespace LocalJSX { */ 'position'?: 'top' | 'bottom' | 'middle'; /** - * @deprecated Use `buttons` instead. If `true`, the close button will be displayed. - */ - 'showCloseButton'?: boolean; - /** * If `true`, the toast will be translucent. Only applies when the mode is `"ios"` and the device supports [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility). */ 'translucent'?: boolean; @@ -6222,7 +6092,6 @@ declare namespace LocalJSX { 'ion-action-sheet-controller': IonActionSheetController; 'ion-alert': IonAlert; 'ion-alert-controller': IonAlertController; - 'ion-anchor': IonAnchor; 'ion-app': IonApp; 'ion-avatar': IonAvatar; 'ion-back-button': IonBackButton; @@ -6269,9 +6138,6 @@ declare namespace LocalJSX { 'ion-modal-controller': IonModalController; 'ion-nav': IonNav; 'ion-nav-link': IonNavLink; - 'ion-nav-pop': IonNavPop; - 'ion-nav-push': IonNavPush; - 'ion-nav-set-root': IonNavSetRoot; 'ion-note': IonNote; 'ion-picker': IonPicker; 'ion-picker-column': IonPickerColumn; @@ -6330,7 +6196,6 @@ declare module "@stencil/core" { 'ion-action-sheet-controller': LocalJSX.IonActionSheetController & JSXBase.HTMLAttributes; 'ion-alert': LocalJSX.IonAlert & JSXBase.HTMLAttributes; 'ion-alert-controller': LocalJSX.IonAlertController & JSXBase.HTMLAttributes; - 'ion-anchor': LocalJSX.IonAnchor & JSXBase.HTMLAttributes; 'ion-app': LocalJSX.IonApp & JSXBase.HTMLAttributes; 'ion-avatar': LocalJSX.IonAvatar & JSXBase.HTMLAttributes; 'ion-back-button': LocalJSX.IonBackButton & JSXBase.HTMLAttributes; @@ -6377,9 +6242,6 @@ declare module "@stencil/core" { 'ion-modal-controller': LocalJSX.IonModalController & JSXBase.HTMLAttributes; 'ion-nav': LocalJSX.IonNav & JSXBase.HTMLAttributes; 'ion-nav-link': LocalJSX.IonNavLink & JSXBase.HTMLAttributes; - 'ion-nav-pop': LocalJSX.IonNavPop & JSXBase.HTMLAttributes; - 'ion-nav-push': LocalJSX.IonNavPush & JSXBase.HTMLAttributes; - 'ion-nav-set-root': LocalJSX.IonNavSetRoot & JSXBase.HTMLAttributes; 'ion-note': LocalJSX.IonNote & JSXBase.HTMLAttributes; 'ion-picker': LocalJSX.IonPicker & JSXBase.HTMLAttributes; 'ion-picker-column': LocalJSX.IonPickerColumn & JSXBase.HTMLAttributes; diff --git a/core/src/components/action-sheet/action-sheet.ios.scss b/core/src/components/action-sheet/action-sheet.ios.scss index 69f77b5340d..afe9f36cf2c 100644 --- a/core/src/components/action-sheet/action-sheet.ios.scss +++ b/core/src/components/action-sheet/action-sheet.ios.scss @@ -8,6 +8,7 @@ --background: #{$action-sheet-ios-background-color}; --background-selected: #{$action-sheet-ios-button-background-selected}; --background-activated: #{$action-sheet-ios-button-background-activated}; + --backdrop-opacity: var(--ion-backdrop-opacity, 0.4); text-align: $action-sheet-ios-text-align; } diff --git a/core/src/components/action-sheet/action-sheet.md.scss b/core/src/components/action-sheet/action-sheet.md.scss index 79d577d9b55..f080453ea94 100644 --- a/core/src/components/action-sheet/action-sheet.md.scss +++ b/core/src/components/action-sheet/action-sheet.md.scss @@ -8,6 +8,7 @@ --background: #{$action-sheet-md-background-color}; --background-selected: #{var(--background, $action-sheet-md-button-background-selected)}; --background-activated: var(--background); + --backdrop-opacity: var(--ion-backdrop-opacity, 0.32); } .action-sheet-title { diff --git a/core/src/components/action-sheet/action-sheet.scss b/core/src/components/action-sheet/action-sheet.scss index b7230b5adbf..f93646cea3c 100644 --- a/core/src/components/action-sheet/action-sheet.scss +++ b/core/src/components/action-sheet/action-sheet.scss @@ -18,6 +18,8 @@ * @prop --min-height: Minimum height of the action sheet * @prop --height: height of the action sheet * @prop --max-height: Maximum height of the action sheet + * + * @prop --backdrop-opacity: Opacity of the backdrop */ --color: initial; --min-width: auto; diff --git a/core/src/components/action-sheet/animations/ios.enter.ts b/core/src/components/action-sheet/animations/ios.enter.ts index 40fd7abda81..9e4363869d3 100644 --- a/core/src/components/action-sheet/animations/ios.enter.ts +++ b/core/src/components/action-sheet/animations/ios.enter.ts @@ -11,7 +11,7 @@ export const iosEnterAnimation = (baseEl: HTMLElement): IonicAnimation => { backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.01, 0.4); + .fromTo('opacity', 0.01, 'var(--backdrop-opacity)'); wrapperAnimation .addElement(baseEl.querySelector('.action-sheet-wrapper')!) diff --git a/core/src/components/action-sheet/animations/ios.leave.ts b/core/src/components/action-sheet/animations/ios.leave.ts index 52e4ff45230..414ebfebfc0 100644 --- a/core/src/components/action-sheet/animations/ios.leave.ts +++ b/core/src/components/action-sheet/animations/ios.leave.ts @@ -11,7 +11,7 @@ export const iosLeaveAnimation = (baseEl: HTMLElement): IonicAnimation => { backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.4, 0); + .fromTo('opacity', 'var(--backdrop-opacity)', 0); wrapperAnimation .addElement(baseEl.querySelector('.action-sheet-wrapper')!) diff --git a/core/src/components/action-sheet/animations/md.enter.ts b/core/src/components/action-sheet/animations/md.enter.ts index 3ad476c8aa9..97288a10d36 100644 --- a/core/src/components/action-sheet/animations/md.enter.ts +++ b/core/src/components/action-sheet/animations/md.enter.ts @@ -11,7 +11,7 @@ export const mdEnterAnimation = (baseEl: HTMLElement): IonicAnimation => { backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.01, 0.32); + .fromTo('opacity', 0.01, 'var(--backdrop-opacity)'); wrapperAnimation .addElement(baseEl.querySelector('.action-sheet-wrapper')!) diff --git a/core/src/components/action-sheet/animations/md.leave.ts b/core/src/components/action-sheet/animations/md.leave.ts index 468b79f5010..b3251b74f69 100644 --- a/core/src/components/action-sheet/animations/md.leave.ts +++ b/core/src/components/action-sheet/animations/md.leave.ts @@ -11,7 +11,7 @@ export const mdLeaveAnimation = (baseEl: HTMLElement): IonicAnimation => { backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.32, 0); + .fromTo('opacity', 'var(--backdrop-opacity)', 0); wrapperAnimation .addElement(baseEl.querySelector('.action-sheet-wrapper')!) diff --git a/core/src/components/action-sheet/readme.md b/core/src/components/action-sheet/readme.md index 708b67cc30a..f916b63d01d 100644 --- a/core/src/components/action-sheet/readme.md +++ b/core/src/components/action-sheet/readme.md @@ -321,6 +321,7 @@ Type: `Promise` | Name | Description | | ------------------------ | -------------------------------------------------- | +| `--backdrop-opacity` | Opacity of the backdrop | | `--background` | Background of the action sheet group | | `--background-activated` | Background of the action sheet button when pressed | | `--background-selected` | Background of the selected action sheet button | diff --git a/core/src/components/action-sheet/test/basic/e2e.ts b/core/src/components/action-sheet/test/basic/e2e.ts index 685541bbc1d..d96982cd3f2 100644 --- a/core/src/components/action-sheet/test/basic/e2e.ts +++ b/core/src/components/action-sheet/test/basic/e2e.ts @@ -34,6 +34,10 @@ test('action-sheet: basic, scroll without cancel', async () => { await testActionSheet(DIRECTORY, '#scrollWithoutCancel'); }); +test('action-sheet: basic, custom backdrop', async () => { + await testActionSheet(DIRECTORY, '#customBackdrop'); +}); + /** * RTL Tests */ @@ -69,3 +73,7 @@ test('action-sheet:rtl: basic, scrollable options', async () => { test('action-sheet:rtl: basic, scroll without cancel', async () => { await testActionSheet(DIRECTORY, '#scrollWithoutCancel', true); }); + +test('action-sheet:rtl: basic, custom backdrop', async () => { + await testActionSheet(DIRECTORY, '#customBackdrop', true); +}); diff --git a/core/src/components/action-sheet/test/basic/index.html b/core/src/components/action-sheet/test/basic/index.html index 52bd855f5cf..73199c8e28e 100644 --- a/core/src/components/action-sheet/test/basic/index.html +++ b/core/src/components/action-sheet/test/basic/index.html @@ -28,6 +28,7 @@ No Backdrop Dismiss Scrollable Options Scroll Without Cancel + Custom Backdrop Opacity @@ -49,6 +50,10 @@ --height: 325px; } + .custom-backdrop { + --ion-backdrop-opacity: 1; + } + - - - - - - - - - Anchor - Basic - - - - -

- A -

- -

- Anchor -

- -

- Underline Anchor -

- -

- Custom Anchor -

- -

- Dark Anchor -

- -

- Danger Anchor -

- -

- Dynamic Color -

- - Toggle Color -
- - -
- - - - - - - diff --git a/core/src/components/anchor/test/standalone/index.html b/core/src/components/anchor/test/standalone/index.html deleted file mode 100644 index 63887ff37b7..00000000000 --- a/core/src/components/anchor/test/standalone/index.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - Anchor - Standalone - - - - - - - - -

Default

- Anchor - -

Colors

- Primary Anchor - Secondary Anchor - Tertiary Anchor - Success Anchor - Warning Anchor - Danger Anchor - Light Anchor - Medium Anchor - Dark Anchor - -

Custom

- Underline Anchor - Cursive Anchor - Custom Anchor - Custom Secondary Anchor - - - - - diff --git a/core/src/components/app/test/safe-area/index.html b/core/src/components/app/test/safe-area/index.html index f88bea2e0d5..bd4ac475448 100644 --- a/core/src/components/app/test/safe-area/index.html +++ b/core/src/components/app/test/safe-area/index.html @@ -59,7 +59,9 @@ async function showToast() { const toast = Object.assign(document.createElement('ion-toast'), { message: 'Hello world!', - showCloseButton: true + buttons: [ + { text: 'Close', role: 'close' } + ] }); document.body.appendChild(toast); await toast.present(); diff --git a/core/src/components/back-button/test/host-element/index.html b/core/src/components/back-button/test/host-element/index.html index 227d2527c28..9d42734cf0c 100644 --- a/core/src/components/back-button/test/host-element/index.html +++ b/core/src/components/back-button/test/host-element/index.html @@ -24,9 +24,9 @@

Page One

- + Go to Page Two - +
`; } @@ -47,9 +47,9 @@

Page One

Page Two

- + Go to Page Three - +
`; @@ -71,9 +71,9 @@

Page Two

Page Three

- + Go to Page Four - +
`; diff --git a/core/src/components/content/test/fullscreen/index.html b/core/src/components/content/test/fullscreen/index.html index 4588f2e2bbd..98173e5db34 100644 --- a/core/src/components/content/test/fullscreen/index.html +++ b/core/src/components/content/test/fullscreen/index.html @@ -13,7 +13,7 @@ - + Content - Fullscreen diff --git a/core/src/components/footer/footer.ios.scss b/core/src/components/footer/footer.ios.scss index 1496a7ab03a..b42fc1bc991 100644 --- a/core/src/components/footer/footer.ios.scss +++ b/core/src/components/footer/footer.ios.scss @@ -8,10 +8,6 @@ --border-width: #{$hairlines-width} 0 0; } -.footer-ios[no-border] ion-toolbar:first-child { - --border-width: 0; -} - @supports (backdrop-filter: blur(0)) { .footer-translucent-ios { backdrop-filter: $footer-ios-translucent-filter; @@ -21,4 +17,8 @@ --opacity: .8; --backdrop-filter: #{$footer-ios-translucent-filter}; } +} + +.footer-ios.ion-no-border ion-toolbar:first-child { + --border-width: 0; } \ No newline at end of file diff --git a/core/src/components/footer/footer.md.scss b/core/src/components/footer/footer.md.scss index 7cdf4674640..0c96b5814ca 100644 --- a/core/src/components/footer/footer.md.scss +++ b/core/src/components/footer/footer.md.scss @@ -22,6 +22,6 @@ content: ""; } -.footer-md[no-border]::before { +.footer-md.ion-no-border::before { display: none; -} +} \ No newline at end of file diff --git a/core/src/components/footer/readme.md b/core/src/components/footer/readme.md index e387f415830..2782250f7d7 100644 --- a/core/src/components/footer/readme.md +++ b/core/src/components/footer/readme.md @@ -8,11 +8,18 @@ Footer can be a wrapper for ion-toolbar to make sure the content area is sized c ## Usage -### Javascript +### Angular / javascript ```html + + + + Footer - No Border + + + Footer @@ -30,6 +37,13 @@ import { IonContent, IonFooter, IonToolbar, IonTitle } from '@ionic/react'; export const FooterExample: React.FC = () => ( <> + + {/*-- Footer without a border --*/} + + + Footer - No Border + + @@ -41,6 +55,28 @@ export const FooterExample: React.FC = () => ( ``` +### Vue + +```html + +``` + + ## Properties diff --git a/core/src/components/footer/test/basic/e2e.ts b/core/src/components/footer/test/basic/e2e.ts new file mode 100644 index 00000000000..6288e279bfe --- /dev/null +++ b/core/src/components/footer/test/basic/e2e.ts @@ -0,0 +1,10 @@ +import { newE2EPage } from '@stencil/core/testing'; + +test('footer: basic', async () => { + const page = await newE2EPage({ + url: '/src/components/footer/test/basic?ionic:_testing=true' + }); + + const compare = await page.compareScreenshot(); + expect(compare).toMatchScreenshot(); +}); diff --git a/core/src/components/footer/test/basic/index.html b/core/src/components/footer/test/basic/index.html new file mode 100644 index 00000000000..92e4f401157 --- /dev/null +++ b/core/src/components/footer/test/basic/index.html @@ -0,0 +1,36 @@ + + + + + Footer - Basic + + + + + + + + + + + +
+ + + + Footer - Default + + + +
+ + + + Footer - No Border + + + +
+
+ + diff --git a/core/src/components/footer/usage/angular.md b/core/src/components/footer/usage/angular.md new file mode 100644 index 00000000000..a3bcfe851ea --- /dev/null +++ b/core/src/components/footer/usage/angular.md @@ -0,0 +1,16 @@ +```html + + + + + + Footer - No Border + + + + + + Footer + + +``` diff --git a/core/src/components/footer/usage/javascript.md b/core/src/components/footer/usage/javascript.md index a3691b5122c..a3bcfe851ea 100644 --- a/core/src/components/footer/usage/javascript.md +++ b/core/src/components/footer/usage/javascript.md @@ -1,6 +1,13 @@ ```html + + + + Footer - No Border + + + Footer diff --git a/core/src/components/footer/usage/react.md b/core/src/components/footer/usage/react.md index 218c23bc4df..c4e6fef6f4a 100644 --- a/core/src/components/footer/usage/react.md +++ b/core/src/components/footer/usage/react.md @@ -5,6 +5,13 @@ import { IonContent, IonFooter, IonToolbar, IonTitle } from '@ionic/react'; export const FooterExample: React.FC = () => ( <> + + {/*-- Footer without a border --*/} + + + Footer - No Border + + diff --git a/core/src/components/footer/usage/vue.md b/core/src/components/footer/usage/vue.md new file mode 100644 index 00000000000..9bb5dcb3ac8 --- /dev/null +++ b/core/src/components/footer/usage/vue.md @@ -0,0 +1,18 @@ +```html + +``` diff --git a/core/src/components/header/header.ios.scss b/core/src/components/header/header.ios.scss index 4a85dc2311b..127d05c8138 100644 --- a/core/src/components/header/header.ios.scss +++ b/core/src/components/header/header.ios.scss @@ -8,10 +8,6 @@ --border-width: 0 0 #{$hairlines-width}; } -.header-ios[no-border] ion-toolbar:last-child { - --border-width: 0; -} - @supports (backdrop-filter: blur(0)) { .header-translucent-ios { backdrop-filter: $header-ios-translucent-filter; @@ -23,6 +19,10 @@ } } +.header-ios.ion-no-border ion-toolbar:last-child { + --border-width: 0; +} + // iOS Header - Collapse // -------------------------------------------------- .header-collapse-condense { diff --git a/core/src/components/header/header.md.scss b/core/src/components/header/header.md.scss index a60e9e80d44..79201c91585 100644 --- a/core/src/components/header/header.md.scss +++ b/core/src/components/header/header.md.scss @@ -22,10 +22,10 @@ content: ""; } -.header-md[no-border]::after { +.header-collapse-condense { display: none; } -.header-collapse-condense { +.header-md.ion-no-border::after { display: none; } \ No newline at end of file diff --git a/core/src/components/header/readme.md b/core/src/components/header/readme.md index 929aca7bf50..716687853f1 100644 --- a/core/src/components/header/readme.md +++ b/core/src/components/header/readme.md @@ -26,6 +26,13 @@ It's important to note that ion-header needs to be the one of the three root ele
+ + + + Header - No Border + + + @@ -57,6 +64,13 @@ export const HeaderExample: React.FC = () => ( + {/*-- Header without a border --*/} + + + Header - No Border + + + @@ -86,6 +100,13 @@ export const HeaderExample: React.FC = () => ( + + + + Header - No Border + + + diff --git a/core/src/components/header/test/basic/e2e.ts b/core/src/components/header/test/basic/e2e.ts new file mode 100644 index 00000000000..d1f3b50ccf8 --- /dev/null +++ b/core/src/components/header/test/basic/e2e.ts @@ -0,0 +1,10 @@ +import { newE2EPage } from '@stencil/core/testing'; + +test('header: basic', async () => { + const page = await newE2EPage({ + url: '/src/components/header/test/basic?ionic:_testing=true' + }); + + const compare = await page.compareScreenshot(); + expect(compare).toMatchScreenshot(); +}); diff --git a/core/src/components/header/test/basic/index.html b/core/src/components/header/test/basic/index.html new file mode 100644 index 00000000000..7c80920a712 --- /dev/null +++ b/core/src/components/header/test/basic/index.html @@ -0,0 +1,34 @@ + + + + + Header - Basic + + + + + + + + + + + + + + Header - Default + + + +
+ + + + Header - No Border + + + +
+
+ + diff --git a/core/src/components/header/usage/angular.md b/core/src/components/header/usage/angular.md index 272c1af54b8..7b43b5d997e 100644 --- a/core/src/components/header/usage/angular.md +++ b/core/src/components/header/usage/angular.md @@ -12,6 +12,13 @@
+ + + + Header - No Border + + + diff --git a/core/src/components/header/usage/javascript.md b/core/src/components/header/usage/javascript.md index 272c1af54b8..7b43b5d997e 100644 --- a/core/src/components/header/usage/javascript.md +++ b/core/src/components/header/usage/javascript.md @@ -12,6 +12,13 @@ + + + + Header - No Border + + + diff --git a/core/src/components/header/usage/react.md b/core/src/components/header/usage/react.md index e65f281af01..683f6e9adf7 100644 --- a/core/src/components/header/usage/react.md +++ b/core/src/components/header/usage/react.md @@ -17,6 +17,13 @@ export const HeaderExample: React.FC = () => ( + {/*-- Header without a border --*/} + + + Header - No Border + + + diff --git a/core/src/components/header/usage/vue.md b/core/src/components/header/usage/vue.md index 941cb3e7fb0..ad1fa4ae068 100644 --- a/core/src/components/header/usage/vue.md +++ b/core/src/components/header/usage/vue.md @@ -13,6 +13,13 @@ + + + + Header - No Border + + + diff --git a/core/src/components/loading/animations/ios.enter.ts b/core/src/components/loading/animations/ios.enter.ts index b01dace4284..48a7b32d073 100644 --- a/core/src/components/loading/animations/ios.enter.ts +++ b/core/src/components/loading/animations/ios.enter.ts @@ -11,7 +11,7 @@ export const iosEnterAnimation = (baseEl: HTMLElement): IonicAnimation => { backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.01, 0.3); + .fromTo('opacity', 0.01, 'var(--backdrop-opacity)'); wrapperAnimation .addElement(baseEl.querySelector('.loading-wrapper')!) diff --git a/core/src/components/loading/animations/ios.leave.ts b/core/src/components/loading/animations/ios.leave.ts index a36395c2632..cb15a1a017b 100644 --- a/core/src/components/loading/animations/ios.leave.ts +++ b/core/src/components/loading/animations/ios.leave.ts @@ -11,7 +11,7 @@ export const iosLeaveAnimation = (baseEl: HTMLElement): IonicAnimation => { backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.3, 0); + .fromTo('opacity', 'var(--backdrop-opacity)', 0); wrapperAnimation .addElement(baseEl.querySelector('.loading-wrapper')!) diff --git a/core/src/components/loading/animations/md.enter.ts b/core/src/components/loading/animations/md.enter.ts index 989537c0cd7..15c6190b60d 100644 --- a/core/src/components/loading/animations/md.enter.ts +++ b/core/src/components/loading/animations/md.enter.ts @@ -11,7 +11,7 @@ export const mdEnterAnimation = (baseEl: HTMLElement): IonicAnimation => { backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.01, 0.32); + .fromTo('opacity', 0.01, 'var(--backdrop-opacity)'); wrapperAnimation .addElement(baseEl.querySelector('.loading-wrapper')!) diff --git a/core/src/components/loading/animations/md.leave.ts b/core/src/components/loading/animations/md.leave.ts index ba86ba84473..c6f27ecf767 100644 --- a/core/src/components/loading/animations/md.leave.ts +++ b/core/src/components/loading/animations/md.leave.ts @@ -11,7 +11,7 @@ export const mdLeaveAnimation = (baseEl: HTMLElement): IonicAnimation => { backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.32, 0); + .fromTo('opacity', 'var(--backdrop-opacity)', 0); wrapperAnimation .addElement(baseEl.querySelector('.loading-wrapper')!) diff --git a/core/src/components/loading/loading.ios.scss b/core/src/components/loading/loading.ios.scss index 828b3744737..52217e4b380 100644 --- a/core/src/components/loading/loading.ios.scss +++ b/core/src/components/loading/loading.ios.scss @@ -9,6 +9,7 @@ --max-width: #{$loading-ios-max-width}; --max-height: #{$loading-ios-max-height}; --spinner-color: #{$loading-ios-spinner-color}; + --backdrop-opacity: var(--ion-backdrop-opacity, 0.3); color: $loading-ios-text-color; diff --git a/core/src/components/loading/loading.md.scss b/core/src/components/loading/loading.md.scss index 03a9fd3fee5..f913723fe75 100644 --- a/core/src/components/loading/loading.md.scss +++ b/core/src/components/loading/loading.md.scss @@ -9,6 +9,7 @@ --max-width: #{$loading-md-max-width}; --max-height: #{$loading-md-max-height}; --spinner-color: #{$loading-md-spinner-color}; + --backdrop-opacity: var(--ion-backdrop-opacity, 0.32); color: $loading-md-text-color; diff --git a/core/src/components/loading/loading.scss b/core/src/components/loading/loading.scss index 3e51fbdb3c8..d95f3175d66 100644 --- a/core/src/components/loading/loading.scss +++ b/core/src/components/loading/loading.scss @@ -16,6 +16,8 @@ * @prop --max-height: Maximum height of the loading dialog * * @prop --spinner-color: Color of the loading spinner + * + * @prop --backdrop-opacity: Opacity of the backdrop */ --min-width: auto; --width: auto; diff --git a/core/src/components/loading/readme.md b/core/src/components/loading/readme.md index 2bbf9f09e09..8d9ff55aab1 100644 --- a/core/src/components/loading/readme.md +++ b/core/src/components/loading/readme.md @@ -242,16 +242,17 @@ Type: `Promise` ## CSS Custom Properties -| Name | Description | -| ----------------- | ------------------------------------ | -| `--background` | Background of the loading dialog | -| `--height` | Height of the loading dialog | -| `--max-height` | Maximum height of the loading dialog | -| `--max-width` | Maximum width of the loading dialog | -| `--min-height` | Minimum height of the loading dialog | -| `--min-width` | Minimum width of the loading dialog | -| `--spinner-color` | Color of the loading spinner | -| `--width` | Width of the loading dialog | +| Name | Description | +| -------------------- | ------------------------------------ | +| `--backdrop-opacity` | Opacity of the backdrop | +| `--background` | Background of the loading dialog | +| `--height` | Height of the loading dialog | +| `--max-height` | Maximum height of the loading dialog | +| `--max-width` | Maximum width of the loading dialog | +| `--min-height` | Minimum height of the loading dialog | +| `--min-width` | Minimum width of the loading dialog | +| `--spinner-color` | Color of the loading spinner | +| `--width` | Width of the loading dialog | ## Dependencies diff --git a/core/src/components/menu/menu-interface.ts b/core/src/components/menu/menu-interface.ts index a6fc586141f..6c21ec930ba 100644 --- a/core/src/components/menu/menu-interface.ts +++ b/core/src/components/menu/menu-interface.ts @@ -1,8 +1,8 @@ import { Animation, Side } from '../../interface'; export interface MenuI { - el: HTMLIonMenuElement; + mode: string; side: Side; menuId?: string; disabled: boolean; diff --git a/core/src/components/menu/menu.md.vars.scss b/core/src/components/menu/menu.md.vars.scss index de2830d1fbf..064c8f47765 100644 --- a/core/src/components/menu/menu.md.vars.scss +++ b/core/src/components/menu/menu.md.vars.scss @@ -7,4 +7,4 @@ $menu-md-background: $background-color !default; /// @prop - Box shadow of the menu -$menu-md-box-shadow: 0 2px 22px 0 rgba(0, 0, 0, 0.09), 4px 0 16px 0 rgba(0, 0, 0, 0.18) !default; +$menu-md-box-shadow: 4px 0px 16px rgba(0, 0, 0, 0.18) !default; diff --git a/core/src/components/menu/menu.tsx b/core/src/components/menu/menu.tsx index 6bc05d315e6..9a0d2ebd5f1 100644 --- a/core/src/components/menu/menu.tsx +++ b/core/src/components/menu/menu.tsx @@ -8,6 +8,11 @@ import { GESTURE_CONTROLLER } from '../../utils/gesture'; import { assert, isEndSide as isEnd } from '../../utils/helpers'; import { menuController } from '../../utils/menu-controller'; +const iosEasing = 'cubic-bezier(0.32,0.72,0,1)'; +const mdEasing = 'cubic-bezier(0.0,0.0,0.2,1)'; +const iosEasingReverse = 'cubic-bezier(1, 0, 0.68, 0.28)'; +const mdEasingReverse = 'cubic-bezier(0.4, 0, 0.6, 1)'; + @Component({ tag: 'ion-menu', styleUrls: { @@ -23,7 +28,10 @@ export class Menu implements ComponentInterface, MenuI { private gesture?: Gesture; private blocker = GESTURE_CONTROLLER.createBlocker({ disableScroll: true }); - private mode = getIonMode(this); + mode = getIonMode(this); + + private easing: string = this.mode === 'ios' ? iosEasing : mdEasing; + private easingReverse: string = this.mode === 'ios' ? iosEasingReverse : mdEasingReverse; isAnimating = false; width!: number; // TODO @@ -138,7 +146,7 @@ export class Menu implements ComponentInterface, MenuI { async connectedCallback() { if (this.type === undefined) { - this.type = config.get('menuType', this.mode === 'ios' ? 'reveal' : 'overlay'); + this.type = config.get('menuType', 'overlay'); } if (!Build.isBrowser) { @@ -329,12 +337,12 @@ AFTER: const isReversed = !shouldOpen; const ani = (this.animation as IonicAnimation)! .direction((isReversed) ? 'reverse' : 'normal') - .easing((isReversed) ? 'cubic-bezier(0.4, 0.0, 0.6, 1)' : 'cubic-bezier(0.0, 0.0, 0.2, 1)'); + .easing((isReversed) ? this.easingReverse : this.easing); if (animated) { - await ani.playAsync(); + await ani.play(); } else { - ani.playSync(); + ani.play({ sync: true }); } } @@ -532,7 +540,7 @@ AFTER: this.isAnimating = true; const ani = (this.animation as IonicAnimation)!.direction('reverse'); - ani.playSync(); + ani.play({ sync: true }); this.afterAnimation(false); } diff --git a/core/src/components/menu/test/basic/index.html b/core/src/components/menu/test/basic/index.html index 0cac916ea39..c5474a06f62 100644 --- a/core/src/components/menu/test/basic/index.html +++ b/core/src/components/menu/test/basic/index.html @@ -93,7 +93,7 @@ } - - - - - - - - - - - - - - diff --git a/core/src/components/nav-push/nav-push.tsx b/core/src/components/nav-push/nav-push.tsx deleted file mode 100644 index 6a9489385cc..00000000000 --- a/core/src/components/nav-push/nav-push.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { Component, ComponentInterface, Element, Host, Prop, h } from '@stencil/core'; - -import { ComponentProps, NavComponent } from '../../interface'; -import { navLink } from '../nav-link/nav-link-utils'; - -/** - * @deprecated Use `` instead. - */ -@Component({ - tag: 'ion-nav-push' -}) -export class NavPush implements ComponentInterface { - @Element() el!: HTMLElement; - - /** - * Component to navigate to - */ - @Prop() component?: NavComponent; - - /** - * Data you want to pass to the component as props - */ - @Prop() componentProps?: ComponentProps; - - componentDidLoad() { - console.warn('[DEPRECATED][ion-nav-push] `` is deprecated. Use `` instead.'); - } - - private push = () => { - return navLink(this.el, 'forward', this.component, this.componentProps); - } - - render() { - return ( - - ); - } -} diff --git a/core/src/components/nav-push/readme.md b/core/src/components/nav-push/readme.md deleted file mode 100644 index 7fc7ad24641..00000000000 --- a/core/src/components/nav-push/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# ion-nav-push - -Nav Push is a component used to navigate to the specified component. - -It is the component form of `NavController.push()` - - - - - -> **[DEPRECATED]** Use `` instead. - -## Properties - -| Property | Attribute | Description | Type | Default | -| ---------------- | ----------- | ----------------------------------------------- | -------------------------------------------------------------------------- | ----------- | -| `component` | `component` | Component to navigate to | `Function \| HTMLElement \| ViewController \| null \| string \| undefined` | `undefined` | -| `componentProps` | -- | Data you want to pass to the component as props | `undefined \| { [key: string]: any; }` | `undefined` | - - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/core/src/components/nav-push/test/basic/index.html b/core/src/components/nav-push/test/basic/index.html deleted file mode 100644 index 5b8c6d88f14..00000000000 --- a/core/src/components/nav-push/test/basic/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - Nav Push - - - - - - - - - - - - - - - - - diff --git a/core/src/components/nav-set-root/nav-set-root.tsx b/core/src/components/nav-set-root/nav-set-root.tsx deleted file mode 100644 index 3ebf21f0c3a..00000000000 --- a/core/src/components/nav-set-root/nav-set-root.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { Component, ComponentInterface, Element, Host, Prop, h } from '@stencil/core'; - -import { ComponentProps, NavComponent } from '../../interface'; -import { navLink } from '../nav-link/nav-link-utils'; - -/** - * @deprecated Use `` instead. - */ -@Component({ - tag: 'ion-nav-set-root' -}) -export class NavSetRoot implements ComponentInterface { - @Element() el!: HTMLElement; - - /** - * Component you want to make root for the navigation stack - * - */ - @Prop() component?: NavComponent; - - /** - * Data you want to pass to the component as props - */ - @Prop() componentProps?: ComponentProps; - - componentDidLoad() { - console.warn('[DEPRECATED][ion-nav-set-root] `` is deprecated. Use `` instead.'); - } - - private setRoot = () => { - return navLink(this.el, 'root', this.component, this.componentProps); - } - - render() { - return ( - - ); - } -} diff --git a/core/src/components/nav-set-root/readme.md b/core/src/components/nav-set-root/readme.md deleted file mode 100644 index bbc4e6583f8..00000000000 --- a/core/src/components/nav-set-root/readme.md +++ /dev/null @@ -1,22 +0,0 @@ -# ion-nav-set-root - -`NavSetRoot` is a component that allows you to set the root of the current navigation stack. -It is the component form of calling `NavController.setRoot()` - - - - - -> **[DEPRECATED]** Use `` instead. - -## Properties - -| Property | Attribute | Description | Type | Default | -| ---------------- | ----------- | -------------------------------------------------------- | -------------------------------------------------------------------------- | ----------- | -| `component` | `component` | Component you want to make root for the navigation stack | `Function \| HTMLElement \| ViewController \| null \| string \| undefined` | `undefined` | -| `componentProps` | -- | Data you want to pass to the component as props | `undefined \| { [key: string]: any; }` | `undefined` | - - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/core/src/components/nav-set-root/test/basic/index.html b/core/src/components/nav-set-root/test/basic/index.html deleted file mode 100644 index adf876efae3..00000000000 --- a/core/src/components/nav-set-root/test/basic/index.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - Nav Set Root - - - - - - - - - - - - - - - - diff --git a/core/src/components/nav/test/basic/index.html b/core/src/components/nav/test/basic/index.html index 6f8c61be419..87606c37692 100644 --- a/core/src/components/nav/test/basic/index.html +++ b/core/src/components/nav/test/basic/index.html @@ -55,9 +55,9 @@

Page One

- + Go to Page Two - +
`; } @@ -89,9 +89,9 @@

Page One

Page Two

- + Go to Page Three - +
diff --git a/core/src/components/nav/test/nested/index.html b/core/src/components/nav/test/nested/index.html index 5db0829a123..ec7ec3ddeec 100644 --- a/core/src/components/nav/test/nested/index.html +++ b/core/src/components/nav/test/nested/index.html @@ -20,9 +20,9 @@

Page 1

- + Go to Page 2 - +
`; } @@ -50,9 +50,9 @@

Page 1

Page 2.1

- + Go to Page 2.2 - +
`; @@ -74,9 +74,9 @@

Page 2.1

Page 2.2

- + Go to Page 3 - +
`; diff --git a/core/src/components/nav/test/routing/index.html b/core/src/components/nav/test/routing/index.html index 594a6e0d73e..b6fa0439ce5 100644 --- a/core/src/components/nav/test/routing/index.html +++ b/core/src/components/nav/test/routing/index.html @@ -21,9 +21,9 @@

Root

- + Go to Page One - +
`; @@ -42,9 +42,9 @@

Root

Page One

- + Go to Page Two - +
`; } @@ -63,9 +63,9 @@

Page One

Page Two

- + Go to Page Three - +
`; diff --git a/core/src/components/picker/animations/ios.enter.ts b/core/src/components/picker/animations/ios.enter.ts index 093d80ec584..8c7f17b80e4 100644 --- a/core/src/components/picker/animations/ios.enter.ts +++ b/core/src/components/picker/animations/ios.enter.ts @@ -11,7 +11,7 @@ export const iosEnterAnimation = (baseEl: HTMLElement): IonicAnimation => { backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.01, 0.26); + .fromTo('opacity', 0.01, 'var(--backdrop-opacity)'); wrapperAnimation .addElement(baseEl.querySelector('.picker-wrapper')!) diff --git a/core/src/components/picker/animations/ios.leave.ts b/core/src/components/picker/animations/ios.leave.ts index 106df59b171..d9f388a8548 100644 --- a/core/src/components/picker/animations/ios.leave.ts +++ b/core/src/components/picker/animations/ios.leave.ts @@ -11,7 +11,7 @@ export const iosLeaveAnimation = (baseEl: HTMLElement): IonicAnimation => { backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.26, 0.01); + .fromTo('opacity', 'var(--backdrop-opacity)', 0.01); wrapperAnimation .addElement(baseEl.querySelector('.picker-wrapper')!) diff --git a/core/src/components/picker/picker.ios.scss b/core/src/components/picker/picker.ios.scss index 469cafbaa34..effa4969e01 100644 --- a/core/src/components/picker/picker.ios.scss +++ b/core/src/components/picker/picker.ios.scss @@ -9,6 +9,7 @@ --border-width: #{1px 0 0}; --border-color: #{$picker-ios-border-color}; --height: #{$picker-ios-height}; + --backdrop-opacity: var(--ion-backdrop-opacity, 0.26); color: $picker-ios-option-text-color; } diff --git a/core/src/components/picker/picker.md.scss b/core/src/components/picker/picker.md.scss index 0b0edfc1b54..347d0b50d3c 100644 --- a/core/src/components/picker/picker.md.scss +++ b/core/src/components/picker/picker.md.scss @@ -9,6 +9,7 @@ --border-width: #{$hairlines-width 0 0}; --border-color: #{$picker-md-border-color}; --height: #{$picker-md-height}; + --backdrop-opacity: var(--ion-backdrop-opacity, 0.26); color: $picker-md-option-text-color; } diff --git a/core/src/components/picker/picker.scss b/core/src/components/picker/picker.scss index 66ddcb0ac05..4c05c820922 100644 --- a/core/src/components/picker/picker.scss +++ b/core/src/components/picker/picker.scss @@ -20,6 +20,8 @@ * @prop --min-height: Minimum height of the picker * @prop --height: Height of the picker * @prop --max-height: Maximum height of the picker + * + * @prop --backdrop-opacity: Opacity of the backdrop */ --border-radius: 0; --border-style: solid; diff --git a/core/src/components/picker/readme.md b/core/src/components/picker/readme.md index 7b92295cf15..69597a74950 100644 --- a/core/src/components/picker/readme.md +++ b/core/src/components/picker/readme.md @@ -89,20 +89,21 @@ Type: `Promise` ## CSS Custom Properties -| Name | Description | -| ------------------ | -------------------------------------- | -| `--background` | Background of the picker | -| `--background-rgb` | Background of the picker in rgb format | -| `--border-color` | Border color of the picker | -| `--border-radius` | Border radius of the picker | -| `--border-style` | Border style of the picker | -| `--border-width` | Border width of the picker | -| `--height` | Height of the picker | -| `--max-height` | Maximum height of the picker | -| `--max-width` | Maximum width of the picker | -| `--min-height` | Minimum height of the picker | -| `--min-width` | Minimum width of the picker | -| `--width` | Width of the picker | +| Name | Description | +| -------------------- | -------------------------------------- | +| `--backdrop-opacity` | Opacity of the backdrop | +| `--background` | Background of the picker | +| `--background-rgb` | Background of the picker in rgb format | +| `--border-color` | Border color of the picker | +| `--border-radius` | Border radius of the picker | +| `--border-style` | Border style of the picker | +| `--border-width` | Border width of the picker | +| `--height` | Height of the picker | +| `--max-height` | Maximum height of the picker | +| `--max-width` | Maximum width of the picker | +| `--min-height` | Minimum height of the picker | +| `--min-width` | Minimum width of the picker | +| `--width` | Width of the picker | ## Dependencies diff --git a/core/src/components/popover/animations/ios.enter.ts b/core/src/components/popover/animations/ios.enter.ts index 43a6510ccd8..21ffa930240 100644 --- a/core/src/components/popover/animations/ios.enter.ts +++ b/core/src/components/popover/animations/ios.enter.ts @@ -104,7 +104,7 @@ export const iosEnterAnimation = (baseEl: HTMLElement, ev?: Event): IonicAnimati backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.01, 0.08); + .fromTo('opacity', 0.01, 'var(--backdrop-opacity)'); wrapperAnimation .addElement(baseEl.querySelector('.popover-wrapper')!) diff --git a/core/src/components/popover/animations/ios.leave.ts b/core/src/components/popover/animations/ios.leave.ts index 8e3bf06bebc..20cffbb893a 100644 --- a/core/src/components/popover/animations/ios.leave.ts +++ b/core/src/components/popover/animations/ios.leave.ts @@ -11,7 +11,7 @@ export const iosLeaveAnimation = (baseEl: HTMLElement): IonicAnimation => { backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.08, 0); + .fromTo('opacity', 'var(--backdrop-opacity)', 0); wrapperAnimation .addElement(baseEl.querySelector('.popover-wrapper')!) diff --git a/core/src/components/popover/animations/md.enter.ts b/core/src/components/popover/animations/md.enter.ts index 278208b3611..308f7e8fc2b 100644 --- a/core/src/components/popover/animations/md.enter.ts +++ b/core/src/components/popover/animations/md.enter.ts @@ -86,7 +86,7 @@ export const mdEnterAnimation = (baseEl: HTMLElement, ev?: Event): IonicAnimatio backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.01, 0.32); + .fromTo('opacity', 0.01, 'var(--backdrop-opacity)'); wrapperAnimation .addElement(baseEl.querySelector('.popover-wrapper')!) diff --git a/core/src/components/popover/animations/md.leave.ts b/core/src/components/popover/animations/md.leave.ts index 08335966d9b..98c770eee00 100644 --- a/core/src/components/popover/animations/md.leave.ts +++ b/core/src/components/popover/animations/md.leave.ts @@ -11,7 +11,7 @@ export const mdLeaveAnimation = (baseEl: HTMLElement): IonicAnimation => { backdropAnimation .addElement(baseEl.querySelector('ion-backdrop')!) - .fromTo('opacity', 0.32, 0); + .fromTo('opacity', 'var(--backdrop-opacity)', 0); wrapperAnimation .addElement(baseEl.querySelector('.popover-wrapper')!) diff --git a/core/src/components/popover/popover.ios.scss b/core/src/components/popover/popover.ios.scss index fd46b5416b1..e89b72b25df 100644 --- a/core/src/components/popover/popover.ios.scss +++ b/core/src/components/popover/popover.ios.scss @@ -8,6 +8,7 @@ --width: #{$popover-ios-width}; --max-height: #{$popover-ios-max-height}; --box-shadow: none; + --backdrop-opacity: var(--ion-backdrop-opacity, 0.08); } .popover-content { diff --git a/core/src/components/popover/popover.md.scss b/core/src/components/popover/popover.md.scss index 2b918a699af..e588debfc0a 100644 --- a/core/src/components/popover/popover.md.scss +++ b/core/src/components/popover/popover.md.scss @@ -8,6 +8,7 @@ --width: #{$popover-md-width}; --max-height: #{$popover-md-max-height}; --box-shadow: #{$popover-md-box-shadow}; + --backdrop-opacity: var(--ion-backdrop-opacity, 0.32); } .popover-content { diff --git a/core/src/components/popover/popover.scss b/core/src/components/popover/popover.scss index 80b90cf16df..13f9e7d6215 100644 --- a/core/src/components/popover/popover.scss +++ b/core/src/components/popover/popover.scss @@ -15,6 +15,8 @@ * @prop --min-height: Minimum height of the popover * @prop --height: Height of the popover * @prop --max-height: Maximum height of the popover + * + * @prop --backdrop-opacity: Opacity of the backdrop */ --background: #{$popover-background-color}; --min-width: 0; diff --git a/core/src/components/popover/readme.md b/core/src/components/popover/readme.md index a76ad54101f..21643d9ecd8 100644 --- a/core/src/components/popover/readme.md +++ b/core/src/components/popover/readme.md @@ -156,16 +156,17 @@ Type: `Promise` ## CSS Custom Properties -| Name | Description | -| -------------- | ----------------------------- | -| `--background` | Background of the popover | -| `--box-shadow` | Box shadow of the popover | -| `--height` | Height of the popover | -| `--max-height` | Maximum height of the popover | -| `--max-width` | Maximum width of the popover | -| `--min-height` | Minimum height of the popover | -| `--min-width` | Minimum width of the popover | -| `--width` | Width of the popover | +| Name | Description | +| -------------------- | ----------------------------- | +| `--backdrop-opacity` | Opacity of the backdrop | +| `--background` | Background of the popover | +| `--box-shadow` | Box shadow of the popover | +| `--height` | Height of the popover | +| `--max-height` | Maximum height of the popover | +| `--max-width` | Maximum width of the popover | +| `--min-height` | Minimum height of the popover | +| `--min-width` | Minimum width of the popover | +| `--width` | Width of the popover | ## Dependencies diff --git a/core/src/components/router-outlet/test/basic/index.html b/core/src/components/router-outlet/test/basic/index.html index e8c6d44b359..b773f4e3628 100644 --- a/core/src/components/router-outlet/test/basic/index.html +++ b/core/src/components/router-outlet/test/basic/index.html @@ -39,9 +39,9 @@

Page One

Page Two

- + Go to Page Two - +
`; diff --git a/core/src/components/searchbar/readme.md b/core/src/components/searchbar/readme.md index 1347c8edbac..ef4f6fd71c6 100644 --- a/core/src/components/searchbar/readme.md +++ b/core/src/components/searchbar/readme.md @@ -234,7 +234,7 @@ export const SearchbarExample: React.FC = () => ( | `mode` | `mode` | The mode determines which platform styles to use. | `"ios" \| "md"` | `undefined` | | `placeholder` | `placeholder` | Set the input's placeholder. `placeholder` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) | `string` | `'Search'` | | `searchIcon` | `search-icon` | The icon to use as the search icon. | `string` | `'search'` | -| `showCancelButton` | `show-cancel-button` | Sets the behavior for the cancel button. Defaults to `"never"`. Setting to `"focus"` shows the cancel button on focus. Setting to `"never"` hides the cancel button. Setting to `"always"` shows the cancel button regardless of focus state. | `boolean \| string` | `'never'` | +| `showCancelButton` | `show-cancel-button` | Sets the behavior for the cancel button. Defaults to `"never"`. Setting to `"focus"` shows the cancel button on focus. Setting to `"never"` hides the cancel button. Setting to `"always"` shows the cancel button regardless of focus state. | `"always" \| "focus" \| "never"` | `'never'` | | `spellcheck` | `spellcheck` | If `true`, enable spellcheck on the input. | `boolean` | `false` | | `type` | `type` | Set the type of the input. | `"email" \| "number" \| "password" \| "search" \| "tel" \| "text" \| "url"` | `'search'` | | `value` | `value` | the value of the searchbar. | `null \| string \| undefined` | `''` | diff --git a/core/src/components/searchbar/searchbar.tsx b/core/src/components/searchbar/searchbar.tsx index e46bafce124..d4e2c0475bb 100644 --- a/core/src/components/searchbar/searchbar.tsx +++ b/core/src/components/searchbar/searchbar.tsx @@ -111,7 +111,7 @@ export class Searchbar implements ComponentInterface { * Setting to `"always"` shows the cancel button regardless * of focus state. */ - @Prop() showCancelButton: boolean | string = 'never'; + @Prop() showCancelButton: 'never' | 'focus' | 'always' = 'never'; /** * If `true`, enable spellcheck on the input. @@ -187,14 +187,6 @@ export class Searchbar implements ComponentInterface { } componentDidLoad() { - if (this.showCancelButton === 'false' || this.showCancelButton === false) { - console.warn('The boolean values of showCancelButton are deprecated. Please use "never" instead of "false".'); - } - - if (this.showCancelButton === '' || this.showCancelButton === 'true' || this.showCancelButton === true) { - console.warn('The boolean values of showCancelButton are deprecated. Please use "focus" instead of "true".'); - } - this.positionElements(); this.debounceChanged(); @@ -410,10 +402,9 @@ export class Searchbar implements ComponentInterface { * 2. `showCancelButton` is set to `focus`, and the searchbar has been focused. */ private shouldShowCancelButton(): boolean { - if ( - isCancelButtonSetToNever(this.showCancelButton) || - (isCancelButtonSetToFocus(this.showCancelButton) && !this.focused) - ) { return false; } + if ((this.showCancelButton === 'never') || (this.showCancelButton === 'focus' && !this.focused)) { + return false; + } return true; } @@ -424,7 +415,7 @@ export class Searchbar implements ComponentInterface { const clearIcon = this.clearIcon || (mode === 'ios' ? 'ios-close-circle' : 'md-close'); const searchIcon = this.searchIcon; - const cancelButton = !isCancelButtonSetToNever(this.showCancelButton) && ( + const cancelButton = (this.showCancelButton !== 'never') && ( - - - - + + + + diff --git a/core/src/components/toast/toast-interface.ts b/core/src/components/toast/toast-interface.ts index 585b66e37fa..ba2ad7c33e5 100644 --- a/core/src/components/toast/toast-interface.ts +++ b/core/src/components/toast/toast-interface.ts @@ -6,8 +6,6 @@ export interface ToastOptions { cssClass?: string | string[]; duration?: number; buttons?: (ToastButton | string)[]; - showCloseButton?: boolean; - closeButtonText?: string; position?: 'top' | 'bottom' | 'middle'; translucent?: boolean; animated?: boolean; diff --git a/core/src/components/toast/toast.tsx b/core/src/components/toast/toast.tsx index 378f45d35ec..cd15330b325 100644 --- a/core/src/components/toast/toast.tsx +++ b/core/src/components/toast/toast.tsx @@ -86,16 +86,6 @@ export class Toast implements ComponentInterface, OverlayInterface { */ @Prop() position: 'top' | 'bottom' | 'middle' = 'bottom'; - /** - * @deprecated Use `buttons` instead. If `true`, the close button will be displayed. - */ - @Prop() showCloseButton = false; - - /** - * @deprecated Use `buttons` instead. Text to display in the close button. - */ - @Prop() closeButtonText?: string; - /** * An array of buttons for the toast. */ @@ -191,15 +181,6 @@ export class Toast implements ComponentInterface, OverlayInterface { }) : []; - // tslint:disable-next-line: deprecation - if (this.showCloseButton) { - buttons.push({ - // tslint:disable-next-line: deprecation - text: this.closeButtonText || 'Close', - handler: () => this.dismiss(undefined, 'cancel') - }); - } - return buttons; } diff --git a/core/src/components/toolbar/test/modes/e2e.ts b/core/src/components/toolbar/test/modes/e2e.ts new file mode 100644 index 00000000000..6e11a068d84 --- /dev/null +++ b/core/src/components/toolbar/test/modes/e2e.ts @@ -0,0 +1,19 @@ +import { newE2EPage } from '@stencil/core/testing'; + +test('toolbar: modes', async () => { + const page = await newE2EPage({ + url: '/src/components/toolbar/test/modes?ionic:_testing=true' + }); + + const compare = await page.compareScreenshot(); + expect(compare).toMatchScreenshot(); +}); + +test('toolbar:rtl: modes', async () => { + const page = await newE2EPage({ + url: '/src/components/toolbar/test/modes?ionic:_testing=true&rtl=true' + }); + + const compare = await page.compareScreenshot(); + expect(compare).toMatchScreenshot(); +}); diff --git a/core/src/components/toolbar/test/modes/index.html b/core/src/components/toolbar/test/modes/index.html new file mode 100644 index 00000000000..c3f51309dd9 --- /dev/null +++ b/core/src/components/toolbar/test/modes/index.html @@ -0,0 +1,84 @@ + + + + + + Toolbar - Modes + + + + + + + + + + + + + + iOS toolbar + + + + + MD toolbar + + + + + iOS toolbar + + + Outline + + + Clear + Solid + + + + + + MD toolbar + + + Outline + + + Clear + Solid + + + + + + + + + + + + + + + + + iOS + Segment + + + + + + + MD + Segment + + + + + + + + diff --git a/core/src/css/display.scss b/core/src/css/display.scss index efee359f998..2b47da6404d 100644 --- a/core/src/css/display.scss +++ b/core/src/css/display.scss @@ -10,7 +10,7 @@ display: none !important; } -// Adds hidden attributes +// Adds hidden classes @each $breakpoint in map-keys($screen-breakpoints) { $infix: breakpoint-infix($breakpoint, $screen-breakpoints); diff --git a/core/src/css/flex-utils.scss b/core/src/css/flex-utils.scss index 06670474b00..41e9f3325c4 100644 --- a/core/src/css/flex-utils.scss +++ b/core/src/css/flex-utils.scss @@ -6,33 +6,27 @@ // Align Self // -------------------------------------------------- -.ion-align-self-start, -[align-self-start] { +.ion-align-self-start { align-self: flex-start !important; } -.ion-align-self-end, -[align-self-end] { +.ion-align-self-end { align-self: flex-end !important; } -.ion-align-self-center, -[align-self-center] { +.ion-align-self-center { align-self: center !important; } -.ion-align-self-stretch, -[align-self-stretch] { +.ion-align-self-stretch { align-self: stretch !important; } -.ion-align-self-baseline, -[align-self-baseline] { +.ion-align-self-baseline { align-self: baseline !important; } -.ion-align-self-auto, -[align-self-auto] { +.ion-align-self-auto { align-self: auto !important; } @@ -40,18 +34,15 @@ // Flex Wrap // -------------------------------------------------- -.ion-wrap, -[wrap] { +.ion-wrap { flex-wrap: wrap !important; } -.ion-nowrap, -[nowrap] { +.ion-nowrap { flex-wrap: nowrap !important; } -.ion-wrap-reverse, -[wrap-reverse] { +.ion-wrap-reverse { flex-wrap: wrap-reverse !important; } @@ -59,33 +50,27 @@ // Justify Content // -------------------------------------------------- -.ion-justify-content-start, -[justify-content-start] { +.ion-justify-content-start { justify-content: flex-start !important; } -.ion-justify-content-center, -[justify-content-center] { +.ion-justify-content-center { justify-content: center !important; } -.ion-justify-content-end, -[justify-content-end] { +.ion-justify-content-end { justify-content: flex-end !important; } -.ion-justify-content-around, -[justify-content-around] { +.ion-justify-content-around { justify-content: space-around !important; } -.ion-justify-content-between, -[justify-content-between] { +.ion-justify-content-between { justify-content: space-between !important; } -.ion-justify-content-evenly, -[justify-content-evenly] { +.ion-justify-content-evenly { justify-content: space-evenly !important; } @@ -93,27 +78,22 @@ // Align Items // -------------------------------------------------- -.ion-align-items-start, -[align-items-start] { +.ion-align-items-start { align-items: flex-start !important; } -.ion-align-items-center, -[align-items-center] { +.ion-align-items-center { align-items: center !important; } -.ion-align-items-end, -[align-items-end] { +.ion-align-items-end { align-items: flex-end !important; } -.ion-align-items-stretch, -[align-items-stretch] { +.ion-align-items-stretch { align-items: stretch !important; } -.ion-align-items-baseline, -[align-items-baseline] { +.ion-align-items-baseline { align-items: baseline !important; } diff --git a/core/src/css/float-elements.scss b/core/src/css/float-elements.scss index b6e2b93e5ba..45d73722c01 100644 --- a/core/src/css/float-elements.scss +++ b/core/src/css/float-elements.scss @@ -12,23 +12,19 @@ @include media-breakpoint-up($breakpoint, $screen-breakpoints) { // Provide `.ion-float-{bp}-{side}` classes for floating the element based // on the breakpoint and side - .ion-float#{$infix}-left, - [float#{$infix}-left] { + .ion-float#{$infix}-left { @include float(left, !important); } - .ion-float#{$infix}-right, - [float#{$infix}-right] { + .ion-float#{$infix}-right { @include float(right, !important); } - .ion-float#{$infix}-start, - [float#{$infix}-start] { + .ion-float#{$infix}-start { @include float(start, !important); } - .ion-float#{$infix}-end, - [float#{$infix}-end] { + .ion-float#{$infix}-end { @include float(end, !important); } } diff --git a/core/src/css/padding.scss b/core/src/css/padding.scss index f4a869ec474..f441eddddc2 100644 --- a/core/src/css/padding.scss +++ b/core/src/css/padding.scss @@ -14,8 +14,7 @@ $margin: var(--ion-margin, 16px); // Padding // -------------------------------------------------- -.ion-no-padding, -[no-padding] { +.ion-no-padding { --padding-start: 0; --padding-end: 0; --padding-top: 0; @@ -24,8 +23,7 @@ $margin: var(--ion-margin, 16px); @include padding(0); } -.ion-padding, -[padding] { +.ion-padding { --padding-start: #{$padding}; --padding-end: #{$padding}; --padding-top: #{$padding}; @@ -34,44 +32,38 @@ $margin: var(--ion-margin, 16px); @include padding($padding); } -.ion-padding-top, -[padding-top] { +.ion-padding-top { --padding-top: #{$padding}; @include padding($padding, null, null, null); } -.ion-padding-start, -[padding-start] { +.ion-padding-start { --padding-start: #{$padding}; @include padding-horizontal($padding, null); } -.ion-padding-end, -[padding-end] { +.ion-padding-end { --padding-end: #{$padding}; @include padding-horizontal(null, $padding); } -.ion-padding-bottom, -[padding-bottom] { +.ion-padding-bottom { --padding-bottom: #{$padding}; @include padding(null, null, $padding, null); } -.ion-padding-vertical, -[padding-vertical] { +.ion-padding-vertical { --padding-top: #{$padding}; --padding-bottom: #{$padding}; @include padding($padding, null, $padding, null); } -.ion-padding-horizontal, -[padding-horizontal] { +.ion-padding-horizontal { --padding-start: #{$padding}; --padding-end: #{$padding}; @@ -82,8 +74,7 @@ $margin: var(--ion-margin, 16px); // Margin // -------------------------------------------------- -.ion-no-margin, -[no-margin] { +.ion-no-margin { --margin-start: 0; --margin-end: 0; --margin-top: 0; @@ -92,8 +83,7 @@ $margin: var(--ion-margin, 16px); @include margin(0); } -.ion-margin, -[margin] { +.ion-margin { --margin-start: #{$margin}; --margin-end: #{$margin}; --margin-top: #{$margin}; @@ -102,44 +92,38 @@ $margin: var(--ion-margin, 16px); @include margin($margin); } -.ion-margin-top, -[margin-top] { +.ion-margin-top { --margin-top: #{$margin}; @include margin($margin, null, null, null); } -.ion-margin-start, -[margin-start] { +.ion-margin-start { --margin-start: #{$margin}; @include margin-horizontal($margin, null); } -.ion-margin-end, -[margin-end] { +.ion-margin-end { --margin-end: #{$margin}; @include margin-horizontal(null, $margin); } -.ion-margin-bottom, -[margin-bottom] { +.ion-margin-bottom { --margin-bottom: #{$margin}; @include margin(null, null, $margin, null); } -.ion-margin-vertical, -[margin-vertical] { +.ion-margin-vertical { --margin-top: #{$margin}; --margin-bottom: #{$margin}; @include margin($margin, null, $margin, null); } -.ion-margin-horizontal, -[margin-horizontal] { +.ion-margin-horizontal { --margin-start: #{$margin}; --margin-end: #{$margin}; diff --git a/core/src/css/text-alignment.scss b/core/src/css/text-alignment.scss index 9b0eeb7dd56..a5c03acc606 100644 --- a/core/src/css/text-alignment.scss +++ b/core/src/css/text-alignment.scss @@ -12,43 +12,35 @@ @include media-breakpoint-up($breakpoint, $screen-breakpoints) { // Provide `[text-{bp}]` attributes for aligning the text based // on the breakpoint - .ion-text#{$infix}-center, - [text#{$infix}-center] { + .ion-text#{$infix}-center { text-align: center !important; } - .ion-text#{$infix}-justify, - [text#{$infix}-justify] { + .ion-text#{$infix}-justify { text-align: justify !important; } - .ion-text#{$infix}-start, - [text#{$infix}-start] { + .ion-text#{$infix}-start { text-align: start !important; } - .ion-text#{$infix}-end, - [text#{$infix}-end] { + .ion-text#{$infix}-end { text-align: end !important; } - .ion-text#{$infix}-left, - [text#{$infix}-left] { + .ion-text#{$infix}-left { text-align: left !important; } - .ion-text#{$infix}-right, - [text#{$infix}-right] { + .ion-text#{$infix}-right { text-align: right !important; } - .ion-text#{$infix}-nowrap, - [text#{$infix}-nowrap] { + .ion-text#{$infix}-nowrap { white-space: nowrap !important; } - .ion-text#{$infix}-wrap, - [text#{$infix}-wrap] { + .ion-text#{$infix}-wrap { white-space: normal !important; } } diff --git a/core/src/css/text-transformation.scss b/core/src/css/text-transformation.scss index 7f2a0402252..9ae66e80939 100644 --- a/core/src/css/text-transformation.scss +++ b/core/src/css/text-transformation.scss @@ -12,20 +12,17 @@ @include media-breakpoint-up($breakpoint, $screen-breakpoints) { // Provide `[text-{bp}]` attributes for transforming the text based // on the breakpoint - .ion-text#{$infix}-uppercase, - [text#{$infix}-uppercase] { + .ion-text#{$infix}-uppercase { /* stylelint-disable-next-line declaration-no-important */ text-transform: uppercase !important; } - .ion-text#{$infix}-lowercase, - [text#{$infix}-lowercase] { + .ion-text#{$infix}-lowercase { /* stylelint-disable-next-line declaration-no-important */ text-transform: lowercase !important; } - .ion-text#{$infix}-capitalize, - [text#{$infix}-capitalize] { + .ion-text#{$infix}-capitalize { /* stylelint-disable-next-line declaration-no-important */ text-transform: capitalize !important; } diff --git a/core/src/global/ionic-global.ts b/core/src/global/ionic-global.ts index e1ff792518c..1d487019952 100644 --- a/core/src/global/ionic-global.ts +++ b/core/src/global/ionic-global.ts @@ -7,10 +7,10 @@ import { config, configFromSession, configFromURL, saveConfig } from './config'; declare const Context: any; -let mode: Mode; +let defaultMode: Mode; export const getIonMode = (ref?: any): Mode => { - return (ref && getMode(ref)) || mode; + return (ref && getMode(ref)) || defaultMode; }; export default () => { @@ -37,19 +37,28 @@ export default () => { } // first see if the mode was set as an attribute on - // which could have been set by the user, or by prerendering + // which could have been set by the user, or by pre-rendering // otherwise get the mode via config settings, and fallback to md Ionic.config = config; - Ionic.mode = mode = config.get('mode', (doc.documentElement.getAttribute('mode')) || (isPlatform(win, 'ios') ? 'ios' : 'md')); - config.set('mode', mode); - doc.documentElement.setAttribute('mode', mode); - doc.documentElement.classList.add(mode); + Ionic.mode = defaultMode = config.get('mode', (doc.documentElement.getAttribute('mode')) || (isPlatform(win, 'ios') ? 'ios' : 'md')); + config.set('mode', defaultMode); + doc.documentElement.setAttribute('mode', defaultMode); + doc.documentElement.classList.add(defaultMode); if (config.getBoolean('_testing')) { config.set('animated', false); } - setMode( - (elm: any) => (elm as any).mode = (elm as any).mode || elm.getAttribute('mode') || mode - ); + setMode((elm: any) => { + while (elm) { + const elmMode = (elm as any).mode || elm.getAttribute('mode'); + + if (elmMode) { + return elmMode; + } + + elm = elm.parentElement; + } + return defaultMode; + }); }; diff --git a/core/src/themes/ionic.mixins.scss b/core/src/themes/ionic.mixins.scss index 6fe25be2315..31410387e87 100644 --- a/core/src/themes/ionic.mixins.scss +++ b/core/src/themes/ionic.mixins.scss @@ -111,14 +111,14 @@ @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null); } -// Maximum breakpoint width. Null for the largest (last) breakpoint. -// The maximum value is calculated as the minimum of the next one less 0.1. +// Maximum breakpoint width. Null for the smallest (first) breakpoint. +// The maximum value is calculated as the minimum of the current one. // // >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) -// 767px +// 576px @function breakpoint-max($name, $breakpoints: $screen-breakpoints) { - $next: breakpoint-next($name, $breakpoints); - @return if($next, breakpoint-min($next, $breakpoints) - 1px, null); + $min: breakpoint-min($name, $breakpoints); + @return if($min, breakpoint-min($name, $breakpoints), null); } // Media of at most the maximum breakpoint width. No query for the largest breakpoint. diff --git a/core/src/themes/ionic.theme.default.scss b/core/src/themes/ionic.theme.default.scss index b4ddb246855..bdc004f61be 100644 --- a/core/src/themes/ionic.theme.default.scss +++ b/core/src/themes/ionic.theme.default.scss @@ -15,13 +15,13 @@ // - tint: 10% lighter version of the base color (mix with white) $primary: #3880ff !default; -$secondary: #0cd1e8 !default; -$tertiary: #7044ff !default; -$success: #10dc60 !default; -$warning: #ffce00 !default; -$danger: #f04141 !default; +$secondary: #3dc2ff !default; +$tertiary: #5260ff !default; +$success: #2dd36f !default; +$warning: #ffc409 !default; +$danger: #eb445a !default; $light: #f4f5f8 !default; -$medium: #989aa2 !default; +$medium: #92949c !default; $dark: #222428 !default; $colors: ( @@ -51,7 +51,7 @@ $colors: ( ), warning: ( base: $warning, - contrast: #fff, + contrast: #000, shade: get-color-shade($warning), tint: get-color-tint($warning) ), diff --git a/core/src/utils/animation/test/animationbuilder/index.html b/core/src/utils/animation/test/animationbuilder/index.html index 6d01be60192..75a40176e8a 100644 --- a/core/src/utils/animation/test/animationbuilder/index.html +++ b/core/src/utils/animation/test/animationbuilder/index.html @@ -14,7 +14,7 @@ if (forceCSSAnimations) { Element.prototype.animate = null; } - + class PageRoot extends HTMLElement { connectedCallback() { this.innerHTML = ` @@ -29,9 +29,9 @@

Root

- + Go to Page One - +
`; @@ -50,9 +50,9 @@

Root

Page One

- + Go to Page Two - +
`; } @@ -71,9 +71,9 @@

Page One

Page Two

- + Go to Page Three - +
`; @@ -100,31 +100,31 @@

Page Three

customElements.define('page-one', PageOne); customElements.define('page-two', PageTwo); customElements.define('page-three', PageThree); - + const forceAnimationBuilder = new URLSearchParams(window.location.search).get('ionic:_forceAnimationBuilder'); if (forceAnimationBuilder) { window.Ionic.config.navAnimation = (AnimationC, navEl, opts) => { const TRANSLATEY = 'translateY'; const OFF_BOTTOM = '40px'; const CENTER = '0px'; - + const backDirection = (opts.direction === 'back'); const enteringEl = opts.enteringEl; const leavingEl = opts.leavingEl; const ionPageElement = getIonPageElement(enteringEl); const enteringToolbarEle = ionPageElement.querySelector('ion-toolbar'); const rootTransition = new AnimationC(); - + rootTransition .addElement(ionPageElement) .beforeRemoveClass('ion-page-invisible'); - + // animate the component itself if (backDirection) { rootTransition .duration(opts.duration || 200) .easing('cubic-bezier(0.47,0,0.745,0.715)'); - + } else { rootTransition .duration(opts.duration || 280) @@ -132,39 +132,39 @@

Page Three

.fromTo(TRANSLATEY, OFF_BOTTOM, CENTER, true) .fromTo('opacity', 0.01, 1, true); } - + // Animate toolbar if it's there if (enteringToolbarEle) { const enteringToolBar = new AnimationC(); enteringToolBar.addElement(enteringToolbarEle); rootTransition.add(enteringToolBar); } - + // setup leaving view if (leavingEl && backDirection) { // leaving content rootTransition .duration(opts.duration || 200) .easing('cubic-bezier(0.47,0,0.745,0.715)'); - + const leavingPage = new AnimationC(); leavingPage .addElement(getIonPageElement(leavingEl)) .fromTo(TRANSLATEY, CENTER, OFF_BOTTOM) .fromTo('opacity', 1, 0); - + rootTransition.add(leavingPage); } - + return Promise.resolve(rootTransition); }; } - + const getIonPageElement = (element) => { if (element.classList.contains('ion-page')) { return element; } - + const ionPage = element.querySelector(':scope > .ion-page, :scope > ion-nav, :scope > ion-tabs'); if (ionPage) { return ionPage; diff --git a/core/src/utils/menu-controller/animations/base.ts b/core/src/utils/menu-controller/animations/base.ts index cd92b4f8d60..06ea9880e6e 100644 --- a/core/src/utils/menu-controller/animations/base.ts +++ b/core/src/utils/menu-controller/animations/base.ts @@ -7,14 +7,13 @@ import { createAnimation } from '../../animation/animation'; * type will provide their own animations for open and close * and registers itself with Menu. */ -export const baseAnimation = (): IonicAnimation => { +export const baseAnimation = (isIos: boolean): IonicAnimation => { // https://material.io/guidelines/motion/movement.html#movement-movement-in-out-of-screen-bounds // https://material.io/guidelines/motion/duration-easing.html#duration-easing-natural-easing-curves // "Apply the sharp curve to items temporarily leaving the screen that may return // from the same exit point. When they return, use the deceleration curve. On mobile, // this transition typically occurs over 300ms" -- MD Motion Guide - return createAnimation() - .easing('cubic-bezier(0.0, 0.0, 0.2, 1)') // Deceleration curve (Entering the screen) - .duration(300); + + return createAnimation().duration(isIos ? 400 : 300); }; diff --git a/core/src/utils/menu-controller/animations/overlay.ts b/core/src/utils/menu-controller/animations/overlay.ts index e59cdb42981..3fb8f6fadc5 100644 --- a/core/src/utils/menu-controller/animations/overlay.ts +++ b/core/src/utils/menu-controller/animations/overlay.ts @@ -11,9 +11,7 @@ import { baseAnimation } from './base'; export const menuOverlayAnimation = (menu: MenuI): IonicAnimation => { let closedX: string; let openedX: string; - - const BOX_SHADOW_WIDTH = 8; - const width = menu.width + BOX_SHADOW_WIDTH; + const width = menu.width + 8; const menuAnimation = createAnimation(); const backdropAnimation = createAnimation(); @@ -32,9 +30,12 @@ export const menuOverlayAnimation = (menu: MenuI): IonicAnimation => { .addElement(menu.menuInnerEl!) .fromTo('transform', `translateX(${closedX})`, `translateX(${openedX})`); + const isIos = menu.mode === 'ios'; + const opacity = isIos ? 0.2 : 0.25; + backdropAnimation .addElement(menu.backdropEl!) - .fromTo('opacity', 0.01, 0.32); + .fromTo('opacity', 0.01, opacity); - return baseAnimation().addAnimation([menuAnimation, backdropAnimation]); + return baseAnimation(isIos).addAnimation([menuAnimation, backdropAnimation]); }; diff --git a/core/src/utils/menu-controller/animations/push.ts b/core/src/utils/menu-controller/animations/push.ts index 0db15fe6b81..56e41a7ccbb 100644 --- a/core/src/utils/menu-controller/animations/push.ts +++ b/core/src/utils/menu-controller/animations/push.ts @@ -35,5 +35,5 @@ export const menuPushAnimation = (menu: MenuI): IonicAnimation => { .addElement(menu.backdropEl!) .fromTo('opacity', 0.01, 0.32); - return baseAnimation().addAnimation([menuAnimation, backdropAnimation, contentAnimation]); + return baseAnimation(menu.mode === 'ios').addAnimation([menuAnimation, contentAnimation, backdropAnimation]); }; diff --git a/core/src/utils/menu-controller/animations/reveal.ts b/core/src/utils/menu-controller/animations/reveal.ts index b2e77fb291e..eb7574c838a 100644 --- a/core/src/utils/menu-controller/animations/reveal.ts +++ b/core/src/utils/menu-controller/animations/reveal.ts @@ -15,5 +15,5 @@ export const menuRevealAnimation = (menu: MenuI): IonicAnimation => { .addElement(menu.contentEl!) // REVIEW .fromTo('transform', 'translateX(0px)', `translateX(${openedX})`); - return baseAnimation().addAnimation(contentOpen); + return baseAnimation(menu.mode === 'ios').addAnimation(contentOpen); }; diff --git a/core/src/utils/overlays.ts b/core/src/utils/overlays.ts index b5d52d2cc6b..369ba58eb17 100644 --- a/core/src/utils/overlays.ts +++ b/core/src/utils/overlays.ts @@ -216,7 +216,7 @@ const overlayAnimation = async ( } }); } - const animationResult = await animation.playAsync(); + const animationResult = await animation.play(); /** * TODO: Remove AnimationBuilder diff --git a/core/src/utils/test/modes/e2e.ts b/core/src/utils/test/modes/e2e.ts index 48558429eea..7dde3dc6949 100644 --- a/core/src/utils/test/modes/e2e.ts +++ b/core/src/utils/test/modes/e2e.ts @@ -50,7 +50,7 @@ test('component: modes', async () => { // components that need to have the mode class // added for external / user styling // e.g. - tags = ['ion-action-sheet', 'ion-alert', 'ion-anchor', 'ion-app', 'ion-avatar', 'ion-back-button', 'ion-backdrop', 'ion-badge', 'ion-button', 'ion-buttons', 'ion-card-content', 'ion-card-header', 'ion-card-subtitle', 'ion-card-title', 'ion-card', 'ion-checkbox', 'ion-chip', 'ion-col', 'ion-content', 'ion-datetime', 'ion-fab', 'ion-fab-button', 'ion-fab-list', 'ion-footer', 'ion-grid', 'ion-header', 'ion-icon', 'ion-img', 'ion-infinite-scroll', 'ion-infinite-scroll-content', 'ion-input', 'ion-item', 'ion-item-divider', 'ion-item-group', 'ion-item-option', 'ion-item-options', 'ion-item-sliding', 'ion-label', 'ion-list', 'ion-list-header', 'ion-loading', 'ion-modal', 'ion-menu', 'ion-menu-button', 'ion-menu-toggle', 'ion-note', 'ion-picker', 'ion-picker-column', 'ion-popover', 'ion-progress-bar', 'ion-radio', 'ion-radio-group', 'ion-range', 'ion-refresher', 'ion-refresher-content', 'ion-reorder', 'ion-reorder-group', 'ion-ripple-effect', 'ion-row', 'ion-searchbar', 'ion-segment', 'ion-segment-button', 'ion-select', 'ion-select-option', 'ion-select-popover', 'ion-skeleton-text', 'ion-slide', 'ion-slides', 'ion-spinner', 'ion-split-pane', 'ion-tab-bar', 'ion-tab-button', 'ion-text', 'ion-textarea', 'ion-thumbnail', 'ion-title', 'ion-toast', 'ion-toggle', 'ion-toolbar']; + tags = ['ion-action-sheet', 'ion-alert', 'ion-app', 'ion-avatar', 'ion-back-button', 'ion-backdrop', 'ion-badge', 'ion-button', 'ion-buttons', 'ion-card-content', 'ion-card-header', 'ion-card-subtitle', 'ion-card-title', 'ion-card', 'ion-checkbox', 'ion-chip', 'ion-col', 'ion-content', 'ion-datetime', 'ion-fab', 'ion-fab-button', 'ion-fab-list', 'ion-footer', 'ion-grid', 'ion-header', 'ion-icon', 'ion-img', 'ion-infinite-scroll', 'ion-infinite-scroll-content', 'ion-input', 'ion-item', 'ion-item-divider', 'ion-item-group', 'ion-item-option', 'ion-item-options', 'ion-item-sliding', 'ion-label', 'ion-list', 'ion-list-header', 'ion-loading', 'ion-modal', 'ion-menu', 'ion-menu-button', 'ion-menu-toggle', 'ion-note', 'ion-picker', 'ion-picker-column', 'ion-popover', 'ion-progress-bar', 'ion-radio', 'ion-radio-group', 'ion-range', 'ion-refresher', 'ion-refresher-content', 'ion-reorder', 'ion-reorder-group', 'ion-ripple-effect', 'ion-router-link', 'ion-row', 'ion-searchbar', 'ion-segment', 'ion-segment-button', 'ion-select', 'ion-select-option', 'ion-select-popover', 'ion-skeleton-text', 'ion-slide', 'ion-slides', 'ion-spinner', 'ion-split-pane', 'ion-tab-bar', 'ion-tab-button', 'ion-text', 'ion-textarea', 'ion-thumbnail', 'ion-title', 'ion-toast', 'ion-toggle', 'ion-toolbar']; const globalMode = await page.evaluate(() => document.documentElement.getAttribute('mode')); for (const tag of tags) { diff --git a/core/src/utils/test/modes/index.html b/core/src/utils/test/modes/index.html index 3a8af62fb23..81926813099 100644 --- a/core/src/utils/test/modes/index.html +++ b/core/src/utils/test/modes/index.html @@ -33,7 +33,6 @@ - @@ -85,6 +84,7 @@ + diff --git a/core/stencil.config.ts b/core/stencil.config.ts index 39425c6f069..3b30b4f5ffa 100644 --- a/core/stencil.config.ts +++ b/core/stencil.config.ts @@ -28,7 +28,7 @@ export const config: Config = { { components: ['ion-loading'] }, { components: ['ion-menu', 'ion-menu-controller', 'ion-menu-toggle', 'ion-menu-button'] }, { components: ['ion-modal'] }, - { components: ['ion-nav', 'ion-nav-link', 'ion-nav-pop', 'ion-nav-push', 'ion-nav-set-root'] }, + { components: ['ion-nav', 'ion-nav-link'] }, { components: ['ion-img'] }, { components: ['ion-popover'] }, { components: ['ion-progress-bar'] }, @@ -53,7 +53,6 @@ export const config: Config = { // Deprecated { components: [ - 'ion-anchor', 'ion-action-sheet-controller', 'ion-alert-controller', 'ion-loading-controller', @@ -76,10 +75,7 @@ export const config: Config = { }, { type: 'dist', - esmLoaderPath: '../loader', - copy: [ - { src: '**/*.scss' } - ] + esmLoaderPath: '../loader' }, // { // type: 'experimental-dist-module', @@ -136,7 +132,6 @@ export const config: Config = { 'ion-route-redirect', 'ion-router-link', 'ion-router-outlet', - 'ion-anchor', // tabs 'ion-tabs', diff --git a/vue/cookbook/ionic-controllers.html b/vue/cookbook/ionic-controllers.html index 51427006078..204c6fa2733 100644 --- a/vue/cookbook/ionic-controllers.html +++ b/vue/cookbook/ionic-controllers.html @@ -112,9 +112,8 @@

Howdy!

toast() { this.$ionic.toastController.create({ message: 'Here\'s to IonicVue!', - showCloseButton: true, + buttons: ['Done'], position: 'top', - closeButtonText: 'Done' }) .then(t => t.present()) },