| 75 | shadow: true, |
| 76 | }) |
| 77 | export class Modal implements ComponentInterface, OverlayInterface { |
| 78 | private readonly lockController = createLockController(); |
| 79 | private readonly triggerController = createTriggerController(); |
| 80 | private gesture?: Gesture; |
| 81 | private coreDelegate: FrameworkDelegate = CoreDelegate(); |
| 82 | private sheetTransition?: Promise<any>; |
| 83 | @State() private isSheetModal = false; |
| 84 | /** |
| 85 | * The breakpoint value that has been committed for a sheet modal. |
| 86 | * This represents the modal's resting state when it is not being dragged |
| 87 | * or animating toward a new position. |
| 88 | */ |
| 89 | private currentBreakpoint?: number; |
| 90 | private wrapperEl?: HTMLElement; |
| 91 | private backdropEl?: HTMLIonBackdropElement; |
| 92 | private dragHandleEl?: HTMLButtonElement; |
| 93 | private sortedBreakpoints?: number[]; |
| 94 | private keyboardOpenCallback?: () => void; |
| 95 | private moveSheetToBreakpoint?: (options: MoveSheetToBreakpointOptions) => Promise<void>; |
| 96 | private inheritedAttributes: Attributes = {}; |
| 97 | private statusBarStyle?: StatusBarStyle; |
| 98 | |
| 99 | private inline = false; |
| 100 | private workingDelegate?: FrameworkDelegate; |
| 101 | |
| 102 | // Reference to the user's provided modal content |
| 103 | private usersElement?: HTMLElement; |
| 104 | |
| 105 | // Whether or not modal is being dismissed via gesture |
| 106 | private gestureAnimationDismissing = false; |
| 107 | |
| 108 | // View transition properties for handling portrait/landscape switches |
| 109 | private currentViewIsPortrait?: boolean; |
| 110 | private viewTransitionAnimation?: Animation; |
| 111 | private resizeTimeout?: any; |
| 112 | |
| 113 | // Mutation observer to watch for parent removal |
| 114 | private parentRemovalObserver?: MutationObserver; |
| 115 | // Cached original parent from before modal is moved to body during presentation |
| 116 | private cachedOriginalParent?: HTMLElement; |
| 117 | // Cached ion-page ancestor for child route passthrough |
| 118 | private cachedPageParent?: HTMLElement | null; |
| 119 | |
| 120 | lastFocus?: HTMLElement; |
| 121 | animation?: Animation; |
| 122 | |
| 123 | @State() presented = false; |
| 124 | |
| 125 | @Element() el!: HTMLIonModalElement; |
| 126 | |
| 127 | /** @internal */ |
| 128 | @Prop() hasController = false; |
| 129 | |
| 130 | /** @internal */ |
| 131 | @Prop() overlayIndex!: number; |
| 132 | |
| 133 | /** @internal */ |
| 134 | @Prop() delegate?: FrameworkDelegate; |
nothing calls this directly
no test coverage detected