@ukic/web-components 3.3.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{helpers-fc4016d2.js → helpers-931fd72e.js} +30 -32
- package/dist/cjs/helpers-931fd72e.js.map +1 -0
- package/dist/cjs/ic-accordion-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-accordion.cjs.entry.js +10 -8
- package/dist/cjs/ic-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +2 -2
- package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
- package/dist/cjs/ic-badge.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +3 -3
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +3 -3
- package/dist/cjs/ic-button_3.cjs.entry.js +138 -145
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-vertical.cjs.entry.js +2 -2
- package/dist/cjs/ic-card-vertical.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +5 -5
- package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +8 -13
- package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-chip.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-list.cjs.entry.js +2 -2
- package/dist/cjs/ic-data-row.cjs.entry.js +3 -3
- package/dist/cjs/ic-dialog.cjs.entry.js +2 -2
- package/dist/cjs/ic-divider.cjs.entry.js +1 -1
- package/dist/cjs/ic-empty-state.cjs.entry.js +3 -3
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +3 -3
- package/dist/cjs/ic-footer.cjs.entry.js +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +7 -6
- package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +6 -6
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +33 -27
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +36 -13
- package/dist/cjs/ic-input-label_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +12 -22
- package/dist/cjs/ic-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +31 -39
- package/dist/cjs/ic-navigation-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +121 -166
- package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +65 -62
- package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +5 -5
- package/dist/cjs/ic-page-header.cjs.entry.js +7 -7
- package/dist/cjs/ic-pagination-item.cjs.entry.js +2 -2
- package/dist/cjs/ic-pagination.cjs.entry.js +5 -5
- package/dist/cjs/ic-popover-menu.cjs.entry.js +6 -6
- package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +6 -6
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +5 -5
- package/dist/cjs/ic-search-bar.cjs.entry.js +68 -34
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js +2 -2
- package/dist/cjs/ic-select.cjs.entry.js +142 -218
- package/dist/cjs/ic-select.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +35 -17
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/ic-skip-link.cjs.entry.js +2 -2
- package/dist/cjs/ic-status-tag.cjs.entry.js +3 -3
- package/dist/cjs/ic-step.cjs.entry.js +14 -14
- package/dist/cjs/ic-stepper.cjs.entry.js +3 -3
- package/dist/cjs/ic-switch.cjs.entry.js +6 -6
- package/dist/cjs/ic-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-context.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +3 -3
- package/dist/cjs/ic-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab.cjs.entry.js +1 -1
- package/dist/cjs/ic-text-field.cjs.entry.js +16 -11
- package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +2 -2
- package/dist/cjs/ic-toast-region.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +4 -4
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +54 -68
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button.cjs.entry.js +62 -64
- package/dist/cjs/ic-toggle-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +74 -66
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-typography.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/ag-theme-icds.css +24 -4
- package/dist/collection/components/ic-accordion/ic-accordion.js +9 -7
- package/dist/collection/components/ic-accordion/ic-accordion.js.map +1 -1
- package/dist/collection/components/ic-accordion/ic-accordion.stories.js +1 -1
- package/dist/collection/components/ic-alert/ic-alert.css +4 -0
- package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.js +2 -2
- package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.js +2 -2
- package/dist/collection/components/ic-button/ic-button.css +0 -8
- package/dist/collection/components/ic-button/ic-button.js +3 -3
- package/dist/collection/components/ic-button/ic-button.js.map +1 -1
- package/dist/collection/components/ic-card-vertical/ic-card-vertical.css +3 -0
- package/dist/collection/components/ic-checkbox/ic-checkbox.css +9 -1
- package/dist/collection/components/ic-checkbox/ic-checkbox.js +6 -11
- package/dist/collection/components/ic-checkbox/ic-checkbox.js.map +1 -1
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.css +10 -2
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js +6 -3
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js.map +1 -1
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.stories.js +22 -0
- package/dist/collection/components/ic-data-list/ic-data-list.js +2 -2
- package/dist/collection/components/ic-data-row/ic-data-row.js +2 -2
- package/dist/collection/components/ic-dialog/ic-dialog.js +1 -1
- package/dist/collection/components/ic-empty-state/ic-empty-state.js +2 -2
- package/dist/collection/components/ic-footer-link/ic-footer-link.js +2 -2
- package/dist/collection/components/ic-hero/ic-hero.css +13 -4
- package/dist/collection/components/ic-hero/ic-hero.js +5 -4
- package/dist/collection/components/ic-hero/ic-hero.js.map +1 -1
- package/dist/collection/components/ic-hero/ic-hero.stories.js +1 -0
- package/dist/collection/components/ic-horizontal-scroll/ic-horizontal-scroll.js +5 -5
- package/dist/collection/components/ic-input-component-container/ic-input-component-container.js +3 -3
- package/dist/collection/components/ic-input-container/ic-input-container.js +2 -2
- package/dist/collection/components/ic-input-label/ic-input-label.css +2 -1
- package/dist/collection/components/ic-input-label/ic-input-label.js +31 -8
- package/dist/collection/components/ic-input-label/ic-input-label.js.map +1 -1
- package/dist/collection/components/ic-input-validation/ic-input-validation.js +3 -3
- package/dist/collection/components/ic-link/ic-link.js +12 -25
- package/dist/collection/components/ic-link/ic-link.js.map +1 -1
- package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.css +3 -3
- package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.js +210 -211
- package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.js.map +1 -1
- package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.stories.js +1 -1
- package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.types.js.map +1 -1
- package/dist/collection/components/ic-menu/ic-menu.js +94 -47
- package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
- package/dist/collection/components/ic-menu-group/ic-menu-group.js +1 -1
- package/dist/collection/components/ic-navigation-button/ic-navigation-button.js +38 -47
- package/dist/collection/components/ic-navigation-button/ic-navigation-button.js.map +1 -1
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.js +144 -170
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.js.map +1 -1
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.css +10 -14
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.js +80 -74
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.js.map +1 -1
- package/dist/collection/components/ic-navigation-menu/ic-navigation-menu.js +4 -4
- package/dist/collection/components/ic-page-header/ic-page-header.js +6 -6
- package/dist/collection/components/ic-pagination/ic-pagination.js +4 -4
- package/dist/collection/components/ic-pagination-item/ic-pagination-item.js +1 -1
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.css +3 -0
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +4 -4
- package/dist/collection/components/ic-radio-group/ic-radio-group.css +10 -2
- package/dist/collection/components/ic-radio-group/ic-radio-group.js +7 -4
- package/dist/collection/components/ic-radio-group/ic-radio-group.js.map +1 -1
- package/dist/collection/components/ic-radio-group/ic-radio-group.stories.js +22 -0
- package/dist/collection/components/ic-radio-option/ic-radio-option.js +4 -4
- package/dist/collection/components/ic-search-bar/ic-search-bar.js +96 -34
- package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
- package/dist/collection/components/ic-search-bar/ic-search-bar.stories.js +29 -18
- package/dist/collection/components/ic-section-container/ic-section-container.js +2 -2
- package/dist/collection/components/ic-select/ic-select.js +197 -271
- package/dist/collection/components/ic-select/ic-select.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select_(multi).stories.js +21 -13
- package/dist/collection/components/ic-select/ic-select_(searchable).stories.js +21 -13
- package/dist/collection/components/ic-select/ic-select_(single).stories.js +47 -30
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js +54 -16
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.stories.js +390 -0
- package/dist/collection/components/ic-skeleton/ic-skeleton.js +2 -2
- package/dist/collection/components/ic-skip-link/ic-skip-link.js +2 -2
- package/dist/collection/components/ic-status-tag/ic-status-tag.js +2 -2
- package/dist/collection/components/ic-step/ic-step.js +13 -13
- package/dist/collection/components/ic-stepper/ic-stepper.js +2 -2
- package/dist/collection/components/ic-switch/ic-switch.css +1 -4
- package/dist/collection/components/ic-switch/ic-switch.js +5 -4
- package/dist/collection/components/ic-switch/ic-switch.js.map +1 -1
- package/dist/collection/components/ic-switch/ic-switch.stories.js +8 -1
- package/dist/collection/components/ic-tab-context/ic-tab-context.js +1 -1
- package/dist/collection/components/ic-tab-group/ic-tab-group.js +2 -2
- package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +2 -2
- package/dist/collection/components/ic-text-field/ic-text-field.js +21 -14
- package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
- package/dist/collection/components/ic-text-field/ic-text-field.stories.js +12 -1
- package/dist/collection/components/ic-theme/ic-theme.js +1 -1
- package/dist/collection/components/ic-toast/ic-toast.js +3 -3
- package/dist/collection/components/ic-toast-region/ic-toast-region.js +1 -1
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.css +40 -7
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.js +80 -82
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.js.map +1 -1
- package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js +79 -88
- package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js.map +1 -1
- package/dist/collection/components/ic-tooltip/ic-tooltip.js +2 -2
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.css +1 -0
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +89 -81
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
- package/dist/collection/components/ic-typography/ic-typography.js +2 -2
- package/dist/collection/utils/constants.js +1 -1
- package/dist/collection/utils/constants.js.map +1 -1
- package/dist/collection/utils/helpers.js +27 -30
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/components/helpers.js +29 -32
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/ic-accordion.js +9 -7
- package/dist/components/ic-accordion.js.map +1 -1
- package/dist/components/ic-alert.js +1 -1
- package/dist/components/ic-alert.js.map +1 -1
- package/dist/components/ic-breadcrumb-group.js +2 -2
- package/dist/components/ic-breadcrumb2.js +2 -2
- package/dist/components/ic-button2.js +4 -4
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-card-vertical.js +1 -1
- package/dist/components/ic-card-vertical.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +4 -4
- package/dist/components/ic-checkbox-group.js.map +1 -1
- package/dist/components/ic-checkbox.js +7 -12
- package/dist/components/ic-checkbox.js.map +1 -1
- package/dist/components/ic-data-list.js +2 -2
- package/dist/components/ic-data-row.js +2 -2
- package/dist/components/ic-dialog.js +1 -1
- package/dist/components/ic-empty-state.js +2 -2
- package/dist/components/ic-footer-link.js +2 -2
- package/dist/components/ic-hero.js +6 -5
- package/dist/components/ic-hero.js.map +1 -1
- package/dist/components/ic-horizontal-scroll2.js +5 -5
- package/dist/components/ic-input-component-container2.js +3 -3
- package/dist/components/ic-input-container2.js +2 -2
- package/dist/components/ic-input-label2.js +33 -10
- package/dist/components/ic-input-label2.js.map +1 -1
- package/dist/components/ic-input-validation2.js +3 -3
- package/dist/components/ic-link2.js +12 -24
- package/dist/components/ic-link2.js.map +1 -1
- package/dist/components/ic-loading-indicator2.js +139 -143
- package/dist/components/ic-loading-indicator2.js.map +1 -1
- package/dist/components/ic-menu-group.js +1 -1
- package/dist/components/ic-menu2.js +30 -22
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-navigation-button.js +32 -41
- package/dist/components/ic-navigation-button.js.map +1 -1
- package/dist/components/ic-navigation-group.js +122 -167
- package/dist/components/ic-navigation-group.js.map +1 -1
- package/dist/components/ic-navigation-item.js +68 -63
- package/dist/components/ic-navigation-item.js.map +1 -1
- package/dist/components/ic-navigation-menu2.js +5 -5
- package/dist/components/ic-page-header.js +6 -6
- package/dist/components/ic-pagination-item2.js +2 -2
- package/dist/components/ic-pagination.js +4 -4
- package/dist/components/ic-popover-menu.js +5 -5
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js +5 -5
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js +4 -4
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-search-bar.js +72 -34
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-section-container2.js +2 -2
- package/dist/components/ic-select.js +141 -217
- package/dist/components/ic-select.js.map +1 -1
- package/dist/components/ic-side-navigation.js +36 -17
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-skeleton.js +2 -2
- package/dist/components/ic-skip-link.js +2 -2
- package/dist/components/ic-status-tag.js +2 -2
- package/dist/components/ic-step.js +13 -13
- package/dist/components/ic-stepper.js +2 -2
- package/dist/components/ic-switch.js +5 -5
- package/dist/components/ic-switch.js.map +1 -1
- package/dist/components/ic-tab-context.js +1 -1
- package/dist/components/ic-tab-group.js +2 -2
- package/dist/components/ic-tab-panel.js +2 -2
- package/dist/components/ic-tab-panel.js.map +1 -1
- package/dist/components/ic-text-field.js +17 -11
- package/dist/components/ic-text-field.js.map +1 -1
- package/dist/components/ic-theme.js +2 -2
- package/dist/components/ic-toast-region.js +1 -1
- package/dist/components/ic-toast.js +4 -4
- package/dist/components/ic-toggle-button-group.js +53 -67
- package/dist/components/ic-toggle-button-group.js.map +1 -1
- package/dist/components/ic-toggle-button.js +62 -64
- package/dist/components/ic-toggle-button.js.map +1 -1
- package/dist/components/ic-tooltip2.js +2 -2
- package/dist/components/ic-top-navigation.js +75 -67
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/components/ic-typography2.js +2 -2
- package/dist/core/ag-theme-icds.css +24 -4
- package/dist/core/core.css +29 -25
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-b371a498.entry.js → p-0f3a56bb.entry.js} +2 -2
- package/dist/core/p-0f3a56bb.entry.js.map +1 -0
- package/dist/core/{p-72c117b6.entry.js → p-0f86ea09.entry.js} +2 -2
- package/dist/core/p-1228fd8c.entry.js +2 -0
- package/dist/core/{p-b8da5c07.entry.js.map → p-1228fd8c.entry.js.map} +1 -1
- package/dist/core/p-1286b234.entry.js +2 -0
- package/dist/core/p-1286b234.entry.js.map +1 -0
- package/dist/core/{p-8c4f7c63.entry.js → p-13e65198.entry.js} +2 -2
- package/dist/core/{p-fbf57f0a.entry.js → p-20a6dc40.entry.js} +2 -2
- package/dist/core/p-20a6dc40.entry.js.map +1 -0
- package/dist/core/{p-cdf56a5d.entry.js → p-21ed856c.entry.js} +2 -2
- package/dist/core/p-21ed856c.entry.js.map +1 -0
- package/dist/core/p-226406d6.entry.js +2 -0
- package/dist/core/{p-70a6cff1.entry.js → p-24bb2265.entry.js} +2 -2
- package/dist/core/{p-d45d66c0.entry.js → p-2b342b23.entry.js} +2 -2
- package/dist/core/p-334672c1.entry.js +2 -0
- package/dist/core/p-334672c1.entry.js.map +1 -0
- package/dist/core/{p-8b5022bc.entry.js → p-3448c713.entry.js} +2 -2
- package/dist/core/p-37900547.entry.js +2 -0
- package/dist/core/p-37900547.entry.js.map +1 -0
- package/dist/core/p-3abaa877.entry.js +2 -0
- package/dist/core/p-3abaa877.entry.js.map +1 -0
- package/dist/core/{p-ef36181d.entry.js → p-3afc2870.entry.js} +2 -2
- package/dist/core/{p-aad10013.entry.js → p-3d7d2ff4.entry.js} +2 -2
- package/dist/core/p-41bb4db1.entry.js +2 -0
- package/dist/core/p-41bb4db1.entry.js.map +1 -0
- package/dist/core/{p-788c96ac.entry.js → p-44902a33.entry.js} +2 -2
- package/dist/core/{p-628c32b8.entry.js → p-476eac8c.entry.js} +2 -2
- package/dist/core/{p-9479f272.entry.js → p-49ca3f54.entry.js} +2 -2
- package/dist/core/{p-ebab7a9e.entry.js → p-4dfc41e7.entry.js} +2 -2
- package/dist/core/{p-83764268.entry.js → p-5026eeaf.entry.js} +2 -2
- package/dist/core/{p-2c17cc67.entry.js → p-54ea7120.entry.js} +2 -2
- package/dist/core/{p-a17499ff.entry.js → p-5b2bf9bb.entry.js} +2 -2
- package/dist/core/{p-0a436c47.entry.js → p-5d9b23ce.entry.js} +2 -2
- package/dist/core/p-5d9b23ce.entry.js.map +1 -0
- package/dist/core/{p-c9a4fe37.entry.js → p-5f9d1977.entry.js} +2 -2
- package/dist/core/p-5f9d1977.entry.js.map +1 -0
- package/dist/core/{p-1b2690b4.entry.js → p-6c10e1a2.entry.js} +2 -2
- package/dist/core/p-6c10e1a2.entry.js.map +1 -0
- package/dist/core/{p-1440847f.entry.js → p-6cb81f35.entry.js} +2 -2
- package/dist/core/{p-df88ff5b.entry.js → p-6dd73165.entry.js} +2 -2
- package/dist/core/p-7ead8535.entry.js +2 -0
- package/dist/core/p-7ead8535.entry.js.map +1 -0
- package/dist/core/{p-c8cf1ad5.entry.js → p-831e884c.entry.js} +2 -2
- package/dist/core/{p-267a19d4.entry.js → p-85f735ed.entry.js} +2 -2
- package/dist/core/p-89f493f3.entry.js +2 -0
- package/dist/core/p-89f493f3.entry.js.map +1 -0
- package/dist/core/{p-00bc353b.entry.js → p-8da025b5.entry.js} +2 -2
- package/dist/core/p-990c37aa.entry.js +2 -0
- package/dist/core/p-990c37aa.entry.js.map +1 -0
- package/dist/core/p-9e039aba.entry.js +2 -0
- package/dist/core/p-9e039aba.entry.js.map +1 -0
- package/dist/core/{p-bc2ca778.entry.js → p-9e051db4.entry.js} +2 -2
- package/dist/core/{p-a0161990.entry.js → p-9edc5973.entry.js} +2 -2
- package/dist/core/{p-2c371198.entry.js → p-a14025cc.entry.js} +2 -2
- package/dist/core/p-a7286727.entry.js +2 -0
- package/dist/core/p-a7286727.entry.js.map +1 -0
- package/dist/core/{p-c4663e1a.entry.js → p-ab4e8b4a.entry.js} +2 -2
- package/dist/core/{p-42a7d0b6.entry.js → p-ab7a5536.entry.js} +2 -2
- package/dist/core/{p-26dfc4db.entry.js → p-ac73cfb8.entry.js} +2 -2
- package/dist/core/{p-f0388d68.entry.js → p-ad374f0b.entry.js} +2 -2
- package/dist/core/p-ad374f0b.entry.js.map +1 -0
- package/dist/core/{p-513628ef.entry.js → p-b08bb522.entry.js} +2 -2
- package/dist/core/{p-1be17f22.entry.js → p-b1b27b7e.entry.js} +2 -2
- package/dist/core/p-b40ecf16.js +2 -0
- package/dist/core/p-b40ecf16.js.map +1 -0
- package/dist/core/{p-10e1e227.entry.js → p-b59007a3.entry.js} +2 -2
- package/dist/core/{p-16f55230.entry.js → p-b811c7a1.entry.js} +2 -2
- package/dist/core/p-b811c7a1.entry.js.map +1 -0
- package/dist/core/p-bae2df5e.entry.js +2 -0
- package/dist/core/p-bae2df5e.entry.js.map +1 -0
- package/dist/core/{p-bdc72446.entry.js → p-c8555360.entry.js} +2 -2
- package/dist/core/{p-a4f9b5bf.entry.js → p-ced2e6ca.entry.js} +2 -2
- package/dist/core/{p-9ca147f3.entry.js → p-d281c3cf.entry.js} +2 -2
- package/dist/core/p-d32c377d.entry.js +2 -0
- package/dist/core/p-d32c377d.entry.js.map +1 -0
- package/dist/core/p-d4a77f80.entry.js +2 -0
- package/dist/core/p-d4a77f80.entry.js.map +1 -0
- package/dist/core/{p-9c47521d.entry.js → p-d7476f6d.entry.js} +2 -2
- package/dist/core/{p-1838d1e9.entry.js → p-e107d1dd.entry.js} +2 -2
- package/dist/core/p-e506ec91.entry.js +2 -0
- package/dist/core/p-e506ec91.entry.js.map +1 -0
- package/dist/core/{p-b9459ba2.entry.js → p-fc5661ac.entry.js} +2 -2
- package/dist/core/p-fca45edb.entry.js +2 -0
- package/dist/core/p-fca45edb.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-f2ffaa7c.js → helpers-91abc444.js} +30 -33
- package/dist/esm/helpers-91abc444.js.map +1 -0
- package/dist/esm/ic-accordion-group.entry.js +1 -1
- package/dist/esm/ic-accordion.entry.js +10 -8
- package/dist/esm/ic-accordion.entry.js.map +1 -1
- package/dist/esm/ic-alert.entry.js +2 -2
- package/dist/esm/ic-alert.entry.js.map +1 -1
- package/dist/esm/ic-back-to-top.entry.js +1 -1
- package/dist/esm/ic-badge.entry.js +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +3 -3
- package/dist/esm/ic-breadcrumb.entry.js +3 -3
- package/dist/esm/ic-button_3.entry.js +138 -145
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card-vertical.entry.js +2 -2
- package/dist/esm/ic-card-vertical.entry.js.map +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +5 -5
- package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
- package/dist/esm/ic-checkbox.entry.js +8 -13
- package/dist/esm/ic-checkbox.entry.js.map +1 -1
- package/dist/esm/ic-chip.entry.js +1 -1
- package/dist/esm/ic-data-list.entry.js +2 -2
- package/dist/esm/ic-data-row.entry.js +3 -3
- package/dist/esm/ic-dialog.entry.js +2 -2
- package/dist/esm/ic-divider.entry.js +1 -1
- package/dist/esm/ic-empty-state.entry.js +3 -3
- package/dist/esm/ic-footer-link-group.entry.js +1 -1
- package/dist/esm/ic-footer-link.entry.js +3 -3
- package/dist/esm/ic-footer.entry.js +1 -1
- package/dist/esm/ic-hero.entry.js +7 -6
- package/dist/esm/ic-hero.entry.js.map +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +6 -6
- package/dist/esm/ic-input-component-container_3.entry.js +33 -27
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-input-label_2.entry.js +36 -13
- package/dist/esm/ic-input-label_2.entry.js.map +1 -1
- package/dist/esm/ic-link.entry.js +12 -22
- package/dist/esm/ic-link.entry.js.map +1 -1
- package/dist/esm/ic-menu-group.entry.js +2 -2
- package/dist/esm/ic-menu-item.entry.js +1 -1
- package/dist/esm/ic-navigation-button.entry.js +31 -39
- package/dist/esm/ic-navigation-button.entry.js.map +1 -1
- package/dist/esm/ic-navigation-group.entry.js +121 -166
- package/dist/esm/ic-navigation-group.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +65 -62
- package/dist/esm/ic-navigation-item.entry.js.map +1 -1
- package/dist/esm/ic-navigation-menu.entry.js +5 -5
- package/dist/esm/ic-page-header.entry.js +7 -7
- package/dist/esm/ic-pagination-item.entry.js +2 -2
- package/dist/esm/ic-pagination.entry.js +5 -5
- package/dist/esm/ic-popover-menu.entry.js +6 -6
- package/dist/esm/ic-popover-menu.entry.js.map +1 -1
- package/dist/esm/ic-radio-group.entry.js +6 -6
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/ic-radio-option.entry.js +5 -5
- package/dist/esm/ic-search-bar.entry.js +68 -34
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js +2 -2
- package/dist/esm/ic-select.entry.js +142 -218
- package/dist/esm/ic-select.entry.js.map +1 -1
- package/dist/esm/ic-side-navigation.entry.js +35 -17
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-skeleton.entry.js +2 -2
- package/dist/esm/ic-skip-link.entry.js +2 -2
- package/dist/esm/ic-status-tag.entry.js +3 -3
- package/dist/esm/ic-step.entry.js +14 -14
- package/dist/esm/ic-stepper.entry.js +3 -3
- package/dist/esm/ic-switch.entry.js +6 -6
- package/dist/esm/ic-switch.entry.js.map +1 -1
- package/dist/esm/ic-tab-context.entry.js +1 -1
- package/dist/esm/ic-tab-group.entry.js +3 -3
- package/dist/esm/ic-tab-panel.entry.js +2 -2
- package/dist/esm/ic-tab.entry.js +1 -1
- package/dist/esm/ic-text-field.entry.js +16 -11
- package/dist/esm/ic-text-field.entry.js.map +1 -1
- package/dist/esm/ic-theme.entry.js +2 -2
- package/dist/esm/ic-toast-region.entry.js +1 -1
- package/dist/esm/ic-toast.entry.js +4 -4
- package/dist/esm/ic-toggle-button-group.entry.js +54 -68
- package/dist/esm/ic-toggle-button-group.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button.entry.js +62 -64
- package/dist/esm/ic-toggle-button.entry.js.map +1 -1
- package/dist/esm/ic-top-navigation.entry.js +75 -67
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/ic-typography.entry.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-checkbox-group/ic-checkbox-group.d.ts +3 -0
- package/dist/types/components/ic-input-label/ic-input-label.d.ts +2 -0
- package/dist/types/components/ic-link/ic-link.d.ts +2 -3
- package/dist/types/components/ic-loading-indicator/ic-loading-indicator.d.ts +28 -32
- package/dist/types/components/ic-loading-indicator/ic-loading-indicator.types.d.ts +2 -0
- package/dist/types/components/ic-menu/ic-menu.d.ts +19 -12
- package/dist/types/components/ic-navigation-button/ic-navigation-button.d.ts +8 -5
- package/dist/types/components/ic-navigation-group/ic-navigation-group.d.ts +8 -19
- package/dist/types/components/ic-navigation-item/ic-navigation-item.d.ts +9 -7
- package/dist/types/components/ic-radio-group/ic-radio-group.d.ts +3 -0
- package/dist/types/components/ic-search-bar/ic-search-bar.d.ts +13 -0
- package/dist/types/components/ic-select/ic-select.d.ts +37 -38
- package/dist/types/components/ic-side-navigation/ic-side-navigation.d.ts +5 -0
- package/dist/types/components/ic-switch/ic-switch.d.ts +1 -0
- package/dist/types/components/ic-text-field/ic-text-field.d.ts +4 -2
- package/dist/types/components/ic-toggle-button/ic-toggle-button.d.ts +10 -11
- package/dist/types/components/ic-toggle-button-group/ic-toggle-button-group.d.ts +10 -12
- package/dist/types/components/ic-top-navigation/ic-top-navigation.d.ts +10 -8
- package/dist/types/components.d.ts +122 -94
- package/dist/types/utils/constants.d.ts +1 -1
- package/dist/types/utils/helpers.d.ts +1 -1
- package/hydrate/index.js +1047 -1100
- package/hydrate/index.mjs +1047 -1100
- package/package.json +3 -5
- package/vscode-data.json +16 -4
- package/dist/cjs/helpers-fc4016d2.js.map +0 -1
- package/dist/core/p-0a436c47.entry.js.map +0 -1
- package/dist/core/p-15b7adaf.entry.js +0 -2
- package/dist/core/p-15b7adaf.entry.js.map +0 -1
- package/dist/core/p-16f55230.entry.js.map +0 -1
- package/dist/core/p-18714198.entry.js +0 -2
- package/dist/core/p-18714198.entry.js.map +0 -1
- package/dist/core/p-1b2690b4.entry.js.map +0 -1
- package/dist/core/p-206c2a26.entry.js +0 -2
- package/dist/core/p-206c2a26.entry.js.map +0 -1
- package/dist/core/p-2e44cf53.entry.js +0 -2
- package/dist/core/p-2e44cf53.entry.js.map +0 -1
- package/dist/core/p-730d2f6e.entry.js +0 -2
- package/dist/core/p-730d2f6e.entry.js.map +0 -1
- package/dist/core/p-7fb79e87.entry.js +0 -2
- package/dist/core/p-7fb79e87.entry.js.map +0 -1
- package/dist/core/p-8242c24f.js +0 -2
- package/dist/core/p-8242c24f.js.map +0 -1
- package/dist/core/p-910f5f14.entry.js +0 -2
- package/dist/core/p-910f5f14.entry.js.map +0 -1
- package/dist/core/p-9cfc2bac.entry.js +0 -2
- package/dist/core/p-9cfc2bac.entry.js.map +0 -1
- package/dist/core/p-b371a498.entry.js.map +0 -1
- package/dist/core/p-b7568944.entry.js +0 -2
- package/dist/core/p-b7568944.entry.js.map +0 -1
- package/dist/core/p-b8da5c07.entry.js +0 -2
- package/dist/core/p-ba600947.entry.js +0 -2
- package/dist/core/p-ba600947.entry.js.map +0 -1
- package/dist/core/p-c45023b7.entry.js +0 -2
- package/dist/core/p-c45023b7.entry.js.map +0 -1
- package/dist/core/p-c9a4fe37.entry.js.map +0 -1
- package/dist/core/p-cdf56a5d.entry.js.map +0 -1
- package/dist/core/p-d6c50565.entry.js +0 -2
- package/dist/core/p-d6c50565.entry.js.map +0 -1
- package/dist/core/p-d975bf2f.entry.js +0 -2
- package/dist/core/p-d975bf2f.entry.js.map +0 -1
- package/dist/core/p-dede4974.entry.js +0 -2
- package/dist/core/p-dede4974.entry.js.map +0 -1
- package/dist/core/p-e86a6d2d.entry.js +0 -2
- package/dist/core/p-eeab3a2e.entry.js +0 -2
- package/dist/core/p-eeab3a2e.entry.js.map +0 -1
- package/dist/core/p-f0388d68.entry.js.map +0 -1
- package/dist/core/p-fbf57f0a.entry.js.map +0 -1
- package/dist/esm/helpers-f2ffaa7c.js.map +0 -1
- /package/dist/core/{p-72c117b6.entry.js.map → p-0f86ea09.entry.js.map} +0 -0
- /package/dist/core/{p-8c4f7c63.entry.js.map → p-13e65198.entry.js.map} +0 -0
- /package/dist/core/{p-e86a6d2d.entry.js.map → p-226406d6.entry.js.map} +0 -0
- /package/dist/core/{p-70a6cff1.entry.js.map → p-24bb2265.entry.js.map} +0 -0
- /package/dist/core/{p-d45d66c0.entry.js.map → p-2b342b23.entry.js.map} +0 -0
- /package/dist/core/{p-8b5022bc.entry.js.map → p-3448c713.entry.js.map} +0 -0
- /package/dist/core/{p-ef36181d.entry.js.map → p-3afc2870.entry.js.map} +0 -0
- /package/dist/core/{p-aad10013.entry.js.map → p-3d7d2ff4.entry.js.map} +0 -0
- /package/dist/core/{p-788c96ac.entry.js.map → p-44902a33.entry.js.map} +0 -0
- /package/dist/core/{p-628c32b8.entry.js.map → p-476eac8c.entry.js.map} +0 -0
- /package/dist/core/{p-9479f272.entry.js.map → p-49ca3f54.entry.js.map} +0 -0
- /package/dist/core/{p-ebab7a9e.entry.js.map → p-4dfc41e7.entry.js.map} +0 -0
- /package/dist/core/{p-83764268.entry.js.map → p-5026eeaf.entry.js.map} +0 -0
- /package/dist/core/{p-2c17cc67.entry.js.map → p-54ea7120.entry.js.map} +0 -0
- /package/dist/core/{p-a17499ff.entry.js.map → p-5b2bf9bb.entry.js.map} +0 -0
- /package/dist/core/{p-1440847f.entry.js.map → p-6cb81f35.entry.js.map} +0 -0
- /package/dist/core/{p-df88ff5b.entry.js.map → p-6dd73165.entry.js.map} +0 -0
- /package/dist/core/{p-c8cf1ad5.entry.js.map → p-831e884c.entry.js.map} +0 -0
- /package/dist/core/{p-267a19d4.entry.js.map → p-85f735ed.entry.js.map} +0 -0
- /package/dist/core/{p-00bc353b.entry.js.map → p-8da025b5.entry.js.map} +0 -0
- /package/dist/core/{p-bc2ca778.entry.js.map → p-9e051db4.entry.js.map} +0 -0
- /package/dist/core/{p-a0161990.entry.js.map → p-9edc5973.entry.js.map} +0 -0
- /package/dist/core/{p-2c371198.entry.js.map → p-a14025cc.entry.js.map} +0 -0
- /package/dist/core/{p-c4663e1a.entry.js.map → p-ab4e8b4a.entry.js.map} +0 -0
- /package/dist/core/{p-42a7d0b6.entry.js.map → p-ab7a5536.entry.js.map} +0 -0
- /package/dist/core/{p-26dfc4db.entry.js.map → p-ac73cfb8.entry.js.map} +0 -0
- /package/dist/core/{p-513628ef.entry.js.map → p-b08bb522.entry.js.map} +0 -0
- /package/dist/core/{p-1be17f22.entry.js.map → p-b1b27b7e.entry.js.map} +0 -0
- /package/dist/core/{p-10e1e227.entry.js.map → p-b59007a3.entry.js.map} +0 -0
- /package/dist/core/{p-bdc72446.entry.js.map → p-c8555360.entry.js.map} +0 -0
- /package/dist/core/{p-a4f9b5bf.entry.js.map → p-ced2e6ca.entry.js.map} +0 -0
- /package/dist/core/{p-9ca147f3.entry.js.map → p-d281c3cf.entry.js.map} +0 -0
- /package/dist/core/{p-9c47521d.entry.js.map → p-d7476f6d.entry.js.map} +0 -0
- /package/dist/core/{p-1838d1e9.entry.js.map → p-e107d1dd.entry.js.map} +0 -0
- /package/dist/core/{p-b9459ba2.entry.js.map → p-fc5661ac.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as e,c as o,h as t,H as i,g as r}from"./p-8e4e97b4.js";import{v as a,g as n,e as c,f as s,a as l,i as d,w as f,I as p}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as e,c as o,h as t,H as i,g as r}from"./p-8e4e97b4.js";import{v as a,g as n,e as c,f as s,a as l,i as d,w as f,I as p}from"./p-b40ecf16.js";const b='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;--footer-compliance-padding:1rem 0}:host(.ic-footer-sparse){--footer-links-padding:1.5rem 0;--footer-logo-margin-bottom:calc(var(--ic-space-md) + var(--ic-space-xxs));--footer-link-inner-flex-direction:row}:host(.ic-footer-small){--footer-links-padding:0 0;--footer-logo-margin-bottom:var(--ic-space-md);--footer-link-inner-flex-direction:column}:host(.ic-footer-foreground-dark){--ic-footer-background:var(--ic-brand-color-secondary-light);--ic-footer-bottom-background:var(--ic-brand-color-tertiary-light);--ic-footer-keyline:var(--ic-state-layer-darken-20);--ic-footer-text:var(--ic-color-text-primary-light);--ic-footer-link:var(--ic-color-text-primary-light);--ic-footer-icon:var(--ic-color-icon-neutral);--ic-footer-chevron-icon:var(--ic-color-icon-neutral);--ic-footer-logo:var(--ic-color-icon-neutral);--ic-footer-hover:var(--ic-architectural-700-state-layer-10);--ic-footer-pressed:var(--ic-architectural-700-state-layer-20)}:host(.ic-footer-small.ic-footer-ungrouped){--footer-links-padding:var(--ic-space-md) 0 0 0}footer{display:flex;flex-direction:column;width:100%}.footer-description{background-color:var(--ic-footer-background);color:var(--ic-footer-text);--ic-typography-color:var(--ic-footer-text);border-bottom:var(--ic-space-1px) solid var(--ic-footer-keyline)}.footer-description-inner{padding:1rem 0}.footer-links{padding:var(--footer-links-padding);background-color:var(--ic-footer-background);color:var(--ic-footer-link);--ic-typography-color:var(--ic-footer-link)}.footer-links-inner{display:flex;flex-direction:var(--footer-link-inner-flex-direction)}.footer-compliance{background-color:var(--ic-footer-bottom-background);color:var(--ic-footer-text);--ic-typography-color:var(--ic-footer-text)}.footer-compliance-inner{padding:var(--footer-compliance-padding)}.footer-logo{margin-bottom:var(--footer-logo-margin-bottom);display:flex;gap:var(--ic-space-xxl)}.footer-logo>::slotted(){margin-right:var(--ic-space-md)}.footer-caption{margin-bottom:var(--ic-space-md)}.classification-spacing{margin-bottom:var(--ic-space-lg)}@media (forced-colors: active){footer{border-top:var(--ic-border-hc)}}';const m=b;const g=class{constructor(t){e(this,t);this.footerResized=o(this,"footerResized",7);this.resizeObserver=null;this.hostMutationObserver=null;this.deviceSize=a.XL;this.foregroundColor=n();this.aligned="left";this.breakpoint="medium";this.copyright=true;this.groupLinks=false;this.resizeObserverCallback=e=>{if(e!==this.deviceSize){this.deviceSize=e}this.footerResized.emit()};this.runResizeObserver=()=>{if(this.footerEl){this.resizeObserver=new ResizeObserver((()=>{const e=c();this.resizeObserverCallback(e)}));this.resizeObserver.observe(this.footerEl)}}}disconnectedCallback(){var e;if(this.resizeObserver!==null){this.resizeObserver.disconnect()}(e=this.hostMutationObserver)===null||e===void 0?void 0:e.disconnect()}componentWillLoad(){this.deviceSize=c()}componentDidLoad(){s(this.runResizeObserver);this.hostMutationObserver=new MutationObserver((e=>l(e,"link",this)));this.hostMutationObserver.observe(this.el,{childList:true})}brandChangeHandler(e){this.foregroundColor=e.detail.mode}isSmall(){const e=this.breakpoint;return e==="extra small"?this.deviceSize<a.XS:e==="small"?this.deviceSize<a.S:e==="medium"?this.deviceSize<a.M:e==="large"?this.deviceSize<a.L:e==="extra large"?this.deviceSize<a.XL:false}render(){const{aligned:e,caption:o,copyright:r,description:n,deviceSize:c,el:s,foregroundColor:l,groupLinks:b}=this;const m=this.isSmall();const g=d(s,"logo")||d(s,"caption")||o||r;return t(i,{key:"b25023d5362ca9baca9c01a319c038eb4540e97a",class:{["ic-footer"]:true,[`ic-footer-${m?"small":"sparse"}`]:true,[`ic-footer-${b?"grouped":"ungrouped"}`]:true,[`ic-footer-foreground-${l}`]:true,[`ic-footer-${p.Dark}`]:l===p.Dark,[`ic-footer-${p.Light}`]:l===p.Light}},t("footer",{key:"053aafbd7016c4a74230cb3f4bd15ff1bd331761",ref:e=>this.footerEl=e},(d(s,"description")||n)&&t("div",{key:"c963c42c0f4d0a19d8fe9c133ca3cf9261398d70",class:"footer-description"},t("ic-section-container",{key:"0dd1fd94781722a494368e146f2a0b8417e1849d",aligned:e,fullHeight:true},t("div",{key:"61a25339f136d624ef39c3f72ff920735eac3656",class:"footer-description-inner"},t("ic-typography",{key:"4655d70fa69d5cc7ed44e352d37646a93b95067a",variant:"body"},t("slot",{key:"3a04c622d16c8fbad42bde6e5a62b94a7cc0dbfc",name:"description"},n))))),d(s,"link")&&t("div",{key:"9a98191b7712a906aafa5295786586cdca8fdd63",class:"footer-links"},b&&m?t("div",{class:"footer-links-inner",role:"list"},t("slot",{name:"link"})):t("ic-section-container",{fullHeight:true,aligned:e},t("div",{class:"footer-links-inner",role:"list"},t("slot",{name:"link"})))),g&&t("div",{key:"26f71e1feac14df4ffd9a5f945823e7d8a334f87",class:"footer-compliance"},t("ic-section-container",{key:"d4b53cd4e8b1170b629f6493188f48438c1edd00",aligned:e,fullHeight:true},t("div",{key:"50b07020da89a9ebe53d6fd035b7139ac8ca2282",class:"footer-compliance-inner"},d(s,"logo")&&t("div",{key:"2ea27171f29498639b56426d4d21fbf4afc98798",class:"footer-logo"},t("slot",{key:"b09b28173314c1b0a63ce1ecdf60822d7497ed80",name:"logo"})),(d(s,"caption")||o)&&t("div",{key:"b4ce260f52b3216ec3c73430311b7659e651a544",class:"footer-caption"},t("ic-typography",{key:"f83868bac58237dcd8586d4d161db7677f0b2b16",variant:c<=a.M?"caption":"body"},t("slot",{key:"3da3e317b1f62be124bbabc9283e08258dc57141",name:"caption"},o))),r&&t("div",{key:"63b18007efa190d038048a1d57223dc0547a64ad",class:{["footer-copyright"]:true,["classification-spacing"]:f()}},t("ic-typography",{key:"0dc6200bfb89a7b34743c442f9c61829cd4b9374",variant:c<=a.M?"caption-uppercase":"label-uppercase"},"© Crown Copyright")))))))}get el(){return r(this)}};g.style=m;export{g as ic_footer};
|
2
|
+
//# sourceMappingURL=p-831e884c.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as e,c as t,h as o,g as i}from"./p-8e4e97b4.js";import{r as a,
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as e,c as t,h as o,g as i}from"./p-8e4e97b4.js";import{r as a,T as r}from"./p-b40ecf16.js";const n='/*! 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}a{text-align:center}.item-container{display:flex;justify-content:center;align-items:center;width:calc(var(--ic-space-xl) + var(--ic-space-sm));height:var(--ic-space-xl);margin:var(--ic-space-xxs) var(--ic-space-xxxs);cursor:pointer;text-decoration:none}button{background:none;border:none;outline:inherit;position:relative}.ellipsis{pointer-events:none;--ic-typography-color:var(--ic-pagination-ellipsis)}.monochrome .ellipsis{--ic-typography-color:var(--ic-pagination-ellipsis-monochrome)}.item-container:focus{box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline);border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-fast)}.page{--ic-typography-color:var(--ic-pagination-page-number)}.monochrome .page{--ic-typography-color:var(--ic-pagination-page-number-monochrome)}.simple-current{min-width:calc(var(--ic-space-xxl) + var(--ic-space-md));height:var(--ic-space-lg);cursor:default}.item-container.page:hover:not(.selected):not(:focus){border-radius:var(--ic-border-radius);background-color:var(--ic-pagination-hover)}.item-container.page:active:not(.selected):not(:focus){background-color:var(--ic-pagination-pressed)}.monochrome .item-container.page:hover:not(.selected):not(:focus){background-color:var(--ic-pagination-hover-monochrome)}.monochrome .item-container.page:active:not(.selected):not(:focus){background-color:var(--ic-pagination-pressed-monochrome)}.selected{pointer-events:none;outline:none}.selected::after{content:"";height:var(--ic-space-xxs);width:100%;position:absolute;bottom:0;background-color:var(--ic-pagination-selected-banner)}.monochrome .selected::after{background-color:var(--ic-pagination-selected-banner-monochrome)}.page-selected{--ic-typography-color:var(--ic-pagination-text)}.item-container.page.light:hover:not(.selected):not(:focus){background-color:var(--ic-action-light-bg-hover)}.item-container.page.light:active:not(.selected):not(:focus){background-color:var(--ic-action-light-bg-pressed)}ic-typography.light,ic-typography.page-selected.light{--ic-typography-color:var(--ic-architectural-white)}.selected.light::after{content:"";height:var(--ic-space-xxs);width:100%;position:absolute;bottom:0;background-color:var(--ic-action-monochrome)}.item-container.page.dark:hover:not(.selected):not(:focus){background-color:var(--ic-action-dark-bg-hover)}.item-container.page.dark:active:not(.selected):not(:focus){background-color:var(--ic-action-dark-bg-pressed)}ic-typography.dark{--ic-typography-color:var(--ic-color-text-primary)}.selected.dark::after{content:"";height:var(--ic-space-xxs);width:100%;position:absolute;bottom:0;background-color:var(--ic-action-monochrome-dark)}.disabled{--ic-typography-color:var(--ic-pagination-text-disabled);pointer-events:none;cursor:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.disabled.page ic-typography{--ic-typography-color:var(--ic-pagination-page-number-disabled)}.disabled.ellipsis{--ic-typography-color:var(--ic-pagination-ellipsis-disabled)}.monochrome .disabled.page{--ic-typography-color:var(--ic-pagination-page-number-monochrome-disabled)}.monochrome .disabled.ellipsis{--ic-typography-color:var(--ic-pagination-ellipsis-monochrome-disabled)}@media (forced-colors: active){.selected::after{background-color:Highlight}.selected.light::after{background-color:Highlight}.selected.dark::after{background-color:Highlight}.disabled{--ic-typography-color:GrayText}}';const c=n;const s=class{constructor(o){e(this,o);this.paginationItemClick=t(this,"paginationItemClick",7);this.disabled=false;this.label="Page";this.monochrome=false;this.selected=false;this.theme="inherit";this.handleClick=()=>{this.paginationItemClick.emit({page:this.page||null})}}watchDisabledHandler(){a(this.disabled,this.el)}watchLabelHandler(){this.capitalizedLabel=r(this.label)}componentWillLoad(){this.watchLabelHandler();a(this.disabled,this.el)}render(){const{page:e,selected:t,type:i,disabled:a,label:r,capitalizedLabel:n,monochrome:c}=this;return o("a",{key:"96dd8b411124b3276fdd7b630d6b1d15528398a0",class:{["monochrome"]:!!c}},i==="ellipsis"?o("div",{class:{["item-container"]:true,["ellipsis"]:true,["disabled"]:!!a}},o("ic-typography",{variant:"label"},"...")):i==="page"?o("button",{disabled:a,onClick:this.handleClick,tabindex:t?"-1":"0",role:"button","aria-current":t&&"page","aria-label":t?`${r}: ${e}`:`Go to ${r} ${e}`,class:{["selected"]:!a&&t,["disabled"]:!!a,["item-container"]:true,["page"]:i==="page"}},o("ic-typography",{variant:"label",class:{["page-selected"]:t,["disabled"]:!!a}},e)):o("ic-typography",{"aria-live":"polite",class:{[`simple-current`]:true,["disabled"]:!!a},variant:"label"},n," ",e))}get el(){return i(this)}static get watchers(){return{disabled:["watchDisabledHandler"],label:["watchLabelHandler"]}}};s.style=c;export{s as ic_pagination_item};
|
2
|
+
//# sourceMappingURL=p-85f735ed.entry.js.map
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as e,c as t,f as i,h as a,H as s,g as r}from"./p-8e4e97b4.js";import{H as o,r as n,G as l,k as c,x as d,j as h,b as u,N as b,L as p,n as f,l as m,m as x,i as v,M as g,z as y}from"./p-b40ecf16.js";const w='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;--ic-input-label-helpertext-padding:var(--ic-space-xxs);--border-color:var(--ic-text-field-border-neutral);--border-color-hover:var(--ic-text-field-border-neutral-hover);--border-color-pressed:var(--ic-text-field-border-neutral-pressed);--border-color-disabled:var(--ic-text-field-border-disabled);--border-color-error:var(--ic-text-field-border-error);--border-color-error-hover:var(--ic-text-field-border-error-hover);--border-color-error-pressed:var(--ic-text-field-border-error-pressed);--border-color-success:var(--ic-text-field-border-success);--border-color-success-hover:var(--ic-text-field-border-success-hover);--border-color-success-pressed:var(--ic-text-field-border-success-pressed);--border-color-warning:var(--ic-text-field-border-warning);--border-color-warning-hover:var(--ic-text-field-border-warning-hover);--border-color-warning-pressed:var(--ic-text-field-border-warning-pressed);--ic-input-label-text-color:var(--ic-text-field-label);--ic-input-label-helper-text-color:var(--ic-text-field-subtitle);--ic-input-validation-status-text-color:var(--ic-text-field-state-text);--ic-input-validation-error:var(--ic-text-field-state-icon-error);--ic-input-validation-warning-icon-color:var(\n --ic-text-field-state-icon-warning\n );--ic-input-validation-success-icon-color:var(\n --ic-text-field-state-icon-success\n );--ic-input-component-container-success-icon-inline-color:var(\n --ic-text-field-state-icon-success\n )}:host(.ic-text-field-disabled){--ic-input-label-text-color:var(--ic-text-field-label-disabled);--ic-input-label-helper-text-color:var(--ic-text-field-subtitle-disabled);--text-field-placeholder-color:var(\n --ic-text-field-text-area-placeholder-text-disabled\n )}:host(.ic-text-field-full-width){width:100%}::-moz-placeholder{color:var(\n --text-field-placeholder-color,\n var(--ic-text-field-placeholder-text)\n );opacity:1}::placeholder{color:var(\n --text-field-placeholder-color,\n var(--ic-text-field-placeholder-text)\n );opacity:1}input,textarea{border:0;border-radius:var(--ic-border-radius);color:var(--text-field-text-color, var(--ic-text-field-text));background-color:var(--input-bg-color, var(--ic-text-field-background));line-height:1.5rem;letter-spacing:0.005rem;width:100%;padding-right:var(--ic-space-xs);padding-left:var(--ic-space-xs);caret-color:var(\n --text-field-typing-cursor,\n var(--ic-text-field-typing-cursor)\n )}textarea{min-height:var(--ic-space-lg);resize:vertical;padding-top:0.375rem}input:focus,textarea:focus{border:0;outline:0}input:disabled,textarea:disabled{color:var(\n --text-field-disabled-text-color,\n var(--ic-text-field-text-disabled)\n )}input.readonly,textarea.readonly{color:var(--ic-text-field-read-only-input-text-internal);background:transparent}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type="number"]{-moz-appearance:textfield}textarea.no-resize{resize:none}.char-count-text{--ic-typography-color:var(--ic-text-field-character-limit);padding-right:var(--ic-space-xxxs)}:host(.ic-text-field-disabled) .char-count-text{--ic-typography-color:var(--ic-text-field-character-limit-disabled)}.no-left-pad{padding-left:0}::slotted([slot="icon"]){fill:var(--ic-text-field-text-disabled)}.has-value ::slotted([slot="icon"]){fill:var(--ic-text-field-input-internal-icon)}.char-count{margin-right:calc(-1 * var(--ic-space-xxxs))}.remaining-char-count-desc{position:absolute;left:-9999px}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-results-button,input[type="search"]::-webkit-search-results-decoration{display:none}input[type="search"].truncate-value{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media (forced-colors: active){input.readonly,textarea.readonly{color:canvastext}.has-value ::slotted([slot="icon"]){fill:currentcolor}}';const k=w;let z=0;const C=[...y,"title"];const $=class{constructor(a){e(this,a);this.getValidationText=t(this,"getValidationText",7);this.icBlur=t(this,"icBlur",7);this.icChange=t(this,"icChange",7);this.icFocus=t(this,"icFocus",7);this.icInput=t(this,"icInput",7);this.icKeydown=t(this,"icKeydown",7);this.icScroll=t(this,"icScroll",7);this.inheritedAttributes={};this.hostMutationObserver=null;this.numChars=0;this.maxCharactersReached=false;this.maxCharactersWarning=false;this.minCharactersUnattained=false;this.maxValueExceeded=false;this.minValueUnattained=false;this.isFocussed=false;this.autocapitalize="off";this.autocomplete="off";this.autocorrect="off";this.autofocus=false;this.disabled=false;this.fullWidth=false;this.helperText="";this.hideCharCount=false;this.hideLabel=false;this.hiddenInput=true;this.inputId=`ic-text-field-input-${z++}`;this.inputmode="text";this.maxCharacters=0;this.maxCharactersMessage=`Maximum input is ${this.maxCharacters} characters`;this.maxMessage=`Maximum value of ${this.max} exceeded`;this.minCharacters=0;this.minCharactersMessage=`Minimum input is ${this.minCharacters} characters`;this.minMessage=`Minimum value of ${this.min} not met`;this.name=this.inputId;this.placeholder="";this.readonly=false;this.required=false;this.resize=false;this.rows=1;this.size="medium";this.spellcheck=false;this.theme="inherit";this.truncateValue=false;this.type="text";this.validationInline=false;this.validationInlineInternal=false;this.validationStatus="";this.validationText="";this.debounce=0;this.value="";this.initialValue=this.value;this.checkChildHydration=()=>{var e,t;if(this.hideLabel||((t=(e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelector("ic-typography"))===null||t===void 0?void 0:t.classList.contains("hydrated"))){this.setFocus();clearInterval(this.interval)}};this.getNumberOfCharacters=e=>e!==null&&e!==undefined?e.length:0;this.getMaxValueExceeded=e=>{this.numChars=this.getNumberOfCharacters(e);if(this.type==="number"){this.minValueUnattained=!!e&&Number(e)<Number(this.min);this.maxValueExceeded=Number(e)>Number(this.max)}};this.getMaxCharactersReached=e=>{this.numChars=this.getNumberOfCharacters(e);this.maxCharactersReached=this.maxCharacters>0&&this.numChars>=this.maxCharacters;if(this.maxCharactersWarning&&!this.maxCharactersReached){this.maxCharactersWarning=false}};this.onInput=e=>{this.value=e.target.value;this.icInput.emit({value:this.value})};this.onBlur=e=>{const t=e.target;t.removeEventListener("wheel",this.onWheel);const{value:i}=t;this.numChars=i.length;this.minCharactersUnattained=this.minCharacters>0&&this.numChars<this.minCharacters;this.icBlur.emit({value:i});this.isFocussed=false};this.onFocus=e=>{const t=e.target;t.addEventListener("wheel",this.onWheel);this.icFocus.emit({value:t.value});this.isFocussed=true};this.onTextAreaScroll=()=>{this.icScroll.emit()};this.onWheel=e=>{const t=e.target;if(t.type==="number"){t.blur();setTimeout((()=>{t.focus()}),0)}};this.hasStatus=e=>e!==""&&!this.disabled;this.handleFormReset=()=>{this.value=this.initialValue};this.hostMutationCallback=e=>{let t=false;e.forEach((({attributeName:e,type:i,addedNodes:a,removedNodes:s})=>{if(e&&C.includes(e)){const i=this.el.getAttribute(e);if(i){this.inheritedAttributes[e]=i}t=true}else if(i==="childList"){t=o(a,s,"icon")}}));if(t){i(this)}}}watchDisabledHandler(){n(this.disabled,this.el)}debounceChanged(){this.icChange=l(this.icChange,this.debounce)}watchValueHandler(e){let t;if(this.maxCharacters>0){t=e.substring(0,this.maxCharacters);if(t.length<e.length){this.maxCharactersWarning=true}this.value=t}else{t=e}if(this.inputEl&&this.inputEl.value!==t){this.inputEl.value=t}this.getMaxValueExceeded(t);this.getMaxCharactersReached(t);this.icChange.emit({value:t})}connectedCallback(){this.debounceChanged()}disconnectedCallback(){var e;c(this.el,this.handleFormReset);(e=this.hostMutationObserver)===null||e===void 0?void 0:e.disconnect()}componentWillLoad(){if(this.value!==this.initialValue){this.watchValueHandler(this.value)}else if(this.maxCharacters>0){this.value=this.value.substring(0,this.maxCharacters)}this.getMaxValueExceeded(this.value);this.getMaxCharactersReached(this.value);this.inheritedAttributes=d(this.el,C);if(this.readonly){this.maxValueExceeded=false;this.minValueUnattained=false}h(this.el,this.handleFormReset);n(this.disabled,this.el)}componentDidLoad(){u([{prop:this.label,propName:"label"}],"Text Field");if(this.validationInlineInternal){this.getValidationText.emit({value:this.validationText})}this.hostMutationObserver=new MutationObserver(this.hostMutationCallback);this.hostMutationObserver.observe(this.el,{attributes:true,childList:true});if(this.autofocus&&!this.disabled&&!this.readonly){this.interval=setInterval(this.checkChildHydration,50)}}handleKeyDown(e){this.icKeydown.emit({event:e});if(!e.ctrlKey&&!b.includes(e.key)){this.maxCharactersWarning=this.maxCharactersReached}}async setFocus(){var e;(e=this.inputEl)===null||e===void 0?void 0:e.focus()}render(){const{inputId:e,name:t,label:i,required:r,size:o,placeholder:n,helperText:l,hideCharCount:c,rows:d,resize:h,disabled:u,value:b,min:y,max:w,numChars:k,readonly:z,maxCharacters:C,maxCharactersMessage:$,maxCharactersWarning:I,maxCharactersReached:M,maxMessage:L,minCharacters:N,minCharactersMessage:T,minCharactersUnattained:j,minMessage:F,minValueUnattained:q,maxValueExceeded:H,validationStatus:V,validationText:D,validationInline:W,validationInlineInternal:B,spellcheck:O,inputmode:S,fullWidth:A,truncateValue:E,hiddenInput:K,theme:U,hideLabel:_,type:G,autocapitalize:R,ariaActiveDescendant:J,inheritedAttributes:P,ariaExpanded:Q,ariaOwns:X,autocomplete:Y,role:Z,isFocussed:ee}=this;const te=this.el;const ie=z||u;const ae=H||q||j||I?I?p.Warning:p.Error:V;const se=I?$:H?L:q?F:j?T:D;const re=z?0:C;const oe=I||H||q||ae===p.Error?"assertive":"polite";const ne=this.hasStatus(ae)&&!(ae==p.Success&&W)&&!B;const le=d>1;const ce=C>0?`${e}-char-count-desc`:"";const de=re-k;const he=C>0?`${e}-remaining-char-count-desc`:"";const ue=`${de} character${de===1?"":"s"} remaining.`;const be=`${ce} ${k>0?he:""} ${f(this.el,e,l!=="",ne)}`.trim();const pe=ie&&!z;const fe=!!this.el.querySelector(`[slot="icon"]`)&&!pe;const me=`${ae===p.Error}`;K?m(this.el,b,t,ie):x(this.el);return a(s,{key:"353a70181ab18c4f636b34e2177bb9d088567885",class:{"ic-text-field-full-width":A,"ic-text-field-disabled":ie,[`ic-theme-${U}`]:U!=="inherit"}},a("ic-input-container",{key:"96d0ef6132ed2a26ee535cfc5055ddc6287446f6",readonly:z,disabled:ie},!_&&a("ic-input-label",{key:"dfcb7859651f74678636e4cda1ba0706b2e3b1fb",for:e,label:i,helperText:l,required:r,disabled:pe,readonly:z},a("slot",{key:"d9ee297f2de674a969486a3d00eef54526eace50",name:"helper-text",slot:"helper-text"})),a("ic-input-component-container",{key:"0a178235ced26ef73fd907d41424a8b4942659dc",size:o,validationStatus:ae,multiLine:le,disabled:ie,readonly:z,validationInline:W,fullWidth:A},fe&&a("span",{key:"c5206e3d1af81d4bf9bf0afcc9277899ca2287be",class:{readonly:z,"has-value":this.getNumberOfCharacters(b)>0},slot:"left-icon"},a("slot",{key:"f3945929b482d9a0a954dc1afa658fc0c45d90c8",name:"icon"})),!le?a("input",Object.assign({id:e,name:t,ref:e=>this.inputEl=e,type:G,min:y,max:w,value:b,class:{"no-left-pad":!fe&&z,readonly:z,"truncate-value":E},placeholder:n?n:"",required:r,disabled:ie,readonly:z,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,"aria-label":i,"aria-describedby":be,"aria-invalid":me,"aria-activedescendant":J,"aria-expanded":Q,"aria-owns":X,autocomplete:Y,autocapitalize:R,spellcheck:O,inputmode:S,role:Z||undefined,maxlength:M?C:undefined,minlength:j?N:undefined},P)):a("textarea",Object.assign({id:e,class:{"no-resize":h===false||!!z,"no-left-pad":!fe&&!!z,readonly:!!z},name:t,ref:e=>this.inputEl=e,value:b,rows:d,required:r,disabled:ie,placeholder:n,readonly:z,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,onScroll:this.onTextAreaScroll,"aria-label":i,"aria-describedby":be,"aria-invalid":me,autocapitalize:R,spellcheck:O,inputmode:S,maxlength:M?C:undefined,minlength:j?N:undefined},P)),v(te,"clear-button")&&a("slot",{key:"6397d66b59b148884cb2fd7f8913063ca24f0de1",name:"clear-button"}),v(te,"search-submit-button")&&a("slot",{key:"c5e7f94345cebe1dc99ba475aa5bde1b45dda0e0",name:"search-submit-button"})),v(te,"menu")&&a("slot",{key:"1c7fe7d7654373753295a44a3e126ce2409099cc",name:"menu"}),(!g(V)||!g(D)||re>0||H||I||j||q)&&!B&&a("ic-input-validation",{key:"2ba3ff987910423696b822529b36e59f04b36025",status:this.hasStatus(ae)===false||ae===p.Success&&W||B?"":ae,message:ne?se:"",ariaLiveMode:oe,for:e,fullWidth:A},!z&&re>0&&a("div",{key:"01e443574b72a18ebd0b0646b0c2c30b59cc5726",slot:"validation-message-adornment"},!c&&a("ic-typography",{key:"90d4e1d9325a34444c38a9c75eaaa5e256c23cae",variant:"caption",class:"char-count-text"},a("span",{key:"901a7db053e3fa59e6db506a53be92ddbf54be5d",class:"char-count"},k,"/",re)),a("span",{key:"83b08ec8e8ba8286cc8024b647552c5b3e0d09e5",class:"remaining-char-count-desc","aria-live":"polite",hidden:!ee,id:he},ue),a("span",{key:"28e0fc0de7a73057a7b00bd7e40e71c7611a980c",hidden:true,id:ce},"Field can contain a maximum of ",re," characters.")))))}get el(){return r(this)}static get watchers(){return{disabled:["watchDisabledHandler"],debounce:["debounceChanged"],value:["watchValueHandler"]}}};$.style=k;export{$ as ic_text_field};
|
2
|
+
//# sourceMappingURL=p-89f493f3.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["icTextFieldCss","IcTextFieldStyle0","inputIds","MUTABLE_ATTRIBUTES","IC_INHERITED_ARIA","TextField","constructor","hostRef","this","inheritedAttributes","hostMutationObserver","numChars","maxCharactersReached","maxCharactersWarning","minCharactersUnattained","maxValueExceeded","minValueUnattained","isFocussed","autocapitalize","autocomplete","autocorrect","autofocus","disabled","fullWidth","helperText","hideCharCount","hideLabel","hiddenInput","inputId","inputmode","maxCharacters","maxCharactersMessage","maxMessage","max","minCharacters","minCharactersMessage","minMessage","min","name","placeholder","readonly","required","resize","rows","size","spellcheck","theme","truncateValue","type","validationInline","validationInlineInternal","validationStatus","validationText","debounce","value","initialValue","checkChildHydration","_b","_a","el","shadowRoot","querySelector","classList","contains","setFocus","clearInterval","interval","getNumberOfCharacters","undefined","length","getMaxValueExceeded","Number","getMaxCharactersReached","onInput","ev","target","icInput","emit","onBlur","removeEventListener","onWheel","icBlur","onFocus","addEventListener","icFocus","onTextAreaScroll","icScroll","blur","setTimeout","focus","hasStatus","status","handleFormReset","hostMutationCallback","mutationList","forceComponentUpdate","forEach","attributeName","addedNodes","removedNodes","includes","attribute","getAttribute","checkSlotInChildMutations","forceUpdate","watchDisabledHandler","removeDisabledFalse","debounceChanged","icChange","debounceEvent","watchValueHandler","newValue","substring","inputEl","connectedCallback","disconnectedCallback","removeFormResetListener","disconnect","componentWillLoad","inheritAttributes","addFormResetListener","componentDidLoad","onComponentRequiredPropUndefined","prop","label","propName","getValidationText","MutationObserver","observe","attributes","childList","setInterval","handleKeyDown","icKeydown","event","ctrlKey","IGNORED_KEYBOARD_CHARACTERS","key","render","ariaActiveDescendant","ariaExpanded","ariaOwns","role","disabledMode","currentStatus","IcInformationStatus","Warning","Error","currentValidationText","maxNumChars","messageAriaLive","showStatusText","Success","multiline","hiddenCharCountDescId","charsRemaining","remainingCharCountDescId","remainingCharCountDesc","describedBy","getInputDescribedByText","trim","disabledText","showLeftIcon","invalid","renderHiddenInput","removeHiddenInput","h","Host","class","for","slot","multiLine","Object","assign","id","ref","maxlength","minlength","onScroll","isSlotUsed","isEmptyString","message","ariaLiveMode","variant","hidden"],"sources":["src/components/ic-text-field/ic-text-field.css?tag=ic-text-field&encapsulation=shadow","src/components/ic-text-field/ic-text-field.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n /**\n * @prop --input-width: Width of the input field\n */\n display: block;\n\n --ic-input-label-helpertext-padding: var(--ic-space-xxs);\n --border-color: var(--ic-text-field-border-neutral);\n --border-color-hover: var(--ic-text-field-border-neutral-hover);\n --border-color-pressed: var(--ic-text-field-border-neutral-pressed);\n --border-color-disabled: var(--ic-text-field-border-disabled);\n --border-color-error: var(--ic-text-field-border-error);\n --border-color-error-hover: var(--ic-text-field-border-error-hover);\n --border-color-error-pressed: var(--ic-text-field-border-error-pressed);\n --border-color-success: var(--ic-text-field-border-success);\n --border-color-success-hover: var(--ic-text-field-border-success-hover);\n --border-color-success-pressed: var(--ic-text-field-border-success-pressed);\n --border-color-warning: var(--ic-text-field-border-warning);\n --border-color-warning-hover: var(--ic-text-field-border-warning-hover);\n --border-color-warning-pressed: var(--ic-text-field-border-warning-pressed);\n --ic-input-label-text-color: var(--ic-text-field-label);\n --ic-input-label-helper-text-color: var(--ic-text-field-subtitle);\n --ic-input-validation-status-text-color: var(--ic-text-field-state-text);\n --ic-input-validation-error: var(--ic-text-field-state-icon-error);\n --ic-input-validation-warning-icon-color: var(\n --ic-text-field-state-icon-warning\n );\n --ic-input-validation-success-icon-color: var(\n --ic-text-field-state-icon-success\n );\n --ic-input-component-container-success-icon-inline-color: var(\n --ic-text-field-state-icon-success\n );\n}\n\n:host(.ic-text-field-disabled) {\n --ic-input-label-text-color: var(--ic-text-field-label-disabled);\n --ic-input-label-helper-text-color: var(--ic-text-field-subtitle-disabled);\n --text-field-placeholder-color: var(\n --ic-text-field-text-area-placeholder-text-disabled\n );\n}\n\n:host(.ic-text-field-full-width) {\n width: 100%;\n}\n\n::placeholder {\n color: var(\n --text-field-placeholder-color,\n var(--ic-text-field-placeholder-text)\n );\n opacity: 1;\n}\n\ninput,\ntextarea {\n border: 0;\n border-radius: var(--ic-border-radius);\n color: var(--text-field-text-color, var(--ic-text-field-text));\n background-color: var(--input-bg-color, var(--ic-text-field-background));\n line-height: 1.5rem;\n letter-spacing: 0.005rem;\n width: 100%;\n padding-right: var(--ic-space-xs);\n padding-left: var(--ic-space-xs);\n caret-color: var(\n --text-field-typing-cursor,\n var(--ic-text-field-typing-cursor)\n );\n}\n\ntextarea {\n min-height: var(--ic-space-lg);\n resize: vertical;\n padding-top: 0.375rem;\n}\n\ninput:focus,\ntextarea:focus {\n border: 0;\n outline: 0;\n}\n\ninput:disabled,\ntextarea:disabled {\n color: var(\n --text-field-disabled-text-color,\n var(--ic-text-field-text-disabled)\n );\n}\n\ninput.readonly,\ntextarea.readonly {\n color: var(--ic-text-field-read-only-input-text-internal);\n background: transparent;\n}\n\n/* Chrome, Safari, Edge */\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n/* Firefox */\ninput[type=\"number\"] {\n -moz-appearance: textfield;\n}\n\ntextarea.no-resize {\n resize: none;\n}\n\n.char-count-text {\n --ic-typography-color: var(--ic-text-field-character-limit);\n\n padding-right: var(--ic-space-xxxs);\n}\n\n:host(.ic-text-field-disabled) .char-count-text {\n --ic-typography-color: var(--ic-text-field-character-limit-disabled);\n}\n\n.no-left-pad {\n padding-left: 0;\n}\n\n::slotted([slot=\"icon\"]) {\n fill: var(--ic-text-field-text-disabled);\n}\n\n.has-value ::slotted([slot=\"icon\"]) {\n fill: var(--ic-text-field-input-internal-icon);\n}\n\n.char-count {\n margin-right: calc(-1 * var(--ic-space-xxxs));\n}\n\n.remaining-char-count-desc {\n position: absolute;\n left: -9999px;\n}\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration,\ninput[type=\"search\"]::-webkit-search-results-button,\ninput[type=\"search\"]::-webkit-search-results-decoration {\n display: none;\n}\n\ninput[type=\"search\"].truncate-value {\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n@media (forced-colors: active) {\n input.readonly,\n textarea.readonly {\n color: canvastext;\n }\n\n .has-value ::slotted([slot=\"icon\"]) {\n fill: currentcolor;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n Method,\n h,\n forceUpdate,\n} from \"@stencil/core\";\nimport {\n IcInformationStatus,\n IcAutocompleteTypes,\n IcAutocorrectStates,\n IcInformationStatusOrEmpty,\n IcValueEventDetail,\n IcSizesNoLarge,\n IcThemeMode,\n} from \"../../utils/types\";\nimport {\n inheritAttributes,\n debounceEvent,\n getInputDescribedByText,\n renderHiddenInput,\n isEmptyString,\n onComponentRequiredPropUndefined,\n addFormResetListener,\n removeFormResetListener,\n isSlotUsed,\n removeDisabledFalse,\n checkSlotInChildMutations,\n removeHiddenInput,\n} from \"../../utils/helpers\";\nimport {\n IC_INHERITED_ARIA,\n IGNORED_KEYBOARD_CHARACTERS,\n} from \"../../utils/constants\";\nimport {\n IcAriaAutocompleteTypes,\n IcTextFieldInputModes,\n IcTextFieldTypes,\n} from \"./ic-text-field.types\";\n\nlet inputIds = 0;\nconst MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, \"title\"];\n\n/**\n * @slot helper-text - Content is set as the helper text for the text field.\n * @slot icon - Content will be placed to the left of the text input.\n */\n@Component({\n tag: \"ic-text-field\",\n styleUrl: \"ic-text-field.css\",\n shadow: true,\n})\nexport class TextField {\n private inheritedAttributes: { [k: string]: string } = {};\n private inputEl: HTMLInputElement | HTMLTextAreaElement;\n private hostMutationObserver: MutationObserver | null = null;\n private interval: ReturnType<typeof setInterval>;\n\n @Element() el: HTMLIcTextFieldElement;\n\n @State() numChars: number = 0;\n @State() maxCharactersReached: boolean = false;\n @State() maxCharactersWarning: boolean = false;\n @State() minCharactersUnattained: boolean = false;\n @State() maxValueExceeded: boolean = false;\n @State() minValueUnattained: boolean = false;\n @State() isFocussed: boolean = false;\n\n /**\n * @slot clear-button - an ic-button clear component will render as an end adornment to the input.\n * @slot search-submit-button - an ic-button search submit component will render as an end adornment to the input.\n * @slot menu - an ic-menu component will appear below the input.\n */\n\n /**\n * @internal The active element when focus is on the ic-menu items.\n */\n @Prop() ariaActiveDescendant?: string;\n\n /**\n * @internal Used to identify whether inputting any text triggers more predictions\n */\n @Prop() ariaAutocomplete?: IcAriaAutocompleteTypes;\n\n /**\n * @internal Used to identify if the slotted menu is rendered\n */\n @Prop() ariaExpanded: string | null;\n\n /**\n * @internal Used to identify any related child component\n */\n @Prop() ariaOwns?: string;\n\n /**\n * The automatic capitalisation of the text value as it is entered/edited by the user.\n * Available options: \"off\", \"none\", \"on\", \"sentences\", \"words\", \"characters\".\n */\n @Prop() autocapitalize = \"off\";\n\n /**\n * The state of autocompletion the browser can apply on the text value.\n */\n @Prop() autocomplete?: IcAutocompleteTypes = \"off\";\n\n /**\n * The state of autocorrection the browser can apply when the user is entering/editing the text value.\n */\n @Prop() autocorrect?: IcAutocorrectStates = \"off\";\n\n /**\n * If `true`, the form control will have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el as HTMLElement);\n }\n\n /**\n * Specify whether the text field fills the full width of the container.\n * If `true`, this overrides the --input-width CSS variable.\n */\n @Prop() fullWidth = false;\n\n /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText = \"\";\n\n /**\n * If `true`, the character count which is displayed when `maxCharacters` is set will be visually hidden.\n */\n @Prop() hideCharCount = false;\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel = false;\n\n /**\n * @internal If `true`, the hidden form input will stop rendering for form submission.\n */\n @Prop() hiddenInput = true;\n\n /**\n * The ID for the input.\n */\n @Prop() inputId = `ic-text-field-input-${inputIds++}`;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode: IcTextFieldInputModes = \"text\";\n\n /**\n * The label for the input.\n */\n @Prop() label!: string;\n\n /**\n * The maximum number that can be accepted as a value, when `type` is `number` and `rows` is `1`. (NOTE: Ensure to include visual indication of max value in `helperText` or `label`)\n */\n @Prop() max?: string | number;\n\n /**\n * The count of characters in the field. Will display a warning if the bound is reached. (NOTE: If the value of the text field has been set using the `value` prop, it will be truncated to this number of characters)\n */\n @Prop() maxCharacters = 0;\n\n /**\n * The text to display as the warning message when the maximum number of characters (the `maxCharacters` prop value) is reached.\n */\n // prettier-ignore\n @Prop() maxCharactersMessage = `Maximum input is ${this.maxCharacters} characters`;\n\n /**\n * The text to display as the error message when the maximum value (the `max` prop value) has been exceeded.\n */\n @Prop() maxMessage = `Maximum value of ${this.max} exceeded`;\n\n /**\n * The minimum number that can be accepted as a value, when `type` is `number` and `rows` is `1`. (NOTE: Ensure to include visual indication of min value in `helperText` or `label`)\n */\n @Prop() min?: string | number;\n\n /**\n * The minimum number of characters that can be entered in the field.\n */\n @Prop() minCharacters = 0;\n\n /**\n * The text to display as the error message when the minimum number of characters (the `minCharacters` prop value) has not been met.\n */\n // prettier-ignore\n @Prop() minCharactersMessage = `Minimum input is ${this.minCharacters} characters`;\n\n /**\n * The text to display as the error message when the minimum value (the `min` prop value) has not been met.\n */\n @Prop() minMessage = `Minimum value of ${this.min} not met`;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name = this.inputId;\n\n /**\n * The placeholder value to be displayed.\n */\n @Prop() placeholder = \"\";\n\n /**\n * If `true`, the read only state will be set.\n */\n @Prop({ reflect: true }) readonly = false;\n\n /**\n * If `true`, the input will require a value.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the multiline text area will be resizeable.\n */\n @Prop() resize = false;\n\n /**\n * @internal Used to set the role if not default textbox;\n */\n @Prop() role: string | null;\n\n /**\n * The number of rows to transform the text field into a text area with a specific height.\n */\n @Prop() rows = 1;\n\n /**\n * The size of the text field component.\n */\n @Prop() size: IcSizesNoLarge = \"medium\";\n\n /**\n * If `true`, the value of the text field will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\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 * @internal If `true`, an ellipsis will be displayed at the end of the value if the value is longer than the container.\n */\n @Prop() truncateValue = false;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop() type: IcTextFieldTypes = \"text\";\n\n /**\n * If `true`, the icon in input control will be displayed - only applies when validationStatus ='success'.\n */\n @Prop() validationInline = false;\n\n /**\n * @internal If `true`, the validation will display inline.\n */\n @Prop() validationInlineInternal = false;\n\n /**\n * The validation state - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus: IcInformationStatusOrEmpty = \"\";\n\n /**\n * The text to display as the validation message.\n */\n @Prop() validationText: string = \"\";\n\n /**\n * The amount of time, in milliseconds, to wait to trigger the `icChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n @Watch(\"debounce\")\n private debounceChanged() {\n this.icChange = debounceEvent(this.icChange, this.debounce);\n }\n\n /**\n * The value of the text field.\n */\n @Prop({ reflect: true, mutable: true }) value = \"\";\n @State() initialValue = this.value;\n @Watch(\"value\")\n private watchValueHandler(newValue: string): void {\n let value;\n\n if (this.maxCharacters > 0) {\n value = newValue.substring(0, this.maxCharacters);\n if (value.length < newValue.length) {\n this.maxCharactersWarning = true;\n }\n this.value = value;\n } else {\n value = newValue;\n }\n\n if (this.inputEl && this.inputEl.value !== value) {\n this.inputEl.value = value;\n }\n\n this.getMaxValueExceeded(value);\n\n this.getMaxCharactersReached(value);\n\n this.icChange.emit({ value });\n }\n\n /**\n * @internal Emitted when the validationInlineInternal is `true`\n */\n @Event() getValidationText: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when input loses focus.\n */\n @Event() icBlur: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() icChange: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when input gains focus.\n */\n @Event() icFocus: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() icInput: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when a keydown event occurred.\n */\n @Event() icKeydown: EventEmitter<{ event: KeyboardEvent }>;\n\n /**\n * Emitted when the textarea variant is scrolled.\n */\n @Event() icScroll: EventEmitter;\n\n connectedCallback(): void {\n this.debounceChanged();\n }\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el as HTMLElement, this.handleFormReset);\n this.hostMutationObserver?.disconnect();\n }\n\n componentWillLoad(): void {\n if (this.value !== this.initialValue) {\n this.watchValueHandler(this.value);\n } else if (this.maxCharacters > 0) {\n this.value = this.value.substring(0, this.maxCharacters);\n }\n\n this.getMaxValueExceeded(this.value);\n this.getMaxCharactersReached(this.value);\n\n this.inheritedAttributes = inheritAttributes(\n this.el as HTMLElement,\n MUTABLE_ATTRIBUTES\n );\n\n if (this.readonly) {\n this.maxValueExceeded = false;\n this.minValueUnattained = false;\n }\n\n addFormResetListener(this.el as HTMLElement, this.handleFormReset);\n\n removeDisabledFalse(this.disabled, this.el as HTMLElement);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Text Field\"\n );\n if (this.validationInlineInternal) {\n this.getValidationText.emit({ value: this.validationText });\n }\n\n this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);\n this.hostMutationObserver.observe(this.el, {\n attributes: true,\n childList: true,\n });\n\n if (this.autofocus && !this.disabled && !this.readonly) {\n this.interval = setInterval(this.checkChildHydration, 50);\n }\n }\n\n private checkChildHydration = () => {\n if (\n this.hideLabel ||\n this.el.shadowRoot\n ?.querySelector(\"ic-typography\")\n ?.classList.contains(\"hydrated\")\n ) {\n this.setFocus();\n clearInterval(this.interval);\n }\n };\n\n @Listen(\"keydown\", {})\n handleKeyDown(ev: KeyboardEvent): void {\n this.icKeydown.emit({ event: ev });\n\n if (!ev.ctrlKey && !IGNORED_KEYBOARD_CHARACTERS.includes(ev.key)) {\n this.maxCharactersWarning = this.maxCharactersReached;\n }\n }\n\n /**\n * Sets focus on the native `input`.\n */\n\n @Method()\n async setFocus(): Promise<void> {\n this.inputEl?.focus();\n }\n\n private getNumberOfCharacters = (value: string) =>\n value !== null && value !== undefined ? value.length : 0;\n\n private getMaxValueExceeded = (value: string) => {\n this.numChars = this.getNumberOfCharacters(value);\n\n if (this.type === \"number\") {\n this.minValueUnattained = !!value && Number(value) < Number(this.min);\n this.maxValueExceeded = Number(value) > Number(this.max);\n }\n };\n\n private getMaxCharactersReached = (value: string) => {\n this.numChars = this.getNumberOfCharacters(value);\n\n this.maxCharactersReached =\n this.maxCharacters > 0 && this.numChars >= this.maxCharacters;\n\n if (this.maxCharactersWarning && !this.maxCharactersReached) {\n this.maxCharactersWarning = false;\n }\n };\n\n private onInput = (ev: Event) => {\n this.value = (ev.target as HTMLInputElement).value;\n this.icInput.emit({ value: this.value });\n };\n\n private onBlur = (ev: Event) => {\n const target = ev.target as HTMLInputElement;\n target.removeEventListener(\"wheel\", this.onWheel);\n const { value } = target;\n this.numChars = value.length;\n this.minCharactersUnattained =\n this.minCharacters > 0 && this.numChars < this.minCharacters;\n this.icBlur.emit({ value });\n this.isFocussed = false;\n };\n\n private onFocus = (ev: Event) => {\n const target = ev.target as HTMLInputElement;\n target.addEventListener(\"wheel\", this.onWheel);\n this.icFocus.emit({ value: target.value });\n this.isFocussed = true;\n };\n\n private onTextAreaScroll = () => {\n this.icScroll.emit();\n };\n\n private onWheel = (ev: WheelEvent) => {\n const target = ev.target as HTMLInputElement;\n if (target.type === \"number\") {\n target.blur();\n setTimeout(() => {\n target.focus();\n }, 0);\n }\n };\n\n private hasStatus = (status: IcInformationStatusOrEmpty) =>\n status !== \"\" && !this.disabled;\n\n private handleFormReset = (): void => {\n this.value = this.initialValue;\n };\n\n // triggered when attributes of host element change\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n let forceComponentUpdate = false;\n mutationList.forEach(\n ({ attributeName, type, addedNodes, removedNodes }) => {\n if (attributeName && MUTABLE_ATTRIBUTES.includes(attributeName)) {\n const attribute = this.el.getAttribute(attributeName);\n if (attribute) {\n this.inheritedAttributes[attributeName] = attribute;\n }\n forceComponentUpdate = true;\n } else if (type === \"childList\") {\n forceComponentUpdate = checkSlotInChildMutations(\n addedNodes,\n removedNodes,\n \"icon\"\n );\n }\n }\n );\n if (forceComponentUpdate) {\n forceUpdate(this);\n }\n };\n\n render() {\n const {\n inputId,\n name,\n label,\n required,\n size,\n placeholder,\n helperText,\n hideCharCount,\n rows,\n resize,\n disabled,\n value,\n min,\n max,\n numChars,\n readonly,\n maxCharacters,\n maxCharactersMessage,\n maxCharactersWarning,\n maxCharactersReached,\n maxMessage,\n minCharacters,\n minCharactersMessage,\n minCharactersUnattained,\n minMessage,\n minValueUnattained,\n maxValueExceeded,\n validationStatus,\n validationText,\n validationInline,\n validationInlineInternal,\n spellcheck,\n inputmode,\n fullWidth,\n truncateValue,\n hiddenInput,\n theme,\n hideLabel,\n type,\n autocapitalize,\n ariaActiveDescendant,\n inheritedAttributes,\n ariaExpanded,\n ariaOwns,\n autocomplete,\n role,\n isFocussed,\n } = this;\n\n const el = this.el as HTMLElement;\n\n const disabledMode = readonly || disabled;\n\n const currentStatus =\n maxValueExceeded ||\n minValueUnattained ||\n minCharactersUnattained ||\n maxCharactersWarning\n ? maxCharactersWarning\n ? IcInformationStatus.Warning\n : IcInformationStatus.Error\n : validationStatus;\n\n const currentValidationText = maxCharactersWarning\n ? maxCharactersMessage\n : maxValueExceeded\n ? maxMessage\n : minValueUnattained\n ? minMessage\n : minCharactersUnattained\n ? minCharactersMessage\n : validationText;\n\n const maxNumChars = readonly ? 0 : maxCharacters;\n const messageAriaLive =\n maxCharactersWarning ||\n maxValueExceeded ||\n minValueUnattained ||\n currentStatus === IcInformationStatus.Error\n ? \"assertive\"\n : \"polite\";\n\n const showStatusText =\n this.hasStatus(currentStatus) &&\n !(currentStatus == IcInformationStatus.Success && validationInline) &&\n !validationInlineInternal;\n\n const multiline = rows > 1;\n\n const hiddenCharCountDescId =\n maxCharacters > 0 ? `${inputId}-char-count-desc` : \"\";\n\n const charsRemaining = maxNumChars - numChars;\n const remainingCharCountDescId =\n maxCharacters > 0 ? `${inputId}-remaining-char-count-desc` : \"\";\n const remainingCharCountDesc = `${charsRemaining} character${\n charsRemaining === 1 ? \"\" : \"s\"\n } remaining.`;\n\n const describedBy = `${hiddenCharCountDescId} ${\n numChars > 0 ? remainingCharCountDescId : \"\"\n } ${getInputDescribedByText(\n this.el,\n inputId,\n helperText !== \"\",\n showStatusText\n )}`.trim();\n\n const disabledText = disabledMode && !readonly;\n const showLeftIcon =\n !!this.el.querySelector(`[slot=\"icon\"]`) && !disabledText;\n\n const invalid = `${currentStatus === IcInformationStatus.Error}`;\n\n hiddenInput\n ? renderHiddenInput(this.el as HTMLElement, value, name, disabledMode)\n : removeHiddenInput(this.el as HTMLElement);\n\n return (\n <Host\n class={{\n \"ic-text-field-full-width\": fullWidth,\n \"ic-text-field-disabled\": disabledMode,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n >\n <ic-input-container readonly={readonly} disabled={disabledMode}>\n {!hideLabel && (\n <ic-input-label\n for={inputId}\n label={label}\n helperText={helperText}\n required={required}\n disabled={disabledText}\n readonly={readonly}\n >\n <slot name=\"helper-text\" slot=\"helper-text\"></slot>\n </ic-input-label>\n )}\n\n <ic-input-component-container\n size={size}\n validationStatus={currentStatus}\n multiLine={multiline}\n disabled={disabledMode}\n readonly={readonly}\n validationInline={validationInline}\n fullWidth={fullWidth}\n >\n {showLeftIcon && (\n <span\n class={{\n readonly,\n \"has-value\": this.getNumberOfCharacters(value) > 0,\n }}\n slot=\"left-icon\"\n >\n <slot name=\"icon\" />\n </span>\n )}\n\n {!multiline ? (\n <input\n id={inputId}\n name={name}\n ref={(el) => (this.inputEl = el as HTMLInputElement)}\n type={type}\n min={min}\n max={max}\n value={value}\n class={{\n \"no-left-pad\": !showLeftIcon && readonly,\n readonly,\n \"truncate-value\": truncateValue,\n }}\n placeholder={placeholder ? placeholder : \"\"}\n required={required}\n disabled={disabledMode}\n readonly={readonly}\n onInput={this.onInput}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n aria-label={label}\n aria-describedby={describedBy}\n aria-invalid={invalid}\n aria-activedescendant={ariaActiveDescendant}\n aria-expanded={ariaExpanded}\n aria-owns={ariaOwns}\n autocomplete={autocomplete}\n autocapitalize={autocapitalize}\n spellcheck={spellcheck}\n inputmode={inputmode}\n role={role || undefined}\n maxlength={maxCharactersReached ? maxCharacters : undefined}\n minlength={minCharactersUnattained ? minCharacters : undefined}\n {...inheritedAttributes}\n ></input>\n ) : (\n <textarea\n id={inputId}\n class={{\n \"no-resize\": resize === false || !!readonly,\n \"no-left-pad\": !showLeftIcon && !!readonly,\n readonly: !!readonly,\n }}\n name={name}\n ref={(el) => (this.inputEl = el as HTMLTextAreaElement)}\n value={value}\n rows={rows}\n required={required}\n disabled={disabledMode}\n placeholder={placeholder}\n readonly={readonly}\n onInput={this.onInput}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n onScroll={this.onTextAreaScroll}\n aria-label={label}\n aria-describedby={describedBy}\n aria-invalid={invalid}\n autocapitalize={autocapitalize}\n spellcheck={spellcheck}\n inputmode={inputmode}\n maxlength={maxCharactersReached ? maxCharacters : undefined}\n minlength={minCharactersUnattained ? minCharacters : undefined}\n {...inheritedAttributes}\n ></textarea>\n )}\n {isSlotUsed(el, \"clear-button\") && (\n <slot name=\"clear-button\"></slot>\n )}\n {isSlotUsed(el, \"search-submit-button\") && (\n <slot name=\"search-submit-button\"></slot>\n )}\n </ic-input-component-container>\n {isSlotUsed(el, \"menu\") && <slot name=\"menu\"></slot>}\n {(!isEmptyString(validationStatus) ||\n !isEmptyString(validationText) ||\n maxNumChars > 0 ||\n maxValueExceeded ||\n maxCharactersWarning ||\n minCharactersUnattained ||\n minValueUnattained) &&\n !validationInlineInternal && (\n <ic-input-validation\n status={\n this.hasStatus(currentStatus) === false ||\n (currentStatus === IcInformationStatus.Success &&\n validationInline) ||\n validationInlineInternal\n ? \"\"\n : currentStatus\n }\n message={showStatusText ? currentValidationText : \"\"}\n ariaLiveMode={messageAriaLive}\n for={inputId}\n fullWidth={fullWidth}\n >\n {!readonly && maxNumChars > 0 && (\n <div slot=\"validation-message-adornment\">\n {!hideCharCount && (\n <ic-typography variant=\"caption\" class=\"char-count-text\">\n <span class=\"char-count\">\n {numChars}/{maxNumChars}\n </span>\n </ic-typography>\n )}\n <span\n class=\"remaining-char-count-desc\"\n aria-live=\"polite\"\n hidden={!isFocussed}\n id={remainingCharCountDescId}\n >\n {remainingCharCountDesc}\n </span>\n <span hidden={true} id={hiddenCharCountDescId}>\n Field can contain a maximum of {maxNumChars} characters.\n </span>\n </div>\n )}\n </ic-input-validation>\n )}\n </ic-input-container>\n </Host>\n );\n }\n}\n"],"mappings":"6MAAA,MAAMA,EAAiB,otMACvB,MAAAC,EAAeD,EC8C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WAAYA,EACZhB,UAAWA,EACXmJ,UAAWpK,EAAuBkB,EAAgBsC,UAClD6G,UAAWnK,EAA0BoB,EAAgBkC,WACjD3D,IAGP0K,EAAWxH,GAAI,iBACd2G,EAAA,QAAA7B,IAAA,2CAAMnG,KAAK,iBAEZ6I,EAAWxH,GAAI,yBACd2G,EAAA,QAAA7B,IAAA,2CAAMnG,KAAK,0BAGd6I,EAAWxH,GAAI,SAAW2G,EAAA,QAAA7B,IAAA,2CAAMnG,KAAK,WACnC8I,EAAcjI,KACdiI,EAAchI,IACfiG,GAAc,GACdtI,GACAF,GACAC,GACAE,KACCkC,GACCoH,EAAA,uBAAA7B,IAAA,2CACE9C,OACEnF,KAAKkF,UAAUsD,MAAmB,OACjCA,KAAkBC,EAAoBO,SACrCvG,GACFC,EACI,GACA8F,GAENqC,QAAS9B,GAAiBH,GAAwB,GAClDkC,aAAchC,GACdmB,IAAK7I,EACLL,UAAWA,IAETiB,GAAY6G,GAAc,GAC1BiB,EAAA,OAAA7B,IAAA,2CAAKiC,KAAK,iCACNjJ,GACA6I,EAAA,iBAAA7B,IAAA,2CAAe8C,QAAQ,UAAUf,MAAM,mBACrCF,EAAA,QAAA7B,IAAA,2CAAM+B,MAAM,cACT7J,EAAQ,IAAG0I,KAIlBiB,EAAA,QAAA7B,IAAA,2CACE+B,MAAM,4BAA2B,YACvB,SACVgB,QAASvK,GACT6J,GAAIlB,IAEHC,IAEHS,EAAA,QAAA7B,IAAA,2CAAM+C,OAAQ,KAAMV,GAAIpB,IAAqB,kCACXL,GAAW,mB","ignoreList":[]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as i,c as t,h as e,F as s,H as a,g as o}from"./p-8e4e97b4.js";import{c as n}from"./p-f074ef5b.js";import{f as r,u as l,i as h,b as d}from"./p-8242c24f.js";const c='/*! 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-clear-button)}.content-area{padding:0 var(--ic-space-md);margin:0;overflow-y:auto}#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;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 g=c;const p=class{constructor(a){i(this,a);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.contentAreaMutationObserver=null;this.DATA_GETS_FOCUS="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.IC_CHECKBOX="IC-CHECKBOX";this.IC_SEARCH_BAR="IC-SEARCH-BAR";this.resizeObserver=null;this.dialogRendered=false;this.fadeIn=false;this.closeOnBackdropClick=true;this.destructive=false;this.dismissLabel="Dismiss";this.disableHeightConstraint=false;this.disableWidthConstraint=false;this.hideCloseButton=false;this.hideDefaultControls=false;this.open=false;this.size="small";this.theme="inherit";this.dialogOpened=()=>{var i,t;this.dialogRendered=true;if(this.disableHeightConstraint){(i=this.dialogEl)===null||i===void 0?void 0:i.show()}else{(t=this.dialogEl)===null||t===void 0?void 0:t.showModal()}setTimeout((()=>{this.fadeIn=true;if(this.backdropEl&&this.disableHeightConstraint&&this.backdropEl.scrollTop!==0){this.backdropEl.scrollTop=0}}),10);setTimeout((()=>{this.setInitialFocus();r(this.runResizeObserver)}),75);setTimeout((()=>{this.icDialogOpened.emit()}),80)};this.runResizeObserver=()=>{if(this.dialogEl){this.resizeObserver=new ResizeObserver((()=>{clearTimeout(this.resizeTimeout);this.resizeTimeout=window.setTimeout(this.resizeObserverCallback,80)}));this.resizeObserver.observe(this.dialogEl)}};this.resizeObserverCallback=()=>{if(this.dialogEl&&this.dialogEl.clientHeight!==this.dialogHeight){this.dialogHeight=this.dialogEl.clientHeight}};this.refreshInteractiveElementsOnSlotChange=()=>{var i,t,e;const s=(i=this.el.shadowRoot)===null||i===void 0?void 0:i.querySelector("#dialog-content");if(s){this.contentArea=s.querySelector("slot");(t=this.contentArea)===null||t===void 0?void 0:t.addEventListener("slotchange",this.getInteractiveElements);this.contentAreaMutationObserver=new MutationObserver((()=>{this.getInteractiveElements()}));(e=l(s))===null||e===void 0?void 0:e.forEach((i=>{var t;(t=this.contentAreaMutationObserver)===null||t===void 0?void 0:t.observe(i,{childList:true,subtree:true})}))}};this.removeSlotChangeListener=()=>{var i;if(this.contentArea){this.contentArea.removeEventListener("slotchange",this.getInteractiveElements);(i=this.contentAreaMutationObserver)===null||i===void 0?void 0:i.disconnect()}};this.setInitialFocus=()=>{this.sourceElement=document.activeElement;this.focusedElementIndex=this.interactiveElementList?this.interactiveElementList.findIndex((i=>i.hasAttribute(this.DATA_GETS_FOCUS))):0;this.focusElement(this.interactiveElementList[this.focusedElementIndex])};this.getFocusedElementIndex=()=>{var i;for(let t=0;t<this.interactiveElementList.length;t++){if(this.interactiveElementList[t]===(((i=this.el.shadowRoot)===null||i===void 0?void 0:i.activeElement)||document.activeElement)){this.focusedElementIndex=t}}};this.closeIconClick=()=>{this.open=false};this.getInteractiveElements=()=>{var i;this.interactiveElementList=Array.from(((i=this.el.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll("ic-button"))||[]);const t=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, \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, ic-date-input, ic-date-picker`));if(t.length>0){if(t[0].slot!==this.DIALOG_CONTROLS){t[0].setAttribute(this.DATA_GETS_FOCUS,"")}else if(!this.destructive){t[t.length-1].setAttribute(this.DATA_GETS_FOCUS,"")}}for(let i=0;i<t.length;i++){this.interactiveElementList.splice(1+i,0,t[i])}};this.getNextFocusEl=i=>this.interactiveElementList[i];this.onTabKeyPress=i=>{this.getFocusedElementIndex();if(this.interactiveElementList[this.focusedElementIndex].tagName===this.IC_SEARCH_BAR){return false}this.setFocusIndexBasedOnShiftKey(i);this.loopNextFocusIndexIfLastElement();this.focusElement(this.getNextFocusEl(this.focusedElementIndex),i);return true};this.shouldSkipElement=i=>{const t=getComputedStyle(i).visibility==="hidden"||i.offsetHeight===0||i.hasAttribute("disabled")||i.tagName===this.IC_ACCORDION_GROUP&&i.hasAttribute("single-expansion");const e=i.closest("ic-radio-option");return t||i.getAttribute("type")==="radio"&&!!e&&!e.hasAttribute("selected")};this.focusElement=(i,t=false)=>{let e=i;if(this.shouldSkipElement(i)){this.setFocusIndexBasedOnShiftKey(t);this.loopNextFocusIndexIfLastElement();e=this.getNextFocusEl(this.focusedElementIndex);this.focusElement(e,t)}else{switch(i.tagName){case this.IC_ACCORDION_GROUP:case this.IC_ACCORDION:case this.IC_SEARCH_BAR:case this.IC_TEXT_FIELD:case this.IC_CHECKBOX:i.setFocus();break;default:i.focus()}}};this.renderDialog=()=>{const{hideDefaultControls:i,size:t,heading:a,label:o,destructive:r,dismissLabel:l,hideCloseButton:d,disableHeightConstraint:c,disableWidthConstraint:g,closeIconClick:p,DIALOG_CONTROLS:b}=this;const u=h(this.el,b);return e("dialog",{class:{dialog:true,[`${t}`]:true,"disable-height-constraint":!!c,"disable-width-constraint":!!g},"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"},o))),e("div",{class:"heading"},e("slot",{name:"heading"},e("ic-typography",{variant:"h4",id:"dialog-heading"},a)))),!d&&e("ic-button",{class:"close-icon",variant:"icon",innerHTML:n,"aria-label":l,onClick:p,"data-gets-focus":r||i&&!u?"":null})),e("div",{class:"content-area"},h(this.el,"alert")&&e("slot",{name:"alert"}),e("div",{id:"dialog-content"},e("slot",null))),(u||!i)&&e("div",{class:{[b]:true}},u?e("slot",{name:b}):e(s,null,e("ic-button",{variant:"tertiary",onClick:()=>this.cancelDialog(),class:"dialog-control-button","data-gets-focus":null},"Cancel"),e("ic-button",{variant:r?"destructive":"primary",onClick:()=>this.confirmDialog(),class:"dialog-control-button","data-gets-focus":""},"Confirm"))))}}watchOpenHandler(){if(this.open){this.dialogOpened()}else{this.fadeIn=false;if(this.resizeObserver!==null){this.resizeObserver.disconnect()}setTimeout((()=>{var i,t;this.dialogRendered=false;(i=this.dialogEl)===null||i===void 0?void 0:i.close();(t=this.sourceElement)===null||t===void 0?void 0:t.focus();this.dialogHeight=0;this.icDialogClosed.emit()}),80)}}disconnectedCallback(){this.removeSlotChangeListener()}componentDidLoad(){this.getInteractiveElements();this.refreshInteractiveElementsOnSlotChange();if(this.open){this.dialogOpened()}!h(this.el,"heading")&&d([{prop:this.heading,propName:"heading"}],"Dialog")}componentDidRender(){document.body.style.overflow=getComputedStyle(this.el).display!=="none"&&this.disableHeightConstraint?"hidden":"auto"}handleKeyboard(i){if(this.dialogRendered){switch(i.key){case"Tab":if(this.onTabKeyPress(i.shiftKey)){i.preventDefault()}break;case"Escape":if(!i.repeat){this.open=false}i.stopImmediatePropagation();break}}}handleClick(i){if(this.dialogEl&&this.closeOnBackdropClick&&i.composedPath().indexOf(this.dialogEl)<=0){const{top:t,height:e,left:s,width:a}=this.dialogEl.getBoundingClientRect();const o=t<=i.clientY&&i.clientY<=t+e&&s<=i.clientX&&i.clientX<=s+a;if(!o){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(){const{dialogRendered:i,disableHeightConstraint:t,fadeIn:s,theme:o}=this;return e(a,{key:"11ce388b78e337682fcd54494a076789d488b86b",class:{"ic-dialog-hidden":!i,"ic-dialog-fade-in":s,"disable-height-constraint":!!t,[`ic-theme-${o}`]:o!=="inherit"}},t?e("div",{class:"backdrop",ref:i=>this.backdropEl=i},this.renderDialog()):this.renderDialog())}get el(){return o(this)}static get watchers(){return{open:["watchOpenHandler"]}}};p.style=g;export{p as ic_dialog};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as i,c as t,h as e,F as s,H as a,g as o}from"./p-8e4e97b4.js";import{c as n}from"./p-f074ef5b.js";import{f as r,u as l,i as h,b as d}from"./p-b40ecf16.js";const c='/*! 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-clear-button)}.content-area{padding:0 var(--ic-space-md);margin:0;overflow-y:auto}#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;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 g=c;const p=class{constructor(a){i(this,a);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.contentAreaMutationObserver=null;this.DATA_GETS_FOCUS="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.IC_CHECKBOX="IC-CHECKBOX";this.IC_SEARCH_BAR="IC-SEARCH-BAR";this.resizeObserver=null;this.dialogRendered=false;this.fadeIn=false;this.closeOnBackdropClick=true;this.destructive=false;this.dismissLabel="Dismiss";this.disableHeightConstraint=false;this.disableWidthConstraint=false;this.hideCloseButton=false;this.hideDefaultControls=false;this.open=false;this.size="small";this.theme="inherit";this.dialogOpened=()=>{var i,t;this.dialogRendered=true;if(this.disableHeightConstraint){(i=this.dialogEl)===null||i===void 0?void 0:i.show()}else{(t=this.dialogEl)===null||t===void 0?void 0:t.showModal()}setTimeout((()=>{this.fadeIn=true;if(this.backdropEl&&this.disableHeightConstraint&&this.backdropEl.scrollTop!==0){this.backdropEl.scrollTop=0}}),10);setTimeout((()=>{this.setInitialFocus();r(this.runResizeObserver)}),75);setTimeout((()=>{this.icDialogOpened.emit()}),80)};this.runResizeObserver=()=>{if(this.dialogEl){this.resizeObserver=new ResizeObserver((()=>{clearTimeout(this.resizeTimeout);this.resizeTimeout=window.setTimeout(this.resizeObserverCallback,80)}));this.resizeObserver.observe(this.dialogEl)}};this.resizeObserverCallback=()=>{if(this.dialogEl&&this.dialogEl.clientHeight!==this.dialogHeight){this.dialogHeight=this.dialogEl.clientHeight}};this.refreshInteractiveElementsOnSlotChange=()=>{var i,t,e;const s=(i=this.el.shadowRoot)===null||i===void 0?void 0:i.querySelector("#dialog-content");if(s){this.contentArea=s.querySelector("slot");(t=this.contentArea)===null||t===void 0?void 0:t.addEventListener("slotchange",this.getInteractiveElements);this.contentAreaMutationObserver=new MutationObserver((()=>{this.getInteractiveElements()}));(e=l(s))===null||e===void 0?void 0:e.forEach((i=>{var t;(t=this.contentAreaMutationObserver)===null||t===void 0?void 0:t.observe(i,{childList:true,subtree:true})}))}};this.removeSlotChangeListener=()=>{var i;if(this.contentArea){this.contentArea.removeEventListener("slotchange",this.getInteractiveElements);(i=this.contentAreaMutationObserver)===null||i===void 0?void 0:i.disconnect()}};this.setInitialFocus=()=>{this.sourceElement=document.activeElement;this.focusedElementIndex=this.interactiveElementList?this.interactiveElementList.findIndex((i=>i.hasAttribute(this.DATA_GETS_FOCUS))):0;this.focusElement(this.interactiveElementList[this.focusedElementIndex])};this.getFocusedElementIndex=()=>{var i;for(let t=0;t<this.interactiveElementList.length;t++){if(this.interactiveElementList[t]===(((i=this.el.shadowRoot)===null||i===void 0?void 0:i.activeElement)||document.activeElement)){this.focusedElementIndex=t}}};this.closeIconClick=()=>{this.open=false};this.getInteractiveElements=()=>{var i;this.interactiveElementList=Array.from(((i=this.el.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll("ic-button"))||[]);const t=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, \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, ic-date-input, ic-date-picker`));if(t.length>0){if(t[0].slot!==this.DIALOG_CONTROLS){t[0].setAttribute(this.DATA_GETS_FOCUS,"")}else if(!this.destructive){t[t.length-1].setAttribute(this.DATA_GETS_FOCUS,"")}}for(let i=0;i<t.length;i++){this.interactiveElementList.splice(1+i,0,t[i])}};this.getNextFocusEl=i=>this.interactiveElementList[i];this.onTabKeyPress=i=>{this.getFocusedElementIndex();if(this.interactiveElementList[this.focusedElementIndex].tagName===this.IC_SEARCH_BAR){return false}this.setFocusIndexBasedOnShiftKey(i);this.loopNextFocusIndexIfLastElement();this.focusElement(this.getNextFocusEl(this.focusedElementIndex),i);return true};this.shouldSkipElement=i=>{const t=getComputedStyle(i).visibility==="hidden"||i.offsetHeight===0||i.hasAttribute("disabled")||i.tagName===this.IC_ACCORDION_GROUP&&i.hasAttribute("single-expansion");const e=i.closest("ic-radio-option");return t||i.getAttribute("type")==="radio"&&!!e&&!e.hasAttribute("selected")};this.focusElement=(i,t=false)=>{let e=i;if(this.shouldSkipElement(i)){this.setFocusIndexBasedOnShiftKey(t);this.loopNextFocusIndexIfLastElement();e=this.getNextFocusEl(this.focusedElementIndex);this.focusElement(e,t)}else{switch(i.tagName){case this.IC_ACCORDION_GROUP:case this.IC_ACCORDION:case this.IC_SEARCH_BAR:case this.IC_TEXT_FIELD:case this.IC_CHECKBOX:i.setFocus();break;default:i.focus()}}};this.renderDialog=()=>{const{hideDefaultControls:i,size:t,heading:a,label:o,destructive:r,dismissLabel:l,hideCloseButton:d,disableHeightConstraint:c,disableWidthConstraint:g,closeIconClick:p,DIALOG_CONTROLS:b}=this;const u=h(this.el,b);return e("dialog",{class:{dialog:true,[`${t}`]:true,"disable-height-constraint":!!c,"disable-width-constraint":!!g},"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"},o))),e("div",{class:"heading"},e("slot",{name:"heading"},e("ic-typography",{variant:"h4",id:"dialog-heading"},a)))),!d&&e("ic-button",{class:"close-icon",variant:"icon",innerHTML:n,"aria-label":l,onClick:p,"data-gets-focus":r||i&&!u?"":null})),e("div",{class:"content-area"},h(this.el,"alert")&&e("slot",{name:"alert"}),e("div",{id:"dialog-content"},e("slot",null))),(u||!i)&&e("div",{class:{[b]:true}},u?e("slot",{name:b}):e(s,null,e("ic-button",{variant:"tertiary",onClick:()=>this.cancelDialog(),class:"dialog-control-button","data-gets-focus":null},"Cancel"),e("ic-button",{variant:r?"destructive":"primary",onClick:()=>this.confirmDialog(),class:"dialog-control-button","data-gets-focus":""},"Confirm"))))}}watchOpenHandler(){if(this.open){this.dialogOpened()}else{this.fadeIn=false;if(this.resizeObserver!==null){this.resizeObserver.disconnect()}setTimeout((()=>{var i,t;this.dialogRendered=false;(i=this.dialogEl)===null||i===void 0?void 0:i.close();(t=this.sourceElement)===null||t===void 0?void 0:t.focus();this.dialogHeight=0;this.icDialogClosed.emit()}),80)}}disconnectedCallback(){this.removeSlotChangeListener()}componentDidLoad(){this.getInteractiveElements();this.refreshInteractiveElementsOnSlotChange();if(this.open){this.dialogOpened()}!h(this.el,"heading")&&d([{prop:this.heading,propName:"heading"}],"Dialog")}componentDidRender(){document.body.style.overflow=getComputedStyle(this.el).display!=="none"&&this.disableHeightConstraint?"hidden":"auto"}handleKeyboard(i){if(this.dialogRendered){switch(i.key){case"Tab":if(this.onTabKeyPress(i.shiftKey)){i.preventDefault()}break;case"Escape":if(!i.repeat){this.open=false}i.stopImmediatePropagation();break}}}handleClick(i){if(this.dialogEl&&this.closeOnBackdropClick&&i.composedPath().indexOf(this.dialogEl)<=0){const{top:t,height:e,left:s,width:a}=this.dialogEl.getBoundingClientRect();const o=t<=i.clientY&&i.clientY<=t+e&&s<=i.clientX&&i.clientX<=s+a;if(!o){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(){const{dialogRendered:i,disableHeightConstraint:t,fadeIn:s,theme:o}=this;return e(a,{key:"e8517bd103f365705b664f80c494df70972dd9c4",class:{"ic-dialog-hidden":!i,"ic-dialog-fade-in":s,"disable-height-constraint":!!t,[`ic-theme-${o}`]:o!=="inherit"}},t?e("div",{class:"backdrop",ref:i=>this.backdropEl=i},this.renderDialog()):this.renderDialog())}get el(){return o(this)}static get watchers(){return{open:["watchOpenHandler"]}}};p.style=g;export{p as ic_dialog};
|
2
|
+
//# sourceMappingURL=p-8da025b5.entry.js.map
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as t,c as i,h as a,F as e,H as o,g as n}from"./p-8e4e97b4.js";import{D as s,g as r,i as c,Q as l,e as d,o as h,f as p,b,M as m,I as f,d as v}from"./p-b40ecf16.js";const g='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;color:var(--ic-top-navigation-text);width:100%;position:relative;--ic-typography-color:var(--ic-top-navigation-text);--ic-button-secondary-text-monochrome:var(--ic-brand-text-color);--ic-button-secondary-border-monochrome:var(--ic-brand-text-color);--navigation-link-colour:var(--ic-top-navigation-text)}:host(.dark){color:var(--ic-color-text-primary-light);--ic-typography-color:var(--ic-color-text-primary-light);--ic-top-navigation-logo:var(--ic-color-icon-neutral);--ic-top-navigation-icon:var(--ic-color-icon-neutral);--ic-top-navigation-icon-and-label:var(--ic-color-text-primary-light);--ic-top-navigation-theme:var(--ic-color-icon-neutral);--ic-top-navigation-status-tag:var(--ic-color-background-primary-dark);--ic-top-navigation-status-tag-text:var(--ic-color-brand-text);--ic-top-navigation-status-tag-secondary:var(--ic-state-layer-darken-10);--ic-top-navigation-title-hover:var(--ic-action-dark-bg-hover);--ic-top-navigation-title-pressed:var(--ic-action-dark-bg-pressed);--navigation-link-colour:var(--ic-color-text-primary-light)}:host(.dark) ::slotted(ic-navigation-button){--ic-button-icon-monochrome:var(--ic-color-text-primary-light)}::slotted(ic-navigation-button){--ic-button-icon-monochrome:white}:host .top-navigation{background-color:var(--ic-top-navigation-background);height:-moz-max-content;height:max-content}:host(.fullwidth-searchbar) slot[name="search"]::slotted(form){width:100%}:host .title-link{display:inline-flex;align-items:center;text-decoration:none;padding:var(--ic-space-xxs);transition:var(--ic-easing-transition-fast)}:host .title-link,:host .title-link:visited,:host .title-link:active,:host .title-link ::slotted(a),:host .title-link:visited ::slotted(a),:host .title-link:active ::slotted(a){color:var(--ic-top-navigation-icon-and-label);text-decoration:none;outline:none}:host .title-link:hover:not(:focus){background-color:var(--ic-top-navigation-title-hover)}:host .title-link:active:not(:focus){background-color:var(--ic-top-navigation-title-pressed)}:host .title-link:hover{border-radius:var(--ic-border-radius)}:host .title-link:focus,:host .title-link:focus-within{border-radius:var(--ic-border-radius);box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline)}:host .title-link ic-typography{font-weight:600}:host .nav-panel-container{border-top:var(--ic-space-1px) solid var(--ic-top-navigation-keyline);padding:0 var(--ic-space-lg);margin-left:calc(-1 * var(--section-container-margin));margin-right:calc(-1 * var(--section-container-margin));display:flex}:host(.dark) .nav-panel-container{border-top:var(--ic-border-keyline-darken)}.top-panel-container{display:flex;padding-top:0.5rem;padding-bottom:0.5rem}.navigation-tabs{margin-top:calc(-1 * var(--ic-space-1px))}.app-details-container{display:flex;align-items:center;flex:1 1 auto;margin-right:var(--ic-space-md)}.app-icon-container{display:flex;padding-right:var(--ic-space-xs)}.icon-buttons-container{display:flex;margin-left:var(--ic-space-md)}.icon-buttons-container ::slotted(nav){display:flex}.title-wrap{overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-word;-webkit-hyphens:auto;hyphens:auto}:host .app-status{border-radius:var(--ic-space-md);background-color:var(--ic-top-navigation-status-tag);color:var(--ic-top-navigation-status-tag-text);--ic-typography-color:var(--ic-top-navigation-status-tag-text);padding:var(--ic-space-xxs) var(--ic-space-lg);margin-left:var(--ic-space-md);flex:1 1 0;max-width:-moz-fit-content;max-width:fit-content}:host .app-version{border-radius:var(--ic-space-md);background-color:var(--ic-top-navigation-status-tag-secondary);color:var(--ic-top-navigation-status-tag);padding:var(--ic-space-xxs) var(--ic-space-sm);margin-left:var(--ic-space-xs);flex:1 1 0;max-width:-moz-fit-content;max-width:fit-content}slot[name="app-icon"]::slotted(*){fill:var(--ic-top-navigation-logo);width:2em;height:2em;cursor:pointer}slot[name="toggle-icon"] svg{fill:var(--ic-top-navigation-icon)}.search-menu-container{justify-content:right;display:flex;align-items:center}.menu-button-container{margin-left:var(--ic-space-md)}.menu-button-container .navigation-landmark-button-text{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}.menu-button-container .navigation-landmark-button-text:dir(rtl){right:-9999px}.search-actions-container{display:flex}.menu-buttons-slot{display:flex;flex-direction:column}.navigation-landmark-text{position:absolute;width:var(--ic-space-1px);height:var(--ic-space-1px);padding:0;margin:calc(-1 * var(--ic-space-1px));overflow:hidden}.navigation-item-list{display:flex;list-style:none;height:2.75rem}.navigation-item-list::-webkit-scrollbar{display:none}:host ic-section-container{padding-bottom:0 !important;padding-top:0 !important}@media screen and (min-width: 993px){.app-details-container{margin-right:var(--ic-space-lg)}}@media screen and (max-width: 1200px){:host .nav-panel-container{padding:0 var(--ic-space-md)}}:host(.mobile-mode) .app-status,:host(.mobile-mode) .app-version{display:none}:host(.mobile-mode) .title-link{margin-right:var(--ic-space-xs)}:host(.mobile-mode) .search-menu-container{max-width:10rem}:host(.mobile-mode) .search-bar-container{display:flex;justify-content:center;align-items:center;border-top:var(--ic-border-keyline-darken);height:4rem;padding-left:var(--ic-space-md);padding-right:var(--ic-space-md);margin-left:calc(-1 * var(--section-container-margin));margin-right:calc(-1 * var(--section-container-margin))}@media screen and (max-width: 576px){:host .title-link{margin-right:var(--ic-space-xxxs);word-break:break-word;-webkit-hyphens:none;hyphens:none}.top-panel-container{min-height:2.5rem}.search-bar-container{margin-top:0;height:3.5rem;padding-left:var(--ic-space-xs);padding-right:var(--ic-space-xs)}.menu-button-container{margin-left:var(--ic-space-sm)}slot[name="app-icon"]::slotted(*){width:1.5em;height:1.5em}slot[name="toggle-icon"] svg{width:1.5em;height:1.5em}}@media (forced-colors: active){:host .top-navigation{border-bottom:var(--ic-border-hc)}.app-status,.app-version{border:var(--ic-border-hc)}slot[name="app-icon"]::slotted(*){fill:currentcolor}slot[name="toggle-icon"] svg{fill:currentcolor}}';const u=g;const y=class{constructor(a){t(this,a);this.icNavigationMenuClosed=i(this,"icNavigationMenuClosed",7);this.icNavigationMenuOpened=i(this,"icNavigationMenuOpened",7);this.icTopNavResized=i(this,"icTopNavResized",7);this.hasAppIcon=false;this.hasAppTitleSlot=false;this.hasIconButtons=false;this.hasNavigation=false;this.hasSearchSlotContent=false;this.resizeObserver=null;this.searchBar=null;this.deviceSize=s.XL;this.foregroundColor=r();this.hasFullWidthSearchBar=false;this.mobileSearchBarVisible=false;this.mobileSearchHiddenOnBlur=false;this.navMenuVisible=false;this.searchButtonClick=false;this.searchValue="";this.contentAligned="full-width";this.customMobileBreakpoint=s.L;this.href="/";this.inline=false;this.shortAppTitle="";this.status="";this.theme="inherit";this.version="";this.checkSlots=()=>{this.hasAppIcon=c(this.el,"app-icon");this.hasAppTitleSlot=c(this.el,"app-title");this.hasNavigation=c(this.el,"navigation");this.hasIconButtons=c(this.el,"buttons");this.hasSearchSlotContent=c(this.el,"search");if(this.hasAppIcon){const t=this.el.querySelector('[slot="app-icon"]');if(t&&t.tagName==="A")t.tabIndex=-1}};this.initialiseSearchBar=()=>{if(!this.hasSearchSlotContent)return;const t=l(this.el,"search");if((t===null||t===void 0?void 0:t.tagName)==="IC-SEARCH-BAR"){this.searchBar=t}else if((t===null||t===void 0?void 0:t.tagName)==="FORM"){this.searchBar=t.querySelector("ic-search-bar")}if(this.searchBar!==null){this.searchBar.hideLabel=true}};this.toggleSearchBar=()=>{var t;this.mobileSearchBarVisible=!this.mobileSearchBarVisible;if(!this.searchBar)return;(t=this.mobileSearchButtonEl)===null||t===void 0?void 0:t.setAttribute("aria-label",`${this.mobileSearchBarVisible?"Hide":"Show"} search`);this.hasFullWidthSearchBar=this.mobileSearchBarVisible;this.searchBar.fullWidth=this.mobileSearchBarVisible;if(this.mobileSearchBarVisible){setTimeout((()=>{var t;(t=this.searchBar)===null||t===void 0?void 0:t.focus()}),100)}};this.menuButtonClick=()=>{this.showNavMenu(true)};this.showNavMenu=t=>{this.navMenuVisible=t;(t?this.icNavigationMenuOpened:this.icNavigationMenuClosed).emit();document.body.style.height=t?"100%":"auto";document.body.style.overflow=t?"hidden":"auto"};this.searchButtonMouseDownHandler=()=>{this.searchButtonClick=true};this.searchButtonClickHandler=()=>{this.toggleSearchBar();this.searchButtonClick=false};this.resizeObserverCallback=t=>{if(t===this.deviceSize)return;this.deviceSize=t;if(t>this.customMobileBreakpoint){this.showNavMenu(false);if(this.mobileSearchBarVisible){this.toggleSearchBar()}}this.icTopNavResized.emit({size:t});if(this.searchBar&&document.activeElement===this.searchBar){this.searchBar.setAttribute("hidden","true");this.searchBar.removeAttribute("hidden");setTimeout((()=>{var t;(t=this.searchBar)===null||t===void 0?void 0:t.focus()}),100)}};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.resizeObserverCallback(d())}));this.resizeObserver.observe(this.el)}}watchPropHandler(t,i){h(i,t,this.initialiseSearchBar)}disconnectedCallback(){var t;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect()}componentWillLoad(){this.checkSlots();this.deviceSize=d();this.initialiseSearchBar()}componentDidLoad(){p(this.runResizeObserver);if(!this.hasAppTitleSlot){b([{prop:this.appTitle,propName:"app-title"}],"Top Navigation")}}componentWillRender(){this.checkSlots()}navBarMenuCloseHandler(){var t;this.showNavMenu(false);(t=this.menuButtonEl)===null||t===void 0?void 0:t.setFocus()}searchInputBlurHandler({detail:t}){if(t!==null){if(this.mobileSearchBarVisible&&!this.searchButtonClick){this.toggleSearchBar()}this.searchValue=t.value}}searchValueChangeHandler({detail:t}){this.searchValue=t.value}brandChangeHandler({detail:t}){this.foregroundColor=t.mode}render(){const{appTitle:t,contentAligned:i,customMobileBreakpoint:n,deviceSize:r,el:l,foregroundColor:d,hasAppIcon:h,hasAppTitleSlot:p,hasFullWidthSearchBar:b,hasIconButtons:g,hasNavigation:u,hasSearchSlotContent:y,href:k,inline:x,menuButtonClick:w,mobileSearchBarVisible:z,navMenuVisible:H,searchButtonClickHandler:M,searchButtonMouseDownHandler:C,shortAppTitle:B,status:S,version:T,theme:j}=this;const A=S!=="";const $=T!=="";const I=u||g||A||$;const N=r<=s.S;const R=N?"medium":"large";const V=t!==""&&v(t);const O=r<=n;const D=O?N?"subtitle-small":"h4":"h3";const L=`${z?"Hide":"Show"} search`;const F=N?"small":"medium";const W=c(l,"short-app-title");const q=p?"div":"a";const P=q=="a"&&{href:k};return a(o,{key:"04ae428a97e2c58967096b74d112eaff245f8dff",class:{"fullwidth-searchbar":b,"mobile-mode":O,[f.Dark]:d===f.Dark,[`ic-theme-${j}`]:j!=="inherit"}},a("div",{key:"567b43f0ff4239ec947520f1b3cfdca5f248a273",class:"top-navigation"},a("ic-section-container",{key:"de93c750d52edcafbf52b45f35adeb6547a68b7b",aligned:i,"full-height":true},a("header",{key:"70f3227f015418d9fa82e64786a0b6c9543b3bee",role:"banner"},a("div",{key:"cd42a8c33f9baef9566f2fea19d3e9462f4e067a",class:"top-panel-container"},a("div",{key:"192dbc95a46ffb8d06a7f55258e791a149003bd4",class:"app-details-container"},(V||p)&&a(q,Object.assign({key:"434d3d4de2d251752145200352425032692fc1cd",class:"title-link"},P),h&&a("div",{key:"6f3d2089eb16b717946baa082706beb46f04657d",class:"app-icon-container"},a("slot",{key:"0daa4b46d9e2d72aa1c68e62279e5a3389ec3ab2",name:"app-icon"})),N&&(!m(B)||W)?a("ic-typography",{variant:"subtitle-small","aria-label":(!p||!W)&&`${t} (${B})`},a("h1",null,W?a("slot",{name:"short-app-title"}):B)):a("ic-typography",{variant:D},a("h1",{class:"title-wrap"},p?a("slot",{name:"app-title"}):t))),A&&a("div",{key:"83a440ebcedf586a87690b57ea9ecfce1495ceb7",class:"app-status"},a("ic-typography",{key:"0889ee69e31b3665821b286915a43e253fd66c1a","aria-label":"app tag",variant:"label-uppercase",class:"app-status-text"},S)),$&&a("div",{key:"542d3f22383d5bac8eda47fcd47ef694f054929b",class:"app-version"},a("ic-typography",{key:"0ed2b7209b4f03da9d462ac1406d3530696b702c",variant:"label",class:"app-version-text","aria-label":"app version"},T))),(y||I)&&a("div",{key:"dbc3439b52e9d9257fc1c98ad50e25e92140ceca",class:"search-menu-container"},a("div",{key:"3f5b5d05659459daab6d0bcbd69dd0ac70eae0f8",class:"search-actions-container"},!O?a(e,null,a("slot",{name:"search"}),g&&a("div",{class:"icon-buttons-container"},a("slot",{name:"buttons"}))):a(e,null,y&&a("ic-button",{id:"search-toggle-button",ref:t=>this.mobileSearchButtonEl=t,onMouseDown:C,variant:"icon-tertiary",monochrome:true,size:R,"aria-label":L,theme:d,onClick:M},a("slot",{name:"toggle-icon"},a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#ffffff"},a("path",{d:"M0 0h24v24H0V0z",fill:"none"}),a("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})))),I&&a("div",{class:"menu-button-container"},a("span",{id:"navigation-landmark-button-text",class:"navigation-landmark-button-text","aria-hidden":"true"},"Main navigation button"),a("nav",{"aria-labelledby":"navigation-landmark-button-text","aria-hidden":`${H}`},a("ic-button",{id:"menu-button",ref:t=>this.menuButtonEl=t,theme:d,variant:"secondary",monochrome:true,"aria-expanded":"false","aria-haspopup":"true","aria-label":`Open ${u?"navigation":"app"} menu`,size:F,onClick:w},"Menu",a("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#ffffff",slot:"left-icon"},a("path",{d:"M0 0h24v24H0V0z",fill:"none"}),a("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}))))))))),z&&a("div",{key:"b3f55a4e18ef3c55503b56447d5fbeb19e569a4f",class:"search-bar-container"},a("slot",{key:"99ebca2aa04bf76d949384c517dc2012312dbd92",name:"search"})),u&&!O&&a("div",{key:"6113dfcd92cf06c1f9a533ec6c2f0af3d26abca7",class:"navigation-tabs"},a("span",{key:"fa638d34955dccbdb7a8f149e0a8e083e3df0f72",id:"navigation-landmark-text",class:"navigation-landmark-text","aria-hidden":"true"},"Main pages"),a("nav",{key:"fc6e24c76b720a463e81dbbe00c91a065bb260ea","aria-labelledby":"navigation-landmark-text",class:"nav-panel-container"},a("ic-horizontal-scroll",{key:"da133fd91d91ff172067fc9aad86651a4c3a2f95",monochrome:true,appearance:d},a("ul",{key:"f48330caa3937f35f2f65a3fbad830bda2b5c342",class:"navigation-item-list",tabindex:"-1"},a("slot",{key:"74eb909d405109d5387f42e00a633e8ed09ff6f6",name:"navigation"})))))))),H&&a("ic-navigation-menu",{key:"c77d988d1af3ac37eebb5d598b5f649f1d47c899",version:T,status:S,class:{inline:x}},g&&a("div",{key:"77d9283a5fdffa724e13f667e9d09ae72f72329e",class:"menu-buttons-slot",slot:"buttons"},a("slot",{key:"020b485ca53e55926b072738ab7dcb465f1efce5",name:"buttons"})),a("ul",{key:"16101ca81c95d2de0d55c7a051ccffd5a987f5f8",slot:"navigation"},a("slot",{key:"02bde8c67591e4c2c15d005252f1f7ae87cff61a",name:"navigation"}))))}get el(){return n(this)}static get watchers(){return{appTitle:["watchPropHandler"]}}};y.style=u;export{y as ic_top_navigation};
|
2
|
+
//# sourceMappingURL=p-990c37aa.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["icTopNavigationCss","IcTopNavigationStyle0","TopNavigation","constructor","hostRef","this","hasAppIcon","hasAppTitleSlot","hasIconButtons","hasNavigation","hasSearchSlotContent","resizeObserver","searchBar","deviceSize","DEVICE_SIZES","XL","foregroundColor","getBrandForegroundAppearance","hasFullWidthSearchBar","mobileSearchBarVisible","mobileSearchHiddenOnBlur","navMenuVisible","searchButtonClick","searchValue","contentAligned","customMobileBreakpoint","L","href","inline","shortAppTitle","status","theme","version","checkSlots","isSlotUsed","el","slottedAppIcon","querySelector","tagName","tabIndex","initialiseSearchBar","slot","getSlot","hideLabel","toggleSearchBar","_a","mobileSearchButtonEl","setAttribute","fullWidth","setTimeout","focus","menuButtonClick","showNavMenu","show","icNavigationMenuOpened","icNavigationMenuClosed","emit","document","body","style","height","overflow","searchButtonMouseDownHandler","searchButtonClickHandler","resizeObserverCallback","currSize","icTopNavResized","size","activeElement","removeAttribute","runResizeObserver","ResizeObserver","getCurrentDeviceSize","observe","watchPropHandler","newValue","oldValue","onComponentPropUndefinedChange","disconnectedCallback","disconnect","componentWillLoad","componentDidLoad","checkResizeObserver","onComponentRequiredPropUndefined","prop","appTitle","propName","componentWillRender","navBarMenuCloseHandler","menuButtonEl","setFocus","searchInputBlurHandler","detail","value","searchValueChangeHandler","brandChangeHandler","mode","render","hasStatus","hasVersion","hasMenuContent","isSmallDeviceSize","S","searchButtonSize","hasTitle","isPropDefined","overMobileBreakpoint","appTitleVariant","mobileSearchButtonTitle","menuSize","shortAppTitleSlot","Component","attrs","h","Host","key","class","IcBrandForegroundEnum","Dark","aligned","role","Object","assign","name","isEmptyString","variant","Fragment","id","ref","onMouseDown","monochrome","onClick","xmlns","viewBox","fill","d","width","appearance","tabindex"],"sources":["src/components/ic-top-navigation/ic-top-navigation.css?tag=ic-top-navigation&encapsulation=shadow","src/components/ic-top-navigation/ic-top-navigation.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n color: var(--ic-top-navigation-text);\n width: 100%;\n position: relative;\n\n --ic-typography-color: var(--ic-top-navigation-text);\n --ic-button-secondary-text-monochrome: var(--ic-brand-text-color);\n --ic-button-secondary-border-monochrome: var(--ic-brand-text-color);\n --navigation-link-colour: var(--ic-top-navigation-text);\n}\n\n:host(.dark) {\n color: var(--ic-color-text-primary-light);\n\n --ic-typography-color: var(--ic-color-text-primary-light);\n --ic-top-navigation-logo: var(--ic-color-icon-neutral);\n --ic-top-navigation-icon: var(--ic-color-icon-neutral);\n --ic-top-navigation-icon-and-label: var(--ic-color-text-primary-light);\n --ic-top-navigation-theme: var(--ic-color-icon-neutral);\n --ic-top-navigation-status-tag: var(--ic-color-background-primary-dark);\n --ic-top-navigation-status-tag-text: var(--ic-color-brand-text);\n --ic-top-navigation-status-tag-secondary: var(--ic-state-layer-darken-10);\n --ic-top-navigation-title-hover: var(--ic-action-dark-bg-hover);\n --ic-top-navigation-title-pressed: var(--ic-action-dark-bg-pressed);\n --navigation-link-colour: var(--ic-color-text-primary-light);\n}\n\n:host(.dark) ::slotted(ic-navigation-button) {\n --ic-button-icon-monochrome: var(--ic-color-text-primary-light);\n}\n\n::slotted(ic-navigation-button) {\n --ic-button-icon-monochrome: white;\n}\n\n:host .top-navigation {\n background-color: var(--ic-top-navigation-background);\n height: max-content;\n}\n\n:host(.fullwidth-searchbar) slot[name=\"search\"]::slotted(form) {\n width: 100%;\n}\n\n:host .title-link {\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n padding: var(--ic-space-xxs);\n transition: var(--ic-easing-transition-fast);\n}\n\n:host .title-link,\n:host .title-link:visited,\n:host .title-link:active,\n:host .title-link ::slotted(a),\n:host .title-link:visited ::slotted(a),\n:host .title-link:active ::slotted(a) {\n color: var(--ic-top-navigation-icon-and-label);\n text-decoration: none;\n outline: none;\n}\n\n:host .title-link:hover:not(:focus) {\n background-color: var(--ic-top-navigation-title-hover);\n}\n\n:host .title-link:active:not(:focus) {\n background-color: var(--ic-top-navigation-title-pressed);\n}\n\n:host .title-link:hover {\n border-radius: var(--ic-border-radius);\n}\n\n:host .title-link:focus,\n:host .title-link:focus-within {\n border-radius: var(--ic-border-radius);\n box-shadow: var(--ic-border-focus);\n outline: var(--ic-hc-focus-outline);\n}\n\n:host .title-link ic-typography {\n font-weight: 600;\n}\n\n:host .nav-panel-container {\n border-top: var(--ic-space-1px) solid var(--ic-top-navigation-keyline);\n padding: 0 var(--ic-space-lg);\n margin-left: calc(-1 * var(--section-container-margin));\n margin-right: calc(-1 * var(--section-container-margin));\n display: flex;\n}\n\n:host(.dark) .nav-panel-container {\n border-top: var(--ic-border-keyline-darken);\n}\n\n.top-panel-container {\n display: flex;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n.navigation-tabs {\n margin-top: calc(-1 * var(--ic-space-1px));\n}\n\n.app-details-container {\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n margin-right: var(--ic-space-md);\n}\n\n.app-icon-container {\n display: flex;\n padding-right: var(--ic-space-xs);\n}\n\n.icon-buttons-container {\n display: flex;\n margin-left: var(--ic-space-md);\n}\n\n.icon-buttons-container ::slotted(nav) {\n display: flex;\n}\n\n.title-wrap {\n overflow-wrap: break-word;\n word-wrap: break-word;\n -ms-word-break: break-all;\n word-break: break-word;\n hyphens: auto;\n}\n\n:host .app-status {\n border-radius: var(--ic-space-md);\n background-color: var(--ic-top-navigation-status-tag);\n color: var(--ic-top-navigation-status-tag-text);\n\n --ic-typography-color: var(--ic-top-navigation-status-tag-text);\n\n padding: var(--ic-space-xxs) var(--ic-space-lg);\n margin-left: var(--ic-space-md);\n flex: 1 1 0;\n max-width: fit-content;\n}\n\n:host .app-version {\n border-radius: var(--ic-space-md);\n background-color: var(--ic-top-navigation-status-tag-secondary);\n color: var(--ic-top-navigation-status-tag);\n padding: var(--ic-space-xxs) var(--ic-space-sm);\n margin-left: var(--ic-space-xs);\n flex: 1 1 0;\n max-width: fit-content;\n}\n\nslot[name=\"app-icon\"]::slotted(*) {\n fill: var(--ic-top-navigation-logo);\n width: 2em;\n height: 2em;\n cursor: pointer;\n}\n\nslot[name=\"toggle-icon\"] svg {\n fill: var(--ic-top-navigation-icon);\n}\n\n.search-menu-container {\n justify-content: right;\n display: flex;\n align-items: center;\n}\n\n.menu-button-container {\n margin-left: var(--ic-space-md);\n}\n\n.menu-button-container .navigation-landmark-button-text {\n position: absolute;\n left: -9999px;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n}\n\n.menu-button-container .navigation-landmark-button-text:dir(rtl) {\n right: -9999px;\n}\n\n.search-actions-container {\n display: flex;\n}\n\n.menu-buttons-slot {\n display: flex;\n flex-direction: column;\n}\n\n.navigation-landmark-text {\n position: absolute;\n width: var(--ic-space-1px);\n height: var(--ic-space-1px);\n padding: 0;\n margin: calc(-1 * var(--ic-space-1px));\n overflow: hidden;\n}\n\n.navigation-item-list {\n display: flex;\n list-style: none;\n height: 2.75rem;\n}\n\n.navigation-item-list::-webkit-scrollbar {\n display: none;\n}\n\n:host ic-section-container {\n padding-bottom: 0 !important;\n padding-top: 0 !important;\n}\n\n@media screen and (min-width: 993px) {\n .app-details-container {\n margin-right: var(--ic-space-lg);\n }\n}\n\n/* large */\n@media screen and (max-width: 1200px) {\n :host .nav-panel-container {\n padding: 0 var(--ic-space-md);\n }\n}\n\n/** Mobile styling **/\n:host(.mobile-mode) .app-status,\n:host(.mobile-mode) .app-version {\n display: none;\n}\n\n:host(.mobile-mode) .title-link {\n margin-right: var(--ic-space-xs);\n}\n\n:host(.mobile-mode) .search-menu-container {\n max-width: 10rem;\n}\n\n:host(.mobile-mode) .search-bar-container {\n display: flex;\n justify-content: center;\n align-items: center;\n border-top: var(--ic-border-keyline-darken);\n height: 4rem;\n padding-left: var(--ic-space-md);\n padding-right: var(--ic-space-md);\n margin-left: calc(-1 * var(--section-container-margin));\n margin-right: calc(-1 * var(--section-container-margin));\n}\n\n/* x small */\n@media screen and (max-width: 576px) {\n :host .title-link {\n margin-right: var(--ic-space-xxxs);\n word-break: break-word;\n hyphens: none;\n }\n\n .top-panel-container {\n min-height: 2.5rem;\n }\n\n .search-bar-container {\n margin-top: 0;\n height: 3.5rem;\n padding-left: var(--ic-space-xs);\n padding-right: var(--ic-space-xs);\n }\n\n .menu-button-container {\n margin-left: var(--ic-space-sm);\n }\n\n slot[name=\"app-icon\"]::slotted(*) {\n width: 1.5em;\n height: 1.5em;\n }\n\n slot[name=\"toggle-icon\"] svg {\n width: 1.5em;\n height: 1.5em;\n }\n}\n\n@media (forced-colors: active) {\n :host .top-navigation {\n border-bottom: var(--ic-border-hc);\n }\n\n .app-status,\n .app-version {\n border: var(--ic-border-hc);\n }\n\n slot[name=\"app-icon\"]::slotted(*) {\n fill: currentcolor;\n }\n\n slot[name=\"toggle-icon\"] svg {\n fill: currentcolor;\n }\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n State,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Fragment,\n} from \"@stencil/core\";\n\nimport {\n IcTypographyVariants,\n IcAlignment,\n IcBrandForeground,\n IcBrandForegroundEnum,\n IcBrand,\n IcDeviceSizes,\n IcValueEventDetail,\n IcThemeMode,\n} from \"../../utils/types\";\nimport {\n checkResizeObserver,\n DEVICE_SIZES,\n getCurrentDeviceSize,\n getBrandForegroundAppearance,\n getSlot,\n onComponentPropUndefinedChange,\n onComponentRequiredPropUndefined,\n isSlotUsed,\n isEmptyString,\n isPropDefined,\n} from \"../../utils/helpers\";\nimport { IcSearchBarBlurEventDetail } from \"../ic-search-bar/ic-search-bar.types\";\n\n/**\n * @slot app-icon - Content will be rendered to left of app title. Anything that is slotted here will be hidden from screen readers.\n * @slot app-title - Handle routing by nesting a route in the app title.\n * @slot short-app-title - Handle routing by nesting a route in the short app title (to be displayed in place of app title on small screen sizes).\n * @slot search - Content will be rendered in search area to left of buttons.\n * @slot toggle-icon - Icon to be displayed on the button to toggle search slot content on smaller devices\n * @slot navigation - Content will be rendered in navigation panel.\n * @slot buttons - Content will be rendered to right of search bar.\n */\n@Component({\n tag: \"ic-top-navigation\",\n styleUrl: \"ic-top-navigation.css\",\n shadow: true,\n})\nexport class TopNavigation {\n private hasAppIcon = false;\n private hasAppTitleSlot = false;\n private hasIconButtons = false;\n private hasNavigation = false;\n private hasSearchSlotContent = false;\n private mobileSearchButtonEl?: HTMLIcButtonElement;\n private resizeObserver: ResizeObserver | null = null;\n private searchBar: HTMLIcSearchBarElement | null = null;\n private menuButtonEl?: HTMLIcButtonElement;\n\n @Element() el: HTMLIcTopNavigationElement;\n\n @State() deviceSize: number = DEVICE_SIZES.XL;\n @State() foregroundColor: IcBrandForeground = getBrandForegroundAppearance();\n @State() hasFullWidthSearchBar = false;\n @State() mobileSearchBarVisible = false;\n @State() mobileSearchHiddenOnBlur = false;\n @State() navMenuVisible = false;\n @State() searchButtonClick = false;\n @State() searchValue = \"\";\n\n /**\n * The alignment of the top navigation content.\n */\n @Prop() contentAligned: IcAlignment = \"full-width\";\n /**\n * Can set a custom breakpoint for the top navigation to switch to mobile mode.\n * Must be one of our specified breakpoints in px: `0`, `576`, `768`, `992`, `1200`.\n */\n @Prop() customMobileBreakpoint: IcDeviceSizes = DEVICE_SIZES.L;\n /**\n * The URL to navigate to when the app title is clicked.\n */\n @Prop() href = \"/\";\n\n /**\n * If `true`, the flyout navigation menu on small devices will be contained by the parent element.\n */\n @Prop() inline = false;\n\n /**\n * The short title of the app to be displayed at small screen sizes in place of the app title.\n */\n @Prop() shortAppTitle = \"\";\n\n /**\n * The status info to be displayed.\n */\n @Prop() status = \"\";\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 * The version info to be displayed.\n */\n @Prop() version = \"\";\n\n /**\n * The app title to be displayed. This is required, unless a slotted app title link is used.\n */\n @Prop() appTitle?: string;\n @Watch(\"appTitle\")\n watchPropHandler(newValue: string, oldValue: string): void {\n //added for Gatsby rehydration issue where prop is initially undefined but then changes to actual value\n //this watch can be removed once Gatsby hydration issue is resolved\n onComponentPropUndefinedChange(\n oldValue,\n newValue,\n this.initialiseSearchBar\n );\n }\n\n /**\n * @internal - Emitted when the menu is closed.\n */\n @Event() icNavigationMenuClosed: EventEmitter<void>;\n\n /**\n * @internal - Emitted when the menu is opened.\n */\n @Event() icNavigationMenuOpened: EventEmitter<void>;\n\n /**\n * Emitted when the top navigation is resized.\n */\n @Event() icTopNavResized: EventEmitter<{ size: number }>;\n\n disconnectedCallback(): void {\n this.resizeObserver?.disconnect();\n }\n\n componentWillLoad(): void {\n this.checkSlots();\n this.deviceSize = getCurrentDeviceSize();\n this.initialiseSearchBar();\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n if (!this.hasAppTitleSlot) {\n onComponentRequiredPropUndefined(\n [{ prop: this.appTitle, propName: \"app-title\" }],\n \"Top Navigation\"\n );\n }\n }\n\n componentWillRender(): void {\n this.checkSlots();\n }\n\n @Listen(\"icNavigationMenuClose\", {})\n navBarMenuCloseHandler(): void {\n this.showNavMenu(false);\n this.menuButtonEl?.setFocus();\n }\n\n @Listen(\"icSearchBarBlur\", {})\n searchInputBlurHandler({\n detail,\n }: CustomEvent<IcSearchBarBlurEventDetail>): void {\n if (detail !== null) {\n if (this.mobileSearchBarVisible && !this.searchButtonClick) {\n //don't hide if blur was triggered by click on search button - let the click handler toggle the state\n this.toggleSearchBar();\n }\n this.searchValue = detail.value as string;\n }\n }\n\n @Listen(\"icChange\", {})\n searchValueChangeHandler({ detail }: CustomEvent<IcValueEventDetail>): void {\n this.searchValue = detail.value;\n }\n\n @Listen(\"brandChange\", { target: \"document\" })\n brandChangeHandler({ detail }: CustomEvent<IcBrand>): void {\n this.foregroundColor = detail.mode;\n }\n\n private checkSlots = () => {\n this.hasAppIcon = isSlotUsed(this.el, \"app-icon\");\n this.hasAppTitleSlot = isSlotUsed(this.el, \"app-title\");\n this.hasNavigation = isSlotUsed(this.el, \"navigation\");\n this.hasIconButtons = isSlotUsed(this.el, \"buttons\");\n this.hasSearchSlotContent = isSlotUsed(this.el, \"search\");\n\n if (this.hasAppIcon) {\n const slottedAppIcon =\n this.el.querySelector<HTMLElement>('[slot=\"app-icon\"]');\n if (slottedAppIcon && slottedAppIcon.tagName === \"A\")\n slottedAppIcon.tabIndex = -1;\n }\n };\n\n private initialiseSearchBar = () => {\n if (!this.hasSearchSlotContent) return;\n\n const slot = getSlot(this.el, \"search\");\n if (slot?.tagName === \"IC-SEARCH-BAR\") {\n this.searchBar = slot as HTMLIcSearchBarElement;\n } else if (slot?.tagName === \"FORM\") {\n this.searchBar = slot.querySelector(\"ic-search-bar\");\n }\n\n if (this.searchBar !== null) {\n this.searchBar.hideLabel = true;\n }\n };\n\n private toggleSearchBar = () => {\n this.mobileSearchBarVisible = !this.mobileSearchBarVisible;\n\n if (!this.searchBar) return;\n\n this.mobileSearchButtonEl?.setAttribute(\n \"aria-label\",\n `${this.mobileSearchBarVisible ? \"Hide\" : \"Show\"} search`\n );\n this.hasFullWidthSearchBar = this.mobileSearchBarVisible;\n this.searchBar.fullWidth = this.mobileSearchBarVisible;\n if (this.mobileSearchBarVisible) {\n setTimeout(() => {\n this.searchBar?.focus();\n }, 100);\n }\n };\n\n private menuButtonClick = () => {\n this.showNavMenu(true);\n };\n\n private showNavMenu = (show: boolean) => {\n this.navMenuVisible = show;\n (show ? this.icNavigationMenuOpened : this.icNavigationMenuClosed).emit();\n document.body.style.height = show ? \"100%\" : \"auto\";\n document.body.style.overflow = show ? \"hidden\" : \"auto\";\n };\n\n private searchButtonMouseDownHandler = () => {\n this.searchButtonClick = true;\n };\n\n private searchButtonClickHandler = () => {\n this.toggleSearchBar();\n this.searchButtonClick = false;\n };\n\n private resizeObserverCallback = (currSize: number) => {\n if (currSize === this.deviceSize) return;\n\n this.deviceSize = currSize;\n if (currSize > this.customMobileBreakpoint) {\n this.showNavMenu(false);\n if (this.mobileSearchBarVisible) {\n this.toggleSearchBar();\n }\n }\n this.icTopNavResized.emit({\n size: currSize,\n });\n if (this.searchBar && document.activeElement === this.searchBar) {\n this.searchBar.setAttribute(\"hidden\", \"true\");\n //remove attribute again as this trigger a redraw & applies css\n this.searchBar.removeAttribute(\"hidden\");\n setTimeout(() => {\n this.searchBar?.focus();\n }, 100);\n }\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.resizeObserverCallback(getCurrentDeviceSize());\n });\n\n this.resizeObserver.observe(this.el);\n };\n\n render() {\n const {\n appTitle,\n contentAligned,\n customMobileBreakpoint,\n deviceSize,\n el,\n foregroundColor,\n hasAppIcon,\n hasAppTitleSlot,\n hasFullWidthSearchBar,\n hasIconButtons,\n hasNavigation,\n hasSearchSlotContent,\n href,\n inline,\n menuButtonClick,\n mobileSearchBarVisible,\n navMenuVisible,\n searchButtonClickHandler,\n searchButtonMouseDownHandler,\n shortAppTitle,\n status,\n version,\n theme,\n } = this;\n\n const hasStatus = status !== \"\";\n const hasVersion = version !== \"\";\n const hasMenuContent =\n hasNavigation || hasIconButtons || hasStatus || hasVersion;\n\n const isSmallDeviceSize = deviceSize <= DEVICE_SIZES.S;\n\n const searchButtonSize = isSmallDeviceSize ? \"medium\" : \"large\";\n const hasTitle = appTitle !== \"\" && isPropDefined(appTitle);\n const overMobileBreakpoint = deviceSize <= customMobileBreakpoint;\n\n const appTitleVariant: IcTypographyVariants = overMobileBreakpoint\n ? isSmallDeviceSize\n ? \"subtitle-small\"\n : \"h4\"\n : \"h3\";\n\n const mobileSearchButtonTitle = `${\n mobileSearchBarVisible ? \"Hide\" : \"Show\"\n } search`;\n const menuSize = isSmallDeviceSize ? \"small\" : \"medium\";\n\n const shortAppTitleSlot = isSlotUsed(el, \"short-app-title\");\n const Component = hasAppTitleSlot ? \"div\" : \"a\";\n const attrs = Component == \"a\" && {\n href: href,\n };\n\n return (\n <Host\n class={{\n \"fullwidth-searchbar\": hasFullWidthSearchBar,\n \"mobile-mode\": overMobileBreakpoint,\n [IcBrandForegroundEnum.Dark]:\n foregroundColor === IcBrandForegroundEnum.Dark,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n >\n <div class=\"top-navigation\">\n <ic-section-container aligned={contentAligned} full-height>\n <header role=\"banner\">\n <div class=\"top-panel-container\">\n <div class=\"app-details-container\">\n {(hasTitle || hasAppTitleSlot) && (\n <Component class=\"title-link\" {...attrs}>\n {hasAppIcon && (\n <div class=\"app-icon-container\">\n <slot name=\"app-icon\" />\n </div>\n )}\n {isSmallDeviceSize &&\n (!isEmptyString(shortAppTitle) || shortAppTitleSlot) ? (\n <ic-typography\n variant=\"subtitle-small\"\n aria-label={\n (!hasAppTitleSlot || !shortAppTitleSlot) &&\n `${appTitle} (${shortAppTitle})`\n }\n >\n <h1>\n {shortAppTitleSlot ? (\n <slot name=\"short-app-title\"></slot>\n ) : (\n shortAppTitle\n )}\n </h1>\n </ic-typography>\n ) : (\n <ic-typography variant={appTitleVariant}>\n <h1 class=\"title-wrap\">\n {hasAppTitleSlot ? (\n <slot name=\"app-title\"></slot>\n ) : (\n appTitle\n )}\n </h1>\n </ic-typography>\n )}\n </Component>\n )}\n {hasStatus && (\n <div class=\"app-status\">\n <ic-typography\n aria-label=\"app tag\"\n variant=\"label-uppercase\"\n class=\"app-status-text\"\n >\n {status}\n </ic-typography>\n </div>\n )}\n {hasVersion && (\n <div class=\"app-version\">\n <ic-typography\n variant=\"label\"\n class=\"app-version-text\"\n aria-label=\"app version\"\n >\n {version}\n </ic-typography>\n </div>\n )}\n </div>\n\n {(hasSearchSlotContent || hasMenuContent) && (\n <div class=\"search-menu-container\">\n <div class=\"search-actions-container\">\n {!overMobileBreakpoint ? (\n <Fragment>\n <slot name=\"search\"></slot>\n {hasIconButtons && (\n <div class=\"icon-buttons-container\">\n <slot name=\"buttons\"></slot>\n </div>\n )}\n </Fragment>\n ) : (\n <Fragment>\n {hasSearchSlotContent && (\n <ic-button\n id=\"search-toggle-button\"\n ref={(el) => (this.mobileSearchButtonEl = el)}\n onMouseDown={searchButtonMouseDownHandler}\n variant=\"icon-tertiary\"\n monochrome\n size={searchButtonSize}\n aria-label={mobileSearchButtonTitle}\n theme={foregroundColor as IcThemeMode}\n onClick={searchButtonClickHandler}\n >\n <slot name=\"toggle-icon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"#ffffff\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\" />\n </svg>\n </slot>\n </ic-button>\n )}\n {hasMenuContent && (\n <div class=\"menu-button-container\">\n <span\n id=\"navigation-landmark-button-text\"\n class=\"navigation-landmark-button-text\"\n aria-hidden=\"true\"\n >\n Main navigation button\n </span>\n <nav\n aria-labelledby=\"navigation-landmark-button-text\"\n aria-hidden={`${navMenuVisible}`}\n >\n <ic-button\n id=\"menu-button\"\n ref={(el) => (this.menuButtonEl = el)}\n theme={foregroundColor as IcThemeMode}\n variant=\"secondary\"\n monochrome\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n aria-label={`Open ${\n hasNavigation ? \"navigation\" : \"app\"\n } menu`}\n size={menuSize}\n onClick={menuButtonClick}\n >\n Menu\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"#ffffff\"\n slot=\"left-icon\"\n >\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\" />\n <path d=\"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z\" />\n </svg>\n </ic-button>\n </nav>\n </div>\n )}\n </Fragment>\n )}\n </div>\n </div>\n )}\n </div>\n\n {mobileSearchBarVisible && (\n <div class=\"search-bar-container\">\n <slot name=\"search\"></slot>\n </div>\n )}\n\n {hasNavigation && !overMobileBreakpoint && (\n <div class=\"navigation-tabs\">\n <span\n id=\"navigation-landmark-text\"\n class=\"navigation-landmark-text\"\n aria-hidden=\"true\"\n >\n Main pages\n </span>\n <nav\n aria-labelledby=\"navigation-landmark-text\"\n class=\"nav-panel-container\"\n >\n <ic-horizontal-scroll\n monochrome\n appearance={foregroundColor}\n >\n <ul class=\"navigation-item-list\" tabindex=\"-1\">\n <slot name=\"navigation\"></slot>\n </ul>\n </ic-horizontal-scroll>\n </nav>\n </div>\n )}\n </header>\n </ic-section-container>\n </div>\n {navMenuVisible && (\n <ic-navigation-menu\n version={version}\n status={status}\n class={{\n inline,\n }}\n >\n {hasIconButtons && (\n <div class=\"menu-buttons-slot\" slot=\"buttons\">\n <slot name=\"buttons\"></slot>\n </div>\n )}\n <ul slot=\"navigation\">\n <slot name=\"navigation\"></slot>\n </ul>\n </ic-navigation-menu>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"4KAAA,MAAMA,EAAqB,26QAC3B,MAAAC,EAAeD,E,MCmDFE,EAAa,MAL1B,WAAAC,CAAAC,G,yLAMUC,KAAAC,WAAa,MACbD,KAAAE,gBAAkB,MAClBF,KAAAG,eAAiB,MACjBH,KAAAI,cAAgB,MAChBJ,KAAAK,qBAAuB,MAEvBL,KAAAM,eAAwC,KACxCN,KAAAO,UAA2C,KAK1CP,KAAAQ,WAAqBC,EAAaC,GAClCV,KAAAW,gBAAqCC,IACrCZ,KAAAa,sBAAwB,MACxBb,KAAAc,uBAAyB,MACzBd,KAAAe,yBAA2B,MAC3Bf,KAAAgB,eAAiB,MACjBhB,KAAAiB,kBAAoB,MACpBjB,KAAAkB,YAAc,GAKflB,KAAAmB,eAA8B,aAK9BnB,KAAAoB,uBAAwCX,EAAaY,EAIrDrB,KAAAsB,KAAO,IAKPtB,KAAAuB,OAAS,MAKTvB,KAAAwB,cAAgB,GAKhBxB,KAAAyB,OAAS,GAKTzB,KAAA0B,MAAqB,UAKrB1B,KAAA2B,QAAU,GAqFV3B,KAAA4B,WAAa,KACnB5B,KAAKC,WAAa4B,EAAW7B,KAAK8B,GAAI,YACtC9B,KAAKE,gB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BAENH,EAAA,wBAAAE,IAAA,2CACEe,WAAU,KACVO,WAAYzH,GAEZiG,EAAA,MAAAE,IAAA,2CAAIC,MAAM,uBAAuBsB,SAAS,MACxCzB,EAAA,QAAAE,IAAA,2CAAMQ,KAAK,sBAS1BtG,GACC4F,EAAA,sBAAAE,IAAA,2CACEnF,QAASA,EACTF,OAAQA,EACRsF,MAAO,CACLxF,WAGDpB,GACCyG,EAAA,OAAAE,IAAA,2CAAKC,MAAM,oBAAoB3E,KAAK,WAClCwE,EAAA,QAAAE,IAAA,2CAAMQ,KAAK,aAGfV,EAAA,MAAAE,IAAA,2CAAI1E,KAAK,cACPwE,EAAA,QAAAE,IAAA,2CAAMQ,KAAK,iB","ignoreList":[]}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as e,c as t,h as i,H as o,g as s}from"./p-8e4e97b4.js";import{u as n,d as a}from"./p-b40ecf16.js";import{c as r}from"./p-68a5aaff.js";const c='/*! 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}@media (prefers-reduced-motion: no-preference){:host .opening-from-parent{animation:slide-in var(--ic-transition-duration-slow) ease-in-out}:host .opening-from-child{animation:slide-out var(--ic-transition-duration-slow) ease-in-out}}:host{border-radius:var(--ic-border-radius);color:var(--ic-popover-nav-text);--ic-typography-color:var(--ic-popover-nav-text);position:relative;z-index:var(--ic-z-index-popover);box-sizing:border-box;box-shadow:var(--ic-elevation-overlay);display:none;overflow-x:clip}:host(.on-dialog){inset:auto !important}:host(.on-dialog-fix-translate){transform:translate(0, var(--ic-space-xs)) !important}:host(.on-dialog-translate-y){transform:translate(0, calc(-1 * var(--translate-y))) !important}.menu{border:var(--ic-border-default);border-color:var(--ic-popover-border);border-radius:var(--ic-border-radius);background-color:var(--ic-popover-background);visibility:hidden;height:0;display:flex;flex-direction:column}:host(:focus-within){box-shadow:var(--ic-border-focus)}.menu:focus-visible{outline:none}:host(.ic-popover-menu-open){display:block;min-width:calc(20rem - var(--ic-space-xl));width:var(--popover-width, 20rem);max-width:calc(100vw - var(--ic-space-xl))}:host(.ic-popover-menu-open) .menu{visibility:visible;height:-moz-fit-content;height:fit-content;max-height:var(--max-height, -moz-fit-content);max-height:var(--max-height, fit-content);overflow-y:auto;overflow-x:hidden}.parent-label{--ic-typography-color:var(--ic-popover-parent-label);margin:var(--ic-space-xs) var(--ic-space-xs) 0}@keyframes slide-in{from{opacity:0;transform:translateX(10rem)}to{opacity:1;transform:translateX(0)}}@keyframes slide-out{from{opacity:0;transform:translateX(-10rem)}to{opacity:1;transform:translateX(0)}}';const l=c;const h="div.menu-body";const d=class{constructor(i){e(this,i);this.icPopoverClosed=t(this,"icPopoverClosed",7);this.ARIA_LABEL="aria-label";this.popoverMenuEls=[];this.openingFromChild=false;this.openingFromParent=false;this.submenuLevel=1;this.theme="inherit";this.open=undefined;this.setButtonFocus=()=>{var e;(e=this.popoverMenuEls[this.currentFocus])===null||e===void 0?void 0:e.focus()};this.findAnchorEl=e=>{let t=null;if(!e){this.submenuId===undefined&&console.error("No anchor specified for popover component")}else{t=document.querySelector(e.indexOf("#")===0?e:"#"+e);if(t===null){console.error(`Popover anchor element '${e}' not found`)}}return t};this.isNotPopoverMenuEl=e=>{const{id:t,tagName:i}=e.target;return t!==this.anchor&&i!=="IC-MENU-ITEM"&&i!=="IC-MENU-GROUP"&&i!=="IC-POPOVER-MENU"};this.getNextItemToSelect=(e,t)=>{const i=this.popoverMenuEls.length-1;if(e<1){e=0}let o=t?e+1:e-1;if(o<0){o=i}else if(o>i){o=0}return o};this.addMenuItems=e=>{var t;for(let i=0;i<e.length;i++){const o=e[i];if(o.tagName==="IC-MENU-ITEM"){this.popoverMenuEls.push(o)}else if(o.tagName==="IC-MENU-GROUP"){const e=(t=o.shadowRoot)===null||t===void 0?void 0:t.querySelector(".menu-items-wrapper");if(e){const t=n(e);t&&this.addMenuItems(t)}}}};this.getMenuAriaLabel=()=>{const e=this.el.getAttribute(this.ARIA_LABEL);if(a(this.submenuId)){return`${e}, within nested level ${this.submenuLevel} ${this.parentLabel} submenu,`}else{return e}};this.handleBackButtonClick=()=>{var e;(e=this.parentPopover)===null||e===void 0?void 0:e.openFromChild();this.open=false};this.initPopperJS=()=>{if(this.anchorEl){this.popperInstance=r(this.anchorEl,this.el,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,4]}},{name:"flip",options:{fallbackPlacements:["top-start","top-end","bottom-end"],rootBoundary:"viewport"}}]})}}}watchOpenHandler(){var e;const t=(e=this.el.parentElement)===null||e===void 0?void 0:e.querySelectorAll(`ic-popover-menu`);if(this.open){if(t.length>0){t.forEach((e=>{if(e!==this.el){e.open=false}}))}if(this.parentPopover!==undefined&&!this.popoverMenuEls.some((e=>e.id))){this.backButton&&this.popoverMenuEls.unshift(this.backButton)}this.currentFocus=0;setTimeout(this.setButtonFocus,50)}else if(this.popperInstance){if(t.length>0){t.forEach((e=>{if(e!==this.el){e.open=false}}))}this.popperInstance.destroy();this.popperInstance=null}}disconnectedCallback(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}}componentDidLoad(){var e;const t=(e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelector(h);if(t){const e=n(t);if(e!==null){this.addMenuItems(e)}}if(this.submenuId===undefined&&this.el.getAttribute(this.ARIA_LABEL)===null){console.error(`No aria-label specified for popover menu component - aria-label required`)}this.watchOpenHandler()}componentWillRender(){this.anchorEl=this.findAnchorEl(this.anchor)}componentDidRender(){if(this.open&&!this.popperInstance){this.initPopperJS()}}handleMenuItemClick(e){if(!e.detail.submenuTriggerFor&&e.detail.label!=="Back"){this.closeMenu(false,e.detail)}}handleSubmenuChange(e){const t=e.target;this.open=false;const i=document.querySelector(`ic-popover-menu[submenu-id=${t.submenuTriggerFor}]`);i.parentPopover=this.el;i.anchor=this.anchor;i.ariaLabel=this.el.getAttribute(this.ARIA_LABEL);i.openFromParent();i.submenuLevel=this.submenuLevel+1;i.parentLabel=t.label}handleClick(e){if(this.open&&this.isNotPopoverMenuEl(e)){this.closeMenu()}}handleKeyDown(e){switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault();this.currentFocus=this.getNextItemToSelect(this.currentFocus,e.key==="ArrowDown");this.setButtonFocus();break;case"Home":this.currentFocus=0;this.setButtonFocus();break;case"End":this.currentFocus=this.popoverMenuEls.length-1;this.setButtonFocus();break;case"Escape":case"Tab":e.preventDefault();if(this.open){this.closeMenu(true);this.el.blur()}break}}async openFromChild(){this.open=true;this.openingFromChild=true;setTimeout((()=>this.openingFromChild=false),1e3)}async openFromParent(){this.open=true;this.openingFromParent=true;setTimeout((()=>this.openingFromParent=false),1e3)}async closeMenu(e=false,t){var i;this.open=false;if(this.parentPopover){this.parentPopover.closeMenu(e,t)}else{if(e){(i=this.anchorEl)===null||i===void 0?void 0:i.focus()}this.icPopoverClosed.emit(t)}}render(){return i(o,{key:"2cf6304cab334813b297e8bf91d25c57ab6b9b91",class:{["ic-popover-menu-open"]:!!this.open,[`ic-theme-${this.theme}`]:this.theme!=="inherit"}},i("div",{key:"b7f520998946555e6e5d8ca43d194ec142cf4102",id:this.parentPopover===undefined?`ic-popover-submenu-${this.submenuId}`:"",class:{menu:true}},i("span",{key:"5c43e11463a6fe04356d73c2522eca4c1cb39d68",class:{"opening-from-parent":this.openingFromParent,"opening-from-child":this.openingFromChild}},a(this.submenuId)&&i("span",{key:"7bb226ae2aa077cff93ea367f136f171020c0718"},i("span",{key:"0cc54f3ef474f2cbe92c3c04437d83cf35e92de1",role:"menu"},i("ic-menu-item",{key:"ae3f4d6162e643ac6245821e392b2b9491215287",class:"ic-popover-submenu-back-button",ref:e=>this.backButton=e,label:"Back",onClick:this.handleBackButtonClick,id:`ic-popover-submenu-back-button-${this.submenuLevel}`},i("svg",{key:"c3e1211479d31e062b13aba36a025fec0814cfee",slot:"icon",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"submenu-back-icon"},i("path",{key:"dc399eef7ee50dc37dc57aa1f241292d0827a743",d:"M20 11H7.83L13.42 5.41L12 4L4 12L12 20L13.41 18.59L7.83 13H20V11Z",fill:"currentColor"})))),i("ic-typography",{key:"b1ce83e9b01277953f21fe9c58763915c4a8515a",variant:"subtitle-small",class:"parent-label"},this.parentLabel)),i("div",{key:"fab42dde1d195b5d47dd1c669a7bce81f79f42c6",class:"menu-body","aria-label":this.getMenuAriaLabel(),role:"menu"},i("slot",{key:"fe4f5006cefd63260217c969c06d214f47e0b9bb"})))))}static get delegatesFocus(){return true}get el(){return s(this)}static get watchers(){return{open:["watchOpenHandler"]}}};d.style=l;export{d as ic_popover_menu};
|
2
|
+
//# sourceMappingURL=p-9e039aba.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["icPopoverMenuCss","IcPopoverMenuStyle0","MENU_SELECTOR","PopoverMenu","constructor","hostRef","this","ARIA_LABEL","popoverMenuEls","openingFromChild","openingFromParent","submenuLevel","theme","open","undefined","setButtonFocus","_a","currentFocus","focus","findAnchorEl","anchor","anchorElement","submenuId","console","error","document","querySelector","indexOf","isNotPopoverMenuEl","ev","id","tagName","target","getNextItemToSelect","currentItem","movingDown","numButtons","length","nextItem","addMenuItems","elements","i","el","push","groupSlotWrapper","shadowRoot","menuGroupElements","getSlotElements","getMenuAriaLabel","ariaLabel","getAttribute","isPropDefined","parentLabel","handleBackButtonClick","parentPopover","openFromChild","initPopperJS","anchorEl","popperInstance","createPopper","placement","modifiers","name","options","offset","fallbackPlacements","rootBoundary","watchOpenHandler","popoverArr","parentElement","querySelectorAll","forEach","popover","some","menuItem","backButton","unshift","setTimeout","destroy","disconnectedCallback","componentDidLoad","slotWrapper","popoverMenuElements","componentWillRender","componentDidRender","handleMenuItemClick","detail","submenuTriggerFor","label","closeMenu","handleSubmenuChange","childEl","openFromParent","handleClick","handleKeyDown","key","preventDefault","blur","setFocusToAnchor","menuElement","icPopoverClosed","emit","render","h","Host","class","menu","role","ref","onClick","slot","viewBox","fill","xmlns","d","variant"],"sources":["src/components/ic-popover-menu/ic-popover-menu.css?tag=ic-popover-menu&encapsulation=shadow","src/components/ic-popover-menu/ic-popover-menu.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n* @prop --ic-z-index-popover: z-index of popover menu. \n* @prop --max-height: Maximum height of the popover menu.\n* @prop --popover-width: Default width of the popover menu.\n*/\n\n@media (prefers-reduced-motion: no-preference) {\n :host .opening-from-parent {\n animation: slide-in var(--ic-transition-duration-slow) ease-in-out;\n }\n\n :host .opening-from-child {\n animation: slide-out var(--ic-transition-duration-slow) ease-in-out;\n }\n}\n\n:host {\n border-radius: var(--ic-border-radius);\n color: var(--ic-popover-nav-text);\n\n --ic-typography-color: var(--ic-popover-nav-text);\n\n position: relative;\n z-index: var(--ic-z-index-popover);\n box-sizing: border-box;\n box-shadow: var(--ic-elevation-overlay);\n display: none;\n overflow-x: clip;\n}\n\n:host(.on-dialog) {\n inset: auto !important;\n}\n\n:host(.on-dialog-fix-translate) {\n transform: translate(0, var(--ic-space-xs)) !important;\n}\n\n:host(.on-dialog-translate-y) {\n transform: translate(0, calc(-1 * var(--translate-y))) !important;\n}\n\n.menu {\n border: var(--ic-border-default);\n border-color: var(--ic-popover-border);\n border-radius: var(--ic-border-radius);\n background-color: var(--ic-popover-background);\n visibility: hidden;\n height: 0;\n display: flex;\n flex-direction: column;\n}\n\n:host(:focus-within) {\n box-shadow: var(--ic-border-focus);\n}\n\n.menu:focus-visible {\n outline: none;\n}\n\n:host(.ic-popover-menu-open) {\n display: block;\n min-width: calc(20rem - var(--ic-space-xl));\n width: var(--popover-width, 20rem);\n max-width: calc(100vw - var(--ic-space-xl));\n}\n\n:host(.ic-popover-menu-open) .menu {\n visibility: visible;\n height: fit-content;\n max-height: var(--max-height, fit-content);\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n.parent-label {\n --ic-typography-color: var(--ic-popover-parent-label);\n\n margin: var(--ic-space-xs) var(--ic-space-xs) 0;\n}\n\n@keyframes slide-in {\n from {\n opacity: 0;\n transform: translateX(10rem);\n }\n\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n\n@keyframes slide-out {\n from {\n opacity: 0;\n transform: translateX(-10rem);\n }\n\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n","import {\n Component,\n Element,\n Host,\n h,\n Prop,\n Listen,\n Watch,\n State,\n Method,\n Event,\n EventEmitter,\n} from \"@stencil/core\";\nimport { getSlotElements, isPropDefined } from \"../../utils/helpers\";\nimport { createPopper, Instance as PopperInstance } from \"@popperjs/core\";\nimport { IcThemeMode } from \"../../utils/types\";\n\nconst MENU_SELECTOR = \"div.menu-body\";\n\n@Component({\n tag: \"ic-popover-menu\",\n styleUrl: \"ic-popover-menu.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class PopoverMenu {\n private anchorEl: HTMLElement | null;\n private ARIA_LABEL: string = \"aria-label\";\n private backButton?: HTMLIcMenuItemElement;\n private currentFocus: number;\n private popoverMenuEls: HTMLIcMenuItemElement[] = [];\n private popperInstance: PopperInstance | null;\n\n @Element() el: HTMLIcPopoverMenuElement;\n\n @State() openingFromChild: boolean = false;\n @State() openingFromParent: boolean = false;\n\n /**\n * The ID of the element the popover menu will anchor itself to. This is required unless the popover is a submenu.\n */\n @Prop() anchor?: string;\n\n /**\n * @internal The parent popover menu of a child popover menu.\n */\n @Prop() parentLabel?: string;\n\n /**\n * @internal The parent popover menu of a child popover menu.\n */\n @Prop() parentPopover?: HTMLIcPopoverMenuElement;\n\n /**\n * The unique identifier for a popover submenu.\n */\n @Prop() submenuId?: string;\n\n /**\n * @internal The level of menu being displayed.\n */\n @Prop() submenuLevel?: number = 1;\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 * If `true`, the popover menu will be displayed.\n */\n @Prop({ reflect: true, mutable: true }) open?: boolean | undefined =\n undefined;\n\n @Watch(\"open\")\n watchOpenHandler(): void {\n const popoverArr = this.el.parentElement?.querySelectorAll(\n `ic-popover-menu`\n ) as NodeListOf<HTMLIcPopoverMenuElement>;\n if (this.open) {\n if (popoverArr.length > 0) {\n popoverArr.forEach((popover) => {\n if (popover !== this.el) {\n popover.open = false;\n }\n });\n }\n if (\n this.parentPopover !== undefined &&\n !this.popoverMenuEls.some((menuItem) => menuItem.id)\n ) {\n this.backButton && this.popoverMenuEls.unshift(this.backButton);\n }\n\n this.currentFocus = 0;\n // Needed so that anchorEl isn't always focused\n setTimeout(this.setButtonFocus, 50);\n } else if (this.popperInstance) {\n if (popoverArr.length > 0) {\n popoverArr.forEach((popover) => {\n if (popover !== this.el) {\n popover.open = false;\n }\n });\n }\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n /**\n * Emitted when the popover menu is closed.\n */\n @Event() icPopoverClosed: EventEmitter<HTMLIcMenuItemElement>;\n\n disconnectedCallback(): void {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n componentDidLoad(): void {\n const slotWrapper = this.el.shadowRoot?.querySelector(MENU_SELECTOR);\n if (slotWrapper) {\n const popoverMenuElements = getSlotElements(slotWrapper);\n\n if (popoverMenuElements !== null) {\n this.addMenuItems(popoverMenuElements);\n }\n }\n\n if (\n this.submenuId === undefined &&\n this.el.getAttribute(this.ARIA_LABEL) === null\n ) {\n console.error(\n `No aria-label specified for popover menu component - aria-label required`\n );\n }\n\n this.watchOpenHandler();\n }\n\n componentWillRender(): void {\n this.anchorEl = this.findAnchorEl(this.anchor);\n }\n\n componentDidRender(): void {\n if (this.open && !this.popperInstance) {\n this.initPopperJS();\n }\n }\n\n @Listen(\"handleMenuItemClick\")\n handleMenuItemClick(ev: CustomEvent<HTMLIcMenuItemElement>): void {\n if (!ev.detail.submenuTriggerFor && ev.detail.label !== \"Back\") {\n this.closeMenu(false, ev.detail);\n }\n }\n\n // This is listening for the event emitted when a menu item is acting as a trigger button\n @Listen(\"triggerPopoverMenuInstance\", { capture: true })\n handleSubmenuChange(ev: Event): void {\n // Finds the trigger menu item that has emitted the event\n const target = ev.target as HTMLIcMenuItemElement;\n this.open = false;\n\n // Find the popover menu that the menu item triggers (i.e. submenu-trigger-for === submenu-id).\n const childEl = document.querySelector(\n `ic-popover-menu[submenu-id=${target.submenuTriggerFor}]`\n ) as HTMLIcPopoverMenuElement;\n // Set the parent popover menu of the submenu and open the submenu\n childEl.parentPopover = this.el;\n childEl.anchor = this.anchor;\n childEl.ariaLabel = this.el.getAttribute(this.ARIA_LABEL);\n childEl.openFromParent();\n childEl.submenuLevel = this.submenuLevel! + 1;\n // Set the label in the submenu using the label of the menu item that has emitted the event\n childEl.parentLabel = target.label;\n }\n\n @Listen(\"click\", { target: \"document\" })\n handleClick(ev: Event): void {\n if (this.open && this.isNotPopoverMenuEl(ev)) {\n // If menu is open and the next click on the document is not a popover El, close the popover\n this.closeMenu();\n }\n }\n\n // Manages the keyboard navigation in the popover menu\n @Listen(\"keydown\", {})\n handleKeyDown(ev: KeyboardEvent): void {\n switch (ev.key) {\n case \"ArrowDown\":\n case \"ArrowUp\":\n ev.preventDefault();\n this.currentFocus = this.getNextItemToSelect(\n this.currentFocus,\n ev.key === \"ArrowDown\"\n );\n this.setButtonFocus();\n break;\n case \"Home\":\n //Sets home focus as first element, or back button\n this.currentFocus = 0;\n this.setButtonFocus();\n break;\n case \"End\":\n //Sets end focus as last element\n this.currentFocus = this.popoverMenuEls.length - 1;\n this.setButtonFocus();\n break;\n case \"Escape\":\n case \"Tab\":\n ev.preventDefault();\n if (this.open) {\n this.closeMenu(true);\n this.el.blur();\n }\n break;\n }\n }\n\n /**\n * @internal Opens the menu from the child menu.\n */\n @Method()\n async openFromChild(): Promise<void> {\n this.open = true;\n this.openingFromChild = true;\n\n setTimeout(() => (this.openingFromChild = false), 1000);\n }\n\n /**\n * @internal Opens the menu from the parent menu.\n */\n @Method()\n async openFromParent(): Promise<void> {\n this.open = true;\n this.openingFromParent = true;\n\n setTimeout(() => (this.openingFromParent = false), 1000);\n }\n\n private setButtonFocus = () => {\n this.popoverMenuEls[this.currentFocus]?.focus();\n };\n\n // Checks that the popover menu has an anchor\n private findAnchorEl = (anchor: string | undefined): HTMLElement | null => {\n let anchorElement: HTMLElement | null = null;\n if (!anchor) {\n this.submenuId === undefined &&\n console.error(\"No anchor specified for popover component\");\n } else {\n anchorElement = document.querySelector(\n anchor.indexOf(\"#\") === 0 ? anchor : \"#\" + anchor\n );\n if (anchorElement === null) {\n console.error(`Popover anchor element '${anchor}' not found`);\n }\n }\n return anchorElement;\n };\n\n private isNotPopoverMenuEl = (ev: Event) => {\n const { id, tagName } = ev.target as HTMLElement;\n return (\n id !== this.anchor &&\n tagName !== \"IC-MENU-ITEM\" &&\n tagName !== \"IC-MENU-GROUP\" &&\n tagName !== \"IC-POPOVER-MENU\"\n );\n };\n\n /**\n * @internal Close the menu, emit icPopoverClosed of the root popover\n * @param setFocusToAnchor when true return focus to anchor element when menu is closed\n */\n @Method()\n async closeMenu(\n setFocusToAnchor = false,\n menuElement?: HTMLIcMenuItemElement\n ): Promise<void> {\n this.open = false;\n if (this.parentPopover) {\n this.parentPopover.closeMenu(setFocusToAnchor, menuElement);\n } else {\n if (setFocusToAnchor) {\n this.anchorEl?.focus();\n }\n this.icPopoverClosed.emit(menuElement);\n }\n }\n\n private getNextItemToSelect = (\n currentItem: number,\n movingDown: boolean\n ): number => {\n const numButtons = this.popoverMenuEls.length - 1;\n\n if (currentItem < 1) {\n currentItem = 0;\n }\n\n let nextItem = movingDown ? currentItem + 1 : currentItem - 1;\n\n // Check if wrap around necessary\n if (nextItem < 0) {\n nextItem = numButtons;\n } else if (nextItem > numButtons) {\n nextItem = 0;\n }\n\n return nextItem;\n };\n\n private addMenuItems = (elements: Element[] | NodeListOf<ChildNode>) => {\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i] as HTMLIcMenuItemElement;\n if (el.tagName === \"IC-MENU-ITEM\") {\n this.popoverMenuEls.push(el);\n } else if (el.tagName === \"IC-MENU-GROUP\") {\n const groupSlotWrapper = el.shadowRoot?.querySelector(\n \".menu-items-wrapper\"\n );\n if (groupSlotWrapper) {\n const menuGroupElements = getSlotElements(groupSlotWrapper);\n menuGroupElements && this.addMenuItems(menuGroupElements);\n }\n }\n }\n };\n\n private getMenuAriaLabel = (): string | null => {\n const ariaLabel = this.el.getAttribute(this.ARIA_LABEL);\n\n if (isPropDefined(this.submenuId)) {\n return `${ariaLabel}, within nested level ${this.submenuLevel} ${this.parentLabel} submenu,`;\n } else {\n return ariaLabel;\n }\n };\n\n private handleBackButtonClick = (): void => {\n this.parentPopover?.openFromChild();\n this.open = false;\n };\n\n private initPopperJS = () => {\n if (this.anchorEl) {\n this.popperInstance = createPopper(this.anchorEl, this.el, {\n placement: \"bottom-start\",\n modifiers: [\n {\n name: \"offset\",\n options: {\n offset: [0, 4],\n },\n },\n {\n name: \"flip\",\n options: {\n fallbackPlacements: [\"top-start\", \"top-end\", \"bottom-end\"],\n rootBoundary: \"viewport\",\n },\n },\n ],\n });\n }\n };\n\n render() {\n return (\n <Host\n class={{\n [\"ic-popover-menu-open\"]: !!this.open,\n [`ic-theme-${this.theme}`]: this.theme !== \"inherit\",\n }}\n >\n <div\n id={\n this.parentPopover === undefined\n ? `ic-popover-submenu-${this.submenuId}`\n : \"\"\n }\n class={{\n menu: true,\n }}\n >\n <span\n class={{\n \"opening-from-parent\": this.openingFromParent,\n \"opening-from-child\": this.openingFromChild,\n }}\n >\n {isPropDefined(this.submenuId) && (\n <span>\n <span role=\"menu\">\n <ic-menu-item\n class=\"ic-popover-submenu-back-button\"\n ref={(el) => (this.backButton = el)}\n label=\"Back\"\n onClick={this.handleBackButtonClick}\n id={`ic-popover-submenu-back-button-${this.submenuLevel}`}\n >\n <svg\n slot=\"icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"submenu-back-icon\"\n >\n <path\n d=\"M20 11H7.83L13.42 5.41L12 4L4 12L12 20L13.41 18.59L7.83 13H20V11Z\"\n fill=\"currentColor\"\n />\n </svg>\n </ic-menu-item>\n </span>\n <ic-typography variant=\"subtitle-small\" class=\"parent-label\">\n {this.parentLabel}\n </ic-typography>\n </span>\n )}\n <div\n class=\"menu-body\"\n aria-label={this.getMenuAriaLabel()}\n role=\"menu\"\n >\n <slot></slot>\n </div>\n </span>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"+IAAA,MAAMA,EAAmB,0iIACzB,MAAAC,EAAeD,ECgBf,MAAME,EAAgB,gB,MASTC,EAAW,MAPxB,WAAAC,CAAAC,G,2DASUC,KAAAC,WAAqB,aAGrBD,KAAAE,eAA0C,GAKzCF,KAAAG,iBAA4B,MAC5BH,KAAAI,kBAA6B,MAyB9BJ,KAAAK,aAAwB,EAKxBL,KAAAM,MAAsB,UAKUN,KAAAO,KACtCC,UA8KMR,KAAAS,eAAiB,K,OACvBC,EAAAV,KAAKE,eAAeF,KAAKW,iBAAa,MAAAD,SAAA,SAAAA,EAAEE,OAAO,EAIzCZ,KAAAa,aAAgBC,IACtB,IAAIC,EAAoC,KACxC,IAAKD,EAAQ,CACXd,KAAKgB,YAAcR,WACjBS,QAAQC,MAAM,4C,KACX,CACLH,EAAgBI,SAASC,cACvBN,EAAOO,QAAQ,OAAS,EAAIP,EAAS,IAAMA,GAE7C,GAAIC,IAAkB,KAAM,CAC1BE,QAAQC,MAAM,2BAA2BJ,e,EAG7C,OAAOC,CAAa,EAGdf,KAAAsB,mBAAsBC,IAC5B,MAAMC,GAAEA,EAAEC,QAAEA,GAAYF,EAAGG,OAC3B,OACEF,IAAOxB,KAAKc,QACZW,IAAY,gBACZA,IAAY,iBACZA,IAAY,iBAAiB,EAwBzBzB,KAAA2B,oBAAsB,CAC5BC,EACAC,KAEA,MAAMC,EAAa9B,KAAKE,eAAe6B,OAAS,EAEhD,GAAIH,EAAc,EAAG,CACnBA,E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AAkBC,E,KAC1C,CACL,GAAID,EAAkB,EACpBlF,EAAAV,KAAKmD,YAAQ,MAAAzC,SAAA,SAAAA,EAAEE,O,CAEjBZ,KAAK8F,gBAAgBC,KAAKF,E,EAiF9B,MAAAG,GACE,OACEC,EAACC,EAAI,CAAAT,IAAA,2CACHU,MAAO,CACL,CAAC,0BAA2BnG,KAAKO,KACjC,CAAC,YAAYP,KAAKM,SAAUN,KAAKM,QAAU,YAG7C2F,EAAA,OAAAR,IAAA,2CACEjE,GACExB,KAAKgD,gBAAkBxC,UACnB,sBAAsBR,KAAKgB,YAC3B,GAENmF,MAAO,CACLC,KAAM,OAGRH,EAAA,QAAAR,IAAA,2CACEU,MAAO,CACL,sBAAuBnG,KAAKI,kBAC5B,qBAAsBJ,KAAKG,mBAG5B0C,EAAc7C,KAAKgB,YAClBiF,EAAA,QAAAR,IAAA,4CACEQ,EAAA,QAAAR,IAAA,2CAAMY,KAAK,QACTJ,EAAA,gBAAAR,IAAA,2CACEU,MAAM,iCACNG,IAAMlE,GAAQpC,KAAKqE,WAAajC,EAChC8C,MAAM,OACNqB,QAASvG,KAAK+C,sBACdvB,GAAI,kCAAkCxB,KAAKK,gBAE3C4F,EAAA,OAAAR,IAAA,2CACEe,KAAK,OACLC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BACNR,MAAM,qBAENF,EAAA,QAAAR,IAAA,2CACEmB,EAAE,oEACFF,KAAK,oBAKbT,EAAA,iBAAAR,IAAA,2CAAeoB,QAAQ,iBAAiBV,MAAM,gBAC3CnG,KAAK8C,cAIZmD,EAAA,OAAAR,IAAA,2CACEU,MAAM,YAAW,aACLnG,KAAK0C,mBACjB2D,KAAK,QAELJ,EAAA,QAAAR,IAAA,gD","ignoreList":[]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as t,c as i,h as s,g as h}from"./p-8e4e97b4.js";const e="context-id";const a=class{constructor(s){t(this,s);this.icTabSelect=i(this,"icTabSelect",3);this.newTabPanels=[];this.newTabs=[];this.activationType="automatic";this.contextId="default";this.monochrome=false;this.theme="inherit";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);this.tabPanels[i].setAttribute("id",h);this.tabPanels[i].setAttribute("aria-labelledby",s);if(this.contextId){t.setAttribute(e,this.contextId);this.tabGroup&&this.tabGroup.setAttribute(e,this.contextId);this.tabPanels[i].setAttribute(e,this.contextId)}t.theme=this.theme;this.tabPanels[i].theme=this.theme;this.tabGroup&&(this.tabGroup.theme=this.theme)}))};this.getChildren=()=>{var t;this.tabGroup=this.el.querySelector("ic-tab-group");this.tabs=Array.from(((t=this.tabGroup)===null||t===void 0?void 0:t.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||0].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.active=i===this.selectedTab}))};this.getEnabledTabs=()=>Array.from(this.tabs).filter((t=>!t.disabled));this.keyboardSelectTab=t=>{var i,s;const h=this.tabs.findIndex((i=>i.tabId===this.enabledTabs[t].tabId));this.enabledTabs[t].focus();if(this.selectedTabIndex===undefined){this.selectedTab=h}else{this.icTabSelect.emit({tabIndex:h,tabLabel:((s=(i=this.el.querySelectorAll("ic-tab")[h])===null||i===void 0?void 0:i.textContent)===null||s===void 0?void 0:s.trim())||""})}};this.keyboardFocusTab=t=>{this.enabledTabs[t].focus();this.focusedTabIndex=this.tabs.findIndex((i=>i.tabId===this.enabledTabs[t].tabId))}}updateSelectedTab(t){this.selectedTab=t}watchMonochromeHandler(){this.tabs.forEach(((t,i)=>{t.monochrome=this.monochrome;this.tabPanels[i].monochrome=this.monochrome}));this.tabGroup&&(this.tabGroup.monochrome=this.monochrome)}watchThemeHandler(){this.tabs.forEach(((t,i)=>{t.theme=this.theme;this.tabPanels[i].theme=this.theme}));this.tabGroup&&(this.tabGroup.theme=this.theme)}componentDidLoad(){if(this.selectedTabIndex!==undefined){this.selectedTab=this.selectedTabIndex}this.getChildren();this.linkTabs();this.tabGroup&&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){var i,s;if(this.selectedTabIndex===undefined&&t.detail.contextId===this.contextId){this.selectedTab=t.detail.position}this.icTabSelect.emit({tabIndex:t.detail.position,tabLabel:((s=(i=this.el.querySelectorAll("ic-tab")[t.detail.position])===null||i===void 0?void 0:i.textContent)===null||s===void 0?void 0:s.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.selectedTab&&(!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.selectedTab&&this.tabs[this.selectedTab]&&this.tabPanels[this.selectedTab]){this.tabs[this.selectedTab].selected=true}else{this.setInitialTab()}if(t&&this.selectedTab){this.tabs[this.selectedTab].setFocus()}}render(){return s("slot",{key:"
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as t,c as i,h as s,g as h}from"./p-8e4e97b4.js";const e="context-id";const a=class{constructor(s){t(this,s);this.icTabSelect=i(this,"icTabSelect",3);this.newTabPanels=[];this.newTabs=[];this.activationType="automatic";this.contextId="default";this.monochrome=false;this.theme="inherit";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);this.tabPanels[i].setAttribute("id",h);this.tabPanels[i].setAttribute("aria-labelledby",s);if(this.contextId){t.setAttribute(e,this.contextId);this.tabGroup&&this.tabGroup.setAttribute(e,this.contextId);this.tabPanels[i].setAttribute(e,this.contextId)}t.theme=this.theme;this.tabPanels[i].theme=this.theme;this.tabGroup&&(this.tabGroup.theme=this.theme)}))};this.getChildren=()=>{var t;this.tabGroup=this.el.querySelector("ic-tab-group");this.tabs=Array.from(((t=this.tabGroup)===null||t===void 0?void 0:t.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||0].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.active=i===this.selectedTab}))};this.getEnabledTabs=()=>Array.from(this.tabs).filter((t=>!t.disabled));this.keyboardSelectTab=t=>{var i,s;const h=this.tabs.findIndex((i=>i.tabId===this.enabledTabs[t].tabId));this.enabledTabs[t].focus();if(this.selectedTabIndex===undefined){this.selectedTab=h}else{this.icTabSelect.emit({tabIndex:h,tabLabel:((s=(i=this.el.querySelectorAll("ic-tab")[h])===null||i===void 0?void 0:i.textContent)===null||s===void 0?void 0:s.trim())||""})}};this.keyboardFocusTab=t=>{this.enabledTabs[t].focus();this.focusedTabIndex=this.tabs.findIndex((i=>i.tabId===this.enabledTabs[t].tabId))}}updateSelectedTab(t){this.selectedTab=t}watchMonochromeHandler(){this.tabs.forEach(((t,i)=>{t.monochrome=this.monochrome;this.tabPanels[i].monochrome=this.monochrome}));this.tabGroup&&(this.tabGroup.monochrome=this.monochrome)}watchThemeHandler(){this.tabs.forEach(((t,i)=>{t.theme=this.theme;this.tabPanels[i].theme=this.theme}));this.tabGroup&&(this.tabGroup.theme=this.theme)}componentDidLoad(){if(this.selectedTabIndex!==undefined){this.selectedTab=this.selectedTabIndex}this.getChildren();this.linkTabs();this.tabGroup&&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){var i,s;if(this.selectedTabIndex===undefined&&t.detail.contextId===this.contextId){this.selectedTab=t.detail.position}this.icTabSelect.emit({tabIndex:t.detail.position,tabLabel:((s=(i=this.el.querySelectorAll("ic-tab")[t.detail.position])===null||i===void 0?void 0:i.textContent)===null||s===void 0?void 0:s.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.selectedTab&&(!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.selectedTab&&this.tabs[this.selectedTab]&&this.tabPanels[this.selectedTab]){this.tabs[this.selectedTab].selected=true}else{this.setInitialTab()}if(t&&this.selectedTab){this.tabs[this.selectedTab].setFocus()}}render(){return s("slot",{key:"b2129a3c599ca4b97df30f14833761780c2c0940"})}get el(){return h(this)}static get watchers(){return{selectedTabIndex:["updateSelectedTab"],monochrome:["watchMonochromeHandler"],theme:["watchThemeHandler"]}}};export{a as ic_tab_context};
|
2
|
+
//# sourceMappingURL=p-9e051db4.entry.js.map
|