@ionic/core 8.6.3-dev.11750799190.186437ae → 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/action-sheet.js +8 -9
- package/components/alert.js +7 -8
- package/components/ion-app.js +3 -1
- package/components/ion-datetime.js +8 -2
- package/components/ion-loading.js +7 -8
- package/components/ion-menu.js +27 -5
- package/components/ion-reorder-group.js +1 -2
- package/components/ion-router.js +1 -0
- package/components/ion-searchbar.js +4 -6
- package/components/ion-toast.js +6 -7
- package/components/modal.js +213 -15
- package/components/popover.js +8 -7
- package/dist/cjs/ion-action-sheet.cjs.entry.js +8 -9
- package/dist/cjs/ion-alert.cjs.entry.js +7 -8
- package/dist/cjs/ion-app_8.cjs.entry.js +3 -1
- package/dist/cjs/ion-datetime_3.cjs.entry.js +8 -2
- package/dist/cjs/ion-loading.cjs.entry.js +7 -8
- package/dist/cjs/ion-menu_3.cjs.entry.js +27 -5
- package/dist/cjs/ion-modal.cjs.entry.js +213 -15
- package/dist/cjs/ion-popover.cjs.entry.js +8 -7
- package/dist/cjs/ion-reorder_2.cjs.entry.js +1 -2
- package/dist/cjs/ion-route_4.cjs.entry.js +1 -0
- package/dist/cjs/ion-searchbar.cjs.entry.js +4 -6
- package/dist/cjs/ion-toast.cjs.entry.js +6 -7
- package/dist/collection/components/action-sheet/action-sheet.js +11 -12
- package/dist/collection/components/alert/alert.js +10 -11
- package/dist/collection/components/app/app.js +8 -3
- package/dist/collection/components/datetime/datetime.js +23 -8
- package/dist/collection/components/loading/loading.js +10 -11
- package/dist/collection/components/menu/menu.js +62 -19
- 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 +108 -17
- package/dist/collection/components/popover/popover.js +18 -14
- package/dist/collection/components/reorder-group/reorder-group.js +2 -3
- package/dist/collection/components/router/router.js +5 -1
- package/dist/collection/components/searchbar/searchbar.js +5 -7
- package/dist/collection/components/toast/toast.js +9 -10
- package/dist/docs.json +138 -72
- package/dist/esm/ion-action-sheet.entry.js +8 -9
- package/dist/esm/ion-alert.entry.js +7 -8
- package/dist/esm/ion-app_8.entry.js +3 -1
- package/dist/esm/ion-datetime_3.entry.js +8 -2
- package/dist/esm/ion-loading.entry.js +7 -8
- package/dist/esm/ion-menu_3.entry.js +27 -5
- package/dist/esm/ion-modal.entry.js +213 -15
- package/dist/esm/ion-popover.entry.js +8 -7
- package/dist/esm/ion-reorder_2.entry.js +1 -2
- package/dist/esm/ion-route_4.entry.js +1 -0
- package/dist/esm/ion-searchbar.entry.js +4 -6
- package/dist/esm/ion-toast.entry.js +6 -7
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-96389029.entry.js → p-01123ecf.entry.js} +1 -1
- package/dist/ionic/{p-cb787a4b.entry.js → p-03d21728.entry.js} +1 -1
- package/dist/ionic/{p-9e699d4a.entry.js → p-0d131a02.entry.js} +1 -1
- package/dist/ionic/p-0df5b2a5.entry.js +4 -0
- package/dist/ionic/{p-6b666996.entry.js → p-2d0eccfb.entry.js} +1 -1
- package/dist/ionic/{p-ead42a37.entry.js → p-5f671887.entry.js} +1 -1
- package/dist/ionic/p-69f91268.entry.js +4 -0
- package/dist/ionic/{p-2020aa51.entry.js → p-b758a177.entry.js} +1 -1
- package/dist/ionic/p-b9ba04ca.entry.js +4 -0
- package/dist/ionic/{p-cd12ed1c.entry.js → p-d8429eb4.entry.js} +1 -1
- package/dist/ionic/{p-3a4feac2.entry.js → p-e37d6c67.entry.js} +1 -1
- package/dist/types/components/action-sheet/action-sheet.d.ts +5 -6
- package/dist/types/components/alert/alert.d.ts +5 -6
- package/dist/types/components/app/app.d.ts +2 -0
- package/dist/types/components/datetime/datetime.d.ts +6 -0
- package/dist/types/components/loading/loading.d.ts +5 -6
- package/dist/types/components/menu/menu.d.ts +25 -3
- package/dist/types/components/modal/animations/ios.transition.d.ts +14 -0
- package/dist/types/components/modal/modal.d.ts +20 -6
- package/dist/types/components/popover/popover.d.ts +6 -5
- package/dist/types/components/reorder-group/reorder-group.d.ts +0 -1
- package/dist/types/components/router/router.d.ts +1 -0
- package/dist/types/components/searchbar/searchbar.d.ts +0 -2
- package/dist/types/components/toast/toast.d.ts +4 -5
- package/dist/types/components.d.ts +32 -18
- package/hydrate/index.js +293 -70
- package/hydrate/index.mjs +293 -70
- package/package.json +2 -2
- package/dist/ionic/p-6dd2e493.entry.js +0 -4
- package/dist/ionic/p-7149db7e.entry.js +0 -4
- package/dist/ionic/p-bec79123.entry.js +0 -4
package/components/modal.js
CHANGED
|
@@ -587,7 +587,7 @@ const iosEnterAnimation = (baseEl, opts) => {
|
|
|
587
587
|
baseAnimation.addAnimation(contentAnimation);
|
|
588
588
|
}
|
|
589
589
|
if (presentingEl) {
|
|
590
|
-
const
|
|
590
|
+
const isPortrait = window.innerWidth < 768;
|
|
591
591
|
const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
|
|
592
592
|
const presentingElRoot = getElementRoot(presentingEl);
|
|
593
593
|
const presentingAnimation = createAnimation().beforeStyles({
|
|
@@ -596,7 +596,7 @@ const iosEnterAnimation = (baseEl, opts) => {
|
|
|
596
596
|
overflow: 'hidden',
|
|
597
597
|
});
|
|
598
598
|
const bodyEl = document.body;
|
|
599
|
-
if (
|
|
599
|
+
if (isPortrait) {
|
|
600
600
|
/**
|
|
601
601
|
* Fallback for browsers that does not support `max()` (ex: Firefox)
|
|
602
602
|
* No need to worry about statusbar padding since engines like Gecko
|
|
@@ -674,7 +674,7 @@ const iosLeaveAnimation = (baseEl, opts, duration = 500) => {
|
|
|
674
674
|
.duration(duration)
|
|
675
675
|
.addAnimation(wrapperAnimation);
|
|
676
676
|
if (presentingEl) {
|
|
677
|
-
const
|
|
677
|
+
const isPortrait = window.innerWidth < 768;
|
|
678
678
|
const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
|
|
679
679
|
const presentingElRoot = getElementRoot(presentingEl);
|
|
680
680
|
const presentingAnimation = createAnimation()
|
|
@@ -692,7 +692,7 @@ const iosLeaveAnimation = (baseEl, opts, duration = 500) => {
|
|
|
692
692
|
}
|
|
693
693
|
});
|
|
694
694
|
const bodyEl = document.body;
|
|
695
|
-
if (
|
|
695
|
+
if (isPortrait) {
|
|
696
696
|
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
697
697
|
const modalTransform = hasCardModal ? '-10px' : transformOffset;
|
|
698
698
|
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
@@ -739,6 +739,125 @@ const iosLeaveAnimation = (baseEl, opts, duration = 500) => {
|
|
|
739
739
|
return baseAnimation;
|
|
740
740
|
};
|
|
741
741
|
|
|
742
|
+
/**
|
|
743
|
+
* Transition animation from portrait view to landscape view
|
|
744
|
+
* This handles the case where a card modal is open in portrait view
|
|
745
|
+
* and the user switches to landscape view
|
|
746
|
+
*/
|
|
747
|
+
const portraitToLandscapeTransition = (baseEl, opts, duration = 300) => {
|
|
748
|
+
const { presentingEl } = opts;
|
|
749
|
+
if (!presentingEl) {
|
|
750
|
+
// No transition needed for non-card modals
|
|
751
|
+
return createAnimation('portrait-to-landscape-transition');
|
|
752
|
+
}
|
|
753
|
+
const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
|
|
754
|
+
const presentingElRoot = getElementRoot(presentingEl);
|
|
755
|
+
const bodyEl = document.body;
|
|
756
|
+
const baseAnimation = createAnimation('portrait-to-landscape-transition')
|
|
757
|
+
.addElement(baseEl)
|
|
758
|
+
.easing('cubic-bezier(0.32,0.72,0,1)')
|
|
759
|
+
.duration(duration);
|
|
760
|
+
const presentingAnimation = createAnimation();
|
|
761
|
+
if (!hasCardModal) {
|
|
762
|
+
// Non-card modal: transition from portrait state to landscape state
|
|
763
|
+
// Portrait: presentingEl has transform and body has black background
|
|
764
|
+
// Landscape: no transform, no body background, modal wrapper opacity changes
|
|
765
|
+
const root = getElementRoot(baseEl);
|
|
766
|
+
const wrapperAnimation = createAnimation()
|
|
767
|
+
.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow'))
|
|
768
|
+
.fromTo('opacity', '1', '1'); // Keep wrapper visible in landscape
|
|
769
|
+
const backdropAnimation = createAnimation()
|
|
770
|
+
.addElement(root.querySelector('ion-backdrop'))
|
|
771
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 'var(--backdrop-opacity)'); // Keep backdrop visible
|
|
772
|
+
// Animate presentingEl from portrait state back to normal
|
|
773
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
774
|
+
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
775
|
+
const fromTransform = `translateY(${transformOffset}) scale(${toPresentingScale})`;
|
|
776
|
+
presentingAnimation
|
|
777
|
+
.addElement(presentingEl)
|
|
778
|
+
.beforeAddWrite(() => bodyEl.style.setProperty('background-color', ''))
|
|
779
|
+
.fromTo('transform', fromTransform, 'translateY(0px) scale(1)')
|
|
780
|
+
.fromTo('filter', 'contrast(0.85)', 'contrast(1)')
|
|
781
|
+
.fromTo('border-radius', '10px 10px 0 0', '0px');
|
|
782
|
+
baseAnimation.addAnimation([presentingAnimation, wrapperAnimation, backdropAnimation]);
|
|
783
|
+
}
|
|
784
|
+
else {
|
|
785
|
+
// Card modal: transition from portrait card state to landscape card state
|
|
786
|
+
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
787
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
788
|
+
const fromTransform = `translateY(${transformOffset}) scale(${toPresentingScale})`;
|
|
789
|
+
const toTransform = `translateY(-10px) scale(${toPresentingScale})`;
|
|
790
|
+
presentingAnimation
|
|
791
|
+
.addElement(presentingElRoot.querySelector('.modal-wrapper'))
|
|
792
|
+
.fromTo('transform', fromTransform, toTransform)
|
|
793
|
+
.fromTo('filter', 'contrast(0.85)', 'contrast(0.85)'); // Keep same contrast for card
|
|
794
|
+
const shadowAnimation = createAnimation()
|
|
795
|
+
.addElement(presentingElRoot.querySelector('.modal-shadow'))
|
|
796
|
+
.fromTo('opacity', '0', '0') // Shadow stays hidden in landscape for card modals
|
|
797
|
+
.fromTo('transform', fromTransform, toTransform);
|
|
798
|
+
baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);
|
|
799
|
+
}
|
|
800
|
+
return baseAnimation;
|
|
801
|
+
};
|
|
802
|
+
/**
|
|
803
|
+
* Transition animation from landscape view to portrait view
|
|
804
|
+
* This handles the case where a card modal is open in landscape view
|
|
805
|
+
* and the user switches to portrait view
|
|
806
|
+
*/
|
|
807
|
+
const landscapeToPortraitTransition = (baseEl, opts, duration = 300) => {
|
|
808
|
+
const { presentingEl } = opts;
|
|
809
|
+
if (!presentingEl) {
|
|
810
|
+
// No transition needed for non-card modals
|
|
811
|
+
return createAnimation('landscape-to-portrait-transition');
|
|
812
|
+
}
|
|
813
|
+
const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
|
|
814
|
+
const presentingElRoot = getElementRoot(presentingEl);
|
|
815
|
+
const bodyEl = document.body;
|
|
816
|
+
const baseAnimation = createAnimation('landscape-to-portrait-transition')
|
|
817
|
+
.addElement(baseEl)
|
|
818
|
+
.easing('cubic-bezier(0.32,0.72,0,1)')
|
|
819
|
+
.duration(duration);
|
|
820
|
+
const presentingAnimation = createAnimation();
|
|
821
|
+
if (!hasCardModal) {
|
|
822
|
+
// Non-card modal: transition from landscape state to portrait state
|
|
823
|
+
const root = getElementRoot(baseEl);
|
|
824
|
+
const wrapperAnimation = createAnimation()
|
|
825
|
+
.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow'))
|
|
826
|
+
.fromTo('opacity', '1', '1'); // Keep wrapper visible
|
|
827
|
+
const backdropAnimation = createAnimation()
|
|
828
|
+
.addElement(root.querySelector('ion-backdrop'))
|
|
829
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 'var(--backdrop-opacity)'); // Keep backdrop visible
|
|
830
|
+
// Animate presentingEl from normal state to portrait state
|
|
831
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
832
|
+
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
833
|
+
const toTransform = `translateY(${transformOffset}) scale(${toPresentingScale})`;
|
|
834
|
+
presentingAnimation
|
|
835
|
+
.addElement(presentingEl)
|
|
836
|
+
.beforeAddWrite(() => bodyEl.style.setProperty('background-color', 'black'))
|
|
837
|
+
.fromTo('transform', 'translateY(0px) scale(1)', toTransform)
|
|
838
|
+
.fromTo('filter', 'contrast(1)', 'contrast(0.85)')
|
|
839
|
+
.fromTo('border-radius', '0px', '10px 10px 0 0');
|
|
840
|
+
baseAnimation.addAnimation([presentingAnimation, wrapperAnimation, backdropAnimation]);
|
|
841
|
+
}
|
|
842
|
+
else {
|
|
843
|
+
// Card modal: transition from landscape card state to portrait card state
|
|
844
|
+
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
|
845
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
|
846
|
+
const fromTransform = `translateY(-10px) scale(${toPresentingScale})`;
|
|
847
|
+
const toTransform = `translateY(${transformOffset}) scale(${toPresentingScale})`;
|
|
848
|
+
presentingAnimation
|
|
849
|
+
.addElement(presentingElRoot.querySelector('.modal-wrapper'))
|
|
850
|
+
.fromTo('transform', fromTransform, toTransform)
|
|
851
|
+
.fromTo('filter', 'contrast(0.85)', 'contrast(0.85)'); // Keep same contrast for card
|
|
852
|
+
const shadowAnimation = createAnimation()
|
|
853
|
+
.addElement(presentingElRoot.querySelector('.modal-shadow'))
|
|
854
|
+
.fromTo('opacity', '0', '0') // Shadow stays hidden
|
|
855
|
+
.fromTo('transform', fromTransform, toTransform);
|
|
856
|
+
baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);
|
|
857
|
+
}
|
|
858
|
+
return baseAnimation;
|
|
859
|
+
};
|
|
860
|
+
|
|
742
861
|
const createEnterAnimation = () => {
|
|
743
862
|
const backdropAnimation = createAnimation()
|
|
744
863
|
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
|
@@ -1484,6 +1603,17 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
|
|
|
1484
1603
|
el.dispatchEvent(ev);
|
|
1485
1604
|
}
|
|
1486
1605
|
};
|
|
1606
|
+
/**
|
|
1607
|
+
* When the modal receives focus directly, pass focus to the handle
|
|
1608
|
+
* if it exists and is focusable, otherwise let the focus trap handle it.
|
|
1609
|
+
*/
|
|
1610
|
+
this.onModalFocus = (ev) => {
|
|
1611
|
+
const { dragHandleEl, el } = this;
|
|
1612
|
+
// Only handle focus if the modal itself was focused (not a child element)
|
|
1613
|
+
if (ev.target === el && dragHandleEl && dragHandleEl.tabIndex !== -1) {
|
|
1614
|
+
dragHandleEl.focus();
|
|
1615
|
+
}
|
|
1616
|
+
};
|
|
1487
1617
|
}
|
|
1488
1618
|
onIsOpenChange(newValue, oldValue) {
|
|
1489
1619
|
if (newValue === true && oldValue === false) {
|
|
@@ -1511,6 +1641,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
|
|
|
1511
1641
|
}
|
|
1512
1642
|
disconnectedCallback() {
|
|
1513
1643
|
this.triggerController.removeClickListener();
|
|
1644
|
+
this.cleanupViewTransitionListener();
|
|
1514
1645
|
}
|
|
1515
1646
|
componentWillLoad() {
|
|
1516
1647
|
var _a;
|
|
@@ -1721,6 +1852,8 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
|
|
|
1721
1852
|
else if (hasCardModal) {
|
|
1722
1853
|
this.initSwipeToClose();
|
|
1723
1854
|
}
|
|
1855
|
+
// Initialize view transition listener for iOS card modals
|
|
1856
|
+
this.initViewTransitionListener();
|
|
1724
1857
|
unlock();
|
|
1725
1858
|
}
|
|
1726
1859
|
initSwipeToClose() {
|
|
@@ -1815,13 +1948,13 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
|
|
|
1815
1948
|
}
|
|
1816
1949
|
/**
|
|
1817
1950
|
* Dismiss the modal overlay after it has been presented.
|
|
1818
|
-
*
|
|
1819
|
-
* @param data Any data to emit in the dismiss events.
|
|
1820
|
-
* @param role The role of the element that is dismissing the modal. For example, 'cancel' or 'backdrop'.
|
|
1821
|
-
*
|
|
1822
1951
|
* This is a no-op if the overlay has not been presented yet. If you want
|
|
1823
1952
|
* to remove an overlay from the DOM that was never presented, use the
|
|
1824
1953
|
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
1954
|
+
*
|
|
1955
|
+
* @param data Any data to emit in the dismiss events.
|
|
1956
|
+
* @param role The role of the element that is dismissing the modal.
|
|
1957
|
+
* For example, `cancel` or `backdrop`.
|
|
1825
1958
|
*/
|
|
1826
1959
|
async dismiss(data, role) {
|
|
1827
1960
|
var _a;
|
|
@@ -1874,6 +2007,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
|
|
|
1874
2007
|
if (this.gesture) {
|
|
1875
2008
|
this.gesture.destroy();
|
|
1876
2009
|
}
|
|
2010
|
+
this.cleanupViewTransitionListener();
|
|
1877
2011
|
}
|
|
1878
2012
|
this.currentBreakpoint = undefined;
|
|
1879
2013
|
this.animation = undefined;
|
|
@@ -1893,8 +2027,10 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
|
|
|
1893
2027
|
return eventMethod(this.el, 'ionModalWillDismiss');
|
|
1894
2028
|
}
|
|
1895
2029
|
/**
|
|
1896
|
-
* Move a sheet style modal to a specific breakpoint.
|
|
1897
|
-
*
|
|
2030
|
+
* Move a sheet style modal to a specific breakpoint.
|
|
2031
|
+
*
|
|
2032
|
+
* @param breakpoint The breakpoint value to move the sheet modal to.
|
|
2033
|
+
* Must be a value defined in your `breakpoints` array.
|
|
1898
2034
|
*/
|
|
1899
2035
|
async setCurrentBreakpoint(breakpoint) {
|
|
1900
2036
|
if (!this.isSheetModal) {
|
|
@@ -1947,26 +2083,88 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
|
|
|
1947
2083
|
await this.setCurrentBreakpoint(nextBreakpoint);
|
|
1948
2084
|
return true;
|
|
1949
2085
|
}
|
|
2086
|
+
initViewTransitionListener() {
|
|
2087
|
+
// Only enable for iOS card modals when no custom animations are provided
|
|
2088
|
+
if (getIonMode(this) !== 'ios' || !this.presentingElement || this.enterAnimation || this.leaveAnimation) {
|
|
2089
|
+
return;
|
|
2090
|
+
}
|
|
2091
|
+
// Set initial view state
|
|
2092
|
+
this.currentViewIsPortrait = window.innerWidth < 768;
|
|
2093
|
+
// Create debounced resize handler
|
|
2094
|
+
let resizeTimeout;
|
|
2095
|
+
this.resizeListener = () => {
|
|
2096
|
+
clearTimeout(resizeTimeout);
|
|
2097
|
+
resizeTimeout = setTimeout(() => {
|
|
2098
|
+
this.handleViewTransition();
|
|
2099
|
+
}, 100); // Debounce for 100ms to avoid excessive calls
|
|
2100
|
+
};
|
|
2101
|
+
window.addEventListener('resize', this.resizeListener);
|
|
2102
|
+
}
|
|
2103
|
+
handleViewTransition() {
|
|
2104
|
+
const isPortrait = window.innerWidth < 768;
|
|
2105
|
+
// Only transition if view state actually changed
|
|
2106
|
+
if (this.currentViewIsPortrait === isPortrait) {
|
|
2107
|
+
return;
|
|
2108
|
+
}
|
|
2109
|
+
// Cancel any ongoing transition animation
|
|
2110
|
+
if (this.viewTransitionAnimation) {
|
|
2111
|
+
this.viewTransitionAnimation.destroy();
|
|
2112
|
+
this.viewTransitionAnimation = undefined;
|
|
2113
|
+
}
|
|
2114
|
+
const { presentingElement } = this;
|
|
2115
|
+
if (!presentingElement) {
|
|
2116
|
+
return;
|
|
2117
|
+
}
|
|
2118
|
+
// Create transition animation
|
|
2119
|
+
let transitionAnimation;
|
|
2120
|
+
if (this.currentViewIsPortrait && !isPortrait) {
|
|
2121
|
+
// Portrait to landscape transition
|
|
2122
|
+
transitionAnimation = portraitToLandscapeTransition(this.el, {
|
|
2123
|
+
presentingEl: presentingElement});
|
|
2124
|
+
}
|
|
2125
|
+
else {
|
|
2126
|
+
// Landscape to portrait transition
|
|
2127
|
+
transitionAnimation = landscapeToPortraitTransition(this.el, {
|
|
2128
|
+
presentingEl: presentingElement});
|
|
2129
|
+
}
|
|
2130
|
+
// Update state and play animation
|
|
2131
|
+
this.currentViewIsPortrait = isPortrait;
|
|
2132
|
+
this.viewTransitionAnimation = transitionAnimation;
|
|
2133
|
+
transitionAnimation.play().then(() => {
|
|
2134
|
+
this.viewTransitionAnimation = undefined;
|
|
2135
|
+
});
|
|
2136
|
+
}
|
|
2137
|
+
cleanupViewTransitionListener() {
|
|
2138
|
+
if (this.resizeListener) {
|
|
2139
|
+
window.removeEventListener('resize', this.resizeListener);
|
|
2140
|
+
this.resizeListener = undefined;
|
|
2141
|
+
}
|
|
2142
|
+
if (this.viewTransitionAnimation) {
|
|
2143
|
+
this.viewTransitionAnimation.destroy();
|
|
2144
|
+
this.viewTransitionAnimation = undefined;
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
1950
2147
|
render() {
|
|
1951
2148
|
const { handle, isSheetModal, presentingElement, htmlAttributes, handleBehavior, inheritedAttributes, focusTrap, expandToScroll, } = this;
|
|
1952
2149
|
const showHandle = handle !== false && isSheetModal;
|
|
1953
2150
|
const mode = getIonMode(this);
|
|
1954
2151
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
1955
2152
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
1956
|
-
|
|
2153
|
+
const isSheetModalWithHandle = isSheetModal && showHandle;
|
|
2154
|
+
return (h(Host, Object.assign({ key: 'd5bcaa588471573e1bcbd99997b306c8ecdd124f', "no-router": true,
|
|
1957
2155
|
// Allow the modal to be navigable when the handle is focusable
|
|
1958
|
-
tabIndex:
|
|
2156
|
+
tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
|
|
1959
2157
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
1960
|
-
}, 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 }), h("ion-backdrop", { key: '
|
|
2158
|
+
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), h("ion-backdrop", { key: '78b954a1c50a0325eb51db04314e86701c66d840', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && h("div", { key: '21887227c272f5eba1b3d164be3572bd710d415c', class: "modal-shadow" }), h("div", Object.assign({ key: 'a40472a9065c04ad12fb7b2b2a05e5021f077ad5',
|
|
1961
2159
|
/*
|
|
1962
2160
|
role and aria-modal must be used on the
|
|
1963
2161
|
same element. They must also be set inside the
|
|
1964
2162
|
shadow DOM otherwise ion-button will not be highlighted
|
|
1965
2163
|
when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
|
|
1966
2164
|
*/
|
|
1967
|
-
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { key: '
|
|
2165
|
+
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { key: 'a4973f66587546031d1cc0197e1ba7c2521a3fbc', class: "modal-handle",
|
|
1968
2166
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
1969
|
-
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), h("slot", { key: '
|
|
2167
|
+
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), h("slot", { key: 'ee5e007e3a4e592d98f1b5a5d31ad55e6faa3bdb' }))));
|
|
1970
2168
|
}
|
|
1971
2169
|
get el() { return this; }
|
|
1972
2170
|
static get watchers() { return {
|
package/components/popover.js
CHANGED
|
@@ -1263,6 +1263,8 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
|
|
|
1263
1263
|
* Developers can pass a mouse, touch, or pointer event
|
|
1264
1264
|
* to position the popover relative to where that event
|
|
1265
1265
|
* was dispatched.
|
|
1266
|
+
*
|
|
1267
|
+
* @param event The event to position the popover relative to.
|
|
1266
1268
|
*/
|
|
1267
1269
|
async present(event) {
|
|
1268
1270
|
const unlock = await this.lockController.lock();
|
|
@@ -1326,15 +1328,14 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
|
|
|
1326
1328
|
}
|
|
1327
1329
|
/**
|
|
1328
1330
|
* Dismiss the popover overlay after it has been presented.
|
|
1331
|
+
* This is a no-op if the overlay has not been presented yet. If you want
|
|
1332
|
+
* to remove an overlay from the DOM that was never presented, use the
|
|
1333
|
+
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
1329
1334
|
*
|
|
1330
1335
|
* @param data Any data to emit in the dismiss events.
|
|
1331
|
-
* @param role The role of the element that is dismissing the popover. For example,
|
|
1336
|
+
* @param role The role of the element that is dismissing the popover. For example, `cancel` or `backdrop`.
|
|
1332
1337
|
* @param dismissParentPopover If `true`, dismissing this popover will also dismiss
|
|
1333
1338
|
* a parent popover if this popover is nested. Defaults to `true`.
|
|
1334
|
-
*
|
|
1335
|
-
* This is a no-op if the overlay has not been presented yet. If you want
|
|
1336
|
-
* to remove an overlay from the DOM that was never presented, use the
|
|
1337
|
-
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
1338
1339
|
*/
|
|
1339
1340
|
async dismiss(data, role, dismissParentPopover = true) {
|
|
1340
1341
|
const unlock = await this.lockController.lock();
|
|
@@ -1386,9 +1387,9 @@ const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends HTMLEleme
|
|
|
1386
1387
|
const { onLifecycle, parentPopover, dismissOnSelect, side, arrow, htmlAttributes, focusTrap } = this;
|
|
1387
1388
|
const desktop = isPlatform('desktop');
|
|
1388
1389
|
const enableArrow = arrow && !parentPopover;
|
|
1389
|
-
return (h(Host, Object.assign({ key: '
|
|
1390
|
+
return (h(Host, Object.assign({ key: '16866c02534968c982cf4730d2936d03a5107c8b', "aria-modal": "true", "no-router": true, tabindex: "-1" }, htmlAttributes, { style: {
|
|
1390
1391
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
1391
|
-
}, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'popover-translucent': this.translucent, 'overlay-hidden': true, 'popover-desktop': desktop, [`popover-side-${side}`]: true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false, 'popover-nested': !!parentPopover }), onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonBackdropTap: this.onBackdropTap }), !parentPopover && h("ion-backdrop", { key: '
|
|
1392
|
+
}, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'popover-translucent': this.translucent, 'overlay-hidden': true, 'popover-desktop': desktop, [`popover-side-${side}`]: true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false, 'popover-nested': !!parentPopover }), onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonBackdropTap: this.onBackdropTap }), !parentPopover && h("ion-backdrop", { key: '0df258601a4d30df3c27aa8234a7d5e056c3ecbb', tappable: this.backdropDismiss, visible: this.showBackdrop, part: "backdrop" }), h("div", { key: 'f94e80ed996b957b5cd09b826472b4f60e8fcc78', class: "popover-wrapper ion-overlay-wrapper", onClick: dismissOnSelect ? () => this.dismiss() : undefined }, enableArrow && h("div", { key: '185ce22f6386e8444a9cc7b8818dbfc16c463c99', class: "popover-arrow", part: "arrow" }), h("div", { key: '206202b299404e110de5397b229678cca18568d3', class: "popover-content", part: "content" }, h("slot", { key: 'ee543a0b92d6e35a837c0a0e4617c7b0fc4ad0b0' })))));
|
|
1392
1393
|
}
|
|
1393
1394
|
get el() { return this; }
|
|
1394
1395
|
static get watchers() { return {
|
|
@@ -189,16 +189,15 @@ const ActionSheet = class {
|
|
|
189
189
|
}
|
|
190
190
|
/**
|
|
191
191
|
* Dismiss the action sheet overlay after it has been presented.
|
|
192
|
+
* This is a no-op if the overlay has not been presented yet. If you want
|
|
193
|
+
* to remove an overlay from the DOM that was never presented, use the
|
|
194
|
+
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
192
195
|
*
|
|
193
196
|
* @param data Any data to emit in the dismiss events.
|
|
194
197
|
* @param role The role of the element that is dismissing the action sheet.
|
|
195
198
|
* This can be useful in a button handler for determining which button was
|
|
196
|
-
* clicked to dismiss the action sheet.
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* This is a no-op if the overlay has not been presented yet. If you want
|
|
200
|
-
* to remove an overlay from the DOM that was never presented, use the
|
|
201
|
-
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
199
|
+
* clicked to dismiss the action sheet. Some examples include:
|
|
200
|
+
* `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
|
|
202
201
|
*/
|
|
203
202
|
async dismiss(data, role) {
|
|
204
203
|
const unlock = await this.lockController.lock();
|
|
@@ -310,12 +309,12 @@ const ActionSheet = class {
|
|
|
310
309
|
const cancelButton = allButtons.find((b) => b.role === 'cancel');
|
|
311
310
|
const buttons = allButtons.filter((b) => b.role !== 'cancel');
|
|
312
311
|
const headerID = `action-sheet-${overlayIndex}-header`;
|
|
313
|
-
return (index.h(index.Host, Object.assign({ key: '
|
|
312
|
+
return (index.h(index.Host, Object.assign({ key: '9fef156b2a1f09ca4a6c1fe1f37c374139bde03c', role: "dialog", "aria-modal": "true", "aria-labelledby": header !== undefined ? headerID : null, tabindex: "-1" }, htmlAttributes, { style: {
|
|
314
313
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
315
|
-
}, class: Object.assign(Object.assign({ [mode]: true }, theme.getClassMap(this.cssClass)), { 'overlay-hidden': true, 'action-sheet-translucent': this.translucent }), onIonActionSheetWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), index.h("ion-backdrop", { key: '
|
|
314
|
+
}, class: Object.assign(Object.assign({ [mode]: true }, theme.getClassMap(this.cssClass)), { 'overlay-hidden': true, 'action-sheet-translucent': this.translucent }), onIonActionSheetWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), index.h("ion-backdrop", { key: '81cf3f7d19864e041813987b46d2d115b8466819', tappable: this.backdropDismiss }), index.h("div", { key: '791c6a976683646fc306a42c15c5078b6f06a45f', tabindex: "0", "aria-hidden": "true" }), index.h("div", { key: 'a350b489ef7852eab9dc2227ce6d92da27dd9bf9', class: "action-sheet-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, index.h("div", { key: '69ba51ee13510c1a411d87cb4845b11b7302a36f', class: "action-sheet-container" }, index.h("div", { key: 'bded15b8306c36591e526f0f99e1eeabcbab3915', class: "action-sheet-group", ref: (el) => (this.groupEl = el) }, header !== undefined && (index.h("div", { key: '06b5147c0f6d9180fe8f12e75c9b4a0310226adc', id: headerID, class: {
|
|
316
315
|
'action-sheet-title': true,
|
|
317
316
|
'action-sheet-has-sub-title': this.subHeader !== undefined,
|
|
318
|
-
} }, header, this.subHeader && index.h("div", { key: '
|
|
317
|
+
} }, header, this.subHeader && index.h("div", { key: '54874362a75c679aba803bf4f8768f5404d2dd28', class: "action-sheet-sub-title" }, this.subHeader))), buttons.map((b) => (index.h("button", Object.assign({}, b.htmlAttributes, { type: "button", id: b.id, class: buttonClass(b), onClick: () => this.buttonClick(b), disabled: b.disabled }), index.h("span", { class: "action-sheet-button-inner" }, b.icon && index.h("ion-icon", { icon: b.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" }), b.text), mode === 'md' && index.h("ion-ripple-effect", null))))), cancelButton && (index.h("div", { key: '67b0de298eb424f3dea846a841b7a06d70e3930d', class: "action-sheet-group action-sheet-group-cancel" }, index.h("button", Object.assign({ key: 'e7e3f9a5495eea9b97dbf885ef36944f2e420eff' }, cancelButton.htmlAttributes, { type: "button", class: buttonClass(cancelButton), onClick: () => this.buttonClick(cancelButton) }), index.h("span", { key: 'f889d29ed6c3d14bbc1d805888351d87f5122377', class: "action-sheet-button-inner" }, cancelButton.icon && (index.h("ion-icon", { key: '7c05cf424b38c37fd40aaeb42a494387291571fb', icon: cancelButton.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" })), cancelButton.text), mode === 'md' && index.h("ion-ripple-effect", { key: 'bed927b477dc2708a5123ef560274fca9819b3d6' })))))), index.h("div", { key: 'c5df1b11dc15a93892d57065d3dd5fbe02e43b39', tabindex: "0", "aria-hidden": "true" })));
|
|
319
318
|
}
|
|
320
319
|
get el() { return index.getElement(this); }
|
|
321
320
|
static get watchers() { return {
|
|
@@ -359,16 +359,15 @@ const Alert = class {
|
|
|
359
359
|
}
|
|
360
360
|
/**
|
|
361
361
|
* Dismiss the alert overlay after it has been presented.
|
|
362
|
+
* This is a no-op if the overlay has not been presented yet. If you want
|
|
363
|
+
* to remove an overlay from the DOM that was never presented, use the
|
|
364
|
+
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
362
365
|
*
|
|
363
366
|
* @param data Any data to emit in the dismiss events.
|
|
364
367
|
* @param role The role of the element that is dismissing the alert.
|
|
365
368
|
* This can be useful in a button handler for determining which button was
|
|
366
|
-
* clicked to dismiss the alert.
|
|
367
|
-
*
|
|
368
|
-
*
|
|
369
|
-
* This is a no-op if the overlay has not been presented yet. If you want
|
|
370
|
-
* to remove an overlay from the DOM that was never presented, use the
|
|
371
|
-
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
369
|
+
* clicked to dismiss the alert. Some examples include:
|
|
370
|
+
* `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
|
|
372
371
|
*/
|
|
373
372
|
async dismiss(data, role) {
|
|
374
373
|
const unlock = await this.lockController.lock();
|
|
@@ -538,9 +537,9 @@ const Alert = class {
|
|
|
538
537
|
* If neither are defined, do not set aria-labelledby.
|
|
539
538
|
*/
|
|
540
539
|
const ariaLabelledBy = header && subHeader ? `${hdrId} ${subHdrId}` : header ? hdrId : subHeader ? subHdrId : null;
|
|
541
|
-
return (index.h(index.Host, { key: '
|
|
540
|
+
return (index.h(index.Host, { key: '6025440b9cd369d4fac89e7e4296c84a10a0b8e0', tabindex: "-1", style: {
|
|
542
541
|
zIndex: `${20000 + overlayIndex}`,
|
|
543
|
-
}, class: Object.assign(Object.assign({}, theme.getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }, index.h("ion-backdrop", { key: '
|
|
542
|
+
}, class: Object.assign(Object.assign({}, theme.getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }, index.h("ion-backdrop", { key: '3cd5ca8b99cb95b11dd22ab41a820d841142896f', tappable: this.backdropDismiss }), index.h("div", { key: '4cc62ae6e21424057d22aeef1e8fc77011e77cd5', tabindex: "0", "aria-hidden": "true" }), index.h("div", Object.assign({ key: '364057a69f25aa88904df17bdcf7e5bf714e7830', class: "alert-wrapper ion-overlay-wrapper", role: role, "aria-modal": "true", "aria-labelledby": ariaLabelledBy, "aria-describedby": message !== undefined ? msgId : null, tabindex: "0", ref: (el) => (this.wrapperEl = el) }, htmlAttributes), index.h("div", { key: '78694e3c0db2d408df3899fb1a90859bcc8d14cc', class: "alert-head" }, header && (index.h("h2", { key: 'ec88ff3e4e1ea871b5975133fdcf4cac38b05e0f', id: hdrId, class: "alert-title" }, header)), subHeader && !header && (index.h("h2", { key: '9b09bc8bb68af255ef8b7d22587acc946148e544', id: subHdrId, class: "alert-sub-title" }, subHeader)), subHeader && header && (index.h("h3", { key: '99abe815f75d2df7f1b77c0df9f3436724fea76f', id: subHdrId, class: "alert-sub-title" }, subHeader))), this.renderAlertMessage(msgId), this.renderAlertInputs(), this.renderAlertButtons()), index.h("div", { key: 'a43d0c22c0e46b1ef911f92ffeb253d7911b85f7', tabindex: "0", "aria-hidden": "true" })));
|
|
544
543
|
}
|
|
545
544
|
get el() { return index.getElement(this); }
|
|
546
545
|
static get watchers() { return {
|
|
@@ -72,6 +72,8 @@ const App = class {
|
|
|
72
72
|
* a result of another user action. (Ex: We focus the first element
|
|
73
73
|
* inside of a popover when the user presents it, but the popover is not always
|
|
74
74
|
* presented as a result of keyboard action.)
|
|
75
|
+
*
|
|
76
|
+
* @param elements An array of HTML elements to set focus on.
|
|
75
77
|
*/
|
|
76
78
|
async setFocus(elements) {
|
|
77
79
|
if (this.focusVisible) {
|
|
@@ -80,7 +82,7 @@ const App = class {
|
|
|
80
82
|
}
|
|
81
83
|
render() {
|
|
82
84
|
const mode = index.getIonMode(this);
|
|
83
|
-
return (index.h(index.Host, { key: '
|
|
85
|
+
return (index.h(index.Host, { key: '9be440c65819e4fa67c2c3c6477ab40b3ad3eed3', class: {
|
|
84
86
|
[mode]: true,
|
|
85
87
|
'ion-page': true,
|
|
86
88
|
'force-statusbar-padding': index.config.getBoolean('_forceStatusbarPadding'),
|
|
@@ -994,6 +994,8 @@ const Datetime = class {
|
|
|
994
994
|
* Confirms the selected datetime value, updates the
|
|
995
995
|
* `value` property, and optionally closes the popover
|
|
996
996
|
* or modal that the datetime was presented in.
|
|
997
|
+
*
|
|
998
|
+
* @param closeOverlay If `true`, closes the parent overlay. Defaults to `false`.
|
|
997
999
|
*/
|
|
998
1000
|
async confirm(closeOverlay = false) {
|
|
999
1001
|
const { isCalendarPicker, activeParts, preferWheel, workingParts } = this;
|
|
@@ -1027,6 +1029,8 @@ const Datetime = class {
|
|
|
1027
1029
|
* Resets the internal state of the datetime but does not update the value.
|
|
1028
1030
|
* Passing a valid ISO-8601 string will reset the state of the component to the provided date.
|
|
1029
1031
|
* If no value is provided, the internal state will be reset to the clamped value of the min, max and today.
|
|
1032
|
+
*
|
|
1033
|
+
* @param startDate A valid [ISO-8601 string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format) to reset the datetime state to.
|
|
1030
1034
|
*/
|
|
1031
1035
|
async reset(startDate) {
|
|
1032
1036
|
this.processValue(startDate);
|
|
@@ -1036,6 +1040,8 @@ const Datetime = class {
|
|
|
1036
1040
|
* optionally closes the popover
|
|
1037
1041
|
* or modal that the datetime was
|
|
1038
1042
|
* presented in.
|
|
1043
|
+
*
|
|
1044
|
+
* @param closeOverlay If `true`, closes the parent overlay. Defaults to `false`.
|
|
1039
1045
|
*/
|
|
1040
1046
|
async cancel(closeOverlay = false) {
|
|
1041
1047
|
this.ionCancel.emit();
|
|
@@ -1849,7 +1855,7 @@ const Datetime = class {
|
|
|
1849
1855
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1850
1856
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1851
1857
|
helpers.renderHiddenInput(true, el, name, data.formatValue(value), disabled);
|
|
1852
|
-
return (index.h(index.Host, { key: '
|
|
1858
|
+
return (index.h(index.Host, { key: '79677f5bc0fb32fb68569636bd76e68238e62eb8', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, theme.createColorClasses(color, {
|
|
1853
1859
|
[mode]: true,
|
|
1854
1860
|
['datetime-readonly']: readonly,
|
|
1855
1861
|
['datetime-disabled']: disabled,
|
|
@@ -1859,7 +1865,7 @@ const Datetime = class {
|
|
|
1859
1865
|
[`datetime-size-${size}`]: true,
|
|
1860
1866
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
1861
1867
|
[`datetime-grid`]: isGridStyle,
|
|
1862
|
-
})) }, index.h("div", { key: '
|
|
1868
|
+
})) }, index.h("div", { key: 'bf07b1e3c64af6e837663ff470bea93787a6e86f', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
1863
1869
|
}
|
|
1864
1870
|
get el() { return index.getElement(this); }
|
|
1865
1871
|
static get watchers() { return {
|
|
@@ -227,16 +227,15 @@ const Loading = class {
|
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
229
229
|
* Dismiss the loading overlay after it has been presented.
|
|
230
|
+
* This is a no-op if the overlay has not been presented yet. If you want
|
|
231
|
+
* to remove an overlay from the DOM that was never presented, use the
|
|
232
|
+
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
230
233
|
*
|
|
231
234
|
* @param data Any data to emit in the dismiss events.
|
|
232
235
|
* @param role The role of the element that is dismissing the loading.
|
|
233
236
|
* This can be useful in a button handler for determining which button was
|
|
234
|
-
* clicked to dismiss the loading.
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
* This is a no-op if the overlay has not been presented yet. If you want
|
|
238
|
-
* to remove an overlay from the DOM that was never presented, use the
|
|
239
|
-
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
237
|
+
* clicked to dismiss the loading. Some examples include:
|
|
238
|
+
* `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
|
|
240
239
|
*/
|
|
241
240
|
async dismiss(data, role) {
|
|
242
241
|
const unlock = await this.lockController.lock();
|
|
@@ -278,9 +277,9 @@ const Loading = class {
|
|
|
278
277
|
* Otherwise, don't set aria-labelledby.
|
|
279
278
|
*/
|
|
280
279
|
const ariaLabelledBy = message !== undefined ? msgId : null;
|
|
281
|
-
return (index.h(index.Host, Object.assign({ key: '
|
|
280
|
+
return (index.h(index.Host, Object.assign({ key: '4497183ce220242abe19ae15f328f9a92ccafbbc', role: "dialog", "aria-modal": "true", "aria-labelledby": ariaLabelledBy, tabindex: "-1" }, htmlAttributes, { style: {
|
|
282
281
|
zIndex: `${40000 + this.overlayIndex}`,
|
|
283
|
-
}, onIonBackdropTap: this.onBackdropTap, class: Object.assign(Object.assign({}, theme.getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'loading-translucent': this.translucent }) }), index.h("ion-backdrop", { key: '
|
|
282
|
+
}, onIonBackdropTap: this.onBackdropTap, class: Object.assign(Object.assign({}, theme.getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'loading-translucent': this.translucent }) }), index.h("ion-backdrop", { key: '231dec84e424a2dc358ce95b84d6035cf43e4dea', visible: this.showBackdrop, tappable: this.backdropDismiss }), index.h("div", { key: 'c9af29b6e6bb49a217396a5c874bbfb8835a926c', tabindex: "0", "aria-hidden": "true" }), index.h("div", { key: 'a8659863743cdeccbe1ba810eaabfd3ebfcb86f3', class: "loading-wrapper ion-overlay-wrapper" }, spinner && (index.h("div", { key: '3b346f39bc71691bd8686556a1e142198a7b12fa', class: "loading-spinner" }, index.h("ion-spinner", { key: '8dc2bf1556e5138e262827f1516c59ecd09f3520', name: spinner, "aria-hidden": "true" }))), message !== undefined && this.renderLoadingMessage(msgId)), index.h("div", { key: '054164c0dbae9a0e0973dd3c8e28f5b771820310', tabindex: "0", "aria-hidden": "true" })));
|
|
284
283
|
}
|
|
285
284
|
get el() { return index.getElement(this); }
|
|
286
285
|
static get watchers() { return {
|