@ukic/web-components 3.21.0 → 3.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{helpers-3a796e7a.js → helpers-81cd6930.js} +3 -16
- package/dist/cjs/helpers-81cd6930.js.map +1 -0
- package/dist/cjs/ic-accordion-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ic-action-chip.cjs.entry.js +7 -3
- package/dist/cjs/ic-action-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +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 +5 -3
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-horizontal.cjs.entry.js +1 -1
- package/dist/cjs/ic-card-vertical.cjs.entry.js +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +5 -5
- package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-chip.cjs.entry.js +7 -3
- package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js +13 -5
- 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 +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +1 -1
- package/dist/cjs/ic-empty-state.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +212 -80
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination-bar.cjs.entry.js +389 -0
- package/dist/cjs/ic-pagination-bar.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-pagination-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination_3.cjs.entry.js +1412 -0
- package/dist/cjs/ic-pagination_3.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-popover-menu.cjs.entry.js +5 -5
- package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +11 -11
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js +2 -2
- package/dist/cjs/ic-side-navigation.cjs.entry.js +18 -9
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/ic-skip-link.cjs.entry.js +2 -2
- package/dist/cjs/ic-status-tag.cjs.entry.js +3 -3
- package/dist/cjs/ic-step.cjs.entry.js +14 -14
- package/dist/cjs/ic-stepper.cjs.entry.js +3 -3
- package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +5 -5
- package/dist/cjs/ic-tab-context.cjs.entry.js +1 -2
- package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +3 -3
- package/dist/cjs/ic-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab.cjs.entry.js +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +2 -2
- package/dist/cjs/ic-toast-region.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +8 -7
- package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +3 -3
- package/dist/cjs/ic-toggle-button.cjs.entry.js +3 -3
- package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ic-typography.cjs.entry.js +1 -1
- package/dist/cjs/index-d337cd8a.js +12 -16
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ic-action-chip/ic-action-chip.css +15 -2
- package/dist/collection/components/ic-action-chip/ic-action-chip.js +5 -1
- package/dist/collection/components/ic-action-chip/ic-action-chip.js.map +1 -1
- package/dist/collection/components/ic-checkbox/ic-checkbox.js +4 -5
- package/dist/collection/components/ic-checkbox/ic-checkbox.js.map +1 -1
- package/dist/collection/components/ic-chip/ic-chip.css +15 -3
- package/dist/collection/components/ic-chip/ic-chip.js +5 -1
- package/dist/collection/components/ic-chip/ic-chip.js.map +1 -1
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.js +33 -5
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.js.map +1 -1
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.stories.js +32 -0
- package/dist/collection/components/ic-menu/ic-menu.css +6 -1
- package/dist/collection/components/ic-menu/ic-menu.js +184 -53
- package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.css +104 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +895 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.stories.js +215 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.types.js +2 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.types.js.map +1 -0
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +4 -4
- package/dist/collection/components/ic-search-bar/ic-search-bar.js +10 -11
- package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
- package/dist/collection/components/ic-section-container/ic-section-container.js +2 -2
- package/dist/collection/components/ic-select/ic-select.css +1 -2
- package/dist/collection/components/ic-select/ic-select.js +414 -589
- package/dist/collection/components/ic-select/ic-select.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select.types.js +2 -0
- package/dist/collection/components/ic-select/ic-select.types.js.map +1 -0
- package/dist/collection/components/ic-select/ic-select_(searchable).stories.js +26 -21
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js +18 -9
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
- package/dist/collection/components/ic-skeleton/ic-skeleton.js +2 -2
- package/dist/collection/components/ic-skip-link/ic-skip-link.js +2 -2
- package/dist/collection/components/ic-status-tag/ic-status-tag.js +2 -2
- package/dist/collection/components/ic-step/ic-step.js +13 -13
- package/dist/collection/components/ic-stepper/ic-stepper.js +2 -2
- package/dist/collection/components/ic-stepper/ic-stepper.js.map +1 -1
- package/dist/collection/components/ic-switch/ic-switch.js +4 -4
- package/dist/collection/components/ic-tab-context/ic-tab-context.js +1 -2
- package/dist/collection/components/ic-tab-context/ic-tab-context.js.map +1 -1
- package/dist/collection/components/ic-tab-group/ic-tab-group.js +2 -2
- package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +2 -2
- package/dist/collection/components/ic-theme/ic-theme.js +1 -1
- package/dist/collection/components/ic-toast/ic-toast.js +7 -6
- package/dist/collection/components/ic-toast/ic-toast.js.map +1 -1
- package/dist/collection/components/ic-toast-region/ic-toast-region.js +1 -1
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.js +2 -2
- package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js +2 -2
- package/dist/collection/components/ic-tooltip/ic-tooltip.js +21 -2
- package/dist/collection/components/ic-tooltip/ic-tooltip.js.map +1 -1
- package/dist/collection/components/ic-tooltip/ic-tooltip.stories.js +32 -0
- package/dist/collection/utils/helpers.js +2 -15
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/components/helpers.js +3 -16
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/ic-action-chip.js +6 -2
- package/dist/components/ic-action-chip.js.map +1 -1
- package/dist/components/ic-card-vertical.js.map +1 -1
- package/dist/components/ic-checkbox.js +4 -4
- package/dist/components/ic-checkbox.js.map +1 -1
- package/dist/components/ic-chip.js +6 -2
- package/dist/components/ic-chip.js.map +1 -1
- package/dist/components/ic-classification-banner.js +14 -5
- package/dist/components/ic-classification-banner.js.map +1 -1
- package/dist/components/ic-menu2.js +213 -79
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-page-header.js.map +1 -1
- package/dist/components/ic-pagination-bar.d.ts +11 -0
- package/dist/components/ic-pagination-bar.js +523 -0
- package/dist/components/ic-pagination-bar.js.map +1 -0
- package/dist/components/ic-pagination.js +1 -375
- package/dist/components/ic-pagination.js.map +1 -1
- package/dist/{esm/ic-pagination.entry.js → components/ic-pagination2.js} +82 -11
- package/dist/components/ic-pagination2.js.map +1 -0
- package/dist/components/ic-popover-menu.js +4 -4
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-search-bar.js +11 -11
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-section-container2.js +2 -2
- package/dist/components/ic-select.js +1 -994
- package/dist/components/ic-select.js.map +1 -1
- package/dist/components/ic-select2.js +804 -0
- package/dist/components/ic-select2.js.map +1 -0
- package/dist/components/ic-side-navigation.js +18 -9
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-skeleton.js +2 -2
- package/dist/components/ic-skip-link.js +2 -2
- package/dist/components/ic-status-tag.js +2 -2
- package/dist/components/ic-step.js +13 -13
- package/dist/components/ic-stepper.js +2 -2
- package/dist/components/ic-stepper.js.map +1 -1
- package/dist/components/ic-switch.js +4 -4
- package/dist/components/ic-switch.js.map +1 -1
- package/dist/components/ic-tab-context.js +1 -2
- package/dist/components/ic-tab-context.js.map +1 -1
- package/dist/components/ic-tab-group.js +2 -2
- package/dist/components/ic-tab-panel.js +2 -2
- package/dist/components/ic-text-field.js +1 -528
- package/dist/components/ic-text-field.js.map +1 -1
- package/dist/{esm/ic-text-field.entry.js → components/ic-text-field2.js} +114 -11
- package/dist/components/ic-text-field2.js.map +1 -0
- package/dist/components/ic-theme.js +1 -1
- package/dist/components/ic-toast-region.js +1 -1
- package/dist/components/ic-toast.js +7 -6
- package/dist/components/ic-toast.js.map +1 -1
- package/dist/components/ic-toggle-button-group.js +2 -2
- package/dist/components/ic-toggle-button.js +2 -2
- package/dist/components/ic-tooltip2.js +5 -3
- package/dist/components/ic-tooltip2.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-0a24c536.entry.js → p-05fd2707.entry.js} +2 -2
- package/dist/core/{p-85e15d01.entry.js → p-09505807.entry.js} +2 -2
- package/dist/core/{p-96bc7d24.entry.js → p-09caf7ed.entry.js} +2 -2
- package/dist/core/p-09caf7ed.entry.js.map +1 -0
- package/dist/core/p-0fb7f915.entry.js +2 -0
- package/dist/core/p-0fb7f915.entry.js.map +1 -0
- package/dist/core/{p-41a5da12.entry.js → p-1b81ec88.entry.js} +2 -2
- package/dist/core/p-1b81ec88.entry.js.map +1 -0
- package/dist/core/{p-99951365.entry.js → p-2691cc80.entry.js} +2 -2
- package/dist/core/{p-94916588.entry.js → p-2a124daf.entry.js} +2 -2
- package/dist/core/{p-04c77b2d.entry.js → p-2b87c592.entry.js} +2 -2
- package/dist/core/{p-4aa56990.entry.js → p-2bd80913.entry.js} +2 -2
- package/dist/core/{p-aed1c7e7.entry.js → p-347cc084.entry.js} +2 -2
- package/dist/core/p-393af2bc.entry.js +2 -0
- package/dist/core/p-393af2bc.entry.js.map +1 -0
- package/dist/core/{p-a3dea729.entry.js → p-3aed13ba.entry.js} +2 -2
- package/dist/core/{p-8da90b72.entry.js → p-46fd555f.entry.js} +2 -2
- package/dist/core/{p-43cc0f1d.entry.js → p-48a628f0.entry.js} +2 -2
- package/dist/core/{p-9a4e067f.entry.js → p-4f56acff.entry.js} +2 -2
- package/dist/core/{p-3021290f.entry.js → p-506d428a.entry.js} +2 -2
- package/dist/core/{p-a1b2f483.entry.js → p-50dca790.entry.js} +2 -2
- package/dist/core/p-53ab3c0f.entry.js +2 -0
- package/dist/core/p-53ab3c0f.entry.js.map +1 -0
- package/dist/core/{p-feef7c2c.entry.js → p-56de4f4b.entry.js} +2 -2
- package/dist/core/{p-b4e322fe.entry.js → p-5900cb65.entry.js} +2 -2
- package/dist/core/{p-78a54069.entry.js → p-5976de6e.entry.js} +2 -2
- package/dist/core/{p-2af89564.entry.js → p-61d79fc6.entry.js} +2 -2
- package/dist/core/{p-2af89564.entry.js.map → p-61d79fc6.entry.js.map} +1 -1
- package/dist/core/p-659d048d.entry.js +2 -0
- package/dist/core/{p-1edf2689.entry.js → p-67de1290.entry.js} +2 -2
- package/dist/core/p-6b4ec95f.entry.js +3 -0
- package/dist/core/p-6b4ec95f.entry.js.map +1 -0
- package/dist/core/{p-f700b759.entry.js → p-73043f57.entry.js} +2 -2
- package/dist/core/{p-7b8e5926.entry.js → p-735d3096.entry.js} +2 -2
- package/dist/core/{p-07075461.entry.js → p-7b538fd1.entry.js} +2 -2
- package/dist/core/{p-cfd43558.entry.js → p-80d85403.entry.js} +2 -2
- package/dist/core/{p-7f279c8a.entry.js → p-83578f1d.entry.js} +2 -2
- package/dist/core/{p-7f279c8a.entry.js.map → p-83578f1d.entry.js.map} +1 -1
- package/dist/core/{p-b8c0c142.entry.js → p-880f7548.entry.js} +2 -2
- package/dist/core/p-880f7548.entry.js.map +1 -0
- package/dist/core/{p-79949920.entry.js → p-8a833e82.entry.js} +2 -2
- package/dist/core/{p-0aba9e31.entry.js → p-90678e67.entry.js} +2 -2
- package/dist/core/{p-a851eb65.entry.js → p-9502fb86.entry.js} +2 -2
- package/dist/core/{p-2ca7f050.entry.js → p-99433296.entry.js} +2 -2
- package/dist/core/p-99433296.entry.js.map +1 -0
- package/dist/core/{p-f6de08fb.entry.js → p-9c2b2cb9.entry.js} +2 -2
- package/dist/core/{p-949d08d3.entry.js → p-9cb83a2e.entry.js} +2 -2
- package/dist/core/{p-f0ecb80b.entry.js → p-a08d6b46.entry.js} +2 -2
- package/dist/core/{p-9057a186.entry.js → p-a2953aad.entry.js} +2 -2
- package/dist/core/p-a2953aad.entry.js.map +1 -0
- package/dist/core/p-a321feee.entry.js +2 -0
- package/dist/core/p-a321feee.entry.js.map +1 -0
- package/dist/core/{p-208f470f.entry.js → p-a780a34b.entry.js} +2 -2
- package/dist/core/{p-387b7bca.entry.js → p-aad03a3c.entry.js} +2 -2
- package/dist/core/{p-ec14c783.entry.js → p-aaf4e367.entry.js} +2 -2
- package/dist/core/{p-707ae6e9.entry.js → p-b52c44eb.entry.js} +2 -2
- package/dist/core/{p-716e7eaf.entry.js → p-b777f0a1.entry.js} +2 -2
- package/dist/core/p-b777f0a1.entry.js.map +1 -0
- package/dist/core/p-b77b1e1f.js +2 -0
- package/dist/core/p-b77b1e1f.js.map +1 -0
- package/dist/core/{p-780babc0.entry.js → p-b997ad5e.entry.js} +2 -2
- package/dist/core/{p-a0af1b0a.entry.js → p-bb7652cd.entry.js} +2 -2
- package/dist/core/{p-ded4cd76.entry.js → p-cbca04bb.entry.js} +2 -2
- package/dist/core/{p-99687bce.entry.js → p-cc64e5ef.entry.js} +2 -2
- package/dist/core/{p-812c5e61.entry.js → p-cfbacca1.entry.js} +2 -2
- package/dist/core/{p-0da2caa2.entry.js → p-daec7e69.entry.js} +2 -2
- package/dist/core/{p-1590fd69.entry.js → p-e7767c0d.entry.js} +2 -2
- package/dist/core/p-e938eb31.entry.js +2 -0
- package/dist/core/p-e938eb31.entry.js.map +1 -0
- package/dist/core/{p-dce11b9d.entry.js → p-ea7a3d30.entry.js} +2 -2
- package/dist/core/{p-880afd4b.entry.js → p-ebd688b9.entry.js} +2 -2
- package/dist/core/p-ebd688b9.entry.js.map +1 -0
- package/dist/core/{p-a674b13b.entry.js → p-ef70ea50.entry.js} +2 -2
- package/dist/core/{p-d25d0aad.entry.js → p-f64996f1.entry.js} +2 -2
- package/dist/core/{p-db17a793.entry.js → p-f661ba76.entry.js} +2 -2
- package/dist/core/{p-a03bb31c.entry.js → p-f84ac9c6.entry.js} +2 -2
- package/dist/core/{p-f3406b42.entry.js → p-fb9376f0.entry.js} +2 -2
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-0f85537f.js → helpers-66681c73.js} +4 -17
- package/dist/esm/helpers-66681c73.js.map +1 -0
- package/dist/esm/ic-accordion-group.entry.js +1 -1
- package/dist/esm/ic-accordion.entry.js +1 -1
- package/dist/esm/ic-action-chip.entry.js +7 -3
- package/dist/esm/ic-action-chip.entry.js.map +1 -1
- package/dist/esm/ic-alert.entry.js +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 +5 -3
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card-horizontal.entry.js +1 -1
- package/dist/esm/ic-card-vertical.entry.js +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +1 -1
- package/dist/esm/ic-checkbox.entry.js +5 -5
- package/dist/esm/ic-checkbox.entry.js.map +1 -1
- package/dist/esm/ic-chip.entry.js +7 -3
- package/dist/esm/ic-chip.entry.js.map +1 -1
- package/dist/esm/ic-classification-banner.entry.js +13 -5
- 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 +1 -1
- package/dist/esm/ic-divider.entry.js +1 -1
- package/dist/esm/ic-empty-state.entry.js +1 -1
- package/dist/esm/ic-footer-link-group.entry.js +1 -1
- package/dist/esm/ic-footer-link.entry.js +1 -1
- package/dist/esm/ic-footer.entry.js +1 -1
- package/dist/esm/ic-hero.entry.js +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +212 -80
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-input-label_2.entry.js +1 -1
- package/dist/esm/ic-link.entry.js +1 -1
- package/dist/esm/ic-menu-group.entry.js +1 -1
- package/dist/esm/ic-menu-item.entry.js +1 -1
- package/dist/esm/ic-navigation-button.entry.js +1 -1
- package/dist/esm/ic-navigation-group.entry.js +1 -1
- package/dist/esm/ic-navigation-group.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +1 -1
- package/dist/esm/ic-navigation-menu.entry.js +1 -1
- package/dist/esm/ic-page-header.entry.js +1 -1
- package/dist/esm/ic-pagination-bar.entry.js +385 -0
- package/dist/esm/ic-pagination-bar.entry.js.map +1 -0
- package/dist/esm/ic-pagination-item.entry.js +1 -1
- package/dist/esm/ic-pagination_3.entry.js +1406 -0
- package/dist/esm/ic-pagination_3.entry.js.map +1 -0
- package/dist/esm/ic-popover-menu.entry.js +5 -5
- package/dist/esm/ic-radio-group.entry.js +1 -1
- package/dist/esm/ic-radio-option.entry.js +1 -1
- package/dist/esm/ic-search-bar.entry.js +11 -11
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js +2 -2
- package/dist/esm/ic-side-navigation.entry.js +18 -9
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-skeleton.entry.js +2 -2
- package/dist/esm/ic-skip-link.entry.js +2 -2
- package/dist/esm/ic-status-tag.entry.js +3 -3
- package/dist/esm/ic-step.entry.js +14 -14
- package/dist/esm/ic-stepper.entry.js +3 -3
- package/dist/esm/ic-stepper.entry.js.map +1 -1
- package/dist/esm/ic-switch.entry.js +5 -5
- package/dist/esm/ic-tab-context.entry.js +1 -2
- package/dist/esm/ic-tab-context.entry.js.map +1 -1
- package/dist/esm/ic-tab-group.entry.js +3 -3
- package/dist/esm/ic-tab-panel.entry.js +2 -2
- package/dist/esm/ic-tab.entry.js +1 -1
- package/dist/esm/ic-theme.entry.js +2 -2
- package/dist/esm/ic-toast-region.entry.js +1 -1
- package/dist/esm/ic-toast.entry.js +8 -7
- package/dist/esm/ic-toast.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button-group.entry.js +3 -3
- package/dist/esm/ic-toggle-button.entry.js +3 -3
- package/dist/esm/ic-top-navigation.entry.js +1 -1
- package/dist/esm/ic-typography.entry.js +1 -1
- package/dist/esm/index-a7a720e7.js +12 -16
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-classification-banner/ic-classification-banner.d.ts +4 -0
- package/dist/types/components/ic-menu/ic-menu.d.ts +11 -1
- package/dist/types/components/ic-pagination-bar/ic-pagination-bar.d.ts +162 -0
- package/dist/types/components/ic-pagination-bar/ic-pagination-bar.types.d.ts +8 -0
- package/dist/types/components/ic-select/ic-select.d.ts +53 -80
- package/dist/types/components/ic-select/ic-select.types.d.ts +43 -0
- package/dist/types/components/ic-side-navigation/ic-side-navigation.d.ts +3 -2
- package/dist/types/components/ic-tooltip/ic-tooltip.d.ts +5 -0
- package/dist/types/components.d.ts +253 -5
- package/dist/types/utils/helpers.d.ts +2 -4
- package/hydrate/index.js +1145 -773
- package/hydrate/index.mjs +1145 -773
- package/package.json +2 -2
- package/vscode-data.json +131 -0
- package/dist/cjs/helpers-3a796e7a.js.map +0 -1
- package/dist/cjs/ic-pagination.cjs.entry.js +0 -312
- package/dist/cjs/ic-pagination.cjs.entry.js.map +0 -1
- package/dist/cjs/ic-select.cjs.entry.js +0 -879
- package/dist/cjs/ic-select.cjs.entry.js.map +0 -1
- package/dist/cjs/ic-text-field.cjs.entry.js +0 -433
- package/dist/cjs/ic-text-field.cjs.entry.js.map +0 -1
- package/dist/core/p-0d7fd892.entry.js +0 -2
- package/dist/core/p-29b61bb5.entry.js +0 -3
- package/dist/core/p-29b61bb5.entry.js.map +0 -1
- package/dist/core/p-2ca7f050.entry.js.map +0 -1
- package/dist/core/p-41a5da12.entry.js.map +0 -1
- package/dist/core/p-4aadabc8.entry.js +0 -2
- package/dist/core/p-4aadabc8.entry.js.map +0 -1
- package/dist/core/p-716e7eaf.entry.js.map +0 -1
- package/dist/core/p-808e1ef5.entry.js +0 -2
- package/dist/core/p-808e1ef5.entry.js.map +0 -1
- package/dist/core/p-880afd4b.entry.js.map +0 -1
- package/dist/core/p-8fe4e0ad.entry.js +0 -2
- package/dist/core/p-8fe4e0ad.entry.js.map +0 -1
- package/dist/core/p-9057a186.entry.js.map +0 -1
- package/dist/core/p-96bc7d24.entry.js.map +0 -1
- package/dist/core/p-b8c0c142.entry.js.map +0 -1
- package/dist/core/p-c5b9519d.entry.js +0 -2
- package/dist/core/p-c5b9519d.entry.js.map +0 -1
- package/dist/core/p-d1730d4d.entry.js +0 -2
- package/dist/core/p-d1730d4d.entry.js.map +0 -1
- package/dist/core/p-dbc8bf0c.js +0 -2
- package/dist/core/p-dbc8bf0c.js.map +0 -1
- package/dist/core/p-fdb587ab.entry.js +0 -2
- package/dist/core/p-fdb587ab.entry.js.map +0 -1
- package/dist/esm/helpers-0f85537f.js.map +0 -1
- package/dist/esm/ic-pagination.entry.js.map +0 -1
- package/dist/esm/ic-select.entry.js +0 -875
- package/dist/esm/ic-select.entry.js.map +0 -1
- package/dist/esm/ic-text-field.entry.js.map +0 -1
- /package/dist/core/{p-0a24c536.entry.js.map → p-05fd2707.entry.js.map} +0 -0
- /package/dist/core/{p-85e15d01.entry.js.map → p-09505807.entry.js.map} +0 -0
- /package/dist/core/{p-99951365.entry.js.map → p-2691cc80.entry.js.map} +0 -0
- /package/dist/core/{p-94916588.entry.js.map → p-2a124daf.entry.js.map} +0 -0
- /package/dist/core/{p-04c77b2d.entry.js.map → p-2b87c592.entry.js.map} +0 -0
- /package/dist/core/{p-4aa56990.entry.js.map → p-2bd80913.entry.js.map} +0 -0
- /package/dist/core/{p-aed1c7e7.entry.js.map → p-347cc084.entry.js.map} +0 -0
- /package/dist/core/{p-a3dea729.entry.js.map → p-3aed13ba.entry.js.map} +0 -0
- /package/dist/core/{p-8da90b72.entry.js.map → p-46fd555f.entry.js.map} +0 -0
- /package/dist/core/{p-43cc0f1d.entry.js.map → p-48a628f0.entry.js.map} +0 -0
- /package/dist/core/{p-9a4e067f.entry.js.map → p-4f56acff.entry.js.map} +0 -0
- /package/dist/core/{p-3021290f.entry.js.map → p-506d428a.entry.js.map} +0 -0
- /package/dist/core/{p-a1b2f483.entry.js.map → p-50dca790.entry.js.map} +0 -0
- /package/dist/core/{p-feef7c2c.entry.js.map → p-56de4f4b.entry.js.map} +0 -0
- /package/dist/core/{p-b4e322fe.entry.js.map → p-5900cb65.entry.js.map} +0 -0
- /package/dist/core/{p-78a54069.entry.js.map → p-5976de6e.entry.js.map} +0 -0
- /package/dist/core/{p-0d7fd892.entry.js.map → p-659d048d.entry.js.map} +0 -0
- /package/dist/core/{p-1edf2689.entry.js.map → p-67de1290.entry.js.map} +0 -0
- /package/dist/core/{p-f700b759.entry.js.map → p-73043f57.entry.js.map} +0 -0
- /package/dist/core/{p-7b8e5926.entry.js.map → p-735d3096.entry.js.map} +0 -0
- /package/dist/core/{p-07075461.entry.js.map → p-7b538fd1.entry.js.map} +0 -0
- /package/dist/core/{p-cfd43558.entry.js.map → p-80d85403.entry.js.map} +0 -0
- /package/dist/core/{p-79949920.entry.js.map → p-8a833e82.entry.js.map} +0 -0
- /package/dist/core/{p-0aba9e31.entry.js.map → p-90678e67.entry.js.map} +0 -0
- /package/dist/core/{p-a851eb65.entry.js.map → p-9502fb86.entry.js.map} +0 -0
- /package/dist/core/{p-f6de08fb.entry.js.map → p-9c2b2cb9.entry.js.map} +0 -0
- /package/dist/core/{p-949d08d3.entry.js.map → p-9cb83a2e.entry.js.map} +0 -0
- /package/dist/core/{p-f0ecb80b.entry.js.map → p-a08d6b46.entry.js.map} +0 -0
- /package/dist/core/{p-208f470f.entry.js.map → p-a780a34b.entry.js.map} +0 -0
- /package/dist/core/{p-387b7bca.entry.js.map → p-aad03a3c.entry.js.map} +0 -0
- /package/dist/core/{p-ec14c783.entry.js.map → p-aaf4e367.entry.js.map} +0 -0
- /package/dist/core/{p-707ae6e9.entry.js.map → p-b52c44eb.entry.js.map} +0 -0
- /package/dist/core/{p-780babc0.entry.js.map → p-b997ad5e.entry.js.map} +0 -0
- /package/dist/core/{p-a0af1b0a.entry.js.map → p-bb7652cd.entry.js.map} +0 -0
- /package/dist/core/{p-ded4cd76.entry.js.map → p-cbca04bb.entry.js.map} +0 -0
- /package/dist/core/{p-99687bce.entry.js.map → p-cc64e5ef.entry.js.map} +0 -0
- /package/dist/core/{p-812c5e61.entry.js.map → p-cfbacca1.entry.js.map} +0 -0
- /package/dist/core/{p-0da2caa2.entry.js.map → p-daec7e69.entry.js.map} +0 -0
- /package/dist/core/{p-1590fd69.entry.js.map → p-e7767c0d.entry.js.map} +0 -0
- /package/dist/core/{p-dce11b9d.entry.js.map → p-ea7a3d30.entry.js.map} +0 -0
- /package/dist/core/{p-a674b13b.entry.js.map → p-ef70ea50.entry.js.map} +0 -0
- /package/dist/core/{p-d25d0aad.entry.js.map → p-f64996f1.entry.js.map} +0 -0
- /package/dist/core/{p-db17a793.entry.js.map → p-f661ba76.entry.js.map} +0 -0
- /package/dist/core/{p-a03bb31c.entry.js.map → p-f84ac9c6.entry.js.map} +0 -0
- /package/dist/core/{p-f3406b42.entry.js.map → p-fb9376f0.entry.js.map} +0 -0
|
@@ -0,0 +1,1406 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement, f as forceUpdate } from './index-a7a720e7.js';
|
|
2
|
+
import { r as removeDisabledFalse, o as onComponentRequiredPropUndefined, Q as checkSlotInChildMutations, l as removeFormResetListener, k as addFormResetListener, q as getInputDescribedByText, m as renderHiddenInput, i as isSlotUsed, R as isMobileOrTablet, S as IcInformationStatus, L as isEmptyString, K as debounceEvent, z as inheritAttributes, n as removeHiddenInput } from './helpers-66681c73.js';
|
|
3
|
+
import { I as IC_INHERITED_ARIA, e as IGNORED_KEYBOARD_CHARACTERS } from './constants-ab12fdcf.js';
|
|
4
|
+
|
|
5
|
+
const paginationNextPrevious = `<svg width="8" height="10" viewBox="0 0 8 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<path d="M2.08748 0L0.912476 1.175L4.72914 5L0.912476 8.825L2.08748 10L7.08748 5L2.08748 0Z" fill="currentColor"/>
|
|
7
|
+
</svg>
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
const paginationFirstLast = `<svg width="12" height="10" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
11
|
+
<path d="M11.1709 8.825L7.34589 5L11.1709 1.175L9.99589 0L4.99589 5L9.99589 10L11.1709 8.825ZM0.829224 0H2.49589V10H0.829224V0Z" fill="currentColour"/>
|
|
12
|
+
</svg>`;
|
|
13
|
+
|
|
14
|
+
const icPaginationCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{box-sizing:border-box;width:100%;display:flex;justify-content:center}nav{width:100%;display:flex;flex-flow:row wrap;justify-content:flex-start;align-items:center}ic-button{cursor:pointer}ic-button.next-previous{--icon-width:var(--ic-space-xs);--icon-height:calc(var(--ic-space-xs) + var(--ic-space-xxxs));padding:0 var(--ic-space-xxs) 0 var(--ic-space-xxxs)}ic-button.first-last{--icon-width:calc(var(--ic-space-sm) + var(--ic-space-xxxs));--icon-height:calc(var(--ic-space-xs) + var(--ic-space-xxxs))}ic-button.first-last::part(button),ic-button.next-previous::part(button){color:var(--ic-pagination-chevron)}:host(.ic-pagination-monochrome) ic-button.first-last::part(button),:host(.ic-pagination-monochrome) ic-button.next-previous::part(button){color:var(--ic-pagination-chevron-monochrome)}ic-button.ic-button-disabled.first-last::part(button),ic-button.ic-button-disabled.next-previous::part(button),:host(.ic-pagination-monochrome) ic-button.ic-button-disabled.first-last::part(button),:host(.ic-pagination-monochrome) ic-button.ic-button-disabled.next-previous::part(button){color:var(--ic-pagination-chevron-disabled)}.disabled{color:var(--ic-color-text-disabled-mid);pointer-events:none;cursor:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.hide-current-page{display:none}.sr-only{position:absolute;left:-9999px}.sr-only:dir(rtl){right:-9999px}";
|
|
15
|
+
const IcPaginationStyle0 = icPaginationCss;
|
|
16
|
+
|
|
17
|
+
const Pagination = class {
|
|
18
|
+
constructor(hostRef) {
|
|
19
|
+
registerInstance(this, hostRef);
|
|
20
|
+
this.icPageChange = createEvent(this, "icPageChange", 7);
|
|
21
|
+
this.endEllipsis = false;
|
|
22
|
+
this.endItems = [];
|
|
23
|
+
this.midItems = [];
|
|
24
|
+
this.startEllipsis = false;
|
|
25
|
+
this.startItems = [];
|
|
26
|
+
/**
|
|
27
|
+
* The accessible label of the pagination component to provide context for screen reader users.
|
|
28
|
+
*/
|
|
29
|
+
this.accessibleLabel = "Pagination Navigation";
|
|
30
|
+
/**
|
|
31
|
+
* The number of pages displayed adjacent to the current page when using 'complex' type pagination. Accepted values are 0, 1 & 2.
|
|
32
|
+
*/
|
|
33
|
+
this.adjacentPageCount = 1;
|
|
34
|
+
/**
|
|
35
|
+
* The number of pages displayed as boundary items to the current page when using 'complex' type pagination. Accepted values are 0, 1 & 2.
|
|
36
|
+
*/
|
|
37
|
+
this.boundaryPageCount = 1;
|
|
38
|
+
/**
|
|
39
|
+
* The default page to display.
|
|
40
|
+
*/
|
|
41
|
+
this.defaultPage = 1;
|
|
42
|
+
/**
|
|
43
|
+
* If `true`, the pagination will not allow interaction.
|
|
44
|
+
*/
|
|
45
|
+
this.disabled = false;
|
|
46
|
+
/**
|
|
47
|
+
* If `true`, the current page of the simple pagination will not be displayed.
|
|
48
|
+
*/
|
|
49
|
+
this.hideCurrentPage = false;
|
|
50
|
+
/**
|
|
51
|
+
* If `true`, the first and last page buttons will not be displayed.
|
|
52
|
+
*/
|
|
53
|
+
this.hideFirstAndLastPageButton = false;
|
|
54
|
+
/**
|
|
55
|
+
* The label for the pagination item (applicable when simple pagination is being used).
|
|
56
|
+
*/
|
|
57
|
+
this.label = "Page";
|
|
58
|
+
/**
|
|
59
|
+
* If `true`, the pagination will display as black in the light theme, and white in dark theme.
|
|
60
|
+
*/
|
|
61
|
+
this.monochrome = false;
|
|
62
|
+
/**
|
|
63
|
+
* Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component.
|
|
64
|
+
*/
|
|
65
|
+
this.theme = "inherit";
|
|
66
|
+
/**
|
|
67
|
+
* The type of pagination to be used.
|
|
68
|
+
*/
|
|
69
|
+
this.type = "simple";
|
|
70
|
+
/**
|
|
71
|
+
* The current page displayed by the pagination.
|
|
72
|
+
*/
|
|
73
|
+
this.currentPage = this.defaultPage;
|
|
74
|
+
this.handleClickFirst = () => {
|
|
75
|
+
this.currentPage = 1;
|
|
76
|
+
this.icPageChange.emit({ value: this.currentPage });
|
|
77
|
+
};
|
|
78
|
+
this.handleClickPrevious = () => {
|
|
79
|
+
this.currentPage--;
|
|
80
|
+
this.icPageChange.emit({ value: this.currentPage });
|
|
81
|
+
};
|
|
82
|
+
this.handleClickNext = () => {
|
|
83
|
+
this.currentPage++;
|
|
84
|
+
this.icPageChange.emit({ value: this.currentPage });
|
|
85
|
+
};
|
|
86
|
+
this.handleClickLast = () => {
|
|
87
|
+
this.currentPage = this.pages;
|
|
88
|
+
this.icPageChange.emit({ value: this.currentPage });
|
|
89
|
+
};
|
|
90
|
+
// button rendering abstracted from component render methods for clarity
|
|
91
|
+
this.firstButton = () => {
|
|
92
|
+
return (h("ic-button", { id: "first-page-button", "aria-label": "Go to first page", theme: this.theme, onClick: this.handleClickFirst, class: "page-button first-last", disabled: this.currentPage === 1 || this.disabled, variant: "icon-tertiary", monochrome: this.theme == "light" || this.theme == "dark", innerHTML: paginationFirstLast }));
|
|
93
|
+
};
|
|
94
|
+
this.previousButton = () => {
|
|
95
|
+
return (h("ic-button", { id: "previous-page-button", "aria-label": "Go to previous page", theme: this.theme, onClick: this.handleClickPrevious, class: "page-button next-previous flip", disabled: this.currentPage === 1 || this.disabled, variant: "icon-tertiary", monochrome: this.theme == "light" || this.theme == "dark", innerHTML: paginationNextPrevious }));
|
|
96
|
+
};
|
|
97
|
+
this.nextButton = () => {
|
|
98
|
+
return (h("ic-button", { id: "next-page-button", "aria-label": "Go to next page", theme: this.theme, onClick: this.handleClickNext, class: "page-button next-previous", disabled: this.currentPage === this.pages || this.disabled, variant: "icon-tertiary", monochrome: this.theme == "light" || this.theme == "dark", innerHTML: paginationNextPrevious }));
|
|
99
|
+
};
|
|
100
|
+
this.lastButton = () => {
|
|
101
|
+
return (h("ic-button", { id: "last-page-button", "aria-label": "Go to last page", theme: this.theme, onClick: this.handleClickLast, class: "page-button first-last flip", disabled: this.currentPage === this.pages || this.disabled, variant: "icon-tertiary", monochrome: this.theme == "light" || this.theme == "dark", innerHTML: paginationFirstLast }));
|
|
102
|
+
};
|
|
103
|
+
this.renderStartEllipsis = () => {
|
|
104
|
+
return (h("ic-pagination-item", { theme: this.theme, monochrome: this.monochrome, type: "ellipsis", id: "start-ellipsis", disabled: this.disabled }));
|
|
105
|
+
};
|
|
106
|
+
this.renderEndEllipsis = () => {
|
|
107
|
+
return (h("ic-pagination-item", { theme: this.theme, monochrome: this.monochrome, type: "ellipsis", id: "end-ellipsis", disabled: this.disabled }));
|
|
108
|
+
};
|
|
109
|
+
this.renderStartItems = () => {
|
|
110
|
+
return this.startItems.map((page) => {
|
|
111
|
+
return (h("ic-pagination-item", { theme: this.theme, monochrome: this.monochrome, selected: page === this.currentPage, id: `pagination-item-${page}`, type: "page", page: page, disabled: this.disabled }));
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
this.renderEndItems = () => {
|
|
115
|
+
return this.endItems.map((page) => {
|
|
116
|
+
return (h("ic-pagination-item", { theme: this.theme, monochrome: this.monochrome, selected: page === this.currentPage, id: `pagination-item-${page}`, type: "page", page: page, disabled: this.disabled }));
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
this.renderMiddleItems = () => {
|
|
120
|
+
return this.midItems.map((page) => {
|
|
121
|
+
return (h("ic-pagination-item", { theme: this.theme, monochrome: this.monochrome, selected: page === this.currentPage, id: `pagination-item-${page}`, type: "page", page: page, disabled: this.disabled }));
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
watchAdjacentPageCountHandler() {
|
|
126
|
+
if (this.adjacentPageCount > 2) {
|
|
127
|
+
this.adjacentPageCount = 2;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
watchBoundaryPageCountHandler() {
|
|
131
|
+
if (this.boundaryPageCount > 2) {
|
|
132
|
+
this.boundaryPageCount = 2;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
watchDisabledHandler() {
|
|
136
|
+
removeDisabledFalse(this.disabled, this.el);
|
|
137
|
+
}
|
|
138
|
+
watchNumberPagesHandler() {
|
|
139
|
+
this.watchPageChangeHandler();
|
|
140
|
+
}
|
|
141
|
+
watchTypeHandler() {
|
|
142
|
+
this.watchPageChangeHandler();
|
|
143
|
+
}
|
|
144
|
+
watchPageChangeHandler() {
|
|
145
|
+
if (this.type === "simple") {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
this.startEllipsis = false;
|
|
149
|
+
this.endEllipsis = false;
|
|
150
|
+
this.startItems = [];
|
|
151
|
+
this.endItems = [];
|
|
152
|
+
this.midItems = [];
|
|
153
|
+
const startItems = [];
|
|
154
|
+
let startItemCount = 0;
|
|
155
|
+
const endItems = [];
|
|
156
|
+
let endStart = this.pages;
|
|
157
|
+
const midItems = [];
|
|
158
|
+
let midStart;
|
|
159
|
+
let midEnd;
|
|
160
|
+
let startEllipsis = false;
|
|
161
|
+
let endEllipsis = false;
|
|
162
|
+
if (this.pages <=
|
|
163
|
+
this.boundaryPageCount * 2 + this.adjacentPageCount * 2 + 3) {
|
|
164
|
+
this.startEllipsis = false;
|
|
165
|
+
this.endEllipsis = false;
|
|
166
|
+
for (let i = 1; i <= this.pages; i++) {
|
|
167
|
+
startItems.push(i);
|
|
168
|
+
}
|
|
169
|
+
this.startItems = startItems;
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
startItemCount = this.boundaryPageCount === 0 ? 1 : this.boundaryPageCount;
|
|
173
|
+
endStart =
|
|
174
|
+
this.boundaryPageCount === 0
|
|
175
|
+
? this.pages
|
|
176
|
+
: this.pages - this.boundaryPageCount + 1;
|
|
177
|
+
if (this.currentPage <=
|
|
178
|
+
this.adjacentPageCount + this.boundaryPageCount + 2) {
|
|
179
|
+
startEllipsis = false;
|
|
180
|
+
endEllipsis = true;
|
|
181
|
+
let numItems = 2 * this.adjacentPageCount + 1;
|
|
182
|
+
if (this.boundaryPageCount === 0) {
|
|
183
|
+
numItems--;
|
|
184
|
+
}
|
|
185
|
+
midStart = startItemCount + 1;
|
|
186
|
+
midEnd = midStart + numItems;
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
startEllipsis = true;
|
|
190
|
+
if (this.currentPage >
|
|
191
|
+
this.pages - (this.adjacentPageCount + this.boundaryPageCount + 2)) {
|
|
192
|
+
let numItems = 2 * this.adjacentPageCount + 1;
|
|
193
|
+
if (this.boundaryPageCount === 0) {
|
|
194
|
+
numItems--;
|
|
195
|
+
}
|
|
196
|
+
midEnd =
|
|
197
|
+
this.boundaryPageCount === 0
|
|
198
|
+
? this.pages - 1
|
|
199
|
+
: this.pages - this.boundaryPageCount;
|
|
200
|
+
midStart = midEnd - numItems;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
endEllipsis = true;
|
|
204
|
+
midStart = this.currentPage - this.adjacentPageCount;
|
|
205
|
+
midEnd = this.currentPage + this.adjacentPageCount;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
//create array of start items
|
|
209
|
+
if (this.boundaryPageCount > 0 ||
|
|
210
|
+
(this.boundaryPageCount === 0 && startEllipsis === false)) {
|
|
211
|
+
for (let i = 1; i <= startItemCount; i++) {
|
|
212
|
+
startItems.push(i);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
//create array of end items
|
|
216
|
+
if (this.boundaryPageCount > 0 ||
|
|
217
|
+
(this.boundaryPageCount === 0 && endEllipsis === false)) {
|
|
218
|
+
for (let i = endStart; i <= this.pages; i++) {
|
|
219
|
+
endItems.push(i);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
//create array of mid items
|
|
223
|
+
for (let i = midStart; i <= midEnd; i++) {
|
|
224
|
+
midItems.push(i);
|
|
225
|
+
}
|
|
226
|
+
this.startEllipsis = startEllipsis;
|
|
227
|
+
this.endEllipsis = endEllipsis;
|
|
228
|
+
this.startItems = startItems;
|
|
229
|
+
this.endItems = endItems;
|
|
230
|
+
this.midItems = midItems;
|
|
231
|
+
}
|
|
232
|
+
componentWillLoad() {
|
|
233
|
+
this.watchPageChangeHandler();
|
|
234
|
+
this.watchBoundaryPageCountHandler();
|
|
235
|
+
this.watchAdjacentPageCountHandler();
|
|
236
|
+
removeDisabledFalse(this.disabled, this.el);
|
|
237
|
+
}
|
|
238
|
+
componentDidLoad() {
|
|
239
|
+
onComponentRequiredPropUndefined([{ prop: this.pages, propName: "pages" }], "Pagination");
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Prevents focus lingering on a disabled element. If the currently
|
|
243
|
+
* focused element is one of the back buttons (and we reach the first page),
|
|
244
|
+
* move focus to "next" button, and vice versa.
|
|
245
|
+
* @param ev
|
|
246
|
+
*/
|
|
247
|
+
icPageChangeHandler(ev) {
|
|
248
|
+
var _a, _b, _c;
|
|
249
|
+
const shadow = (_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.shadowRoot;
|
|
250
|
+
const activeEl = shadow ? shadow.activeElement : document.activeElement;
|
|
251
|
+
if (!shadow || !activeEl) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (ev.detail.value === 1 &&
|
|
255
|
+
["first-page-button", "previous-page-button"].some((id) => id === (activeEl === null || activeEl === void 0 ? void 0 : activeEl.id))) {
|
|
256
|
+
const btn = (_b = shadow.querySelector("#next-page-button").shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("button");
|
|
257
|
+
// When navigating from firstPage->lastPage or vice versa, the to-be-selected element will be disabled. wait a tick so that it can receive focus.
|
|
258
|
+
setTimeout(() => btn === null || btn === void 0 ? void 0 : btn.focus(), 10);
|
|
259
|
+
}
|
|
260
|
+
else if (ev.detail.value === this.pages &&
|
|
261
|
+
["last-page-button", "next-page-button"].some((id) => id === (activeEl === null || activeEl === void 0 ? void 0 : activeEl.id))) {
|
|
262
|
+
const btn = (_c = shadow.querySelector("#previous-page-button").shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector("button");
|
|
263
|
+
setTimeout(() => btn === null || btn === void 0 ? void 0 : btn.focus(), 10);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
paginationItemClickHandler(ev) {
|
|
267
|
+
const page = ev.detail.page;
|
|
268
|
+
this.currentPage = page;
|
|
269
|
+
this.icPageChange.emit({ value: this.currentPage });
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Sets the currently displayed page.
|
|
273
|
+
* @param {number} page The page number to set as the current page
|
|
274
|
+
*/
|
|
275
|
+
async setCurrentPage(page) {
|
|
276
|
+
if (typeof page === "number" && page > 0 && page <= this.pages) {
|
|
277
|
+
this.currentPage = page;
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
console.error("Current page must be a number greater than zero but less than or equal to the total number of pages");
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
render() {
|
|
284
|
+
const { type, currentPage, hideCurrentPage, disabled, hideFirstAndLastPageButton, label, theme, monochrome, } = this;
|
|
285
|
+
return (h(Host, { key: 'cefb3137892be2304c041ca32ca118268f8ccb07', class: {
|
|
286
|
+
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
287
|
+
["ic-pagination-monochrome"]: !!monochrome,
|
|
288
|
+
} }, type === "simple" && (h("nav", { key: '9a1d8230be41cb26b31bb8af066a32e9b64e0d89', class: {
|
|
289
|
+
["disabled"]: !!disabled,
|
|
290
|
+
}, role: "navigation", "aria-label": this.accessibleLabel }, hideFirstAndLastPageButton ? null : this.firstButton(), this.previousButton(), h("ic-pagination-item", { key: '577b9b9894ce6ddc2cf02381729600e4284e8912', theme: this.theme, monochrome: this.monochrome, type: "simple-current", page: currentPage, label: label, class: { ["hide-current-page"]: !!hideCurrentPage }, disabled: disabled }), this.nextButton(), hideFirstAndLastPageButton ? null : this.lastButton())), type === "complex" && (h("nav", { key: '317d507ca76549e3c980ced7d01332504738a102', class: {
|
|
291
|
+
["disabled"]: !!disabled,
|
|
292
|
+
}, role: "navigation", "aria-label": this.accessibleLabel }, hideFirstAndLastPageButton ? null : this.firstButton(), this.previousButton(), this.renderStartItems(), this.startEllipsis && this.renderStartEllipsis(), this.renderMiddleItems(), this.endEllipsis && this.renderEndEllipsis(), this.renderEndItems(), this.nextButton(), hideFirstAndLastPageButton ? null : this.lastButton())), type === "complex" && (h("span", { key: '6d3a5778f4704dd5ec1e74bf2cf236143c5f7e7c', class: "sr-only", "aria-live": "polite" }, "Page ", this.currentPage))));
|
|
293
|
+
}
|
|
294
|
+
get el() { return getElement(this); }
|
|
295
|
+
static get watchers() { return {
|
|
296
|
+
"adjacentPageCount": ["watchAdjacentPageCountHandler"],
|
|
297
|
+
"boundaryPageCount": ["watchBoundaryPageCountHandler"],
|
|
298
|
+
"disabled": ["watchDisabledHandler"],
|
|
299
|
+
"pages": ["watchNumberPagesHandler"],
|
|
300
|
+
"type": ["watchTypeHandler"],
|
|
301
|
+
"currentPage": ["watchPageChangeHandler"]
|
|
302
|
+
}; }
|
|
303
|
+
};
|
|
304
|
+
Pagination.style = IcPaginationStyle0;
|
|
305
|
+
|
|
306
|
+
const Expand = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
307
|
+
<path d="M7 9.5L12 14.5L17 9.5H7Z" fill="currentColor" />
|
|
308
|
+
</svg>
|
|
309
|
+
`;
|
|
310
|
+
|
|
311
|
+
const Clear = `<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
|
312
|
+
<path d="M12.6666 4.27334L11.7266 3.33334L7.99998 7.06001L4.27331 3.33334L3.33331 4.27334L7.05998 8.00001L3.33331 11.7267L4.27331 12.6667L7.99998 8.94001L11.7266 12.6667L12.6666 11.7267L8.93998 8.00001L12.6666 4.27334Z" fill="currentColor" />
|
|
313
|
+
</svg>
|
|
314
|
+
`;
|
|
315
|
+
|
|
316
|
+
const icSelectCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;position:relative;--ic-input-label-helpertext-padding:var(--ic-space-xs);--menu-max-height:100px;--border-color:var(--ic-select-field-border);--border-color-hover:var(--ic-select-field-border-hover);--border-color-pressed:var(--ic-select-field-border-pressed);--border-color-disabled:var(--ic-select-field-border-disabled);--border-color-error:var(--ic-select-field-border-error);--border-color-error-hover:var(--ic-select-field-border-error-hover);--border-color-error-pressed:var(--ic-select-field-border-error-pressed);--border-color-success:var(--ic-select-field-border-success);--border-color-success-hover:var(--ic-select-field-border-success-hover);--border-color-success-pressed:var(--ic-select-field-border-success-pressed);--border-color-warning:var(--ic-select-field-border-warning);--border-color-warning-hover:var(--ic-select-field-border-warning-hover);--border-color-warning-pressed:var(--ic-select-field-border-warning-pressed);--ic-input-label-text-color:var(--ic-select-field-label);--ic-input-label-helper-text-color:var(\n --ic-select-input-field-label-subtitle\n );--ic-input-validation-status-text-color:var(--ic-select-state-text);--ic-input-validation-error:var(--ic-select-state-icon-error);--ic-input-validation-warning-icon-color:var(--ic-select-state-icon-warning);--ic-input-validation-success-icon-color:var(--ic-select-state-icon-success);--menu-item-text-color:var(--ic-select-list-option-text);--menu-bg-color:var(--ic-select-list-option-background);--menu-border-color:var(--ic-select-dropdown-list-border)}:host(.ic-select-disabled){--ic-input-label-text-color:var(--ic-select-field-label-disabled);--ic-input-label-helper-text-color:var(\n --ic-select-input-field-label-subtitle-disabled\n )}:host(.ic-select-full-width){width:100%}ic-input-component-container.menu-open{--border-color:var(--ic-select-field-border-pressed)}ic-input-validation .status-icon,ic-input-validation .statustext{visibility:visible}ic-input-validation.menu-open .status-icon,ic-input-validation.menu-open .statustext{visibility:hidden;transition:visibility 0s}ic-input-label{margin-bottom:var(--ic-space-xs)}select{border:0;border-radius:var(--ic-border-radius);background-color:var(--ic-select-field-background);color:var(--ic-select-content-text);line-height:1.5rem;letter-spacing:0.005rem;width:100%;height:100%;padding-left:0.375rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-repeat:no-repeat;background-position:right 0.375rem center;background-image:var(--ic-select-mobile-dropdown-icon);caret-color:var(--ic-select-input-field-text-cursor)}select option,.select-option-selected{color:var(--ic-select-list-option-text)}select:disabled{color:var(--ic-select-content-text-disabled);background-image:var(--ic-select-mobile-dropdown-icon-disabled)}select:focus{border:0;outline:0}select:not([disabled]){cursor:pointer}.select-container{width:100%;display:flex;align-items:center;position:relative}.select-input{width:100%;height:100%;padding:0 0.375rem;display:flex;cursor:pointer;align-items:center;justify-content:space-between;background:none;border:none;background-color:var(--ic-select-field-background);color:var(--ic-select-content-text)}.select-input:focus{outline:none}.select-input[disabled]{pointer-events:none}:host(.ic-select-searchable) .select-input{cursor:auto}.select-input.with-clear-button{padding-right:0}.value-text{max-width:calc(100% - (var(--ic-space-lg) + var(--ic-space-xxs)));box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin-bottom:0 !important}.value-text.with-clear-button{padding-right:calc(var(--ic-space-xl) + var(--ic-space-xs))}.searchable-select-container{align-items:center;display:flex;width:100%;position:relative}.expand-icon{height:var(--ic-space-lg);padding-left:var(--ic-space-xxs);color:var(--ic-select-expand-icon-color)}.expand-icon>svg{display:inline-block;width:var(--ic-space-lg);height:var(--ic-space-lg)}:host(.ic-select-disabled) .expand-icon,:host(.ic-select-disabled) .expand-icon>svg>path{color:var(--ic-select-disabled-expand-icon-color)}:host(.ic-select-searchable) .expand-icon{padding-left:0;height:2.25rem}:host(.ic-select-searchable) .expand-icon>svg{height:2.25rem;padding:0 calc(var(--ic-space-xxxs) + var(--ic-space-xxs)) 0\n var(--ic-space-xxs)}:host(.ic-select-searchable:not(.ic-select-disabled)) .expand-icon>svg{cursor:pointer}.expand-icon-open{color:var(--ic-select-expand-icon-color)}.expand-icon-open,:host(.ic-select-searchable) .expand-icon-open{transform:rotateX(180deg)}.placeholder{color:var(--ic-select-content-placeholder-text)}:host(.ic-select-disabled.ic-select-searchable) .select-input::-moz-placeholder{color:var(--ic-select-content-text-disabled)}:host(.ic-select-disabled) .value-text,:host(.ic-select-disabled) .select-input,:host(.ic-select-disabled) .placeholder,:host(.ic-select-disabled.ic-select-searchable) .select-input::placeholder{color:var(--ic-select-content-text-disabled)}.select-input-end{display:flex;align-items:center}.clear-button-container{display:flex;align-items:center}.divider{width:var(--ic-space-1px);background-color:var(--ic-select-content-divider);margin:var(--ic-space-xxs) 0;border-radius:var(--ic-space-1px);height:var(--ic-space-lg)}:host(.ic-select-small) .divider{height:var(--ic-space-md)}:host(.ic-select-large) .divider{height:var(--ic-space-xl)}.clear-button{color:var(--ic-select-clear-button);position:absolute;right:calc(var(--ic-space-xl) + var(--ic-space-xxs) - var(--ic-space-1px));border-radius:var(--ic-border-radius);transition:box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition)}.clear-button:focus,.clear-button:active{background-color:var(--ic-color-focus-inner);box-shadow:inset 0 0 0 0.125rem var(--ic-color-focus-outer);border-radius:0.25rem}.clear-button:focus,.clear-button:active *{fill:var(--ic-atoms-input-clear-button-focus)}.clear-button.searchable{position:static}.aria-live-hidden-text{border:0;clip:rect(0, 0, 0, 0, 0);height:var(--ic-space-1px);overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:var(--ic-space-1px)}::slotted([slot=\"icon\"]){fill:var(--ic-select-content-placeholder-text)}.has-value ::slotted([slot=\"icon\"]){fill:var(--ic-select-content-text)}.readonly ::slotted([slot=\"icon\"]){padding:0.375rem;margin-bottom:0.75rem}@media (forced-colors: active){.has-value ::slotted([slot=\"icon\"]){fill:currentcolor}}@media (prefers-reduced-motion: reduce){.clear-button,ic-input-validation.menu-open .status-icon,ic-input-validation.menu-open .statustext{transition:none}}";
|
|
317
|
+
const IcSelectStyle0 = icSelectCss;
|
|
318
|
+
|
|
319
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
320
|
+
var t = {};
|
|
321
|
+
for (var p in s)
|
|
322
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
323
|
+
t[p] = s[p];
|
|
324
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
325
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
326
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
327
|
+
t[p[i]] = s[p[i]];
|
|
328
|
+
}
|
|
329
|
+
return t;
|
|
330
|
+
};
|
|
331
|
+
let inputIds$1 = 0;
|
|
332
|
+
const MUTABLE_ATTRIBUTES$1 = [...IC_INHERITED_ARIA, "tabindex", "title"];
|
|
333
|
+
const Select = class {
|
|
334
|
+
constructor(hostRef) {
|
|
335
|
+
registerInstance(this, hostRef);
|
|
336
|
+
this.icBlur = createEvent(this, "icBlur", 7);
|
|
337
|
+
this.icChange = createEvent(this, "icChange", 7);
|
|
338
|
+
this.icClear = createEvent(this, "icClear", 7);
|
|
339
|
+
this.icClose = createEvent(this, "icClose", 7);
|
|
340
|
+
this.icFocus = createEvent(this, "icFocus", 7);
|
|
341
|
+
this.icInput = createEvent(this, "icInput", 7);
|
|
342
|
+
this.icOpen = createEvent(this, "icOpen", 7);
|
|
343
|
+
this.icOptionSelect = createEvent(this, "icOptionSelect", 7);
|
|
344
|
+
this.icOptionDeselect = createEvent(this, "icOptionDeselect", 7);
|
|
345
|
+
this.icRetryLoad = createEvent(this, "icRetryLoad", 7);
|
|
346
|
+
this.inputId = `ic-select-input-${inputIds$1++}`;
|
|
347
|
+
this.menuId = `${this.inputId}-menu`;
|
|
348
|
+
this.inheritedAttributes = {};
|
|
349
|
+
this.hostMutationObserver = null;
|
|
350
|
+
this.timeoutTimer = null;
|
|
351
|
+
this.hasTimedOut = false;
|
|
352
|
+
this.initialRender = true;
|
|
353
|
+
this.pressedCharacters = "";
|
|
354
|
+
this.hasError = false;
|
|
355
|
+
this.searchableSelectInputValue = "";
|
|
356
|
+
this.selectButtonAriaLiveText = "";
|
|
357
|
+
this.selectInputAriaLiveText = "";
|
|
358
|
+
/**
|
|
359
|
+
* If `true`, the disabled state will be set.
|
|
360
|
+
*/
|
|
361
|
+
this.disabled = false;
|
|
362
|
+
/**
|
|
363
|
+
* If `true`, the built in filtering will be disabled for a searchable variant. For example, if options will already be filtered from external source.
|
|
364
|
+
*/
|
|
365
|
+
this.disableAutoFiltering = false;
|
|
366
|
+
/**
|
|
367
|
+
* The text displayed when there are no options in the option list.
|
|
368
|
+
*/
|
|
369
|
+
this.emptyOptionListText = "No results found";
|
|
370
|
+
/**
|
|
371
|
+
* If `true`, the select will fill the width of the container.
|
|
372
|
+
*/
|
|
373
|
+
this.fullWidth = false;
|
|
374
|
+
/**
|
|
375
|
+
* The helper text that will be displayed for additional field guidance.
|
|
376
|
+
*/
|
|
377
|
+
this.helperText = "";
|
|
378
|
+
/**
|
|
379
|
+
* If `true`, the label will be hidden and the required label value will be applied as an aria-label.
|
|
380
|
+
*/
|
|
381
|
+
this.hideLabel = false;
|
|
382
|
+
/**
|
|
383
|
+
* If `true`, descriptions of options will be included when filtering options in a searchable select. Only applies to built in filtering.
|
|
384
|
+
*/
|
|
385
|
+
this.includeDescriptionsInSearch = false;
|
|
386
|
+
/**
|
|
387
|
+
* If `true`, group titles of grouped options will be included when filtering options in a searchable select. Only applies to built in filtering.
|
|
388
|
+
*/
|
|
389
|
+
this.includeGroupTitlesInSearch = false;
|
|
390
|
+
/**
|
|
391
|
+
* The message displayed when external loading times out.
|
|
392
|
+
*/
|
|
393
|
+
this.loadingErrorLabel = "Loading Error";
|
|
394
|
+
/**
|
|
395
|
+
* The message displayed whilst the options are being loaded externally.
|
|
396
|
+
*/
|
|
397
|
+
this.loadingLabel = "Loading...";
|
|
398
|
+
/**
|
|
399
|
+
* If `true`, multiple options can be selected.
|
|
400
|
+
*/
|
|
401
|
+
this.multiple = false;
|
|
402
|
+
/**
|
|
403
|
+
* The name of the control, which is submitted with the form data.
|
|
404
|
+
*/
|
|
405
|
+
this.name = this.inputId;
|
|
406
|
+
/**
|
|
407
|
+
* The placeholder value to be displayed.
|
|
408
|
+
*/
|
|
409
|
+
this.placeholder = "Select an option";
|
|
410
|
+
/**
|
|
411
|
+
* If `true`, the readonly state will be set.
|
|
412
|
+
*/
|
|
413
|
+
this.readonly = false;
|
|
414
|
+
/**
|
|
415
|
+
* If `true`, the select will require a value.
|
|
416
|
+
*/
|
|
417
|
+
this.required = false;
|
|
418
|
+
/**
|
|
419
|
+
* If `true`, a searchable variant of the select will be displayed which can be typed in to filter options. This functionality is only available on the single-select variant of the select component.
|
|
420
|
+
*/
|
|
421
|
+
this.searchable = false;
|
|
422
|
+
/**
|
|
423
|
+
* Whether the search string of the searchable select should match the start of or anywhere in the options. Only applies to built in filtering.
|
|
424
|
+
*/
|
|
425
|
+
this.searchMatchPosition = "anywhere";
|
|
426
|
+
/**
|
|
427
|
+
* If `true`, the icOptionSelect event will be fired on enter instead of ArrowUp and ArrowDown on the single select.
|
|
428
|
+
*/
|
|
429
|
+
this.selectOnEnter = false;
|
|
430
|
+
/**
|
|
431
|
+
* If `true`, a button which clears the select input when clicked will be displayed. The button will always appear on the searchable select.
|
|
432
|
+
*/
|
|
433
|
+
this.showClearButton = false;
|
|
434
|
+
/**
|
|
435
|
+
* The size of the select.
|
|
436
|
+
*/
|
|
437
|
+
this.size = "medium";
|
|
438
|
+
/**
|
|
439
|
+
* Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component.
|
|
440
|
+
*/
|
|
441
|
+
this.theme = "inherit";
|
|
442
|
+
/**
|
|
443
|
+
* The value of the `aria-live` attribute on the validation message.
|
|
444
|
+
*/
|
|
445
|
+
this.validationAriaLive = "polite";
|
|
446
|
+
/**
|
|
447
|
+
* The validation status - e.g. 'error' | 'warning' | 'success'.
|
|
448
|
+
*/
|
|
449
|
+
this.validationStatus = "";
|
|
450
|
+
/**
|
|
451
|
+
* The text to display as the validation message.
|
|
452
|
+
*/
|
|
453
|
+
this.validationText = "";
|
|
454
|
+
/**
|
|
455
|
+
* If `true` and on a mobile or tablet device, the native select element will be used instead of the custom select component for better usability.
|
|
456
|
+
*/
|
|
457
|
+
this.useNativeSelectOnMobile = true;
|
|
458
|
+
/**
|
|
459
|
+
* If `true`, the loading state will be triggered when fetching options asynchronously.
|
|
460
|
+
*/
|
|
461
|
+
this.loading = false;
|
|
462
|
+
/**
|
|
463
|
+
* The possible selection options.
|
|
464
|
+
*/
|
|
465
|
+
this.options = [];
|
|
466
|
+
this.flatOptions = [];
|
|
467
|
+
/**
|
|
468
|
+
* The amount of time, in milliseconds, to wait to trigger the `icInput` event after each keystroke.
|
|
469
|
+
*/
|
|
470
|
+
this.debounce = 0;
|
|
471
|
+
this.currDebounce = this.debounce;
|
|
472
|
+
/**
|
|
473
|
+
* The value of the select, reflected by the value of the currently selected option.
|
|
474
|
+
* For the searchable variant, the value is also reflected by the user input.
|
|
475
|
+
* For the multi-select variant, the value must be an array of option values.
|
|
476
|
+
*/
|
|
477
|
+
this.value = null;
|
|
478
|
+
this.initialValue = this.value;
|
|
479
|
+
this.open = false;
|
|
480
|
+
this.getValidatedValue = (value) => {
|
|
481
|
+
const validValues = this.flatOptions.map((opt) => opt.value);
|
|
482
|
+
if (validValues.length === 0)
|
|
483
|
+
return value;
|
|
484
|
+
if (this.multiple) {
|
|
485
|
+
if (!value)
|
|
486
|
+
return null;
|
|
487
|
+
const arr = Array.isArray(value) ? value : [value]; // Ensure value is an array
|
|
488
|
+
const filtered = validValues.filter((v) => arr.includes(v)); // Keep only valid values
|
|
489
|
+
return filtered.length > 0 ? filtered : null;
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
return validValues.includes(value) ? value : null;
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
this.getFilteredOptions = (searchString, searchMatchPosition, includeDescriptionsInSearch, includeGroupTitlesInSearch) => {
|
|
496
|
+
const search = searchString.toLowerCase();
|
|
497
|
+
const match = (text, method) => method === "anywhere" ? text.includes(search) : text.startsWith(search);
|
|
498
|
+
return this.unflattenOptions(this.flatOptions.filter((option) => {
|
|
499
|
+
var _a, _b, _c, _d;
|
|
500
|
+
const label = option.label.toLowerCase();
|
|
501
|
+
const group = (_b = (_a = option.group) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : "";
|
|
502
|
+
const description = (_d = (_c = option.description) === null || _c === void 0 ? void 0 : _c.toLowerCase()) !== null && _d !== void 0 ? _d : "";
|
|
503
|
+
return (match(label, searchMatchPosition) ||
|
|
504
|
+
(includeDescriptionsInSearch &&
|
|
505
|
+
match(description, searchMatchPosition)) ||
|
|
506
|
+
(includeGroupTitlesInSearch && match(group, searchMatchPosition)));
|
|
507
|
+
}));
|
|
508
|
+
};
|
|
509
|
+
this.getOptions = () => {
|
|
510
|
+
const options = this.searchable &&
|
|
511
|
+
!this.disableAutoFiltering &&
|
|
512
|
+
this.searchableSelectInputValue
|
|
513
|
+
? this.getFilteredOptions(this.searchableSelectInputValue, this.searchMatchPosition, this.includeDescriptionsInSearch, this.includeGroupTitlesInSearch)
|
|
514
|
+
: this.unflattenOptions(this.flatOptions);
|
|
515
|
+
if (this.hasTimedOut)
|
|
516
|
+
return [{ label: this.loadingErrorLabel, value: "", timedOut: true }];
|
|
517
|
+
if (this.loading)
|
|
518
|
+
return [{ label: this.loadingLabel, value: "", loading: true }];
|
|
519
|
+
if (options.length > 0)
|
|
520
|
+
return options;
|
|
521
|
+
return [{ label: this.emptyOptionListText, value: "" }];
|
|
522
|
+
};
|
|
523
|
+
this.getFlatOptions = (options) => options.flatMap((item) => ("children" in item && item.children
|
|
524
|
+
? [...item.children.map((child) => (Object.assign({ group: item.label }, child)))]
|
|
525
|
+
: [item]));
|
|
526
|
+
this.unflattenOptions = (flatOptions) => {
|
|
527
|
+
const groupMap = new Map();
|
|
528
|
+
const result = [];
|
|
529
|
+
for (const option of flatOptions) {
|
|
530
|
+
if (option.group) {
|
|
531
|
+
let group = groupMap.get(option.group);
|
|
532
|
+
if (!group) {
|
|
533
|
+
group = { label: option.group, children: [] };
|
|
534
|
+
groupMap.set(option.group, group);
|
|
535
|
+
result.push(group);
|
|
536
|
+
}
|
|
537
|
+
const rest = __rest(option, ["group"]);
|
|
538
|
+
group.children.push(rest);
|
|
539
|
+
}
|
|
540
|
+
else {
|
|
541
|
+
result.push(option);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return result;
|
|
545
|
+
};
|
|
546
|
+
this.getLabelFromValue = (value) => { var _a, _b; return (_b = (_a = this.flatOptions.find((option) => option.value === value)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : ""; };
|
|
547
|
+
// Construct the string that will be shown in the select input or button
|
|
548
|
+
this.getLabelString = () => {
|
|
549
|
+
if (Array.isArray(this.value)) {
|
|
550
|
+
return this.value.map(this.getLabelFromValue).filter(Boolean).join(", ");
|
|
551
|
+
}
|
|
552
|
+
return (this.getLabelFromValue(this.value) ||
|
|
553
|
+
(this.searchable ? "" : this.placeholder));
|
|
554
|
+
};
|
|
555
|
+
this.handleClick = (event) => {
|
|
556
|
+
var _a;
|
|
557
|
+
if (event.detail !== 0) {
|
|
558
|
+
(_a = this.menu) === null || _a === void 0 ? void 0 : _a.handleClickOpen();
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
this.handleExpandIconMouseDown = (event) => {
|
|
562
|
+
var _a;
|
|
563
|
+
if (!this.disabled) {
|
|
564
|
+
event.preventDefault();
|
|
565
|
+
(_a = this.searchableSelectElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
566
|
+
this.handleClick(event);
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
this.handleBlur = ({ relatedTarget }) => {
|
|
570
|
+
var _a, _b;
|
|
571
|
+
const target = relatedTarget;
|
|
572
|
+
if (this.el.contains(target) ||
|
|
573
|
+
((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(target)) ||
|
|
574
|
+
((_b = this.menu) === null || _b === void 0 ? void 0 : _b.contains(target)) ||
|
|
575
|
+
target === this.clearButton) {
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
this.open = false;
|
|
579
|
+
this.handleFocusIndicatorDisplay();
|
|
580
|
+
if (this.searchable) {
|
|
581
|
+
this.searchableSelectInputValue = "";
|
|
582
|
+
}
|
|
583
|
+
this.icBlur.emit();
|
|
584
|
+
};
|
|
585
|
+
this.handleTimeoutBlur = (event) => {
|
|
586
|
+
this.handleBlur(event.detail.ev);
|
|
587
|
+
};
|
|
588
|
+
this.handleFocus = () => {
|
|
589
|
+
this.icFocus.emit();
|
|
590
|
+
};
|
|
591
|
+
this.handleClear = () => {
|
|
592
|
+
this.clearTimer();
|
|
593
|
+
this.loading = false;
|
|
594
|
+
this.value = null;
|
|
595
|
+
this.searchableSelectInputValue = "";
|
|
596
|
+
this.icClear.emit();
|
|
597
|
+
this.setFocus();
|
|
598
|
+
};
|
|
599
|
+
this.setTextColor = () => {
|
|
600
|
+
if (this.nativeSelectElement) {
|
|
601
|
+
this.nativeSelectElement.className =
|
|
602
|
+
this.nativeSelectElement.selectedIndex === 0
|
|
603
|
+
? "placeholder"
|
|
604
|
+
: "select-option-selected";
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
this.handleNativeSelectChange = () => {
|
|
608
|
+
if (this.nativeSelectElement) {
|
|
609
|
+
this.icOptionSelect.emit({ value: this.nativeSelectElement.value });
|
|
610
|
+
this.icChange.emit({ value: this.nativeSelectElement.value });
|
|
611
|
+
}
|
|
612
|
+
this.setTextColor();
|
|
613
|
+
};
|
|
614
|
+
this.handleFocusIndicatorDisplay = () => {
|
|
615
|
+
var _a;
|
|
616
|
+
const focusIndicator = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".focus-indicator");
|
|
617
|
+
if (focusIndicator) {
|
|
618
|
+
if (this.open) {
|
|
619
|
+
focusIndicator.classList.add("focus-indicator-enabled");
|
|
620
|
+
}
|
|
621
|
+
else {
|
|
622
|
+
focusIndicator.classList.remove("focus-indicator-enabled");
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
this.handleKeyDown = (event) => {
|
|
627
|
+
var _a, _b;
|
|
628
|
+
if (!(event.key === " " && this.pressedCharacters.length > 0)) {
|
|
629
|
+
if (this.open) {
|
|
630
|
+
(_a = this.menu) === null || _a === void 0 ? void 0 : _a.handleMenuKeyDown(event);
|
|
631
|
+
}
|
|
632
|
+
else {
|
|
633
|
+
(_b = this.menu) === null || _b === void 0 ? void 0 : _b.handleKeyboardOpen(event);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
if (!this.multiple &&
|
|
637
|
+
!this.searchable &&
|
|
638
|
+
!this.selectOnEnter &&
|
|
639
|
+
/^[a-zA-Z0-9 ]$/.test(event.key)) {
|
|
640
|
+
this.handleCharacterKeyDown(event.key);
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
this.handleCharacterKeyDown = (key) => {
|
|
644
|
+
// Only close menu when space is pressed if not being used alongside character keys to quickly select options
|
|
645
|
+
if (this.open && key === " " && this.pressedCharacters.length === 0) {
|
|
646
|
+
this.open = false;
|
|
647
|
+
}
|
|
648
|
+
if (key.length !== 1 || this.searchable) {
|
|
649
|
+
this.pressedCharacters = "";
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
window.clearTimeout(this.characterKeyPressTimer);
|
|
653
|
+
this.characterKeyPressTimer = window.setTimeout(() => (this.pressedCharacters = ""), 1000);
|
|
654
|
+
if (key !== " " || !!this.pressedCharacters) {
|
|
655
|
+
this.pressedCharacters += key;
|
|
656
|
+
const filteredOptions = this.getFilteredOptions(this.pressedCharacters, "start", false, false);
|
|
657
|
+
if (filteredOptions.length > 0) {
|
|
658
|
+
const firstOption = filteredOptions[0];
|
|
659
|
+
if ("children" in firstOption) {
|
|
660
|
+
this.value = firstOption.children[0].value;
|
|
661
|
+
}
|
|
662
|
+
else {
|
|
663
|
+
this.value = firstOption.value;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
this.handleNativeSelectKeyDown = (event) => {
|
|
669
|
+
this.handleKeyDown(event);
|
|
670
|
+
};
|
|
671
|
+
this.handleSelectChange = (event) => {
|
|
672
|
+
const { value } = event.detail;
|
|
673
|
+
if (!value || this.getLabelFromValue(value) === this.emptyOptionListText) {
|
|
674
|
+
this.value = null;
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
if (this.multiple) {
|
|
678
|
+
let valueArray = Array.isArray(this.value) ? [...this.value] : [];
|
|
679
|
+
const index = valueArray.indexOf(value);
|
|
680
|
+
if (index > -1) {
|
|
681
|
+
valueArray.splice(index, 1);
|
|
682
|
+
this.icOptionDeselect.emit({ value });
|
|
683
|
+
}
|
|
684
|
+
else {
|
|
685
|
+
this.icOptionSelect.emit({ value });
|
|
686
|
+
valueArray.push(value);
|
|
687
|
+
valueArray = this.getValidatedValue(valueArray);
|
|
688
|
+
}
|
|
689
|
+
this.value = valueArray.length ? valueArray : null;
|
|
690
|
+
}
|
|
691
|
+
else {
|
|
692
|
+
this.icOptionSelect.emit({ value });
|
|
693
|
+
this.value = value;
|
|
694
|
+
if (this.searchable)
|
|
695
|
+
this.searchableSelectInputValue = "";
|
|
696
|
+
}
|
|
697
|
+
};
|
|
698
|
+
this.handleSelectAllChange = ({ detail, }) => {
|
|
699
|
+
const allSelectableValues = this.flatOptions
|
|
700
|
+
.filter((option) => !option.disabled)
|
|
701
|
+
.map((option) => option.value);
|
|
702
|
+
if (detail.select) {
|
|
703
|
+
allSelectableValues
|
|
704
|
+
.filter((value) => { var _a; return !((_a = this.value) !== null && _a !== void 0 ? _a : []).includes(value); })
|
|
705
|
+
.forEach((value) => {
|
|
706
|
+
this.icOptionSelect.emit({ value });
|
|
707
|
+
});
|
|
708
|
+
this.value = allSelectableValues;
|
|
709
|
+
}
|
|
710
|
+
else {
|
|
711
|
+
this.value.forEach((value) => this.icOptionDeselect.emit({ value }));
|
|
712
|
+
this.value = null;
|
|
713
|
+
}
|
|
714
|
+
};
|
|
715
|
+
this.handleFormReset = () => {
|
|
716
|
+
this.value = this.initialValue;
|
|
717
|
+
this.searchableSelectInputValue = "";
|
|
718
|
+
if (this.searchable) {
|
|
719
|
+
this.hiddenInputValue = this.initialValue;
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
this.handleRetry = () => {
|
|
723
|
+
this.clearTimer();
|
|
724
|
+
this.hasTimedOut = false;
|
|
725
|
+
this.hasError = false;
|
|
726
|
+
this.loading = true;
|
|
727
|
+
this.icRetryLoad.emit({
|
|
728
|
+
value: this.searchable
|
|
729
|
+
? this.searchableSelectInputValue
|
|
730
|
+
: this.hiddenInputValue,
|
|
731
|
+
});
|
|
732
|
+
this.setFocus();
|
|
733
|
+
};
|
|
734
|
+
this.handleSearchableSelectInput = (event) => {
|
|
735
|
+
var _a;
|
|
736
|
+
this.updateSearchableSelectResultAriaLive();
|
|
737
|
+
if (!this.multiple) {
|
|
738
|
+
this.value = null;
|
|
739
|
+
}
|
|
740
|
+
this.searchableSelectInputValue =
|
|
741
|
+
(_a = event.target.value) !== null && _a !== void 0 ? _a : "";
|
|
742
|
+
this.open = true;
|
|
743
|
+
clearTimeout(this.debounceIcInput);
|
|
744
|
+
this.debounceIcInput = window.setTimeout(() => this.icInput.emit({ value: this.searchableSelectInputValue }), this.currDebounce);
|
|
745
|
+
};
|
|
746
|
+
this.hostMutationCallback = (mutationList) => {
|
|
747
|
+
let forceComponentUpdate = false;
|
|
748
|
+
mutationList.forEach(({ attributeName, type, addedNodes, removedNodes }) => {
|
|
749
|
+
if (attributeName) {
|
|
750
|
+
const attribute = this.el.getAttribute(attributeName);
|
|
751
|
+
if (attribute && MUTABLE_ATTRIBUTES$1.includes(attributeName)) {
|
|
752
|
+
this.inheritedAttributes[attributeName] = attribute;
|
|
753
|
+
forceComponentUpdate = true;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
else if (type === "childList") {
|
|
757
|
+
forceComponentUpdate = checkSlotInChildMutations(addedNodes, removedNodes, "icon");
|
|
758
|
+
}
|
|
759
|
+
});
|
|
760
|
+
if (forceComponentUpdate) {
|
|
761
|
+
forceUpdate(this);
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
this.updateSelectButtonAriaLive = () => {
|
|
765
|
+
const value_label = this.getLabelFromValue(this.value);
|
|
766
|
+
this.selectButtonAriaLiveText = this.multiple
|
|
767
|
+
? `${this.value ? this.value.length : 0} of ${this.flatOptions.length} selected`
|
|
768
|
+
: this.value
|
|
769
|
+
? value_label !== null && value_label !== void 0 ? value_label : `${value_label} selected`
|
|
770
|
+
: "";
|
|
771
|
+
};
|
|
772
|
+
this.updateSearchableSelectResultAriaLive = () => {
|
|
773
|
+
var _a, _b;
|
|
774
|
+
this.selectInputAriaLiveText =
|
|
775
|
+
((_b = (_a = this.getOptions()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.label) == this.emptyOptionListText
|
|
776
|
+
? this.emptyOptionListText
|
|
777
|
+
: "";
|
|
778
|
+
};
|
|
779
|
+
this.updateAriaActiveDescendant = (event) => {
|
|
780
|
+
this.ariaActiveDescendant = event.detail.optionId;
|
|
781
|
+
};
|
|
782
|
+
this.handleMenuChange = (event) => {
|
|
783
|
+
this.open = event.detail.open;
|
|
784
|
+
this.pressedCharacters = "";
|
|
785
|
+
};
|
|
786
|
+
this.getDeduplicatedOptions = (flatOptions) => {
|
|
787
|
+
const seen = new Set();
|
|
788
|
+
return flatOptions.filter((option) => {
|
|
789
|
+
if (option.value && seen.has(option.value)) {
|
|
790
|
+
console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${option.value}) which has been removed.`);
|
|
791
|
+
return false;
|
|
792
|
+
}
|
|
793
|
+
if (option.value)
|
|
794
|
+
seen.add(option.value);
|
|
795
|
+
return true;
|
|
796
|
+
});
|
|
797
|
+
};
|
|
798
|
+
this.renderNativeOption = (option) => (h("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label));
|
|
799
|
+
}
|
|
800
|
+
watchDisabledHandler() {
|
|
801
|
+
removeDisabledFalse(this.disabled, this.el);
|
|
802
|
+
}
|
|
803
|
+
loadingHandler(newValue) {
|
|
804
|
+
this.hasTimedOut = false;
|
|
805
|
+
if (newValue) {
|
|
806
|
+
this.hasError = false;
|
|
807
|
+
if (this.timeout) {
|
|
808
|
+
if (this.timeoutTimer) {
|
|
809
|
+
this.clearTimer();
|
|
810
|
+
}
|
|
811
|
+
this.timeoutTimer = window.setTimeout(() => {
|
|
812
|
+
this.loading = false;
|
|
813
|
+
this.hasTimedOut = true;
|
|
814
|
+
forceUpdate(this);
|
|
815
|
+
}, this.timeout);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
else {
|
|
819
|
+
if (this.timeoutTimer) {
|
|
820
|
+
this.clearTimer();
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
clearTimer() {
|
|
825
|
+
if (this.timeoutTimer) {
|
|
826
|
+
clearTimeout(this.timeoutTimer);
|
|
827
|
+
this.timeoutTimer = null;
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
optionsChangedHandler() {
|
|
831
|
+
const flat = this.getFlatOptions(this.options)
|
|
832
|
+
.filter((option) => option.value != null || option.label != null) // filter out options missing both value and label
|
|
833
|
+
.map((option) => {
|
|
834
|
+
var _a, _b;
|
|
835
|
+
return (Object.assign(Object.assign({}, option), { value: (_a = option.value) !== null && _a !== void 0 ? _a : option.label, label: (_b = option.label) !== null && _b !== void 0 ? _b : option.value }));
|
|
836
|
+
});
|
|
837
|
+
this.flatOptions = this.getDeduplicatedOptions(flat);
|
|
838
|
+
if (!this.initialRender)
|
|
839
|
+
this.loading = false;
|
|
840
|
+
this.clearTimer();
|
|
841
|
+
this.updateSelectButtonAriaLive();
|
|
842
|
+
}
|
|
843
|
+
debounceChangedHandler(newValue) {
|
|
844
|
+
if (this.currDebounce !== newValue) {
|
|
845
|
+
this.currDebounce = newValue;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
valueChangedHandler(newValue) {
|
|
849
|
+
const validated = this.getValidatedValue(newValue);
|
|
850
|
+
const isEqual = Array.isArray(validated) && Array.isArray(this.value)
|
|
851
|
+
? validated.length === this.value.length &&
|
|
852
|
+
validated.every((v, i) => v === this.value[i])
|
|
853
|
+
: validated === this.value;
|
|
854
|
+
if (!isEqual) {
|
|
855
|
+
this.value = validated;
|
|
856
|
+
return;
|
|
857
|
+
}
|
|
858
|
+
this.updateSelectButtonAriaLive();
|
|
859
|
+
this.icChange.emit({ value: this.value });
|
|
860
|
+
}
|
|
861
|
+
openChangedHandler() {
|
|
862
|
+
this.open ? this.icOpen.emit() : this.icClose.emit();
|
|
863
|
+
if (!this.open) {
|
|
864
|
+
this.ariaActiveDescendant = undefined;
|
|
865
|
+
}
|
|
866
|
+
this.handleFocusIndicatorDisplay();
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Sets focus on the select component.
|
|
870
|
+
*/
|
|
871
|
+
async setFocus() {
|
|
872
|
+
if (this.nativeSelectElement) {
|
|
873
|
+
this.nativeSelectElement.focus();
|
|
874
|
+
}
|
|
875
|
+
else if (this.selectElement) {
|
|
876
|
+
this.selectElement.focus();
|
|
877
|
+
}
|
|
878
|
+
else if (this.searchableSelectElement) {
|
|
879
|
+
this.searchableSelectElement.focus();
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
componentDidRender() {
|
|
883
|
+
if (this.nativeSelectElement && !this.disabled) {
|
|
884
|
+
this.setTextColor();
|
|
885
|
+
}
|
|
886
|
+
this.initialRender = false;
|
|
887
|
+
}
|
|
888
|
+
disconnectedCallback() {
|
|
889
|
+
var _a;
|
|
890
|
+
removeFormResetListener(this.el, this.handleFormReset);
|
|
891
|
+
(_a = this.hostMutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
892
|
+
this.clearTimer();
|
|
893
|
+
}
|
|
894
|
+
componentDidLoad() {
|
|
895
|
+
forceUpdate(this);
|
|
896
|
+
this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);
|
|
897
|
+
this.hostMutationObserver.observe(this.el, {
|
|
898
|
+
attributes: true,
|
|
899
|
+
childList: true,
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
componentWillLoad() {
|
|
903
|
+
this.optionsChangedHandler();
|
|
904
|
+
this.value = this.getValidatedValue(this.value);
|
|
905
|
+
this.initialValue = this.value;
|
|
906
|
+
if (this.loading)
|
|
907
|
+
this.loadingHandler(true);
|
|
908
|
+
addFormResetListener(this.el, this.handleFormReset);
|
|
909
|
+
}
|
|
910
|
+
render() {
|
|
911
|
+
const { disabled, searchable, size, fullWidth, theme, readonly, hideLabel, inputId, label, helperText, required, value, options, menuId, multiple, validationStatus, open, showClearButton, selectOnEnter, loading, searchableSelectInputValue, validationText, validationAriaLive, form, ariaActiveDescendant, placeholder, name, inheritedAttributes, selectInputAriaLiveText, selectButtonAriaLiveText, } = this;
|
|
912
|
+
const hasValue = !!value;
|
|
913
|
+
const hasInput = !!searchableSelectInputValue;
|
|
914
|
+
const isClearable = !disabled &&
|
|
915
|
+
((searchable && (hasInput || hasValue)) ||
|
|
916
|
+
(!searchable && hasValue && !loading && showClearButton));
|
|
917
|
+
const showValidation = !!validationStatus && !disabled;
|
|
918
|
+
const invalid = validationStatus === IcInformationStatus.Error;
|
|
919
|
+
const describedBy = getInputDescribedByText(this.el, inputId, helperText !== "", showValidation).trim();
|
|
920
|
+
const menuOptions = this.getOptions();
|
|
921
|
+
const noOptions = disabled ||
|
|
922
|
+
(menuOptions.length === 1 &&
|
|
923
|
+
(menuOptions[0].label === this.emptyOptionListText ||
|
|
924
|
+
"loading" in menuOptions[0] ||
|
|
925
|
+
"timedOut" in menuOptions[0]));
|
|
926
|
+
renderHiddenInput(this.el, value, name || inputId, disabled);
|
|
927
|
+
const ClearButton = () => (h("ic-button", { key: '983b6bfae4f3a9d439f23fe022652605d91f0a1e', ref: (el) => (this.clearButton = el), id: "clear-button", "aria-label": this.searchable ? "Clear input" : "Clear selection", class: "clear-button", innerHTML: Clear, onClick: this.handleClear, onBlur: this.handleBlur, size: size, variant: "icon-tertiary" }));
|
|
928
|
+
const NativeSelect = () => (h("select", Object.assign({ key: '2fb628398e722cff8c3759229af969600e553485', ref: (el) => (this.nativeSelectElement = el), disabled: disabled, onChange: this.handleNativeSelectChange, required: required, id: inputId, "aria-label": label, "aria-describedby": describedBy, "aria-invalid": invalid ? "true" : "false", onBlur: this.handleBlur, onFocus: this.handleFocus, onKeyDown: this.handleNativeSelectKeyDown, form: form }, inheritedAttributes), h("option", { key: '5fb827fef7ab7c597a2361ac4d019f9e07adb55f', value: "", selected: true, disabled: !showClearButton }, placeholder), options.map((option) => "children" in option ? (h("optgroup", { label: option.label }, option.children.map((child) => this.renderNativeOption(child)))) : (this.renderNativeOption(option)))));
|
|
929
|
+
const SelectButton = () => (h("div", { key: '47ad04d6da391fcb88a8b6a6a841dec93f53cd74', class: "select-container" }, h("button", { key: '7ee23a4f16c4aca4b287391ac5bf5f6ee4441b07', class: "select-input", role: "combobox", ref: (el) => (this.selectElement = el), id: inputId, "aria-label": `${label}, ${(multiple && value
|
|
930
|
+
? `${value.length} of ${this.flatOptions.length} selected, ${this.getLabelString()}`
|
|
931
|
+
: this.getLabelString()) || placeholder}`, onClick: this.handleClick, "aria-describedby": describedBy, "aria-invalid": invalid ? "true" : "false", "aria-haspopup": "listbox", "aria-expanded": `${open}`, "aria-controls": menuId, "aria-required": `${required}`, disabled: disabled, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur, "aria-activedescendant": ariaActiveDescendant }, h("ic-typography", { key: '438cce7c257e37d0a0aef5247d28d31586725a1e', variant: "body", class: {
|
|
932
|
+
"value-text": true,
|
|
933
|
+
"with-clear-button": !!isClearable,
|
|
934
|
+
placeholder: !value,
|
|
935
|
+
} }, this.getLabelString()), h("div", { key: '8926d05851401339717c159651b802fb41e53096', class: "select-input-end" }, isClearable && h("div", { key: '5c94e4ba98ad972001890d639b00c82887e0fb5d', class: "divider" }), h("span", { key: '23569f5196d66f2b4a834d44006f6a05446598cd', class: {
|
|
936
|
+
"expand-icon": true,
|
|
937
|
+
"expand-icon-open": open,
|
|
938
|
+
}, innerHTML: Expand, "aria-hidden": "true" }))), isClearable && h(ClearButton, { key: 'e4165cb01b0bdc1681e3d9490007182b934f40ea' }), h("div", { key: '6208229358ee8ba7a007a08f5e551d494015a347', "aria-live": "polite", "aria-atomic": "true", class: "aria-live-hidden-text" }, selectButtonAriaLiveText)));
|
|
939
|
+
const SelectInput = () => (h("div", { key: 'af39791c29e8d792c16fed1fffe08db8f621fcac', class: "searchable-select-container" }, h("input", { key: '366bd3c57ad76f130d73ab2390c557b9e8fe98c8', class: {
|
|
940
|
+
"value-text": true,
|
|
941
|
+
"select-input": true,
|
|
942
|
+
"with-clear-button": !!searchableSelectInputValue,
|
|
943
|
+
}, role: "combobox", autocomplete: "off", "aria-label": label, "aria-describedby": describedBy, "aria-activedescendant": ariaActiveDescendant, "aria-autocomplete": "list", "aria-expanded": `${open}`, "aria-invalid": invalid ? "true" : "false", "aria-required": `${required}`, "aria-controls": menuId, ref: (el) => (this.searchableSelectElement = el), id: inputId, value: multiple
|
|
944
|
+
? ""
|
|
945
|
+
: value
|
|
946
|
+
? this.getLabelString()
|
|
947
|
+
: searchableSelectInputValue || undefined, disabled: disabled, placeholder: placeholder, onInput: this.handleSearchableSelectInput, onClick: this.handleClick, onBlur: this.handleBlur, onFocus: this.handleFocus, onKeyDown: this.handleKeyDown, form: form }), isClearable && (h("div", { key: 'e9260358a6c8ac3683d1de3015064665d32d907f', class: "clear-button-container" }, h(ClearButton, { key: '0c05ed1cf92ac8fde61ba55192a8a1511338239e' }), h("div", { key: 'e44933edcc7c79459f1ecd551eec43a86fd53b11', class: "divider" }))), h("span", { key: '36e7fe34e7d438caab2967fae27bfe4fb2e49041', onMouseDown: this.handleExpandIconMouseDown, class: {
|
|
948
|
+
"expand-icon": true,
|
|
949
|
+
"expand-icon-open": open,
|
|
950
|
+
}, innerHTML: Expand, "aria-hidden": "true" }), h("div", { key: 'c3e06f04e62b273b8a7a6f9df0aa27bf71060ed4', "aria-live": "polite", role: "status", class: "aria-live-hidden-text" }, selectInputAriaLiveText)));
|
|
951
|
+
const ReadOnly = () => (h("ic-typography", { key: '979d342f453fdb2ed79a6cf231d9a40275662a44' }, h("p", { key: '221530958da8731657b5ad4d455041dc3934718f' }, this.getLabelString() === placeholder ? "" : this.getLabelString())));
|
|
952
|
+
return (h(Host, { key: 'efbdccb0f0b7e86142cd530d52a86f7ce95d6c1c', class: {
|
|
953
|
+
"ic-select-disabled": disabled,
|
|
954
|
+
"ic-select-searchable": searchable,
|
|
955
|
+
[`ic-select-${size}`]: size !== "medium",
|
|
956
|
+
"ic-select-full-width": fullWidth,
|
|
957
|
+
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
958
|
+
} }, h("ic-input-container", { key: '48fe83c1c79ec578f94a2d8af4b8b452570a421f', readonly: readonly }, !hideLabel && (h("ic-input-label", { key: '8410dabe6d0d62c7c1459991631807cfa6546735', for: inputId, label: label, helperText: helperText, required: required, disabled: disabled, readonly: readonly }, h("slot", { key: '77ce0ab9ca879ecf515de633ff27ba8e2320cf2c', name: "helper-text", slot: "helper-text" }))), h("ic-input-component-container", { key: '699375a82eb49f5eb351cf95b4822b4cad7bcc1a', ref: (el) => (this.anchorEl = el), class: { "menu-open": open }, size: size, fullWidth: fullWidth, disabled: disabled, readonly: readonly, validationStatus: validationStatus }, isSlotUsed(this.el, "icon") &&
|
|
959
|
+
!disabled &&
|
|
960
|
+
(!readonly || !!value) && (h("span", { key: 'fcfec6b75fdb0eb41950460af3c6d7dc5ad43657', slot: "left-icon", class: {
|
|
961
|
+
readonly,
|
|
962
|
+
"has-value": !!value,
|
|
963
|
+
} }, h("slot", { key: '08d321011ba86b6d50bf3c8c85bf16595c8df657', name: "icon" }))), isMobileOrTablet() && this.useNativeSelectOnMobile && !multiple ? (h(NativeSelect, null)) : readonly ? (h(ReadOnly, null)) : !searchable ? (h(SelectButton, null)) : (h(SelectInput, null))), !(isMobileOrTablet() &&
|
|
964
|
+
this.useNativeSelectOnMobile &&
|
|
965
|
+
!multiple) && (h("ic-menu", { key: '3fc0ee9172a93e744174e2f2b7a16c4f327a82c9', ref: (el) => (this.menu = el), class: { "no-results": noOptions }, inputEl: searchable ? this.searchableSelectElement : this.selectElement, allowMenuFocus: false, inputLabel: label, anchorEl: this.anchorEl, size: size, menuId: menuId, open: open, options: this.getOptions(), value: multiple ? value : value, fullWidth: fullWidth, selectOnEnter: selectOnEnter, onMenuStateChange: this.handleMenuChange, onMenuOptionSelect: this.handleSelectChange, onMenuOptionSelectAll: this.handleSelectAllChange, onTimeoutBlur: this.handleTimeoutBlur, onMenuOptionId: this.updateAriaActiveDescendant, onClick: this.setFocus, parentEl: this.el, activationType: searchable || multiple || selectOnEnter ? "manual" : "automatic", onRetryButtonClicked: this.handleRetry, closeOnSelect: !multiple, multiSelect: multiple, searchableSelect: searchable })), h("ic-input-validation", { key: '6b8bd66f22d67776d418e0aac1b41d2f03f3c9cd', class: {
|
|
966
|
+
"menu-open": open,
|
|
967
|
+
}, ariaLiveMode: validationAriaLive, status: showValidation ? validationStatus : "", message: showValidation ? validationText : "", for: inputId }))));
|
|
968
|
+
}
|
|
969
|
+
static get delegatesFocus() { return true; }
|
|
970
|
+
get el() { return getElement(this); }
|
|
971
|
+
static get watchers() { return {
|
|
972
|
+
"disabled": ["watchDisabledHandler"],
|
|
973
|
+
"loading": ["loadingHandler"],
|
|
974
|
+
"options": ["optionsChangedHandler"],
|
|
975
|
+
"debounce": ["debounceChangedHandler"],
|
|
976
|
+
"value": ["valueChangedHandler"],
|
|
977
|
+
"open": ["openChangedHandler"]
|
|
978
|
+
}; }
|
|
979
|
+
};
|
|
980
|
+
Select.style = IcSelectStyle0;
|
|
981
|
+
|
|
982
|
+
const icTextFieldCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;--ic-input-label-helpertext-padding:var(--ic-space-xs);--border-color:var(--ic-text-field-border-neutral);--border-color-hover:var(--ic-text-field-border-neutral-hover);--border-color-pressed:var(--ic-text-field-border-neutral-pressed);--border-color-disabled:var(--ic-text-field-border-disabled);--border-color-error:var(--ic-text-field-border-error);--border-color-error-hover:var(--ic-text-field-border-error-hover);--border-color-error-pressed:var(--ic-text-field-border-error-pressed);--border-color-success:var(--ic-text-field-border-success);--border-color-success-hover:var(--ic-text-field-border-success-hover);--border-color-success-pressed:var(--ic-text-field-border-success-pressed);--border-color-warning:var(--ic-text-field-border-warning);--border-color-warning-hover:var(--ic-text-field-border-warning-hover);--border-color-warning-pressed:var(--ic-text-field-border-warning-pressed);--ic-input-label-text-color:var(--ic-text-field-label);--ic-input-label-helper-text-color:var(--ic-text-field-subtitle);--ic-input-validation-status-text-color:var(--ic-text-field-state-text);--ic-input-validation-error:var(--ic-text-field-state-icon-error);--ic-input-validation-warning-icon-color:var(\n --ic-text-field-state-icon-warning\n );--ic-input-validation-success-icon-color:var(\n --ic-text-field-state-icon-success\n );--ic-input-component-container-success-icon-inline-color:var(\n --ic-text-field-state-icon-success\n )}:host(.ic-text-field-disabled){--ic-input-label-text-color:var(--ic-text-field-label-disabled);--ic-input-label-helper-text-color:var(--ic-text-field-subtitle-disabled);--text-field-placeholder-color:var(\n --ic-text-field-text-area-placeholder-text-disabled\n )}:host(.ic-text-field-full-width){width:100%}::-moz-placeholder{color:var(\n --text-field-placeholder-color,\n var(--ic-text-field-placeholder-text)\n );opacity:1}::placeholder{color:var(\n --text-field-placeholder-color,\n var(--ic-text-field-placeholder-text)\n );opacity:1}input,textarea{border:0;border-radius:var(--ic-border-radius);color:var(--text-field-text-color, var(--ic-text-field-text));background-color:var(--input-bg-color, var(--ic-text-field-background));line-height:1.5rem;letter-spacing:0.005rem;width:100%;padding-right:var(--ic-space-xs);padding-left:var(--ic-space-xs);caret-color:var(\n --text-field-typing-cursor,\n var(--ic-text-field-typing-cursor)\n )}textarea{min-height:var(--ic-space-lg);resize:vertical;padding-top:0.375rem}input:focus,textarea:focus{border:0;outline:0}input:disabled,textarea:disabled{color:var(\n --text-field-disabled-text-color,\n var(--ic-text-field-text-disabled)\n )}input.readonly,textarea.readonly{color:var(--ic-text-field-read-only-input-text-internal);background:transparent}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=\"number\"]{-moz-appearance:textfield}textarea.no-resize{resize:none}.char-count-text{--ic-typography-color:var(--ic-text-field-character-limit);padding-right:var(--ic-space-xxxs)}:host(.ic-text-field-disabled) .char-count-text{--ic-typography-color:var(--ic-text-field-character-limit-disabled)}.no-left-pad{padding-left:0}::slotted([slot=\"icon\"]){fill:var(--ic-text-field-text-disabled)}.has-value ::slotted([slot=\"icon\"]){fill:var(--ic-text-field-input-internal-icon)}.char-count{margin-right:calc(-1 * var(--ic-space-xxxs))}.remaining-char-count-desc{position:absolute;left:-9999px}.show-validation{margin-top:var(--ic-space-xs)}input[type=\"search\"]::-webkit-search-cancel-button,input[type=\"search\"]::-webkit-search-decoration,input[type=\"search\"]::-webkit-search-results-button,input[type=\"search\"]::-webkit-search-results-decoration{display:none}input[type=\"search\"].truncate-value{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media (forced-colors: active){input.readonly,textarea.readonly{color:canvastext}.has-value ::slotted([slot=\"icon\"]){fill:currentcolor}}";
|
|
983
|
+
const IcTextFieldStyle0 = icTextFieldCss;
|
|
984
|
+
|
|
985
|
+
let inputIds = 0;
|
|
986
|
+
const MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, "title"];
|
|
987
|
+
const TextField = class {
|
|
988
|
+
constructor(hostRef) {
|
|
989
|
+
registerInstance(this, hostRef);
|
|
990
|
+
this.getValidationText = createEvent(this, "getValidationText", 7);
|
|
991
|
+
this.icBlur = createEvent(this, "icBlur", 7);
|
|
992
|
+
this.icChange = createEvent(this, "icChange", 7);
|
|
993
|
+
this.icFocus = createEvent(this, "icFocus", 7);
|
|
994
|
+
this.icInput = createEvent(this, "icInput", 7);
|
|
995
|
+
this.icKeydown = createEvent(this, "icKeydown", 7);
|
|
996
|
+
this.icScroll = createEvent(this, "icScroll", 7);
|
|
997
|
+
this.inheritedAttributes = {};
|
|
998
|
+
this.hostMutationObserver = null;
|
|
999
|
+
this.numChars = 0;
|
|
1000
|
+
this.maxCharactersReached = false;
|
|
1001
|
+
this.maxCharactersWarning = false;
|
|
1002
|
+
this.minCharactersUnattained = false;
|
|
1003
|
+
this.maxValueExceeded = false;
|
|
1004
|
+
this.minValueUnattained = false;
|
|
1005
|
+
this.isFocussed = false;
|
|
1006
|
+
/**
|
|
1007
|
+
* The automatic capitalisation of the text value as it is entered/edited by the user.
|
|
1008
|
+
* Available options: "off", "none", "on", "sentences", "words", "characters".
|
|
1009
|
+
*/
|
|
1010
|
+
this.autocapitalize = "off";
|
|
1011
|
+
/**
|
|
1012
|
+
* The state of autocompletion the browser can apply on the text value.
|
|
1013
|
+
*/
|
|
1014
|
+
this.autocomplete = "off";
|
|
1015
|
+
/**
|
|
1016
|
+
* The state of autocorrection the browser can apply when the user is entering/editing the text value.
|
|
1017
|
+
*/
|
|
1018
|
+
this.autocorrect = "off";
|
|
1019
|
+
/**
|
|
1020
|
+
* If `true`, the form control will have input focus when the page loads.
|
|
1021
|
+
*/
|
|
1022
|
+
this.autofocus = false;
|
|
1023
|
+
/**
|
|
1024
|
+
* If `true`, the disabled state will be set.
|
|
1025
|
+
*/
|
|
1026
|
+
this.disabled = false;
|
|
1027
|
+
/**
|
|
1028
|
+
* Specify whether the text field fills the full width of the container.
|
|
1029
|
+
* If `true`, this overrides the --input-width CSS variable.
|
|
1030
|
+
*/
|
|
1031
|
+
this.fullWidth = false;
|
|
1032
|
+
/**
|
|
1033
|
+
* The helper text that will be displayed for additional field guidance.
|
|
1034
|
+
*/
|
|
1035
|
+
this.helperText = "";
|
|
1036
|
+
/**
|
|
1037
|
+
* If `true`, the character count which is displayed when `maxCharacters` is set will be visually hidden.
|
|
1038
|
+
*/
|
|
1039
|
+
this.hideCharCount = false;
|
|
1040
|
+
/**
|
|
1041
|
+
* If `true`, the label will be hidden and the required label value will be applied as an aria-label.
|
|
1042
|
+
*/
|
|
1043
|
+
this.hideLabel = false;
|
|
1044
|
+
/**
|
|
1045
|
+
* @internal If `true`, the hidden form input will stop rendering for form submission.
|
|
1046
|
+
*/
|
|
1047
|
+
this.hiddenInput = true;
|
|
1048
|
+
/**
|
|
1049
|
+
* The ID for the input.
|
|
1050
|
+
*/
|
|
1051
|
+
this.inputId = `ic-text-field-input-${inputIds++}`;
|
|
1052
|
+
/**
|
|
1053
|
+
* A hint to the browser for which keyboard to display.
|
|
1054
|
+
* Possible values: `"none"`, `"text"`, `"tel"`, `"url"`,
|
|
1055
|
+
* `"email"`, `"numeric"`, `"decimal"`, and `"search"`.
|
|
1056
|
+
*/
|
|
1057
|
+
this.inputmode = "text";
|
|
1058
|
+
/**
|
|
1059
|
+
* The count of characters in the field. Will display a warning if the bound is reached. (NOTE: If the value of the text field has been set using the `value` prop, it will be truncated to this number of characters)
|
|
1060
|
+
*/
|
|
1061
|
+
this.maxCharacters = 0;
|
|
1062
|
+
/**
|
|
1063
|
+
* The text to display as the warning message when the maximum number of characters (the `maxCharacters` prop value) is reached.
|
|
1064
|
+
*/
|
|
1065
|
+
// prettier-ignore
|
|
1066
|
+
this.maxCharactersMessage = `Maximum input is ${this.maxCharacters} characters`;
|
|
1067
|
+
/**
|
|
1068
|
+
* The text to display as the error message when the maximum value (the `max` prop value) has been exceeded.
|
|
1069
|
+
*/
|
|
1070
|
+
this.maxMessage = `Maximum value of ${this.max} exceeded`;
|
|
1071
|
+
/**
|
|
1072
|
+
* The minimum number of characters that can be entered in the field.
|
|
1073
|
+
*/
|
|
1074
|
+
this.minCharacters = 0;
|
|
1075
|
+
/**
|
|
1076
|
+
* The text to display as the error message when the minimum number of characters (the `minCharacters` prop value) has not been met.
|
|
1077
|
+
*/
|
|
1078
|
+
// prettier-ignore
|
|
1079
|
+
this.minCharactersMessage = `Minimum input is ${this.minCharacters} characters`;
|
|
1080
|
+
/**
|
|
1081
|
+
* The text to display as the error message when the minimum value (the `min` prop value) has not been met.
|
|
1082
|
+
*/
|
|
1083
|
+
this.minMessage = `Minimum value of ${this.min} not met`;
|
|
1084
|
+
/**
|
|
1085
|
+
* The name of the control, which is submitted with the form data.
|
|
1086
|
+
*/
|
|
1087
|
+
this.name = this.inputId;
|
|
1088
|
+
/**
|
|
1089
|
+
* The placeholder value to be displayed.
|
|
1090
|
+
*/
|
|
1091
|
+
this.placeholder = "";
|
|
1092
|
+
/**
|
|
1093
|
+
* If `true`, the read only state will be set.
|
|
1094
|
+
*/
|
|
1095
|
+
this.readonly = false;
|
|
1096
|
+
/**
|
|
1097
|
+
* If `true`, the input will require a value.
|
|
1098
|
+
*/
|
|
1099
|
+
this.required = false;
|
|
1100
|
+
/**
|
|
1101
|
+
* If `true`, the multiline text area will be resizeable.
|
|
1102
|
+
*/
|
|
1103
|
+
this.resize = false;
|
|
1104
|
+
/**
|
|
1105
|
+
* The number of rows to transform the text field into a text area with a specific height.
|
|
1106
|
+
*/
|
|
1107
|
+
this.rows = 1;
|
|
1108
|
+
/**
|
|
1109
|
+
* The size of the text field component.
|
|
1110
|
+
*/
|
|
1111
|
+
this.size = "medium";
|
|
1112
|
+
/**
|
|
1113
|
+
* If `true`, the value of the text field will have its spelling and grammar checked.
|
|
1114
|
+
*/
|
|
1115
|
+
this.spellcheck = false;
|
|
1116
|
+
/**
|
|
1117
|
+
* Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component.
|
|
1118
|
+
*/
|
|
1119
|
+
this.theme = "inherit";
|
|
1120
|
+
/**
|
|
1121
|
+
* @internal If `true`, an ellipsis will be displayed at the end of the value if the value is longer than the container.
|
|
1122
|
+
*/
|
|
1123
|
+
this.truncateValue = false;
|
|
1124
|
+
/**
|
|
1125
|
+
* The type of control to display. The default type is text.
|
|
1126
|
+
*/
|
|
1127
|
+
this.type = "text";
|
|
1128
|
+
/**
|
|
1129
|
+
* The value of the `aria-live` attribute on the validation message. When set to "default", the `aria-live` value will be handled automatically, e.g. "assertive" for `validation-status="error"`.
|
|
1130
|
+
*/
|
|
1131
|
+
this.validationAriaLive = "default";
|
|
1132
|
+
/**
|
|
1133
|
+
* If `true`, the icon in input control will be displayed - only applies when validationStatus ='success'.
|
|
1134
|
+
*/
|
|
1135
|
+
this.validationInline = false;
|
|
1136
|
+
/**
|
|
1137
|
+
* @internal If `true`, the validation will display inline.
|
|
1138
|
+
*/
|
|
1139
|
+
this.validationInlineInternal = false;
|
|
1140
|
+
/**
|
|
1141
|
+
* The validation state - e.g. 'error' | 'warning' | 'success'.
|
|
1142
|
+
*/
|
|
1143
|
+
this.validationStatus = "";
|
|
1144
|
+
/**
|
|
1145
|
+
* The text to display as the validation message.
|
|
1146
|
+
*/
|
|
1147
|
+
this.validationText = "";
|
|
1148
|
+
/**
|
|
1149
|
+
* The amount of time, in milliseconds, to wait to trigger the `icChange` event after each keystroke.
|
|
1150
|
+
*/
|
|
1151
|
+
this.debounce = 0;
|
|
1152
|
+
/**
|
|
1153
|
+
* The value of the text field.
|
|
1154
|
+
*/
|
|
1155
|
+
this.value = "";
|
|
1156
|
+
this.initialValue = this.value;
|
|
1157
|
+
this.checkChildHydration = () => {
|
|
1158
|
+
var _a, _b;
|
|
1159
|
+
if (this.hideLabel ||
|
|
1160
|
+
((_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("ic-typography")) === null || _b === void 0 ? void 0 : _b.classList.contains("hydrated"))) {
|
|
1161
|
+
this.setFocus();
|
|
1162
|
+
clearInterval(this.interval);
|
|
1163
|
+
}
|
|
1164
|
+
};
|
|
1165
|
+
this.getNumberOfCharacters = (value) => value !== null && value !== undefined ? value.length : 0;
|
|
1166
|
+
this.getMaxValueExceeded = (value) => {
|
|
1167
|
+
this.numChars = this.getNumberOfCharacters(value);
|
|
1168
|
+
if (this.type === "number") {
|
|
1169
|
+
this.minValueUnattained = !!value && Number(value) < Number(this.min);
|
|
1170
|
+
this.maxValueExceeded = Number(value) > Number(this.max);
|
|
1171
|
+
}
|
|
1172
|
+
};
|
|
1173
|
+
this.getMaxCharactersReached = (value) => {
|
|
1174
|
+
this.numChars = this.getNumberOfCharacters(value);
|
|
1175
|
+
this.maxCharactersReached =
|
|
1176
|
+
this.maxCharacters > 0 && this.numChars >= this.maxCharacters;
|
|
1177
|
+
if (this.maxCharactersWarning && !this.maxCharactersReached) {
|
|
1178
|
+
this.maxCharactersWarning = false;
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1181
|
+
this.onInput = (ev) => {
|
|
1182
|
+
this.value = ev.target.value;
|
|
1183
|
+
this.icInput.emit({ value: this.value });
|
|
1184
|
+
};
|
|
1185
|
+
this.onBlur = (ev) => {
|
|
1186
|
+
const target = ev.target;
|
|
1187
|
+
target.removeEventListener("wheel", this.onWheel);
|
|
1188
|
+
const { value } = target;
|
|
1189
|
+
this.numChars = value.length;
|
|
1190
|
+
this.minCharactersUnattained =
|
|
1191
|
+
this.minCharacters > 0 && this.numChars < this.minCharacters;
|
|
1192
|
+
this.icBlur.emit({ value });
|
|
1193
|
+
this.isFocussed = false;
|
|
1194
|
+
};
|
|
1195
|
+
this.onFocus = (ev) => {
|
|
1196
|
+
const target = ev.target;
|
|
1197
|
+
target.addEventListener("wheel", this.onWheel);
|
|
1198
|
+
this.icFocus.emit({ value: target.value });
|
|
1199
|
+
this.isFocussed = true;
|
|
1200
|
+
};
|
|
1201
|
+
this.onTextAreaScroll = () => {
|
|
1202
|
+
this.icScroll.emit();
|
|
1203
|
+
};
|
|
1204
|
+
this.onWheel = (ev) => {
|
|
1205
|
+
const target = ev.target;
|
|
1206
|
+
if (target.type === "number") {
|
|
1207
|
+
target.blur();
|
|
1208
|
+
setTimeout(() => {
|
|
1209
|
+
target.focus();
|
|
1210
|
+
}, 0);
|
|
1211
|
+
}
|
|
1212
|
+
};
|
|
1213
|
+
this.hasStatus = (status) => status !== "" && !this.disabled;
|
|
1214
|
+
this.handleFormReset = () => {
|
|
1215
|
+
this.value = this.initialValue;
|
|
1216
|
+
};
|
|
1217
|
+
this.showValidationMargin = () => {
|
|
1218
|
+
const maxNumChars = this.readonly ? 0 : this.maxCharacters;
|
|
1219
|
+
const emptyString = isEmptyString(this.validationStatus) ||
|
|
1220
|
+
isEmptyString(this.validationText);
|
|
1221
|
+
const valueOutsideRange = this.minValueUnattained || this.maxValueExceeded;
|
|
1222
|
+
const charsOutsideRange = maxNumChars > 0 || this.minCharactersUnattained;
|
|
1223
|
+
return ((!emptyString || valueOutsideRange || charsOutsideRange) &&
|
|
1224
|
+
!this.validationInlineInternal);
|
|
1225
|
+
};
|
|
1226
|
+
// triggered when attributes of host element change
|
|
1227
|
+
this.hostMutationCallback = (mutationList) => {
|
|
1228
|
+
let forceComponentUpdate = false;
|
|
1229
|
+
mutationList.forEach(({ attributeName, type, addedNodes, removedNodes }) => {
|
|
1230
|
+
if (attributeName && MUTABLE_ATTRIBUTES.includes(attributeName)) {
|
|
1231
|
+
const attribute = this.el.getAttribute(attributeName);
|
|
1232
|
+
if (attribute) {
|
|
1233
|
+
this.inheritedAttributes[attributeName] = attribute;
|
|
1234
|
+
}
|
|
1235
|
+
forceComponentUpdate = true;
|
|
1236
|
+
}
|
|
1237
|
+
else if (type === "childList") {
|
|
1238
|
+
forceComponentUpdate = checkSlotInChildMutations(addedNodes, removedNodes, "icon");
|
|
1239
|
+
}
|
|
1240
|
+
});
|
|
1241
|
+
if (forceComponentUpdate) {
|
|
1242
|
+
forceUpdate(this);
|
|
1243
|
+
}
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1246
|
+
watchDisabledHandler() {
|
|
1247
|
+
removeDisabledFalse(this.disabled, this.el);
|
|
1248
|
+
}
|
|
1249
|
+
debounceChanged() {
|
|
1250
|
+
this.icChange = debounceEvent(this.icChange, this.debounce);
|
|
1251
|
+
}
|
|
1252
|
+
watchValueHandler(newValue) {
|
|
1253
|
+
let value;
|
|
1254
|
+
if (this.maxCharacters > 0) {
|
|
1255
|
+
value = newValue.substring(0, this.maxCharacters);
|
|
1256
|
+
if (value.length < newValue.length) {
|
|
1257
|
+
this.maxCharactersWarning = true;
|
|
1258
|
+
}
|
|
1259
|
+
this.value = value;
|
|
1260
|
+
}
|
|
1261
|
+
else {
|
|
1262
|
+
value = newValue;
|
|
1263
|
+
}
|
|
1264
|
+
if (this.inputEl && this.inputEl.value !== value) {
|
|
1265
|
+
this.inputEl.value = value;
|
|
1266
|
+
}
|
|
1267
|
+
this.getMaxValueExceeded(value);
|
|
1268
|
+
this.getMaxCharactersReached(value);
|
|
1269
|
+
this.icChange.emit({ value });
|
|
1270
|
+
}
|
|
1271
|
+
connectedCallback() {
|
|
1272
|
+
this.debounceChanged();
|
|
1273
|
+
}
|
|
1274
|
+
disconnectedCallback() {
|
|
1275
|
+
var _a;
|
|
1276
|
+
removeFormResetListener(this.el, this.handleFormReset);
|
|
1277
|
+
(_a = this.hostMutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
1278
|
+
}
|
|
1279
|
+
componentWillLoad() {
|
|
1280
|
+
if (this.value !== this.initialValue) {
|
|
1281
|
+
this.watchValueHandler(this.value);
|
|
1282
|
+
}
|
|
1283
|
+
else if (this.maxCharacters > 0) {
|
|
1284
|
+
this.value = this.value.substring(0, this.maxCharacters);
|
|
1285
|
+
}
|
|
1286
|
+
this.getMaxValueExceeded(this.value);
|
|
1287
|
+
this.getMaxCharactersReached(this.value);
|
|
1288
|
+
this.inheritedAttributes = inheritAttributes(this.el, MUTABLE_ATTRIBUTES);
|
|
1289
|
+
if (this.readonly) {
|
|
1290
|
+
this.maxValueExceeded = false;
|
|
1291
|
+
this.minValueUnattained = false;
|
|
1292
|
+
}
|
|
1293
|
+
addFormResetListener(this.el, this.handleFormReset);
|
|
1294
|
+
removeDisabledFalse(this.disabled, this.el);
|
|
1295
|
+
}
|
|
1296
|
+
componentDidLoad() {
|
|
1297
|
+
onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Text Field");
|
|
1298
|
+
if (this.validationInlineInternal) {
|
|
1299
|
+
this.getValidationText.emit({ value: this.validationText });
|
|
1300
|
+
}
|
|
1301
|
+
this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);
|
|
1302
|
+
this.hostMutationObserver.observe(this.el, {
|
|
1303
|
+
attributes: true,
|
|
1304
|
+
childList: true,
|
|
1305
|
+
});
|
|
1306
|
+
if (this.autofocus && !this.disabled && !this.readonly) {
|
|
1307
|
+
this.interval = setInterval(this.checkChildHydration, 50);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
handleKeyDown(ev) {
|
|
1311
|
+
var _a, _b;
|
|
1312
|
+
this.icKeydown.emit({
|
|
1313
|
+
event: ev,
|
|
1314
|
+
cursorPosition: (_a = this.inputEl.selectionStart) !== null && _a !== void 0 ? _a : 0,
|
|
1315
|
+
selectionEnd: (_b = this.inputEl.selectionEnd) !== null && _b !== void 0 ? _b : 0,
|
|
1316
|
+
});
|
|
1317
|
+
if (!ev.ctrlKey && !IGNORED_KEYBOARD_CHARACTERS.includes(ev.key)) {
|
|
1318
|
+
this.maxCharactersWarning = this.maxCharactersReached;
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* Sets focus on the native `input`.
|
|
1323
|
+
*/
|
|
1324
|
+
async setFocus() {
|
|
1325
|
+
var _a;
|
|
1326
|
+
(_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
1327
|
+
}
|
|
1328
|
+
render() {
|
|
1329
|
+
const { inputId, name, label, required, size, placeholder, helperText, hideCharCount, rows, resize, disabled, value, min, max, numChars, readonly, maxCharacters, maxCharactersMessage, maxCharactersWarning, maxCharactersReached, maxMessage, minCharacters, minCharactersMessage, minCharactersUnattained, minMessage, minValueUnattained, maxValueExceeded, validationAriaLive, validationStatus, validationText, validationInline, validationInlineInternal, spellcheck, inputmode, fullWidth, truncateValue, hiddenInput, theme, hideLabel, type, autocapitalize, ariaActiveDescendant, inheritedAttributes, ariaExpanded, ariaOwns, autocomplete, role, isFocussed, } = this;
|
|
1330
|
+
const el = this.el;
|
|
1331
|
+
const disabledMode = readonly || disabled;
|
|
1332
|
+
const currentStatus = maxValueExceeded ||
|
|
1333
|
+
minValueUnattained ||
|
|
1334
|
+
minCharactersUnattained ||
|
|
1335
|
+
maxCharactersWarning
|
|
1336
|
+
? maxCharactersWarning
|
|
1337
|
+
? IcInformationStatus.Warning
|
|
1338
|
+
: IcInformationStatus.Error
|
|
1339
|
+
: validationStatus;
|
|
1340
|
+
const currentValidationText = maxCharactersWarning
|
|
1341
|
+
? maxCharactersMessage
|
|
1342
|
+
: maxValueExceeded
|
|
1343
|
+
? maxMessage
|
|
1344
|
+
: minValueUnattained
|
|
1345
|
+
? minMessage
|
|
1346
|
+
: minCharactersUnattained
|
|
1347
|
+
? minCharactersMessage
|
|
1348
|
+
: validationText;
|
|
1349
|
+
const maxNumChars = readonly ? 0 : maxCharacters;
|
|
1350
|
+
const messageAriaLive = validationAriaLive === "default"
|
|
1351
|
+
? maxCharactersWarning ||
|
|
1352
|
+
maxValueExceeded ||
|
|
1353
|
+
minValueUnattained ||
|
|
1354
|
+
currentStatus === IcInformationStatus.Error
|
|
1355
|
+
? "assertive"
|
|
1356
|
+
: "polite"
|
|
1357
|
+
: validationAriaLive;
|
|
1358
|
+
const showStatusText = this.hasStatus(currentStatus) &&
|
|
1359
|
+
!(currentStatus == IcInformationStatus.Success && validationInline) &&
|
|
1360
|
+
!validationInlineInternal;
|
|
1361
|
+
const multiline = rows > 1;
|
|
1362
|
+
const hiddenCharCountDescId = maxCharacters > 0 ? `${inputId}-char-count-desc` : "";
|
|
1363
|
+
const charsRemaining = maxNumChars - numChars;
|
|
1364
|
+
const remainingCharCountDescId = maxCharacters > 0 ? `${inputId}-remaining-char-count-desc` : "";
|
|
1365
|
+
const remainingCharCountDesc = `${charsRemaining} character${charsRemaining === 1 ? "" : "s"} remaining.`;
|
|
1366
|
+
const describedBy = `${getInputDescribedByText(this.el, inputId, helperText !== "", showStatusText)} ${hiddenCharCountDescId} ${numChars > 0 ? remainingCharCountDescId : ""}`.trim();
|
|
1367
|
+
const disabledText = disabledMode && !readonly;
|
|
1368
|
+
const showLeftIcon = !!this.el.querySelector(`[slot="icon"]`) && !disabledText;
|
|
1369
|
+
const invalid = `${currentStatus === IcInformationStatus.Error}`;
|
|
1370
|
+
hiddenInput
|
|
1371
|
+
? renderHiddenInput(this.el, value, name, disabledMode)
|
|
1372
|
+
: removeHiddenInput(this.el);
|
|
1373
|
+
return (h(Host, { key: '6300558c65d21c3cf9fcb2af66774cbdf274cf89', class: {
|
|
1374
|
+
"ic-text-field-full-width": fullWidth,
|
|
1375
|
+
"ic-text-field-disabled": disabledMode,
|
|
1376
|
+
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
1377
|
+
} }, h("ic-input-container", { key: '6f0d1a6cf4ed01bd98c3b69d37f6ffb473e1201e', readonly: readonly, disabled: disabledMode }, !hideLabel && (h("ic-input-label", { key: '71cc64b0733fbe16b21f389000c8a6813ad9f07f', for: inputId, label: label, helperText: helperText, required: required, disabled: disabledText, readonly: readonly }, h("slot", { key: '985b82195b09acc991bbed6c0be5210cba70f59e', name: "helper-text", slot: "helper-text" }))), h("ic-input-component-container", { key: '95df2f453e06c5dec6788e98db94e5e4ce129d04', size: size, validationStatus: currentStatus, multiLine: multiline, disabled: disabledMode, readonly: readonly, validationInline: validationInline, fullWidth: fullWidth }, showLeftIcon && (h("span", { key: '62a052203a6b9e35858e7103f505bdf38eda7349', class: {
|
|
1378
|
+
readonly,
|
|
1379
|
+
"has-value": this.getNumberOfCharacters(value) > 0,
|
|
1380
|
+
}, slot: "left-icon" }, h("slot", { key: '12ee0976840d954f7f855740db4098983ccf73a5', name: "icon" }))), !multiline ? (h("input", Object.assign({ id: inputId, name: name, ref: (el) => (this.inputEl = el), type: type, min: min, max: max, value: value, class: {
|
|
1381
|
+
"no-left-pad": !showLeftIcon && readonly,
|
|
1382
|
+
readonly,
|
|
1383
|
+
"truncate-value": truncateValue,
|
|
1384
|
+
}, placeholder: placeholder ? placeholder : "", required: required, disabled: disabledMode, readonly: readonly, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, "aria-label": label, "aria-describedby": describedBy, "aria-invalid": invalid, "aria-activedescendant": ariaActiveDescendant, "aria-expanded": ariaExpanded, "aria-owns": ariaOwns, autocomplete: autocomplete, autocapitalize: autocapitalize, spellcheck: spellcheck, inputmode: inputmode, role: role || undefined, maxlength: maxCharactersReached ? maxCharacters : undefined, minlength: minCharactersUnattained ? minCharacters : undefined }, inheritedAttributes))) : (h("textarea", Object.assign({ id: inputId, class: {
|
|
1385
|
+
"no-resize": resize === false || !!readonly,
|
|
1386
|
+
"no-left-pad": !showLeftIcon && !!readonly,
|
|
1387
|
+
readonly: !!readonly,
|
|
1388
|
+
}, name: name, ref: (el) => (this.inputEl = el), value: value, rows: rows, required: required, disabled: disabledMode, placeholder: placeholder, readonly: readonly, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, onScroll: this.onTextAreaScroll, "aria-label": label, "aria-describedby": describedBy, "aria-invalid": invalid, autocomplete: autocomplete, autocapitalize: autocapitalize, spellcheck: spellcheck, inputmode: inputmode, maxlength: maxCharactersReached ? maxCharacters : undefined, minlength: minCharactersUnattained ? minCharacters : undefined }, inheritedAttributes))), isSlotUsed(el, "clear-button") && (h("slot", { key: '4bd5b1b44a9fded9be98c35d3e49f357b99adf26', name: "clear-button" })), isSlotUsed(el, "search-submit-button") && (h("slot", { key: 'fccd3ae4e454d661540f45b748440aa8c9c28baf', name: "search-submit-button" }))), isSlotUsed(el, "menu") && h("slot", { key: 'aca9fabb2b029547a713e75be81c179e3c1e3b52', name: "menu" }), h("ic-input-validation", { key: '1d2443ab140751bd21f247f5136254498ffc8004', class: { "show-validation": this.showValidationMargin() }, status: this.hasStatus(currentStatus) === false ||
|
|
1389
|
+
(currentStatus === IcInformationStatus.Success &&
|
|
1390
|
+
validationInline) ||
|
|
1391
|
+
validationInlineInternal
|
|
1392
|
+
? ""
|
|
1393
|
+
: currentStatus, message: showStatusText ? currentValidationText : "", ariaLiveMode: messageAriaLive, for: inputId, fullWidth: fullWidth }, isSlotUsed(el, "validation-text") && (h("slot", { key: 'e8f5abdc72b047998c5164ec7bef70eab2d7af81', name: "validation-text", slot: "validation-message" })), !readonly && maxNumChars > 0 && (h("div", { key: '9458320139c6c17b4db3f40ef91ed8f35667e612', slot: "validation-message-adornment" }, !hideCharCount && (h("ic-typography", { key: '26663bbc0dbc1e5183cfb4af5b2f9a244fa303c5', variant: "caption", class: "char-count-text" }, h("span", { key: '84a9de3338f2fee09b3712fcc56dd509bbc672e2', class: "char-count" }, numChars, "/", maxNumChars))), h("span", { key: 'cb1d19f9755ea5b393e03ab19da262c67ce6e19e', class: "remaining-char-count-desc", "aria-live": "polite", hidden: !isFocussed, id: remainingCharCountDescId }, remainingCharCountDesc), h("span", { key: '87cfdac09956c5e749ff4c06bb58228d2d40feb5', hidden: true, id: hiddenCharCountDescId }, "Field can contain a maximum of ", maxNumChars, " characters.")))))));
|
|
1394
|
+
}
|
|
1395
|
+
get el() { return getElement(this); }
|
|
1396
|
+
static get watchers() { return {
|
|
1397
|
+
"disabled": ["watchDisabledHandler"],
|
|
1398
|
+
"debounce": ["debounceChanged"],
|
|
1399
|
+
"value": ["watchValueHandler"]
|
|
1400
|
+
}; }
|
|
1401
|
+
};
|
|
1402
|
+
TextField.style = IcTextFieldStyle0;
|
|
1403
|
+
|
|
1404
|
+
export { Pagination as ic_pagination, Select as ic_select, TextField as ic_text_field };
|
|
1405
|
+
|
|
1406
|
+
//# sourceMappingURL=ic-pagination_3.entry.js.map
|