@ukic/web-components 3.11.0 → 3.12.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/{constants-8354f6e6.js → constants-3a9ba64a.js} +3 -1
- package/dist/cjs/constants-3a9ba64a.js.map +1 -0
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{helpers-ffe1c2d9.js → helpers-478d1107.js} +2 -2
- package/dist/cjs/helpers-478d1107.js.map +1 -0
- package/dist/cjs/ic-accordion-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-accordion.cjs.entry.js +2 -2
- package/dist/cjs/ic-action-chip.cjs.entry.js +2 -2
- package/dist/cjs/ic-alert.cjs.entry.js +2 -2
- package/dist/cjs/ic-back-to-top.cjs.entry.js +2 -2
- package/dist/cjs/ic-badge.cjs.entry.js +2 -2
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/ic-button_3.cjs.entry.js +2 -2
- package/dist/cjs/ic-card-vertical.cjs.entry.js +2 -2
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +8 -5
- package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/ic-chip.cjs.entry.js +7 -6
- package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +2 -2
- package/dist/cjs/ic-dialog.cjs.entry.js +2 -2
- package/dist/cjs/ic-divider.cjs.entry.js +2 -2
- package/dist/cjs/ic-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer-link.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer.cjs.entry.js +2 -2
- package/dist/cjs/ic-hero.cjs.entry.js +2 -2
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +2 -2
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +1381 -6
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +8 -7
- package/dist/cjs/ic-input-label_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +2 -2
- package/dist/cjs/ic-menu-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/ic-navigation-button.cjs.entry.js +2 -2
- package/dist/cjs/ic-navigation-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-navigation-item.cjs.entry.js +2 -2
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +2 -2
- package/dist/cjs/ic-page-header.cjs.entry.js +2 -2
- package/dist/cjs/ic-pagination-item.cjs.entry.js +2 -2
- package/dist/cjs/ic-pagination.cjs.entry.js +2 -2
- package/dist/cjs/ic-popover-menu.cjs.entry.js +2 -2
- package/dist/cjs/ic-radio-group.cjs.entry.js +15 -8
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +3 -3
- package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +2 -2
- package/dist/cjs/ic-select.cjs.entry.js +17 -10
- package/dist/cjs/ic-select.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +2 -2
- package/dist/cjs/ic-status-tag.cjs.entry.js +2 -2
- package/dist/cjs/ic-step.cjs.entry.js +67 -55
- package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +21 -4
- package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab.cjs.entry.js +2 -2
- package/dist/cjs/ic-text-field.cjs.entry.js +9 -9
- 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.cjs.entry.js +2 -2
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-toggle-button.cjs.entry.js +2 -2
- package/dist/cjs/ic-top-navigation.cjs.entry.js +2 -2
- package/dist/cjs/ic-typography.cjs.entry.js +2 -2
- package/dist/cjs/index.cjs.js +2 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.css +3 -3
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js +5 -2
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js.map +1 -1
- package/dist/collection/components/ic-chip/ic-chip.css +4 -0
- package/dist/collection/components/ic-chip/ic-chip.js +4 -3
- package/dist/collection/components/ic-chip/ic-chip.js.map +1 -1
- package/dist/collection/components/ic-input-validation/ic-input-validation.css +4 -1
- package/dist/collection/components/ic-input-validation/ic-input-validation.js +9 -8
- package/dist/collection/components/ic-input-validation/ic-input-validation.js.map +1 -1
- package/dist/collection/components/ic-menu/ic-menu.js +5 -4
- package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
- package/dist/collection/components/ic-radio-group/ic-radio-group.css +2 -2
- package/dist/collection/components/ic-radio-group/ic-radio-group.js +40 -7
- 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 +164 -0
- package/dist/collection/components/ic-radio-option/ic-radio-option.css +37 -1
- package/dist/collection/components/ic-select/ic-select.js +41 -8
- package/dist/collection/components/ic-select/ic-select.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select_(multi).stories.js +14 -2
- package/dist/collection/components/ic-select/ic-select_(searchable).stories.js +10 -0
- package/dist/collection/components/ic-select/ic-select_(single).stories.js +111 -4
- package/dist/collection/components/ic-step/ic-step.js +89 -53
- package/dist/collection/components/ic-step/ic-step.js.map +1 -1
- package/dist/collection/components/ic-step/ic-step.types.js.map +1 -1
- package/dist/collection/components/ic-stepper/ic-stepper.js +43 -2
- package/dist/collection/components/ic-stepper/ic-stepper.js.map +1 -1
- package/dist/collection/components/ic-stepper/ic-stepper.stories.js +75 -0
- package/dist/collection/components/ic-text-field/ic-text-field.css +2 -2
- package/dist/collection/components/ic-text-field/ic-text-field.js +32 -32
- package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
- package/dist/collection/utils/common-helpers.js +17 -0
- package/dist/collection/utils/common-helpers.js.map +1 -0
- package/dist/collection/utils/constants.js +1 -0
- package/dist/collection/utils/constants.js.map +1 -1
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/components/constants.js +2 -1
- package/dist/components/constants.js.map +1 -1
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +6 -3
- package/dist/components/ic-checkbox-group.js.map +1 -1
- package/dist/components/ic-chip.js +5 -4
- package/dist/components/ic-chip.js.map +1 -1
- package/dist/components/ic-input-validation2.js +7 -6
- package/dist/components/ic-input-validation2.js.map +1 -1
- package/dist/components/ic-menu2.js +1380 -4
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-radio-group.js +14 -6
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js +1 -1
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-select.js +17 -9
- package/dist/components/ic-select.js.map +1 -1
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-step.js +66 -53
- package/dist/components/ic-step.js.map +1 -1
- package/dist/components/ic-stepper.js +20 -2
- package/dist/components/ic-stepper.js.map +1 -1
- package/dist/components/ic-text-field.js +8 -8
- package/dist/components/ic-text-field.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/index.esm.js +1 -1
- package/dist/core/{p-52a2f800.entry.js → p-0123dde7.entry.js} +2 -2
- package/dist/core/{p-23b223bf.entry.js → p-01e018cb.entry.js} +2 -2
- package/dist/core/{p-1ab63899.entry.js → p-02af2b59.entry.js} +2 -2
- package/dist/core/p-05036675.entry.js +2 -0
- package/dist/core/p-05036675.entry.js.map +1 -0
- package/dist/core/{p-1d4dfef1.entry.js → p-0c36ce84.entry.js} +2 -2
- package/dist/core/{p-f78f34ce.entry.js → p-0ec76cff.entry.js} +2 -2
- package/dist/core/{p-35ee7c53.entry.js → p-13e093d0.entry.js} +2 -2
- package/dist/core/{p-a48b581a.entry.js → p-1423bd4a.entry.js} +2 -2
- package/dist/core/{p-3f55bb5b.entry.js → p-2126d37b.entry.js} +2 -2
- package/dist/core/{p-515ded3f.entry.js → p-228bc12d.entry.js} +2 -2
- package/dist/core/{p-d27e46ac.entry.js → p-25bef09d.entry.js} +2 -2
- package/dist/core/{p-eddc5517.entry.js → p-27e67d45.entry.js} +2 -2
- package/dist/core/{p-4dd8add9.entry.js → p-2800fc30.entry.js} +2 -2
- package/dist/core/{p-f045f59d.entry.js → p-33582352.entry.js} +2 -2
- package/dist/core/p-33789b23.entry.js +3 -0
- package/dist/core/p-33789b23.entry.js.map +1 -0
- package/dist/core/{p-4a2c02b2.entry.js → p-3e36f281.entry.js} +2 -2
- package/dist/core/{p-58b8d154.entry.js → p-45097448.entry.js} +2 -2
- package/dist/core/p-514daffe.entry.js +2 -0
- package/dist/core/p-514daffe.entry.js.map +1 -0
- package/dist/core/{p-3a78bf6e.entry.js → p-54803e3b.entry.js} +2 -2
- package/dist/core/{p-0201abbf.entry.js → p-6058d4c9.entry.js} +2 -2
- package/dist/core/{p-8d29c0fa.entry.js → p-675bb3e4.entry.js} +2 -2
- package/dist/core/{p-75e0278a.entry.js → p-6dbe70f1.entry.js} +2 -2
- package/dist/core/{p-b9018261.entry.js → p-6e139e6e.entry.js} +2 -2
- package/dist/core/{p-aab838e5.entry.js → p-80317cd1.entry.js} +2 -2
- package/dist/core/{p-d35f8bd4.entry.js → p-80e0f66e.entry.js} +2 -2
- package/dist/core/{p-02c2c31f.entry.js → p-813ad03c.entry.js} +2 -2
- package/dist/core/{p-69412f61.entry.js → p-8558b9b7.entry.js} +2 -2
- package/dist/core/{p-a468df37.entry.js → p-8684efeb.entry.js} +2 -2
- package/dist/core/{p-ffc608a1.entry.js → p-8b99a806.entry.js} +2 -2
- package/dist/core/{p-19366be6.entry.js → p-93479c36.entry.js} +2 -2
- package/dist/core/{p-69cc0f7d.entry.js → p-95d3d1a7.entry.js} +2 -2
- package/dist/core/p-99793b64.entry.js +2 -0
- package/dist/core/p-99793b64.entry.js.map +1 -0
- package/dist/core/{p-57803949.entry.js → p-a06c1e4e.entry.js} +2 -2
- package/dist/core/p-a1857d24.entry.js +2 -0
- package/dist/core/p-a1857d24.entry.js.map +1 -0
- package/dist/core/{p-f17e1525.entry.js → p-a1e2e029.entry.js} +2 -2
- package/dist/core/{p-abb9dccb.entry.js → p-abd88929.entry.js} +2 -2
- package/dist/core/{p-cdd04ec2.entry.js → p-b0376079.entry.js} +2 -2
- package/dist/core/{p-fd488ed7.entry.js → p-b1838ad8.entry.js} +2 -2
- package/dist/core/p-b1838ad8.entry.js.map +1 -0
- package/dist/core/{p-6ceedfa8.js → p-b57e59b7.js} +2 -2
- package/dist/core/p-b57e59b7.js.map +1 -0
- package/dist/core/p-b9bdd9a9.entry.js +2 -0
- package/dist/core/p-b9bdd9a9.entry.js.map +1 -0
- package/dist/core/{p-641c26c4.js → p-bddf799a.js} +2 -2
- package/dist/core/p-bddf799a.js.map +1 -0
- package/dist/core/{p-0809aff4.entry.js → p-c04e1fab.entry.js} +2 -2
- package/dist/core/p-c2d5e301.entry.js +2 -0
- package/dist/core/p-c2d5e301.entry.js.map +1 -0
- package/dist/core/{p-65a3c216.entry.js → p-c975cced.entry.js} +2 -2
- package/dist/core/p-cc00cbce.entry.js +2 -0
- package/dist/core/p-cc00cbce.entry.js.map +1 -0
- package/dist/core/{p-a4e67ab8.entry.js → p-cf868a24.entry.js} +2 -2
- package/dist/core/p-cf868a24.entry.js.map +1 -0
- package/dist/core/{p-01aeffca.entry.js → p-d58ad080.entry.js} +2 -2
- package/dist/core/{p-f086d6df.entry.js → p-de32a223.entry.js} +2 -2
- package/dist/core/{p-46423f42.entry.js → p-e6dacbe2.entry.js} +2 -2
- package/dist/core/{p-8af9413c.entry.js → p-e9d28e02.entry.js} +2 -2
- package/dist/core/{p-1dab47b1.entry.js → p-ea06792a.entry.js} +2 -2
- package/dist/core/{p-5c6efed3.entry.js → p-eb0e7153.entry.js} +2 -2
- package/dist/core/{p-402813c9.entry.js → p-f609ca37.entry.js} +2 -2
- package/dist/core/{p-8d1fbbeb.entry.js → p-fb69fbc0.entry.js} +2 -2
- package/dist/core/{p-cd63bcf2.entry.js → p-fb734a59.entry.js} +2 -2
- package/dist/esm/{constants-48759bda.js → constants-7960cba4.js} +3 -2
- package/dist/esm/constants-7960cba4.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-d8189e9d.js → helpers-4ddac6ed.js} +2 -2
- package/dist/esm/helpers-4ddac6ed.js.map +1 -0
- package/dist/esm/ic-accordion-group.entry.js +2 -2
- package/dist/esm/ic-accordion.entry.js +2 -2
- package/dist/esm/ic-action-chip.entry.js +2 -2
- package/dist/esm/ic-alert.entry.js +2 -2
- package/dist/esm/ic-back-to-top.entry.js +2 -2
- package/dist/esm/ic-badge.entry.js +2 -2
- package/dist/esm/ic-breadcrumb-group.entry.js +2 -2
- package/dist/esm/ic-breadcrumb.entry.js +2 -2
- package/dist/esm/ic-button_3.entry.js +2 -2
- package/dist/esm/ic-card-vertical.entry.js +2 -2
- package/dist/esm/ic-checkbox-group.entry.js +8 -5
- package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
- package/dist/esm/ic-checkbox.entry.js +2 -2
- package/dist/esm/ic-chip.entry.js +7 -6
- package/dist/esm/ic-chip.entry.js.map +1 -1
- package/dist/esm/ic-data-row.entry.js +2 -2
- package/dist/esm/ic-dialog.entry.js +2 -2
- package/dist/esm/ic-divider.entry.js +2 -2
- package/dist/esm/ic-empty-state.entry.js +2 -2
- package/dist/esm/ic-footer-link-group.entry.js +2 -2
- package/dist/esm/ic-footer-link.entry.js +2 -2
- package/dist/esm/ic-footer.entry.js +2 -2
- package/dist/esm/ic-hero.entry.js +2 -2
- package/dist/esm/ic-horizontal-scroll.entry.js +2 -2
- package/dist/esm/ic-input-component-container_3.entry.js +1381 -6
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-input-label_2.entry.js +8 -7
- package/dist/esm/ic-input-label_2.entry.js.map +1 -1
- package/dist/esm/ic-link.entry.js +2 -2
- package/dist/esm/ic-menu-group.entry.js +2 -2
- package/dist/esm/ic-menu-item.entry.js +2 -2
- package/dist/esm/ic-navigation-button.entry.js +2 -2
- package/dist/esm/ic-navigation-group.entry.js +2 -2
- package/dist/esm/ic-navigation-item.entry.js +2 -2
- package/dist/esm/ic-navigation-menu.entry.js +2 -2
- package/dist/esm/ic-page-header.entry.js +2 -2
- package/dist/esm/ic-pagination-item.entry.js +2 -2
- package/dist/esm/ic-pagination.entry.js +2 -2
- package/dist/esm/ic-popover-menu.entry.js +2 -2
- package/dist/esm/ic-radio-group.entry.js +15 -8
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/ic-radio-option.entry.js +3 -3
- package/dist/esm/ic-radio-option.entry.js.map +1 -1
- package/dist/esm/ic-search-bar.entry.js +2 -2
- package/dist/esm/ic-select.entry.js +17 -10
- package/dist/esm/ic-select.entry.js.map +1 -1
- package/dist/esm/ic-side-navigation.entry.js +2 -2
- package/dist/esm/ic-status-tag.entry.js +2 -2
- package/dist/esm/ic-step.entry.js +67 -55
- package/dist/esm/ic-step.entry.js.map +1 -1
- package/dist/esm/ic-stepper.entry.js +21 -4
- package/dist/esm/ic-stepper.entry.js.map +1 -1
- package/dist/esm/ic-switch.entry.js +2 -2
- package/dist/esm/ic-tab-group.entry.js +2 -2
- package/dist/esm/ic-tab.entry.js +2 -2
- package/dist/esm/ic-text-field.entry.js +9 -9
- 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.entry.js +2 -2
- package/dist/esm/ic-toggle-button-group.entry.js +2 -2
- package/dist/esm/ic-toggle-button.entry.js +2 -2
- package/dist/esm/ic-top-navigation.entry.js +2 -2
- package/dist/esm/ic-typography.entry.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-input-validation/ic-input-validation.d.ts +2 -3
- package/dist/types/components/ic-radio-group/ic-radio-group.d.ts +6 -2
- package/dist/types/components/ic-select/ic-select.d.ts +5 -1
- package/dist/types/components/ic-step/ic-step.d.ts +5 -1
- package/dist/types/components/ic-step/ic-step.types.d.ts +10 -0
- package/dist/types/components/ic-stepper/ic-stepper.d.ts +5 -1
- package/dist/types/components/ic-text-field/ic-text-field.d.ts +4 -4
- package/dist/types/components.d.ts +39 -9
- package/dist/types/interface.d.ts +0 -1
- package/dist/types/utils/common-helpers.d.ts +2 -0
- package/dist/types/utils/constants.d.ts +1 -0
- package/dist/types/utils/types.d.ts +1 -0
- package/hydrate/index.js +1522 -94
- package/hydrate/index.mjs +1522 -94
- package/package.json +4 -3
- package/vscode-data.json +30 -0
- package/dist/cjs/constants-8354f6e6.js.map +0 -1
- package/dist/cjs/helpers-ffe1c2d9.js.map +0 -1
- package/dist/collection/components/ic-input-validation/ic-input-validation.types.js +0 -2
- package/dist/collection/components/ic-input-validation/ic-input-validation.types.js.map +0 -1
- package/dist/core/p-402c2455.entry.js +0 -2
- package/dist/core/p-402c2455.entry.js.map +0 -1
- package/dist/core/p-641c26c4.js.map +0 -1
- package/dist/core/p-6ceedfa8.js.map +0 -1
- package/dist/core/p-75a9b2e4.entry.js +0 -2
- package/dist/core/p-75a9b2e4.entry.js.map +0 -1
- package/dist/core/p-8326db29.entry.js +0 -2
- package/dist/core/p-8326db29.entry.js.map +0 -1
- package/dist/core/p-a4e67ab8.entry.js.map +0 -1
- package/dist/core/p-b80d408f.entry.js +0 -2
- package/dist/core/p-b80d408f.entry.js.map +0 -1
- package/dist/core/p-c81ffadd.entry.js +0 -2
- package/dist/core/p-c81ffadd.entry.js.map +0 -1
- package/dist/core/p-d6b3e02f.entry.js +0 -2
- package/dist/core/p-d6b3e02f.entry.js.map +0 -1
- package/dist/core/p-d7bd5aa0.entry.js +0 -2
- package/dist/core/p-d7bd5aa0.entry.js.map +0 -1
- package/dist/core/p-ed69f110.entry.js +0 -2
- package/dist/core/p-ed69f110.entry.js.map +0 -1
- package/dist/core/p-fd488ed7.entry.js.map +0 -1
- package/dist/esm/constants-48759bda.js.map +0 -1
- package/dist/esm/helpers-d8189e9d.js.map +0 -1
- package/dist/types/components/ic-input-validation/ic-input-validation.types.d.ts +0 -1
- /package/dist/core/{p-52a2f800.entry.js.map → p-0123dde7.entry.js.map} +0 -0
- /package/dist/core/{p-23b223bf.entry.js.map → p-01e018cb.entry.js.map} +0 -0
- /package/dist/core/{p-1ab63899.entry.js.map → p-02af2b59.entry.js.map} +0 -0
- /package/dist/core/{p-1d4dfef1.entry.js.map → p-0c36ce84.entry.js.map} +0 -0
- /package/dist/core/{p-f78f34ce.entry.js.map → p-0ec76cff.entry.js.map} +0 -0
- /package/dist/core/{p-35ee7c53.entry.js.map → p-13e093d0.entry.js.map} +0 -0
- /package/dist/core/{p-a48b581a.entry.js.map → p-1423bd4a.entry.js.map} +0 -0
- /package/dist/core/{p-3f55bb5b.entry.js.map → p-2126d37b.entry.js.map} +0 -0
- /package/dist/core/{p-515ded3f.entry.js.map → p-228bc12d.entry.js.map} +0 -0
- /package/dist/core/{p-d27e46ac.entry.js.map → p-25bef09d.entry.js.map} +0 -0
- /package/dist/core/{p-eddc5517.entry.js.map → p-27e67d45.entry.js.map} +0 -0
- /package/dist/core/{p-4dd8add9.entry.js.map → p-2800fc30.entry.js.map} +0 -0
- /package/dist/core/{p-f045f59d.entry.js.map → p-33582352.entry.js.map} +0 -0
- /package/dist/core/{p-4a2c02b2.entry.js.map → p-3e36f281.entry.js.map} +0 -0
- /package/dist/core/{p-58b8d154.entry.js.map → p-45097448.entry.js.map} +0 -0
- /package/dist/core/{p-3a78bf6e.entry.js.map → p-54803e3b.entry.js.map} +0 -0
- /package/dist/core/{p-0201abbf.entry.js.map → p-6058d4c9.entry.js.map} +0 -0
- /package/dist/core/{p-8d29c0fa.entry.js.map → p-675bb3e4.entry.js.map} +0 -0
- /package/dist/core/{p-75e0278a.entry.js.map → p-6dbe70f1.entry.js.map} +0 -0
- /package/dist/core/{p-b9018261.entry.js.map → p-6e139e6e.entry.js.map} +0 -0
- /package/dist/core/{p-aab838e5.entry.js.map → p-80317cd1.entry.js.map} +0 -0
- /package/dist/core/{p-d35f8bd4.entry.js.map → p-80e0f66e.entry.js.map} +0 -0
- /package/dist/core/{p-02c2c31f.entry.js.map → p-813ad03c.entry.js.map} +0 -0
- /package/dist/core/{p-69412f61.entry.js.map → p-8558b9b7.entry.js.map} +0 -0
- /package/dist/core/{p-a468df37.entry.js.map → p-8684efeb.entry.js.map} +0 -0
- /package/dist/core/{p-ffc608a1.entry.js.map → p-8b99a806.entry.js.map} +0 -0
- /package/dist/core/{p-19366be6.entry.js.map → p-93479c36.entry.js.map} +0 -0
- /package/dist/core/{p-69cc0f7d.entry.js.map → p-95d3d1a7.entry.js.map} +0 -0
- /package/dist/core/{p-57803949.entry.js.map → p-a06c1e4e.entry.js.map} +0 -0
- /package/dist/core/{p-f17e1525.entry.js.map → p-a1e2e029.entry.js.map} +0 -0
- /package/dist/core/{p-abb9dccb.entry.js.map → p-abd88929.entry.js.map} +0 -0
- /package/dist/core/{p-cdd04ec2.entry.js.map → p-b0376079.entry.js.map} +0 -0
- /package/dist/core/{p-0809aff4.entry.js.map → p-c04e1fab.entry.js.map} +0 -0
- /package/dist/core/{p-65a3c216.entry.js.map → p-c975cced.entry.js.map} +0 -0
- /package/dist/core/{p-01aeffca.entry.js.map → p-d58ad080.entry.js.map} +0 -0
- /package/dist/core/{p-f086d6df.entry.js.map → p-de32a223.entry.js.map} +0 -0
- /package/dist/core/{p-46423f42.entry.js.map → p-e6dacbe2.entry.js.map} +0 -0
- /package/dist/core/{p-8af9413c.entry.js.map → p-e9d28e02.entry.js.map} +0 -0
- /package/dist/core/{p-1dab47b1.entry.js.map → p-ea06792a.entry.js.map} +0 -0
- /package/dist/core/{p-5c6efed3.entry.js.map → p-eb0e7153.entry.js.map} +0 -0
- /package/dist/core/{p-402813c9.entry.js.map → p-f609ca37.entry.js.map} +0 -0
- /package/dist/core/{p-8d1fbbeb.entry.js.map → p-fb69fbc0.entry.js.map} +0 -0
- /package/dist/core/{p-cd63bcf2.entry.js.map → p-fb734a59.entry.js.map} +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["IcInformationStatus","IcBrandForegroundEnum","DARK_MODE_THRESHOLD","ANYWHERE_SEARCH_POSITION","icInput","inheritAttributes","element","attributes","attributeObject","forEach","attr","value","getAttribute","removeAttribute","debounceEvent","event","wait","original","_original","emit","debounce","bind","func","timer","args","clearTimeout","setTimeout","renderHiddenInput","container","name","disabled","always","hasShadowDom","input","getHiddenInputElement","ownerDocument","createElement","type","classList","add","appendChild","Date","toISOString","Array","from","querySelectorAll","filter","el","parentElement","renderFileHiddenInput","multiple","accept","undefined","hidden","files","onchange","click","removeHiddenInput","_a","remove","shadowRoot","attachShadow","getInputHelperTextID","id","getInputValidationTextID","getInputDescribedByText","inputId","helperText","validationText","isSlotUsed","trim","getBrandFromContext","brandFromEvent","getRootNode","host","blockColorParent","closest","IC_BLOCK_COLOR_COMPONENTS","Default","parentTag","tagName","toLowerCase","IC_BLOCK_COLOR_EXCEPTIONS","includes","IC_FIXED_COLOR_COMPONENTS","contains","Dark","Light","isMobileOrTablet","navigator","maxTouchPoints","test","userAgent","handleHiddenFormButtonClick","form","button","hiddenFormButtonId","hiddenFormButton","document","querySelector","setAttribute","_b","style","display","formAction","_c","formaction","formEnctype","_d","formenctype","formMethod","_e","formmethod","formNoValidate","_f","formnovalidate","formTarget","_g","formtarget","isEmptyString","length","isPropDefined","prop","getLabelFromValue","options","valueField","labelField","ungroupedOptions","map","option","children","push","matchingValue","find","getFilteredMenuOptions","includeDescriptions","searchString","position","label","description","lowerSearchString","startsWith","getOptionsWithoutGroupTitlesCount","optionsWithoutGroupTitles","deviceSizeMatches","size","window","matchMedia","matches","getCurrentDeviceSize","DEVICE_SIZES","S","M","L","XL","UNDEFINED","getCssProperty","cssVar","getComputedStyle","documentElement","getPropertyValue","getBrandColorBrightness","parseInt","getBrandForegroundAppearance","brightness","getSlot","slotHasContent","getSlotContent","slot","getSlotElements","slotContent","firstElementChild","elements","assignedElements","childNodes","getNavItemParentDetails","navType","parent","XS","Number","replace","hasValidationStatus","status","slotName","some","child","onComponentPropUndefinedChange","oldValue","newValue","callback","onComponentRequiredPropUndefined","props","component","propName","console","error","kebabToCamelCase","kebabCase","split","word","index","substring","toUpperCase","join","checkResizeObserver","callbackFn","ResizeObserver","hex2dec","v","hexToRgba","hex","hexChars","char","repeat","r","slice","g","b","a","rgbaStrToObj","rgbaStr","isRGBA","rgbValues","elementOverflowsX","scrollWidth","clientWidth","hasClassificationBanner","addFormResetListener","addEventListener","removeFormResetListener","removeEventListener","pxToRem","px","base","removeDisabledFalse","isMacDevice","indexOf","convertToRGBA","color","firstChar","capitalize","text","charAt","checkSlotInChildMutations","addedNodes","removedNodes","hasSlot","nodeList","node","isArray","isElInAGGrid","isSlottedInGroup","hasDynamicChildSlots","mutationList","slotNames","renderDynamicChildSlots","ref","forceUpdate","getElementInheritedTheme","blockParentTheme","theme","wrapperTheme","call"],"sources":["src/utils/types.ts","src/utils/helpers.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nexport type IcFocusableComponents =\n | HTMLIcBreadcrumbElement\n | HTMLIcButtonElement\n | HTMLIcCardVerticalElement\n | HTMLIcCheckboxElement\n | HTMLIcChipElement\n | HTMLIcLinkElement\n | HTMLIcNavigationButtonElement\n | HTMLIcNavigationGroupElement\n | HTMLIcNavigationItemElement\n | HTMLIcRadioOptionElement\n | HTMLIcSearchBarElement\n | HTMLIcSelectElement\n | HTMLIcSwitchElement\n | HTMLIcTabElement\n | HTMLIcTextFieldElement;\n\nexport type IcStatusVariants =\n | \"neutral\"\n | \"info\"\n | \"warning\"\n | \"error\"\n | \"success\"\n | \"ai\";\n\nexport enum IcInformationStatus {\n Warning = \"warning\",\n Error = \"error\",\n Success = \"success\",\n}\n\nexport type IcSizes = \"medium\" | \"large\" | \"small\";\n\nexport type IcSizesNoLarge = \"medium\" | \"small\";\n\nexport type IcInformationStatusOrEmpty = \"warning\" | \"error\" | \"success\" | \"\";\n\nexport type IcNavType = \"side\" | \"top\" | \"page-header\";\n\n// From: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\nexport type IcAutocompleteTypes =\n | \"on\"\n | \"off\"\n | \"name\"\n | \"honorific-prefix\"\n | \"given-name\"\n | \"additional-name\"\n | \"family-name\"\n | \"honorific-suffix\"\n | \"nickname\"\n | \"email\"\n | \"username\"\n | \"new-password\"\n | \"current-password\"\n | \"one-time-code\"\n | \"organization-title\"\n | \"organization\"\n | \"street-address\"\n | \"address-line1\"\n | \"address-line2\"\n | \"address-line3\"\n | \"address-level4\"\n | \"address-level3\"\n | \"address-level2\"\n | \"address-level1\"\n | \"country\"\n | \"country-name\"\n | \"postal-code\"\n | \"cc-name\"\n | \"cc-given-name\"\n | \"cc-additional-name\"\n | \"cc-family-name\"\n | \"cc-family-name\"\n | \"cc-number\"\n | \"cc-exp\"\n | \"cc-exp-month\"\n | \"cc-exp-year\"\n | \"cc-csc\"\n | \"cc-type\"\n | \"transaction-currency\"\n | \"transaction-amount\"\n | \"language\"\n | \"bday\"\n | \"bday-day\"\n | \"bday-month\"\n | \"bday-year\"\n | \"sex\"\n | \"tel\"\n | \"tel-country-code\"\n | \"tel-national\"\n | \"tel-area-code\"\n | \"tel-local\"\n | \"tel-extension\"\n | \"impp\"\n | \"url\"\n | \"photo\";\n\nexport type IcAlignment = \"left\" | \"center\" | \"full-width\";\n\nexport enum IcBrandForegroundEnum {\n Default = \"default\",\n Dark = \"dark\",\n Light = \"light\",\n}\n\nexport type IcThemeMode = \"dark\" | \"light\" | \"inherit\";\n\nexport type IcBrandForeground = \"default\" | \"dark\" | \"light\";\n\nexport type IcBrandForegroundNoDefault = \"dark\" | \"light\";\n\nexport type IcBrand = {\n mode: IcBrandForeground;\n color: IcColorRGB;\n};\n\nexport type IcAdditionalFieldTypes = \"static\" | \"dynamic\";\n\nexport type IcColorRGB = {\n r: number;\n g: number;\n b: number;\n};\n\nexport type IcColorRGBA = IcColorRGB & {\n a: number;\n};\n\nexport type IcActivationTypes = \"automatic\" | \"manual\";\n\nexport type IcAutocorrectStates = \"on\" | \"off\";\n\nexport type IcNavParentDetails = {\n navType: IcNavType | \"\";\n parent: HTMLElement | null;\n};\n\nexport type IcTypographyVariants =\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"subtitle-large\"\n | \"subtitle-small\"\n | \"body\"\n | \"label\"\n | \"label-uppercase\"\n | \"caption\"\n | \"caption-uppercase\"\n | \"code-large\"\n | \"code-small\"\n | \"code-extra-small\"\n | \"badge\"\n | \"badge-small\";\n\n/**\n * @interface IcMenuOption\n * @field {string} A label field to options. Defaults to \"label\", but can have any custom name.\n * @field {string} A value field to options. Defaults to \"value\", but can have any custom name.\n */\nexport interface IcMenuOption {\n description?: string;\n disabled?: boolean;\n recommended?: boolean;\n children?: IcMenuOption[];\n loading?: boolean;\n timedOut?: boolean;\n [key: string]: any;\n element?: {\n component: any;\n ariaLabel: string;\n };\n icon?: any;\n}\n\nexport type IcSearchMatchPositions = \"start\" | \"anywhere\";\n\nexport type IcCallbackFunctionNoReturn = (...args: unknown[]) => void;\n\nexport type IcRequiredPropsTypes =\n | string\n | boolean\n | number\n | HTMLElement\n | IcMenuOption[]\n | undefined;\n\nexport type IcPropObject = { prop: IcRequiredPropsTypes; propName: string };\n\nexport type IcRelatedTarget = EventTarget | undefined;\n\nexport type IcOrientation = \"horizontal\" | \"vertical\";\n\nexport type IcEmphasisType = \"filled\" | \"outlined\";\n\nexport interface IcValueEventDetail {\n value: string;\n keyPressed?: string;\n}\n\nexport interface IcMultiValueEventDetail {\n value: string | string[] | null;\n keyPressed?: string;\n}\n\nexport interface IcBlurEventDetail {\n relatedTarget: IcRelatedTarget | null;\n}\n\nexport type IcSelectTypes = \"single\" | \"multi\";\n\nexport type IcSelectMethodTypes = \"auto\" | \"manual\";\n\nexport type IcDeviceSizes = 0 | 576 | 768 | 992 | 1200;\n\ntype RGB = `rgb(${string})`;\ntype RGBA = `rgba(${string})`;\ntype HEX = `#${string}`;\n\nexport type IcColor = RGB | RGBA | HEX;\n\nexport type IcIconPlacementOptions = \"left\" | \"right\" | \"top\";\n\nexport type IcButtonTooltipPlacement = \"top\" | \"right\" | \"bottom\" | \"left\";\n\nexport type IcThemeSettings = \"dark\" | \"light\" | \"system\";\n\nexport type IcValidationAriaLive = \"default\" | \"polite\" | \"assertive\" | \"off\";\n","import { EventEmitter, forceUpdate } from \"@stencil/core\";\nimport {\n IcCallbackFunctionNoReturn,\n IcInformationStatusOrEmpty,\n IcNavParentDetails,\n IcPropObject,\n IcSearchMatchPositions,\n IcColorRGBA,\n IcDeviceSizes,\n IcColor,\n IcBrandForegroundNoDefault,\n IcThemeMode,\n} from \"./types\";\n\nimport {\n IcMenuOption,\n IcBrandForeground,\n IcBrandForegroundEnum,\n} from \"../utils/types\";\nimport {\n IC_BLOCK_COLOR_COMPONENTS,\n IC_BLOCK_COLOR_EXCEPTIONS,\n IC_FIXED_COLOR_COMPONENTS,\n} from \"./constants\";\n\nconst DARK_MODE_THRESHOLD = 133.3505;\nconst ANYWHERE_SEARCH_POSITION = \"anywhere\";\nconst icInput = \"ic-input\";\n\n/**\n * converts an enum of strings into an array of strings\n */\nexport const stringEnumToArray = (\n theEnum: Record<string, string | number>\n): string[] => {\n const arr: string[] = [];\n Object.values(theEnum).forEach((val) => {\n if (isNaN(Number(val))) {\n const str = val as string;\n arr.push(str);\n }\n });\n return arr;\n};\n\n/**\n * Used to inherit global attributes set on the host. Called in componentWillLoad and assigned\n * to a variable that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\nexport const inheritAttributes = (\n element: HTMLElement,\n attributes: string[] = []\n): { [key: string]: string } => {\n const attributeObject: { [key: string]: string } = {};\n\n attributes.forEach((attr) => {\n const value = element.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = value;\n element.removeAttribute(attr);\n }\n });\n\n return attributeObject;\n};\n\nexport const debounceEvent = (\n event: EventEmitter,\n wait: number\n): EventEmitter => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const original = (event as any)._original || event;\n return {\n _original: event,\n emit: debounce(original.emit.bind(original), wait),\n } as EventEmitter;\n};\n\nexport const debounce = (\n func: (...args: unknown[]) => void,\n wait = 0\n): unknown => {\n let timer: ReturnType<typeof setTimeout>;\n return (...args: unknown[]) => {\n clearTimeout(timer);\n timer = setTimeout(func, wait, ...args);\n };\n};\n\n/**\n * This method is used to add a hidden input to a host element that contains\n * a Shadow DOM. It does not add the input inside of the Shadow root which\n * allows it to be picked up inside of forms. It should contain the same\n * values as the host element.\n *\n * @param container The element where the input will be added\n * @param value The value of the input\n * @param name The name of the input\n * @param disabled If true, the input is disabled\n * @param always Add a hidden input even if the container does not use Shadow\n */\nexport const renderHiddenInput = (\n container: HTMLElement,\n value?: string | Date | null,\n name?: string,\n disabled = false,\n always = true\n): void => {\n if (name && (always || hasShadowDom(container))) {\n let input = getHiddenInputElement(container);\n\n if (!input) {\n input = container.ownerDocument.createElement(\"input\");\n input.type = \"hidden\";\n input.classList.add(icInput);\n container.appendChild(input);\n }\n input.disabled = disabled;\n input.name = name;\n input.value = value instanceof Date ? value.toISOString() : value || \"\";\n }\n};\n\nconst getHiddenInputElement = (container: HTMLElement) =>\n Array.from(\n container.querySelectorAll<HTMLInputElement>(`input.${icInput}`)\n ).filter((el) => container === el.parentElement)[0];\n\n/**\n * This method is used to add a hidden file input to a host element that contains\n * a Shadow DOM. It does not add the input inside of the Shadow root which\n * allows it to be picked up inside of forms. It should contain the same\n * values as the host element.\n *\n * @param event: The event that is emitted once a file is selected.\n * @param container The element where the input will be added\n * @param multiple If true, multiple files can be selected\n * @param disabled If true, the input is disabled\n * @param accept A string of the accepted files\n * @param name The name of the input\n * @param value The value of the input\n */\nexport const renderFileHiddenInput = (\n event: EventEmitter,\n container: HTMLElement,\n multiple: boolean,\n disabled: boolean,\n accept?: string,\n name?: string,\n value?: FileList\n): void => {\n if (name !== undefined && hasShadowDom(container)) {\n let input = getHiddenInputElement(container);\n\n if (input === null || input === undefined) {\n input = container.ownerDocument.createElement(\"input\");\n input.classList.add(icInput);\n container.appendChild(input);\n }\n input.type = \"file\";\n input.hidden = true;\n input.multiple = multiple;\n input.name = name;\n input.disabled = disabled;\n\n if (value) input.files = value;\n if (accept) input.accept = accept;\n\n input.onchange = () => {\n event.emit(input.files);\n };\n input.click();\n }\n};\n\nexport const removeHiddenInput = (container: HTMLElement): void => {\n getHiddenInputElement(container)?.remove();\n};\n\nexport const hasShadowDom = (el: HTMLElement | null | undefined): boolean =>\n !!el && !!el.shadowRoot && !!el.attachShadow;\n\nexport const getInputHelperTextID = (id: string): string => id + \"-helper-text\";\n\nexport const getInputValidationTextID = (id: string): string =>\n id + \"-validation-text\";\n\nexport const getInputDescribedByText = (\n el: HTMLElement,\n inputId: string,\n helperText: boolean,\n validationText: boolean\n): string =>\n `${\n isSlotUsed(el, \"helper-text\") || helperText\n ? getInputHelperTextID(inputId)\n : \"\"\n } ${validationText ? getInputValidationTextID(inputId) : \"\"}`.trim();\n\n/**\n * This method helps to understand the context in which a component exists,\n * to assist with choosing appropriate foreground colours to use. For example,\n * this method will help you use the 'white' version of a button if it's within\n * a block colour element using white foreground text.\n *\n * This only works for components/elements passed via <slot> and not if they\n * are part of an IC component.\n *\n * \"\"\n * @returns IcBrandForeground depending on the context\n */\nexport const getBrandFromContext = (\n el: Element,\n brandFromEvent: IcBrandForeground | null = null\n): IcBrandForeground => {\n const parentElement =\n el.parentElement || (<ShadowRoot>el.getRootNode()).host.parentElement;\n const blockColorParent = parentElement?.closest(IC_BLOCK_COLOR_COMPONENTS);\n\n if (!blockColorParent) return IcBrandForegroundEnum.Default;\n\n const parentTag = blockColorParent.tagName.toLowerCase();\n\n if (\n IC_BLOCK_COLOR_EXCEPTIONS[parentTag]?.includes(el.tagName.toLowerCase())\n ) {\n return IcBrandForegroundEnum.Default;\n } else if (\n brandFromEvent !== null &&\n !IC_FIXED_COLOR_COMPONENTS.includes(parentTag)\n ) {\n return brandFromEvent;\n } else if (\n blockColorParent.classList.contains(\n `${parentTag}-${IcBrandForegroundEnum.Dark}`\n ) ||\n blockColorParent.classList.contains(IcBrandForegroundEnum.Dark)\n ) {\n return IcBrandForegroundEnum.Dark;\n } else {\n return IcBrandForegroundEnum.Light;\n }\n};\n\n/**\n * Checks if the current device is a mobile or tablet device.\n * @returns {boolean} Returns true if the device is a mobile or tablet device, otherwise returns false.\n */\nexport const isMobileOrTablet = (): boolean =>\n \"maxTouchPoints\" in navigator && \"userAgent\" in navigator\n ? navigator.maxTouchPoints > 0 &&\n /iPad|iPhone|iPod|Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n : false;\n\n/**\n * Will create a button within the lightDOM which interacts with the form.\n * This is required as buttons within the shadowDOM will not invoke a submit or reset\n *\n * @param form - form element to associate button with\n * @param button - shadowDOM button\n */\nexport const handleHiddenFormButtonClick = (\n form: HTMLFormElement | null,\n button: HTMLIcButtonElement\n): void => {\n const hiddenFormButtonId =\n button.type === \"submit\" || button.type === \"reset\"\n ? `hidden-form-${button.type}-button`\n : \"hidden-form-button\";\n\n const hiddenFormButton =\n document.querySelector<HTMLButtonElement>(`#${hiddenFormButtonId}`) ??\n document.createElement(\"button\");\n\n hiddenFormButton.setAttribute(\"type\", button.type ?? \"button\");\n hiddenFormButton.id = hiddenFormButtonId;\n hiddenFormButton.style.display = \"none\";\n\n hiddenFormButton.formAction = button.formaction ?? \"\";\n hiddenFormButton.formEnctype = button.formenctype ?? \"\";\n hiddenFormButton.formMethod = button.formmethod ?? \"\";\n hiddenFormButton.formNoValidate = button.formnovalidate ?? false;\n hiddenFormButton.formTarget = button.formtarget ?? \"\";\n\n form?.appendChild(hiddenFormButton);\n hiddenFormButton.click();\n};\n\nexport const isEmptyString = (value?: string): boolean =>\n !value || value.trim().length === 0;\n\n// A helper function that checks if a prop has been defined\nexport const isPropDefined = (prop?: string): string | undefined =>\n prop !== undefined ? prop : undefined;\n\n/**\n * Extracts the label using the value from an object. Requires the object to have a label and value property.\n * @param value - value from object\n * @param options - list of menu items\n * @returns - label corresponding to value\n */\nexport const getLabelFromValue = (\n value: string,\n options: IcMenuOption[],\n valueField = \"value\",\n labelField = \"label\"\n): string | undefined => {\n const ungroupedOptions: IcMenuOption[] = [];\n if (options.length > 0 && options.map) {\n options.map((option) => {\n if (option.children) {\n option.children.map((option: IcMenuOption) =>\n ungroupedOptions.push(option)\n );\n } else {\n ungroupedOptions.push(option);\n }\n });\n const matchingValue = ungroupedOptions.find(\n (option) => option[valueField] === value\n );\n if (matchingValue !== undefined) return matchingValue[labelField];\n }\n\n return undefined;\n};\n\n/**\n * Filters the options based on the search string.\n * @param options - array of options\n * @param includeDescriptions - determines whether option descriptions are included when filtering options\n * @param searchString - string used to filter the options\n * @param position - whether the search string matches the start of or anywhere in the options\n * @returns filtered array of options\n */\nexport const getFilteredMenuOptions = (\n options: IcMenuOption[],\n includeDescriptions: boolean,\n searchString: string,\n position: IcSearchMatchPositions = ANYWHERE_SEARCH_POSITION,\n labelField = \"label\"\n): IcMenuOption[] =>\n options.filter((option) => {\n const label: string = option[labelField].toLowerCase();\n const description = option.description?.toLowerCase();\n const lowerSearchString = searchString.toLowerCase();\n\n return position === ANYWHERE_SEARCH_POSITION\n ? includeDescriptions\n ? label.includes(lowerSearchString) ||\n description?.includes(lowerSearchString)\n : label.includes(lowerSearchString)\n : includeDescriptions\n ? label.startsWith(lowerSearchString) ||\n description?.startsWith(lowerSearchString)\n : label.startsWith(lowerSearchString);\n });\n\n/**\n * Gets count of options where only group title \"parent\" options have been removed.\n * Disabled options are included in the count.\n * @param options - array of options\n * @returns number of options not including group titles\n */\nexport const getOptionsWithoutGroupTitlesCount = (\n options: IcMenuOption[]\n): number => {\n const optionsWithoutGroupTitles: IcMenuOption[] = [];\n\n if (options.length > 0 && options.map) {\n options.map((option) => {\n if (option.children) {\n option.children.map((option) => optionsWithoutGroupTitles.push(option));\n } else {\n optionsWithoutGroupTitles.push(option);\n }\n });\n }\n\n return optionsWithoutGroupTitles.length;\n};\n\nexport const deviceSizeMatches = (size: number): boolean =>\n window.matchMedia(`(max-width: ${size}px)`).matches;\n\nexport const getCurrentDeviceSize = (): number => {\n if (deviceSizeMatches(DEVICE_SIZES.S)) {\n return DEVICE_SIZES.S;\n }\n if (deviceSizeMatches(DEVICE_SIZES.M)) {\n return DEVICE_SIZES.M;\n }\n if (deviceSizeMatches(DEVICE_SIZES.L)) {\n return DEVICE_SIZES.L;\n }\n if (deviceSizeMatches(DEVICE_SIZES.XL)) {\n return DEVICE_SIZES.XL;\n }\n //fallback needed as all of above get initialised to 0 in jest tests\n return DEVICE_SIZES.UNDEFINED;\n};\n\nexport const getCssProperty = (cssVar: string): string =>\n getComputedStyle(document.documentElement).getPropertyValue(cssVar);\n\n/**\n * Returns the brightness of the theme colour, calculated by using the theme RGB CSS values by:\n * - Multiplying each RGB value by a set number: https://www.w3.org/TR/AERT/#color-contrast\n * - Adding them together and dividing by 1000\n * This is a similar calculation to its CSS counterpart: \"--ic-brand-text-color\"\n * @returns number representing the brightness of the theme colour\n */\nexport const getBrandColorBrightness = (): number =>\n (parseInt(getCssProperty(\"--ic-brand-color-primary-r\")) * 299 +\n parseInt(getCssProperty(\"--ic-brand-color-primary-g\")) * 587 +\n parseInt(getCssProperty(\"--ic-brand-color-primary-b\")) * 114) /\n 1000;\n\n/**\n * Returns if dark or light foreground colors should be used for color contrast reasons\n * @returns \"dark\" or \"light\"\n * @param brightness - Optional custom brightness value. Defaults to `getBrandColorBrightness`\n */\nexport const getBrandForegroundAppearance = (\n brightness = getBrandColorBrightness()\n): IcBrandForegroundNoDefault =>\n brightness > DARK_MODE_THRESHOLD\n ? IcBrandForegroundEnum.Dark\n : IcBrandForegroundEnum.Light;\n\nexport const getSlot = (\n element: HTMLElement | undefined,\n name: string\n): Element | null => element?.querySelector(`[slot=\"${name}\"]`) || null;\n\nexport const slotHasContent = (element: HTMLElement, name: string): boolean =>\n getSlot(element, name) !== null;\n\nexport const getSlotContent = (\n element: HTMLElement,\n name: string\n): Element[] | NodeListOf<ChildNode> | null => {\n const slot = getSlot(element, name);\n return slot ? getSlotElements(slot) : null;\n};\n\nexport const getSlotElements = (\n slot: Element\n): NodeListOf<ChildNode> | Element[] | null => {\n const slotContent = slot.firstElementChild as HTMLSlotElement;\n\n if (slotContent === null) return [slot];\n\n const elements = slotContent.assignedElements\n ? slotContent.assignedElements()\n : slotContent.childNodes;\n return elements.length ? elements : slot.tagName ? [slot] : null;\n};\n\nexport const getNavItemParentDetails = ({\n parentElement,\n}: HTMLElement): IcNavParentDetails => {\n let navType: IcNavParentDetails = { navType: \"\", parent: null };\n if (parentElement) {\n switch (parentElement.tagName) {\n case \"IC-NAVIGATION-GROUP\":\n navType = getNavItemParentDetails(parentElement);\n break;\n case \"IC-TOP-NAVIGATION\":\n navType = { navType: \"top\", parent: parentElement };\n break;\n case \"IC-SIDE-NAVIGATION\":\n navType = { navType: \"side\", parent: parentElement };\n break;\n case \"IC-PAGE-HEADER\":\n navType = { navType: \"page-header\", parent: null };\n break;\n }\n }\n\n return navType;\n};\n\nexport const DEVICE_SIZES = {\n XS: Number(\n getCssProperty(\"--ic-breakpoint-xs\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 0\n S: Number(\n getCssProperty(\"--ic-breakpoint-sm\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 576\n M: Number(\n getCssProperty(\"--ic-breakpoint-md\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 768\n L: Number(\n getCssProperty(\"--ic-breakpoint-lg\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 992\n XL: Number(\n getCssProperty(\"--ic-breakpoint-xl\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 1200\n UNDEFINED: 1200,\n};\n\nexport const hasValidationStatus = (\n status?: IcInformationStatusOrEmpty,\n disabled?: boolean\n): boolean => !!status && !disabled;\n\nexport const isSlotUsed = (\n { children }: HTMLElement,\n slotName: string\n): boolean =>\n Array.from(children).some((child) => child.getAttribute(\"slot\") === slotName);\n\n// added as a common method to allow detection of gatsby hydration issue, where (camelCase) props are initially undefined & then update\n// with a value. Allows a callback function to be executed when this is the case\nexport const onComponentPropUndefinedChange = (\n oldValue: string | undefined,\n newValue: string | undefined,\n callback: IcCallbackFunctionNoReturn\n): void => {\n if (oldValue === undefined && newValue !== oldValue) {\n callback();\n }\n};\n\nexport const onComponentRequiredPropUndefined = (\n props: IcPropObject[],\n component: string\n): void => {\n props.forEach(({ prop, propName }) => {\n if (prop === null || prop === undefined) {\n console.error(\n `No ${propName} specified for ${component} component - prop '${propName}' (web components) / '${kebabToCamelCase(\n propName\n )}' (react) required`\n );\n }\n });\n};\n\nexport const kebabToCamelCase = (kebabCase: string): string =>\n kebabCase\n .toLowerCase()\n .split(\"-\")\n .map((word, index) =>\n index === 0\n ? word\n : `${word.substring(0, 1).toUpperCase()}${word.substring(1)}`\n )\n .join(\"\");\n\nexport const checkResizeObserver = (\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n if (\n typeof window !== \"undefined\" &&\n typeof window.ResizeObserver !== \"undefined\"\n ) {\n callbackFn();\n }\n};\n\nconst hex2dec = (v: string) => parseInt(v, 16);\n\nexport const hexToRgba = (hex: string): IcColorRGBA => {\n const hexChars = hex\n .replace(\"#\", \"\")\n .split(\"\")\n .map((char) => char.repeat(2));\n return {\n r: hex2dec(hex.length === 4 ? hexChars[0] : hex.slice(1, 3)),\n g: hex2dec(hex.length === 4 ? hexChars[1] : hex.slice(3, 5)),\n b: hex2dec(hex.length === 4 ? hexChars[2] : hex.slice(5)),\n a: 1,\n };\n};\n\nexport const rgbaStrToObj = (rgbaStr: string): IcColorRGBA => {\n const isRGBA = rgbaStr.slice(3, 4).toLowerCase() === \"a\";\n const rgbValues = rgbaStr\n .substring(isRGBA ? 5 : 4, rgbaStr.length - 1)\n .replace(/ /g, \"\")\n .split(\",\")\n .map(Number);\n return {\n r: rgbValues[0],\n g: rgbValues[1],\n b: rgbValues[2],\n a: isRGBA ? rgbValues[3] : 1,\n };\n};\n\nexport const elementOverflowsX = ({\n scrollWidth,\n clientWidth,\n}: HTMLElement): boolean => scrollWidth > clientWidth;\n\nexport const hasClassificationBanner = (): boolean =>\n !!document.querySelector(\"ic-classification-banner:not([inline='true'])\");\n\nexport const addFormResetListener = (\n el: HTMLElement,\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n el.closest(\"FORM\")?.addEventListener(\"reset\", callbackFn);\n};\n\nexport const removeFormResetListener = (\n el: HTMLElement,\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n el.closest(\"FORM\")?.removeEventListener(\"reset\", callbackFn);\n};\n\nexport const pxToRem = (px: string, base = 16): string =>\n `${(1 / base) * parseInt(px)}rem`;\n\n/**\n * Removes the disabled attribute from the provided element when its value is set to false.\n * This effectively makes it null, to not confuse screen readers that cannot interpret the false value\n */\nexport const removeDisabledFalse = (\n disabled: boolean | undefined,\n element: HTMLElement\n): void => {\n if (!disabled) {\n element.removeAttribute(\"disabled\");\n }\n};\n\nexport const isMacDevice = (): boolean =>\n window.navigator.userAgent.toUpperCase().indexOf(\"MAC\") >= 0;\n\nexport const isNumeric = (value: string): boolean => /^-?\\d+$/.test(value);\n\nexport async function waitForHydration(): Promise<boolean> {\n const elements = document.getElementsByTagName(\"*\");\n\n for (let i = 0; i < elements.length; i++) {\n if (elements[i].tagName.startsWith(\"IC-\")) {\n if (elements[i].classList.contains(\"hydrated\")) {\n return true;\n }\n } else {\n return false;\n }\n }\n\n return false;\n}\n\nexport const convertToRGBA = (color: IcColor): IcColorRGBA | null => {\n const firstChar = color?.slice(0, 1).toLowerCase();\n\n if (firstChar !== \"#\" && firstChar !== \"r\") return null;\n return firstChar === \"#\" ? hexToRgba(color) : rgbaStrToObj(color);\n};\n\nexport const capitalize = (text: string): string =>\n text.charAt(0).toUpperCase() + text.slice(1);\n\nexport const checkSlotInChildMutations = (\n addedNodes: NodeList,\n removedNodes: NodeList,\n slotName: string | string[]\n): boolean => {\n const hasSlot = (nodeList: NodeList) =>\n Array.from(nodeList).some((node) =>\n Array.isArray(slotName)\n ? slotName.some((name) => (node as Element).slot === name)\n : (node as Element).slot === slotName\n );\n return hasSlot(addedNodes) || hasSlot(removedNodes);\n};\n\nexport const isElInAGGrid = (el: HTMLElement): boolean =>\n !!el.closest(\".ag-cell\") && !!el.closest(\".ag-root\");\n\n/**\n * Checks if the component is slotted in its relevant 'group' component\n * @param component - the component to check\n */\nexport const isSlottedInGroup = (component: HTMLElement): boolean =>\n component.parentElement?.tagName === `${component.tagName}-GROUP`;\n\nexport const hasDynamicChildSlots = (\n mutationList: MutationRecord[],\n slotNames: string | string[]\n): boolean =>\n mutationList.some(\n ({ type, addedNodes, removedNodes }) =>\n type === \"childList\" &&\n checkSlotInChildMutations(addedNodes, removedNodes, slotNames)\n );\n\nexport const renderDynamicChildSlots = (\n mutationList: MutationRecord[],\n slotNames: string | string[],\n ref: any\n): void => {\n if (hasDynamicChildSlots(mutationList, slotNames)) {\n forceUpdate(ref);\n }\n};\n\nexport const getElementInheritedTheme = (el: HTMLElement): IcThemeMode => {\n const blockParentTheme =\n el.parentElement?.closest<HTMLIcTopNavigationElement>(\n IC_BLOCK_COLOR_COMPONENTS\n )?.theme;\n\n if (blockParentTheme && blockParentTheme !== \"inherit\")\n return blockParentTheme;\n\n const wrapperTheme = el.parentElement?.closest(\"ic-theme\")?.theme;\n\n if (wrapperTheme && wrapperTheme !== \"system\") return wrapperTheme;\n\n return window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches\n ? \"dark\"\n : \"light\";\n};\n"],"mappings":"0FA0BYA,GAAZ,SAAYA,GACVA,EAAA,qBACAA,EAAA,iBACAA,EAAA,oBACD,EAJD,CAAYA,MAAmB,K,IA0EnBC,GAAZ,SAAYA,GACVA,EAAA,qBACAA,EAAA,eACAA,EAAA,gBACD,EAJD,CAAYA,MAAqB,KC3EjC,MAAMC,EAAsB,SAC5B,MAAMC,EAA2B,WACjC,MAAMC,EAAU,W,MAyBHC,EAAoB,CAC/BC,EACAC,EAAuB,MAEvB,MAAMC,EAA6C,GAEnDD,EAAWE,SAASC,IAClB,MAAMC,EAAQL,EAAQM,aAAaF,GACnC,GAAIC,IAAU,KAAM,CAClBH,EAAgBE,GAAQC,EACxBL,EAAQO,gBAAgBH,E,KAI5B,OAAOF,CAAe,E,MAGXM,EAAgB,CAC3BC,EACAC,KAGA,MAAMC,EAAYF,EAAcG,WAAaH,EAC7C,MAAO,CACLG,UAAWH,EACXI,KAAMC,EAASH,EAASE,KAAKE,KAAKJ,GAAWD,GAC9B,EAGZ,MAAMI,EAAW,CACtBE,EACAN,EAAO,KAEP,IAAIO,EACJ,MAAO,IAAIC,KACTC,aAAaF,GACbA,EAAQG,WAAWJ,EAAMN,KAASQ,EAAK,CACxC,E,MAeUG,EAAoB,CAC/BC,EACAjB,EACAkB,EACAC,EAAW,MACXC,EAAS,QAET,GAAIF,IAASE,GAAUC,EAAaJ,IAAa,CAC/C,IAAIK,EAAQC,EAAsBN,GAElC,IAAKK,EAAO,CACVA,EAAQL,EAAUO,cAAcC,cAAc,SAC9CH,EA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Aa,MAAAU,SAAA,SAAAA,EAAEkB,QAChBC,MACD,MAAAwB,SAAA,SAAAA,EAAE+J,MAEL,GAAID,GAAoBA,IAAqB,UAC3C,OAAOA,EAET,MAAME,GAAezJ,GAAAH,EAAA1D,EAAGC,iBAAa,MAAAyD,SAAA,SAAAA,EAAE7B,QAAQ,eAAW,MAAAgC,SAAA,SAAAA,EAAEwJ,MAE5D,GAAIC,GAAgBA,IAAiB,SAAU,OAAOA,EAEtD,QAAOtJ,EAAAmC,OAAOC,cAAU,MAAApC,SAAA,SAAAA,EAAAuJ,KAAApH,OAAG,gCAAgCE,SACvD,OACA,OAAO,S","ignoreList":[]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{r as e,c as i,h as a,H as t,g as r}from"./p-8e4e97b4.js";import{r as o,l as c,i as n,k as d,o as s,t as l,e as b}from"./p-6ceedfa8.js";import"./p-641c26c4.js";const h='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}ic-radio-option{display:flex;flex-direction:column;width:-moz-fit-content;width:fit-content}.additional-field-wrapper [slot="additional-field"]{margin-top:calc(var(--ic-space-sm) / 2);margin-left:var(--ic-space-xl)}ic-radio-option.ic-radio-option-disabled,ic-radio-option.ic-radio-option-disabled .radio-label{--ic-typography-color:var(--ic-radio-button-text-option-disabled)}.container input:focus+span.checkmark,.container:hover input:focus+span.checkmark,.container:active input:focus+span.checkmark,:host(:focus) .container input:checked+span.checkmark{box-shadow:var(--ic-border-focus)}.container{display:grid;grid-template-columns:min-content auto;position:relative;cursor:pointer;align-items:center;margin:var(--ic-space-xxs) 0 var(--ic-space-xxs) var(--ic-space-xxs)}.container.disabled,.container.disabled input:disabled{cursor:default}.container input{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-block;position:absolute;cursor:pointer;height:var(--ic-space-lg);width:var(--ic-space-lg);border-radius:50%;border:none}.checkmark{display:block;position:relative;top:0;left:0;height:var(--ic-space-lg);width:var(--ic-space-lg);background-color:var(--ic-radio-button-background-default);border:var(--ic-space-1px) solid var(--ic-radio-button-border-default);border-radius:50%;transition:var(--ic-easing-transition-fast);box-sizing:border-box}.container input:checked~.checkmark::after{display:inline-block}.container:hover input~.checkmark{box-shadow:0 0 0 0.25rem var(--ic-radio-button-active-hover);border:var(--ic-border-width) solid var(--ic-radio-button-default-hover)}.container:hover input:checked~.checkmark{box-shadow:0 0 0 0.25rem var(--ic-radio-button-active-hover);border:0.125rem solid var(--ic-radio-button-default-hover)}.container:hover:not(.disabled) input:checked~.checkmark::after{background-color:var(--ic-radio-button-default-hover)}.container:active input~.checkmark{box-shadow:0 0 0 0.25rem var(--ic-radio-button-active-pressed);border:var(--ic-border-width) solid var(--ic-radio-button-default-pressed)}.container:active input:checked~.checkmark{border:0.125rem solid var(--ic-radio-button-default-pressed);box-shadow:0 0 0 0.25rem var(--ic-radio-button-active-pressed)}.container:active input:checked~.checkmark::after{background-color:var(--ic-radio-button-default-pressed)}.container input:checked~.checkmark{border:0.125rem solid var(--ic-radio-button-default-active)}.container input:checked:disabled~.checkmark{border:0.125rem solid var(--ic-radio-button-border-disabled)}.container input:disabled~.checkmark{border:var(--ic-border-width) dashed var(--ic-radio-button-border-disabled)}.container input:disabled~.checkmark::after{background:var(--ic-radio-button-disabled)}.container:hover input:disabled~.checkmark{box-shadow:none;border:0.125rem solid none}.container:active input:disabled~.checkmark::after{background-color:var(--ic-radio-button-disabled)}.container .checkmark::after{content:"";position:absolute;display:none;top:calc(50% - var(--ic-space-xs));left:calc(50% - var(--ic-space-xs));width:var(--ic-space-md);height:var(--ic-space-md);border-radius:50%;background:var(--ic-radio-button-default-active)}.radio-label{margin-left:var(--ic-space-md);--ic-typography-color:var(--ic-radio-button-text-option)}.additional-field-wrapper{margin-left:var(--ic-space-xs)}.branch-corner{color:var(--ic-radio-button-required-bar);height:var(--ic-space-md);width:var(--ic-space-xl);border-radius:0 0 0 0.188rem;border-bottom:0.125rem solid var(--ic-radio-button-required-bar);border-left:0.125rem solid var(--ic-radio-button-required-bar);margin-left:calc(-1 * var(--ic-space-1px))}.dynamic-container{display:flex;position:relative;margin:var(--ic-space-xxxs) 0 var(--ic-space-xxs) var(--ic-space-md);gap:var(--ic-space-xs)}.dynamic-container.hidden{display:none}.dynamic-text{color:var(--ic-radio-button-required-text);--ic-typography-color:var(--ic-radio-button-required-text);margin-top:calc(var(--ic-space-sm) / 2);margin-bottom:var(--ic-space-xs);border-radius:2%}@media (max-width: 576px){ic-text-field{--input-width:100%}}@media (forced-colors: active){.container input:checked~.checkmark,.container:active input:checked~.checkmark{border-color:Highlight}.container input:checked~.checkmark::after,.container:active input:checked~.checkmark::after{background-color:Highlight}.container input:disabled~.checkmark,.container input:checked:disabled~.checkmark{border-color:GrayText}.container input:disabled~.checkmark::after,.container:active input:disabled~.checkmark::after{background-color:GrayText}}input[type="radio"]:dir(rtl){right:0}.radio-label:dir(rtl){padding-right:var(--ic-space-sm);padding-left:0}.branch-corner:dir(rtl){border-radius:0 0 0.188rem;border-right:0.125rem solid var(--ic-action-default);border-left:none}.dynamic-container:dir(rtl){margin:var(--ic-space-xxxs) var(--ic-space-sm) var(--ic-space-xxs) 0}';const p=h;const u="additional-field";const m=class{constructor(a){e(this,a);this.icCheck=i(this,"icCheck",7);this.icSelectedChange=i(this,"icSelectedChange",7);this.defaultRadioValue="";this.hasAdditionalField=false;this.skipFocus=false;this.additionalFieldDisplay="static";this.disabled=false;this.dynamicText="This selection requires additional answers";this.theme="inherit";this.selected=false;this.initiallySelected=this.selected;this.handleClick=e=>{var i,a;const t=e.target.matches(".dynamic-container:not(ic-radio-option, .checkmark), .dynamic-container *:not(ic-radio-option, .checkmark)");if(!this.disabled&&(!t||e.target===this.radioElement)){e.stopPropagation();if(this.skipFocus===false){(i=this.radioElement)===null||i===void 0?void 0:i.focus()}this.skipFocus=false;if(this.hasAdditionalField){this.value=((a=this.getAdditionalField())===null||a===void 0?void 0:a.value)||this.defaultRadioValue}this.icCheck.emit({value:this.value})}};this.handleKeyDown=e=>{const i=["IC-DATE-INPUT","IC-DATE-PICKER"];if(this.getAdditionalField()==document.activeElement&&i.includes(this.getAdditionalField().nodeName)){e.stopPropagation()}};this.handleFormReset=()=>{this.skipFocus=true;this.selected=this.initiallySelected}}watchDisabledHandler(){o(this.disabled,this.el)}watchSelectedHandler(){this.icSelectedChange.emit()}handleCheck(e){if(this.additionalFieldDisplay==="static"&&Array.from(this.el.querySelectorAll("ic-radio-option")).includes(e.target))this.icCheck.emit({value:this.value})}disconnectedCallback(){c(this.el,this.handleFormReset)}componentWillLoad(){if(n(this.el,u)){this.hasAdditionalField=true;this.getAdditionalField()}this.defaultRadioValue=this.value;d(this.el,this.handleFormReset);o(this.disabled,this.el)}componentDidLoad(){s([{prop:this.value,propName:"value"}],"Radio Option")}componentWillRender(){const e=l(this.el,u);if(e&&!this.hasAdditionalField){this.hasAdditionalField=true;this.getAdditionalField()}else if(!e&&this.hasAdditionalField){this.hasAdditionalField=false}}componentDidRender(){if(this.additionalFieldDisplay==="static"){const e=this.getAdditionalField();if(!this.selected||this.disabled){e===null||e===void 0?void 0:e.setAttribute("disabled","")}else{e===null||e===void 0?void 0:e.removeAttribute("disabled")}}}additionalFieldValueHandler(e){if(this.selected){this.value=e.detail.value||this.defaultRadioValue;this.icCheck.emit({value:this.value})}e.stopImmediatePropagation()}async setFocus(){var e;(e=this.radioElement)===null||e===void 0?void 0:e.focus()}async setTabIndex(e){var i;(i=this.radioElement)===null||i===void 0?void 0:i.setAttribute("tabIndex",e.toString())}getAdditionalField(){const e=this.el.querySelector('ic-text-field[slot="additional-field"]');if(e)e.hiddenInput=false;return e}render(){const{additionalFieldDisplay:e,disabled:i,dynamicText:r,form:o,groupLabel:c,handleClick:n,handleKeyDown:d,hasAdditionalField:s,label:l,name:h,selected:p,value:m,theme:f}=this;const v=`ic-radio-option-${b(l)||m}-${c}`;return a(t,{key:"3d233946c372788a34128912099c47d6858d7ea9",onClick:n,onKeyDown:d,class:{["ic-radio-option-disabled"]:!!i,[`ic-theme-${f}`]:f!=="inherit"}},a("div",{key:"e932a0827c6b0620522f9f3df3f5a06316098949",class:{container:true,disabled:!!i}},a("div",{key:"64eeea95469af9831655f56701e2332255bf6669"},a("input",{key:"32f7a8840d8a14a89f1a79b9c61890e0e2fe23a0",tabindex:p?"0":"-1",type:"radio",name:h,id:v,value:m,disabled:i,checked:p,ref:e=>this.radioElement=e,form:o}),a("span",{key:"6cbea9714c51eb75b7be07a509049f0c330ffca5",class:"checkmark"})),a("ic-typography",{key:"55164cf8d231d449267b74389f9d7cd8193ab6db",class:"radio-label",variant:"body"},a("label",{key:"54014827aa5c16641bc3fa864974382bf0715335",htmlFor:v},l))),s&&a("div",{key:"5f3e1054494365c3fafdfd421bed64523307406b",class:{"dynamic-container":true,hidden:e==="dynamic"&&!p}},e==="dynamic"&&a("div",{key:"d9c292dd502569650dcf327a3e48716cde723593",class:"branch-corner"}),a("div",{key:"3994230df8af7e9c5215646a1c5c3d5687961637"},e==="dynamic"&&a("ic-typography",{key:"0b92403d743c4517ca099586a2845e71d528c329",variant:"caption",role:"alert"},a("p",{key:"0b689ea686ff2cb08b27858920a2f0548c197aa7",class:"dynamic-text"},r)),a("div",{key:"7e023eb75b14dd0a75acbe5321ecd676de0a67d4",class:{"additional-field-wrapper":e==="static"}},a("slot",{key:"b3f82b1650ef67a732b35a32c5088745f31d1f31",name:u})))))}get el(){return r(this)}static get watchers(){return{disabled:["watchDisabledHandler"],selected:["watchSelectedHandler"]}}};m.style=p;export{m as ic_radio_option};
|
2
|
-
//# sourceMappingURL=p-75a9b2e4.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["icRadioOptionCss","IcRadioOptionStyle0","ADDITIONAL_FIELD","RadioOption","constructor","hostRef","this","defaultRadioValue","hasAdditionalField","skipFocus","additionalFieldDisplay","disabled","dynamicText","theme","selected","initiallySelected","handleClick","event","clickedAdditionalField","target","matches","radioElement","stopPropagation","_a","focus","value","_b","getAdditionalField","icCheck","emit","handleKeyDown","preventPropagationElements","document","activeElement","includes","nodeName","handleFormReset","watchDisabledHandler","removeDisabledFalse","el","watchSelectedHandler","icSelectedChange","handleCheck","ev","Array","from","querySelectorAll","disconnectedCallback","removeFormResetListener","componentWillLoad","isSlotUsed","addFormResetListener","componentDidLoad","onComponentRequiredPropUndefined","prop","propName","componentWillRender","hasSlot","slotHasContent","componentDidRender","additionalField","setAttribute","removeAttribute","additionalFieldValueHandler","detail","stopImmediatePropagation","setFocus","setTabIndex","toString","querySelector","hiddenInput","render","form","groupLabel","label","name","id","isPropDefined","h","Host","key","onClick","onKeyDown","class","container","tabindex","type","checked","ref","variant","htmlFor","hidden","role"],"sources":["src/components/ic-radio-option/ic-radio-option.css?tag=ic-radio-option","src/components/ic-radio-option/ic-radio-option.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\nic-radio-option {\n display: flex;\n flex-direction: column;\n width: fit-content;\n}\n\n.additional-field-wrapper [slot=\"additional-field\"] {\n margin-top: calc(var(--ic-space-sm) / 2);\n margin-left: var(--ic-space-xl);\n}\n\n/* The label turns grey when disabled */\nic-radio-option.ic-radio-option-disabled,\nic-radio-option.ic-radio-option-disabled .radio-label {\n --ic-typography-color: var(--ic-radio-button-text-option-disabled);\n}\n\n/* Focus states */\n\n.container input:focus + span.checkmark,\n.container:hover input:focus + span.checkmark,\n.container:active input:focus + span.checkmark,\n:host(:focus) .container input:checked + span.checkmark {\n box-shadow: var(--ic-border-focus);\n}\n\n/* The container */\n.container {\n display: grid;\n grid-template-columns: min-content auto;\n position: relative;\n cursor: pointer;\n align-items: center;\n margin: var(--ic-space-xxs) 0 var(--ic-space-xxs) var(--ic-space-xxs);\n}\n\n.container.disabled,\n.container.disabled input:disabled {\n cursor: default;\n}\n\n/* Hide the browser's default radio button */\n.container input {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n display: inline-block;\n position: absolute;\n cursor: pointer;\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n border-radius: 50%;\n border: none;\n}\n\n/* Create a custom radio button */\n.checkmark {\n display: block;\n position: relative;\n top: 0;\n left: 0;\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n background-color: var(--ic-radio-button-background-default);\n border: var(--ic-space-1px) solid var(--ic-radio-button-border-default);\n border-radius: 50%;\n transition: var(--ic-easing-transition-fast);\n box-sizing: border-box;\n}\n\n/* Show the indicator (dot/circle) when checked */\n.container input:checked ~ .checkmark::after {\n display: inline-block;\n}\n\n/* On mouse-over, add a light blue background color */\n.container:hover input ~ .checkmark {\n box-shadow: 0 0 0 0.25rem var(--ic-radio-button-active-hover);\n border: var(--ic-border-width) solid var(--ic-radio-button-default-hover);\n}\n\n.container:hover input:checked ~ .checkmark {\n box-shadow: 0 0 0 0.25rem var(--ic-radio-button-active-hover);\n border: 0.125rem solid var(--ic-radio-button-default-hover);\n}\n\n.container:hover:not(.disabled) input:checked ~ .checkmark::after {\n background-color: var(--ic-radio-button-default-hover);\n}\n\n/* When pressed, adds the active colours */\n.container:active input ~ .checkmark {\n box-shadow: 0 0 0 0.25rem var(--ic-radio-button-active-pressed);\n border: var(--ic-border-width) solid var(--ic-radio-button-default-pressed);\n}\n\n/* When pressed, adds the active colours */\n.container:active input:checked ~ .checkmark {\n border: 0.125rem solid var(--ic-radio-button-default-pressed);\n box-shadow: 0 0 0 0.25rem var(--ic-radio-button-active-pressed);\n}\n\n/* When pressed and selected, adds the active colours */\n.container:active input:checked ~ .checkmark::after {\n background-color: var(--ic-radio-button-default-pressed);\n}\n\n/* When the radio button is checked */\n.container input:checked ~ .checkmark {\n border: 0.125rem solid var(--ic-radio-button-default-active);\n}\n\n/* When the radio button is checked and disabled */\n.container input:checked:disabled ~ .checkmark {\n border: 0.125rem solid var(--ic-radio-button-border-disabled);\n}\n\n/* When the radio button is disabled */\n.container input:disabled ~ .checkmark {\n border: var(--ic-border-width) dashed var(--ic-radio-button-border-disabled);\n}\n\n/* When the radio button is disabled */\n.container input:disabled ~ .checkmark::after {\n background: var(--ic-radio-button-disabled);\n}\n\n/* On mouse-over inactive */\n.container:hover input:disabled ~ .checkmark {\n box-shadow: none;\n border: 0.125rem solid none;\n}\n\n.container:active input:disabled ~ .checkmark::after {\n background-color: var(--ic-radio-button-disabled);\n}\n\n/* Style the indicator (dot/circle) */\n.container .checkmark::after {\n content: \"\";\n position: absolute;\n display: none;\n top: calc(50% - var(--ic-space-xs));\n left: calc(50% - var(--ic-space-xs));\n width: var(--ic-space-md);\n height: var(--ic-space-md);\n border-radius: 50%;\n background: var(--ic-radio-button-default-active);\n}\n\n.radio-label {\n margin-left: var(--ic-space-md);\n\n --ic-typography-color: var(--ic-radio-button-text-option);\n}\n\n.additional-field-wrapper {\n margin-left: var(--ic-space-xs);\n}\n\n/* The line */\n.branch-corner {\n color: var(--ic-radio-button-required-bar);\n height: var(--ic-space-md);\n width: var(--ic-space-xl);\n border-radius: 0 0 0 0.188rem;\n border-bottom: 0.125rem solid var(--ic-radio-button-required-bar);\n border-left: 0.125rem solid var(--ic-radio-button-required-bar);\n margin-left: calc(-1 * var(--ic-space-1px));\n}\n\n/* The dynamic container */\n.dynamic-container {\n display: flex;\n position: relative;\n margin: var(--ic-space-xxxs) 0 var(--ic-space-xxs) var(--ic-space-md);\n gap: var(--ic-space-xs);\n}\n\n.dynamic-container.hidden {\n display: none;\n}\n\n.dynamic-text {\n color: var(--ic-radio-button-required-text);\n\n --ic-typography-color: var(--ic-radio-button-required-text);\n\n margin-top: calc(var(--ic-space-sm) / 2);\n margin-bottom: var(--ic-space-xs);\n border-radius: 2%;\n}\n\n@media (max-width: 576px) {\n ic-text-field {\n --input-width: 100%;\n }\n}\n\n@media (forced-colors: active) {\n /* Styles here only apply to Forced Colors Mode */\n\n .container input:checked ~ .checkmark,\n .container:active input:checked ~ .checkmark {\n border-color: Highlight;\n }\n\n .container input:checked ~ .checkmark::after,\n .container:active input:checked ~ .checkmark::after {\n background-color: Highlight;\n }\n\n .container input:disabled ~ .checkmark,\n .container input:checked:disabled ~ .checkmark {\n border-color: GrayText;\n }\n\n .container input:disabled ~ .checkmark::after,\n .container:active input:disabled ~ .checkmark::after {\n background-color: GrayText;\n }\n}\n\n/* Right to left */\ninput[type=\"radio\"]:dir(rtl) {\n right: 0;\n}\n\n.radio-label:dir(rtl) {\n padding-right: var(--ic-space-sm);\n padding-left: 0;\n}\n\n.branch-corner:dir(rtl) {\n border-radius: 0 0 0.188rem;\n border-right: 0.125rem solid var(--ic-action-default);\n border-left: none;\n}\n\n.dynamic-container:dir(rtl) {\n margin: var(--ic-space-xxxs) var(--ic-space-sm) var(--ic-space-xxs) 0;\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n Listen,\n State,\n Method,\n Watch,\n} from \"@stencil/core\";\nimport {\n IcAdditionalFieldTypes,\n IcThemeMode,\n IcValueEventDetail,\n} from \"../../utils/types\";\nimport {\n onComponentRequiredPropUndefined,\n addFormResetListener,\n removeFormResetListener,\n removeDisabledFalse,\n isPropDefined,\n isSlotUsed,\n slotHasContent,\n} from \"../../utils/helpers\";\n\nconst ADDITIONAL_FIELD = \"additional-field\";\n\n/**\n * @slot additional-field - Content to displayed alongside a radio option.\n */\n@Component({\n tag: \"ic-radio-option\",\n styleUrl: \"ic-radio-option.css\",\n})\nexport class RadioOption {\n private defaultRadioValue: string = \"\";\n private hasAdditionalField: boolean = false;\n private radioElement?: HTMLInputElement;\n private skipFocus = false;\n\n @Element() el: HTMLIcRadioOptionElement;\n\n /**\n * The style of additionalField that will be displayed if used.\n */\n @Prop({ reflect: true }) additionalFieldDisplay?: IcAdditionalFieldTypes =\n \"static\";\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled?: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * The text to be displayed when dynamic.\n */\n @Prop() dynamicText?: string = \"This selection requires additional answers\";\n\n /**\n * The <form> element to associate the radio with.\n */\n @Prop() form?: string;\n\n /**\n * The group label for the radio option.\n */\n @Prop() groupLabel?: string;\n\n /**\n * The label for the radio option.\n */\n @Prop() label?: string;\n\n /**\n * The name for the radio option.\n */\n @Prop() name?: string;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * The value for the radio option.\n */\n @Prop({ mutable: true }) value!: string;\n\n /**\n * If `true`, the radio option will be displayed in a selected state.\n */\n @Prop({ reflect: true, mutable: true }) selected?: boolean = false;\n @State() initiallySelected = this.selected;\n\n @Watch(\"selected\")\n watchSelectedHandler(): void {\n this.icSelectedChange.emit();\n }\n\n /**\n * Emitted when the radio option is selected.\n */\n @Event() icCheck: EventEmitter<IcValueEventDetail>;\n @Listen(\"icCheck\")\n handleCheck(ev: CustomEvent<IcValueEventDetail>): void {\n if (\n this.additionalFieldDisplay === \"static\" &&\n Array.from(this.el.querySelectorAll(\"ic-radio-option\")).includes(\n ev.target as HTMLIcRadioOptionElement\n )\n )\n this.icCheck.emit({ value: this.value });\n }\n\n /**\n * Emitted when the radio option is selected or deselected.\n */\n @Event() icSelectedChange: EventEmitter<void>;\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el, this.handleFormReset);\n }\n\n componentWillLoad(): void {\n if (isSlotUsed(this.el, ADDITIONAL_FIELD)) {\n this.hasAdditionalField = true;\n this.getAdditionalField();\n }\n\n this.defaultRadioValue = this.value;\n\n addFormResetListener(this.el, this.handleFormReset);\n\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.value, propName: \"value\" }],\n \"Radio Option\"\n );\n }\n\n componentWillRender(): void {\n const hasSlot = slotHasContent(this.el, ADDITIONAL_FIELD);\n if (hasSlot && !this.hasAdditionalField) {\n this.hasAdditionalField = true;\n this.getAdditionalField();\n } else if (!hasSlot && this.hasAdditionalField) {\n this.hasAdditionalField = false;\n }\n }\n\n componentDidRender(): void {\n if (this.additionalFieldDisplay === \"static\") {\n const additionalField = this.getAdditionalField();\n if (!this.selected || this.disabled) {\n additionalField?.setAttribute(\"disabled\", \"\");\n } else {\n additionalField?.removeAttribute(\"disabled\");\n }\n }\n }\n\n @Listen(\"icChange\")\n additionalFieldValueHandler(event: CustomEvent<{ value: string }>): void {\n if (this.selected) {\n this.value = event.detail.value || this.defaultRadioValue;\n this.icCheck.emit({\n value: this.value,\n });\n }\n\n event.stopImmediatePropagation();\n }\n\n /**\n * Sets focus on the radio option.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.radioElement?.focus();\n }\n\n /**\n * @internal Sets the tabIndex of the radio option.\n */\n @Method()\n async setTabIndex(value: number): Promise<void> {\n this.radioElement?.setAttribute(\"tabIndex\", value.toString());\n }\n\n private getAdditionalField(): HTMLIcTextFieldElement {\n const additionalField = this.el.querySelector(\n 'ic-text-field[slot=\"additional-field\"]'\n ) as HTMLIcTextFieldElement;\n if (additionalField) additionalField.hiddenInput = false;\n return additionalField;\n }\n\n private handleClick = (event: MouseEvent) => {\n const clickedAdditionalField = (event.target as Element).matches(\n \".dynamic-container:not(ic-radio-option, .checkmark), .dynamic-container *:not(ic-radio-option, .checkmark)\"\n );\n\n if (\n !this.disabled &&\n (!clickedAdditionalField || event.target === this.radioElement)\n ) {\n event.stopPropagation();\n if (this.skipFocus === false) {\n this.radioElement?.focus();\n }\n this.skipFocus = false;\n\n if (this.hasAdditionalField) {\n this.value = this.getAdditionalField()?.value || this.defaultRadioValue;\n }\n\n this.icCheck.emit({\n value: this.value,\n });\n }\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const preventPropagationElements = [\"IC-DATE-INPUT\", \"IC-DATE-PICKER\"];\n\n if (\n this.getAdditionalField() == document.activeElement &&\n preventPropagationElements.includes(this.getAdditionalField().nodeName)\n ) {\n event.stopPropagation();\n }\n };\n\n private handleFormReset = (): void => {\n this.skipFocus = true;\n this.selected = this.initiallySelected;\n };\n\n render() {\n const {\n additionalFieldDisplay,\n disabled,\n dynamicText,\n form,\n groupLabel,\n handleClick,\n handleKeyDown,\n hasAdditionalField,\n label,\n name,\n selected,\n value,\n theme,\n } = this;\n\n const id = `ic-radio-option-${isPropDefined(label) || value}-${groupLabel}`;\n\n return (\n <Host\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n class={{\n [\"ic-radio-option-disabled\"]: !!disabled,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n >\n <div class={{ container: true, disabled: !!disabled }}>\n <div>\n <input\n tabindex={selected ? \"0\" : \"-1\"}\n type=\"radio\"\n name={name}\n id={id}\n value={value}\n disabled={disabled}\n checked={selected}\n ref={(el) => (this.radioElement = el)}\n form={form}\n ></input>\n <span class=\"checkmark\"></span>\n </div>\n <ic-typography class=\"radio-label\" variant=\"body\">\n <label htmlFor={id}>{label}</label>\n </ic-typography>\n </div>\n {hasAdditionalField && (\n <div\n class={{\n \"dynamic-container\": true,\n hidden: additionalFieldDisplay === \"dynamic\" && !selected,\n }}\n >\n {additionalFieldDisplay === \"dynamic\" && (\n <div class=\"branch-corner\"></div>\n )}\n <div>\n {additionalFieldDisplay === \"dynamic\" && (\n <ic-typography variant=\"caption\" role=\"alert\">\n <p class=\"dynamic-text\">{dynamicText}</p>\n </ic-typography>\n )}\n <div\n class={{\n \"additional-field-wrapper\":\n additionalFieldDisplay === \"static\",\n }}\n >\n <slot name={ADDITIONAL_FIELD}></slot>\n </div>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"sKAAA,MAAMA,EAAmB,0oOACzB,MAAAC,EAAeD,EC2Bf,MAAME,EAAmB,mB,MASZC,EAAW,MAJxB,WAAAC,CAAAC,G,8FAKUC,KAAAC,kBAA4B,GAC5BD,KAAAE,mBAA8B,MAE9BF,KAAAG,UAAY,MAOKH,KAAAI,uBACvB,SAKMJ,KAAAK,SAAqB,MASr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as i,h as t,H as s,g as e}from"./p-8e4e97b4.js";import{p as h,h as l}from"./p-6ceedfa8.js";import"./p-641c26c4.js";const a=":host{display:flex;width:100%}.step-item-list{display:flex;margin:0;padding:0}:host(.ic-stepper-default:not(.ic-stepper-aligned-left)) .step-item-list{flex:auto}:host(.ic-stepper-compact) ul ::slotted(ic-step){display:none}:host(.ic-stepper-compact) ul ::slotted(ic-step.show){display:flex}:host(.ic-stepper-compact) ul ::slotted(ic-step.hide){display:none;opacity:0;visibility:hidden}";const o=a;const d=class{constructor(t){i(this,t);var s;this.resizeObserver=null;this.visuallyHidden="visually-hidden";this.alignedFullWidth=true;this.autoSetStepTitles=true;this.lastStepWidth=0;this.noOfResizes=0;this.stepperWidth=(s=document.querySelector("ic-stepper"))===null||s===void 0?void 0:s.getBoundingClientRect().width;this.stepTypes=[];this.variantOverride=this.variant!=="compact";this.aligned="full-width";this.connectorWidth=100;this.hideStepInfo=false;this.theme="inherit";this.variant="default";this.getChildren=()=>{this.steps=Array.from(this.el.querySelectorAll("ic-step"));this.stepsWithStepTitles=Array.from(this.el.querySelectorAll("ic-step[heading]"))};this.checkStepTitles=()=>{if(this.stepsWithStepTitles.length<this.steps.length&&this.variantOverride&&this.variant==="compact"){this.noOfResizes=this.noOfResizes+1;if(this.noOfResizes===1){console.error(`The prop 'heading' is required for all steps of the Stepper component (compact variant)`)}}};this.setStepTypes=()=>{this.getChildren();this.stepTypes=[];for(let i=0;i<this.steps.length;i++){this.stepTypes.push("active")}};this.setStepperWidth=()=>{this.alignedFullWidth=this.variant==="default"&&this.aligned==="full-width";const i=this.steps[this.steps.length-1];i.style.maxWidth="none";if(this.alignedFullWidth){this.stepperWidth=this.el.offsetWidth;i.style.maxWidth=h(`${this.stepperWidth/this.steps.length}px`);this.lastStepWidth=i.offsetWidth}};this.initialiseStepStates=()=>{this.steps.forEach(((i,t)=>{var s,e,l;i.variant=this.variant;i.stepNum=t+1;i.lastStep=t===this.steps.length-1;i.lastStepNum=this.steps.length;if(i.type!=="current"){i.current=false;this.stepTypes[t]=i.type}else{i.current=true}const a=i.shadowRoot&&i.shadowRoot.querySelector(".step > .heading-area");if(this.stepsWithStepTitles.length==0&&this.variantOverride){if(this.variant==="compact"){this.autoSetStepTitles=true;if(this.autoSetStepTitles){i.heading="Step "+i.stepNum;a&&((s=a===null||a===void 0?void 0:a.querySelector(".heading"))===null||s===void 0?void 0:s.setAttribute("aria-hidden","true"))}}if(this.variant==="default"){this.autoSetStepTitles=false;if(!this.autoSetStepTitles){i.heading=undefined;a&&((e=a===null||a===void 0?void 0:a.querySelector(".heading"))===null||e===void 0?void 0:e.removeAttribute("aria-hidden"))}}}if(this.variant==="compact"){if(i.current===true||i.type==="current"){i.classList.remove("hide");i.classList.add("show")}else if(i.classList.contains("show")){i.classList.remove("show");i.classList.add("hide")}if(!i.lastStep){i.nextStepHeading=this.steps[t+1].heading;i.progress=i.stepNum/this.steps.length*100}else if(i.lastStep&&this.stepTypes[t]!=="completed"){i.progress=95}else{i.progress=100}if(this.hideStepInfo&&a!==null){a.classList.remove(this.visuallyHidden)}i.compactStepStyling=this.stepTypes[t]}if(this.variant==="default"){if(!i.lastStep){if(this.alignedFullWidth&&this.stepperWidth!==undefined){i.style.width=h(`${(this.stepperWidth-this.lastStepWidth)/(this.steps.length-1)}px`);i.style.minWidth=h("148px")}}else if(i.lastStep){i.classList.add("last-step");if(this.alignedFullWidth){i.style.maxWidth=`${this.lastStepWidth}px`}else if(this.connectorWidth){i.style.maxWidth=this.connectorWidth>100?h(`${this.connectorWidth+48}px`):h("148px")}}if(this.aligned==="left"&&this.connectorWidth){i.style.width=this.connectorWidth>100?h(`${this.connectorWidth+48}px`):h("148px");const t=(l=i.shadowRoot)===null||l===void 0?void 0:l.querySelector(".step > .step-top > .step-connect");if(t){t.style.width=this.connectorWidth>100?h(`${this.connectorWidth}px`):h("100px")}}if(this.hideStepInfo&&a!==null){a.classList.add(this.visuallyHidden)}}}))};this.setHideStepInfo=()=>{this.steps.forEach((i=>{var t,s,e;const h=(t=i.shadowRoot)===null||t===void 0?void 0:t.querySelector(".step > .heading-area");if(h){if(this.hideStepInfo){(s=h.classList)===null||s===void 0?void 0:s.add(this.visuallyHidden)}else{(e=h.classList)===null||e===void 0?void 0:e.remove(this.visuallyHidden)}}}))};this.overrideVariant=()=>{if(this.variantOverride){let i=148*this.steps.length;if(this.aligned==="left"&&this.connectorWidth&&this.connectorWidth>100){i=(this.connectorWidth+48)*this.steps.length}if(this.el.clientWidth<i){this.variant="compact"}else{this.variant="default"}}};this.resizeObserverCallback=()=>{this.getChildren();this.checkStepTitles();this.overrideVariant();this.setStepperWidth();this.initialiseStepStates();this.handleThemeChange()};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.resizeObserverCallback()}));this.resizeObserver.observe(this.el)}}handleThemeChange(){this.getChildren();this.steps.forEach((i=>{i.theme=this.theme}))}handlePropChange(){this.setHideStepInfo();this.getChildren()}disconnectedCallback(){if(this.resizeObserver!==null){this.resizeObserver.disconnect()}}componentWillLoad(){this.setStepTypes();this.handleThemeChange();if(this.variant==="compact"){this.variantOverride=false}}componentWillRender(){this.initialiseStepStates()}componentDidLoad(){l(this.runResizeObserver)}render(){return t(s,{key:"b7a0dfaa4d7842f9df2f85e1dbc2e693d9c68679",class:{[`ic-stepper-${this.variant}`]:true,["ic-stepper-aligned-left"]:this.variant==="default"&&this.aligned==="left",[`ic-theme-${this.theme}`]:this.theme!=="inherit"}},t("ul",{key:"051a97451fc7e8074978f332aa4aa1a6bcfcd17f",class:"step-item-list"},t("slot",{key:"bbecef8f861b321f530606b70229a15a9d20549b"})))}get el(){return e(this)}static get watchers(){return{theme:["handleThemeChange"],hideStepInfo:["handlePropChange"],variant:["handlePropChange"]}}};d.style=o;export{d as ic_stepper};
|
2
|
-
//# sourceMappingURL=p-8326db29.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["icStepperCss","IcStepperStyle0","Stepper","constructor","hostRef","this","resizeObserver","visuallyHidden","alignedFullWidth","autoSetStepTitles","lastStepWidth","noOfResizes","stepperWidth","_a","document","querySelector","getBoundingClientRect","width","stepTypes","variantOverride","variant","aligned","connectorWidth","hideStepInfo","theme","getChildren","steps","Array","from","el","querySelectorAll","stepsWithStepTitles","checkStepTitles","length","console","error","setStepTypes","i","push","setStepperWidth","lastStep","style","maxWidth","offsetWidth","pxToRem","initialiseStepStates","forEach","step","index","stepNum","lastStepNum","type","current","stepTitleArea","shadowRoot","heading","setAttribute","undefined","_b","removeAttribute","classList","remove","add","contains","nextStepHeading","progress","compactStepStyling","minWidth","stepConnect","_c","setHideStepInfo","overrideVariant","minDefaultStepperWidth","clientWidth","resizeObserverCallback","handleThemeChange","runResizeObserver","ResizeObserver","observe","handlePropChange","disconnectedCallback","disconnect","componentWillLoad","componentWillRender","componentDidLoad","checkResizeObserver","render","h","Host","key","class"],"sources":["src/components/ic-stepper/ic-stepper.css?tag=ic-stepper&encapsulation=shadow","src/components/ic-stepper/ic-stepper.tsx"],"sourcesContent":[":host {\n display: flex;\n width: 100%;\n}\n\n.step-item-list {\n display: flex;\n margin: 0;\n padding: 0;\n}\n\n:host(.ic-stepper-default:not(.ic-stepper-aligned-left)) .step-item-list {\n flex: auto;\n}\n\n:host(.ic-stepper-compact) ul ::slotted(ic-step) {\n display: none;\n}\n\n:host(.ic-stepper-compact) ul ::slotted(ic-step.show) {\n display: flex;\n}\n\n:host(.ic-stepper-compact) ul ::slotted(ic-step.hide) {\n display: none;\n opacity: 0;\n visibility: hidden;\n}\n","import { Component, Element, Host, Prop, h, State, Watch } from \"@stencil/core\";\nimport { checkResizeObserver, pxToRem } from \"../../utils/helpers\";\nimport { IcStepperAlignment } from \"./ic-stepper.types\";\nimport { IcStepTypes, IcStepVariants } from \"../ic-step/ic-step.types\";\nimport { IcThemeMode } from \"../../utils/types\";\n\n@Component({\n tag: \"ic-stepper\",\n styleUrl: \"ic-stepper.css\",\n shadow: true,\n})\nexport class Stepper {\n private resizeObserver: ResizeObserver | null = null;\n private steps: HTMLIcStepElement[];\n private stepsWithStepTitles: HTMLIcStepElement[];\n private visuallyHidden: string = \"visually-hidden\";\n\n @Element() el: HTMLIcStepperElement;\n\n @State() alignedFullWidth: boolean = true;\n @State() autoSetStepTitles: boolean = true;\n @State() lastStepWidth: number = 0;\n @State() noOfResizes?: number = 0;\n @State() stepperWidth: number | undefined = document\n .querySelector(\"ic-stepper\")\n ?.getBoundingClientRect().width;\n @State() stepTypes: IcStepTypes[] = [];\n @State() variantOverride?: boolean = this.variant !== \"compact\";\n\n /**\n * The alignment of the default stepper within its container.\n */\n @Prop() aligned?: IcStepperAlignment = \"full-width\";\n\n /**\n * The length of the connector between each step in pixels. Minimum length is 100px.\n */\n @Prop() connectorWidth?: number = 100;\n\n /**\n * If `true`, the information about each step, i.e. step title, step subtitle and step status, will be hidden on all default steps. The information about each step will still be visible in the compact variant of the stepper.\n */\n @Prop() hideStepInfo?: boolean = 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 @Watch(\"theme\")\n handleThemeChange(): void {\n this.getChildren();\n this.steps.forEach((step) => {\n step.theme = this.theme;\n });\n }\n\n /**\n * The variant of the stepper.\n */\n @Prop({ mutable: true }) variant?: IcStepVariants = \"default\";\n\n @Watch(\"hideStepInfo\")\n @Watch(\"variant\")\n handlePropChange(): void {\n this.setHideStepInfo();\n this.getChildren();\n }\n\n disconnectedCallback(): void {\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n }\n\n componentWillLoad(): void {\n this.setStepTypes();\n this.handleThemeChange();\n\n if (this.variant === \"compact\") {\n this.variantOverride = false;\n }\n }\n\n componentWillRender(): void {\n this.initialiseStepStates();\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n }\n\n // Get all steps currently within this stepper\n private getChildren = (): void => {\n this.steps = Array.from(this.el.querySelectorAll(\"ic-step\"));\n\n this.stepsWithStepTitles = Array.from(\n this.el.querySelectorAll(\"ic-step[heading]\")\n );\n };\n\n // Inform the user that stepTitles are required on all steps in a compact stepper\n private checkStepTitles = (): void => {\n if (\n this.stepsWithStepTitles.length < this.steps.length &&\n this.variantOverride &&\n this.variant === \"compact\"\n ) {\n this.noOfResizes = this.noOfResizes! + 1;\n if (this.noOfResizes === 1) {\n console.error(\n `The prop 'heading' is required for all steps of the Stepper component (compact variant)`\n );\n }\n }\n };\n\n private setStepTypes = (): void => {\n this.getChildren();\n this.stepTypes = [];\n for (let i = 0; i < this.steps.length; i++) {\n this.stepTypes.push(\"active\");\n }\n };\n\n private setStepperWidth = (): void => {\n this.alignedFullWidth =\n this.variant === \"default\" && this.aligned === \"full-width\";\n\n const lastStep = this.steps[this.steps.length - 1];\n lastStep.style.maxWidth = \"none\";\n\n if (this.alignedFullWidth) {\n this.stepperWidth = this.el.offsetWidth;\n lastStep.style.maxWidth = pxToRem(\n `${this.stepperWidth / this.steps.length}px`\n );\n this.lastStepWidth = lastStep.offsetWidth;\n }\n };\n\n private initialiseStepStates = (): void => {\n this.steps.forEach((step, index) => {\n // Set variant\n step.variant = this.variant!;\n // Assign stepNum to each step\n step.stepNum = index + 1;\n // Assign lastStep to final step\n step.lastStep = index === this.steps.length - 1;\n step.lastStepNum = this.steps.length;\n\n if (step.type !== \"current\") {\n step.current = false;\n this.stepTypes[index] = step.type!;\n } else {\n step.current = true;\n }\n\n const stepTitleArea =\n step.shadowRoot &&\n step.shadowRoot.querySelector(\".step > .heading-area\");\n\n if (this.stepsWithStepTitles.length == 0 && this.variantOverride) {\n if (this.variant === \"compact\") {\n this.autoSetStepTitles = true;\n if (this.autoSetStepTitles) {\n step.heading = \"Step \" + step.stepNum;\n stepTitleArea &&\n stepTitleArea\n ?.querySelector(\".heading\")\n ?.setAttribute(\"aria-hidden\", \"true\");\n }\n }\n if (this.variant === \"default\") {\n this.autoSetStepTitles = false;\n if (!this.autoSetStepTitles) {\n step.heading = undefined;\n stepTitleArea &&\n stepTitleArea\n ?.querySelector(\".heading\")\n ?.removeAttribute(\"aria-hidden\");\n }\n }\n }\n\n if (this.variant === \"compact\") {\n if (step.current === true || step.type === \"current\") {\n step.classList.remove(\"hide\");\n step.classList.add(\"show\");\n } else if (step.classList.contains(\"show\")) {\n step.classList.remove(\"show\");\n step.classList.add(\"hide\");\n }\n\n if (!step.lastStep) {\n step.nextStepHeading = this.steps[index + 1].heading;\n step.progress = (step.stepNum / this.steps.length) * 100;\n } else if (step.lastStep && this.stepTypes[index] !== \"completed\") {\n step.progress = 95;\n } else {\n step.progress = 100;\n }\n\n if (this.hideStepInfo && stepTitleArea !== null) {\n stepTitleArea.classList.remove(this.visuallyHidden);\n }\n\n step.compactStepStyling = this.stepTypes[index];\n }\n\n if (this.variant === \"default\") {\n if (!step.lastStep) {\n if (this.alignedFullWidth && this.stepperWidth !== undefined) {\n step.style.width = pxToRem(\n `${\n (this.stepperWidth - this.lastStepWidth) /\n (this.steps.length - 1)\n }px`\n );\n step.style.minWidth = pxToRem(\"148px\");\n }\n } else if (step.lastStep) {\n step.classList.add(\"last-step\");\n if (this.alignedFullWidth) {\n step.style.maxWidth = `${this.lastStepWidth}px`;\n } else if (this.connectorWidth) {\n step.style.maxWidth =\n this.connectorWidth > 100\n ? pxToRem(`${this.connectorWidth + 48}px`)\n : pxToRem(\"148px\");\n }\n }\n\n if (this.aligned === \"left\" && this.connectorWidth) {\n step.style.width =\n this.connectorWidth > 100\n ? pxToRem(`${this.connectorWidth + 48}px`)\n : pxToRem(\"148px\");\n const stepConnect = step.shadowRoot?.querySelector(\n \".step > .step-top > .step-connect\"\n ) as HTMLElement;\n\n if (stepConnect) {\n stepConnect.style.width =\n this.connectorWidth > 100\n ? pxToRem(`${this.connectorWidth}px`)\n : pxToRem(\"100px\");\n }\n }\n\n if (this.hideStepInfo && stepTitleArea !== null) {\n stepTitleArea.classList.add(this.visuallyHidden);\n }\n }\n });\n };\n\n private setHideStepInfo = (): void => {\n this.steps.forEach((step) => {\n const stepTitleArea = step.shadowRoot?.querySelector(\n \".step > .heading-area\"\n );\n\n if (stepTitleArea) {\n if (this.hideStepInfo) {\n stepTitleArea.classList?.add(this.visuallyHidden);\n } else {\n stepTitleArea.classList?.remove(this.visuallyHidden);\n }\n }\n });\n };\n\n private overrideVariant = () => {\n if (this.variantOverride) {\n let minDefaultStepperWidth = 148 * this.steps.length;\n\n if (\n this.aligned === \"left\" &&\n this.connectorWidth &&\n this.connectorWidth > 100\n ) {\n minDefaultStepperWidth = (this.connectorWidth + 48) * this.steps.length;\n }\n if (this.el.clientWidth < minDefaultStepperWidth) {\n this.variant = \"compact\";\n } else {\n this.variant = \"default\";\n }\n }\n };\n\n private resizeObserverCallback = () => {\n this.getChildren();\n this.checkStepTitles();\n this.overrideVariant();\n this.setStepperWidth();\n this.initialiseStepStates();\n this.handleThemeChange();\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.resizeObserverCallback();\n });\n this.resizeObserver.observe(this.el);\n };\n\n render() {\n return (\n <Host\n class={{\n [`ic-stepper-${this.variant}`]: true,\n [\"ic-stepper-aligned-left\"]:\n this.variant === \"default\" && this.aligned === \"left\",\n [`ic-theme-${this.theme}`]: this.theme !== \"inherit\",\n }}\n >\n <ul class=\"step-item-list\">\n <slot></slot>\n </ul>\n </Host>\n );\n }\n}\n"],"mappings":"4HAAA,MAAMA,EAAe,oYACrB,MAAAC,EAAeD,E,MCUFE,EAAO,MALpB,WAAAC,CAAAC,G,gBAMUC,KAAAC,eAAwC,KAGxCD,KAAAE,eAAyB,kBAIxBF,KAAAG,iBAA4B,KAC5BH,KAAAI,kBAA6B,KAC7BJ,KAAAK,cAAwB,EACxBL,KAAAM,YAAuB,EACvBN,KAAAO,cAAmCC,EAAAC,SACzCC,cAAc,iBAAa,MAAAF,SAAA,SAAAA,EAC1BG,wBAAwBC,MACnBZ,KAAAa,UAA2B,GAC3Bb,KAAAc,gBAA4Bd,KAAKe,UAAY,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AoBhF,KAAKuE,kB,CA2N3B,MAAAU,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CACHC,MAAO,CACL,CAAC,cAAcrF,KAAKe,WAAY,KAChC,CAAC,2BACCf,KAAKe,UAAY,WAAaf,KAAKgB,UAAY,OACjD,CAAC,YAAYhB,KAAKmB,SAAUnB,KAAKmB,QAAU,YAG7C+D,EAAA,MAAAE,IAAA,2CAAIC,MAAM,kBACRH,EAAA,QAAAE,IAAA,8C","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["icCheckboxGroupCss","IcCheckboxGroupStyle0","CHECKBOX_SELECTOR","CheckboxGroup","constructor","hostRef","this","disabled","helperText","hideLabel","required","size","theme","validationStatus","validationText","watchDisabledHandler","removeDisabledFalse","el","labelNameHandler","newValue","oldValue","propName","Array","from","querySelectorAll","forEach","checkbox","groupLabel","name","watchThemeHandler","handleChange","ev","target","tagName","stopImmediatePropagation","componentWillLoad","componentDidLoad","onComponentRequiredPropUndefined","prop","label","selectHandler","checkedOptions","filter","checked","icChange","emit","value","map","opt","textFieldValue","_a","querySelector","selectedOption","render","describedBy","getInputDescribedByText","renderSRText","h","Host","key","class","id","trim","useLabelTag","slot","hasValidationStatus","for","ariaLiveMode","status","message"],"sources":["src/components/ic-checkbox-group/ic-checkbox-group.css?tag=ic-checkbox-group&encapsulation=shadow","src/components/ic-checkbox-group/ic-checkbox-group.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n\n --ic-input-label-text-color: var(--ic-checkbox-group-label);\n --ic-input-label-helper-text-color: var(--ic-checkbox-group-subtitle);\n --ic-input-validation-error: var(--ic-checkbox-state-icon-error);\n --ic-input-validation-status-text-color: var(--ic-checkbox-state-text);\n}\n\n:host(.ic-checkbox-group-disabled) {\n --ic-input-label-text-color: var(--ic-checkbox-group-label-disabled);\n --ic-input-label-helper-text-color: var(\n --ic-checkbox-group-subtitle-disabled\n );\n}\n\nic-input-label.error {\n color: var(--ic-checkbox-group-label-error);\n\n --ic-typography-color: var(--ic-checkbox-group-label-error);\n --ic-input-label-helper-text-color: var(--ic-checkbox-group-subtitle-error);\n}\n\nic-input-label:not(.with-helper) .ic-typography-label,\nic-input-label .helpertext {\n margin-bottom: var(--ic-space-sm);\n}\n\n:host(.ic-checkbox-group-small)\n ic-input-label:not(.with-helper)\n .ic-typography-label,\n:host(.ic-checkbox-group-small) ic-input-label .helpertext {\n margin-bottom: calc(var(--ic-space-sm) / 2);\n}\n\n:host(.ic-checkbox-group-large)\n ic-input-label:not(.with-helper)\n .ic-typography-label,\n:host(.ic-checkbox-group-large) ic-input-label .helpertext {\n margin-bottom: calc(var(--ic-space-sm) * 1.5);\n}\n\nic-input-label .helpertext {\n display: block;\n}\n\nic-input-validation {\n margin-top: var(--ic-space-sm);\n}\n\n:host(.ic-checkbox-group-small) ic-input-validation {\n margin-top: calc(var(--ic-space-sm) / 2);\n}\n\n:host(.ic-checkbox-group-large) ic-input-validation {\n margin-top: calc(var(--ic-space-sm) * 1.5);\n}\n\n.checkboxes-container {\n margin-bottom: calc(-1 * var(--ic-space-xxs));\n}\n\n:host(.ic-checkbox-group-small) .checkboxes-container {\n margin-bottom: calc(-1 * var(--ic-space-xxxs));\n}\n\n.screen-reader-only-text {\n position: absolute;\n left: -9999px;\n background-color: #fff;\n color: #000;\n text-transform: none;\n}\n\n.screen-reader-only-text:dir(rtl) {\n right: -9999px;\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Listen,\n Element,\n Event,\n EventEmitter,\n Watch,\n} from \"@stencil/core\";\nimport {\n getInputDescribedByText,\n hasValidationStatus,\n onComponentRequiredPropUndefined,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\nimport {\n IcInformationStatusOrEmpty,\n IcSizes,\n IcThemeMode,\n} from \"../../utils/types\";\nimport { IcChangeEventDetail } from \"./ic-checkbox-group.types\";\n\nconst CHECKBOX_SELECTOR = \"ic-checkbox\";\n\n/**\n * @slot helper-text - Content is set as the helper text for the checkbox group.\n */\n@Component({\n tag: \"ic-checkbox-group\",\n styleUrl: \"ic-checkbox-group.css\",\n shadow: true,\n})\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport class CheckboxGroup {\n @Element() el: HTMLIcCheckboxGroupElement;\n\n /**\n * If `true`, the checkbox group will be set to the disabled state.\n */\n @Prop() disabled: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText: string = \"\";\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: boolean = false;\n\n /**\n * The label for the checkbox group to be displayed.\n */\n @Prop() label!: string;\n\n /**\n * The name for the checkbox group to differentiate from other groups.\n */\n @Prop() name!: string;\n\n @Watch(\"label\")\n @Watch(\"name\")\n labelNameHandler(\n newValue: string,\n oldValue: string,\n propName: \"label\" | \"name\"\n ): void {\n Array.from(this.el.querySelectorAll(CHECKBOX_SELECTOR)).forEach(\n (checkbox) => {\n if (propName === \"label\") checkbox.groupLabel = newValue;\n else if (checkbox.name === oldValue) {\n // If the checkbox name has been set by the parent, then override it\n checkbox.name = newValue;\n }\n }\n );\n }\n\n /**\n * If `true`, the checkbox group will require a value.\n */\n @Prop() required: boolean = false;\n\n /**\n * The size of the checkboxes to be displayed. This does not affect the font size of the label.\n */\n @Prop() size: IcSizes = \"medium\";\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 @Watch(\"theme\")\n watchThemeHandler(newValue: IcThemeMode): void {\n Array.from(this.el.querySelectorAll(CHECKBOX_SELECTOR)).forEach(\n (checkbox) => {\n checkbox.theme = newValue;\n }\n );\n }\n\n /**\n * The validation status - 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 * Emitted when a checkbox is checked.\n */\n @Event() icChange: EventEmitter<IcChangeEventDetail>;\n\n @Listen(\"icChange\")\n handleChange(ev: CustomEvent): void {\n //don't pass on the event if it has come from slotted text field\n //otherwise any icChange handler bound to the checkbox group will also run\n if ((ev.target as HTMLElement).tagName === \"IC-TEXT-FIELD\") {\n ev.stopImmediatePropagation();\n }\n }\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n this.watchThemeHandler(this.theme);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.name, propName: \"name\" },\n ],\n \"Checkbox Group\"\n );\n }\n\n @Listen(\"icCheck\")\n selectHandler({ target }: CustomEvent): void {\n const checkedOptions = Array.from(\n this.el.querySelectorAll(CHECKBOX_SELECTOR)\n ).filter(({ checked, disabled }) => checked && !disabled);\n this.icChange.emit({\n value: checkedOptions.map(({ value }) => value),\n checkedOptions: checkedOptions.map((opt) => ({\n checkbox: opt,\n textFieldValue: opt.querySelector(\"ic-text-field\")?.value,\n })),\n selectedOption: target as HTMLIcCheckboxElement,\n });\n }\n\n render() {\n const {\n disabled,\n helperText,\n hideLabel,\n label,\n name,\n required,\n size,\n theme,\n validationStatus,\n validationText,\n } = this;\n\n const describedBy = getInputDescribedByText(\n this.el,\n name,\n helperText !== \"\",\n validationStatus !== \"\"\n );\n\n const renderSRText = validationStatus === \"error\" || required || hideLabel;\n\n return (\n <Host\n class={{\n \"ic-checkbox-group-disabled\": !!disabled,\n [`ic-checkbox-group-${size}`]: true,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n >\n {renderSRText && (\n <span\n id=\"screenReaderOnlyText\"\n class=\"screen-reader-only-text\"\n aria-hidden=\"true\"\n >\n {label} {validationStatus === \"error\" ? \"invalid data \" : null}{\" \"}\n {required ? \"required\" : null}\n </span>\n )}\n <fieldset\n id={name}\n aria-labelledby={`${\n renderSRText ? \"screenReaderOnlyText\" : \"\"\n } ${describedBy}`.trim()}\n disabled={disabled}\n >\n {!hideLabel && (\n <legend>\n <ic-input-label\n class={{ [`${validationStatus}`]: true }}\n label={label}\n helperText={helperText}\n required={required}\n disabled={disabled}\n useLabelTag={false}\n >\n <slot name=\"helper-text\" slot=\"helper-text\"></slot>\n </ic-input-label>\n </legend>\n )}\n <div class=\"checkboxes-container\">\n <slot></slot>\n </div>\n </fieldset>\n {hasValidationStatus(validationStatus, disabled) && (\n <ic-input-validation\n for={name}\n ariaLiveMode=\"polite\"\n status={validationStatus}\n message={validationText}\n ></ic-input-validation>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"4IAAA,MAAMA,EAAqB,wkIAC3B,MAAAC,EAAeD,ECuBf,MAAME,EAAoB,c,MAWbC,EAAa,MAN1B,WAAAC,CAAAC,G,6CAYUC,KAAAC,SAAoB,MASpBD,KAAAE,WAAqB,GAKrBF,KAAAG,UAAqB,MAiCrBH,KAAAI,SAAoB,MAKpBJ,KAAAK,KAAgB,SAKhBL,KAAAM,MAAqB,UAarBN,KAAAO,iBAA+C,GAK/CP,KAAAQ,eAAyB,E,CAzEjC,oBAAAC,GACEC,EAAoBV,KAAKC,SAAUD,KAAKW,G,CAyB1C,gBAAAC,CACEC,EACAC,EACAC,GAEAC,MAAMC,KAAKjB,KAAKW,GAAGO,iBAAiBtB,IAAoBuB,SACrDC,IACC,GAAIL,IAAa,QAASK,EAASC,WAAaR,OAC3C,GAAIO,EAASE,OAASR,EAAU,CAEnCM,EAASE,KAAOT,C,KAqBxB,iBAAAU,CAAkBV,GAChBG,MAAMC,KAAKjB,KAAKW,GAAGO,iBAAiBtB,IAAoBuB,SACrDC,IACCA,EAASd,MAAQO,CAAQ,G,CAqB/B,YAAAW,CAAaC,GAGX,GAAKA,EAAGC,OAAuBC,UAAY,gBAAiB,CAC1DF,EAAGG,0B,EAIP,iBAAAC,GACEnB,EAAoBV,KAAKC,SAAUD,KAAKW,IACxCX,KAAKu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AE,IAAA,2CACEC,MAAO,CAAE,CAAC,GAAG/C,KAAqB,MAClC0B,MAAOA,EACP/B,WAAYA,EACZE,SAAUA,EACVH,SAAUA,EACVwD,YAAa,OAEbN,EAAA,QAAAE,IAAA,2CAAM/B,KAAK,cAAcoC,KAAK,kBAIpCP,EAAA,OAAAE,IAAA,2CAAKC,MAAM,wBACTH,EAAA,QAAAE,IAAA,+CAGHM,EAAoBpD,EAAkBN,IACrCkD,EAAA,uBAAAE,IAAA,2CACEO,IAAKtC,EACLuC,aAAa,SACbC,OAAQvD,EACRwD,QAASvD,I","ignoreList":[]}
|
@@ -1,2 +0,0 @@
|
|
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{K as o,F as n,r as l,E as c,l as d,w as h,k as u,o as b,J as p,q as f,m,n as x,i as v}from"./p-6ceedfa8.js";import{e as g,I as y}from"./p-641c26c4.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-xs);--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}.hidden-validation{margin:0}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.validationAriaLive="default";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.showValidationMargin=()=>{const e=this.readonly?0:this.maxCharacters;const t=o(this.validationStatus)||o(this.validationText);const i=this.minValueUnattained||this.maxValueExceeded;const a=e>0||this.minCharactersUnattained;return(!t||i||a)&&!this.validationInlineInternal};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=n(a,s,"icon")}}));if(t){i(this)}}}watchDisabledHandler(){l(this.disabled,this.el)}debounceChanged(){this.icChange=c(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;d(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=h(this.el,C);if(this.readonly){this.maxValueExceeded=false;this.minValueUnattained=false}u(this.el,this.handleFormReset);l(this.disabled,this.el)}componentDidLoad(){b([{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&&!g.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:g,max:y,numChars:w,readonly:k,maxCharacters:z,maxCharactersMessage:C,maxCharactersWarning:$,maxCharactersReached:I,maxMessage:M,minCharacters:L,minCharactersMessage:F,minCharactersUnattained:N,minMessage:T,minValueUnattained:j,maxValueExceeded:q,validationAriaLive:V,validationStatus:D,validationText:H,validationInline:W,validationInlineInternal:B,spellcheck:O,inputmode:S,fullWidth:A,truncateValue:E,hiddenInput:K,theme:U,hideLabel:_,type:J,autocapitalize:R,ariaActiveDescendant:G,inheritedAttributes:P,ariaExpanded:Q,ariaOwns:X,autocomplete:Y,role:Z,isFocussed:ee}=this;const te=this.el;const ie=k||u;const ae=q||j||N||$?$?p.Warning:p.Error:D;const se=$?C:q?M:j?T:N?F:H;const re=k?0:z;const oe=V==="default"?$||q||j||ae===p.Error?"assertive":"polite":V;const ne=this.hasStatus(ae)&&!(ae==p.Success&&W)&&!B;const le=d>1;const ce=z>0?`${e}-char-count-desc`:"";const de=re-w;const he=z>0?`${e}-remaining-char-count-desc`:"";const ue=`${de} character${de===1?"":"s"} remaining.`;const be=`${ce} ${w>0?he:""} ${f(this.el,e,l!=="",ne)}`.trim();const pe=ie&&!k;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:"985b46adc3cee088de75766a4230042e4af8c9c3",class:{"ic-text-field-full-width":A,"ic-text-field-disabled":ie,[`ic-theme-${U}`]:U!=="inherit"}},a("ic-input-container",{key:"4b9794b880ab440c1c2e6cf2072c13d9d88cc1fa",readonly:k,disabled:ie},!_&&a("ic-input-label",{key:"6ccf8091d697ddce0dade9a81d38e7bc17315da9",for:e,label:i,helperText:l,required:r,disabled:pe,readonly:k},a("slot",{key:"0ecf6a100c43efdca46f3b7c03ac6a5a8f7cc972",name:"helper-text",slot:"helper-text"})),a("ic-input-component-container",{key:"a1d649e733cab8590b92db3c0ecda49ea021103f",size:o,validationStatus:ae,multiLine:le,disabled:ie,readonly:k,validationInline:W,fullWidth:A},fe&&a("span",{key:"d3228d1ab97951891316b60608ce8a9fbe6295bb",class:{readonly:k,"has-value":this.getNumberOfCharacters(b)>0},slot:"left-icon"},a("slot",{key:"ea62e21d7abc5048da1a8e9a15f5a5a535c963b3",name:"icon"})),!le?a("input",Object.assign({id:e,name:t,ref:e=>this.inputEl=e,type:J,min:g,max:y,value:b,class:{"no-left-pad":!fe&&k,readonly:k,"truncate-value":E},placeholder:n?n:"",required:r,disabled:ie,readonly:k,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,"aria-label":i,"aria-describedby":be,"aria-invalid":me,"aria-activedescendant":G,"aria-expanded":Q,"aria-owns":X,autocomplete:Y,autocapitalize:R,spellcheck:O,inputmode:S,role:Z||undefined,maxlength:I?z:undefined,minlength:N?L:undefined},P)):a("textarea",Object.assign({id:e,class:{"no-resize":h===false||!!k,"no-left-pad":!fe&&!!k,readonly:!!k},name:t,ref:e=>this.inputEl=e,value:b,rows:d,required:r,disabled:ie,placeholder:n,readonly:k,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,onScroll:this.onTextAreaScroll,"aria-label":i,"aria-describedby":be,"aria-invalid":me,autocomplete:Y,autocapitalize:R,spellcheck:O,inputmode:S,maxlength:I?z:undefined,minlength:N?L:undefined},P)),v(te,"clear-button")&&a("slot",{key:"e02f69a6fd4c654b7f3b5f1593f7a29c7412d10f",name:"clear-button"}),v(te,"search-submit-button")&&a("slot",{key:"2e32b1afd58a382a804a356537489efa523009ce",name:"search-submit-button"})),v(te,"menu")&&a("slot",{key:"1cbac8ded359309907e51f16033b03d266eb8828",name:"menu"}),a("ic-input-validation",{key:"d5c1c75305e3bebe54a48b1a2a99429f4f64019a",class:{"hidden-validation":!this.showValidationMargin()},status:this.hasStatus(ae)===false||ae===p.Success&&W||B?"":ae,message:ne?se:"",ariaLiveMode:oe,for:e,fullWidth:A},!k&&re>0&&a("div",{key:"8f44917b384aea5179dd8ec7ecb76c4deac324f4",slot:"validation-message-adornment"},!c&&a("ic-typography",{key:"82c4343bc57ca67df98685ef351032e411010c82",variant:"caption",class:"char-count-text"},a("span",{key:"c89807bfa34112d29f906cf540a97639846970fb",class:"char-count"},w,"/",re)),a("span",{key:"24fef83685d9b7ac8c706c8776485b38fea74973",class:"remaining-char-count-desc","aria-live":"polite",hidden:!ee,id:he},ue),a("span",{key:"98d23cac7439da80ea0d72a355cce23b57e5bea4",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-b80d408f.entry.js.map
|
@@ -1 +0,0 @@
|
|
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","validationAriaLive","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","showValidationMargin","maxNumChars","emptyString","isEmptyString","valueOutsideRange","charsOutsideRange","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","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","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-xs);\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\n.hidden-validation {\n margin: 0;\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 IcValidationAriaLive,\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 value of the `aria-live` attribute on the validation message. When set to \"default\", the `aria-live` value will be handled automatically, e.g. \"assertive\" for `validation-status=\"error\"`.\n */\n @Prop() validationAriaLive: IcValidationAriaLive = \"default\";\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 private showValidationMargin = (): boolean => {\n const maxNumChars = this.readonly ? 0 : this.maxCharacters;\n const emptyString =\n isEmptyString(this.validationStatus) ||\n isEmptyString(this.validationText);\n const valueOutsideRange = this.minValueUnattained || this.maxValueExceeded;\n const charsOutsideRange = maxNumChars > 0 || this.minCharactersUnattained;\n return (\n (!emptyString || valueOutsideRange || charsOutsideRange) &&\n !this.validationInlineInternal\n );\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 validationAriaLive,\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 validationAriaLive === \"default\"\n ? maxCharactersWarning ||\n maxValueExceeded ||\n minValueUnattained ||\n currentStatus === IcInformationStatus.Error\n ? \"assertive\"\n : \"polite\"\n : validationAriaLive;\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 autocomplete={autocomplete}\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 <ic-input-validation\n class={{ \"hidden-validation\": !this.showValidationMargin() }}\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 </ic-input-container>\n </Host>\n );\n }\n}\n"],"mappings":"qOAAA,MAAMA,EAAiB,+uMACvB,MAAAC,EAAeD,EC+Cf,IAAIE,EAAW,EACf,MAAMC,EAAqB,IAAIC,EAAmB,S,MAWrCC,EAAS,MALtB,WAAAC,CAAAC,G,2QAMUC,KAAAC,oBAA+C,GAE/CD,KAAAE,qBAAgD,KAK/CF,KAAAG,SAAmB,EACnBH,KAAAI,qBAAgC,MAChCJ,KAAAK,qBAAgC,MAChCL,KAAAM,wBAAmC,MACnCN,KAAAO,iBAA4B,MAC5BP,KAAAQ,mBAA8B,MAC9BR,KAAAS,WAAsB,MA+BvBT,KAAAU,mBAA2C,UAM3CV,KAAAW,eAAiB,MAKjBX,KAAAY,aAAqC,MAKrCZ,KAAAa,YAAoC,MAKpCb,KAAAc,UAAY,MAKZd,KAAAe,SAAW,MAUXf,KAAAgB,UAAY,MAKZhB,KAAAiB,WAAa,GAKbjB,KAAAkB,cAAgB,MAKhBlB,KAAAmB,UAAY,MAKZnB,KAAAoB,YAAc,KAKdpB,KAAAqB,QAAU,uBAAuB3B,MAOjCM,KAAAsB,UAAmC,OAenCtB,KAAAuB,cAAgB,EAMhBvB,KAAAwB,qBAAuB,oBAAoBxB,KAAKuB,2BAKhDvB,KAAAyB,WAAa,oBAAoBzB,KAAK0B,eAUtC1B,KAAA2B,cAAgB,EAMhB3B,KAAA4B,qBAAuB,oBAAoB5B,KAAK2B,2BAKhD3B,KAAA6B,WAAa,oBAAoB7B,KAAK8B,cAKtC9B,KAAA+B,KAAO/B,KAAKqB,QAKZrB,KAAAgC,YAAc,GAKGhC,KAAAiC,SAAW,MAK5BjC,KAAAkC,SAAW,MAKXlC,KAAAmC,OAAS,MAUTnC,KAAAoC,KAAO,EAKPpC,KAAAqC,KAAuB,SAKvBrC,KAAAsC,WAA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AQ,UAAUd,MAAM,mBACrCF,EAAA,QAAA5B,IAAA,2CAAM8B,MAAM,cACTnK,EAAQ,IAAGoF,KAIlB6E,EAAA,QAAA5B,IAAA,2CACE8B,MAAM,4BAA2B,YACvB,SACVe,QAAS5K,GACTmK,GAAIlB,IAEHC,IAEHS,EAAA,QAAA5B,IAAA,2CAAM6C,OAAQ,KAAMT,GAAIpB,IAAqB,kCACXjE,GAAW,mB","ignoreList":[]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{r as i,c as e,h as t,H as o,g as a}from"./p-8e4e97b4.js";import{d as c,g as r,r as s,o as n,a as l,i as d,b as p}from"./p-6ceedfa8.js";import"./p-641c26c4.js";const h=`<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M10 0C4.47 0 0 4.47 0 10C0 15.53 4.47 20 10 20C15.53 20 20 15.53 20 10C20 4.47 15.53 0 10 0ZM15 13.59L13.59 15L10 11.41L6.41 15L5 13.59L8.59 10L5 6.41L6.41 5L10 8.59L13.59 5L15 6.41L11.41 10L15 13.59Z" fill="currentColor"/>\n</svg>\n`;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:inline-block;max-width:100%;vertical-align:middle}.chip{--chip-bg-color:transparent;--chip-hover-bg:var(--ic-chip-action-hover);--chip-pressed-bg:var(--ic-chip-action-pressed);display:flex;padding:calc(var(--ic-space-xxs) - var(--ic-space-1px)) var(--ic-space-xxs);font-size:0.875rem;border-radius:var(--ic-space-md);text-align:left;text-decoration:none;position:relative;background-color:var(--chip-bg-color);border:var(--ic-border-width) solid transparent;justify-content:space-between}@media (prefers-reduced-motion: no-preference){.chip{transition:var(--ic-easing-transition-fast)}}.chip.small{padding:var(--ic-space-1px) var(--ic-space-xxxs);border-radius:calc(var(--ic-space-md) - var(--ic-space-xxxs))}.chip.large{padding:calc(var(--ic-space-xs) - var(--ic-space-1px)) var(--ic-space-xs);border-radius:calc(var(--ic-space-md) + var(--ic-space-xxs))}.label{padding:0 var(--ic-space-xs)}.chip:focus-within{box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline);z-index:1}ic-tooltip:focus-within{z-index:1}.filled{--chip-bg-color:var(\n --chip-custom-color,\n var(--ic-chip-background-filled-default)\n );--ic-typography-color:var(\n --chip-custom-foreground-color,\n var(--ic-chip-label)\n );color:var(--chip-custom-foreground-color, var(--ic-chip-label))}.filled.disabled{--chip-bg-color:var(--ic-chip-background-filled-inactive)}:host(.ic-chip-dark-text){--chip-custom-foreground-color:var(--ic-architectural-black)}:host(.ic-chip-light-text){--chip-custom-foreground-color:var(--ic-architectural-white)}:host(.ic-chip-dark-text) .chip.filled.hovered:not(:focus-within){--chip-hover-bg:var(--ic-action-dark-bg-hover)}:host(.ic-chip-dark-text) .chip.filled:focus-within{--chip-pressed-bg:var(--ic-action-dark-bg-pressed)}:host(.ic-chip-light-text) .chip.filled.hovered:not(:focus-within){--chip-hover-bg:var(--ic-action-light-bg-hover)}:host(.ic-chip-light-text) .chip.filled:focus-within{--chip-pressed-bg:var(--ic-action-light-bg-pressed)}.outlined{color:var(--ic-chip-outline-label);border-color:var(--chip-custom-color, var(--ic-chip-outline));padding:calc(var(--ic-space-xxs));--ic-typography-color:var(--ic-chip-outline-label)}.outlined.disabled{border:var(--ic-border-disabled);border-color:var(--ic-chip-outline-inactive)}.chip.disabled ic-typography{--ic-typography-color:var(--ic-chip-label-inactive)}.dismiss-icon{border:none;border-radius:50%;padding:0;color:currentcolor;background:none;cursor:pointer;margin:var(--ic-space-xxxs);height:calc(var(--ic-space-lg) - var(--ic-space-xxs));width:calc(var(--ic-space-lg) - var(--ic-space-xxs))}.dismiss-icon:focus{outline:var(--ic-hc-focus-outline)}.dismiss-icon[disabled]{pointer-events:none;color:var(--ic-chip-icon-inactive)}.icon{padding:var(--ic-space-xxxs);box-sizing:border-box}.icon,ic-tooltip{width:var(--ic-space-lg);height:var(--ic-space-lg)}.chip.disabled path,.chip.disabled ::slotted(svg){fill:var(--ic-chip-icon-inactive)}.outlined.non-transparent{background-color:var(--ic-chip-outline-background)}:host .chip.hovered:not(:focus-within){background-image:linear-gradient(var(--chip-hover-bg) 0 0)}:host .chip:focus-within{background-image:linear-gradient(var(--chip-pressed-bg) 0 0)}.sr-only{position:absolute;left:-9999px}.sr-only:dir(rtl){right:-9999px}@media (forced-colors: active){.chip{border:var(--ic-border-hc)}.chip.disabled{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-color:GrayText}.chip.disabled ic-typography{--ic-typography-color:GrayText}.chip.disabled path,.chip.disabled ::slotted(svg){fill:GrayText}.chip:focus-within{outline:none;border-color:Highlight}}';const u=b;const g=class{constructor(t){i(this,t);this.icDismiss=e(this,"icDismiss",7);this.foregroundColor=null;this.hovered=false;this.visible=true;this.disabled=false;this.dismissible=false;this.dismissLabel="Dismiss";this.size="medium";this.theme="inherit";this.transparentBackground=true;this.variant="filled";this.dismissAction=()=>{this.icDismiss.emit()};this.mouseEnterHandler=()=>{this.hovered=true};this.mouseLeaveHandler=()=>{this.hovered=false}}customColorHandler(){const i=this.customColor&&c(this.customColor);if(!i){this.foregroundColor=null;return}const{r:e,g:t,b:o,a}=i;this.foregroundColor=r((e*299+t*587+o*114)/1e3);this.el.setAttribute("style",`--chip-custom-color: rgba(${e}, ${t}, ${o}, ${a});`)}watchDisabledHandler(){s(this.disabled,this.el)}disconnectedCallback(){var i;(i=this.hostMutationObserver)===null||i===void 0?void 0:i.disconnect()}componentWillLoad(){s(this.disabled,this.el);this.customColorHandler()}componentDidLoad(){n([{prop:this.label,propName:"label"}],"Chip");this.hostMutationObserver=new MutationObserver((i=>l(i,["icon","badge"],this)));this.hostMutationObserver.observe(this.el,{childList:true})}handleClick(){this.visible=!this.visible}async setFocus(){var i;(i=this.buttonEl)===null||i===void 0?void 0:i.focus()}render(){const{label:i,variant:e,size:a,dismissible:c,visible:r,disabled:s,hovered:n,theme:l,foregroundColor:b,dismissLabel:u,transparentBackground:g}=this;const f=`${i} chip`;return t(o,{key:"ced030b6d7a5aeb6b7030ea7858200187d16ae90",class:{[`ic-theme-${l}`]:l!=="inherit",[`ic-chip-${b}-text`]:e==="filled"&&!!b}},r&&t("div",{key:"dca2da18144d1ee47d9507cbb616bc6493060f94",class:{chip:true,[`${e}`]:true,[`${a}`]:true,disabled:s,dismissible:c,hovered:n,"non-transparent":e==="outlined"&&!g}},d(this.el,"icon")&&t("div",{key:"3e1537327125e7cfd54a20aeeb3f6279560da02f",class:"icon"},t("slot",{key:"33a229dad89f94f165c0a3f77e83720e1cc0603f",name:"icon"})),t("ic-typography",{key:"7445c7ae2254c909af206b43e5044f643177f1af",variant:"label","apply-vertical-margins":false,class:{label:true,"in-ag-grid":p(this.el)}},t("span",{key:"af34cb3ca942ea778c3ba4716f983755571626db"},i)),c&&t("ic-tooltip",{key:"7664945e7ddc8cb66a302265a5b7affcea514241",label:u,target:"dismiss-icon",class:{"tooltip-disabled":s}},t("button",{key:"692fd13b54eef71e29ef4d3639182617770684df",id:"dismiss-icon",class:"dismiss-icon",ref:i=>this.buttonEl=i,"aria-label":`${u} ${f}`,disabled:s,tabindex:s?-1:0,onClick:this.dismissAction,onMouseEnter:this.mouseEnterHandler,onMouseLeave:this.mouseLeaveHandler,innerHTML:h})),d(this.el,"badge")&&t("slot",{key:"6db0a5f0dd29df3315caa52aba01d339449e3bdd",name:"badge"})),c&&t("div",{key:"2d989a411ff7eedad1e9238714c704c3e2d0d536",class:"sr-only","aria-live":"polite"},!r?`Dismissed ${f}`:""))}static get delegatesFocus(){return true}get el(){return a(this)}static get watchers(){return{customColor:["customColorHandler"],disabled:["watchDisabledHandler"]}}};g.style=u;export{g as ic_chip};
|
2
|
-
//# sourceMappingURL=p-c81ffadd.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["icChipCss","IcChipStyle0","Chip","constructor","hostRef","this","foregroundColor","hovered","visible","disabled","dismissible","dismissLabel","size","theme","transparentBackground","variant","dismissAction","icDismiss","emit","mouseEnterHandler","mouseLeaveHandler","customColorHandler","colorRGBA","customColor","convertToRGBA","r","g","b","a","getBrandForegroundAppearance","el","setAttribute","watchDisabledHandler","removeDisabledFalse","disconnectedCallback","_a","hostMutationObserver","disconnect","componentWillLoad","componentDidLoad","onComponentRequiredPropUndefined","prop","label","propName","MutationObserver","mutationList","renderDynamicChildSlots","observe","childList","handleClick","setFocus","buttonEl","focus","render","ariaLabel","h","Host","key","class","chip","isSlotUsed","name","isElInAGGrid","target","id","ref","tabindex","onClick","onMouseEnter","onMouseLeave","innerHTML","dismissIcon"],"sources":["src/components/ic-chip/ic-chip.css?tag=ic-chip&encapsulation=shadow","src/components/ic-chip/ic-chip.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: inline-block;\n max-width: 100%;\n vertical-align: middle;\n}\n\n.chip {\n --chip-bg-color: transparent;\n --chip-hover-bg: var(--ic-chip-action-hover);\n --chip-pressed-bg: var(--ic-chip-action-pressed);\n\n display: flex;\n padding: calc(var(--ic-space-xxs) - var(--ic-space-1px)) var(--ic-space-xxs);\n font-size: 0.875rem;\n border-radius: var(--ic-space-md);\n text-align: left;\n text-decoration: none;\n position: relative;\n background-color: var(--chip-bg-color);\n border: var(--ic-border-width) solid transparent;\n justify-content: space-between;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .chip {\n transition: var(--ic-easing-transition-fast);\n }\n}\n\n.chip.small {\n padding: var(--ic-space-1px) var(--ic-space-xxxs);\n border-radius: calc(var(--ic-space-md) - var(--ic-space-xxxs));\n}\n\n.chip.large {\n padding: calc(var(--ic-space-xs) - var(--ic-space-1px)) var(--ic-space-xs);\n border-radius: calc(var(--ic-space-md) + var(--ic-space-xxs));\n}\n\n.label {\n padding: 0 var(--ic-space-xs);\n}\n\n.chip:focus-within {\n box-shadow: var(--ic-border-focus);\n outline: var(--ic-hc-focus-outline);\n z-index: 1;\n}\n\nic-tooltip:focus-within {\n z-index: 1;\n}\n\n.filled {\n --chip-bg-color: var(\n --chip-custom-color,\n var(--ic-chip-background-filled-default)\n );\n --ic-typography-color: var(\n --chip-custom-foreground-color,\n var(--ic-chip-label)\n );\n\n color: var(--chip-custom-foreground-color, var(--ic-chip-label));\n}\n\n.filled.disabled {\n --chip-bg-color: var(--ic-chip-background-filled-inactive);\n}\n\n:host(.ic-chip-dark-text) {\n --chip-custom-foreground-color: var(--ic-architectural-black);\n}\n\n:host(.ic-chip-light-text) {\n --chip-custom-foreground-color: var(--ic-architectural-white);\n}\n\n:host(.ic-chip-dark-text) .chip.filled.hovered:not(:focus-within) {\n --chip-hover-bg: var(--ic-action-dark-bg-hover);\n}\n\n:host(.ic-chip-dark-text) .chip.filled:focus-within {\n --chip-pressed-bg: var(--ic-action-dark-bg-pressed);\n}\n\n:host(.ic-chip-light-text) .chip.filled.hovered:not(:focus-within) {\n --chip-hover-bg: var(--ic-action-light-bg-hover);\n}\n\n:host(.ic-chip-light-text) .chip.filled:focus-within {\n --chip-pressed-bg: var(--ic-action-light-bg-pressed);\n}\n\n.outlined {\n color: var(--ic-chip-outline-label);\n border-color: var(--chip-custom-color, var(--ic-chip-outline));\n padding: calc(var(--ic-space-xxs));\n\n --ic-typography-color: var(--ic-chip-outline-label);\n}\n\n.outlined.disabled {\n border: var(--ic-border-disabled);\n border-color: var(--ic-chip-outline-inactive);\n}\n\n.chip.disabled ic-typography {\n --ic-typography-color: var(--ic-chip-label-inactive);\n}\n\n.dismiss-icon {\n border: none;\n border-radius: 50%;\n padding: 0;\n color: currentcolor;\n background: none;\n cursor: pointer;\n margin: var(--ic-space-xxxs);\n height: calc(var(--ic-space-lg) - var(--ic-space-xxs));\n width: calc(var(--ic-space-lg) - var(--ic-space-xxs));\n}\n\n.dismiss-icon:focus {\n outline: var(--ic-hc-focus-outline);\n}\n\n.dismiss-icon[disabled] {\n pointer-events: none;\n color: var(--ic-chip-icon-inactive);\n}\n\n.icon {\n padding: var(--ic-space-xxxs);\n box-sizing: border-box;\n}\n\n.icon,\nic-tooltip {\n width: var(--ic-space-lg);\n height: var(--ic-space-lg);\n}\n\n.chip.disabled path,\n.chip.disabled ::slotted(svg) {\n fill: var(--ic-chip-icon-inactive);\n}\n\n.outlined.non-transparent {\n background-color: var(--ic-chip-outline-background);\n}\n\n:host .chip.hovered:not(:focus-within) {\n background-image: linear-gradient(var(--chip-hover-bg) 0 0);\n}\n\n:host .chip:focus-within {\n background-image: linear-gradient(var(--chip-pressed-bg) 0 0);\n}\n\n.sr-only {\n position: absolute;\n left: -9999px;\n}\n\n.sr-only:dir(rtl) {\n right: -9999px;\n}\n\n@media (forced-colors: active) {\n .chip {\n border: var(--ic-border-hc);\n }\n\n .chip.disabled {\n appearance: none;\n border-color: GrayText;\n }\n\n .chip.disabled ic-typography {\n --ic-typography-color: GrayText;\n }\n\n .chip.disabled path,\n .chip.disabled ::slotted(svg) {\n fill: GrayText;\n }\n\n .chip:focus-within {\n outline: none;\n border-color: Highlight;\n }\n}\n","import {\n Component,\n h,\n Prop,\n State,\n Listen,\n Event,\n EventEmitter,\n Element,\n Method,\n Watch,\n Host,\n} from \"@stencil/core\";\nimport {\n onComponentRequiredPropUndefined,\n isSlotUsed,\n removeDisabledFalse,\n convertToRGBA,\n isElInAGGrid,\n getBrandForegroundAppearance,\n renderDynamicChildSlots,\n} from \"../../utils/helpers\";\nimport {\n IcBrandForegroundNoDefault,\n IcColor,\n IcEmphasisType,\n IcSizes,\n IcThemeMode,\n} from \"../../utils/types\";\nimport dismissIcon from \"../../assets/dismiss-icon.svg\";\n\n/**\n * @slot icon - Content will be rendered at the start of the chip.\n * @slot badge - Badge component overlaying the top right of the chip.\n */\n@Component({\n tag: \"ic-chip\",\n styleUrl: \"ic-chip.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Chip {\n private buttonEl?: HTMLButtonElement;\n private hostMutationObserver?: MutationObserver;\n\n @Element() el: HTMLIcChipElement;\n\n @State() foregroundColor: IcBrandForegroundNoDefault | null = null;\n @State() hovered = false;\n @State() visible = true;\n\n /**\n * The custom chip colour. This will override the theme colour.\n * Can be a hex value e.g. \"#ff0000\", RGB e.g. \"rgb(255, 0, 0)\", or RGBA e.g. \"rgba(255, 0, 0, 1)\".\n */\n @Prop() customColor?: IcColor;\n @Watch(\"customColor\")\n customColorHandler(): void {\n const colorRGBA = this.customColor && convertToRGBA(this.customColor);\n if (!colorRGBA) {\n this.foregroundColor = null;\n return;\n }\n\n const { r, g, b, a } = colorRGBA;\n this.foregroundColor = getBrandForegroundAppearance(\n (r * 299 + g * 587 + b * 114) / 1000\n );\n this.el.setAttribute(\n \"style\",\n `--chip-custom-color: rgba(${r}, ${g}, ${b}, ${a});`\n );\n }\n\n /**\n * If `true`, the chip will appear disabled.\n */\n @Prop() disabled = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * If `true`, the chip will have a close button at the end to dismiss it.\n */\n @Prop() dismissible = false;\n\n /**\n * The text in the dismiss button tooltip and aria label. Makes the user aware of the action resulting from clicking the 'Dismiss chip' button.\n */\n @Prop() dismissLabel = \"Dismiss\";\n\n /**\n * The text rendered within the chip.\n */\n @Prop() label!: string;\n\n /**\n * The size of the chip.\n */\n @Prop() size: IcSizes = \"medium\";\n /**\n * Sets the chip to the dark or light theme colors. \"inherit\" will set the color based on the system settings or ic-theme component.\n * Setting the \"customColor\" prop will override this.\n */\n @Prop() theme: IcThemeMode = \"inherit\";\n\n /**\n * If `true`, the outlined variant of chip will have a transparent background rather than the theme defined color.\n */\n @Prop() transparentBackground = true;\n\n /**\n * The emphasis of the chip.\n */\n @Prop() variant: IcEmphasisType = \"filled\";\n\n /**\n * Is emitted when the user dismisses the chip.\n */\n @Event() icDismiss: EventEmitter<void>;\n\n disconnectedCallback(): void {\n this.hostMutationObserver?.disconnect();\n }\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n this.customColorHandler();\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Chip\"\n );\n\n this.hostMutationObserver = new MutationObserver((mutationList) =>\n renderDynamicChildSlots(mutationList, [\"icon\", \"badge\"], this)\n );\n this.hostMutationObserver.observe(this.el, {\n childList: true,\n });\n }\n\n @Listen(\"icDismiss\", { capture: true })\n handleClick(): void {\n this.visible = !this.visible;\n }\n\n /**\n * Sets focus on the chip.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.buttonEl?.focus();\n }\n\n private dismissAction = () => {\n this.icDismiss.emit();\n };\n\n private mouseEnterHandler = () => {\n this.hovered = true;\n };\n\n private mouseLeaveHandler = () => {\n this.hovered = false;\n };\n\n render() {\n const {\n label,\n variant,\n size,\n dismissible,\n visible,\n disabled,\n hovered,\n theme,\n foregroundColor,\n dismissLabel,\n transparentBackground,\n } = this;\n\n const ariaLabel = `${label} chip`;\n\n return (\n <Host\n class={{\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n [`ic-chip-${foregroundColor}-text`]:\n variant === \"filled\" && !!foregroundColor,\n }}\n >\n {visible && (\n <div\n class={{\n chip: true,\n [`${variant}`]: true,\n [`${size}`]: true,\n disabled,\n dismissible,\n hovered,\n \"non-transparent\":\n variant === \"outlined\" && !transparentBackground,\n }}\n >\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon\">\n <slot name=\"icon\" />\n </div>\n )}\n <ic-typography\n variant=\"label\"\n apply-vertical-margins={false}\n class={{ label: true, \"in-ag-grid\": isElInAGGrid(this.el) }}\n >\n <span>{label}</span>\n </ic-typography>\n {dismissible && (\n <ic-tooltip\n label={dismissLabel}\n target=\"dismiss-icon\"\n class={{ \"tooltip-disabled\": disabled }}\n >\n <button\n id=\"dismiss-icon\"\n class=\"dismiss-icon\"\n ref={(el) => (this.buttonEl = el)}\n aria-label={`${dismissLabel} ${ariaLabel}`}\n disabled={disabled}\n tabindex={disabled ? -1 : 0}\n onClick={this.dismissAction}\n onMouseEnter={this.mouseEnterHandler}\n onMouseLeave={this.mouseLeaveHandler}\n innerHTML={dismissIcon}\n ></button>\n </ic-tooltip>\n )}\n {isSlotUsed(this.el, \"badge\") && <slot name=\"badge\"></slot>}\n </div>\n )}\n {dismissible && (\n <div class=\"sr-only\" aria-live=\"polite\">\n {!visible ? `Dismissed ${ariaLabel}` : \"\"}\n </div>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"6eAAA,MAAMA,EAAY,o4LAClB,MAAAC,EAAeD,E,MCyCFE,EAAI,MAPjB,WAAAC,CAAAC,G,+CAaWC,KAAAC,gBAAqD,KACrDD,KAAAE,QAAU,MACVF,KAAAG,QAAU,KA4BXH,KAAAI,SAAW,MASXJ,KAAAK,YAAc,MAKdL,KAAAM,aAAe,UAUfN,KAAAO,KAAgB,SAKhBP,KAAAQ,MAAqB,UAKrBR,KAAAS,sBAAwB,KAKxBT,KAAAU,QAA0B,SA2C1BV,KAAAW,cAAgB,KACtBX,KAAKY,UAAUC,MAAM,EAGfb,KAAAc,kBAAoB,KAC1Bd,KAAKE,QAAU,IAAI,EAGbF,KAAAe,kBAAoB,KAC1Bf,KAAKE,QAAU,KAAK,C,CA/GtB,kBAAAc,GACE,MAAMC,EAAYjB,KAAKkB,aAAeC,EAAcnB,KAAKkB,aACzD,IAAKD,EAAW,CACdjB,KAAKC,gBAAkB,KACvB,M,CAGF,MAAMmB,EAAEA,EAACC,EAAEA,EAACC,EAAEA,EAACC,GAAQN,EACvBjB,KAAKC,gBAAkBuB,GACpBJ,EAAI,IAAMC,EAAI,IAAMC,EAAI,KAAO,KAElCtB,KAAKyB,GAAGC,aACN,QACA,6BAA6BN,MAAMC,MAAMC,MAAMC,M,CASnD,oBAAAI,GACEC,EAAoB5B,KAAKI,SAAUJ,KAAKyB,G,CA2C1C,oBAAAI,G,OACEC,EAAA9B,KAAK+B,wBAAoB,MAAAD,SAAA,SAAAA,EAAEE,Y,CAG7B,iBAAAC,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O,CAAE,mBAAoBjD,IAE7B8C,EAAA,UAAAE,IAAA,2CACEO,GAAG,eACHN,MAAM,eACNO,IAAMnC,GAAQzB,KAAK8C,SAAWrB,EAAG,aACrB,GAAGnB,KAAgB2C,IAC/B7C,SAAUA,EACVyD,SAAUzD,GAAY,EAAI,EAC1B0D,QAAS9D,KAAKW,cACdoD,aAAc/D,KAAKc,kBACnBkD,aAAchE,KAAKe,kBACnBkD,UAAWC,KAIhBX,EAAWvD,KAAKyB,GAAI,UAAYyB,EAAA,QAAAE,IAAA,2CAAMI,KAAK,WAG/CnD,GACC6C,EAAA,OAAAE,IAAA,2CAAKC,MAAM,UAAS,YAAW,WAC3BlD,EAAU,aAAa8C,IAAc,I","ignoreList":[]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{r as t,c as i,h as e,H as s,g as a}from"./p-8e4e97b4.js";import{t as o,r as n,h as r,o as l,s as h}from"./p-6ceedfa8.js";import"./p-641c26c4.js";const d='/*! 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-text-color:var(--ic-radio-button-input-field-label);--ic-input-label-helper-text-color:var(\n --ic-radio-button-input-field-subtitle\n );--ic-input-validation-status-text-color:var(--ic-radio-button-state-text);--ic-input-validation-error:var(--ic-radio-button-state-icon-error)}ic-input-label.error{--ic-input-label-text-color:var(--ic-radio-button-input-field-label-error)}ic-input-label.disabled{--ic-input-label-text-color:var(\n --ic-radio-button-input-field-label-disabled\n );--ic-input-label-helper-text-color:var(\n --ic-radio-button-input-field-subtitle-disabled\n )}ic-input-validation{margin-top:var(--ic-space-sm)}:host(.ic-radio-group-small) ic-input-validation{margin-top:calc(var(--ic-space-sm) / 2)}ic-input-label:not(.with-helper) .ic-typography-label,ic-input-label .helpertext{margin-bottom:var(--ic-space-sm)}:host(.ic-radio-group-small) ic-input-label:not(.with-helper) .ic-typography-label,:host(.ic-radio-group-small) ic-input-label .helpertext{margin-bottom:calc(var(--ic-space-sm) / 2)}ic-input-label .helpertext{display:block}:host .radio-buttons-container{display:flex;flex-direction:column;gap:var(--ic-space-xxs)}:host(.ic-radio-group-small) .radio-buttons-container{gap:var(--ic-space-xxxs)}:host .radio-buttons-container.horizontal{display:flex;flex-direction:row;gap:calc(var(--ic-space-xl) + var(--ic-space-xs))}:host(.ic-radio-group-small) .radio-buttons-container.horizontal{gap:var(--ic-space-xl)}';const c=d;const p=class{constructor(e){t(this,e);this.icChange=i(this,"icChange",7);this.resizeObserver=null;this.ADDITIONAL_FIELD="additional-field";this.RADIO_HORIZONTAL="horizontal";this.RADIO_VERTICAL="vertical";this.checkedValue="";this.selectedChild=-1;this.disabled=false;this.hideLabel=false;this.orientation="vertical";this.required=false;this.size="medium";this.validationStatus="";this.validationText="";this.theme="inherit";this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.checkOrientation()}));this.resizeObserver.observe(this.el)};this.handleKeyDown=t=>{const i=Array.from(this.el.querySelectorAll('ic-text-field[slot="additional-field"]'));const e=document.activeElement;if(i.length>0&&this.radioOptions.map((t=>o(t,this.ADDITIONAL_FIELD)))&&i.map((t=>t==e))){return}t.stopPropagation();switch(t.key){case"ArrowDown":case"ArrowRight":this.radioOptions[this.getNextItemToSelect(this.selectedChild,true)].click();t.preventDefault();break;case"ArrowUp":case"ArrowLeft":this.radioOptions[this.getNextItemToSelect(this.selectedChild,false)].click();t.preventDefault()}};this.getNextItemToSelect=(t,i)=>{const e=this.radioOptions.length-1;if(t<1){t=0}let s=i?t+1:t-1;if(s<0){s=e}else if(s>e){s=0}if(this.radioOptions[s].disabled){s=this.getNextItemToSelect(s,i)}return s};this.addSlotChangeListener=()=>{var t;(t=this.radioContainer)===null||t===void 0?void 0:t.addEventListener("slotchange",this.setRadioOptions)};this.setFirstRadioOptionTabIndex=t=>{this.radioOptions[0].setTabIndex(t)};this.setRadioOptions=()=>{this.selectedChild=-1;this.checkedValue="";this.radioOptions=Array.from(this.el.children).filter((t=>t.tagName==="IC-RADIO-OPTION"));if(this.radioOptions.length>0){this.radioOptions.forEach(((t,i)=>{if(!t.selected){t.selected=this.checkedValue===t.value}t.name=this.name;t.groupLabel=this.label;if(t.selected){this.selectedChild=i;this.checkedValue=t.value}if(this.disabled){t.disabled=true}}));this.setFirstRadioOptionTabIndex(this.selectedChild>0?-1:0);if(this.initialOrientation===this.RADIO_HORIZONTAL&&this.radioOptions!==undefined&&(this.radioOptions.length>2||this.radioOptions.length===2&&(o(this.radioOptions[0],this.ADDITIONAL_FIELD)||o(this.radioOptions[1],this.ADDITIONAL_FIELD)))){this.currentOrientation=this.RADIO_VERTICAL}}}}watchDisabledHandler(t){this.radioOptions.forEach((i=>i.disabled=t));n(this.disabled,this.el)}orientationChangeHandler(){this.initialOrientation=this.orientation;this.checkOrientation()}watchThemeHandler(t){this.radioOptions.forEach((i=>i.theme=t))}disconnectedCallback(){var t,i;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect();(i=this.radioContainer)===null||i===void 0?void 0:i.removeEventListener("slotchange",this.setRadioOptions)}componentWillLoad(){n(this.disabled,this.el);this.orientationChangeHandler();this.currentOrientation=this.initialOrientation}componentDidLoad(){this.setRadioOptions();r(this.runResizeObserver);this.addSlotChangeListener();l([{prop:this.label,propName:"label"},{prop:this.name,propName:"name"}],"Radio Group");this.watchThemeHandler(this.theme)}selectHandler({detail:t,target:i}){var e;const s=i;if(s.parentElement===this.el){this.checkedValue=t.value;this.icChange.emit({value:this.checkedValue,selectedOption:{radio:s,textFieldValue:(e=s===null||s===void 0?void 0:s.querySelector("ic-text-field"))===null||e===void 0?void 0:e.value}});if(this.radioOptions!==undefined){this.radioOptions.forEach(((t,i)=>{t.selected=s===t;if(t.selected){this.selectedChild=i}}));this.setFirstRadioOptionTabIndex(this.selectedChild>0?-1:0)}}}changeHandler(){var t;const i=(t=this.radioOptions)===null||t===void 0?void 0:t.findIndex((t=>t.selected));if(i<0){this.setFirstRadioOptionTabIndex(0);this.selectedChild=i}}checkOrientation(){if(this.initialOrientation===this.RADIO_HORIZONTAL){let t=0;if(Array.isArray(this.radioOptions)&&this.radioOptions.length>0){this.radioOptions.forEach((({clientWidth:i},e,s)=>{t+=i;if(e<s.length-1)t+=40}))}else{t=0}if(this.initialOrientation==this.RADIO_HORIZONTAL){if(this.radioOptions!==undefined&&(this.radioOptions.length>2||this.radioOptions.length===2&&(o(this.radioOptions[0],this.ADDITIONAL_FIELD)||o(this.radioOptions[1],this.ADDITIONAL_FIELD)))){this.currentOrientation=this.RADIO_VERTICAL}else{if(this.radioContainer){if(t>=this.radioContainer.clientWidth){this.currentOrientation=this.RADIO_VERTICAL}else if(t<this.radioContainer.clientWidth){this.currentOrientation=this.RADIO_HORIZONTAL}}}}}}render(){const{currentOrientation:t,disabled:i,handleKeyDown:a,helperText:o,hideLabel:n,label:r,required:l,size:d,validationStatus:c,validationText:p,theme:b}=this;return e(s,{key:"1918a447f8496430296685b05e633e9b3fdc60b1",onKeyDown:a,class:{"ic-radio-group-small":d==="small",[`ic-theme-${b}`]:b!=="inherit"}},e("fieldset",{key:"89b09cf7b89cff9e80077134e2ab675e4fa50f9f",role:"radiogroup",id:this.name,"aria-required":`${l}`},!n&&e("legend",{key:"be8903e178ff4f75c6fe63398b9fbecfd7c05d68"},e("ic-input-label",{key:"98a73b9c42bfa5c9c8993eaa7c2fce79f2905540",class:{[`${c}`]:true,["disabled"]:!!i},label:r,helperText:o,required:l,disabled:i},e("slot",{key:"2440d6283794eb94b28da42e44d8824260ffb064",name:"helper-text",slot:"helper-text"}))),e("div",{key:"51f662a214f2b191df64bf2ec1c84f914b53dd8e",class:{"radio-buttons-container":true,horizontal:t===this.RADIO_HORIZONTAL},ref:t=>this.radioContainer=t},e("slot",{key:"44ece542e47d62879f01d2daf14a7771818288fd"}))),h(c,i)&&e("ic-input-validation",{key:"b9a2fd5d969534c01e7a30be1a0a3f45e5a59072",ariaLiveMode:"polite",status:c,message:p}))}get el(){return a(this)}static get watchers(){return{disabled:["watchDisabledHandler"],orientation:["orientationChangeHandler"],theme:["watchThemeHandler"]}}};p.style=c;export{p as ic_radio_group};
|
2
|
-
//# sourceMappingURL=p-d6b3e02f.entry.js.map
|