mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 10:41:13 +08:00

BREAKING CHANGE: - The `swipeToClose` property has been removed in favor of `canDismiss`. - The `canDismiss` property now defaults to `true` and can no longer be set to `undefined`.
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import type { AnimationBuilder, ComponentProps, ComponentRef, FrameworkDelegate, Mode } from '../../interface';
|
|
|
|
export interface ModalOptions<T extends ComponentRef = ComponentRef> {
|
|
component: T;
|
|
componentProps?: ComponentProps<T>;
|
|
presentingElement?: HTMLElement;
|
|
showBackdrop?: boolean;
|
|
backdropDismiss?: boolean;
|
|
cssClass?: string | string[];
|
|
delegate?: FrameworkDelegate;
|
|
animated?: boolean;
|
|
canDismiss?: boolean | (() => Promise<boolean>);
|
|
|
|
mode?: Mode;
|
|
keyboardClose?: boolean;
|
|
id?: string;
|
|
htmlAttributes?: ModalAttributes;
|
|
|
|
enterAnimation?: AnimationBuilder;
|
|
leaveAnimation?: AnimationBuilder;
|
|
|
|
breakpoints?: number[];
|
|
initialBreakpoint?: number;
|
|
backdropBreakpoint?: number;
|
|
handle?: boolean;
|
|
handleBehavior?: ModalHandleBehavior;
|
|
}
|
|
|
|
export interface ModalAnimationOptions {
|
|
presentingEl?: HTMLElement;
|
|
currentBreakpoint?: number;
|
|
backdropBreakpoint?: number;
|
|
}
|
|
|
|
export interface ModalBreakpointChangeEventDetail {
|
|
breakpoint: number;
|
|
}
|
|
|
|
export interface ModalCustomEvent extends CustomEvent {
|
|
target: HTMLIonModalElement;
|
|
}
|
|
|
|
/**
|
|
* @deprecated - Use { [key: string]: any } directly instead.
|
|
*/
|
|
export type ModalAttributes = { [key: string]: any };
|
|
|
|
/**
|
|
* The behavior setting for modals when the handle is pressed.
|
|
*/
|
|
export type ModalHandleBehavior = 'none' | 'cycle';
|