@ukic/canary-web-components 3.0.0-canary.3 → 3.0.0-canary.4
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-a67ad3a4.js.map +1 -1
- package/dist/cjs/ic-accordion-group.cjs.entry.js +9 -9
- package/dist/cjs/ic-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-accordion.cjs.entry.js +4 -4
- package/dist/cjs/ic-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +6 -4
- package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-horizontal.cjs.entry.js +20 -25
- package/dist/cjs/ic-card-horizontal.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-vertical.cjs.entry.js +21 -23
- package/dist/cjs/ic-card-vertical.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +15 -4
- package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +4 -2
- package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-table.cjs.entry.js +65 -10
- package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-input.cjs.entry.js +3 -2
- 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-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +3 -1
- package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +70 -6
- package/dist/cjs/ic-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-empty-state_2.cjs.entry.js +22 -8
- package/dist/cjs/ic-empty-state_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +3 -2
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +5 -4
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +2 -2
- package/dist/cjs/ic-input-label_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js +9 -9
- package/dist/cjs/ic-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +3 -2
- package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +28 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination_4.cjs.entry.js +44 -25
- package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +3 -3
- package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +13 -4
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +7 -3
- package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +11 -8
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +3 -2
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-context.cjs.entry.js +2 -1
- package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +2 -2
- package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tree-item.cjs.entry.js +7 -5
- package/dist/cjs/ic-tree-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tree-view.cjs.entry.js +12 -12
- package/dist/cjs/ic-tree-view.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.css +18 -21
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.js +44 -25
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.js.map +1 -1
- package/dist/collection/components/ic-data-table/ic-data-table.css +20 -0
- package/dist/collection/components/ic-data-table/ic-data-table.js +86 -11
- package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
- package/dist/collection/components/ic-data-table/story-data.js +7 -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 +17 -0
- package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js.map +1 -1
- package/dist/collection/components/ic-date-input/ic-date-input.css +8 -0
- package/dist/collection/components/ic-date-input/ic-date-input.js +2 -1
- package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -1
- package/dist/collection/components/ic-date-picker/ic-date-picker.css +1 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.css +8 -7
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +64 -32
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -1
- package/dist/collection/components/ic-tree-item/ic-tree-item.css +14 -21
- package/dist/collection/components/ic-tree-item/ic-tree-item.js +30 -31
- package/dist/collection/components/ic-tree-item/ic-tree-item.js.map +1 -1
- package/dist/collection/components/ic-tree-view/ic-tree-view.css +8 -9
- package/dist/collection/components/ic-tree-view/ic-tree-view.js +36 -36
- package/dist/collection/components/ic-tree-view/ic-tree-view.js.map +1 -1
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/components/helpers2.js +1 -1
- package/dist/components/helpers2.js.map +1 -1
- package/dist/components/ic-accordion-group.js +11 -11
- package/dist/components/ic-accordion-group.js.map +1 -1
- package/dist/components/ic-accordion.js +5 -5
- package/dist/components/ic-accordion.js.map +1 -1
- package/dist/components/ic-alert.js +8 -5
- package/dist/components/ic-alert.js.map +1 -1
- package/dist/components/ic-card-horizontal.js +22 -26
- package/dist/components/ic-card-horizontal.js.map +1 -1
- package/dist/components/ic-card-vertical.js +23 -24
- package/dist/components/ic-card-vertical.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +18 -5
- package/dist/components/ic-checkbox-group.js.map +1 -1
- package/dist/components/ic-checkbox.js +5 -2
- package/dist/components/ic-checkbox.js.map +1 -1
- package/dist/components/ic-classification-banner.js +1 -1
- package/dist/components/ic-classification-banner.js.map +1 -1
- package/dist/components/ic-data-table.js +68 -11
- package/dist/components/ic-data-table.js.map +1 -1
- package/dist/components/ic-date-input2.js +3 -2
- package/dist/components/ic-date-input2.js.map +1 -1
- package/dist/components/ic-date-picker.js +1 -1
- package/dist/components/ic-date-picker.js.map +1 -1
- package/dist/components/ic-dialog.js +4 -1
- package/dist/components/ic-dialog.js.map +1 -1
- package/dist/components/ic-divider2.js +86 -9
- package/dist/components/ic-divider2.js.map +1 -1
- package/dist/components/ic-footer-link-group.js +1 -1
- package/dist/components/ic-footer-link-group.js.map +1 -1
- package/dist/components/ic-footer-link.js +1 -1
- package/dist/components/ic-footer-link.js.map +1 -1
- package/dist/components/ic-footer.js +1 -1
- package/dist/components/ic-footer.js.map +1 -1
- package/dist/components/ic-hero.js +1 -1
- package/dist/components/ic-hero.js.map +1 -1
- package/dist/components/ic-horizontal-scroll2.js +3 -2
- package/dist/components/ic-horizontal-scroll2.js.map +1 -1
- package/dist/components/ic-input-component-container2.js +1 -1
- package/dist/components/ic-input-component-container2.js.map +1 -1
- package/dist/components/ic-input-label2.js +1 -1
- package/dist/components/ic-input-label2.js.map +1 -1
- package/dist/components/ic-input-validation2.js +1 -1
- package/dist/components/ic-input-validation2.js.map +1 -1
- package/dist/components/ic-menu-group.js +1 -1
- package/dist/components/ic-menu-group.js.map +1 -1
- package/dist/components/ic-menu-item2.js +10 -10
- package/dist/components/ic-menu-item2.js.map +1 -1
- package/dist/components/ic-menu2.js +4 -3
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-navigation-group.js +3 -2
- package/dist/components/ic-navigation-group.js.map +1 -1
- package/dist/components/ic-navigation-item.js +30 -2
- package/dist/components/ic-navigation-item.js.map +1 -1
- package/dist/components/ic-pagination-bar2.js +26 -11
- package/dist/components/ic-pagination-bar2.js.map +1 -1
- package/dist/components/ic-pagination-item2.js +9 -11
- package/dist/components/ic-pagination-item2.js.map +1 -1
- package/dist/components/ic-pagination2.js +38 -15
- package/dist/components/ic-pagination2.js.map +1 -1
- package/dist/components/ic-popover-menu.js +3 -3
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js +16 -5
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js +8 -3
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-search-bar.js +12 -8
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-select2.js.map +1 -1
- package/dist/components/ic-side-navigation.js +3 -2
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-tab-context.js +2 -1
- package/dist/components/ic-tab-context.js.map +1 -1
- package/dist/components/ic-text-field2.js +1 -1
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-toast.js +3 -3
- package/dist/components/ic-toast.js.map +1 -1
- package/dist/components/ic-toggle-button-group.js +1 -1
- package/dist/components/ic-toggle-button-group.js.map +1 -1
- package/dist/components/ic-tree-item.js +8 -6
- package/dist/components/ic-tree-item.js.map +1 -1
- package/dist/components/ic-tree-view.js +15 -15
- package/dist/components/ic-tree-view.js.map +1 -1
- package/dist/core/core.css +125 -13
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-13e01a1e.entry.js → p-00ff3a06.entry.js} +2 -2
- package/dist/core/p-00ff3a06.entry.js.map +1 -0
- package/dist/core/{p-7e1603cc.entry.js → p-01ab3a15.entry.js} +2 -2
- package/dist/core/p-01ab3a15.entry.js.map +1 -0
- package/dist/core/p-1d24a02a.entry.js +2 -0
- package/dist/core/{p-dcccd9c1.entry.js.map → p-1d24a02a.entry.js.map} +1 -1
- package/dist/core/p-235b461f.entry.js +2 -0
- package/dist/core/p-235b461f.entry.js.map +1 -0
- package/dist/core/p-2873f871.entry.js +2 -0
- package/dist/core/p-2873f871.entry.js.map +1 -0
- package/dist/core/p-2f4bec06.entry.js +2 -0
- package/dist/core/p-2f4bec06.entry.js.map +1 -0
- package/dist/core/p-350074d4.entry.js +2 -0
- package/dist/core/p-350074d4.entry.js.map +1 -0
- package/dist/core/{p-5cfb5821.entry.js → p-39101ffc.entry.js} +2 -2
- package/dist/core/{p-5cfb5821.entry.js.map → p-39101ffc.entry.js.map} +1 -1
- package/dist/core/p-3b0fae40.entry.js +2 -0
- package/dist/core/p-3b0fae40.entry.js.map +1 -0
- package/dist/core/p-42f1b9cc.entry.js +2 -0
- package/dist/core/p-42f1b9cc.entry.js.map +1 -0
- package/dist/core/p-53228014.entry.js +2 -0
- package/dist/core/p-53228014.entry.js.map +1 -0
- package/dist/core/p-574355c9.entry.js +2 -0
- package/dist/core/p-574355c9.entry.js.map +1 -0
- package/dist/core/p-5af1273f.entry.js +2 -0
- package/dist/core/p-5af1273f.entry.js.map +1 -0
- package/dist/core/p-5eecd3fc.entry.js +2 -0
- package/dist/core/p-5eecd3fc.entry.js.map +1 -0
- package/dist/core/{p-51ea45cb.entry.js → p-606ad46f.entry.js} +2 -2
- package/dist/core/p-606ad46f.entry.js.map +1 -0
- package/dist/core/{p-a4439688.entry.js → p-620b758c.entry.js} +2 -2
- package/dist/core/p-637035c3.entry.js +2 -0
- package/dist/core/p-637035c3.entry.js.map +1 -0
- package/dist/core/p-72210cd4.entry.js +2 -0
- package/dist/core/p-72210cd4.entry.js.map +1 -0
- package/dist/core/p-7c3c080a.entry.js +2 -0
- package/dist/core/p-7c3c080a.entry.js.map +1 -0
- package/dist/core/p-7c663d4a.entry.js +2 -0
- package/dist/core/p-7c663d4a.entry.js.map +1 -0
- package/dist/core/p-7c6710f8.entry.js +2 -0
- package/dist/core/p-7c6710f8.entry.js.map +1 -0
- package/dist/core/{p-c6a62d1b.entry.js → p-80dee118.entry.js} +2 -2
- package/dist/core/p-80dee118.entry.js.map +1 -0
- package/dist/core/p-85d51975.entry.js +2 -0
- package/dist/core/p-85d51975.entry.js.map +1 -0
- package/dist/core/{p-044689ef.entry.js → p-8ffdd236.entry.js} +2 -2
- package/dist/core/p-8ffdd236.entry.js.map +1 -0
- package/dist/core/p-97953d8b.entry.js +2 -0
- package/dist/core/p-97953d8b.entry.js.map +1 -0
- package/dist/core/p-9a62c3b8.entry.js +2 -0
- package/dist/core/p-9a62c3b8.entry.js.map +1 -0
- package/dist/core/p-a22d335b.entry.js +2 -0
- package/dist/core/p-a22d335b.entry.js.map +1 -0
- package/dist/core/p-a22e5356.entry.js +2 -0
- package/dist/core/p-a22e5356.entry.js.map +1 -0
- package/dist/core/p-b03218df.entry.js +2 -0
- package/dist/core/p-b03218df.entry.js.map +1 -0
- package/dist/core/p-c1feb2b2.entry.js +2 -0
- package/dist/core/p-c1feb2b2.entry.js.map +1 -0
- package/dist/core/p-c883b5c1.entry.js +2 -0
- package/dist/core/p-c883b5c1.entry.js.map +1 -0
- package/dist/core/p-dcbfc485.entry.js +2 -0
- package/dist/core/p-dcbfc485.entry.js.map +1 -0
- package/dist/core/{p-44ee5375.entry.js → p-e3e0cf46.entry.js} +2 -2
- package/dist/core/p-e3e0cf46.entry.js.map +1 -0
- package/dist/core/{p-89be0a21.js → p-e6a330e4.js} +2 -2
- package/dist/core/p-e6a330e4.js.map +1 -0
- package/dist/core/{p-94416b6b.entry.js → p-e7b6d9c5.entry.js} +2 -2
- package/dist/core/{p-94416b6b.entry.js.map → p-e7b6d9c5.entry.js.map} +1 -1
- package/dist/core/p-ea3e2419.entry.js +2 -0
- package/dist/core/p-ea3e2419.entry.js.map +1 -0
- package/dist/core/{p-94141606.entry.js → p-f32ab3de.entry.js} +2 -2
- package/dist/core/p-f32ab3de.entry.js.map +1 -0
- package/dist/core/p-f3f9acbb.entry.js +2 -0
- package/dist/core/p-f3f9acbb.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-a7b13f5a.js → helpers-1e2516ae.js} +2 -2
- package/dist/esm/helpers-1e2516ae.js.map +1 -0
- package/dist/esm/ic-accordion-group.entry.js +9 -9
- package/dist/esm/ic-accordion-group.entry.js.map +1 -1
- package/dist/esm/ic-accordion.entry.js +4 -4
- package/dist/esm/ic-accordion.entry.js.map +1 -1
- package/dist/esm/ic-alert.entry.js +6 -4
- package/dist/esm/ic-alert.entry.js.map +1 -1
- package/dist/esm/ic-card-horizontal.entry.js +22 -27
- package/dist/esm/ic-card-horizontal.entry.js.map +1 -1
- package/dist/esm/ic-card-vertical.entry.js +22 -24
- package/dist/esm/ic-card-vertical.entry.js.map +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +15 -4
- package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
- package/dist/esm/ic-checkbox.entry.js +4 -2
- package/dist/esm/ic-checkbox.entry.js.map +1 -1
- package/dist/esm/ic-classification-banner.entry.js +1 -1
- package/dist/esm/ic-classification-banner.entry.js.map +1 -1
- package/dist/esm/ic-data-table-title-bar.entry.js +1 -1
- package/dist/esm/ic-data-table.entry.js +66 -11
- package/dist/esm/ic-data-table.entry.js.map +1 -1
- package/dist/esm/ic-date-input.entry.js +4 -3
- package/dist/esm/ic-date-input.entry.js.map +1 -1
- package/dist/esm/ic-date-picker.entry.js +2 -2
- package/dist/esm/ic-date-picker.entry.js.map +1 -1
- package/dist/esm/ic-dialog.entry.js +3 -1
- package/dist/esm/ic-dialog.entry.js.map +1 -1
- package/dist/esm/ic-divider.entry.js +72 -8
- package/dist/esm/ic-divider.entry.js.map +1 -1
- package/dist/esm/ic-empty-state_2.entry.js +23 -9
- package/dist/esm/ic-empty-state_2.entry.js.map +1 -1
- package/dist/esm/ic-footer-link-group.entry.js +1 -1
- package/dist/esm/ic-footer-link-group.entry.js.map +1 -1
- package/dist/esm/ic-footer-link.entry.js +1 -1
- package/dist/esm/ic-footer-link.entry.js.map +1 -1
- package/dist/esm/ic-footer.entry.js +1 -1
- package/dist/esm/ic-footer.entry.js.map +1 -1
- package/dist/esm/ic-hero.entry.js +1 -1
- package/dist/esm/ic-hero.entry.js.map +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +3 -2
- package/dist/esm/ic-horizontal-scroll.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +5 -4
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-input-label_2.entry.js +2 -2
- package/dist/esm/ic-input-label_2.entry.js.map +1 -1
- package/dist/esm/ic-menu-group.entry.js +1 -1
- package/dist/esm/ic-menu-group.entry.js.map +1 -1
- package/dist/esm/ic-menu-item.entry.js +9 -9
- package/dist/esm/ic-menu-item.entry.js.map +1 -1
- package/dist/esm/ic-navigation-group.entry.js +3 -2
- package/dist/esm/ic-navigation-group.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +29 -2
- package/dist/esm/ic-navigation-item.entry.js.map +1 -1
- package/dist/esm/ic-pagination_4.entry.js +44 -25
- package/dist/esm/ic-pagination_4.entry.js.map +1 -1
- package/dist/esm/ic-popover-menu.entry.js +3 -3
- package/dist/esm/ic-popover-menu.entry.js.map +1 -1
- package/dist/esm/ic-radio-group.entry.js +13 -4
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/ic-radio-option.entry.js +7 -3
- package/dist/esm/ic-radio-option.entry.js.map +1 -1
- package/dist/esm/ic-search-bar.entry.js +11 -8
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-side-navigation.entry.js +3 -2
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-tab-context.entry.js +2 -1
- package/dist/esm/ic-tab-context.entry.js.map +1 -1
- package/dist/esm/ic-toast.entry.js +3 -3
- package/dist/esm/ic-toast.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button-group.entry.js +1 -1
- package/dist/esm/ic-toggle-button-group.entry.js.map +1 -1
- package/dist/esm/ic-tree-item.entry.js +8 -6
- package/dist/esm/ic-tree-item.entry.js.map +1 -1
- package/dist/esm/ic-tree-view.entry.js +13 -13
- package/dist/esm/ic-tree-view.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-card-horizontal/ic-card-horizontal.d.ts +6 -2
- package/dist/types/components/ic-data-table/ic-data-table.d.ts +11 -0
- package/dist/types/components/ic-data-table/story-data.d.ts +1 -0
- package/dist/types/components/ic-pagination-bar/ic-pagination-bar.d.ts +10 -5
- package/dist/types/components/ic-tree-item/ic-tree-item.d.ts +6 -5
- package/dist/types/components/ic-tree-view/ic-tree-view.d.ts +7 -6
- package/dist/types/components.d.ts +54 -21
- package/dist/types/utils/types.d.ts +3 -1
- package/hydrate/index.js +430 -201
- package/package.json +3 -3
- package/dist/core/p-044689ef.entry.js.map +0 -1
- package/dist/core/p-095da817.entry.js +0 -2
- package/dist/core/p-095da817.entry.js.map +0 -1
- package/dist/core/p-13e01a1e.entry.js.map +0 -1
- package/dist/core/p-1ae71507.entry.js +0 -2
- package/dist/core/p-1ae71507.entry.js.map +0 -1
- package/dist/core/p-2200ca85.entry.js +0 -2
- package/dist/core/p-2200ca85.entry.js.map +0 -1
- package/dist/core/p-2257f5e8.entry.js +0 -2
- package/dist/core/p-2257f5e8.entry.js.map +0 -1
- package/dist/core/p-266098ee.entry.js +0 -2
- package/dist/core/p-266098ee.entry.js.map +0 -1
- package/dist/core/p-283a2274.entry.js +0 -2
- package/dist/core/p-283a2274.entry.js.map +0 -1
- package/dist/core/p-42f88966.entry.js +0 -2
- package/dist/core/p-42f88966.entry.js.map +0 -1
- package/dist/core/p-44ee5375.entry.js.map +0 -1
- package/dist/core/p-48a78218.entry.js +0 -2
- package/dist/core/p-48a78218.entry.js.map +0 -1
- package/dist/core/p-4e316ae5.entry.js +0 -2
- package/dist/core/p-4e316ae5.entry.js.map +0 -1
- package/dist/core/p-51ea45cb.entry.js.map +0 -1
- package/dist/core/p-5458d818.entry.js +0 -2
- package/dist/core/p-5458d818.entry.js.map +0 -1
- package/dist/core/p-5ad1a7fb.entry.js +0 -2
- package/dist/core/p-5ad1a7fb.entry.js.map +0 -1
- package/dist/core/p-5b061abc.entry.js +0 -2
- package/dist/core/p-5b061abc.entry.js.map +0 -1
- package/dist/core/p-6fd89ed5.entry.js +0 -2
- package/dist/core/p-6fd89ed5.entry.js.map +0 -1
- package/dist/core/p-7e1603cc.entry.js.map +0 -1
- package/dist/core/p-7e5b0fff.entry.js +0 -2
- package/dist/core/p-7e5b0fff.entry.js.map +0 -1
- package/dist/core/p-86b608b5.entry.js +0 -2
- package/dist/core/p-86b608b5.entry.js.map +0 -1
- package/dist/core/p-89be0a21.js.map +0 -1
- package/dist/core/p-94141606.entry.js.map +0 -1
- package/dist/core/p-a8106c56.entry.js +0 -2
- package/dist/core/p-a8106c56.entry.js.map +0 -1
- package/dist/core/p-affd7f55.entry.js +0 -2
- package/dist/core/p-affd7f55.entry.js.map +0 -1
- package/dist/core/p-bac2beeb.entry.js +0 -2
- package/dist/core/p-bac2beeb.entry.js.map +0 -1
- package/dist/core/p-c29b2b48.entry.js +0 -2
- package/dist/core/p-c29b2b48.entry.js.map +0 -1
- package/dist/core/p-c6a62d1b.entry.js.map +0 -1
- package/dist/core/p-cfd81370.entry.js +0 -2
- package/dist/core/p-cfd81370.entry.js.map +0 -1
- package/dist/core/p-d53fb899.entry.js +0 -2
- package/dist/core/p-d53fb899.entry.js.map +0 -1
- package/dist/core/p-d5e9cf81.entry.js +0 -2
- package/dist/core/p-d5e9cf81.entry.js.map +0 -1
- package/dist/core/p-dcccd9c1.entry.js +0 -2
- package/dist/core/p-edfd0946.entry.js +0 -2
- package/dist/core/p-edfd0946.entry.js.map +0 -1
- package/dist/core/p-f1842a68.entry.js +0 -2
- package/dist/core/p-f1842a68.entry.js.map +0 -1
- package/dist/core/p-f8c1d7e8.entry.js +0 -2
- package/dist/core/p-f8c1d7e8.entry.js.map +0 -1
- package/dist/core/p-fc2f336d.entry.js +0 -2
- package/dist/core/p-fc2f336d.entry.js.map +0 -1
- package/dist/esm/helpers-a7b13f5a.js.map +0 -1
- /package/dist/core/{p-a4439688.entry.js.map → p-620b758c.entry.js.map} +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["icDateInputCss","inputIds","DateInput","this","ARIA_INVALID","ARIA_LABEL","ARIA_LABELLED_BY","EVENT_OBJECT_STRING","FIT_TO_VALUE","initialValue","value","INPUT_EVENT_OBJECT_STRING","inputsInOrder","isAfterMax","isBeforeMin","isDateSetFromKeyboardEvent","isDisabledDate","isValidDay","isValidMonth","isValidDate","isZuluTime","KEYBOARD_EVENT_OBJECT_STRING","MAX_DAY","MAX_MONTH","previousEmittedDate","undefined","previousSelectedDate","selectedDate","setInputPasteValue","input","pastedValue","inputEl","classList","add","checkSingleCopiedValueIsValid","isValid","Number","dayInputEl","monthInputEl","yearInputEl","isKeyboardOrEvent","event","Object","prototype","toString","call","setDateValidity","isEmptyString","day","month","handleInput","inputEvent","target","inputType","preventAutoFormatting","length","setInputValue","notifyScreenReader","moveToNextInput","setPreventInput","setFitToValueStyling","setValidationMessage","handleKeyDown","isInputPrevented","eventKey","_a","key","toLowerCase","regex","test","ctrlKey","metaKey","preventDefault","setPasteInvalidText","handleLeftRightArrowKeyPress","handleUpDownArrowKeyPress","preventInput","handleFocus","select","handleBlur","autocompleteInput","moveToPreviousInput","notifyScreenReaderSelectedDate","dayNames","stringEnumToArray","IcDayNames","months","IcDateInputMonths","selectedDateInfoEl","textContent","getDay","getDate","getMonth","getFullYear","minValue","maxValue","Date","handleDateChange","force","dateMatches","forEach","year","invalidDateText","setValueAndEmitChange","updateInputValues","slicePastedDate","valueLength","datePart","slice","isPastedStringDateValid","handlePaste","clipboardData","getData","setPastedValueAndValidation","setDate","date","remove","isDateOrEpoch","newDate","convertToDoubleDigits","defaultDateArray","splitStringDate","dateFormat","formatMinMax","formattedDate","clear","newValue","convertToDate","isSelectedDateDisabled","setAttribute","removeAttribute","invalidDateMessage","disablePast","disablePastMessage","minDate","disableFuture","disableFutureMessage","maxDate","disableDays","disableDaysMessage","setInputsInOrder","inputs","el","shadowRoot","querySelectorAll","push","setAriaLabelledBy","disabled","inputCompContainerEl","getAttribute","removeAriaLabelledBy","labelEl","querySelector","labelId","inputId","id","hasValidation","validationStatus","validationText","labelledBy","_b","screenReaderInfoId","getInputDescribedByText","helperText","defaultHelperText","selectedDateInfoId","assistiveHintId","isPrevented","preventDayInput","preventMonthInput","preventYearInput","getInputFromDatePart","dayInput","h","class","ref","placeholder","onPaste","inputmode","pattern","onKeyDown","monthInput","yearInput","maxLength","getInputsInOrder","dateParts","split","part","substring","getDescOfInputsOrder","description","getScreenReaderInfo","inputDescriptors","required","IcInformationStatus","Error","selectedString","selectionStart","selectionEnd","currentDate","isNotToday","toDateString","includes","currentInput","currentInputPos","findIndex","nextInput","focus","autocompleteYear","inputValue","yearNumbers","autocompletedInput","number","index","handleHostBlur","removeLabelledBy","icBlur","emit","handleHostFocus","activeElement","match","icFocus","handleFormReset","getAriaLabel","notifyScreenReaderArrowKeys","liveRegion","announcement","ariaLabel","notifyScreenReaderInput","setAriaInvalid","validDay","validMonth","validDate","disabledDate","handleClear","handleCalendarOpen","ev","stopImmediatePropagation","calendarButtonEl","displayTooltip","calendarButtonClicked","emitIcChange","handleCalendarFocus","calendarFocused","handleCalendarBlur","handleClearFocus","clearButtonFocused","handleClearBlur","relatedTarget","d","icChange","watchDisableFutureHandler","watchMaxHandler","watchDisablePastHandler","watchMinHandler","createDate","max","min","watchRequiredHandler","asteriskSpan","document","createElement","appendChild","disconnectedCallback","removeFormResetListener","componentWillLoad","addFormResetListener","componentDidLoad","onComponentRequiredPropUndefined","prop","label","propName","addEventListener","componentWillUpdate","componentDidRender","setCalendarFocus","setDisableDays","days","triggerIcChange","nextParsedValue","extractDateFromZuluDateTime","pasteZuluDateTime","dateValue","isNumeric","displayPastedValidation","previousInvalidDateTest","isPasteValidationDisplayed","render","hideHelperText","hideLabel","showClearButton","showCalendarButton","size","hasCustomValidation","assistiveHint","renderHiddenInput","name","Host","onBlur","onFocus","for","role","innerHTML","Clear","onClick","variant","appearance","IcThemeForegroundEnum","Light","Dark","divider","Calendar","Default","status","message"],"sources":["src/components/ic-date-input/ic-date-input.css?tag=ic-date-input&encapsulation=shadow","src/components/ic-date-input/ic-date-input.tsx"],"sourcesContent":["@import \"../../../dist/core/normalize.css\";\n\n:host {\n --ic-input-label-helpertext-padding: var(--ic-space-xxs);\n}\n\ninput {\n border: 0;\n height: 100%;\n padding: 0;\n outline: none;\n background: none;\n -moz-appearance: textfield;\n appearance: textfield;\n}\n\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n}\n\ninput:-webkit-autofill {\n box-shadow: 0 0 0 var(--ic-space-sm) var(--ic-architectural-white) inset;\n}\n\nic-input-component-container {\n cursor: text;\n}\n\nic-input-component-container,\nic-input-component-container:hover {\n color: var(--ic-color-text-tertiary);\n}\n\nic-input-component-container .focus-indicator {\n padding: var(--ic-space-xxxs) var(--ic-space-xs);\n align-items: center;\n}\n\n.day-input {\n width: 1.438rem;\n}\n\n.month-input {\n width: 1.813rem;\n}\n\n.year-input,\n.year-input.fit-to-value {\n width: 2.313rem;\n}\n\n.fit-to-value {\n width: 1.25rem;\n}\n\n.sr-only {\n position: absolute;\n left: -9999px;\n}\n\n.input-container {\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n position: relative;\n}\n\n.action-buttons {\n display: flex;\n align-items: center;\n}\n\n.show-calendar-button-wrapper {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.clear-button,\n.calendar-button {\n border-radius: var(--ic-border-radius);\n transition: box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition);\n margin: 0;\n}\n\n.clear-button.hidden {\n display: none;\n}\n\n.clear-button:focus,\n.calendar-button:focus,\n.clear-button:active,\n.calendar-button:active {\n background-color: var(--ic-color-focus-inner) !important;\n box-shadow: inset 0 0 0 0.125rem var(--ic-color-focus-outer) !important;\n border-radius: 0.25rem;\n}\n\n.clear-button:focus,\n.calendar-button:focus,\n.clear-button:active *,\n.calendar-button:active * {\n fill: var(--ic-architectural-white);\n}\n\n.divider {\n margin: 0 var(--ic-space-xxs);\n width: var(--ic-space-1px);\n background-color: var(--ic-architectural-400);\n border-radius: var(--ic-space-1px);\n}\n\n.divider.small {\n height: var(--ic-space-md);\n}\n\n.divider.medium {\n height: calc(var(--ic-space-sm) + var(--ic-space-xs));\n}\n\n.divider.large {\n height: var(--ic-space-lg);\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n State,\n Host,\n Method,\n Watch,\n} from \"@stencil/core\";\nimport {\n IcInformationStatus,\n IcInformationStatusOrEmpty,\n IcSizes,\n IcThemeForegroundEnum,\n IcDateFormat,\n IcDateInputMonths,\n IcDayNames,\n IcWeekDays,\n} from \"../../utils/types\";\nimport {\n convertToDoubleDigits,\n createDate,\n dateMatches,\n extractDateFromZuluDateTime,\n isDateOrEpoch,\n splitStringDate,\n} from \"../../utils/date-helpers\";\nimport {\n addFormResetListener,\n getInputDescribedByText,\n isEmptyString,\n isNumeric,\n onComponentRequiredPropUndefined,\n removeFormResetListener,\n renderHiddenInput,\n stringEnumToArray,\n} from \"../../utils/helpers\";\nimport Clear from \"../../assets/clear-icon.svg\";\nimport Calendar from \"../../assets/calendar.svg\";\n\nlet inputIds = 0;\n\n@Component({\n tag: \"ic-date-input\",\n styleUrl: \"ic-date-input.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class DateInput {\n private ARIA_INVALID = \"aria-invalid\";\n private ARIA_LABEL = \"aria-label\";\n private ARIA_LABELLED_BY = \"aria-labelledby\";\n private assistiveHintId: string;\n private calendarButtonEl: HTMLIcButtonElement;\n private dayInputEl: HTMLInputElement;\n private defaultHelperText: string;\n private EVENT_OBJECT_STRING = \"[object Event]\";\n private FIT_TO_VALUE = \"fit-to-value\";\n\n private initialValue = this.value;\n private inputCompContainerEl: HTMLIcInputComponentContainerElement;\n private INPUT_EVENT_OBJECT_STRING = \"[object InputEvent]\";\n private inputsInOrder: HTMLInputElement[] = [];\n\n private isAfterMax: boolean = false;\n private isBeforeMin: boolean = false;\n private isDateSetFromKeyboardEvent: boolean = false;\n private isDisabledDate: boolean = false;\n private isPasteValidationDisplayed: boolean;\n private isValidDay: boolean = true;\n private isValidMonth: boolean = true;\n private isValidDate: boolean = true;\n private isZuluTime: boolean = false;\n\n private KEYBOARD_EVENT_OBJECT_STRING = \"[object KeyboardEvent]\";\n private MAX_DAY = 31;\n private MAX_MONTH = 12;\n private monthInputEl: HTMLInputElement;\n\n private preventAutoFormatting: boolean;\n private preventDayInput: boolean;\n private preventMonthInput: boolean;\n private preventYearInput: boolean;\n\n private previousInvalidDateTest: string;\n private previousEmittedDate: Date = undefined;\n private previousSelectedDate: Date = null;\n\n private selectedDate: Date = null;\n private selectedDateInfoEl: HTMLSpanElement;\n private screenReaderInfoId: string;\n private selectedDateInfoId: string;\n\n private yearInputEl: HTMLInputElement;\n\n @Element() el: HTMLIcDateInputElement;\n\n @State() day: string = \"\";\n @State() invalidDateText: string;\n @State() maxDate: Date;\n @State() minDate: Date;\n @State() month: string = \"\";\n @State() year: string = \"\";\n @State() calendarFocused: boolean = false;\n @State() clearButtonFocused: boolean = false;\n @State() removeLabelledBy: boolean = false;\n\n /**\n * The format in which the date will be displayed.\n */\n // eslint-disable-next-line sonarjs/no-duplicate-string\n @Prop() dateFormat?: IcDateFormat = \"DD/MM/YYYY\";\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * The days of the week to disable.\n */\n @Prop({ mutable: true }) disableDays?: IcWeekDays[] = [];\n\n /**\n * The text to display as the validation message when `disableDays` is set and a disabled date is entered.\n */\n @Prop() disableDaysMessage?: string =\n \"The date you have selected is on a day of the week that is not allowed. Please select another date.\";\n\n /**\n * If `true`, dates in the future are not allowed. A validation message will appear if a date in the future is entered.\n */\n @Prop() disableFuture?: boolean = false;\n\n @Watch(\"disableFuture\")\n watchDisableFutureHandler(): void {\n this.watchMaxHandler();\n }\n\n /**\n * The text to display as the validation message when `disableFuture` is true and a date in the future is entered.\n */\n @Prop() disableFutureMessage?: string =\n \"Dates in the future are not allowed. Please select a date in the past.\";\n\n /**\n * If `true`, dates in the past are not allowed. A validation message will appear if a date in the past is entered.\n */\n @Prop() disablePast?: boolean = false;\n\n @Watch(\"disablePast\")\n watchDisablePastHandler(): void {\n this.watchMinHandler();\n }\n\n /**\n * The text to display as the validation message when `disablePast` is true and a date in the past is entered.\n */\n @Prop() disablePastMessage?: string =\n \"Dates in the past are not allowed. Please select a date in the future.\";\n\n /**\n * The helper text that will be displayed for additional field guidance. This will default to the text \"Use format\" along with the `dateFormat` value.\n */\n @Prop({ mutable: true }) helperText?: string;\n\n /**\n * If `true`, the helper text will be visually hidden, but still read out by screenreaders.\n */\n @Prop() hideHelperText: boolean = false;\n\n /**\n * If `true`, the label will be visually hidden, but will still be read out by screen readers.\n */\n @Prop() hideLabel?: boolean = false;\n\n /**\n * The ID for the input.\n */\n @Prop() inputId?: string = `ic-date-input-${inputIds++}`;\n\n /**\n * The text to display as the validation message when an invalid date is entered.\n */\n @Prop() invalidDateMessage?: string = \"Please enter a valid date.\";\n\n /**\n * The label for the date input.\n */\n @Prop() label!: string;\n\n /**\n * The latest date that will be allowed. The value can be in any format supported as `dateFormat`, in ISO 8601 date string format (`yyyy-mm-dd`) or as a JavaScript `Date` object.\n * The value of this prop is ignored if `disableFuture` is set to `true`.\n */\n @Prop() max?: string | Date = \"\";\n\n @Watch(\"max\")\n watchMaxHandler(): void {\n if (this.disableFuture) {\n this.maxDate = new Date();\n } else {\n this.maxDate = createDate(this.max, this.dateFormat);\n }\n }\n\n /**\n * The earliest date that will be allowed. The value can be in any format supported as `dateFormat`, in ISO 8601 date string format (`yyyy-mm-dd`) or as a JavaScript `Date` object.\n * The value of this prop is ignored if `disablePast` is set to `true`.\n */\n @Prop() min?: string | Date = \"\";\n\n @Watch(\"min\")\n watchMinHandler(): void {\n if (this.disablePast) {\n this.minDate = new Date();\n } else {\n this.minDate = createDate(this.min, this.dateFormat);\n }\n }\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * If `true`, the input will require a value.\n */\n @Prop() required?: boolean = false;\n\n @Watch(\"required\")\n watchRequiredHandler(): void {\n // Prevent asterisk being read out after the label by screen reader (by applying aria-hidden)\n // Needed because label is included in 'aria-labelledby' instead of using 'aria-label'\n const labelEl = this.el.shadowRoot.querySelector(\"label\");\n if (this.required) {\n const asteriskSpan = document.createElement(\"span\");\n asteriskSpan.setAttribute(\"id\", \"asterisk-span\");\n asteriskSpan.setAttribute(\"aria-hidden\", \"true\");\n asteriskSpan.textContent = \" *\";\n labelEl?.appendChild(asteriskSpan);\n } else {\n const asteriskSpan = this.el.shadowRoot.querySelector(\"#asterisk-span\");\n if (asteriskSpan) {\n asteriskSpan.remove();\n }\n }\n }\n\n /**\n * @internal If `true`, a button which displays the calendar view when clicked will be displayed.\n */\n @Prop() showCalendarButton?: boolean = false;\n\n /**\n * If `true`, a button which clears the date input when clicked will be displayed.\n */\n @Prop() showClearButton?: boolean = true;\n\n /**\n * The size of the date input to be displayed.\n */\n @Prop() size?: IcSizes = \"medium\";\n\n /**\n * The value of the date input. The value can be in any format supported as `dateFormat`, in ISO 8601 date string format (`yyyy-mm-dd`) or as a JavaScript `Date` object.\n */\n @Prop({ mutable: true }) value?: string | Date | null | undefined = \"\";\n\n /**\n * The validation status - e.g. 'error' | 'warning' | 'success'. This will override the built-in date validation.\n */\n @Prop({ mutable: true }) validationStatus?: IcInformationStatusOrEmpty = \"\";\n\n /**\n * The text to display as the validation message. This will override the built-in date validation.\n */\n @Prop() validationText?: string = \"\";\n\n /**\n * @internal Emitted when the calendar is opened.\n */\n @Event() calendarButtonClicked: EventEmitter<{ value: Date }>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() icBlur: EventEmitter<{ value: Date }>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() icChange: EventEmitter<{ value: Date }>;\n\n /**\n * Emitted when the input gains focus.\n */\n @Event() icFocus: EventEmitter<{ value: Date }>;\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el, this.handleFormReset);\n }\n\n componentWillLoad(): void {\n this.defaultHelperText = `Use format ${this.dateFormat}`;\n\n if (isEmptyString(this.helperText))\n this.helperText = this.defaultHelperText;\n\n this.watchMinHandler();\n this.watchMaxHandler();\n\n if (this.value) {\n this.setDate(this.value);\n this.previousEmittedDate = this.selectedDate;\n } else {\n this.previousEmittedDate = null;\n }\n\n this.screenReaderInfoId = `${this.inputId}-screen-reader-info`;\n this.assistiveHintId = `${this.inputId}-assistive-hint`;\n this.selectedDateInfoId = `${this.inputId}-selected-date-info`;\n\n addFormResetListener(this.el, this.handleFormReset);\n }\n\n componentDidLoad(): void {\n this.setInputsInOrder();\n\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Date Input\"\n );\n\n if (this.value) {\n this.updateInputValues(this.day, this.month, this.year);\n this.inputsInOrder.forEach((input) => {\n input.classList.add(this.FIT_TO_VALUE);\n });\n }\n\n this.setAriaInvalid(\n this.isValidDay,\n this.isValidMonth,\n this.isValidDate,\n this.isDisabledDate\n );\n\n if (this.value) {\n this.notifyScreenReaderSelectedDate();\n }\n\n this.inputsInOrder.forEach((input) => {\n input.addEventListener(\"input\", this.handleInput);\n input.addEventListener(\"focus\", this.handleFocus);\n input.addEventListener(\"blur\", this.handleBlur);\n });\n\n this.watchRequiredHandler();\n }\n\n componentWillUpdate(): void {\n if (isEmptyString(this.helperText))\n this.helperText = this.defaultHelperText;\n\n if (!this.isDateSetFromKeyboardEvent) this.setDate(this.value);\n\n this.setAriaInvalid(\n this.isValidDay,\n this.isValidMonth,\n this.isValidDate,\n this.isDisabledDate\n );\n this.handleDateChange(false);\n this.isDateSetFromKeyboardEvent = false;\n }\n\n componentDidRender(): void {\n if (this.removeLabelledBy) {\n this.removeAriaLabelledBy();\n return;\n }\n\n this.setAriaLabelledBy();\n }\n\n /**\n * Returns the value as a Date object\n * @returns Date\n */\n @Method()\n async getDate(): Promise<Date> {\n return this.selectedDate;\n }\n\n /**\n * @internal Sets focus on the calendar button.\n */\n @Method()\n async setCalendarFocus(): Promise<void> {\n if (this.calendarButtonEl) {\n this.calendarButtonEl.focus();\n }\n }\n\n /**\n * @internal Used to pass disabledDays from parent component.\n */\n @Method()\n async setDisableDays(days: IcWeekDays[]): Promise<void> {\n this.disableDays = days;\n }\n\n /**\n * @internal Used to enable other components to invoke an IcChange event from the input.\n */\n @Method()\n async triggerIcChange(d: Date): Promise<void> {\n this.emitIcChange(d);\n }\n\n private setInputPasteValue = (input: EventTarget, pastedValue: string) => {\n const inputEl = input as HTMLInputElement;\n\n inputEl.value = pastedValue;\n inputEl.classList.add(this.FIT_TO_VALUE);\n };\n\n private checkSingleCopiedValueIsValid = (\n input: EventTarget,\n pastedValue: string\n ) => {\n let isValid = false;\n const value = Number(pastedValue);\n\n switch (input) {\n case this.dayInputEl:\n isValid = value >= 1 && value <= this.MAX_DAY;\n break;\n case this.monthInputEl:\n isValid = value >= 1 && value <= this.MAX_MONTH;\n break;\n case this.yearInputEl:\n isValid = true;\n break;\n default:\n isValid = false;\n break;\n }\n\n return isValid;\n };\n\n /**\n * Using Object.prototype.string to determine type if event from user\n * @param event - event object used to differentiate keyboard, generic or input event\n * @returns boolean\n */\n private isKeyboardOrEvent = (event: Event) => {\n return (\n Object.prototype.toString.call(event) === this.EVENT_OBJECT_STRING ||\n Object.prototype.toString.call(event) ===\n this.KEYBOARD_EVENT_OBJECT_STRING\n );\n };\n\n private setDateValidity = () => {\n if (!isEmptyString(this.day)) {\n this.isValidDay = +this.day > this.MAX_DAY ? false : true;\n } else {\n this.isValidDay = true;\n }\n\n if (!isEmptyString(this.month)) {\n this.isValidMonth = +this.month > this.MAX_MONTH ? false : true;\n } else {\n this.isValidMonth = true;\n }\n };\n\n private handleInput = (event: Event) => {\n const inputEvent = event as InputEvent;\n const input = event.target as HTMLInputElement;\n\n if (input !== this.yearInputEl) {\n // Only auto-format if input event is not a character being deleted\n // and not as user is changing value using up / down keys\n if (\n inputEvent.inputType !== \"deleteContentBackward\" &&\n !this.preventAutoFormatting\n ) {\n if (\n input.value.length === 1 &&\n ((input === this.dayInputEl && +input.value >= 4) ||\n (input === this.monthInputEl && +input.value >= 2)) &&\n +input.value <= 9\n ) {\n this.setInputValue(input);\n this.notifyScreenReader(input, event);\n this.moveToNextInput(input);\n }\n\n if (input.value.length === 2) {\n if (+input.value === 0) {\n input.value = \"01\";\n }\n this.setInputValue(input);\n this.setPreventInput(input, true);\n this.notifyScreenReader(input, event);\n this.moveToNextInput(input);\n } else {\n this.setPreventInput(input, false);\n }\n } else if (this.preventAutoFormatting) {\n /**\n * Using arrow keys prevents auto formatting so need to deal with\n * switching from arrow keys to inputting numbers\n **/\n if (input.value.length === 2 && !this.isKeyboardOrEvent(event)) {\n this.setInputValue(input);\n this.setPreventInput(input, true);\n this.moveToNextInput(input);\n } else {\n this.setInputValue(input);\n }\n }\n\n if (input.value.length !== 2) {\n this.setPreventInput(input, false);\n }\n } else {\n if (input.value.length === 4) {\n this.setInputValue(input);\n if (\n Object.prototype.toString.call(event) !== this.EVENT_OBJECT_STRING\n ) {\n this.moveToNextInput(input);\n }\n this.setPreventInput(input, true);\n } else {\n this.setInputValue(input, true);\n this.setPreventInput(input, false);\n }\n }\n\n // Add / remove class to make input width match size of value i.e. 2 digits' width for day / month, 4 for year\n this.setFitToValueStyling(input);\n\n if (input.value.length === 0) {\n this.setInputValue(input, true);\n this.setValidationMessage();\n }\n\n this.notifyScreenReader(input, event);\n };\n\n private handleKeyDown = (event: KeyboardEvent, isInputPrevented: boolean) => {\n const input = event.target as HTMLInputElement;\n\n const eventKey = event.key?.toLowerCase();\n // Regex required due to FF allowing all characters as values for number text field.\n const regex =\n /-?\\d*\\.?\\d+(e[-+]?\\d+)?|[/-]|arrowup|arrowdown|arrowleft|arrowright|shift|tab|backspace|delete/;\n if (\n !regex.test(eventKey) &&\n !(\n (event.ctrlKey || event.metaKey) &&\n (eventKey === \"v\" || eventKey === \"c\")\n )\n ) {\n event.preventDefault();\n }\n\n switch (eventKey) {\n case \"/\":\n case \"-\":\n case \".\":\n event.preventDefault();\n this.setPasteInvalidText();\n this.moveToNextInput(input);\n break;\n case \"arrowright\":\n case \"arrowleft\":\n event.preventDefault();\n this.handleLeftRightArrowKeyPress(input, eventKey);\n break;\n case \"arrowup\":\n case \"arrowdown\":\n this.preventAutoFormatting = true;\n this.handleUpDownArrowKeyPress(input, event);\n break;\n default:\n break;\n }\n\n this.preventInput(event, isInputPrevented);\n this.isDateSetFromKeyboardEvent = true;\n };\n\n private handleFocus = (event: FocusEvent) => {\n // Highlight / select all characters in input for easy replacement\n const input = event.target as HTMLInputElement;\n\n input.select();\n };\n\n private handleBlur = (event: FocusEvent) => {\n const input = event.target as HTMLInputElement;\n\n this.setPasteInvalidText();\n this.autocompleteInput(input);\n };\n\n private handleLeftRightArrowKeyPress = (\n input: HTMLInputElement,\n key: string\n ) => {\n if (key === \"arrowright\") {\n this.moveToNextInput(input);\n } else {\n this.moveToPreviousInput(input);\n }\n\n this.setPasteInvalidText();\n };\n\n private notifyScreenReaderSelectedDate = () => {\n const dayNames = stringEnumToArray(IcDayNames);\n const months = stringEnumToArray(IcDateInputMonths);\n\n this.selectedDateInfoEl.textContent = `Selected date: ${\n dayNames[this.selectedDate.getDay()]\n }, ${this.selectedDate.getDate()} ${\n months[this.selectedDate.getMonth()]\n } ${this.selectedDate.getFullYear()}`;\n };\n\n private handleUpDownArrowKeyPress = (\n input: HTMLInputElement,\n event: KeyboardEvent\n ) => {\n const minValue = input === this.yearInputEl ? 0 : 1;\n\n let maxValue;\n\n switch (input) {\n case this.dayInputEl:\n maxValue = this.MAX_DAY;\n break;\n case this.monthInputEl:\n maxValue = this.MAX_MONTH;\n break;\n case this.yearInputEl:\n maxValue = 9999;\n }\n\n // Make value loop round when min / max reached\n if (input?.value) {\n if (event.key === \"ArrowUp\") {\n if (+input.value === maxValue) {\n event.preventDefault();\n input.value = `0${minValue}`;\n } else {\n input.value =\n +input.value + 1 < 10\n ? `0${+input.value + 1}`\n : (+input.value + 1).toString();\n }\n this.notifyScreenReader(input, event);\n }\n\n if (event.key === \"ArrowDown\") {\n if (+input.value === minValue) {\n event.preventDefault();\n input.value = maxValue.toString();\n } else {\n input.value =\n +input.value - 1 < 10\n ? `0${+input.value - 1}`\n : (+input.value - 1).toString();\n }\n this.notifyScreenReader(input, event);\n }\n } else {\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n if (input === this.yearInputEl) {\n input.value = new Date().getFullYear().toString();\n } else {\n input.value = maxValue.toString();\n }\n this.notifyScreenReader(input, event);\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n if (input === this.yearInputEl) {\n input.value = new Date().getFullYear().toString();\n } else {\n input.value = `0${minValue}`;\n }\n this.notifyScreenReader(input, event);\n }\n }\n\n this.setInputValue(input);\n this.setFitToValueStyling(input);\n };\n\n private handleDateChange = (force: boolean) => {\n // Prevent icChange being emitted when each individual input is changed\n // This method is used within componentWillUpdate instead of using @Watch('value');\n if (force || !dateMatches(this.selectedDate, this.previousSelectedDate)) {\n if (this.value) {\n this.inputsInOrder.forEach((input) => {\n input.classList.add(this.FIT_TO_VALUE);\n });\n }\n if (this.day && this.month && this.year && this.invalidDateText === \"\") {\n this.setValueAndEmitChange(this.selectedDate);\n this.notifyScreenReaderSelectedDate();\n } else if (\n !(this.selectedDate === null && this.previousSelectedDate === null)\n ) {\n this.setValueAndEmitChange(null);\n this.selectedDateInfoEl.textContent = \"\";\n }\n this.previousSelectedDate = this.selectedDate;\n\n if (!this.isDateSetFromKeyboardEvent) {\n this.updateInputValues(this.day, this.month, this.year);\n }\n }\n };\n\n private slicePastedDate = (valueLength: number, datePart: string): string => {\n return datePart.length > valueLength\n ? datePart.slice(0, valueLength)\n : datePart;\n };\n\n private isPastedStringDateValid = (value: string) => {\n if (\n /\\d+-\\d+-\\d+$/.test(value) ||\n /\\d+\\/\\d+\\/\\d+/.test(value) ||\n /\\d+\\.\\d+\\.\\d+/.test(value)\n ) {\n return true;\n }\n\n if (\n /[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}(?::[0-9]{2}(?:\\.\\d+)?)?Z/.test(\n value\n )\n ) {\n this.isZuluTime = true;\n return true;\n }\n\n return false;\n };\n\n // Set value of each input to value of pasted date part\n // Allows formats separated by '-' or '/'\n private handlePaste = (event: ClipboardEvent) => {\n event.preventDefault();\n\n const pastedValue = event.clipboardData.getData(\"Text\");\n const isValidDate = this.isPastedStringDateValid(pastedValue);\n\n this.setPastedValueAndValidation(isValidDate, pastedValue, event);\n };\n\n private setDate = (date: string | Date) => {\n if (date === null || date === \"\" || date === undefined) {\n this.day = null;\n this.month = null;\n this.year = null;\n this.inputsInOrder.forEach((input) => {\n input.classList.remove(this.FIT_TO_VALUE);\n this.setPreventInput(input, false);\n });\n this.handleDateChange(true);\n } else {\n if (isDateOrEpoch(date)) {\n let newDate;\n if (typeof date === \"string\") {\n // Checking if epoch date time\n newDate = new Date(+date);\n } else {\n newDate = date;\n }\n\n this.day = convertToDoubleDigits(newDate.getDate());\n this.month = convertToDoubleDigits(newDate.getMonth() + 1);\n this.year = newDate.getFullYear().toString();\n } else if (typeof date === \"string\") {\n const defaultDateArray = splitStringDate(date, this.dateFormat);\n this.year = defaultDateArray[0];\n this.month = defaultDateArray[1];\n this.day = defaultDateArray[2];\n }\n }\n\n this.setValidationMessage();\n };\n\n private formatMinMax = (date: Date) => {\n let formattedDate;\n\n const day = convertToDoubleDigits(date.getDate());\n const month = convertToDoubleDigits(date.getMonth() + 1);\n const year = date.getFullYear();\n\n switch (this.dateFormat) {\n case \"DD/MM/YYYY\":\n formattedDate = `${day}/${month}/${year}`;\n break;\n case \"MM/DD/YYYY\":\n formattedDate = `${month}/${day}/${year}`;\n break;\n case \"YYYY/MM/DD\":\n formattedDate = `${year}/${month}/${day}`;\n break;\n default:\n break;\n }\n return formattedDate;\n };\n private updateInputValues = (day: string, month: string, year: string) => {\n this.dayInputEl.value = day;\n this.monthInputEl.value = month;\n this.yearInputEl.value = year;\n };\n\n // Set value in state based on input\n private setInputValue = (input: HTMLInputElement, clear = false) => {\n const newValue = clear ? \"\" : input.value;\n\n switch (input) {\n case this.dayInputEl:\n this.day = newValue;\n break;\n case this.monthInputEl:\n this.month = newValue;\n break;\n case this.yearInputEl:\n if (this.year !== newValue) {\n this.year = newValue;\n }\n }\n\n this.setValidationMessage();\n };\n\n private setValidationMessage = () => {\n this.setDateValidity();\n\n if (\n !isEmptyString(this.day) &&\n !isEmptyString(this.month) &&\n !isEmptyString(this.year)\n ) {\n // Check whether date actually exists\n // (used https://www.hectane.com/blog/javascript-date-validation-with-leap-year)\n this.selectedDate = this.convertToDate(this.year, this.month, this.day);\n this.isValidDate =\n +this.selectedDate !== 0 && this.selectedDate.getDate() == +this.day;\n this.isDisabledDate = this.isSelectedDateDisabled();\n\n if (!this.isValidDate || this.isDisabledDate) {\n this.inputsInOrder.forEach((input) =>\n input.setAttribute(this.ARIA_INVALID, \"true\")\n );\n } else {\n this.inputsInOrder.forEach((input) =>\n input.removeAttribute(this.ARIA_INVALID)\n );\n }\n } else {\n this.selectedDate = null;\n }\n\n if (!(this.isValidDay && this.isValidMonth && this.isValidDate)) {\n this.invalidDateText = this.invalidDateMessage;\n } else if (this.isDisabledDate && this.selectedDate !== null) {\n if (this.isBeforeMin) {\n if (this.disablePast) {\n this.invalidDateText = this.disablePastMessage;\n } else {\n this.invalidDateText = `Please enter a date after ${this.formatMinMax(\n this.minDate\n )}.`;\n }\n } else if (this.isAfterMax) {\n if (this.disableFuture) {\n this.invalidDateText = this.disableFutureMessage;\n } else {\n this.invalidDateText = `Please enter a date before ${this.formatMinMax(\n this.maxDate\n )}.`;\n }\n } else if (this.disableDays.length !== 0) {\n this.invalidDateText = this.disableDaysMessage;\n } else {\n if (this.disablePast) {\n this.invalidDateText = this.disablePastMessage;\n }\n if (this.disableFuture) {\n this.invalidDateText = this.disableFutureMessage;\n }\n }\n } else {\n this.invalidDateText = \"\";\n }\n };\n\n // Set refs to the input elements in the order they are displayed (based on the dateFormat)\n private setInputsInOrder = () => {\n const inputs = this.el.shadowRoot.querySelectorAll(\"input\");\n inputs.forEach((input) => this.inputsInOrder.push(input));\n };\n\n // Includes text usually added using aria-describedby\n // (which doesn't work on input component container)\n private setAriaLabelledBy = () => {\n if (\n this.disabled &&\n !isEmptyString(\n this.inputCompContainerEl?.getAttribute(this.ARIA_LABELLED_BY)\n )\n ) {\n this.removeAriaLabelledBy();\n return;\n }\n\n if (this.disabled) {\n return;\n }\n\n const labelEl = this.el.shadowRoot.querySelector(\"label\");\n const labelId = `${this.inputId}-label`;\n\n if (labelEl !== null && labelEl !== undefined) {\n labelEl.id = labelId;\n }\n\n const hasValidation =\n (!isEmptyString(this.validationStatus) &&\n !isEmptyString(this.validationText)) ||\n !isEmptyString(this.invalidDateText);\n\n const labelledBy = `${labelEl?.id ?? \"\"} ${\n this.screenReaderInfoId\n } ${getInputDescribedByText(\n this.inputId,\n this.helperText !== \"\" && this.helperText !== this.defaultHelperText,\n hasValidation\n )} ${this.selectedDate ? this.selectedDateInfoId : \"\"} ${\n this.assistiveHintId\n }`;\n\n this.inputCompContainerEl.setAttribute(this.ARIA_LABELLED_BY, labelledBy);\n };\n\n // Sets boolean for each input, used to limit the number of characters within each field (2 for day / month, 4 for year)\n private setPreventInput = (input: HTMLInputElement, isPrevented: boolean) => {\n switch (input) {\n case this.dayInputEl:\n this.preventDayInput = isPrevented;\n break;\n case this.monthInputEl:\n this.preventMonthInput = isPrevented;\n break;\n case this.yearInputEl:\n this.preventYearInput = isPrevented;\n }\n };\n\n // Get input based on letter representing each date part (\"D\", \"M\" or \"Y\")\n // (retrieved from dateFormat)\n private getInputFromDatePart = (datePart: string) => {\n const dayInput = (\n <input\n class=\"day-input\"\n id=\"day-input\"\n ref={(el) => (this.dayInputEl = el)}\n aria-label=\"day\"\n placeholder=\"DD\"\n disabled={this.disabled}\n onPaste={this.handlePaste}\n inputmode=\"number\"\n pattern=\"[0-9]*\"\n onKeyDown={(event) => this.handleKeyDown(event, this.preventDayInput)}\n ></input>\n );\n\n const monthInput = (\n <input\n id=\"month-input\"\n class=\"month-input\"\n ref={(el) => (this.monthInputEl = el)}\n aria-label=\"month\"\n placeholder=\"MM\"\n disabled={this.disabled}\n onPaste={this.handlePaste}\n inputmode=\"number\"\n pattern=\"[0-9]*\"\n onKeyDown={(event) => this.handleKeyDown(event, this.preventMonthInput)}\n ></input>\n );\n\n const yearInput = (\n <input\n id=\"year-input\"\n class=\"year-input\"\n ref={(el) => (this.yearInputEl = el)}\n aria-label=\"year\"\n placeholder=\"YYYY\"\n maxLength={4}\n disabled={this.disabled}\n onPaste={this.handlePaste}\n inputmode=\"number\"\n pattern=\"[0-9]*\"\n onKeyDown={(event) => this.handleKeyDown(event, this.preventYearInput)}\n ></input>\n );\n\n let input;\n\n switch (datePart) {\n case \"D\":\n input = dayInput;\n break;\n case \"M\":\n input = monthInput;\n break;\n case \"Y\":\n input = yearInput;\n }\n\n return input;\n };\n\n // Get input elements in order of chosen date format\n private getInputsInOrder = () => {\n const dateParts = this.dateFormat.split(\"/\");\n\n const inputsInOrder: HTMLInputElement[] = [];\n\n dateParts.forEach((part: string) => {\n inputsInOrder.push(this.getInputFromDatePart(part.substring(0, 1)));\n });\n\n return inputsInOrder;\n };\n\n // To add to the end of assistive hint to make it clearer that each date part has its own input\n // that can be changed individually\n private getDescOfInputsOrder = () => {\n let description;\n\n switch (this.dateFormat) {\n case \"DD/MM/YYYY\":\n description = \"day, month, and year\";\n break;\n case \"MM/DD/YYYY\":\n description = \"month, day, and year\";\n break;\n case \"YYYY/MM/DD\":\n description = \"year, month, and day\";\n }\n\n return description;\n };\n\n // Add 'required' or 'invalid data' to span used in aria-labelledby\n // Many ARIA attributes aren't read out by screen reader when on the input component container\n private getScreenReaderInfo = (validationStatus: string) => {\n let inputDescriptors = \"\";\n\n if (this.required) {\n inputDescriptors += \"required\";\n }\n\n if (validationStatus === IcInformationStatus.Error) {\n inputDescriptors += \" invalid data\";\n }\n\n return inputDescriptors === \"\" ? \"\" : inputDescriptors + \", \";\n };\n\n // Prevent non-number characters being entered\n // ('e' or '.' - which are usually allowed in <input type=\"number\">)\n // And limit the number of characters within each field (2 for day / month, 4 for year)\n // (because 'maxlength' doesn't work on <input type=\"number\">)\n private preventInput = (event: KeyboardEvent, isInputPrevented: boolean) => {\n const key = event.key;\n const input = event.target as HTMLInputElement;\n let selectedString;\n\n if (input) {\n selectedString = input.value.substring(\n input.selectionStart,\n input.selectionEnd\n );\n }\n\n if (\n key === \"e\" ||\n key === \".\" ||\n key === \"-\" ||\n (event.key >= \"0\" &&\n event.key <= \"9\" &&\n isInputPrevented &&\n !selectedString)\n ) {\n event.preventDefault();\n }\n };\n\n // Get whether date has been disabled using disableFuture or disablePast prop, but always allow current day\n // Consider using dateClamp and inDateRange\n private isSelectedDateDisabled = () => {\n const currentDate = new Date();\n this.isAfterMax = false;\n this.isBeforeMin = false;\n\n let disabled = false;\n const isNotToday =\n this.selectedDate.toDateString() !== currentDate.toDateString();\n\n if (this.minDate && this.selectedDate < this.minDate && isNotToday) {\n this.isBeforeMin = true;\n disabled = true;\n }\n\n if (this.maxDate && this.selectedDate > this.maxDate && isNotToday) {\n this.isAfterMax = true;\n disabled = true;\n }\n\n if (this.disableDays.includes(this.selectedDate.getDay())) {\n disabled = true;\n }\n\n if (\n ((this.disablePast && this.selectedDate < currentDate) ||\n (this.disableFuture && this.selectedDate > currentDate)) &&\n isNotToday\n ) {\n disabled = true;\n }\n\n return disabled;\n };\n\n private moveToNextInput = (currentInput: HTMLInputElement) => {\n const currentInputPos = this.inputsInOrder.findIndex(\n (input) => input === currentInput\n );\n const nextInput = this.inputsInOrder[currentInputPos + 1];\n\n this.preventAutoFormatting = false;\n\n if (nextInput) {\n nextInput.focus();\n }\n };\n\n private moveToPreviousInput = (currentInput: HTMLInputElement) => {\n const currentInputPos = this.inputsInOrder.findIndex(\n (input) => input === currentInput\n );\n\n this.preventAutoFormatting = false;\n\n if (this.inputsInOrder[currentInputPos - 1]) {\n this.inputsInOrder[currentInputPos - 1].focus();\n }\n };\n\n private autocompleteInput = (input: HTMLInputElement) => {\n if (input === this.yearInputEl) {\n this.autocompleteYear();\n } else {\n const inputValue = input.value;\n\n // Autocomplete input as 2 characters (leading zero) when only 1 character entered (for day and month)\n if (inputValue.length === 1) {\n if (+inputValue === 0) {\n input.value = \"01\";\n } else {\n input.value = `0${inputValue}`;\n }\n }\n }\n\n if (input.value) {\n this.setInputValue(input);\n }\n };\n\n // Autocomplete year as current millennium when fewer than 4 characters entered\n private autocompleteYear = () => {\n const inputValue = this.yearInputEl.value;\n const yearNumbers = [\"2\", \"0\", \"0\"];\n\n let autocompletedInput = \"\";\n\n if (inputValue) {\n yearNumbers.forEach((number, index) => {\n if (inputValue.length + index <= 3) {\n autocompletedInput += number;\n }\n });\n\n this.yearInputEl.value = `${autocompletedInput}${inputValue}`;\n }\n };\n\n private convertToDate = (\n year: string,\n month: string,\n day: string\n ): Date | null => {\n if (!isEmptyString(year) && !isEmptyString(month) && !isEmptyString(day)) {\n return new Date(+year, +month - 1, +day);\n } else {\n return null;\n }\n };\n\n private handleHostBlur = () => {\n this.removeLabelledBy = false;\n this.icBlur.emit({ value: this.selectedDate });\n };\n\n private handleHostFocus = () => {\n if (this.el.shadowRoot.activeElement?.id.match(/(day|month|year)-input$/)) {\n this.removeLabelledBy = false;\n } else {\n this.removeLabelledBy = true;\n }\n this.icFocus.emit({ value: this.selectedDate });\n };\n\n private handleFormReset = () => {\n // Get the initial value and populate day, month and year again.\n this.setDate(this.initialValue);\n this.setValidationMessage();\n this.handleDateChange(false);\n };\n\n private getAriaLabel = (input: HTMLInputElement): string => {\n return input.getAttribute(this.ARIA_LABEL);\n };\n\n private notifyScreenReaderArrowKeys = (input: HTMLInputElement) => {\n const liveRegion = this.el.shadowRoot.querySelector(\"#live-region\");\n let announcement = \"\";\n const ariaLabel = this.getAriaLabel(input);\n\n if (liveRegion && input.value) {\n if (\n input === this.monthInputEl &&\n !!IcDateInputMonths[+input.value - 1]\n ) {\n announcement = `${input.value} - ${\n IcDateInputMonths[+input.value - 1]\n }, ${ariaLabel}`;\n }\n\n if (input === this.dayInputEl || input === this.yearInputEl) {\n announcement = `${input.value}, ${ariaLabel}`;\n }\n\n liveRegion.textContent = announcement;\n }\n };\n\n private removeAriaLabelledBy() {\n this.inputCompContainerEl.removeAttribute(this.ARIA_LABELLED_BY);\n }\n\n private setPastedValueAndValidation(\n isValidDate: boolean,\n pastedValue: string,\n event: ClipboardEvent\n ) {\n switch (true) {\n case isValidDate: {\n const nextParsedValue = this.isZuluTime\n ? extractDateFromZuluDateTime(pastedValue)\n : pastedValue;\n const dateParts = nextParsedValue.split(/-|\\/|\\./);\n this.inputsInOrder.forEach((input, index) => {\n input.classList.add(this.FIT_TO_VALUE);\n\n if (this.isZuluTime) {\n this.pasteZuluDateTime(dateParts, index);\n } else {\n let dateValue;\n\n if (input === this.dayInputEl || input === this.monthInputEl) {\n dateValue = this.slicePastedDate(2, dateParts[index]);\n } else {\n dateValue = this.slicePastedDate(4, dateParts[index]);\n }\n\n input.value = dateValue;\n\n this.setInputValue(input);\n this.autocompleteInput(input);\n }\n });\n this.isZuluTime = false;\n break;\n }\n\n case (pastedValue.length === 1 ||\n pastedValue.length === 2 ||\n pastedValue.length === 4) &&\n isNumeric(pastedValue):\n if (this.checkSingleCopiedValueIsValid(event.target, pastedValue)) {\n // Check if copied value can be pasted into input\n this.setInputPasteValue(event.target, pastedValue);\n this.setInputValue(event.target as HTMLInputElement);\n } else {\n this.displayPastedValidation(event);\n }\n break;\n\n case pastedValue.length === 3 && isNumeric(pastedValue):\n if (event.target !== this.yearInputEl) {\n this.displayPastedValidation(event);\n } else {\n this.setInputPasteValue(event.target, pastedValue);\n this.setInputValue(event.target as HTMLInputElement);\n }\n break;\n\n case pastedValue.length >= 5 && isNumeric(pastedValue):\n this.displayPastedValidation(event);\n }\n }\n\n private pasteZuluDateTime(dateParts: string[], index: number) {\n // ['YYYY', 'MM', 'DD']\n if (index === 0) {\n const dateValue = this.slicePastedDate(4, dateParts[index]);\n this.yearInputEl.value = dateValue;\n this.setInputValue(this.yearInputEl);\n } else if (index === 1) {\n // The month value is the second item in the array\n const dateValue = this.slicePastedDate(2, dateParts[index]);\n this.monthInputEl.value = dateValue;\n this.setInputValue(this.monthInputEl);\n } else {\n const dateValue = this.slicePastedDate(2, dateParts[index]);\n this.dayInputEl.value = dateValue;\n this.setInputValue(this.dayInputEl);\n }\n }\n\n private displayPastedValidation(event: ClipboardEvent) {\n if (this.invalidDateText?.length > 0) {\n this.previousInvalidDateTest = this.invalidDateText;\n }\n\n this.invalidDateText = `Please paste a valid ${this.getAriaLabel(\n event.target as HTMLInputElement\n )}`;\n\n this.validationStatus = IcInformationStatus.Error;\n this.isPasteValidationDisplayed = true;\n }\n\n private setPasteInvalidText() {\n if (this.isPasteValidationDisplayed) {\n this.invalidDateText = this.previousInvalidDateTest ?? \"\";\n this.isPasteValidationDisplayed = false;\n\n // This is to prevent setDate from triggering within componentWillUpdate\n this.isDateSetFromKeyboardEvent = true;\n }\n }\n\n private notifyScreenReader(input: HTMLInputElement, event: Event) {\n const liveRegion = this.el.shadowRoot.querySelector(\"#live-region\");\n\n if (liveRegion) {\n if (this.isKeyboardOrEvent(event)) {\n this.notifyScreenReaderArrowKeys(input);\n } else if (\n Object.prototype.toString.call(event) === this.INPUT_EVENT_OBJECT_STRING\n ) {\n this.notifyScreenReaderInput(input, liveRegion as HTMLElement);\n }\n }\n }\n\n private notifyScreenReaderInput = (\n input: HTMLInputElement,\n liveRegion: HTMLElement\n ) => {\n let announcement = \"\";\n const ariaLabel = this.getAriaLabel(input);\n\n if (input === this.dayInputEl || input === this.monthInputEl) {\n if (input.value.length === 2) {\n if (\n input === this.monthInputEl &&\n !!IcDateInputMonths[+input.value - 1] &&\n this.isValidMonth\n ) {\n announcement = `${input.value} - ${\n IcDateInputMonths[+input.value - 1]\n }, ${ariaLabel}`;\n }\n\n if (input === this.dayInputEl && this.isValidDay) {\n announcement = `${input.value}, ${ariaLabel}`;\n }\n } else {\n announcement = \"\";\n }\n } else {\n if (input.value.length === 4) {\n announcement = `${input.value}, ${ariaLabel}`;\n } else {\n announcement = \"\";\n }\n }\n liveRegion.textContent = announcement;\n };\n\n private setFitToValueStyling = (input: HTMLInputElement) => {\n if (input.value) {\n input.classList.add(this.FIT_TO_VALUE);\n } else {\n input.classList.remove(this.FIT_TO_VALUE);\n }\n };\n\n private setAriaInvalid = (\n validDay: boolean,\n validMonth: boolean,\n validDate: boolean,\n disabledDate: boolean\n ) => {\n if (this.inputsInOrder.length) {\n this.inputsInOrder.forEach((input) => {\n input.removeAttribute(this.ARIA_INVALID);\n });\n\n if (!validDay) {\n this.dayInputEl.setAttribute(this.ARIA_INVALID, \"true\");\n }\n\n if (!validMonth) {\n this.monthInputEl.setAttribute(this.ARIA_INVALID, \"true\");\n }\n\n if (!validDate || disabledDate) {\n this.inputsInOrder.forEach((input) => {\n input.setAttribute(this.ARIA_INVALID, \"true\");\n });\n }\n }\n };\n\n private handleClear = () => {\n this.inputsInOrder.forEach((input) => {\n input.classList.remove(this.FIT_TO_VALUE);\n this.setInputValue(input, true);\n this.setPreventInput(input, false);\n });\n this.isDateSetFromKeyboardEvent = false;\n this.setValidationMessage();\n this.handleDateChange(true);\n\n this.inputsInOrder[0].focus();\n };\n\n private handleCalendarOpen = (ev: MouseEvent) => {\n ev.stopImmediatePropagation();\n this.calendarButtonEl?.shadowRoot\n .querySelector(\"ic-tooltip\")\n .displayTooltip(false);\n this.calendarButtonClicked.emit({ value: this.selectedDate });\n this.calendarButtonEl?.shadowRoot\n .querySelector(\"ic-tooltip\")\n .displayTooltip(false);\n this.isDateSetFromKeyboardEvent = false;\n };\n\n private setValueAndEmitChange = (value: Date) => {\n if (!dateMatches(new Date(this.value), value)) {\n this.emitIcChange(value);\n this.value = value;\n }\n };\n\n private handleCalendarFocus = () => {\n this.calendarFocused = true;\n };\n\n private handleCalendarBlur = () => {\n this.calendarFocused = false;\n };\n\n private handleClearFocus = () => {\n this.removeLabelledBy = true;\n this.clearButtonFocused = true;\n };\n\n private handleClearBlur = (ev: FocusEvent) => {\n this.clearButtonFocused = false;\n if ((ev.relatedTarget as HTMLElement)?.id.match(/(day|year)-input$/)) {\n this.removeLabelledBy = false;\n return;\n }\n\n this.removeLabelledBy = true;\n };\n\n private emitIcChange = (d: Date) => {\n if (\n !(d === null && this.previousEmittedDate === null) &&\n !dateMatches(d, this.previousEmittedDate)\n ) {\n this.previousEmittedDate = d;\n this.icChange.emit({ value: d });\n }\n };\n\n render() {\n const {\n inputId,\n label,\n disabled,\n helperText,\n hideHelperText,\n hideLabel,\n showClearButton,\n showCalendarButton,\n size,\n } = this;\n\n const hasCustomValidation =\n !isEmptyString(this.validationStatus) &&\n !isEmptyString(this.validationText);\n\n const validationStatus = hasCustomValidation\n ? this.validationStatus\n : !isEmptyString(this.invalidDateText)\n ? IcInformationStatus.Error\n : \"\";\n\n const assistiveHint = `Type or use the up and down arrow keys to change the values for the ${this.getDescOfInputsOrder()}.`;\n\n renderHiddenInput(\n true,\n this.el,\n this.name,\n this.convertToDate(this.year, this.month, this.day),\n this.disabled\n );\n\n return (\n <Host onBlur={this.handleHostBlur} onFocus={this.handleHostFocus}>\n <ic-input-container disabled={disabled}>\n {!(hideLabel && hideHelperText) && (\n <ic-input-label\n for={inputId}\n label={label}\n hideLabel={hideLabel}\n helperText={!hideHelperText ? helperText : null}\n disabled={disabled}\n ></ic-input-label>\n )}\n <span id={this.screenReaderInfoId} class=\"sr-only\" aria-hidden=\"true\">\n {this.getScreenReaderInfo(validationStatus)}\n {hideLabel && `${label}\\n`}\n {hideHelperText && `${helperText}\\n`}\n {`${this.defaultHelperText}.`}\n </span>\n <span id={this.assistiveHintId} class=\"sr-only\" aria-hidden=\"true\">\n {assistiveHint}\n </span>\n <span id=\"live-region\" aria-live=\"assertive\" class=\"sr-only\"></span>\n <ic-input-component-container\n id={inputId}\n ref={(el: HTMLIcInputComponentContainerElement) =>\n (this.inputCompContainerEl = el)\n }\n disabled={disabled}\n validationStatus={validationStatus}\n size={size}\n role=\"group\"\n >\n <div class=\"input-container\">\n <div class=\"date-inputs\">\n {this.getInputsInOrder()[0]}/{this.getInputsInOrder()[1]}/\n {this.getInputsInOrder()[2]}\n </div>\n <div class=\"action-buttons\">\n {showClearButton && (\n <ic-button\n id=\"clear-button\"\n aria-label=\"Clear input\"\n class={{\n [\"clear-button\"]: true,\n [\"hidden\"]:\n isEmptyString(this.day) &&\n isEmptyString(this.month) &&\n isEmptyString(this.year),\n }}\n disabled={this.disabled}\n innerHTML={Clear}\n onClick={this.handleClear}\n onFocus={this.handleClearFocus}\n onBlur={this.handleClearBlur}\n variant=\"icon\"\n appearance={\n this.clearButtonFocused\n ? IcThemeForegroundEnum.Light\n : IcThemeForegroundEnum.Dark\n }\n size={size}\n ></ic-button>\n )}\n {showCalendarButton && (\n <div class=\"show-calendar-button-wrapper\">\n <div class={{ divider: true, [size]: true }}></div>\n <ic-button\n id=\"calendar-button\"\n ref={(el: HTMLIcButtonElement) =>\n (this.calendarButtonEl = el)\n }\n aria-label=\"Display calendar\"\n aria-haspopup=\"dialog\"\n class=\"calendar-button\"\n disabled={this.disabled}\n innerHTML={Calendar}\n onClick={this.handleCalendarOpen}\n variant=\"icon\"\n size={size}\n onFocus={this.handleCalendarFocus}\n onBlur={this.handleCalendarBlur}\n appearance={\n this.calendarFocused\n ? IcThemeForegroundEnum.Light\n : IcThemeForegroundEnum.Default\n }\n ></ic-button>\n </div>\n )}\n </div>\n </div>\n </ic-input-component-container>\n <span id={this.selectedDateInfoId} class=\"sr-only\" aria-live=\"polite\">\n <span\n ref={(el) => (this.selectedDateInfoEl = el)}\n role=\"status\"\n ></span>\n </span>\n {(hasCustomValidation || !isEmptyString(this.invalidDateText)) && (\n <ic-input-validation\n status={validationStatus}\n message={\n hasCustomValidation ? this.validationText : this.invalidDateText\n }\n for={inputId}\n ></ic-input-validation>\n )}\n </ic-input-container>\n </Host>\n );\n }\n}\n"],"mappings":"4kCAAA,MAAMA,EAAiB,0uIC2CvB,IAAIC,EAAW,E,MASFC,EAAS,M,yLACZC,KAAAC,aAAe,eACfD,KAAAE,WAAa,aACbF,KAAAG,iBAAmB,kBAKnBH,KAAAI,oBAAsB,iBACtBJ,KAAAK,aAAe,eAEfL,KAAAM,aAAeN,KAAKO,MAEpBP,KAAAQ,0BAA4B,sBAC5BR,KAAAS,cAAoC,GAEpCT,KAAAU,WAAsB,MACtBV,KAAAW,YAAuB,MACvBX,KAAAY,2BAAsC,MACtCZ,KAAAa,eAA0B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AQxC3I,EAAA,QAAMlB,GAAIxJ,KAAKkK,mBAAoBS,MAAM,UAAS,YAAW,UAC3DD,EAAA,QACEE,IAAMjC,GAAQ3I,KAAKqF,mBAAqBsD,EACxC+J,KAAK,aAGPR,IAAwBtP,EAAc5C,KAAKmG,mBAC3CuE,EAAA,uBACE4I,OAAQ5J,EACR6J,QACErB,EAAsBlS,KAAK2J,eAAiB3J,KAAKmG,gBAEnDsM,IAAKlJ,K"}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as t,c as e,f as i,h as s,H as o,g as r}from"./p-8455d1bb.js";import{c,i as l,o as a}from"./p-e6a330e4.js";const n=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M7 9.5L12 14.5L17 9.5H7Z" fill="currentColor"/>\n</svg>`;const h=':host{display:block;border:none;position:relative}:host .tree-item-content{display:flex;align-items:center;height:calc(var(--ic-space-xl) + var(--ic-space-xs));padding:0 var(--ic-space-xs);text-decoration:none;color:var(--ic-tree-view-text);--ic-typography-color:var(--ic-tree-view-text)}::slotted([slot="router-item"]){display:flex;align-items:center;height:calc(var(--ic-space-xl) + var(--ic-space-xs));text-decoration:none;font-family:var(--ic-font-body-family);color:var(--ic-tree-view-text);padding:0 var(--ic-space-xs) !important}::slotted([slot="router-item"].ic-tree-item-single){padding-left:calc(var(--ic-space-xl) + var(--ic-space-xs)) !important}:host .tree-item-content:focus,::slotted([slot="router-item"]:focus){box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);transition:var(--ic-transition-duration-fast);outline:none}:host(.ic-tree-item-focus-inset) .tree-item-content:focus,:host(.ic-tree-item-focus-inset) ::slotted([slot="router-item"]:focus){box-shadow:var(--ic-border-focus-inset);border-radius:var(--ic-border-radius-inset)}:host(.ic-tree-item-focus-inset) .tree-item-content,:host(.ic-tree-item-focus-inset) ::slotted([slot="router-item"]){padding:0 var(--ic-space-sm)}:host .tree-item-content:hover,::slotted([slot="router-item"]:hover){background-color:var(--ic-tree-view-hover) !important;cursor:pointer}:host .tree-item-content:active,::slotted([slot="router-item"]:active){background-color:var(--ic-tree-view-pressed) !important}:host(.ic-tree-item-selected) .tree-item-content,:host(.ic-tree-item-selected) ::slotted([slot="router-item"]){background-color:var(--ic-tree-view-selected) !important}:host(.ic-tree-item-small) .tree-item-content,:host(.ic-tree-item-small) ::slotted([slot="router-item"]){height:var(--ic-space-xl)}:host(.ic-tree-item-large) .tree-item-content,:host(.ic-tree-item-large) ::slotted([slot="router-item"]){height:var(--ic-space-xxl)}:host(.ic-tree-item-disabled){pointer-events:none}:host(.ic-tree-item-disabled) .tree-item-content,:host(.ic-tree-item-disabled) .arrow-dropdown,:host(.ic-tree-item-disabled) ::slotted([slot="icon"]),:host(.ic-tree-item-disabled) ::slotted([slot="router-item"]){color:var(--ic-tree-view-text-disabled) !important;--ic-typography-color:var(--ic-tree-view-text-disabled) !important;fill:var(--ic-tree-view-icon-disabled);pointer-events:none}:host .arrow-dropdown{color:var(--ic-tree-view-dropdown-arrow);margin-right:var(--ic-space-xs)}:host(.ic-tree-item-small) .arrow-dropdown{margin-right:var(--ic-space-xxs)}:host .tree-item-expanded{transform:rotate(180deg);margin-top:calc(-1 * var(--ic-space-xxs))}:host .ic-tree-item-single{padding-left:calc(var(--ic-space-xl) + var(--ic-space-xs))}:host(.ic-tree-item-small) .ic-tree-item-single{padding-left:calc(var(--ic-space-xl) + var(--ic-space-xxs))}.icon-container{width:var(--ic-space-lg);height:var(--ic-space-lg);margin:0 var(--ic-space-xs) 0 0}:host(.ic-tree-item-small) .icon-container{margin:0 var(--ic-space-xxs) 0 0}.ic-text-overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ic-tooltip-overflow{overflow:hidden}::slotted([slot="icon"]){fill:var(--ic-tree-view-icon)}@media (forced-colors: active){::slotted([slot="icon"]){fill:currentcolor}:host .tree-item-content:hover,::slotted([slot="router-item"]:hover),:host .tree-item-content:active,::slotted([slot="router-item"]:active),:host(.ic-tree-item-selected) .tree-item-content,:host(.ic-tree-item-selected) ::slotted([slot="router-item"]){background-color:none !important}:host(.ic-tree-item-disabled) .tree-item-content,:host(.ic-tree-item-disabled) .arrow-dropdown,:host(.ic-tree-item-disabled) ::slotted([slot="icon"]),:host(.ic-tree-item-disabled) ::slotted([slot="router-item"]){color:GrayText !important;--ic-typography-color:GrayText !important;fill:GrayText !important}:host .tree-item-content:focus,::slotted([slot="router-item"]:focus){border:var(--ic-border-hc) !important}:host(.ic-tree-item-selected) .tree-item-content,:host(.ic-tree-item-selected) ::slotted([slot="router-item"]){color:Highlight !important;--ic-typography-color:Highlight !important}}';let d=0;const m=class{constructor(s){t(this,s);this.icTreeItemSelected=e(this,"icTreeItemSelected",7);this.treeItemId=`ic-tree-item-${d++}`;this.treeItemTag="IC-TREE-ITEM";this.hostMutationObserver=null;this.TOOLTIP="ic-tooltip";this.handleTreeItemClicked=()=>{if(this.isParent){this.expanded=!this.expanded;this.hasParentExpanded=true}this.updateAriaLabel();this.selected=true;this.watchSelectedHandler()};this.setTreeItemPadding=()=>{let t=1;let e=this.el.parentElement;const i=this.el.shadowRoot.querySelector(".tree-item-content");const s=Array.from(e.children).map((t=>{if(t!==this.el&&!t.querySelector('[slot="router-item"]')&&!t.querySelector('[slot="label"]')){return t.children.length>0}else{return false}})).includes(true);const o=e.tagName===this.treeItemTag;const r=this.hasRouterSlot();if(s&&!this.el.isParent||o&&!this.el.isParent){if(r){this.routerSlot.classList.add("ic-tree-item-single")}else{i.classList.add("ic-tree-item-single")}}while(e){if(e.tagName===this.treeItemTag){t++;if(!this.el.isParent&&s){i.style.paddingLeft=`calc(var(--ic-space-xl) + ${t*16}px)`}else if(!this.el.isParent){i.style.paddingLeft=`calc(var(--ic-space-xs) + ${t*24}px`}else{i.style.paddingLeft=`${t*16}px`}}e=e.parentElement}};this.truncateTreeItemLabel=t=>{const e=t.shadowRoot.querySelector(".tree-item-label");const i=e===null||e===void 0?void 0:e.closest(this.TOOLTIP);const s=t.shadowRoot.querySelector(".tree-item-content");if((e===null||e===void 0?void 0:e.scrollHeight)>(s===null||s===void 0?void 0:s.clientHeight)){e.classList.add("ic-text-overflow");if(!i){const t=document.createElement("ic-tooltip");t.setAttribute("target",this.el.id);t.setAttribute("label",e.textContent);t.classList.add("ic-tooltip-overflow");t.setAttribute("placement","right");s.appendChild(t);t.appendChild(e)}}};this.hostMutationCallback=t=>{if(t.some((({type:t,addedNodes:e,removedNodes:i})=>t==="childList"?c(e,i,"icon"):false))){i(this)}};this.handleDisplayTooltip=t=>{const e=this.el.shadowRoot.querySelector(".tree-item-label");const i=e===null||e===void 0?void 0:e.closest(this.TOOLTIP);i===null||i===void 0?void 0:i.displayTooltip(t)};this.childTreeItems=undefined;this.disabled=false;this.expanded=false;this.focusInset=false;this.hasParentExpanded=false;this.href=undefined;this.hreflang="";this.isParent=false;this.label="";this.referrerpolicy=undefined;this.rel=undefined;this.selected=false;this.size="medium";this.target=undefined;this.theme="inherit"}watchSelectedHandler(){if(this.selected){this.icTreeItemSelected.emit({id:this.el.id})}this.updateAriaLabel()}disconnectedCallback(){var t;(t=this.hostMutationObserver)===null||t===void 0?void 0:t.disconnect()}componentDidLoad(){this.childTreeItems=Array.from(this.el.children).filter((t=>t.tagName===this.treeItemTag));if(this.childTreeItems.length>0){this.isParent=true}this.setTreeItemPadding();this.updateAriaLabel();setTimeout((()=>{this.truncateTreeItemLabel(this.el)}),100);!l(this.el,"label")&&a([{prop:this.label,propName:"label"}],"Tree item");this.hostMutationObserver=new MutationObserver(this.hostMutationCallback);this.hostMutationObserver.observe(this.el,{childList:true})}componentDidUpdate(){if(this.hasParentExpanded){this.childTreeItems.forEach((t=>{this.truncateTreeItemLabel(t)}));this.hasParentExpanded=false}}handleKeyDown(t){if(t.key==="Enter"||t.key===" "){t.stopImmediatePropagation();this.handleTreeItemClicked()}}async setFocus(){var t,e;if(this.hasRouterSlot()){(t=this.routerSlot)===null||t===void 0?void 0:t.focus()}else{(e=this.treeItemElement)===null||e===void 0?void 0:e.focus()}}async updateAriaLabel(){let t;if(this.hasRouterSlot()){t=this.routerSlot.textContent}else if(l(this.el,"label")){t=this.el.querySelector('[slot="label"]').textContent}else{t=this.label}if(this.isParent){t=`${t}, triggers submenu, ${this.expanded?"expanded":"collapsed"}`}if(this.el.parentElement){const e=Array.from(this.el.parentElement.children).filter((t=>t.tagName===this.treeItemTag));const i=e.indexOf(this.el)+1;const s=e.length;t=`${t}, ${i} of ${s}`}if(this.selected){t=`${t}, active`}if(this.disabled){t=`${t}, dimmed`}if(this.hasRouterSlot()){this.routerSlot.ariaLabel=t}else{this.treeItemElement.ariaLabel=t}}hasRouterSlot(){this.routerSlot=this.el.querySelector('[slot="router-item"]');return!!this.routerSlot}render(){const{disabled:t,label:e,selected:i,size:r,expanded:c,focusInset:a,theme:h}=this;const d=this.href&&!this.disabled?"a":"div";const m=d=="a"&&{href:this.href,hrefLang:this.hreflang,referrerPolicy:this.referrerpolicy,rel:this.rel,target:this.target};return s(o,{class:{"ic-tree-item-disabled":t,"ic-tree-item-selected":!t&&i,[`ic-tree-item-${r}`]:r!=="medium",[`ic-tree-item-focus-inset`]:a,[`ic-theme-${h}`]:h!=="inherit"},id:this.treeItemId},this.hasRouterSlot()?s("slot",{name:"router-item"}):s(d,Object.assign({class:{"tree-item-content":true},tabIndex:t?-1:0,onClick:this.handleTreeItemClicked,ref:t=>this.treeItemElement=t,"aria-disabled":t?"true":"false","aria-live":"polite"},m,{onFocus:()=>this.handleDisplayTooltip(true),onBlur:()=>this.handleDisplayTooltip(false)}),this.isParent&&s("span",{class:{["arrow-dropdown"]:true,["tree-item-expanded"]:c},"aria-hidden":"true",innerHTML:n}),l(this.el,"icon")&&s("div",{class:"icon-container"},s("slot",{name:"icon"})),s("ic-typography",{class:"tree-item-label"},l(this.el,"label")?s("slot",{name:"label"}):e)),c&&s("div",{"aria-hidden":`${!c}`},s("slot",null)))}get el(){return r(this)}static get watchers(){return{selected:["watchSelectedHandler"]}}};m.style=h;export{m as ic_tree_item};
|
2
|
+
//# sourceMappingURL=p-c883b5c1.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["icTreeItemCss","treeItemIds","TreeItem","this","treeItemId","treeItemTag","hostMutationObserver","TOOLTIP","handleTreeItemClicked","isParent","expanded","hasParentExpanded","updateAriaLabel","selected","watchSelectedHandler","setTreeItemPadding","level","parentElement","el","treeItemContent","shadowRoot","querySelector","isSiblingOfParent","Array","from","children","map","sibling","length","includes","isChild","tagName","isRouterItem","hasRouterSlot","routerSlot","classList","add","style","paddingLeft","truncateTreeItemLabel","treeItem","typographyEl","tooltip","closest","treeContent","scrollHeight","clientHeight","tooltipEl","document","createElement","setAttribute","id","textContent","appendChild","hostMutationCallback","mutationList","some","type","addedNodes","removedNodes","checkSlotInChildMutations","forceUpdate","handleDisplayTooltip","display","displayTooltip","icTreeItemSelected","emit","disconnectedCallback","_a","disconnect","componentDidLoad","childTreeItems","filter","child","setTimeout","isSlotUsed","onComponentRequiredPropUndefined","prop","label","propName","MutationObserver","observe","childList","componentDidUpdate","forEach","handleKeyDown","ev","key","stopImmediatePropagation","setFocus","focus","_b","treeItemElement","ariaLabel","treeItems","index","indexOf","parentChildren","disabled","render","size","focusInset","theme","Component","href","attrs","hrefLang","hreflang","referrerPolicy","referrerpolicy","rel","target","h","Host","class","name","Object","assign","tabIndex","onClick","ref","onFocus","onBlur","innerHTML","arrowDropdown"],"sources":["src/components/ic-tree-item/ic-tree-item.css?tag=ic-tree-item&encapsulation=shadow","src/components/ic-tree-item/ic-tree-item.tsx"],"sourcesContent":[":host {\n display: block;\n border: none;\n position: relative;\n}\n\n:host .tree-item-content {\n display: flex;\n align-items: center;\n height: calc(var(--ic-space-xl) + var(--ic-space-xs));\n padding: 0 var(--ic-space-xs);\n text-decoration: none;\n color: var(--ic-tree-view-text);\n\n --ic-typography-color: var(--ic-tree-view-text);\n}\n\n::slotted([slot=\"router-item\"]) {\n display: flex;\n align-items: center;\n height: calc(var(--ic-space-xl) + var(--ic-space-xs));\n text-decoration: none;\n font-family: var(--ic-font-body-family);\n color: var(--ic-tree-view-text);\n padding: 0 var(--ic-space-xs) !important;\n}\n\n::slotted([slot=\"router-item\"].ic-tree-item-single) {\n padding-left: calc(var(--ic-space-xl) + var(--ic-space-xs)) !important;\n}\n\n:host .tree-item-content:focus,\n::slotted([slot=\"router-item\"]:focus) {\n box-shadow: var(--ic-border-focus);\n border-radius: var(--ic-border-radius);\n transition: var(--ic-transition-duration-fast);\n outline: none;\n}\n\n:host(.ic-tree-item-focus-inset) .tree-item-content:focus,\n:host(.ic-tree-item-focus-inset) ::slotted([slot=\"router-item\"]:focus) {\n box-shadow: var(--ic-border-focus-inset);\n border-radius: var(--ic-border-radius-inset);\n}\n\n:host(.ic-tree-item-focus-inset) .tree-item-content,\n:host(.ic-tree-item-focus-inset) ::slotted([slot=\"router-item\"]) {\n padding: 0 var(--ic-space-sm);\n}\n\n:host .tree-item-content:hover,\n::slotted([slot=\"router-item\"]:hover) {\n background-color: var(--ic-tree-view-hover) !important;\n cursor: pointer;\n}\n\n:host .tree-item-content:active,\n::slotted([slot=\"router-item\"]:active) {\n background-color: var(--ic-tree-view-pressed) !important;\n}\n\n:host(.ic-tree-item-selected) .tree-item-content,\n:host(.ic-tree-item-selected) ::slotted([slot=\"router-item\"]) {\n background-color: var(--ic-tree-view-selected) !important;\n}\n\n:host(.ic-tree-item-small) .tree-item-content,\n:host(.ic-tree-item-small) ::slotted([slot=\"router-item\"]) {\n height: var(--ic-space-xl);\n}\n\n:host(.ic-tree-item-large) .tree-item-content,\n:host(.ic-tree-item-large) ::slotted([slot=\"router-item\"]) {\n height: var(--ic-space-xxl);\n}\n\n:host(.ic-tree-item-disabled) {\n pointer-events: none;\n}\n\n:host(.ic-tree-item-disabled) .tree-item-content,\n:host(.ic-tree-item-disabled) .arrow-dropdown,\n:host(.ic-tree-item-disabled) ::slotted([slot=\"icon\"]),\n:host(.ic-tree-item-disabled) ::slotted([slot=\"router-item\"]) {\n color: var(--ic-tree-view-text-disabled) !important;\n\n --ic-typography-color: var(--ic-tree-view-text-disabled) !important;\n\n fill: var(--ic-tree-view-icon-disabled);\n pointer-events: none;\n}\n\n:host .arrow-dropdown {\n color: var(--ic-tree-view-dropdown-arrow);\n margin-right: var(--ic-space-xs);\n}\n\n:host(.ic-tree-item-small) .arrow-dropdown {\n margin-right: var(--ic-space-xxs);\n}\n\n:host .tree-item-expanded {\n transform: rotate(180deg);\n margin-top: calc(-1 * var(--ic-space-xxs));\n}\n\n:host .ic-tree-item-single {\n padding-left: calc(var(--ic-space-xl) + var(--ic-space-xs));\n}\n\n:host(.ic-tree-item-small) .ic-tree-item-single {\n padding-left: calc(var(--ic-space-xl) + var(--ic-space-xxs));\n}\n\n.icon-container {\n width: var(--ic-space-lg);\n height: var(--ic-space-lg);\n margin: 0 var(--ic-space-xs) 0 0;\n}\n\n:host(.ic-tree-item-small) .icon-container {\n margin: 0 var(--ic-space-xxs) 0 0;\n}\n\n.ic-text-overflow {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.ic-tooltip-overflow {\n overflow: hidden;\n}\n\n::slotted([slot=\"icon\"]) {\n fill: var(--ic-tree-view-icon);\n}\n\n/** High Contrast **/\n@media (forced-colors: active) {\n ::slotted([slot=\"icon\"]) {\n fill: currentcolor;\n }\n\n :host .tree-item-content:hover,\n ::slotted([slot=\"router-item\"]:hover),\n :host .tree-item-content:active,\n ::slotted([slot=\"router-item\"]:active),\n :host(.ic-tree-item-selected) .tree-item-content,\n :host(.ic-tree-item-selected) ::slotted([slot=\"router-item\"]) {\n background-color: none !important;\n }\n\n :host(.ic-tree-item-disabled) .tree-item-content,\n :host(.ic-tree-item-disabled) .arrow-dropdown,\n :host(.ic-tree-item-disabled) ::slotted([slot=\"icon\"]),\n :host(.ic-tree-item-disabled) ::slotted([slot=\"router-item\"]) {\n color: GrayText !important;\n\n --ic-typography-color: GrayText !important;\n\n fill: GrayText !important;\n }\n\n :host .tree-item-content:focus,\n ::slotted([slot=\"router-item\"]:focus) {\n border: var(--ic-border-hc) !important;\n }\n\n :host(.ic-tree-item-selected) .tree-item-content,\n :host(.ic-tree-item-selected) ::slotted([slot=\"router-item\"]) {\n color: Highlight !important;\n\n --ic-typography-color: Highlight !important;\n }\n}\n","import {\n Component,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n Host,\n Watch,\n State,\n Listen,\n forceUpdate,\n Method,\n} from \"@stencil/core\";\nimport { IcSizes } from \"../../utils/types\";\nimport {\n isSlotUsed,\n onComponentRequiredPropUndefined,\n checkSlotInChildMutations,\n} from \"../../utils/helpers\";\nimport arrowDropdown from \"../../assets/arrow-dropdown.svg\";\nimport { IcThemeMode } from \"@ukic/web-components\";\n\nlet treeItemIds = 0;\n\n/**\n * @slot label - Content is set as the tree item label.\n * @slot icon - Content is placed to the left of the label.\n * @slot router-item - Handle routing by nesting your routes in this slot.\n */\n@Component({\n tag: \"ic-tree-item\",\n styleUrl: \"ic-tree-item.css\",\n shadow: true,\n})\nexport class TreeItem {\n private treeItemId = `ic-tree-item-${treeItemIds++}`;\n private treeItemElement: HTMLElement;\n private treeItemTag = \"IC-TREE-ITEM\";\n private routerSlot: HTMLElement;\n private hostMutationObserver: MutationObserver = null;\n private TOOLTIP = \"ic-tooltip\";\n\n @Element() el: HTMLIcTreeItemElement;\n\n @State() childTreeItems: HTMLIcTreeItemElement[];\n\n /**\n * If `true`, the tree item appears in the disabled state.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * If `true`, the tree item appears in the expanded state.\n */\n @Prop({ mutable: true }) expanded: boolean = false;\n\n /**\n * @internal If `true`, the tree item will have an inset focus border.\n */\n @Prop() focusInset?: boolean = false;\n\n /**\n * @internal Determines if the parent tree item has been expanded.\n */\n @Prop({ mutable: true }) hasParentExpanded: boolean = false;\n\n /**\n * The URL that the tree item link points to. If set, the tree item will render as an \"a\" tag, otherwise it will render as a div.\n */\n @Prop() href?: string | undefined;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string = \"\";\n\n /**\n * @internal If `true`, the tree item is a parent of other tree items.\n */\n @Prop({ mutable: true }) isParent: boolean = false;\n\n /**\n * The label of the tree item.\n */\n @Prop() label: string = \"\";\n\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n\n /**\n * If `true`, the tree item appears in the selected state.\n */\n @Prop({ mutable: true }) selected: boolean = false;\n @Watch(\"selected\")\n watchSelectedHandler() {\n if (this.selected) {\n this.icTreeItemSelected.emit({ id: this.el.id });\n }\n this.updateAriaLabel();\n }\n\n /**\n * @internal Determines the size of the tree item.\n */\n @Prop() size?: IcSizes = \"medium\";\n\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * Emitted when tree item is selected.\n */\n @Event() icTreeItemSelected: EventEmitter<{ id: string }>;\n\n disconnectedCallback(): void {\n this.hostMutationObserver?.disconnect();\n }\n\n componentDidLoad(): void {\n this.childTreeItems = Array.from((this.el as HTMLElement).children).filter(\n (child) => child.tagName === this.treeItemTag\n ) as HTMLIcTreeItemElement[];\n\n if (this.childTreeItems.length > 0) {\n this.isParent = true;\n }\n\n this.setTreeItemPadding();\n\n this.updateAriaLabel();\n\n setTimeout(() => {\n this.truncateTreeItemLabel(this.el);\n }, 100);\n\n !isSlotUsed(this.el, \"label\") &&\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Tree item\"\n );\n\n this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);\n this.hostMutationObserver.observe(this.el, {\n childList: true,\n });\n }\n\n componentDidUpdate(): void {\n if (this.hasParentExpanded) {\n this.childTreeItems.forEach((child) => {\n this.truncateTreeItemLabel(child);\n });\n this.hasParentExpanded = false;\n }\n }\n\n @Listen(\"keydown\", {})\n handleKeyDown(ev: KeyboardEvent): void {\n if (ev.key === \"Enter\" || ev.key === \" \") {\n ev.stopImmediatePropagation();\n this.handleTreeItemClicked();\n }\n }\n\n /**\n * Sets focus on the native `input`.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.hasRouterSlot()) {\n this.routerSlot?.focus();\n } else {\n this.treeItemElement?.focus();\n }\n }\n\n private handleTreeItemClicked = (): void => {\n if (this.isParent) {\n this.expanded = !this.expanded;\n this.hasParentExpanded = true;\n }\n\n this.updateAriaLabel();\n this.selected = true;\n this.watchSelectedHandler();\n };\n\n /**\n * @internal Updates the aria-label of the tree item.\n */\n @Method()\n async updateAriaLabel(): Promise<void> {\n let ariaLabel;\n\n if (this.hasRouterSlot()) {\n ariaLabel = this.routerSlot.textContent;\n } else if (isSlotUsed(this.el, \"label\")) {\n ariaLabel = this.el.querySelector('[slot=\"label\"]').textContent;\n } else {\n ariaLabel = this.label;\n }\n\n if (this.isParent) {\n ariaLabel = `${ariaLabel}, triggers submenu, ${\n this.expanded ? \"expanded\" : \"collapsed\"\n }`;\n }\n\n if (this.el.parentElement) {\n const treeItems = Array.from(\n (this.el.parentElement as HTMLElement).children\n ).filter(\n (child) => child.tagName === this.treeItemTag\n ) as HTMLIcTreeItemElement[];\n\n const index = treeItems.indexOf(this.el) + 1;\n const parentChildren = treeItems.length;\n\n ariaLabel = `${ariaLabel}, ${index} of ${parentChildren}`;\n }\n\n if (this.selected) {\n ariaLabel = `${ariaLabel}, active`;\n }\n\n if (this.disabled) {\n ariaLabel = `${ariaLabel}, dimmed`;\n }\n\n if (this.hasRouterSlot()) {\n this.routerSlot.ariaLabel = ariaLabel;\n } else {\n this.treeItemElement.ariaLabel = ariaLabel;\n }\n }\n\n private setTreeItemPadding = () => {\n let level = 1;\n let parentElement = this.el.parentElement;\n const treeItemContent = this.el.shadowRoot.querySelector(\n \".tree-item-content\"\n ) as HTMLElement;\n\n const isSiblingOfParent = Array.from(parentElement.children)\n .map((sibling) => {\n if (\n sibling !== this.el &&\n !sibling.querySelector('[slot=\"router-item\"]') &&\n !sibling.querySelector('[slot=\"label\"]')\n ) {\n return sibling.children.length > 0;\n } else {\n return false;\n }\n })\n .includes(true);\n\n const isChild = parentElement.tagName === this.treeItemTag;\n\n const isRouterItem = this.hasRouterSlot();\n\n if (\n (isSiblingOfParent && !this.el.isParent) ||\n (isChild && !this.el.isParent)\n ) {\n if (isRouterItem) {\n this.routerSlot.classList.add(\"ic-tree-item-single\");\n } else {\n treeItemContent.classList.add(\"ic-tree-item-single\");\n }\n }\n\n while (parentElement) {\n if (parentElement.tagName === this.treeItemTag) {\n level++;\n if (!this.el.isParent && isSiblingOfParent) {\n treeItemContent.style.paddingLeft = `calc(var(--ic-space-xl) + ${\n level * 16\n }px)`;\n } else if (!this.el.isParent) {\n treeItemContent.style.paddingLeft = `calc(var(--ic-space-xs) + ${\n level * 24\n }px`;\n } else {\n treeItemContent.style.paddingLeft = `${level * 16}px`;\n }\n }\n parentElement = parentElement.parentElement;\n }\n };\n\n private truncateTreeItemLabel = (treeItem: HTMLIcTreeItemElement) => {\n const typographyEl: HTMLIcTypographyElement =\n treeItem.shadowRoot.querySelector(\".tree-item-label\");\n const tooltip = typographyEl?.closest(this.TOOLTIP);\n const treeContent: HTMLElement =\n treeItem.shadowRoot.querySelector(\".tree-item-content\");\n\n if (typographyEl?.scrollHeight > treeContent?.clientHeight) {\n typographyEl.classList.add(\"ic-text-overflow\");\n\n if (!tooltip) {\n const tooltipEl = document.createElement(\"ic-tooltip\");\n tooltipEl.setAttribute(\"target\", this.el.id);\n tooltipEl.setAttribute(\"label\", typographyEl.textContent);\n tooltipEl.classList.add(\"ic-tooltip-overflow\");\n tooltipEl.setAttribute(\"placement\", \"right\");\n treeContent.appendChild(tooltipEl);\n tooltipEl.appendChild(typographyEl);\n }\n }\n };\n\n private hasRouterSlot(): boolean {\n this.routerSlot = this.el.querySelector('[slot=\"router-item\"]');\n return !!this.routerSlot;\n }\n\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n if (\n mutationList.some(({ type, addedNodes, removedNodes }) =>\n type === \"childList\"\n ? checkSlotInChildMutations(addedNodes, removedNodes, \"icon\")\n : false\n )\n ) {\n forceUpdate(this);\n }\n };\n\n private handleDisplayTooltip = (display: boolean) => {\n const typographyEl: HTMLIcTypographyElement =\n this.el.shadowRoot.querySelector(\".tree-item-label\");\n const tooltip: HTMLIcTooltipElement = typographyEl?.closest(this.TOOLTIP);\n\n tooltip?.displayTooltip(display);\n };\n\n render() {\n const { disabled, label, selected, size, expanded, focusInset, theme } =\n this;\n\n const Component = this.href && !this.disabled ? \"a\" : \"div\";\n\n const attrs = Component == \"a\" && {\n href: this.href,\n hrefLang: this.hreflang,\n referrerPolicy: this.referrerpolicy,\n rel: this.rel,\n target: this.target,\n };\n\n return (\n <Host\n class={{\n \"ic-tree-item-disabled\": disabled,\n \"ic-tree-item-selected\": !disabled && selected,\n [`ic-tree-item-${size}`]: size !== \"medium\",\n [`ic-tree-item-focus-inset`]: focusInset,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n id={this.treeItemId}\n >\n {this.hasRouterSlot() ? (\n <slot name=\"router-item\" />\n ) : (\n <Component\n class={{\n \"tree-item-content\": true,\n }}\n tabIndex={disabled ? -1 : 0}\n onClick={this.handleTreeItemClicked}\n ref={(el) => (this.treeItemElement = el)}\n aria-disabled={disabled ? \"true\" : \"false\"}\n aria-live=\"polite\"\n {...attrs}\n onFocus={() => this.handleDisplayTooltip(true)}\n onBlur={() => this.handleDisplayTooltip(false)}\n >\n {this.isParent && (\n <span\n class={{\n [\"arrow-dropdown\"]: true,\n [\"tree-item-expanded\"]: expanded,\n }}\n aria-hidden=\"true\"\n innerHTML={arrowDropdown}\n />\n )}\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon-container\">\n <slot name=\"icon\" />\n </div>\n )}\n <ic-typography class=\"tree-item-label\">\n {isSlotUsed(this.el, \"label\") ? <slot name=\"label\" /> : label}\n </ic-typography>\n </Component>\n )}\n {expanded && (\n <div aria-hidden={`${!expanded}`}>\n <slot />\n </div>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"oSAAA,MAAMA,EAAgB,4gICuBtB,IAAIC,EAAc,E,MAYLC,EAAQ,M,gFACXC,KAAAC,WAAa,gBAAgBH,MAE7BE,KAAAE,YAAc,eAEdF,KAAAG,qBAAyC,KACzCH,KAAAI,QAAU,aAsJVJ,KAAAK,sBAAwB,KAC9B,GAAIL,KAAKM,SAAU,CACjBN,KAAKO,UAAYP,KAAKO,SACtBP,KAAKQ,kBAAoB,I,CAG3BR,KAAKS,kBACLT,KAAKU,SAAW,KAChBV,KAAKW,sBAAsB,EAoDrBX,KAAAY,mBAAqB,KAC3B,IAAIC,EAAQ,EACZ,IAAIC,EAAgBd,KAAKe,GAAGD,cAC5B,MAAME,EAAkBhB,KAAKe,GAAGE,WAAWC,cACzC,sBAGF,MAAMC,EAAoBC,MAAMC,KAAKP,EAAcQ,UAChDC,KAAKC,IACJ,GACEA,IAAYxB,KAAKe,KAChBS,EAAQN,cAAc,0BACtBM,EAAQN,cAAc,kBACvB,CACA,OAAOM,EAAQF,SAASG,OAAS,C,KAC5B,CACL,OAAO,K,KAGVC,SAAS,MAEZ,MAAMC,EAAUb,EAAcc,UAAY5B,KAAKE,YAE/C,MAAM2B,EAAe7B,KAAK8B,gBAE1B,GACGX,IAAsBnB,KAAKe,GAAGT,UAC9BqB,IAAY3B,KAAKe,GAAGT,SACrB,CACA,GAAIuB,EAAc,CAChB7B,KAAK+B,WAAWC,UAAUC,IAAI,sB,KACzB,CACLjB,EAAgBgB,UAAUC,IAAI,sB,EAIlC,MAAOnB,EAAe,CACpB,GAAIA,EAAcc,UAAY5B,KAAKE,YAAa,CAC9CW,IACA,IAAKb,KAAKe,GAAGT,UAAYa,EAAmB,CAC1CH,EAAgBkB,MAAMC,YAAc,6BAClC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A,IAAU,WAEnCnD,GAAIhD,KAAKC,YAERD,KAAK8B,gBACJ+E,EAAA,QAAMG,KAAK,gBAEXH,EAACT,EAASa,OAAAC,OAAA,CACRH,MAAO,CACL,oBAAqB,MAEvBI,SAAUpB,GAAY,EAAI,EAC1BqB,QAASpH,KAAKK,sBACdgH,IAAMtG,GAAQf,KAAKyF,gBAAkB1E,EAAG,gBACzBgF,EAAW,OAAS,QAAO,YAChC,UACNO,EAAK,CACTgB,QAAS,IAAMtH,KAAK2D,qBAAqB,MACzC4D,OAAQ,IAAMvH,KAAK2D,qBAAqB,SAEvC3D,KAAKM,UACJuG,EAAA,QACEE,MAAO,CACL,CAAC,kBAAmB,KACpB,CAAC,sBAAuBxG,GACzB,cACW,OACZiH,UAAWC,IAGdjD,EAAWxE,KAAKe,GAAI,SACnB8F,EAAA,OAAKE,MAAM,kBACTF,EAAA,QAAMG,KAAK,UAGfH,EAAA,iBAAeE,MAAM,mBAClBvC,EAAWxE,KAAKe,GAAI,SAAW8F,EAAA,QAAMG,KAAK,UAAarC,IAI7DpE,GACCsG,EAAA,qBAAkB,IAAItG,KACpBsG,EAAA,c"}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as i,c as t,h as e,H as s,g as a}from"./p-8455d1bb.js";import{c as o}from"./p-e081702e.js";import{f as n,i as r,a as l}from"./p-043cf5de.js";const h='/*! 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{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;min-height:100% !important;background:rgb(0 0 0 / 60%);z-index:var(--ic-z-index-dialog);opacity:0}:host(.ic-dialog-fade-in){opacity:1}:host(.disable-height-constraint){background:none;justify-content:unset;align-items:unset}.dialog.disable-height-constraint{max-height:none;position:relative}.dialog.disable-height-constraint .content-area{overflow-y:visible}@media (prefers-reduced-motion: no-preference){:host{transition:opacity var(--ic-easing-transition-slow)}.dialog{transform:translateY(-3rem);transition:transform 1000s}:host(.ic-dialog-fade-in) .dialog{transform:translateY(0);transition:transform var(--ic-easing-transition-slow)}}:host(.ic-dialog-hidden){display:none}.dialog{background-color:var(--ic-dialog-background);color:var(--ic-dialog-text-primary);--ic-typography-color:var(--ic-dialog-text-primary);border:var(--ic-space-1px) solid var(--ic-dialog-border);border-radius:var(--ic-border-radius);padding:var(--ic-space-xs) 0 var(--ic-space-md);display:flex;flex-direction:column;box-sizing:border-box;overflow-x:visible}.small{width:50%;max-width:25rem;min-height:11rem;max-height:70vh}.medium{width:70vw;max-width:44rem;min-height:12.5rem;max-height:70vh}.large{width:90vw;max-width:62.5rem;min-height:12.5rem;max-height:90vh}.heading-area{display:flex;margin-bottom:var(--ic-space-xs);padding:0 var(--ic-space-md)}.heading{overflow-wrap:break-word}.close-icon{margin-left:auto}.close-icon>svg{color:var(--ic-dialog-icon)}.content-area{-ms-overflow-style:none;scrollbar-width:none;padding:0 var(--ic-space-md);margin:0;overflow-y:auto}.content-area::-webkit-scrollbar{display:none}#dialog-content{margin-bottom:var(--ic-space-sm)}#dialog-content ::slotted(ic-typography){overflow-wrap:break-word}#dialog-content ::slotted(*){position:relative}.dialog-controls{margin-top:auto;padding:var(--ic-space-xs) var(--ic-space-md) 0;display:flex;justify-content:flex-end;gap:var(--ic-space-md)}.dialog-control-button{width:-moz-fit-content;width:fit-content}.backdrop{overflow-y:auto;position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgb(0 0 0 / 60%);z-index:var(--ic-z-index-dialog);padding-top:16px;padding-bottom:16px}.heading ic-typography{--ic-typography-color:var(--ic-dialog-text-primary)}.label ic-typography{--ic-typography-color:var(--ic-dialog-label)}@media (min-width: 800px){:host([size="large"]) .dialog:not(.disable-width-constraint)>.content-area{width:75%}}@media (max-width: 576px){.dialog{width:100vw;height:100vh;transform:translateY(-5rem);max-width:none;max-height:none;box-sizing:border-box}.backdrop{padding:0}.dialog.disable-height-constraint{height:auto;min-height:100vh}}@media (max-width: 364px){.dialog-control-button{width:unset}}';const d=class{constructor(s){i(this,s);this.icDialogCancelled=t(this,"icDialogCancelled",7);this.icDialogClosed=t(this,"icDialogClosed",7);this.icDialogConfirmed=t(this,"icDialogConfirmed",7);this.icDialogOpened=t(this,"icDialogOpened",7);this.DATA_GETS_FOCUS="data-gets-focus";this.DATA_GETS_FOCUS_SELECTOR="[data-gets-focus]";this.DIALOG_CONTROLS="dialog-controls";this.dialogHeight=0;this.focusedElementIndex=0;this.IC_TEXT_FIELD="IC-TEXT-FIELD";this.IC_ACCORDION="IC-ACCORDION";this.IC_ACCORDION_GROUP="IC-ACCORDION-GROUP";this.resizeObserver=null;this.dialogOpened=()=>{var i;this.dialogRendered=true;if(this.disableHeightConstraint){this.dialogEl.show()}else{(i=this.dialogEl)===null||i===void 0?void 0:i.showModal()}setTimeout((()=>{this.fadeIn=true;if(this.disableHeightConstraint&&this.backdropEl.scrollTop!==0){this.backdropEl.scrollTop=0}}),10);setTimeout((()=>{this.setInitialFocus();n(this.runResizeObserver)}),75);setTimeout((()=>{this.getFocusedElementIndex();this.icDialogOpened.emit()}),80)};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{clearTimeout(this.resizeTimeout);this.resizeTimeout=window.setTimeout(this.resizeObserverCallback,80)}));this.resizeObserver.observe(this.dialogEl)};this.resizeObserverCallback=()=>{if(this.dialogEl.clientHeight!==this.dialogHeight){this.dialogHeight=this.dialogEl.clientHeight}};this.refreshInteractiveElementsOnSlotChange=()=>{this.contentArea=this.el.shadowRoot.querySelector("#dialog-content slot");this.contentArea.addEventListener("slotchange",this.getInteractiveElements)};this.removeSlotChangeListener=()=>{if(this.contentArea){this.contentArea.removeEventListener("slotchange",this.getInteractiveElements)}};this.setInitialFocus=()=>{this.sourceElement=document.activeElement;let i;if(this.el.querySelector(this.DATA_GETS_FOCUS_SELECTOR)!==null){i=this.el.querySelector(this.DATA_GETS_FOCUS_SELECTOR)}else{i=this.el.shadowRoot.querySelector(this.DATA_GETS_FOCUS_SELECTOR)}if(i.tagName===this.IC_TEXT_FIELD){i.setFocus()}else if(i.tagName===this.IC_ACCORDION_GROUP){i.setFocus()}else if(i.tagName===this.IC_ACCORDION){i.setFocus()}else{i.focus({preventScroll:this.disableHeightConstraint?true:false})}};this.getFocusedElementIndex=()=>{for(let i=0;i<this.interactiveElementList.length;i++){if(this.interactiveElementList[i]===(this.el.shadowRoot.activeElement||document.activeElement)){this.focusedElementIndex=i}}};this.closeIconClick=()=>{this.open=false};this.getInteractiveElements=()=>{this.interactiveElementList=Array.from(this.el.shadowRoot.querySelectorAll("ic-button"));const i=Array.from(this.el.querySelectorAll(`a[href], button, input:not(.ic-input), textarea, select, details, [tabindex]:not([tabindex="-1"]), \n ic-button, ic-checkbox, ic-select, ic-search-bar, ic-tab-group, ic-radio-group, \n ic-back-to-top, ic-breadcrumb, ic-chip[dismissible="true"], ic-footer-link, ic-link, ic-navigation-button, \n ic-navigation-item, ic-switch, ic-text-field, ic-accordion-group, ic-accordion`));if(i.length>0){if(i[0].slot!==this.DIALOG_CONTROLS){i[0].setAttribute(this.DATA_GETS_FOCUS,"")}else if(!this.destructive){i[i.length-1].setAttribute(this.DATA_GETS_FOCUS,"")}}for(let t=0;t<i.length;t++){this.interactiveElementList.splice(1+t,0,i[t])}};this.getNextFocusEl=i=>this.interactiveElementList[i];this.focusNextInteractiveElement=i=>{this.getFocusedElementIndex();this.setFocusIndexBasedOnShiftKey(i);this.loopNextFocusIndexIfLastElement();let t=this.getNextFocusEl(this.focusedElementIndex);const e=getComputedStyle(t).visibility==="hidden"||t.tagName===this.IC_ACCORDION_GROUP&&t.hasAttribute("single-expansion");if(t.tagName===this.IC_TEXT_FIELD){t.setFocus()}else{if(e){this.setFocusIndexBasedOnShiftKey(i);this.loopNextFocusIndexIfLastElement();t=this.getNextFocusEl(this.focusedElementIndex)}if(t.tagName===this.IC_ACCORDION_GROUP){t.setFocus()}else if(t.tagName===this.IC_ACCORDION){t.setFocus()}else{t.focus()}}};this.renderDialog=()=>{const{buttons:i,size:t,heading:s,label:a,destructive:n,dismissLabel:l,hideCloseButton:h}=this;return e("dialog",{class:{["dialog"]:true,[`${t}`]:true,["disable-height-constraint"]:this.disableHeightConstraint,["disable-width-constraint"]:this.disableWidthConstraint},"aria-labelledby":"dialog-label dialog-heading","aria-describedby":"dialog-alert dialog-content",ref:i=>this.dialogEl=i},e("div",{class:"heading-area"},e("div",{class:"heading-content"},e("div",{class:"label"},e("slot",{name:"label"},e("ic-typography",{variant:"label",id:"dialog-label"},a))),e("div",{class:"heading"},e("slot",{name:"heading"},e("ic-typography",{variant:"h4",id:"dialog-heading"},s)))),!h&&e("ic-button",{class:"close-icon",variant:"icon",innerHTML:o,"aria-label":l,onClick:this.closeIconClick,"data-gets-focus":n||!i?"":null})),e("div",{class:"content-area"},r(this.el,"alert")&&e("slot",{name:"alert"}),e("div",{id:"dialog-content"},e("slot",null))),i&&(r(this.el,this.DIALOG_CONTROLS)?e("div",{class:{[this.DIALOG_CONTROLS]:true}},e("slot",{name:this.DIALOG_CONTROLS})):e("div",{class:{[this.DIALOG_CONTROLS]:true}},e("ic-button",{variant:"tertiary",onClick:()=>this.cancelDialog(),class:"dialog-control-button","data-gets-focus":null},"Cancel"),e("ic-button",{variant:this.destructive?"destructive":"primary",onClick:()=>this.confirmDialog(),class:"dialog-control-button","data-gets-focus":""},"Confirm"))))};this.dialogRendered=false;this.fadeIn=false;this.buttons=true;this.closeOnBackdropClick=true;this.destructive=false;this.dismissLabel="Dismiss";this.disableHeightConstraint=false;this.disableWidthConstraint=false;this.hideCloseButton=false;this.heading=undefined;this.label=undefined;this.open=undefined;this.size="small";this.theme="inherit"}watchOpenHandler(){if(this.open){this.dialogOpened()}else{this.fadeIn=false;if(this.resizeObserver!==null){this.resizeObserver.disconnect()}setTimeout((()=>{var i;this.dialogRendered=false;this.dialogEl.close();(i=this.sourceElement)===null||i===void 0?void 0:i.focus();this.dialogHeight=0;this.icDialogClosed.emit()}),80)}}disconnectedCallback(){this.removeSlotChangeListener()}componentDidLoad(){this.getInteractiveElements();this.refreshInteractiveElementsOnSlotChange();if(this.open){this.dialogOpened()}!r(this.el,"heading")&&l([{prop:this.heading,propName:"heading"}],"Dialog")}componentDidRender(){if(getComputedStyle(this.el).display!=="none"&&this.disableHeightConstraint){document.body.style.overflow="hidden"}else{document.body.style.overflow="auto"}}handleKeyboard(i){if(this.dialogRendered){switch(i.key){case"Tab":i.preventDefault();this.focusNextInteractiveElement(i.shiftKey);break;case"Escape":if(!i.repeat){this.open=false}i.stopImmediatePropagation();break}}}handleClick(i){const t=this.el.shadowRoot.querySelector("dialog");if(this.closeOnBackdropClick&&i.composedPath().indexOf(t)<=0){const t=this.dialogEl.getBoundingClientRect();const e=t.top<=i.clientY&&i.clientY<=t.top+t.height&&t.left<=i.clientX&&i.clientX<=t.left+t.width;if(!e){this.open=false}}}async cancelDialog(){this.icDialogCancelled.emit();this.open=false}async confirmDialog(){this.icDialogConfirmed.emit()}loopNextFocusIndexIfLastElement(){if(this.focusedElementIndex>this.interactiveElementList.length-1)this.focusedElementIndex=0;else if(this.focusedElementIndex<0){this.focusedElementIndex=this.interactiveElementList.length-1}}setFocusIndexBasedOnShiftKey(i){if(i){this.focusedElementIndex-=1}else{this.focusedElementIndex+=1}}render(){return e(s,{class:{["ic-dialog-hidden"]:!this.dialogRendered,["ic-dialog-fade-in"]:this.fadeIn,["disable-height-constraint"]:this.disableHeightConstraint,[`ic-theme-${this.theme}`]:this.theme!=="inherit"}},this.disableHeightConstraint?e("div",{class:"backdrop",ref:i=>this.backdropEl=i},this.renderDialog()):this.renderDialog())}get el(){return a(this)}static get watchers(){return{open:["watchOpenHandler"]}}};d.style=h;export{d as ic_dialog};
|
2
|
+
//# sourceMappingURL=p-dcbfc485.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["icDialogCss","Dialog","constructor","hostRef","this","DATA_GETS_FOCUS","DATA_GETS_FOCUS_SELECTOR","DIALOG_CONTROLS","dialogHeight","focusedElementIndex","IC_TEXT_FIELD","IC_ACCORDION","IC_ACCORDION_GROUP","resizeObserver","dialogOpened","_a","dialogRendered","disableHeightConstraint","dialogEl","show","showModal","setTimeout","fadeIn","backdropEl","scrollTop","setInitialFocus","checkResizeObserver","runResizeObserver","getFocusedElementIndex","icDialogOpened","emit","ResizeObserver","clearTimeout","resizeTimeout","window","resizeObserverCallback","observe","clientHeight","refreshInteractiveElementsOnSlotChange","contentArea","el","shadowRoot","querySelector","addEventListener","getInteractiveElements","removeSlotChangeListener","removeEventListener","sourceElement","document","activeElement","focusedElement","tagName","setFocus","focus","preventScroll","i","interactiveElementList","length","closeIconClick","open","Array","from","querySelectorAll","slottedInteractiveElements","slot","setAttribute","destructive","splice","getNextFocusEl","focusNextInteractiveElement","shiftKey","setFocusIndexBasedOnShiftKey","loopNextFocusIndexIfLastElement","nextFocusEl","isHidden","getComputedStyle","visibility","hasAttribute","renderDialog","buttons","size","heading","label","dismissLabel","hideCloseButton","h","class","disableWidthConstraint","ref","name","variant","id","innerHTML","closeIcon","onClick","isSlotUsed","cancelDialog","confirmDialog","closeOnBackdropClick","undefined","theme","watchOpenHandler","disconnect","close","icDialogClosed","disconnectedCallback","componentDidLoad","onComponentRequiredPropUndefined","prop","propName","componentDidRender","display","body","style","overflow","handleKeyboard","ev","key","preventDefault","repeat","stopImmediatePropagation","handleClick","dialogElement","composedPath","indexOf","rect","getBoundingClientRect","isInDialog","top","clientY","height","left","clientX","width","icDialogCancelled","icDialogConfirmed","render","Host"],"sources":["../web-components/dist/collection/components/ic-dialog/ic-dialog.css?tag=ic-dialog&encapsulation=shadow","../web-components/dist/collection/components/ic-dialog/ic-dialog.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/**\n * @prop --ic-z-index-dialog: z-index of dialog \n */\n\n:host {\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100% !important;\n background: rgb(0 0 0 / 60%);\n z-index: var(--ic-z-index-dialog);\n opacity: 0;\n}\n\n:host(.ic-dialog-fade-in) {\n opacity: 1;\n}\n\n:host(.disable-height-constraint) {\n background: none;\n justify-content: unset;\n align-items: unset;\n}\n\n.dialog.disable-height-constraint {\n max-height: none;\n position: relative;\n}\n\n.dialog.disable-height-constraint .content-area {\n overflow-y: visible;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n :host {\n transition: opacity var(--ic-easing-transition-slow);\n }\n\n .dialog {\n transform: translateY(-3rem);\n transition: transform 1000s;\n }\n\n :host(.ic-dialog-fade-in) .dialog {\n transform: translateY(0);\n transition: transform var(--ic-easing-transition-slow);\n }\n}\n\n:host(.ic-dialog-hidden) {\n display: none;\n}\n\n.dialog {\n background-color: var(--ic-dialog-background);\n color: var(--ic-dialog-text-primary);\n --ic-typography-color: var(--ic-dialog-text-primary);\n border: var(--ic-space-1px) solid var(--ic-dialog-border);\n border-radius: var(--ic-border-radius);\n padding: var(--ic-space-xs) 0 var(--ic-space-md);\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n overflow-x: visible;\n}\n\n.small {\n width: 50%;\n max-width: 25rem;\n min-height: 11rem;\n max-height: 70vh;\n}\n\n.medium {\n width: 70vw;\n max-width: 44rem;\n min-height: 12.5rem;\n max-height: 70vh;\n}\n\n.large {\n width: 90vw;\n max-width: 62.5rem;\n min-height: 12.5rem;\n max-height: 90vh;\n}\n\n.heading-area {\n display: flex;\n margin-bottom: var(--ic-space-xs);\n padding: 0 var(--ic-space-md);\n}\n\n.heading {\n overflow-wrap: break-word;\n}\n\n.close-icon {\n margin-left: auto;\n}\n\n.close-icon > svg {\n color: var(--ic-dialog-icon);\n}\n\n.content-area {\n -ms-overflow-style: none;\n scrollbar-width: none;\n padding: 0 var(--ic-space-md);\n margin: 0;\n overflow-y: auto;\n}\n\n.content-area::-webkit-scrollbar {\n display: none;\n}\n\n#dialog-content {\n margin-bottom: var(--ic-space-sm);\n}\n\n#dialog-content ::slotted(ic-typography) {\n overflow-wrap: break-word;\n}\n\n#dialog-content ::slotted(*) {\n position: relative;\n}\n\n.dialog-controls {\n margin-top: auto;\n padding: var(--ic-space-xs) var(--ic-space-md) 0;\n display: flex;\n justify-content: flex-end;\n gap: var(--ic-space-md);\n}\n\n.dialog-control-button {\n width: -moz-fit-content;\n width: fit-content;\n}\n\n.backdrop {\n overflow-y: auto;\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgb(0 0 0 / 60%);\n z-index: var(--ic-z-index-dialog);\n padding-top: 16px;\n padding-bottom: 16px;\n}\n\n.heading ic-typography {\n --ic-typography-color: var(--ic-dialog-text-primary);\n}\n\n.label ic-typography {\n --ic-typography-color: var(--ic-dialog-label);\n}\n\n@media (min-width: 800px) {\n :host([size=\"large\"]) .dialog:not(.disable-width-constraint) > .content-area {\n width: 75%;\n }\n}\n\n@media (max-width: 576px) {\n .dialog {\n width: 100vw;\n height: 100vh;\n transform: translateY(-5rem);\n max-width: none;\n max-height: none;\n box-sizing: border-box;\n }\n\n .backdrop {\n padding: 0;\n }\n\n .dialog.disable-height-constraint {\n height: auto;\n min-height: 100vh;\n }\n}\n\n@media (max-width: 364px) {\n .dialog-control-button {\n width: unset;\n }\n}\n","import { Host, h, } from \"@stencil/core\";\nimport closeIcon from \"../../assets/close-icon.svg\";\nimport { isSlotUsed, checkResizeObserver, onComponentRequiredPropUndefined, } from \"../../utils/helpers\";\n/**\n * @slot dialog-controls - Content will be place at the bottom of the dialog.\n * @slot heading - Content will be placed at the top of the dialog.\n * @slot label - Content will be placed above the dialog heading.\n * @slot alert - Content will be placed at the top of the content area of the dialog.\n */\nexport class Dialog {\n constructor() {\n this.DATA_GETS_FOCUS = \"data-gets-focus\";\n this.DATA_GETS_FOCUS_SELECTOR = \"[data-gets-focus]\";\n this.DIALOG_CONTROLS = \"dialog-controls\";\n this.dialogHeight = 0;\n this.focusedElementIndex = 0;\n this.IC_TEXT_FIELD = \"IC-TEXT-FIELD\";\n this.IC_ACCORDION = \"IC-ACCORDION\";\n this.IC_ACCORDION_GROUP = \"IC-ACCORDION-GROUP\";\n this.resizeObserver = null;\n this.dialogOpened = () => {\n var _a;\n this.dialogRendered = true;\n if (this.disableHeightConstraint) {\n this.dialogEl.show();\n }\n else {\n (_a = this.dialogEl) === null || _a === void 0 ? void 0 : _a.showModal();\n }\n setTimeout(() => {\n this.fadeIn = true;\n /**\n * This is required to set scroll back to top if:\n * - dialog content goes below the fold\n * - is closed using cancel or confirm and reopened.\n *\n * Without this, the scroll bar will start from the dialog's last scroll-x coordinate.\n */\n if (this.disableHeightConstraint && this.backdropEl.scrollTop !== 0) {\n this.backdropEl.scrollTop = 0;\n }\n }, 10);\n setTimeout(() => {\n this.setInitialFocus();\n checkResizeObserver(this.runResizeObserver);\n }, 75);\n setTimeout(() => {\n this.getFocusedElementIndex();\n this.icDialogOpened.emit();\n }, 80);\n };\n this.runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n clearTimeout(this.resizeTimeout);\n this.resizeTimeout = window.setTimeout(this.resizeObserverCallback, 80);\n });\n this.resizeObserver.observe(this.dialogEl);\n };\n this.resizeObserverCallback = () => {\n if (this.dialogEl.clientHeight !== this.dialogHeight) {\n this.dialogHeight = this.dialogEl.clientHeight;\n }\n };\n this.refreshInteractiveElementsOnSlotChange = () => {\n this.contentArea = this.el.shadowRoot.querySelector(\"#dialog-content slot\");\n this.contentArea.addEventListener(\"slotchange\", this.getInteractiveElements);\n };\n this.removeSlotChangeListener = () => {\n if (this.contentArea) {\n this.contentArea.removeEventListener(\"slotchange\", this.getInteractiveElements);\n }\n };\n this.setInitialFocus = () => {\n this.sourceElement = document.activeElement;\n let focusedElement;\n if (this.el.querySelector(this.DATA_GETS_FOCUS_SELECTOR) !== null) {\n focusedElement = this.el.querySelector(this.DATA_GETS_FOCUS_SELECTOR);\n }\n else {\n focusedElement = this.el.shadowRoot.querySelector(this.DATA_GETS_FOCUS_SELECTOR);\n }\n if (focusedElement.tagName === this.IC_TEXT_FIELD) {\n focusedElement.setFocus();\n }\n else if (focusedElement.tagName === this.IC_ACCORDION_GROUP) {\n focusedElement.setFocus();\n }\n else if (focusedElement.tagName === this.IC_ACCORDION) {\n focusedElement.setFocus();\n }\n else {\n focusedElement.focus({\n preventScroll: this.disableHeightConstraint ? true : false,\n });\n }\n };\n this.getFocusedElementIndex = () => {\n for (let i = 0; i < this.interactiveElementList.length; i++) {\n if (this.interactiveElementList[i] ===\n (this.el.shadowRoot.activeElement || document.activeElement)) {\n this.focusedElementIndex = i;\n }\n }\n };\n this.closeIconClick = () => {\n this.open = false;\n };\n this.getInteractiveElements = () => {\n this.interactiveElementList = Array.from(this.el.shadowRoot.querySelectorAll(\"ic-button\"));\n const slottedInteractiveElements = Array.from(this.el.querySelectorAll(`a[href], button, input:not(.ic-input), textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), \n ic-button, ic-checkbox, ic-select, ic-search-bar, ic-tab-group, ic-radio-group, \n ic-back-to-top, ic-breadcrumb, ic-chip[dismissible=\"true\"], ic-footer-link, ic-link, ic-navigation-button, \n ic-navigation-item, ic-switch, ic-text-field, ic-accordion-group, ic-accordion`));\n if (slottedInteractiveElements.length > 0) {\n if (slottedInteractiveElements[0].slot !== this.DIALOG_CONTROLS) {\n slottedInteractiveElements[0].setAttribute(this.DATA_GETS_FOCUS, \"\");\n }\n else if (!this.destructive) {\n slottedInteractiveElements[slottedInteractiveElements.length - 1].setAttribute(this.DATA_GETS_FOCUS, \"\");\n }\n }\n for (let i = 0; i < slottedInteractiveElements.length; i++) {\n this.interactiveElementList.splice(1 + i, 0, slottedInteractiveElements[i]);\n }\n };\n this.getNextFocusEl = (focusedElementIndex) => this.interactiveElementList[focusedElementIndex];\n this.focusNextInteractiveElement = (shiftKey) => {\n this.getFocusedElementIndex();\n this.setFocusIndexBasedOnShiftKey(shiftKey);\n this.loopNextFocusIndexIfLastElement();\n let nextFocusEl = this.getNextFocusEl(this.focusedElementIndex);\n const isHidden = getComputedStyle(nextFocusEl).visibility === \"hidden\" ||\n (nextFocusEl.tagName === this.IC_ACCORDION_GROUP &&\n nextFocusEl.hasAttribute(\"single-expansion\"));\n if (nextFocusEl.tagName === this.IC_TEXT_FIELD) {\n nextFocusEl.setFocus();\n }\n else {\n if (isHidden) {\n this.setFocusIndexBasedOnShiftKey(shiftKey);\n this.loopNextFocusIndexIfLastElement();\n nextFocusEl = this.getNextFocusEl(this.focusedElementIndex);\n }\n if (nextFocusEl.tagName === this.IC_ACCORDION_GROUP) {\n nextFocusEl.setFocus();\n }\n else if (nextFocusEl.tagName === this.IC_ACCORDION) {\n nextFocusEl.setFocus();\n }\n else {\n nextFocusEl.focus();\n }\n }\n };\n this.renderDialog = () => {\n const { buttons, size, heading, label, destructive, dismissLabel, hideCloseButton, } = this;\n return (h(\"dialog\", { class: {\n [\"dialog\"]: true,\n [`${size}`]: true,\n [\"disable-height-constraint\"]: this.disableHeightConstraint,\n [\"disable-width-constraint\"]: this.disableWidthConstraint,\n }, \"aria-labelledby\": \"dialog-label dialog-heading\", \"aria-describedby\": \"dialog-alert dialog-content\", ref: (el) => (this.dialogEl = el) }, h(\"div\", { class: \"heading-area\" }, h(\"div\", { class: \"heading-content\" }, h(\"div\", { class: \"label\" }, h(\"slot\", { name: \"label\" }, h(\"ic-typography\", { variant: \"label\", id: \"dialog-label\" }, label))), h(\"div\", { class: \"heading\" }, h(\"slot\", { name: \"heading\" }, h(\"ic-typography\", { variant: \"h4\", id: \"dialog-heading\" }, heading)))), !hideCloseButton && (h(\"ic-button\", { class: \"close-icon\", variant: \"icon\", innerHTML: closeIcon, \"aria-label\": dismissLabel, onClick: this.closeIconClick, \"data-gets-focus\": destructive || !buttons ? \"\" : null }))), h(\"div\", { class: \"content-area\" }, isSlotUsed(this.el, \"alert\") && h(\"slot\", { name: \"alert\" }), h(\"div\", { id: \"dialog-content\" }, h(\"slot\", null))), buttons &&\n (isSlotUsed(this.el, this.DIALOG_CONTROLS) ? (h(\"div\", { class: {\n [this.DIALOG_CONTROLS]: true,\n } }, h(\"slot\", { name: this.DIALOG_CONTROLS }))) : (h(\"div\", { class: {\n [this.DIALOG_CONTROLS]: true,\n } }, h(\"ic-button\", { variant: \"tertiary\", onClick: () => this.cancelDialog(), class: \"dialog-control-button\", \"data-gets-focus\": null }, \"Cancel\"), h(\"ic-button\", { variant: this.destructive ? \"destructive\" : \"primary\", onClick: () => this.confirmDialog(), class: \"dialog-control-button\", \"data-gets-focus\": \"\" }, \"Confirm\"))))));\n };\n this.dialogRendered = false;\n this.fadeIn = false;\n this.buttons = true;\n this.closeOnBackdropClick = true;\n this.destructive = false;\n this.dismissLabel = \"Dismiss\";\n this.disableHeightConstraint = false;\n this.disableWidthConstraint = false;\n this.hideCloseButton = false;\n this.heading = undefined;\n this.label = undefined;\n this.open = undefined;\n this.size = \"small\";\n this.theme = \"inherit\";\n }\n watchOpenHandler() {\n if (this.open) {\n this.dialogOpened();\n }\n else {\n this.fadeIn = false;\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n setTimeout(() => {\n var _a;\n this.dialogRendered = false;\n this.dialogEl.close();\n (_a = this.sourceElement) === null || _a === void 0 ? void 0 : _a.focus();\n this.dialogHeight = 0;\n this.icDialogClosed.emit();\n }, 80);\n }\n }\n disconnectedCallback() {\n this.removeSlotChangeListener();\n }\n componentDidLoad() {\n this.getInteractiveElements();\n this.refreshInteractiveElementsOnSlotChange();\n if (this.open) {\n this.dialogOpened();\n }\n !isSlotUsed(this.el, \"heading\") &&\n onComponentRequiredPropUndefined([{ prop: this.heading, propName: \"heading\" }], \"Dialog\");\n }\n componentDidRender() {\n if (getComputedStyle(this.el).display !== \"none\" &&\n this.disableHeightConstraint) {\n document.body.style.overflow = \"hidden\";\n }\n else {\n document.body.style.overflow = \"auto\";\n }\n }\n handleKeyboard(ev) {\n if (this.dialogRendered) {\n switch (ev.key) {\n case \"Tab\":\n ev.preventDefault();\n this.focusNextInteractiveElement(ev.shiftKey);\n break;\n case \"Escape\":\n if (!ev.repeat) {\n this.open = false;\n }\n ev.stopImmediatePropagation();\n break;\n }\n }\n }\n handleClick(ev) {\n const dialogElement = this.el.shadowRoot.querySelector(\"dialog\");\n if (this.closeOnBackdropClick &&\n ev.composedPath().indexOf(dialogElement) <= 0) {\n const rect = this.dialogEl.getBoundingClientRect();\n const isInDialog = rect.top <= ev.clientY &&\n ev.clientY <= rect.top + rect.height &&\n rect.left <= ev.clientX &&\n ev.clientX <= rect.left + rect.width;\n if (!isInDialog) {\n this.open = false;\n }\n }\n }\n /**\n * Cancels the dialog. Used by the default 'Cancel' button or can be called manually to trigger cancelling of dialog.\n */\n async cancelDialog() {\n this.icDialogCancelled.emit();\n this.open = false;\n }\n /**\n * Confirms the dialog. Used by the default 'Confirm' button or can be called manually to trigger confirming of dialog.\n */\n async confirmDialog() {\n this.icDialogConfirmed.emit();\n }\n loopNextFocusIndexIfLastElement() {\n if (this.focusedElementIndex > this.interactiveElementList.length - 1)\n this.focusedElementIndex = 0;\n else if (this.focusedElementIndex < 0) {\n this.focusedElementIndex = this.interactiveElementList.length - 1;\n }\n }\n setFocusIndexBasedOnShiftKey(shiftKey) {\n if (shiftKey) {\n this.focusedElementIndex -= 1;\n }\n else {\n this.focusedElementIndex += 1;\n }\n }\n render() {\n return (h(Host, { class: {\n [\"ic-dialog-hidden\"]: !this.dialogRendered,\n [\"ic-dialog-fade-in\"]: this.fadeIn,\n [\"disable-height-constraint\"]: this.disableHeightConstraint,\n [`ic-theme-${this.theme}`]: this.theme !== \"inherit\",\n } }, this.disableHeightConstraint ? (h(\"div\", { class: \"backdrop\", ref: (el) => (this.backdropEl = el) }, this.renderDialog())) : (this.renderDialog())));\n }\n static get is() { return \"ic-dialog\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() {\n return {\n \"$\": [\"ic-dialog.css\"]\n };\n }\n static get styleUrls() {\n return {\n \"$\": [\"ic-dialog.css\"]\n };\n }\n static get properties() {\n return {\n \"buttons\": {\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 set to `false`, default buttons or slotted dialog controls will not be displayed.\"\n },\n \"attribute\": \"buttons\",\n \"reflect\": false,\n \"defaultValue\": \"true\"\n },\n \"closeOnBackdropClick\": {\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 set to `false`, the dialog will not close when the backdrop is clicked.\"\n },\n \"attribute\": \"close-on-backdrop-click\",\n \"reflect\": false,\n \"defaultValue\": \"true\"\n },\n \"destructive\": {\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 default buttons are displayed, sets the 'primary' or rightmost button to the destructive variant. Stops initial focus being set on the 'primary' or rightmost default or slotted button.\"\n },\n \"attribute\": \"destructive\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"dismissLabel\": {\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\": \"Sets the dismiss label tooltip and aria label.\"\n },\n \"attribute\": \"dismiss-label\",\n \"reflect\": false,\n \"defaultValue\": \"\\\"Dismiss\\\"\"\n },\n \"disableHeightConstraint\": {\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 set to `true`, the content area max height and overflow properties are removed allowing the dialog to stretch below the fold.\\nThis prop also prevents popover elements from being cut off within the content area.\"\n },\n \"attribute\": \"disable-height-constraint\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"disableWidthConstraint\": {\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 set to `true`, the content area width property is removed, allowing content to take the full width of the dialog when using the large variant.\"\n },\n \"attribute\": \"disable-width-constraint\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"hideCloseButton\": {\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 close button will not be displayed.\"\n },\n \"attribute\": \"hide-close-button\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"heading\": {\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\": \"Sets the heading for the dialog.\"\n },\n \"attribute\": \"heading\",\n \"reflect\": false\n },\n \"label\": {\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\": \"Sets the optional label for the dialog which appears above the heading.\"\n },\n \"attribute\": \"label\",\n \"reflect\": false\n },\n \"open\": {\n \"type\": \"boolean\",\n \"mutable\": true,\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 dialog will be displayed.\"\n },\n \"attribute\": \"open\",\n \"reflect\": true,\n \"defaultValue\": \"undefined\"\n },\n \"size\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"\\\"small\\\" | \\\"medium\\\" | \\\"large\\\"\",\n \"resolved\": \"\\\"large\\\" | \\\"medium\\\" | \\\"small\\\"\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Sets the maximum and minimum height and width for the dialog.\"\n },\n \"attribute\": \"size\",\n \"reflect\": false,\n \"defaultValue\": \"\\\"small\\\"\"\n },\n \"theme\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"IcThemeMode\",\n \"resolved\": \"\\\"dark\\\" | \\\"inherit\\\" | \\\"light\\\"\",\n \"references\": {\n \"IcThemeMode\": {\n \"location\": \"import\",\n \"path\": \"../../utils/types\",\n \"id\": \"src/utils/types.ts::IcThemeMode\"\n }\n }\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Sets the theme color to the dark or light theme color. \\\"inherit\\\" will set the color based on the system settings or ic-theme component.\"\n },\n \"attribute\": \"theme\",\n \"reflect\": false,\n \"defaultValue\": \"\\\"inherit\\\"\"\n }\n };\n }\n static get states() {\n return {\n \"dialogRendered\": {},\n \"fadeIn\": {}\n };\n }\n static get events() {\n return [{\n \"method\": \"icDialogCancelled\",\n \"name\": \"icDialogCancelled\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Cancelation event emitted when default 'Cancel' button clicked or 'cancelDialog' method is called.\"\n },\n \"complexType\": {\n \"original\": \"void\",\n \"resolved\": \"void\",\n \"references\": {}\n }\n }, {\n \"method\": \"icDialogClosed\",\n \"name\": \"icDialogClosed\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Emitted when dialog has closed.\"\n },\n \"complexType\": {\n \"original\": \"void\",\n \"resolved\": \"void\",\n \"references\": {}\n }\n }, {\n \"method\": \"icDialogConfirmed\",\n \"name\": \"icDialogConfirmed\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Confirmation event emitted when default 'Confirm' primary button clicked or 'confirmDialog' method is called.\"\n },\n \"complexType\": {\n \"original\": \"void\",\n \"resolved\": \"void\",\n \"references\": {}\n }\n }, {\n \"method\": \"icDialogOpened\",\n \"name\": \"icDialogOpened\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Emitted when dialog has opened.\"\n },\n \"complexType\": {\n \"original\": \"void\",\n \"resolved\": \"void\",\n \"references\": {}\n }\n }];\n }\n static get methods() {\n return {\n \"cancelDialog\": {\n \"complexType\": {\n \"signature\": \"() => Promise<void>\",\n \"parameters\": [],\n \"references\": {\n \"Promise\": {\n \"location\": \"global\",\n \"id\": \"global::Promise\"\n }\n },\n \"return\": \"Promise<void>\"\n },\n \"docs\": {\n \"text\": \"Cancels the dialog. Used by the default 'Cancel' button or can be called manually to trigger cancelling of dialog.\",\n \"tags\": []\n }\n },\n \"confirmDialog\": {\n \"complexType\": {\n \"signature\": \"() => Promise<void>\",\n \"parameters\": [],\n \"references\": {\n \"Promise\": {\n \"location\": \"global\",\n \"id\": \"global::Promise\"\n }\n },\n \"return\": \"Promise<void>\"\n },\n \"docs\": {\n \"text\": \"Confirms the dialog. Used by the default 'Confirm' button or can be called manually to trigger confirming of dialog.\",\n \"tags\": []\n }\n }\n };\n }\n static get elementRef() { return \"el\"; }\n static get watchers() {\n return [{\n \"propName\": \"open\",\n \"methodName\": \"watchOpenHandler\"\n }];\n }\n static get listeners() {\n return [{\n \"name\": \"keydown\",\n \"method\": \"handleKeyboard\",\n \"target\": \"document\",\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"click\",\n \"method\": \"handleClick\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }];\n }\n}\n//# sourceMappingURL=ic-dialog.js.map\n"],"mappings":"sJAAA,MAAMA,EAAc,6kK,MCSPC,EAAM,MACf,WAAAC,CAAAC,G,kNACIC,KAAKC,gBAAkB,kBACvBD,KAAKE,yBAA2B,oBAChCF,KAAKG,gBAAkB,kBACvBH,KAAKI,aAAe,EACpBJ,KAAKK,oBAAsB,EAC3BL,KAAKM,cAAgB,gBACrBN,KAAKO,aAAe,eACpBP,KAAKQ,mBAAqB,qBAC1BR,KAAKS,eAAiB,KACtBT,KAAKU,aAAe,KAChB,IAAIC,EACJX,KAAKY,eAAiB,KACtB,GAAIZ,KAAKa,wBAAyB,CAC9Bb,KAAKc,SAASC,M,KAEb,EACAJ,EAAKX,KAAKc,YAAc,MAAQH,SAAY,OAAS,EAAIA,EAAGK,W,CAEjEC,YAAW,KACPjB,KAAKkB,OAAS,KAQd,GAAIlB,KAAKa,yBAA2Bb,KAAKmB,WAAWC,YAAc,EAAG,CACjEpB,KAAKmB,WAAWC,UAAY,C,IAEjC,IACHH,YAA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ACI,OAAQnD,EAAEoD,EAAM,CAAEnD,MAAO,CACjB,CAAC,qBAAsBlF,KAAKY,eAC5B,CAAC,qBAAsBZ,KAAKkB,OAC5B,CAAC,6BAA8BlB,KAAKa,wBACpC,CAAC,YAAYb,KAAKgG,SAAUhG,KAAKgG,QAAU,YAC1ChG,KAAKa,wBAA2BoE,EAAE,MAAO,CAAEC,MAAO,WAAYE,IAAMhD,GAAQpC,KAAKmB,WAAaiB,GAAOpC,KAAK0E,gBAAoB1E,KAAK0E,e"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as t,c as i,h as s,g as h}from"./p-8455d1bb.js";const e="context-id";const a=class{constructor(s){t(this,s);this.icTabSelect=i(this,"icTabSelect",3);this.newTabPanels=[];this.newTabs=[];this.linkTabs=()=>{this.tabs.forEach(((t,i)=>{const s=`ic-tab-${i}-context-${this.contextId}`;const h=`ic-tab-panel-${i}-context-${this.contextId}`;t.setAttribute("id",s);t.tabId=`ic-tab--${i}-context-${this.contextId}`;t.tabPosition=i;t.setAttribute("aria-controls",h);t.setAttribute(e,this.contextId);this.tabGroup.setAttribute(e,this.contextId);this.tabPanels[i].setAttribute("id",h);this.tabPanels[i].setAttribute("aria-labelledby",s);this.tabPanels[i].setAttribute(e,this.contextId);t.theme=this.theme;this.tabPanels[i].theme=this.theme;this.tabGroup.theme=this.theme}))};this.getChildren=()=>{this.tabGroup=this.el.querySelector("ic-tab-group");this.tabs=Array.from(this.tabGroup.querySelectorAll("ic-tab"));this.tabPanels=Array.from(this.el.children).filter((t=>t.tagName==="IC-TAB-PANEL"));this.enabledTabs=this.getEnabledTabs()};this.keydownHandler=t=>{const i=this.activationType==="manual";const s=this.enabledTabs.findIndex((t=>t.tabId===this.tabs[i?this.focusedTabIndex:this.selectedTab].tabId));const h=i?this.keyboardFocusTab:this.keyboardSelectTab;let e=true;switch(t.key){case"Home":h(0);break;case"End":h(this.enabledTabs.length-1);break;case"ArrowRight":h(s<this.enabledTabs.length-1?s+1:0);break;case"ArrowLeft":h((s>0?s:this.enabledTabs.length)-1);break;default:if(i&&(t.key==="Enter"||t.key===" ")){this.keyboardSelectTab(this.focusedTabIndex)}else{e=false}}if(e)t.preventDefault()};this.setInitialTab=()=>{if(this.selectedTabIndex!==undefined){this.selectedTab=this.selectedTabIndex;this.focusedTabIndex=this.selectedTabIndex}else{const t=this.tabs.findIndex((t=>t.tabId===this.enabledTabs[0].tabId));this.selectedTab=t;this.focusedTabIndex=t}};this.configureTabs=()=>{this.enabledTabs.forEach((t=>{t.selected=t.tabPosition===this.selectedTab}));this.tabPanels.forEach(((t,i)=>{t.hidden=i!==this.selectedTab}))};this.getEnabledTabs=()=>Array.from(this.tabs).filter((t=>!t.disabled));this.keyboardSelectTab=t=>{const i=this.tabs.findIndex((i=>i.tabId===this.enabledTabs[t].tabId));this.enabledTabs[t].focus();if(this.selectedTabIndex===undefined){this.selectedTab=i}else{this.icTabSelect.emit({tabIndex:i,tabLabel:this.el.querySelectorAll("ic-tab")[i].textContent.trim()})}};this.keyboardFocusTab=t=>{this.enabledTabs[t].focus();this.focusedTabIndex=this.tabs.findIndex((i=>i.tabId===this.enabledTabs[t].tabId))};this.selectedTab=undefined;this.activationType="automatic";this.contextId="default";this.selectedTabIndex=undefined;this.monochrome=false;this.theme="inherit"}updateSelectedTab(t){this.selectedTab=t}watchMonochromeHandler(){this.tabs.forEach(((t,i)=>{t.monochrome=this.monochrome;this.tabPanels[i].monochrome=this.monochrome}));this.tabGroup.monochrome=this.monochrome}watchThemeHandler(){this.tabs.forEach(((t,i)=>{t.theme=this.theme;this.tabPanels[i].theme=this.theme}));this.tabGroup.theme=this.theme}componentDidLoad(){if(this.selectedTabIndex!==undefined){this.selectedTab=this.selectedTabIndex}this.getChildren();this.linkTabs();this.tabGroup.addEventListener("keydown",this.keydownHandler);this.setInitialTab();this.configureTabs()}componentWillUpdate(){this.configureTabs()}disconnectedCallback(){this.tabGroup.removeEventListener("keydown",this.keydownHandler)}tabClickHandler(t){if(this.selectedTabIndex===undefined&&t.detail.contextId===this.contextId){this.selectedTab=t.detail.position}this.icTabSelect.emit({tabIndex:t.detail.position,tabLabel:this.el.querySelectorAll("ic-tab")[t.detail.position].textContent.trim()});t.stopImmediatePropagation()}tabCreatedHandler(t){if(this.tabs&&this.tabPanels){(t.detail.setFocus?this.newTabs:this.newTabPanels).push(t.detail);if(this.newTabs.length===this.newTabPanels.length){this.tabs.push(...this.newTabs);this.tabPanels.push(...this.newTabPanels);this.enabledTabs=this.getEnabledTabs();this.linkTabs();if(!this.tabs[this.selectedTab]||!this.tabPanels[this.selectedTab])this.setInitialTab();this.configureTabs();this.newTabs=[];this.newTabPanels=[]}}}tabEnabledHandler(){this.enabledTabs=this.getEnabledTabs()}async tabRemovedHandler(t){this.getChildren();this.linkTabs();if(this.tabs[this.selectedTab]&&this.tabPanels[this.selectedTab]){this.tabs[this.selectedTab].selected=true;this.tabPanels[this.selectedTab].hidden=false}else{this.setInitialTab()}if(t){this.tabs[this.selectedTab].setFocus()}}render(){return s("slot",null)}get el(){return h(this)}static get watchers(){return{selectedTabIndex:["updateSelectedTab"],monochrome:["watchMonochromeHandler"],theme:["watchThemeHandler"]}}};export{a as ic_tab_context};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as t,c as i,h as s,g as h}from"./p-8455d1bb.js";const e="context-id";const a=class{constructor(s){t(this,s);this.icTabSelect=i(this,"icTabSelect",3);this.newTabPanels=[];this.newTabs=[];this.linkTabs=()=>{this.tabs.forEach(((t,i)=>{const s=`ic-tab-${i}-context-${this.contextId}`;const h=`ic-tab-panel-${i}-context-${this.contextId}`;t.setAttribute("id",s);t.tabId=`ic-tab--${i}-context-${this.contextId}`;t.tabPosition=i;t.setAttribute("aria-controls",h);t.setAttribute(e,this.contextId);this.tabGroup.setAttribute(e,this.contextId);this.tabPanels[i].setAttribute("id",h);this.tabPanels[i].setAttribute("aria-labelledby",s);this.tabPanels[i].setAttribute(e,this.contextId);t.theme=this.theme;this.tabPanels[i].theme=this.theme;this.tabGroup.theme=this.theme}))};this.getChildren=()=>{this.tabGroup=this.el.querySelector("ic-tab-group");this.tabs=Array.from(this.tabGroup.querySelectorAll("ic-tab"));this.tabPanels=Array.from(this.el.children).filter((t=>t.tagName==="IC-TAB-PANEL"));this.enabledTabs=this.getEnabledTabs()};this.keydownHandler=t=>{const i=this.activationType==="manual";const s=this.enabledTabs.findIndex((t=>t.tabId===this.tabs[i?this.focusedTabIndex:this.selectedTab].tabId));const h=i?this.keyboardFocusTab:this.keyboardSelectTab;let e=true;switch(t.key){case"Home":h(0);break;case"End":h(this.enabledTabs.length-1);break;case"ArrowRight":h(s<this.enabledTabs.length-1?s+1:0);break;case"ArrowLeft":h((s>0?s:this.enabledTabs.length)-1);break;default:if(i&&(t.key==="Enter"||t.key===" ")){this.keyboardSelectTab(this.focusedTabIndex)}else{e=false}}if(e)t.preventDefault()};this.setInitialTab=()=>{if(this.selectedTabIndex!==undefined){this.selectedTab=this.selectedTabIndex;this.focusedTabIndex=this.selectedTabIndex}else{const t=this.tabs.findIndex((t=>t.tabId===this.enabledTabs[0].tabId));this.selectedTab=t;this.focusedTabIndex=t}};this.configureTabs=()=>{this.enabledTabs.forEach((t=>{t.selected=t.tabPosition===this.selectedTab}));this.tabPanels.forEach(((t,i)=>{t.hidden=i!==this.selectedTab}))};this.getEnabledTabs=()=>Array.from(this.tabs).filter((t=>!t.disabled));this.keyboardSelectTab=t=>{const i=this.tabs.findIndex((i=>i.tabId===this.enabledTabs[t].tabId));this.enabledTabs[t].focus();if(this.selectedTabIndex===undefined){this.selectedTab=i}else{this.icTabSelect.emit({tabIndex:i,tabLabel:this.el.querySelectorAll("ic-tab")[i].textContent.trim()})}};this.keyboardFocusTab=t=>{this.enabledTabs[t].focus();this.focusedTabIndex=this.tabs.findIndex((i=>i.tabId===this.enabledTabs[t].tabId))};this.selectedTab=undefined;this.activationType="automatic";this.contextId="default";this.selectedTabIndex=undefined;this.monochrome=false;this.theme="inherit"}updateSelectedTab(t){this.selectedTab=t}watchMonochromeHandler(){this.tabs.forEach(((t,i)=>{t.monochrome=this.monochrome;this.tabPanels[i].monochrome=this.monochrome}));this.tabGroup.monochrome=this.monochrome}watchThemeHandler(){this.tabs.forEach(((t,i)=>{t.theme=this.theme;this.tabPanels[i].theme=this.theme}));this.tabGroup.theme=this.theme}componentDidLoad(){if(this.selectedTabIndex!==undefined){this.selectedTab=this.selectedTabIndex}this.getChildren();this.linkTabs();this.tabGroup.addEventListener("keydown",this.keydownHandler);this.setInitialTab();this.configureTabs()}componentWillUpdate(){this.configureTabs()}disconnectedCallback(){var t;(t=this.tabGroup)===null||t===void 0?void 0:t.removeEventListener("keydown",this.keydownHandler)}tabClickHandler(t){if(this.selectedTabIndex===undefined&&t.detail.contextId===this.contextId){this.selectedTab=t.detail.position}this.icTabSelect.emit({tabIndex:t.detail.position,tabLabel:this.el.querySelectorAll("ic-tab")[t.detail.position].textContent.trim()});t.stopImmediatePropagation()}tabCreatedHandler(t){if(this.tabs&&this.tabPanels){(t.detail.setFocus?this.newTabs:this.newTabPanels).push(t.detail);if(this.newTabs.length===this.newTabPanels.length){this.tabs.push(...this.newTabs);this.tabPanels.push(...this.newTabPanels);this.enabledTabs=this.getEnabledTabs();this.linkTabs();if(!this.tabs[this.selectedTab]||!this.tabPanels[this.selectedTab])this.setInitialTab();this.configureTabs();this.newTabs=[];this.newTabPanels=[]}}}tabEnabledHandler(){this.enabledTabs=this.getEnabledTabs()}async tabRemovedHandler(t){this.getChildren();this.linkTabs();if(this.tabs[this.selectedTab]&&this.tabPanels[this.selectedTab]){this.tabs[this.selectedTab].selected=true;this.tabPanels[this.selectedTab].hidden=false}else{this.setInitialTab()}if(t){this.tabs[this.selectedTab].setFocus()}}render(){return s("slot",null)}get el(){return h(this)}static get watchers(){return{selectedTabIndex:["updateSelectedTab"],monochrome:["watchMonochromeHandler"],theme:["watchThemeHandler"]}}};export{a as ic_tab_context};
|
2
|
+
//# sourceMappingURL=p-e3e0cf46.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["CONTEXT_ID_ATTR","TabContext","constructor","hostRef","this","newTabPanels","newTabs","linkTabs","tabs","forEach","tab","index","tabId","contextId","tabPanelId","setAttribute","tabPosition","tabGroup","tabPanels","theme","getChildren","el","querySelector","Array","from","querySelectorAll","children","filter","child","tagName","enabledTabs","getEnabledTabs","keydownHandler","event","isManual","activationType","enabledTabIndex","findIndex","focusedTabIndex","selectedTab","keyboardFunction","keyboardFocusTab","keyboardSelectTab","preventDefault","key","length","setInitialTab","selectedTabIndex","undefined","firstEnabledTabIndex","configureTabs","selected","tabPanel","hidden","disabled","newIndex","focus","icTabSelect","emit","tabIndex","tabLabel","textContent","trim","monochrome","updateSelectedTab","newValue","watchMonochromeHandler","watchThemeHandler","componentDidLoad","addEventListener","componentWillUpdate","disconnectedCallback","_a","removeEventListener","tabClickHandler","detail","position","stopImmediatePropagation","tabCreatedHandler","ev","setFocus","push","tabEnabledHandler","tabRemovedHandler","hadFocus","render","h"],"sources":["../web-components/dist/collection/components/ic-tab-context/ic-tab-context.js"],"sourcesContent":["import { h, } from \"@stencil/core\";\nconst CONTEXT_ID_ATTR = \"context-id\";\nexport class TabContext {\n constructor() {\n this.newTabPanels = [];\n this.newTabs = [];\n /** Sets attributes to link tab-group, tabs and tab-panels */\n this.linkTabs = () => {\n this.tabs.forEach((tab, index) => {\n const tabId = `ic-tab-${index}-context-${this.contextId}`;\n const tabPanelId = `ic-tab-panel-${index}-context-${this.contextId}`;\n tab.setAttribute(\"id\", tabId);\n tab.tabId = `ic-tab--${index}-context-${this.contextId}`;\n tab.tabPosition = index;\n tab.setAttribute(\"aria-controls\", tabPanelId);\n tab.setAttribute(CONTEXT_ID_ATTR, this.contextId);\n this.tabGroup.setAttribute(CONTEXT_ID_ATTR, this.contextId);\n this.tabPanels[index].setAttribute(\"id\", tabPanelId);\n this.tabPanels[index].setAttribute(\"aria-labelledby\", tabId);\n this.tabPanels[index].setAttribute(CONTEXT_ID_ATTR, this.contextId);\n tab.theme = this.theme;\n this.tabPanels[index].theme = this.theme;\n this.tabGroup.theme = this.theme;\n });\n };\n /**\n * Gets tabs and tabpanels with the same context ID using querySelector to selector the children in relation to the host\n */\n this.getChildren = () => {\n this.tabGroup = this.el.querySelector(\"ic-tab-group\");\n this.tabs = Array.from(this.tabGroup.querySelectorAll(\"ic-tab\"));\n this.tabPanels = Array.from(this.el.children).filter((child) => child.tagName === \"IC-TAB-PANEL\");\n this.enabledTabs = this.getEnabledTabs();\n };\n this.keydownHandler = (event) => {\n const isManual = this.activationType === \"manual\";\n const enabledTabIndex = this.enabledTabs.findIndex((tab) => tab.tabId ===\n this.tabs[isManual ? this.focusedTabIndex : this.selectedTab].tabId);\n const keyboardFunction = isManual\n ? this.keyboardFocusTab\n : this.keyboardSelectTab;\n let preventDefault = true;\n switch (event.key) {\n case \"Home\":\n keyboardFunction(0);\n break;\n case \"End\":\n keyboardFunction(this.enabledTabs.length - 1);\n break;\n case \"ArrowRight\":\n keyboardFunction(enabledTabIndex < this.enabledTabs.length - 1\n ? enabledTabIndex + 1\n : 0);\n break;\n case \"ArrowLeft\":\n keyboardFunction((enabledTabIndex > 0 ? enabledTabIndex : this.enabledTabs.length) - 1);\n break;\n default:\n if (isManual && (event.key === \"Enter\" || event.key === \" \")) {\n this.keyboardSelectTab(this.focusedTabIndex);\n }\n else {\n preventDefault = false;\n }\n }\n if (preventDefault)\n event.preventDefault();\n };\n /** Sets the tab that is selected on initial render */\n this.setInitialTab = () => {\n if (this.selectedTabIndex !== undefined) {\n this.selectedTab = this.selectedTabIndex;\n this.focusedTabIndex = this.selectedTabIndex;\n }\n else {\n const firstEnabledTabIndex = this.tabs.findIndex((tab) => tab.tabId === this.enabledTabs[0].tabId);\n this.selectedTab = firstEnabledTabIndex;\n this.focusedTabIndex = firstEnabledTabIndex;\n }\n };\n /** Passes the selected tab to the tab and tab panel components */\n this.configureTabs = () => {\n this.enabledTabs.forEach((tab) => {\n tab.selected = tab.tabPosition === this.selectedTab;\n });\n this.tabPanels.forEach((tabPanel, index) => {\n tabPanel.hidden = index !== this.selectedTab;\n });\n };\n this.getEnabledTabs = () => Array.from(this.tabs).filter((child) => !child.disabled);\n /** Sets focus on tab and selects it */\n this.keyboardSelectTab = (enabledTabIndex) => {\n const newIndex = this.tabs.findIndex((tab) => tab.tabId === this.enabledTabs[enabledTabIndex].tabId);\n this.enabledTabs[enabledTabIndex].focus();\n if (this.selectedTabIndex === undefined) {\n this.selectedTab = newIndex;\n }\n else {\n /* eslint-disable no-unexpected-multiline */\n this.icTabSelect.emit({\n tabIndex: newIndex,\n tabLabel: this.el\n .querySelectorAll(\"ic-tab\")[newIndex].textContent.trim(),\n });\n }\n };\n /** Sets focus on tab without selecting it (for manual activation) */\n this.keyboardFocusTab = (enabledTabIndex) => {\n this.enabledTabs[enabledTabIndex].focus();\n this.focusedTabIndex = this.tabs.findIndex((tab) => tab.tabId === this.enabledTabs[enabledTabIndex].tabId);\n };\n this.selectedTab = undefined;\n this.activationType = \"automatic\";\n this.contextId = \"default\";\n this.selectedTabIndex = undefined;\n this.monochrome = false;\n this.theme = \"inherit\";\n }\n updateSelectedTab(newValue) {\n this.selectedTab = newValue;\n }\n watchMonochromeHandler() {\n this.tabs.forEach((tab, index) => {\n tab.monochrome = this.monochrome;\n this.tabPanels[index].monochrome = this.monochrome;\n });\n this.tabGroup.monochrome = this.monochrome;\n }\n watchThemeHandler() {\n this.tabs.forEach((tab, index) => {\n tab.theme = this.theme;\n this.tabPanels[index].theme = this.theme;\n });\n this.tabGroup.theme = this.theme;\n }\n componentDidLoad() {\n if (this.selectedTabIndex !== undefined) {\n this.selectedTab = this.selectedTabIndex;\n }\n this.getChildren();\n this.linkTabs();\n this.tabGroup.addEventListener(\"keydown\", this.keydownHandler);\n this.setInitialTab();\n this.configureTabs();\n }\n componentWillUpdate() {\n this.configureTabs();\n }\n disconnectedCallback() {\n var _a;\n (_a = this.tabGroup) === null || _a === void 0 ? void 0 : _a.removeEventListener(\"keydown\", this.keydownHandler);\n }\n tabClickHandler(event) {\n if (this.selectedTabIndex === undefined &&\n event.detail.contextId === this.contextId) {\n this.selectedTab = event.detail.position;\n }\n /* eslint-disable no-unexpected-multiline */\n this.icTabSelect.emit({\n tabIndex: event.detail.position,\n tabLabel: this.el\n .querySelectorAll(\"ic-tab\")[event.detail.position].textContent.trim(),\n });\n /* eslint-enable no-unexpected-multiline */\n event.stopImmediatePropagation();\n }\n tabCreatedHandler(ev) {\n if (this.tabs && this.tabPanels) {\n (ev.detail.setFocus ? this.newTabs : this.newTabPanels).push(ev.detail);\n if (this.newTabs.length === this.newTabPanels.length) {\n this.tabs.push(...this.newTabs);\n this.tabPanels.push(...this.newTabPanels);\n this.enabledTabs = this.getEnabledTabs();\n this.linkTabs();\n if (!this.tabs[this.selectedTab] || !this.tabPanels[this.selectedTab])\n this.setInitialTab();\n this.configureTabs();\n this.newTabs = [];\n this.newTabPanels = [];\n }\n }\n }\n tabEnabledHandler() {\n this.enabledTabs = this.getEnabledTabs();\n }\n /**\n * @internal Used to set tab/tab panel IDs when a tab/tab panel has been removed\n */\n async tabRemovedHandler(hadFocus) {\n this.getChildren();\n this.linkTabs();\n if (this.tabs[this.selectedTab] && this.tabPanels[this.selectedTab]) {\n this.tabs[this.selectedTab].selected = true;\n this.tabPanels[this.selectedTab].hidden = false;\n }\n else {\n this.setInitialTab();\n }\n if (hadFocus) {\n this.tabs[this.selectedTab].setFocus();\n }\n }\n render() {\n return h(\"slot\", null);\n }\n static get is() { return \"ic-tab-context\"; }\n static get properties() {\n return {\n \"activationType\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"IcActivationTypes\",\n \"resolved\": \"\\\"automatic\\\" | \\\"manual\\\"\",\n \"references\": {\n \"IcActivationTypes\": {\n \"location\": \"import\",\n \"path\": \"../../utils/types\",\n \"id\": \"src/utils/types.ts::IcActivationTypes\"\n }\n }\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Determines whether tabs have to be manually activated (by pressing 'Enter' or 'Space') when they receive focus using keyboard navigation.\"\n },\n \"attribute\": \"activation-type\",\n \"reflect\": false,\n \"defaultValue\": \"\\\"automatic\\\"\"\n },\n \"contextId\": {\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 unique context needed if using multiple tabs inside one another i.e. rendering another set of tabs inside a tab panel.\"\n },\n \"attribute\": \"context-id\",\n \"reflect\": true,\n \"defaultValue\": \"\\\"default\\\"\"\n },\n \"selectedTabIndex\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The selected tab to be controlled by the user. Must be used alongside the icTabSelect event to manage tab selection.\"\n },\n \"attribute\": \"selected-tab-index\",\n \"reflect\": false\n },\n \"monochrome\": {\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 tabs will display as black in the light theme.\"\n },\n \"attribute\": \"monochrome\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"theme\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"IcThemeMode\",\n \"resolved\": \"\\\"dark\\\" | \\\"inherit\\\" | \\\"light\\\"\",\n \"references\": {\n \"IcThemeMode\": {\n \"location\": \"import\",\n \"path\": \"../../utils/types\",\n \"id\": \"src/utils/types.ts::IcThemeMode\"\n }\n }\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Sets the theme color to the dark or light theme color. \\\"inherit\\\" will set the color based on the system settings or ic-theme component.\"\n },\n \"attribute\": \"theme\",\n \"reflect\": false,\n \"defaultValue\": \"\\\"inherit\\\"\"\n }\n };\n }\n static get states() {\n return {\n \"selectedTab\": {}\n };\n }\n static get events() {\n return [{\n \"method\": \"icTabSelect\",\n \"name\": \"icTabSelect\",\n \"bubbles\": false,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Emitted when a user selects a tab.\"\n },\n \"complexType\": {\n \"original\": \"IcTabSelectEventDetail\",\n \"resolved\": \"IcTabSelectEventDetail\",\n \"references\": {\n \"IcTabSelectEventDetail\": {\n \"location\": \"import\",\n \"path\": \"../ic-tab/ic-tab.types\",\n \"id\": \"src/components/ic-tab/ic-tab.types.ts::IcTabSelectEventDetail\"\n }\n }\n }\n }];\n }\n static get methods() {\n return {\n \"tabRemovedHandler\": {\n \"complexType\": {\n \"signature\": \"(hadFocus?: boolean) => Promise<void>\",\n \"parameters\": [{\n \"name\": \"hadFocus\",\n \"type\": \"boolean\",\n \"docs\": \"\"\n }],\n \"references\": {\n \"Promise\": {\n \"location\": \"global\",\n \"id\": \"global::Promise\"\n }\n },\n \"return\": \"Promise<void>\"\n },\n \"docs\": {\n \"text\": \"\",\n \"tags\": [{\n \"name\": \"internal\",\n \"text\": \"Used to set tab/tab panel IDs when a tab/tab panel has been removed\"\n }]\n }\n }\n };\n }\n static get elementRef() { return \"el\"; }\n static get watchers() {\n return [{\n \"propName\": \"selectedTabIndex\",\n \"methodName\": \"updateSelectedTab\"\n }, {\n \"propName\": \"monochrome\",\n \"methodName\": \"watchMonochromeHandler\"\n }, {\n \"propName\": \"theme\",\n \"methodName\": \"watchThemeHandler\"\n }];\n }\n static get listeners() {\n return [{\n \"name\": \"tabClick\",\n \"method\": \"tabClickHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"tabCreated\",\n \"method\": \"tabCreatedHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"tabPanelCreated\",\n \"method\": \"tabCreatedHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"tabEnabled\",\n \"method\": \"tabEnabledHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }];\n }\n}\n//# sourceMappingURL=ic-tab-context.js.map\n"],"mappings":"yDACA,MAAMA,EAAkB,a,MACXC,EAAU,MACnB,WAAAC,CAAAC,G,mDACIC,KAAKC,aAAe,GACpBD,KAAKE,QAAU,GAEfF,KAAKG,SAAW,KACZH,KAAKI,KAAKC,SAAQ,CAACC,EAAKC,KACpB,MAAMC,EAAQ,UAAUD,aAAiBP,KAAKS,YAC9C,MAAMC,EAAa,gBAAgBH,aAAiBP,KAAKS,YACzDH,EAAIK,aAAa,KAAMH,GACvBF,EAAIE,MAAQ,WAAWD,aAAiBP,KAAKS,YAC7CH,EAAIM,YAAcL,EAClBD,EAAIK,aAAa,gBAAiBD,GAClCJ,EAAIK,aAAaf,EAAiBI,KAAKS,WACvCT,KAAKa,SAASF,aAAaf,EAAiBI,KAAKS,WACjDT,KAAKc,UAAUP,GAAOI,aAAa,KAAMD,GACzCV,KAAKc,UAAUP,GAAOI,aAAa,kBAAmBH,GACtDR,KAAKc,UAAUP,GAAOI,aAAaf,EAAiBI,KAAKS,WACzDH,EAAIS,MAAQf,KAAKe,MACjBf,KAAKc,UAAUP,GAAOQ,MAAQf,KAAKe,MACnCf,KAAKa,SAASE,MAAQf,KAAKe,KAAK,GAClC,EAKNf,KAAKgB,YAAc,KACfhB,KAAKa,SAAWb,KAAKiB,GAAGC,cAAc,gBACtClB,KAAKI,KAAOe,MAAMC,KAAKpB,KAAKa,SAASQ,iBAAiB,WACtDrB,KAAKc,UAAYK,MAAMC,KAAKpB,KAAKiB,GAAGK,UAAUC,QAAQC,GAAUA,EAAMC,UAAY,iBAClFzB,KAAK0B,YAAc1B,KAAK2B,gBAAgB,EAE5C3B,K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KAAKJ,KAAKmC,aAAaY,SAAW,KACvC/C,KAAKc,UAAUd,KAAKmC,aAAac,OAAS,K,KAEzC,CACDjD,KAAK0C,e,CAET,GAAIsC,EAAU,CACVhF,KAAKI,KAAKJ,KAAKmC,aAAayC,U,EAGpC,MAAAK,GACI,OAAOC,EAAE,OAAQ,K"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
const n=["ic-hero","ic-top-navigation","ic-footer","ic-side-navigation","ic-alert"];const t=["ic-alert"];const e={"ic-alert":["ic-link"]};var s;(function(n){n["Warning"]="warning";n["Error"]="error";n["Success"]="success"})(s||(s={}));var o;(function(n){n["Default"]="default";n["Dark"]="dark";n["Light"]="light"})(o||(o={}));var r;(function(n){n[n["January"]=0]="January";n[n["February"]=1]="February";n[n["March"]=2]="March";n[n["April"]=3]="April";n[n["May"]=4]="May";n[n["June"]=5]="June";n[n["July"]=6]="July";n[n["August"]=7]="August";n[n["September"]=8]="September";n[n["October"]=9]="October";n[n["November"]=10]="November";n[n["December"]=11]="December"})(r||(r={}));var c;(function(n){n[n["Sun"]=0]="Sun";n[n["Mon"]=1]="Mon";n[n["Tue"]=2]="Tue";n[n["Wed"]=3]="Wed";n[n["Thu"]=4]="Thu";n[n["Fri"]=5]="Fri";n[n["Sat"]=6]="Sat"})(c||(c={}));var a;(function(n){n[n["Sunday"]=0]="Sunday";n[n["Monday"]=1]="Monday";n[n["Tuesday"]=2]="Tuesday";n[n["Wednesday"]=3]="Wednesday";n[n["Thursday"]=4]="Thursday";n[n["Friday"]=5]="Friday";n[n["Saturday"]=6]="Saturday"})(a||(a={}));var i;(function(n){n[n["Sunday"]=0]="Sunday";n[n["Monday"]=1]="Monday";n[n["Tuesday"]=2]="Tuesday";n[n["Wednesday"]=3]="Wednesday";n[n["Thursday"]=4]="Thursday";n[n["Friday"]=5]="Friday";n[n["Saturday"]=6]="Saturday"})(i||(i={}));const u=n=>{const t=[];Object.values(n).forEach((n=>{if(isNaN(Number(n))){const e=n;t.push(e)}}));return t};const l=(n,t)=>{let e;return(...s)=>{const o=t();clearTimeout(e);e=setTimeout(n,o,...s)}};const d=(n,t,e,s,o)=>{if(e!==undefined&&(n||N(t))){const n=t.querySelectorAll("input.ic-input");const r=Array.from(n);const c=r.filter((n=>t===n.parentElement));let a=c[0];if(a===null||a===undefined){a=t.ownerDocument.createElement("input");a.type="hidden";a.classList.add("ic-input");t.appendChild(a)}a.disabled=o;a.name=e;if(s instanceof Date){a.value=s?s.toISOString():null}else{a.value=s||""}}};const f=(s,r=null)=>{var c;const a=s.parentElement||s.getRootNode().host.parentElement;const i=a.closest(n.join(","));if(i!==null){const n=i.tagName.toLowerCase();const a=s.tagName.toLowerCase();if((c=e[n])===null||c===void 0?void 0:c.includes(a)){return o.Default}else if(r!==null&&!t.includes(n)){return r}else if(i.classList.contains(o.Dark)){return o.Dark}return o.Light}return o.Default};const p=n=>n?n.trim().length===0:true;const y=n=>n!==undefined?n:null;const b=n=>getComputedStyle(document.documentElement).getPropertyValue(n);const m=n=>{const t=n.firstElementChild;if(t!==null){const e=t.assignedElements?t.assignedElements():t.childNodes;return e.length?e:n.tagName?[n]:null}else{return n===null?null:[n]}};({XS:Number(b("--ic-breakpoint-xs").replace("px","")),S:Number(b("--ic-breakpoint-sm").replace("px","")),M:Number(b("--ic-breakpoint-md").replace("px","")),L:Number(b("--ic-breakpoint-lg").replace("px","")),XL:Number(b("--ic-breakpoint-xl").replace("px","")),UNDEFINED:1200});const v=(n,t)=>Array.from(n.children).some((n=>n.getAttribute("slot")===t));const N=n=>!!n.shadowRoot&&!!n.attachShadow;const x=n=>n+"-helper-text";const S=n=>n+"-validation-text";const h=(n,t,e)=>`${t?x(n):""} ${e?S(n):""}`.trim();const g=(n,t=16)=>`${1/t*parseInt(n)}rem`;const k=n=>/^-?\d+$/.test(n);const T=(n,t)=>{for(let e=0;e<n.length;e++){const{prop:s,propName:o}=n[e];if(s===null||s===undefined){console.error(`No ${o} specified for ${t} component - prop '${o}' (web components) / '${$(o)}' (react) required`)}}};const $=n=>{n=n.toLowerCase();const t=n.split("-");let e=t[0];for(let n=1;n<t.length;n++){e+=t[n].substring(0,1).toUpperCase()+t[n].substring(1)}return e};const w=n=>{if(typeof window!=="undefined"&&typeof window.ResizeObserver!=="undefined"){n()}};const M=n=>n.closest("FORM");const F=(n,t)=>{const e=M(n);if(e!==null){e.addEventListener("reset",t)}};const A=(n,t)=>{const e=M(n);if(e!==null){e.removeEventListener("reset",t)}};const D=(n,t)=>{if(!n){t.removeAttribute("disabled")}};const O=n=>n.charAt(0).toUpperCase()+n.slice(1);const j=(n,t,e)=>{const s=n=>Array.from(n).some((n=>n.slot===e));return s(n)||s(t)};const I=(n,t,e)=>{const s={};const o=t.map((n=>n.index));let r=0;Object.keys(n).forEach((c=>{if(o.includes(r)){s[t[o.indexOf(r)].key]=e;r++}s[c]=n[c];r++}));return s};export{o as I,p as a,I as b,j as c,l as d,m as e,
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
const n=["ic-hero","ic-top-navigation","ic-footer","ic-side-navigation","ic-alert"];const t=["ic-alert"];const e={"ic-alert":["ic-link"]};var s;(function(n){n["Warning"]="warning";n["Error"]="error";n["Success"]="success"})(s||(s={}));var o;(function(n){n["Default"]="default";n["Dark"]="dark";n["Light"]="light"})(o||(o={}));var r;(function(n){n[n["January"]=0]="January";n[n["February"]=1]="February";n[n["March"]=2]="March";n[n["April"]=3]="April";n[n["May"]=4]="May";n[n["June"]=5]="June";n[n["July"]=6]="July";n[n["August"]=7]="August";n[n["September"]=8]="September";n[n["October"]=9]="October";n[n["November"]=10]="November";n[n["December"]=11]="December"})(r||(r={}));var c;(function(n){n[n["Sun"]=0]="Sun";n[n["Mon"]=1]="Mon";n[n["Tue"]=2]="Tue";n[n["Wed"]=3]="Wed";n[n["Thu"]=4]="Thu";n[n["Fri"]=5]="Fri";n[n["Sat"]=6]="Sat"})(c||(c={}));var a;(function(n){n[n["Sunday"]=0]="Sunday";n[n["Monday"]=1]="Monday";n[n["Tuesday"]=2]="Tuesday";n[n["Wednesday"]=3]="Wednesday";n[n["Thursday"]=4]="Thursday";n[n["Friday"]=5]="Friday";n[n["Saturday"]=6]="Saturday"})(a||(a={}));var i;(function(n){n[n["Sunday"]=0]="Sunday";n[n["Monday"]=1]="Monday";n[n["Tuesday"]=2]="Tuesday";n[n["Wednesday"]=3]="Wednesday";n[n["Thursday"]=4]="Thursday";n[n["Friday"]=5]="Friday";n[n["Saturday"]=6]="Saturday"})(i||(i={}));const u=n=>{const t=[];Object.values(n).forEach((n=>{if(isNaN(Number(n))){const e=n;t.push(e)}}));return t};const l=(n,t)=>{let e;return(...s)=>{const o=t();clearTimeout(e);e=setTimeout(n,o,...s)}};const d=(n,t,e,s,o)=>{if(e!==undefined&&(n||N(t))){const n=t.querySelectorAll("input.ic-input");const r=Array.from(n);const c=r.filter((n=>t===n.parentElement));let a=c[0];if(a===null||a===undefined){a=t.ownerDocument.createElement("input");a.type="hidden";a.classList.add("ic-input");t.appendChild(a)}a.disabled=o;a.name=e;if(s instanceof Date){a.value=s?s.toISOString():null}else{a.value=s||""}}};const f=(s,r=null)=>{var c;const a=s.parentElement||s.getRootNode().host.parentElement;const i=a.closest(n.join(","));if(i!==null){const n=i.tagName.toLowerCase();const a=s.tagName.toLowerCase();if((c=e[n])===null||c===void 0?void 0:c.includes(a)){return o.Default}else if(r!==null&&!t.includes(n)){return r}else if(i.classList.contains(o.Dark)){return o.Dark}return o.Light}return o.Default};const p=n=>n?n.trim().length===0:true;const y=n=>n!==undefined?n:null;const b=n=>getComputedStyle(document.documentElement).getPropertyValue(n);const m=n=>{const t=n.firstElementChild;if(t!==null){const e=t.assignedElements?t.assignedElements():t.childNodes;return e.length?e:n.tagName?[n]:null}else{return n===null?null:[n]}};({XS:Number(b("--ic-breakpoint-xs").replace("px","")),S:Number(b("--ic-breakpoint-sm").replace("px","")),M:Number(b("--ic-breakpoint-md").replace("px","")),L:Number(b("--ic-breakpoint-lg").replace("px","")),XL:Number(b("--ic-breakpoint-xl").replace("px","")),UNDEFINED:1200});const v=(n,t)=>Array.from(n.children).some((n=>n.getAttribute("slot")===t));const N=n=>!!n.shadowRoot&&!!n.attachShadow;const x=n=>n+"-helper-text";const S=n=>n+"-validation-text";const h=(n,t,e)=>`${t?x(n):""} ${e?S(n):""}`.trim();const g=(n,t=16)=>`${1/t*parseInt(n)}rem`;const k=n=>/^-?\d+$/.test(n);const T=(n,t)=>{for(let e=0;e<n.length;e++){const{prop:s,propName:o}=n[e];if(s===null||s===undefined){console.error(`No ${o} specified for ${t} component - prop '${o}' (web components) / '${$(o)}' (react) required`)}}};const $=n=>{n=n.toLowerCase();const t=n.split("-");let e=t[0];for(let n=1;n<t.length;n++){e+=t[n].substring(0,1).toUpperCase()+t[n].substring(1)}return e};const w=n=>{if(typeof window!=="undefined"&&typeof window.ResizeObserver!=="undefined"){n()}};const M=n=>n.closest("FORM");const F=(n,t)=>{const e=M(n);if(e!==null){e.addEventListener("reset",t)}};const A=(n,t)=>{const e=M(n);if(e!==null){e.removeEventListener("reset",t)}};const D=(n,t)=>{if(!n){t.removeAttribute("disabled")}};const O=n=>n.charAt(0).toUpperCase()+n.slice(1);const j=(n,t,e)=>{const s=n=>Array.from(n).some((n=>n.slot===e));return s(n)||s(t)};const I=(n,t,e)=>{const s={};const o=t.map((n=>n.index));let r=0;Object.keys(n).forEach((c=>{if(o.includes(r)){s[t[o.indexOf(r)].key]=e;r++}s[c]=n[c];r++}));return s};export{o as I,p as a,I as b,j as c,l as d,m as e,w as f,f as g,a as h,v as i,r as j,i as k,c as l,y as m,h as n,T as o,g as p,A as q,D as r,u as s,F as t,k as u,s as v,d as w,O as x};
|
2
|
+
//# sourceMappingURL=p-e6a330e4.js.map
|