diff --git a/core/api.txt b/core/api.txt index b8760bfe52..02ed8bc395 100644 --- a/core/api.txt +++ b/core/api.txt @@ -31,11 +31,6 @@ ion-action-sheet,css-prop,--min-height ion-action-sheet,css-prop,--min-width ion-action-sheet,css-prop,--width -ion-action-sheet-controller,none -ion-action-sheet-controller,method,create,create(options: ActionSheetOptions) => Promise -ion-action-sheet-controller,method,dismiss,dismiss(data?: any, role?: string | undefined, id?: string | undefined) => Promise -ion-action-sheet-controller,method,getTop,getTop() => Promise - ion-alert,scoped ion-alert,prop,animated,boolean,true,false,false ion-alert,prop,backdropDismiss,boolean,true,false,false @@ -67,11 +62,6 @@ ion-alert,css-prop,--min-height ion-alert,css-prop,--min-width ion-alert,css-prop,--width -ion-alert-controller,none -ion-alert-controller,method,create,create(options: AlertOptions) => Promise -ion-alert-controller,method,dismiss,dismiss(data?: any, role?: string | undefined, id?: string | undefined) => Promise -ion-alert-controller,method,getTop,getTop() => Promise - ion-app,none ion-avatar,shadow @@ -608,11 +598,6 @@ ion-loading,css-prop,--min-width ion-loading,css-prop,--spinner-color ion-loading,css-prop,--width -ion-loading-controller,none -ion-loading-controller,method,create,create(options?: LoadingOptions | undefined) => Promise -ion-loading-controller,method,dismiss,dismiss(data?: any, role?: string | undefined, id?: string | undefined) => Promise -ion-loading-controller,method,getTop,getTop() => Promise - ion-menu,shadow ion-menu,prop,contentId,string | undefined,undefined,false,true ion-menu,prop,disabled,boolean,false,false,false @@ -657,20 +642,6 @@ ion-menu-button,css-prop,--padding-end ion-menu-button,css-prop,--padding-start ion-menu-button,css-prop,--padding-top -ion-menu-controller,none -ion-menu-controller,method,close,close(menu?: string | null | undefined) => Promise -ion-menu-controller,method,enable,enable(enable: boolean, menu?: string | null | undefined) => Promise -ion-menu-controller,method,get,get(menu?: string | null | undefined) => Promise -ion-menu-controller,method,getMenus,getMenus() => Promise -ion-menu-controller,method,getOpen,getOpen() => Promise -ion-menu-controller,method,isAnimating,isAnimating() => Promise -ion-menu-controller,method,isEnabled,isEnabled(menu?: string | null | undefined) => Promise -ion-menu-controller,method,isOpen,isOpen(menu?: string | null | undefined) => Promise -ion-menu-controller,method,open,open(menu?: string | null | undefined) => Promise -ion-menu-controller,method,registerAnimation,registerAnimation(name: string, animation: AnimationBuilder) => Promise -ion-menu-controller,method,swipeGesture,swipeGesture(enable: boolean, menu?: string | null | undefined) => Promise -ion-menu-controller,method,toggle,toggle(menu?: string | null | undefined) => Promise - ion-menu-toggle,shadow ion-menu-toggle,prop,autoHide,boolean,true,false,false ion-menu-toggle,prop,menu,string | undefined,undefined,false,false @@ -709,11 +680,6 @@ ion-modal,css-prop,--min-height ion-modal,css-prop,--min-width ion-modal,css-prop,--width -ion-modal-controller,none -ion-modal-controller,method,create,create(options: ModalOptions) => Promise -ion-modal-controller,method,dismiss,dismiss(data?: any, role?: string | undefined, id?: string | undefined) => Promise -ion-modal-controller,method,getTop,getTop() => Promise - ion-nav,shadow ion-nav,prop,animated,boolean,true,false,false ion-nav,prop,animation,((baseEl: any, opts?: any) => Animation) | undefined,undefined,false,false @@ -781,11 +747,6 @@ ion-picker,css-prop,--min-height ion-picker,css-prop,--min-width ion-picker,css-prop,--width -ion-picker-controller,none -ion-picker-controller,method,create,create(options: PickerOptions) => Promise -ion-picker-controller,method,dismiss,dismiss(data?: any, role?: string | undefined, id?: string | undefined) => Promise -ion-picker-controller,method,getTop,getTop() => Promise - ion-popover,scoped ion-popover,prop,animated,boolean,true,false,false ion-popover,prop,backdropDismiss,boolean,true,false,false @@ -817,11 +778,6 @@ ion-popover,css-prop,--min-height ion-popover,css-prop,--min-width ion-popover,css-prop,--width -ion-popover-controller,none -ion-popover-controller,method,create,create(options: PopoverOptions) => Promise -ion-popover-controller,method,dismiss,dismiss(data?: any, role?: string | undefined, id?: string | undefined) => Promise -ion-popover-controller,method,getTop,getTop() => Promise - ion-progress-bar,shadow ion-progress-bar,prop,buffer,number,1,false,false ion-progress-bar,prop,color,string | undefined,undefined,false,false @@ -1259,11 +1215,6 @@ ion-toast,css-prop,--min-width ion-toast,css-prop,--start ion-toast,css-prop,--width -ion-toast-controller,none -ion-toast-controller,method,create,create(options?: ToastOptions | undefined) => Promise -ion-toast-controller,method,dismiss,dismiss(data?: any, role?: string | undefined, id?: string | undefined) => Promise -ion-toast-controller,method,getTop,getTop() => Promise - ion-toggle,shadow ion-toggle,prop,checked,boolean,false,false,false ion-toggle,prop,color,string | undefined,undefined,false,false diff --git a/core/src/components.d.ts b/core/src/components.d.ts index 11824a3b9e..14d557b7ea 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -9,10 +9,8 @@ import { HTMLStencilElement, JSXBase } from '@stencil/core/internal'; import { ActionSheetButton, - ActionSheetOptions, AlertButton, AlertInput, - AlertOptions, AnimationBuilder, CheckboxChangeEventDetail, Color, @@ -29,16 +27,12 @@ import { ItemHeightFn, ItemRenderFn, ItemReorderEventDetail, - LoadingOptions, MenuChangeEventDetail, - ModalOptions, NavComponent, NavOptions, OverlayEventDetail, PickerButton, PickerColumn, - PickerOptions, - PopoverOptions, RadioChangeEventDetail, RadioGroupChangeEventDetail, RangeChangeEventDetail, @@ -67,7 +61,6 @@ import { TextareaChangeEventDetail, TextFieldTypes, ToastButton, - ToastOptions, ToggleChangeEventDetail, TransitionDoneFn, TransitionInstruction, @@ -143,24 +136,6 @@ export namespace Components { */ 'translucent': boolean; } - interface IonActionSheetController { - /** - * Create an action sheet overlay with action sheet options. - * @param options The options to use to create the action sheet. - */ - 'create': (options: ActionSheetOptions) => Promise; - /** - * Dismiss the open action sheet overlay. - * @param data Any data to emit in the dismiss events. - * @param role The role of the element that is dismissing the action sheet. This can be useful in a button handler for determining which button was clicked to dismiss the action sheet. Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. - * @param id The id of the action sheet to dismiss. If an id is not provided, it will dismiss the most recently opened action sheet. - */ - 'dismiss': (data?: any, role?: string | undefined, id?: string | undefined) => Promise; - /** - * Get the most recently opened action sheet overlay. - */ - 'getTop': () => Promise; - } interface IonAlert { /** * If `true`, the alert will animate. @@ -234,24 +209,6 @@ export namespace Components { */ 'translucent': boolean; } - interface IonAlertController { - /** - * Create an alert overlay with alert options. - * @param options The options to use to create the alert. - */ - 'create': (options: AlertOptions) => Promise; - /** - * Dismiss the open alert overlay. - * @param data Any data to emit in the dismiss events. - * @param role The role of the element that is dismissing the alert. This can be useful in a button handler for determining which button was clicked to dismiss the alert. Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. - * @param id The id of the alert to dismiss. If an id is not provided, it will dismiss the most recently opened alert. - */ - 'dismiss': (data?: any, role?: string | undefined, id?: string | undefined) => Promise; - /** - * Get the most recently opened alert overlay. - */ - 'getTop': () => Promise; - } interface IonApp {} interface IonAvatar {} interface IonBackButton { @@ -1280,24 +1237,6 @@ export namespace Components { */ 'translucent': boolean; } - interface IonLoadingController { - /** - * Create a loading overlay with loading options. - * @param options The options to use to create the loading. - */ - 'create': (options?: LoadingOptions | undefined) => Promise; - /** - * Dismiss the open loading overlay. - * @param data Any data to emit in the dismiss events. - * @param role The role of the element that is dismissing the loading. This can be useful in a button handler for determining which button was clicked to dismiss the loading. Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. - * @param id The id of the loading to dismiss. If an id is not provided, it will dismiss the most recently opened loading. - */ - 'dismiss': (data?: any, role?: string | undefined, id?: string | undefined) => Promise; - /** - * Get the most recently opened loading overlay. - */ - 'getTop': () => Promise; - } interface IonMenu { /** * Closes the menu. If the menu is already closed or it can't be closed, it returns `false`. @@ -1374,68 +1313,6 @@ export namespace Components { */ 'type': 'submit' | 'reset' | 'button'; } - interface IonMenuController { - /** - * Close the menu. If a menu is specified, it will close that menu. If no menu is specified, then it will close any menu that is open. If it does not find any open menus, it will return `false`. - * @param menu The menuId or side of the menu to close. - */ - 'close': (menu?: string | null | undefined) => Promise; - /** - * Enable or disable a menu. Disabling a menu will not allow gestures for that menu or any calls to open it. This is useful when there are multiple menus on the same side and only one of them should be allowed to open. Enabling a menu will automatically disable all other menus on that side. - * @param enable If `true`, the menu should be enabled. - * @param menu The menuId or side of the menu to enable or disable. - */ - 'enable': (enable: boolean, menu?: string | null | undefined) => Promise; - /** - * Get a menu instance. If a menu is not provided then it will return the first menu found. If the specified menu is `start` or `end`, then it will return the enabled menu on that side. Otherwise, it will try to find the menu using the menu's `id` property. If a menu is not found then it will return `null`. - * @param menu The menuId or side of the menu. - */ - 'get': (menu?: string | null | undefined) => Promise; - /** - * Get all menu instances. - */ - 'getMenus': () => Promise; - /** - * Get the instance of the opened menu. Returns `null` if a menu is not found. - */ - 'getOpen': () => Promise; - /** - * Get whether or not a menu is animating. Returns `true` if any menu is currently animating. - */ - 'isAnimating': () => Promise; - /** - * Get whether or not the menu is enabled. Returns `true` if the specified menu is enabled. Returns `false` if a menu is disabled or not found. - * @param menu The menuId or side of the menu that is being checked. - */ - 'isEnabled': (menu?: string | null | undefined) => Promise; - /** - * Get whether or not the menu is open. Returns `true` if the specified menu is open. If a menu is not specified, it will return `true` if any menu is currently open. - * @param menu The menuId or side of the menu that is being checked. - */ - 'isOpen': (menu?: string | null | undefined) => Promise; - /** - * Open the menu. If a menu is not provided then it will open the first menu found. If the specified menu is `start` or `end`, then it will open the enabled menu on that side. Otherwise, it will try to find the menu using the menu's `id` property. If a menu is not found then it will return `false`. - * @param menu The menuId or side of the menu to open. - */ - 'open': (menu?: string | null | undefined) => Promise; - /** - * Registers a new animation that can be used with any `ion-menu` by passing the name of the animation in its `type` property. - * @param name The name of the animation to register. - * @param animation The animation function to register. - */ - 'registerAnimation': (name: string, animation: AnimationBuilder) => Promise; - /** - * Enable or disable the ability to swipe open the menu. - * @param enable If `true`, the menu swipe gesture should be enabled. - * @param menu The menuId or side of the menu to enable or disable the swipe gesture on. - */ - 'swipeGesture': (enable: boolean, menu?: string | null | undefined) => Promise; - /** - * Toggle the menu open or closed. If the menu is already open, it will try to close the menu, otherwise it will try to open it. Returns `false` if a menu is not found. - * @param menu The menuId or side of the menu to toggle. - */ - 'toggle': (menu?: string | null | undefined) => Promise; - } interface IonMenuToggle { /** * Automatically hides the content when the corresponding menu is not active. By default, it's `true`. Change it to `false` in order to keep `ion-menu-toggle` always visible regardless the state of the menu. @@ -1516,24 +1393,6 @@ export namespace Components { */ 'swipeToClose': boolean; } - interface IonModalController { - /** - * Create a modal overlay with modal options. - * @param options The options to use to create the modal. - */ - 'create': (options: ModalOptions) => Promise; - /** - * Dismiss the open modal overlay. - * @param data Any data to emit in the dismiss events. - * @param role The role of the element that is dismissing the modal. This can be useful in a button handler for determining which button was clicked to dismiss the modal. Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. - * @param id The id of the modal to dismiss. If an id is not provided, it will dismiss the most recently opened modal. - */ - 'dismiss': (data?: any, role?: string | undefined, id?: string | undefined) => Promise; - /** - * Get the most recently opened modal overlay. - */ - 'getTop': () => Promise; - } interface IonNav { /** * If `true`, the nav should animate the transition of components. @@ -1745,24 +1604,6 @@ export namespace Components { */ 'col': PickerColumn; } - interface IonPickerController { - /** - * Create a picker overlay with picker options. - * @param options The options to use to create the picker. - */ - 'create': (options: PickerOptions) => Promise; - /** - * Dismiss the open picker overlay. - * @param data Any data to emit in the dismiss events. - * @param role The role of the element that is dismissing the picker. This can be useful in a button handler for determining which button was clicked to dismiss the picker. Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. - * @param id The id of the picker to dismiss. If an id is not provided, it will dismiss the most recently opened picker. - */ - 'dismiss': (data?: any, role?: string | undefined, id?: string | undefined) => Promise; - /** - * Get the most recently opened picker overlay. - */ - 'getTop': () => Promise; - } interface IonPopover { /** * If `true`, the popover will animate. @@ -1833,24 +1674,6 @@ export namespace Components { */ 'translucent': boolean; } - interface IonPopoverController { - /** - * Create a popover overlay with popover options. - * @param options The options to use to create the popover. - */ - 'create': (options: PopoverOptions) => Promise; - /** - * Dismiss the open popover overlay. - * @param data Any data to emit in the dismiss events. - * @param role The role of the element that is dismissing the popover. This can be useful in a button handler for determining which button was clicked to dismiss the popover. Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. - * @param id The id of the popover to dismiss. If an id is not provided, it will dismiss the most recently opened popover. - */ - 'dismiss': (data?: any, role?: string | undefined, id?: string | undefined) => Promise; - /** - * Get the most recently opened popover overlay. - */ - 'getTop': () => Promise; - } interface IonProgressBar { /** * If the buffer and value are smaller than 1, the buffer circles will show. The buffer should be between [0, 1]. @@ -2755,24 +2578,6 @@ export namespace Components { */ 'translucent': boolean; } - interface IonToastController { - /** - * Create a toast overlay with toast options. - * @param options The options to use to create the toast. - */ - 'create': (options?: ToastOptions | undefined) => Promise; - /** - * Dismiss the open toast overlay. - * @param data Any data to emit in the dismiss events. - * @param role The role of the element that is dismissing the toast. For example, 'cancel' or 'backdrop'. - * @param id The id of the toast to dismiss. If an id is not provided, it will dismiss the most recently opened toast. - */ - 'dismiss': (data?: any, role?: string | undefined, id?: string | undefined) => Promise; - /** - * Get the most recently opened toast overlay. - */ - 'getTop': () => Promise; - } interface IonToggle { /** * If `true`, the toggle is selected. @@ -2887,24 +2692,12 @@ declare global { new (): HTMLIonActionSheetElement; }; - interface HTMLIonActionSheetControllerElement extends Components.IonActionSheetController, HTMLStencilElement {} - var HTMLIonActionSheetControllerElement: { - prototype: HTMLIonActionSheetControllerElement; - new (): HTMLIonActionSheetControllerElement; - }; - interface HTMLIonAlertElement extends Components.IonAlert, HTMLStencilElement {} var HTMLIonAlertElement: { prototype: HTMLIonAlertElement; new (): HTMLIonAlertElement; }; - interface HTMLIonAlertControllerElement extends Components.IonAlertController, HTMLStencilElement {} - var HTMLIonAlertControllerElement: { - prototype: HTMLIonAlertControllerElement; - new (): HTMLIonAlertControllerElement; - }; - interface HTMLIonAppElement extends Components.IonApp, HTMLStencilElement {} var HTMLIonAppElement: { prototype: HTMLIonAppElement; @@ -3127,12 +2920,6 @@ declare global { new (): HTMLIonLoadingElement; }; - interface HTMLIonLoadingControllerElement extends Components.IonLoadingController, HTMLStencilElement {} - var HTMLIonLoadingControllerElement: { - prototype: HTMLIonLoadingControllerElement; - new (): HTMLIonLoadingControllerElement; - }; - interface HTMLIonMenuElement extends Components.IonMenu, HTMLStencilElement {} var HTMLIonMenuElement: { prototype: HTMLIonMenuElement; @@ -3145,12 +2932,6 @@ declare global { new (): HTMLIonMenuButtonElement; }; - interface HTMLIonMenuControllerElement extends Components.IonMenuController, HTMLStencilElement {} - var HTMLIonMenuControllerElement: { - prototype: HTMLIonMenuControllerElement; - new (): HTMLIonMenuControllerElement; - }; - interface HTMLIonMenuToggleElement extends Components.IonMenuToggle, HTMLStencilElement {} var HTMLIonMenuToggleElement: { prototype: HTMLIonMenuToggleElement; @@ -3163,12 +2944,6 @@ declare global { new (): HTMLIonModalElement; }; - interface HTMLIonModalControllerElement extends Components.IonModalController, HTMLStencilElement {} - var HTMLIonModalControllerElement: { - prototype: HTMLIonModalControllerElement; - new (): HTMLIonModalControllerElement; - }; - interface HTMLIonNavElement extends Components.IonNav, HTMLStencilElement {} var HTMLIonNavElement: { prototype: HTMLIonNavElement; @@ -3199,24 +2974,12 @@ declare global { new (): HTMLIonPickerColumnElement; }; - interface HTMLIonPickerControllerElement extends Components.IonPickerController, HTMLStencilElement {} - var HTMLIonPickerControllerElement: { - prototype: HTMLIonPickerControllerElement; - new (): HTMLIonPickerControllerElement; - }; - interface HTMLIonPopoverElement extends Components.IonPopover, HTMLStencilElement {} var HTMLIonPopoverElement: { prototype: HTMLIonPopoverElement; new (): HTMLIonPopoverElement; }; - interface HTMLIonPopoverControllerElement extends Components.IonPopoverController, HTMLStencilElement {} - var HTMLIonPopoverControllerElement: { - prototype: HTMLIonPopoverControllerElement; - new (): HTMLIonPopoverControllerElement; - }; - interface HTMLIonProgressBarElement extends Components.IonProgressBar, HTMLStencilElement {} var HTMLIonProgressBarElement: { prototype: HTMLIonProgressBarElement; @@ -3427,12 +3190,6 @@ declare global { new (): HTMLIonToastElement; }; - interface HTMLIonToastControllerElement extends Components.IonToastController, HTMLStencilElement {} - var HTMLIonToastControllerElement: { - prototype: HTMLIonToastControllerElement; - new (): HTMLIonToastControllerElement; - }; - interface HTMLIonToggleElement extends Components.IonToggle, HTMLStencilElement {} var HTMLIonToggleElement: { prototype: HTMLIonToggleElement; @@ -3452,9 +3209,7 @@ declare global { }; interface HTMLElementTagNameMap { 'ion-action-sheet': HTMLIonActionSheetElement; - 'ion-action-sheet-controller': HTMLIonActionSheetControllerElement; 'ion-alert': HTMLIonAlertElement; - 'ion-alert-controller': HTMLIonAlertControllerElement; 'ion-app': HTMLIonAppElement; 'ion-avatar': HTMLIonAvatarElement; 'ion-back-button': HTMLIonBackButtonElement; @@ -3492,21 +3247,16 @@ declare global { 'ion-list': HTMLIonListElement; 'ion-list-header': HTMLIonListHeaderElement; 'ion-loading': HTMLIonLoadingElement; - 'ion-loading-controller': HTMLIonLoadingControllerElement; 'ion-menu': HTMLIonMenuElement; 'ion-menu-button': HTMLIonMenuButtonElement; - 'ion-menu-controller': HTMLIonMenuControllerElement; 'ion-menu-toggle': HTMLIonMenuToggleElement; 'ion-modal': HTMLIonModalElement; - 'ion-modal-controller': HTMLIonModalControllerElement; 'ion-nav': HTMLIonNavElement; 'ion-nav-link': HTMLIonNavLinkElement; 'ion-note': HTMLIonNoteElement; 'ion-picker': HTMLIonPickerElement; 'ion-picker-column': HTMLIonPickerColumnElement; - 'ion-picker-controller': HTMLIonPickerControllerElement; 'ion-popover': HTMLIonPopoverElement; - 'ion-popover-controller': HTMLIonPopoverControllerElement; 'ion-progress-bar': HTMLIonProgressBarElement; 'ion-radio': HTMLIonRadioElement; 'ion-radio-group': HTMLIonRadioGroupElement; @@ -3542,7 +3292,6 @@ declare global { 'ion-thumbnail': HTMLIonThumbnailElement; 'ion-title': HTMLIonTitleElement; 'ion-toast': HTMLIonToastElement; - 'ion-toast-controller': HTMLIonToastControllerElement; 'ion-toggle': HTMLIonToggleElement; 'ion-toolbar': HTMLIonToolbarElement; 'ion-virtual-scroll': HTMLIonVirtualScrollElement; @@ -3612,7 +3361,6 @@ declare namespace LocalJSX { */ 'translucent'?: boolean; } - interface IonActionSheetController {} interface IonAlert { /** * If `true`, the alert will animate. @@ -3683,7 +3431,6 @@ declare namespace LocalJSX { */ 'translucent'?: boolean; } - interface IonAlertController {} interface IonApp {} interface IonAvatar {} interface IonBackButton { @@ -4735,7 +4482,6 @@ declare namespace LocalJSX { */ 'translucent'?: boolean; } - interface IonLoadingController {} interface IonMenu { /** * The content's id the menu should use. @@ -4804,7 +4550,6 @@ declare namespace LocalJSX { */ 'type'?: 'submit' | 'reset' | 'button'; } - interface IonMenuController {} interface IonMenuToggle { /** * Automatically hides the content when the corresponding menu is not active. By default, it's `true`. Change it to `false` in order to keep `ion-menu-toggle` always visible regardless the state of the menu. @@ -4881,7 +4626,6 @@ declare namespace LocalJSX { */ 'swipeToClose'?: boolean; } - interface IonModalController {} interface IonNav { /** * If `true`, the nav should animate the transition of components. @@ -5004,7 +4748,6 @@ declare namespace LocalJSX { */ 'col': PickerColumn; } - interface IonPickerController {} interface IonPopover { /** * If `true`, the popover will animate. @@ -5071,7 +4814,6 @@ declare namespace LocalJSX { */ 'translucent'?: boolean; } - interface IonPopoverController {} interface IonProgressBar { /** * If the buffer and value are smaller than 1, the buffer circles will show. The buffer should be between [0, 1]. @@ -6014,7 +5756,6 @@ declare namespace LocalJSX { */ 'translucent'?: boolean; } - interface IonToastController {} interface IonToggle { /** * If `true`, the toggle is selected. @@ -6120,9 +5861,7 @@ declare namespace LocalJSX { interface IntrinsicElements { 'ion-action-sheet': IonActionSheet; - 'ion-action-sheet-controller': IonActionSheetController; 'ion-alert': IonAlert; - 'ion-alert-controller': IonAlertController; 'ion-app': IonApp; 'ion-avatar': IonAvatar; 'ion-back-button': IonBackButton; @@ -6160,21 +5899,16 @@ declare namespace LocalJSX { 'ion-list': IonList; 'ion-list-header': IonListHeader; 'ion-loading': IonLoading; - 'ion-loading-controller': IonLoadingController; 'ion-menu': IonMenu; 'ion-menu-button': IonMenuButton; - 'ion-menu-controller': IonMenuController; 'ion-menu-toggle': IonMenuToggle; 'ion-modal': IonModal; - 'ion-modal-controller': IonModalController; 'ion-nav': IonNav; 'ion-nav-link': IonNavLink; 'ion-note': IonNote; 'ion-picker': IonPicker; 'ion-picker-column': IonPickerColumn; - 'ion-picker-controller': IonPickerController; 'ion-popover': IonPopover; - 'ion-popover-controller': IonPopoverController; 'ion-progress-bar': IonProgressBar; 'ion-radio': IonRadio; 'ion-radio-group': IonRadioGroup; @@ -6210,7 +5944,6 @@ declare namespace LocalJSX { 'ion-thumbnail': IonThumbnail; 'ion-title': IonTitle; 'ion-toast': IonToast; - 'ion-toast-controller': IonToastController; 'ion-toggle': IonToggle; 'ion-toolbar': IonToolbar; 'ion-virtual-scroll': IonVirtualScroll; @@ -6224,9 +5957,7 @@ declare module "@stencil/core" { export namespace JSX { interface IntrinsicElements { 'ion-action-sheet': LocalJSX.IonActionSheet & JSXBase.HTMLAttributes; - 'ion-action-sheet-controller': LocalJSX.IonActionSheetController & JSXBase.HTMLAttributes; 'ion-alert': LocalJSX.IonAlert & JSXBase.HTMLAttributes; - 'ion-alert-controller': LocalJSX.IonAlertController & JSXBase.HTMLAttributes; 'ion-app': LocalJSX.IonApp & JSXBase.HTMLAttributes; 'ion-avatar': LocalJSX.IonAvatar & JSXBase.HTMLAttributes; 'ion-back-button': LocalJSX.IonBackButton & JSXBase.HTMLAttributes; @@ -6264,21 +5995,16 @@ declare module "@stencil/core" { 'ion-list': LocalJSX.IonList & JSXBase.HTMLAttributes; 'ion-list-header': LocalJSX.IonListHeader & JSXBase.HTMLAttributes; 'ion-loading': LocalJSX.IonLoading & JSXBase.HTMLAttributes; - 'ion-loading-controller': LocalJSX.IonLoadingController & JSXBase.HTMLAttributes; 'ion-menu': LocalJSX.IonMenu & JSXBase.HTMLAttributes; 'ion-menu-button': LocalJSX.IonMenuButton & JSXBase.HTMLAttributes; - 'ion-menu-controller': LocalJSX.IonMenuController & JSXBase.HTMLAttributes; 'ion-menu-toggle': LocalJSX.IonMenuToggle & JSXBase.HTMLAttributes; 'ion-modal': LocalJSX.IonModal & JSXBase.HTMLAttributes; - 'ion-modal-controller': LocalJSX.IonModalController & JSXBase.HTMLAttributes; 'ion-nav': LocalJSX.IonNav & JSXBase.HTMLAttributes; 'ion-nav-link': LocalJSX.IonNavLink & JSXBase.HTMLAttributes; 'ion-note': LocalJSX.IonNote & JSXBase.HTMLAttributes; 'ion-picker': LocalJSX.IonPicker & JSXBase.HTMLAttributes; 'ion-picker-column': LocalJSX.IonPickerColumn & JSXBase.HTMLAttributes; - 'ion-picker-controller': LocalJSX.IonPickerController & JSXBase.HTMLAttributes; 'ion-popover': LocalJSX.IonPopover & JSXBase.HTMLAttributes; - 'ion-popover-controller': LocalJSX.IonPopoverController & JSXBase.HTMLAttributes; 'ion-progress-bar': LocalJSX.IonProgressBar & JSXBase.HTMLAttributes; 'ion-radio': LocalJSX.IonRadio & JSXBase.HTMLAttributes; 'ion-radio-group': LocalJSX.IonRadioGroup & JSXBase.HTMLAttributes; @@ -6314,7 +6040,6 @@ declare module "@stencil/core" { 'ion-thumbnail': LocalJSX.IonThumbnail & JSXBase.HTMLAttributes; 'ion-title': LocalJSX.IonTitle & JSXBase.HTMLAttributes; 'ion-toast': LocalJSX.IonToast & JSXBase.HTMLAttributes; - 'ion-toast-controller': LocalJSX.IonToastController & JSXBase.HTMLAttributes; 'ion-toggle': LocalJSX.IonToggle & JSXBase.HTMLAttributes; 'ion-toolbar': LocalJSX.IonToolbar & JSXBase.HTMLAttributes; 'ion-virtual-scroll': LocalJSX.IonVirtualScroll & JSXBase.HTMLAttributes; diff --git a/core/src/components/action-sheet-controller/action-sheet-controller.tsx b/core/src/components/action-sheet-controller/action-sheet-controller.tsx deleted file mode 100644 index e74019743d..0000000000 --- a/core/src/components/action-sheet-controller/action-sheet-controller.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { Build, Component, ComponentInterface, Method } from '@stencil/core'; - -import { ActionSheetOptions, OverlayController } from '../../interface'; -import { createOverlay, dismissOverlay, getOverlay } from '../../utils/overlays'; - -/** - * @deprecated Use the `actionSheetController` exported from core. - */ -@Component({ - tag: 'ion-action-sheet-controller' -}) -export class ActionSheetController implements ComponentInterface, OverlayController { - - constructor() { - if (Build.isDev) { - console.warn(`[DEPRECATED][ion-action-sheet-controller] Use the actionSheetController export from @ionic/core: - import { actionSheetController } from '@ionic/core'; - const actionSheet = await actionSheetController.create({...});`); - } - } - - /** - * Create an action sheet overlay with action sheet options. - * - * @param options The options to use to create the action sheet. - */ - @Method() - create(options: ActionSheetOptions): Promise { - return createOverlay('ion-action-sheet', options); - } - - /** - * Dismiss the open action sheet overlay. - * - * @param data Any data to emit in the dismiss events. - * @param role The role of the element that is dismissing the action sheet. - * This can be useful in a button handler for determining which button was - * clicked to dismiss the action sheet. - * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. - * @param id The id of the action sheet to dismiss. If an id is not provided, it will dismiss the most recently opened action sheet. - */ - @Method() - dismiss(data?: any, role?: string, id?: string) { - return dismissOverlay(document, data, role, 'ion-action-sheet', id); - } - - /** - * Get the most recently opened action sheet overlay. - */ - @Method() - async getTop(): Promise { - return getOverlay(document, 'ion-action-sheet') as HTMLIonActionSheetElement; - } -} diff --git a/core/src/components/action-sheet-controller/readme.md b/core/src/components/action-sheet-controller/readme.md deleted file mode 100644 index 913d88f193..0000000000 --- a/core/src/components/action-sheet-controller/readme.md +++ /dev/null @@ -1,45 +0,0 @@ -# ion-action-sheet-controller - -Action Sheet controllers programmatically control the action sheet component. Action Sheets can be created and dismissed from the action sheet controller. View the [Action Sheet](../action-sheet) documentation for a full list of options to pass upon creation. - - - - -> **[DEPRECATED]** Use the `actionSheetController` exported from core. - -## Methods - -### `create(options: ActionSheetOptions) => Promise` - -Create an action sheet overlay with action sheet options. - -#### Returns - -Type: `Promise` - - - -### `dismiss(data?: any, role?: string | undefined, id?: string | undefined) => Promise` - -Dismiss the open action sheet overlay. - -#### Returns - -Type: `Promise` - - - -### `getTop() => Promise` - -Get the most recently opened action sheet overlay. - -#### Returns - -Type: `Promise` - - - - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/core/src/components/action-sheet/test/basic/index.html b/core/src/components/action-sheet/test/basic/index.html index 07813c7b8f..7771929482 100644 --- a/core/src/components/action-sheet/test/basic/index.html +++ b/core/src/components/action-sheet/test/basic/index.html @@ -10,6 +10,10 @@ + @@ -57,11 +61,14 @@ diff --git a/core/src/components/action-sheet/test/spec/index.html b/core/src/components/action-sheet/test/spec/index.html index 1077ae3f87..55f0781be8 100644 --- a/core/src/components/action-sheet/test/spec/index.html +++ b/core/src/components/action-sheet/test/spec/index.html @@ -10,7 +10,10 @@ - + @@ -31,8 +34,7 @@ async function presentSpec() { const mode = Ionic.mode; - - const actionSheetElement = Object.assign(document.createElement('ion-action-sheet'), { + const actionSheet = await actionSheetController.create({ header: "Open in", buttons: [{ text: 'Item 1', @@ -66,8 +68,7 @@ } }] }); - document.body.appendChild(actionSheetElement); - await actionSheetElement.present(); + await actionSheet.present(); } diff --git a/core/src/components/action-sheet/test/standalone/index.html b/core/src/components/action-sheet/test/standalone/index.html index 499d6cf465..3c5a3644bd 100644 --- a/core/src/components/action-sheet/test/standalone/index.html +++ b/core/src/components/action-sheet/test/standalone/index.html @@ -10,7 +10,10 @@ - + @@ -37,8 +40,13 @@ diff --git a/core/src/components/action-sheet/test/translucent/index.html b/core/src/components/action-sheet/test/translucent/index.html index ed0b5c31ad..a7f3d4221d 100644 --- a/core/src/components/action-sheet/test/translucent/index.html +++ b/core/src/components/action-sheet/test/translucent/index.html @@ -10,7 +10,10 @@ - + @@ -46,12 +49,15 @@ diff --git a/core/src/components/alert-controller/alert-controller.tsx b/core/src/components/alert-controller/alert-controller.tsx deleted file mode 100644 index cd4f392675..0000000000 --- a/core/src/components/alert-controller/alert-controller.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { Build, Component, ComponentInterface, Method } from '@stencil/core'; - -import { AlertOptions, OverlayController } from '../../interface'; -import { createOverlay, dismissOverlay, getOverlay } from '../../utils/overlays'; - -/** - * @deprecated Use the `alertController` exported from core. - */ -@Component({ - tag: 'ion-alert-controller' -}) -export class AlertController implements ComponentInterface, OverlayController { - - constructor() { - if (Build.isDev) { - console.warn(`[DEPRECATED][ion-alert-controller] Use the alertController export from @ionic/core: - import { alertController } from '@ionic/core'; - const alert = await alertController.create({...});`); - } - } - - /** - * Create an alert overlay with alert options. - * - * @param options The options to use to create the alert. - */ - @Method() - create(options: AlertOptions): Promise { - return createOverlay('ion-alert', options); - } - - /** - * Dismiss the open alert overlay. - * - * @param data Any data to emit in the dismiss events. - * @param role The role of the element that is dismissing the alert. - * This can be useful in a button handler for determining which button was - * clicked to dismiss the alert. - * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. - * @param id The id of the alert to dismiss. If an id is not provided, it will dismiss the most recently opened alert. - */ - @Method() - dismiss(data?: any, role?: string, id?: string) { - return dismissOverlay(document, data, role, 'ion-alert', id); - } - - /** - * Get the most recently opened alert overlay. - */ - @Method() - async getTop(): Promise { - return getOverlay(document, 'ion-alert') as HTMLIonAlertElement; - } -} diff --git a/core/src/components/alert-controller/readme.md b/core/src/components/alert-controller/readme.md deleted file mode 100644 index 743ea43cdb..0000000000 --- a/core/src/components/alert-controller/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# ion-alert-controller - -Alert controllers programmatically control the alert component. Alerts can be created and dismissed by the alert controller. View the [Alert](../alert) documentation for the list of options to pass upon creation and usage information. - - - - - -> **[DEPRECATED]** Use the `alertController` exported from core. - -## Methods - -### `create(options: AlertOptions) => Promise` - -Create an alert overlay with alert options. - -#### Returns - -Type: `Promise` - - - -### `dismiss(data?: any, role?: string | undefined, id?: string | undefined) => Promise` - -Dismiss the open alert overlay. - -#### Returns - -Type: `Promise` - - - -### `getTop() => Promise` - -Get the most recently opened alert overlay. - -#### Returns - -Type: `Promise` - - - - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/core/src/components/alert/test/basic/index.html b/core/src/components/alert/test/basic/index.html index cfa15748b5..216e54a571 100644 --- a/core/src/components/alert/test/basic/index.html +++ b/core/src/components/alert/test/basic/index.html @@ -10,7 +10,11 @@ - + + @@ -45,50 +49,45 @@ window.addEventListener('ionAlertDidDismiss', function (e) { console.log('didDismiss', e) }) window.addEventListener('ionAlertWillDismiss', function (e) { console.log('willDismiss', e) }) - + async function openAlert(opts) { + const alert = await alertController.create(opts); + await alert.present(); + } function presentAlert() { - const alert = Object.assign(document.createElement('ion-alert'), { + openAlert({ header: 'Alert', subHeader: 'Subtitle', message: 'This is an alert message.', buttons: ['OK'] }); - document.body.append(alert); - return alert.present(); } function presentAlertLongMessage() { - const alert = Object.assign(document.createElement('ion-alert'), { + openAlert({ header: 'Alert', message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum hendrerit diam lorem, a faucibus turpis sagittis eu. In finibus augue in dui varius convallis. Donec vulputate nibh gravida odio vulputate commodo. Suspendisse imperdiet consequat egestas. Nulla feugiat consequat urna eu tincidunt. Cras nec blandit turpis, eu auctor nunc. Pellentesque finibus, magna eu vestibulum imperdiet, arcu ex lacinia massa, eget volutpat quam leo a orci. Etiam mauris est, elementum at feugiat at, dictum in sapien. Mauris efficitur eros sodales convallis egestas. Phasellus eu faucibus nisl. In eu diam vitae libero egestas lacinia. Integer sed convallis metus, nec commodo felis. Duis libero augue, ornare at tempus non, posuere vel augue. Cras mattis dui at tristique aliquam. Phasellus fermentum nibh ligula, porta hendrerit ligula elementum eu. Suspendisse sollicitudin enim at libero iaculis pulvinar. Donec ac massa id purus laoreet rutrum quis eu urna. Mauris luctus erat vel magna porttitor, vel varius erat rhoncus. Donec eu turpis vestibulum, feugiat urna id, gravida mauris. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer at lobortis tortor. Nam ultrices volutpat elit, sed pharetra nulla suscipit at. Nunc eu accumsan eros, id auctor libero. Suspendisse potenti. Nam vitae dapibus metus. Maecenas nisi dui, sagittis et condimentum eu, bibendum vel eros. Vivamus malesuada, tortor in accumsan iaculis, urna velit consectetur ante, nec semper sem diam a diam. In et semper ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus blandit, velit vel porttitor euismod, neque risus blandit nulla, non laoreet libero dolor et odio. Nulla enim risus, feugiat eu urna sed, ultrices semper felis. Sed blandit mi diam. Nunc quis mi ligula. Pellentesque a elit eu orci volutpat egestas. Aenean fermentum eleifend quam, ut tincidunt eros tristique et. Nam dapibus tincidunt ligula, id faucibus felis sodales quis. Donec tincidunt lectus ipsum, ac semper tellus cursus ac. Vestibulum nec dui a lectus accumsan vestibulum quis et velit. Aliquam finibus justo et odio euismod, viverra condimentum eros tristique. Sed eget luctus risus. Pellentesque lorem magna, dictum non congue sodales, laoreet eget quam. In sagittis vulputate dolor a ultricies. Donec viverra leo sed ex maximus, in finibus elit gravida. Aliquam posuere vulputate mi. Suspendisse potenti. Nunc consectetur congue arcu, at pharetra dui varius non. Etiam vestibulum congue felis, id ullamcorper neque convallis ultrices. Aenean congue, diam a iaculis mollis, nisl eros maximus arcu, nec hendrerit purus felis porta diam. Nullam vitae ultrices dui, ac dictum sapien. Phasellus eu magna luctus, varius urna id, molestie quam. Nulla in semper tellus. Curabitur lacinia tellus sit amet lacinia dapibus. Sed id condimentum tellus, nec aliquam sapien. Vivamus luctus at ante a tincidunt.', buttons: ['Cancel', 'OK'] }); - document.body.append(alert); - return alert.present(); } function presentAlertMultipleButtons() { - const alert = Object.assign(document.createElement('ion-alert'), { + openAlert({ header: 'Alert', subHeader: 'Subtitle', message: 'This is an alert message.', buttons: ['Cancel', 'Open Modal', 'Delete'] }); - document.body.append(alert); - return alert.present(); } function presentAlertNoMessage() { - const alert = Object.assign(document.createElement('ion-alert'), { + openAlert({ header: 'Alert', buttons: ['OK'] }); - document.body.append(alert); - return alert.present(); } function presentAlertConfirm() { - const alert = Object.assign(document.createElement('ion-alert'), { + openAlert({ header: 'Confirm!', message: 'Message text!!!', buttons: [ @@ -107,12 +106,10 @@ } ] }); - document.body.append(alert); - return alert.present(); } function presentAlertPrompt() { - const alert = Object.assign(document.createElement('ion-alert'), { + openAlert({ header: 'Prompt!', inputs: [ { @@ -182,12 +179,10 @@ } ] }); - document.body.append(alert); - return alert.present(); } function presentAlertRadio() { - const alert = Object.assign(document.createElement('ion-alert'), { + openAlert({ header: 'Radio', inputs: [ { @@ -239,12 +234,10 @@ } ] }); - document.body.append(alert); - return alert.present(); } function presentAlertCheckbox() { - const alert = Object.assign(document.createElement('ion-alert'), { + openAlert({ header: 'Checkbox', inputs: [ { @@ -301,12 +294,10 @@ } ] }); - document.body.append(alert); - return alert.present(); } function presentWithCssClass() { - const alert = Object.assign(document.createElement('ion-alert'), { + openAlert({ header: 'Alert', subHeader: 'Subtitle', cssClass: 'my-class my-custom-class ', @@ -319,8 +310,6 @@ } }] }); - document.body.append(alert); - return alert.present(); } diff --git a/core/src/components/alert/test/preview/index.html b/core/src/components/alert/test/preview/index.html deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/core/src/components/alert/test/standalone/index.html b/core/src/components/alert/test/standalone/index.html index fcc75e716d..a52a03ff80 100644 --- a/core/src/components/alert/test/standalone/index.html +++ b/core/src/components/alert/test/standalone/index.html @@ -10,7 +10,11 @@ - + + @@ -75,50 +79,45 @@ diff --git a/core/src/components/alert/test/translucent/index.html b/core/src/components/alert/test/translucent/index.html index 4588a69790..bc48286175 100644 --- a/core/src/components/alert/test/translucent/index.html +++ b/core/src/components/alert/test/translucent/index.html @@ -10,7 +10,11 @@ - + + @@ -50,53 +54,49 @@ diff --git a/core/src/components/loading-controller/loading-controller.tsx b/core/src/components/loading-controller/loading-controller.tsx deleted file mode 100644 index 88058c5a57..0000000000 --- a/core/src/components/loading-controller/loading-controller.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { Build, Component, ComponentInterface, Method } from '@stencil/core'; - -import { LoadingOptions, OverlayController } from '../../interface'; -import { createOverlay, dismissOverlay, getOverlay } from '../../utils/overlays'; - -/** - * @deprecated Use the `loadingController` exported from core. - */ -@Component({ - tag: 'ion-loading-controller' -}) -export class LoadingController implements ComponentInterface, OverlayController { - - constructor() { - if (Build.isDev) { - console.warn(`[DEPRECATED][ion-loading-controller] Use the loadingController export from @ionic/core: - import { loadingController } from '@ionic/core'; - const modal = await loadingController.create({...});`); - } - } - - /** - * Create a loading overlay with loading options. - * - * @param options The options to use to create the loading. - */ - @Method() - create(options?: LoadingOptions): Promise { - return createOverlay('ion-loading', options); - } - - /** - * Dismiss the open loading overlay. - * - * @param data Any data to emit in the dismiss events. - * @param role The role of the element that is dismissing the loading. - * This can be useful in a button handler for determining which button was - * clicked to dismiss the loading. - * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. - * @param id The id of the loading to dismiss. If an id is not provided, it will dismiss the most recently opened loading. - */ - @Method() - dismiss(data?: any, role?: string, id?: string) { - return dismissOverlay(document, data, role, 'ion-loading', id); - } - - /** - * Get the most recently opened loading overlay. - */ - @Method() - async getTop(): Promise { - return getOverlay(document, 'ion-loading') as HTMLIonLoadingElement; - } -} diff --git a/core/src/components/loading-controller/readme.md b/core/src/components/loading-controller/readme.md deleted file mode 100644 index 6ab1e09837..0000000000 --- a/core/src/components/loading-controller/readme.md +++ /dev/null @@ -1,48 +0,0 @@ -# ion-loading-controller - -Loading controllers programmatically control the loading component. Loadings can be created and dismissed from the loading controller. View the [Loading](../loading) documentation for a full list of options to pass upon creation. - - - - - - - -> **[DEPRECATED]** Use the `loadingController` exported from core. - -## Methods - -### `create(options?: LoadingOptions | undefined) => Promise` - -Create a loading overlay with loading options. - -#### Returns - -Type: `Promise` - - - -### `dismiss(data?: any, role?: string | undefined, id?: string | undefined) => Promise` - -Dismiss the open loading overlay. - -#### Returns - -Type: `Promise` - - - -### `getTop() => Promise` - -Get the most recently opened loading overlay. - -#### Returns - -Type: `Promise` - - - - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/core/src/components/loading/test/basic/index.html b/core/src/components/loading/test/basic/index.html index 13fec93364..f6836bb4eb 100644 --- a/core/src/components/loading/test/basic/index.html +++ b/core/src/components/loading/test/basic/index.html @@ -10,7 +10,10 @@ - + @@ -21,14 +24,14 @@ - Show Loading - Show Default Loading - Show Loading with long message - Show Loading with no spinner - Show Loading with translucent - Show Loading with cssClass - Show Backdrop Click Loading - Show Loading with HTML content + Show Loading + Show Default Loading + Show Loading with long message + Show Loading with no spinner + Show Loading with translucent + Show Loading with cssClass + Show Backdrop Click Loading + Show Loading with HTML content @@ -62,19 +65,9 @@ diff --git a/core/src/components/loading/test/standalone/index.html b/core/src/components/loading/test/standalone/index.html index c1ebb92f0d..4c470d7561 100644 --- a/core/src/components/loading/test/standalone/index.html +++ b/core/src/components/loading/test/standalone/index.html @@ -10,13 +10,16 @@ - + - - - - - + + + + + diff --git a/core/src/components/menu-controller/menu-controller.ts b/core/src/components/menu-controller/menu-controller.ts deleted file mode 100644 index 7ac2e588f0..0000000000 --- a/core/src/components/menu-controller/menu-controller.ts +++ /dev/null @@ -1,155 +0,0 @@ -import { Build, Component, Method } from '@stencil/core'; - -import { AnimationBuilder } from '../../interface'; -import { menuController } from '../../utils/menu-controller'; - -@Component({ - tag: 'ion-menu-controller' -}) -export class MenuController { - - constructor() { - if (Build.isDev) { - console.warn(`[DEPRECATED][ion-menu-controller] Use the menuController export from @ionic/core: - import { menuController } from '@ionic/core';`); - } - } - - /** - * Open the menu. If a menu is not provided then it will open the first - * menu found. If the specified menu is `start` or `end`, then it will open - * the enabled menu on that side. Otherwise, it will try to find the menu - * using the menu's `id` property. If a menu is not found then it will - * return `false`. - * - * @param menu The menuId or side of the menu to open. - */ - @Method() - open(menu?: string | null) { - return menuController.open(menu); - } - - /** - * Close the menu. If a menu is specified, it will close that menu. - * If no menu is specified, then it will close any menu that is open. - * If it does not find any open menus, it will return `false`. - * - * @param menu The menuId or side of the menu to close. - */ - @Method() - close(menu?: string | null) { - return menuController.close(menu); - } - - /** - * Toggle the menu open or closed. If the menu is already open, it will try to - * close the menu, otherwise it will try to open it. Returns `false` if - * a menu is not found. - * - * @param menu The menuId or side of the menu to toggle. - */ - @Method() - toggle(menu?: string | null) { - return menuController.toggle(menu); - } - - /** - * Enable or disable a menu. Disabling a menu will not allow gestures - * for that menu or any calls to open it. This is useful when there are - * multiple menus on the same side and only one of them should be allowed - * to open. Enabling a menu will automatically disable all other menus - * on that side. - * - * @param enable If `true`, the menu should be enabled. - * @param menu The menuId or side of the menu to enable or disable. - */ - @Method() - enable(enable: boolean, menu?: string | null) { - return menuController.enable(enable, menu); - } - - /** - * Enable or disable the ability to swipe open the menu. - * - * @param enable If `true`, the menu swipe gesture should be enabled. - * @param menu The menuId or side of the menu to enable or disable the swipe gesture on. - */ - @Method() - swipeGesture(enable: boolean, menu?: string | null) { - return menuController.swipeGesture(enable, menu); - } - - /** - * Get whether or not the menu is open. Returns `true` if the specified - * menu is open. If a menu is not specified, it will return `true` if - * any menu is currently open. - * - * @param menu The menuId or side of the menu that is being checked. - */ - @Method() - isOpen(menu?: string | null) { - return menuController.isOpen(menu); - } - - /** - * Get whether or not the menu is enabled. Returns `true` if the - * specified menu is enabled. Returns `false` if a menu is disabled - * or not found. - * - * @param menu The menuId or side of the menu that is being checked. - */ - @Method() - isEnabled(menu?: string | null) { - return menuController.isEnabled(menu); - } - - /** - * Get a menu instance. If a menu is not provided then it will return the first - * menu found. If the specified menu is `start` or `end`, then it will return the - * enabled menu on that side. Otherwise, it will try to find the menu using the menu's - * `id` property. If a menu is not found then it will return `null`. - * - * @param menu The menuId or side of the menu. - */ - @Method() - get(menu?: string | null) { - return menuController.get(menu); - } - - /** - * Get the instance of the opened menu. Returns `null` if a menu is not found. - */ - @Method() - getOpen() { - return menuController.getOpen(); - } - - /** - * Get all menu instances. - */ - @Method() - getMenus() { - return menuController.getMenus(); - } - - /** - * Get whether or not a menu is animating. Returns `true` if any - * menu is currently animating. - */ - @Method() - isAnimating() { - return menuController.isAnimating(); - } - - /** - * Registers a new animation that can be used with any `ion-menu` by - * passing the name of the animation in its `type` property. - * - * @param name The name of the animation to register. - * @param animation The animation function to register. - */ - @Method() - async registerAnimation(name: string, animation: AnimationBuilder) { - return menuController.registerAnimation(name, animation as any); - } -} diff --git a/core/src/components/menu-controller/readme.md b/core/src/components/menu-controller/readme.md deleted file mode 100644 index 9237e2d39c..0000000000 --- a/core/src/components/menu-controller/readme.md +++ /dev/null @@ -1,155 +0,0 @@ -# ion-menu-controller - -The Menu Controller makes it easy to control a Menu. The methods provided can be used to display the menu, enable the menu, toggle the menu, and more. The controller will grab a reference to the menu by the side, or id. if neither of these are passed to it, it will grab the first menu it finds. - - - - - -## Methods - -### `close(menu?: string | null | undefined) => Promise` - -Close the menu. If a menu is specified, it will close that menu. -If no menu is specified, then it will close any menu that is open. -If it does not find any open menus, it will return `false`. - -#### Returns - -Type: `Promise` - - - -### `enable(enable: boolean, menu?: string | null | undefined) => Promise` - -Enable or disable a menu. Disabling a menu will not allow gestures -for that menu or any calls to open it. This is useful when there are -multiple menus on the same side and only one of them should be allowed -to open. Enabling a menu will automatically disable all other menus -on that side. - -#### Returns - -Type: `Promise` - - - -### `get(menu?: string | null | undefined) => Promise` - -Get a menu instance. If a menu is not provided then it will return the first -menu found. If the specified menu is `start` or `end`, then it will return the -enabled menu on that side. Otherwise, it will try to find the menu using the menu's -`id` property. If a menu is not found then it will return `null`. - -#### Returns - -Type: `Promise` - - - -### `getMenus() => Promise` - -Get all menu instances. - -#### Returns - -Type: `Promise` - - - -### `getOpen() => Promise` - -Get the instance of the opened menu. Returns `null` if a menu is not found. - -#### Returns - -Type: `Promise` - - - -### `isAnimating() => Promise` - -Get whether or not a menu is animating. Returns `true` if any -menu is currently animating. - -#### Returns - -Type: `Promise` - - - -### `isEnabled(menu?: string | null | undefined) => Promise` - -Get whether or not the menu is enabled. Returns `true` if the -specified menu is enabled. Returns `false` if a menu is disabled -or not found. - -#### Returns - -Type: `Promise` - - - -### `isOpen(menu?: string | null | undefined) => Promise` - -Get whether or not the menu is open. Returns `true` if the specified -menu is open. If a menu is not specified, it will return `true` if -any menu is currently open. - -#### Returns - -Type: `Promise` - - - -### `open(menu?: string | null | undefined) => Promise` - -Open the menu. If a menu is not provided then it will open the first -menu found. If the specified menu is `start` or `end`, then it will open -the enabled menu on that side. Otherwise, it will try to find the menu -using the menu's `id` property. If a menu is not found then it will -return `false`. - -#### Returns - -Type: `Promise` - - - -### `registerAnimation(name: string, animation: AnimationBuilder) => Promise` - -Registers a new animation that can be used with any `ion-menu` by -passing the name of the animation in its `type` property. - -#### Returns - -Type: `Promise` - - - -### `swipeGesture(enable: boolean, menu?: string | null | undefined) => Promise` - -Enable or disable the ability to swipe open the menu. - -#### Returns - -Type: `Promise` - - - -### `toggle(menu?: string | null | undefined) => Promise` - -Toggle the menu open or closed. If the menu is already open, it will try to -close the menu, otherwise it will try to open it. Returns `false` if -a menu is not found. - -#### Returns - -Type: `Promise` - - - - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/core/src/components/menu-toggle/test/button/index.html b/core/src/components/menu-toggle/test/button/index.html index e423c5173e..e6cc1f50e9 100644 --- a/core/src/components/menu-toggle/test/button/index.html +++ b/core/src/components/menu-toggle/test/button/index.html @@ -63,7 +63,6 @@ - diff --git a/core/src/components/menu-toggle/test/list/index.html b/core/src/components/menu-toggle/test/list/index.html index d4b349875d..37312a0510 100644 --- a/core/src/components/menu-toggle/test/list/index.html +++ b/core/src/components/menu-toggle/test/list/index.html @@ -10,7 +10,6 @@ - @@ -238,7 +237,6 @@ - diff --git a/core/src/components/menu/test/standalone/index.html b/core/src/components/menu/test/standalone/index.html index 9c9b9b0be9..539a50447d 100644 --- a/core/src/components/menu/test/standalone/index.html +++ b/core/src/components/menu/test/standalone/index.html @@ -9,7 +9,12 @@ -