mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 10:01:59 +08:00
fix(overlays): dismiss last overlay
This commit is contained in:
14
core/src/components.d.ts
vendored
14
core/src/components.d.ts
vendored
@ -74,7 +74,7 @@ export namespace Components {
|
|||||||
/**
|
/**
|
||||||
* Dismiss the open action sheet overlay.
|
* Dismiss the open action sheet overlay.
|
||||||
*/
|
*/
|
||||||
'dismiss': (data?: any, role?: string | undefined, actionSheetId?: number) => Promise<void>;
|
'dismiss': (data?: any, role?: string | undefined, actionSheetId?: number | undefined) => Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Get the most recently opened action sheet overlay.
|
* Get the most recently opened action sheet overlay.
|
||||||
*/
|
*/
|
||||||
@ -223,7 +223,7 @@ export namespace Components {
|
|||||||
/**
|
/**
|
||||||
* Dismiss the open alert overlay.
|
* Dismiss the open alert overlay.
|
||||||
*/
|
*/
|
||||||
'dismiss': (data?: any, role?: string | undefined, alertId?: number) => Promise<void>;
|
'dismiss': (data?: any, role?: string | undefined, alertId?: number | undefined) => Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Get the most recently opened alert overlay.
|
* Get the most recently opened alert overlay.
|
||||||
*/
|
*/
|
||||||
@ -2229,7 +2229,7 @@ export namespace Components {
|
|||||||
/**
|
/**
|
||||||
* Dismiss the open loading overlay.
|
* Dismiss the open loading overlay.
|
||||||
*/
|
*/
|
||||||
'dismiss': (data?: any, role?: string | undefined, loadingId?: number) => Promise<void>;
|
'dismiss': (data?: any, role?: string | undefined, loadingId?: number | undefined) => Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Get the most recently opened loading overlay.
|
* Get the most recently opened loading overlay.
|
||||||
*/
|
*/
|
||||||
@ -2572,7 +2572,7 @@ export namespace Components {
|
|||||||
/**
|
/**
|
||||||
* Dismiss the open modal overlay.
|
* Dismiss the open modal overlay.
|
||||||
*/
|
*/
|
||||||
'dismiss': (data?: any, role?: string | undefined, modalId?: number) => Promise<void>;
|
'dismiss': (data?: any, role?: string | undefined, modalId?: number | undefined) => Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Get the most recently opened modal overlay.
|
* Get the most recently opened modal overlay.
|
||||||
*/
|
*/
|
||||||
@ -2880,7 +2880,7 @@ export namespace Components {
|
|||||||
|
|
||||||
interface IonPickerController {
|
interface IonPickerController {
|
||||||
'create': (opts?: PickerOptions | undefined) => Promise<HTMLIonPickerElement>;
|
'create': (opts?: PickerOptions | undefined) => Promise<HTMLIonPickerElement>;
|
||||||
'dismiss': (data?: any, role?: string | undefined, pickerId?: number) => Promise<void>;
|
'dismiss': (data?: any, role?: string | undefined, pickerId?: number | undefined) => Promise<void>;
|
||||||
'getTop': () => HTMLIonPickerElement;
|
'getTop': () => HTMLIonPickerElement;
|
||||||
}
|
}
|
||||||
interface IonPickerControllerAttributes extends StencilHTMLAttributes {}
|
interface IonPickerControllerAttributes extends StencilHTMLAttributes {}
|
||||||
@ -3024,7 +3024,7 @@ export namespace Components {
|
|||||||
/**
|
/**
|
||||||
* Dismiss the open popover overlay.
|
* Dismiss the open popover overlay.
|
||||||
*/
|
*/
|
||||||
'dismiss': (data?: any, role?: string | undefined, popoverId?: number) => Promise<void>;
|
'dismiss': (data?: any, role?: string | undefined, popoverId?: number | undefined) => Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Get the most recently opened popover overlay.
|
* Get the most recently opened popover overlay.
|
||||||
*/
|
*/
|
||||||
@ -4861,7 +4861,7 @@ export namespace Components {
|
|||||||
/**
|
/**
|
||||||
* Dismiss the open toast overlay.
|
* Dismiss the open toast overlay.
|
||||||
*/
|
*/
|
||||||
'dismiss': (data?: any, role?: string | undefined, toastId?: number) => Promise<void>;
|
'dismiss': (data?: any, role?: string | undefined, toastId?: number | undefined) => Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Get the most recently opened toast overlay.
|
* Get the most recently opened toast overlay.
|
||||||
*/
|
*/
|
||||||
|
@ -22,7 +22,7 @@ export class ActionSheetController implements OverlayController {
|
|||||||
* Dismiss the open action sheet overlay.
|
* Dismiss the open action sheet overlay.
|
||||||
*/
|
*/
|
||||||
@Method()
|
@Method()
|
||||||
dismiss(data?: any, role?: string, actionSheetId = -1) {
|
dismiss(data?: any, role?: string, actionSheetId?: number) {
|
||||||
return dismissOverlay(this.doc, data, role, 'ion-action-sheet', actionSheetId);
|
return dismissOverlay(this.doc, data, role, 'ion-action-sheet', actionSheetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ export class AlertController implements OverlayController {
|
|||||||
* Dismiss the open alert overlay.
|
* Dismiss the open alert overlay.
|
||||||
*/
|
*/
|
||||||
@Method()
|
@Method()
|
||||||
dismiss(data?: any, role?: string, alertId = -1) {
|
dismiss(data?: any, role?: string, alertId?: number) {
|
||||||
return dismissOverlay(this.doc, data, role, 'ion-alert', alertId);
|
return dismissOverlay(this.doc, data, role, 'ion-alert', alertId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ export class LoadingController implements OverlayController {
|
|||||||
* Dismiss the open loading overlay.
|
* Dismiss the open loading overlay.
|
||||||
*/
|
*/
|
||||||
@Method()
|
@Method()
|
||||||
dismiss(data?: any, role?: string, loadingId = -1) {
|
dismiss(data?: any, role?: string, loadingId?: number) {
|
||||||
return dismissOverlay(this.doc, data, role, 'ion-loading', loadingId);
|
return dismissOverlay(this.doc, data, role, 'ion-loading', loadingId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ export class ModalController implements OverlayController {
|
|||||||
* Dismiss the open modal overlay.
|
* Dismiss the open modal overlay.
|
||||||
*/
|
*/
|
||||||
@Method()
|
@Method()
|
||||||
dismiss(data?: any, role?: string, modalId = -1) {
|
dismiss(data?: any, role?: string, modalId?: number) {
|
||||||
return dismissOverlay(this.doc, data, role, 'ion-modal', modalId);
|
return dismissOverlay(this.doc, data, role, 'ion-modal', modalId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ export class PickerController implements OverlayController {
|
|||||||
* Dismiss the open picker overlay.
|
* Dismiss the open picker overlay.
|
||||||
*/
|
*/
|
||||||
@Method()
|
@Method()
|
||||||
dismiss(data?: any, role?: string, pickerId = -1) {
|
dismiss(data?: any, role?: string, pickerId?: number) {
|
||||||
return dismissOverlay(this.doc, data, role, 'ion-picker', pickerId);
|
return dismissOverlay(this.doc, data, role, 'ion-picker', pickerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ export class PopoverController implements OverlayController {
|
|||||||
* Dismiss the open popover overlay.
|
* Dismiss the open popover overlay.
|
||||||
*/
|
*/
|
||||||
@Method()
|
@Method()
|
||||||
dismiss(data?: any, role?: string, popoverId = -1) {
|
dismiss(data?: any, role?: string, popoverId?: number) {
|
||||||
return dismissOverlay(this.doc, data, role, 'ion-popover', popoverId);
|
return dismissOverlay(this.doc, data, role, 'ion-popover', popoverId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ export class ToastController implements OverlayController {
|
|||||||
* Dismiss the open toast overlay.
|
* Dismiss the open toast overlay.
|
||||||
*/
|
*/
|
||||||
@Method()
|
@Method()
|
||||||
dismiss(data?: any, role?: string, toastId = -1) {
|
dismiss(data?: any, role?: string, toastId?: number) {
|
||||||
return dismissOverlay(this.doc, data, role, 'ion-toast', toastId);
|
return dismissOverlay(this.doc, data, role, 'ion-toast', toastId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ export function connectListeners(doc: Document) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function dismissOverlay(doc: Document, data: any, role: string | undefined, overlayTag: string, id: number): Promise<void> {
|
export function dismissOverlay(doc: Document, data: any, role: string | undefined, overlayTag: string, id?: number): Promise<void> {
|
||||||
const overlay = getOverlay(doc, overlayTag, id);
|
const overlay = getOverlay(doc, overlayTag, id);
|
||||||
if (!overlay) {
|
if (!overlay) {
|
||||||
return Promise.reject('overlay does not exist');
|
return Promise.reject('overlay does not exist');
|
||||||
|
Reference in New Issue
Block a user