@ionic/core 8.6.3-dev.11750971489.140836b0 → 8.6.3-dev.11751305829.1112929c
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 +192 -8
- package/dist/cjs/ion-modal.cjs.entry.js +192 -8
- package/dist/collection/components/modal/animations/ios.enter.js +2 -2
- package/dist/collection/components/modal/animations/ios.leave.js +2 -2
- package/dist/collection/components/modal/animations/ios.transition.js +124 -0
- package/dist/collection/components/modal/modal.js +78 -4
- package/dist/docs.json +1 -1
- package/dist/esm/ion-modal.entry.js +192 -8
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-0df5b2a5.entry.js +4 -0
- package/dist/types/components/modal/animations/ios.transition.d.ts +14 -0
- package/dist/types/components/modal/modal.d.ts +6 -0
- package/hydrate/index.js +192 -8
- package/hydrate/index.mjs +192 -8
- package/package.json +2 -2
- package/dist/ionic/p-9e32212d.entry.js +0 -4
package/hydrate/index.mjs
CHANGED
|
@@ -21216,7 +21216,7 @@ const iosEnterAnimation$3 = (baseEl, opts) => {
|
|
|
21216
21216
|
baseAnimation.addAnimation(contentAnimation);
|
|
21217
21217
|
}
|
|
21218
21218
|
if (presentingEl) {
|
|
21219
|
-
const
|
|
21219
|
+
const isPortrait = window.innerWidth < 768;
|
|
21220
21220
|
const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
|
|
21221
21221
|
const presentingElRoot = getElementRoot(presentingEl);
|
|
21222
21222
|
const presentingAnimation = createAnimation().beforeStyles({
|
|
@@ -21225,7 +21225,7 @@ const iosEnterAnimation$3 = (baseEl, opts) => {
|
|
|
21225
21225
|
overflow: 'hidden',
|
|
21226
21226
|
});
|
|
21227
21227
|
const bodyEl = document.body;
|
|
21228
|
-
if (
|
|
21228
|
+
if (isPortrait) {
|
|
21229
21229
|
/**
|
|
21230
21230
|
* Fallback for browsers that does not support `max()` (ex: Firefox)
|
|
21231
21231
|
* No need to worry about statusbar padding since engines like Gecko
|
|
@@ -21303,7 +21303,7 @@ const iosLeaveAnimation$3 = (baseEl, opts, duration = 500) => {
|
|
|
21303
21303
|
.duration(duration)
|
|
21304
21304
|
.addAnimation(wrapperAnimation);
|
|
21305
21305
|
if (presentingEl) {
|
|
21306
|
-
const
|
|
21306
|
+
const isPortrait = window.innerWidth < 768;
|
|
21307
21307
|
const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
|
|
21308
21308
|
const presentingElRoot = getElementRoot(presentingEl);
|
|
21309
21309
|
const presentingAnimation = createAnimation()
|
|
@@ -21321,7 +21321,7 @@ const iosLeaveAnimation$3 = (baseEl, opts, duration = 500) => {
|
|
|
21321
21321
|
}
|
|
21322
21322
|
});
|
|
21323
21323
|
const bodyEl = document.body;
|
|
21324
|
-
if (
|
|
21324
|
+
if (isPortrait) {
|
|
21325
21325
|
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
21326
21326
|
const modalTransform = hasCardModal ? '-10px' : transformOffset;
|
|
21327
21327
|
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
@@ -21368,6 +21368,125 @@ const iosLeaveAnimation$3 = (baseEl, opts, duration = 500) => {
|
|
|
21368
21368
|
return baseAnimation;
|
|
21369
21369
|
};
|
|
21370
21370
|
|
|
21371
|
+
/**
|
|
21372
|
+
* Transition animation from portrait view to landscape view
|
|
21373
|
+
* This handles the case where a card modal is open in portrait view
|
|
21374
|
+
* and the user switches to landscape view
|
|
21375
|
+
*/
|
|
21376
|
+
const portraitToLandscapeTransition = (baseEl, opts, duration = 300) => {
|
|
21377
|
+
const { presentingEl } = opts;
|
|
21378
|
+
if (!presentingEl) {
|
|
21379
|
+
// No transition needed for non-card modals
|
|
21380
|
+
return createAnimation('portrait-to-landscape-transition');
|
|
21381
|
+
}
|
|
21382
|
+
const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
|
|
21383
|
+
const presentingElRoot = getElementRoot(presentingEl);
|
|
21384
|
+
const bodyEl = document.body;
|
|
21385
|
+
const baseAnimation = createAnimation('portrait-to-landscape-transition')
|
|
21386
|
+
.addElement(baseEl)
|
|
21387
|
+
.easing('cubic-bezier(0.32,0.72,0,1)')
|
|
21388
|
+
.duration(duration);
|
|
21389
|
+
const presentingAnimation = createAnimation();
|
|
21390
|
+
if (!hasCardModal) {
|
|
21391
|
+
// Non-card modal: transition from portrait state to landscape state
|
|
21392
|
+
// Portrait: presentingEl has transform and body has black background
|
|
21393
|
+
// Landscape: no transform, no body background, modal wrapper opacity changes
|
|
21394
|
+
const root = getElementRoot(baseEl);
|
|
21395
|
+
const wrapperAnimation = createAnimation()
|
|
21396
|
+
.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow'))
|
|
21397
|
+
.fromTo('opacity', '1', '1'); // Keep wrapper visible in landscape
|
|
21398
|
+
const backdropAnimation = createAnimation()
|
|
21399
|
+
.addElement(root.querySelector('ion-backdrop'))
|
|
21400
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 'var(--backdrop-opacity)'); // Keep backdrop visible
|
|
21401
|
+
// Animate presentingEl from portrait state back to normal
|
|
21402
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
21403
|
+
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
21404
|
+
const fromTransform = `translateY(${transformOffset}) scale(${toPresentingScale})`;
|
|
21405
|
+
presentingAnimation
|
|
21406
|
+
.addElement(presentingEl)
|
|
21407
|
+
.beforeAddWrite(() => bodyEl.style.setProperty('background-color', ''))
|
|
21408
|
+
.fromTo('transform', fromTransform, 'translateY(0px) scale(1)')
|
|
21409
|
+
.fromTo('filter', 'contrast(0.85)', 'contrast(1)')
|
|
21410
|
+
.fromTo('border-radius', '10px 10px 0 0', '0px');
|
|
21411
|
+
baseAnimation.addAnimation([presentingAnimation, wrapperAnimation, backdropAnimation]);
|
|
21412
|
+
}
|
|
21413
|
+
else {
|
|
21414
|
+
// Card modal: transition from portrait card state to landscape card state
|
|
21415
|
+
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
21416
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
21417
|
+
const fromTransform = `translateY(${transformOffset}) scale(${toPresentingScale})`;
|
|
21418
|
+
const toTransform = `translateY(-10px) scale(${toPresentingScale})`;
|
|
21419
|
+
presentingAnimation
|
|
21420
|
+
.addElement(presentingElRoot.querySelector('.modal-wrapper'))
|
|
21421
|
+
.fromTo('transform', fromTransform, toTransform)
|
|
21422
|
+
.fromTo('filter', 'contrast(0.85)', 'contrast(0.85)'); // Keep same contrast for card
|
|
21423
|
+
const shadowAnimation = createAnimation()
|
|
21424
|
+
.addElement(presentingElRoot.querySelector('.modal-shadow'))
|
|
21425
|
+
.fromTo('opacity', '0', '0') // Shadow stays hidden in landscape for card modals
|
|
21426
|
+
.fromTo('transform', fromTransform, toTransform);
|
|
21427
|
+
baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);
|
|
21428
|
+
}
|
|
21429
|
+
return baseAnimation;
|
|
21430
|
+
};
|
|
21431
|
+
/**
|
|
21432
|
+
* Transition animation from landscape view to portrait view
|
|
21433
|
+
* This handles the case where a card modal is open in landscape view
|
|
21434
|
+
* and the user switches to portrait view
|
|
21435
|
+
*/
|
|
21436
|
+
const landscapeToPortraitTransition = (baseEl, opts, duration = 300) => {
|
|
21437
|
+
const { presentingEl } = opts;
|
|
21438
|
+
if (!presentingEl) {
|
|
21439
|
+
// No transition needed for non-card modals
|
|
21440
|
+
return createAnimation('landscape-to-portrait-transition');
|
|
21441
|
+
}
|
|
21442
|
+
const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
|
|
21443
|
+
const presentingElRoot = getElementRoot(presentingEl);
|
|
21444
|
+
const bodyEl = document.body;
|
|
21445
|
+
const baseAnimation = createAnimation('landscape-to-portrait-transition')
|
|
21446
|
+
.addElement(baseEl)
|
|
21447
|
+
.easing('cubic-bezier(0.32,0.72,0,1)')
|
|
21448
|
+
.duration(duration);
|
|
21449
|
+
const presentingAnimation = createAnimation();
|
|
21450
|
+
if (!hasCardModal) {
|
|
21451
|
+
// Non-card modal: transition from landscape state to portrait state
|
|
21452
|
+
const root = getElementRoot(baseEl);
|
|
21453
|
+
const wrapperAnimation = createAnimation()
|
|
21454
|
+
.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow'))
|
|
21455
|
+
.fromTo('opacity', '1', '1'); // Keep wrapper visible
|
|
21456
|
+
const backdropAnimation = createAnimation()
|
|
21457
|
+
.addElement(root.querySelector('ion-backdrop'))
|
|
21458
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 'var(--backdrop-opacity)'); // Keep backdrop visible
|
|
21459
|
+
// Animate presentingEl from normal state to portrait state
|
|
21460
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
21461
|
+
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
21462
|
+
const toTransform = `translateY(${transformOffset}) scale(${toPresentingScale})`;
|
|
21463
|
+
presentingAnimation
|
|
21464
|
+
.addElement(presentingEl)
|
|
21465
|
+
.beforeAddWrite(() => bodyEl.style.setProperty('background-color', 'black'))
|
|
21466
|
+
.fromTo('transform', 'translateY(0px) scale(1)', toTransform)
|
|
21467
|
+
.fromTo('filter', 'contrast(1)', 'contrast(0.85)')
|
|
21468
|
+
.fromTo('border-radius', '0px', '10px 10px 0 0');
|
|
21469
|
+
baseAnimation.addAnimation([presentingAnimation, wrapperAnimation, backdropAnimation]);
|
|
21470
|
+
}
|
|
21471
|
+
else {
|
|
21472
|
+
// Card modal: transition from landscape card state to portrait card state
|
|
21473
|
+
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
21474
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
21475
|
+
const fromTransform = `translateY(-10px) scale(${toPresentingScale})`;
|
|
21476
|
+
const toTransform = `translateY(${transformOffset}) scale(${toPresentingScale})`;
|
|
21477
|
+
presentingAnimation
|
|
21478
|
+
.addElement(presentingElRoot.querySelector('.modal-wrapper'))
|
|
21479
|
+
.fromTo('transform', fromTransform, toTransform)
|
|
21480
|
+
.fromTo('filter', 'contrast(0.85)', 'contrast(0.85)'); // Keep same contrast for card
|
|
21481
|
+
const shadowAnimation = createAnimation()
|
|
21482
|
+
.addElement(presentingElRoot.querySelector('.modal-shadow'))
|
|
21483
|
+
.fromTo('opacity', '0', '0') // Shadow stays hidden
|
|
21484
|
+
.fromTo('transform', fromTransform, toTransform);
|
|
21485
|
+
baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);
|
|
21486
|
+
}
|
|
21487
|
+
return baseAnimation;
|
|
21488
|
+
};
|
|
21489
|
+
|
|
21371
21490
|
const createEnterAnimation = () => {
|
|
21372
21491
|
const backdropAnimation = createAnimation()
|
|
21373
21492
|
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
|
@@ -22159,6 +22278,7 @@ class Modal {
|
|
|
22159
22278
|
}
|
|
22160
22279
|
disconnectedCallback() {
|
|
22161
22280
|
this.triggerController.removeClickListener();
|
|
22281
|
+
this.cleanupViewTransitionListener();
|
|
22162
22282
|
}
|
|
22163
22283
|
componentWillLoad() {
|
|
22164
22284
|
var _a;
|
|
@@ -22369,6 +22489,8 @@ class Modal {
|
|
|
22369
22489
|
else if (hasCardModal) {
|
|
22370
22490
|
this.initSwipeToClose();
|
|
22371
22491
|
}
|
|
22492
|
+
// Initialize view transition listener for iOS card modals
|
|
22493
|
+
this.initViewTransitionListener();
|
|
22372
22494
|
unlock();
|
|
22373
22495
|
}
|
|
22374
22496
|
initSwipeToClose() {
|
|
@@ -22522,6 +22644,7 @@ class Modal {
|
|
|
22522
22644
|
if (this.gesture) {
|
|
22523
22645
|
this.gesture.destroy();
|
|
22524
22646
|
}
|
|
22647
|
+
this.cleanupViewTransitionListener();
|
|
22525
22648
|
}
|
|
22526
22649
|
this.currentBreakpoint = undefined;
|
|
22527
22650
|
this.animation = undefined;
|
|
@@ -22597,6 +22720,67 @@ class Modal {
|
|
|
22597
22720
|
await this.setCurrentBreakpoint(nextBreakpoint);
|
|
22598
22721
|
return true;
|
|
22599
22722
|
}
|
|
22723
|
+
initViewTransitionListener() {
|
|
22724
|
+
// Only enable for iOS card modals when no custom animations are provided
|
|
22725
|
+
if (getIonMode$1(this) !== 'ios' || !this.presentingElement || this.enterAnimation || this.leaveAnimation) {
|
|
22726
|
+
return;
|
|
22727
|
+
}
|
|
22728
|
+
// Set initial view state
|
|
22729
|
+
this.currentViewIsPortrait = window.innerWidth < 768;
|
|
22730
|
+
// Create debounced resize handler
|
|
22731
|
+
let resizeTimeout;
|
|
22732
|
+
this.resizeListener = () => {
|
|
22733
|
+
clearTimeout(resizeTimeout);
|
|
22734
|
+
resizeTimeout = setTimeout(() => {
|
|
22735
|
+
this.handleViewTransition();
|
|
22736
|
+
}, 100); // Debounce for 100ms to avoid excessive calls
|
|
22737
|
+
};
|
|
22738
|
+
window.addEventListener('resize', this.resizeListener);
|
|
22739
|
+
}
|
|
22740
|
+
handleViewTransition() {
|
|
22741
|
+
const isPortrait = window.innerWidth < 768;
|
|
22742
|
+
// Only transition if view state actually changed
|
|
22743
|
+
if (this.currentViewIsPortrait === isPortrait) {
|
|
22744
|
+
return;
|
|
22745
|
+
}
|
|
22746
|
+
// Cancel any ongoing transition animation
|
|
22747
|
+
if (this.viewTransitionAnimation) {
|
|
22748
|
+
this.viewTransitionAnimation.destroy();
|
|
22749
|
+
this.viewTransitionAnimation = undefined;
|
|
22750
|
+
}
|
|
22751
|
+
const { presentingElement } = this;
|
|
22752
|
+
if (!presentingElement) {
|
|
22753
|
+
return;
|
|
22754
|
+
}
|
|
22755
|
+
// Create transition animation
|
|
22756
|
+
let transitionAnimation;
|
|
22757
|
+
if (this.currentViewIsPortrait && !isPortrait) {
|
|
22758
|
+
// Portrait to landscape transition
|
|
22759
|
+
transitionAnimation = portraitToLandscapeTransition(this.el, {
|
|
22760
|
+
presentingEl: presentingElement});
|
|
22761
|
+
}
|
|
22762
|
+
else {
|
|
22763
|
+
// Landscape to portrait transition
|
|
22764
|
+
transitionAnimation = landscapeToPortraitTransition(this.el, {
|
|
22765
|
+
presentingEl: presentingElement});
|
|
22766
|
+
}
|
|
22767
|
+
// Update state and play animation
|
|
22768
|
+
this.currentViewIsPortrait = isPortrait;
|
|
22769
|
+
this.viewTransitionAnimation = transitionAnimation;
|
|
22770
|
+
transitionAnimation.play().then(() => {
|
|
22771
|
+
this.viewTransitionAnimation = undefined;
|
|
22772
|
+
});
|
|
22773
|
+
}
|
|
22774
|
+
cleanupViewTransitionListener() {
|
|
22775
|
+
if (this.resizeListener) {
|
|
22776
|
+
window.removeEventListener('resize', this.resizeListener);
|
|
22777
|
+
this.resizeListener = undefined;
|
|
22778
|
+
}
|
|
22779
|
+
if (this.viewTransitionAnimation) {
|
|
22780
|
+
this.viewTransitionAnimation.destroy();
|
|
22781
|
+
this.viewTransitionAnimation = undefined;
|
|
22782
|
+
}
|
|
22783
|
+
}
|
|
22600
22784
|
render() {
|
|
22601
22785
|
const { handle, isSheetModal, presentingElement, htmlAttributes, handleBehavior, inheritedAttributes, focusTrap, expandToScroll, } = this;
|
|
22602
22786
|
const showHandle = handle !== false && isSheetModal;
|
|
@@ -22604,20 +22788,20 @@ class Modal {
|
|
|
22604
22788
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
22605
22789
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
22606
22790
|
const isSheetModalWithHandle = isSheetModal && showHandle;
|
|
22607
|
-
return (hAsync(Host, Object.assign({ key: '
|
|
22791
|
+
return (hAsync(Host, Object.assign({ key: 'd5bcaa588471573e1bcbd99997b306c8ecdd124f', "no-router": true,
|
|
22608
22792
|
// Allow the modal to be navigable when the handle is focusable
|
|
22609
22793
|
tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
|
|
22610
22794
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
22611
|
-
}, 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: '
|
|
22795
|
+
}, 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: '78b954a1c50a0325eb51db04314e86701c66d840', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && hAsync("div", { key: '21887227c272f5eba1b3d164be3572bd710d415c', class: "modal-shadow" }), hAsync("div", Object.assign({ key: 'a40472a9065c04ad12fb7b2b2a05e5021f077ad5',
|
|
22612
22796
|
/*
|
|
22613
22797
|
role and aria-modal must be used on the
|
|
22614
22798
|
same element. They must also be set inside the
|
|
22615
22799
|
shadow DOM otherwise ion-button will not be highlighted
|
|
22616
22800
|
when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
|
|
22617
22801
|
*/
|
|
22618
|
-
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: '
|
|
22802
|
+
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: 'a4973f66587546031d1cc0197e1ba7c2521a3fbc', class: "modal-handle",
|
|
22619
22803
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
22620
|
-
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: '
|
|
22804
|
+
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: 'ee5e007e3a4e592d98f1b5a5d31ad55e6faa3bdb' }))));
|
|
22621
22805
|
}
|
|
22622
22806
|
get el() { return getElement(this); }
|
|
22623
22807
|
static get watchers() { return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ionic/core",
|
|
3
|
-
"version": "8.6.3-dev.
|
|
3
|
+
"version": "8.6.3-dev.11751305829.1112929c",
|
|
4
4
|
"description": "Base components for Ionic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ionic",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@stencil/angular-output-target": "^0.10.0",
|
|
51
51
|
"@stencil/react-output-target": "0.5.3",
|
|
52
52
|
"@stencil/sass": "^3.0.9",
|
|
53
|
-
"@stencil/vue-output-target": "0.10.
|
|
53
|
+
"@stencil/vue-output-target": "0.10.8",
|
|
54
54
|
"@types/jest": "^29.5.6",
|
|
55
55
|
"@types/node": "^14.6.0",
|
|
56
56
|
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,d as o,m as i,w as a,e,l as r,h as n,j as s,k as d}from"./p-B_U9CtaY.js";import{f as h,i as p,d as l,r as c,a as m,p as f}from"./p-QwEXyOze.js";import{C as b,a as u,d as w}from"./p-BhLqfMrf.js";import{e as x,g as v,r as g,b as k,h as y}from"./p-Do-uqmtX.js";import{c as A}from"./p-B-hirT0v.js";import{g as B}from"./p-CIGNaXM1.js";import{G as D,O as Y,F as E,e as S,B as j,j as C,k as M,f as T,g as O,h as $}from"./p-aIxOGKys.js";import{g as P}from"./p-DiVJyqlX.js";import{e as I,w as R}from"./p-BROiNJRB.js";import{KEYBOARD_DID_OPEN as z}from"./p-9eeaBrnk.js";import{c as W}from"./p-bNmY-WfR.js";import{g as L}from"./p-hHmYLOfE.js";import{createGesture as H}from"./p-Cl0B-RWe.js";import{w as N}from"./p-ZjP4CjeZ.js";import"./p-DzH0J0yi.js";import"./p-BTEOs1at.js";import"./p-D13Eaw-8.js";var F;!function(t){t.Dark="DARK",t.Light="LIGHT",t.Default="DEFAULT"}(F||(F={}));const K={getEngine(){const t=B();if(null==t?void 0:t.isPluginAvailable("StatusBar"))return t.Plugins.StatusBar},setStyle(t){const o=this.getEngine();o&&o.setStyle(t)},getStyle:async function(){const t=this.getEngine();if(!t)return F.Default;const{style:o}=await t.getInfo();return o}},Z=(t,o)=>{if(1===o)return 0;const i=1/(1-o);return t*i+-o*i},G=()=>{!N||N.innerWidth>=768||K.setStyle({style:F.Dark})},V=(t=F.Default)=>{!N||N.innerWidth>=768||K.setStyle({style:t})},_=async(t,o)=>{"function"==typeof t.canDismiss&&await t.canDismiss(void 0,D)&&(o.isRunning()?o.onFinish((()=>{t.dismiss(void 0,"handler")}),{oneTimeCallback:!0}):t.dismiss(void 0,"handler"))},X=t=>.00255275*2.71828**(-14.9619*t)-1.00255*2.71828**(-.0380968*t)+1,q=.915,J=(t,o)=>x(400,t/Math.abs(1.1*o),500),U=t=>{const{currentBreakpoint:o,backdropBreakpoint:i,expandToScroll:a}=t,e=void 0===i||i<o,r=e?`calc(var(--backdrop-opacity) * ${o})`:"0",n=W("backdropAnimation").fromTo("opacity",0,r);return e&&n.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),{wrapperAnimation:W("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:`translateY(${100-100*o}%)`}]),backdropAnimation:n,contentAnimation:a?void 0:W("contentAnimation").keyframes([{offset:0,opacity:1,maxHeight:100*(1-o)+"%"},{offset:1,opacity:1,maxHeight:100*o+"%"}])}},Q=t=>{const{currentBreakpoint:o,backdropBreakpoint:i}=t,a=`calc(var(--backdrop-opacity) * ${Z(o,i)})`,e=[{offset:0,opacity:a},{offset:1,opacity:0}],r=[{offset:0,opacity:a},{offset:i,opacity:0},{offset:1,opacity:0}],n=W("backdropAnimation").keyframes(0!==i?r:e);return{wrapperAnimation:W("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:`translateY(${100-100*o}%)`},{offset:1,opacity:1,transform:"translateY(100%)"}]),backdropAnimation:n}},tt=(t,o)=>{const{presentingEl:i,currentBreakpoint:a,expandToScroll:e}=o,r=v(t),{wrapperAnimation:n,backdropAnimation:s,contentAnimation:d}=void 0!==a?U(o):{backdropAnimation:W().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:W().fromTo("transform","translateY(100vh)","translateY(0vh)"),contentAnimation:void 0};s.addElement(r.querySelector("ion-backdrop")),n.addElement(r.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1}),!e&&(null==d||d.addElement(t.querySelector(".ion-page")));const h=W("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation([n]);if(d&&h.addAnimation(d),i){const t=window.innerWidth<768,o="ION-MODAL"===i.tagName&&void 0!==i.presentingElement,a=v(i),e=W().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"}),r=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",a=`translateY(${o?"-10px":t}) scale(0.915)`;e.afterStyles({transform:a}).beforeAddWrite((()=>r.style.setProperty("background-color","black"))).addElement(i).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:a,borderRadius:"10px 10px 0 0"}]),h.addAnimation(e)}else if(h.addAnimation(s),o){const t=`translateY(-10px) scale(${o?q:1})`;e.afterStyles({transform:t}).addElement(a.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:t}]);const i=W().afterStyles({transform:t}).addElement(a.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:t}]);h.addAnimation([e,i])}else n.fromTo("opacity","0","1")}else h.addAnimation(s);return h},ot=(t,o,i=500)=>{const{presentingEl:a,currentBreakpoint:e}=o,r=v(t),{wrapperAnimation:n,backdropAnimation:s}=void 0!==e?Q(o):{backdropAnimation:W().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:W().fromTo("transform","translateY(0vh)","translateY(100vh)")};s.addElement(r.querySelector("ion-backdrop")),n.addElement(r.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const d=W("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(i).addAnimation(n);if(a){const t=window.innerWidth<768,o="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,i=v(a),e=W().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((t=>{1===t&&(a.style.setProperty("overflow",""),Array.from(r.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((t=>void 0!==t.presentingElement)).length<=1&&r.style.setProperty("background-color",""))})),r=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",i=`translateY(${o?"-10px":t}) scale(0.915)`;e.addElement(a).keyframes([{offset:0,filter:"contrast(0.85)",transform:i,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]),d.addAnimation(e)}else if(d.addAnimation(s),o){const t=`translateY(-10px) scale(${o?q:1})`;e.addElement(i.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:t},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);const a=W().addElement(i.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:t},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);d.addAnimation([e,a])}else n.fromTo("opacity","1","0")}else d.addAnimation(s);return d},it=(t,o)=>{const{currentBreakpoint:i,expandToScroll:a}=o,e=v(t),{wrapperAnimation:r,backdropAnimation:n,contentAnimation:s}=void 0!==i?U(o):{backdropAnimation:W().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:W().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]),contentAnimation:void 0};n.addElement(e.querySelector("ion-backdrop")),r.addElement(e.querySelector(".modal-wrapper")),!a&&(null==s||s.addElement(t.querySelector(".ion-page")));const d=W().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([n,r]);return s&&d.addAnimation(s),d},at=(t,o)=>{const{currentBreakpoint:i}=o,a=v(t),{wrapperAnimation:e,backdropAnimation:r}=void 0!==i?Q(o):{backdropAnimation:W().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:W().keyframes([{offset:0,opacity:.99,transform:"translateY(0px)"},{offset:1,opacity:0,transform:"translateY(40px)"}])};return r.addElement(a.querySelector("ion-backdrop")),e.addElement(a.querySelector(".modal-wrapper")),W().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([r,e])},et=class{constructor(i){t(this,i),this.didPresent=o(this,"ionModalDidPresent",7),this.willPresent=o(this,"ionModalWillPresent",7),this.willDismiss=o(this,"ionModalWillDismiss",7),this.didDismiss=o(this,"ionModalDidDismiss",7),this.ionBreakpointDidChange=o(this,"ionBreakpointDidChange",7),this.didPresentShorthand=o(this,"didPresent",7),this.willPresentShorthand=o(this,"willPresent",7),this.willDismissShorthand=o(this,"willDismiss",7),this.didDismissShorthand=o(this,"didDismiss",7),this.ionMount=o(this,"ionMount",7),this.lockController=A(),this.triggerController=S(),this.coreDelegate=b(),this.isSheetModal=!1,this.inheritedAttributes={},this.inline=!1,this.gestureAnimationDismissing=!1,this.presented=!1,this.hasController=!1,this.keyboardClose=!0,this.expandToScroll=!0,this.backdropBreakpoint=0,this.handleBehavior="none",this.backdropDismiss=!0,this.showBackdrop=!0,this.animated=!0,this.isOpen=!1,this.keepContentsMounted=!1,this.focusTrap=!0,this.canDismiss=!0,this.onHandleClick=()=>{const{sheetTransition:t,handleBehavior:o}=this;"cycle"===o&&void 0===t&&this.moveToNextBreakpoint()},this.onBackdropTap=()=>{const{sheetTransition:t}=this;void 0===t&&this.dismiss(void 0,j)},this.onLifecycle=t=>{const o=this.usersElement,i=rt[t.type];if(o&&i){const a=new CustomEvent(i,{bubbles:!1,cancelable:!1,detail:t.detail});o.dispatchEvent(a)}},this.onModalFocus=t=>{const{dragHandleEl:o,el:i}=this;t.target===i&&o&&-1!==o.tabIndex&&o.focus()}}onIsOpenChange(t,o){!0===t&&!1===o?this.present():!1===t&&!0===o&&this.dismiss()}triggerChanged(){const{trigger:t,el:o,triggerController:i}=this;t&&i.addClickListener(o,t)}breakpointsChanged(t){void 0!==t&&(this.sortedBreakpoints=t.sort(((t,o)=>t-o)))}connectedCallback(){const{el:t}=this;C(t),this.triggerChanged()}disconnectedCallback(){this.triggerController.removeClickListener()}componentWillLoad(){var t;const{breakpoints:o,initialBreakpoint:a,el:e,htmlAttributes:r}=this,n=this.isSheetModal=void 0!==o&&void 0!==a,s=["aria-label","role"];this.inheritedAttributes=k(e,s),void 0!==r&&s.forEach((t=>{r[t]&&(this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:r[t]}),delete r[t])})),n&&(this.currentBreakpoint=this.initialBreakpoint),void 0===o||void 0===a||o.includes(a)||i("[ion-modal] - Your breakpoints array must include the initialBreakpoint value."),(null===(t=this.htmlAttributes)||void 0===t?void 0:t.id)||M(this.el)}componentDidLoad(){!0===this.isOpen&&g((()=>this.present())),this.breakpointsChanged(this.breakpoints),this.triggerChanged()}getDelegate(t=!1){if(this.workingDelegate&&!t)return{delegate:this.workingDelegate,inline:this.inline};const o=this.inline=null!==this.el.parentNode&&!this.hasController;return{inline:o,delegate:this.workingDelegate=o?this.delegate||this.coreDelegate:this.delegate}}async checkCanDismiss(t,o){const{canDismiss:i}=this;return"function"==typeof i?i(t,o):i}async present(){const t=await this.lockController.lock();if(this.presented)return void t();const{presentingElement:o,el:i}=this;this.currentBreakpoint=this.initialBreakpoint;const{inline:r,delegate:n}=this.getDelegate(!0);this.ionMount.emit(),this.usersElement=await u(n,i,this.component,["ion-page"],this.componentProps,r),y(i)?await I(this.usersElement):this.keepContentsMounted||await R(),a((()=>this.el.classList.add("show-modal")));const s=void 0!==o;s&&"ios"===e(this)&&(this.statusBarStyle=await K.getStyle(),G()),await T(this,"modalEnter",tt,it,{presentingEl:o,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll}),"undefined"!=typeof window&&(this.keyboardOpenCallback=()=>{this.gesture&&(this.gesture.enable(!1),g((()=>{this.gesture&&this.gesture.enable(!0)})))},window.addEventListener(z,this.keyboardOpenCallback)),this.isSheetModal?this.initSheetGesture():s&&this.initSwipeToClose(),t()}initSwipeToClose(){var t;if("ios"!==e(this))return;const{el:o}=this,i=this.leaveAnimation||r.get("modalLeave",ot),a=this.animation=i(o,{presentingEl:this.presentingElement,expandToScroll:this.expandToScroll});if(!m(o))return void f(o);const n=null!==(t=this.statusBarStyle)&&void 0!==t?t:F.Default;this.gesture=((t,o,i,a)=>{const e=.5,r=t.offsetHeight;let n=!1,s=!1,d=null,m=null,f=!0,b=0;const u=H({el:t,gestureName:"modalSwipeToClose",gesturePriority:Y,direction:"y",threshold:10,canStart:t=>{const o=t.event.target;if(null===o||!o.closest)return!0;if(d=h(o),d){if(p(d)){const t=v(d);m=t.querySelector(".inner-scroll")}else m=d;return!d.querySelector("ion-refresher")&&0===m.scrollTop}return null===o.closest("ion-footer")},onStart:i=>{const{deltaY:a}=i;f=!d||!p(d)||d.scrollY,s=void 0!==t.canDismiss&&!0!==t.canDismiss,a>0&&d&&l(d),o.progressStart(!0,n?1:0)},onMove:t=>{const{deltaY:a}=t;a>0&&d&&l(d);const n=t.deltaY/r,h=n>=0&&s,p=h?.2:.9999,c=h?X(n/p):n,m=x(1e-4,c,p);o.progressStep(m),m>=e&&b<e?V(i):m<e&&b>=e&&G(),b=m},onEnd:i=>{const h=i.velocityY,p=i.deltaY/r,l=p>=0&&s,m=l?.2:.9999,b=l?X(p/m):p,w=x(1e-4,b,m),v=!l&&(i.deltaY+1e3*h)/r>=e;let g=v?-.001:.001;v?(o.easing("cubic-bezier(0.32, 0.72, 0, 1)"),g+=L([0,0],[.32,.72],[0,1],[1,1],w)[0]):(o.easing("cubic-bezier(1, 0, 0.68, 0.28)"),g+=L([0,0],[1,0],[.68,.28],[1,1],w)[0]);const k=J(v?p*r:(1-w)*r,h);n=v,u.enable(!1),d&&c(d,f),o.onFinish((()=>{v||u.enable(!0)})).progressEnd(v?1:0,g,k),l&&w>m/4?_(t,o):v&&a()}});return u})(o,a,n,(()=>{this.gestureAnimationDismissing=!0,V(this.statusBarStyle),this.animation.onFinish((async()=>{await this.dismiss(void 0,D),this.gestureAnimationDismissing=!1}))})),this.gesture.enable(!0)}initSheetGesture(){const{wrapperEl:t,initialBreakpoint:o,backdropBreakpoint:i}=this;if(!t||void 0===o)return;const a=this.enterAnimation||r.get("modalEnter",tt),e=this.animation=a(this.el,{presentingEl:this.presentingElement,currentBreakpoint:o,backdropBreakpoint:i,expandToScroll:this.expandToScroll});e.progressStart(!0,1);const{gesture:n,moveSheetToBreakpoint:s}=((t,o,i,a,e,r,n=[],s,d,l,c)=>{const m={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:0!==e?[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-e,opacity:0},{offset:1,opacity:0}]:[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}],CONTENT_KEYFRAMES:[{offset:0,maxHeight:"100%"},{offset:1,maxHeight:"0%"}]},f=t.querySelector("ion-content"),b=i.clientHeight;let u=a,w=0,k=!1,y=null,A=null,B=null,D=null;const Y=n[n.length-1],S=n[0],j=r.childAnimations.find((t=>"wrapperAnimation"===t.id)),C=r.childAnimations.find((t=>"backdropAnimation"===t.id)),M=r.childAnimations.find((t=>"contentAnimation"===t.id)),T=()=>{t.style.setProperty("pointer-events","auto"),o.style.setProperty("pointer-events","auto"),t.classList.remove(E)},O=()=>{t.style.setProperty("pointer-events","none"),o.style.setProperty("pointer-events","none"),t.classList.add(E)},$=o=>{if(!A&&(A=Array.from(t.querySelectorAll("ion-footer")),!A.length))return;const i=t.querySelector(".ion-page");if(D=o,"stationary"===o)A.forEach((t=>{t.classList.remove("modal-footer-moving"),t.style.removeProperty("position"),t.style.removeProperty("width"),t.style.removeProperty("height"),t.style.removeProperty("top"),t.style.removeProperty("left"),null==i||i.style.removeProperty("padding-bottom"),null==i||i.appendChild(t)}));else{let o=0;A.forEach(((i,a)=>{const e=i.getBoundingClientRect(),r=document.body.getBoundingClientRect();o+=i.clientHeight;const n=e.top-r.top,s=e.left-r.left;if(i.style.setProperty("--pinned-width",`${i.clientWidth}px`),i.style.setProperty("--pinned-height",`${i.clientHeight}px`),i.style.setProperty("--pinned-top",`${n}px`),i.style.setProperty("--pinned-left",`${s}px`),0===a){B=n;const o=t.querySelector("ion-header");o&&(B-=o.clientHeight)}})),A.forEach((t=>{null==i||i.style.setProperty("padding-bottom",`${o}px`),t.classList.add("modal-footer-moving"),t.style.setProperty("position","absolute"),t.style.setProperty("width","var(--pinned-width)"),t.style.setProperty("height","var(--pinned-height)"),t.style.setProperty("top","var(--pinned-top)"),t.style.setProperty("left","var(--pinned-left)"),document.body.appendChild(t)}))}};j&&C&&(j.keyframes([...m.WRAPPER_KEYFRAMES]),C.keyframes([...m.BACKDROP_KEYFRAMES]),null==M||M.keyframes([...m.CONTENT_KEYFRAMES]),r.progressStart(!0,1-u),u>e?T():O()),f&&u!==Y&&s&&(f.scrollY=!1);const P=o=>{const{breakpoint:i,canDismiss:a,breakpointOffset:d,animated:h}=o,p=a&&0===i,b=p?u:i,w=0!==b;return u=0,j&&C&&(j.keyframes([{offset:0,transform:`translateY(${100*d}%)`},{offset:1,transform:`translateY(${100*(1-b)}%)`}]),C.keyframes([{offset:0,opacity:`calc(var(--backdrop-opacity) * ${Z(1-d,e)})`},{offset:1,opacity:`calc(var(--backdrop-opacity) * ${Z(b,e)})`}]),M&&M.keyframes([{offset:0,maxHeight:100*(1-d)+"%"},{offset:1,maxHeight:100*b+"%"}]),r.progressStep(0)),I.enable(!1),p?_(t,r):w||l(),!f||b!==n[n.length-1]&&s||(f.scrollY=!0),s||0!==b||$("stationary"),new Promise((t=>{r.onFinish((()=>{w?(s||$("stationary"),j&&C?g((()=>{j.keyframes([...m.WRAPPER_KEYFRAMES]),C.keyframes([...m.BACKDROP_KEYFRAMES]),null==M||M.keyframes([...m.CONTENT_KEYFRAMES]),r.progressStart(!0,1-b),u=b,c(u),u>e?T():O(),I.enable(!0),t()})):(I.enable(!0),t())):t()}),{oneTimeCallback:!0}).progressEnd(1,0,h?500:0)}))},I=H({el:i,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:t=>{const o=h(t.event.target);if(u=d(),!s&&o)return 0===(p(o)?v(o).querySelector(".inner-scroll"):o).scrollTop;if(1===u&&o){const t=p(o)?v(o).querySelector(".inner-scroll"):o;return!o.querySelector("ion-refresher")&&0===t.scrollTop}return!0},onStart:o=>{if(k=void 0!==t.canDismiss&&!0!==t.canDismiss&&0===S,!s){const t=h(o.event.target);y=t&&p(t)?v(t).querySelector(".inner-scroll"):t}s||$("moving"),o.deltaY>0&&f&&(f.scrollY=!1),g((()=>{t.focus()})),r.progressStart(!0,1-u)},onMove:t=>{if(s||null===B||null===D||(t.currentY>=B&&"moving"===D?$("stationary"):t.currentY<B&&"stationary"===D&&$("moving")),!s&&t.deltaY<=0&&y)return;t.deltaY>0&&f&&(f.scrollY=!1);const o=n.length>1?1-n[1]:void 0,i=1-u+t.deltaY/b,a=void 0!==o&&i>=o&&k,e=a?.95:.9999,d=a&&void 0!==o?o+X((i-o)/(e-o)):i;w=x(1e-4,d,e),r.progressStep(w)},onEnd:t=>{if(!s&&t.deltaY<=0&&y&&y.scrollTop>0)return void $("stationary");const o=u-(t.deltaY+350*t.velocityY)/b,i=n.reduce(((t,i)=>Math.abs(i-o)<Math.abs(t-o)?i:t));P({breakpoint:i,breakpointOffset:w,canDismiss:k,animated:!0})}});return{gesture:I,moveSheetToBreakpoint:P}})(this.el,this.backdropEl,t,o,i,e,this.sortedBreakpoints,this.expandToScroll,(()=>{var t;return null!==(t=this.currentBreakpoint)&&void 0!==t?t:0}),(()=>this.sheetOnDismiss()),(t=>{this.currentBreakpoint!==t&&(this.currentBreakpoint=t,this.ionBreakpointDidChange.emit({breakpoint:t}))}));this.gesture=n,this.moveSheetToBreakpoint=s,this.gesture.enable(!0)}sheetOnDismiss(){this.gestureAnimationDismissing=!0,this.animation.onFinish((async()=>{this.currentBreakpoint=0,this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint}),await this.dismiss(void 0,D),this.gestureAnimationDismissing=!1}))}async dismiss(t,o){var i;if(this.gestureAnimationDismissing&&o!==D)return!1;const r=await this.lockController.lock();if("handler"!==o&&!await this.checkCanDismiss(t,o))return r(),!1;const{presentingElement:n}=this;void 0!==n&&"ios"===e(this)&&V(this.statusBarStyle),"undefined"!=typeof window&&this.keyboardOpenCallback&&(window.removeEventListener(z,this.keyboardOpenCallback),this.keyboardOpenCallback=void 0);const s=await O(this,t,o,"modalLeave",ot,at,{presentingEl:n,currentBreakpoint:null!==(i=this.currentBreakpoint)&&void 0!==i?i:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll});if(s){const{delegate:t}=this.getDelegate();await w(t,this.usersElement),a((()=>this.el.classList.remove("show-modal"))),this.animation&&this.animation.destroy(),this.gesture&&this.gesture.destroy()}return this.currentBreakpoint=void 0,this.animation=void 0,r(),s}onDidDismiss(){return $(this.el,"ionModalDidDismiss")}onWillDismiss(){return $(this.el,"ionModalWillDismiss")}async setCurrentBreakpoint(t){if(!this.isSheetModal)return void i("[ion-modal] - setCurrentBreakpoint is only supported on sheet modals.");if(!this.breakpoints.includes(t))return void i(`[ion-modal] - Attempted to set invalid breakpoint value ${t}. Please double check that the breakpoint value is part of your defined breakpoints.`);const{currentBreakpoint:o,moveSheetToBreakpoint:a,canDismiss:e,breakpoints:r,animated:n}=this;o!==t&&a&&(this.sheetTransition=a({breakpoint:t,breakpointOffset:1-o,canDismiss:void 0!==e&&!0!==e&&0===r[0],animated:n}),await this.sheetTransition,this.sheetTransition=void 0)}async getCurrentBreakpoint(){return this.currentBreakpoint}async moveToNextBreakpoint(){const{breakpoints:t,currentBreakpoint:o}=this;if(!t||null==o)return!1;const i=t.filter((t=>0!==t)),a=i.indexOf(o),e=i[(a+1)%i.length];return await this.setCurrentBreakpoint(e),!0}render(){const{handle:t,isSheetModal:o,presentingElement:i,htmlAttributes:a,handleBehavior:r,inheritedAttributes:d,focusTrap:h,expandToScroll:p}=this,l=!1!==t&&o,c=e(this),m=void 0!==i&&"ios"===c,f="cycle"===r;return n(s,Object.assign({key:"8add05bb43a2cdb5e3cf180147d31eb85a018fe0","no-router":!0,tabIndex:f&&o&&l?0:-1},a,{style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign({[c]:!0,"modal-default":!m&&!o,"modal-card":m,"modal-sheet":o,"modal-no-expand-scroll":o&&!p,"overlay-hidden":!0,[E]:!1===h},P(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle,onFocus:this.onModalFocus}),n("ion-backdrop",{key:"90a6605a9564a699d6f66cf71cf6b506796a2963",ref:t=>this.backdropEl=t,visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),"ios"===c&&n("div",{key:"a97d071395333bf803c0a9347bda000cf7500d8d",class:"modal-shadow"}),n("div",Object.assign({key:"e7b7985c7414a13e3ba8dcecf497b76e92edf53e",role:"dialog"},d,{"aria-modal":"true",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:t=>this.wrapperEl=t}),l&&n("button",{key:"8258b65570b11a8ee9c9df2537d6419cd2e34536",class:"modal-handle",tabIndex:f?0:-1,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:f?this.onHandleClick:void 0,part:"handle",ref:t=>this.dragHandleEl=t}),n("slot",{key:"394370d0ed03ee03152f8f8abae7ff7664ca5c13"})))}get el(){return d(this)}static get watchers(){return{isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}}},rt={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};et.style={ios:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}',md:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}'};export{et as ion_modal}
|