@pod-os/elements 0.6.1-bea440b.0 → 0.7.1-2196a40.0
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/dist/cjs/{animation-5840e4df.js → animation-9bea118f.js} +115 -84
- package/dist/cjs/{app-globals-1aedd05c.js → app-globals-6352043e.js} +1 -1
- package/dist/cjs/{cubic-bezier-dcb7bfef.js → cubic-bezier-0b702a31.js} +13 -12
- package/dist/cjs/data-0c9489d7.js +1510 -0
- package/dist/cjs/dir-011f46ea.js +20 -0
- package/dist/cjs/elements.cjs.js +5 -5
- package/dist/cjs/focus-visible-2624ec15.js +76 -0
- package/dist/cjs/framework-delegate-437c0645.js +119 -0
- package/dist/cjs/{gesture-controller-fbbe9a65.js → gesture-controller-00a6b02f.js} +6 -2
- package/dist/cjs/{haptic-09e73337.js → haptic-7358cb0b.js} +37 -8
- package/dist/cjs/{hardware-back-button-01027575.js → hardware-back-button-25372ec7.js} +11 -8
- package/dist/cjs/{helpers-398ced09.js → helpers-cb08f5ae.js} +115 -15
- package/dist/cjs/{index-2067b305.js → index-1b07c737.js} +35 -24
- package/dist/cjs/{index-68ae43d2.js → index-2dc3637c.js} +34 -28
- package/dist/cjs/index-57b9fa9e.js +30 -0
- package/dist/cjs/{index-d01d9183.js → index-643851c6.js} +34 -19
- package/dist/cjs/index-731691ca.js +48 -0
- package/dist/cjs/{index-6bbae9b1.js → index-7d56774d.js} +12 -8
- package/dist/cjs/index-9fca5d6f.js +140 -0
- package/dist/cjs/index-b2a479e4.js +38 -0
- package/dist/cjs/{index-b4a9ece2.js → index-eaa0d16e.js} +7 -0
- package/dist/cjs/{tap-click-f24cb477.js → index-ed2ce04f.js} +37 -19
- package/dist/cjs/{input-shims-e959d9e2.js → input-shims-427999f7.js} +89 -38
- package/dist/cjs/ion-accordion-group.cjs.entry.js +205 -0
- package/dist/cjs/ion-accordion.cjs.entry.js +336 -0
- package/dist/cjs/ion-action-sheet_3.cjs.entry.js +865 -0
- package/dist/cjs/{ion-app_45.cjs.entry.js → ion-app_46.cjs.entry.js} +1775 -1471
- package/dist/cjs/ion-avatar.cjs.entry.js +2 -2
- package/dist/cjs/ion-back-button.cjs.entry.js +12 -11
- package/dist/cjs/ion-backdrop.cjs.entry.js +4 -4
- package/dist/cjs/ion-breadcrumb.cjs.entry.js +101 -0
- package/dist/cjs/ion-breadcrumbs.cjs.entry.js +133 -0
- package/dist/cjs/ion-buttons_3.cjs.entry.js +793 -0
- package/dist/cjs/ion-card-subtitle.cjs.entry.js +4 -4
- package/dist/cjs/{ion-list-header_3.cjs.entry.js → ion-checkbox_4.cjs.entry.js} +124 -23
- package/dist/cjs/ion-chip.cjs.entry.js +5 -10
- package/dist/cjs/ion-datetime-button.cjs.entry.js +346 -0
- package/dist/cjs/ion-datetime.cjs.entry.js +1548 -856
- package/dist/cjs/ion-fab-button.cjs.entry.js +26 -9
- package/dist/cjs/ion-fab-list.cjs.entry.js +4 -4
- package/dist/cjs/ion-fab.cjs.entry.js +15 -13
- package/dist/cjs/ion-img.cjs.entry.js +28 -4
- package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +5 -5
- package/dist/cjs/ion-infinite-scroll.cjs.entry.js +13 -13
- package/dist/cjs/ion-input.cjs.entry.js +57 -23
- package/dist/cjs/ion-item-option.cjs.entry.js +8 -8
- package/dist/cjs/ion-item-options.cjs.entry.js +5 -5
- package/dist/cjs/ion-item-sliding.cjs.entry.js +59 -63
- package/dist/cjs/ion-loading.cjs.entry.js +37 -36
- package/dist/cjs/ion-menu-button.cjs.entry.js +14 -12
- package/dist/cjs/ion-menu-toggle.cjs.entry.js +8 -7
- package/dist/cjs/ion-menu.cjs.entry.js +71 -57
- package/dist/cjs/ion-modal.cjs.entry.js +1384 -154
- package/dist/cjs/ion-nav-link.cjs.entry.js +5 -2
- package/dist/cjs/ion-nav.cjs.entry.js +177 -171
- package/dist/cjs/ion-picker-column.cjs.entry.js +25 -27
- package/dist/cjs/ion-picker.cjs.entry.js +22 -17
- package/dist/cjs/ion-popover.cjs.entry.js +1208 -182
- package/dist/cjs/ion-range.cjs.entry.js +137 -57
- package/dist/cjs/ion-refresher-content.cjs.entry.js +7 -12
- package/dist/cjs/ion-refresher.cjs.entry.js +150 -148
- package/dist/cjs/ion-reorder-group.cjs.entry.js +42 -35
- package/dist/cjs/ion-reorder.cjs.entry.js +5 -4
- package/dist/cjs/ion-route-redirect.cjs.entry.js +1 -1
- package/dist/cjs/ion-route.cjs.entry.js +1 -1
- package/dist/cjs/ion-router-link.cjs.entry.js +5 -5
- package/dist/cjs/ion-router-outlet.cjs.entry.js +24 -20
- package/dist/cjs/ion-router.cjs.entry.js +291 -194
- package/dist/cjs/ion-segment-button.cjs.entry.js +10 -17
- package/dist/cjs/ion-segment.cjs.entry.js +119 -26
- package/dist/cjs/ion-select-option.cjs.entry.js +3 -3
- package/dist/cjs/ion-select.cjs.entry.js +113 -78
- package/dist/cjs/ion-slide.cjs.entry.js +3 -3
- package/dist/cjs/ion-slides.cjs.entry.js +26 -27
- package/dist/cjs/ion-spinner.cjs.entry.js +10 -9
- package/dist/cjs/ion-split-pane.cjs.entry.js +16 -12
- package/dist/cjs/ion-tab-bar.cjs.entry.js +16 -23
- package/dist/cjs/ion-tab-button.cjs.entry.js +6 -6
- package/dist/cjs/ion-tab.cjs.entry.js +4 -4
- package/dist/cjs/ion-tabs.cjs.entry.js +4 -5
- package/dist/cjs/ion-text.cjs.entry.js +3 -3
- package/dist/cjs/ion-textarea.cjs.entry.js +31 -29
- package/dist/cjs/ion-thumbnail.cjs.entry.js +2 -2
- package/dist/cjs/ion-toast.cjs.entry.js +49 -59
- package/dist/cjs/ion-toggle.cjs.entry.js +41 -22
- package/dist/cjs/ion-virtual-scroll.cjs.entry.js +39 -31
- package/dist/cjs/{ionic-global-56e10eb5.js → ionic-global-f2d95fd3.js} +112 -93
- package/dist/cjs/{ios.transition-32e4623d.js → ios.transition-0f31ec9a.js} +78 -53
- package/dist/cjs/{keyboard-9e8103e4.js → keyboard-79afcba2.js} +6 -3
- package/dist/cjs/keyboard-controller-a934d106.js +42 -0
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/{md.transition-169c54f0.js → md.transition-d2a33a23.js} +15 -17
- package/dist/cjs/{menu-toggle-util-087678e0.js → menu-toggle-util-0a43ff7c.js} +5 -2
- package/dist/cjs/{overlays-49fe9ba7.js → overlays-65c716aa.js} +187 -71
- package/dist/cjs/spinner-configs-cd0abbeb.js +147 -0
- package/dist/cjs/{status-tap-ada894ff.js → status-tap-beaa3a71.js} +10 -5
- package/dist/cjs/{swipe-back-c4a778df.js → swipe-back-666ea8e6.js} +34 -15
- package/dist/cjs/test-component.cjs.entry.js +1 -1
- package/dist/cjs/{theme-2259d0f5.js → theme-fc63803b.js} +9 -5
- package/dist/collection/apps/pos-app-image-viewer/pos-app-image-viewer.js +1 -0
- package/dist/collection/collection-manifest.json +8 -1
- package/dist/collection/components/pos-image/pos-image.css +4 -0
- package/dist/custom-elements/index.js +12770 -4850
- package/dist/custom-elements/{tap-click.js → index2.js} +36 -18
- package/dist/custom-elements/input-shims.js +87 -38
- package/dist/custom-elements/ios.transition.js +74 -50
- package/dist/custom-elements/md.transition.js +11 -14
- package/dist/custom-elements/status-tap.js +7 -4
- package/dist/custom-elements/swipe-back.js +31 -13
- package/dist/elements/elements.css +1 -1
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/p-0268cbd3.entry.js +7 -0
- package/dist/elements/p-0587332d.entry.js +1 -0
- package/dist/elements/{p-cfc0e54d.js → p-0991c811.js} +3 -0
- package/dist/elements/p-0a69a563.entry.js +1 -0
- package/dist/elements/p-0b95be17.entry.js +1 -0
- package/dist/elements/p-0d284fe0.entry.js +1 -0
- package/dist/elements/p-0fd77b33.entry.js +1 -0
- package/dist/elements/p-120dec2b.entry.js +1 -0
- package/dist/elements/p-12880671.entry.js +1 -0
- package/dist/elements/p-14ccd586.entry.js +1 -0
- package/dist/elements/{p-83d45051.entry.js → p-14df6ac0.entry.js} +1 -1
- package/dist/elements/{p-e860be6a.entry.js → p-17079f06.entry.js} +1 -1
- package/dist/elements/p-19e4a688.js +4 -0
- package/dist/elements/p-1afc4eb4.js +4 -0
- package/dist/elements/p-1beaf6bf.js +4 -0
- package/dist/elements/p-1d1c6a6f.entry.js +1 -0
- package/dist/elements/{p-31d30e42.entry.js → p-1d98f84b.entry.js} +1 -1
- package/dist/elements/p-278ca4c9.js +4 -0
- package/dist/elements/p-27f5629c.entry.js +1 -0
- package/dist/elements/p-29c0f03f.js +4 -0
- package/dist/elements/p-2da59aca.js +4 -0
- package/dist/elements/p-3152143f.js +4 -0
- package/dist/elements/p-343ff720.entry.js +7 -0
- package/dist/elements/p-36d4c9a8.js +4 -0
- package/dist/elements/p-3a30dfb2.entry.js +1 -0
- package/dist/elements/p-3c013bf1.entry.js +1 -0
- package/dist/elements/{p-74ba1e42.entry.js → p-3c318da5.entry.js} +1 -1
- package/dist/elements/p-3cee3222.entry.js +1 -0
- package/dist/elements/p-480b3c4f.entry.js +1 -0
- package/dist/elements/p-4e9d8f18.entry.js +1 -0
- package/dist/elements/p-53e23176.js +2 -0
- package/dist/elements/p-548524f3.js +4 -0
- package/dist/elements/p-5739fa41.entry.js +1 -0
- package/dist/elements/p-5808c505.js +1 -0
- package/dist/elements/p-58a8cc2a.js +4 -0
- package/dist/elements/p-6035415e.entry.js +1 -0
- package/dist/elements/p-60eeae90.js +4 -0
- package/dist/elements/p-610b03ff.entry.js +4 -0
- package/dist/elements/p-67777478.entry.js +1 -0
- package/dist/elements/p-6ab826e1.entry.js +1 -0
- package/dist/elements/p-6f5a2827.entry.js +1 -0
- package/dist/elements/p-779676c5.entry.js +1 -0
- package/dist/elements/p-7916ecc5.entry.js +1 -0
- package/dist/elements/p-79f06b80.entry.js +1 -0
- package/dist/elements/p-7b5991c1.entry.js +1 -0
- package/dist/elements/p-7d0def79.js +5 -0
- package/dist/elements/p-8112afea.js +4 -0
- package/dist/elements/p-83678d7d.entry.js +4 -0
- package/dist/elements/p-87e45c94.entry.js +1 -0
- package/dist/elements/p-8da6a31e.entry.js +1 -0
- package/dist/elements/p-8f80768f.entry.js +4 -0
- package/dist/elements/p-8fe0433b.js +4 -0
- package/dist/elements/{p-4cb27b48.entry.js → p-9147d82b.entry.js} +1 -1
- package/dist/elements/p-97abb434.entry.js +1 -0
- package/dist/elements/p-98497a4b.entry.js +1 -0
- package/dist/elements/p-9c719139.js +4 -0
- package/dist/elements/p-9ca37332.js +4 -0
- package/dist/elements/{p-37de7110.js → p-9d48def2.js} +3 -0
- package/dist/elements/p-a79a6ad9.entry.js +79 -0
- package/dist/elements/p-a805f2f9.entry.js +1 -0
- package/dist/elements/p-a86a5bfa.entry.js +1 -0
- package/dist/elements/{p-9c1dbe52.entry.js → p-ac34eab7.entry.js} +1 -1
- package/dist/elements/p-ad366eab.entry.js +4 -0
- package/dist/elements/p-aef3a931.js +7 -0
- package/dist/elements/p-b0537eb3.entry.js +1 -0
- package/dist/elements/p-b337f3b8.js +4 -0
- package/dist/elements/p-b34bf73f.entry.js +7 -0
- package/dist/elements/p-b41e66f0.entry.js +1 -0
- package/dist/elements/p-b47e7091.entry.js +1 -0
- package/dist/elements/p-b840320e.js +4 -0
- package/dist/elements/p-b934ac5d.entry.js +1 -0
- package/dist/elements/p-b98314e0.entry.js +4 -0
- package/dist/elements/p-bd12806f.entry.js +1 -0
- package/dist/elements/p-c16d38d5.js +4 -0
- package/dist/elements/p-c84205a3.js +4 -0
- package/dist/elements/{p-06675ac7.entry.js → p-cbe318f8.entry.js} +1 -1
- package/dist/elements/p-cfed7395.js +4 -0
- package/dist/elements/p-d22a1dc7.entry.js +7 -0
- package/dist/elements/p-d3e75c94.entry.js +1 -0
- package/dist/elements/p-d8f6d3ce.entry.js +14 -0
- package/dist/elements/p-d9880221.entry.js +4 -0
- package/dist/elements/p-da5db8fb.entry.js +1 -0
- package/dist/elements/{p-91fe653f.js → p-dcc6b03c.js} +3 -0
- package/dist/elements/{p-305e246c.entry.js → p-dd846020.entry.js} +1 -1
- package/dist/elements/p-df240b2a.entry.js +4 -0
- package/dist/elements/p-dffd8689.js +4 -0
- package/dist/elements/p-e495a095.js +4 -0
- package/dist/elements/p-e5fc7d42.entry.js +1 -0
- package/dist/elements/{p-aaa8393e.entry.js → p-eb137e9d.entry.js} +1 -1
- package/dist/elements/p-f4e54a17.js +7 -0
- package/dist/elements/p-f67d0717.entry.js +1 -0
- package/dist/elements/p-f7f4c640.js +1 -0
- package/dist/elements/p-f851b91a.js +4 -0
- package/dist/elements/p-fb27ee76.entry.js +1 -0
- package/dist/elements/p-fbddca35.entry.js +1 -0
- package/dist/elements/p-fc1df8e0.entry.js +7 -0
- package/dist/elements/p-fdac5f3a.js +4 -0
- package/dist/esm/{animation-fe6ed422.js → animation-801a007a.js} +115 -84
- package/dist/esm/{app-globals-27d92837.js → app-globals-05a3abfb.js} +1 -1
- package/dist/esm/{cubic-bezier-108b8579.js → cubic-bezier-538b6253.js} +13 -12
- package/dist/esm/data-62c81c24.js +1463 -0
- package/dist/esm/dir-defb16c6.js +18 -0
- package/dist/esm/elements.js +5 -5
- package/dist/esm/focus-visible-78d55799.js +74 -0
- package/dist/esm/framework-delegate-7e2b767b.js +115 -0
- package/dist/esm/{gesture-controller-8f35af24.js → gesture-controller-c466ff14.js} +6 -2
- package/dist/esm/{haptic-c424e670.js → haptic-e7d5ef4d.js} +38 -9
- package/dist/esm/{hardware-back-button-bb4c578a.js → hardware-back-button-242191a7.js} +11 -8
- package/dist/esm/{helpers-44e3bd9f.js → helpers-aeff219b.js} +113 -16
- package/dist/esm/index-0dbaca1a.js +28 -0
- package/dist/esm/index-1f3d8582.js +34 -0
- package/dist/esm/{index-97199683.js → index-2be9a18b.js} +34 -28
- package/dist/esm/{index-8d682224.js → index-51e4a829.js} +12 -8
- package/dist/esm/{index-8a463a85.js → index-6048aed6.js} +35 -24
- package/dist/esm/index-65ecd543.js +25 -0
- package/dist/esm/{tap-click-a7e55ef5.js → index-b212db1c.js} +37 -19
- package/dist/esm/{index-e4deec27.js → index-cb938ffb.js} +7 -1
- package/dist/esm/{index-3a1bd803.js → index-d39eb62b.js} +35 -20
- package/dist/esm/index-ebf7f059.js +128 -0
- package/dist/esm/{input-shims-3b48722f.js → input-shims-8a389148.js} +89 -38
- package/dist/esm/ion-accordion-group.entry.js +201 -0
- package/dist/esm/ion-accordion.entry.js +332 -0
- package/dist/esm/ion-action-sheet_3.entry.js +859 -0
- package/dist/esm/{ion-app_45.entry.js → ion-app_46.entry.js} +1775 -1472
- package/dist/esm/ion-avatar.entry.js +2 -2
- package/dist/esm/ion-back-button.entry.js +12 -11
- package/dist/esm/ion-backdrop.entry.js +4 -4
- package/dist/esm/ion-breadcrumb.entry.js +97 -0
- package/dist/esm/ion-breadcrumbs.entry.js +129 -0
- package/dist/esm/ion-buttons_3.entry.js +787 -0
- package/dist/esm/ion-card-subtitle.entry.js +4 -4
- package/dist/esm/{ion-list-header_3.entry.js → ion-checkbox_4.entry.js} +124 -24
- package/dist/esm/ion-chip.entry.js +5 -10
- package/dist/esm/ion-datetime-button.entry.js +342 -0
- package/dist/esm/ion-datetime.entry.js +1548 -856
- package/dist/esm/ion-fab-button.entry.js +26 -9
- package/dist/esm/ion-fab-list.entry.js +4 -4
- package/dist/esm/ion-fab.entry.js +15 -13
- package/dist/esm/ion-img.entry.js +28 -4
- package/dist/esm/ion-infinite-scroll-content.entry.js +5 -5
- package/dist/esm/ion-infinite-scroll.entry.js +13 -13
- package/dist/esm/ion-input.entry.js +57 -23
- package/dist/esm/ion-item-option.entry.js +8 -8
- package/dist/esm/ion-item-options.entry.js +5 -5
- package/dist/esm/ion-item-sliding.entry.js +59 -63
- package/dist/esm/ion-loading.entry.js +37 -36
- package/dist/esm/ion-menu-button.entry.js +14 -12
- package/dist/esm/ion-menu-toggle.entry.js +8 -7
- package/dist/esm/ion-menu.entry.js +71 -57
- package/dist/esm/ion-modal.entry.js +1375 -145
- package/dist/esm/ion-nav-link.entry.js +5 -2
- package/dist/esm/ion-nav.entry.js +177 -171
- package/dist/esm/ion-picker-column.entry.js +25 -27
- package/dist/esm/ion-picker.entry.js +22 -17
- package/dist/esm/ion-popover.entry.js +1208 -182
- package/dist/esm/ion-range.entry.js +137 -57
- package/dist/esm/ion-refresher-content.entry.js +7 -12
- package/dist/esm/ion-refresher.entry.js +149 -147
- package/dist/esm/ion-reorder-group.entry.js +42 -35
- package/dist/esm/ion-reorder.entry.js +5 -4
- package/dist/esm/ion-route-redirect.entry.js +1 -1
- package/dist/esm/ion-route.entry.js +1 -1
- package/dist/esm/ion-router-link.entry.js +5 -5
- package/dist/esm/ion-router-outlet.entry.js +24 -20
- package/dist/esm/ion-router.entry.js +291 -194
- package/dist/esm/ion-segment-button.entry.js +10 -17
- package/dist/esm/ion-segment.entry.js +119 -26
- package/dist/esm/ion-select-option.entry.js +3 -3
- package/dist/esm/ion-select.entry.js +113 -78
- package/dist/esm/ion-slide.entry.js +3 -3
- package/dist/esm/ion-slides.entry.js +26 -27
- package/dist/esm/ion-spinner.entry.js +10 -9
- package/dist/esm/ion-split-pane.entry.js +16 -12
- package/dist/esm/ion-tab-bar.entry.js +16 -23
- package/dist/esm/ion-tab-button.entry.js +6 -6
- package/dist/esm/ion-tab.entry.js +4 -4
- package/dist/esm/ion-tabs.entry.js +4 -5
- package/dist/esm/ion-text.entry.js +3 -3
- package/dist/esm/ion-textarea.entry.js +31 -29
- package/dist/esm/ion-thumbnail.entry.js +2 -2
- package/dist/esm/ion-toast.entry.js +49 -59
- package/dist/esm/ion-toggle.entry.js +41 -22
- package/dist/esm/ion-virtual-scroll.entry.js +39 -31
- package/dist/esm/{ionic-global-2e28f7c7.js → ionic-global-6cd57191.js} +112 -93
- package/dist/esm/{ios.transition-a783e3cd.js → ios.transition-bbd952f2.js} +78 -53
- package/dist/{custom-elements/keyboard.js → esm/keyboard-413afe04.js} +6 -3
- package/dist/esm/keyboard-controller-33693bc2.js +40 -0
- package/dist/esm/loader.js +5 -5
- package/dist/esm/{md.transition-5a4a8c82.js → md.transition-5170a6d3.js} +15 -17
- package/dist/esm/{menu-toggle-util-562dfc9c.js → menu-toggle-util-82bf888a.js} +5 -2
- package/dist/esm/{overlays-fc9a0625.js → overlays-0c7f05e1.js} +186 -71
- package/dist/esm/spinner-configs-cbcd1f62.js +145 -0
- package/dist/esm/{status-tap-69e62ad6.js → status-tap-ad757b8a.js} +10 -5
- package/dist/esm/swipe-back-7ef22876.js +69 -0
- package/dist/esm/test-component.entry.js +1 -1
- package/dist/esm/{theme-d21826a7.js → theme-7cf2cab0.js} +9 -5
- package/package.json +4 -5
- package/LICENSE +0 -21
- package/dist/cjs/button-active-c14dab31.js +0 -66
- package/dist/cjs/focus-visible-16c98640.js +0 -45
- package/dist/cjs/framework-delegate-c45292a3.js +0 -37
- package/dist/cjs/ion-action-sheet.cjs.entry.js +0 -265
- package/dist/cjs/ion-alert.cjs.entry.js +0 -456
- package/dist/cjs/ion-buttons.cjs.entry.js +0 -42
- package/dist/cjs/ion-checkbox.cjs.entry.js +0 -117
- package/dist/cjs/ion-note.cjs.entry.js +0 -29
- package/dist/cjs/ion-select-popover.cjs.entry.js +0 -35
- package/dist/cjs/spinner-configs-fb16b986.js +0 -112
- package/dist/custom-elements/focus-visible.js +0 -43
- package/dist/elements/p-03bda390.js +0 -1
- package/dist/elements/p-0be044f1.entry.js +0 -1
- package/dist/elements/p-119c7c6c.entry.js +0 -1
- package/dist/elements/p-14c7c3ea.entry.js +0 -1
- package/dist/elements/p-1d4a2c61.js +0 -1
- package/dist/elements/p-1d894ac4.entry.js +0 -1
- package/dist/elements/p-1dafa1ce.entry.js +0 -1
- package/dist/elements/p-23b89ccb.entry.js +0 -1
- package/dist/elements/p-2c03b9ab.entry.js +0 -1
- package/dist/elements/p-346985f2.js +0 -1
- package/dist/elements/p-360f1c62.entry.js +0 -1
- package/dist/elements/p-373e1f25.entry.js +0 -1
- package/dist/elements/p-40547acb.entry.js +0 -1
- package/dist/elements/p-40b68014.entry.js +0 -1
- package/dist/elements/p-42e4f702.entry.js +0 -1
- package/dist/elements/p-489807e5.js +0 -1
- package/dist/elements/p-4ad72d54.entry.js +0 -1
- package/dist/elements/p-4cca7b5e.entry.js +0 -1
- package/dist/elements/p-4f24d306.js +0 -1
- package/dist/elements/p-519d6a53.entry.js +0 -1
- package/dist/elements/p-536e8e52.entry.js +0 -1
- package/dist/elements/p-599bb53f.entry.js +0 -1
- package/dist/elements/p-5eb7a546.js +0 -1
- package/dist/elements/p-60df2bed.entry.js +0 -1
- package/dist/elements/p-65133e33.js +0 -1
- package/dist/elements/p-6693fce8.js +0 -1
- package/dist/elements/p-689bdcc1.entry.js +0 -1
- package/dist/elements/p-70713b3d.entry.js +0 -1
- package/dist/elements/p-707d5d76.js +0 -1
- package/dist/elements/p-7212b7f2.js +0 -1
- package/dist/elements/p-73992898.entry.js +0 -1
- package/dist/elements/p-792c1e0f.entry.js +0 -1
- package/dist/elements/p-7e5300af.js +0 -2
- package/dist/elements/p-8068987c.entry.js +0 -1
- package/dist/elements/p-83accf46.entry.js +0 -1
- package/dist/elements/p-86635d06.entry.js +0 -1
- package/dist/elements/p-874c2b44.js +0 -1
- package/dist/elements/p-89c12ce8.entry.js +0 -1
- package/dist/elements/p-8bcba3f7.entry.js +0 -1
- package/dist/elements/p-8c759f51.entry.js +0 -1
- package/dist/elements/p-8f945e6b.entry.js +0 -1
- package/dist/elements/p-9300ab6a.js +0 -1
- package/dist/elements/p-93cacd51.entry.js +0 -1
- package/dist/elements/p-9408d0b4.entry.js +0 -1
- package/dist/elements/p-98c79eda.js +0 -1
- package/dist/elements/p-99f8abed.js +0 -1
- package/dist/elements/p-9ca7e079.js +0 -1
- package/dist/elements/p-a4648b74.entry.js +0 -1
- package/dist/elements/p-aab0f63c.js +0 -1
- package/dist/elements/p-ad4e2295.entry.js +0 -1
- package/dist/elements/p-afb8f7d5.entry.js +0 -1
- package/dist/elements/p-b055ec44.js +0 -1
- package/dist/elements/p-b078d63b.entry.js +0 -1
- package/dist/elements/p-b3460325.entry.js +0 -1
- package/dist/elements/p-b3f4042e.entry.js +0 -67
- package/dist/elements/p-b5406b58.entry.js +0 -1
- package/dist/elements/p-b5ef0c91.entry.js +0 -1
- package/dist/elements/p-b6ba623e.entry.js +0 -1
- package/dist/elements/p-b9926d8b.entry.js +0 -1
- package/dist/elements/p-bfd4cfcd.entry.js +0 -1
- package/dist/elements/p-c08dd7d0.entry.js +0 -1
- package/dist/elements/p-c0db9c51.entry.js +0 -1
- package/dist/elements/p-c1e7fbfb.js +0 -1
- package/dist/elements/p-ca69d6c9.js +0 -1
- package/dist/elements/p-cc4cb1ac.entry.js +0 -1
- package/dist/elements/p-cf8a7031.entry.js +0 -1
- package/dist/elements/p-cff82b6f.js +0 -1
- package/dist/elements/p-d6d1e65f.entry.js +0 -1
- package/dist/elements/p-d9462b66.entry.js +0 -1
- package/dist/elements/p-e2e0fee9.entry.js +0 -1
- package/dist/elements/p-e642b266.entry.js +0 -1
- package/dist/elements/p-e953934f.entry.js +0 -1
- package/dist/elements/p-f0474f46.js +0 -1
- package/dist/elements/p-f10a94f6.entry.js +0 -1
- package/dist/elements/p-f2426182.entry.js +0 -1
- package/dist/elements/p-f327fd21.js +0 -1
- package/dist/elements/p-f84987ee.js +0 -1
- package/dist/elements/p-f8a3367d.entry.js +0 -1
- package/dist/esm/button-active-fd9d6d91.js +0 -64
- package/dist/esm/focus-visible-edb28f19.js +0 -43
- package/dist/esm/framework-delegate-9cd8048f.js +0 -34
- package/dist/esm/ion-action-sheet.entry.js +0 -261
- package/dist/esm/ion-alert.entry.js +0 -452
- package/dist/esm/ion-buttons.entry.js +0 -38
- package/dist/esm/ion-checkbox.entry.js +0 -113
- package/dist/esm/ion-note.entry.js +0 -25
- package/dist/esm/ion-select-popover.entry.js +0 -31
- package/dist/esm/keyboard-e6abcb80.js +0 -125
- package/dist/esm/spinner-configs-aaf2a1a9.js +0 -110
- package/dist/esm/swipe-back-d84cfc8a.js +0 -50
- package/readme.md +0 -55
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
2
|
-
import { g as getIonMode } from './ionic-global-
|
|
3
|
-
import { c as createColorClasses } from './theme-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-cb938ffb.js';
|
|
2
|
+
import { g as getIonMode } from './ionic-global-6cd57191.js';
|
|
3
|
+
import { c as createColorClasses } from './theme-7cf2cab0.js';
|
|
4
4
|
|
|
5
5
|
const cardSubtitleIosCss = ":host{display:block;position:relative;color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-600, #666666);margin-left:0;margin-right:0;margin-top:0;margin-bottom:4px;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:12px;font-weight:700;letter-spacing:0.4px;text-transform:uppercase}";
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ const CardSubtitle = class {
|
|
|
14
14
|
const mode = getIonMode(this);
|
|
15
15
|
return (h(Host, { role: "heading", "aria-level": "3", class: createColorClasses(this.color, {
|
|
16
16
|
'ion-inherit-color': true,
|
|
17
|
-
[mode]: true
|
|
17
|
+
[mode]: true,
|
|
18
18
|
}) }, h("slot", null)));
|
|
19
19
|
}
|
|
20
20
|
};
|
|
@@ -1,7 +1,110 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, c as
|
|
2
|
-
import { g as getIonMode } from './ionic-global-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { r as registerInstance, d as createEvent, h, H as Host, c as getElement } from './index-cb938ffb.js';
|
|
2
|
+
import { g as getIonMode } from './ionic-global-6cd57191.js';
|
|
3
|
+
import { o as getAriaLabel, j as renderHiddenInput, e as addEventListener, f as removeEventListener } from './helpers-aeff219b.js';
|
|
4
|
+
import { c as createColorClasses, h as hostContext } from './theme-7cf2cab0.js';
|
|
5
|
+
|
|
6
|
+
const checkboxIosCss = ":host{--background-checked:var(--ion-color-primary, #3880ff);--border-color-checked:var(--ion-color-primary, #3880ff);--checkmark-color:var(--ion-color-primary-contrast, #fff);--checkmark-width:1;--transition:none;display:inline-block;position:relative;user-select:none;z-index:2}:host(.ion-color){--background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}label{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;appearance:none;outline:none;display:flex;align-items:center;opacity:0}[dir=rtl] label,:host-context([dir=rtl]) label{left:unset;right:unset;right:0}label::-moz-focus-inner{border:0}input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.checkbox-icon{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);box-sizing:border-box}.checkbox-icon path{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}:host(.checkbox-checked) .checkbox-icon,:host(.checkbox-indeterminate) .checkbox-icon{border-color:var(--border-color-checked);background:var(--background-checked)}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{opacity:1}:host(.checkbox-disabled){pointer-events:none}:host{--border-radius:50%;--border-width:1px;--border-style:solid;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.23);--background:var(--ion-item-background, var(--ion-background-color, #fff));--size:26px;width:var(--size);height:var(--size)}:host(.checkbox-disabled){opacity:0.3}:host(.in-item){margin-left:0;margin-right:8px;margin-top:10px;margin-bottom:9px;display:block;position:static}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.in-item){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}:host(.in-item[slot=start]){margin-left:2px;margin-right:20px;margin-top:8px;margin-bottom:8px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.in-item[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:20px;margin-inline-end:20px}}";
|
|
7
|
+
|
|
8
|
+
const checkboxMdCss = ":host{--background-checked:var(--ion-color-primary, #3880ff);--border-color-checked:var(--ion-color-primary, #3880ff);--checkmark-color:var(--ion-color-primary-contrast, #fff);--checkmark-width:1;--transition:none;display:inline-block;position:relative;user-select:none;z-index:2}:host(.ion-color){--background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}label{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;appearance:none;outline:none;display:flex;align-items:center;opacity:0}[dir=rtl] label,:host-context([dir=rtl]) label{left:unset;right:unset;right:0}label::-moz-focus-inner{border:0}input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.checkbox-icon{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);box-sizing:border-box}.checkbox-icon path{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}:host(.checkbox-checked) .checkbox-icon,:host(.checkbox-indeterminate) .checkbox-icon{border-color:var(--border-color-checked);background:var(--background-checked)}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{opacity:1}:host(.checkbox-disabled){pointer-events:none}:host{--border-radius:calc(var(--size) * .125);--border-width:2px;--border-style:solid;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.51);--checkmark-width:3;--background:var(--ion-item-background, var(--ion-background-color, #fff));--transition:background 180ms cubic-bezier(0.4, 0, 0.2, 1);--size:18px;width:var(--size);height:var(--size)}.checkbox-icon path{stroke-dasharray:30;stroke-dashoffset:30}:host(.checkbox-checked) .checkbox-icon path,:host(.checkbox-indeterminate) .checkbox-icon path{stroke-dashoffset:0;transition:stroke-dashoffset 90ms linear 90ms}:host(.checkbox-disabled){opacity:0.3}:host(.in-item){margin-left:0;margin-right:0;margin-top:18px;margin-bottom:18px;display:block;position:static}:host(.in-item[slot=start]){margin-left:4px;margin-right:36px;margin-top:18px;margin-bottom:18px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.in-item[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:36px;margin-inline-end:36px}}";
|
|
9
|
+
|
|
10
|
+
const Checkbox = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
registerInstance(this, hostRef);
|
|
13
|
+
this.ionChange = createEvent(this, "ionChange", 7);
|
|
14
|
+
this.ionFocus = createEvent(this, "ionFocus", 7);
|
|
15
|
+
this.ionBlur = createEvent(this, "ionBlur", 7);
|
|
16
|
+
this.ionStyle = createEvent(this, "ionStyle", 7);
|
|
17
|
+
this.inputId = `ion-cb-${checkboxIds++}`;
|
|
18
|
+
/**
|
|
19
|
+
* The name of the control, which is submitted with the form data.
|
|
20
|
+
*/
|
|
21
|
+
this.name = this.inputId;
|
|
22
|
+
/**
|
|
23
|
+
* If `true`, the checkbox is selected.
|
|
24
|
+
*/
|
|
25
|
+
this.checked = false;
|
|
26
|
+
/**
|
|
27
|
+
* If `true`, the checkbox will visually appear as indeterminate.
|
|
28
|
+
*/
|
|
29
|
+
this.indeterminate = false;
|
|
30
|
+
/**
|
|
31
|
+
* If `true`, the user cannot interact with the checkbox.
|
|
32
|
+
*/
|
|
33
|
+
this.disabled = false;
|
|
34
|
+
/**
|
|
35
|
+
* The value of the checkbox does not mean if it's checked or not, use the `checked`
|
|
36
|
+
* property for that.
|
|
37
|
+
*
|
|
38
|
+
* The value of a checkbox is analogous to the value of an `<input type="checkbox">`,
|
|
39
|
+
* it's only used when the checkbox participates in a native `<form>`.
|
|
40
|
+
*/
|
|
41
|
+
this.value = 'on';
|
|
42
|
+
this.onClick = (ev) => {
|
|
43
|
+
ev.preventDefault();
|
|
44
|
+
this.setFocus();
|
|
45
|
+
this.checked = !this.checked;
|
|
46
|
+
this.indeterminate = false;
|
|
47
|
+
};
|
|
48
|
+
this.onFocus = () => {
|
|
49
|
+
this.ionFocus.emit();
|
|
50
|
+
};
|
|
51
|
+
this.onBlur = () => {
|
|
52
|
+
this.ionBlur.emit();
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
componentWillLoad() {
|
|
56
|
+
this.emitStyle();
|
|
57
|
+
}
|
|
58
|
+
checkedChanged(isChecked) {
|
|
59
|
+
this.ionChange.emit({
|
|
60
|
+
checked: isChecked,
|
|
61
|
+
value: this.value,
|
|
62
|
+
});
|
|
63
|
+
this.emitStyle();
|
|
64
|
+
}
|
|
65
|
+
disabledChanged() {
|
|
66
|
+
this.emitStyle();
|
|
67
|
+
}
|
|
68
|
+
emitStyle() {
|
|
69
|
+
this.ionStyle.emit({
|
|
70
|
+
'checkbox-checked': this.checked,
|
|
71
|
+
'interactive-disabled': this.disabled,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
setFocus() {
|
|
75
|
+
if (this.focusEl) {
|
|
76
|
+
this.focusEl.focus();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
render() {
|
|
80
|
+
const { color, checked, disabled, el, indeterminate, inputId, name, value } = this;
|
|
81
|
+
const mode = getIonMode(this);
|
|
82
|
+
const { label, labelId, labelText } = getAriaLabel(el, inputId);
|
|
83
|
+
renderHiddenInput(true, el, name, checked ? value : '', disabled);
|
|
84
|
+
let path = indeterminate ? (h("path", { d: "M6 12L18 12", part: "mark" })) : (h("path", { d: "M5.9,12.5l3.8,3.8l8.8-8.8", part: "mark" }));
|
|
85
|
+
if (mode === 'md') {
|
|
86
|
+
path = indeterminate ? (h("path", { d: "M2 12H22", part: "mark" })) : (h("path", { d: "M1.73,12.91 8.1,19.28 22.79,4.59", part: "mark" }));
|
|
87
|
+
}
|
|
88
|
+
return (h(Host, { onClick: this.onClick, "aria-labelledby": label ? labelId : null, "aria-checked": `${checked}`, "aria-hidden": disabled ? 'true' : null, role: "checkbox", class: createColorClasses(color, {
|
|
89
|
+
[mode]: true,
|
|
90
|
+
'in-item': hostContext('ion-item', el),
|
|
91
|
+
'checkbox-checked': checked,
|
|
92
|
+
'checkbox-disabled': disabled,
|
|
93
|
+
'checkbox-indeterminate': indeterminate,
|
|
94
|
+
interactive: true,
|
|
95
|
+
}) }, h("svg", { class: "checkbox-icon", viewBox: "0 0 24 24", part: "container" }, path), h("label", { htmlFor: inputId }, labelText), h("input", { type: "checkbox", "aria-checked": `${checked}`, disabled: disabled, id: inputId, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: (focusEl) => (this.focusEl = focusEl) })));
|
|
96
|
+
}
|
|
97
|
+
get el() { return getElement(this); }
|
|
98
|
+
static get watchers() { return {
|
|
99
|
+
"checked": ["checkedChanged"],
|
|
100
|
+
"disabled": ["disabledChanged"]
|
|
101
|
+
}; }
|
|
102
|
+
};
|
|
103
|
+
let checkboxIds = 0;
|
|
104
|
+
Checkbox.style = {
|
|
105
|
+
ios: checkboxIosCss,
|
|
106
|
+
md: checkboxMdCss
|
|
107
|
+
};
|
|
5
108
|
|
|
6
109
|
const listHeaderIosCss = ":host{--border-style:solid;--border-width:0;--inner-border-width:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:flex;align-items:center;justify-content:space-between;width:100%;min-height:40px;border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);color:var(--color);overflow:hidden}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}.list-header-inner{display:flex;position:relative;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);overflow:inherit;box-sizing:border-box}::slotted(ion-label){flex:1 1 auto}:host(.list-header-lines-inset),:host(.list-header-lines-none){--border-width:0}:host(.list-header-lines-full),:host(.list-header-lines-none){--inner-border-width:0}:host{--background:transparent;--color:var(--ion-color-step-850, #262626);--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));padding-left:calc(var(--ion-safe-area-left, 0px) + 20px);position:relative;align-items:flex-end;font-size:22px;font-weight:700;letter-spacing:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;-webkit-padding-start:calc(var(--ion-safe-area-left, 0px) + 20px);padding-inline-start:calc(var(--ion-safe-area-left, 0px) + 20px)}}::slotted(ion-button),::slotted(ion-label){margin-top:29px;margin-bottom:6px}::slotted(ion-button){margin-left:3px;margin-right:3px;height:1.4em}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-button){margin-left:unset;margin-right:unset;-webkit-margin-start:3px;margin-inline-start:3px;-webkit-margin-end:3px;margin-inline-end:3px}}:host(.list-header-lines-full){--border-width:0 0 0.55px 0}:host(.list-header-lines-inset){--inner-border-width:0 0 0.55px 0}";
|
|
7
110
|
|
|
@@ -59,6 +162,9 @@ const Radio = class {
|
|
|
59
162
|
this.checked = this.radioGroup.value === this.value;
|
|
60
163
|
}
|
|
61
164
|
};
|
|
165
|
+
this.onClick = () => {
|
|
166
|
+
this.checked = this.nativeInput.checked;
|
|
167
|
+
};
|
|
62
168
|
this.onFocus = () => {
|
|
63
169
|
this.ionFocus.emit();
|
|
64
170
|
};
|
|
@@ -80,7 +186,7 @@ const Radio = class {
|
|
|
80
186
|
if (this.value === undefined) {
|
|
81
187
|
this.value = this.inputId;
|
|
82
188
|
}
|
|
83
|
-
const radioGroup = this.radioGroup = this.el.closest('ion-radio-group');
|
|
189
|
+
const radioGroup = (this.radioGroup = this.el.closest('ion-radio-group'));
|
|
84
190
|
if (radioGroup) {
|
|
85
191
|
this.updateState();
|
|
86
192
|
addEventListener(radioGroup, 'ionChange', this.updateState);
|
|
@@ -106,13 +212,13 @@ const Radio = class {
|
|
|
106
212
|
const { inputId, disabled, checked, color, el, buttonTabindex } = this;
|
|
107
213
|
const mode = getIonMode(this);
|
|
108
214
|
const { label, labelId, labelText } = getAriaLabel(el, inputId);
|
|
109
|
-
return (h(Host, { "aria-checked": `${checked}`, "aria-hidden": disabled ? 'true' : null, "aria-labelledby": label ? labelId : null, role: "radio", tabindex: buttonTabindex, onFocus: this.onFocus, onBlur: this.onBlur, class: createColorClasses(color, {
|
|
215
|
+
return (h(Host, { "aria-checked": `${checked}`, "aria-hidden": disabled ? 'true' : null, "aria-labelledby": label ? labelId : null, role: "radio", tabindex: buttonTabindex, onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.onClick, class: createColorClasses(color, {
|
|
110
216
|
[mode]: true,
|
|
111
217
|
'in-item': hostContext('ion-item', el),
|
|
112
|
-
|
|
218
|
+
interactive: true,
|
|
113
219
|
'radio-checked': checked,
|
|
114
220
|
'radio-disabled': disabled,
|
|
115
|
-
}) }, h("div", { class: "radio-icon", part: "container" }, h("div", { class: "radio-inner", part: "mark" }), h("div", { class: "radio-ripple" })), h("label", { htmlFor: inputId }, labelText), h("input", { type: "radio", checked: checked, disabled: disabled, tabindex: "-1", id: inputId })));
|
|
221
|
+
}) }, h("div", { class: "radio-icon", part: "container" }, h("div", { class: "radio-inner", part: "mark" }), h("div", { class: "radio-ripple" })), h("label", { htmlFor: inputId }, labelText), h("input", { type: "radio", checked: checked, disabled: disabled, tabindex: "-1", id: inputId, ref: (nativeEl) => (this.nativeInput = nativeEl) })));
|
|
116
222
|
}
|
|
117
223
|
get el() { return getElement(this); }
|
|
118
224
|
static get watchers() { return {
|
|
@@ -144,8 +250,8 @@ const RadioGroup = class {
|
|
|
144
250
|
this.setRadioTabindex = (value) => {
|
|
145
251
|
const radios = this.getRadios();
|
|
146
252
|
// Get the first radio that is not disabled and the checked one
|
|
147
|
-
const first = radios.find(radio => !radio.disabled);
|
|
148
|
-
const checked = radios.find(radio =>
|
|
253
|
+
const first = radios.find((radio) => !radio.disabled);
|
|
254
|
+
const checked = radios.find((radio) => radio.value === value && !radio.disabled);
|
|
149
255
|
if (!first && !checked) {
|
|
150
256
|
return;
|
|
151
257
|
}
|
|
@@ -184,7 +290,7 @@ const RadioGroup = class {
|
|
|
184
290
|
// this is used to set aria-labelledby
|
|
185
291
|
const header = this.el.querySelector('ion-list-header') || this.el.querySelector('ion-item-divider');
|
|
186
292
|
if (header) {
|
|
187
|
-
const label = this.label = header.querySelector('ion-label');
|
|
293
|
+
const label = (this.label = header.querySelector('ion-label'));
|
|
188
294
|
if (label) {
|
|
189
295
|
this.labelId = label.id = this.name + '-lbl';
|
|
190
296
|
}
|
|
@@ -200,25 +306,21 @@ const RadioGroup = class {
|
|
|
200
306
|
}
|
|
201
307
|
// Get all radios inside of the radio group and then
|
|
202
308
|
// filter out disabled radios since we need to skip those
|
|
203
|
-
const radios = this.getRadios().filter(radio => !radio.disabled);
|
|
309
|
+
const radios = this.getRadios().filter((radio) => !radio.disabled);
|
|
204
310
|
// Only move the radio if the current focus is in the radio group
|
|
205
311
|
if (ev.target && radios.includes(ev.target)) {
|
|
206
|
-
const index = radios.findIndex(radio => radio === ev.target);
|
|
312
|
+
const index = radios.findIndex((radio) => radio === ev.target);
|
|
207
313
|
const current = radios[index];
|
|
208
314
|
let next;
|
|
209
315
|
// If hitting arrow down or arrow right, move to the next radio
|
|
210
316
|
// If we're on the last radio, move to the first radio
|
|
211
317
|
if (['ArrowDown', 'ArrowRight'].includes(ev.code)) {
|
|
212
|
-
next =
|
|
213
|
-
? radios[0]
|
|
214
|
-
: radios[index + 1];
|
|
318
|
+
next = index === radios.length - 1 ? radios[0] : radios[index + 1];
|
|
215
319
|
}
|
|
216
320
|
// If hitting arrow up or arrow left, move to the previous radio
|
|
217
321
|
// If we're on the first radio, move to the last radio
|
|
218
322
|
if (['ArrowUp', 'ArrowLeft'].includes(ev.code)) {
|
|
219
|
-
next =
|
|
220
|
-
? radios[radios.length - 1]
|
|
221
|
-
: radios[index - 1];
|
|
323
|
+
next = index === 0 ? radios[radios.length - 1] : radios[index - 1];
|
|
222
324
|
}
|
|
223
325
|
if (next && radios.includes(next)) {
|
|
224
326
|
next.setFocus(ev);
|
|
@@ -229,9 +331,7 @@ const RadioGroup = class {
|
|
|
229
331
|
// Update the radio group value when a user presses the
|
|
230
332
|
// space bar on top of a selected radio
|
|
231
333
|
if (['Space'].includes(ev.code)) {
|
|
232
|
-
this.value =
|
|
233
|
-
? undefined
|
|
234
|
-
: current.value;
|
|
334
|
+
this.value = this.allowEmptySelection && this.value !== undefined ? undefined : current.value;
|
|
235
335
|
// Prevent browsers from jumping
|
|
236
336
|
// to the bottom of the screen
|
|
237
337
|
ev.preventDefault();
|
|
@@ -241,7 +341,7 @@ const RadioGroup = class {
|
|
|
241
341
|
render() {
|
|
242
342
|
const { label, labelId } = this;
|
|
243
343
|
const mode = getIonMode(this);
|
|
244
|
-
return
|
|
344
|
+
return h(Host, { role: "radiogroup", "aria-labelledby": label ? labelId : null, onClick: this.onClick, class: mode });
|
|
245
345
|
}
|
|
246
346
|
get el() { return getElement(this); }
|
|
247
347
|
static get watchers() { return {
|
|
@@ -250,4 +350,4 @@ const RadioGroup = class {
|
|
|
250
350
|
};
|
|
251
351
|
let radioGroupIds = 0;
|
|
252
352
|
|
|
253
|
-
export { ListHeader as ion_list_header, Radio as ion_radio, RadioGroup as ion_radio_group };
|
|
353
|
+
export { Checkbox as ion_checkbox, ListHeader as ion_list_header, Radio as ion_radio, RadioGroup as ion_radio_group };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
2
|
-
import { g as getIonMode } from './ionic-global-
|
|
3
|
-
import { c as createColorClasses } from './theme-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-cb938ffb.js';
|
|
2
|
+
import { g as getIonMode } from './ionic-global-6cd57191.js';
|
|
3
|
+
import { c as createColorClasses } from './theme-7cf2cab0.js';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const chipMdCss = ":host{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12);--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.87);border-radius:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:4px;margin-right:4px;margin-top:4px;margin-bottom:4px;padding-left:12px;padding-right:12px;padding-top:7px;padding-bottom:7px;display:inline-flex;position:relative;align-items:center;height:32px;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);font-size:14px;line-height:1;cursor:pointer;overflow:hidden;vertical-align:middle;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:4px;margin-inline-end:4px}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}:host(.chip-disabled){cursor:default;opacity:0.4;pointer-events:none}:host(.ion-color){background:rgba(var(--ion-color-base-rgb), 0.08);color:var(--ion-color-shade)}:host(.ion-color:focus){background:rgba(var(--ion-color-base-rgb), 0.12)}:host(.ion-color.ion-activated){background:rgba(var(--ion-color-base-rgb), 0.16)}:host(.chip-outline){border-width:1px;border-style:solid}:host(.chip-outline){border-color:rgba(0, 0, 0, 0.32);background:transparent}:host(.chip-outline.ion-color){border-color:rgba(var(--ion-color-base-rgb), 0.32)}:host(.chip-outline:not(.ion-color):focus){background:rgba(0, 0, 0, 0.04)}:host(.chip-outline.ion-activated:not(.ion-color)){background:rgba(0, 0, 0, 0.08)}::slotted(ion-icon){font-size:20px}:host(:not(.ion-color)) ::slotted(ion-icon){color:rgba(0, 0, 0, 0.54)}::slotted(ion-icon:first-child){margin-left:-4px;margin-right:8px;margin-top:-4px;margin-bottom:-4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon:first-child){margin-left:unset;margin-right:unset;-webkit-margin-start:-4px;margin-inline-start:-4px;-webkit-margin-end:8px;margin-inline-end:8px}}::slotted(ion-icon:last-child){margin-left:8px;margin-right:-4px;margin-top:-4px;margin-bottom:-4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon:last-child){margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:-4px;margin-inline-end:-4px}}::slotted(ion-avatar){width:24px;height:24px}::slotted(ion-avatar:first-child){margin-left:-8px;margin-right:8px;margin-top:-4px;margin-bottom:-4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar:first-child){margin-left:unset;margin-right:unset;-webkit-margin-start:-8px;margin-inline-start:-8px;-webkit-margin-end:8px;margin-inline-end:8px}}::slotted(ion-avatar:last-child){margin-left:8px;margin-right:-8px;margin-top:-4px;margin-bottom:-4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar:last-child){margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:-8px;margin-inline-end:-8px}}:host(:focus){outline:none}:host(:focus){--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16)}:host(.ion-activated){--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2)}@media (any-hover: hover){:host(:hover){--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16)}:host(.ion-color:hover){background:rgba(var(--ion-color-base-rgb), 0.12)}:host(.chip-outline:not(.ion-color):hover){background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.04)}}";
|
|
5
|
+
const chipCss = ":host{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12);--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.87);border-radius:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:4px;margin-right:4px;margin-top:4px;margin-bottom:4px;padding-left:12px;padding-right:12px;padding-top:7px;padding-bottom:7px;display:inline-flex;position:relative;align-items:center;height:32px;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);font-size:14px;line-height:1;cursor:pointer;overflow:hidden;vertical-align:middle;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:4px;margin-inline-end:4px}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}:host(.chip-disabled){cursor:default;opacity:0.4;pointer-events:none}:host(.ion-color){background:rgba(var(--ion-color-base-rgb), 0.08);color:var(--ion-color-shade)}:host(.ion-color:focus){background:rgba(var(--ion-color-base-rgb), 0.12)}:host(.ion-color.ion-activated){background:rgba(var(--ion-color-base-rgb), 0.16)}:host(.chip-outline){border-width:1px;border-style:solid}:host(.chip-outline){border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.32);background:transparent}:host(.chip-outline.ion-color){border-color:rgba(var(--ion-color-base-rgb), 0.32)}:host(.chip-outline:not(.ion-color):focus){background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.04)}:host(.chip-outline.ion-activated:not(.ion-color)){background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08)}::slotted(ion-icon){font-size:20px}:host(:not(.ion-color)) ::slotted(ion-icon){color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54)}::slotted(ion-icon:first-child){margin-left:-4px;margin-right:8px;margin-top:-4px;margin-bottom:-4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon:first-child){margin-left:unset;margin-right:unset;-webkit-margin-start:-4px;margin-inline-start:-4px;-webkit-margin-end:8px;margin-inline-end:8px}}::slotted(ion-icon:last-child){margin-left:8px;margin-right:-4px;margin-top:-4px;margin-bottom:-4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon:last-child){margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:-4px;margin-inline-end:-4px}}::slotted(ion-avatar){width:24px;height:24px}::slotted(ion-avatar:first-child){margin-left:-8px;margin-right:8px;margin-top:-4px;margin-bottom:-4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar:first-child){margin-left:unset;margin-right:unset;-webkit-margin-start:-8px;margin-inline-start:-8px;-webkit-margin-end:8px;margin-inline-end:8px}}::slotted(ion-avatar:last-child){margin-left:8px;margin-right:-8px;margin-top:-4px;margin-bottom:-4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar:last-child){margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:-8px;margin-inline-end:-8px}}:host(:focus){outline:none}:host(:focus){--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16)}:host(.ion-activated){--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2)}@media (any-hover: hover){:host(:hover){--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16)}:host(.ion-color:hover){background:rgba(var(--ion-color-base-rgb), 0.12)}:host(.chip-outline:not(.ion-color):hover){background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.04)}}";
|
|
8
6
|
|
|
9
7
|
const Chip = class {
|
|
10
8
|
constructor(hostRef) {
|
|
@@ -28,9 +26,6 @@ const Chip = class {
|
|
|
28
26
|
}) }, h("slot", null), mode === 'md' && h("ion-ripple-effect", null)));
|
|
29
27
|
}
|
|
30
28
|
};
|
|
31
|
-
Chip.style =
|
|
32
|
-
ios: chipIosCss,
|
|
33
|
-
md: chipMdCss
|
|
34
|
-
};
|
|
29
|
+
Chip.style = chipCss;
|
|
35
30
|
|
|
36
31
|
export { Chip as ion_chip };
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host, c as getElement } from './index-cb938ffb.js';
|
|
2
|
+
import { g as getIonMode } from './ionic-global-6cd57191.js';
|
|
3
|
+
import { e as addEventListener, c as componentOnReady } from './helpers-aeff219b.js';
|
|
4
|
+
import { a as printIonError } from './index-1f3d8582.js';
|
|
5
|
+
import { c as createColorClasses } from './theme-7cf2cab0.js';
|
|
6
|
+
import { q as parseDate, t as getToday, J as is24Hour, S as getLocalizedDateTime, G as getMonthAndYear, K as getLocalizedTime, T as getMonthDayAndYear } from './data-62c81c24.js';
|
|
7
|
+
|
|
8
|
+
const iosDatetimeButtonCss = ":host{display:flex;align-items:center;justify-content:center}:host button{border-radius:8px;padding-left:12px;padding-right:12px;padding-top:6px;padding-bottom:6px;margin-left:2px;margin-right:2px;margin-top:0px;margin-bottom:0px;position:relative;transition:150ms color ease-in-out;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;appearance:none;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host button{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host button{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}:host(.time-active) #time-button,:host(.date-active) #date-button{color:var(--ion-color-base)}:host(.datetime-button-disabled){pointer-events:none}:host(.datetime-button-disabled) button{opacity:0.4}";
|
|
9
|
+
|
|
10
|
+
const mdDatetimeButtonCss = ":host{display:flex;align-items:center;justify-content:center}:host button{border-radius:8px;padding-left:12px;padding-right:12px;padding-top:6px;padding-bottom:6px;margin-left:2px;margin-right:2px;margin-top:0px;margin-bottom:0px;position:relative;transition:150ms color ease-in-out;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;appearance:none;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host button{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host button{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}:host(.time-active) #time-button,:host(.date-active) #date-button{color:var(--ion-color-base)}:host(.datetime-button-disabled){pointer-events:none}:host(.datetime-button-disabled) button{opacity:0.4}";
|
|
11
|
+
|
|
12
|
+
const DatetimeButton = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
registerInstance(this, hostRef);
|
|
15
|
+
this.datetimeEl = null;
|
|
16
|
+
this.overlayEl = null;
|
|
17
|
+
this.datetimePresentation = 'date-time';
|
|
18
|
+
this.datetimeActive = false;
|
|
19
|
+
/**
|
|
20
|
+
* The color to use from your application's color palette.
|
|
21
|
+
* Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`.
|
|
22
|
+
* For more information on colors, see [theming](/docs/theming/basics).
|
|
23
|
+
*/
|
|
24
|
+
this.color = 'primary';
|
|
25
|
+
/**
|
|
26
|
+
* If `true`, the user cannot interact with the button.
|
|
27
|
+
*/
|
|
28
|
+
this.disabled = false;
|
|
29
|
+
/**
|
|
30
|
+
* Accepts one or more string values and converts
|
|
31
|
+
* them to DatetimeParts. This is done so datetime-button
|
|
32
|
+
* can work with an array internally and not need
|
|
33
|
+
* to keep checking if the datetime value is `string` or `string[]`.
|
|
34
|
+
*/
|
|
35
|
+
this.getParsedDateValues = (value) => {
|
|
36
|
+
// TODO FW-2646 Remove value === ''
|
|
37
|
+
if (value === '' || value === undefined || value === null) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
if (Array.isArray(value)) {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
return [value];
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Check the value property on the linked
|
|
47
|
+
* ion-datetime and then format it according
|
|
48
|
+
* to the locale specified on ion-datetime.
|
|
49
|
+
*/
|
|
50
|
+
this.setDateTimeText = () => {
|
|
51
|
+
const { datetimeEl, datetimePresentation } = this;
|
|
52
|
+
if (!datetimeEl) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const { value, locale, hourCycle, preferWheel, multiple, titleSelectedDatesFormatter } = datetimeEl;
|
|
56
|
+
const parsedValues = this.getParsedDateValues(value);
|
|
57
|
+
/**
|
|
58
|
+
* Both ion-datetime and ion-datetime-button default
|
|
59
|
+
* to today's date and time if no value is set.
|
|
60
|
+
*/
|
|
61
|
+
const parsedDatetimes = parseDate(parsedValues.length > 0 ? parsedValues : [getToday()]);
|
|
62
|
+
/**
|
|
63
|
+
* If developers incorrectly use multiple="true"
|
|
64
|
+
* with non "date" datetimes, then just select
|
|
65
|
+
* the first value so the interface does
|
|
66
|
+
* not appear broken. Datetime will provide a
|
|
67
|
+
* warning in the console.
|
|
68
|
+
*/
|
|
69
|
+
const firstParsedDatetime = parsedDatetimes[0];
|
|
70
|
+
const use24Hour = is24Hour(locale, hourCycle);
|
|
71
|
+
// TODO(FW-1865) - Remove once FW-1831 is fixed.
|
|
72
|
+
parsedDatetimes.forEach((parsedDatetime) => {
|
|
73
|
+
parsedDatetime.tzOffset = undefined;
|
|
74
|
+
});
|
|
75
|
+
this.dateText = this.timeText = undefined;
|
|
76
|
+
switch (datetimePresentation) {
|
|
77
|
+
case 'date-time':
|
|
78
|
+
case 'time-date':
|
|
79
|
+
const dateText = getMonthDayAndYear(locale, firstParsedDatetime);
|
|
80
|
+
const timeText = getLocalizedTime(locale, firstParsedDatetime, use24Hour);
|
|
81
|
+
if (preferWheel) {
|
|
82
|
+
this.dateText = `${dateText} ${timeText}`;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
this.dateText = dateText;
|
|
86
|
+
this.timeText = timeText;
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
case 'date':
|
|
90
|
+
if (multiple && parsedValues.length !== 1) {
|
|
91
|
+
let headerText = `${parsedValues.length} days`; // default/fallback for multiple selection
|
|
92
|
+
if (titleSelectedDatesFormatter !== undefined) {
|
|
93
|
+
try {
|
|
94
|
+
headerText = titleSelectedDatesFormatter(parsedValues);
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
printIonError('Exception in provided `titleSelectedDatesFormatter`: ', e);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
this.dateText = headerText;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
this.dateText = getMonthDayAndYear(locale, firstParsedDatetime);
|
|
104
|
+
}
|
|
105
|
+
break;
|
|
106
|
+
case 'time':
|
|
107
|
+
this.timeText = getLocalizedTime(locale, firstParsedDatetime, use24Hour);
|
|
108
|
+
break;
|
|
109
|
+
case 'month-year':
|
|
110
|
+
this.dateText = getMonthAndYear(locale, firstParsedDatetime);
|
|
111
|
+
break;
|
|
112
|
+
case 'month':
|
|
113
|
+
this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, { month: 'long' });
|
|
114
|
+
break;
|
|
115
|
+
case 'year':
|
|
116
|
+
this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, { year: 'numeric' });
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Waits for the ion-datetime to re-render.
|
|
122
|
+
* This is needed in order to correctly position
|
|
123
|
+
* a popover relative to the trigger element.
|
|
124
|
+
*/
|
|
125
|
+
this.waitForDatetimeChanges = async () => {
|
|
126
|
+
const { datetimeEl } = this;
|
|
127
|
+
if (!datetimeEl) {
|
|
128
|
+
return Promise.resolve();
|
|
129
|
+
}
|
|
130
|
+
return new Promise((resolve) => {
|
|
131
|
+
addEventListener(datetimeEl, 'ionRender', resolve, { once: true });
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
this.handleDateClick = async (ev) => {
|
|
135
|
+
const { datetimeEl, datetimePresentation } = this;
|
|
136
|
+
if (!datetimeEl) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
let needsPresentationChange = false;
|
|
140
|
+
/**
|
|
141
|
+
* When clicking the date button,
|
|
142
|
+
* we need to make sure that only a date
|
|
143
|
+
* picker is displayed. For presentation styles
|
|
144
|
+
* that display content other than a date picker,
|
|
145
|
+
* we need to update the presentation style.
|
|
146
|
+
*/
|
|
147
|
+
switch (datetimePresentation) {
|
|
148
|
+
case 'date-time':
|
|
149
|
+
case 'time-date':
|
|
150
|
+
const needsChange = datetimeEl.presentation !== 'date';
|
|
151
|
+
/**
|
|
152
|
+
* The date+time wheel picker
|
|
153
|
+
* shows date and time together,
|
|
154
|
+
* so do not adjust the presentation
|
|
155
|
+
* in that case.
|
|
156
|
+
*/
|
|
157
|
+
if (!datetimeEl.preferWheel && needsChange) {
|
|
158
|
+
datetimeEl.presentation = 'date';
|
|
159
|
+
needsPresentationChange = true;
|
|
160
|
+
}
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Track which button was clicked
|
|
165
|
+
* so that it can have the correct
|
|
166
|
+
* activated styles applied when
|
|
167
|
+
* the modal/popover containing
|
|
168
|
+
* the datetime is opened.
|
|
169
|
+
*/
|
|
170
|
+
this.selectedButton = 'date';
|
|
171
|
+
this.presentOverlay(ev, needsPresentationChange, this.dateTargetEl);
|
|
172
|
+
};
|
|
173
|
+
this.handleTimeClick = (ev) => {
|
|
174
|
+
const { datetimeEl, datetimePresentation } = this;
|
|
175
|
+
if (!datetimeEl) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
let needsPresentationChange = false;
|
|
179
|
+
/**
|
|
180
|
+
* When clicking the time button,
|
|
181
|
+
* we need to make sure that only a time
|
|
182
|
+
* picker is displayed. For presentation styles
|
|
183
|
+
* that display content other than a time picker,
|
|
184
|
+
* we need to update the presentation style.
|
|
185
|
+
*/
|
|
186
|
+
switch (datetimePresentation) {
|
|
187
|
+
case 'date-time':
|
|
188
|
+
case 'time-date':
|
|
189
|
+
const needsChange = datetimeEl.presentation !== 'time';
|
|
190
|
+
if (needsChange) {
|
|
191
|
+
datetimeEl.presentation = 'time';
|
|
192
|
+
needsPresentationChange = true;
|
|
193
|
+
}
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Track which button was clicked
|
|
198
|
+
* so that it can have the correct
|
|
199
|
+
* activated styles applied when
|
|
200
|
+
* the modal/popover containing
|
|
201
|
+
* the datetime is opened.
|
|
202
|
+
*/
|
|
203
|
+
this.selectedButton = 'time';
|
|
204
|
+
this.presentOverlay(ev, needsPresentationChange, this.timeTargetEl);
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* If the datetime is presented in an
|
|
208
|
+
* overlay, the datetime and overlay
|
|
209
|
+
* should be appropriately sized.
|
|
210
|
+
* These classes provide default sizing values
|
|
211
|
+
* that developers can customize.
|
|
212
|
+
* The goal is to provide an overlay that is
|
|
213
|
+
* reasonably sized with a datetime that
|
|
214
|
+
* fills the entire container.
|
|
215
|
+
*/
|
|
216
|
+
this.presentOverlay = async (ev, needsPresentationChange, triggerEl) => {
|
|
217
|
+
const { overlayEl } = this;
|
|
218
|
+
if (!overlayEl) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
if (overlayEl.tagName === 'ION-POPOVER') {
|
|
222
|
+
/**
|
|
223
|
+
* When the presentation on datetime changes,
|
|
224
|
+
* we need to wait for the component to re-render
|
|
225
|
+
* otherwise the computed width/height of the
|
|
226
|
+
* popover content will be wrong, causing
|
|
227
|
+
* the popover to not align with the trigger element.
|
|
228
|
+
*/
|
|
229
|
+
if (needsPresentationChange) {
|
|
230
|
+
await this.waitForDatetimeChanges();
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* We pass the trigger button element
|
|
234
|
+
* so that the popover aligns with the individual
|
|
235
|
+
* button that was clicked, not the component container.
|
|
236
|
+
*/
|
|
237
|
+
overlayEl.present(Object.assign(Object.assign({}, ev), { detail: {
|
|
238
|
+
ionShadowTarget: triggerEl,
|
|
239
|
+
} }));
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
overlayEl.present();
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
async componentWillLoad() {
|
|
247
|
+
const { datetime } = this;
|
|
248
|
+
if (!datetime) {
|
|
249
|
+
printIonError('An ID associated with an ion-datetime instance is required for ion-datetime-button to function properly.', this.el);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const datetimeEl = (this.datetimeEl = document.getElementById(datetime));
|
|
253
|
+
if (!datetimeEl) {
|
|
254
|
+
printIonError(`No ion-datetime instance found for ID '${datetime}'.`, this.el);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Since the datetime can be used in any context (overlays, accordion, etc)
|
|
259
|
+
* we track when it is visible to determine when it is active.
|
|
260
|
+
* This informs which button is highlighted as well as the
|
|
261
|
+
* aria-expanded state.
|
|
262
|
+
*/
|
|
263
|
+
const io = new IntersectionObserver((entries) => {
|
|
264
|
+
const ev = entries[0];
|
|
265
|
+
this.datetimeActive = ev.isIntersecting;
|
|
266
|
+
}, {
|
|
267
|
+
threshold: 0.01,
|
|
268
|
+
});
|
|
269
|
+
io.observe(datetimeEl);
|
|
270
|
+
/**
|
|
271
|
+
* Get a reference to any modal/popover
|
|
272
|
+
* the datetime is being used in so we can
|
|
273
|
+
* correctly size it when it is presented.
|
|
274
|
+
*/
|
|
275
|
+
const overlayEl = (this.overlayEl = datetimeEl.closest('ion-modal, ion-popover'));
|
|
276
|
+
/**
|
|
277
|
+
* The .ion-datetime-button-overlay class contains
|
|
278
|
+
* styles that allow any modal/popover to be
|
|
279
|
+
* sized according to the dimensions of the datetime.
|
|
280
|
+
* If developers want a smaller/larger overlay all they need
|
|
281
|
+
* to do is change the width/height of the datetime.
|
|
282
|
+
* Additionally, this lets us avoid having to set
|
|
283
|
+
* explicit widths on each variant of datetime.
|
|
284
|
+
*/
|
|
285
|
+
if (overlayEl) {
|
|
286
|
+
overlayEl.classList.add('ion-datetime-button-overlay');
|
|
287
|
+
}
|
|
288
|
+
componentOnReady(datetimeEl, () => {
|
|
289
|
+
const datetimePresentation = (this.datetimePresentation = datetimeEl.presentation || 'date-time');
|
|
290
|
+
/**
|
|
291
|
+
* Set the initial display
|
|
292
|
+
* in the rendered buttons.
|
|
293
|
+
*
|
|
294
|
+
* From there, we need to listen
|
|
295
|
+
* for ionChange to be emitted
|
|
296
|
+
* from datetime so we know when
|
|
297
|
+
* to re-render the displayed
|
|
298
|
+
* text in the buttons.
|
|
299
|
+
*/
|
|
300
|
+
this.setDateTimeText();
|
|
301
|
+
addEventListener(datetimeEl, 'ionChange', this.setDateTimeText);
|
|
302
|
+
/**
|
|
303
|
+
* Configure the initial selected button
|
|
304
|
+
* in the event that the datetime is displayed
|
|
305
|
+
* without clicking one of the datetime buttons.
|
|
306
|
+
* For example, a datetime could be expanded
|
|
307
|
+
* in an accordion. In this case users only
|
|
308
|
+
* need to click the accordion header to show
|
|
309
|
+
* the datetime.
|
|
310
|
+
*/
|
|
311
|
+
switch (datetimePresentation) {
|
|
312
|
+
case 'date-time':
|
|
313
|
+
case 'date':
|
|
314
|
+
case 'month-year':
|
|
315
|
+
case 'month':
|
|
316
|
+
case 'year':
|
|
317
|
+
this.selectedButton = 'date';
|
|
318
|
+
break;
|
|
319
|
+
case 'time-date':
|
|
320
|
+
case 'time':
|
|
321
|
+
this.selectedButton = 'time';
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
render() {
|
|
327
|
+
const { color, dateText, timeText, selectedButton, datetimeActive, disabled } = this;
|
|
328
|
+
const mode = getIonMode(this);
|
|
329
|
+
return (h(Host, { class: createColorClasses(color, {
|
|
330
|
+
[mode]: true,
|
|
331
|
+
[`${selectedButton}-active`]: datetimeActive,
|
|
332
|
+
['datetime-button-disabled']: disabled,
|
|
333
|
+
}) }, dateText && (h("button", { class: "ion-activatable", id: "date-button", "aria-expanded": datetimeActive ? 'true' : 'false', onClick: this.handleDateClick, disabled: disabled, part: "native", ref: (el) => (this.dateTargetEl = el) }, h("slot", { name: "date-target" }, dateText), mode === 'md' && h("ion-ripple-effect", null))), timeText && (h("button", { class: "ion-activatable", id: "time-button", "aria-expanded": datetimeActive ? 'true' : 'false', onClick: this.handleTimeClick, disabled: disabled, part: "native", ref: (el) => (this.timeTargetEl = el) }, h("slot", { name: "time-target" }, timeText), mode === 'md' && h("ion-ripple-effect", null)))));
|
|
334
|
+
}
|
|
335
|
+
get el() { return getElement(this); }
|
|
336
|
+
};
|
|
337
|
+
DatetimeButton.style = {
|
|
338
|
+
ios: iosDatetimeButtonCss,
|
|
339
|
+
md: mdDatetimeButtonCss
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
export { DatetimeButton as ion_datetime_button };
|