@ukic/canary-web-components 3.0.0-canary.32 → 3.0.0-canary.33
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/core.cjs.js +1 -1
- package/dist/cjs/{helpers-6f4b406b.js → helpers-f81fed28.js} +37 -1
- package/dist/cjs/helpers-f81fed28.js.map +1 -0
- package/dist/cjs/ic-calendar_2.cjs.entry.js +2 -2
- package/dist/cjs/ic-calendar_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-horizontal.cjs.entry.js +1 -1
- package/dist/cjs/ic-checkbox_3.cjs.entry.js +11 -7
- package/dist/cjs/ic-checkbox_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-table-title-bar.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-table.cjs.entry.js +11 -8
- package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination_4.cjs.entry.js +8 -4
- package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-table-of-contents.cjs.entry.js +1 -1
- package/dist/cjs/ic-time-input.cjs.entry.js +401 -99
- package/dist/cjs/ic-time-input.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-time-selector.cjs.entry.js +842 -0
- package/dist/cjs/ic-time-selector.cjs.entry.js.map +1 -0
- package/dist/cjs/{ic-toggle-button.cjs.entry.js → ic-toggle-button_2.cjs.entry.js} +274 -1
- package/dist/cjs/ic-toggle-button_2.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-tree-item.cjs.entry.js +3 -3
- package/dist/cjs/ic-tree-view.cjs.entry.js +4 -4
- package/dist/cjs/index-d337cd8a.js +8 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ic-calendar/ic-calendar.css +8 -6
- package/dist/collection/components/ic-calendar/ic-calendar.stories.js +13 -0
- package/dist/collection/components/ic-calendar/ic-calendar.stories.js.map +1 -1
- package/dist/collection/components/ic-data-table/ic-data-table.js +10 -7
- package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +30 -6
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -1
- package/dist/collection/components/ic-time-input/ic-time-input.css +21 -3
- package/dist/collection/components/ic-time-input/ic-time-input.js +434 -106
- package/dist/collection/components/ic-time-input/ic-time-input.js.map +1 -1
- package/dist/collection/components/ic-time-input/ic-time-input.stories.js +58 -9
- package/dist/collection/components/ic-time-input/ic-time-input.stories.js.map +1 -1
- package/dist/collection/components/ic-time-input/test/helpers/ic-time-input.js +2 -0
- package/dist/collection/components/ic-time-input/test/helpers/ic-time-input.js.map +1 -1
- package/dist/collection/components/ic-time-selector/ic-time-selector.css +293 -0
- package/dist/collection/components/ic-time-selector/ic-time-selector.js +1075 -0
- package/dist/collection/components/ic-time-selector/ic-time-selector.js.map +1 -0
- package/dist/collection/components/ic-time-selector/ic-time-selector.stories.js +166 -0
- package/dist/collection/components/ic-time-selector/ic-time-selector.stories.js.map +1 -0
- package/dist/collection/components/ic-time-selector/ic-time-selector.types.js +2 -0
- package/dist/collection/components/ic-time-selector/ic-time-selector.types.js.map +1 -0
- package/dist/collection/components/ic-tree-item/ic-tree-item.js +2 -2
- package/dist/collection/components/ic-tree-view/ic-tree-view.js +3 -3
- package/dist/collection/utils/helpers.js +35 -0
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/components/helpers2.js +36 -1
- package/dist/components/helpers2.js.map +1 -1
- package/dist/components/ic-calendar2.js +1 -1
- package/dist/components/ic-calendar2.js.map +1 -1
- package/dist/components/ic-data-table.js +10 -7
- package/dist/components/ic-data-table.js.map +1 -1
- package/dist/components/ic-pagination-bar2.js +11 -6
- package/dist/components/ic-pagination-bar2.js.map +1 -1
- package/dist/components/ic-pagination2.js +9 -4
- package/dist/components/ic-pagination2.js.map +1 -1
- package/dist/components/ic-time-input.js +431 -112
- package/dist/components/ic-time-input.js.map +1 -1
- package/dist/components/ic-time-selector.d.ts +11 -0
- package/dist/components/ic-time-selector.js +898 -0
- package/dist/components/ic-time-selector.js.map +1 -0
- package/dist/components/ic-toggle-button-group.js +1 -299
- package/dist/components/ic-toggle-button-group.js.map +1 -1
- package/dist/{esm/ic-toggle-button-group.entry.js → components/ic-toggle-button-group2.js} +70 -13
- package/dist/components/ic-toggle-button-group2.js.map +1 -0
- package/dist/components/ic-toggle-button.js +1 -228
- package/dist/components/ic-toggle-button.js.map +1 -1
- package/dist/{esm/ic-toggle-button.entry.js → components/ic-toggle-button2.js} +65 -10
- package/dist/components/ic-toggle-button2.js.map +1 -0
- package/dist/components/ic-tree-item.js +2 -2
- package/dist/components/ic-tree-view.js +4 -4
- package/dist/core/core.css +28 -6
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-b80b08ae.entry.js → p-08f24329.entry.js} +2 -2
- package/dist/core/{p-615d474e.entry.js → p-14b8bf37.entry.js} +2 -2
- package/dist/core/{p-81f12581.entry.js → p-169ad948.entry.js} +2 -2
- package/dist/core/{p-847cbb16.entry.js → p-1d166343.entry.js} +2 -2
- package/dist/core/{p-b4bfaf8f.entry.js → p-201b41c7.entry.js} +2 -2
- package/dist/core/{p-24bac55f.entry.js → p-33509a89.entry.js} +2 -2
- package/dist/core/{p-e1920777.entry.js → p-3389625c.entry.js} +2 -2
- package/dist/core/{p-5a1cfb3c.entry.js → p-344752cb.entry.js} +2 -2
- package/dist/core/{p-6c238418.entry.js → p-348d7080.entry.js} +2 -2
- package/dist/core/{p-3ef2e98d.entry.js → p-39cdf5db.entry.js} +2 -2
- package/dist/core/{p-fd20470e.entry.js → p-496b314f.entry.js} +2 -2
- package/dist/core/{p-bd9a76d8.entry.js → p-508b6da3.entry.js} +2 -2
- package/dist/core/p-551a0fc1.entry.js +2 -0
- package/dist/core/p-551a0fc1.entry.js.map +1 -0
- package/dist/core/{p-f5cea10d.entry.js → p-5e6687a8.entry.js} +2 -2
- package/dist/core/{p-72171192.entry.js → p-60f4fe3a.entry.js} +2 -2
- package/dist/core/p-61c92598.entry.js +2 -0
- package/dist/core/p-61c92598.entry.js.map +1 -0
- package/dist/core/{p-e00e67ff.entry.js → p-6323da7a.entry.js} +2 -2
- package/dist/core/p-691dd972.entry.js +2 -0
- package/dist/core/p-691dd972.entry.js.map +1 -0
- package/dist/core/{p-c6c87e58.entry.js → p-6dfe0922.entry.js} +2 -2
- package/dist/core/p-71cc5909.entry.js +2 -0
- package/dist/core/p-71cc5909.entry.js.map +1 -0
- package/dist/core/{p-fd7f3b58.entry.js → p-770e92cd.entry.js} +2 -2
- package/dist/core/{p-7cf6b428.entry.js → p-79ead0e7.entry.js} +2 -2
- package/dist/core/{p-285892ef.entry.js → p-7b4b45cf.entry.js} +2 -2
- package/dist/core/{p-afedcfdb.entry.js → p-7efdbab8.entry.js} +2 -2
- package/dist/core/{p-96177a74.entry.js → p-802a4bd3.entry.js} +2 -2
- package/dist/core/p-829b34f9.js +2 -0
- package/dist/core/p-829b34f9.js.map +1 -0
- package/dist/core/{p-9a9605c3.entry.js → p-879c180d.entry.js} +2 -2
- package/dist/core/{p-3891ce53.entry.js → p-8830011c.entry.js} +2 -2
- package/dist/core/{p-444cd8d3.entry.js → p-8ab37b4d.entry.js} +2 -2
- package/dist/core/{p-c87cc0d1.entry.js → p-939025af.entry.js} +2 -2
- package/dist/core/{p-4992e9ac.entry.js → p-939b168a.entry.js} +2 -2
- package/dist/core/{p-5a4344cb.entry.js → p-9dea5764.entry.js} +2 -2
- package/dist/core/{p-af821831.entry.js → p-a88e61b2.entry.js} +2 -2
- package/dist/core/p-a88e61b2.entry.js.map +1 -0
- package/dist/core/{p-90611726.entry.js → p-a8a92e54.entry.js} +2 -2
- package/dist/core/{p-31f3fb15.entry.js → p-a94a7b71.entry.js} +2 -2
- package/dist/core/p-ad551a0c.entry.js +2 -0
- package/dist/core/p-ad551a0c.entry.js.map +1 -0
- package/dist/core/{p-ba75ed34.entry.js → p-b434bd7c.entry.js} +2 -2
- package/dist/core/{p-2188b483.entry.js → p-c0a7eed7.entry.js} +2 -2
- package/dist/core/{p-2bd2f38b.entry.js → p-c0b227d2.entry.js} +2 -2
- package/dist/core/{p-2646a629.entry.js → p-c32f043e.entry.js} +2 -2
- package/dist/core/{p-7a0f62c2.entry.js → p-c4b2774d.entry.js} +2 -2
- package/dist/core/{p-775b8dba.entry.js → p-c9525aac.entry.js} +2 -2
- package/dist/core/{p-7026afad.entry.js → p-ca05573a.entry.js} +2 -2
- package/dist/core/{p-8c580d88.entry.js → p-d0607a70.entry.js} +2 -2
- package/dist/core/{p-15c05eb8.entry.js → p-d528d856.entry.js} +2 -2
- package/dist/core/{p-0043b019.entry.js → p-da1c2883.entry.js} +2 -2
- package/dist/core/{p-ffc1cea6.entry.js → p-e2e556ec.entry.js} +2 -2
- package/dist/core/{p-e4ef4263.js → p-e519f607.js} +2 -2
- package/dist/core/{p-3f0bce15.entry.js → p-e5c6d01a.entry.js} +2 -2
- package/dist/core/{p-04a9f82f.entry.js → p-e8db8772.entry.js} +2 -2
- package/dist/core/{p-e4b82731.entry.js → p-ea04103e.entry.js} +2 -2
- package/dist/core/{p-9a95f428.entry.js → p-eaeb473e.entry.js} +2 -2
- package/dist/core/{p-8e592393.entry.js → p-ecc7fd71.entry.js} +2 -2
- package/dist/core/{p-6cfba272.entry.js → p-efe260f0.entry.js} +2 -2
- package/dist/core/{p-b6d6b26e.entry.js → p-f1b57f91.entry.js} +2 -2
- package/dist/core/{p-e4551a38.entry.js → p-f5dc04f7.entry.js} +2 -2
- package/dist/core/{p-25280383.entry.js → p-fb07921b.entry.js} +2 -2
- package/dist/core/p-fb07921b.entry.js.map +1 -0
- package/dist/core/{p-1900c7c7.entry.js → p-fd08156a.entry.js} +2 -2
- package/dist/core/{p-3594922d.entry.js → p-fe5b51bb.entry.js} +2 -2
- package/dist/core/{p-ef5b6622.entry.js → p-ff618439.entry.js} +2 -2
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-5419eb6c.js → helpers-063369f4.js} +2 -2
- package/dist/esm/{helpers-5419eb6c.js.map → helpers-063369f4.js.map} +1 -1
- package/dist/esm/{helpers-9f228880.js → helpers-a08b3f32.js} +37 -2
- package/dist/esm/helpers-a08b3f32.js.map +1 -0
- package/dist/esm/ic-accordion-group.entry.js +1 -1
- package/dist/esm/ic-accordion.entry.js +1 -1
- package/dist/esm/ic-action-chip.entry.js +1 -1
- package/dist/esm/ic-alert.entry.js +1 -1
- package/dist/esm/ic-back-to-top.entry.js +1 -1
- package/dist/esm/ic-badge.entry.js +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
- package/dist/esm/ic-breadcrumb.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js +1 -1
- package/dist/esm/ic-calendar_2.entry.js +2 -2
- package/dist/esm/ic-calendar_2.entry.js.map +1 -1
- package/dist/esm/ic-card-horizontal.entry.js +1 -1
- package/dist/esm/ic-card-vertical.entry.js +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +1 -1
- package/dist/esm/ic-checkbox_3.entry.js +12 -8
- package/dist/esm/ic-checkbox_3.entry.js.map +1 -1
- package/dist/esm/ic-chip.entry.js +1 -1
- package/dist/esm/ic-data-row.entry.js +1 -1
- package/dist/esm/ic-data-table-title-bar.entry.js +1 -1
- package/dist/esm/ic-data-table.entry.js +11 -8
- package/dist/esm/ic-data-table.entry.js.map +1 -1
- package/dist/esm/ic-date-picker.entry.js +1 -1
- package/dist/esm/ic-dialog.entry.js +1 -1
- package/dist/esm/ic-divider.entry.js +1 -1
- package/dist/esm/ic-footer-link-group.entry.js +1 -1
- package/dist/esm/ic-footer-link.entry.js +1 -1
- package/dist/esm/ic-footer.entry.js +1 -1
- package/dist/esm/ic-hero.entry.js +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
- package/dist/esm/ic-input-component-container_4.entry.js +1 -1
- package/dist/esm/ic-link.entry.js +1 -1
- package/dist/esm/ic-menu-group.entry.js +1 -1
- package/dist/esm/ic-menu-item.entry.js +1 -1
- package/dist/esm/ic-menu.entry.js +1 -1
- package/dist/esm/ic-navigation-button.entry.js +1 -1
- package/dist/esm/ic-navigation-group.entry.js +1 -1
- package/dist/esm/ic-navigation-item.entry.js +1 -1
- package/dist/esm/ic-navigation-menu.entry.js +1 -1
- package/dist/esm/ic-page-header.entry.js +1 -1
- package/dist/esm/ic-pagination_4.entry.js +9 -5
- package/dist/esm/ic-pagination_4.entry.js.map +1 -1
- package/dist/esm/ic-popover-menu.entry.js +1 -1
- package/dist/esm/ic-radio-group.entry.js +1 -1
- package/dist/esm/ic-radio-option.entry.js +1 -1
- package/dist/esm/ic-search-bar.entry.js +1 -1
- package/dist/esm/ic-side-navigation.entry.js +1 -1
- package/dist/esm/ic-status-tag.entry.js +1 -1
- package/dist/esm/ic-step.entry.js +1 -1
- package/dist/esm/ic-stepper.entry.js +1 -1
- package/dist/esm/ic-switch.entry.js +1 -1
- package/dist/esm/ic-tab-group.entry.js +1 -1
- package/dist/esm/ic-tab.entry.js +1 -1
- package/dist/esm/ic-table-of-contents.entry.js +1 -1
- package/dist/esm/ic-theme.entry.js +1 -1
- package/dist/esm/ic-time-input.entry.js +401 -99
- package/dist/esm/ic-time-input.entry.js.map +1 -1
- package/dist/esm/ic-time-selector.entry.js +838 -0
- package/dist/esm/ic-time-selector.entry.js.map +1 -0
- package/dist/esm/ic-toast.entry.js +1 -1
- package/dist/esm/ic-toggle-button_2.entry.js +449 -0
- package/dist/esm/ic-toggle-button_2.entry.js.map +1 -0
- package/dist/esm/ic-top-navigation.entry.js +1 -1
- package/dist/esm/ic-tree-item.entry.js +3 -3
- package/dist/esm/ic-tree-view.entry.js +4 -4
- package/dist/esm/ic-typography.entry.js +1 -1
- package/dist/esm/index-a7a720e7.js +8 -8
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-calendar/ic-calendar.stories.d.ts +20 -14
- package/dist/types/components/ic-pagination-bar/ic-pagination-bar.d.ts +4 -0
- package/dist/types/components/ic-time-input/ic-time-input.d.ts +26 -6
- package/dist/types/components/ic-time-input/ic-time-input.stories.d.ts +31 -7
- package/dist/types/components/ic-time-input/test/helpers/ic-time-input.d.ts +1 -0
- package/dist/types/components/ic-time-selector/ic-time-selector.d.ts +88 -0
- package/dist/types/components/ic-time-selector/ic-time-selector.stories.d.ts +99 -0
- package/dist/types/components/ic-time-selector/ic-time-selector.types.d.ts +1 -0
- package/dist/types/components.d.ts +147 -11
- package/dist/types/utils/helpers.d.ts +14 -0
- package/dist/types/utils/types.d.ts +2 -1
- package/hydrate/index.js +1356 -131
- package/hydrate/index.mjs +1356 -131
- package/package.json +30 -30
- package/dist/cjs/helpers-6f4b406b.js.map +0 -1
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +0 -267
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +0 -1
- package/dist/cjs/ic-toggle-button.cjs.entry.js.map +0 -1
- package/dist/core/p-25280383.entry.js.map +0 -1
- package/dist/core/p-2c86ce4b.entry.js +0 -2
- package/dist/core/p-2c86ce4b.entry.js.map +0 -1
- package/dist/core/p-5b32aaf3.entry.js +0 -2
- package/dist/core/p-5b32aaf3.entry.js.map +0 -1
- package/dist/core/p-80111272.entry.js +0 -2
- package/dist/core/p-80111272.entry.js.map +0 -1
- package/dist/core/p-9044539c.entry.js +0 -2
- package/dist/core/p-9044539c.entry.js.map +0 -1
- package/dist/core/p-af821831.entry.js.map +0 -1
- package/dist/core/p-c3eddb99.entry.js +0 -2
- package/dist/core/p-c3eddb99.entry.js.map +0 -1
- package/dist/core/p-f48ce5f6.js +0 -2
- package/dist/core/p-f48ce5f6.js.map +0 -1
- package/dist/esm/helpers-9f228880.js.map +0 -1
- package/dist/esm/ic-toggle-button-group.entry.js.map +0 -1
- package/dist/esm/ic-toggle-button.entry.js.map +0 -1
- /package/dist/core/{p-b80b08ae.entry.js.map → p-08f24329.entry.js.map} +0 -0
- /package/dist/core/{p-615d474e.entry.js.map → p-14b8bf37.entry.js.map} +0 -0
- /package/dist/core/{p-81f12581.entry.js.map → p-169ad948.entry.js.map} +0 -0
- /package/dist/core/{p-847cbb16.entry.js.map → p-1d166343.entry.js.map} +0 -0
- /package/dist/core/{p-b4bfaf8f.entry.js.map → p-201b41c7.entry.js.map} +0 -0
- /package/dist/core/{p-24bac55f.entry.js.map → p-33509a89.entry.js.map} +0 -0
- /package/dist/core/{p-e1920777.entry.js.map → p-3389625c.entry.js.map} +0 -0
- /package/dist/core/{p-5a1cfb3c.entry.js.map → p-344752cb.entry.js.map} +0 -0
- /package/dist/core/{p-6c238418.entry.js.map → p-348d7080.entry.js.map} +0 -0
- /package/dist/core/{p-3ef2e98d.entry.js.map → p-39cdf5db.entry.js.map} +0 -0
- /package/dist/core/{p-fd20470e.entry.js.map → p-496b314f.entry.js.map} +0 -0
- /package/dist/core/{p-bd9a76d8.entry.js.map → p-508b6da3.entry.js.map} +0 -0
- /package/dist/core/{p-f5cea10d.entry.js.map → p-5e6687a8.entry.js.map} +0 -0
- /package/dist/core/{p-72171192.entry.js.map → p-60f4fe3a.entry.js.map} +0 -0
- /package/dist/core/{p-e00e67ff.entry.js.map → p-6323da7a.entry.js.map} +0 -0
- /package/dist/core/{p-c6c87e58.entry.js.map → p-6dfe0922.entry.js.map} +0 -0
- /package/dist/core/{p-fd7f3b58.entry.js.map → p-770e92cd.entry.js.map} +0 -0
- /package/dist/core/{p-7cf6b428.entry.js.map → p-79ead0e7.entry.js.map} +0 -0
- /package/dist/core/{p-285892ef.entry.js.map → p-7b4b45cf.entry.js.map} +0 -0
- /package/dist/core/{p-afedcfdb.entry.js.map → p-7efdbab8.entry.js.map} +0 -0
- /package/dist/core/{p-96177a74.entry.js.map → p-802a4bd3.entry.js.map} +0 -0
- /package/dist/core/{p-9a9605c3.entry.js.map → p-879c180d.entry.js.map} +0 -0
- /package/dist/core/{p-3891ce53.entry.js.map → p-8830011c.entry.js.map} +0 -0
- /package/dist/core/{p-444cd8d3.entry.js.map → p-8ab37b4d.entry.js.map} +0 -0
- /package/dist/core/{p-c87cc0d1.entry.js.map → p-939025af.entry.js.map} +0 -0
- /package/dist/core/{p-4992e9ac.entry.js.map → p-939b168a.entry.js.map} +0 -0
- /package/dist/core/{p-5a4344cb.entry.js.map → p-9dea5764.entry.js.map} +0 -0
- /package/dist/core/{p-90611726.entry.js.map → p-a8a92e54.entry.js.map} +0 -0
- /package/dist/core/{p-31f3fb15.entry.js.map → p-a94a7b71.entry.js.map} +0 -0
- /package/dist/core/{p-ba75ed34.entry.js.map → p-b434bd7c.entry.js.map} +0 -0
- /package/dist/core/{p-2188b483.entry.js.map → p-c0a7eed7.entry.js.map} +0 -0
- /package/dist/core/{p-2bd2f38b.entry.js.map → p-c0b227d2.entry.js.map} +0 -0
- /package/dist/core/{p-2646a629.entry.js.map → p-c32f043e.entry.js.map} +0 -0
- /package/dist/core/{p-7a0f62c2.entry.js.map → p-c4b2774d.entry.js.map} +0 -0
- /package/dist/core/{p-775b8dba.entry.js.map → p-c9525aac.entry.js.map} +0 -0
- /package/dist/core/{p-7026afad.entry.js.map → p-ca05573a.entry.js.map} +0 -0
- /package/dist/core/{p-8c580d88.entry.js.map → p-d0607a70.entry.js.map} +0 -0
- /package/dist/core/{p-15c05eb8.entry.js.map → p-d528d856.entry.js.map} +0 -0
- /package/dist/core/{p-0043b019.entry.js.map → p-da1c2883.entry.js.map} +0 -0
- /package/dist/core/{p-ffc1cea6.entry.js.map → p-e2e556ec.entry.js.map} +0 -0
- /package/dist/core/{p-e4ef4263.js.map → p-e519f607.js.map} +0 -0
- /package/dist/core/{p-3f0bce15.entry.js.map → p-e5c6d01a.entry.js.map} +0 -0
- /package/dist/core/{p-04a9f82f.entry.js.map → p-e8db8772.entry.js.map} +0 -0
- /package/dist/core/{p-e4b82731.entry.js.map → p-ea04103e.entry.js.map} +0 -0
- /package/dist/core/{p-9a95f428.entry.js.map → p-eaeb473e.entry.js.map} +0 -0
- /package/dist/core/{p-8e592393.entry.js.map → p-ecc7fd71.entry.js.map} +0 -0
- /package/dist/core/{p-6cfba272.entry.js.map → p-efe260f0.entry.js.map} +0 -0
- /package/dist/core/{p-b6d6b26e.entry.js.map → p-f1b57f91.entry.js.map} +0 -0
- /package/dist/core/{p-e4551a38.entry.js.map → p-f5dc04f7.entry.js.map} +0 -0
- /package/dist/core/{p-1900c7c7.entry.js.map → p-fd08156a.entry.js.map} +0 -0
- /package/dist/core/{p-3594922d.entry.js.map → p-fe5b51bb.entry.js.map} +0 -0
- /package/dist/core/{p-ef5b6622.entry.js.map → p-ff618439.entry.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7a720e7.js';
|
|
2
|
-
import { b as isEmptyString, l as
|
|
2
|
+
import { b as isEmptyString, l as parseTimeHelper, m as getInputDescribedByText, n as isNumeric, q as IcInformationStatus, r as removeDisabledFalse, s as removeFormResetListener, t as addFormResetListener, o as onComponentRequiredPropUndefined, u as renderHiddenInput } from './helpers-a08b3f32.js';
|
|
3
3
|
import { C as Clear } from './clear-icon-1c79bda2.js';
|
|
4
4
|
|
|
5
5
|
const Clock = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>clock-outline</title><path d="M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z" /></svg>`;
|
|
6
6
|
|
|
7
|
-
const icTimeInputCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{--ic-input-label-helpertext-padding:var(--ic-space-xs);--input-bg-color:var(--ic-time-picker-field-background);--ic-input-label-text-color:var(--ic-time-picker-label);--ic-input-label-helper-text-color:var(--ic-time-picker-subtitle);--border-color:var(--ic-time-picker-time-field-border-default);--border-color-disabled:var(--ic-time-picker-border-disabled);--border-color-hover:var(--ic-time-picker-time-field-border-hover);--border-color-pressed:var(--ic-time-picker-time-field-border-pressed);--border-error-color:var(--ic-time-picker-border-error);--border-error-color-hover:var(--ic-time-picker-border-error-hover);--border-error-color-pressed:var(--ic-time-picker-border-error-pressed);--border-success-color:var(--ic-time-picker-border-success);--border-success-color-hover:var(--ic-time-picker-border-success-hover);--border-success-color-pressed:var(--ic-time-picker-border-success-pressed);--border-warning-color:var(--ic-time-picker-border-warning);--border-warning-color-hover:var(--ic-time-picker-border-warning-hover);--border-warning-color-pressed:var(--ic-time-picker-border-warning-pressed);--input-width:calc((4 * var(--ic-space-xxl)) + var(--ic-space-xxs))}:host(.ic-time-input-disabled){--ic-input-label-text-color:var(--ic-time-picker-label-disabled);--ic-input-label-helper-text-color:var(--ic-time-picker-subtitle-disabled)}:host(.ic-time-input-disabled) input{color:var(--ic-time-picker-time-text-disabled)}:host(.ic-time-input-large){--input-width:calc(\n (4 * var(--ic-space-xxl)) + var(--ic-space-xxs) + var(--ic-space-lg)\n )}:host(.ic-time-input-small){--input-width:calc(\n (3 * var(--ic-space-xxl)) + var(--ic-space-xxs) + var(--ic-space-xl)\n )}input{border:0;height:100%;padding:0;outline:none;background:none;-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield;color:var(--ic-time-picker-time-text-default);caret-color:var(--ic-time-picker-typing-cursor)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none}input:-webkit-autofill{box-shadow:0 0 0 var(--ic-space-sm) var(--ic-color-background-primary) inset;-webkit-text-fill-color:var(--ic-time-picker-time-text-default) !important}input::-moz-placeholder{color:var(--ic-time-picker-field-placeholder-text)}input::placeholder{color:var(--ic-time-picker-field-placeholder-text)}ic-input-component-container{cursor:text}ic-input-component-container .focus-indicator{padding:var(--ic-space-xxxs) var(--ic-space-xs);align-items:center}.time-inputs{color:var(--ic-time-picker-field-placeholder-text)}.hour-input{width:1.438rem}.minute-input{width:1.813rem}.second-input,.
|
|
7
|
+
const icTimeInputCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{--ic-input-label-helpertext-padding:var(--ic-space-xs);--input-bg-color:var(--ic-time-picker-field-background);--ic-input-label-text-color:var(--ic-time-picker-label);--ic-input-label-helper-text-color:var(--ic-time-picker-subtitle);--border-color:var(--ic-time-picker-time-field-border-default);--border-color-disabled:var(--ic-time-picker-border-disabled);--border-color-hover:var(--ic-time-picker-time-field-border-hover);--border-color-pressed:var(--ic-time-picker-time-field-border-pressed);--border-error-color:var(--ic-time-picker-border-error);--border-error-color-hover:var(--ic-time-picker-border-error-hover);--border-error-color-pressed:var(--ic-time-picker-border-error-pressed);--border-success-color:var(--ic-time-picker-border-success);--border-success-color-hover:var(--ic-time-picker-border-success-hover);--border-success-color-pressed:var(--ic-time-picker-border-success-pressed);--border-warning-color:var(--ic-time-picker-border-warning);--border-warning-color-hover:var(--ic-time-picker-border-warning-hover);--border-warning-color-pressed:var(--ic-time-picker-border-warning-pressed);--input-width:calc((4 * var(--ic-space-xxl)) + var(--ic-space-xxs))}:host(.ic-time-input-disabled){--ic-input-label-text-color:var(--ic-time-picker-label-disabled);--ic-input-label-helper-text-color:var(--ic-time-picker-subtitle-disabled)}:host(.ic-time-input-disabled) input{color:var(--ic-time-picker-time-text-disabled)}:host(.ic-time-input-large){--input-width:calc(\n (4 * var(--ic-space-xxl)) + var(--ic-space-xxs) + var(--ic-space-lg)\n )}:host(.ic-time-input-small){--input-width:calc(\n (3 * var(--ic-space-xxl)) + var(--ic-space-xxs) + var(--ic-space-xl)\n )}.with-am-pm-toggle{display:flex;flex-direction:row}.am-pm-toggle ::part(button){min-width:-moz-fit-content;min-width:fit-content}.am-pm-toggle{margin-left:var(--ic-space-xs)}input{border:0;height:100%;padding:0;outline:none;background:none;-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield;color:var(--ic-time-picker-time-text-default);caret-color:var(--ic-time-picker-typing-cursor)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none}input:-webkit-autofill{box-shadow:0 0 0 var(--ic-space-sm) var(--ic-color-background-primary) inset;-webkit-text-fill-color:var(--ic-time-picker-time-text-default) !important}input::-moz-placeholder{color:var(--ic-time-picker-field-placeholder-text)}input::placeholder{color:var(--ic-time-picker-field-placeholder-text)}ic-input-component-container{cursor:text}ic-input-component-container .focus-indicator{padding:var(--ic-space-xxxs) var(--ic-space-xs);align-items:center}.time-inputs{color:var(--ic-time-picker-field-placeholder-text)}.hour-input{width:1.438rem}.minute-input{width:1.813rem}.second-input{width:1.18rem}.millisecond-input,.millisecond-input.fit-to-value{width:1.75rem}.fit-to-value{width:1.25rem}.sr-only{position:absolute;left:-9999px}.input-container{width:100%;display:flex;justify-content:space-between;align-items:center;position:relative}.action-buttons{display:flex;align-items:center}.show-clock-button-wrapper{display:flex;justify-content:center;align-items:center}.clear-button,.clock-button{border-radius:var(--ic-border-radius);transition:box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition);margin:0}.clear-button.hidden{display:none}.clear-button:focus,.clock-button:focus,.clear-button:active,.clock-button:active{background-color:var(--ic-color-focus-inner) !important;box-shadow:inset 0 0 0 0.125rem var(--ic-color-focus-outer) !important;border-radius:0.25rem}.clock-button:focus,.clock-button:active{--ic-button-tertiary-text-active:var(--ic-atoms-input-clear-button-focus);--ic-button-tertiary-text-hover-active:var(\n --ic-atoms-input-clear-button-focus\n );--ic-button-tertiary-text-pressed-active:var(\n --ic-atoms-input-clear-button-focus\n )}.clear-button:focus,.clock-button:focus,.clear-button:active *,.clock-button:active *{fill:var(--ic-atoms-input-clear-button-focus)}.clear-button svg{color:var(--ic-time-picker-clear-icon)}.clear-button:focus svg{color:var(--ic-atoms-input-clear-button-focus)}.divider{margin:0 var(--ic-space-xxs);width:var(--ic-space-1px);background-color:var(--ic-atoms-input-divider);border-radius:var(--ic-space-1px)}.divider.small{height:var(--ic-space-md)}.divider.medium{height:calc(var(--ic-space-sm) + var(--ic-space-xs))}.divider.large{height:var(--ic-space-lg)}ic-input-validation{--ic-input-validation-status-text-color:var(--ic-time-picker-status-text);--ic-input-validation-error:var(--ic-time-picker-icon-error);--ic-input-validation-warning-icon-color:var(--ic-time-picker-icon-warning);--ic-input-validation-success-icon-color:var(--ic-time-picker-icon-success)}@media (forced-colors: active){.clear-button svg{color:currentcolor}}";
|
|
8
8
|
const IcTimeInputStyle0 = icTimeInputCss;
|
|
9
9
|
|
|
10
10
|
let inputIds = 0;
|
|
@@ -13,9 +13,10 @@ const TimeInput = class {
|
|
|
13
13
|
registerInstance(this, hostRef);
|
|
14
14
|
this.clockButtonClicked = createEvent(this, "clockButtonClicked", 7);
|
|
15
15
|
this.icBlur = createEvent(this, "icBlur", 7);
|
|
16
|
-
this.
|
|
16
|
+
this.icTimeChange = createEvent(this, "icTimeChange", 7);
|
|
17
17
|
this.icFocus = createEvent(this, "icFocus", 7);
|
|
18
18
|
this.DEFAULT_TIME_FORMAT = "HH:MM:SS";
|
|
19
|
+
this.TOGGLE_BUTTON_SELECTOR = "ic-toggle-button";
|
|
19
20
|
this.ARIA_INVALID = "aria-invalid";
|
|
20
21
|
this.ARIA_LABEL = "aria-label";
|
|
21
22
|
this.ARIA_LABELLED_BY = "aria-labelledby";
|
|
@@ -26,6 +27,7 @@ const TimeInput = class {
|
|
|
26
27
|
this.isValidHour = true;
|
|
27
28
|
this.isValidMinute = true;
|
|
28
29
|
this.isValidSecond = true;
|
|
30
|
+
this.isValidMillisecond = true;
|
|
29
31
|
this.isValidTime = true;
|
|
30
32
|
this.isTimeSetFromKeyboardEvent = false;
|
|
31
33
|
this.previousSelectedTime = null;
|
|
@@ -34,12 +36,20 @@ const TimeInput = class {
|
|
|
34
36
|
this.clearInput = false;
|
|
35
37
|
this.maxTime = null;
|
|
36
38
|
this.minTime = null;
|
|
39
|
+
this.previousHour = "";
|
|
40
|
+
this.previousMinute = "";
|
|
41
|
+
this.previousSecond = "";
|
|
42
|
+
this.previousMillisecond = "";
|
|
43
|
+
this.previousPeriod = "AM";
|
|
37
44
|
this.clockFocused = false;
|
|
38
45
|
this.clearButtonFocused = false;
|
|
39
46
|
this.removeLabelledBy = false;
|
|
40
47
|
this.hour = "";
|
|
41
48
|
this.minute = "";
|
|
42
49
|
this.second = "";
|
|
50
|
+
this.millisecond = "";
|
|
51
|
+
this.period = "AM";
|
|
52
|
+
this.isSSSFormat = () => this.timeFormat === "HH:MM:SS.SSS";
|
|
43
53
|
/**
|
|
44
54
|
* If `true`, the disabled state will be set.
|
|
45
55
|
*/
|
|
@@ -49,7 +59,7 @@ const TimeInput = class {
|
|
|
49
59
|
*/
|
|
50
60
|
this.disableTimes = [];
|
|
51
61
|
/**
|
|
52
|
-
* If `true`, every individual input field completed will emit an
|
|
62
|
+
* If `true`, every individual input field completed will emit an icTimeChange event.
|
|
53
63
|
*/
|
|
54
64
|
this.emitTimePartChange = false;
|
|
55
65
|
/**
|
|
@@ -84,6 +94,10 @@ const TimeInput = class {
|
|
|
84
94
|
* If `true`, the input will require a value.
|
|
85
95
|
*/
|
|
86
96
|
this.required = false;
|
|
97
|
+
/**
|
|
98
|
+
* If `true`, the time input will show an AM/PM toggle when in 12-hour time period.
|
|
99
|
+
*/
|
|
100
|
+
this.showAmPmToggle = false;
|
|
87
101
|
/**
|
|
88
102
|
* If `true`, a button which clears the time input when clicked will be displayed.
|
|
89
103
|
*/
|
|
@@ -131,19 +145,6 @@ const TimeInput = class {
|
|
|
131
145
|
inputEl.classList.add(this.FIT_TO_VALUE);
|
|
132
146
|
}
|
|
133
147
|
};
|
|
134
|
-
this.parseTime = (value) => {
|
|
135
|
-
if (!value)
|
|
136
|
-
return null;
|
|
137
|
-
if (value instanceof Date)
|
|
138
|
-
return value;
|
|
139
|
-
const parts = value.split(":");
|
|
140
|
-
if (parts.length >= 2) {
|
|
141
|
-
const d = new Date();
|
|
142
|
-
d.setHours(+parts[0], +parts[1], parts[2] ? +parts[2] : 0, 0);
|
|
143
|
-
return d;
|
|
144
|
-
}
|
|
145
|
-
return null;
|
|
146
|
-
};
|
|
147
148
|
this.isHHMMFormat = () => this.timeFormat === "HH:MM";
|
|
148
149
|
this.isKeyboardOrEvent = (event) => {
|
|
149
150
|
return (Object.prototype.toString.call(event) === this.EVENT_OBJECT_STRING ||
|
|
@@ -171,9 +172,22 @@ const TimeInput = class {
|
|
|
171
172
|
else {
|
|
172
173
|
this.isValidSecond = true;
|
|
173
174
|
}
|
|
175
|
+
if (this.isSSSFormat()) {
|
|
176
|
+
if (!isEmptyString(this.millisecond)) {
|
|
177
|
+
this.isValidMillisecond =
|
|
178
|
+
+this.millisecond >= 0 && +this.millisecond <= 999;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
this.isValidMillisecond = true;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
this.isValidMillisecond = true;
|
|
186
|
+
}
|
|
174
187
|
}
|
|
175
188
|
else {
|
|
176
189
|
this.isValidSecond = true;
|
|
190
|
+
this.isValidMillisecond = true;
|
|
177
191
|
}
|
|
178
192
|
};
|
|
179
193
|
this.setInputValue = (input, clear = false) => {
|
|
@@ -187,6 +201,9 @@ const TimeInput = class {
|
|
|
187
201
|
else if (input === this.secondInputEl && !this.isHHMMFormat()) {
|
|
188
202
|
this.second = newValue;
|
|
189
203
|
}
|
|
204
|
+
else if (this.isSSSFormat() && input === this.millisecondInputEl) {
|
|
205
|
+
this.millisecond = newValue;
|
|
206
|
+
}
|
|
190
207
|
this.setValidationMessage();
|
|
191
208
|
};
|
|
192
209
|
this.setPreventInput = (input, isPrevented) => {
|
|
@@ -199,22 +216,50 @@ const TimeInput = class {
|
|
|
199
216
|
else if (input === this.secondInputEl) {
|
|
200
217
|
this.preventSecondInput = isPrevented;
|
|
201
218
|
}
|
|
219
|
+
else if (this.isSSSFormat() && input === this.millisecondInputEl) {
|
|
220
|
+
this.preventMillisecondInput = isPrevented;
|
|
221
|
+
}
|
|
202
222
|
};
|
|
203
223
|
this.setValidationMessage = () => {
|
|
204
|
-
this.maxTime =
|
|
205
|
-
this.minTime =
|
|
224
|
+
this.maxTime = parseTimeHelper(this.max).date;
|
|
225
|
+
this.minTime = parseTimeHelper(this.min).date;
|
|
206
226
|
this.setTimeValidity();
|
|
207
227
|
let outOfBoundsMsg = "";
|
|
208
228
|
let isDisabledTime = false;
|
|
209
229
|
if (!isEmptyString(this.hour) &&
|
|
210
230
|
!isEmptyString(this.minute) &&
|
|
211
|
-
(this.isHHMMFormat() || !isEmptyString(this.second))
|
|
212
|
-
|
|
213
|
-
this.
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
231
|
+
(this.isHHMMFormat() || !isEmptyString(this.second)) &&
|
|
232
|
+
(!this.isSSSFormat() || !isEmptyString(this.millisecond))) {
|
|
233
|
+
this.selectedTime = this.convertToTime(this.hour, this.minute, this.isHHMMFormat() ? "00" : this.second, this.isSSSFormat() ? this.millisecond : "000");
|
|
234
|
+
const inputHour = +this.hour;
|
|
235
|
+
const selectedHour = this.selectedTime
|
|
236
|
+
? this.selectedTime.getHours()
|
|
237
|
+
: null;
|
|
238
|
+
if (this.timePeriod === "12" &&
|
|
239
|
+
this.showAmPmToggle &&
|
|
240
|
+
selectedHour !== null) {
|
|
241
|
+
let selectedHour12 = selectedHour % 12;
|
|
242
|
+
if (selectedHour12 === 0)
|
|
243
|
+
selectedHour12 = 12;
|
|
244
|
+
this.isValidTime =
|
|
245
|
+
!!this.selectedTime &&
|
|
246
|
+
selectedHour12 == inputHour &&
|
|
247
|
+
this.selectedTime.getMinutes() == +this.minute &&
|
|
248
|
+
(this.isHHMMFormat() ||
|
|
249
|
+
this.selectedTime.getSeconds() == +this.second) &&
|
|
250
|
+
(!this.isSSSFormat() ||
|
|
251
|
+
this.selectedTime.getMilliseconds() == +this.millisecond);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
this.isValidTime =
|
|
255
|
+
!!this.selectedTime &&
|
|
256
|
+
this.selectedTime.getHours() == inputHour &&
|
|
257
|
+
this.selectedTime.getMinutes() == +this.minute &&
|
|
258
|
+
(this.isHHMMFormat() ||
|
|
259
|
+
this.selectedTime.getSeconds() == +this.second) &&
|
|
260
|
+
(!this.isSSSFormat() ||
|
|
261
|
+
this.selectedTime.getMilliseconds() == +this.millisecond);
|
|
262
|
+
}
|
|
218
263
|
if (this.selectedTime &&
|
|
219
264
|
Array.isArray(this.disableTimes) &&
|
|
220
265
|
this.disableTimes.length > 0) {
|
|
@@ -223,18 +268,25 @@ const TimeInput = class {
|
|
|
223
268
|
t !== null &&
|
|
224
269
|
"start" in t &&
|
|
225
270
|
"end" in t) {
|
|
226
|
-
const start =
|
|
227
|
-
const end =
|
|
271
|
+
const start = parseTimeHelper(t.start).date;
|
|
272
|
+
const end = parseTimeHelper(t.end).date;
|
|
228
273
|
if (start && end) {
|
|
229
274
|
return this.selectedTime >= start && this.selectedTime <= end;
|
|
230
275
|
}
|
|
231
276
|
return false;
|
|
232
277
|
}
|
|
233
|
-
const parsed =
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
278
|
+
const parsed = parseTimeHelper(t).parts;
|
|
279
|
+
if (!parsed)
|
|
280
|
+
return false;
|
|
281
|
+
let selectedHour = this.selectedTime.getHours();
|
|
282
|
+
let parsedHour = parsed.hour;
|
|
283
|
+
if (this.timePeriod === "12" && this.showAmPmToggle) {
|
|
284
|
+
selectedHour = this.convertTo24Hour(selectedHour);
|
|
285
|
+
parsedHour = this.convertTo24Hour(parsedHour);
|
|
286
|
+
}
|
|
287
|
+
return (parsedHour === selectedHour &&
|
|
288
|
+
parsed.minute === this.selectedTime.getMinutes() &&
|
|
289
|
+
parsed.second === this.selectedTime.getSeconds());
|
|
238
290
|
});
|
|
239
291
|
if (isDisabledTime) {
|
|
240
292
|
this.isValidTime = false;
|
|
@@ -264,6 +316,7 @@ const TimeInput = class {
|
|
|
264
316
|
if (!(this.isValidHour &&
|
|
265
317
|
this.isValidMinute &&
|
|
266
318
|
this.isValidSecond &&
|
|
319
|
+
this.isValidMillisecond &&
|
|
267
320
|
this.isValidTime)) {
|
|
268
321
|
this.invalidTimeText = outOfBoundsMsg || this.invalidTimeMessage;
|
|
269
322
|
}
|
|
@@ -275,12 +328,33 @@ const TimeInput = class {
|
|
|
275
328
|
const hh = time.getHours().toString().padStart(2, "0");
|
|
276
329
|
const mm = time.getMinutes().toString().padStart(2, "0");
|
|
277
330
|
const ss = time.getSeconds().toString().padStart(2, "0");
|
|
331
|
+
const sss = time.getMilliseconds().toString().padStart(3, "0");
|
|
332
|
+
if (this.isSSSFormat()) {
|
|
333
|
+
return `${hh}:${mm}:${ss}.${sss}`;
|
|
334
|
+
}
|
|
278
335
|
return this.isHHMMFormat() ? `${hh}:${mm}` : `${hh}:${mm}:${ss}`;
|
|
279
336
|
};
|
|
280
337
|
this.handleInput = (event) => {
|
|
281
338
|
const inputEvent = event;
|
|
282
339
|
const input = event.target;
|
|
283
|
-
if (input
|
|
340
|
+
if (input === this.millisecondInputEl && this.isSSSFormat()) {
|
|
341
|
+
this.setInputValue(input);
|
|
342
|
+
this.setPreventInput(input, false);
|
|
343
|
+
this.setFitToValueStyling(input);
|
|
344
|
+
if (input.value.length === 3) {
|
|
345
|
+
this.moveToNextInput(input);
|
|
346
|
+
this.setPreventInput(input, true);
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
this.setPreventInput(input, false);
|
|
350
|
+
}
|
|
351
|
+
if (input.value.length === 0) {
|
|
352
|
+
this.setInputValue(input, true);
|
|
353
|
+
this.setValidationMessage();
|
|
354
|
+
}
|
|
355
|
+
this.notifyScreenReader(input);
|
|
356
|
+
}
|
|
357
|
+
else if (input !== this.hourInputEl) {
|
|
284
358
|
if (inputEvent.inputType !== "deleteContentBackward" &&
|
|
285
359
|
!this.preventAutoFormatting) {
|
|
286
360
|
if (input.value.length === 1 &&
|
|
@@ -313,6 +387,12 @@ const TimeInput = class {
|
|
|
313
387
|
if (input.value.length !== 2) {
|
|
314
388
|
this.setPreventInput(input, false);
|
|
315
389
|
}
|
|
390
|
+
this.setFitToValueStyling(input);
|
|
391
|
+
if (input.value.length === 0) {
|
|
392
|
+
this.setInputValue(input, true);
|
|
393
|
+
this.setValidationMessage();
|
|
394
|
+
}
|
|
395
|
+
this.notifyScreenReader(input);
|
|
316
396
|
}
|
|
317
397
|
else {
|
|
318
398
|
if (input.value.length === 2) {
|
|
@@ -326,18 +406,25 @@ const TimeInput = class {
|
|
|
326
406
|
this.setInputValue(input, true);
|
|
327
407
|
this.setPreventInput(input, false);
|
|
328
408
|
}
|
|
409
|
+
this.setFitToValueStyling(input);
|
|
410
|
+
if (input.value.length === 0) {
|
|
411
|
+
this.setInputValue(input, true);
|
|
412
|
+
this.setValidationMessage();
|
|
413
|
+
}
|
|
414
|
+
this.notifyScreenReader(input);
|
|
329
415
|
}
|
|
330
|
-
this.setFitToValueStyling(input);
|
|
331
|
-
if (input.value.length === 0) {
|
|
332
|
-
this.setInputValue(input, true);
|
|
333
|
-
this.setValidationMessage();
|
|
334
|
-
}
|
|
335
|
-
this.notifyScreenReader(input);
|
|
336
416
|
};
|
|
337
417
|
this.handleKeyDown = (event, isInputPrevented) => {
|
|
338
418
|
var _a;
|
|
419
|
+
const navKeys = /arrowup|arrowdown|arrowleft|arrowright|shift|tab|backspace|delete/i;
|
|
339
420
|
const input = event.target;
|
|
340
421
|
const eventKey = (_a = event.key) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
422
|
+
if (!/-?\d*\.?\d+(e[-+]?\d+)?|[:]|[.]/i.test(eventKey) &&
|
|
423
|
+
!navKeys.test(eventKey) &&
|
|
424
|
+
!((event.ctrlKey || event.metaKey) &&
|
|
425
|
+
(eventKey === "v" || eventKey === "c"))) {
|
|
426
|
+
event.preventDefault();
|
|
427
|
+
}
|
|
341
428
|
const regex = /-?\d*\.?\d+(e[-+]?\d+)?|[:]|arrowup|arrowdown|arrowleft|arrowright|shift|tab|backspace|delete/;
|
|
342
429
|
if (!regex.test(eventKey) &&
|
|
343
430
|
!((event.ctrlKey || event.metaKey) &&
|
|
@@ -375,7 +462,18 @@ const TimeInput = class {
|
|
|
375
462
|
};
|
|
376
463
|
this.handleBlur = (event) => {
|
|
377
464
|
const input = event.target;
|
|
378
|
-
if (input) {
|
|
465
|
+
if (input === this.millisecondInputEl && this.isSSSFormat()) {
|
|
466
|
+
if (input.value.length === 1) {
|
|
467
|
+
input.value = `00${input.value}`;
|
|
468
|
+
this.setInputValue(input);
|
|
469
|
+
}
|
|
470
|
+
else if (input.value.length === 2) {
|
|
471
|
+
input.value = `0${input.value}`;
|
|
472
|
+
this.setInputValue(input);
|
|
473
|
+
}
|
|
474
|
+
this.setFitToValueStyling(input);
|
|
475
|
+
}
|
|
476
|
+
else if (input) {
|
|
379
477
|
this.autocompleteInput(input);
|
|
380
478
|
}
|
|
381
479
|
};
|
|
@@ -431,20 +529,80 @@ const TimeInput = class {
|
|
|
431
529
|
};
|
|
432
530
|
this.setValueAndEmitChange = (value, force = false) => {
|
|
433
531
|
if (this.value !== value || force) {
|
|
434
|
-
this.
|
|
532
|
+
this.emitIcTimeChange(value);
|
|
435
533
|
this.value = value;
|
|
436
534
|
}
|
|
437
535
|
};
|
|
438
|
-
this.
|
|
439
|
-
|
|
440
|
-
this.
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
536
|
+
this.convertTo24Hour = (hour) => {
|
|
537
|
+
let date24hours = hour;
|
|
538
|
+
if (this.period === "PM" && hour < 12)
|
|
539
|
+
date24hours = hour + 12;
|
|
540
|
+
if (this.period === "AM" && hour === 12)
|
|
541
|
+
date24hours = 0;
|
|
542
|
+
return date24hours;
|
|
543
|
+
};
|
|
544
|
+
this.emitIcTimeChange = (t) => {
|
|
545
|
+
const hour = parseInt(this.hour);
|
|
546
|
+
const minute = parseInt(this.minute);
|
|
547
|
+
const second = parseInt(this.second);
|
|
548
|
+
const millisecond = parseInt(this.millisecond);
|
|
549
|
+
const period = this.period;
|
|
550
|
+
let allSelected = false;
|
|
551
|
+
if (this.isSSSFormat()) {
|
|
552
|
+
allSelected =
|
|
553
|
+
this.hour !== "" &&
|
|
554
|
+
this.minute !== "" &&
|
|
555
|
+
this.second !== "" &&
|
|
556
|
+
this.millisecond !== "";
|
|
557
|
+
}
|
|
558
|
+
else if (this.timeFormat === this.DEFAULT_TIME_FORMAT) {
|
|
559
|
+
allSelected =
|
|
560
|
+
this.hour !== "" && this.minute !== "" && this.second !== "";
|
|
561
|
+
}
|
|
562
|
+
else if (this.timeFormat === "HH:MM") {
|
|
563
|
+
allSelected = this.hour !== "" && this.minute !== "";
|
|
564
|
+
}
|
|
565
|
+
let time = t;
|
|
566
|
+
let date24hours = hour;
|
|
567
|
+
if (hour != null &&
|
|
568
|
+
period &&
|
|
569
|
+
this.timePeriod === "12" &&
|
|
570
|
+
this.showAmPmToggle) {
|
|
571
|
+
date24hours = this.convertTo24Hour(hour);
|
|
572
|
+
time = new Date();
|
|
573
|
+
time.setHours(date24hours !== null && date24hours !== void 0 ? date24hours : 0);
|
|
574
|
+
time.setMinutes(minute !== null && minute !== void 0 ? minute : 0);
|
|
575
|
+
time.setSeconds(second !== null && second !== void 0 ? second : 0);
|
|
576
|
+
this.isSSSFormat() && time.setMilliseconds(millisecond !== null && millisecond !== void 0 ? millisecond : 0);
|
|
577
|
+
}
|
|
578
|
+
this.selectedTime = time;
|
|
579
|
+
const allTimePartsEmpty = this.hour === "" &&
|
|
580
|
+
this.minute === "" &&
|
|
581
|
+
this.second === "" &&
|
|
582
|
+
this.millisecond === "";
|
|
583
|
+
const onlyPeriodChanged = allTimePartsEmpty &&
|
|
584
|
+
this.period !== this.previousPeriod &&
|
|
585
|
+
this.previousHour === "" &&
|
|
586
|
+
this.previousMinute === "" &&
|
|
587
|
+
this.previousSecond === "" &&
|
|
588
|
+
this.previousMillisecond === "";
|
|
589
|
+
if (!onlyPeriodChanged) {
|
|
590
|
+
this.icTimeChange.emit({
|
|
591
|
+
value: allSelected ? time : null,
|
|
592
|
+
timeObject: {
|
|
593
|
+
hour: this.hour === "" ? null : this.hour,
|
|
594
|
+
minute: this.minute === "" ? null : this.minute,
|
|
595
|
+
second: this.second === "" ? null : this.second,
|
|
596
|
+
millisecond: this.millisecond === "" ? null : this.millisecond,
|
|
597
|
+
period: this.period === "" ? null : this.period,
|
|
598
|
+
},
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
this.previousHour = this.hour;
|
|
602
|
+
this.previousMinute = this.minute;
|
|
603
|
+
this.previousSecond = this.second;
|
|
604
|
+
this.previousMillisecond = this.millisecond;
|
|
605
|
+
this.previousPeriod = this.period;
|
|
448
606
|
};
|
|
449
607
|
this.setTime = (time) => {
|
|
450
608
|
if (time === null || time === "" || time === undefined) {
|
|
@@ -454,6 +612,8 @@ const TimeInput = class {
|
|
|
454
612
|
this.minute = "";
|
|
455
613
|
if (this.second)
|
|
456
614
|
this.second = "";
|
|
615
|
+
if (this.millisecond)
|
|
616
|
+
this.millisecond = "";
|
|
457
617
|
this.inputsInOrder.forEach((input) => {
|
|
458
618
|
input.classList.remove(this.FIT_TO_VALUE);
|
|
459
619
|
this.setPreventInput(input, false);
|
|
@@ -469,22 +629,26 @@ const TimeInput = class {
|
|
|
469
629
|
this.second = zuluMatch[3];
|
|
470
630
|
}
|
|
471
631
|
else {
|
|
472
|
-
const parts = time.split(
|
|
632
|
+
const parts = time.split(/[:.]/);
|
|
473
633
|
this.hour = parts[0] || "";
|
|
474
634
|
this.minute = parts[1] || "";
|
|
475
635
|
this.second = parts[2] || "";
|
|
636
|
+
this.millisecond = parts[3] || "";
|
|
476
637
|
}
|
|
477
638
|
}
|
|
478
639
|
else if (time instanceof Date) {
|
|
479
640
|
this.hour = time.getHours().toString().padStart(2, "0");
|
|
480
641
|
this.minute = time.getMinutes().toString().padStart(2, "0");
|
|
481
642
|
this.second = time.getSeconds().toString().padStart(2, "0");
|
|
643
|
+
if (this.isSSSFormat()) {
|
|
644
|
+
this.millisecond = time.getMilliseconds().toString().padStart(3, "0");
|
|
645
|
+
}
|
|
482
646
|
}
|
|
483
647
|
}
|
|
484
648
|
this.setValidationMessage();
|
|
485
649
|
};
|
|
486
|
-
this.setAriaInvalid = (validHour, validMinute, validSecond) => {
|
|
487
|
-
var _a, _b, _c;
|
|
650
|
+
this.setAriaInvalid = (validHour, validMinute, validSecond, validMillisecond) => {
|
|
651
|
+
var _a, _b, _c, _d;
|
|
488
652
|
if (this.inputsInOrder.length) {
|
|
489
653
|
this.inputsInOrder.forEach((input) => {
|
|
490
654
|
input.removeAttribute(this.ARIA_INVALID);
|
|
@@ -498,7 +662,10 @@ const TimeInput = class {
|
|
|
498
662
|
if (!validSecond) {
|
|
499
663
|
(_c = this.secondInputEl) === null || _c === void 0 ? void 0 : _c.setAttribute(this.ARIA_INVALID, "true");
|
|
500
664
|
}
|
|
501
|
-
if (!
|
|
665
|
+
if (!validMillisecond) {
|
|
666
|
+
(_d = this.millisecondInputEl) === null || _d === void 0 ? void 0 : _d.setAttribute(this.ARIA_INVALID, "true");
|
|
667
|
+
}
|
|
668
|
+
if (!(validHour && validMinute && validSecond && validMillisecond)) {
|
|
502
669
|
this.inputsInOrder.forEach((input) => {
|
|
503
670
|
input.setAttribute(this.ARIA_INVALID, "true");
|
|
504
671
|
});
|
|
@@ -506,6 +673,7 @@ const TimeInput = class {
|
|
|
506
673
|
}
|
|
507
674
|
};
|
|
508
675
|
this.handleClear = () => {
|
|
676
|
+
var _a;
|
|
509
677
|
this.clearInput = true;
|
|
510
678
|
if (this.hourInputEl) {
|
|
511
679
|
this.hourInputEl.value = "";
|
|
@@ -516,9 +684,25 @@ const TimeInput = class {
|
|
|
516
684
|
if (!this.isHHMMFormat() && this.secondInputEl) {
|
|
517
685
|
this.secondInputEl.value = "";
|
|
518
686
|
}
|
|
687
|
+
if (this.isSSSFormat() && this.millisecondInputEl) {
|
|
688
|
+
this.millisecondInputEl.value = "";
|
|
689
|
+
}
|
|
519
690
|
this.hour = "";
|
|
520
691
|
this.minute = "";
|
|
521
692
|
this.second = "";
|
|
693
|
+
this.millisecond = "";
|
|
694
|
+
this.period = "AM";
|
|
695
|
+
if (this.showAmPmToggle) {
|
|
696
|
+
(_a = this.periodToggleEl) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.TOGGLE_BUTTON_SELECTOR).forEach((btn) => {
|
|
697
|
+
const toggleBtn = btn;
|
|
698
|
+
if (toggleBtn.label === "AM") {
|
|
699
|
+
toggleBtn.checked = true;
|
|
700
|
+
}
|
|
701
|
+
else {
|
|
702
|
+
toggleBtn.checked = false;
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
}
|
|
522
706
|
this.handleTimeChange(true);
|
|
523
707
|
this.inputsInOrder.forEach((input) => {
|
|
524
708
|
input.classList.remove(this.FIT_TO_VALUE);
|
|
@@ -534,26 +718,31 @@ const TimeInput = class {
|
|
|
534
718
|
};
|
|
535
719
|
this.notifyScreenReaderSelectedTime = () => {
|
|
536
720
|
if (this.selectedTime && this.selectedTimeInfoEl) {
|
|
721
|
+
let hours = this.selectedTime.getHours();
|
|
722
|
+
if (this.timePeriod === "12" && this.showAmPmToggle) {
|
|
723
|
+
hours = this.convertTo24Hour(hours);
|
|
724
|
+
}
|
|
725
|
+
const hoursStr = hours.toString().padStart(2, "0");
|
|
726
|
+
const minutesStr = this.selectedTime
|
|
727
|
+
.getMinutes()
|
|
728
|
+
.toString()
|
|
729
|
+
.padStart(2, "0");
|
|
730
|
+
const secondsStr = this.selectedTime
|
|
731
|
+
.getSeconds()
|
|
732
|
+
.toString()
|
|
733
|
+
.padStart(2, "0");
|
|
734
|
+
const msStr = this.selectedTime
|
|
735
|
+
.getMilliseconds()
|
|
736
|
+
.toString()
|
|
737
|
+
.padStart(3, "0");
|
|
537
738
|
if (this.isHHMMFormat()) {
|
|
538
|
-
this.selectedTimeInfoEl.textContent = `Selected time: ${
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
.getMinutes()
|
|
543
|
-
.toString()
|
|
544
|
-
.padStart(2, "0")}`;
|
|
739
|
+
this.selectedTimeInfoEl.textContent = `Selected time: ${hoursStr}:${minutesStr}`;
|
|
740
|
+
}
|
|
741
|
+
else if (!this.isSSSFormat()) {
|
|
742
|
+
this.selectedTimeInfoEl.textContent = `Selected time: ${hoursStr}:${minutesStr}:${secondsStr}`;
|
|
545
743
|
}
|
|
546
744
|
else {
|
|
547
|
-
this.selectedTimeInfoEl.textContent = `Selected time: ${
|
|
548
|
-
.getHours()
|
|
549
|
-
.toString()
|
|
550
|
-
.padStart(2, "0")}:${this.selectedTime
|
|
551
|
-
.getMinutes()
|
|
552
|
-
.toString()
|
|
553
|
-
.padStart(2, "0")}:${this.selectedTime
|
|
554
|
-
.getSeconds()
|
|
555
|
-
.toString()
|
|
556
|
-
.padStart(2, "0")}`;
|
|
745
|
+
this.selectedTimeInfoEl.textContent = `Selected time: ${hoursStr}:${minutesStr}:${secondsStr}.${msStr}`;
|
|
557
746
|
}
|
|
558
747
|
}
|
|
559
748
|
};
|
|
@@ -571,7 +760,7 @@ const TimeInput = class {
|
|
|
571
760
|
};
|
|
572
761
|
this.handleHostFocus = () => {
|
|
573
762
|
var _a, _b;
|
|
574
|
-
if ((_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) === null || _b === void 0 ? void 0 : _b.id.match(/(hour|minute|second)-input$/)) {
|
|
763
|
+
if ((_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) === null || _b === void 0 ? void 0 : _b.id.match(/(hour|minute|second|millisecond)-input$/)) {
|
|
575
764
|
this.removeLabelledBy = false;
|
|
576
765
|
}
|
|
577
766
|
else {
|
|
@@ -620,12 +809,17 @@ const TimeInput = class {
|
|
|
620
809
|
this.setInputValue(input);
|
|
621
810
|
}
|
|
622
811
|
};
|
|
623
|
-
this.convertToTime = (hour, minute, second) => {
|
|
812
|
+
this.convertToTime = (hour, minute, second, millisecond = null) => {
|
|
624
813
|
if (!isEmptyString(hour) &&
|
|
625
814
|
!isEmptyString(minute) &&
|
|
626
|
-
(this.isHHMMFormat() || !isEmptyString(second))
|
|
815
|
+
(this.isHHMMFormat() || !isEmptyString(second)) &&
|
|
816
|
+
(!this.isSSSFormat() ||
|
|
817
|
+
(millisecond !== null && !isEmptyString(millisecond)))) {
|
|
627
818
|
const d = new Date();
|
|
628
819
|
d.setHours(+hour, +minute, this.isHHMMFormat() ? 0 : +second, 0);
|
|
820
|
+
if (this.isSSSFormat() && millisecond !== null) {
|
|
821
|
+
d.setMilliseconds(+millisecond);
|
|
822
|
+
}
|
|
629
823
|
return d;
|
|
630
824
|
}
|
|
631
825
|
else {
|
|
@@ -670,17 +864,22 @@ const TimeInput = class {
|
|
|
670
864
|
(_d = this.inputCompContainerEl) === null || _d === void 0 ? void 0 : _d.setAttribute(this.ARIA_LABELLED_BY, labelledBy);
|
|
671
865
|
};
|
|
672
866
|
this.getInputsInOrder = () => {
|
|
673
|
-
const timeParts = this.timeFormat.split(
|
|
867
|
+
const timeParts = this.timeFormat.split(/[:.]/);
|
|
674
868
|
return timeParts.map((part) => {
|
|
675
|
-
switch (part
|
|
676
|
-
case "
|
|
869
|
+
switch (part) {
|
|
870
|
+
case "HH":
|
|
677
871
|
return (h("input", { class: "hour-input", id: "hour-input", ref: (el) => (this.hourInputEl = el), "aria-label": "hour", placeholder: "HH", disabled: this.disabled, "aria-required": `${this.required}`, inputmode: "number", pattern: "[0-9]*", onPaste: this.handlePaste, onKeyDown: (event) => this.handleKeyDown(event, this.preventHourInput) }));
|
|
678
|
-
case "
|
|
872
|
+
case "MM":
|
|
679
873
|
return (h("input", { id: "minute-input", class: "minute-input", ref: (el) => (this.minuteInputEl = el), "aria-label": "minute", placeholder: "MM", disabled: this.disabled, "aria-required": `${this.required}`, inputmode: "number", pattern: "[0-9]*", onPaste: this.handlePaste, onKeyDown: (event) => this.handleKeyDown(event, this.preventMinuteInput) }));
|
|
680
|
-
case "
|
|
874
|
+
case "SS":
|
|
681
875
|
if (!this.isHHMMFormat()) {
|
|
682
876
|
return (h("input", { id: "second-input", class: "second-input", ref: (el) => (this.secondInputEl = el), "aria-label": "second", placeholder: "SS", disabled: this.disabled, "aria-required": `${this.required}`, inputmode: "number", pattern: "[0-9]*", onPaste: this.handlePaste, onKeyDown: (event) => this.handleKeyDown(event, this.preventSecondInput) }));
|
|
683
877
|
}
|
|
878
|
+
break;
|
|
879
|
+
case "SSS":
|
|
880
|
+
if (this.isSSSFormat()) {
|
|
881
|
+
return (h("input", { id: "millisecond-input", class: "millisecond-input", ref: (el) => (this.millisecondInputEl = el), "aria-label": "millisecond", placeholder: "SSS", disabled: this.disabled, "aria-required": `${this.required}`, inputmode: "number", pattern: "[0-9]*", onPaste: this.handlePaste, onKeyDown: (event) => this.handleKeyDown(event, this.preventMillisecondInput) }));
|
|
882
|
+
}
|
|
684
883
|
return null;
|
|
685
884
|
default:
|
|
686
885
|
return null;
|
|
@@ -688,6 +887,9 @@ const TimeInput = class {
|
|
|
688
887
|
});
|
|
689
888
|
};
|
|
690
889
|
this.getDescOfInputsOrder = () => {
|
|
890
|
+
if (this.isSSSFormat()) {
|
|
891
|
+
return "hour, minute, second, and millisecond";
|
|
892
|
+
}
|
|
691
893
|
return "hour, minute, and second";
|
|
692
894
|
};
|
|
693
895
|
this.getScreenReaderInfo = (validationStatus) => {
|
|
@@ -727,7 +929,7 @@ const TimeInput = class {
|
|
|
727
929
|
this.removeLabelledBy = false;
|
|
728
930
|
return;
|
|
729
931
|
}
|
|
730
|
-
if (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.id.match(/(minute|second)-input$/)) {
|
|
932
|
+
if (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.id.match(/(minute|second|millisecond)-input$/)) {
|
|
731
933
|
this.removeLabelledBy = false;
|
|
732
934
|
return;
|
|
733
935
|
}
|
|
@@ -745,6 +947,18 @@ const TimeInput = class {
|
|
|
745
947
|
return value;
|
|
746
948
|
}
|
|
747
949
|
}
|
|
950
|
+
else if (this.isSSSFormat()) {
|
|
951
|
+
if (/^\d{2}:\d{2}:\d{2}\.\d{1,3}$/.test(value)) {
|
|
952
|
+
return value;
|
|
953
|
+
}
|
|
954
|
+
if (/^\d{2}:\d{2}:\d{2}\.\d{1,3}Z$/.test(value)) {
|
|
955
|
+
return value.replace("Z", "");
|
|
956
|
+
}
|
|
957
|
+
const isoMatch = value.match(/T(\d{2}:\d{2}:\d{2}\.\d{1,3})/);
|
|
958
|
+
if (isoMatch) {
|
|
959
|
+
return isoMatch[1];
|
|
960
|
+
}
|
|
961
|
+
}
|
|
748
962
|
else {
|
|
749
963
|
if (/^\d{2}:\d{2}:\d{2}$/.test(value)) {
|
|
750
964
|
return value;
|
|
@@ -761,16 +975,78 @@ const TimeInput = class {
|
|
|
761
975
|
};
|
|
762
976
|
this.setPastedValueAndValidation = (isValidTime, pastedValue, event) => {
|
|
763
977
|
if (isValidTime) {
|
|
764
|
-
const timeParts = isValidTime.split(
|
|
978
|
+
const timeParts = isValidTime.split(/[:.]/);
|
|
765
979
|
this.inputsInOrder.forEach((input, index) => {
|
|
980
|
+
var _a, _b, _c, _d;
|
|
766
981
|
input.classList.add(this.FIT_TO_VALUE);
|
|
767
|
-
|
|
768
|
-
input.
|
|
982
|
+
let timeValue = timeParts[index] || "";
|
|
983
|
+
if (input === this.millisecondInputEl && this.isSSSFormat()) {
|
|
984
|
+
timeValue = timeValue.slice(0, 3);
|
|
985
|
+
}
|
|
986
|
+
else {
|
|
987
|
+
timeValue = timeValue.slice(0, 2);
|
|
988
|
+
}
|
|
989
|
+
if (input === this.hourInputEl) {
|
|
990
|
+
let activeToggle;
|
|
991
|
+
if (this.timePeriod === "12" && this.showAmPmToggle) {
|
|
992
|
+
if (parseInt(timeValue) > 12) {
|
|
993
|
+
timeValue = (parseInt(timeValue) - 12)
|
|
994
|
+
.toString()
|
|
995
|
+
.padStart(2, "0");
|
|
996
|
+
if (parseInt(timeValue) > 12) {
|
|
997
|
+
return;
|
|
998
|
+
}
|
|
999
|
+
else {
|
|
1000
|
+
this.period = "PM";
|
|
1001
|
+
(_a = this.periodToggleEl) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.TOGGLE_BUTTON_SELECTOR).forEach((btn) => {
|
|
1002
|
+
const toggleBtn = btn;
|
|
1003
|
+
if (toggleBtn.label === "PM") {
|
|
1004
|
+
activeToggle = toggleBtn;
|
|
1005
|
+
}
|
|
1006
|
+
else {
|
|
1007
|
+
toggleBtn.checked = false;
|
|
1008
|
+
}
|
|
1009
|
+
});
|
|
1010
|
+
if (activeToggle) {
|
|
1011
|
+
(_b = this.periodToggleEl) === null || _b === void 0 ? void 0 : _b.setActiveToggle(activeToggle);
|
|
1012
|
+
activeToggle.checked = true;
|
|
1013
|
+
}
|
|
1014
|
+
this.invalidTimeText = "";
|
|
1015
|
+
this.validationStatus = "";
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
else {
|
|
1019
|
+
if (parseInt(timeValue) === 0) {
|
|
1020
|
+
timeValue = "12";
|
|
1021
|
+
}
|
|
1022
|
+
this.period = "AM";
|
|
1023
|
+
(_c = this.periodToggleEl) === null || _c === void 0 ? void 0 : _c.querySelectorAll(this.TOGGLE_BUTTON_SELECTOR).forEach((btn) => {
|
|
1024
|
+
const toggleBtn = btn;
|
|
1025
|
+
if (toggleBtn.label === "AM") {
|
|
1026
|
+
activeToggle = toggleBtn;
|
|
1027
|
+
}
|
|
1028
|
+
else {
|
|
1029
|
+
toggleBtn.checked = false;
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
if (activeToggle) {
|
|
1033
|
+
(_d = this.periodToggleEl) === null || _d === void 0 ? void 0 : _d.setActiveToggle(activeToggle);
|
|
1034
|
+
activeToggle.checked = true;
|
|
1035
|
+
}
|
|
1036
|
+
this.invalidTimeText = "";
|
|
1037
|
+
this.validationStatus = "";
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
input.value = timeValue;
|
|
769
1042
|
this.setInputValue(input);
|
|
770
1043
|
this.autocompleteInput(input);
|
|
771
1044
|
});
|
|
772
|
-
if (this.isHHMMFormat() &&
|
|
1045
|
+
if (this.isHHMMFormat() &&
|
|
1046
|
+
this.second !== "" &&
|
|
1047
|
+
this.millisecond !== "") {
|
|
773
1048
|
this.second = "";
|
|
1049
|
+
this.millisecond = "";
|
|
774
1050
|
}
|
|
775
1051
|
}
|
|
776
1052
|
else {
|
|
@@ -785,14 +1061,22 @@ const TimeInput = class {
|
|
|
785
1061
|
}
|
|
786
1062
|
}
|
|
787
1063
|
};
|
|
1064
|
+
this.handleAMPM = (selectedOption) => {
|
|
1065
|
+
var _a;
|
|
1066
|
+
this.period = selectedOption.label;
|
|
1067
|
+
(_a = this.periodToggleEl) === null || _a === void 0 ? void 0 : _a.setActiveToggle(selectedOption);
|
|
1068
|
+
};
|
|
788
1069
|
}
|
|
789
1070
|
watchInputHandler() {
|
|
790
1071
|
if (this.emitTimePartChange &&
|
|
791
1072
|
!this.externalSetTime &&
|
|
792
1073
|
!this.clearInput &&
|
|
793
|
-
!(this.hour &&
|
|
1074
|
+
!(this.hour &&
|
|
1075
|
+
this.minute &&
|
|
1076
|
+
this.second &&
|
|
1077
|
+
(this.isSSSFormat() ? this.millisecond : true)) &&
|
|
794
1078
|
this.selectedTime === null) {
|
|
795
|
-
this.
|
|
1079
|
+
this.emitIcTimeChange(this.selectedTime);
|
|
796
1080
|
}
|
|
797
1081
|
}
|
|
798
1082
|
watchDisabledHandler() {
|
|
@@ -803,10 +1087,10 @@ const TimeInput = class {
|
|
|
803
1087
|
this.helperText = this.defaultHelperText;
|
|
804
1088
|
}
|
|
805
1089
|
watchMaxHandler() {
|
|
806
|
-
this.maxTime =
|
|
1090
|
+
this.maxTime = parseTimeHelper(this.max).date;
|
|
807
1091
|
}
|
|
808
1092
|
watchMinHandler() {
|
|
809
|
-
this.minTime =
|
|
1093
|
+
this.minTime = parseTimeHelper(this.min).date;
|
|
810
1094
|
}
|
|
811
1095
|
watchRequiredHandler() {
|
|
812
1096
|
var _a, _b;
|
|
@@ -855,7 +1139,7 @@ const TimeInput = class {
|
|
|
855
1139
|
input.classList.add(this.FIT_TO_VALUE);
|
|
856
1140
|
});
|
|
857
1141
|
}
|
|
858
|
-
this.setAriaInvalid(this.isValidHour, this.isValidMinute, this.isValidSecond);
|
|
1142
|
+
this.setAriaInvalid(this.isValidHour, this.isValidMinute, this.isValidSecond, this.isValidMillisecond);
|
|
859
1143
|
if (this.value) {
|
|
860
1144
|
this.notifyScreenReaderSelectedTime();
|
|
861
1145
|
}
|
|
@@ -869,7 +1153,7 @@ const TimeInput = class {
|
|
|
869
1153
|
componentWillUpdate() {
|
|
870
1154
|
if (!this.isTimeSetFromKeyboardEvent)
|
|
871
1155
|
this.setTime(this.value);
|
|
872
|
-
this.setAriaInvalid(this.isValidHour, this.isValidMinute, this.isValidSecond);
|
|
1156
|
+
this.setAriaInvalid(this.isValidHour, this.isValidMinute, this.isValidSecond, this.isValidMillisecond);
|
|
873
1157
|
this.handleTimeChange(false);
|
|
874
1158
|
this.isTimeSetFromKeyboardEvent = false;
|
|
875
1159
|
}
|
|
@@ -888,12 +1172,12 @@ const TimeInput = class {
|
|
|
888
1172
|
return this.selectedTime;
|
|
889
1173
|
}
|
|
890
1174
|
/**
|
|
891
|
-
* @internal Used to enable other components to invoke an
|
|
1175
|
+
* @internal Used to enable other components to invoke an icTimeChange event from the input.
|
|
892
1176
|
*/
|
|
893
|
-
async
|
|
1177
|
+
async triggerIcTimeChange(t) {
|
|
894
1178
|
this.externalSetTime = true;
|
|
895
1179
|
this.setTime(t);
|
|
896
|
-
this.
|
|
1180
|
+
this.emitIcTimeChange(t);
|
|
897
1181
|
this.externalSetTime = false;
|
|
898
1182
|
}
|
|
899
1183
|
render() {
|
|
@@ -910,23 +1194,39 @@ const TimeInput = class {
|
|
|
910
1194
|
!(isEmptyString(this.hour) &&
|
|
911
1195
|
isEmptyString(this.minute) &&
|
|
912
1196
|
isEmptyString(this.second)));
|
|
913
|
-
|
|
1197
|
+
if (this.showAmPmToggle && this.timePeriod !== "12") {
|
|
1198
|
+
this.showAmPmToggle = false;
|
|
1199
|
+
}
|
|
1200
|
+
return (h(Host, { key: 'd005982324084fad9fdfe6392cf879e15709d2ef', class: {
|
|
914
1201
|
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
915
1202
|
[`ic-time-input-disabled`]: disabled,
|
|
916
1203
|
[`ic-time-input-${size}`]: true,
|
|
917
|
-
}, onBlur: this.handleHostBlur, onFocus: this.handleHostFocus }, h("ic-input-container", { key: '
|
|
1204
|
+
}, onBlur: this.handleHostBlur, onFocus: this.handleHostFocus }, h("ic-input-container", { key: '6fcc48d72a92ef2a0acf3f6b109e29b24c6608db', disabled: disabled }, !(hideLabel && hideHelperText) && (h("ic-input-label", { key: '84364f527bbfeffed22d95df1ce879bb9cb55fde', for: inputId, label: label, hideLabel: hideLabel, helperText: !hideHelperText ? helperText : "", disabled: disabled }, h("slot", { key: '4a993ddc9a3923e4fbe58f4abfd1d6f51ef63494', name: "helper-text", slot: "helper-text" }))), h("span", { key: 'de2889971bef74376661a3fb0963c9bc88673e12', id: this.screenReaderInfoId, class: "sr-only", "aria-hidden": "true" }, this.getScreenReaderInfo(validationStatus), hideLabel && `${label}\n`, hideHelperText && `${helperText}\n`, `${this.defaultHelperText}.`), h("span", { key: 'b68b686d6794d6ad1247f18c867b1652066b48da', id: this.assistiveHintId, class: "sr-only", "aria-hidden": "true" }, assistiveHint), h("span", { key: '56557e76da321f937be614926cd3f41b4c9a09a8', id: "live-region", "aria-live": "assertive", class: "sr-only" }), h("div", { key: '89cbb13ffe21d66fd82a28ad6b5b295cf68c5787', class: {
|
|
1205
|
+
"with-am-pm-toggle": this.showAmPmToggle === true,
|
|
1206
|
+
} }, h("ic-input-component-container", { key: '03a61c8d72f43d68f81069327aa31b632bfee74d', id: inputId, ref: (el) => (this.inputCompContainerEl = el), disabled: disabled, validationStatus: validationStatus, size: size, role: "group", class: { [`ic-theme-${theme}`]: theme !== "inherit" } }, h("div", { key: '0fdf9d4191272a8b53e73d6230e10750032d5279', class: "input-container" }, h("div", { key: 'c7b13f330ec67b48e817f4b87fff96ad6ad6102e', class: "time-inputs" }, [
|
|
918
1207
|
this.getInputsInOrder()[0],
|
|
919
1208
|
":",
|
|
920
1209
|
this.getInputsInOrder()[1],
|
|
921
1210
|
!this.isHHMMFormat()
|
|
922
1211
|
? [":", this.getInputsInOrder()[2]]
|
|
923
1212
|
: null,
|
|
924
|
-
|
|
1213
|
+
this.isSSSFormat()
|
|
1214
|
+
? [".", this.getInputsInOrder()[3]]
|
|
1215
|
+
: null,
|
|
1216
|
+
]), h("div", { key: 'caf4926b8008875a111f6bb3aa0815cfb2e10768', class: "action-buttons" }, showClearButton && (h("ic-button", { key: '9883c16dc3d60c6ea4d9d3cc3e4a770479339879', id: "clear-button", "aria-label": "Clear input", class: {
|
|
925
1217
|
["clear-button"]: true,
|
|
926
1218
|
["hidden"]: isEmptyString(this.hour) &&
|
|
927
1219
|
isEmptyString(this.minute) &&
|
|
928
1220
|
isEmptyString(this.second),
|
|
929
|
-
}, disabled: this.disabled, innerHTML: Clear, onClick: this.handleClear, onFocus: this.handleClearFocus, onBlur: this.handleClearBlur, variant: "icon-tertiary", theme: this.clearButtonFocused ? "light" : "dark", size: size })), showClockButton && (h("div", { key: '
|
|
1221
|
+
}, disabled: this.disabled, innerHTML: Clear, onClick: this.handleClear, onFocus: this.handleClearFocus, onBlur: this.handleClearBlur, variant: "icon-tertiary", theme: this.clearButtonFocused ? "light" : "dark", size: size })), showClockButton && (h("div", { key: '9ace5895419381c300bbdc5c8ef2eeacad05b63b', class: "show-clock-button-wrapper" }, h("div", { key: 'dfa2a5bbf9e7bd74353d7caf3514861d545d6026', class: { divider: showDivider, [size]: true } }), h("ic-button", { key: '1c36dcf4f02a323aafeb265126e2d1334df077b2', id: "clock-button", "aria-label": "Display clock", "aria-haspopup": "dialog", class: "clock-button", disabled: this.disabled, innerHTML: Clock, variant: "icon-tertiary", size: size, onFocus: this.handleClockFocus, onBlur: this.handleClockBlur, theme: this.clockFocused ? "light" : "dark" })))))), this.showAmPmToggle && (h("ic-toggle-button-group", { key: 'c63749fddcc1b7ed3c394a17a5d1a65aa322f024', "select-type": "single", "accessible-label": "AM PM Toggle", ref: (el) => (this.periodToggleEl = el), disabled: disabled, class: "am-pm-toggle", "select-method": "auto", onIcChange: (e) => this.handleAMPM(e.detail.selectedOption), onKeyDown: (e) => {
|
|
1222
|
+
if (e.key === "Tab" && e.shiftKey) {
|
|
1223
|
+
e.preventDefault();
|
|
1224
|
+
if (this.inputsInOrder && this.inputsInOrder.length > 0) {
|
|
1225
|
+
const lastInput = this.inputsInOrder[this.inputsInOrder.length - 1];
|
|
1226
|
+
lastInput === null || lastInput === void 0 ? void 0 : lastInput.focus();
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
} }, h("ic-toggle-button", { key: 'fc731674e7c26846a969768ddc77b94b14c6cca6', label: "AM", disabled: disabled, checked: true }), h("ic-toggle-button", { key: '89e0bd48a39a8e786fcac5e034358edd560f4136', label: "PM", disabled: disabled })))), h("span", { key: '52854ea1dc4a1c4e7783914ff90bf204848a2e6e', id: this.selectedTimeInfoId, class: "sr-only", "aria-live": "polite" }, h("span", { key: '065c89020778df53ae78d037ef62feb189b7fdba', ref: (el) => (this.selectedTimeInfoEl = el), role: "status" })), h("ic-input-validation", { key: 'fc2500bef0e8e077272424a46663a85509a160c3', status: validationStatus, message: hasCustomValidation ? this.validationText : this.invalidTimeText, for: inputId, ariaLiveMode: validationAriaLive }))));
|
|
930
1230
|
}
|
|
931
1231
|
static get delegatesFocus() { return true; }
|
|
932
1232
|
get el() { return getElement(this); }
|
|
@@ -934,6 +1234,8 @@ const TimeInput = class {
|
|
|
934
1234
|
"hour": ["watchInputHandler"],
|
|
935
1235
|
"minute": ["watchInputHandler"],
|
|
936
1236
|
"second": ["watchInputHandler"],
|
|
1237
|
+
"millisecond": ["watchInputHandler"],
|
|
1238
|
+
"period": ["watchInputHandler"],
|
|
937
1239
|
"disabled": ["watchDisabledHandler"],
|
|
938
1240
|
"helperText": ["watchHelperTextHandler"],
|
|
939
1241
|
"max": ["watchMaxHandler"],
|