@ionic/core 8.7.12-dev.11764961567.138743ff → 8.7.12-dev.11765219790.17cbe2e9
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 +4 -78
- package/components/overlays.js +11 -15
- package/css/core.css +1 -1
- package/css/core.css.map +1 -1
- package/css/ionic.bundle.css +1 -1
- package/css/ionic.bundle.css.map +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/ion-alert.cjs.entry.js +1 -1
- package/dist/cjs/ion-datetime_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-loading.cjs.entry.js +1 -1
- package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-modal.cjs.entry.js +5 -79
- package/dist/cjs/ion-popover.cjs.entry.js +1 -1
- package/dist/cjs/ion-select-modal.cjs.entry.js +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-toast.cjs.entry.js +1 -1
- package/dist/cjs/{overlays-D3xMmZCY.js → overlays-DxIZwUXI.js} +11 -15
- package/dist/collection/components/modal/modal.js +4 -78
- package/dist/collection/utils/overlays.js +11 -15
- package/dist/docs.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +1 -1
- package/dist/esm/ion-alert.entry.js +1 -1
- package/dist/esm/ion-datetime_3.entry.js +1 -1
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu_3.entry.js +1 -1
- package/dist/esm/ion-modal.entry.js +5 -79
- package/dist/esm/ion-popover.entry.js +1 -1
- package/dist/esm/ion-select-modal.entry.js +1 -1
- package/dist/esm/ion-select_3.entry.js +1 -1
- package/dist/esm/ion-toast.entry.js +1 -1
- package/dist/esm/{overlays-DYKBVm6h.js → overlays-BymNv-BL.js} +11 -15
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-3fad4ab5.entry.js → p-0b80d700.entry.js} +1 -1
- package/dist/ionic/{p-a480563a.entry.js → p-15193d01.entry.js} +1 -1
- package/dist/ionic/{p-1cf19c5a.entry.js → p-510d86e1.entry.js} +1 -1
- package/dist/ionic/{p-ede27a66.entry.js → p-7380261c.entry.js} +1 -1
- package/dist/ionic/{p-b4b6513a.entry.js → p-7da39a4d.entry.js} +1 -1
- package/dist/ionic/{p-caa8efa1.entry.js → p-83be404e.entry.js} +1 -1
- package/dist/ionic/{p-7928cc4d.entry.js → p-98fc09eb.entry.js} +1 -1
- package/dist/ionic/p-D87hU-Ly.js +4 -0
- package/dist/ionic/p-a80f1b04.entry.js +4 -0
- package/dist/ionic/{p-985f02a8.entry.js → p-cb93126d.entry.js} +1 -1
- package/dist/ionic/{p-038f3a87.entry.js → p-e16b69e1.entry.js} +1 -1
- package/dist/types/components/modal/modal.d.ts +0 -13
- package/hydrate/index.js +15 -93
- package/hydrate/index.mjs +15 -93
- package/package.json +1 -2
- package/dist/ionic/p-90969bdf.entry.js +0 -4
- package/dist/ionic/p-CHK505Co.js +0 -4
|
@@ -9,7 +9,7 @@ var frameworkDelegate = require('./framework-delegate-DMJRBuDi.js');
|
|
|
9
9
|
var helpers = require('./helpers-DrTqNghc.js');
|
|
10
10
|
var lockController = require('./lock-controller-aDB9wrEf.js');
|
|
11
11
|
var capacitor = require('./capacitor-DmA66EwP.js');
|
|
12
|
-
var overlays = require('./overlays-
|
|
12
|
+
var overlays = require('./overlays-DxIZwUXI.js');
|
|
13
13
|
var theme = require('./theme-CeDs6Hcv.js');
|
|
14
14
|
var index$4 = require('./index-094mMFB-.js');
|
|
15
15
|
var ionicGlobal = require('./ionic-global-HMVqOFGO.js');
|
|
@@ -2002,79 +2002,6 @@ const Modal = class {
|
|
|
2002
2002
|
this.gesture = gesture;
|
|
2003
2003
|
this.moveSheetToBreakpoint = moveSheetToBreakpoint;
|
|
2004
2004
|
this.gesture.enable(true);
|
|
2005
|
-
/**
|
|
2006
|
-
* When backdrop interaction is allowed, nested router outlets from child routes
|
|
2007
|
-
* may block pointer events to parent content. Apply passthrough styles only when
|
|
2008
|
-
* the modal was the sole content of a child route page.
|
|
2009
|
-
* See https://github.com/ionic-team/ionic-framework/issues/30700
|
|
2010
|
-
*/
|
|
2011
|
-
const backdropNotBlocking = this.showBackdrop === false || this.focusTrap === false || backdropBreakpoint > 0;
|
|
2012
|
-
if (backdropNotBlocking) {
|
|
2013
|
-
this.setupChildRoutePassthrough();
|
|
2014
|
-
}
|
|
2015
|
-
}
|
|
2016
|
-
/**
|
|
2017
|
-
* For sheet modals that allow background interaction, sets up pointer-events
|
|
2018
|
-
* passthrough on child route page wrappers and nested router outlets.
|
|
2019
|
-
*/
|
|
2020
|
-
setupChildRoutePassthrough() {
|
|
2021
|
-
var _a;
|
|
2022
|
-
const pageParent = this.getOriginalPageParent();
|
|
2023
|
-
// Skip ion-app (controller modals) and pages with other content (inline modals)
|
|
2024
|
-
if (!pageParent || pageParent.tagName === 'ION-APP') {
|
|
2025
|
-
return;
|
|
2026
|
-
}
|
|
2027
|
-
const hasVisibleContent = Array.from(pageParent.children).some((child) => {
|
|
2028
|
-
var _a;
|
|
2029
|
-
if (child === this.el)
|
|
2030
|
-
return false;
|
|
2031
|
-
if (child instanceof HTMLElement && window.getComputedStyle(child).display === 'none')
|
|
2032
|
-
return false;
|
|
2033
|
-
if (child.tagName === 'TEMPLATE' || child.tagName === 'SLOT')
|
|
2034
|
-
return false;
|
|
2035
|
-
if (child.nodeType === Node.TEXT_NODE && !((_a = child.textContent) === null || _a === void 0 ? void 0 : _a.trim()))
|
|
2036
|
-
return false;
|
|
2037
|
-
return true;
|
|
2038
|
-
});
|
|
2039
|
-
if (hasVisibleContent) {
|
|
2040
|
-
return;
|
|
2041
|
-
}
|
|
2042
|
-
// Child route case: page only contained the modal
|
|
2043
|
-
pageParent.classList.add('ion-page-overlay-passthrough');
|
|
2044
|
-
// Also make nested router outlets passthrough
|
|
2045
|
-
const routerOutlet = pageParent.parentElement;
|
|
2046
|
-
if ((routerOutlet === null || routerOutlet === void 0 ? void 0 : routerOutlet.tagName) === 'ION-ROUTER-OUTLET' && ((_a = routerOutlet.parentElement) === null || _a === void 0 ? void 0 : _a.tagName) !== 'ION-APP') {
|
|
2047
|
-
routerOutlet.style.setProperty('pointer-events', 'none');
|
|
2048
|
-
routerOutlet.setAttribute('data-overlay-passthrough', 'true');
|
|
2049
|
-
}
|
|
2050
|
-
}
|
|
2051
|
-
/**
|
|
2052
|
-
* Finds the ion-page ancestor of the modal's original parent location.
|
|
2053
|
-
*/
|
|
2054
|
-
getOriginalPageParent() {
|
|
2055
|
-
if (!this.cachedOriginalParent) {
|
|
2056
|
-
return null;
|
|
2057
|
-
}
|
|
2058
|
-
let pageParent = this.cachedOriginalParent;
|
|
2059
|
-
while (pageParent && !pageParent.classList.contains('ion-page')) {
|
|
2060
|
-
pageParent = pageParent.parentElement;
|
|
2061
|
-
}
|
|
2062
|
-
return pageParent;
|
|
2063
|
-
}
|
|
2064
|
-
/**
|
|
2065
|
-
* Removes passthrough styles added by setupChildRoutePassthrough.
|
|
2066
|
-
*/
|
|
2067
|
-
cleanupChildRoutePassthrough() {
|
|
2068
|
-
const pageParent = this.getOriginalPageParent();
|
|
2069
|
-
if (!pageParent) {
|
|
2070
|
-
return;
|
|
2071
|
-
}
|
|
2072
|
-
pageParent.classList.remove('ion-page-overlay-passthrough');
|
|
2073
|
-
const routerOutlet = pageParent.parentElement;
|
|
2074
|
-
if (routerOutlet === null || routerOutlet === void 0 ? void 0 : routerOutlet.hasAttribute('data-overlay-passthrough')) {
|
|
2075
|
-
routerOutlet.style.removeProperty('pointer-events');
|
|
2076
|
-
routerOutlet.removeAttribute('data-overlay-passthrough');
|
|
2077
|
-
}
|
|
2078
2005
|
}
|
|
2079
2006
|
sheetOnDismiss() {
|
|
2080
2007
|
/**
|
|
@@ -2164,7 +2091,6 @@ const Modal = class {
|
|
|
2164
2091
|
}
|
|
2165
2092
|
this.cleanupViewTransitionListener();
|
|
2166
2093
|
this.cleanupParentRemovalObserver();
|
|
2167
|
-
this.cleanupChildRoutePassthrough();
|
|
2168
2094
|
}
|
|
2169
2095
|
this.currentBreakpoint = undefined;
|
|
2170
2096
|
this.animation = undefined;
|
|
@@ -2402,20 +2328,20 @@ const Modal = class {
|
|
|
2402
2328
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
2403
2329
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
2404
2330
|
const isSheetModalWithHandle = isSheetModal && showHandle;
|
|
2405
|
-
return (index$3.h(index$3.Host, Object.assign({ key: '
|
|
2331
|
+
return (index$3.h(index$3.Host, Object.assign({ key: '9e9a7bd591eb17a225a00b4fa2e379e94601d17f', "no-router": true,
|
|
2406
2332
|
// Allow the modal to be navigable when the handle is focusable
|
|
2407
2333
|
tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
|
|
2408
2334
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
2409
|
-
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [overlays.FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, theme.getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), index$3.h("ion-backdrop", { key: '
|
|
2335
|
+
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [overlays.FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, theme.getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), index$3.h("ion-backdrop", { key: 'e5eae2c14f830f75e308fcd7f4c10c86fac5b962', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && index$3.h("div", { key: 'e268f9cd310c3cf4e051b5b92524ce4fb70d005e', class: "modal-shadow" }), index$3.h("div", Object.assign({ key: '9c380f36c18144c153077b15744d1c3346bce63e',
|
|
2410
2336
|
/*
|
|
2411
2337
|
role and aria-modal must be used on the
|
|
2412
2338
|
same element. They must also be set inside the
|
|
2413
2339
|
shadow DOM otherwise ion-button will not be highlighted
|
|
2414
2340
|
when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
|
|
2415
2341
|
*/
|
|
2416
|
-
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (index$3.h("button", { key: '
|
|
2342
|
+
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (index$3.h("button", { key: '2d5ee6d5959d97309c306e8ce72eb0f2c19be144', class: "modal-handle",
|
|
2417
2343
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
2418
|
-
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) })), index$3.h("slot", { key: '
|
|
2344
|
+
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) })), index$3.h("slot", { key: '5590434c35ea04c42fc006498bc189038e15a298', onSlotchange: this.onSlotChange }))));
|
|
2419
2345
|
}
|
|
2420
2346
|
get el() { return index$3.getElement(this); }
|
|
2421
2347
|
static get watchers() { return {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
6
|
var index = require('./index-D6Wc6v08.js');
|
|
7
|
-
var overlays = require('./overlays-
|
|
7
|
+
var overlays = require('./overlays-DxIZwUXI.js');
|
|
8
8
|
var frameworkDelegate = require('./framework-delegate-DMJRBuDi.js');
|
|
9
9
|
var helpers = require('./helpers-DrTqNghc.js');
|
|
10
10
|
var lockController = require('./lock-controller-aDB9wrEf.js');
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
var index = require('./index-D6Wc6v08.js');
|
|
7
7
|
var ionicGlobal = require('./ionic-global-HMVqOFGO.js');
|
|
8
|
-
var overlays = require('./overlays-
|
|
8
|
+
var overlays = require('./overlays-DxIZwUXI.js');
|
|
9
9
|
var theme = require('./theme-CeDs6Hcv.js');
|
|
10
10
|
require('./index-DkNv4J_i.js');
|
|
11
11
|
require('./helpers-DrTqNghc.js');
|
|
@@ -8,7 +8,7 @@ var notchController = require('./notch-controller-Bzqhjm4f.js');
|
|
|
8
8
|
var compareWithUtils = require('./compare-with-utils-DSicavqM.js');
|
|
9
9
|
var validity = require('./validity-BpS37YFM.js');
|
|
10
10
|
var helpers = require('./helpers-DrTqNghc.js');
|
|
11
|
-
var overlays = require('./overlays-
|
|
11
|
+
var overlays = require('./overlays-DxIZwUXI.js');
|
|
12
12
|
var dir = require('./dir-Cn0z1rJH.js');
|
|
13
13
|
var theme = require('./theme-CeDs6Hcv.js');
|
|
14
14
|
var watchOptions = require('./watch-options-CviOsrTS.js');
|
|
@@ -7,7 +7,7 @@ var index$1 = require('./index-D6Wc6v08.js');
|
|
|
7
7
|
var config = require('./config-C5fsO43a.js');
|
|
8
8
|
var helpers = require('./helpers-DrTqNghc.js');
|
|
9
9
|
var lockController = require('./lock-controller-aDB9wrEf.js');
|
|
10
|
-
var overlays = require('./overlays-
|
|
10
|
+
var overlays = require('./overlays-DxIZwUXI.js');
|
|
11
11
|
var theme = require('./theme-CeDs6Hcv.js');
|
|
12
12
|
var ionicGlobal = require('./ionic-global-HMVqOFGO.js');
|
|
13
13
|
var animation = require('./animation-Bt3H9L1C.js');
|
|
@@ -504,7 +504,7 @@ const setRootAriaHidden = (hidden = false) => {
|
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
506
|
const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts) => {
|
|
507
|
-
var _a, _b
|
|
507
|
+
var _a, _b;
|
|
508
508
|
if (overlay.presented) {
|
|
509
509
|
return;
|
|
510
510
|
}
|
|
@@ -538,10 +538,9 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
538
538
|
*/
|
|
539
539
|
const overlayEl = overlay.el;
|
|
540
540
|
const shouldTrapFocus = overlayEl.tagName !== 'ION-TOAST' && overlayEl.focusTrap !== false;
|
|
541
|
-
// Only lock out root content when backdrop is
|
|
542
|
-
//
|
|
543
|
-
const
|
|
544
|
-
const shouldLockRoot = shouldTrapFocus && backdropAlwaysActive;
|
|
541
|
+
// Only lock out root content when backdrop is active. Developers relying on showBackdrop=false
|
|
542
|
+
// expect background interaction to remain enabled.
|
|
543
|
+
const shouldLockRoot = shouldTrapFocus && overlayEl.showBackdrop !== false;
|
|
545
544
|
overlay.presented = true;
|
|
546
545
|
overlay.willPresent.emit();
|
|
547
546
|
if (shouldLockRoot) {
|
|
@@ -553,7 +552,7 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
553
552
|
}
|
|
554
553
|
document.body.classList.add(gestureController.BACKDROP_NO_SCROLL);
|
|
555
554
|
}
|
|
556
|
-
(
|
|
555
|
+
(_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
|
|
557
556
|
const mode = ionicGlobal.getIonMode(overlay);
|
|
558
557
|
// get the user's animation fn if one was provided
|
|
559
558
|
const animationBuilder = overlay.enterAnimation
|
|
@@ -562,7 +561,7 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
562
561
|
const completed = await overlayAnimation(overlay, animationBuilder, overlay.el, opts);
|
|
563
562
|
if (completed) {
|
|
564
563
|
overlay.didPresent.emit();
|
|
565
|
-
(
|
|
564
|
+
(_b = overlay.didPresentShorthand) === null || _b === void 0 ? void 0 : _b.emit();
|
|
566
565
|
}
|
|
567
566
|
/**
|
|
568
567
|
* If the focused element is already
|
|
@@ -640,7 +639,7 @@ const restoreElementFocus = async (overlayEl) => {
|
|
|
640
639
|
}
|
|
641
640
|
};
|
|
642
641
|
const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnimation, opts) => {
|
|
643
|
-
var _a, _b
|
|
642
|
+
var _a, _b;
|
|
644
643
|
if (!overlay.presented) {
|
|
645
644
|
return false;
|
|
646
645
|
}
|
|
@@ -656,14 +655,11 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
656
655
|
* is dismissed.
|
|
657
656
|
*/
|
|
658
657
|
const overlaysLockingRoot = presentedOverlays.filter((o) => {
|
|
659
|
-
var _a;
|
|
660
658
|
const el = o;
|
|
661
|
-
|
|
662
|
-
return el.tagName !== 'ION-TOAST' && el.focusTrap !== false && backdropAlwaysActive;
|
|
659
|
+
return el.tagName !== 'ION-TOAST' && el.focusTrap !== false && el.showBackdrop !== false;
|
|
663
660
|
});
|
|
664
661
|
const overlayEl = overlay.el;
|
|
665
|
-
const
|
|
666
|
-
const locksRoot = overlayEl.tagName !== 'ION-TOAST' && overlayEl.focusTrap !== false && backdropAlwaysActive;
|
|
662
|
+
const locksRoot = overlayEl.tagName !== 'ION-TOAST' && overlayEl.focusTrap !== false && overlayEl.showBackdrop !== false;
|
|
667
663
|
/**
|
|
668
664
|
* If this is the last visible overlay that is trapping focus
|
|
669
665
|
* then we want to re-add the root to the accessibility tree.
|
|
@@ -678,7 +674,7 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
678
674
|
// Overlay contents should not be clickable during dismiss
|
|
679
675
|
overlay.el.style.setProperty('pointer-events', 'none');
|
|
680
676
|
overlay.willDismiss.emit({ data, role });
|
|
681
|
-
(
|
|
677
|
+
(_a = overlay.willDismissShorthand) === null || _a === void 0 ? void 0 : _a.emit({ data, role });
|
|
682
678
|
const mode = ionicGlobal.getIonMode(overlay);
|
|
683
679
|
const animationBuilder = overlay.leaveAnimation
|
|
684
680
|
? overlay.leaveAnimation
|
|
@@ -688,7 +684,7 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
688
684
|
await overlayAnimation(overlay, animationBuilder, overlay.el, opts);
|
|
689
685
|
}
|
|
690
686
|
overlay.didDismiss.emit({ data, role });
|
|
691
|
-
(
|
|
687
|
+
(_b = overlay.didDismissShorthand) === null || _b === void 0 ? void 0 : _b.emit({ data, role });
|
|
692
688
|
// Get a reference to all animations currently assigned to this overlay
|
|
693
689
|
// Then tear them down to return the overlay to its initial visual state
|
|
694
690
|
const animations = activeAnimations.get(overlay) || [];
|
|
@@ -545,79 +545,6 @@ export class Modal {
|
|
|
545
545
|
this.gesture = gesture;
|
|
546
546
|
this.moveSheetToBreakpoint = moveSheetToBreakpoint;
|
|
547
547
|
this.gesture.enable(true);
|
|
548
|
-
/**
|
|
549
|
-
* When backdrop interaction is allowed, nested router outlets from child routes
|
|
550
|
-
* may block pointer events to parent content. Apply passthrough styles only when
|
|
551
|
-
* the modal was the sole content of a child route page.
|
|
552
|
-
* See https://github.com/ionic-team/ionic-framework/issues/30700
|
|
553
|
-
*/
|
|
554
|
-
const backdropNotBlocking = this.showBackdrop === false || this.focusTrap === false || backdropBreakpoint > 0;
|
|
555
|
-
if (backdropNotBlocking) {
|
|
556
|
-
this.setupChildRoutePassthrough();
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
/**
|
|
560
|
-
* For sheet modals that allow background interaction, sets up pointer-events
|
|
561
|
-
* passthrough on child route page wrappers and nested router outlets.
|
|
562
|
-
*/
|
|
563
|
-
setupChildRoutePassthrough() {
|
|
564
|
-
var _a;
|
|
565
|
-
const pageParent = this.getOriginalPageParent();
|
|
566
|
-
// Skip ion-app (controller modals) and pages with other content (inline modals)
|
|
567
|
-
if (!pageParent || pageParent.tagName === 'ION-APP') {
|
|
568
|
-
return;
|
|
569
|
-
}
|
|
570
|
-
const hasVisibleContent = Array.from(pageParent.children).some((child) => {
|
|
571
|
-
var _a;
|
|
572
|
-
if (child === this.el)
|
|
573
|
-
return false;
|
|
574
|
-
if (child instanceof HTMLElement && window.getComputedStyle(child).display === 'none')
|
|
575
|
-
return false;
|
|
576
|
-
if (child.tagName === 'TEMPLATE' || child.tagName === 'SLOT')
|
|
577
|
-
return false;
|
|
578
|
-
if (child.nodeType === Node.TEXT_NODE && !((_a = child.textContent) === null || _a === void 0 ? void 0 : _a.trim()))
|
|
579
|
-
return false;
|
|
580
|
-
return true;
|
|
581
|
-
});
|
|
582
|
-
if (hasVisibleContent) {
|
|
583
|
-
return;
|
|
584
|
-
}
|
|
585
|
-
// Child route case: page only contained the modal
|
|
586
|
-
pageParent.classList.add('ion-page-overlay-passthrough');
|
|
587
|
-
// Also make nested router outlets passthrough
|
|
588
|
-
const routerOutlet = pageParent.parentElement;
|
|
589
|
-
if ((routerOutlet === null || routerOutlet === void 0 ? void 0 : routerOutlet.tagName) === 'ION-ROUTER-OUTLET' && ((_a = routerOutlet.parentElement) === null || _a === void 0 ? void 0 : _a.tagName) !== 'ION-APP') {
|
|
590
|
-
routerOutlet.style.setProperty('pointer-events', 'none');
|
|
591
|
-
routerOutlet.setAttribute('data-overlay-passthrough', 'true');
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
/**
|
|
595
|
-
* Finds the ion-page ancestor of the modal's original parent location.
|
|
596
|
-
*/
|
|
597
|
-
getOriginalPageParent() {
|
|
598
|
-
if (!this.cachedOriginalParent) {
|
|
599
|
-
return null;
|
|
600
|
-
}
|
|
601
|
-
let pageParent = this.cachedOriginalParent;
|
|
602
|
-
while (pageParent && !pageParent.classList.contains('ion-page')) {
|
|
603
|
-
pageParent = pageParent.parentElement;
|
|
604
|
-
}
|
|
605
|
-
return pageParent;
|
|
606
|
-
}
|
|
607
|
-
/**
|
|
608
|
-
* Removes passthrough styles added by setupChildRoutePassthrough.
|
|
609
|
-
*/
|
|
610
|
-
cleanupChildRoutePassthrough() {
|
|
611
|
-
const pageParent = this.getOriginalPageParent();
|
|
612
|
-
if (!pageParent) {
|
|
613
|
-
return;
|
|
614
|
-
}
|
|
615
|
-
pageParent.classList.remove('ion-page-overlay-passthrough');
|
|
616
|
-
const routerOutlet = pageParent.parentElement;
|
|
617
|
-
if (routerOutlet === null || routerOutlet === void 0 ? void 0 : routerOutlet.hasAttribute('data-overlay-passthrough')) {
|
|
618
|
-
routerOutlet.style.removeProperty('pointer-events');
|
|
619
|
-
routerOutlet.removeAttribute('data-overlay-passthrough');
|
|
620
|
-
}
|
|
621
548
|
}
|
|
622
549
|
sheetOnDismiss() {
|
|
623
550
|
/**
|
|
@@ -707,7 +634,6 @@ export class Modal {
|
|
|
707
634
|
}
|
|
708
635
|
this.cleanupViewTransitionListener();
|
|
709
636
|
this.cleanupParentRemovalObserver();
|
|
710
|
-
this.cleanupChildRoutePassthrough();
|
|
711
637
|
}
|
|
712
638
|
this.currentBreakpoint = undefined;
|
|
713
639
|
this.animation = undefined;
|
|
@@ -953,20 +879,20 @@ export class Modal {
|
|
|
953
879
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
954
880
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
955
881
|
const isSheetModalWithHandle = isSheetModal && showHandle;
|
|
956
|
-
return (h(Host, Object.assign({ key: '
|
|
882
|
+
return (h(Host, Object.assign({ key: '9e9a7bd591eb17a225a00b4fa2e379e94601d17f', "no-router": true,
|
|
957
883
|
// Allow the modal to be navigable when the handle is focusable
|
|
958
884
|
tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
|
|
959
885
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
960
|
-
}, 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 }), h("ion-backdrop", { key: '
|
|
886
|
+
}, 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 }), h("ion-backdrop", { key: 'e5eae2c14f830f75e308fcd7f4c10c86fac5b962', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && h("div", { key: 'e268f9cd310c3cf4e051b5b92524ce4fb70d005e', class: "modal-shadow" }), h("div", Object.assign({ key: '9c380f36c18144c153077b15744d1c3346bce63e',
|
|
961
887
|
/*
|
|
962
888
|
role and aria-modal must be used on the
|
|
963
889
|
same element. They must also be set inside the
|
|
964
890
|
shadow DOM otherwise ion-button will not be highlighted
|
|
965
891
|
when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
|
|
966
892
|
*/
|
|
967
|
-
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { key: '
|
|
893
|
+
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { key: '2d5ee6d5959d97309c306e8ce72eb0f2c19be144', class: "modal-handle",
|
|
968
894
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
969
|
-
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) })), h("slot", { key: '
|
|
895
|
+
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) })), h("slot", { key: '5590434c35ea04c42fc006498bc189038e15a298', onSlotchange: this.onSlotChange }))));
|
|
970
896
|
}
|
|
971
897
|
static get is() { return "ion-modal"; }
|
|
972
898
|
static get encapsulation() { return "shadow"; }
|
|
@@ -423,7 +423,7 @@ export const setRootAriaHidden = (hidden = false) => {
|
|
|
423
423
|
}
|
|
424
424
|
};
|
|
425
425
|
export const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts) => {
|
|
426
|
-
var _a, _b
|
|
426
|
+
var _a, _b;
|
|
427
427
|
if (overlay.presented) {
|
|
428
428
|
return;
|
|
429
429
|
}
|
|
@@ -457,10 +457,9 @@ export const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation
|
|
|
457
457
|
*/
|
|
458
458
|
const overlayEl = overlay.el;
|
|
459
459
|
const shouldTrapFocus = overlayEl.tagName !== 'ION-TOAST' && overlayEl.focusTrap !== false;
|
|
460
|
-
// Only lock out root content when backdrop is
|
|
461
|
-
//
|
|
462
|
-
const
|
|
463
|
-
const shouldLockRoot = shouldTrapFocus && backdropAlwaysActive;
|
|
460
|
+
// Only lock out root content when backdrop is active. Developers relying on showBackdrop=false
|
|
461
|
+
// expect background interaction to remain enabled.
|
|
462
|
+
const shouldLockRoot = shouldTrapFocus && overlayEl.showBackdrop !== false;
|
|
464
463
|
overlay.presented = true;
|
|
465
464
|
overlay.willPresent.emit();
|
|
466
465
|
if (shouldLockRoot) {
|
|
@@ -472,7 +471,7 @@ export const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation
|
|
|
472
471
|
}
|
|
473
472
|
document.body.classList.add(BACKDROP_NO_SCROLL);
|
|
474
473
|
}
|
|
475
|
-
(
|
|
474
|
+
(_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
|
|
476
475
|
const mode = getIonMode(overlay);
|
|
477
476
|
// get the user's animation fn if one was provided
|
|
478
477
|
const animationBuilder = overlay.enterAnimation
|
|
@@ -481,7 +480,7 @@ export const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation
|
|
|
481
480
|
const completed = await overlayAnimation(overlay, animationBuilder, overlay.el, opts);
|
|
482
481
|
if (completed) {
|
|
483
482
|
overlay.didPresent.emit();
|
|
484
|
-
(
|
|
483
|
+
(_b = overlay.didPresentShorthand) === null || _b === void 0 ? void 0 : _b.emit();
|
|
485
484
|
}
|
|
486
485
|
/**
|
|
487
486
|
* If the focused element is already
|
|
@@ -559,7 +558,7 @@ const restoreElementFocus = async (overlayEl) => {
|
|
|
559
558
|
}
|
|
560
559
|
};
|
|
561
560
|
export const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnimation, opts) => {
|
|
562
|
-
var _a, _b
|
|
561
|
+
var _a, _b;
|
|
563
562
|
if (!overlay.presented) {
|
|
564
563
|
return false;
|
|
565
564
|
}
|
|
@@ -575,14 +574,11 @@ export const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLe
|
|
|
575
574
|
* is dismissed.
|
|
576
575
|
*/
|
|
577
576
|
const overlaysLockingRoot = presentedOverlays.filter((o) => {
|
|
578
|
-
var _a;
|
|
579
577
|
const el = o;
|
|
580
|
-
|
|
581
|
-
return el.tagName !== 'ION-TOAST' && el.focusTrap !== false && backdropAlwaysActive;
|
|
578
|
+
return el.tagName !== 'ION-TOAST' && el.focusTrap !== false && el.showBackdrop !== false;
|
|
582
579
|
});
|
|
583
580
|
const overlayEl = overlay.el;
|
|
584
|
-
const
|
|
585
|
-
const locksRoot = overlayEl.tagName !== 'ION-TOAST' && overlayEl.focusTrap !== false && backdropAlwaysActive;
|
|
581
|
+
const locksRoot = overlayEl.tagName !== 'ION-TOAST' && overlayEl.focusTrap !== false && overlayEl.showBackdrop !== false;
|
|
586
582
|
/**
|
|
587
583
|
* If this is the last visible overlay that is trapping focus
|
|
588
584
|
* then we want to re-add the root to the accessibility tree.
|
|
@@ -597,7 +593,7 @@ export const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLe
|
|
|
597
593
|
// Overlay contents should not be clickable during dismiss
|
|
598
594
|
overlay.el.style.setProperty('pointer-events', 'none');
|
|
599
595
|
overlay.willDismiss.emit({ data, role });
|
|
600
|
-
(
|
|
596
|
+
(_a = overlay.willDismissShorthand) === null || _a === void 0 ? void 0 : _a.emit({ data, role });
|
|
601
597
|
const mode = getIonMode(overlay);
|
|
602
598
|
const animationBuilder = overlay.leaveAnimation
|
|
603
599
|
? overlay.leaveAnimation
|
|
@@ -607,7 +603,7 @@ export const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLe
|
|
|
607
603
|
await overlayAnimation(overlay, animationBuilder, overlay.el, opts);
|
|
608
604
|
}
|
|
609
605
|
overlay.didDismiss.emit({ data, role });
|
|
610
|
-
(
|
|
606
|
+
(_b = overlay.didDismissShorthand) === null || _b === void 0 ? void 0 : _b.emit({ data, role });
|
|
611
607
|
// Get a reference to all animations currently assigned to this overlay
|
|
612
608
|
// Then tear them down to return the overlay to its initial visual state
|
|
613
609
|
const animations = activeAnimations.get(overlay) || [];
|
package/dist/docs.json
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export { L as LogLevel } from './index-C8IsBmNU.js';
|
|
|
13
13
|
export { I as IonicSafeString, g as getMode, s as setupConfig } from './config-mCdtaoPe.js';
|
|
14
14
|
export { o as openURL } from './theme-DiVJyqlX.js';
|
|
15
15
|
export { m as menuController } from './index-CvDIirVx.js';
|
|
16
|
-
export { b as actionSheetController, a as alertController, l as loadingController, m as modalController, p as pickerController, c as popoverController, t as toastController } from './overlays-
|
|
16
|
+
export { b as actionSheetController, a as alertController, l as loadingController, m as modalController, p as pickerController, c as popoverController, t as toastController } from './overlays-BymNv-BL.js';
|
|
17
17
|
import './index-ZjP4CjeZ.js';
|
|
18
18
|
import './gesture-controller-BTEOs1at.js';
|
|
19
19
|
import './hardware-back-button-CPLxO-Ev.js';
|
|
@@ -5,7 +5,7 @@ import { r as registerInstance, c as createEvent, a as readTask, h, d as Host, g
|
|
|
5
5
|
import { c as createButtonActiveGesture } from './button-active-L570Swow.js';
|
|
6
6
|
import { r as raf } from './helpers-DEn3pfjm.js';
|
|
7
7
|
import { c as createLockController } from './lock-controller-B-hirT0v.js';
|
|
8
|
-
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, f as present, g as dismiss, h as eventMethod, s as safeCall, j as prepareOverlay, k as setOverlayId } from './overlays-
|
|
8
|
+
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, f as present, g as dismiss, h as eventMethod, s as safeCall, j as prepareOverlay, k as setOverlayId } from './overlays-BymNv-BL.js';
|
|
9
9
|
import { g as getClassMap } from './theme-DiVJyqlX.js';
|
|
10
10
|
import { b as getIonMode } from './ionic-global-CDrldh-5.js';
|
|
11
11
|
import { c as createAnimation } from './animation-Dt8bGnA-.js';
|
|
@@ -6,7 +6,7 @@ import { E as ENABLE_HTML_CONTENT_DEFAULT, a as sanitizeDOMString } from './conf
|
|
|
6
6
|
import { c as createButtonActiveGesture } from './button-active-L570Swow.js';
|
|
7
7
|
import { r as raf } from './helpers-DEn3pfjm.js';
|
|
8
8
|
import { c as createLockController } from './lock-controller-B-hirT0v.js';
|
|
9
|
-
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-
|
|
9
|
+
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-BymNv-BL.js';
|
|
10
10
|
import { g as getClassMap } from './theme-DiVJyqlX.js';
|
|
11
11
|
import { b as getIonMode } from './ionic-global-CDrldh-5.js';
|
|
12
12
|
import { c as createAnimation } from './animation-Dt8bGnA-.js';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { j as printIonError, f as printIonWarning, r as registerInstance, c as createEvent, w as writeTask, h, d as Host, g as getElement } from './index-C8IsBmNU.js';
|
|
5
5
|
import { startFocusVisible } from './focus-visible-BmVRXR1y.js';
|
|
6
6
|
import { r as raf, g as getElementRoot, a as renderHiddenInput, e as clamp } from './helpers-DEn3pfjm.js';
|
|
7
|
-
import { F as FOCUS_TRAP_DISABLE_CLASS, d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-
|
|
7
|
+
import { F as FOCUS_TRAP_DISABLE_CLASS, d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-BymNv-BL.js';
|
|
8
8
|
import { i as isRTL } from './dir-C53feagD.js';
|
|
9
9
|
import { c as createColorClasses, g as getClassMap } from './theme-DiVJyqlX.js';
|
|
10
10
|
import { l as chevronDown, o as caretUpSharp, p as chevronForward, q as caretDownSharp, c as chevronBack } from './index-DV3sJJW8.js';
|
|
@@ -5,7 +5,7 @@ import { r as registerInstance, c as createEvent, e as config, h, d as Host, g a
|
|
|
5
5
|
import { E as ENABLE_HTML_CONTENT_DEFAULT, a as sanitizeDOMString } from './config-mCdtaoPe.js';
|
|
6
6
|
import { r as raf } from './helpers-DEn3pfjm.js';
|
|
7
7
|
import { c as createLockController } from './lock-controller-B-hirT0v.js';
|
|
8
|
-
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod } from './overlays-
|
|
8
|
+
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod } from './overlays-BymNv-BL.js';
|
|
9
9
|
import { g as getClassMap } from './theme-DiVJyqlX.js';
|
|
10
10
|
import { b as getIonMode } from './ionic-global-CDrldh-5.js';
|
|
11
11
|
import { c as createAnimation } from './animation-Dt8bGnA-.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, c as createEvent, e as config, j as printIonError, h, d as Host, g as getElement } from './index-C8IsBmNU.js';
|
|
5
5
|
import { g as getTimeGivenProgression } from './cubic-bezier-hHmYLOfE.js';
|
|
6
|
-
import { o as getPresentedOverlay, B as BACKDROP, n as focusFirstDescendant, q as focusLastDescendant, G as GESTURE } from './overlays-
|
|
6
|
+
import { o as getPresentedOverlay, B as BACKDROP, n as focusFirstDescendant, q as focusLastDescendant, G as GESTURE } from './overlays-BymNv-BL.js';
|
|
7
7
|
import { G as GESTURE_CONTROLLER } from './gesture-controller-BTEOs1at.js';
|
|
8
8
|
import { shouldUseCloseWatcher } from './hardware-back-button-CPLxO-Ev.js';
|
|
9
9
|
import { o as isEndSide, i as inheritAriaAttributes, l as assert, e as clamp } from './helpers-DEn3pfjm.js';
|