@ionic/core 8.7.18-dev.11769546281.18b0f3ba → 8.7.18-dev.11769790854.11895f8f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/modal.js +220 -12
- package/components/popover.js +83 -11
- package/dist/cjs/ion-modal.cjs.entry.js +220 -12
- package/dist/cjs/ion-popover.cjs.entry.js +83 -11
- package/dist/collection/components/modal/gestures/sheet.js +3 -1
- package/dist/collection/components/modal/gestures/swipe-to-close.js +3 -1
- package/dist/collection/components/modal/modal.ios.css +0 -4
- package/dist/collection/components/modal/modal.js +215 -7
- package/dist/collection/components/modal/modal.md.css +0 -4
- package/dist/collection/components/popover/animations/ios.enter.js +21 -5
- package/dist/collection/components/popover/animations/md.enter.js +30 -5
- package/dist/collection/components/popover/utils.js +32 -1
- package/dist/docs.json +1 -1
- package/dist/esm/ion-modal.entry.js +220 -12
- package/dist/esm/ion-popover.entry.js +83 -11
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-ec9ca3fe.entry.js +4 -0
- package/dist/ionic/p-ef4256eb.entry.js +4 -0
- package/dist/types/components/modal/gestures/sheet.d.ts +1 -1
- package/dist/types/components/modal/gestures/swipe-to-close.d.ts +1 -1
- package/dist/types/components/modal/modal.d.ts +47 -0
- package/dist/types/components/popover/utils.d.ts +2 -0
- package/hydrate/index.js +302 -22
- package/hydrate/index.mjs +302 -22
- package/package.json +1 -1
- package/dist/ionic/p-91840a80.entry.js +0 -4
- package/dist/ionic/p-f9061316.entry.js +0 -4
package/hydrate/index.mjs
CHANGED
|
@@ -21579,7 +21579,7 @@ const calculateSpringStep = (t) => {
|
|
|
21579
21579
|
const SwipeToCloseDefaults = {
|
|
21580
21580
|
MIN_PRESENTING_SCALE: 0.915,
|
|
21581
21581
|
};
|
|
21582
|
-
const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) => {
|
|
21582
|
+
const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss, onGestureMove) => {
|
|
21583
21583
|
/**
|
|
21584
21584
|
* The step value at which a card modal
|
|
21585
21585
|
* is eligible for dismissing via gesture.
|
|
@@ -21736,6 +21736,8 @@ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) =>
|
|
|
21736
21736
|
const processedStep = isAttemptingDismissWithCanDismiss ? calculateSpringStep(step / maxStep) : step;
|
|
21737
21737
|
const clampedStep = clamp(0.0001, processedStep, maxStep);
|
|
21738
21738
|
animation.progressStep(clampedStep);
|
|
21739
|
+
// Notify modal of position change for safe-area updates
|
|
21740
|
+
onGestureMove === null || onGestureMove === void 0 ? void 0 : onGestureMove();
|
|
21739
21741
|
/**
|
|
21740
21742
|
* When swiping down half way, the status bar style
|
|
21741
21743
|
* should be reset to its default value.
|
|
@@ -22279,7 +22281,7 @@ const mdLeaveAnimation$2 = (baseEl, opts) => {
|
|
|
22279
22281
|
return baseAnimation;
|
|
22280
22282
|
};
|
|
22281
22283
|
|
|
22282
|
-
const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange) => {
|
|
22284
|
+
const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange, onGestureMove) => {
|
|
22283
22285
|
// Defaults for the sheet swipe animation
|
|
22284
22286
|
const defaultBackdrop = [
|
|
22285
22287
|
{ offset: 0, opacity: 'var(--backdrop-opacity)' },
|
|
@@ -22610,6 +22612,8 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
22610
22612
|
: step;
|
|
22611
22613
|
offset = clamp(0.0001, processedStep, maxStep);
|
|
22612
22614
|
animation.progressStep(offset);
|
|
22615
|
+
// Notify modal of position change for safe-area updates
|
|
22616
|
+
onGestureMove === null || onGestureMove === void 0 ? void 0 : onGestureMove();
|
|
22613
22617
|
};
|
|
22614
22618
|
const onEnd = (detail) => {
|
|
22615
22619
|
/**
|
|
@@ -22804,9 +22808,9 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
22804
22808
|
};
|
|
22805
22809
|
};
|
|
22806
22810
|
|
|
22807
|
-
const modalIosCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px
|
|
22811
|
+
const modalIosCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\"\"}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}";
|
|
22808
22812
|
|
|
22809
|
-
const modalMdCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px
|
|
22813
|
+
const modalMdCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\"\"}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}";
|
|
22810
22814
|
|
|
22811
22815
|
// TODO(FW-2832): types
|
|
22812
22816
|
/**
|
|
@@ -22839,6 +22843,10 @@ class Modal {
|
|
|
22839
22843
|
this.inline = false;
|
|
22840
22844
|
// Whether or not modal is being dismissed via gesture
|
|
22841
22845
|
this.gestureAnimationDismissing = false;
|
|
22846
|
+
// Whether to skip coordinate-based safe-area detection (for fullscreen phone modals)
|
|
22847
|
+
this.skipSafeAreaCoordinateDetection = false;
|
|
22848
|
+
// Track previous safe-area state to avoid redundant DOM writes
|
|
22849
|
+
this.prevSafeAreaState = { top: false, bottom: false, left: false, right: false };
|
|
22842
22850
|
this.presented = false;
|
|
22843
22851
|
/** @internal */
|
|
22844
22852
|
this.hasController = false;
|
|
@@ -23029,7 +23037,10 @@ class Modal {
|
|
|
23029
23037
|
}
|
|
23030
23038
|
}
|
|
23031
23039
|
onWindowResize() {
|
|
23032
|
-
//
|
|
23040
|
+
// Invalidate safe-area cache on resize (device rotation may change values)
|
|
23041
|
+
this.cachedSafeAreas = undefined;
|
|
23042
|
+
this.updateSafeAreaOverrides();
|
|
23043
|
+
// Only handle view transition for iOS card modals when no custom animations are provided
|
|
23033
23044
|
if (getIonMode$1(this) !== 'ios' || !this.presentingElement || this.enterAnimation || this.leaveAnimation) {
|
|
23034
23045
|
return;
|
|
23035
23046
|
}
|
|
@@ -23052,6 +23063,8 @@ class Modal {
|
|
|
23052
23063
|
this.triggerController.removeClickListener();
|
|
23053
23064
|
this.cleanupViewTransitionListener();
|
|
23054
23065
|
this.cleanupParentRemovalObserver();
|
|
23066
|
+
// Reset safe-area state to handle removal without dismiss (e.g., framework unmount)
|
|
23067
|
+
this.resetSafeAreaState();
|
|
23055
23068
|
}
|
|
23056
23069
|
componentWillLoad() {
|
|
23057
23070
|
var _a;
|
|
@@ -23211,6 +23224,8 @@ class Modal {
|
|
|
23211
23224
|
else if (!this.keepContentsMounted) {
|
|
23212
23225
|
await waitForMount();
|
|
23213
23226
|
}
|
|
23227
|
+
// Predict safe-area needs based on modal configuration to avoid visual snap
|
|
23228
|
+
this.setInitialSafeAreaOverrides(presentingElement);
|
|
23214
23229
|
writeTask(() => this.el.classList.add('show-modal'));
|
|
23215
23230
|
const hasCardModal = presentingElement !== undefined;
|
|
23216
23231
|
/**
|
|
@@ -23272,6 +23287,8 @@ class Modal {
|
|
|
23272
23287
|
else if (hasCardModal) {
|
|
23273
23288
|
this.initSwipeToClose();
|
|
23274
23289
|
}
|
|
23290
|
+
// Now that animation is complete, update safe-area based on actual position
|
|
23291
|
+
this.updateSafeAreaOverrides();
|
|
23275
23292
|
// Initialize view transition listener for iOS card modals
|
|
23276
23293
|
this.initViewTransitionListener();
|
|
23277
23294
|
// Initialize parent removal observer
|
|
@@ -23323,7 +23340,7 @@ class Modal {
|
|
|
23323
23340
|
await this.dismiss(undefined, GESTURE);
|
|
23324
23341
|
this.gestureAnimationDismissing = false;
|
|
23325
23342
|
});
|
|
23326
|
-
});
|
|
23343
|
+
}, () => this.updateSafeAreaOverrides());
|
|
23327
23344
|
this.gesture.enable(true);
|
|
23328
23345
|
}
|
|
23329
23346
|
initSheetGesture() {
|
|
@@ -23344,7 +23361,8 @@ class Modal {
|
|
|
23344
23361
|
this.currentBreakpoint = breakpoint;
|
|
23345
23362
|
this.ionBreakpointDidChange.emit({ breakpoint });
|
|
23346
23363
|
}
|
|
23347
|
-
|
|
23364
|
+
this.updateSafeAreaOverrides();
|
|
23365
|
+
}, () => this.updateSafeAreaOverrides());
|
|
23348
23366
|
this.gesture = gesture;
|
|
23349
23367
|
this.moveSheetToBreakpoint = moveSheetToBreakpoint;
|
|
23350
23368
|
this.gesture.enable(true);
|
|
@@ -23422,6 +23440,194 @@ class Modal {
|
|
|
23422
23440
|
// Clear the cached reference
|
|
23423
23441
|
this.cachedPageParent = undefined;
|
|
23424
23442
|
}
|
|
23443
|
+
/**
|
|
23444
|
+
* Sets initial safe-area overrides based on modal configuration before
|
|
23445
|
+
* the modal becomes visible. This predicts whether the modal will touch
|
|
23446
|
+
* screen edges to avoid a visual snap after animation completes.
|
|
23447
|
+
*/
|
|
23448
|
+
setInitialSafeAreaOverrides(presentingElement) {
|
|
23449
|
+
const style = this.el.style;
|
|
23450
|
+
const mode = getIonMode$1(this);
|
|
23451
|
+
const isSheetModal = this.breakpoints !== undefined && this.initialBreakpoint !== undefined;
|
|
23452
|
+
// Card modals only exist in iOS mode - in MD mode, presentingElement is ignored
|
|
23453
|
+
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
23454
|
+
const isTablet = window.innerWidth >= 768;
|
|
23455
|
+
// Sheet modals always touch bottom edge, never top/left/right
|
|
23456
|
+
if (isSheetModal) {
|
|
23457
|
+
style.setProperty('--ion-safe-area-top', '0px');
|
|
23458
|
+
style.setProperty('--ion-safe-area-left', '0px');
|
|
23459
|
+
style.setProperty('--ion-safe-area-right', '0px');
|
|
23460
|
+
return;
|
|
23461
|
+
}
|
|
23462
|
+
// Card modals have rounded top corners
|
|
23463
|
+
if (isCardModal) {
|
|
23464
|
+
style.setProperty('--ion-safe-area-top', '0px');
|
|
23465
|
+
if (isTablet) {
|
|
23466
|
+
// On tablets, card modals are inset from all edges
|
|
23467
|
+
this.zeroAllSafeAreas();
|
|
23468
|
+
}
|
|
23469
|
+
else {
|
|
23470
|
+
// On phones, card modals still extend to the bottom edge
|
|
23471
|
+
style.setProperty('--ion-safe-area-left', '0px');
|
|
23472
|
+
style.setProperty('--ion-safe-area-right', '0px');
|
|
23473
|
+
this.applyFullscreenSafeArea();
|
|
23474
|
+
}
|
|
23475
|
+
return;
|
|
23476
|
+
}
|
|
23477
|
+
// Check if modal is fullscreen via CSS custom properties
|
|
23478
|
+
// This applies to both phone and tablet sizes - custom modals may have
|
|
23479
|
+
// non-fullscreen dimensions even on phones (e.g., --height: 70%)
|
|
23480
|
+
const computedStyle = getComputedStyle(this.el);
|
|
23481
|
+
const width = computedStyle.getPropertyValue('--width').trim();
|
|
23482
|
+
const height = computedStyle.getPropertyValue('--height').trim();
|
|
23483
|
+
const isFullscreen = width === '100%' && height === '100%';
|
|
23484
|
+
if (isFullscreen) {
|
|
23485
|
+
this.applyFullscreenSafeArea();
|
|
23486
|
+
}
|
|
23487
|
+
else if (isTablet) {
|
|
23488
|
+
// Centered dialog on tablet doesn't touch edges
|
|
23489
|
+
this.zeroAllSafeAreas();
|
|
23490
|
+
}
|
|
23491
|
+
else ;
|
|
23492
|
+
}
|
|
23493
|
+
/**
|
|
23494
|
+
* Applies safe-area handling for fullscreen modals.
|
|
23495
|
+
* Adds wrapper padding when no footer is present to prevent
|
|
23496
|
+
* content from overlapping system navigation areas.
|
|
23497
|
+
*/
|
|
23498
|
+
applyFullscreenSafeArea() {
|
|
23499
|
+
this.skipSafeAreaCoordinateDetection = true;
|
|
23500
|
+
this.updateFooterPadding();
|
|
23501
|
+
// Watch for dynamic footer additions/removals (e.g., async data loading)
|
|
23502
|
+
// Use subtree:true to support wrapped footers in framework components
|
|
23503
|
+
// (e.g., <my-footer><ion-footer>...</ion-footer></my-footer>)
|
|
23504
|
+
if (!this.footerObserver && win$1 !== undefined && 'MutationObserver' in win$1) {
|
|
23505
|
+
this.footerObserver = new MutationObserver(() => this.updateFooterPadding());
|
|
23506
|
+
this.footerObserver.observe(this.el, { childList: true, subtree: true });
|
|
23507
|
+
}
|
|
23508
|
+
}
|
|
23509
|
+
/**
|
|
23510
|
+
* Updates wrapper and shadow padding based on footer presence.
|
|
23511
|
+
* Called initially and when footer is dynamically added/removed.
|
|
23512
|
+
* Both elements must be styled identically to prevent visual mismatches.
|
|
23513
|
+
*/
|
|
23514
|
+
updateFooterPadding() {
|
|
23515
|
+
if (!this.wrapperEl)
|
|
23516
|
+
return;
|
|
23517
|
+
const hasFooter = this.el.querySelector('ion-footer') !== null;
|
|
23518
|
+
// Apply to both wrapper and shadow to keep them in sync
|
|
23519
|
+
const elements = [this.wrapperEl, this.shadowEl].filter(Boolean);
|
|
23520
|
+
if (hasFooter) {
|
|
23521
|
+
elements.forEach((el) => {
|
|
23522
|
+
el.style.removeProperty('padding-bottom');
|
|
23523
|
+
el.style.removeProperty('box-sizing');
|
|
23524
|
+
});
|
|
23525
|
+
}
|
|
23526
|
+
else {
|
|
23527
|
+
elements.forEach((el) => {
|
|
23528
|
+
el.style.setProperty('padding-bottom', 'var(--ion-safe-area-bottom, 0px)');
|
|
23529
|
+
el.style.setProperty('box-sizing', 'border-box');
|
|
23530
|
+
});
|
|
23531
|
+
}
|
|
23532
|
+
}
|
|
23533
|
+
/**
|
|
23534
|
+
* Sets all safe-area CSS variables to 0px for modals that
|
|
23535
|
+
* don't touch screen edges.
|
|
23536
|
+
*/
|
|
23537
|
+
zeroAllSafeAreas() {
|
|
23538
|
+
const style = this.el.style;
|
|
23539
|
+
style.setProperty('--ion-safe-area-top', '0px');
|
|
23540
|
+
style.setProperty('--ion-safe-area-bottom', '0px');
|
|
23541
|
+
style.setProperty('--ion-safe-area-left', '0px');
|
|
23542
|
+
style.setProperty('--ion-safe-area-right', '0px');
|
|
23543
|
+
}
|
|
23544
|
+
/**
|
|
23545
|
+
* Resets all safe-area related state and styles.
|
|
23546
|
+
* Called during dismiss and disconnectedCallback to ensure clean state
|
|
23547
|
+
* for re-presentation of inline modals.
|
|
23548
|
+
*/
|
|
23549
|
+
resetSafeAreaState() {
|
|
23550
|
+
var _a;
|
|
23551
|
+
this.skipSafeAreaCoordinateDetection = false;
|
|
23552
|
+
this.cachedSafeAreas = undefined;
|
|
23553
|
+
this.prevSafeAreaState = { top: false, bottom: false, left: false, right: false };
|
|
23554
|
+
(_a = this.footerObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
23555
|
+
this.footerObserver = undefined;
|
|
23556
|
+
// Clear wrapper and shadow styles that may have been set for safe-area handling
|
|
23557
|
+
[this.wrapperEl, this.shadowEl].forEach((el) => {
|
|
23558
|
+
if (el) {
|
|
23559
|
+
el.style.removeProperty('padding-bottom');
|
|
23560
|
+
el.style.removeProperty('box-sizing');
|
|
23561
|
+
}
|
|
23562
|
+
});
|
|
23563
|
+
// Clear safe-area CSS variable overrides
|
|
23564
|
+
const style = this.el.style;
|
|
23565
|
+
style.removeProperty('--ion-safe-area-top');
|
|
23566
|
+
style.removeProperty('--ion-safe-area-bottom');
|
|
23567
|
+
style.removeProperty('--ion-safe-area-left');
|
|
23568
|
+
style.removeProperty('--ion-safe-area-right');
|
|
23569
|
+
}
|
|
23570
|
+
/**
|
|
23571
|
+
* Gets the root safe-area values from the document element.
|
|
23572
|
+
* Uses cached values during gestures to avoid getComputedStyle calls.
|
|
23573
|
+
*/
|
|
23574
|
+
getSafeAreaValues() {
|
|
23575
|
+
if (!this.cachedSafeAreas) {
|
|
23576
|
+
const rootStyle = getComputedStyle(document.documentElement);
|
|
23577
|
+
this.cachedSafeAreas = {
|
|
23578
|
+
top: parseFloat(rootStyle.getPropertyValue('--ion-safe-area-top')) || 0,
|
|
23579
|
+
bottom: parseFloat(rootStyle.getPropertyValue('--ion-safe-area-bottom')) || 0,
|
|
23580
|
+
left: parseFloat(rootStyle.getPropertyValue('--ion-safe-area-left')) || 0,
|
|
23581
|
+
right: parseFloat(rootStyle.getPropertyValue('--ion-safe-area-right')) || 0,
|
|
23582
|
+
};
|
|
23583
|
+
}
|
|
23584
|
+
return this.cachedSafeAreas;
|
|
23585
|
+
}
|
|
23586
|
+
/**
|
|
23587
|
+
* Updates safe-area CSS variable overrides based on whether the modal
|
|
23588
|
+
* extends into each safe-area region. Called after animation
|
|
23589
|
+
* and during gestures to handle dynamic position changes.
|
|
23590
|
+
*
|
|
23591
|
+
* Optimized to avoid redundant DOM writes by tracking previous state.
|
|
23592
|
+
*/
|
|
23593
|
+
updateSafeAreaOverrides() {
|
|
23594
|
+
if (this.skipSafeAreaCoordinateDetection) {
|
|
23595
|
+
return;
|
|
23596
|
+
}
|
|
23597
|
+
const wrapper = this.wrapperEl;
|
|
23598
|
+
if (!wrapper) {
|
|
23599
|
+
return;
|
|
23600
|
+
}
|
|
23601
|
+
const rect = wrapper.getBoundingClientRect();
|
|
23602
|
+
const safeAreas = this.getSafeAreaValues();
|
|
23603
|
+
const extendsIntoTop = rect.top < safeAreas.top;
|
|
23604
|
+
const extendsIntoBottom = rect.bottom > window.innerHeight - safeAreas.bottom;
|
|
23605
|
+
const extendsIntoLeft = rect.left < safeAreas.left;
|
|
23606
|
+
const extendsIntoRight = rect.right > window.innerWidth - safeAreas.right;
|
|
23607
|
+
// Only update DOM when state actually changes
|
|
23608
|
+
const prev = this.prevSafeAreaState;
|
|
23609
|
+
const style = this.el.style;
|
|
23610
|
+
if (extendsIntoTop !== prev.top) {
|
|
23611
|
+
extendsIntoTop ? style.removeProperty('--ion-safe-area-top') : style.setProperty('--ion-safe-area-top', '0px');
|
|
23612
|
+
prev.top = extendsIntoTop;
|
|
23613
|
+
}
|
|
23614
|
+
if (extendsIntoBottom !== prev.bottom) {
|
|
23615
|
+
extendsIntoBottom
|
|
23616
|
+
? style.removeProperty('--ion-safe-area-bottom')
|
|
23617
|
+
: style.setProperty('--ion-safe-area-bottom', '0px');
|
|
23618
|
+
prev.bottom = extendsIntoBottom;
|
|
23619
|
+
}
|
|
23620
|
+
if (extendsIntoLeft !== prev.left) {
|
|
23621
|
+
extendsIntoLeft ? style.removeProperty('--ion-safe-area-left') : style.setProperty('--ion-safe-area-left', '0px');
|
|
23622
|
+
prev.left = extendsIntoLeft;
|
|
23623
|
+
}
|
|
23624
|
+
if (extendsIntoRight !== prev.right) {
|
|
23625
|
+
extendsIntoRight
|
|
23626
|
+
? style.removeProperty('--ion-safe-area-right')
|
|
23627
|
+
: style.setProperty('--ion-safe-area-right', '0px');
|
|
23628
|
+
prev.right = extendsIntoRight;
|
|
23629
|
+
}
|
|
23630
|
+
}
|
|
23425
23631
|
sheetOnDismiss() {
|
|
23426
23632
|
/**
|
|
23427
23633
|
* While the gesture animation is finishing
|
|
@@ -23514,6 +23720,8 @@ class Modal {
|
|
|
23514
23720
|
}
|
|
23515
23721
|
this.currentBreakpoint = undefined;
|
|
23516
23722
|
this.animation = undefined;
|
|
23723
|
+
// Reset safe-area state for potential re-presentation
|
|
23724
|
+
this.resetSafeAreaState();
|
|
23517
23725
|
unlock();
|
|
23518
23726
|
return dismissed;
|
|
23519
23727
|
}
|
|
@@ -23763,20 +23971,20 @@ class Modal {
|
|
|
23763
23971
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
23764
23972
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
23765
23973
|
const isSheetModalWithHandle = isSheetModal && showHandle;
|
|
23766
|
-
return (hAsync(Host, Object.assign({ key: '
|
|
23974
|
+
return (hAsync(Host, Object.assign({ key: '8f42c71ec9c9270b4218ca7eec57ca998871ac07', "no-router": true,
|
|
23767
23975
|
// Allow the modal to be navigable when the handle is focusable
|
|
23768
23976
|
tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
|
|
23769
23977
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
23770
|
-
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), hAsync("ion-backdrop", { key: '
|
|
23978
|
+
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), hAsync("ion-backdrop", { key: '2f7b08b019c66cbfceacafa9a68b91f8da1f4084', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && hAsync("div", { key: '6b0d1ae90e8483332f74371be5dcbd0a7b2661ba', class: "modal-shadow", ref: (el) => (this.shadowEl = el) }), hAsync("div", Object.assign({ key: 'c96f671fb25e5de45231ea65ac52500547b2e262',
|
|
23771
23979
|
/*
|
|
23772
23980
|
role and aria-modal must be used on the
|
|
23773
23981
|
same element. They must also be set inside the
|
|
23774
23982
|
shadow DOM otherwise ion-button will not be highlighted
|
|
23775
23983
|
when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
|
|
23776
23984
|
*/
|
|
23777
|
-
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: '
|
|
23985
|
+
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: 'e07419b01a588c0ba62ed9607c843cac7bd26337', class: "modal-handle",
|
|
23778
23986
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
23779
|
-
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), hAsync("slot", { key: '
|
|
23987
|
+
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), hAsync("slot", { key: '65f35079df8eb8b6cd262e3a08297866715ce7ea', onSlotchange: this.onSlotChange }))));
|
|
23780
23988
|
}
|
|
23781
23989
|
get el() { return getElement(this); }
|
|
23782
23990
|
static get watchers() { return {
|
|
@@ -27354,6 +27562,8 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
27354
27562
|
let bottom;
|
|
27355
27563
|
let originX = contentOriginX;
|
|
27356
27564
|
let originY = contentOriginY;
|
|
27565
|
+
let checkSafeAreaTop = false;
|
|
27566
|
+
let checkSafeAreaBottom = false;
|
|
27357
27567
|
let checkSafeAreaLeft = false;
|
|
27358
27568
|
let checkSafeAreaRight = false;
|
|
27359
27569
|
const triggerTop = triggerCoordinates
|
|
@@ -27398,10 +27608,18 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
27398
27608
|
* We chose 12 here so that the popover position looks a bit nicer as
|
|
27399
27609
|
* it is not right up against the edge of the screen.
|
|
27400
27610
|
*/
|
|
27401
|
-
top = Math.max(
|
|
27611
|
+
top = Math.max(bodyPadding, triggerTop - contentHeight - triggerHeight - (arrowHeight - 1));
|
|
27402
27612
|
arrowTop = top + contentHeight;
|
|
27403
27613
|
originY = 'bottom';
|
|
27404
27614
|
addPopoverBottomClass = true;
|
|
27615
|
+
/**
|
|
27616
|
+
* If the popover is positioned near the top edge, account for safe area.
|
|
27617
|
+
* This ensures the popover doesn't overlap with status bars or notches.
|
|
27618
|
+
*/
|
|
27619
|
+
if (top <= bodyPadding + safeAreaMargin) {
|
|
27620
|
+
checkSafeAreaTop = true;
|
|
27621
|
+
top = bodyPadding;
|
|
27622
|
+
}
|
|
27405
27623
|
/**
|
|
27406
27624
|
* If not enough room for popover to appear
|
|
27407
27625
|
* above trigger, then cut it off.
|
|
@@ -27409,14 +27627,35 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
27409
27627
|
}
|
|
27410
27628
|
else {
|
|
27411
27629
|
bottom = bodyPadding;
|
|
27630
|
+
/**
|
|
27631
|
+
* When the popover is pinned to the bottom, account for safe area.
|
|
27632
|
+
* This ensures the popover doesn't overlap with home indicators
|
|
27633
|
+
* or navigation bars (e.g., Android API 36+ edge-to-edge).
|
|
27634
|
+
*/
|
|
27635
|
+
checkSafeAreaBottom = true;
|
|
27412
27636
|
}
|
|
27413
27637
|
}
|
|
27638
|
+
/**
|
|
27639
|
+
* Final check: If the popover extends into any safe-area region,
|
|
27640
|
+
* ensure the corresponding flag is set regardless of side.
|
|
27641
|
+
* This handles cases where a side-positioned popover (left/right)
|
|
27642
|
+
* still needs bottom safe-area padding because it extends into that region.
|
|
27643
|
+
*/
|
|
27644
|
+
const popoverBottom = bottom !== undefined ? bodyHeight - bottom : top + contentHeight;
|
|
27645
|
+
if (popoverBottom + safeAreaMargin > bodyHeight) {
|
|
27646
|
+
checkSafeAreaBottom = true;
|
|
27647
|
+
}
|
|
27648
|
+
if (top < safeAreaMargin) {
|
|
27649
|
+
checkSafeAreaTop = true;
|
|
27650
|
+
}
|
|
27414
27651
|
return {
|
|
27415
27652
|
top,
|
|
27416
27653
|
left,
|
|
27417
27654
|
bottom,
|
|
27418
27655
|
originX,
|
|
27419
27656
|
originY,
|
|
27657
|
+
checkSafeAreaTop,
|
|
27658
|
+
checkSafeAreaBottom,
|
|
27420
27659
|
checkSafeAreaLeft,
|
|
27421
27660
|
checkSafeAreaRight,
|
|
27422
27661
|
arrowTop,
|
|
@@ -27477,7 +27716,7 @@ const iosEnterAnimation$1 = (baseEl, opts) => {
|
|
|
27477
27716
|
const results = getPopoverPosition(isRTL, contentWidth, contentHeight, arrowWidth, arrowHeight, reference, side, align, defaultPosition, trigger, ev);
|
|
27478
27717
|
const padding = size === 'cover' ? 0 : POPOVER_IOS_BODY_PADDING;
|
|
27479
27718
|
const margin = size === 'cover' ? 0 : 25;
|
|
27480
|
-
const { originX, originY, top, left, bottom, checkSafeAreaLeft, checkSafeAreaRight, arrowTop, arrowLeft, addPopoverBottomClass, } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, margin, results.originX, results.originY, results.referenceCoordinates, results.arrowTop, results.arrowLeft, arrowHeight);
|
|
27719
|
+
const { originX, originY, top, left, bottom, checkSafeAreaTop, checkSafeAreaBottom, checkSafeAreaLeft, checkSafeAreaRight, arrowTop, arrowLeft, addPopoverBottomClass, } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, margin, results.originX, results.originY, results.referenceCoordinates, results.arrowTop, results.arrowLeft, arrowHeight);
|
|
27481
27720
|
const baseAnimation = createAnimation();
|
|
27482
27721
|
const backdropAnimation = createAnimation();
|
|
27483
27722
|
const contentAnimation = createAnimation();
|
|
@@ -27507,19 +27746,35 @@ const iosEnterAnimation$1 = (baseEl, opts) => {
|
|
|
27507
27746
|
if (addPopoverBottomClass) {
|
|
27508
27747
|
baseEl.classList.add('popover-bottom');
|
|
27509
27748
|
}
|
|
27510
|
-
|
|
27511
|
-
|
|
27512
|
-
|
|
27749
|
+
/**
|
|
27750
|
+
* Safe area CSS variable adjustments.
|
|
27751
|
+
* When the popover is positioned near an edge, we add the corresponding
|
|
27752
|
+
* safe-area inset to ensure the popover doesn't overlap with system UI
|
|
27753
|
+
* (status bars, home indicators, navigation bars on Android API 36+, etc.)
|
|
27754
|
+
*/
|
|
27755
|
+
const safeAreaTop = ' + var(--ion-safe-area-top, 0)';
|
|
27756
|
+
const safeAreaBottom = ' + var(--ion-safe-area-bottom, 0)';
|
|
27513
27757
|
const safeAreaLeft = ' + var(--ion-safe-area-left, 0)';
|
|
27514
27758
|
const safeAreaRight = ' - var(--ion-safe-area-right, 0)';
|
|
27759
|
+
let topValue = `${top}px`;
|
|
27760
|
+
let bottomValue = bottom !== undefined ? `${bottom}px` : undefined;
|
|
27515
27761
|
let leftValue = `${left}px`;
|
|
27762
|
+
if (checkSafeAreaTop) {
|
|
27763
|
+
topValue = `${top}px${safeAreaTop}`;
|
|
27764
|
+
}
|
|
27765
|
+
if (checkSafeAreaBottom && bottomValue !== undefined) {
|
|
27766
|
+
bottomValue = `${bottom}px${safeAreaBottom}`;
|
|
27767
|
+
}
|
|
27516
27768
|
if (checkSafeAreaLeft) {
|
|
27517
27769
|
leftValue = `${left}px${safeAreaLeft}`;
|
|
27518
27770
|
}
|
|
27519
27771
|
if (checkSafeAreaRight) {
|
|
27520
27772
|
leftValue = `${left}px${safeAreaRight}`;
|
|
27521
27773
|
}
|
|
27522
|
-
|
|
27774
|
+
if (bottomValue !== undefined) {
|
|
27775
|
+
contentEl.style.setProperty('bottom', `calc(${bottomValue})`);
|
|
27776
|
+
}
|
|
27777
|
+
contentEl.style.setProperty('top', `calc(${topValue} + var(--offset-y, 0))`);
|
|
27523
27778
|
contentEl.style.setProperty('left', `calc(${leftValue} + var(--offset-x, 0))`);
|
|
27524
27779
|
contentEl.style.setProperty('transform-origin', `${originY} ${originX}`);
|
|
27525
27780
|
if (arrowEl !== null) {
|
|
@@ -27595,7 +27850,32 @@ const mdEnterAnimation$1 = (baseEl, opts) => {
|
|
|
27595
27850
|
};
|
|
27596
27851
|
const results = getPopoverPosition(isRTL, contentWidth, contentHeight, 0, 0, reference, side, align, defaultPosition, trigger, ev);
|
|
27597
27852
|
const padding = size === 'cover' ? 0 : POPOVER_MD_BODY_PADDING;
|
|
27598
|
-
const { originX, originY, top, left, bottom } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, 0, results.originX, results.originY, results.referenceCoordinates);
|
|
27853
|
+
const { originX, originY, top, left, bottom, checkSafeAreaTop, checkSafeAreaBottom, checkSafeAreaLeft, checkSafeAreaRight, } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, 0, results.originX, results.originY, results.referenceCoordinates);
|
|
27854
|
+
/**
|
|
27855
|
+
* Safe area CSS variable adjustments.
|
|
27856
|
+
* When the popover is positioned near an edge, we add the corresponding
|
|
27857
|
+
* safe-area inset to ensure the popover doesn't overlap with system UI
|
|
27858
|
+
* (status bars, home indicators, navigation bars on Android API 36+, etc.)
|
|
27859
|
+
*/
|
|
27860
|
+
const safeAreaTop = ' + var(--ion-safe-area-top, 0)';
|
|
27861
|
+
const safeAreaBottom = ' + var(--ion-safe-area-bottom, 0)';
|
|
27862
|
+
const safeAreaLeft = ' + var(--ion-safe-area-left, 0)';
|
|
27863
|
+
const safeAreaRight = ' - var(--ion-safe-area-right, 0)';
|
|
27864
|
+
let topValue = `${top}px`;
|
|
27865
|
+
let bottomValue = bottom !== undefined ? `${bottom}px` : undefined;
|
|
27866
|
+
let leftValue = `${left}px`;
|
|
27867
|
+
if (checkSafeAreaTop) {
|
|
27868
|
+
topValue = `${top}px${safeAreaTop}`;
|
|
27869
|
+
}
|
|
27870
|
+
if (checkSafeAreaBottom && bottomValue !== undefined) {
|
|
27871
|
+
bottomValue = `${bottom}px${safeAreaBottom}`;
|
|
27872
|
+
}
|
|
27873
|
+
if (checkSafeAreaLeft) {
|
|
27874
|
+
leftValue = `${left}px${safeAreaLeft}`;
|
|
27875
|
+
}
|
|
27876
|
+
if (checkSafeAreaRight) {
|
|
27877
|
+
leftValue = `${left}px${safeAreaRight}`;
|
|
27878
|
+
}
|
|
27599
27879
|
const baseAnimation = createAnimation();
|
|
27600
27880
|
const backdropAnimation = createAnimation();
|
|
27601
27881
|
const wrapperAnimation = createAnimation();
|
|
@@ -27612,13 +27892,13 @@ const mdEnterAnimation$1 = (baseEl, opts) => {
|
|
|
27612
27892
|
contentAnimation
|
|
27613
27893
|
.addElement(contentEl)
|
|
27614
27894
|
.beforeStyles({
|
|
27615
|
-
top: `calc(${
|
|
27616
|
-
left: `calc(${
|
|
27895
|
+
top: `calc(${topValue} + var(--offset-y, 0px))`,
|
|
27896
|
+
left: `calc(${leftValue} + var(--offset-x, 0px))`,
|
|
27617
27897
|
'transform-origin': `${originY} ${originX}`,
|
|
27618
27898
|
})
|
|
27619
27899
|
.beforeAddWrite(() => {
|
|
27620
|
-
if (
|
|
27621
|
-
contentEl.style.setProperty('bottom',
|
|
27900
|
+
if (bottomValue !== undefined) {
|
|
27901
|
+
contentEl.style.setProperty('bottom', `calc(${bottomValue})`);
|
|
27622
27902
|
}
|
|
27623
27903
|
})
|
|
27624
27904
|
.fromTo('transform', 'scale(0.8)', 'scale(1)');
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,c as o,f as i,w as a,e,h as r,d as s,g as n}from"./p-C8IsBmNU.js";import{f as d,i as h,d as l,r as p,a as c,p as m}from"./p-CwgG81ZD.js";import{C as f,a as u,d as b}from"./p-D-eFFUkA.js";import{e as v,g as x,r as w,b as g,h as k}from"./p-CTfR9YZG.js";import{c as y}from"./p-B-hirT0v.js";import{g as A}from"./p-CIGNaXM1.js";import{G as Y,O as D,F as E,e as B,B as T,j as O,k as S,f as C,g as M,h as P}from"./p-DdR6rpbR.js";import{g as j}from"./p-DiVJyqlX.js";import{e as R,w as L}from"./p-DUt5fQmA.js";import{b as $}from"./p-BFvmZNyx.js";import{KEYBOARD_DID_OPEN as I}from"./p-9eeaBrnk.js";import{c as N}from"./p-DDb5r57F.js";import{g as z}from"./p-hHmYLOfE.js";import{createGesture as W}from"./p-Cl0B-RWe.js";import{w as F}from"./p-ZjP4CjeZ.js";import"./p-B0q1YL7N.js";import"./p-BTEOs1at.js";import"./p-D13Eaw-8.js";var H;!function(t){t.Dark="DARK",t.Light="LIGHT",t.Default="DEFAULT"}(H||(H={}));const Z={getEngine(){const t=A();if(null==t?void 0:t.isPluginAvailable("StatusBar"))return t.Plugins.StatusBar},setStyle(t){const o=this.getEngine();o&&o.setStyle(t)},getStyle:async function(){const t=this.getEngine();if(!t)return H.Default;const{style:o}=await t.getInfo();return o}},V=(t,o)=>{if(1===o)return 0;const i=1/(1-o);return t*i+-o*i},G=()=>{!F||F.innerWidth>=768||Z.setStyle({style:H.Dark})},U=(t=H.Default)=>{!F||F.innerWidth>=768||Z.setStyle({style:t})},K=async(t,o)=>{"function"==typeof t.canDismiss&&await t.canDismiss(void 0,Y)&&(o.isRunning()?o.onFinish((()=>{t.dismiss(void 0,"handler")}),{oneTimeCallback:!0}):t.dismiss(void 0,"handler"))},_=t=>.00255275*2.71828**(-14.9619*t)-1.00255*2.71828**(-.0380968*t)+1,q=.915,X=(t,o)=>v(400,t/Math.abs(1.1*o),500),J=t=>{const{currentBreakpoint:o,backdropBreakpoint:i,expandToScroll:a}=t,e=void 0===i||i<o,r=e?`calc(var(--backdrop-opacity) * ${o})`:"0",s=N("backdropAnimation").fromTo("opacity",0,r);return e&&s.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),{wrapperAnimation:N("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:`translateY(${100-100*o}%)`}]),backdropAnimation:s,contentAnimation:a?void 0:N("contentAnimation").keyframes([{offset:0,opacity:1,maxHeight:100*(1-o)+"%"},{offset:1,opacity:1,maxHeight:100*o+"%"}])}},Q=t=>{const{currentBreakpoint:o,backdropBreakpoint:i}=t,a=`calc(var(--backdrop-opacity) * ${V(o,i)})`,e=[{offset:0,opacity:a},{offset:1,opacity:0}],r=[{offset:0,opacity:a},{offset:i,opacity:0},{offset:1,opacity:0}],s=N("backdropAnimation").keyframes(0!==i?r:e);return{wrapperAnimation:N("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:`translateY(${100-100*o}%)`},{offset:1,opacity:1,transform:"translateY(100%)"}]),backdropAnimation:s}},tt=(t,o)=>{const{presentingEl:i,currentBreakpoint:a,expandToScroll:e}=o,r=x(t),{wrapperAnimation:s,backdropAnimation:n,contentAnimation:d}=void 0!==a?J(o):{backdropAnimation:N().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:N().fromTo("transform","translateY(100vh)","translateY(0vh)"),contentAnimation:void 0};n.addElement(r.querySelector("ion-backdrop")),s.addElement(r.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1}),!e&&(null==d||d.addElement(t.querySelector(".ion-page")));const h=N("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation([s]);if(d&&h.addAnimation(d),i){const t=window.innerWidth<768,o="ION-MODAL"===i.tagName&&void 0!==i.presentingElement,a=x(i),e=N().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"}),r=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",a=`translateY(${o?"-10px":t}) scale(0.915)`;e.afterStyles({transform:a}).beforeAddWrite((()=>r.style.setProperty("background-color","black"))).addElement(i).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:a,borderRadius:"10px 10px 0 0"}]),h.addAnimation(e)}else if(h.addAnimation(n),o){const t=`translateY(-10px) scale(${o?q:1})`;e.afterStyles({transform:t}).addElement(a.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:t}]);const i=N().afterStyles({transform:t}).addElement(a.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:t}]);h.addAnimation([e,i])}else s.fromTo("opacity","0","1")}else h.addAnimation(n);return h},ot=(t,o,i=500)=>{const{presentingEl:a,currentBreakpoint:e}=o,r=x(t),{wrapperAnimation:s,backdropAnimation:n}=void 0!==e?Q(o):{backdropAnimation:N().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:N().fromTo("transform","translateY(0vh)","translateY(100vh)")};n.addElement(r.querySelector("ion-backdrop")),s.addElement(r.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const d=N("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(i).addAnimation(s);if(a){const t=window.innerWidth<768,o="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,i=x(a),e=N().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((t=>{1===t&&(a.style.setProperty("overflow",""),Array.from(r.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((t=>void 0!==t.presentingElement)).length<=1&&r.style.setProperty("background-color",""))})),r=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",i=`translateY(${o?"-10px":t}) scale(0.915)`;e.addElement(a).keyframes([{offset:0,filter:"contrast(0.85)",transform:i,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]),d.addAnimation(e)}else if(d.addAnimation(n),o){const t=`translateY(-10px) scale(${o?q:1})`;e.addElement(i.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:t},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);const a=N().addElement(i.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:t},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);d.addAnimation([e,a])}else s.fromTo("opacity","1","0")}else d.addAnimation(n);return d},it=(t,o)=>{const{currentBreakpoint:i,expandToScroll:a}=o,e=x(t),{wrapperAnimation:r,backdropAnimation:s,contentAnimation:n}=void 0!==i?J(o):{backdropAnimation:N().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:N().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]),contentAnimation:void 0};s.addElement(e.querySelector("ion-backdrop")),r.addElement(e.querySelector(".modal-wrapper")),!a&&(null==n||n.addElement(t.querySelector(".ion-page")));const d=N().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([s,r]);return n&&d.addAnimation(n),d},at=(t,o)=>{const{currentBreakpoint:i}=o,a=x(t),{wrapperAnimation:e,backdropAnimation:r}=void 0!==i?Q(o):{backdropAnimation:N().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:N().keyframes([{offset:0,opacity:.99,transform:"translateY(0px)"},{offset:1,opacity:0,transform:"translateY(40px)"}])};return r.addElement(a.querySelector("ion-backdrop")),e.addElement(a.querySelector(".modal-wrapper")),N().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([r,e])},et=class{constructor(i){t(this,i),this.didPresent=o(this,"ionModalDidPresent",7),this.willPresent=o(this,"ionModalWillPresent",7),this.willDismiss=o(this,"ionModalWillDismiss",7),this.didDismiss=o(this,"ionModalDidDismiss",7),this.ionBreakpointDidChange=o(this,"ionBreakpointDidChange",7),this.didPresentShorthand=o(this,"didPresent",7),this.willPresentShorthand=o(this,"willPresent",7),this.willDismissShorthand=o(this,"willDismiss",7),this.didDismissShorthand=o(this,"didDismiss",7),this.ionMount=o(this,"ionMount",7),this.lockController=y(),this.triggerController=B(),this.coreDelegate=f(),this.isSheetModal=!1,this.inheritedAttributes={},this.inline=!1,this.gestureAnimationDismissing=!1,this.presented=!1,this.hasController=!1,this.keyboardClose=!0,this.expandToScroll=!0,this.backdropBreakpoint=0,this.handleBehavior="none",this.backdropDismiss=!0,this.showBackdrop=!0,this.animated=!0,this.isOpen=!1,this.keepContentsMounted=!1,this.focusTrap=!0,this.canDismiss=!0,this.onHandleClick=()=>{const{sheetTransition:t,handleBehavior:o}=this;"cycle"===o&&void 0===t&&this.moveToNextBreakpoint()},this.onBackdropTap=()=>{const{sheetTransition:t}=this;void 0===t&&this.dismiss(void 0,T)},this.onLifecycle=t=>{const o=this.usersElement,i=rt[t.type];if(o&&i){const a=new CustomEvent(i,{bubbles:!1,cancelable:!1,detail:t.detail});o.dispatchEvent(a)}},this.onModalFocus=t=>{const{dragHandleEl:o,el:i}=this;t.target===i&&o&&-1!==o.tabIndex&&o.focus()},this.onSlotChange=({target:t})=>{t.assignedElements().forEach((t=>{t.querySelectorAll("ion-modal").forEach((t=>{null===t.getAttribute("data-parent-ion-modal")&&t.setAttribute("data-parent-ion-modal",this.el.id)}))}))}}onIsOpenChange(t,o){!0===t&&!1===o?this.present():!1===t&&!0===o&&this.dismiss()}triggerChanged(){const{trigger:t,el:o,triggerController:i}=this;t&&i.addClickListener(o,t)}onWindowResize(){"ios"!==$(this)||!this.presentingElement||this.enterAnimation||this.leaveAnimation||(clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((()=>{this.handleViewTransition()}),50))}breakpointsChanged(t){void 0!==t&&(this.sortedBreakpoints=t.sort(((t,o)=>t-o)))}connectedCallback(){const{el:t}=this;O(t),this.triggerChanged()}disconnectedCallback(){this.triggerController.removeClickListener(),this.cleanupViewTransitionListener(),this.cleanupParentRemovalObserver()}componentWillLoad(){var t;const{breakpoints:o,initialBreakpoint:a,el:e,htmlAttributes:r}=this,s=this.isSheetModal=void 0!==o&&void 0!==a,n=["aria-label","role"];this.inheritedAttributes=g(e,n),e.parentNode&&(this.cachedOriginalParent=e.parentNode),void 0!==r&&n.forEach((t=>{r[t]&&(this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:r[t]}),delete r[t])})),s&&(this.currentBreakpoint=this.initialBreakpoint),void 0===o||void 0===a||o.includes(a)||i("[ion-modal] - Your breakpoints array must include the initialBreakpoint value."),(null===(t=this.htmlAttributes)||void 0===t?void 0:t.id)||S(this.el)}componentDidLoad(){!0===this.isOpen&&w((()=>this.present())),this.breakpointsChanged(this.breakpoints),this.triggerChanged()}getDelegate(t=!1){if(this.workingDelegate&&!t)return{delegate:this.workingDelegate,inline:this.inline};const o=this.inline=null!==this.el.parentNode&&!this.hasController;return{inline:o,delegate:this.workingDelegate=o?this.delegate||this.coreDelegate:this.delegate}}async checkCanDismiss(t,o){const{canDismiss:i}=this;return"function"==typeof i?i(t,o):i}async present(){const t=await this.lockController.lock();if(this.presented)return void t();const{presentingElement:o,el:i}=this;this.currentBreakpoint=this.initialBreakpoint;const{inline:e,delegate:r}=this.getDelegate(!0);this.ionMount.emit(),this.usersElement=await u(r,i,this.component,["ion-page"],this.componentProps,e),k(i)?await R(this.usersElement):this.keepContentsMounted||await L(),a((()=>this.el.classList.add("show-modal")));const s=void 0!==o;s&&"ios"===$(this)&&(this.statusBarStyle=await Z.getStyle(),G()),await C(this,"modalEnter",tt,it,{presentingEl:o,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll}),"undefined"!=typeof window&&(this.keyboardOpenCallback=()=>{this.gesture&&(this.gesture.enable(!1),w((()=>{this.gesture&&this.gesture.enable(!0)})))},window.addEventListener(I,this.keyboardOpenCallback));const n=void 0!==this.breakpoints&&void 0!==this.initialBreakpoint;this.isSheetModal=n,n?this.initSheetGesture():s&&this.initSwipeToClose(),this.initViewTransitionListener(),this.initParentRemovalObserver(),t()}initSwipeToClose(){var t;if("ios"!==$(this))return;const{el:o}=this,i=this.leaveAnimation||e.get("modalLeave",ot),a=this.animation=i(o,{presentingEl:this.presentingElement,expandToScroll:this.expandToScroll});if(!c(o))return void m(o);const r=null!==(t=this.statusBarStyle)&&void 0!==t?t:H.Default;this.gesture=((t,o,i,a)=>{const e=.5,r=t.offsetHeight;let s=!1,n=!1,c=null,m=null,f=!0,u=0;const b=W({el:t,gestureName:"modalSwipeToClose",gesturePriority:D,direction:"y",threshold:10,canStart:t=>{const o=t.event.target;if(null===o||!o.closest)return!0;if(c=d(o),c){if(h(c)){const t=x(c);m=t.querySelector(".inner-scroll")}else m=c;return!c.querySelector("ion-refresher")&&0===m.scrollTop}return null===o.closest("ion-footer")},onStart:i=>{const{deltaY:a}=i;f=!c||!h(c)||c.scrollY,n=void 0!==t.canDismiss&&!0!==t.canDismiss,a>0&&c&&l(c),o.progressStart(!0,s?1:0)},onMove:t=>{const{deltaY:a}=t;a>0&&c&&l(c);const s=t.deltaY/r,d=s>=0&&n,h=d?.2:.9999,p=d?_(s/h):s,m=v(1e-4,p,h);o.progressStep(m),m>=e&&u<e?U(i):m<e&&u>=e&&G(),u=m},onEnd:i=>{const d=i.velocityY,h=i.deltaY/r,l=h>=0&&n,m=l?.2:.9999,u=l?_(h/m):h,x=v(1e-4,u,m),w=!l&&(i.deltaY+1e3*d)/r>=e;let g=w?-.001:.001;w?(o.easing("cubic-bezier(0.32, 0.72, 0, 1)"),g+=z([0,0],[.32,.72],[0,1],[1,1],x)[0]):(o.easing("cubic-bezier(1, 0, 0.68, 0.28)"),g+=z([0,0],[1,0],[.68,.28],[1,1],x)[0]);const k=X(w?h*r:(1-x)*r,d);s=w,b.enable(!1),c&&p(c,f),o.onFinish((()=>{w||b.enable(!0)})).progressEnd(w?1:0,g,k),l&&x>m/4?K(t,o):w&&a()}});return b})(o,a,r,(()=>{this.gestureAnimationDismissing=!0,U(this.statusBarStyle),this.animation.onFinish((async()=>{await this.dismiss(void 0,Y),this.gestureAnimationDismissing=!1}))})),this.gesture.enable(!0)}initSheetGesture(){const{wrapperEl:t,initialBreakpoint:o,backdropBreakpoint:i}=this;if(!t||void 0===o)return;const a=this.enterAnimation||e.get("modalEnter",tt),r=this.animation=a(this.el,{presentingEl:this.presentingElement,currentBreakpoint:o,backdropBreakpoint:i,expandToScroll:this.expandToScroll});r.progressStart(!0,1);const{gesture:s,moveSheetToBreakpoint:n}=((t,o,i,a,e,r,s=[],n,l,p,c)=>{const m={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:0!==e?[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-e,opacity:0},{offset:1,opacity:0}]:[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}],CONTENT_KEYFRAMES:[{offset:0,maxHeight:"100%"},{offset:1,maxHeight:"0%"}]},f=t.querySelector("ion-content"),u=i.clientHeight;let b=a,g=0,k=!1,y=null,A=null,Y=null,D=null;const B=s[s.length-1],T=s[0],O=r.childAnimations.find((t=>"wrapperAnimation"===t.id)),S=r.childAnimations.find((t=>"backdropAnimation"===t.id)),C=r.childAnimations.find((t=>"contentAnimation"===t.id)),M=()=>{!1!==t.focusTrap&&!1!==t.showBackdrop&&(t.style.setProperty("pointer-events","auto"),o.style.setProperty("pointer-events","auto"),t.classList.remove(E))},P=()=>{t.style.setProperty("pointer-events","none"),o.style.setProperty("pointer-events","none"),t.classList.add(E)},j=o=>{if(!A&&(A=Array.from(t.querySelectorAll("ion-footer")),!A.length))return;const i=t.querySelector(".ion-page");if(D=o,"stationary"===o)A.forEach((t=>{t.classList.remove("modal-footer-moving"),t.style.removeProperty("position"),t.style.removeProperty("width"),t.style.removeProperty("height"),t.style.removeProperty("top"),t.style.removeProperty("left"),null==i||i.style.removeProperty("padding-bottom"),null==i||i.appendChild(t)}));else{let o=0;A.forEach(((i,a)=>{const e=i.getBoundingClientRect(),r=document.body.getBoundingClientRect();o+=i.clientHeight;const s=e.top-r.top,n=e.left-r.left;if(i.style.setProperty("--pinned-width",`${i.clientWidth}px`),i.style.setProperty("--pinned-height",`${i.clientHeight}px`),i.style.setProperty("--pinned-top",`${s}px`),i.style.setProperty("--pinned-left",`${n}px`),0===a){Y=s;const o=t.querySelector("ion-header");o&&(Y-=o.clientHeight)}})),A.forEach((t=>{null==i||i.style.setProperty("padding-bottom",`${o}px`),t.classList.add("modal-footer-moving"),t.style.setProperty("position","absolute"),t.style.setProperty("width","var(--pinned-width)"),t.style.setProperty("height","var(--pinned-height)"),t.style.setProperty("top","var(--pinned-top)"),t.style.setProperty("left","var(--pinned-left)"),document.body.appendChild(t)}))}};O&&S&&(O.keyframes([...m.WRAPPER_KEYFRAMES]),S.keyframes([...m.BACKDROP_KEYFRAMES]),null==C||C.keyframes([...m.CONTENT_KEYFRAMES]),r.progressStart(!0,1-b),b>e&&!1!==t.focusTrap&&!1!==t.showBackdrop?M():P()),f&&b!==B&&n&&(f.scrollY=!1);const R=o=>{const{breakpoint:i,canDismiss:a,breakpointOffset:d,animated:h}=o,l=a&&0===i,u=l?b:i,v=0!==u;return b=0,O&&S&&(O.keyframes([{offset:0,transform:`translateY(${100*d}%)`},{offset:1,transform:`translateY(${100*(1-u)}%)`}]),S.keyframes([{offset:0,opacity:`calc(var(--backdrop-opacity) * ${V(1-d,e)})`},{offset:1,opacity:`calc(var(--backdrop-opacity) * ${V(u,e)})`}]),C&&C.keyframes([{offset:0,maxHeight:100*(1-d)+"%"},{offset:1,maxHeight:100*u+"%"}]),r.progressStep(0)),L.enable(!1),l?K(t,r):v||p(),!f||u!==s[s.length-1]&&n||(f.scrollY=!0),n||0!==u||j("stationary"),new Promise((o=>{r.onFinish((()=>{v?(n||j("stationary"),O&&S?w((()=>{O.keyframes([...m.WRAPPER_KEYFRAMES]),S.keyframes([...m.BACKDROP_KEYFRAMES]),null==C||C.keyframes([...m.CONTENT_KEYFRAMES]),r.progressStart(!0,1-u),b=u,c(b),b>e&&!1!==t.focusTrap&&!1!==t.showBackdrop?M():P(),L.enable(!0),o()})):(L.enable(!0),o())):o()}),{oneTimeCallback:!0}).progressEnd(1,0,h?500:0)}))},L=W({el:i,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:t=>{const o=d(t.event.target);if(b=l(),!n&&o)return 0===(h(o)?x(o).querySelector(".inner-scroll"):o).scrollTop;if(1===b&&o){const t=h(o)?x(o).querySelector(".inner-scroll"):o;return!o.querySelector("ion-refresher")&&0===t.scrollTop}return!0},onStart:o=>{if(k=void 0!==t.canDismiss&&!0!==t.canDismiss&&0===T,!n){const t=d(o.event.target);y=t&&h(t)?x(t).querySelector(".inner-scroll"):t}n||j("moving"),o.deltaY>0&&f&&(f.scrollY=!1),w((()=>{t.focus()})),r.progressStart(!0,1-b)},onMove:t=>{if(n||null===Y||null===D||(t.currentY>=Y&&"moving"===D?j("stationary"):t.currentY<Y&&"stationary"===D&&j("moving")),!n&&t.deltaY<=0&&y)return;t.deltaY>0&&f&&(f.scrollY=!1);const o=s.length>1?1-s[1]:void 0,i=1-b+t.deltaY/u,a=void 0!==o&&i>=o&&k,e=a?.95:.9999,d=a&&void 0!==o?o+_((i-o)/(e-o)):i;g=v(1e-4,d,e),r.progressStep(g)},onEnd:t=>{if(!n&&t.deltaY<=0&&y&&y.scrollTop>0)return void j("stationary");const o=b-(t.deltaY+350*t.velocityY)/u,i=s.reduce(((t,i)=>Math.abs(i-o)<Math.abs(t-o)?i:t));R({breakpoint:i,breakpointOffset:g,canDismiss:k,animated:!0})}});return{gesture:L,moveSheetToBreakpoint:R}})(this.el,this.backdropEl,t,o,i,r,this.sortedBreakpoints,this.expandToScroll,(()=>{var t;return null!==(t=this.currentBreakpoint)&&void 0!==t?t:0}),(()=>this.sheetOnDismiss()),(t=>{this.currentBreakpoint!==t&&(this.currentBreakpoint=t,this.ionBreakpointDidChange.emit({breakpoint:t}))}));this.gesture=s,this.moveSheetToBreakpoint=n,this.gesture.enable(!0),(!1===this.showBackdrop||!1===this.focusTrap||i>0)&&this.setupChildRoutePassthrough()}setupChildRoutePassthrough(){var t;this.cachedPageParent=this.getOriginalPageParent();const o=this.cachedPageParent;if(!o||"ION-APP"===o.tagName)return;const i=Array.from(o.children).some((t=>{var o;return!(t===this.el||t instanceof HTMLElement&&"none"===window.getComputedStyle(t).display||"TEMPLATE"===t.tagName||"SLOT"===t.tagName||t.nodeType===Node.TEXT_NODE&&!(null===(o=t.textContent)||void 0===o?void 0:o.trim()))}));if(i)return;o.classList.add("ion-page-overlay-passthrough");const a=o.parentElement;"ION-ROUTER-OUTLET"===(null==a?void 0:a.tagName)&&"ION-APP"!==(null===(t=a.parentElement)||void 0===t?void 0:t.tagName)&&(a.style.setProperty("pointer-events","none"),a.setAttribute("data-overlay-passthrough","true"))}getOriginalPageParent(){if(!this.cachedOriginalParent)return null;let t=this.cachedOriginalParent;for(;t&&!t.classList.contains("ion-page");)t=t.parentElement;return t}cleanupChildRoutePassthrough(){const t=this.cachedPageParent;if(!t)return;t.classList.remove("ion-page-overlay-passthrough");const o=t.parentElement;(null==o?void 0:o.hasAttribute("data-overlay-passthrough"))&&(o.style.removeProperty("pointer-events"),o.removeAttribute("data-overlay-passthrough")),this.cachedPageParent=void 0}sheetOnDismiss(){this.gestureAnimationDismissing=!0,this.animation.onFinish((async()=>{this.currentBreakpoint=0,this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint}),await this.dismiss(void 0,Y),this.gestureAnimationDismissing=!1}))}async dismiss(t,o){var i;if(this.gestureAnimationDismissing&&o!==Y)return!1;const e=await this.lockController.lock();if(await this.dismissNestedModals(),"handler"!==o&&!await this.checkCanDismiss(t,o))return e(),!1;const{presentingElement:r}=this;void 0!==r&&"ios"===$(this)&&U(this.statusBarStyle),"undefined"!=typeof window&&this.keyboardOpenCallback&&(window.removeEventListener(I,this.keyboardOpenCallback),this.keyboardOpenCallback=void 0);const s=await M(this,t,o,"modalLeave",ot,at,{presentingEl:r,currentBreakpoint:null!==(i=this.currentBreakpoint)&&void 0!==i?i:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll});if(s){const{delegate:t}=this.getDelegate();await b(t,this.usersElement),a((()=>this.el.classList.remove("show-modal"))),this.animation&&this.animation.destroy(),this.gesture&&this.gesture.destroy(),this.cleanupViewTransitionListener(),this.cleanupParentRemovalObserver(),this.cleanupChildRoutePassthrough()}return this.currentBreakpoint=void 0,this.animation=void 0,e(),s}onDidDismiss(){return P(this.el,"ionModalDidDismiss")}onWillDismiss(){return P(this.el,"ionModalWillDismiss")}async setCurrentBreakpoint(t){if(!this.isSheetModal)return void i("[ion-modal] - setCurrentBreakpoint is only supported on sheet modals.");if(!this.breakpoints.includes(t))return void i(`[ion-modal] - Attempted to set invalid breakpoint value ${t}. Please double check that the breakpoint value is part of your defined breakpoints.`);const{currentBreakpoint:o,moveSheetToBreakpoint:a,canDismiss:e,breakpoints:r,animated:s}=this;o!==t&&a&&(this.sheetTransition=a({breakpoint:t,breakpointOffset:1-o,canDismiss:void 0!==e&&!0!==e&&0===r[0],animated:s}),await this.sheetTransition,this.sheetTransition=void 0)}async getCurrentBreakpoint(){return this.currentBreakpoint}async moveToNextBreakpoint(){const{breakpoints:t,currentBreakpoint:o}=this;if(!t||null==o)return!1;const i=t.filter((t=>0!==t)),a=i.indexOf(o),e=i[(a+1)%i.length];return await this.setCurrentBreakpoint(e),!0}initViewTransitionListener(){"ios"!==$(this)||!this.presentingElement||this.enterAnimation||this.leaveAnimation||(this.currentViewIsPortrait=window.innerWidth<768)}handleViewTransition(){if(!this.presented)return;const t=window.innerWidth<768;if(this.currentViewIsPortrait===t)return;this.viewTransitionAnimation&&(this.viewTransitionAnimation.destroy(),this.viewTransitionAnimation=void 0);const{presentingElement:o}=this;if(!o)return;let i;i=this.currentViewIsPortrait&&!t?((t,o,i=300)=>{const{presentingEl:a}=o;if(!a)return N("portrait-to-landscape-transition");const e="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,r=x(a),s=document.body,n=N("portrait-to-landscape-transition").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(i),d=N().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});if(e){const t="translateY(-10px) scale(0.915)",o="translateY(0px) scale(1)";d.addElement(a).afterStyles({transform:o}).fromTo("transform",t,o).fromTo("filter","contrast(0.85)","contrast(1)");const i=N().addElement(r.querySelector(".modal-shadow")).afterStyles({transform:o,opacity:"0"}).fromTo("transform",t,o);n.addAnimation([d,i])}else{const o=x(t),i=N().addElement(o.querySelectorAll(".modal-wrapper, .modal-shadow")).fromTo("opacity","1","1"),e=N().addElement(o.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)","var(--backdrop-opacity)"),r=`translateY(${CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px"}) scale(0.915)`;d.addElement(a).afterStyles({transform:"translateY(0px) scale(1)","border-radius":"0px"}).beforeAddWrite((()=>s.style.setProperty("background-color",""))).fromTo("transform",r,"translateY(0px) scale(1)").fromTo("filter","contrast(0.85)","contrast(1)").fromTo("border-radius","10px 10px 0 0","0px"),n.addAnimation([d,i,e])}return n})(this.el,{presentingEl:o}):((t,o,i=300)=>{const{presentingEl:a}=o;if(!a)return N("landscape-to-portrait-transition");const e="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,r=x(a),s=document.body,n=N("landscape-to-portrait-transition").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(i),d=N().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});if(e){const t="translateY(-10px) scale(0.915)",o="translateY(0) scale(1)";d.addElement(a).afterStyles({transform:o}).fromTo("transform",t,o);const i=N().addElement(r.querySelector(".modal-shadow")).afterStyles({transform:o,opacity:"0"}).fromTo("transform",t,o);n.addAnimation([d,i])}else{const o=x(t),i=N().addElement(o.querySelectorAll(".modal-wrapper, .modal-shadow")).fromTo("opacity","1","1"),e=N().addElement(o.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)","var(--backdrop-opacity)"),r=`translateY(${CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px"}) scale(0.915)`;d.addElement(a).afterStyles({transform:r}).beforeAddWrite((()=>s.style.setProperty("background-color","black"))).keyframes([{offset:0,transform:"translateY(0px) scale(1)",filter:"contrast(1)",borderRadius:"0px"},{offset:.2,transform:"translateY(0px) scale(1)",filter:"contrast(1)",borderRadius:"10px 10px 0 0"},{offset:1,transform:r,filter:"contrast(0.85)",borderRadius:"10px 10px 0 0"}]),n.addAnimation([d,i,e])}return n})(this.el,{presentingEl:o}),this.currentViewIsPortrait=t,this.viewTransitionAnimation=i,i.play().then((()=>{this.viewTransitionAnimation=void 0,this.reinitSwipeToClose()}))}cleanupViewTransitionListener(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=void 0),this.viewTransitionAnimation&&(this.viewTransitionAnimation.destroy(),this.viewTransitionAnimation=void 0)}reinitSwipeToClose(){"ios"===$(this)&&this.presentingElement&&(this.gesture&&(this.gesture.destroy(),this.gesture=void 0),this.animation&&(this.animation.progressEnd(0,0,0),this.animation.destroy(),this.animation=void 0),w((()=>{this.ensureCorrectModalPosition(),this.initSwipeToClose()})))}ensureCorrectModalPosition(){const{el:t,presentingElement:o}=this,i=x(t).querySelector(".modal-wrapper");if(i&&(i.style.transform="translateY(0vh)",i.style.opacity="1"),"ION-MODAL"===(null==o?void 0:o.tagName))if(window.innerWidth<768){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px";o.style.transform=`translateY(${t}) scale(0.915)`}else o.style.transform="translateY(0px) scale(1)"}async dismissNestedModals(){const t=document.querySelectorAll(`ion-modal[data-parent-ion-modal="${this.el.id}"]`);null==t||t.forEach((async t=>{await t.dismiss(void 0,"parent-dismissed")}))}initParentRemovalObserver(){"undefined"!=typeof MutationObserver&&"undefined"!=typeof window&&this.cachedOriginalParent&&this.cachedOriginalParent.nodeType!==Node.DOCUMENT_NODE&&this.cachedOriginalParent.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&(this.hasController||this.cachedOriginalParent===document.body||"ION-APP"===this.cachedOriginalParent.tagName||(this.parentRemovalObserver=new MutationObserver((t=>{t.forEach((t=>{"childList"===t.type&&t.removedNodes.length>0&&(Array.from(t.removedNodes).some((t=>{var o,i;const a=t===this.cachedOriginalParent,e=!!this.cachedOriginalParent&&(null===(i=(o=t).contains)||void 0===i?void 0:i.call(o,this.cachedOriginalParent));return a||e}))||this.cachedOriginalParent&&!this.cachedOriginalParent.isConnected)&&(this.dismiss(void 0,"parent-removed"),this.cachedOriginalParent=void 0)}))})),this.parentRemovalObserver.observe(document.body,{childList:!0,subtree:!0})))}cleanupParentRemovalObserver(){var t;null===(t=this.parentRemovalObserver)||void 0===t||t.disconnect(),this.parentRemovalObserver=void 0}render(){const{handle:t,isSheetModal:o,presentingElement:i,htmlAttributes:a,handleBehavior:e,inheritedAttributes:n,focusTrap:d,expandToScroll:h}=this,l=!1!==t&&o,p=$(this),c=void 0!==i&&"ios"===p,m="cycle"===e;return r(s,Object.assign({key:"87328006ea6c75ebc518ace300438492a567223e","no-router":!0,tabIndex:m&&o&&l?0:-1},a,{style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign({[p]:!0,"modal-default":!c&&!o,"modal-card":c,"modal-sheet":o,"modal-no-expand-scroll":o&&!h,"overlay-hidden":!0,[E]:!1===d},j(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle,onFocus:this.onModalFocus}),r("ion-backdrop",{key:"ee94ff8e09b691dd4ad4e4db1720f06bc3c5a469",ref:t=>this.backdropEl=t,visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),"ios"===p&&r("div",{key:"bffd69b4635c22d9f249725bd952c1e93d5615c7",class:"modal-shadow"}),r("div",Object.assign({key:"1d394d3c68916e464ff1fbf5242419f4a3d3cca1",role:"dialog"},n,{"aria-modal":"true",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:t=>this.wrapperEl=t}),l&&r("button",{key:"2dcf58792018e557e0c323baad2d672bc99c0bb1",class:"modal-handle",tabIndex:m?0:-1,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:m?this.onHandleClick:void 0,part:"handle",ref:t=>this.dragHandleEl=t}),r("slot",{key:"44164b1e8710c3895400ad9f44ecd99873874ad5",onSlotchange:this.onSlotChange})))}get el(){return n(this)}static get watchers(){return{isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}}},rt={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};et.style={ios:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}',md:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}'};export{et as ion_modal}
|