@ionic/core 8.7.17-dev.11767636336.113b441d → 8.7.17-dev.11767641184.14a165bc
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/ion-tab-bar.js +3 -17
- package/components/modal.js +144 -11
- package/components/popover.js +60 -10
- package/dist/cjs/ion-modal.cjs.entry.js +144 -11
- package/dist/cjs/ion-popover.cjs.entry.js +60 -10
- package/dist/cjs/ion-tab-bar_2.cjs.entry.js +3 -17
- 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 +136 -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 +20 -4
- package/dist/collection/components/popover/utils.js +19 -1
- package/dist/collection/components/tab-bar/tab-bar.js +3 -17
- package/dist/docs.json +1 -1
- package/dist/esm/ion-modal.entry.js +144 -11
- package/dist/esm/ion-popover.entry.js +60 -10
- package/dist/esm/ion-tab-bar_2.entry.js +3 -17
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-301ad219.entry.js +4 -0
- package/dist/ionic/p-7268efa5.entry.js +4 -0
- package/dist/ionic/p-fedca459.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 +29 -0
- package/dist/types/components/popover/utils.d.ts +2 -0
- package/dist/types/components/tab-bar/tab-bar.d.ts +0 -1
- package/hydrate/index.js +207 -38
- package/hydrate/index.mjs +207 -38
- package/package.json +1 -1
- package/dist/ionic/p-0d0eb444.entry.js +0 -4
- package/dist/ionic/p-91840a80.entry.js +0 -4
- package/dist/ionic/p-f9061316.entry.js +0 -4
package/hydrate/index.js
CHANGED
|
@@ -21533,7 +21533,7 @@ const calculateSpringStep = (t) => {
|
|
|
21533
21533
|
const SwipeToCloseDefaults = {
|
|
21534
21534
|
MIN_PRESENTING_SCALE: 0.915,
|
|
21535
21535
|
};
|
|
21536
|
-
const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) => {
|
|
21536
|
+
const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss, onGestureMove) => {
|
|
21537
21537
|
/**
|
|
21538
21538
|
* The step value at which a card modal
|
|
21539
21539
|
* is eligible for dismissing via gesture.
|
|
@@ -21690,6 +21690,8 @@ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) =>
|
|
|
21690
21690
|
const processedStep = isAttemptingDismissWithCanDismiss ? calculateSpringStep(step / maxStep) : step;
|
|
21691
21691
|
const clampedStep = clamp(0.0001, processedStep, maxStep);
|
|
21692
21692
|
animation.progressStep(clampedStep);
|
|
21693
|
+
// Notify modal of position change for safe-area updates
|
|
21694
|
+
onGestureMove === null || onGestureMove === void 0 ? void 0 : onGestureMove();
|
|
21693
21695
|
/**
|
|
21694
21696
|
* When swiping down half way, the status bar style
|
|
21695
21697
|
* should be reset to its default value.
|
|
@@ -22233,7 +22235,7 @@ const mdLeaveAnimation$2 = (baseEl, opts) => {
|
|
|
22233
22235
|
return baseAnimation;
|
|
22234
22236
|
};
|
|
22235
22237
|
|
|
22236
|
-
const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange) => {
|
|
22238
|
+
const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange, onGestureMove) => {
|
|
22237
22239
|
// Defaults for the sheet swipe animation
|
|
22238
22240
|
const defaultBackdrop = [
|
|
22239
22241
|
{ offset: 0, opacity: 'var(--backdrop-opacity)' },
|
|
@@ -22564,6 +22566,8 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
22564
22566
|
: step;
|
|
22565
22567
|
offset = clamp(0.0001, processedStep, maxStep);
|
|
22566
22568
|
animation.progressStep(offset);
|
|
22569
|
+
// Notify modal of position change for safe-area updates
|
|
22570
|
+
onGestureMove === null || onGestureMove === void 0 ? void 0 : onGestureMove();
|
|
22567
22571
|
};
|
|
22568
22572
|
const onEnd = (detail) => {
|
|
22569
22573
|
/**
|
|
@@ -22758,9 +22762,9 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
22758
22762
|
};
|
|
22759
22763
|
};
|
|
22760
22764
|
|
|
22761
|
-
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
|
|
22765
|
+
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}";
|
|
22762
22766
|
|
|
22763
|
-
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
|
|
22767
|
+
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}";
|
|
22764
22768
|
|
|
22765
22769
|
// TODO(FW-2832): types
|
|
22766
22770
|
/**
|
|
@@ -22793,6 +22797,8 @@ class Modal {
|
|
|
22793
22797
|
this.inline = false;
|
|
22794
22798
|
// Whether or not modal is being dismissed via gesture
|
|
22795
22799
|
this.gestureAnimationDismissing = false;
|
|
22800
|
+
// Whether to skip coordinate-based safe-area detection (for fullscreen phone modals)
|
|
22801
|
+
this.skipSafeAreaCoordinateDetection = false;
|
|
22796
22802
|
this.presented = false;
|
|
22797
22803
|
/** @internal */
|
|
22798
22804
|
this.hasController = false;
|
|
@@ -22983,7 +22989,9 @@ class Modal {
|
|
|
22983
22989
|
}
|
|
22984
22990
|
}
|
|
22985
22991
|
onWindowResize() {
|
|
22986
|
-
//
|
|
22992
|
+
// Update safe-area overrides for all modal types on resize
|
|
22993
|
+
this.updateSafeAreaOverrides();
|
|
22994
|
+
// Only handle view transition for iOS card modals when no custom animations are provided
|
|
22987
22995
|
if (getIonMode$1(this) !== 'ios' || !this.presentingElement || this.enterAnimation || this.leaveAnimation) {
|
|
22988
22996
|
return;
|
|
22989
22997
|
}
|
|
@@ -23165,6 +23173,8 @@ class Modal {
|
|
|
23165
23173
|
else if (!this.keepContentsMounted) {
|
|
23166
23174
|
await waitForMount();
|
|
23167
23175
|
}
|
|
23176
|
+
// Predict safe-area needs based on modal configuration to avoid visual snap
|
|
23177
|
+
this.setInitialSafeAreaOverrides(presentingElement);
|
|
23168
23178
|
writeTask(() => this.el.classList.add('show-modal'));
|
|
23169
23179
|
const hasCardModal = presentingElement !== undefined;
|
|
23170
23180
|
/**
|
|
@@ -23226,6 +23236,8 @@ class Modal {
|
|
|
23226
23236
|
else if (hasCardModal) {
|
|
23227
23237
|
this.initSwipeToClose();
|
|
23228
23238
|
}
|
|
23239
|
+
// Now that animation is complete, update safe-area based on actual position
|
|
23240
|
+
this.updateSafeAreaOverrides();
|
|
23229
23241
|
// Initialize view transition listener for iOS card modals
|
|
23230
23242
|
this.initViewTransitionListener();
|
|
23231
23243
|
// Initialize parent removal observer
|
|
@@ -23277,7 +23289,7 @@ class Modal {
|
|
|
23277
23289
|
await this.dismiss(undefined, GESTURE);
|
|
23278
23290
|
this.gestureAnimationDismissing = false;
|
|
23279
23291
|
});
|
|
23280
|
-
});
|
|
23292
|
+
}, () => this.updateSafeAreaOverrides());
|
|
23281
23293
|
this.gesture.enable(true);
|
|
23282
23294
|
}
|
|
23283
23295
|
initSheetGesture() {
|
|
@@ -23298,7 +23310,8 @@ class Modal {
|
|
|
23298
23310
|
this.currentBreakpoint = breakpoint;
|
|
23299
23311
|
this.ionBreakpointDidChange.emit({ breakpoint });
|
|
23300
23312
|
}
|
|
23301
|
-
|
|
23313
|
+
this.updateSafeAreaOverrides();
|
|
23314
|
+
}, () => this.updateSafeAreaOverrides());
|
|
23302
23315
|
this.gesture = gesture;
|
|
23303
23316
|
this.moveSheetToBreakpoint = moveSheetToBreakpoint;
|
|
23304
23317
|
this.gesture.enable(true);
|
|
@@ -23376,6 +23389,124 @@ class Modal {
|
|
|
23376
23389
|
// Clear the cached reference
|
|
23377
23390
|
this.cachedPageParent = undefined;
|
|
23378
23391
|
}
|
|
23392
|
+
/**
|
|
23393
|
+
* Sets initial safe-area overrides based on modal configuration before
|
|
23394
|
+
* the modal becomes visible. This predicts whether the modal will touch
|
|
23395
|
+
* screen edges to avoid a visual snap after animation completes.
|
|
23396
|
+
*/
|
|
23397
|
+
setInitialSafeAreaOverrides(presentingElement) {
|
|
23398
|
+
const style = this.el.style;
|
|
23399
|
+
const mode = getIonMode$1(this);
|
|
23400
|
+
const isSheetModal = this.breakpoints !== undefined && this.initialBreakpoint !== undefined;
|
|
23401
|
+
// Card modals only exist in iOS mode - in MD mode, presentingElement is ignored
|
|
23402
|
+
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
23403
|
+
const isTablet = window.innerWidth >= 768;
|
|
23404
|
+
// Sheet modals always touch bottom edge, never top/left/right
|
|
23405
|
+
if (isSheetModal) {
|
|
23406
|
+
style.setProperty('--ion-safe-area-top', '0px');
|
|
23407
|
+
style.setProperty('--ion-safe-area-left', '0px');
|
|
23408
|
+
style.setProperty('--ion-safe-area-right', '0px');
|
|
23409
|
+
return;
|
|
23410
|
+
}
|
|
23411
|
+
// Card modals have rounded top corners
|
|
23412
|
+
if (isCardModal) {
|
|
23413
|
+
style.setProperty('--ion-safe-area-top', '0px');
|
|
23414
|
+
if (isTablet) {
|
|
23415
|
+
// On tablets, card modals are inset from all edges
|
|
23416
|
+
this.zeroAllSafeAreas();
|
|
23417
|
+
}
|
|
23418
|
+
else {
|
|
23419
|
+
// On phones, card modals still extend to the bottom edge
|
|
23420
|
+
style.setProperty('--ion-safe-area-left', '0px');
|
|
23421
|
+
style.setProperty('--ion-safe-area-right', '0px');
|
|
23422
|
+
this.applyFullscreenSafeArea();
|
|
23423
|
+
}
|
|
23424
|
+
return;
|
|
23425
|
+
}
|
|
23426
|
+
// Phone-sized fullscreen modals inherit safe areas and use wrapper padding
|
|
23427
|
+
if (!isTablet) {
|
|
23428
|
+
this.applyFullscreenSafeArea();
|
|
23429
|
+
return;
|
|
23430
|
+
}
|
|
23431
|
+
// Check if tablet modal is fullscreen via CSS custom properties
|
|
23432
|
+
const computedStyle = getComputedStyle(this.el);
|
|
23433
|
+
const width = computedStyle.getPropertyValue('--width').trim();
|
|
23434
|
+
const height = computedStyle.getPropertyValue('--height').trim();
|
|
23435
|
+
const isFullscreen = width === '100%' && height === '100%';
|
|
23436
|
+
if (isFullscreen) {
|
|
23437
|
+
this.applyFullscreenSafeArea();
|
|
23438
|
+
}
|
|
23439
|
+
else {
|
|
23440
|
+
// Centered dialog doesn't touch edges
|
|
23441
|
+
this.zeroAllSafeAreas();
|
|
23442
|
+
}
|
|
23443
|
+
}
|
|
23444
|
+
/**
|
|
23445
|
+
* Applies safe-area handling for fullscreen modals.
|
|
23446
|
+
* Adds wrapper padding when no footer is present to prevent
|
|
23447
|
+
* content from overlapping system navigation areas.
|
|
23448
|
+
*/
|
|
23449
|
+
applyFullscreenSafeArea() {
|
|
23450
|
+
this.skipSafeAreaCoordinateDetection = true;
|
|
23451
|
+
const hasFooter = this.el.querySelector('ion-footer') !== null;
|
|
23452
|
+
if (!hasFooter && this.wrapperEl) {
|
|
23453
|
+
this.wrapperEl.style.setProperty('padding-bottom', 'var(--ion-safe-area-bottom, 0px)');
|
|
23454
|
+
this.wrapperEl.style.setProperty('box-sizing', 'border-box');
|
|
23455
|
+
}
|
|
23456
|
+
}
|
|
23457
|
+
/**
|
|
23458
|
+
* Sets all safe-area CSS variables to 0px for modals that
|
|
23459
|
+
* don't touch screen edges.
|
|
23460
|
+
*/
|
|
23461
|
+
zeroAllSafeAreas() {
|
|
23462
|
+
const style = this.el.style;
|
|
23463
|
+
style.setProperty('--ion-safe-area-top', '0px');
|
|
23464
|
+
style.setProperty('--ion-safe-area-bottom', '0px');
|
|
23465
|
+
style.setProperty('--ion-safe-area-left', '0px');
|
|
23466
|
+
style.setProperty('--ion-safe-area-right', '0px');
|
|
23467
|
+
}
|
|
23468
|
+
/**
|
|
23469
|
+
* Gets the root safe-area values from the document element.
|
|
23470
|
+
* These represent the actual device safe areas before any overlay overrides.
|
|
23471
|
+
*/
|
|
23472
|
+
getRootSafeAreaValues() {
|
|
23473
|
+
const rootStyle = getComputedStyle(document.documentElement);
|
|
23474
|
+
return {
|
|
23475
|
+
top: parseFloat(rootStyle.getPropertyValue('--ion-safe-area-top')) || 0,
|
|
23476
|
+
bottom: parseFloat(rootStyle.getPropertyValue('--ion-safe-area-bottom')) || 0,
|
|
23477
|
+
left: parseFloat(rootStyle.getPropertyValue('--ion-safe-area-left')) || 0,
|
|
23478
|
+
right: parseFloat(rootStyle.getPropertyValue('--ion-safe-area-right')) || 0,
|
|
23479
|
+
};
|
|
23480
|
+
}
|
|
23481
|
+
/**
|
|
23482
|
+
* Updates safe-area CSS variable overrides based on whether the modal
|
|
23483
|
+
* extends into each safe-area region. Called after animation
|
|
23484
|
+
* and during gestures to handle dynamic position changes.
|
|
23485
|
+
*/
|
|
23486
|
+
updateSafeAreaOverrides() {
|
|
23487
|
+
if (this.skipSafeAreaCoordinateDetection) {
|
|
23488
|
+
return;
|
|
23489
|
+
}
|
|
23490
|
+
const wrapper = this.wrapperEl;
|
|
23491
|
+
if (!wrapper) {
|
|
23492
|
+
return;
|
|
23493
|
+
}
|
|
23494
|
+
const rect = wrapper.getBoundingClientRect();
|
|
23495
|
+
const safeAreas = this.getRootSafeAreaValues();
|
|
23496
|
+
const extendsIntoTop = rect.top < safeAreas.top;
|
|
23497
|
+
const extendsIntoBottom = rect.bottom > window.innerHeight - safeAreas.bottom;
|
|
23498
|
+
const extendsIntoLeft = rect.left < safeAreas.left;
|
|
23499
|
+
const extendsIntoRight = rect.right > window.innerWidth - safeAreas.right;
|
|
23500
|
+
const style = this.el.style;
|
|
23501
|
+
extendsIntoTop ? style.removeProperty('--ion-safe-area-top') : style.setProperty('--ion-safe-area-top', '0px');
|
|
23502
|
+
extendsIntoBottom
|
|
23503
|
+
? style.removeProperty('--ion-safe-area-bottom')
|
|
23504
|
+
: style.setProperty('--ion-safe-area-bottom', '0px');
|
|
23505
|
+
extendsIntoLeft ? style.removeProperty('--ion-safe-area-left') : style.setProperty('--ion-safe-area-left', '0px');
|
|
23506
|
+
extendsIntoRight
|
|
23507
|
+
? style.removeProperty('--ion-safe-area-right')
|
|
23508
|
+
: style.setProperty('--ion-safe-area-right', '0px');
|
|
23509
|
+
}
|
|
23379
23510
|
sheetOnDismiss() {
|
|
23380
23511
|
/**
|
|
23381
23512
|
* While the gesture animation is finishing
|
|
@@ -23468,6 +23599,8 @@ class Modal {
|
|
|
23468
23599
|
}
|
|
23469
23600
|
this.currentBreakpoint = undefined;
|
|
23470
23601
|
this.animation = undefined;
|
|
23602
|
+
// Reset safe-area detection flag for potential re-presentation
|
|
23603
|
+
this.skipSafeAreaCoordinateDetection = false;
|
|
23471
23604
|
unlock();
|
|
23472
23605
|
return dismissed;
|
|
23473
23606
|
}
|
|
@@ -23717,20 +23850,20 @@ class Modal {
|
|
|
23717
23850
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
23718
23851
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
23719
23852
|
const isSheetModalWithHandle = isSheetModal && showHandle;
|
|
23720
|
-
return (hAsync(Host, Object.assign({ key: '
|
|
23853
|
+
return (hAsync(Host, Object.assign({ key: '07ebca6a70eb99f8a2236e1d66a03097a7bb67d8', "no-router": true,
|
|
23721
23854
|
// Allow the modal to be navigable when the handle is focusable
|
|
23722
23855
|
tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
|
|
23723
23856
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
23724
|
-
}, 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: '
|
|
23857
|
+
}, 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: '1b6850d9b9f6e8f3865b49e0a14399e2ef43a5d6', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && hAsync("div", { key: 'eab52c0ebccb820781e92392dc6fa90db93525d5', class: "modal-shadow" }), hAsync("div", Object.assign({ key: 'ab9448cabdf03a633319999771ce1ca1edce5699',
|
|
23725
23858
|
/*
|
|
23726
23859
|
role and aria-modal must be used on the
|
|
23727
23860
|
same element. They must also be set inside the
|
|
23728
23861
|
shadow DOM otherwise ion-button will not be highlighted
|
|
23729
23862
|
when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
|
|
23730
23863
|
*/
|
|
23731
|
-
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: '
|
|
23864
|
+
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: 'b2b8c0a8d8add0d43e928dd3d3519f184551e62b', class: "modal-handle",
|
|
23732
23865
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
23733
|
-
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: '
|
|
23866
|
+
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: 'b994f206765f7b340971d378f00999c0da334102', onSlotchange: this.onSlotChange }))));
|
|
23734
23867
|
}
|
|
23735
23868
|
get el() { return getElement(this); }
|
|
23736
23869
|
static get watchers() { return {
|
|
@@ -27308,6 +27441,8 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
27308
27441
|
let bottom;
|
|
27309
27442
|
let originX = contentOriginX;
|
|
27310
27443
|
let originY = contentOriginY;
|
|
27444
|
+
let checkSafeAreaTop = false;
|
|
27445
|
+
let checkSafeAreaBottom = false;
|
|
27311
27446
|
let checkSafeAreaLeft = false;
|
|
27312
27447
|
let checkSafeAreaRight = false;
|
|
27313
27448
|
const triggerTop = triggerCoordinates
|
|
@@ -27352,10 +27487,18 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
27352
27487
|
* We chose 12 here so that the popover position looks a bit nicer as
|
|
27353
27488
|
* it is not right up against the edge of the screen.
|
|
27354
27489
|
*/
|
|
27355
|
-
top = Math.max(
|
|
27490
|
+
top = Math.max(bodyPadding, triggerTop - contentHeight - triggerHeight - (arrowHeight - 1));
|
|
27356
27491
|
arrowTop = top + contentHeight;
|
|
27357
27492
|
originY = 'bottom';
|
|
27358
27493
|
addPopoverBottomClass = true;
|
|
27494
|
+
/**
|
|
27495
|
+
* If the popover is positioned near the top edge, account for safe area.
|
|
27496
|
+
* This ensures the popover doesn't overlap with status bars or notches.
|
|
27497
|
+
*/
|
|
27498
|
+
if (top <= bodyPadding + safeAreaMargin) {
|
|
27499
|
+
checkSafeAreaTop = true;
|
|
27500
|
+
top = bodyPadding;
|
|
27501
|
+
}
|
|
27359
27502
|
/**
|
|
27360
27503
|
* If not enough room for popover to appear
|
|
27361
27504
|
* above trigger, then cut it off.
|
|
@@ -27363,6 +27506,12 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
27363
27506
|
}
|
|
27364
27507
|
else {
|
|
27365
27508
|
bottom = bodyPadding;
|
|
27509
|
+
/**
|
|
27510
|
+
* When the popover is pinned to the bottom, account for safe area.
|
|
27511
|
+
* This ensures the popover doesn't overlap with home indicators
|
|
27512
|
+
* or navigation bars (e.g., Android API 36+ edge-to-edge).
|
|
27513
|
+
*/
|
|
27514
|
+
checkSafeAreaBottom = true;
|
|
27366
27515
|
}
|
|
27367
27516
|
}
|
|
27368
27517
|
return {
|
|
@@ -27371,6 +27520,8 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
27371
27520
|
bottom,
|
|
27372
27521
|
originX,
|
|
27373
27522
|
originY,
|
|
27523
|
+
checkSafeAreaTop,
|
|
27524
|
+
checkSafeAreaBottom,
|
|
27374
27525
|
checkSafeAreaLeft,
|
|
27375
27526
|
checkSafeAreaRight,
|
|
27376
27527
|
arrowTop,
|
|
@@ -27431,7 +27582,7 @@ const iosEnterAnimation$1 = (baseEl, opts) => {
|
|
|
27431
27582
|
const results = getPopoverPosition(isRTL, contentWidth, contentHeight, arrowWidth, arrowHeight, reference, side, align, defaultPosition, trigger, ev);
|
|
27432
27583
|
const padding = size === 'cover' ? 0 : POPOVER_IOS_BODY_PADDING;
|
|
27433
27584
|
const margin = size === 'cover' ? 0 : 25;
|
|
27434
|
-
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);
|
|
27585
|
+
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);
|
|
27435
27586
|
const baseAnimation = createAnimation();
|
|
27436
27587
|
const backdropAnimation = createAnimation();
|
|
27437
27588
|
const contentAnimation = createAnimation();
|
|
@@ -27461,19 +27612,35 @@ const iosEnterAnimation$1 = (baseEl, opts) => {
|
|
|
27461
27612
|
if (addPopoverBottomClass) {
|
|
27462
27613
|
baseEl.classList.add('popover-bottom');
|
|
27463
27614
|
}
|
|
27464
|
-
|
|
27465
|
-
|
|
27466
|
-
|
|
27615
|
+
/**
|
|
27616
|
+
* Safe area CSS variable adjustments.
|
|
27617
|
+
* When the popover is positioned near an edge, we add the corresponding
|
|
27618
|
+
* safe-area inset to ensure the popover doesn't overlap with system UI
|
|
27619
|
+
* (status bars, home indicators, navigation bars on Android API 36+, etc.)
|
|
27620
|
+
*/
|
|
27621
|
+
const safeAreaTop = ' + var(--ion-safe-area-top, 0)';
|
|
27622
|
+
const safeAreaBottom = ' + var(--ion-safe-area-bottom, 0)';
|
|
27467
27623
|
const safeAreaLeft = ' + var(--ion-safe-area-left, 0)';
|
|
27468
27624
|
const safeAreaRight = ' - var(--ion-safe-area-right, 0)';
|
|
27625
|
+
let topValue = `${top}px`;
|
|
27626
|
+
let bottomValue = bottom !== undefined ? `${bottom}px` : undefined;
|
|
27469
27627
|
let leftValue = `${left}px`;
|
|
27628
|
+
if (checkSafeAreaTop) {
|
|
27629
|
+
topValue = `${top}px${safeAreaTop}`;
|
|
27630
|
+
}
|
|
27631
|
+
if (checkSafeAreaBottom && bottomValue !== undefined) {
|
|
27632
|
+
bottomValue = `${bottom}px${safeAreaBottom}`;
|
|
27633
|
+
}
|
|
27470
27634
|
if (checkSafeAreaLeft) {
|
|
27471
27635
|
leftValue = `${left}px${safeAreaLeft}`;
|
|
27472
27636
|
}
|
|
27473
27637
|
if (checkSafeAreaRight) {
|
|
27474
27638
|
leftValue = `${left}px${safeAreaRight}`;
|
|
27475
27639
|
}
|
|
27476
|
-
|
|
27640
|
+
if (bottomValue !== undefined) {
|
|
27641
|
+
contentEl.style.setProperty('bottom', `calc(${bottomValue})`);
|
|
27642
|
+
}
|
|
27643
|
+
contentEl.style.setProperty('top', `calc(${topValue} + var(--offset-y, 0))`);
|
|
27477
27644
|
contentEl.style.setProperty('left', `calc(${leftValue} + var(--offset-x, 0))`);
|
|
27478
27645
|
contentEl.style.setProperty('transform-origin', `${originY} ${originX}`);
|
|
27479
27646
|
if (arrowEl !== null) {
|
|
@@ -27549,7 +27716,23 @@ const mdEnterAnimation$1 = (baseEl, opts) => {
|
|
|
27549
27716
|
};
|
|
27550
27717
|
const results = getPopoverPosition(isRTL, contentWidth, contentHeight, 0, 0, reference, side, align, defaultPosition, trigger, ev);
|
|
27551
27718
|
const padding = size === 'cover' ? 0 : POPOVER_MD_BODY_PADDING;
|
|
27552
|
-
const { originX, originY, top, left, bottom } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, 0, results.originX, results.originY, results.referenceCoordinates);
|
|
27719
|
+
const { originX, originY, top, left, bottom, checkSafeAreaTop, checkSafeAreaBottom } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, 0, results.originX, results.originY, results.referenceCoordinates);
|
|
27720
|
+
/**
|
|
27721
|
+
* Safe area CSS variable adjustments.
|
|
27722
|
+
* When the popover is positioned near an edge, we add the corresponding
|
|
27723
|
+
* safe-area inset to ensure the popover doesn't overlap with system UI
|
|
27724
|
+
* (status bars, home indicators, navigation bars on Android API 36+, etc.)
|
|
27725
|
+
*/
|
|
27726
|
+
const safeAreaTop = ' + var(--ion-safe-area-top, 0)';
|
|
27727
|
+
const safeAreaBottom = ' + var(--ion-safe-area-bottom, 0)';
|
|
27728
|
+
let topValue = `${top}px`;
|
|
27729
|
+
let bottomValue = bottom !== undefined ? `${bottom}px` : undefined;
|
|
27730
|
+
if (checkSafeAreaTop) {
|
|
27731
|
+
topValue = `${top}px${safeAreaTop}`;
|
|
27732
|
+
}
|
|
27733
|
+
if (checkSafeAreaBottom && bottomValue !== undefined) {
|
|
27734
|
+
bottomValue = `${bottom}px${safeAreaBottom}`;
|
|
27735
|
+
}
|
|
27553
27736
|
const baseAnimation = createAnimation();
|
|
27554
27737
|
const backdropAnimation = createAnimation();
|
|
27555
27738
|
const wrapperAnimation = createAnimation();
|
|
@@ -27566,13 +27749,13 @@ const mdEnterAnimation$1 = (baseEl, opts) => {
|
|
|
27566
27749
|
contentAnimation
|
|
27567
27750
|
.addElement(contentEl)
|
|
27568
27751
|
.beforeStyles({
|
|
27569
|
-
top: `calc(${
|
|
27752
|
+
top: `calc(${topValue} + var(--offset-y, 0px))`,
|
|
27570
27753
|
left: `calc(${left}px + var(--offset-x, 0px))`,
|
|
27571
27754
|
'transform-origin': `${originY} ${originX}`,
|
|
27572
27755
|
})
|
|
27573
27756
|
.beforeAddWrite(() => {
|
|
27574
|
-
if (
|
|
27575
|
-
contentEl.style.setProperty('bottom',
|
|
27757
|
+
if (bottomValue !== undefined) {
|
|
27758
|
+
contentEl.style.setProperty('bottom', `calc(${bottomValue})`);
|
|
27576
27759
|
}
|
|
27577
27760
|
})
|
|
27578
27761
|
.fromTo('transform', 'scale(0.8)', 'scale(1)');
|
|
@@ -34991,7 +35174,6 @@ class TabBar {
|
|
|
34991
35174
|
this.ionTabBarLoaded = createEvent(this, "ionTabBarLoaded", 7);
|
|
34992
35175
|
this.keyboardCtrl = null;
|
|
34993
35176
|
this.didLoad = false;
|
|
34994
|
-
this.isComponentConnected = false;
|
|
34995
35177
|
this.keyboardVisible = false;
|
|
34996
35178
|
/**
|
|
34997
35179
|
* If `true`, the tab bar will be translucent.
|
|
@@ -35026,8 +35208,7 @@ class TabBar {
|
|
|
35026
35208
|
}
|
|
35027
35209
|
}
|
|
35028
35210
|
async connectedCallback() {
|
|
35029
|
-
this.
|
|
35030
|
-
const keyboardCtrl = await createKeyboardController(async (keyboardOpen, waitForResize) => {
|
|
35211
|
+
this.keyboardCtrl = await createKeyboardController(async (keyboardOpen, waitForResize) => {
|
|
35031
35212
|
/**
|
|
35032
35213
|
* If the keyboard is hiding, then we need to wait
|
|
35033
35214
|
* for the webview to resize. Otherwise, the tab bar
|
|
@@ -35038,33 +35219,21 @@ class TabBar {
|
|
|
35038
35219
|
}
|
|
35039
35220
|
this.keyboardVisible = keyboardOpen; // trigger re-render by updating state
|
|
35040
35221
|
});
|
|
35041
|
-
/**
|
|
35042
|
-
* Destroy the keyboard controller if the component was
|
|
35043
|
-
* disconnected during async initialization to prevent memory leaks.
|
|
35044
|
-
*/
|
|
35045
|
-
if (this.isComponentConnected) {
|
|
35046
|
-
this.keyboardCtrl = keyboardCtrl;
|
|
35047
|
-
}
|
|
35048
|
-
else {
|
|
35049
|
-
keyboardCtrl.destroy();
|
|
35050
|
-
}
|
|
35051
35222
|
}
|
|
35052
35223
|
disconnectedCallback() {
|
|
35053
|
-
this.isComponentConnected = false;
|
|
35054
35224
|
if (this.keyboardCtrl) {
|
|
35055
35225
|
this.keyboardCtrl.destroy();
|
|
35056
|
-
this.keyboardCtrl = null;
|
|
35057
35226
|
}
|
|
35058
35227
|
}
|
|
35059
35228
|
render() {
|
|
35060
35229
|
const { color, translucent, keyboardVisible } = this;
|
|
35061
35230
|
const mode = getIonMode$1(this);
|
|
35062
35231
|
const shouldHide = keyboardVisible && this.el.getAttribute('slot') !== 'top';
|
|
35063
|
-
return (hAsync(Host, { key: '
|
|
35232
|
+
return (hAsync(Host, { key: '388ec37ce308035bab78d6c9a016bb616e9517a9', role: "tablist", "aria-hidden": shouldHide ? 'true' : null, class: createColorClasses$1(color, {
|
|
35064
35233
|
[mode]: true,
|
|
35065
35234
|
'tab-bar-translucent': translucent,
|
|
35066
35235
|
'tab-bar-hidden': shouldHide,
|
|
35067
|
-
}) }, hAsync("slot", { key: '
|
|
35236
|
+
}) }, hAsync("slot", { key: 'ce10ade2b86725e24f3254516483eeedd8ecb16a' })));
|
|
35068
35237
|
}
|
|
35069
35238
|
get el() { return getElement(this); }
|
|
35070
35239
|
static get watchers() { return {
|