@ionic/core 8.6.3-dev.11750971489.140836b0 → 8.6.3-dev.11751315648.1da06a67
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 +208 -8
- package/dist/cjs/ion-modal.cjs.entry.js +208 -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 +140 -0
- package/dist/collection/components/modal/modal.js +78 -4
- package/dist/docs.json +1 -1
- package/dist/esm/ion-modal.entry.js +208 -8
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-262429fb.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 +208 -8
- package/hydrate/index.mjs +208 -8
- package/package.json +3 -3
- 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,141 @@ 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().beforeStyles({
|
|
21390
|
+
transform: 'translateY(0)',
|
|
21391
|
+
'transform-origin': 'top center',
|
|
21392
|
+
overflow: 'hidden',
|
|
21393
|
+
});
|
|
21394
|
+
if (!hasCardModal) {
|
|
21395
|
+
// Non-card modal: transition from portrait state to landscape state
|
|
21396
|
+
// Portrait: presentingEl has transform and body has black background
|
|
21397
|
+
// Landscape: no transform, no body background, modal wrapper opacity changes
|
|
21398
|
+
const root = getElementRoot(baseEl);
|
|
21399
|
+
const wrapperAnimation = createAnimation()
|
|
21400
|
+
.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow'))
|
|
21401
|
+
.fromTo('opacity', '1', '1'); // Keep wrapper visible in landscape
|
|
21402
|
+
const backdropAnimation = createAnimation()
|
|
21403
|
+
.addElement(root.querySelector('ion-backdrop'))
|
|
21404
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 'var(--backdrop-opacity)'); // Keep backdrop visible
|
|
21405
|
+
// Animate presentingEl from portrait state back to normal
|
|
21406
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
21407
|
+
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
21408
|
+
const fromTransform = `translateY(${transformOffset}) scale(${toPresentingScale})`;
|
|
21409
|
+
presentingAnimation
|
|
21410
|
+
.addElement(presentingEl)
|
|
21411
|
+
.afterStyles({
|
|
21412
|
+
transform: 'translateY(0px) scale(1)',
|
|
21413
|
+
'border-radius': '0px',
|
|
21414
|
+
})
|
|
21415
|
+
.beforeAddWrite(() => bodyEl.style.setProperty('background-color', ''))
|
|
21416
|
+
.fromTo('transform', fromTransform, 'translateY(0px) scale(1)')
|
|
21417
|
+
.fromTo('filter', 'contrast(0.85)', 'contrast(1)')
|
|
21418
|
+
.fromTo('border-radius', '10px 10px 0 0', '0px');
|
|
21419
|
+
baseAnimation.addAnimation([presentingAnimation, wrapperAnimation, backdropAnimation]);
|
|
21420
|
+
}
|
|
21421
|
+
else {
|
|
21422
|
+
// Card modal: transition from portrait card state to landscape card state
|
|
21423
|
+
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
21424
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
21425
|
+
const fromTransform = `translateY(${transformOffset}) scale(${toPresentingScale})`;
|
|
21426
|
+
const toTransform = `translateY(-10px) scale(${toPresentingScale})`;
|
|
21427
|
+
presentingAnimation
|
|
21428
|
+
.addElement(presentingElRoot.querySelector('.modal-wrapper'))
|
|
21429
|
+
.fromTo('transform', fromTransform, toTransform)
|
|
21430
|
+
.fromTo('filter', 'contrast(0.85)', 'contrast(0.85)'); // Keep same contrast for card
|
|
21431
|
+
const shadowAnimation = createAnimation()
|
|
21432
|
+
.addElement(presentingElRoot.querySelector('.modal-shadow'))
|
|
21433
|
+
.fromTo('opacity', '0', '0') // Shadow stays hidden in landscape for card modals
|
|
21434
|
+
.fromTo('transform', fromTransform, toTransform);
|
|
21435
|
+
baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);
|
|
21436
|
+
}
|
|
21437
|
+
return baseAnimation;
|
|
21438
|
+
};
|
|
21439
|
+
/**
|
|
21440
|
+
* Transition animation from landscape view to portrait view
|
|
21441
|
+
* This handles the case where a card modal is open in landscape view
|
|
21442
|
+
* and the user switches to portrait view
|
|
21443
|
+
*/
|
|
21444
|
+
const landscapeToPortraitTransition = (baseEl, opts, duration = 300) => {
|
|
21445
|
+
const { presentingEl } = opts;
|
|
21446
|
+
if (!presentingEl) {
|
|
21447
|
+
// No transition needed for non-card modals
|
|
21448
|
+
return createAnimation('landscape-to-portrait-transition');
|
|
21449
|
+
}
|
|
21450
|
+
const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
|
|
21451
|
+
const presentingElRoot = getElementRoot(presentingEl);
|
|
21452
|
+
const bodyEl = document.body;
|
|
21453
|
+
const baseAnimation = createAnimation('landscape-to-portrait-transition')
|
|
21454
|
+
.addElement(baseEl)
|
|
21455
|
+
.easing('cubic-bezier(0.32,0.72,0,1)')
|
|
21456
|
+
.duration(duration);
|
|
21457
|
+
const presentingAnimation = createAnimation().beforeStyles({
|
|
21458
|
+
transform: 'translateY(0)',
|
|
21459
|
+
'transform-origin': 'top center',
|
|
21460
|
+
overflow: 'hidden',
|
|
21461
|
+
});
|
|
21462
|
+
if (!hasCardModal) {
|
|
21463
|
+
// Non-card modal: transition from landscape state to portrait state
|
|
21464
|
+
const root = getElementRoot(baseEl);
|
|
21465
|
+
const wrapperAnimation = createAnimation()
|
|
21466
|
+
.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow'))
|
|
21467
|
+
.fromTo('opacity', '1', '1'); // Keep wrapper visible
|
|
21468
|
+
const backdropAnimation = createAnimation()
|
|
21469
|
+
.addElement(root.querySelector('ion-backdrop'))
|
|
21470
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 'var(--backdrop-opacity)'); // Keep backdrop visible
|
|
21471
|
+
// Animate presentingEl from normal state to portrait state
|
|
21472
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
21473
|
+
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
21474
|
+
const toTransform = `translateY(${transformOffset}) scale(${toPresentingScale})`;
|
|
21475
|
+
presentingAnimation
|
|
21476
|
+
.addElement(presentingEl)
|
|
21477
|
+
.afterStyles({
|
|
21478
|
+
transform: toTransform,
|
|
21479
|
+
'border-radius': '10px 10px 0 0',
|
|
21480
|
+
})
|
|
21481
|
+
.beforeAddWrite(() => bodyEl.style.setProperty('background-color', 'black'))
|
|
21482
|
+
.fromTo('transform', 'translateY(0px) scale(1)', toTransform)
|
|
21483
|
+
.fromTo('filter', 'contrast(1)', 'contrast(0.85)')
|
|
21484
|
+
.fromTo('border-radius', '0px', '10px 10px 0 0');
|
|
21485
|
+
baseAnimation.addAnimation([presentingAnimation, wrapperAnimation, backdropAnimation]);
|
|
21486
|
+
}
|
|
21487
|
+
else {
|
|
21488
|
+
// Card modal: transition from landscape card state to portrait card state
|
|
21489
|
+
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
21490
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
21491
|
+
const fromTransform = `translateY(-10px) scale(${toPresentingScale})`;
|
|
21492
|
+
const toTransform = `translateY(${transformOffset}) scale(${toPresentingScale})`;
|
|
21493
|
+
presentingAnimation
|
|
21494
|
+
.addElement(presentingElRoot.querySelector('.modal-wrapper'))
|
|
21495
|
+
.fromTo('transform', fromTransform, toTransform)
|
|
21496
|
+
.fromTo('filter', 'contrast(0.85)', 'contrast(0.85)'); // Keep same contrast for card
|
|
21497
|
+
const shadowAnimation = createAnimation()
|
|
21498
|
+
.addElement(presentingElRoot.querySelector('.modal-shadow'))
|
|
21499
|
+
.fromTo('opacity', '0', '0') // Shadow stays hidden
|
|
21500
|
+
.fromTo('transform', fromTransform, toTransform);
|
|
21501
|
+
baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);
|
|
21502
|
+
}
|
|
21503
|
+
return baseAnimation;
|
|
21504
|
+
};
|
|
21505
|
+
|
|
21371
21506
|
const createEnterAnimation = () => {
|
|
21372
21507
|
const backdropAnimation = createAnimation()
|
|
21373
21508
|
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
|
@@ -22159,6 +22294,7 @@ class Modal {
|
|
|
22159
22294
|
}
|
|
22160
22295
|
disconnectedCallback() {
|
|
22161
22296
|
this.triggerController.removeClickListener();
|
|
22297
|
+
this.cleanupViewTransitionListener();
|
|
22162
22298
|
}
|
|
22163
22299
|
componentWillLoad() {
|
|
22164
22300
|
var _a;
|
|
@@ -22369,6 +22505,8 @@ class Modal {
|
|
|
22369
22505
|
else if (hasCardModal) {
|
|
22370
22506
|
this.initSwipeToClose();
|
|
22371
22507
|
}
|
|
22508
|
+
// Initialize view transition listener for iOS card modals
|
|
22509
|
+
this.initViewTransitionListener();
|
|
22372
22510
|
unlock();
|
|
22373
22511
|
}
|
|
22374
22512
|
initSwipeToClose() {
|
|
@@ -22522,6 +22660,7 @@ class Modal {
|
|
|
22522
22660
|
if (this.gesture) {
|
|
22523
22661
|
this.gesture.destroy();
|
|
22524
22662
|
}
|
|
22663
|
+
this.cleanupViewTransitionListener();
|
|
22525
22664
|
}
|
|
22526
22665
|
this.currentBreakpoint = undefined;
|
|
22527
22666
|
this.animation = undefined;
|
|
@@ -22597,6 +22736,67 @@ class Modal {
|
|
|
22597
22736
|
await this.setCurrentBreakpoint(nextBreakpoint);
|
|
22598
22737
|
return true;
|
|
22599
22738
|
}
|
|
22739
|
+
initViewTransitionListener() {
|
|
22740
|
+
// Only enable for iOS card modals when no custom animations are provided
|
|
22741
|
+
if (getIonMode$1(this) !== 'ios' || !this.presentingElement || this.enterAnimation || this.leaveAnimation) {
|
|
22742
|
+
return;
|
|
22743
|
+
}
|
|
22744
|
+
// Set initial view state
|
|
22745
|
+
this.currentViewIsPortrait = window.innerWidth < 768;
|
|
22746
|
+
// Create debounced resize handler
|
|
22747
|
+
let resizeTimeout;
|
|
22748
|
+
this.resizeListener = () => {
|
|
22749
|
+
clearTimeout(resizeTimeout);
|
|
22750
|
+
resizeTimeout = setTimeout(() => {
|
|
22751
|
+
this.handleViewTransition();
|
|
22752
|
+
}, 100); // Debounce for 100ms to avoid excessive calls
|
|
22753
|
+
};
|
|
22754
|
+
window.addEventListener('resize', this.resizeListener);
|
|
22755
|
+
}
|
|
22756
|
+
handleViewTransition() {
|
|
22757
|
+
const isPortrait = window.innerWidth < 768;
|
|
22758
|
+
// Only transition if view state actually changed
|
|
22759
|
+
if (this.currentViewIsPortrait === isPortrait) {
|
|
22760
|
+
return;
|
|
22761
|
+
}
|
|
22762
|
+
// Cancel any ongoing transition animation
|
|
22763
|
+
if (this.viewTransitionAnimation) {
|
|
22764
|
+
this.viewTransitionAnimation.destroy();
|
|
22765
|
+
this.viewTransitionAnimation = undefined;
|
|
22766
|
+
}
|
|
22767
|
+
const { presentingElement } = this;
|
|
22768
|
+
if (!presentingElement) {
|
|
22769
|
+
return;
|
|
22770
|
+
}
|
|
22771
|
+
// Create transition animation
|
|
22772
|
+
let transitionAnimation;
|
|
22773
|
+
if (this.currentViewIsPortrait && !isPortrait) {
|
|
22774
|
+
// Portrait to landscape transition
|
|
22775
|
+
transitionAnimation = portraitToLandscapeTransition(this.el, {
|
|
22776
|
+
presentingEl: presentingElement});
|
|
22777
|
+
}
|
|
22778
|
+
else {
|
|
22779
|
+
// Landscape to portrait transition
|
|
22780
|
+
transitionAnimation = landscapeToPortraitTransition(this.el, {
|
|
22781
|
+
presentingEl: presentingElement});
|
|
22782
|
+
}
|
|
22783
|
+
// Update state and play animation
|
|
22784
|
+
this.currentViewIsPortrait = isPortrait;
|
|
22785
|
+
this.viewTransitionAnimation = transitionAnimation;
|
|
22786
|
+
transitionAnimation.play().then(() => {
|
|
22787
|
+
this.viewTransitionAnimation = undefined;
|
|
22788
|
+
});
|
|
22789
|
+
}
|
|
22790
|
+
cleanupViewTransitionListener() {
|
|
22791
|
+
if (this.resizeListener) {
|
|
22792
|
+
window.removeEventListener('resize', this.resizeListener);
|
|
22793
|
+
this.resizeListener = undefined;
|
|
22794
|
+
}
|
|
22795
|
+
if (this.viewTransitionAnimation) {
|
|
22796
|
+
this.viewTransitionAnimation.destroy();
|
|
22797
|
+
this.viewTransitionAnimation = undefined;
|
|
22798
|
+
}
|
|
22799
|
+
}
|
|
22600
22800
|
render() {
|
|
22601
22801
|
const { handle, isSheetModal, presentingElement, htmlAttributes, handleBehavior, inheritedAttributes, focusTrap, expandToScroll, } = this;
|
|
22602
22802
|
const showHandle = handle !== false && isSheetModal;
|
|
@@ -22604,20 +22804,20 @@ class Modal {
|
|
|
22604
22804
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
22605
22805
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
22606
22806
|
const isSheetModalWithHandle = isSheetModal && showHandle;
|
|
22607
|
-
return (hAsync(Host, Object.assign({ key: '
|
|
22807
|
+
return (hAsync(Host, Object.assign({ key: 'd5bcaa588471573e1bcbd99997b306c8ecdd124f', "no-router": true,
|
|
22608
22808
|
// Allow the modal to be navigable when the handle is focusable
|
|
22609
22809
|
tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
|
|
22610
22810
|
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: '
|
|
22811
|
+
}, 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
22812
|
/*
|
|
22613
22813
|
role and aria-modal must be used on the
|
|
22614
22814
|
same element. They must also be set inside the
|
|
22615
22815
|
shadow DOM otherwise ion-button will not be highlighted
|
|
22616
22816
|
when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
|
|
22617
22817
|
*/
|
|
22618
|
-
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: '
|
|
22818
|
+
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
22819
|
// 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: '
|
|
22820
|
+
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
22821
|
}
|
|
22622
22822
|
get el() { return getElement(this); }
|
|
22623
22823
|
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.11751315648.1da06a67",
|
|
4
4
|
"description": "Base components for Ionic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ionic",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"@clack/prompts": "^0.11.0",
|
|
45
45
|
"@ionic/eslint-config": "^0.3.0",
|
|
46
46
|
"@ionic/prettier-config": "^2.0.0",
|
|
47
|
-
"@playwright/test": "^1.
|
|
47
|
+
"@playwright/test": "^1.53.2",
|
|
48
48
|
"@rollup/plugin-node-resolve": "^8.4.0",
|
|
49
49
|
"@rollup/plugin-virtual": "^2.0.3",
|
|
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}
|