@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
|
@@ -187,16 +187,15 @@ const ActionSheet = class {
|
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
189
|
* Dismiss the action sheet overlay after it has been presented.
|
|
190
|
+
* This is a no-op if the overlay has not been presented yet. If you want
|
|
191
|
+
* to remove an overlay from the DOM that was never presented, use the
|
|
192
|
+
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
190
193
|
*
|
|
191
194
|
* @param data Any data to emit in the dismiss events.
|
|
192
195
|
* @param role The role of the element that is dismissing the action sheet.
|
|
193
196
|
* This can be useful in a button handler for determining which button was
|
|
194
|
-
* clicked to dismiss the action sheet.
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
* This is a no-op if the overlay has not been presented yet. If you want
|
|
198
|
-
* to remove an overlay from the DOM that was never presented, use the
|
|
199
|
-
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
197
|
+
* clicked to dismiss the action sheet. Some examples include:
|
|
198
|
+
* `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
|
|
200
199
|
*/
|
|
201
200
|
async dismiss(data, role) {
|
|
202
201
|
const unlock = await this.lockController.lock();
|
|
@@ -308,12 +307,12 @@ const ActionSheet = class {
|
|
|
308
307
|
const cancelButton = allButtons.find((b) => b.role === 'cancel');
|
|
309
308
|
const buttons = allButtons.filter((b) => b.role !== 'cancel');
|
|
310
309
|
const headerID = `action-sheet-${overlayIndex}-header`;
|
|
311
|
-
return (h(Host, Object.assign({ key: '
|
|
310
|
+
return (h(Host, Object.assign({ key: '9fef156b2a1f09ca4a6c1fe1f37c374139bde03c', role: "dialog", "aria-modal": "true", "aria-labelledby": header !== undefined ? headerID : null, tabindex: "-1" }, htmlAttributes, { style: {
|
|
312
311
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
313
|
-
}, class: Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'action-sheet-translucent': this.translucent }), onIonActionSheetWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), h("ion-backdrop", { key: '
|
|
312
|
+
}, class: Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'action-sheet-translucent': this.translucent }), onIonActionSheetWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), h("ion-backdrop", { key: '81cf3f7d19864e041813987b46d2d115b8466819', tappable: this.backdropDismiss }), h("div", { key: '791c6a976683646fc306a42c15c5078b6f06a45f', tabindex: "0", "aria-hidden": "true" }), h("div", { key: 'a350b489ef7852eab9dc2227ce6d92da27dd9bf9', class: "action-sheet-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, h("div", { key: '69ba51ee13510c1a411d87cb4845b11b7302a36f', class: "action-sheet-container" }, h("div", { key: 'bded15b8306c36591e526f0f99e1eeabcbab3915', class: "action-sheet-group", ref: (el) => (this.groupEl = el) }, header !== undefined && (h("div", { key: '06b5147c0f6d9180fe8f12e75c9b4a0310226adc', id: headerID, class: {
|
|
314
313
|
'action-sheet-title': true,
|
|
315
314
|
'action-sheet-has-sub-title': this.subHeader !== undefined,
|
|
316
|
-
} }, header, this.subHeader && h("div", { key: '
|
|
315
|
+
} }, header, this.subHeader && h("div", { key: '54874362a75c679aba803bf4f8768f5404d2dd28', class: "action-sheet-sub-title" }, this.subHeader))), buttons.map((b) => (h("button", Object.assign({}, b.htmlAttributes, { type: "button", id: b.id, class: buttonClass(b), onClick: () => this.buttonClick(b), disabled: b.disabled }), h("span", { class: "action-sheet-button-inner" }, b.icon && h("ion-icon", { icon: b.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" }), b.text), mode === 'md' && h("ion-ripple-effect", null))))), cancelButton && (h("div", { key: '67b0de298eb424f3dea846a841b7a06d70e3930d', class: "action-sheet-group action-sheet-group-cancel" }, h("button", Object.assign({ key: 'e7e3f9a5495eea9b97dbf885ef36944f2e420eff' }, cancelButton.htmlAttributes, { type: "button", class: buttonClass(cancelButton), onClick: () => this.buttonClick(cancelButton) }), h("span", { key: 'f889d29ed6c3d14bbc1d805888351d87f5122377', class: "action-sheet-button-inner" }, cancelButton.icon && (h("ion-icon", { key: '7c05cf424b38c37fd40aaeb42a494387291571fb', icon: cancelButton.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" })), cancelButton.text), mode === 'md' && h("ion-ripple-effect", { key: 'bed927b477dc2708a5123ef560274fca9819b3d6' })))))), h("div", { key: 'c5df1b11dc15a93892d57065d3dd5fbe02e43b39', tabindex: "0", "aria-hidden": "true" })));
|
|
317
316
|
}
|
|
318
317
|
get el() { return getElement(this); }
|
|
319
318
|
static get watchers() { return {
|
|
@@ -357,16 +357,15 @@ const Alert = class {
|
|
|
357
357
|
}
|
|
358
358
|
/**
|
|
359
359
|
* Dismiss the alert overlay after it has been presented.
|
|
360
|
+
* This is a no-op if the overlay has not been presented yet. If you want
|
|
361
|
+
* to remove an overlay from the DOM that was never presented, use the
|
|
362
|
+
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
360
363
|
*
|
|
361
364
|
* @param data Any data to emit in the dismiss events.
|
|
362
365
|
* @param role The role of the element that is dismissing the alert.
|
|
363
366
|
* This can be useful in a button handler for determining which button was
|
|
364
|
-
* clicked to dismiss the alert.
|
|
365
|
-
*
|
|
366
|
-
*
|
|
367
|
-
* This is a no-op if the overlay has not been presented yet. If you want
|
|
368
|
-
* to remove an overlay from the DOM that was never presented, use the
|
|
369
|
-
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
367
|
+
* clicked to dismiss the alert. Some examples include:
|
|
368
|
+
* `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
|
|
370
369
|
*/
|
|
371
370
|
async dismiss(data, role) {
|
|
372
371
|
const unlock = await this.lockController.lock();
|
|
@@ -536,9 +535,9 @@ const Alert = class {
|
|
|
536
535
|
* If neither are defined, do not set aria-labelledby.
|
|
537
536
|
*/
|
|
538
537
|
const ariaLabelledBy = header && subHeader ? `${hdrId} ${subHdrId}` : header ? hdrId : subHeader ? subHdrId : null;
|
|
539
|
-
return (h(Host, { key: '
|
|
538
|
+
return (h(Host, { key: '6025440b9cd369d4fac89e7e4296c84a10a0b8e0', tabindex: "-1", style: {
|
|
540
539
|
zIndex: `${20000 + overlayIndex}`,
|
|
541
|
-
}, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }, h("ion-backdrop", { key: '
|
|
540
|
+
}, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }, h("ion-backdrop", { key: '3cd5ca8b99cb95b11dd22ab41a820d841142896f', tappable: this.backdropDismiss }), h("div", { key: '4cc62ae6e21424057d22aeef1e8fc77011e77cd5', tabindex: "0", "aria-hidden": "true" }), 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), h("div", { key: '78694e3c0db2d408df3899fb1a90859bcc8d14cc', class: "alert-head" }, header && (h("h2", { key: 'ec88ff3e4e1ea871b5975133fdcf4cac38b05e0f', id: hdrId, class: "alert-title" }, header)), subHeader && !header && (h("h2", { key: '9b09bc8bb68af255ef8b7d22587acc946148e544', id: subHdrId, class: "alert-sub-title" }, subHeader)), subHeader && header && (h("h3", { key: '99abe815f75d2df7f1b77c0df9f3436724fea76f', id: subHdrId, class: "alert-sub-title" }, subHeader))), this.renderAlertMessage(msgId), this.renderAlertInputs(), this.renderAlertButtons()), h("div", { key: 'a43d0c22c0e46b1ef911f92ffeb253d7911b85f7', tabindex: "0", "aria-hidden": "true" })));
|
|
542
541
|
}
|
|
543
542
|
get el() { return getElement(this); }
|
|
544
543
|
static get watchers() { return {
|
|
@@ -70,6 +70,8 @@ const App = class {
|
|
|
70
70
|
* a result of another user action. (Ex: We focus the first element
|
|
71
71
|
* inside of a popover when the user presents it, but the popover is not always
|
|
72
72
|
* presented as a result of keyboard action.)
|
|
73
|
+
*
|
|
74
|
+
* @param elements An array of HTML elements to set focus on.
|
|
73
75
|
*/
|
|
74
76
|
async setFocus(elements) {
|
|
75
77
|
if (this.focusVisible) {
|
|
@@ -78,7 +80,7 @@ const App = class {
|
|
|
78
80
|
}
|
|
79
81
|
render() {
|
|
80
82
|
const mode = getIonMode(this);
|
|
81
|
-
return (h(Host, { key: '
|
|
83
|
+
return (h(Host, { key: '9be440c65819e4fa67c2c3c6477ab40b3ad3eed3', class: {
|
|
82
84
|
[mode]: true,
|
|
83
85
|
'ion-page': true,
|
|
84
86
|
'force-statusbar-padding': config.getBoolean('_forceStatusbarPadding'),
|
|
@@ -992,6 +992,8 @@ const Datetime = class {
|
|
|
992
992
|
* Confirms the selected datetime value, updates the
|
|
993
993
|
* `value` property, and optionally closes the popover
|
|
994
994
|
* or modal that the datetime was presented in.
|
|
995
|
+
*
|
|
996
|
+
* @param closeOverlay If `true`, closes the parent overlay. Defaults to `false`.
|
|
995
997
|
*/
|
|
996
998
|
async confirm(closeOverlay = false) {
|
|
997
999
|
const { isCalendarPicker, activeParts, preferWheel, workingParts } = this;
|
|
@@ -1025,6 +1027,8 @@ const Datetime = class {
|
|
|
1025
1027
|
* Resets the internal state of the datetime but does not update the value.
|
|
1026
1028
|
* Passing a valid ISO-8601 string will reset the state of the component to the provided date.
|
|
1027
1029
|
* If no value is provided, the internal state will be reset to the clamped value of the min, max and today.
|
|
1030
|
+
*
|
|
1031
|
+
* @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.
|
|
1028
1032
|
*/
|
|
1029
1033
|
async reset(startDate) {
|
|
1030
1034
|
this.processValue(startDate);
|
|
@@ -1034,6 +1038,8 @@ const Datetime = class {
|
|
|
1034
1038
|
* optionally closes the popover
|
|
1035
1039
|
* or modal that the datetime was
|
|
1036
1040
|
* presented in.
|
|
1041
|
+
*
|
|
1042
|
+
* @param closeOverlay If `true`, closes the parent overlay. Defaults to `false`.
|
|
1037
1043
|
*/
|
|
1038
1044
|
async cancel(closeOverlay = false) {
|
|
1039
1045
|
this.ionCancel.emit();
|
|
@@ -1847,7 +1853,7 @@ const Datetime = class {
|
|
|
1847
1853
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1848
1854
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1849
1855
|
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
1850
|
-
return (h(Host, { key: '
|
|
1856
|
+
return (h(Host, { key: '79677f5bc0fb32fb68569636bd76e68238e62eb8', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses(color, {
|
|
1851
1857
|
[mode]: true,
|
|
1852
1858
|
['datetime-readonly']: readonly,
|
|
1853
1859
|
['datetime-disabled']: disabled,
|
|
@@ -1857,7 +1863,7 @@ const Datetime = class {
|
|
|
1857
1863
|
[`datetime-size-${size}`]: true,
|
|
1858
1864
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
1859
1865
|
[`datetime-grid`]: isGridStyle,
|
|
1860
|
-
})) }, h("div", { key: '
|
|
1866
|
+
})) }, h("div", { key: 'bf07b1e3c64af6e837663ff470bea93787a6e86f', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
1861
1867
|
}
|
|
1862
1868
|
get el() { return getElement(this); }
|
|
1863
1869
|
static get watchers() { return {
|
|
@@ -225,16 +225,15 @@ const Loading = class {
|
|
|
225
225
|
}
|
|
226
226
|
/**
|
|
227
227
|
* Dismiss the loading overlay after it has been presented.
|
|
228
|
+
* This is a no-op if the overlay has not been presented yet. If you want
|
|
229
|
+
* to remove an overlay from the DOM that was never presented, use the
|
|
230
|
+
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
228
231
|
*
|
|
229
232
|
* @param data Any data to emit in the dismiss events.
|
|
230
233
|
* @param role The role of the element that is dismissing the loading.
|
|
231
234
|
* This can be useful in a button handler for determining which button was
|
|
232
|
-
* clicked to dismiss the loading.
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
* This is a no-op if the overlay has not been presented yet. If you want
|
|
236
|
-
* to remove an overlay from the DOM that was never presented, use the
|
|
237
|
-
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
235
|
+
* clicked to dismiss the loading. Some examples include:
|
|
236
|
+
* `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
|
|
238
237
|
*/
|
|
239
238
|
async dismiss(data, role) {
|
|
240
239
|
const unlock = await this.lockController.lock();
|
|
@@ -276,9 +275,9 @@ const Loading = class {
|
|
|
276
275
|
* Otherwise, don't set aria-labelledby.
|
|
277
276
|
*/
|
|
278
277
|
const ariaLabelledBy = message !== undefined ? msgId : null;
|
|
279
|
-
return (h(Host, Object.assign({ key: '
|
|
278
|
+
return (h(Host, Object.assign({ key: '4497183ce220242abe19ae15f328f9a92ccafbbc', role: "dialog", "aria-modal": "true", "aria-labelledby": ariaLabelledBy, tabindex: "-1" }, htmlAttributes, { style: {
|
|
280
279
|
zIndex: `${40000 + this.overlayIndex}`,
|
|
281
|
-
}, onIonBackdropTap: this.onBackdropTap, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'loading-translucent': this.translucent }) }), h("ion-backdrop", { key: '
|
|
280
|
+
}, onIonBackdropTap: this.onBackdropTap, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'loading-translucent': this.translucent }) }), h("ion-backdrop", { key: '231dec84e424a2dc358ce95b84d6035cf43e4dea', visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { key: 'c9af29b6e6bb49a217396a5c874bbfb8835a926c', tabindex: "0", "aria-hidden": "true" }), h("div", { key: 'a8659863743cdeccbe1ba810eaabfd3ebfcb86f3', class: "loading-wrapper ion-overlay-wrapper" }, spinner && (h("div", { key: '3b346f39bc71691bd8686556a1e142198a7b12fa', class: "loading-spinner" }, h("ion-spinner", { key: '8dc2bf1556e5138e262827f1516c59ecd09f3520', name: spinner, "aria-hidden": "true" }))), message !== undefined && this.renderLoadingMessage(msgId)), h("div", { key: '054164c0dbae9a0e0973dd3c8e28f5b771820310', tabindex: "0", "aria-hidden": "true" })));
|
|
282
281
|
}
|
|
283
282
|
get el() { return getElement(this); }
|
|
284
283
|
static get watchers() { return {
|
|
@@ -240,7 +240,7 @@ const Menu = class {
|
|
|
240
240
|
return Promise.resolve(this._isOpen);
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
|
-
* Returns `true`
|
|
243
|
+
* Returns `true` if the menu is active.
|
|
244
244
|
*
|
|
245
245
|
* A menu is active when it can be opened or closed, meaning it's enabled
|
|
246
246
|
* and it's not part of a `ion-split-pane`.
|
|
@@ -251,6 +251,10 @@ const Menu = class {
|
|
|
251
251
|
/**
|
|
252
252
|
* Opens the menu. If the menu is already open or it can't be opened,
|
|
253
253
|
* it returns `false`.
|
|
254
|
+
*
|
|
255
|
+
* @param animated If `true`, the menu will animate when opening.
|
|
256
|
+
* If `false`, the menu will open instantly without animation.
|
|
257
|
+
* Defaults to `true`.
|
|
254
258
|
*/
|
|
255
259
|
open(animated = true) {
|
|
256
260
|
return this.setOpen(true, animated);
|
|
@@ -258,20 +262,38 @@ const Menu = class {
|
|
|
258
262
|
/**
|
|
259
263
|
* Closes the menu. If the menu is already closed or it can't be closed,
|
|
260
264
|
* it returns `false`.
|
|
265
|
+
*
|
|
266
|
+
* @param animated If `true`, the menu will animate when closing. If `false`,
|
|
267
|
+
* the menu will close instantly without animation. Defaults to `true`.
|
|
268
|
+
* @param role The role of the element that is closing the menu.
|
|
269
|
+
* This can be useful in a button handler for determining which button was
|
|
270
|
+
* clicked to close the menu. Some examples include:
|
|
271
|
+
* `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
|
|
261
272
|
*/
|
|
262
273
|
close(animated = true, role) {
|
|
263
274
|
return this.setOpen(false, animated, role);
|
|
264
275
|
}
|
|
265
276
|
/**
|
|
266
|
-
* Toggles the menu. If the menu is already open, it will try to close,
|
|
277
|
+
* Toggles the menu. If the menu is already open, it will try to close,
|
|
278
|
+
* otherwise it will try to open it.
|
|
267
279
|
* If the operation can't be completed successfully, it returns `false`.
|
|
280
|
+
*
|
|
281
|
+
* @param animated If `true`, the menu will animate when opening/closing.
|
|
282
|
+
* If `false`, the menu will open/close instantly without animation.
|
|
283
|
+
* Defaults to `true`.
|
|
268
284
|
*/
|
|
269
285
|
toggle(animated = true) {
|
|
270
286
|
return this.setOpen(!this._isOpen, animated);
|
|
271
287
|
}
|
|
272
288
|
/**
|
|
273
|
-
* Opens or closes the
|
|
289
|
+
* Opens or closes the menu.
|
|
274
290
|
* If the operation can't be completed successfully, it returns `false`.
|
|
291
|
+
*
|
|
292
|
+
* @param shouldOpen If `true`, the menu will open. If `false`, the menu
|
|
293
|
+
* will close.
|
|
294
|
+
* @param animated If `true`, the menu will animate when opening/closing.
|
|
295
|
+
* If `false`, the menu will open/close instantly without animation.
|
|
296
|
+
* @param role The role of the element that is closing the menu.
|
|
275
297
|
*/
|
|
276
298
|
setOpen(shouldOpen, animated = true, role) {
|
|
277
299
|
return menuController._setOpen(this, shouldOpen, animated, role);
|
|
@@ -636,14 +658,14 @@ const Menu = class {
|
|
|
636
658
|
* the ionBackButton listener in the menu controller
|
|
637
659
|
* will handle closing the menu when Escape is pressed.
|
|
638
660
|
*/
|
|
639
|
-
return (h(Host, { key: '
|
|
661
|
+
return (h(Host, { key: 'a5c75aa40a34530b56ee3b98d706a5ac5ae300de', onKeyDown: shouldUseCloseWatcher() ? null : this.onKeydown, role: "navigation", "aria-label": inheritedAttributes['aria-label'] || 'menu', class: {
|
|
640
662
|
[mode]: true,
|
|
641
663
|
[`menu-type-${type}`]: true,
|
|
642
664
|
'menu-enabled': !disabled,
|
|
643
665
|
[`menu-side-${side}`]: true,
|
|
644
666
|
'menu-pane-visible': isPaneVisible,
|
|
645
667
|
'split-pane-side': hostContext('ion-split-pane', el),
|
|
646
|
-
} }, h("div", { key: '
|
|
668
|
+
} }, h("div", { key: '3f5f70acd4d3ed6bb445122f4f01d73db738a75f', class: "menu-inner", part: "container", ref: (el) => (this.menuInnerEl = el) }, h("slot", { key: '3161326c9330e7f7441299c428b87a91b31a83e9' })), h("ion-backdrop", { key: '917b50f38489bdf03d0c642af8b4e4e172c7dc4c', ref: (el) => (this.backdropEl = el), class: "menu-backdrop", tappable: false, stopPropagation: false, part: "backdrop" })));
|
|
647
669
|
}
|
|
648
670
|
get el() { return getElement(this); }
|
|
649
671
|
static get watchers() { return {
|
|
@@ -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)')
|
|
@@ -1482,6 +1601,17 @@ const Modal = class {
|
|
|
1482
1601
|
el.dispatchEvent(ev);
|
|
1483
1602
|
}
|
|
1484
1603
|
};
|
|
1604
|
+
/**
|
|
1605
|
+
* When the modal receives focus directly, pass focus to the handle
|
|
1606
|
+
* if it exists and is focusable, otherwise let the focus trap handle it.
|
|
1607
|
+
*/
|
|
1608
|
+
this.onModalFocus = (ev) => {
|
|
1609
|
+
const { dragHandleEl, el } = this;
|
|
1610
|
+
// Only handle focus if the modal itself was focused (not a child element)
|
|
1611
|
+
if (ev.target === el && dragHandleEl && dragHandleEl.tabIndex !== -1) {
|
|
1612
|
+
dragHandleEl.focus();
|
|
1613
|
+
}
|
|
1614
|
+
};
|
|
1485
1615
|
}
|
|
1486
1616
|
onIsOpenChange(newValue, oldValue) {
|
|
1487
1617
|
if (newValue === true && oldValue === false) {
|
|
@@ -1509,6 +1639,7 @@ const Modal = class {
|
|
|
1509
1639
|
}
|
|
1510
1640
|
disconnectedCallback() {
|
|
1511
1641
|
this.triggerController.removeClickListener();
|
|
1642
|
+
this.cleanupViewTransitionListener();
|
|
1512
1643
|
}
|
|
1513
1644
|
componentWillLoad() {
|
|
1514
1645
|
var _a;
|
|
@@ -1719,6 +1850,8 @@ const Modal = class {
|
|
|
1719
1850
|
else if (hasCardModal) {
|
|
1720
1851
|
this.initSwipeToClose();
|
|
1721
1852
|
}
|
|
1853
|
+
// Initialize view transition listener for iOS card modals
|
|
1854
|
+
this.initViewTransitionListener();
|
|
1722
1855
|
unlock();
|
|
1723
1856
|
}
|
|
1724
1857
|
initSwipeToClose() {
|
|
@@ -1813,13 +1946,13 @@ const Modal = class {
|
|
|
1813
1946
|
}
|
|
1814
1947
|
/**
|
|
1815
1948
|
* Dismiss the modal overlay after it has been presented.
|
|
1816
|
-
*
|
|
1817
|
-
* @param data Any data to emit in the dismiss events.
|
|
1818
|
-
* @param role The role of the element that is dismissing the modal. For example, 'cancel' or 'backdrop'.
|
|
1819
|
-
*
|
|
1820
1949
|
* This is a no-op if the overlay has not been presented yet. If you want
|
|
1821
1950
|
* to remove an overlay from the DOM that was never presented, use the
|
|
1822
1951
|
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
|
|
1952
|
+
*
|
|
1953
|
+
* @param data Any data to emit in the dismiss events.
|
|
1954
|
+
* @param role The role of the element that is dismissing the modal.
|
|
1955
|
+
* For example, `cancel` or `backdrop`.
|
|
1823
1956
|
*/
|
|
1824
1957
|
async dismiss(data, role) {
|
|
1825
1958
|
var _a;
|
|
@@ -1872,6 +2005,7 @@ const Modal = class {
|
|
|
1872
2005
|
if (this.gesture) {
|
|
1873
2006
|
this.gesture.destroy();
|
|
1874
2007
|
}
|
|
2008
|
+
this.cleanupViewTransitionListener();
|
|
1875
2009
|
}
|
|
1876
2010
|
this.currentBreakpoint = undefined;
|
|
1877
2011
|
this.animation = undefined;
|
|
@@ -1891,8 +2025,10 @@ const Modal = class {
|
|
|
1891
2025
|
return eventMethod(this.el, 'ionModalWillDismiss');
|
|
1892
2026
|
}
|
|
1893
2027
|
/**
|
|
1894
|
-
* Move a sheet style modal to a specific breakpoint.
|
|
1895
|
-
*
|
|
2028
|
+
* Move a sheet style modal to a specific breakpoint.
|
|
2029
|
+
*
|
|
2030
|
+
* @param breakpoint The breakpoint value to move the sheet modal to.
|
|
2031
|
+
* Must be a value defined in your `breakpoints` array.
|
|
1896
2032
|
*/
|
|
1897
2033
|
async setCurrentBreakpoint(breakpoint) {
|
|
1898
2034
|
if (!this.isSheetModal) {
|
|
@@ -1945,26 +2081,88 @@ const Modal = class {
|
|
|
1945
2081
|
await this.setCurrentBreakpoint(nextBreakpoint);
|
|
1946
2082
|
return true;
|
|
1947
2083
|
}
|
|
2084
|
+
initViewTransitionListener() {
|
|
2085
|
+
// Only enable for iOS card modals when no custom animations are provided
|
|
2086
|
+
if (getIonMode(this) !== 'ios' || !this.presentingElement || this.enterAnimation || this.leaveAnimation) {
|
|
2087
|
+
return;
|
|
2088
|
+
}
|
|
2089
|
+
// Set initial view state
|
|
2090
|
+
this.currentViewIsPortrait = window.innerWidth < 768;
|
|
2091
|
+
// Create debounced resize handler
|
|
2092
|
+
let resizeTimeout;
|
|
2093
|
+
this.resizeListener = () => {
|
|
2094
|
+
clearTimeout(resizeTimeout);
|
|
2095
|
+
resizeTimeout = setTimeout(() => {
|
|
2096
|
+
this.handleViewTransition();
|
|
2097
|
+
}, 100); // Debounce for 100ms to avoid excessive calls
|
|
2098
|
+
};
|
|
2099
|
+
window.addEventListener('resize', this.resizeListener);
|
|
2100
|
+
}
|
|
2101
|
+
handleViewTransition() {
|
|
2102
|
+
const isPortrait = window.innerWidth < 768;
|
|
2103
|
+
// Only transition if view state actually changed
|
|
2104
|
+
if (this.currentViewIsPortrait === isPortrait) {
|
|
2105
|
+
return;
|
|
2106
|
+
}
|
|
2107
|
+
// Cancel any ongoing transition animation
|
|
2108
|
+
if (this.viewTransitionAnimation) {
|
|
2109
|
+
this.viewTransitionAnimation.destroy();
|
|
2110
|
+
this.viewTransitionAnimation = undefined;
|
|
2111
|
+
}
|
|
2112
|
+
const { presentingElement } = this;
|
|
2113
|
+
if (!presentingElement) {
|
|
2114
|
+
return;
|
|
2115
|
+
}
|
|
2116
|
+
// Create transition animation
|
|
2117
|
+
let transitionAnimation;
|
|
2118
|
+
if (this.currentViewIsPortrait && !isPortrait) {
|
|
2119
|
+
// Portrait to landscape transition
|
|
2120
|
+
transitionAnimation = portraitToLandscapeTransition(this.el, {
|
|
2121
|
+
presentingEl: presentingElement});
|
|
2122
|
+
}
|
|
2123
|
+
else {
|
|
2124
|
+
// Landscape to portrait transition
|
|
2125
|
+
transitionAnimation = landscapeToPortraitTransition(this.el, {
|
|
2126
|
+
presentingEl: presentingElement});
|
|
2127
|
+
}
|
|
2128
|
+
// Update state and play animation
|
|
2129
|
+
this.currentViewIsPortrait = isPortrait;
|
|
2130
|
+
this.viewTransitionAnimation = transitionAnimation;
|
|
2131
|
+
transitionAnimation.play().then(() => {
|
|
2132
|
+
this.viewTransitionAnimation = undefined;
|
|
2133
|
+
});
|
|
2134
|
+
}
|
|
2135
|
+
cleanupViewTransitionListener() {
|
|
2136
|
+
if (this.resizeListener) {
|
|
2137
|
+
window.removeEventListener('resize', this.resizeListener);
|
|
2138
|
+
this.resizeListener = undefined;
|
|
2139
|
+
}
|
|
2140
|
+
if (this.viewTransitionAnimation) {
|
|
2141
|
+
this.viewTransitionAnimation.destroy();
|
|
2142
|
+
this.viewTransitionAnimation = undefined;
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
1948
2145
|
render() {
|
|
1949
2146
|
const { handle, isSheetModal, presentingElement, htmlAttributes, handleBehavior, inheritedAttributes, focusTrap, expandToScroll, } = this;
|
|
1950
2147
|
const showHandle = handle !== false && isSheetModal;
|
|
1951
2148
|
const mode = getIonMode(this);
|
|
1952
2149
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
1953
2150
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
1954
|
-
|
|
2151
|
+
const isSheetModalWithHandle = isSheetModal && showHandle;
|
|
2152
|
+
return (h(Host, Object.assign({ key: 'd5bcaa588471573e1bcbd99997b306c8ecdd124f', "no-router": true,
|
|
1955
2153
|
// Allow the modal to be navigable when the handle is focusable
|
|
1956
|
-
tabIndex:
|
|
2154
|
+
tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
|
|
1957
2155
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
1958
|
-
}, 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: '
|
|
2156
|
+
}, 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',
|
|
1959
2157
|
/*
|
|
1960
2158
|
role and aria-modal must be used on the
|
|
1961
2159
|
same element. They must also be set inside the
|
|
1962
2160
|
shadow DOM otherwise ion-button will not be highlighted
|
|
1963
2161
|
when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
|
|
1964
2162
|
*/
|
|
1965
|
-
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { key: '
|
|
2163
|
+
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",
|
|
1966
2164
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
1967
|
-
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: '
|
|
2165
|
+
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' }))));
|
|
1968
2166
|
}
|
|
1969
2167
|
get el() { return getElement(this); }
|
|
1970
2168
|
static get watchers() { return {
|