@ionic/core 7.4.4-dev.11696956070.1faa3cfe → 7.4.4-dev.11699472243.1ccd503d
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/alert.js +8 -0
- package/components/checkbox.js +0 -3
- package/components/data.js +96 -22
- package/components/haptic.js +1 -0
- package/components/icon.js +9 -5
- package/components/index.js +1 -0
- package/components/index4.js +26 -19
- package/components/index7.js +1 -1
- package/components/ion-datetime-button.js +4 -4
- package/components/ion-datetime.js +3 -3
- package/components/ion-menu.js +0 -12
- package/components/ion-nav.js +1 -0
- package/components/ion-router.js +3 -0
- package/components/ion-select.js +1 -1
- package/components/ion-toast.js +157 -13
- package/components/ion-toggle.js +0 -3
- package/components/ios.transition.js +1 -0
- package/components/overlays.js +1 -0
- package/components/radio-group.js +1 -1
- package/components/radio.js +1 -4
- package/dist/cjs/{button-active-c358e83c.js → button-active-f2147e85.js} +1 -1
- package/dist/cjs/{data-db832785.js → data-c8d21093.js} +96 -22
- package/dist/cjs/{haptic-c5f6b4d5.js → haptic-678abc9f.js} +1 -0
- package/dist/cjs/{index-1f1ea05f.js → index-2e612e35.js} +26 -19
- package/dist/cjs/{index-fa649bd8.js → index-33d2809c.js} +2 -2
- package/dist/cjs/{index-d8d1fc0b.js → index-d8f84c5a.js} +1 -1
- package/dist/cjs/index.cjs.js +8 -6
- package/dist/cjs/ion-accordion_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +3 -3
- package/dist/cjs/ion-alert.cjs.entry.js +11 -3
- package/dist/cjs/ion-app_8.cjs.entry.js +1 -1
- package/dist/cjs/ion-back-button.cjs.entry.js +1 -1
- package/dist/cjs/ion-breadcrumb_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-button_2.cjs.entry.js +9 -5
- package/dist/cjs/ion-checkbox.cjs.entry.js +0 -3
- package/dist/cjs/ion-datetime-button.cjs.entry.js +4 -4
- package/dist/cjs/ion-datetime_3.cjs.entry.js +6 -6
- package/dist/cjs/ion-fab_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-input.cjs.entry.js +1 -1
- package/dist/cjs/ion-item_8.cjs.entry.js +1 -1
- package/dist/cjs/ion-loading.cjs.entry.js +1 -1
- package/dist/cjs/ion-menu_3.cjs.entry.js +6 -17
- package/dist/cjs/ion-modal.cjs.entry.js +2 -2
- package/dist/cjs/ion-nav_2.cjs.entry.js +2 -1
- package/dist/cjs/ion-picker-column-internal.cjs.entry.js +1 -1
- package/dist/cjs/ion-popover.cjs.entry.js +2 -2
- package/dist/cjs/ion-radio_2.cjs.entry.js +2 -5
- package/dist/cjs/ion-refresher_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-reorder_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-route_4.cjs.entry.js +3 -0
- package/dist/cjs/ion-searchbar.cjs.entry.js +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +3 -3
- package/dist/cjs/ion-toast.cjs.entry.js +174 -32
- package/dist/cjs/ion-toggle.cjs.entry.js +2 -5
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/{ios.transition-4195d10d.js → ios.transition-8ddf91e6.js} +2 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{md.transition-0713f667.js → md.transition-44ff8566.js} +1 -1
- package/dist/cjs/{overlays-efc9d511.js → overlays-9cab437c.js} +1 -0
- package/dist/collection/components/alert/alert.js +8 -0
- package/dist/collection/components/alert/test/a11y/alert.e2e.js +11 -0
- package/dist/collection/components/checkbox/checkbox.js +0 -3
- package/dist/collection/components/datetime/datetime.js +12 -6
- package/dist/collection/components/datetime/test/hour-cycle/datetime.e2e.js +14 -0
- package/dist/collection/components/datetime/utils/data.js +33 -7
- package/dist/collection/components/datetime/utils/format.js +27 -10
- package/dist/collection/components/datetime/utils/helpers.js +37 -5
- package/dist/collection/components/datetime-button/datetime-button.js +4 -4
- package/dist/collection/components/menu/menu.js +0 -12
- package/dist/collection/components/menu/test/multiple/menu.e2e.js +60 -0
- package/dist/collection/components/nav/nav.js +1 -0
- package/dist/collection/components/radio/radio.js +1 -4
- package/dist/collection/components/radio-group/radio-group.js +1 -1
- package/dist/collection/components/router/router.js +2 -0
- package/dist/collection/components/router/utils/path.js +1 -0
- package/dist/collection/components/select/select.js +1 -1
- package/dist/collection/components/toast/animations/ios.enter.js +2 -3
- package/dist/collection/components/toast/animations/ios.leave.js +2 -3
- package/dist/collection/components/toast/animations/md.enter.js +2 -3
- package/dist/collection/components/toast/animations/utils.js +85 -0
- package/dist/collection/components/toast/test/position-anchor/toast.e2e.js +45 -0
- package/dist/collection/components/toast/toast.js +98 -9
- package/dist/collection/components/toggle/toggle.js +0 -3
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/menu-controller/index.js +26 -19
- package/dist/collection/utils/native/haptic.js +1 -0
- package/dist/collection/utils/overlays.js +1 -0
- package/dist/collection/utils/transition/ios.transition.js +1 -0
- package/dist/docs.json +73 -10
- package/dist/esm/{button-active-7180a130.js → button-active-3dd473a1.js} +1 -1
- package/dist/esm/{data-009dbf15.js → data-44d9e816.js} +96 -22
- package/dist/esm/{haptic-6447af60.js → haptic-1243b917.js} +1 -0
- package/dist/esm/{index-ecfc2c9f.js → index-504b03f0.js} +1 -1
- package/dist/esm/{index-0b0dd67c.js → index-6e10cd02.js} +2 -2
- package/dist/esm/{index-97a2bb98.js → index-c3e624b7.js} +26 -19
- package/dist/esm/index.js +7 -6
- package/dist/esm/ion-accordion_2.entry.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +3 -3
- package/dist/esm/ion-alert.entry.js +11 -3
- package/dist/esm/ion-app_8.entry.js +1 -1
- package/dist/esm/ion-back-button.entry.js +1 -1
- package/dist/esm/ion-breadcrumb_2.entry.js +1 -1
- package/dist/esm/ion-button_2.entry.js +9 -5
- package/dist/esm/ion-checkbox.entry.js +0 -3
- package/dist/esm/ion-datetime-button.entry.js +4 -4
- package/dist/esm/ion-datetime_3.entry.js +6 -6
- package/dist/esm/ion-fab_3.entry.js +1 -1
- package/dist/esm/ion-input.entry.js +1 -1
- package/dist/esm/ion-item_8.entry.js +1 -1
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu_3.entry.js +5 -16
- package/dist/esm/ion-modal.entry.js +2 -2
- package/dist/esm/ion-nav_2.entry.js +2 -1
- package/dist/esm/ion-picker-column-internal.entry.js +1 -1
- package/dist/esm/ion-popover.entry.js +2 -2
- package/dist/esm/ion-radio_2.entry.js +2 -5
- package/dist/esm/ion-refresher_2.entry.js +2 -2
- package/dist/esm/ion-reorder_2.entry.js +2 -2
- package/dist/esm/ion-route_4.entry.js +3 -0
- package/dist/esm/ion-searchbar.entry.js +1 -1
- package/dist/esm/ion-select_3.entry.js +3 -3
- package/dist/esm/ion-toast.entry.js +157 -15
- package/dist/esm/ion-toggle.entry.js +2 -5
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/{ios.transition-875ba2ea.js → ios.transition-6707a3a1.js} +2 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{md.transition-54c79f72.js → md.transition-957964fd.js} +1 -1
- package/dist/esm/{overlays-84621c0a.js → overlays-753933fc.js} +1 -0
- package/dist/esm-es5/{button-active-7180a130.js → button-active-3dd473a1.js} +1 -1
- package/dist/esm-es5/data-44d9e816.js +4 -0
- package/dist/esm-es5/{index-0b0dd67c.js → index-6e10cd02.js} +1 -1
- package/dist/esm-es5/index-c3e624b7.js +4 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/ion-accordion_2.entry.js +1 -1
- package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
- package/dist/esm-es5/ion-alert.entry.js +1 -1
- package/dist/esm-es5/ion-app_8.entry.js +1 -1
- package/dist/esm-es5/ion-back-button.entry.js +1 -1
- package/dist/esm-es5/ion-breadcrumb_2.entry.js +1 -1
- package/dist/esm-es5/ion-button_2.entry.js +1 -1
- package/dist/esm-es5/ion-checkbox.entry.js +1 -1
- package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-fab_3.entry.js +1 -1
- package/dist/esm-es5/ion-input.entry.js +1 -1
- package/dist/esm-es5/ion-item_8.entry.js +1 -1
- package/dist/esm-es5/ion-loading.entry.js +1 -1
- package/dist/esm-es5/ion-menu_3.entry.js +1 -1
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/esm-es5/ion-nav_2.entry.js +1 -1
- package/dist/esm-es5/ion-picker-column-internal.entry.js +1 -1
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ion-radio_2.entry.js +1 -1
- package/dist/esm-es5/ion-refresher_2.entry.js +1 -1
- package/dist/esm-es5/ion-reorder_2.entry.js +1 -1
- package/dist/esm-es5/ion-searchbar.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/esm-es5/ion-toast.entry.js +1 -1
- package/dist/esm-es5/ion-toggle.entry.js +1 -1
- package/dist/esm-es5/ionic.js +1 -1
- package/dist/esm-es5/{ios.transition-875ba2ea.js → ios.transition-6707a3a1.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{md.transition-54c79f72.js → md.transition-957964fd.js} +1 -1
- package/dist/html.html-data.json +11 -1
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-2134558d.entry.js → p-0023e6eb.entry.js} +1 -1
- package/dist/ionic/{p-0dcdf480.system.entry.js → p-00f709ca.system.entry.js} +1 -1
- package/dist/ionic/{p-2330af92.system.entry.js → p-037e2738.system.entry.js} +1 -1
- package/dist/ionic/{p-678f37d7.entry.js → p-03f7e3cc.entry.js} +1 -1
- package/dist/ionic/{p-a1d7f4ef.entry.js → p-0459db58.entry.js} +1 -1
- package/dist/ionic/{p-b2397f35.entry.js → p-06756f31.entry.js} +1 -1
- package/dist/ionic/p-0779a5c8.system.js +4 -0
- package/dist/ionic/{p-8c17d825.js → p-0d198537.js} +1 -1
- package/dist/ionic/{p-a9d7f984.entry.js → p-0d3d44e7.entry.js} +1 -1
- package/dist/ionic/p-100ea813.system.entry.js +4 -0
- package/dist/ionic/{p-f4267847.system.entry.js → p-10fcb3a3.system.entry.js} +1 -1
- package/dist/ionic/{p-00d3814a.system.entry.js → p-14fd96a2.system.entry.js} +1 -1
- package/dist/ionic/p-17240d90.js +4 -0
- package/dist/ionic/{p-af39c1c5.js → p-1d9b39f3.js} +1 -1
- package/dist/ionic/{p-a1528344.entry.js → p-2acea831.entry.js} +1 -1
- package/dist/ionic/p-2b47b2ce.entry.js +4 -0
- package/dist/ionic/p-32b5f10e.entry.js +4 -0
- package/dist/ionic/{p-007168b8.system.entry.js → p-3634b770.system.entry.js} +1 -1
- package/dist/ionic/{p-3d278648.system.entry.js → p-416d7f8d.system.entry.js} +1 -1
- package/dist/ionic/{p-979dc719.entry.js → p-44fa0a61.entry.js} +1 -1
- package/dist/ionic/{p-a51f5932.entry.js → p-4555335a.entry.js} +1 -1
- package/dist/ionic/p-469d6a98.entry.js +4 -0
- package/dist/ionic/{p-a4e95028.system.entry.js → p-48159bfc.system.entry.js} +1 -1
- package/dist/ionic/p-50125c8c.js +4 -0
- package/dist/ionic/p-520789c2.js +4 -0
- package/dist/ionic/{p-17dd92fe.system.entry.js → p-5b5311f6.system.entry.js} +1 -1
- package/dist/ionic/{p-24952f8a.system.entry.js → p-5cafe439.system.entry.js} +1 -1
- package/dist/ionic/{p-eaa58d23.entry.js → p-60dee335.entry.js} +1 -1
- package/dist/ionic/p-68b405cc.entry.js +4 -0
- package/dist/ionic/{p-6ce891b2.entry.js → p-6a3c14d1.entry.js} +1 -1
- package/dist/ionic/{p-28678af4.system.entry.js → p-6a92db9d.system.entry.js} +1 -1
- package/dist/ionic/p-6cfcb294.system.js +4 -0
- package/dist/ionic/{p-018ad59f.entry.js → p-70441a5b.entry.js} +1 -1
- package/dist/ionic/p-73eba881.system.js +1 -1
- package/dist/ionic/{p-0c7d0167.system.entry.js → p-7520e873.system.entry.js} +1 -1
- package/dist/ionic/{p-df951755.system.entry.js → p-88a1a4fe.system.entry.js} +1 -1
- package/dist/ionic/{p-0fc8a522.system.entry.js → p-8957b1de.system.entry.js} +1 -1
- package/dist/ionic/{p-9e6bf328.system.js → p-90012797.system.js} +1 -1
- package/dist/ionic/{p-a8403bed.system.entry.js → p-9736406a.system.entry.js} +1 -1
- package/dist/ionic/{p-0e070fbe.entry.js → p-9b796813.entry.js} +1 -1
- package/dist/ionic/{p-2062958e.js → p-9dbc208c.js} +1 -1
- package/dist/ionic/{p-52e5f8f0.system.entry.js → p-a157df46.system.entry.js} +1 -1
- package/dist/ionic/p-a4ce3b06.system.entry.js +4 -0
- package/dist/ionic/{p-f6f4d4bb.system.entry.js → p-a60cff26.system.entry.js} +1 -1
- package/dist/ionic/{p-a6c52452.entry.js → p-a7361c85.entry.js} +1 -1
- package/dist/ionic/{p-32eaa293.entry.js → p-a99e7e72.entry.js} +1 -1
- package/dist/ionic/p-aae05032.entry.js +4 -0
- package/dist/ionic/{p-7061fa75.system.entry.js → p-ae57449e.system.entry.js} +1 -1
- package/dist/ionic/{p-e92068d4.system.entry.js → p-ae8121f5.system.entry.js} +1 -1
- package/dist/ionic/{p-d17638e9.system.js → p-b25a96b7.system.js} +1 -1
- package/dist/ionic/{p-53d4606a.entry.js → p-b4f14d9e.entry.js} +1 -1
- package/dist/ionic/{p-ec29338e.entry.js → p-b7ac706d.entry.js} +1 -1
- package/dist/ionic/p-b8c3f071.system.js +4 -0
- package/dist/ionic/{p-dd0c00ed.entry.js → p-bc7420cc.entry.js} +1 -1
- package/dist/ionic/{p-ab37db48.entry.js → p-c0c794dd.entry.js} +1 -1
- package/dist/ionic/{p-e40b2cb4.system.entry.js → p-ccdd595c.system.entry.js} +1 -1
- package/dist/ionic/p-d0d59328.entry.js +4 -0
- package/dist/ionic/p-d1df86ff.entry.js +4 -0
- package/dist/ionic/{p-f1c2678b.system.entry.js → p-d8eeabae.system.entry.js} +1 -1
- package/dist/ionic/{p-cd075e75.system.entry.js → p-db8b267a.system.entry.js} +1 -1
- package/dist/ionic/{p-5fd0a13e.system.entry.js → p-dcfea01f.system.entry.js} +1 -1
- package/dist/ionic/{p-b7258ddb.system.js → p-e0f66356.system.js} +1 -1
- package/dist/ionic/{p-7c901810.system.js → p-ec25d547.system.js} +1 -1
- package/dist/ionic/{p-67e21699.entry.js → p-ef4408d6.entry.js} +1 -1
- package/dist/ionic/{p-d511de89.system.entry.js → p-efd574eb.system.entry.js} +1 -1
- package/dist/ionic/{p-7fd0f045.system.entry.js → p-f48af9da.system.entry.js} +1 -1
- package/dist/node_modules/ionicons/dist/collection/components/icon/icon.css +46 -4
- package/dist/types/components/datetime/datetime-interface.d.ts +1 -0
- package/dist/types/components/datetime/datetime.d.ts +2 -2
- package/dist/types/components/datetime/utils/data.d.ts +3 -3
- package/dist/types/components/datetime/utils/format.d.ts +3 -3
- package/dist/types/components/datetime/utils/helpers.d.ts +15 -1
- package/dist/types/components/menu/menu-interface.d.ts +0 -1
- package/dist/types/components/toast/animations/ios.enter.d.ts +2 -1
- package/dist/types/components/toast/animations/ios.leave.d.ts +2 -2
- package/dist/types/components/toast/animations/md.enter.d.ts +2 -1
- package/dist/types/components/toast/animations/utils.d.ts +18 -0
- package/dist/types/components/toast/toast-interface.d.ts +11 -0
- package/dist/types/components/toast/toast.d.ts +21 -1
- package/dist/types/components.d.ts +16 -8
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/menu-controller/index.d.ts +1 -2
- package/hydrate/index.js +309 -87
- package/package.json +5 -6
- package/dist/esm-es5/data-009dbf15.js +0 -4
- package/dist/esm-es5/index-97a2bb98.js +0 -4
- package/dist/ionic/p-07c816fb.entry.js +0 -4
- package/dist/ionic/p-15041a8c.system.js +0 -4
- package/dist/ionic/p-15278928.entry.js +0 -4
- package/dist/ionic/p-44ef7224.system.js +0 -4
- package/dist/ionic/p-4c274938.entry.js +0 -4
- package/dist/ionic/p-63b4ef44.system.entry.js +0 -4
- package/dist/ionic/p-775f3749.entry.js +0 -4
- package/dist/ionic/p-77872abc.entry.js +0 -4
- package/dist/ionic/p-77b9d68a.system.entry.js +0 -4
- package/dist/ionic/p-7cfd253c.js +0 -4
- package/dist/ionic/p-8b33cfef.entry.js +0 -4
- package/dist/ionic/p-a1e2f98c.js +0 -4
- package/dist/ionic/p-c5395981.js +0 -4
- package/dist/ionic/p-c9524896.system.js +0 -4
- package/dist/ionic/p-d055bba9.entry.js +0 -4
- /package/dist/esm-es5/{haptic-6447af60.js → haptic-1243b917.js} +0 -0
- /package/dist/esm-es5/{index-ecfc2c9f.js → index-504b03f0.js} +0 -0
- /package/dist/esm-es5/{overlays-84621c0a.js → overlays-753933fc.js} +0 -0
- /package/dist/ionic/{p-0a87858b.js → p-15bae383.js} +0 -0
- /package/dist/ionic/{p-8985b268.system.js → p-3f919368.system.js} +0 -0
- /package/dist/ionic/{p-c8ec0d79.system.js → p-82c72668.system.js} +0 -0
- /package/dist/ionic/{p-14d7b7e2.system.js → p-b4b4bb29.system.js} +0 -0
- /package/dist/ionic/{p-bb6f38ed.js → p-b923f3d7.js} +0 -0
- /package/dist/ionic/{p-68a3da51.js → p-ee8881d0.js} +0 -0
package/hydrate/index.js
CHANGED
|
@@ -6421,7 +6421,7 @@ const shallowEqualStringMap = (map1, map2) => {
|
|
|
6421
6421
|
return true;
|
|
6422
6422
|
};
|
|
6423
6423
|
|
|
6424
|
-
/* Ionicons v7.1.
|
|
6424
|
+
/* Ionicons v7.1.2, ES Modules */
|
|
6425
6425
|
const arrowBackSharp = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'><path stroke-linecap='square' stroke-miterlimit='10' stroke-width='48' d='M244 400L100 256l144-144M120 256h292' class='ionicon-fill-none'/></svg>";
|
|
6426
6426
|
const arrowDown = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'><path stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 268l144 144 144-144M256 392V100' class='ionicon-fill-none'/></svg>";
|
|
6427
6427
|
const caretBackSharp = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'><path d='M368 64L144 256l224 192V64z'/></svg>";
|
|
@@ -7149,6 +7149,7 @@ const HapticEngine = {
|
|
|
7149
7149
|
* if the browser does not support the Vibrate API.
|
|
7150
7150
|
*/
|
|
7151
7151
|
if ((capacitor === null || capacitor === void 0 ? void 0 : capacitor.getPlatform()) === 'web') {
|
|
7152
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
7152
7153
|
return typeof navigator !== 'undefined' && navigator.vibrate !== undefined;
|
|
7153
7154
|
}
|
|
7154
7155
|
return true;
|
|
@@ -8218,6 +8219,7 @@ const setOverlayId = (el) => {
|
|
|
8218
8219
|
return el.id;
|
|
8219
8220
|
};
|
|
8220
8221
|
const createOverlay = (tagName, opts) => {
|
|
8222
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
8221
8223
|
if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined') {
|
|
8222
8224
|
return window.customElements.whenDefined(tagName).then(() => {
|
|
8223
8225
|
const element = document.createElement(tagName);
|
|
@@ -10546,6 +10548,14 @@ class Alert {
|
|
|
10546
10548
|
}
|
|
10547
10549
|
onKeydown(ev) {
|
|
10548
10550
|
const inputTypes = new Set(this.processedInputs.map((i) => i.type));
|
|
10551
|
+
/**
|
|
10552
|
+
* Based on keyboard navigation requirements, the
|
|
10553
|
+
* checkbox should not respond to the enter keydown event.
|
|
10554
|
+
*/
|
|
10555
|
+
if (inputTypes.has('checkbox') && ev.key === 'Enter') {
|
|
10556
|
+
ev.preventDefault();
|
|
10557
|
+
return;
|
|
10558
|
+
}
|
|
10549
10559
|
// The only inputs we want to navigate between using arrow keys are the radios
|
|
10550
10560
|
// ignore the keydown event if it is not on a radio button
|
|
10551
10561
|
if (!inputTypes.has('radio') ||
|
|
@@ -12185,9 +12195,6 @@ class Checkbox {
|
|
|
12185
12195
|
this.ionBlur.emit();
|
|
12186
12196
|
};
|
|
12187
12197
|
this.onClick = (ev) => {
|
|
12188
|
-
if (this.disabled) {
|
|
12189
|
-
return;
|
|
12190
|
-
}
|
|
12191
12198
|
this.toggleChecked(ev);
|
|
12192
12199
|
};
|
|
12193
12200
|
this.color = undefined;
|
|
@@ -13075,13 +13082,19 @@ const warnIfValueOutOfBounds = (value, min, max) => {
|
|
|
13075
13082
|
const isLeapYear = (year) => {
|
|
13076
13083
|
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
|
13077
13084
|
};
|
|
13078
|
-
|
|
13085
|
+
/**
|
|
13086
|
+
* Determines the hour cycle for a user.
|
|
13087
|
+
* If the hour cycle is explicitly defined, just use that.
|
|
13088
|
+
* Otherwise, we try to derive it from either the specified
|
|
13089
|
+
* locale extension tags or from Intl.DateTimeFormat directly.
|
|
13090
|
+
*/
|
|
13091
|
+
const getHourCycle = (locale, hourCycle) => {
|
|
13079
13092
|
/**
|
|
13080
|
-
* If developer has explicitly enabled
|
|
13093
|
+
* If developer has explicitly enabled 24-hour time
|
|
13081
13094
|
* then return early and do not look at the system default.
|
|
13082
13095
|
*/
|
|
13083
13096
|
if (hourCycle !== undefined) {
|
|
13084
|
-
return hourCycle
|
|
13097
|
+
return hourCycle;
|
|
13085
13098
|
}
|
|
13086
13099
|
/**
|
|
13087
13100
|
* If hourCycle was not specified, check the locale
|
|
@@ -13092,7 +13105,7 @@ const is24Hour = (locale, hourCycle) => {
|
|
|
13092
13105
|
const formatted = new Intl.DateTimeFormat(locale, { hour: 'numeric' });
|
|
13093
13106
|
const options = formatted.resolvedOptions();
|
|
13094
13107
|
if (options.hourCycle !== undefined) {
|
|
13095
|
-
return options.hourCycle
|
|
13108
|
+
return options.hourCycle;
|
|
13096
13109
|
}
|
|
13097
13110
|
/**
|
|
13098
13111
|
* If hourCycle is not specified (either through lack
|
|
@@ -13105,7 +13118,33 @@ const is24Hour = (locale, hourCycle) => {
|
|
|
13105
13118
|
if (!hour) {
|
|
13106
13119
|
throw new Error('Hour value not found from DateTimeFormat');
|
|
13107
13120
|
}
|
|
13108
|
-
|
|
13121
|
+
/**
|
|
13122
|
+
* Midnight for h11 starts at 0:00am
|
|
13123
|
+
* Midnight for h12 starts at 12:00am
|
|
13124
|
+
* Midnight for h23 starts at 00:00
|
|
13125
|
+
* Midnight for h24 starts at 24:00
|
|
13126
|
+
*/
|
|
13127
|
+
switch (hour.value) {
|
|
13128
|
+
case '0':
|
|
13129
|
+
return 'h11';
|
|
13130
|
+
case '12':
|
|
13131
|
+
return 'h12';
|
|
13132
|
+
case '00':
|
|
13133
|
+
return 'h23';
|
|
13134
|
+
case '24':
|
|
13135
|
+
return 'h24';
|
|
13136
|
+
default:
|
|
13137
|
+
throw new Error(`Invalid hour cycle "${hourCycle}"`);
|
|
13138
|
+
}
|
|
13139
|
+
};
|
|
13140
|
+
/**
|
|
13141
|
+
* Determine if the hour cycle uses a 24-hour format.
|
|
13142
|
+
* Returns true for h23 and h24. Returns false otherwise.
|
|
13143
|
+
* If you don't know the hourCycle, use getHourCycle above
|
|
13144
|
+
* and pass the result into this function.
|
|
13145
|
+
*/
|
|
13146
|
+
const is24Hour = (hourCycle) => {
|
|
13147
|
+
return hourCycle === 'h23' || hourCycle === 'h24';
|
|
13109
13148
|
};
|
|
13110
13149
|
/**
|
|
13111
13150
|
* Given a date object, returns the number
|
|
@@ -13772,7 +13811,7 @@ const getFormattedDayPeriod = (dayPeriod) => {
|
|
|
13772
13811
|
}
|
|
13773
13812
|
return dayPeriod.toUpperCase();
|
|
13774
13813
|
};
|
|
13775
|
-
const getLocalizedTime = (locale, refParts,
|
|
13814
|
+
const getLocalizedTime = (locale, refParts, hourCycle) => {
|
|
13776
13815
|
const timeParts = {
|
|
13777
13816
|
hour: refParts.hour,
|
|
13778
13817
|
minute: refParts.minute,
|
|
@@ -13794,7 +13833,7 @@ const getLocalizedTime = (locale, refParts, use24Hour) => {
|
|
|
13794
13833
|
* We use hourCycle here instead of hour12 due to:
|
|
13795
13834
|
* https://bugs.chromium.org/p/chromium/issues/detail?id=1347316&q=hour12&can=2
|
|
13796
13835
|
*/
|
|
13797
|
-
hourCycle
|
|
13836
|
+
hourCycle,
|
|
13798
13837
|
/**
|
|
13799
13838
|
* Setting Z at the end indicates that this
|
|
13800
13839
|
* date string is in the UTC time zone. This
|
|
@@ -13832,17 +13871,33 @@ const addTimePadding = (value) => {
|
|
|
13832
13871
|
* 12 hour times it ensures that
|
|
13833
13872
|
* hour 0 is formatted as '12'.
|
|
13834
13873
|
*/
|
|
13835
|
-
const getFormattedHour = (hour,
|
|
13836
|
-
if (use24Hour) {
|
|
13837
|
-
return addTimePadding(hour);
|
|
13838
|
-
}
|
|
13874
|
+
const getFormattedHour = (hour, hourCycle) => {
|
|
13839
13875
|
/**
|
|
13840
|
-
*
|
|
13841
|
-
*
|
|
13842
|
-
*
|
|
13876
|
+
* Midnight for h11 starts at 0:00am
|
|
13877
|
+
* Midnight for h12 starts at 12:00am
|
|
13878
|
+
* Midnight for h23 starts at 00:00
|
|
13879
|
+
* Midnight for h24 starts at 24:00
|
|
13843
13880
|
*/
|
|
13844
13881
|
if (hour === 0) {
|
|
13845
|
-
|
|
13882
|
+
switch (hourCycle) {
|
|
13883
|
+
case 'h11':
|
|
13884
|
+
return '0';
|
|
13885
|
+
case 'h12':
|
|
13886
|
+
return '12';
|
|
13887
|
+
case 'h23':
|
|
13888
|
+
return '00';
|
|
13889
|
+
case 'h24':
|
|
13890
|
+
return '24';
|
|
13891
|
+
default:
|
|
13892
|
+
throw new Error(`Invalid hour cycle "${hourCycle}"`);
|
|
13893
|
+
}
|
|
13894
|
+
}
|
|
13895
|
+
const use24Hour = is24Hour(hourCycle);
|
|
13896
|
+
/**
|
|
13897
|
+
* h23 and h24 use 24 hour times.
|
|
13898
|
+
*/
|
|
13899
|
+
if (use24Hour) {
|
|
13900
|
+
return addTimePadding(hour);
|
|
13846
13901
|
}
|
|
13847
13902
|
return hour.toString();
|
|
13848
13903
|
};
|
|
@@ -14077,8 +14132,14 @@ const minutes = [
|
|
|
14077
14132
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
|
14078
14133
|
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
|
|
14079
14134
|
];
|
|
14135
|
+
// h11 hour system uses 0-11. Midnight starts at 0:00am.
|
|
14136
|
+
const hour11 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
14137
|
+
// h12 hour system uses 0-12. Midnight starts at 12:00am.
|
|
14080
14138
|
const hour12 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
14139
|
+
// h23 hour system uses 0-23. Midnight starts at 0:00.
|
|
14081
14140
|
const hour23 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
|
|
14141
|
+
// h24 hour system uses 1-24. Midnight starts at 24:00.
|
|
14142
|
+
const hour24 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0];
|
|
14082
14143
|
/**
|
|
14083
14144
|
* Given a locale and a mode,
|
|
14084
14145
|
* return an array with formatted days
|
|
@@ -14147,14 +14208,33 @@ const getDaysOfMonth = (month, year, firstDayOfWeek) => {
|
|
|
14147
14208
|
}
|
|
14148
14209
|
return days;
|
|
14149
14210
|
};
|
|
14211
|
+
/**
|
|
14212
|
+
* Returns an array of pre-defined hour
|
|
14213
|
+
* values based on the provided hourCycle.
|
|
14214
|
+
*/
|
|
14215
|
+
const getHourData = (hourCycle) => {
|
|
14216
|
+
switch (hourCycle) {
|
|
14217
|
+
case 'h11':
|
|
14218
|
+
return hour11;
|
|
14219
|
+
case 'h12':
|
|
14220
|
+
return hour12;
|
|
14221
|
+
case 'h23':
|
|
14222
|
+
return hour23;
|
|
14223
|
+
case 'h24':
|
|
14224
|
+
return hour24;
|
|
14225
|
+
default:
|
|
14226
|
+
throw new Error(`Invalid hour cycle "${hourCycle}"`);
|
|
14227
|
+
}
|
|
14228
|
+
};
|
|
14150
14229
|
/**
|
|
14151
14230
|
* Given a local, reference datetime parts and option
|
|
14152
14231
|
* max/min bound datetime parts, calculate the acceptable
|
|
14153
14232
|
* hour and minute values according to the bounds and locale.
|
|
14154
14233
|
*/
|
|
14155
|
-
const generateTime = (refParts, hourCycle = 'h12', minParts, maxParts, hourValues, minuteValues) => {
|
|
14156
|
-
const
|
|
14157
|
-
|
|
14234
|
+
const generateTime = (locale, refParts, hourCycle = 'h12', minParts, maxParts, hourValues, minuteValues) => {
|
|
14235
|
+
const computedHourCycle = getHourCycle(locale, hourCycle);
|
|
14236
|
+
const use24Hour = is24Hour(computedHourCycle);
|
|
14237
|
+
let processedHours = getHourData(computedHourCycle);
|
|
14158
14238
|
let processedMinutes = minutes;
|
|
14159
14239
|
let isAMAllowed = true;
|
|
14160
14240
|
let isPMAllowed = true;
|
|
@@ -14486,11 +14566,12 @@ const getCombinedDateColumnData = (locale, todayParts, minParts, maxParts, dayVa
|
|
|
14486
14566
|
};
|
|
14487
14567
|
};
|
|
14488
14568
|
const getTimeColumnsData = (locale, refParts, hourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues) => {
|
|
14489
|
-
const
|
|
14490
|
-
const
|
|
14569
|
+
const computedHourCycle = getHourCycle(locale, hourCycle);
|
|
14570
|
+
const use24Hour = is24Hour(computedHourCycle);
|
|
14571
|
+
const { hours, minutes, am, pm } = generateTime(locale, refParts, computedHourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues);
|
|
14491
14572
|
const hoursItems = hours.map((hour) => {
|
|
14492
14573
|
return {
|
|
14493
|
-
text: getFormattedHour(hour,
|
|
14574
|
+
text: getFormattedHour(hour, computedHourCycle),
|
|
14494
14575
|
value: getInternalHourValue(hour, use24Hour, refParts.ampm),
|
|
14495
14576
|
};
|
|
14496
14577
|
});
|
|
@@ -16053,7 +16134,7 @@ class Datetime {
|
|
|
16053
16134
|
}
|
|
16054
16135
|
renderTimeOverlay() {
|
|
16055
16136
|
const { hourCycle, isTimePopoverOpen, locale } = this;
|
|
16056
|
-
const
|
|
16137
|
+
const computedHourCycle = getHourCycle(locale, hourCycle);
|
|
16057
16138
|
const activePart = this.getActivePartsWithFallback();
|
|
16058
16139
|
return [
|
|
16059
16140
|
hAsync("div", { class: "time-header" }, this.renderTimeLabel()),
|
|
@@ -16072,7 +16153,7 @@ class Datetime {
|
|
|
16072
16153
|
await popoverRef.onWillDismiss();
|
|
16073
16154
|
this.isTimePopoverOpen = false;
|
|
16074
16155
|
}
|
|
16075
|
-
} }, getLocalizedTime(locale, activePart,
|
|
16156
|
+
} }, getLocalizedTime(locale, activePart, computedHourCycle)),
|
|
16076
16157
|
hAsync("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
|
|
16077
16158
|
/**
|
|
16078
16159
|
* Intersection Observers do not consistently fire between Blink and Webkit
|
|
@@ -16337,13 +16418,13 @@ class DatetimeButton {
|
|
|
16337
16418
|
* warning in the console.
|
|
16338
16419
|
*/
|
|
16339
16420
|
const firstParsedDatetime = parsedDatetimes[0];
|
|
16340
|
-
const
|
|
16421
|
+
const computedHourCycle = getHourCycle(locale, hourCycle);
|
|
16341
16422
|
this.dateText = this.timeText = undefined;
|
|
16342
16423
|
switch (datetimePresentation) {
|
|
16343
16424
|
case 'date-time':
|
|
16344
16425
|
case 'time-date':
|
|
16345
16426
|
const dateText = getMonthDayAndYear(locale, firstParsedDatetime);
|
|
16346
|
-
const timeText = getLocalizedTime(locale, firstParsedDatetime,
|
|
16427
|
+
const timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle);
|
|
16347
16428
|
if (preferWheel) {
|
|
16348
16429
|
this.dateText = `${dateText} ${timeText}`;
|
|
16349
16430
|
}
|
|
@@ -16370,7 +16451,7 @@ class DatetimeButton {
|
|
|
16370
16451
|
}
|
|
16371
16452
|
break;
|
|
16372
16453
|
case 'time':
|
|
16373
|
-
this.timeText = getLocalizedTime(locale, firstParsedDatetime,
|
|
16454
|
+
this.timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle);
|
|
16374
16455
|
break;
|
|
16375
16456
|
case 'month-year':
|
|
16376
16457
|
this.dateText = getMonthAndYear(locale, firstParsedDatetime);
|
|
@@ -17759,7 +17840,7 @@ const isRTL = (hostEl) => {
|
|
|
17759
17840
|
return (document === null || document === void 0 ? void 0 : document.dir.toLowerCase()) === 'rtl';
|
|
17760
17841
|
};
|
|
17761
17842
|
|
|
17762
|
-
const iconCss = "/*!@:host*/.sc-ion-icon-h{display:inline-block;width:1em;height:1em;contain:strict;fill:currentColor;-webkit-box-sizing:content-box !important;box-sizing:content-box !important}/*!@:host .ionicon*/.sc-ion-icon-h .ionicon.sc-ion-icon{stroke:currentColor}/*!@.ionicon-fill-none*/.ionicon-fill-none.sc-ion-icon{fill:none}/*!@.ionicon-stroke-width*/.ionicon-stroke-width.sc-ion-icon{stroke-width:32px;stroke-width:var(--ionicon-stroke-width, 32px)}/*!@.icon-inner,\n.ionicon,\nsvg*/.icon-inner.sc-ion-icon,.ionicon.sc-ion-icon,svg.sc-ion-icon{display:block;height:100%;width:100%}/*!@:host(.flip-rtl) .icon-inner*/.flip-rtl.sc-ion-icon-h .icon-inner.sc-ion-icon{-webkit-transform:scaleX(-1);transform:scaleX(-1)}/*!@:host(.icon-small)*/.icon-small.sc-ion-icon-h{font-size:18px !important}/*!@:host(.icon-large)*/.icon-large.sc-ion-icon-h{font-size:32px !important}/*!@:host(.ion-color)*/.ion-color.sc-ion-icon-h{color:var(--ion-color-base) !important}/*!@:host(.ion-color-primary)*/.ion-color-primary.sc-ion-icon-h{--ion-color-base:var(--ion-color-primary, #3880ff)}/*!@:host(.ion-color-secondary)*/.ion-color-secondary.sc-ion-icon-h{--ion-color-base:var(--ion-color-secondary, #0cd1e8)}/*!@:host(.ion-color-tertiary)*/.ion-color-tertiary.sc-ion-icon-h{--ion-color-base:var(--ion-color-tertiary, #f4a942)}/*!@:host(.ion-color-success)*/.ion-color-success.sc-ion-icon-h{--ion-color-base:var(--ion-color-success, #10dc60)}/*!@:host(.ion-color-warning)*/.ion-color-warning.sc-ion-icon-h{--ion-color-base:var(--ion-color-warning, #ffce00)}/*!@:host(.ion-color-danger)*/.ion-color-danger.sc-ion-icon-h{--ion-color-base:var(--ion-color-danger, #f14141)}/*!@:host(.ion-color-light)*/.ion-color-light.sc-ion-icon-h{--ion-color-base:var(--ion-color-light, #f4f5f8)}/*!@:host(.ion-color-medium)*/.ion-color-medium.sc-ion-icon-h{--ion-color-base:var(--ion-color-medium, #989aa2)}/*!@:host(.ion-color-dark)*/.ion-color-dark.sc-ion-icon-h{--ion-color-base:var(--ion-color-dark, #222428)}";
|
|
17843
|
+
const iconCss = "/*!@:host*/.sc-ion-icon-h{display:inline-block;width:1em;height:1em;contain:strict;fill:currentColor;-webkit-box-sizing:content-box !important;box-sizing:content-box !important}/*!@:host .ionicon*/.sc-ion-icon-h .ionicon.sc-ion-icon{stroke:currentColor}/*!@.ionicon-fill-none*/.ionicon-fill-none.sc-ion-icon{fill:none}/*!@.ionicon-stroke-width*/.ionicon-stroke-width.sc-ion-icon{stroke-width:32px;stroke-width:var(--ionicon-stroke-width, 32px)}/*!@.icon-inner,\n.ionicon,\nsvg*/.icon-inner.sc-ion-icon,.ionicon.sc-ion-icon,svg.sc-ion-icon{display:block;height:100%;width:100%}@supports (background: -webkit-named-image(i)){/*!@:host(.icon-rtl) .icon-inner*/.icon-rtl.sc-ion-icon-h .icon-inner.sc-ion-icon{-webkit-transform:scaleX(-1);transform:scaleX(-1)}}@supports not selector(:dir(rtl)) and selector(:host-context([dir='rtl'])){/*!@:host(.icon-rtl) .icon-inner*/.icon-rtl.sc-ion-icon-h .icon-inner.sc-ion-icon{-webkit-transform:scaleX(-1);transform:scaleX(-1)}}/*!@:host(.flip-rtl):host-context([dir='rtl']) .icon-inner*/.flip-rtl.sc-ion-icon-h -no-combinator[dir='rtl'].sc-ion-icon-h .icon-inner.sc-ion-icon,[dir='rtl'] .sc-ion-icon-h .icon-inner.sc-ion-icon{-webkit-transform:scaleX(-1);transform:scaleX(-1)}@supports selector(:dir(rtl)){/*!@:host(.flip-rtl:dir(rtl)) .icon-inner*/.flip-rtl.sc-ion-icon-h:dir(rtl) .icon-inner.sc-ion-icon{-webkit-transform:scaleX(-1);transform:scaleX(-1)}/*!@:host(.flip-rtl:dir(ltr)) .icon-inner*/.flip-rtl.sc-ion-icon-h:dir(ltr) .icon-inner.sc-ion-icon{-webkit-transform:scaleX(1);transform:scaleX(1)}}/*!@:host(.icon-small)*/.icon-small.sc-ion-icon-h{font-size:18px !important}/*!@:host(.icon-large)*/.icon-large.sc-ion-icon-h{font-size:32px !important}/*!@:host(.ion-color)*/.ion-color.sc-ion-icon-h{color:var(--ion-color-base) !important}/*!@:host(.ion-color-primary)*/.ion-color-primary.sc-ion-icon-h{--ion-color-base:var(--ion-color-primary, #3880ff)}/*!@:host(.ion-color-secondary)*/.ion-color-secondary.sc-ion-icon-h{--ion-color-base:var(--ion-color-secondary, #0cd1e8)}/*!@:host(.ion-color-tertiary)*/.ion-color-tertiary.sc-ion-icon-h{--ion-color-base:var(--ion-color-tertiary, #f4a942)}/*!@:host(.ion-color-success)*/.ion-color-success.sc-ion-icon-h{--ion-color-base:var(--ion-color-success, #10dc60)}/*!@:host(.ion-color-warning)*/.ion-color-warning.sc-ion-icon-h{--ion-color-base:var(--ion-color-warning, #ffce00)}/*!@:host(.ion-color-danger)*/.ion-color-danger.sc-ion-icon-h{--ion-color-base:var(--ion-color-danger, #f14141)}/*!@:host(.ion-color-light)*/.ion-color-light.sc-ion-icon-h{--ion-color-base:var(--ion-color-light, #f4f5f8)}/*!@:host(.ion-color-medium)*/.ion-color-medium.sc-ion-icon-h{--ion-color-base:var(--ion-color-medium, #989aa2)}/*!@:host(.ion-color-dark)*/.ion-color-dark.sc-ion-icon-h{--ion-color-base:var(--ion-color-dark, #222428)}";
|
|
17763
17844
|
|
|
17764
17845
|
class Icon {
|
|
17765
17846
|
constructor(hostRef) {
|
|
@@ -17813,11 +17894,15 @@ class Icon {
|
|
|
17813
17894
|
this.iconName = getName(this.name, this.icon, this.mode, this.ios, this.md);
|
|
17814
17895
|
}
|
|
17815
17896
|
render() {
|
|
17816
|
-
const {
|
|
17897
|
+
const { flipRtl, iconName, inheritedAttributes, el } = this;
|
|
17817
17898
|
const mode = this.mode || 'md';
|
|
17818
|
-
|
|
17819
|
-
|
|
17820
|
-
|
|
17899
|
+
// we have designated that arrows & chevrons should automatically flip (unless flip-rtl is set to false) because "back" is left in ltr and right in rtl, and "forward" is the opposite
|
|
17900
|
+
const shouldAutoFlip = iconName
|
|
17901
|
+
? (iconName.includes('arrow') || iconName.includes('chevron')) && flipRtl !== false
|
|
17902
|
+
: false;
|
|
17903
|
+
// if shouldBeFlippable is true, the icon should change direction when `dir` changes
|
|
17904
|
+
const shouldBeFlippable = flipRtl || shouldAutoFlip;
|
|
17905
|
+
return (hAsync(Host, Object.assign({ role: "img", class: Object.assign(Object.assign({ [mode]: true }, createColorClasses(this.color)), { [`icon-${this.size}`]: !!this.size, 'flip-rtl': shouldBeFlippable, 'icon-rtl': shouldBeFlippable && isRTL(el) }) }, inheritedAttributes), (hAsync("div", { class: "icon-inner" }))));
|
|
17821
17906
|
}
|
|
17822
17907
|
static get assetsDirs() { return ["svg"]; }
|
|
17823
17908
|
get el() { return getElement(this); }
|
|
@@ -20420,21 +20505,21 @@ const createMenuController = () => {
|
|
|
20420
20505
|
const menuAnimations = new Map();
|
|
20421
20506
|
const menus = [];
|
|
20422
20507
|
const open = async (menu) => {
|
|
20423
|
-
const menuEl = await get(menu);
|
|
20508
|
+
const menuEl = await get(menu, true);
|
|
20424
20509
|
if (menuEl) {
|
|
20425
20510
|
return menuEl.open();
|
|
20426
20511
|
}
|
|
20427
20512
|
return false;
|
|
20428
20513
|
};
|
|
20429
20514
|
const close = async (menu) => {
|
|
20430
|
-
const menuEl = await (menu !== undefined ? get(menu) : getOpen());
|
|
20515
|
+
const menuEl = await (menu !== undefined ? get(menu, true) : getOpen());
|
|
20431
20516
|
if (menuEl !== undefined) {
|
|
20432
20517
|
return menuEl.close();
|
|
20433
20518
|
}
|
|
20434
20519
|
return false;
|
|
20435
20520
|
};
|
|
20436
20521
|
const toggle = async (menu) => {
|
|
20437
|
-
const menuEl = await get(menu);
|
|
20522
|
+
const menuEl = await get(menu, true);
|
|
20438
20523
|
if (menuEl) {
|
|
20439
20524
|
return menuEl.toggle();
|
|
20440
20525
|
}
|
|
@@ -20472,18 +20557,35 @@ const createMenuController = () => {
|
|
|
20472
20557
|
}
|
|
20473
20558
|
return false;
|
|
20474
20559
|
};
|
|
20475
|
-
|
|
20560
|
+
/**
|
|
20561
|
+
* Finds and returns the menu specified by "menu" if registered.
|
|
20562
|
+
* @param menu - The side or ID of the desired menu
|
|
20563
|
+
* @param logOnMultipleSideMenus - If true, this function will log a warning
|
|
20564
|
+
* if "menu" is a side but multiple menus on the same side were found. Since this function
|
|
20565
|
+
* is used in multiple places, we default this log to false so that the calling
|
|
20566
|
+
* functions can choose whether or not it is appropriate to log this warning.
|
|
20567
|
+
*/
|
|
20568
|
+
const get = async (menu, logOnMultipleSideMenus = false) => {
|
|
20476
20569
|
await waitUntilReady();
|
|
20477
20570
|
if (menu === 'start' || menu === 'end') {
|
|
20478
20571
|
// there could be more than one menu on the same side
|
|
20479
20572
|
// so first try to get the enabled one
|
|
20480
|
-
const
|
|
20481
|
-
if (
|
|
20482
|
-
|
|
20573
|
+
const menuRefs = menus.filter((m) => m.side === menu && !m.disabled);
|
|
20574
|
+
if (menuRefs.length >= 1) {
|
|
20575
|
+
if (menuRefs.length > 1 && logOnMultipleSideMenus) {
|
|
20576
|
+
printIonWarning(`menuController queried for a menu on the "${menu}" side, but ${menuRefs.length} menus were found. The first menu reference will be used. If this is not the behavior you want then pass the ID of the menu instead of its side.`, menuRefs.map((m) => m.el));
|
|
20577
|
+
}
|
|
20578
|
+
return menuRefs[0].el;
|
|
20483
20579
|
}
|
|
20484
20580
|
// didn't find a menu side that is enabled
|
|
20485
20581
|
// so try to get the first menu side found
|
|
20486
|
-
|
|
20582
|
+
const sideMenuRefs = menus.filter((m) => m.side === menu);
|
|
20583
|
+
if (sideMenuRefs.length >= 1) {
|
|
20584
|
+
if (sideMenuRefs.length > 1 && logOnMultipleSideMenus) {
|
|
20585
|
+
printIonWarning(`menuController queried for a menu on the "${menu}" side, but ${sideMenuRefs.length} menus were found. The first menu reference will be used. If this is not the behavior you want then pass the ID of the menu instead of its side.`, sideMenuRefs.map((m) => m.el));
|
|
20586
|
+
}
|
|
20587
|
+
return sideMenuRefs[0].el;
|
|
20588
|
+
}
|
|
20487
20589
|
}
|
|
20488
20590
|
else if (menu != null) {
|
|
20489
20591
|
// the menuId was not left or right
|
|
@@ -20525,9 +20627,6 @@ const createMenuController = () => {
|
|
|
20525
20627
|
};
|
|
20526
20628
|
const _register = (menu) => {
|
|
20527
20629
|
if (menus.indexOf(menu) < 0) {
|
|
20528
|
-
if (!menu.disabled) {
|
|
20529
|
-
_setActiveMenu(menu);
|
|
20530
|
-
}
|
|
20531
20630
|
menus.push(menu);
|
|
20532
20631
|
}
|
|
20533
20632
|
};
|
|
@@ -20537,13 +20636,6 @@ const createMenuController = () => {
|
|
|
20537
20636
|
menus.splice(index, 1);
|
|
20538
20637
|
}
|
|
20539
20638
|
};
|
|
20540
|
-
const _setActiveMenu = (menu) => {
|
|
20541
|
-
// if this menu should be enabled
|
|
20542
|
-
// then find all the other menus on this same side
|
|
20543
|
-
// and automatically disable other same side menus
|
|
20544
|
-
const side = menu.side;
|
|
20545
|
-
menus.filter((m) => m.side === side && m !== menu).forEach((m) => (m.disabled = true));
|
|
20546
|
-
};
|
|
20547
20639
|
const _setOpen = async (menu, shouldOpen, animated) => {
|
|
20548
20640
|
if (isAnimatingSync()) {
|
|
20549
20641
|
return false;
|
|
@@ -20615,7 +20707,6 @@ const createMenuController = () => {
|
|
|
20615
20707
|
_register,
|
|
20616
20708
|
_unregister,
|
|
20617
20709
|
_setOpen,
|
|
20618
|
-
_setActiveMenu,
|
|
20619
20710
|
};
|
|
20620
20711
|
};
|
|
20621
20712
|
const menuController = /*@__PURE__*/ createMenuController();
|
|
@@ -21171,17 +21262,6 @@ class Menu {
|
|
|
21171
21262
|
*/
|
|
21172
21263
|
this.afterAnimation(false);
|
|
21173
21264
|
}
|
|
21174
|
-
if (doc === null || doc === void 0 ? void 0 : doc.contains(this.el)) {
|
|
21175
|
-
/**
|
|
21176
|
-
* Only set the active menu if the menu element is
|
|
21177
|
-
* present in the DOM. Otherwise if it was destructively
|
|
21178
|
-
* re-hydrated (through Angular Universal), then ignore
|
|
21179
|
-
* setting the removed node as the active menu.
|
|
21180
|
-
*/
|
|
21181
|
-
if (!this.disabled) {
|
|
21182
|
-
menuController._setActiveMenu(this);
|
|
21183
|
-
}
|
|
21184
|
-
}
|
|
21185
21265
|
}
|
|
21186
21266
|
render() {
|
|
21187
21267
|
const { type, disabled, isPaneVisible, inheritedAttributes, side } = this;
|
|
@@ -23985,6 +24065,7 @@ class Nav {
|
|
|
23985
24065
|
: undefined;
|
|
23986
24066
|
const mode = getIonMode$1(this);
|
|
23987
24067
|
const enteringEl = enteringView.element;
|
|
24068
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
23988
24069
|
const leavingEl = leavingView && leavingView.element;
|
|
23989
24070
|
const animationOpts = Object.assign(Object.assign({ mode, showGoBack: this.canGoBackSync(enteringView), baseEl: this.el, progressCallback, animated: this.animated && config.getBoolean('animated', true), enteringEl,
|
|
23990
24071
|
leavingEl }, opts), { animationBuilder: opts.animationBuilder || this.animation || config.get('navAnimation') });
|
|
@@ -27195,10 +27276,7 @@ class Radio {
|
|
|
27195
27276
|
}
|
|
27196
27277
|
};
|
|
27197
27278
|
this.onClick = () => {
|
|
27198
|
-
const { radioGroup, checked
|
|
27199
|
-
if (disabled) {
|
|
27200
|
-
return;
|
|
27201
|
-
}
|
|
27279
|
+
const { radioGroup, checked } = this;
|
|
27202
27280
|
/**
|
|
27203
27281
|
* The legacy control uses a native input inside
|
|
27204
27282
|
* of the radio host, so we can set this.checked
|
|
@@ -27419,7 +27497,7 @@ class RadioGroup {
|
|
|
27419
27497
|
* using the `name` attribute.
|
|
27420
27498
|
*/
|
|
27421
27499
|
const selectedRadio = ev.target && ev.target.closest('ion-radio');
|
|
27422
|
-
if (selectedRadio
|
|
27500
|
+
if (selectedRadio) {
|
|
27423
27501
|
const currentValue = this.value;
|
|
27424
27502
|
const newValue = selectedRadio.value;
|
|
27425
27503
|
if (newValue !== currentValue) {
|
|
@@ -29746,6 +29824,7 @@ const chainToSegments = (chain) => {
|
|
|
29746
29824
|
for (const route of chain) {
|
|
29747
29825
|
for (const segment of route.segments) {
|
|
29748
29826
|
if (segment[0] === ':') {
|
|
29827
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
29749
29828
|
const param = route.params && route.params[segment.slice(1)];
|
|
29750
29829
|
if (!param) {
|
|
29751
29830
|
return null;
|
|
@@ -30441,12 +30520,14 @@ class Router {
|
|
|
30441
30520
|
}
|
|
30442
30521
|
const routes = readRoutes(this.el);
|
|
30443
30522
|
const fromChain = findChainForSegments(from, routes);
|
|
30523
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
30444
30524
|
const beforeLeaveHook = fromChain && fromChain[fromChain.length - 1].beforeLeave;
|
|
30445
30525
|
const canLeave = beforeLeaveHook ? await beforeLeaveHook() : true;
|
|
30446
30526
|
if (canLeave === false || typeof canLeave === 'object') {
|
|
30447
30527
|
return canLeave;
|
|
30448
30528
|
}
|
|
30449
30529
|
const toChain = findChainForSegments(to, routes);
|
|
30530
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
30450
30531
|
const beforeEnterHook = toChain && toChain[toChain.length - 1].beforeEnter;
|
|
30451
30532
|
return beforeEnterHook ? beforeEnterHook() : true;
|
|
30452
30533
|
}
|
|
@@ -32332,7 +32413,7 @@ Developers can use the "legacy" property to continue using the legacy form marku
|
|
|
32332
32413
|
}
|
|
32333
32414
|
renderListbox() {
|
|
32334
32415
|
const { disabled, inputId, isExpanded } = this;
|
|
32335
|
-
return (hAsync("button", { disabled: disabled, id: inputId, "aria-label": this.ariaLabel, "aria-haspopup": "
|
|
32416
|
+
return (hAsync("button", { disabled: disabled, id: inputId, "aria-label": this.ariaLabel, "aria-haspopup": "dialog", "aria-expanded": `${isExpanded}`, onFocus: this.onFocus, onBlur: this.onBlur, ref: (focusEl) => (this.focusEl = focusEl) }));
|
|
32336
32417
|
}
|
|
32337
32418
|
render() {
|
|
32338
32419
|
const { legacyFormController } = this;
|
|
@@ -33674,13 +33755,12 @@ class Thumbnail {
|
|
|
33674
33755
|
/**
|
|
33675
33756
|
* iOS Toast Enter Animation
|
|
33676
33757
|
*/
|
|
33677
|
-
const iosEnterAnimation = (baseEl,
|
|
33758
|
+
const iosEnterAnimation = (baseEl, opts) => {
|
|
33678
33759
|
const baseAnimation = createAnimation();
|
|
33679
33760
|
const wrapperAnimation = createAnimation();
|
|
33761
|
+
const { position, top, bottom } = opts;
|
|
33680
33762
|
const root = getElementRoot(baseEl);
|
|
33681
33763
|
const wrapperEl = root.querySelector('.toast-wrapper');
|
|
33682
|
-
const bottom = `calc(-10px - var(--ion-safe-area-bottom, 0px))`;
|
|
33683
|
-
const top = `calc(10px + var(--ion-safe-area-top, 0px))`;
|
|
33684
33764
|
wrapperAnimation.addElement(wrapperEl);
|
|
33685
33765
|
switch (position) {
|
|
33686
33766
|
case 'top':
|
|
@@ -33701,13 +33781,12 @@ const iosEnterAnimation = (baseEl, position) => {
|
|
|
33701
33781
|
/**
|
|
33702
33782
|
* iOS Toast Leave Animation
|
|
33703
33783
|
*/
|
|
33704
|
-
const iosLeaveAnimation = (baseEl,
|
|
33784
|
+
const iosLeaveAnimation = (baseEl, opts) => {
|
|
33705
33785
|
const baseAnimation = createAnimation();
|
|
33706
33786
|
const wrapperAnimation = createAnimation();
|
|
33787
|
+
const { position, top, bottom } = opts;
|
|
33707
33788
|
const root = getElementRoot(baseEl);
|
|
33708
33789
|
const wrapperEl = root.querySelector('.toast-wrapper');
|
|
33709
|
-
const bottom = `calc(-10px - var(--ion-safe-area-bottom, 0px))`;
|
|
33710
|
-
const top = `calc(10px + var(--ion-safe-area-top, 0px))`;
|
|
33711
33790
|
wrapperAnimation.addElement(wrapperEl);
|
|
33712
33791
|
switch (position) {
|
|
33713
33792
|
case 'top':
|
|
@@ -33726,13 +33805,12 @@ const iosLeaveAnimation = (baseEl, position) => {
|
|
|
33726
33805
|
/**
|
|
33727
33806
|
* MD Toast Enter Animation
|
|
33728
33807
|
*/
|
|
33729
|
-
const mdEnterAnimation = (baseEl,
|
|
33808
|
+
const mdEnterAnimation = (baseEl, opts) => {
|
|
33730
33809
|
const baseAnimation = createAnimation();
|
|
33731
33810
|
const wrapperAnimation = createAnimation();
|
|
33811
|
+
const { position, top, bottom } = opts;
|
|
33732
33812
|
const root = getElementRoot(baseEl);
|
|
33733
33813
|
const wrapperEl = root.querySelector('.toast-wrapper');
|
|
33734
|
-
const bottom = `calc(8px + var(--ion-safe-area-bottom, 0px))`;
|
|
33735
|
-
const top = `calc(8px + var(--ion-safe-area-top, 0px))`;
|
|
33736
33814
|
wrapperAnimation.addElement(wrapperEl);
|
|
33737
33815
|
switch (position) {
|
|
33738
33816
|
case 'top':
|
|
@@ -33764,6 +33842,87 @@ const mdLeaveAnimation = (baseEl) => {
|
|
|
33764
33842
|
return baseAnimation.easing('cubic-bezier(.36,.66,.04,1)').duration(300).addAnimation(wrapperAnimation);
|
|
33765
33843
|
};
|
|
33766
33844
|
|
|
33845
|
+
/**
|
|
33846
|
+
* Calculate the CSS top and bottom position of the toast, to be used
|
|
33847
|
+
* as starting points for the animation keyframes.
|
|
33848
|
+
*
|
|
33849
|
+
* Note that MD animates bottom-positioned toasts using style.bottom,
|
|
33850
|
+
* which calculates from the bottom edge of the screen, while iOS uses
|
|
33851
|
+
* translateY, which calculates from the top edge of the screen. This
|
|
33852
|
+
* is why the bottom calculates differ slightly between modes.
|
|
33853
|
+
*
|
|
33854
|
+
* @param position The value of the toast's position prop.
|
|
33855
|
+
* @param positionAnchor The element the toast should be anchored to,
|
|
33856
|
+
* if applicable.
|
|
33857
|
+
* @param mode The toast component's mode (md, ios, etc).
|
|
33858
|
+
* @param toast A reference to the toast element itself.
|
|
33859
|
+
*/
|
|
33860
|
+
function getAnimationPosition(position, positionAnchor, mode, toast) {
|
|
33861
|
+
/**
|
|
33862
|
+
* Start with a predefined offset from the edge the toast will be
|
|
33863
|
+
* positioned relative to, whether on the screen or anchor element.
|
|
33864
|
+
*/
|
|
33865
|
+
let offset;
|
|
33866
|
+
if (mode === 'md') {
|
|
33867
|
+
offset = 8;
|
|
33868
|
+
}
|
|
33869
|
+
else {
|
|
33870
|
+
offset = position === 'top' ? 10 : -10;
|
|
33871
|
+
}
|
|
33872
|
+
/**
|
|
33873
|
+
* If positionAnchor is defined, add in the distance from the target
|
|
33874
|
+
* screen edge to the target anchor edge. For position="top", the
|
|
33875
|
+
* bottom anchor edge is targeted. For position="bottom", the top
|
|
33876
|
+
* anchor edge is targeted.
|
|
33877
|
+
*/
|
|
33878
|
+
if (positionAnchor && win$1) {
|
|
33879
|
+
warnIfAnchorIsHidden(positionAnchor, toast);
|
|
33880
|
+
const box = positionAnchor.getBoundingClientRect();
|
|
33881
|
+
if (position === 'top') {
|
|
33882
|
+
offset += box.bottom;
|
|
33883
|
+
}
|
|
33884
|
+
else if (position === 'bottom') {
|
|
33885
|
+
/**
|
|
33886
|
+
* Just box.top is the distance from the top edge of the screen
|
|
33887
|
+
* to the top edge of the anchor. We want to calculate from the
|
|
33888
|
+
* bottom edge of the screen instead.
|
|
33889
|
+
*/
|
|
33890
|
+
if (mode === 'md') {
|
|
33891
|
+
offset += win$1.innerHeight - box.top;
|
|
33892
|
+
}
|
|
33893
|
+
else {
|
|
33894
|
+
offset -= win$1.innerHeight - box.top;
|
|
33895
|
+
}
|
|
33896
|
+
}
|
|
33897
|
+
/**
|
|
33898
|
+
* We don't include safe area here because that should already be
|
|
33899
|
+
* accounted for when checking the position of the anchor.
|
|
33900
|
+
*/
|
|
33901
|
+
return {
|
|
33902
|
+
top: `${offset}px`,
|
|
33903
|
+
bottom: `${offset}px`,
|
|
33904
|
+
};
|
|
33905
|
+
}
|
|
33906
|
+
else {
|
|
33907
|
+
return {
|
|
33908
|
+
top: `calc(${offset}px + var(--ion-safe-area-top, 0px))`,
|
|
33909
|
+
bottom: mode === 'md'
|
|
33910
|
+
? `calc(${offset}px + var(--ion-safe-area-bottom, 0px))`
|
|
33911
|
+
: `calc(${offset}px - var(--ion-safe-area-bottom, 0px))`,
|
|
33912
|
+
};
|
|
33913
|
+
}
|
|
33914
|
+
}
|
|
33915
|
+
/**
|
|
33916
|
+
* If the anchor element is hidden, getBoundingClientRect()
|
|
33917
|
+
* will return all 0s for it, which can cause unexpected
|
|
33918
|
+
* results in the position calculation when animating.
|
|
33919
|
+
*/
|
|
33920
|
+
function warnIfAnchorIsHidden(positionAnchor, toast) {
|
|
33921
|
+
if (positionAnchor.offsetParent === null) {
|
|
33922
|
+
printIonWarning('The positionAnchor element for ion-toast was found in the DOM, but appears to be hidden. This may lead to unexpected positioning of the toast.', toast);
|
|
33923
|
+
}
|
|
33924
|
+
}
|
|
33925
|
+
|
|
33767
33926
|
const toastIosCss = "/*!@:host*/.sc-ion-toast-ios-h{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}@supports (inset-inline-start: 0){/*!@:host*/.sc-ion-toast-ios-h{inset-inline-start:0}}@supports not (inset-inline-start: 0){/*!@:host*/.sc-ion-toast-ios-h{left:0}/*!@:host-context([dir=rtl])*/[dir=rtl].sc-ion-toast-ios-h,[dir=rtl] .sc-ion-toast-ios-h{left:unset;right:unset;right:0}/*!@@supports selector(:dir(rtl))*/@supports .sc-ion-toast-ios selector(.sc-ion-toast-ios:dir(rtl)){.sc-ion-toast-ios-h:dir(rtl){left:unset;right:unset;right:0}}}/*!@:host(.overlay-hidden)*/.overlay-hidden.sc-ion-toast-ios-h{display:none}/*!@:host(.ion-color)*/.ion-color.sc-ion-toast-ios-h{--button-color:inherit;color:var(--ion-color-contrast)}/*!@:host(.ion-color) .toast-button-cancel*/.ion-color.sc-ion-toast-ios-h .toast-button-cancel.sc-ion-toast-ios{color:inherit}/*!@:host(.ion-color) .toast-wrapper*/.ion-color.sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios{background:var(--ion-color-base)}/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-ios{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)}@supports (inset-inline-start: 0){/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-ios{inset-inline-start:var(--start);inset-inline-end:var(--end)}}@supports not (inset-inline-start: 0){/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-ios{left:var(--start);right:var(--end)}/*!@:host-context([dir=rtl]) .toast-wrapper*/[dir=rtl].sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios,[dir=rtl] .sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios{left:unset;right:unset;left:var(--end);right:var(--start)}/*!@[dir=rtl] .toast-wrapper*/[dir=rtl].sc-ion-toast-ios .toast-wrapper.sc-ion-toast-ios{left:unset;right:unset;left:var(--end);right:var(--start)}/*!@@supports selector(:dir(rtl))*/@supports .sc-ion-toast-ios selector(.sc-ion-toast-ios:dir(rtl)){.toast-wrapper:dir(rtl){left:unset;right:unset;left:var(--end);right:var(--start)}}}/*!@.toast-container*/.toast-container.sc-ion-toast-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;pointer-events:auto;height:inherit;min-height:inherit;max-height:inherit;contain:content}/*!@.toast-layout-stacked .toast-container*/.toast-layout-stacked.sc-ion-toast-ios .toast-container.sc-ion-toast-ios{-ms-flex-wrap:wrap;flex-wrap:wrap}/*!@.toast-layout-baseline .toast-content*/.toast-layout-baseline.sc-ion-toast-ios .toast-content.sc-ion-toast-ios{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}/*!@.toast-icon*/.toast-icon.sc-ion-toast-ios{-webkit-margin-start:16px;margin-inline-start:16px}/*!@.toast-message*/.toast-message.sc-ion-toast-ios{-ms-flex:1;flex:1;white-space:var(--white-space)}/*!@.toast-button-group*/.toast-button-group.sc-ion-toast-ios{display:-ms-flexbox;display:flex}/*!@.toast-layout-stacked .toast-button-group*/.toast-layout-stacked.sc-ion-toast-ios .toast-button-group.sc-ion-toast-ios{-ms-flex-pack:end;justify-content:end;width:100%}/*!@.toast-button*/.toast-button.sc-ion-toast-ios{border:0;outline:none;color:var(--button-color);z-index:0}/*!@.toast-icon,\n.toast-button-icon*/.toast-icon.sc-ion-toast-ios,.toast-button-icon.sc-ion-toast-ios{font-size:1.4em}/*!@.toast-button-inner*/.toast-button-inner.sc-ion-toast-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){/*!@.toast-button:hover*/.toast-button.sc-ion-toast-ios:hover{cursor:pointer}}/*!@:host*/.sc-ion-toast-ios-h{--background:var(--ion-color-step-50, #f2f2f2);--border-radius:14px;--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-850, #262626);--max-width:700px;--start:10px;--end:10px;font-size:14px}/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-ios{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;z-index:10}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){/*!@:host(.toast-translucent) .toast-wrapper*/.toast-translucent.sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}/*!@:host(.ion-color.toast-translucent) .toast-wrapper*/.ion-color.toast-translucent.sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios{background:rgba(var(--ion-color-base-rgb), 0.8)}}/*!@.toast-wrapper.toast-top*/.toast-wrapper.toast-top.sc-ion-toast-ios{-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0);top:0}/*!@.toast-wrapper.toast-middle*/.toast-wrapper.toast-middle.sc-ion-toast-ios{opacity:0.01}/*!@.toast-wrapper.toast-bottom*/.toast-wrapper.toast-bottom.sc-ion-toast-ios{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);bottom:0}/*!@.toast-content*/.toast-content.sc-ion-toast-ios{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:15px;padding-bottom:15px}/*!@.toast-header*/.toast-header.sc-ion-toast-ios{margin-bottom:2px;font-weight:500}/*!@.toast-button*/.toast-button.sc-ion-toast-ios{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;height:44px;-webkit-transition:background-color, opacity 100ms linear;transition:background-color, opacity 100ms linear;border:0;background-color:transparent;font-family:var(--ion-font-family);font-size:17px;font-weight:500;overflow:hidden}/*!@.toast-button.ion-activated*/.toast-button.ion-activated.sc-ion-toast-ios{opacity:0.4}@media (any-hover: hover){/*!@.toast-button:hover*/.toast-button.sc-ion-toast-ios:hover{opacity:0.6}}";
|
|
33768
33927
|
|
|
33769
33928
|
const toastMdCss = "/*!@:host*/.sc-ion-toast-md-h{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}@supports (inset-inline-start: 0){/*!@:host*/.sc-ion-toast-md-h{inset-inline-start:0}}@supports not (inset-inline-start: 0){/*!@:host*/.sc-ion-toast-md-h{left:0}/*!@:host-context([dir=rtl])*/[dir=rtl].sc-ion-toast-md-h,[dir=rtl] .sc-ion-toast-md-h{left:unset;right:unset;right:0}/*!@@supports selector(:dir(rtl))*/@supports .sc-ion-toast-md selector(.sc-ion-toast-md:dir(rtl)){.sc-ion-toast-md-h:dir(rtl){left:unset;right:unset;right:0}}}/*!@:host(.overlay-hidden)*/.overlay-hidden.sc-ion-toast-md-h{display:none}/*!@:host(.ion-color)*/.ion-color.sc-ion-toast-md-h{--button-color:inherit;color:var(--ion-color-contrast)}/*!@:host(.ion-color) .toast-button-cancel*/.ion-color.sc-ion-toast-md-h .toast-button-cancel.sc-ion-toast-md{color:inherit}/*!@:host(.ion-color) .toast-wrapper*/.ion-color.sc-ion-toast-md-h .toast-wrapper.sc-ion-toast-md{background:var(--ion-color-base)}/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-md{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)}@supports (inset-inline-start: 0){/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-md{inset-inline-start:var(--start);inset-inline-end:var(--end)}}@supports not (inset-inline-start: 0){/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-md{left:var(--start);right:var(--end)}/*!@:host-context([dir=rtl]) .toast-wrapper*/[dir=rtl].sc-ion-toast-md-h .toast-wrapper.sc-ion-toast-md,[dir=rtl] .sc-ion-toast-md-h .toast-wrapper.sc-ion-toast-md{left:unset;right:unset;left:var(--end);right:var(--start)}/*!@[dir=rtl] .toast-wrapper*/[dir=rtl].sc-ion-toast-md .toast-wrapper.sc-ion-toast-md{left:unset;right:unset;left:var(--end);right:var(--start)}/*!@@supports selector(:dir(rtl))*/@supports .sc-ion-toast-md selector(.sc-ion-toast-md:dir(rtl)){.toast-wrapper:dir(rtl){left:unset;right:unset;left:var(--end);right:var(--start)}}}/*!@.toast-container*/.toast-container.sc-ion-toast-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;pointer-events:auto;height:inherit;min-height:inherit;max-height:inherit;contain:content}/*!@.toast-layout-stacked .toast-container*/.toast-layout-stacked.sc-ion-toast-md .toast-container.sc-ion-toast-md{-ms-flex-wrap:wrap;flex-wrap:wrap}/*!@.toast-layout-baseline .toast-content*/.toast-layout-baseline.sc-ion-toast-md .toast-content.sc-ion-toast-md{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}/*!@.toast-icon*/.toast-icon.sc-ion-toast-md{-webkit-margin-start:16px;margin-inline-start:16px}/*!@.toast-message*/.toast-message.sc-ion-toast-md{-ms-flex:1;flex:1;white-space:var(--white-space)}/*!@.toast-button-group*/.toast-button-group.sc-ion-toast-md{display:-ms-flexbox;display:flex}/*!@.toast-layout-stacked .toast-button-group*/.toast-layout-stacked.sc-ion-toast-md .toast-button-group.sc-ion-toast-md{-ms-flex-pack:end;justify-content:end;width:100%}/*!@.toast-button*/.toast-button.sc-ion-toast-md{border:0;outline:none;color:var(--button-color);z-index:0}/*!@.toast-icon,\n.toast-button-icon*/.toast-icon.sc-ion-toast-md,.toast-button-icon.sc-ion-toast-md{font-size:1.4em}/*!@.toast-button-inner*/.toast-button-inner.sc-ion-toast-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){/*!@.toast-button:hover*/.toast-button.sc-ion-toast-md:hover{cursor:pointer}}/*!@:host*/.sc-ion-toast-md-h{--background:var(--ion-color-step-800, #333333);--border-radius:4px;--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-50, #f2f2f2);--max-width:700px;--start:8px;--end:8px;font-size:14px}/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-md{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;opacity:0.01;z-index:10}/*!@.toast-content*/.toast-content.sc-ion-toast-md{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:14px;padding-bottom:14px}/*!@.toast-header*/.toast-header.sc-ion-toast-md{margin-bottom:2px;font-weight:500;line-height:20px}/*!@.toast-message*/.toast-message.sc-ion-toast-md{line-height:20px}/*!@.toast-layout-baseline .toast-button-group-start*/.toast-layout-baseline.sc-ion-toast-md .toast-button-group-start.sc-ion-toast-md{-webkit-margin-start:8px;margin-inline-start:8px}/*!@.toast-layout-stacked .toast-button-group-start*/.toast-layout-stacked.sc-ion-toast-md .toast-button-group-start.sc-ion-toast-md{-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px}/*!@.toast-layout-baseline .toast-button-group-end*/.toast-layout-baseline.sc-ion-toast-md .toast-button-group-end.sc-ion-toast-md{-webkit-margin-end:8px;margin-inline-end:8px}/*!@.toast-layout-stacked .toast-button-group-end*/.toast-layout-stacked.sc-ion-toast-md .toast-button-group-end.sc-ion-toast-md{-webkit-margin-end:8px;margin-inline-end:8px;margin-bottom:8px}/*!@.toast-button*/.toast-button.sc-ion-toast-md{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;font-family:var(--ion-font-family);font-size:14px;font-weight:500;letter-spacing:0.84px;text-transform:uppercase;overflow:hidden}/*!@.toast-button-cancel*/.toast-button-cancel.sc-ion-toast-md{color:var(--ion-color-step-100, #e6e6e6)}/*!@.toast-button-icon-only*/.toast-button-icon-only.sc-ion-toast-md{border-radius:50%;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:9px;padding-bottom:9px;width:36px;height:36px}@media (any-hover: hover){/*!@.toast-button:hover*/.toast-button.sc-ion-toast-md:hover{background-color:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.08)}/*!@.toast-button-cancel:hover*/.toast-button-cancel.sc-ion-toast-md:hover{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.08)}}";
|
|
@@ -33816,6 +33975,7 @@ class Toast {
|
|
|
33816
33975
|
this.message = undefined;
|
|
33817
33976
|
this.keyboardClose = false;
|
|
33818
33977
|
this.position = 'bottom';
|
|
33978
|
+
this.positionAnchor = undefined;
|
|
33819
33979
|
this.buttons = undefined;
|
|
33820
33980
|
this.translucent = false;
|
|
33821
33981
|
this.animated = true;
|
|
@@ -33863,7 +34023,19 @@ class Toast {
|
|
|
33863
34023
|
async present() {
|
|
33864
34024
|
const unlock = await this.lockController.lock();
|
|
33865
34025
|
await this.delegateController.attachViewToDom();
|
|
33866
|
-
|
|
34026
|
+
const { el, position } = this;
|
|
34027
|
+
const anchor = this.getAnchorElement();
|
|
34028
|
+
const animationPosition = getAnimationPosition(position, anchor, getIonMode$1(this), el);
|
|
34029
|
+
/**
|
|
34030
|
+
* Cache the calculated position of the toast, so we can re-use it
|
|
34031
|
+
* in the dismiss animation.
|
|
34032
|
+
*/
|
|
34033
|
+
this.lastPresentedPosition = animationPosition;
|
|
34034
|
+
await present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, {
|
|
34035
|
+
position,
|
|
34036
|
+
top: animationPosition.top,
|
|
34037
|
+
bottom: animationPosition.bottom,
|
|
34038
|
+
});
|
|
33867
34039
|
/**
|
|
33868
34040
|
* Content is revealed to screen readers after
|
|
33869
34041
|
* the transition to avoid jank since this
|
|
@@ -33885,15 +34057,28 @@ class Toast {
|
|
|
33885
34057
|
* Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
|
|
33886
34058
|
*/
|
|
33887
34059
|
async dismiss(data, role) {
|
|
34060
|
+
var _a, _b;
|
|
33888
34061
|
const unlock = await this.lockController.lock();
|
|
33889
|
-
|
|
33890
|
-
|
|
34062
|
+
const { durationTimeout, position, lastPresentedPosition } = this;
|
|
34063
|
+
if (durationTimeout) {
|
|
34064
|
+
clearTimeout(durationTimeout);
|
|
33891
34065
|
}
|
|
33892
|
-
const dismissed = await dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation,
|
|
34066
|
+
const dismissed = await dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation,
|
|
34067
|
+
/**
|
|
34068
|
+
* Fetch the cached position that was calculated back in the present
|
|
34069
|
+
* animation. We always want to animate the dismiss from the same
|
|
34070
|
+
* position the present stopped at, so the animation looks continuous.
|
|
34071
|
+
*/
|
|
34072
|
+
{
|
|
34073
|
+
position,
|
|
34074
|
+
top: (_a = lastPresentedPosition === null || lastPresentedPosition === void 0 ? void 0 : lastPresentedPosition.top) !== null && _a !== void 0 ? _a : '',
|
|
34075
|
+
bottom: (_b = lastPresentedPosition === null || lastPresentedPosition === void 0 ? void 0 : lastPresentedPosition.bottom) !== null && _b !== void 0 ? _b : '',
|
|
34076
|
+
});
|
|
33893
34077
|
if (dismissed) {
|
|
33894
34078
|
this.delegateController.removeViewFromDom();
|
|
33895
34079
|
this.revealContentToScreenReader = false;
|
|
33896
34080
|
}
|
|
34081
|
+
this.lastPresentedPosition = undefined;
|
|
33897
34082
|
unlock();
|
|
33898
34083
|
return dismissed;
|
|
33899
34084
|
}
|
|
@@ -33917,6 +34102,44 @@ class Toast {
|
|
|
33917
34102
|
: [];
|
|
33918
34103
|
return buttons;
|
|
33919
34104
|
}
|
|
34105
|
+
/**
|
|
34106
|
+
* Returns the element specified by the positionAnchor prop,
|
|
34107
|
+
* or undefined if prop's value is an ID string and the element
|
|
34108
|
+
* is not found in the DOM.
|
|
34109
|
+
*/
|
|
34110
|
+
getAnchorElement() {
|
|
34111
|
+
const { position, positionAnchor, el } = this;
|
|
34112
|
+
/**
|
|
34113
|
+
* If positionAnchor is undefined then
|
|
34114
|
+
* no anchor should be used when presenting the toast.
|
|
34115
|
+
*/
|
|
34116
|
+
if (positionAnchor === undefined) {
|
|
34117
|
+
return;
|
|
34118
|
+
}
|
|
34119
|
+
if (position === 'middle' && positionAnchor !== undefined) {
|
|
34120
|
+
printIonWarning('The positionAnchor property is ignored when using position="middle".', this.el);
|
|
34121
|
+
return undefined;
|
|
34122
|
+
}
|
|
34123
|
+
if (typeof positionAnchor === 'string') {
|
|
34124
|
+
/**
|
|
34125
|
+
* If the anchor is defined as an ID, find the element.
|
|
34126
|
+
* We do this on every present so the toast doesn't need
|
|
34127
|
+
* to account for the surrounding DOM changing since the
|
|
34128
|
+
* last time it was presented.
|
|
34129
|
+
*/
|
|
34130
|
+
const foundEl = document.getElementById(positionAnchor);
|
|
34131
|
+
if (foundEl === null) {
|
|
34132
|
+
printIonWarning(`An anchor element with an ID of "${positionAnchor}" was not found in the DOM.`, el);
|
|
34133
|
+
return undefined;
|
|
34134
|
+
}
|
|
34135
|
+
return foundEl;
|
|
34136
|
+
}
|
|
34137
|
+
if (positionAnchor instanceof HTMLElement) {
|
|
34138
|
+
return positionAnchor;
|
|
34139
|
+
}
|
|
34140
|
+
printIonWarning('Invalid positionAnchor value:', positionAnchor, el);
|
|
34141
|
+
return undefined;
|
|
34142
|
+
}
|
|
33920
34143
|
async buttonClick(button) {
|
|
33921
34144
|
const role = button.role;
|
|
33922
34145
|
if (isCancel(role)) {
|
|
@@ -34024,6 +34247,7 @@ class Toast {
|
|
|
34024
34247
|
"message": [1],
|
|
34025
34248
|
"keyboardClose": [4, "keyboard-close"],
|
|
34026
34249
|
"position": [1],
|
|
34250
|
+
"positionAnchor": [1, "position-anchor"],
|
|
34027
34251
|
"buttons": [16],
|
|
34028
34252
|
"translucent": [4],
|
|
34029
34253
|
"animated": [4],
|
|
@@ -34091,9 +34315,6 @@ class Toggle {
|
|
|
34091
34315
|
}
|
|
34092
34316
|
};
|
|
34093
34317
|
this.onClick = (ev) => {
|
|
34094
|
-
if (this.disabled) {
|
|
34095
|
-
return;
|
|
34096
|
-
}
|
|
34097
34318
|
ev.preventDefault();
|
|
34098
34319
|
if (this.lastDrag + 300 < Date.now()) {
|
|
34099
34320
|
this.toggleChecked();
|
|
@@ -34744,6 +34965,7 @@ const iosTransitionAnimation = (navEl, opts) => {
|
|
|
34744
34965
|
.easing(opts.easing || EASING)
|
|
34745
34966
|
.fill('both')
|
|
34746
34967
|
.beforeRemoveClass('ion-page-invisible');
|
|
34968
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
34747
34969
|
if (leavingEl && navEl !== null && navEl !== undefined) {
|
|
34748
34970
|
const navDecorAnimation = createAnimation();
|
|
34749
34971
|
navDecorAnimation.addElement(navEl);
|