@ionic/core 8.7.17-dev.11767647939.17c197c2 → 8.7.17-dev.11767796972.148e4bc4
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/content.js +79 -6
- package/components/modal.js +81 -26
- package/dist/cjs/ion-app_8.cjs.entry.js +78 -5
- package/dist/cjs/ion-modal.cjs.entry.js +81 -26
- package/dist/collection/components/content/content.css +10 -0
- package/dist/collection/components/content/content.js +77 -4
- package/dist/collection/components/modal/modal.js +81 -26
- package/dist/docs.json +1 -1
- package/dist/esm/ion-app_8.entry.js +79 -6
- package/dist/esm/ion-modal.entry.js +81 -26
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-3830217a.entry.js +4 -0
- package/dist/ionic/p-cecd141b.entry.js +4 -0
- package/dist/types/components/content/content.d.ts +24 -0
- package/dist/types/components/modal/modal.d.ts +12 -2
- package/hydrate/index.js +159 -32
- package/hydrate/index.mjs +159 -32
- package/package.json +1 -1
- package/dist/ionic/p-732b2fd6.entry.js +0 -4
- package/dist/ionic/p-fedca459.entry.js +0 -4
package/hydrate/index.js
CHANGED
|
@@ -10499,7 +10499,7 @@ const isRTL$1 = (hostEl) => {
|
|
|
10499
10499
|
return (document === null || document === void 0 ? void 0 : document.dir.toLowerCase()) === 'rtl';
|
|
10500
10500
|
};
|
|
10501
10501
|
|
|
10502
|
-
const contentCss = ":host{--background:var(--ion-background-color, #fff);--color:var(--ion-text-color, #000);--padding-top:0px;--padding-bottom:0px;--padding-start:0px;--padding-end:0px;--keyboard-offset:0px;--offset-top:0px;--offset-bottom:0px;--overflow:auto;display:block;position:relative;-ms-flex:1;flex:1;width:100%;height:100%;margin:0 !important;padding:0 !important;font-family:var(--ion-font-family, inherit);contain:size style}:host(.ion-color) .inner-scroll{background:var(--ion-color-base);color:var(--ion-color-contrast)}#background-content{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);position:absolute;background:var(--background)}.inner-scroll{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:calc(var(--padding-top) + var(--offset-top));padding-bottom:calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom));position:absolute;color:var(--color);-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;-ms-touch-action:pan-x pan-y pinch-zoom;touch-action:pan-x pan-y pinch-zoom}.scroll-y,.scroll-x{-webkit-overflow-scrolling:touch;z-index:0;will-change:scroll-position}.scroll-y{overflow-y:var(--overflow);overscroll-behavior-y:contain}.scroll-x{overflow-x:var(--overflow);overscroll-behavior-x:contain}.overscroll::before,.overscroll::after{position:absolute;width:1px;height:1px;content:\"\"}.overscroll::before{bottom:-1px}.overscroll::after{top:-1px}:host(.content-sizing){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:0;contain:none}:host(.content-sizing) .inner-scroll{position:relative;top:0;bottom:0;margin-top:calc(var(--offset-top) * -1);margin-bottom:calc(var(--offset-bottom) * -1)}.transition-effect{display:none;position:absolute;width:100%;height:100vh;opacity:0;pointer-events:none}:host(.content-ltr) .transition-effect{left:-100%;}:host(.content-rtl) .transition-effect{right:-100%;}.transition-cover{position:absolute;right:0;width:100%;height:100%;background:black;opacity:0.1}.transition-shadow{display:block;position:absolute;width:100%;height:100%;-webkit-box-shadow:inset -9px 0 9px 0 rgba(0, 0, 100, 0.03);box-shadow:inset -9px 0 9px 0 rgba(0, 0, 100, 0.03)}:host(.content-ltr) .transition-shadow{right:0;}:host(.content-rtl) .transition-shadow{left:0;-webkit-transform:scaleX(-1);transform:scaleX(-1)}::slotted([slot=fixed]){position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0)}";
|
|
10502
|
+
const contentCss = ":host{--background:var(--ion-background-color, #fff);--color:var(--ion-text-color, #000);--padding-top:0px;--padding-bottom:0px;--padding-start:0px;--padding-end:0px;--keyboard-offset:0px;--offset-top:0px;--offset-bottom:0px;--overflow:auto;display:block;position:relative;-ms-flex:1;flex:1;width:100%;height:100%;margin:0 !important;padding:0 !important;font-family:var(--ion-font-family, inherit);contain:size style}:host(.ion-color) .inner-scroll{background:var(--ion-color-base);color:var(--ion-color-contrast)}#background-content{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);position:absolute;background:var(--background)}.inner-scroll{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:calc(var(--padding-top) + var(--offset-top));padding-bottom:calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom));position:absolute;color:var(--color);-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;-ms-touch-action:pan-x pan-y pinch-zoom;touch-action:pan-x pan-y pinch-zoom}.scroll-y,.scroll-x{-webkit-overflow-scrolling:touch;z-index:0;will-change:scroll-position}.scroll-y{overflow-y:var(--overflow);overscroll-behavior-y:contain}.scroll-x{overflow-x:var(--overflow);overscroll-behavior-x:contain}.overscroll::before,.overscroll::after{position:absolute;width:1px;height:1px;content:\"\"}.overscroll::before{bottom:-1px}.overscroll::after{top:-1px}:host(.content-sizing){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:0;contain:none}:host(.content-sizing) .inner-scroll{position:relative;top:0;bottom:0;margin-top:calc(var(--offset-top) * -1);margin-bottom:calc(var(--offset-bottom) * -1)}.transition-effect{display:none;position:absolute;width:100%;height:100vh;opacity:0;pointer-events:none}:host(.content-ltr) .transition-effect{left:-100%;}:host(.content-rtl) .transition-effect{right:-100%;}.transition-cover{position:absolute;right:0;width:100%;height:100%;background:black;opacity:0.1}.transition-shadow{display:block;position:absolute;width:100%;height:100%;-webkit-box-shadow:inset -9px 0 9px 0 rgba(0, 0, 100, 0.03);box-shadow:inset -9px 0 9px 0 rgba(0, 0, 100, 0.03)}:host(.content-ltr) .transition-shadow{right:0;}:host(.content-rtl) .transition-shadow{left:0;-webkit-transform:scaleX(-1);transform:scaleX(-1)}:host(.safe-area-top) #background-content,:host(.safe-area-top) .inner-scroll{top:var(--ion-safe-area-top, 0px)}:host(.safe-area-bottom) #background-content,:host(.safe-area-bottom) .inner-scroll{bottom:var(--ion-safe-area-bottom, 0px)}::slotted([slot=fixed]){position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0)}";
|
|
10503
10503
|
|
|
10504
10504
|
/**
|
|
10505
10505
|
* @slot - Content is placed in the scrollable area if provided without a slot.
|
|
@@ -10523,6 +10523,12 @@ class Content {
|
|
|
10523
10523
|
this.isMainContent = true;
|
|
10524
10524
|
this.resizeTimeout = null;
|
|
10525
10525
|
this.inheritedAttributes = {};
|
|
10526
|
+
/**
|
|
10527
|
+
* Track whether this content has sibling header/footer elements.
|
|
10528
|
+
* When absent, we need to apply safe-area padding directly.
|
|
10529
|
+
*/
|
|
10530
|
+
this.hasHeader = false;
|
|
10531
|
+
this.hasFooter = false;
|
|
10526
10532
|
this.tabsElement = null;
|
|
10527
10533
|
// Detail is used in a hot loop in the scroll event, by allocating it here
|
|
10528
10534
|
// V8 will be able to inline any read/write to it since it's a monomorphic class.
|
|
@@ -10578,6 +10584,8 @@ class Content {
|
|
|
10578
10584
|
}
|
|
10579
10585
|
connectedCallback() {
|
|
10580
10586
|
this.isMainContent = this.el.closest('ion-menu, ion-popover, ion-modal') === null;
|
|
10587
|
+
// Detect sibling header/footer for safe-area handling
|
|
10588
|
+
this.detectSiblingElements();
|
|
10581
10589
|
/**
|
|
10582
10590
|
* The fullscreen content offsets need to be
|
|
10583
10591
|
* computed after the tab bar has loaded. Since
|
|
@@ -10613,8 +10621,70 @@ class Content {
|
|
|
10613
10621
|
}
|
|
10614
10622
|
}
|
|
10615
10623
|
}
|
|
10624
|
+
/**
|
|
10625
|
+
* Detects sibling ion-header and ion-footer elements and sets up
|
|
10626
|
+
* a mutation observer to handle dynamic changes (e.g., conditional rendering).
|
|
10627
|
+
*/
|
|
10628
|
+
detectSiblingElements() {
|
|
10629
|
+
this.updateSiblingDetection();
|
|
10630
|
+
// Watch for dynamic header/footer changes (common in React conditional rendering)
|
|
10631
|
+
const parent = this.el.parentElement;
|
|
10632
|
+
if (parent && !this.parentMutationObserver) {
|
|
10633
|
+
this.parentMutationObserver = new MutationObserver(() => {
|
|
10634
|
+
this.updateSiblingDetection();
|
|
10635
|
+
});
|
|
10636
|
+
this.parentMutationObserver.observe(parent, { childList: true });
|
|
10637
|
+
}
|
|
10638
|
+
}
|
|
10639
|
+
/**
|
|
10640
|
+
* Updates hasHeader/hasFooter based on current DOM state.
|
|
10641
|
+
* Checks both direct siblings and elements wrapped in custom components
|
|
10642
|
+
* (e.g., <my-header><ion-header>...</ion-header></my-header>).
|
|
10643
|
+
*/
|
|
10644
|
+
updateSiblingDetection() {
|
|
10645
|
+
const parent = this.el.parentElement;
|
|
10646
|
+
if (parent) {
|
|
10647
|
+
// First check for direct ion-header/ion-footer siblings
|
|
10648
|
+
this.hasHeader = parent.querySelector(':scope > ion-header') !== null;
|
|
10649
|
+
this.hasFooter = parent.querySelector(':scope > ion-footer') !== null;
|
|
10650
|
+
// If not found, check if any sibling contains them (wrapped components)
|
|
10651
|
+
if (!this.hasHeader) {
|
|
10652
|
+
this.hasHeader = this.siblingContainsElement(parent, 'ion-header');
|
|
10653
|
+
}
|
|
10654
|
+
if (!this.hasFooter) {
|
|
10655
|
+
this.hasFooter = this.siblingContainsElement(parent, 'ion-footer');
|
|
10656
|
+
}
|
|
10657
|
+
}
|
|
10658
|
+
// If no footer found, check if we're inside ion-tabs which has ion-tab-bar
|
|
10659
|
+
if (!this.hasFooter) {
|
|
10660
|
+
const tabs = this.el.closest('ion-tabs');
|
|
10661
|
+
if (tabs) {
|
|
10662
|
+
this.hasFooter = tabs.querySelector(':scope > ion-tab-bar') !== null;
|
|
10663
|
+
}
|
|
10664
|
+
}
|
|
10665
|
+
}
|
|
10666
|
+
/**
|
|
10667
|
+
* Checks if any sibling element of ion-content contains the specified element.
|
|
10668
|
+
* Only searches one level deep to avoid finding elements in nested pages.
|
|
10669
|
+
*/
|
|
10670
|
+
siblingContainsElement(parent, tagName) {
|
|
10671
|
+
for (const sibling of parent.children) {
|
|
10672
|
+
// Skip ion-content itself
|
|
10673
|
+
if (sibling === this.el)
|
|
10674
|
+
continue;
|
|
10675
|
+
// Check if this sibling contains the target element as an immediate child
|
|
10676
|
+
if (sibling.querySelector(`:scope > ${tagName}`) !== null) {
|
|
10677
|
+
return true;
|
|
10678
|
+
}
|
|
10679
|
+
}
|
|
10680
|
+
return false;
|
|
10681
|
+
}
|
|
10616
10682
|
disconnectedCallback() {
|
|
10683
|
+
var _a;
|
|
10617
10684
|
this.onScrollEnd();
|
|
10685
|
+
// Clean up mutation observer to prevent memory leaks
|
|
10686
|
+
(_a = this.parentMutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
10687
|
+
this.parentMutationObserver = undefined;
|
|
10618
10688
|
if (hasLazyBuild(this.el)) {
|
|
10619
10689
|
/**
|
|
10620
10690
|
* The event listener and tabs caches need to
|
|
@@ -10843,26 +10913,28 @@ class Content {
|
|
|
10843
10913
|
}
|
|
10844
10914
|
}
|
|
10845
10915
|
render() {
|
|
10846
|
-
const { fixedSlotPlacement, inheritedAttributes, isMainContent, scrollX, scrollY, el } = this;
|
|
10916
|
+
const { fixedSlotPlacement, hasFooter, hasHeader, inheritedAttributes, isMainContent, scrollX, scrollY, el } = this;
|
|
10847
10917
|
const rtl = isRTL$1(el) ? 'rtl' : 'ltr';
|
|
10848
10918
|
const mode = getIonMode$1(this);
|
|
10849
10919
|
const forceOverscroll = this.shouldForceOverscroll();
|
|
10850
10920
|
const transitionShadow = mode === 'ios';
|
|
10851
10921
|
this.resize();
|
|
10852
|
-
return (hAsync(Host, Object.assign({ key: '
|
|
10922
|
+
return (hAsync(Host, Object.assign({ key: 'c8e3a93e0b1ba6f7aa81a6a6065145ece9a6e2ef', role: isMainContent ? 'main' : undefined, class: createColorClasses$1(this.color, {
|
|
10853
10923
|
[mode]: true,
|
|
10854
10924
|
'content-sizing': hostContext('ion-popover', this.el),
|
|
10855
10925
|
overscroll: forceOverscroll,
|
|
10856
10926
|
[`content-${rtl}`]: true,
|
|
10927
|
+
'safe-area-top': isMainContent && !hasHeader,
|
|
10928
|
+
'safe-area-bottom': isMainContent && !hasFooter,
|
|
10857
10929
|
}), style: {
|
|
10858
10930
|
'--offset-top': `${this.cTop}px`,
|
|
10859
10931
|
'--offset-bottom': `${this.cBottom}px`,
|
|
10860
|
-
} }, inheritedAttributes), hAsync("div", { key: '
|
|
10932
|
+
} }, inheritedAttributes), hAsync("div", { key: '4c0482cda885348eea9eb66d7f076af6b38c52e5', ref: (el) => (this.backgroundContentEl = el), id: "background-content", part: "background" }), fixedSlotPlacement === 'before' ? hAsync("slot", { name: "fixed" }) : null, hAsync("div", { key: '6fbb39bf7ab7120009c56aea9340de45c934eeed', class: {
|
|
10861
10933
|
'inner-scroll': true,
|
|
10862
10934
|
'scroll-x': scrollX,
|
|
10863
10935
|
'scroll-y': scrollY,
|
|
10864
10936
|
overscroll: (scrollX || scrollY) && forceOverscroll,
|
|
10865
|
-
}, ref: (scrollEl) => (this.scrollEl = scrollEl), onScroll: this.scrollEvents ? (ev) => this.onScroll(ev) : undefined, part: "scroll" }, hAsync("slot", { key: '
|
|
10937
|
+
}, ref: (scrollEl) => (this.scrollEl = scrollEl), onScroll: this.scrollEvents ? (ev) => this.onScroll(ev) : undefined, part: "scroll" }, hAsync("slot", { key: '6425bc84edbc0c5b1f2764a1d611df1b46628274' })), transitionShadow ? (hAsync("div", { class: "transition-effect" }, hAsync("div", { class: "transition-cover" }), hAsync("div", { class: "transition-shadow" }))) : null, fixedSlotPlacement === 'after' ? hAsync("slot", { name: "fixed" }) : null));
|
|
10866
10938
|
}
|
|
10867
10939
|
get el() { return getElement(this); }
|
|
10868
10940
|
static get style() { return contentCss; }
|
|
@@ -22799,6 +22871,8 @@ class Modal {
|
|
|
22799
22871
|
this.gestureAnimationDismissing = false;
|
|
22800
22872
|
// Whether to skip coordinate-based safe-area detection (for fullscreen phone modals)
|
|
22801
22873
|
this.skipSafeAreaCoordinateDetection = false;
|
|
22874
|
+
// Track previous safe-area state to avoid redundant DOM writes
|
|
22875
|
+
this.prevSafeAreaState = { top: false, bottom: false, left: false, right: false };
|
|
22802
22876
|
this.presented = false;
|
|
22803
22877
|
/** @internal */
|
|
22804
22878
|
this.hasController = false;
|
|
@@ -22989,7 +23063,8 @@ class Modal {
|
|
|
22989
23063
|
}
|
|
22990
23064
|
}
|
|
22991
23065
|
onWindowResize() {
|
|
22992
|
-
//
|
|
23066
|
+
// Invalidate safe-area cache on resize (device rotation may change values)
|
|
23067
|
+
this.cachedSafeAreas = undefined;
|
|
22993
23068
|
this.updateSafeAreaOverrides();
|
|
22994
23069
|
// Only handle view transition for iOS card modals when no custom animations are provided
|
|
22995
23070
|
if (getIonMode$1(this) !== 'ios' || !this.presentingElement || this.enterAnimation || this.leaveAnimation) {
|
|
@@ -23448,8 +23523,26 @@ class Modal {
|
|
|
23448
23523
|
*/
|
|
23449
23524
|
applyFullscreenSafeArea() {
|
|
23450
23525
|
this.skipSafeAreaCoordinateDetection = true;
|
|
23526
|
+
this.updateFooterPadding();
|
|
23527
|
+
// Watch for dynamic footer additions/removals (e.g., async data loading)
|
|
23528
|
+
if (!this.footerObserver) {
|
|
23529
|
+
this.footerObserver = new MutationObserver(() => this.updateFooterPadding());
|
|
23530
|
+
this.footerObserver.observe(this.el, { childList: true, subtree: true });
|
|
23531
|
+
}
|
|
23532
|
+
}
|
|
23533
|
+
/**
|
|
23534
|
+
* Updates wrapper padding based on footer presence.
|
|
23535
|
+
* Called initially and when footer is dynamically added/removed.
|
|
23536
|
+
*/
|
|
23537
|
+
updateFooterPadding() {
|
|
23538
|
+
if (!this.wrapperEl)
|
|
23539
|
+
return;
|
|
23451
23540
|
const hasFooter = this.el.querySelector('ion-footer') !== null;
|
|
23452
|
-
if (
|
|
23541
|
+
if (hasFooter) {
|
|
23542
|
+
this.wrapperEl.style.removeProperty('padding-bottom');
|
|
23543
|
+
this.wrapperEl.style.removeProperty('box-sizing');
|
|
23544
|
+
}
|
|
23545
|
+
else {
|
|
23453
23546
|
this.wrapperEl.style.setProperty('padding-bottom', 'var(--ion-safe-area-bottom, 0px)');
|
|
23454
23547
|
this.wrapperEl.style.setProperty('box-sizing', 'border-box');
|
|
23455
23548
|
}
|
|
@@ -23467,21 +23560,26 @@ class Modal {
|
|
|
23467
23560
|
}
|
|
23468
23561
|
/**
|
|
23469
23562
|
* Gets the root safe-area values from the document element.
|
|
23470
|
-
*
|
|
23471
|
-
*/
|
|
23472
|
-
|
|
23473
|
-
|
|
23474
|
-
|
|
23475
|
-
|
|
23476
|
-
|
|
23477
|
-
|
|
23478
|
-
|
|
23479
|
-
|
|
23563
|
+
* Uses cached values during gestures to avoid getComputedStyle calls.
|
|
23564
|
+
*/
|
|
23565
|
+
getSafeAreaValues() {
|
|
23566
|
+
if (!this.cachedSafeAreas) {
|
|
23567
|
+
const rootStyle = getComputedStyle(document.documentElement);
|
|
23568
|
+
this.cachedSafeAreas = {
|
|
23569
|
+
top: parseFloat(rootStyle.getPropertyValue('--ion-safe-area-top')) || 0,
|
|
23570
|
+
bottom: parseFloat(rootStyle.getPropertyValue('--ion-safe-area-bottom')) || 0,
|
|
23571
|
+
left: parseFloat(rootStyle.getPropertyValue('--ion-safe-area-left')) || 0,
|
|
23572
|
+
right: parseFloat(rootStyle.getPropertyValue('--ion-safe-area-right')) || 0,
|
|
23573
|
+
};
|
|
23574
|
+
}
|
|
23575
|
+
return this.cachedSafeAreas;
|
|
23480
23576
|
}
|
|
23481
23577
|
/**
|
|
23482
23578
|
* Updates safe-area CSS variable overrides based on whether the modal
|
|
23483
23579
|
* extends into each safe-area region. Called after animation
|
|
23484
23580
|
* and during gestures to handle dynamic position changes.
|
|
23581
|
+
*
|
|
23582
|
+
* Optimized to avoid redundant DOM writes by tracking previous state.
|
|
23485
23583
|
*/
|
|
23486
23584
|
updateSafeAreaOverrides() {
|
|
23487
23585
|
if (this.skipSafeAreaCoordinateDetection) {
|
|
@@ -23492,20 +23590,34 @@ class Modal {
|
|
|
23492
23590
|
return;
|
|
23493
23591
|
}
|
|
23494
23592
|
const rect = wrapper.getBoundingClientRect();
|
|
23495
|
-
const safeAreas = this.
|
|
23593
|
+
const safeAreas = this.getSafeAreaValues();
|
|
23496
23594
|
const extendsIntoTop = rect.top < safeAreas.top;
|
|
23497
23595
|
const extendsIntoBottom = rect.bottom > window.innerHeight - safeAreas.bottom;
|
|
23498
23596
|
const extendsIntoLeft = rect.left < safeAreas.left;
|
|
23499
23597
|
const extendsIntoRight = rect.right > window.innerWidth - safeAreas.right;
|
|
23598
|
+
// Only update DOM when state actually changes
|
|
23599
|
+
const prev = this.prevSafeAreaState;
|
|
23500
23600
|
const style = this.el.style;
|
|
23501
|
-
extendsIntoTop
|
|
23502
|
-
|
|
23503
|
-
|
|
23504
|
-
|
|
23505
|
-
|
|
23506
|
-
|
|
23507
|
-
|
|
23508
|
-
|
|
23601
|
+
if (extendsIntoTop !== prev.top) {
|
|
23602
|
+
extendsIntoTop ? style.removeProperty('--ion-safe-area-top') : style.setProperty('--ion-safe-area-top', '0px');
|
|
23603
|
+
prev.top = extendsIntoTop;
|
|
23604
|
+
}
|
|
23605
|
+
if (extendsIntoBottom !== prev.bottom) {
|
|
23606
|
+
extendsIntoBottom
|
|
23607
|
+
? style.removeProperty('--ion-safe-area-bottom')
|
|
23608
|
+
: style.setProperty('--ion-safe-area-bottom', '0px');
|
|
23609
|
+
prev.bottom = extendsIntoBottom;
|
|
23610
|
+
}
|
|
23611
|
+
if (extendsIntoLeft !== prev.left) {
|
|
23612
|
+
extendsIntoLeft ? style.removeProperty('--ion-safe-area-left') : style.setProperty('--ion-safe-area-left', '0px');
|
|
23613
|
+
prev.left = extendsIntoLeft;
|
|
23614
|
+
}
|
|
23615
|
+
if (extendsIntoRight !== prev.right) {
|
|
23616
|
+
extendsIntoRight
|
|
23617
|
+
? style.removeProperty('--ion-safe-area-right')
|
|
23618
|
+
: style.setProperty('--ion-safe-area-right', '0px');
|
|
23619
|
+
prev.right = extendsIntoRight;
|
|
23620
|
+
}
|
|
23509
23621
|
}
|
|
23510
23622
|
sheetOnDismiss() {
|
|
23511
23623
|
/**
|
|
@@ -23537,7 +23649,7 @@ class Modal {
|
|
|
23537
23649
|
* For example, `cancel` or `backdrop`.
|
|
23538
23650
|
*/
|
|
23539
23651
|
async dismiss(data, role) {
|
|
23540
|
-
var _a;
|
|
23652
|
+
var _a, _b;
|
|
23541
23653
|
if (this.gestureAnimationDismissing && role !== GESTURE) {
|
|
23542
23654
|
return false;
|
|
23543
23655
|
}
|
|
@@ -23599,8 +23711,23 @@ class Modal {
|
|
|
23599
23711
|
}
|
|
23600
23712
|
this.currentBreakpoint = undefined;
|
|
23601
23713
|
this.animation = undefined;
|
|
23602
|
-
// Reset safe-area
|
|
23714
|
+
// Reset safe-area state for potential re-presentation
|
|
23603
23715
|
this.skipSafeAreaCoordinateDetection = false;
|
|
23716
|
+
this.cachedSafeAreas = undefined;
|
|
23717
|
+
this.prevSafeAreaState = { top: false, bottom: false, left: false, right: false };
|
|
23718
|
+
(_b = this.footerObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
23719
|
+
this.footerObserver = undefined;
|
|
23720
|
+
// Clear styles that may have been set for safe-area handling
|
|
23721
|
+
if (this.wrapperEl) {
|
|
23722
|
+
this.wrapperEl.style.removeProperty('padding-bottom');
|
|
23723
|
+
this.wrapperEl.style.removeProperty('box-sizing');
|
|
23724
|
+
}
|
|
23725
|
+
// Clear safe-area CSS variable overrides
|
|
23726
|
+
const style = this.el.style;
|
|
23727
|
+
style.removeProperty('--ion-safe-area-top');
|
|
23728
|
+
style.removeProperty('--ion-safe-area-bottom');
|
|
23729
|
+
style.removeProperty('--ion-safe-area-left');
|
|
23730
|
+
style.removeProperty('--ion-safe-area-right');
|
|
23604
23731
|
unlock();
|
|
23605
23732
|
return dismissed;
|
|
23606
23733
|
}
|
|
@@ -23850,20 +23977,20 @@ class Modal {
|
|
|
23850
23977
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
23851
23978
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
23852
23979
|
const isSheetModalWithHandle = isSheetModal && showHandle;
|
|
23853
|
-
return (hAsync(Host, Object.assign({ key: '
|
|
23980
|
+
return (hAsync(Host, Object.assign({ key: '11cd16cc481093a38a327abdd94467be3f71718d', "no-router": true,
|
|
23854
23981
|
// Allow the modal to be navigable when the handle is focusable
|
|
23855
23982
|
tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
|
|
23856
23983
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
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: '
|
|
23984
|
+
}, 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: '125658fbb071960da3905854668078e15bce56da', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && hAsync("div", { key: '4a63815ef165e5806fef85ef48bf509813ff55c9', class: "modal-shadow" }), hAsync("div", Object.assign({ key: 'cfc4b20354cbf2c0f873f6aee91c9b8f553de61d',
|
|
23858
23985
|
/*
|
|
23859
23986
|
role and aria-modal must be used on the
|
|
23860
23987
|
same element. They must also be set inside the
|
|
23861
23988
|
shadow DOM otherwise ion-button will not be highlighted
|
|
23862
23989
|
when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
|
|
23863
23990
|
*/
|
|
23864
|
-
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: '
|
|
23991
|
+
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: '33a4ee89bb8b6512883cb8756641c1e27fdb0ebc', class: "modal-handle",
|
|
23865
23992
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
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: '
|
|
23993
|
+
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: '986fafb71234591c96e927f92b7330bb5c76fc2e', onSlotchange: this.onSlotChange }))));
|
|
23867
23994
|
}
|
|
23868
23995
|
get el() { return getElement(this); }
|
|
23869
23996
|
static get watchers() { return {
|