@ionic/core 7.5.4-dev.11699310489.151b2717 → 7.5.4-dev.11699469920.1af6ea12
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/animation.js +12 -11
- package/components/checkbox.js +2 -0
- package/components/index4.js +10 -12
- package/components/index5.js +0 -22
- package/components/input-shims.js +12 -7
- package/components/ion-datetime.js +2 -2
- package/components/ion-input.js +2 -0
- package/components/ion-modal.js +2 -2
- package/components/ion-range.js +2 -0
- package/components/ion-searchbar.js +1 -1
- package/components/ion-select.js +4 -2
- package/components/ion-skeleton-text.js +14 -1
- package/components/ion-textarea.js +2 -0
- package/components/ion-toast.js +419 -74
- package/components/ion-toggle.js +2 -0
- package/components/item.js +2 -2
- package/components/label.js +2 -2
- package/components/list.js +2 -2
- package/components/overlays.js +2 -1
- package/components/radio.js +2 -0
- package/dist/cjs/{animation-1083855c.js → animation-d101aa7a.js} +13 -12
- package/dist/cjs/{button-active-625d1d77.js → button-active-69c3bee4.js} +1 -1
- package/dist/cjs/{capacitor-2ffba62a.js → capacitor-f68447d3.js} +1 -1
- package/dist/cjs/{haptic-678abc9f.js → haptic-a74c2767.js} +1 -1
- package/dist/cjs/{index-3659e3a5.js → index-9146d04a.js} +11 -13
- package/dist/cjs/{index-135a6097.js → index-adbcffee.js} +2 -2
- package/dist/cjs/index-c8d52405.js +10 -0
- package/dist/cjs/{index-9f379eaa.js → index-e9634bc9.js} +1 -1
- package/dist/cjs/index.cjs.js +8 -8
- package/dist/cjs/{input-shims-b0a75a01.js → input-shims-3e3f35b9.js} +15 -10
- package/dist/cjs/{input.utils-0fe3097c.js → input.utils-590f0f18.js} +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +6 -6
- package/dist/cjs/ion-alert.cjs.entry.js +6 -6
- package/dist/cjs/ion-app_8.cjs.entry.js +8 -8
- package/dist/cjs/ion-checkbox.cjs.entry.js +2 -0
- package/dist/cjs/ion-datetime_3.cjs.entry.js +7 -7
- package/dist/cjs/ion-input.cjs.entry.js +5 -3
- package/dist/cjs/ion-item_8.cjs.entry.js +19 -6
- package/dist/cjs/ion-loading.cjs.entry.js +3 -3
- package/dist/cjs/ion-menu_3.cjs.entry.js +5 -5
- package/dist/cjs/ion-modal.cjs.entry.js +8 -8
- package/dist/cjs/ion-nav_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-picker-column-internal.cjs.entry.js +3 -3
- package/dist/cjs/ion-popover.cjs.entry.js +4 -4
- package/dist/cjs/ion-radio_2.cjs.entry.js +2 -0
- package/dist/cjs/ion-range.cjs.entry.js +2 -0
- package/dist/cjs/ion-refresher_2.cjs.entry.js +4 -4
- package/dist/cjs/ion-reorder_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-searchbar.cjs.entry.js +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +7 -5
- package/dist/cjs/ion-tab-bar_2.cjs.entry.js +4 -4
- package/dist/cjs/ion-textarea.cjs.entry.js +5 -3
- package/dist/cjs/ion-toast.cjs.entry.js +434 -92
- package/dist/cjs/ion-toggle.cjs.entry.js +5 -3
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/{ios.transition-b71990aa.js → ios.transition-7972d9e3.js} +3 -3
- package/dist/cjs/{keyboard-fd7db491.js → keyboard-43df0428.js} +1 -1
- package/dist/cjs/{keyboard-38f2bb7b.js → keyboard-840107b3.js} +3 -3
- package/dist/cjs/{keyboard-controller-50beb83a.js → keyboard-controller-019f42df.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{md.transition-3caa648a.js → md.transition-6e61a10f.js} +3 -3
- package/dist/cjs/{notch-controller-f4f6af5d.js → notch-controller-c22d1344.js} +1 -1
- package/dist/cjs/{overlays-6d1daf80.js → overlays-ba1a1e21.js} +3 -1
- package/dist/collection/components/checkbox/checkbox.js +2 -0
- package/dist/collection/components/datetime/datetime.ios.css +1 -0
- package/dist/collection/components/datetime/datetime.md.css +1 -0
- package/dist/collection/components/input/input.js +2 -0
- package/dist/collection/components/item/item.ios.css +25 -3
- package/dist/collection/components/item/item.md.css +25 -3
- package/dist/collection/components/item/test/basic/item.e2e.js +1 -1
- package/dist/collection/components/item/test/disabled/item.e2e.js +0 -1
- package/dist/collection/components/label/label.ios.css +14 -3
- package/dist/collection/components/label/label.md.css +14 -3
- package/dist/collection/components/list/list.ios.css +1 -15
- package/dist/collection/components/list/list.md.css +3 -41
- package/dist/collection/components/list/test/lines/list.e2e.js +0 -143
- package/dist/collection/components/modal/gestures/swipe-to-close.js +2 -1
- package/dist/collection/components/note/test/a11y/note.e2e.js +43 -0
- package/dist/collection/components/picker-internal/test/basic/picker-internal.e2e.js +0 -5
- package/dist/collection/components/radio/radio.js +2 -0
- package/dist/collection/components/range/range.js +2 -0
- package/dist/collection/components/searchbar/searchbar.md.css +5 -11
- package/dist/collection/components/searchbar/test/basic/searchbar.e2e.js +0 -25
- package/dist/collection/components/select/select.ios.css +5 -0
- package/dist/collection/components/select/select.js +2 -0
- package/dist/collection/components/select/select.md.css +5 -0
- package/dist/collection/components/select/test/legacy/wrapping/select.e2e.js +1 -1
- package/dist/collection/components/skeleton-text/skeleton-text.js +39 -0
- package/dist/collection/components/textarea/textarea.js +2 -0
- package/dist/collection/components/toast/animations/ios.enter.js +2 -1
- package/dist/collection/components/toast/animations/md.enter.js +4 -3
- package/dist/collection/components/toast/animations/utils.js +20 -14
- package/dist/collection/components/toast/gestures/swipe-to-dismiss.js +267 -0
- package/dist/collection/components/toast/test/swipe-gesture/toast.e2e.js +84 -0
- package/dist/collection/components/toast/toast.ios.css +10 -10
- package/dist/collection/components/toast/toast.js +104 -1
- package/dist/collection/components/toast/toast.md.css +10 -0
- package/dist/collection/components/toggle/toggle.js +2 -0
- package/dist/collection/utils/animation/animation.js +12 -11
- package/dist/collection/utils/browser/index.js +0 -22
- package/dist/collection/utils/input-shims/input-shims.js +12 -6
- package/dist/collection/utils/menu-controller/index.js +10 -12
- package/dist/collection/utils/overlays.js +1 -0
- package/dist/docs.json +37 -1
- package/dist/esm/{animation-8aa13916.js → animation-cf3dd234.js} +13 -12
- package/dist/esm/{button-active-1fb561b0.js → button-active-109ba60d.js} +1 -1
- package/dist/esm/{capacitor-b4979570.js → capacitor-f1f25364.js} +1 -1
- package/dist/esm/{haptic-1243b917.js → haptic-1a66d69f.js} +1 -1
- package/dist/esm/{index-47a510cf.js → index-50582f1c.js} +2 -2
- package/dist/esm/{index-056b43e7.js → index-6a48e009.js} +11 -13
- package/dist/esm/index-a5d50daf.js +7 -0
- package/dist/esm/{index-f0cc4e14.js → index-c9e82353.js} +1 -1
- package/dist/esm/index.js +8 -8
- package/dist/esm/{input-shims-d0c93e5d.js → input-shims-1d767845.js} +14 -9
- package/dist/esm/{input.utils-ec063df4.js → input.utils-d04a7212.js} +1 -1
- package/dist/esm/ion-action-sheet.entry.js +6 -6
- package/dist/esm/ion-alert.entry.js +6 -6
- package/dist/esm/ion-app_8.entry.js +8 -8
- package/dist/esm/ion-checkbox.entry.js +2 -0
- package/dist/esm/ion-datetime_3.entry.js +7 -7
- package/dist/esm/ion-input.entry.js +5 -3
- package/dist/esm/ion-item_8.entry.js +19 -6
- package/dist/esm/ion-loading.entry.js +3 -3
- package/dist/esm/ion-menu_3.entry.js +5 -5
- package/dist/esm/ion-modal.entry.js +8 -8
- package/dist/esm/ion-nav_2.entry.js +1 -1
- package/dist/esm/ion-picker-column-internal.entry.js +3 -3
- package/dist/esm/ion-popover.entry.js +4 -4
- package/dist/esm/ion-radio_2.entry.js +2 -0
- package/dist/esm/ion-range.entry.js +2 -0
- package/dist/esm/ion-refresher_2.entry.js +4 -4
- package/dist/esm/ion-reorder_2.entry.js +3 -3
- package/dist/esm/ion-searchbar.entry.js +1 -1
- package/dist/esm/ion-select_3.entry.js +7 -5
- package/dist/esm/ion-tab-bar_2.entry.js +4 -4
- package/dist/esm/ion-textarea.entry.js +5 -3
- package/dist/esm/ion-toast.entry.js +417 -75
- package/dist/esm/ion-toggle.entry.js +5 -3
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/{ios.transition-b53e19a3.js → ios.transition-e20d71bc.js} +3 -3
- package/dist/esm/{keyboard-b551279d.js → keyboard-9f771a04.js} +3 -3
- package/dist/esm/{keyboard-b063f012.js → keyboard-b6230bfb.js} +1 -1
- package/dist/esm/{keyboard-controller-0c2dce71.js → keyboard-controller-3f0faa10.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{md.transition-276c1159.js → md.transition-a8469407.js} +3 -3
- package/dist/esm/{notch-controller-8c9c0e54.js → notch-controller-3f79197e.js} +1 -1
- package/dist/esm/{overlays-928a4afe.js → overlays-d79b34b4.js} +3 -2
- package/dist/esm-es5/{animation-8aa13916.js → animation-cf3dd234.js} +1 -1
- package/dist/esm-es5/{button-active-1fb561b0.js → button-active-109ba60d.js} +1 -1
- package/dist/esm-es5/{capacitor-b4979570.js → capacitor-f1f25364.js} +1 -1
- package/dist/esm-es5/{haptic-1243b917.js → haptic-1a66d69f.js} +1 -1
- package/dist/esm-es5/{index-47a510cf.js → index-50582f1c.js} +1 -1
- package/dist/esm-es5/index-6a48e009.js +4 -0
- package/dist/esm-es5/index-c9e82353.js +4 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/input-shims-1d767845.js +4 -0
- package/dist/esm-es5/input.utils-d04a7212.js +4 -0
- 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-checkbox.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_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-range.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-tab-bar_2.entry.js +1 -1
- package/dist/esm-es5/ion-textarea.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-b53e19a3.js → ios.transition-e20d71bc.js} +1 -1
- package/dist/esm-es5/{keyboard-b551279d.js → keyboard-9f771a04.js} +1 -1
- package/dist/esm-es5/{keyboard-b063f012.js → keyboard-b6230bfb.js} +1 -1
- package/dist/esm-es5/{keyboard-controller-0c2dce71.js → keyboard-controller-3f0faa10.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{md.transition-276c1159.js → md.transition-a8469407.js} +1 -1
- package/dist/esm-es5/{notch-controller-8c9c0e54.js → notch-controller-3f79197e.js} +1 -1
- package/dist/esm-es5/{overlays-928a4afe.js → overlays-d79b34b4.js} +1 -1
- package/dist/html.html-data.json +9 -0
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-09ec6b90.entry.js → p-020dd47f.entry.js} +1 -1
- package/dist/ionic/p-02663394.system.js +1 -1
- package/dist/ionic/{p-bf731526.system.entry.js → p-0becf7b5.system.entry.js} +1 -1
- package/dist/ionic/{p-8cc04bea.system.js → p-0c40f7d3.system.js} +1 -1
- package/dist/ionic/p-11104d0d.entry.js +4 -0
- package/dist/ionic/{p-81c818e7.js → p-11cb4e19.js} +1 -1
- package/dist/ionic/{p-a5b3aa82.entry.js → p-138a4a93.entry.js} +1 -1
- package/dist/ionic/{p-a07cd4aa.system.js → p-13dd7d20.system.js} +1 -1
- package/dist/ionic/{p-1a1fcc8b.system.js → p-1511dc35.system.js} +1 -1
- package/dist/ionic/{p-276afddd.js → p-1667596c.js} +1 -1
- package/dist/ionic/{p-40c0c580.system.entry.js → p-1fc6b5a5.system.entry.js} +1 -1
- package/dist/ionic/{p-af589369.system.entry.js → p-2151a4a4.system.entry.js} +1 -1
- package/dist/ionic/p-265fec8a.entry.js +4 -0
- package/dist/ionic/{p-da3e5259.entry.js → p-2fb115dc.entry.js} +1 -1
- package/dist/ionic/p-314c4dee.js +4 -0
- package/dist/ionic/p-344706aa.entry.js +4 -0
- package/dist/ionic/p-3554b264.js +4 -0
- package/dist/ionic/{p-59f491c5.entry.js → p-35787a6f.entry.js} +1 -1
- package/dist/ionic/{p-bf5a7db2.system.entry.js → p-3962542f.system.entry.js} +1 -1
- package/dist/ionic/p-3afb9c3d.entry.js +4 -0
- package/dist/ionic/{p-60f55715.system.entry.js → p-3dedd258.system.entry.js} +1 -1
- package/dist/ionic/{p-33986d02.entry.js → p-3fc0b7ba.entry.js} +1 -1
- package/dist/ionic/{p-c4e61a72.entry.js → p-47826f19.entry.js} +1 -1
- package/dist/ionic/p-494e75ad.js +4 -0
- package/dist/ionic/{p-d40d3245.system.entry.js → p-4c50b357.system.entry.js} +1 -1
- package/dist/ionic/p-4e3c07a6.system.js +4 -0
- package/dist/ionic/p-4e4ee05e.js +4 -0
- package/dist/ionic/{p-30d6fb24.system.entry.js → p-50375f3b.system.entry.js} +1 -1
- package/dist/ionic/{p-7d3be70f.system.js → p-53f75103.system.js} +1 -1
- package/dist/ionic/p-561cc050.system.js +4 -0
- package/dist/ionic/p-57b14769.js +4 -0
- package/dist/ionic/{p-8cf94fc1.js → p-5885e9af.js} +1 -1
- package/dist/ionic/{p-1ad8ddc1.system.entry.js → p-637d836a.system.entry.js} +1 -1
- package/dist/ionic/{p-565d1dc5.entry.js → p-664cc492.entry.js} +1 -1
- package/dist/ionic/{p-b923f3d7.js → p-6a309574.js} +1 -1
- package/dist/ionic/p-6c89025e.system.entry.js +4 -0
- package/dist/ionic/p-70dcf429.js +4 -0
- package/dist/ionic/p-710cea83.system.js +4 -0
- package/dist/ionic/{p-e1e64156.system.entry.js → p-71e70a57.system.entry.js} +1 -1
- package/dist/ionic/p-78a8e1e8.entry.js +4 -0
- package/dist/ionic/p-7acd17bc.entry.js +4 -0
- package/dist/ionic/{p-3632220b.system.js → p-7def197f.system.js} +1 -1
- package/dist/ionic/p-81bdfa1c.system.entry.js +4 -0
- package/dist/ionic/p-8414ed31.entry.js +4 -0
- package/dist/ionic/{p-b4b4bb29.system.js → p-9292fd42.system.js} +1 -1
- package/dist/ionic/p-92ac915c.system.js +4 -0
- package/dist/ionic/{p-fb10190f.js → p-938c4956.js} +1 -1
- package/dist/ionic/{p-dbc066cd.system.entry.js → p-9471d511.system.entry.js} +1 -1
- package/dist/ionic/{p-677a233c.system.entry.js → p-957f3028.system.entry.js} +1 -1
- package/dist/ionic/{p-41477ad9.system.js → p-958f1c70.system.js} +1 -1
- package/dist/ionic/{p-a843f88e.entry.js → p-9939c98e.entry.js} +1 -1
- package/dist/ionic/{p-9bb21465.system.entry.js → p-9b34caa0.system.entry.js} +1 -1
- package/dist/ionic/{p-1589d649.system.entry.js → p-a03566c4.system.entry.js} +1 -1
- package/dist/ionic/{p-419eb426.js → p-a135e3ba.js} +1 -1
- package/dist/ionic/{p-6cf407b5.system.entry.js → p-a6880f79.system.entry.js} +1 -1
- package/dist/ionic/p-a6b819ca.entry.js +4 -0
- package/dist/ionic/{p-a3545dad.entry.js → p-a9424586.entry.js} +1 -1
- package/dist/ionic/{p-8704e922.system.entry.js → p-ab1908ba.system.entry.js} +1 -1
- package/dist/ionic/{p-940a581d.system.js → p-abaa9b48.system.js} +1 -1
- package/dist/ionic/{p-ab4cff27.system.js → p-aec8a70a.system.js} +1 -1
- package/dist/ionic/{p-16b94c87.system.entry.js → p-bc48e521.system.entry.js} +1 -1
- package/dist/ionic/{p-69f93198.entry.js → p-bc6e32d2.entry.js} +1 -1
- package/dist/ionic/p-c2db1374.system.js +4 -0
- package/dist/ionic/p-c3547c7a.system.js +4 -0
- package/dist/ionic/{p-084413f2.system.entry.js → p-cb6c380e.system.entry.js} +1 -1
- package/dist/ionic/{p-82c503f7.entry.js → p-ce20c101.entry.js} +1 -1
- package/dist/ionic/p-d075c0aa.system.entry.js +4 -0
- package/dist/ionic/{p-f87219d2.js → p-df18d20d.js} +1 -1
- package/dist/ionic/p-e3b7a2d0.system.entry.js +4 -0
- package/dist/ionic/{p-80baef4f.entry.js → p-e525dbea.entry.js} +1 -1
- package/dist/ionic/{p-3bad5c1a.js → p-e5fd9f10.js} +1 -1
- package/dist/ionic/{p-ccdcb022.system.js → p-e7d20dfb.system.js} +1 -1
- package/dist/ionic/p-e9fe3c8b.system.entry.js +4 -0
- package/dist/ionic/p-ea1650b0.entry.js +4 -0
- package/dist/ionic/{p-e96da585.system.entry.js → p-ed8a02a2.system.entry.js} +1 -1
- package/dist/ionic/{p-a2200630.js → p-edd568c5.js} +1 -1
- package/dist/ionic/p-f2d4e3c8.entry.js +4 -0
- package/dist/ionic/p-f7769c83.js +4 -0
- package/dist/ionic/{p-bba2ce59.system.js → p-f9a641fa.system.js} +1 -1
- package/dist/ionic/p-fa67d712.entry.js +4 -0
- package/dist/types/components/router/router.d.ts +2 -1
- package/dist/types/components/skeleton-text/skeleton-text.d.ts +9 -1
- package/dist/types/components/toast/animations/utils.d.ts +15 -4
- package/dist/types/components/toast/gestures/swipe-to-dismiss.d.ts +9 -0
- package/dist/types/components/toast/toast-interface.d.ts +1 -0
- package/dist/types/components/toast/toast.d.ts +28 -1
- package/dist/types/components.d.ts +25 -2
- package/dist/types/interface.d.ts +1 -5
- package/dist/types/utils/animation/animation-interface.d.ts +4 -4
- package/dist/types/utils/browser/index.d.ts +11 -2
- package/dist/types/utils/hardware-back-button.d.ts +4 -0
- package/dist/types/utils/overlays.d.ts +1 -0
- package/hydrate/index.js +473 -128
- package/package.json +3 -1
- package/dist/cjs/index-306a7476.js +0 -32
- package/dist/collection/components/item/test/text/item.e2e.js +0 -14
- package/dist/esm/index-7a14ecec.js +0 -29
- package/dist/esm-es5/index-056b43e7.js +0 -4
- package/dist/esm-es5/index-f0cc4e14.js +0 -4
- package/dist/esm-es5/input-shims-d0c93e5d.js +0 -4
- package/dist/esm-es5/input.utils-ec063df4.js +0 -4
- package/dist/ionic/p-0816f061.entry.js +0 -4
- package/dist/ionic/p-0e7712cb.entry.js +0 -4
- package/dist/ionic/p-17ebfee6.entry.js +0 -4
- package/dist/ionic/p-28acf48d.system.entry.js +0 -4
- package/dist/ionic/p-2e8e0045.js +0 -4
- package/dist/ionic/p-3602001b.system.js +0 -4
- package/dist/ionic/p-40762835.entry.js +0 -4
- package/dist/ionic/p-4eb8645b.system.entry.js +0 -4
- package/dist/ionic/p-5f4c4347.system.entry.js +0 -4
- package/dist/ionic/p-5feb31c6.entry.js +0 -4
- package/dist/ionic/p-67eecef4.system.js +0 -4
- package/dist/ionic/p-97c65aa5.js +0 -4
- package/dist/ionic/p-9ab6f3e6.system.js +0 -4
- package/dist/ionic/p-a8e2b2b0.js +0 -4
- package/dist/ionic/p-aa310f38.entry.js +0 -4
- package/dist/ionic/p-ae590bcd.entry.js +0 -4
- package/dist/ionic/p-b1075d53.system.js +0 -4
- package/dist/ionic/p-b6be9a42.system.js +0 -4
- package/dist/ionic/p-c3278d57.js +0 -4
- package/dist/ionic/p-c6e9ffd6.js +0 -4
- package/dist/ionic/p-cbbefe72.system.entry.js +0 -4
- package/dist/ionic/p-cc196b34.js +0 -4
- package/dist/ionic/p-d1de1188.js +0 -4
- package/dist/ionic/p-d6c6b195.system.entry.js +0 -4
- package/dist/ionic/p-daf71560.entry.js +0 -4
- package/dist/ionic/p-df9d7fe1.entry.js +0 -4
- package/dist/ionic/p-eb5283b6.entry.js +0 -4
- package/dist/ionic/p-f2ad4b10.entry.js +0 -4
- package/dist/ionic/p-ff5a10f9.system.js +0 -4
- /package/dist/esm-es5/{index-7a14ecec.js → index-a5d50daf.js} +0 -0
- /package/dist/ionic/{p-0e94957a.system.js → p-792919fd.system.js} +0 -0
- /package/dist/ionic/{p-b347cfd1.js → p-7b30edcc.js} +0 -0
|
@@ -465,6 +465,8 @@ export class Select {
|
|
|
465
465
|
style['has-placeholder'] = this.placeholder !== undefined;
|
|
466
466
|
style['has-value'] = this.hasValue();
|
|
467
467
|
style['has-focus'] = this.isExpanded;
|
|
468
|
+
// TODO(FW-3194): remove this
|
|
469
|
+
style['legacy'] = !!this.legacy;
|
|
468
470
|
}
|
|
469
471
|
this.ionStyle.emit(style);
|
|
470
472
|
}
|
|
@@ -27,7 +27,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
|
|
27
27
|
await page.setContent(`
|
|
28
28
|
<ion-item>
|
|
29
29
|
<ion-label>Really long label should not wrap</ion-label>
|
|
30
|
-
<ion-select value="wrap" class="ion-text-wrap">
|
|
30
|
+
<ion-select value="wrap" legacy="true" class="ion-text-wrap">
|
|
31
31
|
<ion-select-option value="wrap">Should wrap value only when label exists and really long text exists to make it wrap the text</ion-select-option>
|
|
32
32
|
</ion-select>
|
|
33
33
|
</ion-item>
|
|
@@ -9,6 +9,18 @@ export class SkeletonText {
|
|
|
9
9
|
constructor() {
|
|
10
10
|
this.animated = false;
|
|
11
11
|
}
|
|
12
|
+
componentWillLoad() {
|
|
13
|
+
this.emitStyle();
|
|
14
|
+
}
|
|
15
|
+
emitStyle() {
|
|
16
|
+
// The emitted property is used by item in order
|
|
17
|
+
// to add the item-skeleton-text class which applies
|
|
18
|
+
// overflow: hidden to its label
|
|
19
|
+
const style = {
|
|
20
|
+
'skeleton-text': true,
|
|
21
|
+
};
|
|
22
|
+
this.ionStyle.emit(style);
|
|
23
|
+
}
|
|
12
24
|
render() {
|
|
13
25
|
const animated = this.animated && config.getBoolean('animated', true);
|
|
14
26
|
const inMedia = hostContext('ion-avatar', this.el) || hostContext('ion-thumbnail', this.el);
|
|
@@ -53,5 +65,32 @@ export class SkeletonText {
|
|
|
53
65
|
}
|
|
54
66
|
};
|
|
55
67
|
}
|
|
68
|
+
static get events() {
|
|
69
|
+
return [{
|
|
70
|
+
"method": "ionStyle",
|
|
71
|
+
"name": "ionStyle",
|
|
72
|
+
"bubbles": true,
|
|
73
|
+
"cancelable": true,
|
|
74
|
+
"composed": true,
|
|
75
|
+
"docs": {
|
|
76
|
+
"tags": [{
|
|
77
|
+
"name": "internal",
|
|
78
|
+
"text": undefined
|
|
79
|
+
}],
|
|
80
|
+
"text": "Emitted when the styles change."
|
|
81
|
+
},
|
|
82
|
+
"complexType": {
|
|
83
|
+
"original": "StyleEventDetail",
|
|
84
|
+
"resolved": "StyleEventDetail",
|
|
85
|
+
"references": {
|
|
86
|
+
"StyleEventDetail": {
|
|
87
|
+
"location": "import",
|
|
88
|
+
"path": "../../interface",
|
|
89
|
+
"id": "src/interface.d.ts::StyleEventDetail"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}];
|
|
94
|
+
}
|
|
56
95
|
static get elementRef() { return "el"; }
|
|
57
96
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { createAnimation } from "../../../utils/animation/animation";
|
|
5
5
|
import { getElementRoot } from "../../../utils/helpers";
|
|
6
|
+
import { getOffsetForMiddlePosition } from "./utils";
|
|
6
7
|
/**
|
|
7
8
|
* iOS Toast Enter Animation
|
|
8
9
|
*/
|
|
@@ -18,7 +19,7 @@ export const iosEnterAnimation = (baseEl, opts) => {
|
|
|
18
19
|
wrapperAnimation.fromTo('transform', 'translateY(-100%)', `translateY(${top})`);
|
|
19
20
|
break;
|
|
20
21
|
case 'middle':
|
|
21
|
-
const topPosition =
|
|
22
|
+
const topPosition = getOffsetForMiddlePosition(baseEl.clientHeight, wrapperEl.clientHeight);
|
|
22
23
|
wrapperEl.style.top = `${topPosition}px`;
|
|
23
24
|
wrapperAnimation.fromTo('opacity', 0.01, 1);
|
|
24
25
|
break;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { createAnimation } from "../../../utils/animation/animation";
|
|
5
5
|
import { getElementRoot } from "../../../utils/helpers";
|
|
6
|
+
import { getOffsetForMiddlePosition } from "./utils";
|
|
6
7
|
/**
|
|
7
8
|
* MD Toast Enter Animation
|
|
8
9
|
*/
|
|
@@ -15,16 +16,16 @@ export const mdEnterAnimation = (baseEl, opts) => {
|
|
|
15
16
|
wrapperAnimation.addElement(wrapperEl);
|
|
16
17
|
switch (position) {
|
|
17
18
|
case 'top':
|
|
18
|
-
wrapperEl.style.
|
|
19
|
+
wrapperEl.style.setProperty('transform', `translateY(${top})`);
|
|
19
20
|
wrapperAnimation.fromTo('opacity', 0.01, 1);
|
|
20
21
|
break;
|
|
21
22
|
case 'middle':
|
|
22
|
-
const topPosition =
|
|
23
|
+
const topPosition = getOffsetForMiddlePosition(baseEl.clientHeight, wrapperEl.clientHeight);
|
|
23
24
|
wrapperEl.style.top = `${topPosition}px`;
|
|
24
25
|
wrapperAnimation.fromTo('opacity', 0.01, 1);
|
|
25
26
|
break;
|
|
26
27
|
default:
|
|
27
|
-
wrapperEl.style.
|
|
28
|
+
wrapperEl.style.setProperty('transform', `translateY(${bottom})`);
|
|
28
29
|
wrapperAnimation.fromTo('opacity', 0.01, 1);
|
|
29
30
|
break;
|
|
30
31
|
}
|
|
@@ -7,10 +7,12 @@ import { printIonWarning } from "../../../utils/logging/index";
|
|
|
7
7
|
* Calculate the CSS top and bottom position of the toast, to be used
|
|
8
8
|
* as starting points for the animation keyframes.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
* which calculates from the
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* The default animations for both MD and iOS
|
|
11
|
+
* use translateY, which calculates from the
|
|
12
|
+
* top edge of the screen. This behavior impacts
|
|
13
|
+
* how we compute the offset when a toast has
|
|
14
|
+
* position='bottom' since we need to calculate from
|
|
15
|
+
* the bottom edge of the screen instead.
|
|
14
16
|
*
|
|
15
17
|
* @param position The value of the toast's position prop.
|
|
16
18
|
* @param positionAnchor The element the toast should be anchored to,
|
|
@@ -25,7 +27,7 @@ export function getAnimationPosition(position, positionAnchor, mode, toast) {
|
|
|
25
27
|
*/
|
|
26
28
|
let offset;
|
|
27
29
|
if (mode === 'md') {
|
|
28
|
-
offset = 8;
|
|
30
|
+
offset = position === 'top' ? 8 : -8;
|
|
29
31
|
}
|
|
30
32
|
else {
|
|
31
33
|
offset = position === 'top' ? 10 : -10;
|
|
@@ -48,12 +50,7 @@ export function getAnimationPosition(position, positionAnchor, mode, toast) {
|
|
|
48
50
|
* to the top edge of the anchor. We want to calculate from the
|
|
49
51
|
* bottom edge of the screen instead.
|
|
50
52
|
*/
|
|
51
|
-
|
|
52
|
-
offset += win.innerHeight - box.top;
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
offset -= win.innerHeight - box.top;
|
|
56
|
-
}
|
|
53
|
+
offset -= win.innerHeight - box.top;
|
|
57
54
|
}
|
|
58
55
|
/**
|
|
59
56
|
* We don't include safe area here because that should already be
|
|
@@ -67,9 +64,7 @@ export function getAnimationPosition(position, positionAnchor, mode, toast) {
|
|
|
67
64
|
else {
|
|
68
65
|
return {
|
|
69
66
|
top: `calc(${offset}px + var(--ion-safe-area-top, 0px))`,
|
|
70
|
-
bottom:
|
|
71
|
-
? `calc(${offset}px + var(--ion-safe-area-bottom, 0px))`
|
|
72
|
-
: `calc(${offset}px - var(--ion-safe-area-bottom, 0px))`,
|
|
67
|
+
bottom: `calc(${offset}px - var(--ion-safe-area-bottom, 0px))`,
|
|
73
68
|
};
|
|
74
69
|
}
|
|
75
70
|
}
|
|
@@ -83,3 +78,14 @@ function warnIfAnchorIsHidden(positionAnchor, toast) {
|
|
|
83
78
|
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);
|
|
84
79
|
}
|
|
85
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Returns the top offset required to place
|
|
83
|
+
* the toast in the middle of the screen.
|
|
84
|
+
* Only needed when position="toast".
|
|
85
|
+
* @param toastHeight: The height of the ion-toast element
|
|
86
|
+
* @param wrapperHeight: The height of the .toast-wrapper element
|
|
87
|
+
* inside the toast's shadow root.
|
|
88
|
+
*/
|
|
89
|
+
export const getOffsetForMiddlePosition = (toastHeight, wrapperHeight) => {
|
|
90
|
+
return Math.floor(toastHeight / 2 - wrapperHeight / 2);
|
|
91
|
+
};
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { Build } from "@stencil/core";
|
|
5
|
+
import { createAnimation } from "../../../utils/animation/animation";
|
|
6
|
+
import { createGesture } from "../../../utils/gesture/index";
|
|
7
|
+
import { getElementRoot } from "../../../utils/helpers";
|
|
8
|
+
import { OVERLAY_GESTURE_PRIORITY } from "../../../utils/overlays";
|
|
9
|
+
import { getOffsetForMiddlePosition } from "../animations/utils";
|
|
10
|
+
/**
|
|
11
|
+
* Create a gesture that allows the Toast
|
|
12
|
+
* to be swiped to dismiss.
|
|
13
|
+
* @param el - The Toast element
|
|
14
|
+
* @param toastPosition - The last computed position of the Toast. This is computed in the "present" method.
|
|
15
|
+
* @param onDismiss - A callback to fire when the Toast was swiped to dismiss.
|
|
16
|
+
*/
|
|
17
|
+
export const createSwipeToDismissGesture = (el, toastPosition, onDismiss) => {
|
|
18
|
+
/**
|
|
19
|
+
* Users should swipe on the visible toast wrapper
|
|
20
|
+
* rather than on ion-toast which covers the entire screen.
|
|
21
|
+
* When testing the class instance the inner wrapper will not
|
|
22
|
+
* be defined. As a result, we use a placeholder element in those environments.
|
|
23
|
+
*/
|
|
24
|
+
const wrapperEl = Build.isTesting
|
|
25
|
+
? document.createElement('div')
|
|
26
|
+
: getElementRoot(el).querySelector('.toast-wrapper');
|
|
27
|
+
const hostElHeight = el.clientHeight;
|
|
28
|
+
const wrapperElBox = wrapperEl.getBoundingClientRect();
|
|
29
|
+
/**
|
|
30
|
+
* The maximum amount that
|
|
31
|
+
* the toast can be swiped. This should
|
|
32
|
+
* account for the wrapper element's height
|
|
33
|
+
* too so the toast can be swiped offscreen
|
|
34
|
+
* completely.
|
|
35
|
+
*/
|
|
36
|
+
let MAX_SWIPE_DISTANCE = 0;
|
|
37
|
+
/**
|
|
38
|
+
* The step value at which a toast
|
|
39
|
+
* is eligible for dismissing via gesture.
|
|
40
|
+
*/
|
|
41
|
+
const DISMISS_THRESHOLD = 0.5;
|
|
42
|
+
/**
|
|
43
|
+
* The middle position Toast starts 50% of the way
|
|
44
|
+
* through the animation, so we need to use this
|
|
45
|
+
* as the starting point for our step values.
|
|
46
|
+
*/
|
|
47
|
+
const STEP_OFFSET = el.position === 'middle' ? 0.5 : 0;
|
|
48
|
+
/**
|
|
49
|
+
* When the Toast is at the top users will be
|
|
50
|
+
* swiping up. As a result, the delta values will be
|
|
51
|
+
* negative numbers which will result in negative steps
|
|
52
|
+
* and thresholds. As a result, we need to make those numbers
|
|
53
|
+
* positive.
|
|
54
|
+
*/
|
|
55
|
+
const INVERSION_FACTOR = el.position === 'top' ? -1 : 1;
|
|
56
|
+
/**
|
|
57
|
+
* The top offset that places the
|
|
58
|
+
* toast in the middle of the screen.
|
|
59
|
+
* Only needed when position="middle".
|
|
60
|
+
*/
|
|
61
|
+
const topPosition = getOffsetForMiddlePosition(hostElHeight, wrapperElBox.height);
|
|
62
|
+
const SWIPE_UP_DOWN_KEYFRAMES = [
|
|
63
|
+
{ offset: 0, transform: `translateY(-${topPosition + wrapperElBox.height}px)` },
|
|
64
|
+
{ offset: 0.5, transform: `translateY(0px)` },
|
|
65
|
+
{ offset: 1, transform: `translateY(${topPosition + wrapperElBox.height}px)` },
|
|
66
|
+
];
|
|
67
|
+
const swipeAnimation = createAnimation('toast-swipe-to-dismiss-animation')
|
|
68
|
+
.addElement(wrapperEl)
|
|
69
|
+
/**
|
|
70
|
+
* The specific value here does not actually
|
|
71
|
+
* matter. We just need this to be a positive
|
|
72
|
+
* value so the animation does not jump
|
|
73
|
+
* to the end when the user beings to drag.
|
|
74
|
+
*/
|
|
75
|
+
.duration(100);
|
|
76
|
+
switch (el.position) {
|
|
77
|
+
case 'middle':
|
|
78
|
+
MAX_SWIPE_DISTANCE = hostElHeight + wrapperElBox.height;
|
|
79
|
+
swipeAnimation.keyframes(SWIPE_UP_DOWN_KEYFRAMES);
|
|
80
|
+
/**
|
|
81
|
+
* Toast can be swiped up or down but
|
|
82
|
+
* should start in the middle of the screen.
|
|
83
|
+
*/
|
|
84
|
+
swipeAnimation.progressStart(true, 0.5);
|
|
85
|
+
break;
|
|
86
|
+
case 'top':
|
|
87
|
+
/**
|
|
88
|
+
* The bottom edge of the wrapper
|
|
89
|
+
* includes the distance between the top
|
|
90
|
+
* of the screen and the top of the wrapper
|
|
91
|
+
* as well as the wrapper height so the wrapper
|
|
92
|
+
* can be dragged fully offscreen.
|
|
93
|
+
*/
|
|
94
|
+
MAX_SWIPE_DISTANCE = wrapperElBox.bottom;
|
|
95
|
+
swipeAnimation.keyframes([
|
|
96
|
+
{ offset: 0, transform: `translateY(${toastPosition.top})` },
|
|
97
|
+
{ offset: 1, transform: 'translateY(-100%)' },
|
|
98
|
+
]);
|
|
99
|
+
swipeAnimation.progressStart(true, 0);
|
|
100
|
+
break;
|
|
101
|
+
case 'bottom':
|
|
102
|
+
default:
|
|
103
|
+
/**
|
|
104
|
+
* This computes the distance between the
|
|
105
|
+
* top of the wrapper and the bottom of the
|
|
106
|
+
* screen including the height of the wrapper
|
|
107
|
+
* element so it can be dragged fully offscreen.
|
|
108
|
+
*/
|
|
109
|
+
MAX_SWIPE_DISTANCE = hostElHeight - wrapperElBox.top;
|
|
110
|
+
swipeAnimation.keyframes([
|
|
111
|
+
{ offset: 0, transform: `translateY(${toastPosition.bottom})` },
|
|
112
|
+
{ offset: 1, transform: 'translateY(100%)' },
|
|
113
|
+
]);
|
|
114
|
+
swipeAnimation.progressStart(true, 0);
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
const computeStep = (delta) => {
|
|
118
|
+
return (delta * INVERSION_FACTOR) / MAX_SWIPE_DISTANCE;
|
|
119
|
+
};
|
|
120
|
+
const onMove = (detail) => {
|
|
121
|
+
const step = STEP_OFFSET + computeStep(detail.deltaY);
|
|
122
|
+
swipeAnimation.progressStep(step);
|
|
123
|
+
};
|
|
124
|
+
const onEnd = (detail) => {
|
|
125
|
+
const velocity = detail.velocityY;
|
|
126
|
+
const threshold = ((detail.deltaY + velocity * 1000) / MAX_SWIPE_DISTANCE) * INVERSION_FACTOR;
|
|
127
|
+
/**
|
|
128
|
+
* Disable the gesture for the remainder of the animation.
|
|
129
|
+
* It will be re-enabled if the toast animates back to
|
|
130
|
+
* its initial presented position.
|
|
131
|
+
*/
|
|
132
|
+
gesture.enable(false);
|
|
133
|
+
let shouldDismiss = true;
|
|
134
|
+
let playTo = 1;
|
|
135
|
+
let step = 0;
|
|
136
|
+
let remainingDistance = 0;
|
|
137
|
+
if (el.position === 'middle') {
|
|
138
|
+
/**
|
|
139
|
+
* A middle positioned Toast appears
|
|
140
|
+
* in the middle of the screen (at animation offset 0.5).
|
|
141
|
+
* As a result, the threshold will be calculated relative
|
|
142
|
+
* to this starting position. In other words at animation offset 0.5
|
|
143
|
+
* the threshold will be 0. We want the middle Toast to be eligible
|
|
144
|
+
* for dismiss when the user has swiped either half way up or down the
|
|
145
|
+
* screen. As a result, we divide DISMISS_THRESHOLD in half. We also
|
|
146
|
+
* consider when the threshold is a negative in the event the
|
|
147
|
+
* user drags up (since the deltaY will also be negative).
|
|
148
|
+
*/
|
|
149
|
+
shouldDismiss = threshold >= DISMISS_THRESHOLD / 2 || threshold <= -DISMISS_THRESHOLD / 2;
|
|
150
|
+
/**
|
|
151
|
+
* Since we are replacing the keyframes
|
|
152
|
+
* below the animation always starts from
|
|
153
|
+
* the beginning of the new keyframes.
|
|
154
|
+
* Similarly, we are always playing to
|
|
155
|
+
* the end of the new keyframes.
|
|
156
|
+
*/
|
|
157
|
+
playTo = 1;
|
|
158
|
+
step = 0;
|
|
159
|
+
/**
|
|
160
|
+
* The Toast should animate from wherever its
|
|
161
|
+
* current position is to the desired end state.
|
|
162
|
+
*
|
|
163
|
+
* To begin, we get the current position of the
|
|
164
|
+
* Toast for its starting state.
|
|
165
|
+
*/
|
|
166
|
+
const wrapperElBox = wrapperEl.getBoundingClientRect();
|
|
167
|
+
const startOffset = wrapperElBox.top - topPosition;
|
|
168
|
+
const startPosition = `${startOffset}px`;
|
|
169
|
+
/**
|
|
170
|
+
* If the deltaY is negative then the user is swiping
|
|
171
|
+
* up, so the Toast should animate to the top of the screen.
|
|
172
|
+
* If the deltaY is positive then the user is swiping
|
|
173
|
+
* down, so the Toast should animate to the bottom of the screen.
|
|
174
|
+
* We also account for when the deltaY is 0, but realistically
|
|
175
|
+
* that should never happen because it means the user did not drag
|
|
176
|
+
* the toast.
|
|
177
|
+
*/
|
|
178
|
+
const offsetFactor = detail.deltaY <= 0 ? -1 : 1;
|
|
179
|
+
const endOffset = (topPosition + wrapperElBox.height) * offsetFactor;
|
|
180
|
+
/**
|
|
181
|
+
* If the Toast should dismiss
|
|
182
|
+
* then we need to figure out which edge of
|
|
183
|
+
* the screen it should animate towards.
|
|
184
|
+
* By default, the Toast will come
|
|
185
|
+
* back to its default state in the
|
|
186
|
+
* middle of the screen.
|
|
187
|
+
*/
|
|
188
|
+
const endPosition = shouldDismiss ? `${endOffset}px` : '0px';
|
|
189
|
+
const KEYFRAMES = [
|
|
190
|
+
{ offset: 0, transform: `translateY(${startPosition})` },
|
|
191
|
+
{ offset: 1, transform: `translateY(${endPosition})` },
|
|
192
|
+
];
|
|
193
|
+
swipeAnimation.keyframes(KEYFRAMES);
|
|
194
|
+
/**
|
|
195
|
+
* Compute the remaining amount of pixels the
|
|
196
|
+
* toast needs to move to be fully dismissed.
|
|
197
|
+
*/
|
|
198
|
+
remainingDistance = endOffset - startOffset;
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
shouldDismiss = threshold >= DISMISS_THRESHOLD;
|
|
202
|
+
playTo = shouldDismiss ? 1 : 0;
|
|
203
|
+
step = computeStep(detail.deltaY);
|
|
204
|
+
/**
|
|
205
|
+
* Compute the remaining amount of pixels the
|
|
206
|
+
* toast needs to move to be fully dismissed.
|
|
207
|
+
*/
|
|
208
|
+
const remainingStepAmount = shouldDismiss ? 1 - step : step;
|
|
209
|
+
remainingDistance = remainingStepAmount * MAX_SWIPE_DISTANCE;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* The animation speed should depend on how quickly
|
|
213
|
+
* the user flicks the toast across the screen. However,
|
|
214
|
+
* it should be no slower than 200ms.
|
|
215
|
+
* We use Math.abs on the remainingDistance because that value
|
|
216
|
+
* can be negative when swiping up on a middle position toast.
|
|
217
|
+
*/
|
|
218
|
+
const duration = Math.min(Math.abs(remainingDistance) / Math.abs(velocity), 200);
|
|
219
|
+
swipeAnimation
|
|
220
|
+
.onFinish(() => {
|
|
221
|
+
if (shouldDismiss) {
|
|
222
|
+
onDismiss();
|
|
223
|
+
swipeAnimation.destroy();
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
if (el.position === 'middle') {
|
|
227
|
+
/**
|
|
228
|
+
* If the toast snapped back to
|
|
229
|
+
* the middle of the screen we need
|
|
230
|
+
* to reset the keyframes
|
|
231
|
+
* so the toast can be swiped
|
|
232
|
+
* up or down again.
|
|
233
|
+
*/
|
|
234
|
+
swipeAnimation.keyframes(SWIPE_UP_DOWN_KEYFRAMES).progressStart(true, 0.5);
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
swipeAnimation.progressStart(true, 0);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* If the toast did not dismiss then
|
|
241
|
+
* the user should be able to swipe again.
|
|
242
|
+
*/
|
|
243
|
+
gesture.enable(true);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* This must be a one time callback
|
|
247
|
+
* otherwise a new callback will
|
|
248
|
+
* be added every time onEnd runs.
|
|
249
|
+
*/
|
|
250
|
+
}, { oneTimeCallback: true })
|
|
251
|
+
.progressEnd(playTo, step, duration);
|
|
252
|
+
};
|
|
253
|
+
const gesture = createGesture({
|
|
254
|
+
el: wrapperEl,
|
|
255
|
+
gestureName: 'toast-swipe-to-dismiss',
|
|
256
|
+
gesturePriority: OVERLAY_GESTURE_PRIORITY,
|
|
257
|
+
/**
|
|
258
|
+
* Toast only supports vertical swipes.
|
|
259
|
+
* This needs to be updated if we later
|
|
260
|
+
* support horizontal swipes.
|
|
261
|
+
*/
|
|
262
|
+
direction: 'y',
|
|
263
|
+
onMove,
|
|
264
|
+
onEnd,
|
|
265
|
+
});
|
|
266
|
+
return gesture;
|
|
267
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { configs, test, dragElementBy } from "../../../../utils/test/playwright/index";
|
|
5
|
+
/**
|
|
6
|
+
* This behavior does not vary across modes and directions.
|
|
7
|
+
*/
|
|
8
|
+
configs({ directions: ['ltr'], modes: ['ios'] }).forEach(({ title, config }) => {
|
|
9
|
+
test.describe(title('toast: swipe gesture with top position'), () => {
|
|
10
|
+
test.beforeEach(async ({ page }) => {
|
|
11
|
+
await page.goto('src/components/toast/test/swipe-gesture', config);
|
|
12
|
+
});
|
|
13
|
+
test('should swipe up to dismiss', async ({ page }) => {
|
|
14
|
+
const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent');
|
|
15
|
+
const ionToastDidDismiss = await page.spyOnEvent('ionToastDidDismiss');
|
|
16
|
+
const presentButton = page.locator('#top');
|
|
17
|
+
await presentButton.click();
|
|
18
|
+
await ionToastDidPresent.next();
|
|
19
|
+
const toastWrapper = page.locator('ion-toast#top-toast .toast-wrapper');
|
|
20
|
+
await dragElementBy(toastWrapper, page, 0, -30);
|
|
21
|
+
await ionToastDidDismiss.next();
|
|
22
|
+
});
|
|
23
|
+
test('should swipe up to dismiss with anchor', async ({ page }) => {
|
|
24
|
+
const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent');
|
|
25
|
+
const ionToastDidDismiss = await page.spyOnEvent('ionToastDidDismiss');
|
|
26
|
+
const presentButton = page.locator('#top-anchor');
|
|
27
|
+
await presentButton.click();
|
|
28
|
+
await ionToastDidPresent.next();
|
|
29
|
+
const toastWrapper = page.locator('ion-toast#top-anchor-toast .toast-wrapper');
|
|
30
|
+
await dragElementBy(toastWrapper, page, 0, -30);
|
|
31
|
+
await ionToastDidDismiss.next();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
test.describe(title('toast: swipe gesture with bottom position'), () => {
|
|
35
|
+
test.beforeEach(async ({ page }) => {
|
|
36
|
+
await page.goto('src/components/toast/test/swipe-gesture', config);
|
|
37
|
+
});
|
|
38
|
+
test('should swipe down to dismiss', async ({ page }) => {
|
|
39
|
+
const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent');
|
|
40
|
+
const ionToastDidDismiss = await page.spyOnEvent('ionToastDidDismiss');
|
|
41
|
+
const presentButton = page.locator('#bottom');
|
|
42
|
+
await presentButton.click();
|
|
43
|
+
await ionToastDidPresent.next();
|
|
44
|
+
const toastWrapper = page.locator('ion-toast#bottom-toast .toast-wrapper');
|
|
45
|
+
await dragElementBy(toastWrapper, page, 0, 30);
|
|
46
|
+
await ionToastDidDismiss.next();
|
|
47
|
+
});
|
|
48
|
+
test('should swipe down to dismiss with anchor', async ({ page }) => {
|
|
49
|
+
const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent');
|
|
50
|
+
const ionToastDidDismiss = await page.spyOnEvent('ionToastDidDismiss');
|
|
51
|
+
const presentButton = page.locator('#bottom-anchor');
|
|
52
|
+
await presentButton.click();
|
|
53
|
+
await ionToastDidPresent.next();
|
|
54
|
+
const toastWrapper = page.locator('ion-toast#bottom-anchor-toast .toast-wrapper');
|
|
55
|
+
await dragElementBy(toastWrapper, page, 0, 30);
|
|
56
|
+
await ionToastDidDismiss.next();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
test.describe(title('toast: swipe gesture with middle position'), () => {
|
|
60
|
+
test.beforeEach(async ({ page }) => {
|
|
61
|
+
await page.goto('src/components/toast/test/swipe-gesture', config);
|
|
62
|
+
});
|
|
63
|
+
test('should swipe down to dismiss', async ({ page }) => {
|
|
64
|
+
const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent');
|
|
65
|
+
const ionToastDidDismiss = await page.spyOnEvent('ionToastDidDismiss');
|
|
66
|
+
const presentButton = page.locator('#middle');
|
|
67
|
+
await presentButton.click();
|
|
68
|
+
await ionToastDidPresent.next();
|
|
69
|
+
const toastWrapper = page.locator('ion-toast#middle-toast .toast-wrapper');
|
|
70
|
+
await dragElementBy(toastWrapper, page, 0, 100);
|
|
71
|
+
await ionToastDidDismiss.next();
|
|
72
|
+
});
|
|
73
|
+
test('should swipe up to dismiss', async ({ page }) => {
|
|
74
|
+
const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent');
|
|
75
|
+
const ionToastDidDismiss = await page.spyOnEvent('ionToastDidDismiss');
|
|
76
|
+
const presentButton = page.locator('#middle');
|
|
77
|
+
await presentButton.click();
|
|
78
|
+
await ionToastDidPresent.next();
|
|
79
|
+
const toastWrapper = page.locator('ion-toast#middle-toast .toast-wrapper');
|
|
80
|
+
await dragElementBy(toastWrapper, page, 0, -100);
|
|
81
|
+
await ionToastDidDismiss.next();
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
});
|
|
@@ -167,6 +167,16 @@
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
.toast-wrapper.toast-top {
|
|
171
|
+
transform: translate3d(0, -100%, 0);
|
|
172
|
+
top: 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.toast-wrapper.toast-bottom {
|
|
176
|
+
transform: translate3d(0, 100%, 0);
|
|
177
|
+
bottom: 0;
|
|
178
|
+
}
|
|
179
|
+
|
|
170
180
|
.toast-container {
|
|
171
181
|
display: flex;
|
|
172
182
|
align-items: center;
|
|
@@ -299,20 +309,10 @@
|
|
|
299
309
|
background: rgba(var(--ion-color-base-rgb), 0.8);
|
|
300
310
|
}
|
|
301
311
|
}
|
|
302
|
-
.toast-wrapper.toast-top {
|
|
303
|
-
transform: translate3d(0, -100%, 0);
|
|
304
|
-
top: 0;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
312
|
.toast-wrapper.toast-middle {
|
|
308
313
|
opacity: 0.01;
|
|
309
314
|
}
|
|
310
315
|
|
|
311
|
-
.toast-wrapper.toast-bottom {
|
|
312
|
-
transform: translate3d(0, 100%, 0);
|
|
313
|
-
bottom: 0;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
316
|
.toast-content {
|
|
317
317
|
-webkit-padding-start: 15px;
|
|
318
318
|
padding-inline-start: 15px;
|