@ukic/canary-web-components 2.0.0-canary.13 → 2.0.0-canary.15
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{helpers-6acbb97e.js → helpers-191dca49.js} +56 -89
- package/dist/cjs/helpers-191dca49.js.map +1 -0
- package/dist/cjs/{helpers-f75cf7cf.js → helpers-765a5118.js} +30 -1
- package/dist/cjs/helpers-765a5118.js.map +1 -0
- package/dist/cjs/ic-accordion-group.cjs.entry.js +3 -1
- package/dist/cjs/ic-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +1 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js +15 -9
- package/dist/cjs/ic-back-to-top.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-badge.cjs.entry.js +55 -84
- package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +3 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +35 -86
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card.cjs.entry.js +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +23 -16
- package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +32 -30
- package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-chip.cjs.entry.js +34 -21
- package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-table-title-bar.cjs.entry.js +57 -0
- package/dist/cjs/ic-data-table-title-bar.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-data-table.cjs.entry.js +154 -31
- package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-input.cjs.entry.js +6 -6
- package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +1 -1
- package/dist/cjs/ic-empty-state_2.cjs.entry.js +322 -0
- package/dist/cjs/ic-empty-state_2.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
- package/dist/cjs/ic-input-component-container_4.cjs.entry.js +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +34 -16
- package/dist/cjs/ic-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/ic-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-with-multi.cjs.entry.js +176 -35
- package/dist/cjs/ic-menu-with-multi.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu.cjs.entry.js +3 -3
- package/dist/cjs/ic-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +26 -5
- package/dist/cjs/ic-navigation-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination_4.cjs.entry.js +58 -17
- package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +3 -2
- package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +40 -26
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +9 -4
- package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
- package/dist/cjs/ic-select-with-multi.cjs.entry.js +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
- package/dist/cjs/ic-step.cjs.entry.js +5 -2
- package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +2 -1
- package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab.cjs.entry.js +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +13 -22
- package/dist/cjs/ic-theme.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +1 -1
- package/dist/cjs/ic-toggle-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ic-typography.cjs.entry.js +2 -2
- package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
- package/dist/cjs/index-4cf27b16.js +8 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ic-data-table/ic-data-table.css +76 -1
- package/dist/collection/components/ic-data-table/ic-data-table.js +368 -43
- package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
- package/dist/collection/components/ic-data-table/ic-data-table.types.js.map +1 -1
- package/dist/collection/components/ic-data-table/story-data.js +258 -0
- package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
- package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js +320 -1
- package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js.map +1 -1
- package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.css +91 -0
- package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.js +160 -0
- package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.js.map +1 -0
- package/dist/collection/components/ic-data-table-title-bar/test/a11y/ic-data-table-title-bar.test.a11y.js +11 -0
- package/dist/collection/components/ic-data-table-title-bar/test/a11y/ic-data-table-title-bar.test.a11y.js.map +1 -0
- package/dist/collection/components/ic-data-table-title-bar/test/basic/ic-data-table-title-bar.spec.js +70 -0
- package/dist/collection/components/ic-data-table-title-bar/test/basic/ic-data-table-title-bar.spec.js.map +1 -0
- package/dist/collection/components/ic-date-input/ic-date-input.css +1 -1
- package/dist/collection/components/ic-date-input/ic-date-input.js +4 -4
- package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -1
- package/dist/collection/components/ic-menu-with-multi/ic-menu.js +176 -35
- package/dist/collection/components/ic-menu-with-multi/ic-menu.js.map +1 -1
- package/dist/collection/components/ic-menu-with-multi/test/basic/ic-menu.spec.js +180 -3
- package/dist/collection/components/ic-menu-with-multi/test/basic/ic-menu.spec.js.map +1 -1
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +145 -116
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -1
- package/dist/collection/components/ic-pagination-bar/test/basic/ic-pagination-bar.spec.js +47 -10
- package/dist/collection/components/ic-pagination-bar/test/basic/ic-pagination-bar.spec.js.map +1 -1
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/components/helpers.js +55 -87
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/helpers2.js +28 -1
- package/dist/components/helpers2.js.map +1 -1
- package/dist/components/ic-accordion-group.js +2 -1
- package/dist/components/ic-accordion-group.js.map +1 -1
- package/dist/components/ic-back-to-top.js +22 -9
- package/dist/components/ic-back-to-top.js.map +1 -1
- package/dist/components/ic-badge.js +59 -84
- package/dist/components/ic-badge.js.map +1 -1
- package/dist/components/ic-breadcrumb-group.js +2 -0
- package/dist/components/ic-breadcrumb-group.js.map +1 -1
- package/dist/components/ic-button2.js +33 -84
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-card.js +1 -1
- package/dist/components/ic-checkbox-group.js +27 -17
- package/dist/components/ic-checkbox-group.js.map +1 -1
- package/dist/components/ic-checkbox.js +32 -30
- package/dist/components/ic-checkbox.js.map +1 -1
- package/dist/components/ic-chip.js +39 -23
- package/dist/components/ic-chip.js.map +1 -1
- package/dist/components/ic-data-table-title-bar.d.ts +11 -0
- package/dist/components/ic-data-table-title-bar.js +136 -0
- package/dist/components/ic-data-table-title-bar.js.map +1 -0
- package/dist/components/ic-data-table.js +179 -37
- package/dist/components/ic-data-table.js.map +1 -1
- package/dist/components/ic-date-input2.js +6 -6
- package/dist/components/ic-date-input2.js.map +1 -1
- package/dist/components/ic-date-picker.js +1 -1
- package/dist/components/ic-divider2.js +1 -1
- package/dist/components/ic-empty-state.js +1 -57
- package/dist/components/ic-empty-state.js.map +1 -1
- package/dist/{esm/ic-empty-state.entry.js → components/ic-empty-state2.js} +38 -11
- package/dist/components/ic-empty-state2.js.map +1 -0
- package/dist/components/ic-footer-link-group.js +1 -1
- package/dist/components/ic-footer-link.js +1 -1
- package/dist/components/ic-footer.js +1 -1
- package/dist/components/ic-hero.js +1 -1
- package/dist/components/ic-horizontal-scroll2.js +1 -1
- package/dist/components/ic-link2.js +35 -17
- package/dist/components/ic-link2.js.map +1 -1
- package/dist/components/ic-loading-indicator2.js +1 -1
- package/dist/components/ic-loading-indicator2.js.map +1 -1
- package/dist/components/ic-menu-item2.js +2 -2
- package/dist/components/ic-menu-item2.js.map +1 -1
- package/dist/components/ic-menu2.js +2 -2
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-menu3.js +177 -36
- package/dist/components/ic-menu3.js.map +1 -1
- package/dist/components/ic-navigation-button.js +27 -6
- package/dist/components/ic-navigation-button.js.map +1 -1
- package/dist/components/ic-navigation-group.js +1 -1
- package/dist/components/ic-navigation-item.js +1 -1
- package/dist/components/ic-navigation-menu2.js +1 -1
- package/dist/components/ic-pagination-bar2.js +126 -99
- package/dist/components/ic-pagination-bar2.js.map +1 -1
- package/dist/components/ic-pagination-item2.js +2 -2
- package/dist/components/ic-pagination-item2.js.map +1 -1
- package/dist/components/ic-pagination2.js +1 -1
- package/dist/components/ic-popover-menu.js +3 -2
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js +40 -26
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js +11 -5
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-search-bar.js +1 -1
- package/dist/components/ic-select-with-multi.js +1 -1
- package/dist/components/ic-select2.js +33 -11
- package/dist/components/ic-select2.js.map +1 -1
- package/dist/components/ic-side-navigation.js +1 -1
- package/dist/components/ic-step.js +4 -1
- package/dist/components/ic-step.js.map +1 -1
- package/dist/components/ic-stepper.js +3 -1
- package/dist/components/ic-stepper.js.map +1 -1
- package/dist/components/ic-switch.js +1 -1
- package/dist/components/ic-tab.js +1 -1
- package/dist/components/ic-text-field2.js +27 -8
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-theme.js +13 -22
- package/dist/components/ic-theme.js.map +1 -1
- package/dist/components/ic-toast.js +1 -1
- package/dist/components/ic-toggle-button.js +1 -1
- package/dist/components/ic-tooltip2.js +1 -1
- package/dist/components/ic-tooltip2.js.map +1 -1
- package/dist/components/ic-top-navigation.js +1 -1
- package/dist/components/ic-typography2.js +1 -1
- package/dist/components/ic-typography2.js.map +1 -1
- package/dist/core/core.css +2 -2
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-b3d21d06.entry.js → p-005e83b0.entry.js} +2 -2
- package/dist/core/{p-b8a3b16d.entry.js → p-05df3901.entry.js} +2 -2
- package/dist/core/{p-3d0185a4.entry.js → p-0646ef0c.entry.js} +2 -2
- package/dist/core/p-0ec09955.entry.js +2 -0
- package/dist/core/p-0ec09955.entry.js.map +1 -0
- package/dist/core/p-114bea92.entry.js +2 -0
- package/dist/core/p-114bea92.entry.js.map +1 -0
- package/dist/core/p-11bbb09c.js +2 -0
- package/dist/core/p-11bbb09c.js.map +1 -0
- package/dist/core/p-11e736a3.entry.js +2 -0
- package/dist/core/p-11e736a3.entry.js.map +1 -0
- package/dist/core/{p-e0e26834.entry.js → p-16c82b13.entry.js} +2 -2
- package/dist/core/{p-094a0455.entry.js → p-1b35b6af.entry.js} +2 -2
- package/dist/core/p-1cf8a04e.entry.js +2 -0
- package/dist/core/p-1cf8a04e.entry.js.map +1 -0
- package/dist/core/{p-849f43c3.entry.js → p-2170f59e.entry.js} +2 -2
- package/dist/core/p-2e167ebb.entry.js +2 -0
- package/dist/core/p-2e167ebb.entry.js.map +1 -0
- package/dist/core/p-3f20608d.entry.js +2 -0
- package/dist/core/p-3f20608d.entry.js.map +1 -0
- package/dist/core/p-41606de1.entry.js +2 -0
- package/dist/core/p-41606de1.entry.js.map +1 -0
- package/dist/core/{p-8b1d128c.entry.js → p-4415c93f.entry.js} +2 -2
- package/dist/core/{p-6b68ee01.entry.js → p-457dd939.entry.js} +2 -2
- package/dist/core/p-457dd939.entry.js.map +1 -0
- package/dist/core/{p-04f46dac.entry.js → p-4737844f.entry.js} +2 -2
- package/dist/core/p-4737844f.entry.js.map +1 -0
- package/dist/core/{p-8ef85b15.entry.js → p-53374a27.entry.js} +2 -2
- package/dist/core/{p-7c8f85fd.entry.js → p-53e45d51.entry.js} +2 -2
- package/dist/core/{p-0707f2fc.entry.js → p-593f0318.entry.js} +2 -2
- package/dist/core/{p-aabab75f.entry.js → p-5d5979fa.entry.js} +2 -2
- package/dist/core/{p-c7b52046.entry.js → p-66af5958.entry.js} +2 -2
- package/dist/core/p-67b0faac.entry.js +2 -0
- package/dist/core/p-67b0faac.entry.js.map +1 -0
- package/dist/core/p-6b277e09.entry.js +2 -0
- package/dist/core/p-6b277e09.entry.js.map +1 -0
- package/dist/core/{p-2ec33c00.entry.js → p-72cea8fd.entry.js} +2 -2
- package/dist/core/p-73dad5cf.entry.js +2 -0
- package/dist/core/p-73dad5cf.entry.js.map +1 -0
- package/dist/core/{p-05d0ac42.entry.js → p-85e2a9af.entry.js} +2 -2
- package/dist/core/p-85e2a9af.entry.js.map +1 -0
- package/dist/core/{p-bbcd6d06.entry.js → p-872c3555.entry.js} +2 -2
- package/dist/core/{p-dae1779d.entry.js → p-87743c4a.entry.js} +2 -2
- package/dist/core/{p-55d819a6.entry.js → p-8cfc74da.entry.js} +2 -2
- package/dist/core/{p-bf316546.entry.js → p-9729086f.entry.js} +2 -2
- package/dist/core/{p-f4965c26.entry.js → p-9cc19e91.entry.js} +2 -2
- package/dist/core/{p-da578abf.entry.js → p-9de20265.entry.js} +2 -2
- package/dist/core/p-a088373e.entry.js +2 -0
- package/dist/core/p-a088373e.entry.js.map +1 -0
- package/dist/core/{p-169dcfdd.entry.js → p-a0e42564.entry.js} +2 -2
- package/dist/core/p-a8110c27.entry.js +2 -0
- package/dist/core/p-a8110c27.entry.js.map +1 -0
- package/dist/core/{p-f9fcdd21.entry.js → p-a9d07792.entry.js} +2 -2
- package/dist/core/p-a9d07792.entry.js.map +1 -0
- package/dist/core/{p-66b8f0a7.entry.js → p-b08f4371.entry.js} +2 -2
- package/dist/core/{p-a9ed6a71.entry.js → p-b79c0631.entry.js} +2 -2
- package/dist/core/p-b79c0631.entry.js.map +1 -0
- package/dist/core/p-b8247636.entry.js +2 -0
- package/dist/core/p-b8247636.entry.js.map +1 -0
- package/dist/core/{p-fdd8f3a5.entry.js → p-badfdf2a.entry.js} +2 -2
- package/dist/core/p-be56fa17.entry.js +2 -0
- package/dist/core/{p-31800427.entry.js.map → p-be56fa17.entry.js.map} +1 -1
- package/dist/core/{p-ed7379e3.entry.js → p-bebf535f.entry.js} +2 -2
- package/dist/core/p-c07cef0e.js +2 -0
- package/dist/core/p-c07cef0e.js.map +1 -0
- package/dist/core/p-c0d88af8.entry.js +2 -0
- package/dist/core/p-c0d88af8.entry.js.map +1 -0
- package/dist/core/p-c3af5dab.entry.js +2 -0
- package/dist/core/p-c3af5dab.entry.js.map +1 -0
- package/dist/core/{p-981b6f12.entry.js → p-c3dabce4.entry.js} +2 -2
- package/dist/core/{p-bcfbd465.entry.js → p-c7e932b5.entry.js} +2 -2
- package/dist/core/{p-1a4bce88.entry.js → p-d09aaa5b.entry.js} +2 -2
- package/dist/core/{p-3f4c408a.entry.js → p-d59a72a9.entry.js} +2 -2
- package/dist/core/p-d59a72a9.entry.js.map +1 -0
- package/dist/core/{p-1170c02d.entry.js → p-d71e9cb5.entry.js} +2 -2
- package/dist/core/{p-b612d68b.entry.js → p-ecd6d123.entry.js} +2 -2
- package/dist/core/p-ecd6d123.entry.js.map +1 -0
- package/dist/core/p-ee52a11a.entry.js +2 -0
- package/dist/core/p-ee52a11a.entry.js.map +1 -0
- package/dist/core/p-f11597df.entry.js +2 -0
- package/dist/core/p-f11597df.entry.js.map +1 -0
- package/dist/core/p-f1f3acd2.entry.js +2 -0
- package/dist/core/p-f1f3acd2.entry.js.map +1 -0
- package/dist/core/{p-e676069e.entry.js → p-f659e5eb.entry.js} +2 -2
- package/dist/core/{p-ffa94639.entry.js → p-fc2551c0.entry.js} +2 -2
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-f328a7b6.js → helpers-8df79303.js} +29 -2
- package/dist/esm/helpers-8df79303.js.map +1 -0
- package/dist/esm/{helpers-451953f9.js → helpers-da05c476.js} +56 -88
- package/dist/esm/helpers-da05c476.js.map +1 -0
- package/dist/esm/ic-accordion-group.entry.js +3 -1
- package/dist/esm/ic-accordion-group.entry.js.map +1 -1
- package/dist/esm/ic-accordion.entry.js +1 -1
- package/dist/esm/ic-alert.entry.js +1 -1
- package/dist/esm/ic-back-to-top.entry.js +15 -9
- package/dist/esm/ic-back-to-top.entry.js.map +1 -1
- package/dist/esm/ic-badge.entry.js +55 -84
- package/dist/esm/ic-badge.entry.js.map +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +3 -1
- package/dist/esm/ic-breadcrumb-group.entry.js.map +1 -1
- package/dist/esm/ic-breadcrumb.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js +35 -86
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card.entry.js +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +23 -16
- package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
- package/dist/esm/ic-checkbox.entry.js +32 -30
- package/dist/esm/ic-checkbox.entry.js.map +1 -1
- package/dist/esm/ic-chip.entry.js +34 -21
- package/dist/esm/ic-chip.entry.js.map +1 -1
- package/dist/esm/ic-data-row.entry.js +1 -1
- package/dist/esm/ic-data-table-title-bar.entry.js +53 -0
- package/dist/esm/ic-data-table-title-bar.entry.js.map +1 -0
- package/dist/esm/ic-data-table.entry.js +155 -32
- package/dist/esm/ic-data-table.entry.js.map +1 -1
- package/dist/esm/ic-date-input.entry.js +6 -6
- package/dist/esm/ic-date-input.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-empty-state_2.entry.js +317 -0
- package/dist/esm/ic-empty-state_2.entry.js.map +1 -0
- 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 +35 -17
- package/dist/esm/ic-link.entry.js.map +1 -1
- package/dist/esm/ic-menu-group.entry.js +1 -1
- package/dist/esm/ic-menu-item.entry.js +2 -2
- package/dist/esm/ic-menu-item.entry.js.map +1 -1
- package/dist/esm/ic-menu-with-multi.entry.js +176 -35
- package/dist/esm/ic-menu-with-multi.entry.js.map +1 -1
- package/dist/esm/ic-menu.entry.js +3 -3
- package/dist/esm/ic-menu.entry.js.map +1 -1
- package/dist/esm/ic-navigation-button.entry.js +27 -6
- package/dist/esm/ic-navigation-button.entry.js.map +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 +59 -18
- package/dist/esm/ic-pagination_4.entry.js.map +1 -1
- package/dist/esm/ic-popover-menu.entry.js +3 -2
- package/dist/esm/ic-popover-menu.entry.js.map +1 -1
- package/dist/esm/ic-radio-group.entry.js +40 -26
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/ic-radio-option.entry.js +9 -4
- package/dist/esm/ic-radio-option.entry.js.map +1 -1
- package/dist/esm/ic-search-bar.entry.js +1 -1
- package/dist/esm/ic-select-with-multi.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 +5 -2
- package/dist/esm/ic-step.entry.js.map +1 -1
- package/dist/esm/ic-stepper.entry.js +2 -1
- package/dist/esm/ic-stepper.entry.js.map +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-panel.entry.js +1 -1
- package/dist/esm/ic-tab.entry.js +1 -1
- package/dist/esm/ic-theme.entry.js +13 -22
- package/dist/esm/ic-theme.entry.js.map +1 -1
- package/dist/esm/ic-toast.entry.js +1 -1
- package/dist/esm/ic-toggle-button.entry.js +1 -1
- package/dist/esm/ic-top-navigation.entry.js +1 -1
- package/dist/esm/ic-typography.entry.js +2 -2
- package/dist/esm/ic-typography.entry.js.map +1 -1
- package/dist/esm/index-93509377.js +8 -8
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-data-table/ic-data-table.d.ts +79 -3
- package/dist/types/components/ic-data-table/ic-data-table.types.d.ts +9 -0
- package/dist/types/components/ic-data-table/story-data.d.ts +59 -0
- package/dist/types/components/ic-data-table-title-bar/ic-data-table-title-bar.d.ts +36 -0
- package/dist/types/components/ic-data-table-title-bar/test/a11y/ic-data-table-title-bar.test.a11y.d.ts +1 -0
- package/dist/types/components/ic-menu-with-multi/ic-menu.d.ts +10 -0
- package/dist/types/components/ic-pagination-bar/ic-pagination-bar.d.ts +24 -14
- package/dist/types/components.d.ts +207 -28
- package/dist/types/utils/types.d.ts +5 -5
- package/hydrate/index.js +1445 -1050
- package/package.json +3 -3
- package/dist/cjs/helpers-6acbb97e.js.map +0 -1
- package/dist/cjs/helpers-f75cf7cf.js.map +0 -1
- package/dist/cjs/ic-empty-state.cjs.entry.js +0 -38
- package/dist/cjs/ic-empty-state.cjs.entry.js.map +0 -1
- package/dist/cjs/ic-pagination-bar.cjs.entry.js +0 -269
- package/dist/cjs/ic-pagination-bar.cjs.entry.js.map +0 -1
- package/dist/collection/components/ic-pagination/ic-pagination.types.js +0 -2
- package/dist/collection/components/ic-pagination/ic-pagination.types.js.map +0 -1
- package/dist/core/p-04f46dac.entry.js.map +0 -1
- package/dist/core/p-05d0ac42.entry.js.map +0 -1
- package/dist/core/p-1c3bd46d.entry.js +0 -2
- package/dist/core/p-1c3bd46d.entry.js.map +0 -1
- package/dist/core/p-28bddd8d.entry.js +0 -2
- package/dist/core/p-28bddd8d.entry.js.map +0 -1
- package/dist/core/p-31800427.entry.js +0 -2
- package/dist/core/p-3b0caac0.js +0 -2
- package/dist/core/p-3b0caac0.js.map +0 -1
- package/dist/core/p-3f4c408a.entry.js.map +0 -1
- package/dist/core/p-4020d7f7.entry.js +0 -2
- package/dist/core/p-4020d7f7.entry.js.map +0 -1
- package/dist/core/p-402fd288.entry.js +0 -2
- package/dist/core/p-402fd288.entry.js.map +0 -1
- package/dist/core/p-49449a2d.entry.js +0 -2
- package/dist/core/p-49449a2d.entry.js.map +0 -1
- package/dist/core/p-4a30b0fc.entry.js +0 -2
- package/dist/core/p-4a30b0fc.entry.js.map +0 -1
- package/dist/core/p-4b361789.entry.js +0 -2
- package/dist/core/p-4b361789.entry.js.map +0 -1
- package/dist/core/p-50cfc2bb.entry.js +0 -2
- package/dist/core/p-50cfc2bb.entry.js.map +0 -1
- package/dist/core/p-58c87b3d.entry.js +0 -2
- package/dist/core/p-58c87b3d.entry.js.map +0 -1
- package/dist/core/p-623f911f.entry.js +0 -2
- package/dist/core/p-623f911f.entry.js.map +0 -1
- package/dist/core/p-6b68ee01.entry.js.map +0 -1
- package/dist/core/p-7d1381ef.entry.js +0 -2
- package/dist/core/p-7d1381ef.entry.js.map +0 -1
- package/dist/core/p-925da2d2.entry.js +0 -2
- package/dist/core/p-925da2d2.entry.js.map +0 -1
- package/dist/core/p-9e3178e8.entry.js +0 -2
- package/dist/core/p-9e3178e8.entry.js.map +0 -1
- package/dist/core/p-a9ed6a71.entry.js.map +0 -1
- package/dist/core/p-b612d68b.entry.js.map +0 -1
- package/dist/core/p-c51496ee.entry.js +0 -2
- package/dist/core/p-c51496ee.entry.js.map +0 -1
- package/dist/core/p-c7590421.entry.js +0 -2
- package/dist/core/p-c7590421.entry.js.map +0 -1
- package/dist/core/p-cd799087.js +0 -2
- package/dist/core/p-cd799087.js.map +0 -1
- package/dist/core/p-e189f1d0.entry.js +0 -2
- package/dist/core/p-e189f1d0.entry.js.map +0 -1
- package/dist/core/p-e30f2623.entry.js +0 -2
- package/dist/core/p-e30f2623.entry.js.map +0 -1
- package/dist/core/p-f9ee48f7.entry.js +0 -2
- package/dist/core/p-f9ee48f7.entry.js.map +0 -1
- package/dist/core/p-f9fcdd21.entry.js.map +0 -1
- package/dist/esm/helpers-451953f9.js.map +0 -1
- package/dist/esm/helpers-f328a7b6.js.map +0 -1
- package/dist/esm/ic-empty-state.entry.js.map +0 -1
- package/dist/esm/ic-pagination-bar.entry.js +0 -265
- package/dist/esm/ic-pagination-bar.entry.js.map +0 -1
- package/dist/types/components/ic-pagination/ic-pagination.types.d.ts +0 -6
- /package/dist/core/{p-b3d21d06.entry.js.map → p-005e83b0.entry.js.map} +0 -0
- /package/dist/core/{p-b8a3b16d.entry.js.map → p-05df3901.entry.js.map} +0 -0
- /package/dist/core/{p-3d0185a4.entry.js.map → p-0646ef0c.entry.js.map} +0 -0
- /package/dist/core/{p-e0e26834.entry.js.map → p-16c82b13.entry.js.map} +0 -0
- /package/dist/core/{p-094a0455.entry.js.map → p-1b35b6af.entry.js.map} +0 -0
- /package/dist/core/{p-849f43c3.entry.js.map → p-2170f59e.entry.js.map} +0 -0
- /package/dist/core/{p-8b1d128c.entry.js.map → p-4415c93f.entry.js.map} +0 -0
- /package/dist/core/{p-8ef85b15.entry.js.map → p-53374a27.entry.js.map} +0 -0
- /package/dist/core/{p-7c8f85fd.entry.js.map → p-53e45d51.entry.js.map} +0 -0
- /package/dist/core/{p-0707f2fc.entry.js.map → p-593f0318.entry.js.map} +0 -0
- /package/dist/core/{p-aabab75f.entry.js.map → p-5d5979fa.entry.js.map} +0 -0
- /package/dist/core/{p-c7b52046.entry.js.map → p-66af5958.entry.js.map} +0 -0
- /package/dist/core/{p-2ec33c00.entry.js.map → p-72cea8fd.entry.js.map} +0 -0
- /package/dist/core/{p-bbcd6d06.entry.js.map → p-872c3555.entry.js.map} +0 -0
- /package/dist/core/{p-dae1779d.entry.js.map → p-87743c4a.entry.js.map} +0 -0
- /package/dist/core/{p-55d819a6.entry.js.map → p-8cfc74da.entry.js.map} +0 -0
- /package/dist/core/{p-bf316546.entry.js.map → p-9729086f.entry.js.map} +0 -0
- /package/dist/core/{p-f4965c26.entry.js.map → p-9cc19e91.entry.js.map} +0 -0
- /package/dist/core/{p-da578abf.entry.js.map → p-9de20265.entry.js.map} +0 -0
- /package/dist/core/{p-169dcfdd.entry.js.map → p-a0e42564.entry.js.map} +0 -0
- /package/dist/core/{p-66b8f0a7.entry.js.map → p-b08f4371.entry.js.map} +0 -0
- /package/dist/core/{p-fdd8f3a5.entry.js.map → p-badfdf2a.entry.js.map} +0 -0
- /package/dist/core/{p-ed7379e3.entry.js.map → p-bebf535f.entry.js.map} +0 -0
- /package/dist/core/{p-981b6f12.entry.js.map → p-c3dabce4.entry.js.map} +0 -0
- /package/dist/core/{p-bcfbd465.entry.js.map → p-c7e932b5.entry.js.map} +0 -0
- /package/dist/core/{p-1a4bce88.entry.js.map → p-d09aaa5b.entry.js.map} +0 -0
- /package/dist/core/{p-1170c02d.entry.js.map → p-d71e9cb5.entry.js.map} +0 -0
- /package/dist/core/{p-e676069e.entry.js.map → p-f659e5eb.entry.js.map} +0 -0
- /package/dist/core/{p-ffa94639.entry.js.map → p-fc2551c0.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
|
|
1
|
-
import{h as t,r as e,c as i,H as s,g as a}from"./p-8455d1bb.js";import{d as n,g as o,a as h,y as r,b as c,c as l,e as d,f as u,h as f}from"./p-33dd24eb.js";import{s as b,I as p,a as m,b as y,o as w,c as g}from"./p-cd799087.js";const v=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.70687 6L8.29688 7.41L12.8769 12L8.29688 16.59L9.70687 18L15.7069 12L9.70687 6Z" fill="currentColor"/>\n</svg>\n`;const k=({focussed:e,today:i,day:s,monthInView:a,onFocusDay:n,onBlurDay:o,onSelectDay:h,selected:r,focussedDayRef:c,inRange:l,showDaysOutsideMonth:d,disableDay:u})=>{const f=()=>{h(s)};const y=()=>{n()};const w=()=>{o()};const g=b(p);const v=b(m);const k=!l||u;const x=a!==s.getMonth();const D=k||x&&!d;return t("div",{class:"day-button-container"},t("button",{class:{"day-button":true,"outside-month":x,"outside-range":k,hidden:x&&!d,disabled:D,today:i,selected:r,focussed:e},tabIndex:e?0:-1,"aria-hidden":x?"true":"false","aria-disabled":D?"true":"false","aria-current":i?"date":undefined,"aria-label":D||x||k?undefined:`Choose ${g[s.getDay()]}, ${s.getDate()} ${v[s.getMonth()]} ${s.getFullYear()}`,disabled:D,onClick:f,onBlur:w,onFocus:y,ref:t=>{if(e&&t&&c){c(t)}}},(!x||x&&d)&&t("ic-typography",{variant:"subtitle-small",italic:x},s.getDate())))};const x=({size:e,focussedMonth:i,monthInView:s,onSelectMonth:a,onKeyDown:r,focussedMonthRef:c,minDate:l,maxDate:d,yearInView:u})=>{const f=t=>{const e=t.target;a(Number(e.getAttribute("data-month")))};const p=b(m);return t("div",{class:{"month-picker":true},role:"list"},p.map(((a,b)=>{const p=s===b;const m=i===b;const y=!n(new Date(u,b,1),l?h(l):null,d?o(d):null);return t("ic-button",{role:"listitem",class:{"month-button":true,selected:p,focussed:m,disabled:y},"full-width":true,disabled:y,variant:p?"primary":"tertiary","data-month":b,size:e,tabIndex:m?0:-1,"aria-current":p?"true":"false","aria-label":p?"":`select ${a}`,onClick:f,onKeyDown:r,ref:t=>{if(m&&t){c(t)}}},a)})))};const D=({decadeView:e,size:i,focussedYear:s,yearInView:a,onSelectYear:n,onFocusYear:o,onBlurYear:h,onKeyDown:c,minDate:l,maxDate:d,focussedYearRef:u})=>{const f=t=>{const e=t.target;n(Number(e.getAttribute("data-year")))};const b=()=>{o()};const p=()=>{h()};const m=t=>{t.preventDefault()};const y=e[0];const w=e[11];const g=e.slice(1,11);return t("div",{class:"year-picker",role:"list"},t("div",{class:"prev-decade","aria-hidden":"true"},t("ic-button",{id:"prev-decade-button",class:{"year-button":true},disabled:!r(y,l,d),"data-year":y,tabIndex:-1,variant:"tertiary",onClick:f,onMouseDown:m,"aria-hidden":"true",size:i},`${y-9}s`,t("svg",{slot:"left-icon",width:"12",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M11.3333 5.33341H3.21996L6.94663 1.60675L5.99996 0.666748L0.666626 6.00008L5.99996 11.3334L6.93996 10.3934L3.21996 6.66675H11.3333V5.33341Z",fill:"currentColor"})))),g.map((e=>{const n=a===e;const o=s===e;return t("ic-button",{class:{"year-button":true,selected:n,focussed:o},disabled:!r(e,l,d),"data-year":e,tabIndex:o?0:-1,variant:n?"primary":"tertiary",onClick:f,"aria-label":n?"":`select ${e}`,role:"listitem","aria-current":n?"true":"false",onKeyDown:c,onFocus:b,onBlur:p,size:i,ref:t=>{if(o&&t){u(t)}}},e)})),t("div",{class:"next-decade","aria-hidden":"true"},t("ic-button",{id:"next-decade-button",class:{"year-button":true,flip:true},disabled:!r(w,l,d),"data-year":w,tabIndex:-1,variant:"tertiary",onClick:f,onMouseDown:m,"aria-hidden":"true",size:i},`${w}s`,t("svg",{slot:"right-icon",width:"12",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M11.3333 5.33341H3.21996L6.94663 1.60675L5.99996 0.666748L0.666626 6.00008L5.99996 11.3334L6.93996 10.3934L3.21996 6.66675H11.3333V5.33341Z",fill:"currentColor"})))))};const z='/*! 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{display:block;position:relative;--month-year-picker-button-width:5rem;--month-button-width:5.5rem;--input-field-width:var(--input-width, 19.125rem)}:host(.large){--month-button-width:6.3125rem;--input-field-width:var(--input-width, 21.125rem)}:host(.small){--month-button-width:6.25rem;--input-field-width:var(--input-width, 17.125rem)}:host .date-input-container{position:relative}ic-date-input{--input-width:var(--input-field-width)}:host .calendar-container{min-width:19rem;max-width:23.5rem;width:var(--input-width);display:flex;flex-direction:column;gap:var(--ic-space-xs);position:absolute;border:var(--ic-border-default);border-radius:var(--ic-border-radius);align-items:center;background-color:var(--ic-architectural-white);z-index:var(--ic-z-index-date-picker);box-sizing:border-box;box-shadow:var(--ic-elevation-overlay);margin-top:var(--ic-space-xxxs);padding:var(--ic-space-xs);animation:fade-in-calendar var(--ic-transition-duration-slow)}:host(.small) .calendar-container{min-width:17rem;max-width:21.5rem}:host(.large) .calendar-container{min-width:21rem;max-width:25.5rem}:host .calendar-container.above{bottom:calc(var(--ic-space-xxl) - var(--ic-space-xxs))}:host .month-year-nav-container{display:flex;justify-content:space-between;align-items:center;align-self:stretch}:host .month-year-nav-container.hidden{display:none}:host .month-year-nav{display:flex;justify-content:space-between;align-items:center;flex:1 0 0}:host .month-picker,:host .year-picker{flex-wrap:wrap;display:inline-flex;align-items:center;width:17.5rem;-moz-column-gap:var(--ic-space-xs);column-gap:var(--ic-space-xs);row-gap:var(--ic-space-xxs)}:host(.small) .month-picker,:host(.small) .year-picker{width:13.125rem}:host(.large) .month-picker,:host(.large) .year-picker{width:20rem}:host .month-picker-button,:host .year-picker-button{width:5rem;--min-width:5rem}:host .month-button,:host .year-button{width:var(--month-button-width)}:host .month-button.focussed,:host .year-button.focussed{z-index:1}:host .month-button::part(button),:host .year-button::part(button){min-width:var(--month-button-width)}:host .prev-decade .year-button svg{margin-right:calc(-1 * var(--ic-space-xl));padding-top:var(--ic-space-sm)}:host .prev-decade .year-button::part(button){padding-left:0;padding-right:var(--ic-space-lg)}:host(.small) .prev-decade .year-button::part(button){padding-left:0;padding-right:calc(var(--ic-space-lg) + var(--ic-space-xxs))}:host .next-decade .year-button svg{margin-left:calc(-1 * var(--ic-space-xl));padding-top:var(--ic-space-sm)}:host .next-decade .year-button::part(button){padding-right:0;padding-left:var(--ic-space-lg)}:host(.small) .next-decade .year-button::part(button),:host(.large) .next-decade .year-button::part(button){padding-left:var(--ic-space-xl)}:host .bottom-buttons{padding-top:var(--ic-space-xs);display:flex;justify-content:space-between;align-items:center;align-self:stretch;animation:fade-in-buttons var(--ic-transition-duration-slow)}:host(.small) .bottom-buttons{padding-top:var(--ic-space-xxs)}:host .bottom-buttons.no-today{align-items:flex-end;flex-direction:column}:host .bottom-buttons.hidden{display:none}:host .calendar{display:flex;flex-direction:column;align-items:flex-start;width:15.75rem;animation:fade-in-buttons var(--ic-transition-duration-slow)}:host(.large) .calendar{width:19.25rem}:host(.small) .calendar{padding-bottom:var(--ic-space-xxs);width:14rem}:host .hidden{display:none}:host .weekdays{display:flex;justify-content:space-between;align-items:flex-start;padding-bottom:var(--ic-space-xs);align-self:stretch}:host .calendar-days-container{display:flex;flex-wrap:wrap;justify-content:space-between;row-gap:var(--ic-space-xs);padding:var(--ic-space-xxs) 0}:host(.small) .calendar-days-container{padding:var(--ic-space-xxxs) 0}:host(.large) .calendar-days-container{padding:var(--ic-space-xs) 0}:host .calendar-day-header{display:flex;width:2rem;padding:var(--ic-space-xxs) 0;justify-content:center;align-items:center}:host(.small) .calendar-day-header,:host(.large) .calendar-day-header{padding:var(--ic-space-xxs)}:host .calendar-day-header ic-typography{color:var(--ic-color-tertiary-text);text-align:center}:host .day-button-container{display:flex;justify-content:center;align-items:center;width:2.25rem;height:2.25rem}:host(.small) .day-button-container{width:2rem;height:2rem}:host(.large) .day-button-container{width:2.5rem;height:2.5rem}:host .day-button{display:flex;position:relative;justify-content:center;align-items:center;border:0;border-radius:2rem;background-color:var(--ic-architectural-white);width:2rem;height:2rem;cursor:pointer;transition:var(--ic-easing-transition-fast);z-index:0}:host .day-button.disabled{cursor:default}:host(.large) .day-button{width:2.25rem;height:2.25rem}:host(.small) .day-button{width:1.75rem;height:1.75rem}:host .day-button ic-typography{width:1.75rem;color:var(--ic-color-primary-text)}:host .day-button.outside-range ic-typography{color:var(--ic-architectural-400)}:host .day-button.outside-month ic-typography{font-weight:var(--ic-font-weight-regular) !important}:host .day-button.outside-month:not(.outside-range):not(.selected) ic-typography{color:var(--ic-color-primary-text)}:host .day-button:hover:not(.disabled){background-color:var(--ic-action-dark-bg-hover)}:host .day-button:active:not(.disabled){background-color:var(--ic-action-dark-bg-active)}@media (prefers-reduced-motion: no-preference){:host .day-button:hover:not(.disabled):not(.focussed),:host .day-button:active:not(.disabled):not(.focussed){transition:background-color var(--ic-transition-duration-slow) ease-in-out}}:host .day-button.selected:not(.hidden){background-color:var(--ic-action-default)}:host .day-button.selected ic-typography{color:var(--ic-color-white-text)}:host .day-button.selected:not(.hidden):hover{background-color:var(--ic-action-default-hover)}:host .day-button.selected:not(.hidden):active{background-color:var(--ic-action-default-active)}:host .day-button.focussed{z-index:1}:host .day-button:focus{outline:none}:host .day-button.focussed:focus{box-shadow:var(--ic-border-focus)}:host .day-button.today:not(.hidden)::after{content:"";position:absolute;width:0.875rem;height:0.125rem;bottom:0.4rem;border-radius:var(--ic-border-radius);background-color:var(--ic-action-default)}:host(.small) .day-button.today::after{bottom:0.35rem}:host(.large) .day-button.today::after{width:1rem}:host .day-button.today.selected::after{background-color:var(--ic-architectural-white)}:host #select-month-hint,:host #select-year-hint{display:none}.sr-only{position:absolute;left:-9999px}@media (prefers-reduced-motion: reduce){:host .calendar-container,:host .calendar,:host .bottom-buttons{animation:none}}@keyframes fade-in-buttons{0%{opacity:0}50%{opacity:0}100%{opacity:1}}@keyframes fade-in-calendar{0%{display:flex;max-height:0}100%{display:flex;max-height:600px}}@media (forced-colors: active){:host .day-button.today:not(.hidden)::after{background-color:highlight}:host .day-button.selected:not(.hidden){background-color:highlight}:host .day-button.focussed:focus{border:var(--ic-hc-border)}:host .month-button.selected::part(button),:host .year-button.selected::part(button){background-color:highlight}}';const M="DD/MM/YYYY";const H="Dates in the future are not allowed. Please select a date in the past.";const P="Dates in the past are not allowed. Please select a date in the future.";const V="The date you have selected is on a day of the week that is not allowed. Please select another date.";const I=100;const L=360;const T=400;const C=440;const Y=class{constructor(s){e(this,s);this.icChange=i(this,"icChange",7);this.clearButtonEl=null;this.daysOfWeek=[];this.dayButtonFocussed=false;this.dayPickerKeyboardNav=false;this.dialogDescription="";this.focusDay=true;this.liveRegionEl=null;this.monthNames=[];this.monthInViewUpdateHandled=false;this.myCalendarButtonClicked=false;this.showPickerAbove=false;this.today=new Date;this.todayButtonEl=null;this.yearButtonFocussed=false;this.setDecadeView=t=>{let e=t-1;const i=[];while(e<=t+10){i.push(e);e++}this.decadeView=i;this.decadeStart=i[1];this.decadeEnd=i[10]};this.setSelectedDate=(t,e=true)=>{if(t===null||!c(t,this.selectedDate)){this.selectedDate=t;this.value=t;if(e){this.inputEl.triggerIcChange(t)}}};this.handleCalendarMouseDown=t=>{const e=t.target;if(e.tagName!=="IC-BUTTON"){t.preventDefault()}};this.handleCalendarClick=t=>{this.clearDialogDescription();t.stopImmediatePropagation()};this.handleDocumentClick=()=>{this.calendarOpen=false};this.keyDownHandler=t=>{if(t.key==="Escape"){this.closeButtonClickHandler();this.inputEl.setCalendarFocus()}else{this.clearDialogDescription()}t.stopImmediatePropagation()};this.closeButtonClickHandler=()=>{this.calendarOpen=false};this.focusFirstElement=()=>{this.monthButtonEl.setFocus()};this.focusLastElement=()=>{if(this.showPickerClearButton&&!this.clearButtonEl.disabled){this.clearButtonEl.setFocus()}else if(this.showPickerTodayButton&&!this.todayButtonEl.disabled){this.todayButtonEl.setFocus()}else if(this.monthPickerVisible){this.focussedMonthEl.setFocus()}else if(this.yearPickerVisible){this.focussedYearEl.setFocus()}else{this.focussedDayEl.focus()}};this.focusFocussedDay=()=>{this.focussedDayEl.focus()};this.monthButtonClickHandler=()=>{this.yearPickerVisible=false;this.focusDay=false;this.monthPickerVisible=!this.monthPickerVisible;if(this.monthPickerVisible){this.setAriaLiveRegionText("Month picker view open")}else{this.setMonthSelectedLiveRegionText()}};this.yearButtonClickHandler=()=>{this.monthPickerVisible=false;this.focusDay=false;this.yearPickerVisible=!this.yearPickerVisible;if(this.yearPickerVisible){this.setAriaLiveRegionText(`Year picker view open. ${this.getDecadeInViewText()}`)}else{this.setYearSelectedLiveRegionText()}};this.todayButtonClickHandler=()=>{this.yearPickerVisible=false;this.monthPickerVisible=false;this.setFocussedDate(new Date);this.setAriaLiveRegionText(this.getMonthInViewText());setTimeout((()=>this.focusFocussedDay()),I)};this.todayButtonKeyDownHandler=t=>{if(t.key==="Tab"&&!t.shiftKey&&this.clearButtonEl.disabled){this.focusFirstElement();t.preventDefault()}};this.clearButtonClickHandler=()=>{this.setSelectedDate(null);let t="Selected date cleared.";if(!this.monthPickerVisible&&!this.yearPickerVisible){t+=` ${this.getMonthInViewText()}`}if(this.monthPickerVisible){this.focussedMonthEl.setFocus()}else if(this.yearPickerVisible){this.focussedYearEl.setFocus()}else{this.focusFocussedDay()}this.setAriaLiveRegionText(t)};this.setMonthSelectedLiveRegionText=()=>{this.setAriaLiveRegionText(`${this.monthNames[this.monthInView]} selected. ${this.getMonthInViewText()}`)};this.setYearSelectedLiveRegionText=()=>{this.setAriaLiveRegionText(`${this.yearInView} selected. ${this.getMonthInViewText()}`)};this.getMonthInViewText=()=>`${this.monthNames[this.monthInView]} ${this.yearInView} currently in view.`;this.getDecadeInViewText=()=>`${this.decadeStart} to ${this.decadeEnd} currently in view.`;this.setAriaLiveRegionText=t=>{this.liveRegionEl&&(this.liveRegionEl.innerText=t)};this.clearDialogDescription=()=>{this.dialogDescription=""};this.clearButtonKeyDownHandler=t=>{if(t.key==="Tab"&&!t.shiftKey){this.focusFirstElement();t.preventDefault()}};this.goToPreviousMonth=(t=false)=>{this.focusDay=t;this.moveMonths(-1)};this.goToNextMonth=(t=false)=>{this.focusDay=t;this.moveMonths(1)};this.goToPreviousYear=(t=false)=>{if(this.isPrevYearAllowed()){this.focusDay=t;this.moveYears(-1)}};this.goToNextYear=(t=false)=>{if(this.isNextYearAllowed()){this.focusDay=t;this.moveYears(1)}};this.navButtonMouseDownHandler=t=>{t.preventDefault()};this.renderMonthYearNavButton=(e,i,s)=>{const a=this.size;return t("div",{"aria-hidden":"true"},t("ic-button",{id:e,disableTooltip:true,disabled:s,onClick:this.monthYearNavClickHandler,class:{flip:i},variant:"icon",innerHTML:v,size:a,tabIndex:-1,"aria-hidden":"true",onMouseDown:this.navButtonMouseDownHandler}))};this.monthYearNavClickHandler=t=>{const e=t.target;switch(e.id){case"previous-month-button":this.goToPreviousMonth(this.dayButtonFocussed);break;case"next-month-button":this.goToNextMonth(this.dayButtonFocussed);break;case"previous-year-button":this.goToPreviousYear(this.dayButtonFocussed);break;case"next-year-button":this.goToNextYear(this.dayButtonFocussed);break}};this.previousMonthButton=()=>{let t=false;if(this.focussedDate!==null&&this.minDate!==null){const e=this.focussedDate.getFullYear()===this.minDate.getFullYear();if(e){t=this.monthInView-1<this.minDate.getMonth()}}return this.renderMonthYearNavButton("previous-month-button",true,t)};this.nextMonthButton=()=>{let t=false;if(this.focussedDate!==null&&this.maxDate!==null){const e=this.focussedDate.getFullYear()===this.maxDate.getFullYear();if(e){t=this.monthInView+1>this.maxDate.getMonth()}}return this.renderMonthYearNavButton("next-month-button",false,t)};this.previousYearButton=()=>this.renderMonthYearNavButton("previous-year-button",true,!this.isPrevYearAllowed());this.nextYearButton=()=>this.renderMonthYearNavButton("next-year-button",false,!this.isNextYearAllowed());this.isPrevYearAllowed=()=>this.isYearAllowed(this.yearInView-1);this.isNextYearAllowed=()=>this.isYearAllowed(this.yearInView+1);this.isYearAllowed=t=>r(t,this.minDate,this.maxDate);this.getMonthView=t=>{const e=l(h(t),this.startOfWeek);const i=d(o(t),this.startOfWeek);const s=[];let a=e;while(!c(a,i)){s.push(a);a=new Date(a);a.setDate(a.getDate()+1)}s.push(a);return s};this.isCurrentMonth=()=>{const t=new Date;return t.getFullYear()===this.yearInView&&t.getMonth()===this.monthInView};this.updateMonthInView=()=>{this.currMonthView=this.getMonthView(this.focussedDate);this.focussedDay=this.focussedDate.getDate();this.monthInView=this.focussedDate.getMonth();this.yearInView=this.focussedDate.getFullYear();if(this.dayPickerKeyboardNav){this.monthInViewUpdateHandled=true;this.setAriaLiveRegionText(this.getMonthInViewText());this.dayPickerKeyboardNav=false}};this.handleSelectDay=t=>{this.setSelectedDate(t);this.calendarOpen=false;this.inputEl.setCalendarFocus()};this.handleSelectMonth=t=>{this.moveMonths(t-this.monthInView);setTimeout((()=>{this.monthButtonEl.setFocus();this.monthPickerVisible=false;this.setMonthSelectedLiveRegionText()}),I)};this.handleSelectYear=t=>{const e=this.decadeView.indexOf(t);if(e>0&&e<this.decadeView.length-1){this.moveYears(t-this.yearInView);this.focusDay=false;const e=this.monthNames[this.monthInView];this.setAriaLiveRegionText(`${t} selected. ${e} ${t} currently in view.`);setTimeout((()=>{this.yearButtonEl.setFocus();this.yearPickerVisible=false}),I)}else{const e=t-this.focussedYear>0?10:-10;this.updateFocussedYear(e,this.yearButtonFocussed);this.setAriaLiveRegionText(this.getDecadeInViewText())}};this.monthPickerKeyDownHandler=t=>{let e=true;switch(t.key){case"ArrowUp":case"ArrowLeft":this.updateFocussedMonth(-1);break;case"ArrowDown":case"ArrowRight":this.updateFocussedMonth(1);break;case"Home":this.updateFocussedMonth(-this.focussedMonth);break;case"End":this.updateFocussedMonth(11-this.focussedMonth);break;case"Tab":e=this.calendarTabHandler(t);break;case"Escape":t.stopImmediatePropagation();this.monthPickerVisible=false;setTimeout((()=>this.focusFocussedDay()),I);break;default:e=false}if(e){t.preventDefault()}};this.yearPickerKeyDownHandler=t=>{let e=true;switch(t.key){case"ArrowUp":case"ArrowLeft":this.updateFocussedYear(-1);break;case"ArrowDown":case"ArrowRight":this.updateFocussedYear(1);break;case"Home":if(this.focussedYear>this.decadeStart){this.updateFocussedYear(this.decadeStart-this.focussedYear)}break;case"End":if(this.focussedYear<this.decadeEnd){this.updateFocussedYear(this.decadeEnd-this.focussedYear)}break;case"PageUp":this.updateFocussedYear(-10);break;case"PageDown":this.updateFocussedYear(10);break;case"Tab":e=this.calendarTabHandler(t);break;case"Escape":t.stopImmediatePropagation();this.yearPickerVisible=false;setTimeout((()=>this.focusFocussedDay()),I);break;default:e=false}if(e){t.preventDefault()}};this.onYearButtonFocusHandler=()=>{this.yearButtonFocussed=true};this.onYearButtonBlurHandler=()=>{this.yearButtonFocussed=false};this.monthButtonKeyDownHandler=t=>{let e=false;switch(t.key){case"ArrowLeft":case"ArrowUp":e=true;this.goToPreviousMonth();break;case"ArrowRight":case"ArrowDown":e=true;this.goToNextMonth();break;case"Home":e=true;this.focusDay=false;this.moveMonths(-this.monthInView);break;case"End":e=true;this.focusDay=false;this.moveMonths(11-this.monthInView);break;case"Tab":if(t.shiftKey){e=true;this.focusLastElement()}break;case"Escape":if(this.monthPickerVisible){this.monthPickerVisible=false;t.stopImmediatePropagation()}break}if(e){t.preventDefault()}};this.yearButtonKeyDownHandler=t=>{let e=false;switch(t.key){case"ArrowLeft":case"ArrowUp":e=true;this.goToPreviousYear();break;case"ArrowRight":case"ArrowDown":e=true;this.goToNextYear();break;case"Home":if(this.yearPickerVisible&&this.yearInView>this.decadeStart){e=true;this.moveYears(this.decadeStart-this.yearInView)}break;case"End":if(this.yearPickerVisible&&this.yearInView<this.decadeEnd){e=true;this.moveYears(this.decadeEnd-this.focussedYear)}break;case"PageUp":e=true;this.focusDay=false;this.moveYears(-10);break;case"PageDown":e=true;this.focusDay=false;this.moveYears(10);break;case"Escape":if(this.yearPickerVisible){this.yearPickerVisible=false;t.stopImmediatePropagation()}break}if(e){t.preventDefault()}};this.handleCalendarKeyDown=t=>{let e=true;switch(t.key){case"ArrowDown":this.dayPickerKeyboardNav=true;this.moveDays(7);break;case"ArrowUp":this.dayPickerKeyboardNav=true;this.moveDays(-7);break;case"ArrowLeft":this.dayPickerKeyboardNav=true;this.moveDays(-1*this.getNextDayToFocus(this.focussedDate,false));break;case"ArrowRight":this.dayPickerKeyboardNav=true;this.moveDays(this.getNextDayToFocus(this.focussedDate,true));break;case"PageUp":this.dayPickerKeyboardNav=true;t.shiftKey?this.moveYears(-1):this.moveMonths(-1);break;case"PageDown":this.dayPickerKeyboardNav=true;t.shiftKey?this.moveYears(1):this.moveMonths(1);break;case"Home":this.dayPickerKeyboardNav=true;this.setFocussedDate(new Date(this.focussedYear,this.focussedMonth,1));break;case"End":this.dayPickerKeyboardNav=true;this.setFocussedDate(new Date(this.focussedYear,this.focussedMonth+1,0));break;case"Tab":e=this.calendarTabHandler(t);break;default:e=false;break}if(e){t.preventDefault()}};this.calendarTabHandler=t=>{let e=false;if(!t.shiftKey&&(!this.showPickerTodayButton||this.isCurrentMonth())&&(!this.showPickerClearButton||this.clearButtonEl.disabled)){this.focusFirstElement();e=true}else if(t.shiftKey){this.yearButtonEl.setFocus();e=true}return e};this.onDayButtonFocusHandler=()=>{this.dayButtonFocussed=true};this.onDayButtonBlurHandler=()=>{this.dayButtonFocussed=false};this.getNextDayToFocus=(t,e,i=1)=>{const s=e?1:-1;const a=new Date(t);a.setDate(a.getDate()+s);const n=Number(a.getDay());if(this.disableDays.includes(n)){return this.getNextDayToFocus(a,e,i+1)}else{return i}};this.moveDays=t=>{const e=new Date(this.focussedDate);e.setDate(e.getDate()+t);this.setFocussedDate(e)};this.moveMonths=t=>{const e=this.focussedDate.getMonth()+t;const i=new Date(new Date(h(this.focussedDate)).setMonth(e));const s=o(i);const a=new Date(new Date(this.focussedDate).setMonth(e));this.setFocussedDate(u(a,i,s));if(this.monthPickerVisible===false&&this.yearPickerVisible===false&&this.monthInViewUpdateHandled===false){this.setAriaLiveRegionText(this.getMonthInViewText())}this.monthInViewUpdateHandled=false};this.moveYears=t=>{const e=this.focussedDate.getFullYear()+t;const i=new Date(new Date(h(this.focussedDate)).setFullYear(e));const s=o(i);const a=new Date(new Date(this.focussedDate).setFullYear(e));this.setFocussedDate(u(a,i,s));if(this.monthPickerVisible===false&&this.yearPickerVisible===false&&this.monthInViewUpdateHandled===false){this.setAriaLiveRegionText(this.getMonthInViewText())}this.monthInViewUpdateHandled=false};this.updateFocussedMonth=t=>{const e=new Date(this.focussedYear,this.focussedMonth,1);e.setMonth(this.focussedMonth+t);const i=u(e,this.minDate,this.maxDate);this.focussedMonth=i.getMonth();setTimeout((()=>this.focussedMonthEl.setFocus()),I)};this.updateFocussedYear=(t,e=true)=>{const i=new Date((new Date).setFullYear(this.focussedYear+t));const s=u(i,this.minDate,this.maxDate);this.setFocussedYear(s.getFullYear(),e)};this.setFocussedDate=t=>{this.focussedDate=u(t,this.minDate,this.maxDate)};this.setFocussedDayEl=t=>{this.focussedDayEl=t};this.setFocussedMonthEl=t=>{this.focussedMonthEl=t};this.setFocussedYearEl=t=>{this.focussedYearEl=t};this.setFocussedYear=(t,e=true)=>{const i=this.focussedYear;this.focussedYear=t;if(this.yearPickerVisible){const s=Math.floor(t/10)*10;const a=Math.floor(i/10)*10;if(s!==a){this.setDecadeView(s);this.setAriaLiveRegionText(this.getDecadeInViewText())}if(e){setTimeout((()=>{if(this.focussedYearEl!==null)this.focussedYearEl.setFocus()}),I)}}else{this.setDecadeView(Math.floor(t/10)*10)}};this.setDateInputProps=()=>{const t={label:this.label,showClearButton:true,showCalendarButton:true,value:this.value};if(this.dateFormat!==M){t.dateFormat=this.dateFormat}if(this.disableFuture){t.disableFuture=this.disableFuture;if(this.disableFutureMessage!==H){t.disableFutureMessage=this.disableFutureMessage}}if(this.disablePast){t.disablePast=this.disablePast;if(this.disablePastMessage!==P){t.disablePastMessage=this.disablePastMessage}}if(this.disableDays.length>0){t.disableDays=this.disableDays;if(this.disableDaysMessage!==V){t.disableDaysMessage=this.disableDaysMessage}}if(this.max!==null&&this.max!==""){t.max=this.maxDate}if(this.min!==null&&this.min!==""){t.min=this.minDate}if(this.helperText!==undefined){t.helperText=this.helperText}if(this.inputId!==undefined){t.inputId=this.inputId}if(this.name!==undefined){t.name=this.name}if(this.disabled){t.disabled=this.disabled}if(this.required){t.required=this.required}if(this.size!=="default"){t.size=this.size}if(this.validationStatus!==""){t.validationStatus=this.validationStatus}if(this.validationText!==""){t.validationText=this.validationText}return t};this.calendarOpen=false;this.currMonthView=[];this.currYearPickerView=[];this.decadeView=[];this.focussedDate=null;this.focussedDay=undefined;this.focussedDayEl=undefined;this.focussedMonth=undefined;this.focussedMonthEl=undefined;this.focussedYear=undefined;this.maxDate=null;this.minDate=null;this.monthInView=undefined;this.monthPickerVisible=false;this.orderedDaysOfWeek=[];this.selectedDate=null;this.yearInView=undefined;this.yearPickerVisible=false;this.dateFormat="DD/MM/YYYY";this.disabled=false;this.disableDays=[];this.disableDaysMessage="The date you have selected is on a day of the week that is not allowed. Please select another date.";this.disableFuture=false;this.disableFutureMessage="Dates in the future are not allowed. Please select a date in the past.";this.disablePast=false;this.disablePastMessage="Dates in the past are not allowed. Please select a date in the future.";this.helperText=undefined;this.inputId=undefined;this.label=undefined;this.max="";this.min="";this.name=undefined;this.openAtDate="";this.required=false;this.showDaysOutsideMonth=true;this.showPickerClearButton=true;this.showPickerTodayButton=true;this.size="default";this.startOfWeek=y.Monday;this.validationStatus="";this.validationText="";this.value=""}watchDisableFutureHandler(){this.watchMaxHandler()}watchDisablePastHandler(){this.watchMinHandler()}watchMaxHandler(){if(this.disableFuture){this.maxDate=new Date}else{this.maxDate=f(this.max,this.dateFormat)}}watchMinHandler(){if(this.disablePast){this.minDate=new Date}else{this.minDate=f(this.min,this.dateFormat)}}watchOpenHandler(){if(this.calendarOpen){if(this.inputEl){let t=T;if(this.size==="small"){t=L}else if(this.size==="large"){t=C}if(this.el.offsetTop+this.inputEl.offsetHeight+t>window.innerHeight&&this.el.offsetTop>t){this.showPickerAbove=true}else{this.showPickerAbove=false}}if(this.selectedDate===null||!n(this.selectedDate,this.minDate,this.maxDate)){let t=new Date;if(this.openAtDate!==""){t=f(this.openAtDate,this.dateFormat)}this.setFocussedDate(t)}else{this.setFocussedDate(this.selectedDate)}let t=this.getMonthInViewText();if(this.selectedDate===null){t+=" No date selected."}t+=" Use arrow keys to change day. Press enter or space to select a date or press escape to close the picker";this.dialogDescription=t;setTimeout((()=>this.focusFocussedDay()),I);document.addEventListener("click",this.handleDocumentClick)}else{document.removeEventListener("click",this.handleDocumentClick);this.monthPickerVisible=false;this.yearPickerVisible=false}}watchFocussedDateHandler(t,e){if(e===null||!(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())){this.updateMonthInView()}}watchMonthInViewHandler(){this.focussedMonth=this.monthInView}watchYearInViewHandler(){this.setFocussedYear(this.yearInView,false)}watchYearPickerVisibleHandler(){if(!this.yearPickerVisible){this.setFocussedYear(this.yearInView)}}watchMonthPickerVisibleHandler(){if(!this.monthPickerVisible){this.focussedMonth=this.monthInView}}watchFocussedDayEl(){if(this.focusDay){setTimeout((()=>this.focusFocussedDay()),I)}this.focusDay=true}componentWillLoad(){w([{prop:this.label,propName:"label"}],"Date Picker");this.monthNames=b(m);this.daysOfWeek=b(g);this.orderedDaysOfWeek=this.daysOfWeek.splice(this.startOfWeek,this.daysOfWeek.length).concat(this.daysOfWeek.splice(0,this.startOfWeek));this.watchMaxHandler();this.watchMinHandler()}componentWillRender(){this.dateInputProps=this.setDateInputProps()}componentWillUpdate(){this.dateInputProps=this.setDateInputProps()}localCalendarButtonClickHandler(t){this.myCalendarButtonClicked=true;if(!this.calendarOpen){this.setSelectedDate(t.detail.value,false)}this.calendarOpen=!this.calendarOpen}calendarButtonClickHandler(){if(!this.myCalendarButtonClicked){this.calendarOpen=false}this.myCalendarButtonClicked=false}render(){const{calendarOpen:e,dateInputProps:i,monthNames:a,size:o,focussedMonth:h,focussedYear:r,monthInView:l,yearInView:d,monthPickerVisible:u,yearPickerVisible:f,orderedDaysOfWeek:b,decadeView:p,minDate:m,maxDate:y,showPickerClearButton:w,showPickerTodayButton:g,dialogDescription:v}=this;let z="";if(u){z=`Use the arrow keys to change the selected month. To return to day picker view, press Enter or Space to select a month, or press Escape.`}else{z=`Press Enter or Space to open month picker view or use the arrow keys to change month.`}let M="";if(f){M=`Use the arrow keys to change the selected year. To return to day picker view, press Enter or Space to select a year, or press Escape.`}else{M=`Press Enter or Space to open year picker view or use the arrow keys to change the selected year.`}const H="choose date";const P=a&&a[l]?a[l]:"Open month picker";const V=this.yearInView?this.yearInView:"Open year picker";let I=m;if(this.disablePast){const t=new Date(m);t.setDate(m.getDate()-1);I=t}return t(s,{onKeyDown:this.keyDownHandler,class:o},t("div",{class:"date-input-container"},t("ic-date-input",Object.assign({ref:t=>this.inputEl=t},i))),e&&t("div",null,t("span",{id:"dialog-description",class:"sr-only"},v),t("div",{role:"dialog","aria-modal":"true","aria-label":H,"aria-describedBy":"dialog-description",class:{"calendar-container":true,above:this.showPickerAbove},onMouseDown:this.handleCalendarMouseDown,onClick:this.handleCalendarClick},t("span",{ref:t=>this.liveRegionEl=t,id:"live-region","aria-live":"assertive",class:"sr-only"}),t("div",{class:{"month-year-nav-container":true}},t("div",{class:"month-year-nav"},this.previousMonthButton(),t("span",{id:"select-month-hint","aria-hidden":"true"},z),t("ic-button",{ref:t=>this.monthButtonEl=t,size:o,class:"month-picker-button","aria-haspopup":"menu","aria-expanded":u?"true":"false","full-width":"true",variant:"tertiary","aria-label":P,"aria-describedby":"select-month-hint",onKeyDown:this.monthButtonKeyDownHandler,onClick:this.monthButtonClickHandler},a[l]),this.nextMonthButton()),t("div",{class:"month-year-nav"},this.previousYearButton(),t("span",{id:"select-year-hint","aria-hidden":"true"},M),t("ic-button",{ref:t=>this.yearButtonEl=t,size:o,class:"year-picker-button","aria-haspopup":"menu","aria-expanded":f?"true":"false","full-width":"true",variant:"tertiary","aria-label":V,"aria-describedby":"select-year-hint",onKeyDown:this.yearButtonKeyDownHandler,onClick:this.yearButtonClickHandler},this.yearInView),this.nextYearButton())),!(u||f)&&t("div",{class:{calendar:true,hidden:u||f},onKeyDown:this.handleCalendarKeyDown},t("div",{class:"weekdays","aria-hidden":"true"},b.map((e=>{const i=o==="small"?e.charAt(0):e;return t("div",{class:"calendar-day-header"},t("ic-typography",{variant:"caption"},i))}))),t("div",{class:"calendar-days-container"},this.currMonthView.map((e=>t(k,{day:e,disableDay:this.disableDays.includes(Number(e.getDay())),today:c(e,this.today),selected:c(e,this.selectedDate),focussed:c(e,this.focussedDate),inRange:n(e,I,y),monthInView:l,onSelectDay:this.handleSelectDay,focussedDayRef:this.setFocussedDayEl,onFocusDay:this.onDayButtonFocusHandler,onBlurDay:this.onDayButtonBlurHandler,showDaysOutsideMonth:this.showDaysOutsideMonth}))))),t("div",{class:{"month-picker-container":true,hidden:!u}},u&&t(x,{size:o,onSelectMonth:this.handleSelectMonth,monthInView:l,focussedMonth:h,onKeyDown:this.monthPickerKeyDownHandler,focussedMonthRef:this.setFocussedMonthEl,minDate:m,maxDate:y,yearInView:d})),t("div",{class:{"year-picker-container":true,hidden:!f}},f&&t(D,{decadeView:p,size:o,focussedYear:r,onSelectYear:this.handleSelectYear,onKeyDown:this.yearPickerKeyDownHandler,onFocusYear:this.onYearButtonFocusHandler,onBlurYear:this.onYearButtonBlurHandler,yearInView:d,minDate:m,maxDate:y,focussedYearRef:this.setFocussedYearEl})),t("div",{class:{"bottom-buttons":true,"no-today":!g}},g&&t("ic-button",{id:"today-button",variant:"tertiary",ref:t=>this.todayButtonEl=t,size:o,"aria-label":"Navigate to current date",onClick:this.todayButtonClickHandler,onKeyDown:this.todayButtonKeyDownHandler,disabled:this.isCurrentMonth()},"Go to today"),w&&t("ic-button",{id:"clear-button","aria-label":"clear selected date",ref:t=>this.clearButtonEl=t,variant:"tertiary",size:o,onClick:this.clearButtonClickHandler,onKeyDown:this.clearButtonKeyDownHandler,disabled:this.value===""||this.value===null||this.value===undefined},"Clear")))))}static get delegatesFocus(){return true}get el(){return a(this)}static get watchers(){return{disableFuture:["watchDisableFutureHandler"],disablePast:["watchDisablePastHandler"],max:["watchMaxHandler"],min:["watchMinHandler"],calendarOpen:["watchOpenHandler"],focussedDate:["watchFocussedDateHandler"],monthInView:["watchMonthInViewHandler"],yearInView:["watchYearInViewHandler"],yearPickerVisible:["watchYearPickerVisibleHandler"],monthPickerVisible:["watchMonthPickerVisibleHandler"],focussedDayEl:["watchFocussedDayEl"]}}};Y.style=z;export{Y as ic_date_picker};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{h as t,r as e,c as i,H as s,g as a}from"./p-8455d1bb.js";import{d as n,g as o,a as h,y as r,b as c,c as l,e as d,f as u,h as f}from"./p-33dd24eb.js";import{s as b,I as p,a as m,b as y,o as w,c as g}from"./p-c07cef0e.js";const v=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.70687 6L8.29688 7.41L12.8769 12L8.29688 16.59L9.70687 18L15.7069 12L9.70687 6Z" fill="currentColor"/>\n</svg>\n`;const k=({focussed:e,today:i,day:s,monthInView:a,onFocusDay:n,onBlurDay:o,onSelectDay:h,selected:r,focussedDayRef:c,inRange:l,showDaysOutsideMonth:d,disableDay:u})=>{const f=()=>{h(s)};const y=()=>{n()};const w=()=>{o()};const g=b(p);const v=b(m);const k=!l||u;const x=a!==s.getMonth();const D=k||x&&!d;return t("div",{class:"day-button-container"},t("button",{class:{"day-button":true,"outside-month":x,"outside-range":k,hidden:x&&!d,disabled:D,today:i,selected:r,focussed:e},tabIndex:e?0:-1,"aria-hidden":x?"true":"false","aria-disabled":D?"true":"false","aria-current":i?"date":undefined,"aria-label":D||x||k?undefined:`Choose ${g[s.getDay()]}, ${s.getDate()} ${v[s.getMonth()]} ${s.getFullYear()}`,disabled:D,onClick:f,onBlur:w,onFocus:y,ref:t=>{if(e&&t&&c){c(t)}}},(!x||x&&d)&&t("ic-typography",{variant:"subtitle-small",italic:x},s.getDate())))};const x=({size:e,focussedMonth:i,monthInView:s,onSelectMonth:a,onKeyDown:r,focussedMonthRef:c,minDate:l,maxDate:d,yearInView:u})=>{const f=t=>{const e=t.target;a(Number(e.getAttribute("data-month")))};const p=b(m);return t("div",{class:{"month-picker":true},role:"list"},p.map(((a,b)=>{const p=s===b;const m=i===b;const y=!n(new Date(u,b,1),l?h(l):null,d?o(d):null);return t("ic-button",{role:"listitem",class:{"month-button":true,selected:p,focussed:m,disabled:y},"full-width":true,disabled:y,variant:p?"primary":"tertiary","data-month":b,size:e,tabIndex:m?0:-1,"aria-current":p?"true":"false","aria-label":p?"":`select ${a}`,onClick:f,onKeyDown:r,ref:t=>{if(m&&t){c(t)}}},a)})))};const D=({decadeView:e,size:i,focussedYear:s,yearInView:a,onSelectYear:n,onFocusYear:o,onBlurYear:h,onKeyDown:c,minDate:l,maxDate:d,focussedYearRef:u})=>{const f=t=>{const e=t.target;n(Number(e.getAttribute("data-year")))};const b=()=>{o()};const p=()=>{h()};const m=t=>{t.preventDefault()};const y=e[0];const w=e[11];const g=e.slice(1,11);return t("div",{class:"year-picker",role:"list"},t("div",{class:"prev-decade","aria-hidden":"true"},t("ic-button",{id:"prev-decade-button",class:{"year-button":true},disabled:!r(y,l,d),"data-year":y,tabIndex:-1,variant:"tertiary",onClick:f,onMouseDown:m,"aria-hidden":"true",size:i},`${y-9}s`,t("svg",{slot:"left-icon",width:"12",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M11.3333 5.33341H3.21996L6.94663 1.60675L5.99996 0.666748L0.666626 6.00008L5.99996 11.3334L6.93996 10.3934L3.21996 6.66675H11.3333V5.33341Z",fill:"currentColor"})))),g.map((e=>{const n=a===e;const o=s===e;return t("ic-button",{class:{"year-button":true,selected:n,focussed:o},disabled:!r(e,l,d),"data-year":e,tabIndex:o?0:-1,variant:n?"primary":"tertiary",onClick:f,"aria-label":n?"":`select ${e}`,role:"listitem","aria-current":n?"true":"false",onKeyDown:c,onFocus:b,onBlur:p,size:i,ref:t=>{if(o&&t){u(t)}}},e)})),t("div",{class:"next-decade","aria-hidden":"true"},t("ic-button",{id:"next-decade-button",class:{"year-button":true,flip:true},disabled:!r(w,l,d),"data-year":w,tabIndex:-1,variant:"tertiary",onClick:f,onMouseDown:m,"aria-hidden":"true",size:i},`${w}s`,t("svg",{slot:"right-icon",width:"12",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M11.3333 5.33341H3.21996L6.94663 1.60675L5.99996 0.666748L0.666626 6.00008L5.99996 11.3334L6.93996 10.3934L3.21996 6.66675H11.3333V5.33341Z",fill:"currentColor"})))))};const z='/*! 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{display:block;position:relative;--month-year-picker-button-width:5rem;--month-button-width:5.5rem;--input-field-width:var(--input-width, 19.125rem)}:host(.large){--month-button-width:6.3125rem;--input-field-width:var(--input-width, 21.125rem)}:host(.small){--month-button-width:6.25rem;--input-field-width:var(--input-width, 17.125rem)}:host .date-input-container{position:relative}ic-date-input{--input-width:var(--input-field-width)}:host .calendar-container{min-width:19rem;max-width:23.5rem;width:var(--input-width);display:flex;flex-direction:column;gap:var(--ic-space-xs);position:absolute;border:var(--ic-border-default);border-radius:var(--ic-border-radius);align-items:center;background-color:var(--ic-architectural-white);z-index:var(--ic-z-index-date-picker);box-sizing:border-box;box-shadow:var(--ic-elevation-overlay);margin-top:var(--ic-space-xxxs);padding:var(--ic-space-xs);animation:fade-in-calendar var(--ic-transition-duration-slow)}:host(.small) .calendar-container{min-width:17rem;max-width:21.5rem}:host(.large) .calendar-container{min-width:21rem;max-width:25.5rem}:host .calendar-container.above{bottom:calc(var(--ic-space-xxl) - var(--ic-space-xxs))}:host .month-year-nav-container{display:flex;justify-content:space-between;align-items:center;align-self:stretch}:host .month-year-nav-container.hidden{display:none}:host .month-year-nav{display:flex;justify-content:space-between;align-items:center;flex:1 0 0}:host .month-picker,:host .year-picker{flex-wrap:wrap;display:inline-flex;align-items:center;width:17.5rem;-moz-column-gap:var(--ic-space-xs);column-gap:var(--ic-space-xs);row-gap:var(--ic-space-xxs)}:host(.small) .month-picker,:host(.small) .year-picker{width:13.125rem}:host(.large) .month-picker,:host(.large) .year-picker{width:20rem}:host .month-picker-button,:host .year-picker-button{width:5rem;--min-width:5rem}:host .month-button,:host .year-button{width:var(--month-button-width)}:host .month-button.focussed,:host .year-button.focussed{z-index:1}:host .month-button::part(button),:host .year-button::part(button){min-width:var(--month-button-width)}:host .prev-decade .year-button svg{margin-right:calc(-1 * var(--ic-space-xl));padding-top:var(--ic-space-sm)}:host .prev-decade .year-button::part(button){padding-left:0;padding-right:var(--ic-space-lg)}:host(.small) .prev-decade .year-button::part(button){padding-left:0;padding-right:calc(var(--ic-space-lg) + var(--ic-space-xxs))}:host .next-decade .year-button svg{margin-left:calc(-1 * var(--ic-space-xl));padding-top:var(--ic-space-sm)}:host .next-decade .year-button::part(button){padding-right:0;padding-left:var(--ic-space-lg)}:host(.small) .next-decade .year-button::part(button),:host(.large) .next-decade .year-button::part(button){padding-left:var(--ic-space-xl)}:host .bottom-buttons{padding-top:var(--ic-space-xs);display:flex;justify-content:space-between;align-items:center;align-self:stretch;animation:fade-in-buttons var(--ic-transition-duration-slow)}:host(.small) .bottom-buttons{padding-top:var(--ic-space-xxs)}:host .bottom-buttons.no-today{align-items:flex-end;flex-direction:column}:host .bottom-buttons.hidden{display:none}:host .calendar{display:flex;flex-direction:column;align-items:flex-start;width:15.75rem;animation:fade-in-buttons var(--ic-transition-duration-slow)}:host(.large) .calendar{width:19.25rem}:host(.small) .calendar{padding-bottom:var(--ic-space-xxs);width:14rem}:host .hidden{display:none}:host .weekdays{display:flex;justify-content:space-between;align-items:flex-start;padding-bottom:var(--ic-space-xs);align-self:stretch}:host .calendar-days-container{display:flex;flex-wrap:wrap;justify-content:space-between;row-gap:var(--ic-space-xs);padding:var(--ic-space-xxs) 0}:host(.small) .calendar-days-container{padding:var(--ic-space-xxxs) 0}:host(.large) .calendar-days-container{padding:var(--ic-space-xs) 0}:host .calendar-day-header{display:flex;width:2rem;padding:var(--ic-space-xxs) 0;justify-content:center;align-items:center}:host(.small) .calendar-day-header,:host(.large) .calendar-day-header{padding:var(--ic-space-xxs)}:host .calendar-day-header ic-typography{color:var(--ic-color-tertiary-text);text-align:center}:host .day-button-container{display:flex;justify-content:center;align-items:center;width:2.25rem;height:2.25rem}:host(.small) .day-button-container{width:2rem;height:2rem}:host(.large) .day-button-container{width:2.5rem;height:2.5rem}:host .day-button{display:flex;position:relative;justify-content:center;align-items:center;border:0;border-radius:2rem;background-color:var(--ic-architectural-white);width:2rem;height:2rem;cursor:pointer;transition:var(--ic-easing-transition-fast);z-index:0}:host .day-button.disabled{cursor:default}:host(.large) .day-button{width:2.25rem;height:2.25rem}:host(.small) .day-button{width:1.75rem;height:1.75rem}:host .day-button ic-typography{width:1.75rem;color:var(--ic-color-primary-text)}:host .day-button.outside-range ic-typography{color:var(--ic-architectural-400)}:host .day-button.outside-month ic-typography{font-weight:var(--ic-font-weight-regular) !important}:host .day-button.outside-month:not(.outside-range):not(.selected) ic-typography{color:var(--ic-color-primary-text)}:host .day-button:hover:not(.disabled){background-color:var(--ic-action-dark-bg-hover)}:host .day-button:active:not(.disabled){background-color:var(--ic-action-dark-bg-active)}@media (prefers-reduced-motion: no-preference){:host .day-button:hover:not(.disabled):not(.focussed),:host .day-button:active:not(.disabled):not(.focussed){transition:background-color var(--ic-transition-duration-slow) ease-in-out}}:host .day-button.selected:not(.hidden){background-color:var(--ic-action-default)}:host .day-button.selected ic-typography{color:var(--ic-color-white-text)}:host .day-button.selected:not(.hidden):hover{background-color:var(--ic-action-default-hover)}:host .day-button.selected:not(.hidden):active{background-color:var(--ic-action-default-active)}:host .day-button.focussed{z-index:1}:host .day-button:focus{outline:none}:host .day-button.focussed:focus{box-shadow:var(--ic-border-focus)}:host .day-button.today:not(.hidden)::after{content:"";position:absolute;width:0.875rem;height:0.125rem;bottom:0.4rem;border-radius:var(--ic-border-radius);background-color:var(--ic-action-default)}:host(.small) .day-button.today::after{bottom:0.35rem}:host(.large) .day-button.today::after{width:1rem}:host .day-button.today.selected::after{background-color:var(--ic-architectural-white)}:host #select-month-hint,:host #select-year-hint{display:none}.sr-only{position:absolute;left:-9999px}@media (prefers-reduced-motion: reduce){:host .calendar-container,:host .calendar,:host .bottom-buttons{animation:none}}@keyframes fade-in-buttons{0%{opacity:0}50%{opacity:0}100%{opacity:1}}@keyframes fade-in-calendar{0%{display:flex;max-height:0}100%{display:flex;max-height:600px}}@media (forced-colors: active){:host .day-button.today:not(.hidden)::after{background-color:highlight}:host .day-button.selected:not(.hidden){background-color:highlight}:host .day-button.focussed:focus{border:var(--ic-hc-border)}:host .month-button.selected::part(button),:host .year-button.selected::part(button){background-color:highlight}}';const M="DD/MM/YYYY";const H="Dates in the future are not allowed. Please select a date in the past.";const P="Dates in the past are not allowed. Please select a date in the future.";const V="The date you have selected is on a day of the week that is not allowed. Please select another date.";const I=100;const L=360;const T=400;const C=440;const Y=class{constructor(s){e(this,s);this.icChange=i(this,"icChange",7);this.clearButtonEl=null;this.daysOfWeek=[];this.dayButtonFocussed=false;this.dayPickerKeyboardNav=false;this.dialogDescription="";this.focusDay=true;this.liveRegionEl=null;this.monthNames=[];this.monthInViewUpdateHandled=false;this.myCalendarButtonClicked=false;this.showPickerAbove=false;this.today=new Date;this.todayButtonEl=null;this.yearButtonFocussed=false;this.setDecadeView=t=>{let e=t-1;const i=[];while(e<=t+10){i.push(e);e++}this.decadeView=i;this.decadeStart=i[1];this.decadeEnd=i[10]};this.setSelectedDate=(t,e=true)=>{if(t===null||!c(t,this.selectedDate)){this.selectedDate=t;this.value=t;if(e){this.inputEl.triggerIcChange(t)}}};this.handleCalendarMouseDown=t=>{const e=t.target;if(e.tagName!=="IC-BUTTON"){t.preventDefault()}};this.handleCalendarClick=t=>{this.clearDialogDescription();t.stopImmediatePropagation()};this.handleDocumentClick=()=>{this.calendarOpen=false};this.keyDownHandler=t=>{if(t.key==="Escape"){this.closeButtonClickHandler();this.inputEl.setCalendarFocus()}else{this.clearDialogDescription()}t.stopImmediatePropagation()};this.closeButtonClickHandler=()=>{this.calendarOpen=false};this.focusFirstElement=()=>{this.monthButtonEl.setFocus()};this.focusLastElement=()=>{if(this.showPickerClearButton&&!this.clearButtonEl.disabled){this.clearButtonEl.setFocus()}else if(this.showPickerTodayButton&&!this.todayButtonEl.disabled){this.todayButtonEl.setFocus()}else if(this.monthPickerVisible){this.focussedMonthEl.setFocus()}else if(this.yearPickerVisible){this.focussedYearEl.setFocus()}else{this.focussedDayEl.focus()}};this.focusFocussedDay=()=>{this.focussedDayEl.focus()};this.monthButtonClickHandler=()=>{this.yearPickerVisible=false;this.focusDay=false;this.monthPickerVisible=!this.monthPickerVisible;if(this.monthPickerVisible){this.setAriaLiveRegionText("Month picker view open")}else{this.setMonthSelectedLiveRegionText()}};this.yearButtonClickHandler=()=>{this.monthPickerVisible=false;this.focusDay=false;this.yearPickerVisible=!this.yearPickerVisible;if(this.yearPickerVisible){this.setAriaLiveRegionText(`Year picker view open. ${this.getDecadeInViewText()}`)}else{this.setYearSelectedLiveRegionText()}};this.todayButtonClickHandler=()=>{this.yearPickerVisible=false;this.monthPickerVisible=false;this.setFocussedDate(new Date);this.setAriaLiveRegionText(this.getMonthInViewText());setTimeout((()=>this.focusFocussedDay()),I)};this.todayButtonKeyDownHandler=t=>{if(t.key==="Tab"&&!t.shiftKey&&this.clearButtonEl.disabled){this.focusFirstElement();t.preventDefault()}};this.clearButtonClickHandler=()=>{this.setSelectedDate(null);let t="Selected date cleared.";if(!this.monthPickerVisible&&!this.yearPickerVisible){t+=` ${this.getMonthInViewText()}`}if(this.monthPickerVisible){this.focussedMonthEl.setFocus()}else if(this.yearPickerVisible){this.focussedYearEl.setFocus()}else{this.focusFocussedDay()}this.setAriaLiveRegionText(t)};this.setMonthSelectedLiveRegionText=()=>{this.setAriaLiveRegionText(`${this.monthNames[this.monthInView]} selected. ${this.getMonthInViewText()}`)};this.setYearSelectedLiveRegionText=()=>{this.setAriaLiveRegionText(`${this.yearInView} selected. ${this.getMonthInViewText()}`)};this.getMonthInViewText=()=>`${this.monthNames[this.monthInView]} ${this.yearInView} currently in view.`;this.getDecadeInViewText=()=>`${this.decadeStart} to ${this.decadeEnd} currently in view.`;this.setAriaLiveRegionText=t=>{this.liveRegionEl&&(this.liveRegionEl.innerText=t)};this.clearDialogDescription=()=>{this.dialogDescription=""};this.clearButtonKeyDownHandler=t=>{if(t.key==="Tab"&&!t.shiftKey){this.focusFirstElement();t.preventDefault()}};this.goToPreviousMonth=(t=false)=>{this.focusDay=t;this.moveMonths(-1)};this.goToNextMonth=(t=false)=>{this.focusDay=t;this.moveMonths(1)};this.goToPreviousYear=(t=false)=>{if(this.isPrevYearAllowed()){this.focusDay=t;this.moveYears(-1)}};this.goToNextYear=(t=false)=>{if(this.isNextYearAllowed()){this.focusDay=t;this.moveYears(1)}};this.navButtonMouseDownHandler=t=>{t.preventDefault()};this.renderMonthYearNavButton=(e,i,s)=>{const a=this.size;return t("div",{"aria-hidden":"true"},t("ic-button",{id:e,disableTooltip:true,disabled:s,onClick:this.monthYearNavClickHandler,class:{flip:i},variant:"icon",innerHTML:v,size:a,tabIndex:-1,"aria-hidden":"true",onMouseDown:this.navButtonMouseDownHandler}))};this.monthYearNavClickHandler=t=>{const e=t.target;switch(e.id){case"previous-month-button":this.goToPreviousMonth(this.dayButtonFocussed);break;case"next-month-button":this.goToNextMonth(this.dayButtonFocussed);break;case"previous-year-button":this.goToPreviousYear(this.dayButtonFocussed);break;case"next-year-button":this.goToNextYear(this.dayButtonFocussed);break}};this.previousMonthButton=()=>{let t=false;if(this.focussedDate!==null&&this.minDate!==null){const e=this.focussedDate.getFullYear()===this.minDate.getFullYear();if(e){t=this.monthInView-1<this.minDate.getMonth()}}return this.renderMonthYearNavButton("previous-month-button",true,t)};this.nextMonthButton=()=>{let t=false;if(this.focussedDate!==null&&this.maxDate!==null){const e=this.focussedDate.getFullYear()===this.maxDate.getFullYear();if(e){t=this.monthInView+1>this.maxDate.getMonth()}}return this.renderMonthYearNavButton("next-month-button",false,t)};this.previousYearButton=()=>this.renderMonthYearNavButton("previous-year-button",true,!this.isPrevYearAllowed());this.nextYearButton=()=>this.renderMonthYearNavButton("next-year-button",false,!this.isNextYearAllowed());this.isPrevYearAllowed=()=>this.isYearAllowed(this.yearInView-1);this.isNextYearAllowed=()=>this.isYearAllowed(this.yearInView+1);this.isYearAllowed=t=>r(t,this.minDate,this.maxDate);this.getMonthView=t=>{const e=l(h(t),this.startOfWeek);const i=d(o(t),this.startOfWeek);const s=[];let a=e;while(!c(a,i)){s.push(a);a=new Date(a);a.setDate(a.getDate()+1)}s.push(a);return s};this.isCurrentMonth=()=>{const t=new Date;return t.getFullYear()===this.yearInView&&t.getMonth()===this.monthInView};this.updateMonthInView=()=>{this.currMonthView=this.getMonthView(this.focussedDate);this.focussedDay=this.focussedDate.getDate();this.monthInView=this.focussedDate.getMonth();this.yearInView=this.focussedDate.getFullYear();if(this.dayPickerKeyboardNav){this.monthInViewUpdateHandled=true;this.setAriaLiveRegionText(this.getMonthInViewText());this.dayPickerKeyboardNav=false}};this.handleSelectDay=t=>{this.setSelectedDate(t);this.calendarOpen=false;this.inputEl.setCalendarFocus()};this.handleSelectMonth=t=>{this.moveMonths(t-this.monthInView);setTimeout((()=>{this.monthButtonEl.setFocus();this.monthPickerVisible=false;this.setMonthSelectedLiveRegionText()}),I)};this.handleSelectYear=t=>{const e=this.decadeView.indexOf(t);if(e>0&&e<this.decadeView.length-1){this.moveYears(t-this.yearInView);this.focusDay=false;const e=this.monthNames[this.monthInView];this.setAriaLiveRegionText(`${t} selected. ${e} ${t} currently in view.`);setTimeout((()=>{this.yearButtonEl.setFocus();this.yearPickerVisible=false}),I)}else{const e=t-this.focussedYear>0?10:-10;this.updateFocussedYear(e,this.yearButtonFocussed);this.setAriaLiveRegionText(this.getDecadeInViewText())}};this.monthPickerKeyDownHandler=t=>{let e=true;switch(t.key){case"ArrowUp":case"ArrowLeft":this.updateFocussedMonth(-1);break;case"ArrowDown":case"ArrowRight":this.updateFocussedMonth(1);break;case"Home":this.updateFocussedMonth(-this.focussedMonth);break;case"End":this.updateFocussedMonth(11-this.focussedMonth);break;case"Tab":e=this.calendarTabHandler(t);break;case"Escape":t.stopImmediatePropagation();this.monthPickerVisible=false;setTimeout((()=>this.focusFocussedDay()),I);break;default:e=false}if(e){t.preventDefault()}};this.yearPickerKeyDownHandler=t=>{let e=true;switch(t.key){case"ArrowUp":case"ArrowLeft":this.updateFocussedYear(-1);break;case"ArrowDown":case"ArrowRight":this.updateFocussedYear(1);break;case"Home":if(this.focussedYear>this.decadeStart){this.updateFocussedYear(this.decadeStart-this.focussedYear)}break;case"End":if(this.focussedYear<this.decadeEnd){this.updateFocussedYear(this.decadeEnd-this.focussedYear)}break;case"PageUp":this.updateFocussedYear(-10);break;case"PageDown":this.updateFocussedYear(10);break;case"Tab":e=this.calendarTabHandler(t);break;case"Escape":t.stopImmediatePropagation();this.yearPickerVisible=false;setTimeout((()=>this.focusFocussedDay()),I);break;default:e=false}if(e){t.preventDefault()}};this.onYearButtonFocusHandler=()=>{this.yearButtonFocussed=true};this.onYearButtonBlurHandler=()=>{this.yearButtonFocussed=false};this.monthButtonKeyDownHandler=t=>{let e=false;switch(t.key){case"ArrowLeft":case"ArrowUp":e=true;this.goToPreviousMonth();break;case"ArrowRight":case"ArrowDown":e=true;this.goToNextMonth();break;case"Home":e=true;this.focusDay=false;this.moveMonths(-this.monthInView);break;case"End":e=true;this.focusDay=false;this.moveMonths(11-this.monthInView);break;case"Tab":if(t.shiftKey){e=true;this.focusLastElement()}break;case"Escape":if(this.monthPickerVisible){this.monthPickerVisible=false;t.stopImmediatePropagation()}break}if(e){t.preventDefault()}};this.yearButtonKeyDownHandler=t=>{let e=false;switch(t.key){case"ArrowLeft":case"ArrowUp":e=true;this.goToPreviousYear();break;case"ArrowRight":case"ArrowDown":e=true;this.goToNextYear();break;case"Home":if(this.yearPickerVisible&&this.yearInView>this.decadeStart){e=true;this.moveYears(this.decadeStart-this.yearInView)}break;case"End":if(this.yearPickerVisible&&this.yearInView<this.decadeEnd){e=true;this.moveYears(this.decadeEnd-this.focussedYear)}break;case"PageUp":e=true;this.focusDay=false;this.moveYears(-10);break;case"PageDown":e=true;this.focusDay=false;this.moveYears(10);break;case"Escape":if(this.yearPickerVisible){this.yearPickerVisible=false;t.stopImmediatePropagation()}break}if(e){t.preventDefault()}};this.handleCalendarKeyDown=t=>{let e=true;switch(t.key){case"ArrowDown":this.dayPickerKeyboardNav=true;this.moveDays(7);break;case"ArrowUp":this.dayPickerKeyboardNav=true;this.moveDays(-7);break;case"ArrowLeft":this.dayPickerKeyboardNav=true;this.moveDays(-1*this.getNextDayToFocus(this.focussedDate,false));break;case"ArrowRight":this.dayPickerKeyboardNav=true;this.moveDays(this.getNextDayToFocus(this.focussedDate,true));break;case"PageUp":this.dayPickerKeyboardNav=true;t.shiftKey?this.moveYears(-1):this.moveMonths(-1);break;case"PageDown":this.dayPickerKeyboardNav=true;t.shiftKey?this.moveYears(1):this.moveMonths(1);break;case"Home":this.dayPickerKeyboardNav=true;this.setFocussedDate(new Date(this.focussedYear,this.focussedMonth,1));break;case"End":this.dayPickerKeyboardNav=true;this.setFocussedDate(new Date(this.focussedYear,this.focussedMonth+1,0));break;case"Tab":e=this.calendarTabHandler(t);break;default:e=false;break}if(e){t.preventDefault()}};this.calendarTabHandler=t=>{let e=false;if(!t.shiftKey&&(!this.showPickerTodayButton||this.isCurrentMonth())&&(!this.showPickerClearButton||this.clearButtonEl.disabled)){this.focusFirstElement();e=true}else if(t.shiftKey){this.yearButtonEl.setFocus();e=true}return e};this.onDayButtonFocusHandler=()=>{this.dayButtonFocussed=true};this.onDayButtonBlurHandler=()=>{this.dayButtonFocussed=false};this.getNextDayToFocus=(t,e,i=1)=>{const s=e?1:-1;const a=new Date(t);a.setDate(a.getDate()+s);const n=Number(a.getDay());if(this.disableDays.includes(n)){return this.getNextDayToFocus(a,e,i+1)}else{return i}};this.moveDays=t=>{const e=new Date(this.focussedDate);e.setDate(e.getDate()+t);this.setFocussedDate(e)};this.moveMonths=t=>{const e=this.focussedDate.getMonth()+t;const i=new Date(new Date(h(this.focussedDate)).setMonth(e));const s=o(i);const a=new Date(new Date(this.focussedDate).setMonth(e));this.setFocussedDate(u(a,i,s));if(this.monthPickerVisible===false&&this.yearPickerVisible===false&&this.monthInViewUpdateHandled===false){this.setAriaLiveRegionText(this.getMonthInViewText())}this.monthInViewUpdateHandled=false};this.moveYears=t=>{const e=this.focussedDate.getFullYear()+t;const i=new Date(new Date(h(this.focussedDate)).setFullYear(e));const s=o(i);const a=new Date(new Date(this.focussedDate).setFullYear(e));this.setFocussedDate(u(a,i,s));if(this.monthPickerVisible===false&&this.yearPickerVisible===false&&this.monthInViewUpdateHandled===false){this.setAriaLiveRegionText(this.getMonthInViewText())}this.monthInViewUpdateHandled=false};this.updateFocussedMonth=t=>{const e=new Date(this.focussedYear,this.focussedMonth,1);e.setMonth(this.focussedMonth+t);const i=u(e,this.minDate,this.maxDate);this.focussedMonth=i.getMonth();setTimeout((()=>this.focussedMonthEl.setFocus()),I)};this.updateFocussedYear=(t,e=true)=>{const i=new Date((new Date).setFullYear(this.focussedYear+t));const s=u(i,this.minDate,this.maxDate);this.setFocussedYear(s.getFullYear(),e)};this.setFocussedDate=t=>{this.focussedDate=u(t,this.minDate,this.maxDate)};this.setFocussedDayEl=t=>{this.focussedDayEl=t};this.setFocussedMonthEl=t=>{this.focussedMonthEl=t};this.setFocussedYearEl=t=>{this.focussedYearEl=t};this.setFocussedYear=(t,e=true)=>{const i=this.focussedYear;this.focussedYear=t;if(this.yearPickerVisible){const s=Math.floor(t/10)*10;const a=Math.floor(i/10)*10;if(s!==a){this.setDecadeView(s);this.setAriaLiveRegionText(this.getDecadeInViewText())}if(e){setTimeout((()=>{if(this.focussedYearEl!==null)this.focussedYearEl.setFocus()}),I)}}else{this.setDecadeView(Math.floor(t/10)*10)}};this.setDateInputProps=()=>{const t={label:this.label,showClearButton:true,showCalendarButton:true,value:this.value};if(this.dateFormat!==M){t.dateFormat=this.dateFormat}if(this.disableFuture){t.disableFuture=this.disableFuture;if(this.disableFutureMessage!==H){t.disableFutureMessage=this.disableFutureMessage}}if(this.disablePast){t.disablePast=this.disablePast;if(this.disablePastMessage!==P){t.disablePastMessage=this.disablePastMessage}}if(this.disableDays.length>0){t.disableDays=this.disableDays;if(this.disableDaysMessage!==V){t.disableDaysMessage=this.disableDaysMessage}}if(this.max!==null&&this.max!==""){t.max=this.maxDate}if(this.min!==null&&this.min!==""){t.min=this.minDate}if(this.helperText!==undefined){t.helperText=this.helperText}if(this.inputId!==undefined){t.inputId=this.inputId}if(this.name!==undefined){t.name=this.name}if(this.disabled){t.disabled=this.disabled}if(this.required){t.required=this.required}if(this.size!=="default"){t.size=this.size}if(this.validationStatus!==""){t.validationStatus=this.validationStatus}if(this.validationText!==""){t.validationText=this.validationText}return t};this.calendarOpen=false;this.currMonthView=[];this.currYearPickerView=[];this.decadeView=[];this.focussedDate=null;this.focussedDay=undefined;this.focussedDayEl=undefined;this.focussedMonth=undefined;this.focussedMonthEl=undefined;this.focussedYear=undefined;this.maxDate=null;this.minDate=null;this.monthInView=undefined;this.monthPickerVisible=false;this.orderedDaysOfWeek=[];this.selectedDate=null;this.yearInView=undefined;this.yearPickerVisible=false;this.dateFormat="DD/MM/YYYY";this.disabled=false;this.disableDays=[];this.disableDaysMessage="The date you have selected is on a day of the week that is not allowed. Please select another date.";this.disableFuture=false;this.disableFutureMessage="Dates in the future are not allowed. Please select a date in the past.";this.disablePast=false;this.disablePastMessage="Dates in the past are not allowed. Please select a date in the future.";this.helperText=undefined;this.inputId=undefined;this.label=undefined;this.max="";this.min="";this.name=undefined;this.openAtDate="";this.required=false;this.showDaysOutsideMonth=true;this.showPickerClearButton=true;this.showPickerTodayButton=true;this.size="default";this.startOfWeek=y.Monday;this.validationStatus="";this.validationText="";this.value=""}watchDisableFutureHandler(){this.watchMaxHandler()}watchDisablePastHandler(){this.watchMinHandler()}watchMaxHandler(){if(this.disableFuture){this.maxDate=new Date}else{this.maxDate=f(this.max,this.dateFormat)}}watchMinHandler(){if(this.disablePast){this.minDate=new Date}else{this.minDate=f(this.min,this.dateFormat)}}watchOpenHandler(){if(this.calendarOpen){if(this.inputEl){let t=T;if(this.size==="small"){t=L}else if(this.size==="large"){t=C}if(this.el.offsetTop+this.inputEl.offsetHeight+t>window.innerHeight&&this.el.offsetTop>t){this.showPickerAbove=true}else{this.showPickerAbove=false}}if(this.selectedDate===null||!n(this.selectedDate,this.minDate,this.maxDate)){let t=new Date;if(this.openAtDate!==""){t=f(this.openAtDate,this.dateFormat)}this.setFocussedDate(t)}else{this.setFocussedDate(this.selectedDate)}let t=this.getMonthInViewText();if(this.selectedDate===null){t+=" No date selected."}t+=" Use arrow keys to change day. Press enter or space to select a date or press escape to close the picker";this.dialogDescription=t;setTimeout((()=>this.focusFocussedDay()),I);document.addEventListener("click",this.handleDocumentClick)}else{document.removeEventListener("click",this.handleDocumentClick);this.monthPickerVisible=false;this.yearPickerVisible=false}}watchFocussedDateHandler(t,e){if(e===null||!(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth())){this.updateMonthInView()}}watchMonthInViewHandler(){this.focussedMonth=this.monthInView}watchYearInViewHandler(){this.setFocussedYear(this.yearInView,false)}watchYearPickerVisibleHandler(){if(!this.yearPickerVisible){this.setFocussedYear(this.yearInView)}}watchMonthPickerVisibleHandler(){if(!this.monthPickerVisible){this.focussedMonth=this.monthInView}}watchFocussedDayEl(){if(this.focusDay){setTimeout((()=>this.focusFocussedDay()),I)}this.focusDay=true}componentWillLoad(){w([{prop:this.label,propName:"label"}],"Date Picker");this.monthNames=b(m);this.daysOfWeek=b(g);this.orderedDaysOfWeek=this.daysOfWeek.splice(this.startOfWeek,this.daysOfWeek.length).concat(this.daysOfWeek.splice(0,this.startOfWeek));this.watchMaxHandler();this.watchMinHandler()}componentWillRender(){this.dateInputProps=this.setDateInputProps()}componentWillUpdate(){this.dateInputProps=this.setDateInputProps()}localCalendarButtonClickHandler(t){this.myCalendarButtonClicked=true;if(!this.calendarOpen){this.setSelectedDate(t.detail.value,false)}this.calendarOpen=!this.calendarOpen}calendarButtonClickHandler(){if(!this.myCalendarButtonClicked){this.calendarOpen=false}this.myCalendarButtonClicked=false}render(){const{calendarOpen:e,dateInputProps:i,monthNames:a,size:o,focussedMonth:h,focussedYear:r,monthInView:l,yearInView:d,monthPickerVisible:u,yearPickerVisible:f,orderedDaysOfWeek:b,decadeView:p,minDate:m,maxDate:y,showPickerClearButton:w,showPickerTodayButton:g,dialogDescription:v}=this;let z="";if(u){z=`Use the arrow keys to change the selected month. To return to day picker view, press Enter or Space to select a month, or press Escape.`}else{z=`Press Enter or Space to open month picker view or use the arrow keys to change month.`}let M="";if(f){M=`Use the arrow keys to change the selected year. To return to day picker view, press Enter or Space to select a year, or press Escape.`}else{M=`Press Enter or Space to open year picker view or use the arrow keys to change the selected year.`}const H="choose date";const P=a&&a[l]?a[l]:"Open month picker";const V=this.yearInView?this.yearInView:"Open year picker";let I=m;if(this.disablePast){const t=new Date(m);t.setDate(m.getDate()-1);I=t}return t(s,{onKeyDown:this.keyDownHandler,class:o},t("div",{class:"date-input-container"},t("ic-date-input",Object.assign({ref:t=>this.inputEl=t},i))),e&&t("div",null,t("span",{id:"dialog-description",class:"sr-only"},v),t("div",{role:"dialog","aria-modal":"true","aria-label":H,"aria-describedBy":"dialog-description",class:{"calendar-container":true,above:this.showPickerAbove},onMouseDown:this.handleCalendarMouseDown,onClick:this.handleCalendarClick},t("span",{ref:t=>this.liveRegionEl=t,id:"live-region","aria-live":"assertive",class:"sr-only"}),t("div",{class:{"month-year-nav-container":true}},t("div",{class:"month-year-nav"},this.previousMonthButton(),t("span",{id:"select-month-hint","aria-hidden":"true"},z),t("ic-button",{ref:t=>this.monthButtonEl=t,size:o,class:"month-picker-button","aria-haspopup":"menu","aria-expanded":u?"true":"false","full-width":"true",variant:"tertiary","aria-label":P,"aria-describedby":"select-month-hint",onKeyDown:this.monthButtonKeyDownHandler,onClick:this.monthButtonClickHandler},a[l]),this.nextMonthButton()),t("div",{class:"month-year-nav"},this.previousYearButton(),t("span",{id:"select-year-hint","aria-hidden":"true"},M),t("ic-button",{ref:t=>this.yearButtonEl=t,size:o,class:"year-picker-button","aria-haspopup":"menu","aria-expanded":f?"true":"false","full-width":"true",variant:"tertiary","aria-label":V,"aria-describedby":"select-year-hint",onKeyDown:this.yearButtonKeyDownHandler,onClick:this.yearButtonClickHandler},this.yearInView),this.nextYearButton())),!(u||f)&&t("div",{class:{calendar:true,hidden:u||f},onKeyDown:this.handleCalendarKeyDown},t("div",{class:"weekdays","aria-hidden":"true"},b.map((e=>{const i=o==="small"?e.charAt(0):e;return t("div",{class:"calendar-day-header"},t("ic-typography",{variant:"caption"},i))}))),t("div",{class:"calendar-days-container"},this.currMonthView.map((e=>t(k,{day:e,disableDay:this.disableDays.includes(Number(e.getDay())),today:c(e,this.today),selected:c(e,this.selectedDate),focussed:c(e,this.focussedDate),inRange:n(e,I,y),monthInView:l,onSelectDay:this.handleSelectDay,focussedDayRef:this.setFocussedDayEl,onFocusDay:this.onDayButtonFocusHandler,onBlurDay:this.onDayButtonBlurHandler,showDaysOutsideMonth:this.showDaysOutsideMonth}))))),t("div",{class:{"month-picker-container":true,hidden:!u}},u&&t(x,{size:o,onSelectMonth:this.handleSelectMonth,monthInView:l,focussedMonth:h,onKeyDown:this.monthPickerKeyDownHandler,focussedMonthRef:this.setFocussedMonthEl,minDate:m,maxDate:y,yearInView:d})),t("div",{class:{"year-picker-container":true,hidden:!f}},f&&t(D,{decadeView:p,size:o,focussedYear:r,onSelectYear:this.handleSelectYear,onKeyDown:this.yearPickerKeyDownHandler,onFocusYear:this.onYearButtonFocusHandler,onBlurYear:this.onYearButtonBlurHandler,yearInView:d,minDate:m,maxDate:y,focussedYearRef:this.setFocussedYearEl})),t("div",{class:{"bottom-buttons":true,"no-today":!g}},g&&t("ic-button",{id:"today-button",variant:"tertiary",ref:t=>this.todayButtonEl=t,size:o,"aria-label":"Navigate to current date",onClick:this.todayButtonClickHandler,onKeyDown:this.todayButtonKeyDownHandler,disabled:this.isCurrentMonth()},"Go to today"),w&&t("ic-button",{id:"clear-button","aria-label":"clear selected date",ref:t=>this.clearButtonEl=t,variant:"tertiary",size:o,onClick:this.clearButtonClickHandler,onKeyDown:this.clearButtonKeyDownHandler,disabled:this.value===""||this.value===null||this.value===undefined},"Clear")))))}static get delegatesFocus(){return true}get el(){return a(this)}static get watchers(){return{disableFuture:["watchDisableFutureHandler"],disablePast:["watchDisablePastHandler"],max:["watchMaxHandler"],min:["watchMinHandler"],calendarOpen:["watchOpenHandler"],focussedDate:["watchFocussedDateHandler"],monthInView:["watchMonthInViewHandler"],yearInView:["watchYearInViewHandler"],yearPickerVisible:["watchYearPickerVisibleHandler"],monthPickerVisible:["watchMonthPickerVisibleHandler"],focussedDayEl:["watchFocussedDayEl"]}}};Y.style=z;export{Y as ic_date_picker};
|
2
|
+
//# sourceMappingURL=p-2170f59e.entry.js.map
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as e,c as i,h as t,H as a,g as o}from"./p-8455d1bb.js";import{j as r,l as c,a as n,m as s,d,n as l,p as h,i as b}from"./p-11bbb09c.js";import"./p-fd186591.js";const m='/*! 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(.disabled){color:var(--ic-architectural-200);pointer-events:none}.container{display:flex;width:-moz-fit-content;width:fit-content;padding:var(--ic-space-xxs) 0 var(--ic-space-xxs) var(--ic-space-xxs);margin-bottom:var(--ic-space-xxs);align-items:center}:host(.small) .container{margin-bottom:var(--ic-space-xxxs)}.checkbox{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:block;position:relative;top:0;left:0;height:var(--ic-space-lg);width:var(--ic-space-lg);background-color:var(--ic-architectural-white);border:var(--ic-border-width) solid var(--ic-architectural-300);border-radius:var(--ic-border-radius);outline:none;cursor:pointer;transition:var(--ic-easing-transition-fast);flex-shrink:0}:host(.small) .checkbox,:host(.small) .container svg{width:var(--ic-space-md);height:var(--ic-space-md)}:host(.large) .checkbox,:host(.large) .container svg{width:var(--ic-space-xl);height:var(--ic-space-xl)}.checkbox:checked{background-color:var(--ic-action-default);border:var(--ic-border-width) solid var(--ic-action-default);transition:var(--ic-easing-transition-slow)}.checkbox:checked:disabled{background-color:var(--ic-architectural-200)}.checkbox:indeterminate,.checkbox.indeterminate:checked{background-color:var(--ic-architectural-white);border:0.125rem solid var(--ic-action-default)}.checkbox:checked:hover{background-color:var(--ic-action-default-hover)}.checkbox:indeterminate:hover,.checkbox.indeterminate:checked:hover{background-color:var(--ic-action-default-bg-hover-no-alpha);border:0.125rem solid var(--ic-action-default-hover)}.checkbox:checked:active{background-color:var(--ic-action-default-active)}.checkbox:indeterminate:active,.checkbox.indeterminate:checked:active{background-color:var(--ic-action-default-bg-active-no-alpha);border:0.125rem solid var(--ic-action-default-active)}.checkbox:hover{background-color:var(--ic-action-default-bg-hover-no-alpha);box-shadow:0 0 0 0.25rem var(--ic-action-default-bg-hover);border:var(--ic-border-width) solid var(--ic-action-default-hover)}.checkbox:active{background-color:var(--ic-action-default-bg-active-no-alpha);box-shadow:0 0 0 0.25rem var(--ic-action-default-bg-active);border:var(--ic-border-width) solid var(--ic-action-default-active)}.checkbox:focus{box-shadow:var(--ic-border-focus)}.checkbox:disabled{border:var(--ic-border-width) dashed var(--ic-architectural-200)}.checkbox-label{padding-left:var(--ic-space-sm)}.checkbox-label:hover{cursor:pointer}.checkmark{position:relative;right:calc(-1 * var(--ic-space-lg));margin-left:calc(-1 * var(--ic-space-lg));fill:white;z-index:1;background-color:transparent;pointer-events:none;flex-shrink:0}:host(.small) .checkmark{margin-left:calc(-1 * var(--ic-space-md));right:calc(-1 * var(--ic-space-md))}:host(.large) .checkmark{margin-left:calc(-1 * var(--ic-space-xl));right:calc(-1 * var(--ic-space-xl))}.indeterminate-symbol{position:relative;width:0.875rem;height:var(--ic-space-xxxs);right:-1.188rem;margin-left:-0.875rem;z-index:1;background-color:var(--ic-action-default);pointer-events:none;flex-shrink:0}:host(.small) .indeterminate-symbol{width:0.6rem;right:-0.8rem;margin-left:-0.6rem}:host(.large) .indeterminate-symbol{width:1.25rem;right:-1.625rem;margin-left:-1.25rem}.container:hover .indeterminate-symbol{background-color:var(--ic-action-default-hover)}.container:active .indeterminate-symbol{background-color:var(--ic-action-default-active)}.additional-field-wrapper{margin-left:calc(var(--ic-space-md) + var(--ic-space-lg));margin-top:calc(var(--ic-space-sm) / 2)}.branch-corner{color:var(--ic-action-default);height:var(--ic-space-md);width:var(--ic-space-xl);border-radius:0 0 0 0.188rem;border-bottom:0.125rem solid var(--ic-action-default);border-left:0.125rem solid var(--ic-action-default)}.dynamic-container{display:flex;position:relative;margin:var(--ic-space-xxxs) 0 var(--ic-space-xxs) var(--ic-space-md);gap:var(--ic-space-xs)}.dynamic-text{color:var(--ic-action-default);margin-top:calc(var(--ic-space-sm) / 2);margin-bottom:var(--ic-space-xs);border-radius:2%}@media (max-width: 576px){::slotted(ic-text-field){--input-width:100%}}@media (forced-colors: active){.checkbox{-webkit-appearance:revert;-moz-appearance:revert;appearance:revert;transition:none}.checkbox:checked{transition:none}.checkbox:focus-visible{outline:0.125rem solid highlight}.checkbox:disabled:not(:checked){-webkit-appearance:none;-moz-appearance:none;appearance:none;border-color:GrayText}.checkmark{fill:none}.indeterminate-symbol{display:none}}';const p=class{constructor(t){e(this,t);this.checkboxChecked=i(this,"checkboxChecked",7);this.icCheck=i(this,"icCheck",7);this.handleClick=()=>{this.checked=!this.checked;this.icCheck.emit();this.checkboxChecked.emit()};this.handleFormReset=()=>{this.checked=this.initiallyChecked};this.additionalFieldDisplay="static";this.checked=false;this.initiallyChecked=this.checked;this.disabled=false;this.dynamicText="This selection requires additional answers";this.form=undefined;this.formaction=undefined;this.formenctype=undefined;this.formmethod=undefined;this.formnovalidate=undefined;this.formtarget=undefined;this.groupLabel=undefined;this.indeterminate=false;this.label=undefined;this.name=undefined;this.size=undefined;this.small=false;this.value=undefined}componentWillLoad(){r(this.disabled,this.el);c(this.el,this.handleFormReset);const e=this.el.parentElement;if(e){if(!this.name)this.name=e.name;this.groupLabel=e.label}}componentDidLoad(){n([{prop:this.label,propName:"label"},{prop:this.value,propName:"value"}],"Checkbox")}componentDidRender(){if(this.additionalFieldDisplay==="static"){const e=this.el.querySelector("ic-text-field");if(!this.checked){e===null||e===void 0?void 0:e.setAttribute("disabled","")}else{e===null||e===void 0?void 0:e.removeAttribute("disabled")}}else if(this.additionalFieldContainer){this.additionalFieldContainer.style.display=!this.checked?"none":"flex"}}disconnectedCallback(){s(this.el,this.handleFormReset)}async setFocus(){var e;(e=this.el.shadowRoot.querySelector(".checkbox"))===null||e===void 0?void 0:e.focus()}render(){const{additionalFieldDisplay:e,checked:i,disabled:o,dynamicText:r,el:c,form:n,formaction:s,formenctype:m,formmethod:p,formnovalidate:u,formtarget:v,indeterminate:f,groupLabel:g,label:k,name:x,size:y,small:w,value:z}=this;const j=`ic-checkbox-${d(k)||z}-${g}`.replace(/ /g,"-");const C=c.parentElement.size;i?l(true,c,x,i&&z,o):h(c);return t(a,{class:{disabled:o,small:w,[`${y||C}`]:true}},t("div",{class:"container"},i&&(!f?t("svg",{class:"checkmark",width:"1.5rem",height:"1.5rem",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","fill-rule":"evenodd","clip-rule":"evenodd"},t("title",null,"checkmark icon"),t("path",{d:"M21 6.285l-11.16 12.733-6.84-6.018 1.319-1.49 5.341 4.686 9.865-11.196 1.475 1.285z"})):t("div",{class:"indeterminate-symbol"})),t("input",{role:"checkbox",class:{checkbox:true,checked:i,indeterminate:f},type:"checkbox",name:x,id:j,value:z,disabled:o?true:null,checked:i,indeterminate:f,onClick:this.handleClick,form:n,formaction:s,formenctype:m,formmethod:p,formnovalidate:u,formtarget:v}),t("ic-typography",{class:"checkbox-label",variant:"body"},t("label",{htmlFor:j},k))),b(c,"additional-field")&&t("div",{class:"dynamic-container",ref:e=>this.additionalFieldContainer=e},e==="dynamic"&&t("div",{class:"branch-corner"}),t("div",null,e==="dynamic"&&t("ic-typography",{variant:"caption"},t("p",{class:"dynamic-text","aria-live":"polite"},r)),t("div",{class:{"additional-field-wrapper":e==="static"}},t("slot",{name:"additional-field"})))))}static get delegatesFocus(){return true}get el(){return o(this)}};p.style=m;export{p as ic_checkbox};
|
2
|
+
//# sourceMappingURL=p-2e167ebb.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["icCheckboxCss","Checkbox","constructor","hostRef","this","handleClick","checked","icCheck","emit","checkboxChecked","handleFormReset","initiallyChecked","additionalFieldDisplay","disabled","dynamicText","form","undefined","formaction","formenctype","formmethod","formnovalidate","formtarget","groupLabel","indeterminate","label","name","size","small","value","componentWillLoad","removeDisabledFalse","el","addFormResetListener","checkboxGroup","parentElement","componentDidLoad","onComponentRequiredPropUndefined","prop","propName","componentDidRender","textfield","querySelector","setAttribute","removeAttribute","additionalFieldContainer","style","display","disconnectedCallback","removeFormResetListener","setFocus","_a","shadowRoot","focus","render","id","isPropDefined","replace","parentElementSize","renderHiddenInput","removeHiddenInput","h","Host","class","width","height","viewBox","xmlns","d","role","checkbox","type","onClick","variant","htmlFor","isSlotUsed","ref","delegatesFocus"],"sources":["../web-components/dist/collection/components/ic-checkbox/ic-checkbox.css?tag=ic-checkbox&encapsulation=shadow","../web-components/dist/collection/components/ic-checkbox/ic-checkbox.js"],"sourcesContent":["/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n\n/* Document\n ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/* Sections\n ========================================================================== */\n\n/**\n * Remove the margin in all browsers.\n */\n\nbody {\n margin: 0;\n}\n\n/**\n * Render the `main` element consistently in IE.\n */\n\nmain {\n display: block;\n}\n\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\n\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Remove the gray background on active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\n\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted; /* 2 */\n}\n\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove the border on images inside links in IE 10.\n */\n\nimg {\n border-style: none;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\n\nbutton,\ninput {\n /* 1 */\n overflow: visible;\n}\n\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\n\nbutton,\nselect {\n /* 1 */\n text-transform: none;\n}\n\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\n\nbutton,\n[type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\n/**\n * Remove the inner border and padding in Firefox.\n */\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus styles unset by the previous rule.\n */\n\nbutton:-moz-focusring,\n[type=\"button\"]:-moz-focusring,\n[type=\"reset\"]:-moz-focusring,\n[type=\"submit\"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/**\n * Correct the padding in Firefox.\n */\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\n\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n\n[type=\"checkbox\"],\n[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n[type=\"search\"] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/* Interactive\n ========================================================================== */\n\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\n\ndetails {\n display: block;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\nsummary {\n display: list-item;\n}\n\n/* Misc\n ========================================================================== */\n\n/**\n * Add the correct display in IE 10+.\n */\n\ntemplate {\n display: none;\n}\n\n/**\n * Add the correct display in IE 10.\n */\n\n[hidden] {\n display: none;\n}\n\nhtml,\nbody,\ndiv,\nspan,\napplet,\nobject,\niframe,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\np,\nblockquote,\npre,\na,\nabbr,\nacronym,\naddress,\nbig,\ncite,\ncode,\ndel,\ndfn,\nem,\nimg,\nins,\nkbd,\nq,\ns,\nsamp,\nsmall,\nstrike,\nstrong,\nsub,\nsup,\ntt,\nvar,\nb,\nu,\ni,\ncenter,\ndl,\ndt,\ndd,\nol,\nul,\nli,\nfieldset,\nform,\nlabel,\nlegend,\ntable,\ncaption,\ntbody,\ntfoot,\nthead,\ntr,\nth,\ntd,\narticle,\naside,\ncanvas,\ndetails,\nembed,\nfigure,\nfigcaption,\nfooter,\nheader,\nhgroup,\nmenu,\nnav,\noutput,\nruby,\nsection,\nsummary,\ntime,\nmark,\naudio,\nvideo {\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font-style: inherit;\n vertical-align: baseline;\n}\n\n\n:host(.disabled) {\n color: var(--ic-architectural-200);\n pointer-events: none;\n}\n\n.container {\n display: flex;\n width: -moz-fit-content;\n width: fit-content;\n padding: var(--ic-space-xxs) 0 var(--ic-space-xxs) var(--ic-space-xxs);\n margin-bottom: var(--ic-space-xxs);\n align-items: center;\n}\n\n:host(.small) .container {\n margin-bottom: var(--ic-space-xxxs);\n}\n\n.checkbox {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n display: block;\n position: relative;\n top: 0;\n left: 0;\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n background-color: var(--ic-architectural-white);\n border: var(--ic-border-width) solid var(--ic-architectural-300);\n border-radius: var(--ic-border-radius);\n outline: none;\n cursor: pointer;\n transition: var(--ic-easing-transition-fast);\n flex-shrink: 0;\n}\n\n:host(.small) .checkbox,\n:host(.small) .container svg {\n width: var(--ic-space-md);\n height: var(--ic-space-md);\n}\n\n:host(.large) .checkbox,\n:host(.large) .container svg {\n width: var(--ic-space-xl);\n height: var(--ic-space-xl);\n}\n\n.checkbox:checked {\n background-color: var(--ic-action-default);\n border: var(--ic-border-width) solid var(--ic-action-default);\n transition: var(--ic-easing-transition-slow);\n}\n\n.checkbox:checked:disabled {\n background-color: var(--ic-architectural-200);\n}\n\n.checkbox:indeterminate,\n.checkbox.indeterminate:checked {\n background-color: var(--ic-architectural-white);\n border: 0.125rem solid var(--ic-action-default);\n}\n\n.checkbox:checked:hover {\n background-color: var(--ic-action-default-hover);\n}\n\n.checkbox:indeterminate:hover,\n.checkbox.indeterminate:checked:hover {\n background-color: var(--ic-action-default-bg-hover-no-alpha);\n border: 0.125rem solid var(--ic-action-default-hover);\n}\n\n.checkbox:checked:active {\n background-color: var(--ic-action-default-active);\n}\n\n.checkbox:indeterminate:active,\n.checkbox.indeterminate:checked:active {\n background-color: var(--ic-action-default-bg-active-no-alpha);\n border: 0.125rem solid var(--ic-action-default-active);\n}\n\n.checkbox:hover {\n background-color: var(--ic-action-default-bg-hover-no-alpha);\n box-shadow: 0 0 0 0.25rem var(--ic-action-default-bg-hover);\n border: var(--ic-border-width) solid var(--ic-action-default-hover);\n}\n\n.checkbox:active {\n background-color: var(--ic-action-default-bg-active-no-alpha);\n box-shadow: 0 0 0 0.25rem var(--ic-action-default-bg-active);\n border: var(--ic-border-width) solid var(--ic-action-default-active);\n}\n\n.checkbox:focus {\n box-shadow: var(--ic-border-focus);\n}\n\n.checkbox:disabled {\n border: var(--ic-border-width) dashed var(--ic-architectural-200);\n}\n\n.checkbox-label {\n padding-left: var(--ic-space-sm);\n}\n\n.checkbox-label:hover {\n cursor: pointer;\n}\n\n.checkmark {\n position: relative;\n right: calc(-1 * var(--ic-space-lg));\n margin-left: calc(-1 * var(--ic-space-lg));\n fill: white;\n z-index: 1;\n background-color: transparent;\n pointer-events: none;\n flex-shrink: 0;\n}\n\n:host(.small) .checkmark {\n margin-left: calc(-1 * var(--ic-space-md));\n right: calc(-1 * var(--ic-space-md));\n}\n\n:host(.large) .checkmark {\n margin-left: calc(-1 * var(--ic-space-xl));\n right: calc(-1 * var(--ic-space-xl));\n}\n\n.indeterminate-symbol {\n position: relative;\n width: 0.875rem;\n height: var(--ic-space-xxxs);\n right: -1.188rem;\n margin-left: -0.875rem;\n z-index: 1;\n background-color: var(--ic-action-default);\n pointer-events: none;\n flex-shrink: 0;\n}\n\n:host(.small) .indeterminate-symbol {\n width: 0.6rem;\n right: -0.8rem;\n margin-left: -0.6rem;\n}\n\n:host(.large) .indeterminate-symbol {\n width: 1.25rem;\n right: -1.625rem;\n margin-left: -1.25rem;\n}\n\n.container:hover .indeterminate-symbol {\n background-color: var(--ic-action-default-hover);\n}\n\n.container:active .indeterminate-symbol {\n background-color: var(--ic-action-default-active);\n}\n\n.additional-field-wrapper {\n margin-left: calc(var(--ic-space-md) + var(--ic-space-lg));\n margin-top: calc(var(--ic-space-sm) / 2);\n}\n\n.branch-corner {\n color: var(--ic-action-default);\n height: var(--ic-space-md);\n width: var(--ic-space-xl);\n border-radius: 0 0 0 0.188rem;\n border-bottom: 0.125rem solid var(--ic-action-default);\n border-left: 0.125rem solid var(--ic-action-default);\n}\n\n.dynamic-container {\n display: flex;\n position: relative;\n margin: var(--ic-space-xxxs) 0 var(--ic-space-xxs) var(--ic-space-md);\n gap: var(--ic-space-xs);\n}\n\n.dynamic-text {\n color: var(--ic-action-default);\n margin-top: calc(var(--ic-space-sm) / 2);\n margin-bottom: var(--ic-space-xs);\n border-radius: 2%;\n}\n\n@media (max-width: 576px) {\n ::slotted(ic-text-field) {\n --input-width: 100%;\n }\n}\n\n@media (forced-colors: active) {\n /* Styles here only apply to Forced Colors Mode */\n .checkbox {\n -webkit-appearance: revert;\n -moz-appearance: revert;\n appearance: revert;\n transition: none;\n }\n\n .checkbox:checked {\n transition: none;\n }\n\n .checkbox:focus-visible {\n outline: 0.125rem solid highlight;\n }\n\n .checkbox:disabled:not(:checked) {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border-color: GrayText;\n }\n\n .checkmark {\n fill: none;\n }\n\n .indeterminate-symbol {\n display: none;\n }\n}\n","import { Host, h, } from \"@stencil/core\";\nimport { isSlotUsed, onComponentRequiredPropUndefined, renderHiddenInput, removeHiddenInput, addFormResetListener, removeFormResetListener, removeDisabledFalse, isPropDefined, } from \"../../utils/helpers\";\n/**\n * @slot additional-field - Content to be displayed alongside a checkbox.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport class Checkbox {\n constructor() {\n this.handleClick = () => {\n this.checked = !this.checked;\n this.icCheck.emit();\n this.checkboxChecked.emit();\n };\n this.handleFormReset = () => {\n this.checked = this.initiallyChecked;\n };\n this.additionalFieldDisplay = \"static\";\n this.checked = false;\n this.initiallyChecked = this.checked;\n this.disabled = false;\n this.dynamicText = \"This selection requires additional answers\";\n this.form = undefined;\n this.formaction = undefined;\n this.formenctype = undefined;\n this.formmethod = undefined;\n this.formnovalidate = undefined;\n this.formtarget = undefined;\n this.groupLabel = undefined;\n this.indeterminate = false;\n this.label = undefined;\n this.name = undefined;\n this.size = undefined;\n this.small = false;\n this.value = undefined;\n }\n componentWillLoad() {\n removeDisabledFalse(this.disabled, this.el);\n addFormResetListener(this.el, this.handleFormReset);\n const checkboxGroup = this.el.parentElement;\n if (checkboxGroup) {\n if (!this.name)\n this.name = checkboxGroup.name;\n this.groupLabel = checkboxGroup.label;\n }\n }\n componentDidLoad() {\n onComponentRequiredPropUndefined([\n { prop: this.label, propName: \"label\" },\n { prop: this.value, propName: \"value\" },\n ], \"Checkbox\");\n }\n componentDidRender() {\n if (this.additionalFieldDisplay === \"static\") {\n const textfield = this.el.querySelector(\"ic-text-field\");\n if (!this.checked) {\n textfield === null || textfield === void 0 ? void 0 : textfield.setAttribute(\"disabled\", \"\");\n }\n else {\n textfield === null || textfield === void 0 ? void 0 : textfield.removeAttribute(\"disabled\");\n }\n }\n else if (this.additionalFieldContainer) {\n this.additionalFieldContainer.style.display = !this.checked\n ? \"none\"\n : \"flex\";\n }\n }\n disconnectedCallback() {\n removeFormResetListener(this.el, this.handleFormReset);\n }\n /**\n * Sets focus on the checkbox.\n */\n async setFocus() {\n var _a;\n (_a = this.el.shadowRoot.querySelector(\".checkbox\")) === null || _a === void 0 ? void 0 : _a.focus();\n }\n render() {\n const { additionalFieldDisplay, checked, disabled, dynamicText, el, form, formaction, formenctype, formmethod, formnovalidate, formtarget, indeterminate, groupLabel, label, name, size, small, value, } = this;\n const id = `ic-checkbox-${isPropDefined(label) || value}-${groupLabel}`.replace(/ /g, \"-\");\n const parentElementSize = el.parentElement\n .size;\n checked\n ? renderHiddenInput(true, el, name, checked && value, disabled)\n : removeHiddenInput(el);\n return (h(Host, { class: {\n disabled,\n small,\n [`${size || parentElementSize}`]: true,\n } }, h(\"div\", { class: \"container\" }, checked &&\n (!indeterminate ? (h(\"svg\", { class: \"checkmark\", width: \"1.5rem\", height: \"1.5rem\", viewBox: \"0 0 24 24\", xmlns: \"http://www.w3.org/2000/svg\", \"fill-rule\": \"evenodd\", \"clip-rule\": \"evenodd\" }, h(\"title\", null, \"checkmark icon\"), h(\"path\", { d: \"M21 6.285l-11.16 12.733-6.84-6.018 1.319-1.49 5.341 4.686 9.865-11.196 1.475 1.285z\" }))) : (h(\"div\", { class: \"indeterminate-symbol\" }))), h(\"input\", { role: \"checkbox\", class: {\n checkbox: true,\n checked,\n indeterminate,\n }, type: \"checkbox\", name: name, id: id, value: value, disabled: disabled ? true : null, checked: checked, indeterminate: indeterminate, onClick: this.handleClick, form: form, formaction: formaction, formenctype: formenctype, formmethod: formmethod, formnovalidate: formnovalidate, formtarget: formtarget }), h(\"ic-typography\", { class: \"checkbox-label\", variant: \"body\" }, h(\"label\", { htmlFor: id }, label))), isSlotUsed(el, \"additional-field\") && (h(\"div\", { class: \"dynamic-container\", ref: (el) => (this.additionalFieldContainer = el) }, additionalFieldDisplay === \"dynamic\" && (h(\"div\", { class: \"branch-corner\" })), h(\"div\", null, additionalFieldDisplay === \"dynamic\" && (h(\"ic-typography\", { variant: \"caption\" }, h(\"p\", { class: \"dynamic-text\", \"aria-live\": \"polite\" }, dynamicText))), h(\"div\", { class: {\n \"additional-field-wrapper\": additionalFieldDisplay === \"static\",\n } }, h(\"slot\", { name: \"additional-field\" })))))));\n }\n static get is() { return \"ic-checkbox\"; }\n static get encapsulation() { return \"shadow\"; }\n static get delegatesFocus() { return true; }\n static get originalStyleUrls() {\n return {\n \"$\": [\"ic-checkbox.css\"]\n };\n }\n static get styleUrls() {\n return {\n \"$\": [\"ic-checkbox.css\"]\n };\n }\n static get properties() {\n return {\n \"additionalFieldDisplay\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"IcAdditionalFieldTypes\",\n \"resolved\": \"\\\"dynamic\\\" | \\\"static\\\"\",\n \"references\": {\n \"IcAdditionalFieldTypes\": {\n \"location\": \"import\",\n \"path\": \"../../utils/types\",\n \"id\": \"src/utils/types.ts::IcAdditionalFieldTypes\"\n }\n }\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The style of additionalField that will be displayed if used.\"\n },\n \"attribute\": \"additional-field-display\",\n \"reflect\": true,\n \"defaultValue\": \"\\\"static\\\"\"\n },\n \"checked\": {\n \"type\": \"boolean\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"If `true`, the checkbox will be set to the checked state.\"\n },\n \"attribute\": \"checked\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"disabled\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"If `true`, the checkbox will be set to the disabled state.\"\n },\n \"attribute\": \"disabled\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"dynamicText\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The text to be displayed when dynamic.\"\n },\n \"attribute\": \"dynamic-text\",\n \"reflect\": false,\n \"defaultValue\": \"\\\"This selection requires additional answers\\\"\"\n },\n \"form\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The <form> element to associate the checkbox with.\"\n },\n \"attribute\": \"form\",\n \"reflect\": false\n },\n \"formaction\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The URL that processes the information submitted by the checkbox. It overrides the action attribute of the checkbox's form owner. Does nothing if there is no form owner.\"\n },\n \"attribute\": \"formaction\",\n \"reflect\": false\n },\n \"formenctype\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The way the submitted form data is encoded.\"\n },\n \"attribute\": \"formenctype\",\n \"reflect\": false\n },\n \"formmethod\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The HTTP method used to submit the form.\"\n },\n \"attribute\": \"formmethod\",\n \"reflect\": false\n },\n \"formnovalidate\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"If `true`, the form will not be validated when submitted.\"\n },\n \"attribute\": \"formnovalidate\",\n \"reflect\": false\n },\n \"formtarget\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The place to display the response from submitting the form. It overrides the target attribute of the checkbox's form owner.\"\n },\n \"attribute\": \"formtarget\",\n \"reflect\": false\n },\n \"groupLabel\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The group label for the checkbox.\"\n },\n \"attribute\": \"group-label\",\n \"reflect\": false\n },\n \"indeterminate\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"If `true`, the indeterminate state will be displayed when checked.\"\n },\n \"attribute\": \"indeterminate\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"label\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": true,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The label for the checkbox.\"\n },\n \"attribute\": \"label\",\n \"reflect\": false\n },\n \"name\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The name for the checkbox. If not set when used in a checkbox group, the name will be based on the group name.\"\n },\n \"attribute\": \"name\",\n \"reflect\": false\n },\n \"size\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"IcSizes\",\n \"resolved\": \"\\\"default\\\" | \\\"large\\\" | \\\"small\\\"\",\n \"references\": {\n \"IcSizes\": {\n \"location\": \"import\",\n \"path\": \"../../utils/types\",\n \"id\": \"src/utils/types.ts::IcSizes\"\n }\n }\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The size of the checkbox to be displayed. This does not affect the font size of the label. If a checkbox is contained in a checkbox group, this will override the size set on checkbox group.\"\n },\n \"attribute\": \"size\",\n \"reflect\": false\n },\n \"small\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [{\n \"name\": \"deprecated\",\n \"text\": \"This prop should not be used anymore. Set prop `size` to \\\"small\\\" instead.\"\n }],\n \"text\": \"\"\n },\n \"attribute\": \"small\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"value\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": true,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The value for the checkbox.\"\n },\n \"attribute\": \"value\",\n \"reflect\": false\n }\n };\n }\n static get states() {\n return {\n \"initiallyChecked\": {}\n };\n }\n static get events() {\n return [{\n \"method\": \"checkboxChecked\",\n \"name\": \"checkboxChecked\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [{\n \"name\": \"deprecated\",\n \"text\": \"This event should not be used anymore. Use icCheck instead.\"\n }],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"void\",\n \"resolved\": \"void\",\n \"references\": {}\n }\n }, {\n \"method\": \"icCheck\",\n \"name\": \"icCheck\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Emitted when a checkbox has been checked.\"\n },\n \"complexType\": {\n \"original\": \"void\",\n \"resolved\": \"void\",\n \"references\": {}\n }\n }];\n }\n static get methods() {\n return {\n \"setFocus\": {\n \"complexType\": {\n \"signature\": \"() => Promise<void>\",\n \"parameters\": [],\n \"references\": {\n \"Promise\": {\n \"location\": \"global\",\n \"id\": \"global::Promise\"\n },\n \"HTMLElement\": {\n \"location\": \"global\",\n \"id\": \"global::HTMLElement\"\n }\n },\n \"return\": \"Promise<void>\"\n },\n \"docs\": {\n \"text\": \"Sets focus on the checkbox.\",\n \"tags\": []\n }\n }\n };\n }\n static get elementRef() { return \"el\"; }\n}\n//# sourceMappingURL=ic-checkbox.js.map\n"],"mappings":"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"}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as o,c as t,h as r,H as e}from"./p-8455d1bb.js";import{G as s,H as i,W as c,c as a,b as h}from"./p-11bbb09c.js";import"./p-fd186591.js";const n=class{constructor(r){o(this,r);this.themeChange=t(this,"themeChange",7);this.checkThemeColorContrast=()=>{if(s()<i&&s()>c){console.warn(`The theme colour does not provide enough contrast with either of the ICDS black or white foreground colours. Consider choosing a colour with a different brightness to achieve sufficient colour contrast for good visibility. See https://www.w3.org/TR/AERT/#color-contrast for more information about colour contrast.`)}};this.setThemeColor=()=>{const o=a(this.color);if(o){const{r:t,g:r,b:e,a:s}=o;const{style:i}=document.documentElement;i.setProperty("--ic-theme-primary-r",`${t}`);i.setProperty("--ic-theme-primary-g",`${r}`);i.setProperty("--ic-theme-primary-b",`${e}`);i.setProperty("--ic-theme-primary-a",`${s}`);this.checkThemeColorContrast();this.themeChange.emit({mode:h(),color:o})}};this.color=null}watchColorPropHandler(){this.setThemeColor()}componentWillLoad(){this.setThemeColor()}render(){return r(e,null)}static get watchers(){return{color:["watchColorPropHandler"]}}};export{n as ic_theme};
|
2
|
+
//# sourceMappingURL=p-3f20608d.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["Theme","constructor","hostRef","this","checkThemeColorContrast","getThemeColorBrightness","BLACK_MIN_COLOR_BRIGHTNESS","WHITE_MAX_COLOR_BRIGHTNESS","console","warn","setThemeColor","colorRGBA","convertToRGBA","color","r","g","b","a","style","document","documentElement","setProperty","themeChange","emit","mode","getThemeForegroundColor","watchColorPropHandler","componentWillLoad","render","h","Host"],"sources":["../web-components/dist/collection/components/ic-theme/ic-theme.js"],"sourcesContent":["import { Host, h, } from \"@stencil/core\";\nimport { convertToRGBA, getThemeForegroundColor } from \"../../utils/helpers\";\nimport { getThemeColorBrightness } from \"../../utils/helpers\";\nimport { BLACK_MIN_COLOR_BRIGHTNESS, WHITE_MAX_COLOR_BRIGHTNESS, } from \"../../utils/constants\";\nexport class Theme {\n constructor() {\n this.checkThemeColorContrast = () => {\n if (getThemeColorBrightness() < BLACK_MIN_COLOR_BRIGHTNESS &&\n getThemeColorBrightness() > WHITE_MAX_COLOR_BRIGHTNESS) {\n console.warn(`The theme colour does not provide enough contrast with either of the ICDS black or white foreground colours. Consider choosing a colour with a different brightness to achieve sufficient colour contrast for good visibility. See https://www.w3.org/TR/AERT/#color-contrast for more information about colour contrast.`);\n }\n };\n this.setThemeColor = () => {\n const colorRGBA = convertToRGBA(this.color);\n if (colorRGBA) {\n const { r, g, b, a } = colorRGBA;\n const { style } = document.documentElement;\n style.setProperty(\"--ic-theme-primary-r\", `${r}`);\n style.setProperty(\"--ic-theme-primary-g\", `${g}`);\n style.setProperty(\"--ic-theme-primary-b\", `${b}`);\n style.setProperty(\"--ic-theme-primary-a\", `${a}`);\n this.checkThemeColorContrast();\n this.themeChange.emit({\n mode: getThemeForegroundColor(),\n color: colorRGBA,\n });\n }\n };\n this.color = null;\n }\n watchColorPropHandler() {\n this.setThemeColor();\n }\n componentWillLoad() {\n this.setThemeColor();\n }\n render() {\n return h(Host, null);\n }\n static get is() { return \"ic-theme\"; }\n static get encapsulation() { return \"shadow\"; }\n static get properties() {\n return {\n \"color\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"IcColor\",\n \"resolved\": \"`#${string}` | `rgb(${string})` | `rgba(${string})`\",\n \"references\": {\n \"IcColor\": {\n \"location\": \"import\",\n \"path\": \"../../utils/types\",\n \"id\": \"src/utils/types.ts::IcColor\"\n }\n }\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The theme colour. Can be a hex value e.g. \\\"#ff0000\\\", RGB e.g. \\\"rgb(255, 0, 0)\\\", or RGBA e.g. \\\"rgba(255, 0, 0, 1)\\\".\"\n },\n \"attribute\": \"color\",\n \"reflect\": false,\n \"defaultValue\": \"null\"\n }\n };\n }\n static get events() {\n return [{\n \"method\": \"themeChange\",\n \"name\": \"themeChange\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [{\n \"name\": \"internal\",\n \"text\": \"Emitted when the theme is changed.\"\n }],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"IcTheme\",\n \"resolved\": \"{ mode: IcThemeForeground; color: IcColorRGB; }\",\n \"references\": {\n \"IcTheme\": {\n \"location\": \"import\",\n \"path\": \"../../utils/types\",\n \"id\": \"src/utils/types.ts::IcTheme\"\n }\n }\n }\n }];\n }\n static get watchers() {\n return [{\n \"propName\": \"color\",\n \"methodName\": \"watchColorPropHandler\"\n }];\n }\n}\n//# sourceMappingURL=ic-theme.js.map\n"],"mappings":"uJAIaA,EAAK,MACd,WAAAC,CAAAC,G,mDACIC,KAAKC,wBAA0B,KAC3B,GAAIC,IAA4BC,GAC5BD,IAA4BE,EAA4B,CACxDC,QAAQC,KAAK,4T,GAGrBN,KAAKO,cAAgB,KACjB,MAAMC,EAAYC,EAAcT,KAAKU,OACrC,GAAIF,EAAW,CACX,MAAMG,EAAEA,EAACC,EAAEA,EAACC,EAAEA,EAACC,EAAEA,GAAMN,EACvB,MAAMO,MAAEA,GAAUC,SAASC,gBAC3BF,EAAMG,YAAY,uBAAwB,GAAGP,KAC7CI,EAAMG,YAAY,uBAAwB,GAAGN,KAC7CG,EAAMG,YAAY,uBAAwB,GAAGL,KAC7CE,EAAMG,YAAY,uBAAwB,GAAGJ,KAC7Cd,KAAKC,0BACLD,KAAKmB,YAAYC,KAAK,CAClBC,KAAMC,IACNZ,MAAOF,G,GAInBR,KAAKU,MAAQ,I,CAEjB,qBAAAa,GACIvB,KAAKO,e,CAET,iBAAAiB,GACIxB,KAAKO,e,CAET,MAAAkB,GACI,OAAOC,EAAEC,EAAM,K"}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as t,c as e,h as i,F as a,g as n}from"./p-8455d1bb.js";import{i as s,g as o}from"./p-c07cef0e.js";const l=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24">\n <path d="M9 3 5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z"></path>\n</svg>`;const r=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" style="transform: rotate(-90deg);">\n <path d="M16.01 11H4v2h12.01v3L20 12l-3.99-4z"></path>\n</svg>`;const h=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" style="transform: rotate(90deg)">\n <path d="M16.01 11H4v2h12.01v3L20 12l-3.99-4z"></path>\n</svg>`;const c=':host{position:relative;display:block;height:100%;max-height:100%}.table-container{position:relative;height:calc(100% - var(--ic-space-xxxs))}ic-loading-indicator{position:sticky;top:20px}.table-row-container{position:relative;height:100%;overflow:auto;transition:var(--ic-easing-transition-fast);overflow-anchor:none}:host([show-pagination="true"]) .table-row-container{height:calc(100% - 3.5625rem)}table{table-layout:fixed;border-spacing:0;width:100%}.table-row-container:focus{outline:none;box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-fast);z-index:1}:host([embedded="true"]) .table-row-container{border:var(--ic-border-light)}.column-header-sticky{position:sticky;top:0;z-index:1}.column-header-overlay{position:sticky;top:0;z-index:1;box-shadow:0 0.375rem var(--ic-space-xs) calc(var(--ic-space-xxs * -1))\n rgb(0 0 0 / 20%)}.row-header-sticky{position:sticky;left:0}.column-header,.table-row{box-sizing:border-box}.table-row-selected{background-color:var(--ic-table-row-selected) !important}.sort-button{margin-left:auto}.sort-button:hover{background-color:var(--ic-action-dark-bg-hover)}.sort-button:active{background-color:var(--ic-action-dark-bg-active)}.sort-button svg{color:var(--ic-architectural-black)}.sort-button-unsorted svg{color:var(--ic-color-tertiary-text)}.table-density-dense{padding:var(--ic-space-xxs) var(--ic-space-xs) !important}.text-dense{font-size:var(--ic-font-size-label)}.table-density-spacious{padding:0.625rem var(--ic-space-xs) !important}.text-spacious{font-size:1.125rem}.column-header-text{font-weight:var(--ic-font-weight-bold)}.column-header,.row-header{text-align:left;padding:var(--ic-space-xs);background-color:var(--ic-architectural-40);border-right:var(--ic-border-light);border-bottom:var(--ic-border-light)}.column-header:last-child{border-right:none}.scrollable .column-header:last-child{border-right:var(--ic-border-light) !important}:host([embedded="true"]) tr:last-child .table-cell,:host([embedded="true"]) tr:last-child .row-header{border-bottom:none}.column-header-alignment-left,.row-header-alignment-left,.cell-alignment-left{text-align:left !important;justify-content:start !important}.column-header-alignment-right,.row-header-alignment-right,.cell-alignment-right{text-align:right !important;justify-content:end !important}.column-header-alignment-center,.row-header-alignment-center,.cell-alignment-center{text-align:center !important;justify-content:center !important}.table-row:nth-child(even){background-color:var(--ic-architectural-20)}.table-cell{padding:var(--ic-space-xs);border-bottom:solid var(--ic-architectural-100) var(--ic-space-1px)}.data-type-string{text-align:left;vertical-align:top}.data-type-number,.data-type-date{text-align:right;justify-content:end;vertical-align:top}.cell-alignment-top{vertical-align:top}.cell-alignment-middle{vertical-align:middle}.cell-alignment-bottom{vertical-align:bottom}.cell-emphasis-low{color:var(--ic-color-secondary-text)}.cell-emphasis-high{font-weight:var(--ic-font-weight-bold)}.pagination-container{background-color:var(--ic-architectural-40);border-top:var(--ic-border-light)}.screen-reader-sort-text,.table-caption{position:absolute;left:-100rem}.table-cell,.column-header,.row-header{word-wrap:break-word;white-space:pre-wrap}.loading-empty{padding:var(--ic-space-xl) var(--ic-space-xxl);margin-top:var(--ic-space-xl)}.updating-state{padding:0;border-bottom:var(--ic-border-light)}.updating-state-headers{border-bottom:none}.loading{position:absolute;left:calc(50% - 5.9741rem);opacity:0;transition:opacity var(--ic-transition-duration-slow)}.loading.show-background{background-color:var(--ic-architectural-white);border:var(--ic-border-light)}.loading.show{opacity:1}.icon,::slotted(svg){height:var(--ic-space-lg);width:var(--ic-space-lg);margin-right:var(--ic-space-xxs)}.column-header-alignment-right>.icon,.row-header-alignment-right>.icon,.cell-alignment-right>.icon,.column-header-alignment-right>::slotted(svg),.row-header-alignment-right>::slotted(svg),.cell-alignment-right>::slotted(svg){margin-right:auto}.column-header-alignment-center>ic-typography,.row-header-alignment-right>ic-typography,.cell-alignment-center>ic-typography{flex:1}.icon>svg{height:var(--ic-space-lg);width:var(--ic-space-lg);display:inline-block}@media screen and (min-width: 576px){.column-header-inner-container{display:flex;align-items:center}.cell-container{display:flex}}';const d=class{constructor(n){t(this,n);this.icRowHeightChange=e(this,"icRowHeightChange",7);this.DENSITY_HEIGHT_MULTIPLIER={dense:.8,default:1,spacious:1.2};this.SORT_ICONS={unsorted:l,ascending:r,descending:h};this.hasLoadedForOneSecond=true;this.startLoadingTimer=()=>{this.hasLoadedForOneSecond=false;this.timerStarted=Date.now();setTimeout((()=>{this.hasLoadedForOneSecond=true;this.timerStarted=null}),this.minimumLoadingDisplayDuration)};this.isObject=t=>typeof t==="object";this.notDefaultDensity=()=>this.density!=="default";this.getCellContent=(t,e)=>{switch(e){case"element":return undefined;case"date":return(t instanceof Date?t:new Date(t)).toLocaleDateString();default:return t}};this.getCellAlignment=(t,e)=>{if(this.isObject(t)&&Object.keys(t).includes("cellAlignment")){return this.getObjectValue(this.getObjectValue(t,"cellAlignment"),e)}};this.createUpdatingIndicator=()=>{const{appearance:t,description:e,max:a,min:n,progress:s}=this.updatingOptions||{};return i("th",{colSpan:this.columns.length,class:"updating-state"},i("ic-loading-indicator",{appearance:t,description:e||"Updating table data",fullWidth:true,max:a,min:n,progress:s,type:"linear",size:"small"}))};this.createCells=(t,e)=>{const n=Object.values(t);const o=Object.keys(t);let l;let r;const h=o.indexOf("header");if(h>-1){l=this.getObjectValue(n[h],"rowAlignment");r=this.getObjectValue(n[h],"emphasis")}return n.map(((t,n)=>{var h,c,d,u,g;const v=this.columns[n];const p=`${v===null||v===void 0?void 0:v.key}-${e}`;const b=this.isObject(t)&&Object.keys(t).includes("icon");const m=e=>this.getObjectValue(t,e);return o[n]==="header"?i("th",{scope:"row",colSpan:m("colspan"),class:{["row-header"]:true,[`row-header-alignment-${m("cellAlignment")}`]:!!m("cellAlignment"),["row-header-sticky"]:this.stickyRowHeaders}},m("title")):i("td",{class:{["table-cell"]:true,[`table-density-${this.density}`]:this.notDefaultDensity(),[`data-type-${v===null||v===void 0?void 0:v.dataType}`]:true,[`cell-alignment-${((h=v===null||v===void 0?void 0:v.columnAlignment)===null||h===void 0?void 0:h.vertical)||l||this.getCellAlignment(t,"vertical")}`]:!!((c=v===null||v===void 0?void 0:v.columnAlignment)===null||c===void 0?void 0:c.vertical)||!!l||!!this.getCellAlignment(t,"vertical")}},i("div",{innerHTML:(v===null||v===void 0?void 0:v.dataType)==="element"&&!s(this.el,p)?t:null,class:{"cell-container":(v===null||v===void 0?void 0:v.dataType)!=="element",[`data-type-${v===null||v===void 0?void 0:v.dataType}`]:true,[`cell-alignment-${((d=v===null||v===void 0?void 0:v.columnAlignment)===null||d===void 0?void 0:d.horizontal)||this.getCellAlignment(t,"horizontal")}`]:!!((u=v===null||v===void 0?void 0:v.columnAlignment)===null||u===void 0?void 0:u.horizontal)||!!this.getCellAlignment(t,"horizontal")}},s(this.el,p)?i("slot",{name:p}):i(a,null,s(this.el,`${p}-icon`)?i("slot",{name:`${p}-icon`}):(b||((g=v===null||v===void 0?void 0:v.icon)===null||g===void 0?void 0:g.onAllCells))&&i("span",{class:"icon",innerHTML:m("icon")||(v===null||v===void 0?void 0:v.icon.icon)}),i("ic-typography",{variant:"body",class:{[`cell-emphasis-${this.isObject(t)&&m("emphasis")||(v===null||v===void 0?void 0:v.emphasis)||r}`]:this.isObject(t)&&!!m("emphasis")||!!(v===null||v===void 0?void 0:v.emphasis)||!!r,[`text-${this.density}`]:this.notDefaultDensity()}},this.isObject(t)&&(v===null||v===void 0?void 0:v.dataType)!=="date"?Object.keys(t).includes("href")?i("ic-link",{href:m("href")},m("data")):m("data"):this.getCellContent(t,v===null||v===void 0?void 0:v.dataType)))))}))};this.createColumnHeaders=()=>this.columns.map((({cellAlignment:t,colspan:e,icon:a,key:n,title:o})=>i("th",{scope:"col",class:{["column-header"]:true,[`table-density-${this.density}`]:this.notDefaultDensity(),["updating-state-headers"]:this.updating&&!this.loading},colSpan:e},i("div",{class:{"column-header-inner-container":true,[`column-header-alignment-${t}`]:!!t}},s(this.el,`${n}-column-icon`)?i("slot",{name:`${n}-column-icon`}):a&&!a.hideOnHeader&&i("span",{class:"icon",innerHTML:a.icon}),i("ic-typography",{variant:"body",class:{["column-header-text"]:true,[`text-${this.density}`]:this.notDefaultDensity()}},o),this.sortable&&i("ic-button",{variant:"icon",id:`sort-button-${n}`,"aria-label":this.getSortButtonLabel(n),onClick:()=>this.sortRows(n),innerHTML:this.SORT_ICONS[this.sortedColumn===n?this.sortedColumnOrder:"unsorted"],class:{["sort-button"]:true,["sort-button-unsorted"]:this.sortedColumn!==n||this.sortedColumnOrder==="unsorted"}})))));this.createRows=()=>{const t=this.showPagination?this.data.slice(this.fromRow,this.toRow):this.data.slice();this.columns.forEach((({key:e})=>{t.forEach(((t,i)=>{const a=`${e}-${i}`;if(s(this.el,a)){t[e]=o(this.el,a)}}))}));return t.sort(!this.sortable?undefined:this.getSortFunction()).map(((t,e)=>{var a;const n=(a=this.variableRowHeight)===null||a===void 0?void 0:a.call(this,Object.assign(Object.assign({},t),{index:e}));const s=n?n!=="auto"&&n:this.globalRowHeight!=="auto"&&this.globalRowHeight;return i("tr",{onClick:()=>this.selectedRow=this.selectedRow!==t&&!this.loading&&!this.updating&&t,class:{["table-row"]:true,["table-row-selected"]:this.selectedRow===t},style:{height:s?`${s*this.DENSITY_HEIGHT_MULTIPLIER[this.density]}px`:null}},this.createCells(t,e))}))};this.getObjectValue=(t,e)=>Object.values(t)[Object.keys(t).indexOf(e)];this.getSortButtonLabel=t=>{let e="";const i=t=>{const e=this.sortOptions.sortOrders;return e[(e.indexOf(t)+1)%e.length]};if(this.sortedColumn===t){const t=i(this.sortedColumnOrder);e=t!=="unsorted"?`Sort ${t}`:"Remove sort"}else{e=`Sort ${i("unsorted")}`}return e};this.getComparison=(t,e)=>{const i=t[this.sortedColumn];const a=e[this.sortedColumn];return this.columns.find((t=>t.key===this.sortedColumn)).dataType==="date"?new Date(i).valueOf()-new Date(a).valueOf():String(this.isObject(i)?Object.values(i)[0]:i).localeCompare(String(this.isObject(a)?Object.values(a)[0]:a),undefined,{numeric:true,sensitivity:"base"})};this.getSortFunction=()=>{switch(this.sortedColumnOrder){case"ascending":return(t,e)=>this.getComparison(t,e);case"descending":return(t,e)=>this.getComparison(e,t);default:return undefined}};this.sortRows=t=>{const e=this.el.shadowRoot.querySelector(`#sort-button-${t}`);const i=this.sortOptions.sortOrders;if(t!==this.sortedColumn){if(this.sortedColumn){const e=this.el.shadowRoot.querySelector(`#sort-button-${this.sortedColumn}`);e.setAttribute("aria-label",this.getSortButtonLabel(t))}this.sortedColumn=t;this.sortedColumnOrder="unsorted"}let a=i.indexOf(this.sortedColumnOrder)+1;if(a>i.length-1){a=0}this.sortedColumnOrder=i[a];e.setAttribute("aria-label",this.getSortButtonLabel(t))};this.updateScrollOffset=()=>{this.scrollOffset=this.el.shadowRoot.querySelector(".table-row-container").scrollTop};this.fromRow=0;this.previousRowsPerPage=undefined;this.rowsPerPage=undefined;this.scrollable=false;this.scrollOffset=0;this.selectedRow=undefined;this.sortedColumn=undefined;this.sortedColumnOrder=undefined;this.toRow=undefined;this.caption=undefined;this.columns=undefined;this.data=undefined;this.density="default";this.embedded=false;this.globalRowHeight=40;this.hideColumnHeaders=false;this.loading=false;this.loadingOptions=undefined;this.minimumLoadingDisplayDuration=1e3;this.paginationOptions={itemsPerPage:[{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"}],rangeLabelType:"page",type:"simple",itemsPerPageControl:true,goToPageControl:true,alignment:"right"};this.showPagination=false;this.sortable=false;this.sortOptions={sortOrders:["unsorted","ascending","descending"],defaultColumn:""};this.stickyColumnHeaders=false;this.stickyRowHeaders=false;this.updating=false;this.updatingOptions=undefined;this.variableRowHeight=undefined}componentWillLoad(){var t;this.rowsPerPage=Number(this.paginationOptions.itemsPerPage[0].value);this.previousRowsPerPage=this.rowsPerPage;this.toRow=this.rowsPerPage;this.sortedColumn=this.sortOptions.defaultColumn;this.sortedColumnOrder=this.sortOptions.sortOrders[0];this.loadingOptions=Object.assign(Object.assign({},this.loadingOptions),{showBackground:((t=this.data)===null||t===void 0?void 0:t.length)>0})}componentDidLoad(){const t=this.el.shadowRoot.querySelector("table");const e=this.el.shadowRoot.querySelector(".table-container");if((t===null||t===void 0?void 0:t.clientHeight)>(e===null||e===void 0?void 0:e.clientHeight)||(t===null||t===void 0?void 0:t.clientWidth)>(e===null||e===void 0?void 0:e.clientWidth)){this.scrollable=true}if(this.loading){this.startLoadingTimer();this.showLoadingIndicator()}}handleItemsPerPageChange(t){this.previousRowsPerPage=this.rowsPerPage;this.rowsPerPage=t.detail.value}handlePageChange(t){this.fromRow=(t.detail.value-1)*this.rowsPerPage;this.toRow=this.fromRow+this.rowsPerPage;const e=this.el.shadowRoot.querySelector(".table-row-container");if(this.previousRowsPerPage===this.rowsPerPage){e.scrollTop=0}else if(this.previousRowsPerPage<this.rowsPerPage){e.scrollTop=this.scrollOffset;this.previousRowsPerPage=this.rowsPerPage}else{this.previousRowsPerPage=this.rowsPerPage}}handleDensityChange(t){this.density=t.detail.value}clickListener(t){if(t.target!==this.el)this.selectedRow=undefined}loadingHandler(t){if(t)this.startLoadingTimer();if(this.loading){setTimeout((()=>{this.showLoadingIndicator()}),500)}}dataHandler(t){this.loadingOptions=Object.assign(Object.assign({},this.loadingOptions),{showBackground:(t===null||t===void 0?void 0:t.length)>0});if(this.loading){!this.hasLoadedForOneSecond?setTimeout((()=>this.loading=false),this.minimumLoadingDisplayDuration-(Date.now()-this.timerStarted)):this.loading=false}if(this.updating)this.updating=false}rowHeightChangeHandler(){this.icRowHeightChange.emit()}async resetRowHeights(){this.globalRowHeight=40;this.variableRowHeight=null}showLoadingIndicator(){this.loadingIndicator.classList.add("show")}render(){const{caption:t,createColumnHeaders:e,createRows:a,createUpdatingIndicator:n,data:o,hideColumnHeaders:l,loading:r,loadingOptions:h,paginationOptions:c,scrollable:d,scrollOffset:u,showPagination:g,sortable:v,sortedColumnOrder:p,sortedColumn:b,stickyColumnHeaders:m,updateScrollOffset:f,updating:w}=this;return i("div",{class:"table-container"},s(this.el,"title-bar")&&i("slot",{name:"title-bar"}),i("div",{class:{["table-row-container"]:true,scrollable:d},tabIndex:d?0:null,onScroll:f},i("table",null,i("caption",{class:"table-caption"},t),!l&&i("thead",{class:{["column-header-sticky"]:m,["column-header-overlay"]:m&&u!==0}},i("tr",null,e())),w&&!r&&(l?i("thead",null,n()):n()),(o===null||o===void 0?void 0:o.length)>0&&i("tbody",null,a())),!(o===null||o===void 0?void 0:o.length)&&!r&&(s(this.el,"empty-state")?i("slot",{name:"empty-state"}):i("ic-empty-state",{aligned:"center",heading:"No Data",class:"loading-empty"}))),r&&i("ic-loading-indicator",{appearance:h===null||h===void 0?void 0:h.appearance,class:{"loading-empty":r,loading:true,"show-background":h.showBackground},description:h.description||"Loading table data",label:h.label||"Loading...",labelDuration:h===null||h===void 0?void 0:h.labelDuration,max:h===null||h===void 0?void 0:h.max,min:h===null||h===void 0?void 0:h.min,progress:h===null||h===void 0?void 0:h.progress,ref:t=>this.loadingIndicator=t}),g&&i("div",{class:"pagination-container"},i("ic-pagination-bar",{totalItems:o.length,type:c.type,rangeLabelType:c.rangeLabelType,showItemsPerPageControl:c.itemsPerPageControl,showGoToPageControl:c.goToPageControl,itemsPerPageOptions:c.itemsPerPage,alignment:c.alignment})),v&&i("div",{class:"screen-reader-sort-text","aria-live":"polite"},p!=="unsorted"&&b?`${b} sorted ${p}`:"table unsorted"))}get el(){return n(this)}static get watchers(){return{loading:["loadingHandler"],data:["dataHandler"],globalRowHeight:["rowHeightChangeHandler"],variableRowHeight:["rowHeightChangeHandler"]}}};d.style=c;export{d as ic_data_table};
|
2
|
+
//# sourceMappingURL=p-41606de1.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["icDataTableCss","DataTable","this","DENSITY_HEIGHT_MULTIPLIER","dense","default","spacious","SORT_ICONS","unsorted","unsortedIcon","ascending","ascendingIcon","descending","descendingIcon","hasLoadedForOneSecond","startLoadingTimer","timerStarted","Date","now","setTimeout","minimumLoadingDisplayDuration","isObject","value","notDefaultDensity","density","getCellContent","cell","dataType","undefined","toLocaleDateString","getCellAlignment","alignment","Object","keys","includes","getObjectValue","createUpdatingIndicator","appearance","description","max","min","progress","updatingOptions","h","colSpan","columns","length","class","fullWidth","type","size","createCells","row","rowIndex","rowValues","values","rowKeys","rowAlignment","rowEmphasis","headerIndex","indexOf","map","index","columnProps","cellSlotName","key","hasIcon","cellValue","scope","stickyRowHeaders","_a","columnAlignment","vertical","_b","innerHTML","isSlotUsed","el","_c","horizontal","_d","name","Fragment","_e","icon","onAllCells","variant","emphasis","href","createColumnHeaders","cellAlignment","colspan","title","updating","loading","hideOnHeader","sortable","id","getSortButtonLabel","onClick","sortRows","sortedColumn","sortedColumnOrder","createRows","data","showPagination","slice","fromRow","toRow","forEach","getSlotContent","sort","getSortFunction","variableRowHeightVal","variableRowHeight","call","assign","findRowHeight","globalRowHeight","selectedRow","style","height","label","getNextSortOption","option","sortOrders","sortOptions","sortOption","getComparison","targetRow","comparisonRow","targetRowValue","comparisonRowValue","find","col","valueOf","String","localeCompare","numeric","sensitivity","a","b","column","sortButton","shadowRoot","querySelector","previousSortedButton","setAttribute","nextSortOrderIndex","updateScrollOffset","scrollOffset","scrollTop","itemsPerPage","rangeLabelType","itemsPerPageControl","goToPageControl","defaultColumn","componentWillLoad","rowsPerPage","Number","paginationOptions","previousRowsPerPage","loadingOptions","showBackground","componentDidLoad","tableElement","tableContainer","clientHeight","clientWidth","scrollable","showLoadingIndicator","handleItemsPerPageChange","ev","detail","handlePageChange","tableRowsContainer","handleDensityChange","clickListener","target","loadingHandler","newValue","dataHandler","newData","rowHeightChangeHandler","icRowHeightChange","emit","resetRowHeights","loadingIndicator","classList","add","render","caption","hideColumnHeaders","stickyColumnHeaders","tabIndex","onScroll","aligned","heading","labelDuration","ref","totalItems","showItemsPerPageControl","showGoToPageControl","itemsPerPageOptions"],"sources":["src/components/ic-data-table/ic-data-table.css?tag=ic-data-table&encapsulation=shadow","src/components/ic-data-table/ic-data-table.tsx"],"sourcesContent":["/**\n * @prop --height: height of the table row container\n */\n\n:host {\n position: relative;\n display: block;\n height: 100%;\n max-height: 100%;\n}\n\n.table-container {\n position: relative;\n height: calc(100% - var(--ic-space-xxxs));\n}\n\nic-loading-indicator {\n position: sticky;\n top: 20px;\n}\n\n.table-row-container {\n position: relative;\n height: 100%;\n overflow: auto;\n transition: var(--ic-easing-transition-fast);\n overflow-anchor: none;\n}\n\n:host([show-pagination=\"true\"]) .table-row-container {\n height: calc(100% - 3.5625rem);\n}\n\ntable {\n table-layout: fixed;\n border-spacing: 0;\n width: 100%;\n}\n\n.table-row-container:focus {\n outline: none;\n box-shadow: var(--ic-border-focus);\n border-radius: var(--ic-border-radius);\n transition: var(--ic-easing-transition-fast);\n z-index: 1;\n}\n\n:host([embedded=\"true\"]) .table-row-container {\n border: var(--ic-border-light);\n}\n\n.column-header-sticky {\n position: sticky;\n top: 0;\n z-index: 1;\n}\n\n.column-header-overlay {\n position: sticky;\n top: 0;\n z-index: 1;\n box-shadow: 0 0.375rem var(--ic-space-xs) calc(var(--ic-space-xxs * -1))\n rgb(0 0 0 / 20%);\n}\n\n.row-header-sticky {\n position: sticky;\n left: 0;\n}\n\n.column-header,\n.table-row {\n box-sizing: border-box;\n}\n\n.table-row-selected {\n background-color: var(--ic-table-row-selected) !important;\n}\n\n.sort-button {\n margin-left: auto;\n}\n\n.sort-button:hover {\n background-color: var(--ic-action-dark-bg-hover);\n}\n\n.sort-button:active {\n background-color: var(--ic-action-dark-bg-active);\n}\n\n.sort-button svg {\n color: var(--ic-architectural-black);\n}\n\n.sort-button-unsorted svg {\n color: var(--ic-color-tertiary-text);\n}\n\n.table-density-dense {\n padding: var(--ic-space-xxs) var(--ic-space-xs) !important;\n}\n\n.text-dense {\n font-size: var(--ic-font-size-label);\n}\n\n.table-density-spacious {\n padding: 0.625rem var(--ic-space-xs) !important;\n}\n\n.text-spacious {\n font-size: 1.125rem;\n}\n\n.column-header-text {\n font-weight: var(--ic-font-weight-bold);\n}\n\n.column-header,\n.row-header {\n text-align: left;\n padding: var(--ic-space-xs);\n background-color: var(--ic-architectural-40);\n border-right: var(--ic-border-light);\n border-bottom: var(--ic-border-light);\n}\n\n.column-header:last-child {\n border-right: none;\n}\n\n.scrollable .column-header:last-child {\n border-right: var(--ic-border-light) !important;\n}\n\n:host([embedded=\"true\"]) tr:last-child .table-cell,\n:host([embedded=\"true\"]) tr:last-child .row-header {\n border-bottom: none;\n}\n\n.column-header-alignment-left,\n.row-header-alignment-left,\n.cell-alignment-left {\n text-align: left !important;\n justify-content: start !important;\n}\n\n.column-header-alignment-right,\n.row-header-alignment-right,\n.cell-alignment-right {\n text-align: right !important;\n justify-content: end !important;\n}\n\n.column-header-alignment-center,\n.row-header-alignment-center,\n.cell-alignment-center {\n text-align: center !important;\n justify-content: center !important;\n}\n\n.table-row:nth-child(even) {\n background-color: var(--ic-architectural-20);\n}\n\n.table-cell {\n padding: var(--ic-space-xs);\n border-bottom: solid var(--ic-architectural-100) var(--ic-space-1px);\n}\n\n.data-type-string {\n text-align: left;\n vertical-align: top;\n}\n\n.data-type-number,\n.data-type-date {\n text-align: right;\n justify-content: end;\n vertical-align: top;\n}\n\n.cell-alignment-top {\n vertical-align: top;\n}\n\n.cell-alignment-middle {\n vertical-align: middle;\n}\n\n.cell-alignment-bottom {\n vertical-align: bottom;\n}\n\n.cell-emphasis-low {\n color: var(--ic-color-secondary-text);\n}\n\n.cell-emphasis-high {\n font-weight: var(--ic-font-weight-bold);\n}\n\n.pagination-container {\n background-color: var(--ic-architectural-40);\n border-top: var(--ic-border-light);\n}\n\n.screen-reader-sort-text,\n.table-caption {\n position: absolute;\n left: -100rem;\n}\n\n.table-cell,\n.column-header,\n.row-header {\n word-wrap: break-word;\n white-space: pre-wrap;\n}\n\n.loading-empty {\n padding: var(--ic-space-xl) var(--ic-space-xxl);\n margin-top: var(--ic-space-xl);\n}\n\n.updating-state {\n padding: 0;\n border-bottom: var(--ic-border-light);\n}\n\n.updating-state-headers {\n border-bottom: none;\n}\n\n.loading {\n position: absolute;\n left: calc(50% - 5.9741rem);\n opacity: 0;\n transition: opacity var(--ic-transition-duration-slow);\n}\n\n.loading.show-background {\n background-color: var(--ic-architectural-white);\n border: var(--ic-border-light);\n}\n\n.loading.show {\n opacity: 1;\n}\n\n.icon,\n::slotted(svg) {\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n margin-right: var(--ic-space-xxs);\n}\n\n.column-header-alignment-right > .icon,\n.row-header-alignment-right > .icon,\n.cell-alignment-right > .icon,\n.column-header-alignment-right > ::slotted(svg),\n.row-header-alignment-right > ::slotted(svg),\n.cell-alignment-right > ::slotted(svg) {\n margin-right: auto;\n}\n\n.column-header-alignment-center > ic-typography,\n.row-header-alignment-right > ic-typography,\n.cell-alignment-center > ic-typography {\n flex: 1;\n}\n\n.icon > svg {\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n display: inline-block;\n}\n\n@media screen and (min-width: 576px) {\n .column-header-inner-container {\n display: flex;\n align-items: center;\n }\n\n .cell-container {\n display: flex;\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n Component,\n Element,\n h,\n Prop,\n State,\n Listen,\n Watch,\n Fragment,\n Method,\n Event,\n EventEmitter,\n} from \"@stencil/core\";\nimport unsortedIcon from \"./assets/unsorted-icon.svg\";\nimport ascendingIcon from \"./assets/ascending-icon.svg\";\nimport descendingIcon from \"./assets/descending-icon.svg\";\nimport {\n IcDataTableColumnDataTypes,\n IcDataTableColumnObject,\n IcDataTableDensityOptions,\n IcDataTableRowHeights,\n IcDataTableSortOrderOptions,\n IcDensityUpdateEventDetail,\n} from \"./ic-data-table.types\";\nimport {\n IcPaginationLabelTypes,\n IcPaginationTypes,\n IcPaginationAlignmentOptions,\n} from \"@ukic/web-components/dist/types/components/ic-pagination/ic-pagination.types\";\nimport { IcThemeForegroundNoDefault } from \"@ukic/web-components/dist/types/utils/types\";\n// Unable to import helper functions via @ukic/web-components\nimport { getSlotContent, isSlotUsed } from \"../../utils/helpers\";\n\n/**\n * @slot empty-state - Content is slotted below the table header when there is no data and the table is not loading.\n * @slot {COLUMN_KEY}-{ROW_INDEX}[-icon] - Each cell should have its own slot, named using the column tag and the row index, allowing for custom elements to be displayed. Include `-icon` at the end for that cell's icon slot.\n * @slot {COLUMN_KEY}-column-icon - The icon slot for a column header.\n * @slot title-bar - A custom ic-data-table-title-bar can be slotted above the column headers to display additional information about the table.\n */\n@Component({\n tag: \"ic-data-table\",\n styleUrl: \"ic-data-table.css\",\n shadow: true,\n})\nexport class DataTable {\n private DENSITY_HEIGHT_MULTIPLIER = {\n dense: 0.8,\n default: 1,\n spacious: 1.2,\n };\n\n private SORT_ICONS = {\n unsorted: unsortedIcon,\n ascending: ascendingIcon,\n descending: descendingIcon,\n };\n\n private hasLoadedForOneSecond: boolean = true;\n private loadingIndicator: HTMLIcLoadingIndicatorElement;\n private timerStarted: number;\n\n @Element() el: HTMLIcDataTableElement;\n\n @State() fromRow: number = 0;\n\n @State() previousRowsPerPage: number;\n\n @State() rowsPerPage: number;\n\n @State() scrollable: boolean = false;\n\n @State() scrollOffset: number = 0;\n\n @State() selectedRow: object;\n\n @State() sortedColumn: string;\n\n @State() sortedColumnOrder: IcDataTableSortOrderOptions;\n\n @State() toRow: number;\n\n /**\n * The title for the table only visible to screen readers.\n */\n @Prop() caption!: string;\n\n /**\n * The column headers for the table.\n */\n @Prop() columns!: IcDataTableColumnObject[];\n\n /**\n * The row content for the table.\n */\n @Prop() data: { [key: string]: any }[];\n\n /**\n * Set the density of the table including font and padding.\n */\n @Prop({ mutable: true }) density?: IcDataTableDensityOptions = \"default\";\n\n /**\n * Applies a border to the table container.\n */\n @Prop() embedded?: boolean = false;\n\n /**\n * Sets the row height on all rows in the table that aren't set using the `variableRowHeight` method.\n */\n @Prop({ mutable: true }) globalRowHeight?: IcDataTableRowHeights = 40;\n\n /**\n * If `true`, column headers will not be visible.\n */\n @Prop() hideColumnHeaders?: boolean = false;\n\n /**\n * When set to `true`, the full table will show a loading state, featuring a radial indicator.\n */\n @Prop({ mutable: true }) loading?: boolean = false;\n\n /**\n * Sets the props for the circular loading indicator used in the loading state.\n */\n @Prop() loadingOptions?: {\n appearance?: IcThemeForegroundNoDefault;\n description?: string;\n label?: string;\n labelDuration?: number;\n max?: number;\n min?: number;\n progress?: number;\n showBackground?: boolean;\n };\n\n /**\n * The minimum amount of time the `loading` state displays for before showing the data. Used to prevent flashing in the component.\n */\n @Prop() minimumLoadingDisplayDuration?: number = 1000;\n\n /**\n * Sets the props for the pagination bar.\n */\n @Prop() paginationOptions?: {\n itemsPerPage?: { label: string; value: string }[];\n rangeLabelType?: IcPaginationLabelTypes;\n type?: IcPaginationTypes;\n itemsPerPageControl?: boolean;\n goToPageControl?: boolean;\n alignment?: IcPaginationAlignmentOptions;\n } = {\n itemsPerPage: [\n { label: \"10\", value: \"10\" },\n { label: \"25\", value: \"25\" },\n { label: \"50\", value: \"50\" },\n ],\n rangeLabelType: \"page\",\n type: \"simple\",\n itemsPerPageControl: true,\n goToPageControl: true,\n alignment: \"right\",\n };\n\n /**\n * If `true`, adds a pagination bar to the bottom of the table.\n */\n @Prop() showPagination?: boolean = false;\n\n /**\n * If `true`, allows table columns to be sorted using applied sort buttons.\n */\n @Prop() sortable?: boolean = false;\n\n /**\n * Sets the order columns will be sorted in and allows for 'default' sorts to be added.\n */\n @Prop() sortOptions?: {\n sortOrders: IcDataTableSortOrderOptions[];\n defaultColumn?: string;\n } = {\n sortOrders: [\"unsorted\", \"ascending\", \"descending\"],\n defaultColumn: \"\",\n };\n\n /**\n * If `true`, column headers will remain at the top of the table when scrolling vertically.\n */\n @Prop() stickyColumnHeaders?: boolean = false;\n\n /**\n * If `true`, row headers will remain to the left when scrolling horizontally.\n */\n @Prop() stickyRowHeaders?: boolean = false;\n\n /**\n * If `true`, the table displays a linear loading indicator below the header row to indicate an updating state.\n */\n @Prop() updating?: boolean = false;\n\n /**\n * Sets the props for the linear loading indicator used in the updating state.\n */\n @Prop() updatingOptions?: {\n appearance?: IcThemeForegroundNoDefault;\n description?: string;\n max?: number;\n min?: number;\n progress?: number;\n };\n\n /**\n * Allows for custom setting of row heights on individual rows based on an individual value from the `data` prop and the row index.\n * If the function returns `null`, that row's height will be set to the `globalRowHeight` property.\n */\n @Prop({ mutable: true }) variableRowHeight?: (params: {\n [key: string]: any;\n index: number;\n }) => IcDataTableRowHeights | null;\n\n /**\n * Emitted when the `globalRowHeight` or `variableRowHeight` properties change in the data table.\n */\n @Event() icRowHeightChange: EventEmitter<void>;\n\n componentWillLoad(): void {\n this.rowsPerPage = Number(this.paginationOptions.itemsPerPage[0].value);\n this.previousRowsPerPage = this.rowsPerPage;\n this.toRow = this.rowsPerPage;\n this.sortedColumn = this.sortOptions.defaultColumn;\n this.sortedColumnOrder = this.sortOptions.sortOrders[0];\n this.loadingOptions = {\n ...this.loadingOptions,\n showBackground: this.data?.length > 0,\n };\n }\n\n componentDidLoad(): void {\n const tableElement = this.el.shadowRoot.querySelector(\"table\");\n const tableContainer = this.el.shadowRoot.querySelector(\".table-container\");\n if (\n tableElement?.clientHeight > tableContainer?.clientHeight ||\n tableElement?.clientWidth > tableContainer?.clientWidth\n ) {\n this.scrollable = true;\n }\n if (this.loading) {\n this.startLoadingTimer();\n this.showLoadingIndicator();\n }\n }\n\n @Listen(\"icItemsPerPageChange\")\n handleItemsPerPageChange(ev: CustomEvent): void {\n this.previousRowsPerPage = this.rowsPerPage;\n this.rowsPerPage = ev.detail.value;\n }\n\n @Listen(\"icPageChange\")\n handlePageChange(ev: CustomEvent): void {\n this.fromRow = (ev.detail.value - 1) * this.rowsPerPage;\n this.toRow = this.fromRow + this.rowsPerPage;\n const tableRowsContainer = this.el.shadowRoot.querySelector(\n \".table-row-container\"\n );\n if (this.previousRowsPerPage === this.rowsPerPage) {\n tableRowsContainer.scrollTop = 0;\n } else if (this.previousRowsPerPage < this.rowsPerPage) {\n tableRowsContainer.scrollTop = this.scrollOffset;\n this.previousRowsPerPage = this.rowsPerPage;\n } else {\n this.previousRowsPerPage = this.rowsPerPage;\n }\n }\n\n @Listen(\"icTableDensityUpdate\")\n handleDensityChange(ev: CustomEvent<IcDensityUpdateEventDetail>): void {\n this.density = ev.detail.value;\n }\n\n @Listen(\"click\", { target: \"window\" })\n clickListener(ev: MouseEvent): void {\n if (ev.target !== this.el) this.selectedRow = undefined;\n }\n\n @Watch(\"loading\")\n loadingHandler(newValue: boolean): void {\n if (newValue) this.startLoadingTimer();\n\n if (this.loading) {\n setTimeout(() => {\n this.showLoadingIndicator();\n }, 500);\n }\n }\n\n @Watch(\"data\")\n dataHandler(newData: { [key: string]: any }[]): void {\n this.loadingOptions = {\n ...this.loadingOptions,\n showBackground: newData?.length > 0,\n };\n if (this.loading) {\n !this.hasLoadedForOneSecond\n ? setTimeout(\n () => (this.loading = false),\n this.minimumLoadingDisplayDuration -\n (Date.now() - this.timerStarted)\n )\n : (this.loading = false);\n }\n if (this.updating) this.updating = false;\n }\n\n @Watch(\"globalRowHeight\")\n @Watch(\"variableRowHeight\")\n rowHeightChangeHandler(): void {\n this.icRowHeightChange.emit();\n }\n\n /**\n * Resets the `globalRowHeight` prop to `40px` and sets the `variableRowHeight` prop to `null`.\n */\n @Method()\n async resetRowHeights(): Promise<void> {\n this.globalRowHeight = 40;\n this.variableRowHeight = null;\n }\n\n private showLoadingIndicator() {\n this.loadingIndicator.classList.add(\"show\");\n }\n\n private startLoadingTimer = (): void => {\n this.hasLoadedForOneSecond = false;\n this.timerStarted = Date.now();\n setTimeout(() => {\n this.hasLoadedForOneSecond = true;\n this.timerStarted = null;\n }, this.minimumLoadingDisplayDuration);\n };\n\n private isObject = (value: any) => typeof value === \"object\";\n\n private notDefaultDensity = () => this.density !== \"default\";\n\n private getCellContent = (\n cell: any,\n dataType: IcDataTableColumnDataTypes\n ): any => {\n switch (dataType) {\n case \"element\":\n return undefined;\n case \"date\":\n return (\n cell instanceof Date ? cell : new Date(cell)\n ).toLocaleDateString();\n default:\n return cell;\n }\n };\n\n private getCellAlignment = (\n cell: any,\n alignment: \"horizontal\" | \"vertical\"\n ) => {\n if (this.isObject(cell) && Object.keys(cell).includes(\"cellAlignment\")) {\n return this.getObjectValue(\n this.getObjectValue(cell, \"cellAlignment\"),\n alignment\n );\n }\n };\n\n private createUpdatingIndicator = () => {\n const { appearance, description, max, min, progress } =\n this.updatingOptions || {};\n return (\n <th colSpan={this.columns.length} class=\"updating-state\">\n <ic-loading-indicator\n appearance={appearance}\n description={description || \"Updating table data\"}\n fullWidth={true}\n max={max}\n min={min}\n progress={progress}\n type=\"linear\"\n size=\"small\"\n ></ic-loading-indicator>\n </th>\n );\n };\n\n private createCells = (row: object, rowIndex: number) => {\n const rowValues = Object.values(row);\n const rowKeys = Object.keys(row);\n let rowAlignment: string;\n let rowEmphasis: string;\n const headerIndex = rowKeys.indexOf(\"header\");\n if (headerIndex > -1) {\n rowAlignment = this.getObjectValue(\n rowValues[headerIndex],\n \"rowAlignment\"\n );\n rowEmphasis = this.getObjectValue(rowValues[headerIndex], \"emphasis\");\n }\n return rowValues.map((cell, index) => {\n const columnProps = this.columns[index];\n const cellSlotName = `${columnProps?.key}-${rowIndex}`;\n const hasIcon = this.isObject(cell) && Object.keys(cell).includes(\"icon\");\n const cellValue = (key: string) => this.getObjectValue(cell, key);\n\n return rowKeys[index] === \"header\" ? (\n <th\n scope=\"row\"\n colSpan={cellValue(\"colspan\")}\n class={{\n [\"row-header\"]: true,\n [`row-header-alignment-${cellValue(\"cellAlignment\")}`]:\n !!cellValue(\"cellAlignment\"),\n [\"row-header-sticky\"]: this.stickyRowHeaders,\n }}\n >\n {cellValue(\"title\")}\n </th>\n ) : (\n <td\n class={{\n [\"table-cell\"]: true,\n [`table-density-${this.density}`]: this.notDefaultDensity(),\n [`data-type-${columnProps?.dataType}`]: true,\n [`cell-alignment-${\n columnProps?.columnAlignment?.vertical ||\n rowAlignment ||\n this.getCellAlignment(cell, \"vertical\")\n }`]:\n !!columnProps?.columnAlignment?.vertical ||\n !!rowAlignment ||\n !!this.getCellAlignment(cell, \"vertical\"),\n }}\n >\n <div\n innerHTML={\n columnProps?.dataType === \"element\" &&\n !isSlotUsed(this.el, cellSlotName)\n ? (cell as string)\n : null\n }\n class={{\n \"cell-container\": columnProps?.dataType !== \"element\",\n [`data-type-${columnProps?.dataType}`]: true,\n [`cell-alignment-${\n columnProps?.columnAlignment?.horizontal ||\n this.getCellAlignment(cell, \"horizontal\")\n }`]:\n !!columnProps?.columnAlignment?.horizontal ||\n !!this.getCellAlignment(cell, \"horizontal\"),\n }}\n >\n {isSlotUsed(this.el, cellSlotName) ? (\n <slot name={cellSlotName} />\n ) : (\n <Fragment>\n {isSlotUsed(this.el, `${cellSlotName}-icon`) ? (\n <slot name={`${cellSlotName}-icon`} />\n ) : (\n (hasIcon || columnProps?.icon?.onAllCells) && (\n <span\n class=\"icon\"\n innerHTML={cellValue(\"icon\") || columnProps?.icon.icon}\n ></span>\n )\n )}\n <ic-typography\n variant=\"body\"\n class={{\n [`cell-emphasis-${\n (this.isObject(cell) && cellValue(\"emphasis\")) ||\n columnProps?.emphasis ||\n rowEmphasis\n }`]:\n (this.isObject(cell) && !!cellValue(\"emphasis\")) ||\n !!columnProps?.emphasis ||\n !!rowEmphasis,\n [`text-${this.density}`]: this.notDefaultDensity(),\n }}\n >\n {this.isObject(cell) && columnProps?.dataType !== \"date\" ? (\n Object.keys(cell).includes(\"href\") ? (\n <ic-link href={cellValue(\"href\")}>\n {cellValue(\"data\")}\n </ic-link>\n ) : (\n cellValue(\"data\")\n )\n ) : (\n this.getCellContent(cell, columnProps?.dataType)\n )}\n </ic-typography>\n </Fragment>\n )}\n </div>\n </td>\n );\n });\n };\n\n private createColumnHeaders = () => {\n return this.columns.map(({ cellAlignment, colspan, icon, key, title }) => (\n <th\n scope=\"col\"\n class={{\n [\"column-header\"]: true,\n [`table-density-${this.density}`]: this.notDefaultDensity(),\n [\"updating-state-headers\"]: this.updating && !this.loading,\n }}\n colSpan={colspan}\n >\n <div\n class={{\n \"column-header-inner-container\": true,\n [`column-header-alignment-${cellAlignment}`]: !!cellAlignment,\n }}\n >\n {isSlotUsed(this.el, `${key}-column-icon`) ? (\n <slot name={`${key}-column-icon`} />\n ) : (\n icon &&\n !icon.hideOnHeader && (\n <span class=\"icon\" innerHTML={icon.icon}></span>\n )\n )}\n <ic-typography\n variant=\"body\"\n class={{\n [\"column-header-text\"]: true,\n [`text-${this.density}`]: this.notDefaultDensity(),\n }}\n >\n {title}\n </ic-typography>\n {this.sortable && (\n <ic-button\n variant=\"icon\"\n id={`sort-button-${key}`}\n aria-label={this.getSortButtonLabel(key)}\n // eslint-disable-next-line react/jsx-no-bind\n onClick={() => this.sortRows(key)}\n innerHTML={\n this.SORT_ICONS[\n this.sortedColumn === key\n ? this.sortedColumnOrder\n : \"unsorted\"\n ]\n }\n class={{\n [\"sort-button\"]: true,\n [\"sort-button-unsorted\"]:\n this.sortedColumn !== key ||\n this.sortedColumnOrder === \"unsorted\",\n }}\n ></ic-button>\n )}\n </div>\n </th>\n ));\n };\n\n private createRows = () => {\n const data = this.showPagination\n ? this.data.slice(this.fromRow, this.toRow)\n : this.data.slice();\n\n /**\n * Ensures that createCells has a value in data to map over to actually render the slot.\n * Removes the need for the user to add it multiple times.\n */\n this.columns.forEach(({ key }) => {\n data.forEach((row, rowIndex) => {\n const cellSlotName = `${key}-${rowIndex}`;\n if (isSlotUsed(this.el, cellSlotName)) {\n row[key] = getSlotContent(this.el, cellSlotName);\n }\n });\n });\n\n return data\n .sort(!this.sortable ? undefined : this.getSortFunction())\n .map((row, index) => {\n const variableRowHeightVal = this.variableRowHeight?.({\n ...row,\n index,\n });\n const findRowHeight = variableRowHeightVal\n ? variableRowHeightVal !== \"auto\" && variableRowHeightVal\n : this.globalRowHeight !== \"auto\" && this.globalRowHeight;\n return (\n <tr\n // eslint-disable-next-line react/jsx-no-bind\n onClick={() =>\n (this.selectedRow =\n this.selectedRow !== row &&\n !this.loading &&\n !this.updating &&\n row)\n }\n class={{\n [\"table-row\"]: true,\n [\"table-row-selected\"]: this.selectedRow === row,\n }}\n style={{\n height: findRowHeight\n ? `${\n findRowHeight * this.DENSITY_HEIGHT_MULTIPLIER[this.density]\n }px`\n : null,\n }}\n >\n {this.createCells(row, index)}\n </tr>\n );\n });\n };\n\n private getObjectValue = (cell: object, key: string) => {\n return Object.values(cell)[Object.keys(cell).indexOf(key)];\n };\n\n private getSortButtonLabel = (key: string) => {\n let label = \"\";\n const getNextSortOption = (option: IcDataTableSortOrderOptions) => {\n const sortOrders = this.sortOptions.sortOrders;\n return sortOrders[(sortOrders.indexOf(option) + 1) % sortOrders.length];\n };\n\n if (this.sortedColumn === key) {\n const sortOption = getNextSortOption(this.sortedColumnOrder);\n label = sortOption !== \"unsorted\" ? `Sort ${sortOption}` : \"Remove sort\";\n } else {\n label = `Sort ${getNextSortOption(\"unsorted\")}`;\n }\n\n return label;\n };\n\n private getComparison = (targetRow: any, comparisonRow: any): number => {\n const targetRowValue = targetRow[this.sortedColumn];\n const comparisonRowValue = comparisonRow[this.sortedColumn];\n return this.columns.find((col) => col.key === this.sortedColumn)\n .dataType === \"date\"\n ? new Date(targetRowValue).valueOf() -\n new Date(comparisonRowValue).valueOf()\n : String(\n this.isObject(targetRowValue)\n ? Object.values(targetRowValue)[0]\n : targetRowValue\n ).localeCompare(\n String(\n this.isObject(comparisonRowValue)\n ? Object.values(comparisonRowValue)[0]\n : comparisonRowValue\n ),\n undefined,\n { numeric: true, sensitivity: \"base\" }\n );\n };\n\n private getSortFunction = () => {\n switch (this.sortedColumnOrder) {\n case \"ascending\":\n return (a: any, b: any) => this.getComparison(a, b);\n case \"descending\":\n return (a: any, b: any) => this.getComparison(b, a);\n default:\n return undefined;\n }\n };\n\n private sortRows = (column: string) => {\n const sortButton = this.el.shadowRoot.querySelector(\n `#sort-button-${column}`\n ) as HTMLIcButtonElement;\n\n const sortOrders = this.sortOptions.sortOrders;\n\n if (column !== this.sortedColumn) {\n if (this.sortedColumn) {\n const previousSortedButton = this.el.shadowRoot.querySelector(\n `#sort-button-${this.sortedColumn}`\n ) as HTMLIcButtonElement;\n previousSortedButton.setAttribute(\n \"aria-label\",\n this.getSortButtonLabel(column)\n ); // Passing through unsorted column returns correct label for newly unsorted column\n }\n this.sortedColumn = column;\n this.sortedColumnOrder = \"unsorted\";\n }\n\n let nextSortOrderIndex = sortOrders.indexOf(this.sortedColumnOrder) + 1;\n\n if (nextSortOrderIndex > sortOrders.length - 1) {\n nextSortOrderIndex = 0;\n }\n\n this.sortedColumnOrder = sortOrders[nextSortOrderIndex];\n\n sortButton.setAttribute(\"aria-label\", this.getSortButtonLabel(column));\n };\n\n private updateScrollOffset = () => {\n this.scrollOffset = this.el.shadowRoot.querySelector(\n \".table-row-container\"\n ).scrollTop;\n };\n\n render() {\n const {\n caption,\n createColumnHeaders,\n createRows,\n createUpdatingIndicator,\n data,\n hideColumnHeaders,\n loading,\n loadingOptions,\n paginationOptions,\n scrollable,\n scrollOffset,\n showPagination,\n sortable,\n sortedColumnOrder,\n sortedColumn,\n stickyColumnHeaders,\n updateScrollOffset,\n updating,\n } = this;\n\n return (\n <div class=\"table-container\">\n {isSlotUsed(this.el, \"title-bar\") && <slot name=\"title-bar\" />}\n <div\n class={{\n [\"table-row-container\"]: true,\n scrollable,\n }}\n tabIndex={scrollable ? 0 : null}\n onScroll={updateScrollOffset}\n >\n <table>\n <caption class=\"table-caption\">{caption}</caption>\n {!hideColumnHeaders && (\n <thead\n class={{\n [\"column-header-sticky\"]: stickyColumnHeaders,\n [\"column-header-overlay\"]:\n stickyColumnHeaders && scrollOffset !== 0,\n }}\n >\n <tr>{createColumnHeaders()}</tr>\n </thead>\n )}\n {updating &&\n !loading &&\n (hideColumnHeaders ? (\n <thead>{createUpdatingIndicator()}</thead>\n ) : (\n createUpdatingIndicator()\n ))}\n {data?.length > 0 && <tbody>{createRows()}</tbody>}\n </table>\n {!data?.length &&\n !loading &&\n (isSlotUsed(this.el, \"empty-state\") ? (\n <slot name=\"empty-state\" />\n ) : (\n <ic-empty-state\n aligned=\"center\"\n heading=\"No Data\"\n class=\"loading-empty\"\n ></ic-empty-state>\n ))}\n </div>\n {loading && (\n <ic-loading-indicator\n appearance={loadingOptions?.appearance}\n class={{\n \"loading-empty\": loading,\n loading: true,\n \"show-background\": loadingOptions.showBackground,\n }}\n description={loadingOptions.description || \"Loading table data\"}\n label={loadingOptions.label || \"Loading...\"}\n labelDuration={loadingOptions?.labelDuration}\n max={loadingOptions?.max}\n min={loadingOptions?.min}\n progress={loadingOptions?.progress}\n ref={(el: HTMLIcLoadingIndicatorElement) =>\n (this.loadingIndicator = el)\n }\n ></ic-loading-indicator>\n )}\n {showPagination && (\n <div class=\"pagination-container\">\n <ic-pagination-bar\n totalItems={data.length}\n type={paginationOptions.type}\n rangeLabelType={paginationOptions.rangeLabelType}\n showItemsPerPageControl={paginationOptions.itemsPerPageControl}\n showGoToPageControl={paginationOptions.goToPageControl}\n itemsPerPageOptions={paginationOptions.itemsPerPage}\n alignment={paginationOptions.alignment}\n ></ic-pagination-bar>\n </div>\n )}\n {sortable && (\n <div class=\"screen-reader-sort-text\" aria-live=\"polite\">\n {sortedColumnOrder !== \"unsorted\" && sortedColumn\n ? `${sortedColumn} sorted ${sortedColumnOrder}`\n : \"table unsorted\"}\n </div>\n )}\n </div>\n );\n }\n}\n"],"mappings":"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"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as e,c as t,h as o,H as i,g as r}from"./p-8455d1bb.js";import{e as n,I as a,
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as e,c as t,h as o,H as i,g as r}from"./p-8455d1bb.js";import{e as n,I as a,b as s,f as l,i as c,u as d}from"./p-11bbb09c.js";import{I as p}from"./p-fd186591.js";const m='/*! 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{display:block;--footer-compliance-padding:1rem 0}:host(.footer-sparse){--footer-links-padding:1.5rem 0;--footer-logo-margin-bottom:var(--ic-space-lg);--footer-link-inner-flex-direction:row}:host(.footer-small){--footer-links-padding:0 0;--footer-logo-margin-bottom:var(--ic-space-md);--footer-link-inner-flex-direction:column}:host(.footer-light){--footer-theme-secondary:var(--ic-theme-secondary);--footer-theme-tertiary:var(--ic-theme-tertiary);--footer-keyline:var(--ic-keyline-lighten)}:host(.footer-dark){--footer-theme-secondary:var(--ic-theme-secondary-light);--footer-theme-tertiary:var(--ic-theme-tertiary-light);--footer-keyline:var(--ic-keyline-darken)}:host(.footer-small.footer-ungrouped){--footer-links-padding:var(--ic-space-md) 0 0 0}footer{display:flex;flex-direction:column;width:100%}.footer-description{background-color:var(--footer-theme-secondary);color:var(--ic-theme-text);border-bottom:var(--footer-keyline)}.footer-description-inner{padding:1rem 0}.footer-links{padding:var(--footer-links-padding);background-color:var(--footer-theme-secondary);color:var(--ic-theme-text)}.footer-links-inner{display:flex;flex-direction:var(--footer-link-inner-flex-direction)}.footer-compliance{background-color:var(--footer-theme-tertiary);color:var(--ic-theme-text)}.footer-compliance-inner{padding:var(--footer-compliance-padding)}.footer-logo{margin-bottom:var(--footer-logo-margin-bottom);display:flex;gap:var(--ic-space-xxl)}.footer-logo>::slotted(){margin-right:var(--ic-space-md)}.footer-caption{margin-bottom:var(--ic-space-md)}.classification-spacing{margin-bottom:var(--ic-space-lg)}@media (forced-colors: active){footer{border-top:var(--ic-hc-border)}}';const f=class{constructor(o){e(this,o);this.footerResized=t(this,"footerResized",7);this.resizeObserver=null;this.resizeObserverCallback=e=>{if(e!==this.deviceSize){this.deviceSize=e}this.footerResized.emit()};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{const e=n();this.resizeObserverCallback(e)}));this.resizeObserver.observe(this.footerEl)};this.deviceSize=a.XL;this.foregroundColor=s();this.aligned="left";this.breakpoint="medium";this.caption=undefined;this.copyright=true;this.description=undefined;this.groupLinks=false}disconnectedCallback(){if(this.resizeObserver!==null){this.resizeObserver.disconnect()}}componentWillLoad(){this.deviceSize=n()}componentDidLoad(){l(this.runResizeObserver)}themeChangeHandler(e){const t=e.detail;this.foregroundColor=t.mode}isSmall(){const e=this.breakpoint;return e==="extra small"?this.deviceSize<a.XS:e==="small"?this.deviceSize<a.S:e==="medium"?this.deviceSize<a.M:e==="large"?this.deviceSize<a.L:e==="extra large"?this.deviceSize<a.XL:false}render(){const{aligned:e,caption:t,copyright:r,description:n,groupLinks:s,foregroundColor:l}=this;const m=this.isSmall();return o(i,{class:{footer:true,[`footer-${m?"small":"sparse"}`]:true,[`footer-${s?"grouped":"ungrouped"}`]:true,[`footer-${l}`]:true,[p.Dark]:l===p.Dark,[p.Light]:l===p.Light}},o("footer",{ref:e=>this.footerEl=e},n&&o("div",{class:"footer-description"},o("ic-section-container",{aligned:e,fullHeight:true},o("div",{class:"footer-description-inner"},o("ic-typography",{variant:"body"},o("slot",{name:"description"},n))))),c(this.el,"link")&&o("div",{class:"footer-links"},s&&m?o("div",{class:"footer-links-inner"},o("slot",{name:"link"})):o("ic-section-container",{fullHeight:true,aligned:e},o("div",{class:"footer-links-inner"},o("slot",{name:"link"})))),o("div",{class:"footer-compliance"},o("ic-section-container",{aligned:e,fullHeight:true},o("div",{class:"footer-compliance-inner"},c(this.el,"logo")&&o("div",{class:"footer-logo"},o("slot",{name:"logo"})),(c(this.el,"caption")||t)&&o("div",{class:"footer-caption"},o("ic-typography",{variant:this.deviceSize<=a.M?"caption":"body"},o("slot",{name:"caption"},t))),r&&o("div",{class:{["footer-copyright"]:true,["classification-spacing"]:d()}},o("ic-typography",{variant:this.deviceSize<=a.M?"caption-uppercase":"label-uppercase"},"© Crown Copyright")))))))}get el(){return r(this)}};f.style=m;export{f as ic_footer};
|
2
|
+
//# sourceMappingURL=p-4415c93f.entry.js.map
|