@ukic/web-components 3.0.0-alpha.2 → 3.0.0-alpha.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{helpers-f1cf5156.js → helpers-69219f14.js} +24 -1
- package/dist/cjs/helpers-69219f14.js.map +1 -0
- package/dist/cjs/ic-accordion-group.cjs.entry.js +10 -10
- package/dist/cjs/ic-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-accordion.cjs.entry.js +5 -5
- package/dist/cjs/ic-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +7 -5
- package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
- package/dist/cjs/ic-badge.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +2 -2
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-vertical.cjs.entry.js +22 -24
- package/dist/cjs/ic-card-vertical.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +17 -6
- package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +6 -4
- package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-chip.cjs.entry.js +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +4 -2
- package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +71 -7
- package/dist/cjs/ic-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-empty-state.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer-link-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +2 -2
- package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +4 -3
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +450 -167
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +9 -7
- package/dist/cjs/ic-input-label_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js +3 -3
- package/dist/cjs/ic-menu-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js +11 -11
- package/dist/cjs/ic-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +5 -4
- package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +29 -2
- package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +5 -5
- package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination-item.cjs.entry.js +8 -11
- package/dist/cjs/ic-pagination-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination.cjs.entry.js +37 -15
- package/dist/cjs/ic-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +11 -11
- package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +15 -6
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +31 -22
- package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +12 -9
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-select.cjs.entry.js +147 -37
- package/dist/cjs/ic-select.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +4 -3
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
- package/dist/cjs/ic-step.cjs.entry.js +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +7 -4
- package/dist/cjs/ic-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-context.cjs.entry.js +2 -1
- package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab.cjs.entry.js +1 -1
- package/dist/cjs/ic-text-field.cjs.entry.js +2 -2
- package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +3 -3
- package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-typography.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/ag-theme-icds.css +217 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ic-accordion/ic-accordion.css +21 -19
- package/dist/collection/components/ic-accordion/ic-accordion.js +27 -30
- package/dist/collection/components/ic-accordion/ic-accordion.js.map +1 -1
- package/dist/collection/components/ic-accordion/test/basic/ic-accordion.spec.js +3 -3
- package/dist/collection/components/ic-accordion/test/basic/ic-accordion.spec.js.map +1 -1
- package/dist/collection/components/ic-accordion-group/ic-accordion-group.css +2 -12
- package/dist/collection/components/ic-accordion-group/ic-accordion-group.js +18 -18
- package/dist/collection/components/ic-accordion-group/ic-accordion-group.js.map +1 -1
- package/dist/collection/components/ic-accordion-group/test/basic/ic-accordion-group.spec.js +3 -3
- package/dist/collection/components/ic-accordion-group/test/basic/ic-accordion-group.spec.js.map +1 -1
- package/dist/collection/components/ic-alert/ic-alert.css +25 -18
- package/dist/collection/components/ic-alert/ic-alert.js +48 -22
- package/dist/collection/components/ic-alert/ic-alert.js.map +1 -1
- package/dist/collection/components/ic-alert/test/basic/ic-alert.spec.js +1 -1
- package/dist/collection/components/ic-alert/test/basic/ic-alert.spec.js.map +1 -1
- package/dist/collection/components/ic-card-vertical/ic-card-vertical.css +98 -114
- package/dist/collection/components/ic-card-vertical/ic-card-vertical.js +46 -24
- package/dist/collection/components/ic-card-vertical/ic-card-vertical.js.map +1 -1
- package/dist/collection/components/ic-checkbox/ic-checkbox.css +47 -39
- package/dist/collection/components/ic-checkbox/ic-checkbox.js +29 -3
- package/dist/collection/components/ic-checkbox/ic-checkbox.js.map +1 -1
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.css +15 -2
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js +40 -3
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js.map +1 -1
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.css +13 -25
- package/dist/collection/components/ic-dialog/ic-dialog.css +16 -3
- package/dist/collection/components/ic-dialog/ic-dialog.js +26 -0
- package/dist/collection/components/ic-dialog/ic-dialog.js.map +1 -1
- package/dist/collection/components/ic-divider/ic-divider.css +341 -4
- package/dist/collection/components/ic-divider/ic-divider.js +235 -8
- package/dist/collection/components/ic-divider/ic-divider.js.map +1 -1
- package/dist/collection/components/ic-divider/ic-divider.types.js +2 -0
- package/dist/collection/components/ic-divider/ic-divider.types.js.map +1 -0
- package/dist/collection/components/ic-divider/test/basic/ic-divider.spec.js +89 -4
- package/dist/collection/components/ic-divider/test/basic/ic-divider.spec.js.map +1 -1
- package/dist/collection/components/ic-footer/ic-footer.css +20 -19
- package/dist/collection/components/ic-footer-link/ic-footer-link.css +2 -2
- package/dist/collection/components/ic-footer-link-group/ic-footer-link-group.css +9 -21
- package/dist/collection/components/ic-footer-link-group/ic-footer-link-group.js.map +1 -1
- package/dist/collection/components/ic-hero/ic-hero.css +17 -2
- package/dist/collection/components/ic-horizontal-scroll/ic-horizontal-scroll.js +3 -2
- package/dist/collection/components/ic-horizontal-scroll/ic-horizontal-scroll.js.map +1 -1
- package/dist/collection/components/ic-input-component-container/ic-input-component-container.css +4 -2
- package/dist/collection/components/ic-input-label/ic-input-label.css +13 -1
- package/dist/collection/components/ic-input-label/ic-input-label.js +45 -4
- package/dist/collection/components/ic-input-label/ic-input-label.js.map +1 -1
- package/dist/collection/components/ic-input-label/test/basic/ic-input-label.spec.js +35 -49
- package/dist/collection/components/ic-input-label/test/basic/ic-input-label.spec.js.map +1 -1
- package/dist/collection/components/ic-input-validation/ic-input-validation.css +5 -1
- package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.css +1 -0
- package/dist/collection/components/ic-menu/ic-menu.css +78 -14
- package/dist/collection/components/ic-menu/ic-menu.js +488 -194
- package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
- package/dist/collection/components/ic-menu/test/basic/ic-menu.spec.js +381 -33
- package/dist/collection/components/ic-menu/test/basic/ic-menu.spec.js.map +1 -1
- package/dist/collection/components/ic-menu-group/ic-menu-group.css +2 -2
- package/dist/collection/components/ic-menu-group/ic-menu-group.js +1 -1
- package/dist/collection/components/ic-menu-group/ic-menu-group.js.map +1 -1
- package/dist/collection/components/ic-menu-item/ic-menu-item.css +32 -28
- package/dist/collection/components/ic-menu-item/ic-menu-item.js +11 -11
- package/dist/collection/components/ic-menu-item/ic-menu-item.js.map +1 -1
- package/dist/collection/components/ic-menu-item/test/basic/ic-menu-item.spec.js +1 -1
- package/dist/collection/components/ic-menu-item/test/basic/ic-menu-item.spec.js.map +1 -1
- package/dist/collection/components/ic-navigation-button/ic-navigation-button.js.map +1 -1
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.css +1 -1
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.js +3 -2
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.js.map +1 -1
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.js +31 -3
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.js.map +1 -1
- package/dist/collection/components/ic-navigation-item/test/basic/ic-navigation-item.spec.js +12 -0
- package/dist/collection/components/ic-navigation-item/test/basic/ic-navigation-item.spec.js.map +1 -1
- package/dist/collection/components/ic-page-header/ic-page-header.css +5 -2
- package/dist/collection/components/ic-page-header/ic-page-header.js +3 -3
- package/dist/collection/components/ic-page-header/ic-page-header.js.map +1 -1
- package/dist/collection/components/ic-pagination/ic-pagination.css +15 -0
- package/dist/collection/components/ic-pagination/ic-pagination.js +77 -37
- package/dist/collection/components/ic-pagination/ic-pagination.js.map +1 -1
- package/dist/collection/components/ic-pagination/test/basic/ic-pagination.spec.js +1 -1
- package/dist/collection/components/ic-pagination/test/basic/ic-pagination.spec.js.map +1 -1
- package/dist/collection/components/ic-pagination-item/ic-pagination-item.css +26 -6
- package/dist/collection/components/ic-pagination-item/ic-pagination-item.js +48 -33
- package/dist/collection/components/ic-pagination-item/ic-pagination-item.js.map +1 -1
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.css +5 -5
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +33 -9
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js.map +1 -1
- package/dist/collection/components/ic-radio-group/ic-radio-group.css +17 -1
- package/dist/collection/components/ic-radio-group/ic-radio-group.js +38 -3
- package/dist/collection/components/ic-radio-group/ic-radio-group.js.map +1 -1
- package/dist/collection/components/ic-radio-group/test/basic/ic-radio-group.spec.js +2 -2
- package/dist/collection/components/ic-radio-group/test/basic/ic-radio-group.spec.js.map +1 -1
- package/dist/collection/components/ic-radio-option/ic-radio-option.css +35 -25
- package/dist/collection/components/ic-radio-option/ic-radio-option.js +54 -21
- package/dist/collection/components/ic-radio-option/ic-radio-option.js.map +1 -1
- package/dist/collection/components/ic-search-bar/ic-search-bar.css +41 -5
- package/dist/collection/components/ic-search-bar/ic-search-bar.js +34 -7
- package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select.css +37 -16
- package/dist/collection/components/ic-select/ic-select.js +191 -43
- package/dist/collection/components/ic-select/ic-select.js.map +1 -1
- package/dist/collection/components/ic-select/test/basic/ic-select.spec.js +160 -1
- package/dist/collection/components/ic-select/test/basic/ic-select.spec.js.map +1 -1
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.css +0 -1
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js +2 -1
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
- package/dist/collection/components/ic-switch/ic-switch.css +27 -30
- package/dist/collection/components/ic-switch/ic-switch.js +29 -2
- package/dist/collection/components/ic-switch/ic-switch.js.map +1 -1
- package/dist/collection/components/ic-tab-context/ic-tab-context.js +2 -1
- package/dist/collection/components/ic-tab-context/ic-tab-context.js.map +1 -1
- package/dist/collection/components/ic-text-field/ic-text-field.css +7 -4
- package/dist/collection/components/ic-toast/ic-toast.css +25 -16
- package/dist/collection/components/ic-toast/ic-toast.js +1 -2
- package/dist/collection/components/ic-toast/ic-toast.js.map +1 -1
- package/dist/collection/components/ic-toast/test/basic/ic-toast.spec.js +12 -12
- package/dist/collection/components/ic-toast/test/basic/ic-toast.spec.js.map +1 -1
- package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js +1 -1
- package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js.map +1 -1
- package/dist/collection/components/ic-toggle-button-group/test/ic-toggle-button-group.spec.js +1 -0
- package/dist/collection/components/ic-toggle-button-group/test/ic-toggle-button-group.spec.js.map +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
- package/dist/collection/utils/helpers.js +20 -0
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/components/helpers.js +22 -1
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/ic-accordion-group.js +11 -11
- package/dist/components/ic-accordion-group.js.map +1 -1
- package/dist/components/ic-accordion.js +5 -5
- package/dist/components/ic-accordion.js.map +1 -1
- package/dist/components/ic-alert.js +8 -5
- package/dist/components/ic-alert.js.map +1 -1
- package/dist/components/ic-card-vertical.js +23 -24
- package/dist/components/ic-card-vertical.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +19 -6
- package/dist/components/ic-checkbox-group.js.map +1 -1
- package/dist/components/ic-checkbox.js +6 -3
- package/dist/components/ic-checkbox.js.map +1 -1
- package/dist/components/ic-classification-banner.js +1 -1
- package/dist/components/ic-classification-banner.js.map +1 -1
- package/dist/components/ic-dialog.js +4 -1
- package/dist/components/ic-dialog.js.map +1 -1
- package/dist/components/ic-divider2.js +86 -9
- package/dist/components/ic-divider2.js.map +1 -1
- package/dist/components/ic-footer-link-group.js +1 -1
- package/dist/components/ic-footer-link-group.js.map +1 -1
- package/dist/components/ic-footer-link.js +1 -1
- package/dist/components/ic-footer-link.js.map +1 -1
- package/dist/components/ic-footer.js +1 -1
- package/dist/components/ic-footer.js.map +1 -1
- package/dist/components/ic-hero.js +1 -1
- package/dist/components/ic-hero.js.map +1 -1
- package/dist/components/ic-horizontal-scroll2.js +3 -2
- package/dist/components/ic-horizontal-scroll2.js.map +1 -1
- package/dist/components/ic-input-component-container2.js +1 -1
- package/dist/components/ic-input-component-container2.js.map +1 -1
- package/dist/components/ic-input-label2.js +10 -6
- package/dist/components/ic-input-label2.js.map +1 -1
- package/dist/components/ic-input-validation2.js +1 -1
- package/dist/components/ic-input-validation2.js.map +1 -1
- package/dist/components/ic-loading-indicator2.js +1 -1
- package/dist/components/ic-loading-indicator2.js.map +1 -1
- package/dist/components/ic-menu-group.js +2 -2
- package/dist/components/ic-menu-group.js.map +1 -1
- package/dist/components/ic-menu-item2.js +11 -11
- package/dist/components/ic-menu-item2.js.map +1 -1
- package/dist/components/ic-menu2.js +453 -169
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-navigation-button.js.map +1 -1
- package/dist/components/ic-navigation-group.js +5 -4
- package/dist/components/ic-navigation-group.js.map +1 -1
- package/dist/components/ic-navigation-item.js +31 -3
- package/dist/components/ic-navigation-item.js.map +1 -1
- package/dist/components/ic-navigation-menu2.js +1 -1
- package/dist/components/ic-page-header.js +4 -4
- package/dist/components/ic-page-header.js.map +1 -1
- package/dist/components/ic-pagination-item2.js +10 -12
- package/dist/components/ic-pagination-item2.js.map +1 -1
- package/dist/components/ic-pagination.js +38 -15
- package/dist/components/ic-pagination.js.map +1 -1
- package/dist/components/ic-popover-menu.js +11 -10
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js +17 -6
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js +32 -22
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-search-bar.js +13 -9
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-select.js +148 -37
- package/dist/components/ic-select.js.map +1 -1
- package/dist/components/ic-side-navigation.js +4 -3
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-stepper.js +1 -1
- package/dist/components/ic-switch.js +7 -3
- package/dist/components/ic-switch.js.map +1 -1
- package/dist/components/ic-tab-context.js +2 -1
- package/dist/components/ic-tab-context.js.map +1 -1
- package/dist/components/ic-text-field2.js +2 -2
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-theme.js +1 -1
- package/dist/components/ic-toast.js +3 -3
- package/dist/components/ic-toast.js.map +1 -1
- package/dist/components/ic-toggle-button-group.js +1 -1
- package/dist/components/ic-toggle-button-group.js.map +1 -1
- package/dist/components/ic-top-navigation.js +1 -1
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/core/ag-theme-icds.css +217 -0
- package/dist/core/core.css +692 -10
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-84526c3e.entry.js → p-13d5875c.entry.js} +2 -2
- package/dist/core/p-13d5875c.entry.js.map +1 -0
- package/dist/core/p-19872973.entry.js +2 -0
- package/dist/core/p-19872973.entry.js.map +1 -0
- package/dist/core/p-2140431c.entry.js +2 -0
- package/dist/core/p-2140431c.entry.js.map +1 -0
- package/dist/core/p-29767574.entry.js +2 -0
- package/dist/core/p-29767574.entry.js.map +1 -0
- package/dist/core/p-2e909738.entry.js +2 -0
- package/dist/core/p-2e909738.entry.js.map +1 -0
- package/dist/core/p-2eae9b27.entry.js +2 -0
- package/dist/core/p-2eae9b27.entry.js.map +1 -0
- package/dist/core/p-2ef46ead.entry.js +2 -0
- package/dist/core/p-2ef46ead.entry.js.map +1 -0
- package/dist/core/{p-355acffa.entry.js → p-37dea10d.entry.js} +2 -2
- package/dist/core/p-3d9726a3.entry.js +2 -0
- package/dist/core/{p-408344d3.entry.js.map → p-3d9726a3.entry.js.map} +1 -1
- package/dist/core/p-428f95f8.entry.js +2 -0
- package/dist/core/p-428f95f8.entry.js.map +1 -0
- package/dist/core/p-4973c563.entry.js +2 -0
- package/dist/core/p-4973c563.entry.js.map +1 -0
- package/dist/core/{p-93c23a35.entry.js → p-4a3b1f06.entry.js} +2 -2
- package/dist/core/{p-34db8aaf.entry.js → p-5cd016e1.entry.js} +2 -2
- package/dist/core/{p-d2f8e03f.entry.js → p-5ef8e106.entry.js} +2 -2
- package/dist/core/p-5f4a6555.entry.js +2 -0
- package/dist/core/p-5f4a6555.entry.js.map +1 -0
- package/dist/core/p-605c0c92.entry.js +2 -0
- package/dist/core/p-605c0c92.entry.js.map +1 -0
- package/dist/core/p-655a9e0f.entry.js +2 -0
- package/dist/core/p-655a9e0f.entry.js.map +1 -0
- package/dist/core/p-65a16de9.entry.js +2 -0
- package/dist/core/p-65a16de9.entry.js.map +1 -0
- package/dist/core/{p-0a808ec3.entry.js → p-690c5e80.entry.js} +2 -2
- package/dist/core/p-705eb610.entry.js +2 -0
- package/dist/core/p-705eb610.entry.js.map +1 -0
- package/dist/core/{p-f30f3a3e.entry.js → p-76263187.entry.js} +2 -2
- package/dist/core/p-78c1f1cc.entry.js +2 -0
- package/dist/core/p-78c1f1cc.entry.js.map +1 -0
- package/dist/core/p-79d0be03.entry.js +2 -0
- package/dist/core/p-79d0be03.entry.js.map +1 -0
- package/dist/core/{p-c06a3b97.entry.js → p-7b35de65.entry.js} +2 -2
- package/dist/core/p-7bff1e96.entry.js +2 -0
- package/dist/core/p-7bff1e96.entry.js.map +1 -0
- package/dist/core/{p-4055f22c.entry.js → p-806a0fab.entry.js} +2 -2
- package/dist/core/p-806a0fab.entry.js.map +1 -0
- package/dist/core/p-85173458.entry.js +2 -0
- package/dist/core/p-85173458.entry.js.map +1 -0
- package/dist/core/{p-1b573920.entry.js → p-922984cb.entry.js} +2 -2
- package/dist/core/{p-aab2c7aa.entry.js → p-95f603dd.entry.js} +2 -2
- package/dist/core/{p-b01ffa55.entry.js → p-96b4ca6e.entry.js} +2 -2
- package/dist/core/p-96b4ca6e.entry.js.map +1 -0
- package/dist/core/p-979c2792.entry.js +2 -0
- package/dist/core/p-979c2792.entry.js.map +1 -0
- package/dist/core/{p-e4b276b5.entry.js → p-97fb2bdf.entry.js} +2 -2
- package/dist/core/p-9ec7f96c.entry.js +2 -0
- package/dist/core/p-9ec7f96c.entry.js.map +1 -0
- package/dist/core/p-9fa93dfe.entry.js +2 -0
- package/dist/core/p-9fa93dfe.entry.js.map +1 -0
- package/dist/core/p-a9341313.entry.js +2 -0
- package/dist/core/p-a9341313.entry.js.map +1 -0
- package/dist/core/{p-e3ed9110.entry.js → p-acbd15ab.entry.js} +2 -2
- package/dist/core/{p-31fc8756.entry.js → p-ae0775aa.entry.js} +2 -2
- package/dist/core/p-ae0775aa.entry.js.map +1 -0
- package/dist/core/{p-312cacae.js → p-b7eb8ef9.js} +2 -2
- package/dist/core/p-b7eb8ef9.js.map +1 -0
- package/dist/core/{p-4ff6d16f.entry.js → p-ba6ecc15.entry.js} +2 -2
- package/dist/core/p-bbeb03ef.entry.js +2 -0
- package/dist/core/p-bbeb03ef.entry.js.map +1 -0
- package/dist/core/{p-0d30ffab.entry.js → p-c0fc3d02.entry.js} +2 -2
- package/dist/core/p-c396bd4d.entry.js +2 -0
- package/dist/core/p-c396bd4d.entry.js.map +1 -0
- package/dist/core/{p-f828a6e1.entry.js → p-c9cf932c.entry.js} +2 -2
- package/dist/core/p-cedc375e.entry.js +2 -0
- package/dist/core/p-cedc375e.entry.js.map +1 -0
- package/dist/core/{p-d58a10ec.entry.js → p-d4a83e25.entry.js} +2 -2
- package/dist/core/p-d4a83e25.entry.js.map +1 -0
- package/dist/core/p-d93bac01.entry.js +2 -0
- package/dist/core/p-d93bac01.entry.js.map +1 -0
- package/dist/core/{p-50ead56c.entry.js → p-df957570.entry.js} +2 -2
- package/dist/core/p-df957570.entry.js.map +1 -0
- package/dist/core/{p-0fb047e7.entry.js → p-eb3b4935.entry.js} +2 -2
- package/dist/core/{p-0fb047e7.entry.js.map → p-eb3b4935.entry.js.map} +1 -1
- package/dist/core/{p-60efd7fa.entry.js → p-ebafab37.entry.js} +2 -2
- package/dist/core/p-ebafab37.entry.js.map +1 -0
- package/dist/core/{p-82375dca.entry.js → p-ee6dd94c.entry.js} +2 -2
- package/dist/core/p-ef78bebc.entry.js +2 -0
- package/dist/core/p-ef78bebc.entry.js.map +1 -0
- package/dist/core/p-f0ae2b99.entry.js +2 -0
- package/dist/core/p-f0ae2b99.entry.js.map +1 -0
- package/dist/core/{p-49525194.entry.js → p-f24984c5.entry.js} +2 -2
- package/dist/core/p-f24984c5.entry.js.map +1 -0
- package/dist/core/{p-d8870804.entry.js → p-f5b2b26d.entry.js} +2 -2
- package/dist/core/{p-40e9e76a.entry.js → p-f71c00ce.entry.js} +2 -2
- package/dist/core/p-fdd0b732.entry.js +2 -0
- package/dist/core/p-fdd0b732.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-1c9151ef.js → helpers-e8797e8d.js} +23 -2
- package/dist/esm/helpers-e8797e8d.js.map +1 -0
- package/dist/esm/ic-accordion-group.entry.js +10 -10
- package/dist/esm/ic-accordion-group.entry.js.map +1 -1
- package/dist/esm/ic-accordion.entry.js +5 -5
- package/dist/esm/ic-accordion.entry.js.map +1 -1
- package/dist/esm/ic-alert.entry.js +7 -5
- package/dist/esm/ic-alert.entry.js.map +1 -1
- package/dist/esm/ic-back-to-top.entry.js +1 -1
- package/dist/esm/ic-badge.entry.js +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
- package/dist/esm/ic-breadcrumb.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js +2 -2
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card-vertical.entry.js +23 -25
- package/dist/esm/ic-card-vertical.entry.js.map +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +17 -6
- package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
- package/dist/esm/ic-checkbox.entry.js +6 -4
- package/dist/esm/ic-checkbox.entry.js.map +1 -1
- package/dist/esm/ic-chip.entry.js +1 -1
- package/dist/esm/ic-classification-banner.entry.js +1 -1
- package/dist/esm/ic-classification-banner.entry.js.map +1 -1
- package/dist/esm/ic-data-row.entry.js +1 -1
- package/dist/esm/ic-dialog.entry.js +4 -2
- package/dist/esm/ic-dialog.entry.js.map +1 -1
- package/dist/esm/ic-divider.entry.js +72 -8
- package/dist/esm/ic-divider.entry.js.map +1 -1
- package/dist/esm/ic-empty-state.entry.js +1 -1
- package/dist/esm/ic-footer-link-group.entry.js +2 -2
- package/dist/esm/ic-footer-link-group.entry.js.map +1 -1
- package/dist/esm/ic-footer-link.entry.js +2 -2
- package/dist/esm/ic-footer-link.entry.js.map +1 -1
- package/dist/esm/ic-footer.entry.js +2 -2
- package/dist/esm/ic-footer.entry.js.map +1 -1
- package/dist/esm/ic-hero.entry.js +2 -2
- package/dist/esm/ic-hero.entry.js.map +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +4 -3
- package/dist/esm/ic-horizontal-scroll.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +450 -167
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-input-label_2.entry.js +9 -7
- package/dist/esm/ic-input-label_2.entry.js.map +1 -1
- package/dist/esm/ic-link.entry.js +1 -1
- package/dist/esm/ic-menu-group.entry.js +3 -3
- package/dist/esm/ic-menu-group.entry.js.map +1 -1
- package/dist/esm/ic-menu-item.entry.js +11 -11
- package/dist/esm/ic-menu-item.entry.js.map +1 -1
- package/dist/esm/ic-navigation-button.entry.js +1 -1
- package/dist/esm/ic-navigation-button.entry.js.map +1 -1
- package/dist/esm/ic-navigation-group.entry.js +5 -4
- package/dist/esm/ic-navigation-group.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +30 -3
- package/dist/esm/ic-navigation-item.entry.js.map +1 -1
- package/dist/esm/ic-navigation-menu.entry.js +1 -1
- package/dist/esm/ic-page-header.entry.js +5 -5
- package/dist/esm/ic-page-header.entry.js.map +1 -1
- package/dist/esm/ic-pagination-item.entry.js +8 -11
- package/dist/esm/ic-pagination-item.entry.js.map +1 -1
- package/dist/esm/ic-pagination.entry.js +37 -15
- package/dist/esm/ic-pagination.entry.js.map +1 -1
- package/dist/esm/ic-popover-menu.entry.js +11 -11
- package/dist/esm/ic-popover-menu.entry.js.map +1 -1
- package/dist/esm/ic-radio-group.entry.js +15 -6
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/ic-radio-option.entry.js +31 -22
- package/dist/esm/ic-radio-option.entry.js.map +1 -1
- package/dist/esm/ic-search-bar.entry.js +12 -9
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-select.entry.js +147 -37
- package/dist/esm/ic-select.entry.js.map +1 -1
- package/dist/esm/ic-side-navigation.entry.js +4 -3
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-status-tag.entry.js +1 -1
- package/dist/esm/ic-step.entry.js +1 -1
- package/dist/esm/ic-stepper.entry.js +1 -1
- package/dist/esm/ic-switch.entry.js +7 -4
- package/dist/esm/ic-switch.entry.js.map +1 -1
- package/dist/esm/ic-tab-context.entry.js +2 -1
- package/dist/esm/ic-tab-context.entry.js.map +1 -1
- package/dist/esm/ic-tab-group.entry.js +1 -1
- package/dist/esm/ic-tab-panel.entry.js +1 -1
- package/dist/esm/ic-tab.entry.js +1 -1
- package/dist/esm/ic-text-field.entry.js +2 -2
- package/dist/esm/ic-text-field.entry.js.map +1 -1
- package/dist/esm/ic-theme.entry.js +1 -1
- package/dist/esm/ic-toast.entry.js +3 -3
- package/dist/esm/ic-toast.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button-group.entry.js +1 -1
- package/dist/esm/ic-toggle-button-group.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button.entry.js +1 -1
- package/dist/esm/ic-top-navigation.entry.js +1 -1
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/ic-typography.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-accordion/ic-accordion.d.ts +5 -5
- package/dist/types/components/ic-accordion-group/ic-accordion-group.d.ts +4 -4
- package/dist/types/components/ic-alert/ic-alert.d.ts +9 -5
- package/dist/types/components/ic-card-vertical/ic-card-vertical.d.ts +7 -3
- package/dist/types/components/ic-checkbox/ic-checkbox.d.ts +6 -2
- package/dist/types/components/ic-checkbox-group/ic-checkbox-group.d.ts +7 -1
- package/dist/types/components/ic-dialog/ic-dialog.d.ts +5 -0
- package/dist/types/components/ic-divider/ic-divider.d.ts +31 -1
- package/dist/types/components/ic-divider/ic-divider.types.d.ts +3 -0
- package/dist/types/components/ic-footer-link-group/ic-footer-link-group.d.ts +2 -1
- package/dist/types/components/ic-input-label/ic-input-label.d.ts +8 -0
- package/dist/types/components/ic-menu/ic-menu.d.ts +43 -15
- package/dist/types/components/ic-menu-item/ic-menu-item.d.ts +1 -1
- package/dist/types/components/ic-navigation-button/ic-navigation-button.d.ts +2 -2
- package/dist/types/components/ic-navigation-group/ic-navigation-group.d.ts +2 -2
- package/dist/types/components/ic-navigation-item/ic-navigation-item.d.ts +7 -2
- package/dist/types/components/ic-pagination/ic-pagination.d.ts +13 -5
- package/dist/types/components/ic-pagination-item/ic-pagination-item.d.ts +9 -5
- package/dist/types/components/ic-popover-menu/ic-popover-menu.d.ts +5 -0
- package/dist/types/components/ic-radio-group/ic-radio-group.d.ts +6 -1
- package/dist/types/components/ic-radio-option/ic-radio-option.d.ts +8 -3
- package/dist/types/components/ic-search-bar/ic-search-bar.d.ts +5 -1
- package/dist/types/components/ic-select/ic-select.d.ts +24 -10
- package/dist/types/components/ic-switch/ic-switch.d.ts +5 -1
- package/dist/types/components.d.ts +242 -51
- package/dist/types/utils/helpers.d.ts +9 -2
- package/dist/types/utils/types.d.ts +1 -1
- package/hydrate/index.js +969 -380
- package/package.json +2 -2
- package/vscode-data.json +330 -55
- package/dist/cjs/helpers-f1cf5156.js.map +0 -1
- package/dist/core/p-0c872824.entry.js +0 -2
- package/dist/core/p-0c872824.entry.js.map +0 -1
- package/dist/core/p-1684c8d4.entry.js +0 -2
- package/dist/core/p-1684c8d4.entry.js.map +0 -1
- package/dist/core/p-1f1758a9.entry.js +0 -2
- package/dist/core/p-1f1758a9.entry.js.map +0 -1
- package/dist/core/p-21e5dd29.entry.js +0 -2
- package/dist/core/p-21e5dd29.entry.js.map +0 -1
- package/dist/core/p-244d6dba.entry.js +0 -2
- package/dist/core/p-244d6dba.entry.js.map +0 -1
- package/dist/core/p-312cacae.js.map +0 -1
- package/dist/core/p-31fc8756.entry.js.map +0 -1
- package/dist/core/p-322edabc.entry.js +0 -2
- package/dist/core/p-322edabc.entry.js.map +0 -1
- package/dist/core/p-363d6e88.entry.js +0 -2
- package/dist/core/p-363d6e88.entry.js.map +0 -1
- package/dist/core/p-4055f22c.entry.js.map +0 -1
- package/dist/core/p-408344d3.entry.js +0 -2
- package/dist/core/p-43f9a711.entry.js +0 -2
- package/dist/core/p-43f9a711.entry.js.map +0 -1
- package/dist/core/p-4502d3c1.entry.js +0 -2
- package/dist/core/p-4502d3c1.entry.js.map +0 -1
- package/dist/core/p-49525194.entry.js.map +0 -1
- package/dist/core/p-50ead56c.entry.js.map +0 -1
- package/dist/core/p-5deb9730.entry.js +0 -2
- package/dist/core/p-5deb9730.entry.js.map +0 -1
- package/dist/core/p-60efd7fa.entry.js.map +0 -1
- package/dist/core/p-6bd2e938.entry.js +0 -2
- package/dist/core/p-6bd2e938.entry.js.map +0 -1
- package/dist/core/p-6d40baa9.entry.js +0 -2
- package/dist/core/p-6d40baa9.entry.js.map +0 -1
- package/dist/core/p-7c89fc86.entry.js +0 -2
- package/dist/core/p-7c89fc86.entry.js.map +0 -1
- package/dist/core/p-84526c3e.entry.js.map +0 -1
- package/dist/core/p-9dba6823.entry.js +0 -2
- package/dist/core/p-9dba6823.entry.js.map +0 -1
- package/dist/core/p-aa0619ce.entry.js +0 -2
- package/dist/core/p-aa0619ce.entry.js.map +0 -1
- package/dist/core/p-af20322c.entry.js +0 -2
- package/dist/core/p-af20322c.entry.js.map +0 -1
- package/dist/core/p-b01ffa55.entry.js.map +0 -1
- package/dist/core/p-bf1f0ac7.entry.js +0 -2
- package/dist/core/p-bf1f0ac7.entry.js.map +0 -1
- package/dist/core/p-c86d48b6.entry.js +0 -2
- package/dist/core/p-c86d48b6.entry.js.map +0 -1
- package/dist/core/p-cbcd4427.entry.js +0 -2
- package/dist/core/p-cbcd4427.entry.js.map +0 -1
- package/dist/core/p-d1c9c32b.entry.js +0 -2
- package/dist/core/p-d1c9c32b.entry.js.map +0 -1
- package/dist/core/p-d2f89cb5.entry.js +0 -2
- package/dist/core/p-d2f89cb5.entry.js.map +0 -1
- package/dist/core/p-d58a10ec.entry.js.map +0 -1
- package/dist/core/p-da14cd3c.entry.js +0 -2
- package/dist/core/p-da14cd3c.entry.js.map +0 -1
- package/dist/core/p-dc83a0e9.entry.js +0 -2
- package/dist/core/p-dc83a0e9.entry.js.map +0 -1
- package/dist/core/p-de3a5423.entry.js +0 -2
- package/dist/core/p-de3a5423.entry.js.map +0 -1
- package/dist/core/p-e53309b0.entry.js +0 -2
- package/dist/core/p-e53309b0.entry.js.map +0 -1
- package/dist/core/p-f38bce8d.entry.js +0 -2
- package/dist/core/p-f38bce8d.entry.js.map +0 -1
- package/dist/core/p-fa1b7a80.entry.js +0 -2
- package/dist/core/p-fa1b7a80.entry.js.map +0 -1
- package/dist/core/p-fa587e6d.entry.js +0 -2
- package/dist/core/p-fa587e6d.entry.js.map +0 -1
- package/dist/esm/helpers-1c9151ef.js.map +0 -1
- /package/dist/core/{p-355acffa.entry.js.map → p-37dea10d.entry.js.map} +0 -0
- /package/dist/core/{p-93c23a35.entry.js.map → p-4a3b1f06.entry.js.map} +0 -0
- /package/dist/core/{p-34db8aaf.entry.js.map → p-5cd016e1.entry.js.map} +0 -0
- /package/dist/core/{p-d2f8e03f.entry.js.map → p-5ef8e106.entry.js.map} +0 -0
- /package/dist/core/{p-0a808ec3.entry.js.map → p-690c5e80.entry.js.map} +0 -0
- /package/dist/core/{p-f30f3a3e.entry.js.map → p-76263187.entry.js.map} +0 -0
- /package/dist/core/{p-c06a3b97.entry.js.map → p-7b35de65.entry.js.map} +0 -0
- /package/dist/core/{p-1b573920.entry.js.map → p-922984cb.entry.js.map} +0 -0
- /package/dist/core/{p-aab2c7aa.entry.js.map → p-95f603dd.entry.js.map} +0 -0
- /package/dist/core/{p-e4b276b5.entry.js.map → p-97fb2bdf.entry.js.map} +0 -0
- /package/dist/core/{p-e3ed9110.entry.js.map → p-acbd15ab.entry.js.map} +0 -0
- /package/dist/core/{p-4ff6d16f.entry.js.map → p-ba6ecc15.entry.js.map} +0 -0
- /package/dist/core/{p-0d30ffab.entry.js.map → p-c0fc3d02.entry.js.map} +0 -0
- /package/dist/core/{p-f828a6e1.entry.js.map → p-c9cf932c.entry.js.map} +0 -0
- /package/dist/core/{p-82375dca.entry.js.map → p-ee6dd94c.entry.js.map} +0 -0
- /package/dist/core/{p-d8870804.entry.js.map → p-f5b2b26d.entry.js.map} +0 -0
- /package/dist/core/{p-40e9e76a.entry.js.map → p-f71c00ce.entry.js.map} +0 -0
@@ -1,12 +1,12 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, Host } from '@stencil/core/internal/client';
|
2
2
|
import { c as checkIcon } from './check-icon.js';
|
3
|
-
import { o as onComponentRequiredPropUndefined } from './helpers.js';
|
3
|
+
import { H as isMacDevice, o as onComponentRequiredPropUndefined, J as getOptionsWithoutGroupTitlesCount } from './helpers.js';
|
4
4
|
import { d as defineCustomElement$4 } from './ic-button2.js';
|
5
5
|
import { d as defineCustomElement$3 } from './ic-loading-indicator2.js';
|
6
6
|
import { c as createPopper, d as defineCustomElement$2 } from './ic-tooltip2.js';
|
7
7
|
import { d as defineCustomElement$1 } from './ic-typography2.js';
|
8
8
|
|
9
|
-
const icMenuCss = "html.sc-ic-menu{line-height:1.15;-webkit-text-size-adjust:100%}body.sc-ic-menu{margin:0}main.sc-ic-menu{display:block}h1.sc-ic-menu{font-size:2em;margin:0.67em 0}hr.sc-ic-menu{box-sizing:content-box;height:0;overflow:visible}pre.sc-ic-menu{font-family:monospace, monospace;font-size:1em}a.sc-ic-menu{background-color:transparent}abbr[title].sc-ic-menu{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b.sc-ic-menu,strong.sc-ic-menu{font-weight:bolder}code.sc-ic-menu,kbd.sc-ic-menu,samp.sc-ic-menu{font-family:monospace, monospace;font-size:1em}small.sc-ic-menu{font-size:80%}sub.sc-ic-menu,sup.sc-ic-menu{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub.sc-ic-menu{bottom:-0.25em}sup.sc-ic-menu{top:-0.5em}img.sc-ic-menu{border-style:none}button.sc-ic-menu,input.sc-ic-menu,optgroup.sc-ic-menu,select.sc-ic-menu,textarea.sc-ic-menu{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button.sc-ic-menu,input.sc-ic-menu{overflow:visible}button.sc-ic-menu,select.sc-ic-menu{text-transform:none}button.sc-ic-menu,[type=\"button\"].sc-ic-menu,[type=\"reset\"].sc-ic-menu,[type=\"submit\"].sc-ic-menu{-webkit-appearance:button}button.sc-ic-menu::-moz-focus-inner,[type=\"button\"].sc-ic-menu::-moz-focus-inner,[type=\"reset\"].sc-ic-menu::-moz-focus-inner,[type=\"submit\"].sc-ic-menu::-moz-focus-inner{border-style:none;padding:0}button.sc-ic-menu:-moz-focusring,[type=\"button\"].sc-ic-menu:-moz-focusring,[type=\"reset\"].sc-ic-menu:-moz-focusring,[type=\"submit\"].sc-ic-menu:-moz-focusring{outline:1px dotted ButtonText}fieldset.sc-ic-menu{padding:0.35em 0.75em 0.625em}legend.sc-ic-menu{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress.sc-ic-menu{vertical-align:baseline}textarea.sc-ic-menu{overflow:auto}[type=\"checkbox\"].sc-ic-menu,[type=\"radio\"].sc-ic-menu{box-sizing:border-box;padding:0}[type=\"number\"].sc-ic-menu::-webkit-inner-spin-button,[type=\"number\"].sc-ic-menu::-webkit-outer-spin-button{height:auto}[type=\"search\"].sc-ic-menu{-webkit-appearance:textfield;outline-offset:-2px}[type=\"search\"].sc-ic-menu::-webkit-search-decoration{-webkit-appearance:none}.sc-ic-menu::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details.sc-ic-menu{display:block}summary.sc-ic-menu{display:list-item}template.sc-ic-menu{display:none}[hidden].sc-ic-menu{display:none}html.sc-ic-menu,body.sc-ic-menu,div.sc-ic-menu,span.sc-ic-menu,applet.sc-ic-menu,object.sc-ic-menu,iframe.sc-ic-menu,h1.sc-ic-menu,h2.sc-ic-menu,h3.sc-ic-menu,h4.sc-ic-menu,h5.sc-ic-menu,h6.sc-ic-menu,p.sc-ic-menu,blockquote.sc-ic-menu,pre.sc-ic-menu,a.sc-ic-menu,abbr.sc-ic-menu,acronym.sc-ic-menu,address.sc-ic-menu,big.sc-ic-menu,cite.sc-ic-menu,code.sc-ic-menu,del.sc-ic-menu,dfn.sc-ic-menu,em.sc-ic-menu,img.sc-ic-menu,ins.sc-ic-menu,kbd.sc-ic-menu,q.sc-ic-menu,s.sc-ic-menu,samp.sc-ic-menu,small.sc-ic-menu,strike.sc-ic-menu,strong.sc-ic-menu,sub.sc-ic-menu,sup.sc-ic-menu,tt.sc-ic-menu,var.sc-ic-menu,b.sc-ic-menu,u.sc-ic-menu,i.sc-ic-menu,center.sc-ic-menu,dl.sc-ic-menu,dt.sc-ic-menu,dd.sc-ic-menu,ol.sc-ic-menu,ul.sc-ic-menu,li.sc-ic-menu,fieldset.sc-ic-menu,form.sc-ic-menu,label.sc-ic-menu,legend.sc-ic-menu,table.sc-ic-menu,caption.sc-ic-menu,tbody.sc-ic-menu,tfoot.sc-ic-menu,thead.sc-ic-menu,tr.sc-ic-menu,th.sc-ic-menu,td.sc-ic-menu,article.sc-ic-menu,aside.sc-ic-menu,canvas.sc-ic-menu,details.sc-ic-menu,embed.sc-ic-menu,figure.sc-ic-menu,figcaption.sc-ic-menu,footer.sc-ic-menu,header.sc-ic-menu,hgroup.sc-ic-menu,menu.sc-ic-menu,nav.sc-ic-menu,output.sc-ic-menu,ruby.sc-ic-menu,section.sc-ic-menu,summary.sc-ic-menu,time.sc-ic-menu,mark.sc-ic-menu,audio.sc-ic-menu,video.sc-ic-menu{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}@media (prefers-reduced-motion: no-preference){.ic-menu-open.sc-ic-menu-h .menu.sc-ic-menu{transition:max-height var(--ic-transition-duration-slow)}}.sc-ic-menu-h{
|
9
|
+
const icMenuCss = "html.sc-ic-menu{line-height:1.15;-webkit-text-size-adjust:100%}body.sc-ic-menu{margin:0}main.sc-ic-menu{display:block}h1.sc-ic-menu{font-size:2em;margin:0.67em 0}hr.sc-ic-menu{box-sizing:content-box;height:0;overflow:visible}pre.sc-ic-menu{font-family:monospace, monospace;font-size:1em}a.sc-ic-menu{background-color:transparent}abbr[title].sc-ic-menu{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b.sc-ic-menu,strong.sc-ic-menu{font-weight:bolder}code.sc-ic-menu,kbd.sc-ic-menu,samp.sc-ic-menu{font-family:monospace, monospace;font-size:1em}small.sc-ic-menu{font-size:80%}sub.sc-ic-menu,sup.sc-ic-menu{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub.sc-ic-menu{bottom:-0.25em}sup.sc-ic-menu{top:-0.5em}img.sc-ic-menu{border-style:none}button.sc-ic-menu,input.sc-ic-menu,optgroup.sc-ic-menu,select.sc-ic-menu,textarea.sc-ic-menu{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button.sc-ic-menu,input.sc-ic-menu{overflow:visible}button.sc-ic-menu,select.sc-ic-menu{text-transform:none}button.sc-ic-menu,[type=\"button\"].sc-ic-menu,[type=\"reset\"].sc-ic-menu,[type=\"submit\"].sc-ic-menu{-webkit-appearance:button}button.sc-ic-menu::-moz-focus-inner,[type=\"button\"].sc-ic-menu::-moz-focus-inner,[type=\"reset\"].sc-ic-menu::-moz-focus-inner,[type=\"submit\"].sc-ic-menu::-moz-focus-inner{border-style:none;padding:0}button.sc-ic-menu:-moz-focusring,[type=\"button\"].sc-ic-menu:-moz-focusring,[type=\"reset\"].sc-ic-menu:-moz-focusring,[type=\"submit\"].sc-ic-menu:-moz-focusring{outline:1px dotted ButtonText}fieldset.sc-ic-menu{padding:0.35em 0.75em 0.625em}legend.sc-ic-menu{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress.sc-ic-menu{vertical-align:baseline}textarea.sc-ic-menu{overflow:auto}[type=\"checkbox\"].sc-ic-menu,[type=\"radio\"].sc-ic-menu{box-sizing:border-box;padding:0}[type=\"number\"].sc-ic-menu::-webkit-inner-spin-button,[type=\"number\"].sc-ic-menu::-webkit-outer-spin-button{height:auto}[type=\"search\"].sc-ic-menu{-webkit-appearance:textfield;outline-offset:-2px}[type=\"search\"].sc-ic-menu::-webkit-search-decoration{-webkit-appearance:none}.sc-ic-menu::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details.sc-ic-menu{display:block}summary.sc-ic-menu{display:list-item}template.sc-ic-menu{display:none}[hidden].sc-ic-menu{display:none}html.sc-ic-menu,body.sc-ic-menu,div.sc-ic-menu,span.sc-ic-menu,applet.sc-ic-menu,object.sc-ic-menu,iframe.sc-ic-menu,h1.sc-ic-menu,h2.sc-ic-menu,h3.sc-ic-menu,h4.sc-ic-menu,h5.sc-ic-menu,h6.sc-ic-menu,p.sc-ic-menu,blockquote.sc-ic-menu,pre.sc-ic-menu,a.sc-ic-menu,abbr.sc-ic-menu,acronym.sc-ic-menu,address.sc-ic-menu,big.sc-ic-menu,cite.sc-ic-menu,code.sc-ic-menu,del.sc-ic-menu,dfn.sc-ic-menu,em.sc-ic-menu,img.sc-ic-menu,ins.sc-ic-menu,kbd.sc-ic-menu,q.sc-ic-menu,s.sc-ic-menu,samp.sc-ic-menu,small.sc-ic-menu,strike.sc-ic-menu,strong.sc-ic-menu,sub.sc-ic-menu,sup.sc-ic-menu,tt.sc-ic-menu,var.sc-ic-menu,b.sc-ic-menu,u.sc-ic-menu,i.sc-ic-menu,center.sc-ic-menu,dl.sc-ic-menu,dt.sc-ic-menu,dd.sc-ic-menu,ol.sc-ic-menu,ul.sc-ic-menu,li.sc-ic-menu,fieldset.sc-ic-menu,form.sc-ic-menu,label.sc-ic-menu,legend.sc-ic-menu,table.sc-ic-menu,caption.sc-ic-menu,tbody.sc-ic-menu,tfoot.sc-ic-menu,thead.sc-ic-menu,tr.sc-ic-menu,th.sc-ic-menu,td.sc-ic-menu,article.sc-ic-menu,aside.sc-ic-menu,canvas.sc-ic-menu,details.sc-ic-menu,embed.sc-ic-menu,figure.sc-ic-menu,figcaption.sc-ic-menu,footer.sc-ic-menu,header.sc-ic-menu,hgroup.sc-ic-menu,menu.sc-ic-menu,nav.sc-ic-menu,output.sc-ic-menu,ruby.sc-ic-menu,section.sc-ic-menu,summary.sc-ic-menu,time.sc-ic-menu,mark.sc-ic-menu,audio.sc-ic-menu,video.sc-ic-menu{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}@media (prefers-reduced-motion: no-preference){.ic-menu-open.sc-ic-menu-h .menu.sc-ic-menu{transition:max-height var(--ic-transition-duration-slow)}}.sc-ic-menu-h{max-height:0;width:var(--menu-width, var(--input-width, 20rem));color:var(--menu-item-text-color, var(--ic-color-text-primary));--ic-typography-color:var(\n --menu-item-text-color,\n var(--ic-color-text-primary)\n );background-color:var(--menu-bg-color, var(--ic-architectural-white));position:relative;z-index:var(--ic-z-index-menu);box-sizing:border-box;box-shadow:var(--ic-elevation-overlay);border-radius:var(--ic-border-radius)}.ic-menu-open.sc-ic-menu-h:not(.ic-menu-no-focus):focus-within{box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline)}.ic-select-select-all-focused.sc-ic-menu-h{box-shadow:var(--ic-elevation-overlay) !important}#retry-button.sc-ic-menu::part(button){height:var(--ic-space-lg)}.small.sc-ic-menu #retry-button.sc-ic-menu::part(button){height:var(--ic-space-md)}.on-dialog.sc-ic-menu-h{inset:auto !important}.menu.sc-ic-menu{text-decoration:none;list-style-type:none;border-radius:1px;background-color:var(--menu-bg-color, var(--ic-architectural-white));visibility:hidden;max-height:0;overflow-y:hidden}.menu.sc-ic-menu:has(+.option-bar).sc-ic-menu{border-radius:0 0 1px 1px}.menu-scroll.sc-ic-menu{overflow-y:auto}.menu.sc-ic-menu:focus-visible{outline:none}.ic-menu-open.sc-ic-menu-h{max-height:none;display:flex;flex-direction:column-reverse;border:var(--ic-border-width) solid\n var(--menu-border-color, var(--ic-architectural-400));transition:box-shadow var(--ic-easing-transition-fast)}.ic-menu-open.sc-ic-menu-h .menu.sc-ic-menu{visibility:visible;max-height:calc(var(--ic-space-xl) * 10 + var(--ic-space-xxxs))}.ic-menu-open.sc-ic-menu-h .option-bar.sc-ic-menu{visibility:visible}.ic-menu-open.sc-ic-menu-h .select-all-button.sc-ic-menu{display:block}.ic-menu-full-width.sc-ic-menu-h{width:100%}.option.sc-ic-menu{padding:var(--ic-space-xs) calc(var(--ic-space-xs) - var(--ic-space-1px));cursor:pointer;display:flex;align-items:center}.loading-option.sc-ic-menu p.sc-ic-menu{margin-bottom:0 !important}.option.sc-ic-menu:not(.loading-option){justify-content:space-between}.ic-menu-small.sc-ic-menu-h .option.sc-ic-menu{padding:var(--ic-space-xxs) calc(var(--ic-space-xs) - var(--ic-space-1px))}.ic-menu-large.sc-ic-menu-h .option.sc-ic-menu{padding:var(--ic-space-sm) calc(var(--ic-space-xs) - var(--ic-space-1px))}.option.sc-ic-menu:last-child{border-radius:0 0 1px 1px}.sc-ic-menu:not(.menu:has(+.option-bar)).sc-ic-menu .option.sc-ic-menu:first-child{border-radius:1px 1px 0 0}.option.sc-ic-menu:not(.disabled-option):hover{background-color:var(--ic-action-dark-bg-hover)}.option.sc-ic-menu:not(.disabled-option):active{background-color:var(--ic-action-dark-bg-pressed)}.option.sc-ic-menu:focus-visible{outline:var(--ic-hc-focus-outline)}.option.sc-ic-menu:not(.disabled-option) .option-description.sc-ic-menu{--ic-typography-color:var(--ic-color-text-secondary)}.option.sc-ic-menu .option-label.sc-ic-menu{display:flex;flex-direction:row;align-items:top}.option.sc-ic-menu .option-label.sc-ic-menu ic-typography.sc-ic-menu{max-width:100%;word-wrap:break-word}.option.sc-ic-menu .option-element.sc-ic-menu{margin-top:var(--ic-space-xxs)}.option.sc-ic-menu .option-icon.sc-ic-menu{height:var(--ic-space-md);width:var(--ic-space-md);margin-top:var(--ic-space-xxs);margin-right:var(--ic-space-xxxs)}.option-text-container.sc-ic-menu{pointer-events:none;width:100%}.option-text-container.show-check-icon.sc-ic-menu{width:calc(var(--ic-space-lg) * 10 + var(--ic-space-xl))}.option.loading-option.sc-ic-menu .option-text-container.sc-ic-menu{margin-left:calc(var(--ic-space-xs) + var(--ic-space-xxxs));color:var(--ic-color-text-secondary);--ic-typography-color:var(--ic-color-text-secondary)}.error-icon-svg.sc-ic-menu{height:var(--ic-space-md);width:var(--ic-space-md);fill:var(--ic-status-error-default);align-self:center;display:flex;margin-right:calc(var(--ic-space-xxs) * 1.2)}.loading-error-info.sc-ic-menu{display:flex}.check-icon.sc-ic-menu{height:var(--ic-space-lg);min-width:var(--ic-space-lg);width:var(--ic-space-lg);margin-left:var(--ic-space-xs);pointer-events:none}.focused-option.sc-ic-menu .check-icon.sc-ic-menu *.sc-ic-menu{fill:currentcolor}.option-group-title.sc-ic-menu{padding:var(--ic-space-lg) calc(var(--ic-space-xs) - var(--ic-space-1px))\n var(--ic-space-xs);--ic-typography-color:var(--ic-color-text-tertiary)}.ic-menu-small.sc-ic-menu-h .option-group-title.sc-ic-menu{padding:var(--ic-space-sm) calc(var(--ic-space-xs) - var(--ic-space-1px))\n var(--ic-space-xxs)}.last-recommended-option.sc-ic-menu{border-bottom:var(--ic-border-default)}.disabled-option.sc-ic-menu{color:var(--ic-architectural-200);--ic-typography-color:var(--ic-architectural-200);cursor:default;pointer-events:none}.focused-option.sc-ic-menu,.focused-option.sc-ic-menu .option-description.sc-ic-menu{background-color:var(--ic-color-focus-inner) !important;color:var(--ic-architectural-white) !important;--ic-typography-color:var(--ic-architectural-white) !important}.no-results.sc-ic-menu-h li.sc-ic-menu{cursor:no-drop}.no-results.sc-ic-menu-h li.sc-ic-menu:hover{background-color:transparent}.option-bar.sc-ic-menu{padding:var(--ic-space-xxs) var(--ic-space-xs);display:flex;align-items:center;justify-content:space-between;background-color:var(--ic-architectural-40);visibility:hidden;border-bottom:var(--ic-border-width) solid var(--ic-architectural-400);border-radius:1px 1px 0 0}.option-bar.sc-ic-menu p.sc-ic-menu{margin-bottom:0 !important}.ic-menu-large.sc-ic-menu-h .option-bar.sc-ic-menu{padding:var(--ic-space-xs)}.select-all-button.sc-ic-menu{display:none}.select-all-button.sc-ic-menu:focus{z-index:calc(var(--ic-z-index-menu) + 1)}@media (forced-colors: active){.focused-option.sc-ic-menu:focus{outline:none;border:0.125rem solid transparent}}";
|
10
10
|
|
11
11
|
const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
12
12
|
constructor() {
|
@@ -15,19 +15,26 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
15
15
|
this.menuKeyPress = createEvent(this, "menuKeyPress", 7);
|
16
16
|
this.menuOptionId = createEvent(this, "menuOptionId", 7);
|
17
17
|
this.menuOptionSelect = createEvent(this, "menuOptionSelect", 7);
|
18
|
+
this.menuOptionSelectAll = createEvent(this, "menuOptionSelectAll", 7);
|
18
19
|
this.menuStateChange = createEvent(this, "menuStateChange", 7);
|
19
|
-
this.menuValueChange = createEvent(this, "menuValueChange", 7);
|
20
20
|
this.retryButtonClicked = createEvent(this, "retryButtonClicked", 7);
|
21
21
|
this.timeoutBlur = createEvent(this, "timeoutBlur", 7);
|
22
22
|
this.ungroupedOptionsSet = createEvent(this, "ungroupedOptionsSet", 7);
|
23
|
+
this.ACTIVE_DESCENDANT = "aria-activedescendant";
|
24
|
+
this.CLEAR_BUTTON_ID = "clear-button";
|
23
25
|
this.disabledOptionSelected = false;
|
24
26
|
this.hasPreviouslyBlurred = false;
|
25
27
|
this.hasTimedOut = false;
|
26
28
|
this.isLoading = false;
|
29
|
+
this.isMultiSelect = false;
|
27
30
|
this.isSearchBar = false;
|
28
31
|
this.isSearchableSelect = false;
|
29
|
-
|
30
|
-
this.
|
32
|
+
this.lastOptionSelected = null; // Index of last option selected
|
33
|
+
this.lastOptionFocused = null; // Index of last option focused
|
34
|
+
this.multiOptionClicked = null;
|
35
|
+
this.preventClickOpen = false; // Prevents menu re-opening immediately after it is closed on blur when clicking input.
|
36
|
+
this.preventMenuFocus = false; // (When multiple) ensures focus moves straight to select all button from menu.
|
37
|
+
this.shiftPressed = false;
|
31
38
|
this.ungroupedOptions = [];
|
32
39
|
this.handleClearListener = () => {
|
33
40
|
this.optionHighlighted = "";
|
@@ -38,9 +45,16 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
38
45
|
};
|
39
46
|
this.handleMenuChange = (open, focusInput) => {
|
40
47
|
this.menuStateChange.emit({ open, focusInput });
|
41
|
-
if (!open
|
42
|
-
|
43
|
-
|
48
|
+
if (!open) {
|
49
|
+
if (focusInput !== false) {
|
50
|
+
this.inputEl.focus();
|
51
|
+
this.preventClickOpen = false;
|
52
|
+
}
|
53
|
+
// Reset optionHighlighted so previously highlighted option doesn't get reselected when Enter pressed
|
54
|
+
if (this.isMultiSelect) {
|
55
|
+
this.optionHighlighted = undefined;
|
56
|
+
this.multiOptionClicked = null;
|
57
|
+
}
|
44
58
|
}
|
45
59
|
};
|
46
60
|
this.setNextOptionValue = (selectedOptionIndex) => {
|
@@ -75,24 +89,34 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
75
89
|
if (parent.tagName === "IC-SEARCH-BAR") {
|
76
90
|
this.isSearchBar = true;
|
77
91
|
}
|
78
|
-
else if (parent.tagName === "IC-SELECT"
|
79
|
-
parent.getAttribute("searchable") !== null &&
|
80
|
-
|
81
|
-
|
92
|
+
else if (parent.tagName === "IC-SELECT") {
|
93
|
+
if (parent.getAttribute("searchable") !== null &&
|
94
|
+
parent.getAttribute("searchable") !== undefined) {
|
95
|
+
this.isSearchableSelect = true;
|
96
|
+
}
|
97
|
+
else if (parent.getAttribute("multiple") !== null &&
|
98
|
+
parent.getAttribute("multiple") !== undefined) {
|
99
|
+
this.isMultiSelect = true;
|
100
|
+
}
|
82
101
|
}
|
83
102
|
};
|
103
|
+
// Open menu when up or down arrow keys are pressed
|
84
104
|
this.arrowBehaviour = (event) => {
|
85
105
|
event.preventDefault();
|
86
106
|
this.handleMenuChange(true);
|
87
107
|
};
|
88
|
-
this.
|
108
|
+
this.getMenuOptions = () => this.isSearchBar ? this.options : this.ungroupedOptions;
|
109
|
+
// Set option that is focused and so should show focus state
|
89
110
|
this.setHighlightedOption = (highlightedIndex) => {
|
90
|
-
const menuOptions = this.
|
111
|
+
const menuOptions = this.getMenuOptions();
|
91
112
|
menuOptions[highlightedIndex] &&
|
92
113
|
!menuOptions[highlightedIndex].timedOut &&
|
93
114
|
(this.optionHighlighted =
|
94
115
|
menuOptions[highlightedIndex][this.valueField] || undefined);
|
95
116
|
};
|
117
|
+
// Determines keyboard behaviour when selection is automatic
|
118
|
+
// (i.e. you don't have to press Enter select an option - just focus on it)
|
119
|
+
// and menu is closed
|
96
120
|
this.autoSetInputValueKeyboardOpen = (event) => {
|
97
121
|
const selectedOptionIndex = this.ungroupedOptions.findIndex((option) => option[this.valueField] === this.value);
|
98
122
|
this.keyboardNav = false;
|
@@ -109,147 +133,278 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
109
133
|
break;
|
110
134
|
case " ":
|
111
135
|
case "Enter":
|
112
|
-
if (event.target.id !==
|
136
|
+
if (event.target.id !== this.CLEAR_BUTTON_ID) {
|
113
137
|
this.handleMenuChange(true);
|
114
138
|
}
|
115
139
|
break;
|
116
140
|
}
|
117
141
|
};
|
118
|
-
this.
|
119
|
-
|
120
|
-
|
121
|
-
|
142
|
+
this.selectHighlightedOption = (options, highlightedOptionIndex) => {
|
143
|
+
if (!this.isLoading && !this.hasTimedOut) {
|
144
|
+
this.keyboardNav = true;
|
145
|
+
}
|
122
146
|
const isOpen = this.isSearchBar || this.isSearchableSelect || this.open;
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
else {
|
134
|
-
this.setHighlightedOption(0);
|
135
|
-
this.menuOptionId.emit({
|
136
|
-
optionId: getOptionId(0),
|
137
|
-
});
|
147
|
+
if (isOpen) {
|
148
|
+
if (highlightedOptionIndex >= 0) {
|
149
|
+
if (options[highlightedOptionIndex] !== undefined) {
|
150
|
+
if (this.isSearchBar &&
|
151
|
+
options[highlightedOptionIndex].disabled === true) {
|
152
|
+
this.disabledOptionSelected = true;
|
153
|
+
}
|
154
|
+
else {
|
155
|
+
this.setInputValue(highlightedOptionIndex);
|
156
|
+
}
|
138
157
|
}
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
158
|
+
}
|
159
|
+
else {
|
160
|
+
this.setInputValue(highlightedOptionIndex);
|
161
|
+
}
|
162
|
+
}
|
163
|
+
else {
|
164
|
+
this.handleMenuChange(true);
|
165
|
+
}
|
166
|
+
};
|
167
|
+
// Check if option is selected based on the index of the option
|
168
|
+
this.isOptionSelected = (index) => {
|
169
|
+
const menuOptions = this.getMenuOptions();
|
170
|
+
return this.value
|
171
|
+
? this.value.includes(menuOptions[index][this.valueField])
|
172
|
+
: false;
|
173
|
+
};
|
174
|
+
// Deselect currently selected options when shift pressed, but keep certain options selected
|
175
|
+
this.deselectSelectedOptions = (optionsToKeepSelected) => {
|
176
|
+
const menuOptions = this.getMenuOptions();
|
177
|
+
if (this.value) {
|
178
|
+
const selectedOptionIndexes = this.value.map((value) => {
|
179
|
+
return menuOptions.findIndex((option) => option[this.valueField] === value);
|
180
|
+
});
|
181
|
+
// Call setInputValue (which toggles the selected state) on options that need to be deselected
|
182
|
+
selectedOptionIndexes.forEach((index) => !optionsToKeepSelected.includes(index) && this.setInputValue(index));
|
183
|
+
}
|
184
|
+
};
|
185
|
+
// Determines keyboard behaviour when selection is manual (i.e. when you have to press Enter to select an option)
|
186
|
+
this.manualSetInputValueKeyboardOpen = (event) => {
|
187
|
+
const menuOptions = this.getMenuOptions();
|
188
|
+
// For preventing focus disappearing on currently focused option when Shift / Cmd / Ctrl pressed
|
189
|
+
// (i.e. when user is likely in the middle of executing a keyboard combination to select options)
|
190
|
+
const isKeyboardCombination = event.shiftKey || event.metaKey || event.ctrlKey;
|
191
|
+
const highlightedOptionIndex = this.getOptionHighlightedIndex();
|
192
|
+
const clickedMultiOptionIndex = menuOptions.findIndex((option) => option[this.valueField] === this.multiOptionClicked);
|
193
|
+
const getOptionId = (index) => { var _a; return (_a = Array.from(this.host.querySelectorAll("li"))[index]) === null || _a === void 0 ? void 0 : _a.id; };
|
194
|
+
// Space press should be equivalent to Enter when multi-select
|
195
|
+
if (event.key === " " && this.isMultiSelect) {
|
196
|
+
this.handleOptionSelect(event, highlightedOptionIndex);
|
197
|
+
}
|
198
|
+
else {
|
199
|
+
switch (event.key) {
|
200
|
+
case "ArrowDown":
|
201
|
+
this.keyboardNav = true;
|
202
|
+
this.arrowBehaviour(event);
|
203
|
+
if (this.multiOptionClicked) {
|
204
|
+
// Set focus to option last clicked
|
205
|
+
// Prevents it resetting to the top of the menu when user switches to using keyboard
|
206
|
+
this.setHighlightedOption(clickedMultiOptionIndex);
|
207
|
+
this.multiOptionClicked = null;
|
208
|
+
}
|
209
|
+
else {
|
210
|
+
this.handleSingleShiftSelect(event, highlightedOptionIndex, menuOptions);
|
211
|
+
if (highlightedOptionIndex < menuOptions.length - 1) {
|
212
|
+
this.setHighlightedOption(highlightedOptionIndex + 1);
|
213
|
+
this.menuOptionId.emit({
|
214
|
+
optionId: getOptionId(highlightedOptionIndex + 1),
|
215
|
+
});
|
216
|
+
this.handleSingleShiftSelect(event, highlightedOptionIndex + 1, menuOptions);
|
217
|
+
}
|
218
|
+
else {
|
219
|
+
this.setHighlightedOption(0);
|
220
|
+
this.menuOptionId.emit({
|
221
|
+
optionId: getOptionId(0),
|
222
|
+
});
|
223
|
+
this.handleSingleShiftSelect(event, 0, menuOptions);
|
224
|
+
}
|
225
|
+
// Deselect currently selected options if arrow was pressed for first time after shift is held
|
226
|
+
if (this.isMultiSelect && this.shiftPressed) {
|
227
|
+
this.deselectSelectedOptions([
|
228
|
+
highlightedOptionIndex,
|
229
|
+
this.getOptionHighlightedIndex(),
|
230
|
+
]);
|
231
|
+
this.shiftPressed = false;
|
232
|
+
}
|
233
|
+
}
|
234
|
+
this.lastOptionFocused = this.getOptionHighlightedIndex();
|
235
|
+
this.preventIncorrectTabOrder = false;
|
236
|
+
this.focusFromSearchKeypress = false;
|
237
|
+
break;
|
238
|
+
case "ArrowUp":
|
239
|
+
this.keyboardNav = true;
|
240
|
+
this.arrowBehaviour(event);
|
241
|
+
if (this.multiOptionClicked) {
|
242
|
+
// Set focus to option last clicked
|
243
|
+
// Prevents it resetting to the bottom of the menu when user switches to using keyboard
|
244
|
+
this.setHighlightedOption(clickedMultiOptionIndex);
|
245
|
+
this.multiOptionClicked = null;
|
246
|
+
}
|
247
|
+
else {
|
248
|
+
this.handleSingleShiftSelect(event, highlightedOptionIndex, menuOptions);
|
249
|
+
if (highlightedOptionIndex <= 0 ||
|
250
|
+
highlightedOptionIndex > menuOptions.length + 1) {
|
251
|
+
this.setHighlightedOption(menuOptions.length - 1);
|
252
|
+
this.menuOptionId.emit({
|
253
|
+
optionId: getOptionId(menuOptions.length - 1),
|
254
|
+
});
|
255
|
+
this.handleSingleShiftSelect(event, menuOptions.length - 1, menuOptions);
|
256
|
+
}
|
257
|
+
else {
|
258
|
+
this.setHighlightedOption(highlightedOptionIndex - 1);
|
259
|
+
this.menuOptionId.emit({
|
260
|
+
optionId: getOptionId(highlightedOptionIndex - 1),
|
261
|
+
});
|
262
|
+
this.handleSingleShiftSelect(event, highlightedOptionIndex - 1, menuOptions);
|
263
|
+
}
|
264
|
+
// Deselect currently selected options if arrow was pressed for first time after shift is held
|
265
|
+
if (this.isMultiSelect && this.shiftPressed) {
|
266
|
+
this.deselectSelectedOptions([
|
267
|
+
highlightedOptionIndex,
|
268
|
+
this.getOptionHighlightedIndex(),
|
269
|
+
]);
|
270
|
+
this.shiftPressed = false;
|
271
|
+
}
|
272
|
+
}
|
273
|
+
this.lastOptionFocused = this.getOptionHighlightedIndex();
|
274
|
+
this.preventIncorrectTabOrder = false;
|
275
|
+
this.focusFromSearchKeypress = false;
|
276
|
+
break;
|
277
|
+
case "Home": {
|
278
|
+
const startOptionIndex = 0;
|
279
|
+
this.keyboardNav = true;
|
280
|
+
event.preventDefault();
|
281
|
+
this.arrowBehaviour(event);
|
282
|
+
this.setHighlightedOption(startOptionIndex);
|
148
283
|
this.menuOptionId.emit({
|
149
|
-
optionId: getOptionId(
|
284
|
+
optionId: getOptionId(startOptionIndex),
|
150
285
|
});
|
286
|
+
if (event.shiftKey && event.ctrlKey) {
|
287
|
+
this.handleMultipleShiftSelect(startOptionIndex);
|
288
|
+
}
|
289
|
+
this.lastOptionFocused = startOptionIndex;
|
290
|
+
this.lastOptionSelected = startOptionIndex;
|
291
|
+
break;
|
151
292
|
}
|
152
|
-
|
153
|
-
|
293
|
+
case "End": {
|
294
|
+
const endOptionIndex = menuOptions.length - 1;
|
295
|
+
this.keyboardNav = true;
|
296
|
+
event.preventDefault();
|
297
|
+
this.arrowBehaviour(event);
|
298
|
+
this.setHighlightedOption(endOptionIndex);
|
154
299
|
this.menuOptionId.emit({
|
155
|
-
optionId: getOptionId(
|
300
|
+
optionId: getOptionId(endOptionIndex),
|
156
301
|
});
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
this.keyboardNav = true;
|
163
|
-
event.preventDefault();
|
164
|
-
this.arrowBehaviour(event);
|
165
|
-
this.setHighlightedOption(0);
|
166
|
-
this.menuOptionId.emit({
|
167
|
-
optionId: getOptionId(0),
|
168
|
-
});
|
169
|
-
break;
|
170
|
-
case "End":
|
171
|
-
this.keyboardNav = true;
|
172
|
-
event.preventDefault();
|
173
|
-
this.arrowBehaviour(event);
|
174
|
-
this.setHighlightedOption(menuOptions.length - 1);
|
175
|
-
this.menuOptionId.emit({
|
176
|
-
optionId: getOptionId(menuOptions.length - 1),
|
177
|
-
});
|
178
|
-
break;
|
179
|
-
case " ":
|
180
|
-
this.keyboardNav = false;
|
181
|
-
if (this.isSearchBar || this.isSearchableSelect) {
|
302
|
+
if (event.shiftKey && event.ctrlKey) {
|
303
|
+
this.handleMultipleShiftSelect(endOptionIndex);
|
304
|
+
}
|
305
|
+
this.lastOptionFocused = endOptionIndex;
|
306
|
+
this.lastOptionSelected = endOptionIndex;
|
182
307
|
break;
|
183
308
|
}
|
184
|
-
|
185
|
-
if (
|
186
|
-
this.
|
309
|
+
case " ":
|
310
|
+
if (!isKeyboardCombination) {
|
311
|
+
this.keyboardNav = false;
|
187
312
|
}
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
313
|
+
if (this.isSearchBar || this.isSearchableSelect) {
|
314
|
+
break;
|
315
|
+
}
|
316
|
+
else {
|
317
|
+
if (event.target.id !== this.CLEAR_BUTTON_ID) {
|
318
|
+
this.handleMenuChange(true);
|
319
|
+
}
|
320
|
+
}
|
321
|
+
break;
|
322
|
+
case "Enter":
|
323
|
+
event.preventDefault();
|
324
|
+
if (!isKeyboardCombination) {
|
325
|
+
this.keyboardNav = false;
|
326
|
+
}
|
327
|
+
this.handleOptionSelect(event, highlightedOptionIndex);
|
328
|
+
break;
|
329
|
+
case "Escape":
|
330
|
+
if (this.open) {
|
331
|
+
event.stopImmediatePropagation();
|
332
|
+
}
|
333
|
+
this.handleMenuChange(false);
|
334
|
+
this.menuOptionId.emit({ optionId: undefined });
|
335
|
+
break;
|
336
|
+
case "a":
|
337
|
+
// Checks if Cmd (meta) key is pressed if Mac device (while excluding meta key on Windows)
|
338
|
+
// Otherwise, if a different OS, checks Ctrl key
|
339
|
+
if ((isMacDevice() && event.metaKey) ||
|
340
|
+
(!isMacDevice() && event.ctrlKey)) {
|
341
|
+
this.emitSelectAll();
|
342
|
+
this.lastOptionFocused = null;
|
343
|
+
this.lastOptionSelected = null;
|
344
|
+
}
|
345
|
+
break;
|
346
|
+
case "Shift":
|
347
|
+
case "Tab":
|
348
|
+
if (event.key === "Shift") {
|
349
|
+
this.shiftPressed = true;
|
350
|
+
}
|
351
|
+
if (this.isSearchBar) {
|
352
|
+
this.keyboardNav = true;
|
353
|
+
}
|
354
|
+
if (this.isMultiSelect) {
|
355
|
+
if (this.open && !event.shiftKey && this.selectAllButton) {
|
356
|
+
event.preventDefault();
|
357
|
+
this.selectAllButton.focus(); // Move focus to select all button instead of focused option
|
358
|
+
this.preventMenuFocus = true;
|
359
|
+
this.preventClickOpen = true;
|
360
|
+
this.optionHighlighted = undefined; // Stop any option focus states showing when focus moved to select all button
|
205
361
|
}
|
206
362
|
}
|
207
363
|
else {
|
208
|
-
this.
|
364
|
+
this.preventIncorrectTabOrder = true;
|
209
365
|
}
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
event.stopImmediatePropagation();
|
218
|
-
}
|
219
|
-
this.handleMenuChange(false);
|
220
|
-
this.menuOptionId.emit({ optionId: undefined });
|
221
|
-
break;
|
222
|
-
case "Shift":
|
223
|
-
case "Tab":
|
224
|
-
if (this.isSearchBar) {
|
225
|
-
this.keyboardNav = true;
|
226
|
-
}
|
227
|
-
this.preventIncorrectTabOrder = true;
|
228
|
-
break;
|
229
|
-
default:
|
230
|
-
this.keyboardNav = false;
|
231
|
-
this.focusOnSearchOrSelectInput(menuOptions, highlightedOptionIndex);
|
232
|
-
break;
|
366
|
+
break;
|
367
|
+
default:
|
368
|
+
if (!isKeyboardCombination) {
|
369
|
+
this.keyboardNav = false;
|
370
|
+
}
|
371
|
+
this.focusOnSearchOrSelectInput(menuOptions, highlightedOptionIndex);
|
372
|
+
}
|
233
373
|
}
|
234
374
|
};
|
235
375
|
this.setInputValue = (highlightedOptionIndex) => {
|
236
|
-
const menuOptions = this.
|
376
|
+
const menuOptions = this.getMenuOptions();
|
237
377
|
if (menuOptions[highlightedOptionIndex] !== undefined) {
|
238
378
|
this.menuOptionSelect.emit({
|
239
379
|
value: menuOptions[highlightedOptionIndex][this.valueField],
|
240
380
|
});
|
241
|
-
this.
|
242
|
-
|
381
|
+
if (this.closeOnSelect) {
|
382
|
+
this.optionHighlighted = undefined;
|
383
|
+
this.menuOptionId.emit({ optionId: undefined });
|
384
|
+
}
|
385
|
+
}
|
386
|
+
if (this.closeOnSelect) {
|
387
|
+
if (!this.hasTimedOut) {
|
388
|
+
this.handleMenuChange(false);
|
389
|
+
}
|
390
|
+
else {
|
391
|
+
this.parentEl.setFocus();
|
392
|
+
}
|
243
393
|
}
|
244
|
-
if (!this.hasTimedOut)
|
245
|
-
this.handleMenuChange(false);
|
246
|
-
else
|
247
|
-
this.parentEl.setFocus();
|
248
394
|
};
|
249
395
|
this.handleOptionClick = (event) => {
|
250
396
|
const { value, label } = event.target.dataset;
|
251
|
-
this.
|
252
|
-
|
397
|
+
if (this.isMultiSelect) {
|
398
|
+
const menuOptions = this.getMenuOptions();
|
399
|
+
const selectedOptionIndex = menuOptions.findIndex((option) => option.value === value);
|
400
|
+
this.handleOptionSelect(event, selectedOptionIndex, true);
|
401
|
+
this.multiOptionClicked = value;
|
402
|
+
}
|
403
|
+
else {
|
404
|
+
this.menuOptionSelect.emit({ value, label });
|
405
|
+
this.handleMenuChange(false);
|
406
|
+
}
|
407
|
+
this.optionHighlighted = undefined;
|
253
408
|
};
|
254
409
|
this.handleRetry = () => {
|
255
410
|
this.retryButtonClicked.emit({ value: this.value });
|
@@ -262,13 +417,23 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
262
417
|
};
|
263
418
|
this.handleBlur = (event) => {
|
264
419
|
if (event.relatedTarget !== this.inputEl) {
|
265
|
-
if (
|
420
|
+
if (event.relatedTarget === this.selectAllButton) {
|
421
|
+
this.menu.removeAttribute(this.ACTIVE_DESCENDANT);
|
422
|
+
}
|
423
|
+
if (!(this.menu.contains(event.relatedTarget) ||
|
424
|
+
event.relatedTarget === this.selectAllButton)) {
|
266
425
|
this.handleMenuChange(false, this.hasPreviouslyBlurred);
|
426
|
+
this.menu.removeAttribute(this.ACTIVE_DESCENDANT);
|
427
|
+
this.lastOptionFocused = null;
|
428
|
+
this.lastOptionSelected = null;
|
267
429
|
}
|
268
430
|
}
|
269
431
|
else {
|
270
432
|
this.handleMenuChange(false);
|
271
433
|
this.preventClickOpen = true;
|
434
|
+
this.menu.removeAttribute(this.ACTIVE_DESCENDANT);
|
435
|
+
this.lastOptionFocused = null;
|
436
|
+
this.lastOptionSelected = null;
|
272
437
|
}
|
273
438
|
if (!this.isSearchBar)
|
274
439
|
this.hasPreviouslyBlurred = !!event.relatedTarget;
|
@@ -281,12 +446,109 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
281
446
|
this.autoSetValueOnMenuKeyDown(event);
|
282
447
|
}
|
283
448
|
else if (this.activationType === "manual" && !this.isSearchBar) {
|
284
|
-
this.
|
449
|
+
this.manualSetInputValueKeyboardOpen(event);
|
450
|
+
}
|
451
|
+
};
|
452
|
+
this.handleMenuKeyUp = (event) => {
|
453
|
+
if (event.key === "Tab" && event.shiftKey) {
|
454
|
+
this.preventClickOpen = false;
|
455
|
+
}
|
456
|
+
if (event.key === "Enter" && this.disabledOptionSelected) {
|
457
|
+
this.disabledOptionSelected = false;
|
458
|
+
event.stopImmediatePropagation();
|
459
|
+
}
|
460
|
+
if (event.key === "Shift") {
|
461
|
+
this.shiftPressed = false;
|
462
|
+
}
|
463
|
+
};
|
464
|
+
this.handleSelectAllClick = () => {
|
465
|
+
this.keyboardNav = false;
|
466
|
+
this.menu.focus();
|
467
|
+
this.emitSelectAll();
|
468
|
+
this.lastOptionFocused = null;
|
469
|
+
this.lastOptionSelected = null;
|
470
|
+
};
|
471
|
+
this.handleSelectAllBlur = (event) => {
|
472
|
+
this.host.classList.remove("ic-select-select-all-focused");
|
473
|
+
if (!this.menu.contains(event.relatedTarget)) {
|
474
|
+
this.handleMenuChange(false, false);
|
285
475
|
}
|
286
476
|
};
|
477
|
+
this.handleSelectAllFocus = () => {
|
478
|
+
this.host.classList.add("ic-select-select-all-focused");
|
479
|
+
this.lastOptionFocused = null;
|
480
|
+
this.lastOptionSelected = null;
|
481
|
+
};
|
482
|
+
// Fix for Safari - select all button click was causing menu to close
|
483
|
+
this.handleSelectAllMouseDown = (event) => {
|
484
|
+
event.preventDefault();
|
485
|
+
};
|
486
|
+
// When shift key is being used to select contiguous options one by one on a multi-select
|
487
|
+
// I.e. holding shift and pressing up and down arrow keys
|
488
|
+
this.handleSingleShiftSelect = (event, optionToSelectIndex, options) => {
|
489
|
+
if (this.isMultiSelect &&
|
490
|
+
event.shiftKey &&
|
491
|
+
!this.isOptionSelected(optionToSelectIndex)) {
|
492
|
+
this.selectHighlightedOption(options, optionToSelectIndex);
|
493
|
+
this.lastOptionSelected = optionToSelectIndex;
|
494
|
+
}
|
495
|
+
};
|
496
|
+
// When shift key is being used to select multiple options at once on a multi-select
|
497
|
+
// I.e. holding shift when selecting another option
|
498
|
+
this.handleMultipleShiftSelect = (lastOptionInSelection, useFocusForSelection = false, firstOptionSelected = null) => {
|
499
|
+
this.shiftPressed = false;
|
500
|
+
const firstOptionInSelection = firstOptionSelected === null
|
501
|
+
? this.getFirstOptionInSelection(useFocusForSelection)
|
502
|
+
: firstOptionSelected;
|
503
|
+
if (firstOptionInSelection !== null) {
|
504
|
+
const optionsToSelect = [];
|
505
|
+
if (firstOptionInSelection < lastOptionInSelection) {
|
506
|
+
for (let i = firstOptionInSelection; i < lastOptionInSelection + 1; i++) {
|
507
|
+
optionsToSelect.push(i);
|
508
|
+
}
|
509
|
+
}
|
510
|
+
else {
|
511
|
+
for (let i = firstOptionInSelection; i > lastOptionInSelection - 1; i--) {
|
512
|
+
optionsToSelect.push(i);
|
513
|
+
}
|
514
|
+
}
|
515
|
+
optionsToSelect.forEach((optionIndex) => !this.isOptionSelected(optionIndex) && this.setInputValue(optionIndex));
|
516
|
+
this.deselectSelectedOptions(optionsToSelect);
|
517
|
+
}
|
518
|
+
};
|
519
|
+
this.handleOptionSelect = (event, optionIndex, useFocusForSelection = false) => {
|
520
|
+
const menuOptions = this.getMenuOptions();
|
521
|
+
const firstOptionInSelection = this.getFirstOptionInSelection(useFocusForSelection);
|
522
|
+
if (event.shiftKey && firstOptionInSelection !== null) {
|
523
|
+
this.handleMultipleShiftSelect(optionIndex, useFocusForSelection, firstOptionInSelection);
|
524
|
+
}
|
525
|
+
else {
|
526
|
+
this.selectHighlightedOption(menuOptions, optionIndex);
|
527
|
+
}
|
528
|
+
this.lastOptionFocused = optionIndex;
|
529
|
+
this.lastOptionSelected = optionIndex;
|
530
|
+
};
|
531
|
+
this.getFirstOptionInSelection = (useFocusForSelection) => {
|
532
|
+
return useFocusForSelection && this.lastOptionFocused !== null
|
533
|
+
? this.lastOptionFocused
|
534
|
+
: this.lastOptionSelected !== null
|
535
|
+
? this.lastOptionSelected
|
536
|
+
: null;
|
537
|
+
};
|
538
|
+
this.emitSelectAll = () => {
|
539
|
+
var _a;
|
540
|
+
// Select all if there is either no value or not all options are selected
|
541
|
+
// 'true' means select all, 'false' means clear all
|
542
|
+
this.menuOptionSelectAll.emit({
|
543
|
+
select: !this.value || !(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) === this.ungroupedOptions.length),
|
544
|
+
});
|
545
|
+
};
|
287
546
|
this.emitMenuKeyPress = (isNavKey, key) => {
|
288
547
|
this.menuKeyPress.emit({ isNavKey: isNavKey, key: key });
|
289
548
|
};
|
549
|
+
// Determines keyboard behaviour when selection is automatic
|
550
|
+
// (i.e. you don't have to press Enter select an option - just focus on it)
|
551
|
+
// and menu is focused
|
290
552
|
this.autoSetValueOnMenuKeyDown = (event) => {
|
291
553
|
event.cancelBubble = true;
|
292
554
|
const selectedOptionIndex = this.ungroupedOptions.findIndex((option) => option[this.valueField] === this.value);
|
@@ -346,15 +608,6 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
346
608
|
}
|
347
609
|
this.emitMenuKeyPress(this.keyboardNav, event.key);
|
348
610
|
};
|
349
|
-
this.handleMenuKeyUp = (event) => {
|
350
|
-
if (event.key === "Tab" && event.shiftKey) {
|
351
|
-
this.preventClickOpen = false;
|
352
|
-
}
|
353
|
-
if (event.key === "Enter" && this.disabledOptionSelected) {
|
354
|
-
this.disabledOptionSelected = false;
|
355
|
-
event.stopImmediatePropagation();
|
356
|
-
}
|
357
|
-
};
|
358
611
|
this.getOptionId = (value) => {
|
359
612
|
return `${this.menuId}-${value}`;
|
360
613
|
};
|
@@ -380,6 +633,10 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
380
633
|
}
|
381
634
|
return sorted;
|
382
635
|
};
|
636
|
+
this.getOptionHighlightedIndex = () => {
|
637
|
+
const menuOptions = this.getMenuOptions();
|
638
|
+
return menuOptions.findIndex((option) => option[this.valueField] === this.optionHighlighted);
|
639
|
+
};
|
383
640
|
this.isManualMode = this.activationType === "manual";
|
384
641
|
this.scrollToSelected = (menu) => {
|
385
642
|
const selectedOption = this.selectOnEnter
|
@@ -391,9 +648,14 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
391
648
|
elTop < menu.scrollTop + menu.offsetHeight) {
|
392
649
|
menu.scrollTop = selectedOption.offsetTop;
|
393
650
|
}
|
651
|
+
// 'aria-activedescendant' affects screen reader focus
|
652
|
+
// https://www.w3.org/TR/2017/WD-wai-aria-practices-1.1-20170628/#kbd_focus_activedescendant
|
653
|
+
this.menu.setAttribute(this.ACTIVE_DESCENDANT, selectedOption.id);
|
394
654
|
selectedOption.focus();
|
395
655
|
}
|
396
656
|
};
|
657
|
+
// Set 'ungroupedOptions' variable and emit its value
|
658
|
+
// - this is all the options with disabled options and group titles removed
|
397
659
|
this.loadUngroupedOptions = () => {
|
398
660
|
if (this.options.length > 0 && this.options.map) {
|
399
661
|
this.options.map((option) => {
|
@@ -420,21 +682,24 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
420
682
|
this.handleTimeoutBlur = (ev) => {
|
421
683
|
this.timeoutBlur.emit({ ev });
|
422
684
|
};
|
423
|
-
this.optionContent = (option) => {
|
424
|
-
|
425
|
-
return (h(Fragment, null, option.loading && h("ic-loading-indicator", { size: "icon" }), h("div", { class: "option-text-container" }, h("div", { class: "option-label" }, option.icon && (h("div", { class: "option-icon", innerHTML: option.icon, "aria-hidden": "true" })), h("ic-typography", { variant: "body", "aria-hidden": "true" }, option[this.labelField])), option.description && (h("ic-typography", { id: `${this.getOptionId(option[this.valueField])}-description`, class: "option-description", variant: "caption", "aria-hidden": "true" }, h("p", null, option.description))), option.element && (h("div", { class: "option-element", innerHTML: option.element.component, "aria-hidden": "true" }))), !!option[this.valueField] &&
|
685
|
+
this.optionContent = (option, selected) => {
|
686
|
+
const showCheckIcon = !!option[this.valueField] &&
|
426
687
|
!!this.value &&
|
427
|
-
|
428
|
-
this.parentEl.tagName !== "IC-SEARCH-BAR"
|
688
|
+
selected &&
|
689
|
+
this.parentEl.tagName !== "IC-SEARCH-BAR";
|
690
|
+
return (h(Fragment, null, option.loading && h("ic-loading-indicator", { size: "icon" }), h("div", { class: {
|
691
|
+
"option-text-container": true,
|
692
|
+
"show-check-icon": showCheckIcon,
|
693
|
+
} }, h("div", { class: "option-label" }, option.icon && (h("div", { class: "option-icon", innerHTML: option.icon, "aria-hidden": "true" })), h("ic-typography", { variant: "body", "aria-hidden": "true" }, option[this.labelField])), option.description && (h("ic-typography", { id: `${this.getOptionId(option[this.valueField])}-description`, class: "option-description", variant: "caption", "aria-hidden": "true" }, h("p", null, option.description))), option.element && (h("div", { class: "option-element", innerHTML: option.element.component, "aria-hidden": "true" }))), showCheckIcon && h("span", { class: "check-icon", innerHTML: checkIcon })));
|
429
694
|
};
|
430
|
-
this.displayOption = (option, index, parentOption) => {
|
431
|
-
const { open,
|
695
|
+
this.displayOption = (option, selected, index, parentOption) => {
|
696
|
+
const { open, keyboardNav, isManualMode, initialOptionsListRender, optionHighlighted, options, } = this;
|
432
697
|
return (h("li", { id: this.getOptionId(option[this.valueField]), class: {
|
433
698
|
option: true,
|
434
699
|
"focused-option": isManualMode
|
435
700
|
? (keyboardNav || initialOptionsListRender) &&
|
436
701
|
option[this.valueField] === optionHighlighted
|
437
|
-
: keyboardNav &&
|
702
|
+
: keyboardNav && selected,
|
438
703
|
"last-recommended-option": option.recommended &&
|
439
704
|
options[index + 1] &&
|
440
705
|
!options[index + 1].recommended,
|
@@ -442,20 +707,21 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
442
707
|
"loading-option": option.loading,
|
443
708
|
timeout: option.timedOut,
|
444
709
|
}, role: "option", tabindex: open &&
|
445
|
-
(option[this.valueField] ===
|
446
|
-
option[this.valueField] === optionHighlighted) &&
|
710
|
+
(selected || option[this.valueField] === optionHighlighted) &&
|
447
711
|
keyboardNav
|
448
712
|
? "0"
|
449
|
-
: "-1", "aria-label": this.getOptionAriaLabel(option, parentOption), "aria-selected":
|
713
|
+
: "-1", "aria-label": this.getOptionAriaLabel(option, parentOption), "aria-selected": selected ? "true" : "false", "aria-disabled": option.disabled ? "true" : "false", onClick: !option.timedOut && !option.loading && this.handleOptionClick, onBlur: this.handleBlur, onMouseDown: this.handleMouseDown, "data-value": option[this.valueField], "data-label": option[this.labelField] }, option.timedOut ? (h(Fragment, null, h("div", { class: "loading-error-info" }, h("svg", { class: "error-icon-svg", "aria-labelledby": "error-title", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#000000" }, h("title", { id: "error-title" }, "Error"), h("g", { id: "close-octagon" }, h("path", { id: "Vector", d: "M8.77 3L3.5 8.27V15.73L8.77 21H16.23L21.5 15.73V8.27L16.23 3M8.91 7L12.5 10.59L16.09 7L17.5 8.41L13.91 12L17.5 15.59L16.09 17L12.5 13.41L8.91 17L7.5 15.59L11.09 12L7.5 8.41" }))), h("ic-typography", { variant: "label" }, option[this.labelField])), h("ic-button", { size: "small", variant: "tertiary", onClick: this.handleRetry, onKeyDown: this.handleRetryKeyDown, onBlur: this.handleTimeoutBlur, id: "retry-button" }, "Retry"))) : (this.optionContent(option, selected))));
|
450
714
|
};
|
451
715
|
this.focusFromSearchKeypress = false;
|
452
716
|
this.initialOptionsListRender = false;
|
453
717
|
this.keyboardNav = false;
|
454
718
|
this.optionHighlighted = undefined;
|
455
719
|
this.preventIncorrectTabOrder = false;
|
720
|
+
this.menuOptions = undefined;
|
456
721
|
this.activationType = "automatic";
|
457
722
|
this.anchorEl = undefined;
|
458
723
|
this.autoFocusOnSelected = true;
|
724
|
+
this.closeOnSelect = true;
|
459
725
|
this.fullWidth = false;
|
460
726
|
this.inputEl = undefined;
|
461
727
|
this.inputLabel = undefined;
|
@@ -482,9 +748,6 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
482
748
|
this.ungroupedOptions = [];
|
483
749
|
this.loadUngroupedOptions();
|
484
750
|
}
|
485
|
-
watchValueHandler() {
|
486
|
-
this.menuValueChange.emit({ value: this.value });
|
487
|
-
}
|
488
751
|
connectedCallback() {
|
489
752
|
this.getParentEl(this.parentEl);
|
490
753
|
if (this.isSearchBar) {
|
@@ -494,11 +757,12 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
494
757
|
}
|
495
758
|
}
|
496
759
|
disconnectedCallback() {
|
760
|
+
var _a, _b;
|
497
761
|
if (this.popperInstance) {
|
498
762
|
this.popperInstance.destroy();
|
499
763
|
}
|
500
|
-
this.parentEl.removeEventListener("icClear", this.handleClearListener);
|
501
|
-
this.parentEl.removeEventListener("icSubmitSearch", this.handleSubmitSearch);
|
764
|
+
(_a = this.parentEl) === null || _a === void 0 ? void 0 : _a.removeEventListener("icClear", this.handleClearListener);
|
765
|
+
(_b = this.parentEl) === null || _b === void 0 ? void 0 : _b.removeEventListener("icSubmitSearch", this.handleSubmitSearch);
|
502
766
|
}
|
503
767
|
componentWillLoad() {
|
504
768
|
var _a, _b;
|
@@ -523,7 +787,7 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
523
787
|
}
|
524
788
|
componentDidUpdate() {
|
525
789
|
const inputValueInOptions = this.options.some((option) => option[this.valueField] === this.value);
|
526
|
-
if (this.open && this.options.length !== 0) {
|
790
|
+
if (this.open && this.options.length !== 0 && !this.preventMenuFocus) {
|
527
791
|
if (this.value &&
|
528
792
|
this.keyboardNav &&
|
529
793
|
inputValueInOptions &&
|
@@ -531,8 +795,7 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
531
795
|
!this.isSearchableSelect) {
|
532
796
|
this.scrollToSelected(this.menu);
|
533
797
|
}
|
534
|
-
else if (this.
|
535
|
-
this.inputEl.tagName !== "INPUT") {
|
798
|
+
else if (this.selectOnEnter) {
|
536
799
|
this.menu.focus();
|
537
800
|
}
|
538
801
|
else if (!!this.optionHighlighted &&
|
@@ -540,13 +803,19 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
540
803
|
!this.preventIncorrectTabOrder) {
|
541
804
|
const highlightedEl = this.host.querySelector(`li[data-value="${this.optionHighlighted}"]`);
|
542
805
|
if (highlightedEl) {
|
806
|
+
this.menu.setAttribute(this.ACTIVE_DESCENDANT, highlightedEl.id);
|
543
807
|
highlightedEl.focus();
|
544
808
|
}
|
545
809
|
}
|
810
|
+
else if (this.inputEl.tagName !== "IC-TEXT-FIELD" &&
|
811
|
+
this.inputEl.tagName !== "INPUT") {
|
812
|
+
this.menu.focus();
|
813
|
+
}
|
546
814
|
}
|
547
815
|
if (this.open && !this.value && this.selectOnEnter) {
|
548
816
|
this.scrollToSelected(this.menu);
|
549
817
|
}
|
818
|
+
this.preventMenuFocus = false;
|
550
819
|
}
|
551
820
|
componentDidRender() {
|
552
821
|
if (this.open && !this.popperInstance && this.anchorEl) {
|
@@ -576,7 +845,7 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
576
845
|
this.autoSetInputValueKeyboardOpen(event);
|
577
846
|
}
|
578
847
|
else {
|
579
|
-
this.
|
848
|
+
this.manualSetInputValueKeyboardOpen(event);
|
580
849
|
}
|
581
850
|
}
|
582
851
|
/**
|
@@ -591,8 +860,9 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
591
860
|
* boundary behaviour so sticking with PopperJS.
|
592
861
|
*/
|
593
862
|
async initPopperJs(anchor) {
|
863
|
+
// Placements set to "-start" to accommodate for custom menu width - menu should always be aligned to the left
|
594
864
|
this.popperInstance = createPopper(anchor, this.host, {
|
595
|
-
placement: "bottom",
|
865
|
+
placement: "bottom-start",
|
596
866
|
modifiers: [
|
597
867
|
{
|
598
868
|
name: "offset",
|
@@ -603,7 +873,7 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
603
873
|
{
|
604
874
|
name: "flip",
|
605
875
|
options: {
|
606
|
-
fallbackPlacements: ["top"],
|
876
|
+
fallbackPlacements: ["top-start"],
|
607
877
|
rootBoundary: "viewport",
|
608
878
|
},
|
609
879
|
},
|
@@ -625,36 +895,50 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
625
895
|
}
|
626
896
|
render() {
|
627
897
|
const { inputLabel, options, menuId, value, fullWidth, hasTimedOut, isLoading, size, open, inputEl, keyboardNav, } = this;
|
898
|
+
const selectAllButtonText = `${(value === null || value === void 0 ? void 0 : value.length) === this.ungroupedOptions.length ? "Clear" : "Select"} all`;
|
899
|
+
const hasNoResults = this.host.classList.contains("no-results");
|
628
900
|
return (h(Host, { class: {
|
629
901
|
"ic-menu-full-width": fullWidth,
|
630
902
|
"ic-menu-no-focus": (inputEl === null || inputEl === void 0 ? void 0 : inputEl.tagName) === "INPUT" || hasTimedOut || isLoading,
|
631
903
|
[`ic-menu-${size}`]: true,
|
632
|
-
"ic-menu-open": open,
|
633
|
-
|
904
|
+
"ic-menu-open": open && options.length !== 0,
|
905
|
+
"ic-menu-multiple": this.isMultiSelect,
|
906
|
+
} }, options.length !== 0 && (h("ul", { id: menuId, class: "menu", role: "listbox", "aria-label": `${inputLabel} pop-up`, "aria-multiselectable": this.isMultiSelect ? "true" : "false", tabindex: open && !keyboardNav && (inputEl === null || inputEl === void 0 ? void 0 : inputEl.tagName) !== "INPUT" ? "0" : "-1", ref: (el) => (this.menu = el), onKeyDown: this.handleMenuKeyDown, onKeyUp: this.handleMenuKeyUp, onBlur: this.handleBlur }, this.getSortedOptions(options).map((option, index) => {
|
634
907
|
if (option.children) {
|
635
908
|
if (option.children.length > 0) {
|
636
|
-
return (h("div", null, h("ic-typography", { class: "option-group-title", role: "presentation", variant: "subtitle-small" }, h("p", null, option[this.labelField])), option.children.map((childOption) =>
|
909
|
+
return (h("div", null, h("ic-typography", { class: "option-group-title", role: "presentation", variant: "subtitle-small" }, h("p", null, option[this.labelField])), option.children.map((childOption) => childOption.label &&
|
910
|
+
this.displayOption(childOption, this.isMultiSelect
|
911
|
+
? value === null || value === void 0 ? void 0 : value.includes(childOption[this.valueField])
|
912
|
+
: childOption[this.valueField] === value, index, option))));
|
637
913
|
}
|
638
914
|
else {
|
639
915
|
return null;
|
640
916
|
}
|
641
917
|
}
|
642
918
|
else {
|
643
|
-
|
644
|
-
|
645
|
-
|
919
|
+
// Display option only if it has a label (rather than displaying an empty space)
|
920
|
+
return (option.label &&
|
921
|
+
this.displayOption(option, this.isMultiSelect
|
922
|
+
? value === null || value === void 0 ? void 0 : value.includes(option[this.valueField])
|
923
|
+
: option[this.valueField] === value, index));
|
924
|
+
}
|
925
|
+
}))), options.length !== 0 &&
|
926
|
+
this.isMultiSelect &&
|
927
|
+
!isLoading &&
|
928
|
+
!hasTimedOut &&
|
929
|
+
!hasNoResults && (h("div", { class: "option-bar" }, h("ic-typography", null, h("p", null, `${value ? value.length : 0}/${getOptionsWithoutGroupTitlesCount(this.options)} selected`)), h("ic-button", { class: "select-all-button", "aria-label": `${selectAllButtonText} options for ${inputLabel}`, ref: (el) => (this.selectAllButton = el), variant: "tertiary", onClick: this.handleSelectAllClick, onMouseDown: this.handleSelectAllMouseDown, onBlur: this.handleSelectAllBlur, onFocus: this.handleSelectAllFocus, size: size === "small" ? "small" : "medium" }, selectAllButtonText)))));
|
646
930
|
}
|
647
931
|
get host() { return this; }
|
648
932
|
static get watchers() { return {
|
649
933
|
"open": ["watchOpenHandler"],
|
650
|
-
"options": ["watchOptionsHandler"]
|
651
|
-
"value": ["watchValueHandler"]
|
934
|
+
"options": ["watchOptionsHandler"]
|
652
935
|
}; }
|
653
936
|
static get style() { return icMenuCss; }
|
654
937
|
}, [2, "ic-menu", {
|
655
938
|
"activationType": [1, "activation-type"],
|
656
939
|
"anchorEl": [16],
|
657
940
|
"autoFocusOnSelected": [4, "auto-focus-on-selected"],
|
941
|
+
"closeOnSelect": [4, "close-on-select"],
|
658
942
|
"fullWidth": [4, "full-width"],
|
659
943
|
"inputEl": [16],
|
660
944
|
"inputLabel": [1, "input-label"],
|
@@ -666,21 +950,21 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
666
950
|
"selectOnEnter": [4, "select-on-enter"],
|
667
951
|
"size": [1],
|
668
952
|
"options": [16],
|
669
|
-
"value": [
|
953
|
+
"value": [1],
|
670
954
|
"valueField": [1, "value-field"],
|
671
955
|
"focusFromSearchKeypress": [32],
|
672
956
|
"initialOptionsListRender": [32],
|
673
957
|
"keyboardNav": [32],
|
674
958
|
"optionHighlighted": [32],
|
675
959
|
"preventIncorrectTabOrder": [32],
|
960
|
+
"menuOptions": [32],
|
676
961
|
"handleClickOpen": [64],
|
677
962
|
"handleKeyboardOpen": [64],
|
678
963
|
"handleSetFirstOption": [64],
|
679
964
|
"initPopperJs": [64]
|
680
965
|
}, undefined, {
|
681
966
|
"open": ["watchOpenHandler"],
|
682
|
-
"options": ["watchOptionsHandler"]
|
683
|
-
"value": ["watchValueHandler"]
|
967
|
+
"options": ["watchOptionsHandler"]
|
684
968
|
}]);
|
685
969
|
function defineCustomElement() {
|
686
970
|
if (typeof customElements === "undefined") {
|