@infineon/infineon-design-system-stencil 36.0.0--canary.1926.3384b08beedd4bd0bf0894c709a0e3eb8096602d.0 → 36.0.0--canary.1941.7599a6785f62cbeb62b2525db0089aa1d1f9fc08.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/{icons-2cd72a7d.js → icons-0d4d096d.js} +1 -4
- package/dist/cjs/icons-0d4d096d.js.map +1 -0
- package/dist/cjs/ifx-alert_2.cjs.entry.js +1 -1
- package/dist/cjs/ifx-basic-table.cjs.entry.js +1 -1
- package/dist/cjs/ifx-faq.cjs.entry.js +1 -1
- package/dist/cjs/ifx-filter-accordion.cjs.entry.js +2 -2
- package/dist/cjs/ifx-filter-bar.cjs.entry.js +1 -1
- package/dist/cjs/ifx-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/ifx-filter-type-group.cjs.entry.js +1 -1
- package/dist/cjs/ifx-icon.cjs.entry.js +1 -1
- package/dist/cjs/ifx-icons-preview.cjs.entry.js +1 -1
- package/dist/cjs/ifx-list-entry.cjs.entry.js +1 -1
- package/dist/cjs/ifx-multiselect.cjs.entry.js +545 -0
- package/dist/cjs/ifx-multiselect.cjs.entry.js.map +1 -0
- package/dist/cjs/ifx-select.cjs.entry.js +2 -2
- package/dist/cjs/ifx-set-filter.cjs.entry.js +2 -19
- package/dist/cjs/ifx-set-filter.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-slider.cjs.entry.js +2 -2
- package/dist/cjs/ifx-spinner_2.cjs.entry.js +6 -6
- package/dist/cjs/ifx-status.cjs.entry.js +1 -1
- package/dist/cjs/ifx-step.cjs.entry.js +4 -4
- package/dist/cjs/ifx-stepper.cjs.entry.js +2 -2
- package/dist/cjs/ifx-switch.cjs.entry.js +1 -1
- package/dist/cjs/ifx-tab.cjs.entry.js +1 -1
- package/dist/cjs/ifx-table.cjs.entry.js +2 -2
- package/dist/cjs/ifx-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ifx-tag.cjs.entry.js +1 -1
- package/dist/cjs/ifx-templates-ui.cjs.entry.js +1 -1
- package/dist/cjs/ifx-textarea.cjs.entry.js +1 -1
- package/dist/cjs/ifx-tooltip.cjs.entry.js +4 -4
- package/dist/cjs/ifx-tree-view-item.cjs.entry.js +2 -2
- package/dist/cjs/ifx-tree-view.cjs.entry.js +1 -1
- package/dist/cjs/index-7f4df11a.js +14 -14
- package/dist/cjs/infineon-design-system-stencil.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js.map +1 -1
- package/dist/collection/components/select/multi-select/interfaces.js.map +1 -1
- package/dist/collection/components/select/multi-select/multiselect.css +65 -60
- package/dist/collection/components/select/multi-select/multiselect.js +427 -675
- package/dist/collection/components/select/multi-select/multiselect.js.map +1 -1
- package/dist/collection/components/select/multi-select/multiselect.stories.js +135 -439
- package/dist/collection/components/select/multi-select/multiselect.stories.js.map +1 -1
- package/dist/collection/components/select/single-select/select.js +2 -2
- package/dist/collection/components/slider/slider.js +2 -2
- package/dist/collection/components/spinner/spinner.js +2 -2
- package/dist/collection/components/status/status.js +1 -1
- package/dist/collection/components/stepper/step/step.js +4 -4
- package/dist/collection/components/stepper/stepper.js +2 -2
- package/dist/collection/components/switch/switch.js +1 -1
- package/dist/collection/components/table-advanced-version/filter-bar/filter-bar.js +1 -1
- package/dist/collection/components/table-advanced-version/filter-type-group/filter-accordion/filter-accordion.js +2 -2
- package/dist/collection/components/table-advanced-version/filter-type-group/filter-search/filter-search.js +1 -1
- package/dist/collection/components/table-advanced-version/filter-type-group/filter-type-group.js +1 -1
- package/dist/collection/components/table-advanced-version/list/list-entry/list-entry.js +1 -1
- package/dist/collection/components/table-advanced-version/set-filter/setFilter.js +2 -19
- package/dist/collection/components/table-advanced-version/set-filter/setFilter.js.map +1 -1
- package/dist/collection/components/table-advanced-version/table.js +2 -2
- package/dist/collection/components/table-advanced-version/table.stories.js +3 -2
- package/dist/collection/components/table-advanced-version/table.stories.js.map +1 -1
- package/dist/collection/components/table-basic-version/table.js +1 -1
- package/dist/collection/components/tabs/tab.js +1 -1
- package/dist/collection/components/tabs/tabs.js +2 -2
- package/dist/collection/components/tag/tag.js +1 -1
- package/dist/collection/components/templates/template/template.js +1 -1
- package/dist/collection/components/templates/templates-ui/templates-ui.js +1 -1
- package/dist/collection/components/text-field/text-field.js +4 -4
- package/dist/collection/components/textarea/textarea.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +4 -4
- package/dist/collection/components/tree-view/tree-view-item.js +2 -2
- package/dist/collection/components/tree-view/tree-view.js +1 -1
- package/dist/collection/stories/setup-and-installation/faq/faq.js +1 -1
- package/dist/components/ifx-accordion-item.js +1 -1
- package/dist/components/ifx-alert.js +1 -1
- package/dist/components/ifx-basic-table.js +1 -1
- package/dist/components/ifx-breadcrumb-item-label.js +1 -1
- package/dist/components/ifx-checkbox-group.js +1 -1
- package/dist/components/ifx-checkbox.js +1 -1
- package/dist/components/ifx-chip-item.js +1 -1
- package/dist/components/ifx-chip.js +1 -1
- package/dist/components/ifx-date-picker.js +1 -1
- package/dist/components/ifx-dropdown-item.js +1 -1
- package/dist/components/ifx-dropdown-separator.js +1 -29
- package/dist/components/ifx-dropdown-separator.js.map +1 -1
- package/dist/components/ifx-dropdown-trigger-button.js +1 -1
- package/dist/components/ifx-faq.js +3 -3
- package/dist/components/ifx-file-upload.js +2 -2
- package/dist/components/ifx-filter-accordion.js +3 -3
- package/dist/components/ifx-filter-bar.js +2 -2
- package/dist/components/ifx-filter-search.js +3 -3
- package/dist/components/ifx-filter-type-group.js +1 -1
- package/dist/components/ifx-icon-button.js +1 -1
- package/dist/components/ifx-icon.js +1 -1
- package/dist/components/ifx-icons-preview.js +3 -3
- package/dist/components/ifx-list-entry.js +3 -3
- package/dist/components/ifx-list.js +1 -1
- package/dist/components/ifx-modal.js +2 -2
- package/dist/components/ifx-multiselect.js +1 -1
- package/dist/components/ifx-navbar-item.js +1 -1
- package/dist/components/ifx-navbar.js +1 -1
- package/dist/components/ifx-notification.js +1 -1
- package/dist/components/ifx-overview-table.js +1 -1
- package/dist/components/ifx-pagination.js +1 -1
- package/dist/components/ifx-radio-button-group.js +1 -1
- package/dist/components/ifx-search-bar.js +2 -2
- package/dist/components/ifx-search-field.js +1 -1
- package/dist/components/ifx-segment.js +1 -1
- package/dist/components/ifx-segmented-control.js +1 -1
- package/dist/components/ifx-select.js +1 -1
- package/dist/components/ifx-set-filter.js +12 -35
- package/dist/components/ifx-set-filter.js.map +1 -1
- package/dist/components/ifx-sidebar-item.js +1 -1
- package/dist/components/ifx-slider.js +3 -3
- package/dist/components/ifx-spinner.js +1 -1
- package/dist/components/ifx-status.js +1 -1
- package/dist/components/ifx-step.js +5 -5
- package/dist/components/ifx-stepper.js +2 -2
- package/dist/components/ifx-switch.js +1 -1
- package/dist/components/ifx-tab.js +1 -1
- package/dist/components/ifx-table.js +9 -9
- package/dist/components/ifx-tabs.js +3 -3
- package/dist/components/ifx-tag.js +2 -2
- package/dist/components/ifx-template.js +1 -1
- package/dist/components/ifx-templates-ui.js +7 -7
- package/dist/components/ifx-text-field.js +1 -1
- package/dist/components/ifx-textarea.js +1 -1
- package/dist/components/ifx-tooltip.js +5 -5
- package/dist/components/ifx-tree-view-item.js +4 -4
- package/dist/components/ifx-tree-view.js +1 -1
- package/dist/components/{p-f2f58eb1.js → p-0c449780.js} +2 -2
- package/dist/components/{p-f2f58eb1.js.map → p-0c449780.js.map} +1 -1
- package/dist/components/{p-b6b0d09b.js → p-186dacc8.js} +2 -2
- package/dist/components/{p-b6b0d09b.js.map → p-186dacc8.js.map} +1 -1
- package/dist/components/{p-34a36730.js → p-2a65d85a.js} +5 -5
- package/dist/components/{p-34a36730.js.map → p-2a65d85a.js.map} +1 -1
- package/dist/components/{p-afd6d4f5.js → p-38396fe7.js} +2 -2
- package/dist/components/{p-afd6d4f5.js.map → p-38396fe7.js.map} +1 -1
- package/dist/components/{p-fe3f24e7.js → p-67573b5f.js} +6 -6
- package/dist/components/{p-fe3f24e7.js.map → p-67573b5f.js.map} +1 -1
- package/dist/components/p-68016aea.js +33 -0
- package/dist/components/p-68016aea.js.map +1 -0
- package/dist/components/{p-20d6a006.js → p-6d12f845.js} +2 -2
- package/dist/components/{p-20d6a006.js.map → p-6d12f845.js.map} +1 -1
- package/dist/components/{p-351949f1.js → p-a4922416.js} +3 -3
- package/dist/components/{p-351949f1.js.map → p-a4922416.js.map} +1 -1
- package/dist/components/{p-b293963f.js → p-a8d0ef73.js} +2 -2
- package/dist/components/{p-b293963f.js.map → p-a8d0ef73.js.map} +1 -1
- package/dist/components/{p-6c0ec65a.js → p-b0039ef1.js} +2 -2
- package/dist/components/{p-6c0ec65a.js.map → p-b0039ef1.js.map} +1 -1
- package/dist/components/{p-12e75dad.js → p-bb4de57d.js} +1 -4
- package/dist/components/p-bb4de57d.js.map +1 -0
- package/dist/components/{p-98c86d16.js → p-c9aec5fa.js} +4 -4
- package/dist/components/{p-98c86d16.js.map → p-c9aec5fa.js.map} +1 -1
- package/dist/components/{p-1bfd69f4.js → p-cc5bd74b.js} +4 -4
- package/dist/components/{p-1bfd69f4.js.map → p-cc5bd74b.js.map} +1 -1
- package/dist/components/p-cd833a9b.js +598 -0
- package/dist/components/p-cd833a9b.js.map +1 -0
- package/dist/components/{p-2a500ed7.js → p-cd913238.js} +3 -3
- package/dist/components/{p-2a500ed7.js.map → p-cd913238.js.map} +1 -1
- package/dist/components/{p-5c96860f.js → p-d1790232.js} +2 -2
- package/dist/components/{p-5c96860f.js.map → p-d1790232.js.map} +1 -1
- package/dist/esm/{icons-75858876.js → icons-788fe290.js} +1 -4
- package/dist/esm/icons-788fe290.js.map +1 -0
- package/dist/esm/ifx-alert_2.entry.js +1 -1
- package/dist/esm/ifx-basic-table.entry.js +1 -1
- package/dist/esm/ifx-faq.entry.js +1 -1
- package/dist/esm/ifx-filter-accordion.entry.js +2 -2
- package/dist/esm/ifx-filter-bar.entry.js +1 -1
- package/dist/esm/ifx-filter-search.entry.js +1 -1
- package/dist/esm/ifx-filter-type-group.entry.js +1 -1
- package/dist/esm/ifx-icon.entry.js +1 -1
- package/dist/esm/ifx-icons-preview.entry.js +1 -1
- package/dist/esm/ifx-list-entry.entry.js +1 -1
- package/dist/esm/ifx-multiselect.entry.js +541 -0
- package/dist/esm/ifx-multiselect.entry.js.map +1 -0
- package/dist/esm/ifx-select.entry.js +2 -2
- package/dist/esm/ifx-set-filter.entry.js +2 -19
- package/dist/esm/ifx-set-filter.entry.js.map +1 -1
- package/dist/esm/ifx-slider.entry.js +2 -2
- package/dist/esm/ifx-spinner_2.entry.js +6 -6
- package/dist/esm/ifx-status.entry.js +1 -1
- package/dist/esm/ifx-step.entry.js +4 -4
- package/dist/esm/ifx-stepper.entry.js +2 -2
- package/dist/esm/ifx-switch.entry.js +1 -1
- package/dist/esm/ifx-tab.entry.js +1 -1
- package/dist/esm/ifx-table.entry.js +2 -2
- package/dist/esm/ifx-tabs.entry.js +2 -2
- package/dist/esm/ifx-tag.entry.js +1 -1
- package/dist/esm/ifx-templates-ui.entry.js +1 -1
- package/dist/esm/ifx-textarea.entry.js +1 -1
- package/dist/esm/ifx-tooltip.entry.js +4 -4
- package/dist/esm/ifx-tree-view-item.entry.js +2 -2
- package/dist/esm/ifx-tree-view.entry.js +1 -1
- package/dist/esm/index-6c9eba32.js +14 -14
- package/dist/esm/infineon-design-system-stencil.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js +1 -1
- package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js.map +1 -1
- package/dist/infineon-design-system-stencil/p-06bfabcf.entry.js +2 -0
- package/dist/infineon-design-system-stencil/{p-76e0c34f.entry.js.map → p-06bfabcf.entry.js.map} +1 -1
- package/dist/infineon-design-system-stencil/{p-3d037fa4.entry.js → p-0f096cf1.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-ad7b58c3.entry.js → p-1048ee19.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-d890b0de.entry.js → p-142878ee.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-4d96fed0.js → p-27d2afb4.js} +2 -2
- package/dist/infineon-design-system-stencil/p-27d2afb4.js.map +1 -0
- package/dist/infineon-design-system-stencil/{p-18a81f5f.entry.js → p-2b38c405.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/p-34738a10.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-45ac2698.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-45ac2698.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/{p-4d9a4329.entry.js → p-49252616.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/p-65e57b85.entry.js +2 -0
- package/dist/infineon-design-system-stencil/{p-74bee1c8.entry.js → p-65fe2246.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-7adee2dd.entry.js → p-6d99d01d.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-4764665d.entry.js → p-702a48f8.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-b6dd2ac0.entry.js → p-7440ea9d.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-c7e86c7c.entry.js → p-7b7ac7fa.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-0c1c831c.entry.js → p-87fbd617.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/p-885adc48.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-885adc48.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/{p-aaf08082.entry.js → p-88af2e64.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-13c107bf.entry.js → p-959285a7.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-36dcebde.entry.js → p-a9cfb70d.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-6250b9f6.entry.js → p-acf0f4ed.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-02496917.entry.js → p-b637c44c.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-6c2698a3.entry.js → p-babf3f2d.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-5e376887.entry.js → p-c2791360.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-a80e321b.entry.js → p-c5a785d7.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-2e7d87ed.entry.js → p-e98d2280.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-5f38cace.entry.js → p-ecc17497.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-5285ca40.entry.js → p-f25f014d.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-04d8ea38.entry.js → p-f2bea855.entry.js} +2 -2
- package/dist/types/components/breadcrumb/breadcrumb.stories.d.ts +1 -1
- package/dist/types/components/select/multi-select/interfaces.d.ts +1 -1
- package/dist/types/components/select/multi-select/multiselect.d.ts +61 -39
- package/dist/types/components/select/multi-select/multiselect.stories.d.ts +30 -219
- package/dist/types/components.d.ts +8 -54
- package/package.json +2 -2
- package/dist/cjs/icons-2cd72a7d.js.map +0 -1
- package/dist/cjs/ifx-multiselect_2.cjs.entry.js +0 -929
- package/dist/cjs/ifx-multiselect_2.cjs.entry.js.map +0 -1
- package/dist/collection/components/select/multi-select/multiselect-option.css +0 -112
- package/dist/collection/components/select/multi-select/multiselect-option.js +0 -505
- package/dist/collection/components/select/multi-select/multiselect-option.js.map +0 -1
- package/dist/components/ifx-multiselect-option.d.ts +0 -11
- package/dist/components/ifx-multiselect-option.js +0 -8
- package/dist/components/ifx-multiselect-option.js.map +0 -1
- package/dist/components/p-12e75dad.js.map +0 -1
- package/dist/components/p-3906f639.js +0 -432
- package/dist/components/p-3906f639.js.map +0 -1
- package/dist/components/p-aedd7be5.js +0 -599
- package/dist/components/p-aedd7be5.js.map +0 -1
- package/dist/esm/icons-75858876.js.map +0 -1
- package/dist/esm/ifx-multiselect_2.entry.js +0 -924
- package/dist/esm/ifx-multiselect_2.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-25204a1e.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-25204a1e.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-4d96fed0.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-6c999b11.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-6c999b11.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-76e0c34f.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-a2a44fbe.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-e571c002.entry.js +0 -2
- package/dist/types/components/select/multi-select/multiselect-option.d.ts +0 -36
- /package/dist/infineon-design-system-stencil/{p-3d037fa4.entry.js.map → p-0f096cf1.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-ad7b58c3.entry.js.map → p-1048ee19.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-d890b0de.entry.js.map → p-142878ee.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-18a81f5f.entry.js.map → p-2b38c405.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-e571c002.entry.js.map → p-34738a10.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-4d9a4329.entry.js.map → p-49252616.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-a2a44fbe.entry.js.map → p-65e57b85.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-74bee1c8.entry.js.map → p-65fe2246.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-7adee2dd.entry.js.map → p-6d99d01d.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-4764665d.entry.js.map → p-702a48f8.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-b6dd2ac0.entry.js.map → p-7440ea9d.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-c7e86c7c.entry.js.map → p-7b7ac7fa.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-0c1c831c.entry.js.map → p-87fbd617.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-aaf08082.entry.js.map → p-88af2e64.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-13c107bf.entry.js.map → p-959285a7.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-36dcebde.entry.js.map → p-a9cfb70d.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-6250b9f6.entry.js.map → p-acf0f4ed.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-02496917.entry.js.map → p-b637c44c.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-6c2698a3.entry.js.map → p-babf3f2d.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-5e376887.entry.js.map → p-c2791360.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-a80e321b.entry.js.map → p-c5a785d7.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-2e7d87ed.entry.js.map → p-e98d2280.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-5f38cace.entry.js.map → p-ecc17497.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-5285ca40.entry.js.map → p-f25f014d.entry.js.map} +0 -0
- /package/dist/infineon-design-system-stencil/{p-04d8ea38.entry.js.map → p-f2bea855.entry.js.map} +0 -0
@@ -0,0 +1,545 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-7f4df11a.js');
|
6
|
+
|
7
|
+
const multiselectCss = ":root{--ifx-font-family:\"Source Sans 3\", \"Arial, sans-serif\"}.ifx-multiselect-container{position:relative;box-sizing:border-box;font-family:var(--ifx-font-family)}.ifx-multiselect-container.small-select{height:36px}.ifx-multiselect-container.medium-select{height:40px}.ifx-multiselect-container:hover{cursor:pointer}.ifx-multiselect-container .ifx-label-wrapper{font-size:1rem;line-height:1.5rem;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere;max-width:100%}.ifx-multiselect-container .ifx-error-message-wrapper{color:#CD002F;font-size:0.75rem;line-height:1rem;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere;max-width:100%}.ifx-multiselect-container .ifx-multiselect-wrapper{background-color:#FFFFFF;box-sizing:border-box;position:relative;display:flex;align-items:center;border:1px solid #8D8786;border-radius:1px;width:100%;font-weight:400;font-style:normal}.ifx-multiselect-container .ifx-multiselect-wrapper.small-select{height:36px;padding:8px 12px;font-size:0.875rem;line-height:1.25rem}.ifx-multiselect-container .ifx-multiselect-wrapper.medium-select{height:40px;padding:8px 16px;font-size:1rem;line-height:1.5rem}.ifx-multiselect-container .ifx-multiselect-wrapper:focus-visible{outline:none}.ifx-multiselect-container .ifx-multiselect-wrapper:focus-visible:not(.active):not(:active){outline:none}.ifx-multiselect-container .ifx-multiselect-wrapper:focus-visible:not(.active):not(:active)::before{content:\"\";position:absolute;width:calc(100% + 4px);height:calc(100% + 4px);top:50%;left:50%;transform:translate(-50%, -50%);border:2px solid #0A8276;border-radius:2px}.ifx-multiselect-container .ifx-multiselect-wrapper.disabled{background:#EEEDED;color:#575352;border-color:#575352;cursor:default;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ifx-multiselect-container .ifx-multiselect-wrapper.error{border-color:#CD002F}.ifx-multiselect-container .ifx-multiselect-wrapper:hover:not(.focus,:focus){border-color:#575352}.ifx-multiselect-container .ifx-multiselect-wrapper.active{border-color:#0A8276 !important}.ifx-multiselect-container .ifx-multiselect-wrapper.active .icon-wrapper-up{display:flex;align-items:center;justify-content:center;padding-left:8px}.ifx-multiselect-container .ifx-multiselect-wrapper.active .icon-wrapper-down{display:none}.ifx-multiselect-container .ifx-multiselect-wrapper .icon-wrapper-up{display:none}.ifx-multiselect-container .ifx-multiselect-wrapper .icon-wrapper-down{display:flex;align-items:center;justify-content:center;padding-left:8px}.ifx-multiselect-container .ifx-multiselect-wrapper.is-flipped .ifx-multiselect-dropdown-menu{top:auto;bottom:100%}.ifx-multiselect-container .ifx-multiselect-input{flex-grow:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ifx-multiselect-container .ifx-multiselect-input.placeholder{opacity:0.5}.ifx-multiselect-container .ifx-multiselect-icon-container{margin-left:auto;align-items:center;display:flex}.ifx-multiselect-container .ifx-clear-button{display:flex}.ifx-multiselect-container .ifx-clear-button.hide{display:none}.ifx-multiselect-container .ifx-multiselect-dropdown-menu{position:absolute;top:100%;left:0;width:100%;margin-top:2px;background-color:#fff;box-shadow:0px 6px 9px 0px rgba(29, 29, 29, 0.1);max-height:300px;overflow-y:auto;z-index:1000}.ifx-multiselect-container .ifx-multiselect-dropdown-menu .search-input{position:sticky;top:0;left:0;z-index:1;width:100%;padding:8px 16px;font-size:1rem;line-height:1.5rem;font-style:normal;font-weight:400;box-sizing:border-box;background-color:#FFFFFF;border:none;border-bottom:1px solid #8D8786}.ifx-multiselect-container .ifx-multiselect-dropdown-menu .search-input:focus{outline:none;border:1px solid #0A8276}.ifx-multiselect-container .ifx-multiselect-dropdown-menu .search-input::placeholder{color:#999}.ifx-multiselect-container .option{position:relative;padding:8px 16px;gap:8px;align-items:center;display:flex;font-style:normal;font-weight:400}.ifx-multiselect-container .option.small-select{font-size:0.875rem;line-height:1.25rem}.ifx-multiselect-container .option.medium-select{font-size:1rem;line-height:1.5rem}.ifx-multiselect-container .option:hover{background-color:#EEEDED}.ifx-multiselect-container .option:focus:not(.disabled){background-color:#BFBBBB;outline:none}.ifx-multiselect-container .option.is-highlighted{background-color:#EEEDED}.ifx-multiselect-container .option.sub-option{padding-left:30px;}.ifx-multiselect-container .option.disabled:hover{cursor:default}.ifx-multiselect-container .option label{cursor:inherit}.select-all-wrapper{padding-top:8px}";
|
8
|
+
const IfxMultiselectStyle0 = multiselectCss;
|
9
|
+
|
10
|
+
// Debounce function
|
11
|
+
function debounce(func, wait) {
|
12
|
+
let timeout;
|
13
|
+
return function executedFunction(...args) {
|
14
|
+
const later = () => {
|
15
|
+
clearTimeout(timeout);
|
16
|
+
func(...args);
|
17
|
+
};
|
18
|
+
clearTimeout(timeout);
|
19
|
+
timeout = setTimeout(later, wait);
|
20
|
+
};
|
21
|
+
}
|
22
|
+
const Multiselect = class {
|
23
|
+
constructor(hostRef) {
|
24
|
+
index.registerInstance(this, hostRef);
|
25
|
+
this.ifxSelect = index.createEvent(this, "ifxSelect", 7);
|
26
|
+
this.ifxOpen = index.createEvent(this, "ifxOpen", 7);
|
27
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
28
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
32
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
33
|
+
}
|
34
|
+
this.batchSize = 50;
|
35
|
+
this.size = 'medium (40px)';
|
36
|
+
this.disabled = false;
|
37
|
+
this.error = false;
|
38
|
+
this.internalError = false;
|
39
|
+
this.errorMessage = "Error";
|
40
|
+
this.label = "";
|
41
|
+
this.persistentSelectedOptions = [];
|
42
|
+
this.placeholder = "";
|
43
|
+
this.dropdownOpen = false;
|
44
|
+
this.currentIndex = 0; //needed for option selection using keyboard
|
45
|
+
this.isLoading = false;
|
46
|
+
this.loadedOptions = [];
|
47
|
+
this.filteredOptions = [];
|
48
|
+
this.showSearch = true;
|
49
|
+
this.showSelectAll = true;
|
50
|
+
this.showClearButton = true;
|
51
|
+
this.optionCount = 0; // number of all options (leaves of the tree)
|
52
|
+
this.optionsProcessed = false; // flag whether options have already been counted, intial selections saved
|
53
|
+
this.handleSearch = debounce((targetElement) => {
|
54
|
+
const searchTerm = targetElement.value.toLowerCase();
|
55
|
+
if (searchTerm === '') {
|
56
|
+
this.filteredOptions = this.loadedOptions;
|
57
|
+
}
|
58
|
+
else {
|
59
|
+
this.filteredOptions = this.loadedOptions.filter(option => {
|
60
|
+
const matchesSearchTerm = option.label.toLowerCase().includes(searchTerm);
|
61
|
+
if (option.children) {
|
62
|
+
const childrenMatch = option.children.some(child => {
|
63
|
+
return child.label.toLowerCase().includes(searchTerm);
|
64
|
+
});
|
65
|
+
return matchesSearchTerm || childrenMatch;
|
66
|
+
}
|
67
|
+
return matchesSearchTerm;
|
68
|
+
});
|
69
|
+
}
|
70
|
+
}, 300);
|
71
|
+
this.handleDocumentClick = (event) => {
|
72
|
+
const path = event.composedPath();
|
73
|
+
if (!path.includes(this.dropdownElement)) {
|
74
|
+
this.dropdownOpen = false;
|
75
|
+
document.removeEventListener('click', this.handleDocumentClick);
|
76
|
+
this.filteredOptions = this.loadedOptions;
|
77
|
+
// Dispatch the ifxMultiselectIsOpen event
|
78
|
+
this.ifxOpen.emit(this.dropdownOpen);
|
79
|
+
}
|
80
|
+
};
|
81
|
+
}
|
82
|
+
updateOptions() {
|
83
|
+
this.loadedOptions = [];
|
84
|
+
this.filteredOptions = [];
|
85
|
+
this.optionCount = 0;
|
86
|
+
this.optionsProcessed = false;
|
87
|
+
this.persistentSelectedOptions = [];
|
88
|
+
this.loadInitialOptions();
|
89
|
+
}
|
90
|
+
async loadInitialOptions() {
|
91
|
+
this.isLoading = true;
|
92
|
+
this.internalError = this.error;
|
93
|
+
this.internalErrorMessage = this.errorMessage;
|
94
|
+
// Load the first batch of options (e.g., first 20)
|
95
|
+
this.loadedOptions = await this.fetchOptions(0, this.batchSize);
|
96
|
+
this.isLoading = false;
|
97
|
+
}
|
98
|
+
async fetchMoreOptions() {
|
99
|
+
this.isLoading = true;
|
100
|
+
const moreOptions = await this.fetchOptions(this.loadedOptions.length, this.batchSize);
|
101
|
+
this.loadedOptions = [...this.loadedOptions, ...moreOptions];
|
102
|
+
this.isLoading = false;
|
103
|
+
}
|
104
|
+
handleScroll(event) {
|
105
|
+
const element = event.target;
|
106
|
+
const halfwayPoint = Math.floor((element.scrollHeight - element.clientHeight) / 2); //loading more options when the user has scrolled halfway through the current list
|
107
|
+
if (element.scrollTop >= halfwayPoint) {
|
108
|
+
this.fetchMoreOptions();
|
109
|
+
}
|
110
|
+
}
|
111
|
+
async fetchOptions(startIndex, count) {
|
112
|
+
let allOptions = [];
|
113
|
+
// Parse options if it's a string, or use directly if it's an array
|
114
|
+
if (typeof this.options === 'string') {
|
115
|
+
try {
|
116
|
+
allOptions = JSON.parse(this.options);
|
117
|
+
}
|
118
|
+
catch (err) {
|
119
|
+
console.error('Failed to parse options:', err);
|
120
|
+
}
|
121
|
+
}
|
122
|
+
else if (Array.isArray(this.options)) {
|
123
|
+
allOptions = this.options;
|
124
|
+
}
|
125
|
+
else {
|
126
|
+
console.error('Unexpected value for options:', this.options);
|
127
|
+
}
|
128
|
+
if (!this.optionsProcessed) {
|
129
|
+
this.optionCount = this.countOptions(allOptions);
|
130
|
+
const initiallySelected = this.collectSelectedOptions(allOptions);
|
131
|
+
const initallySelectedNotInState = initiallySelected.filter(init => !this.persistentSelectedOptions.some(opt => opt.value == init.value));
|
132
|
+
this.persistentSelectedOptions = [...this.persistentSelectedOptions, ...initallySelectedNotInState];
|
133
|
+
this.optionsProcessed = true;
|
134
|
+
}
|
135
|
+
// Slice the options array based on startIndex and count
|
136
|
+
const slicedOptions = allOptions.slice(startIndex, startIndex + count);
|
137
|
+
return slicedOptions;
|
138
|
+
}
|
139
|
+
/**
|
140
|
+
* Collects and returns all options that are selected.
|
141
|
+
* When the parent is selected, then the value of the children will be overriden with selected as well.
|
142
|
+
* It will only collect the leaves of the tree.
|
143
|
+
*
|
144
|
+
* @param options A list of options.
|
145
|
+
* @returns A list with all selected options
|
146
|
+
*/
|
147
|
+
collectSelectedOptions(options) {
|
148
|
+
let selectedOptions = [];
|
149
|
+
for (const option of options) {
|
150
|
+
if (option.selected) {
|
151
|
+
if (option.children && option.children.length > 0) {
|
152
|
+
// if parent is selected, then select all child options
|
153
|
+
selectedOptions = selectedOptions.concat(this.collectLeafOptions(option.children));
|
154
|
+
}
|
155
|
+
else {
|
156
|
+
if (!selectedOptions.some(existingOption => existingOption.value === option.value)) {
|
157
|
+
selectedOptions.push(option);
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}
|
161
|
+
else {
|
162
|
+
if (option.children && option.children.length > 0) {
|
163
|
+
selectedOptions = selectedOptions.concat(this.collectSelectedOptions(option.children));
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}
|
167
|
+
return selectedOptions;
|
168
|
+
}
|
169
|
+
/**
|
170
|
+
* Collects all leaf children options.
|
171
|
+
*
|
172
|
+
* @param option A list with all leaf-children.
|
173
|
+
*/
|
174
|
+
collectLeafOptions(children) {
|
175
|
+
let leafOptions = [];
|
176
|
+
for (const child of children) {
|
177
|
+
if (child.children && child.children.length > 0) {
|
178
|
+
leafOptions = leafOptions.concat(this.collectLeafOptions(child.children));
|
179
|
+
}
|
180
|
+
else {
|
181
|
+
leafOptions.push(child);
|
182
|
+
}
|
183
|
+
}
|
184
|
+
return leafOptions;
|
185
|
+
}
|
186
|
+
/**
|
187
|
+
* Count the number of options. Only counts the leaves of the options tree.
|
188
|
+
*/
|
189
|
+
countOptions(options) {
|
190
|
+
let count = 0;
|
191
|
+
for (const option of options) {
|
192
|
+
if (option.children && option.children.length >= 0) {
|
193
|
+
count += this.countOptions(option.children);
|
194
|
+
}
|
195
|
+
else {
|
196
|
+
count++;
|
197
|
+
}
|
198
|
+
}
|
199
|
+
return count;
|
200
|
+
}
|
201
|
+
componentDidLoad() {
|
202
|
+
setTimeout(() => {
|
203
|
+
this.positionDropdown();
|
204
|
+
}, 500);
|
205
|
+
// setInterval(this.handleScroll, 5000); // Runs every 5 seconds (5000 milliseconds)
|
206
|
+
}
|
207
|
+
componentWillLoad() {
|
208
|
+
this.loadInitialOptions();
|
209
|
+
this.filteredOptions = [...this.loadedOptions];
|
210
|
+
}
|
211
|
+
updateInternalError() {
|
212
|
+
this.internalError = this.error;
|
213
|
+
}
|
214
|
+
updateInternalErrorMessage() {
|
215
|
+
this.internalErrorMessage = this.errorMessage;
|
216
|
+
}
|
217
|
+
loadedOptionsChanged() {
|
218
|
+
this.filteredOptions = [...this.loadedOptions];
|
219
|
+
}
|
220
|
+
onSelectionChange(newValue, _) {
|
221
|
+
const formData = new FormData();
|
222
|
+
newValue.forEach(option => formData.append(this.name, option.value));
|
223
|
+
this.internals.setFormValue(formData);
|
224
|
+
}
|
225
|
+
handleOptionClick(option) {
|
226
|
+
this.internalError = false;
|
227
|
+
if (!option.selected && this.isSelectionLimitReached(option)) {
|
228
|
+
option.checkboxRef.toggleCheckedState(false);
|
229
|
+
this.internalError = true;
|
230
|
+
this.internalErrorMessage = "Please consider the maximum number of items to choose from";
|
231
|
+
return;
|
232
|
+
}
|
233
|
+
this.updateSelection(option);
|
234
|
+
this.ifxSelect.emit(this.persistentSelectedOptions);
|
235
|
+
}
|
236
|
+
isSelectionLimitReached(option) {
|
237
|
+
let newOptionsLength = option.children ? option.children.length : 1;
|
238
|
+
return this.maxItemCount && this.persistentSelectedOptions.length + newOptionsLength > this.maxItemCount &&
|
239
|
+
!this.persistentSelectedOptions.some(selectedOption => selectedOption.value === option.value);
|
240
|
+
}
|
241
|
+
updateSelection(option) {
|
242
|
+
const wasSelected = this.persistentSelectedOptions.some(selectedOption => selectedOption.value === option.value);
|
243
|
+
if (option.children && option.children.length > 0) {
|
244
|
+
this.handleParentOptionClick(option);
|
245
|
+
}
|
246
|
+
else {
|
247
|
+
this.handleChildOptionClick(option, wasSelected);
|
248
|
+
}
|
249
|
+
}
|
250
|
+
async selectAll() {
|
251
|
+
const allOptions = await this.fetchOptions(0, this.optionCount);
|
252
|
+
this.selectAllRecursive(allOptions);
|
253
|
+
this.ifxSelect.emit(this.persistentSelectedOptions);
|
254
|
+
}
|
255
|
+
selectAllRecursive(options) {
|
256
|
+
for (const opt of options) {
|
257
|
+
if (opt.children && opt.children.length > 0) {
|
258
|
+
this.selectAllRecursive(opt.children);
|
259
|
+
}
|
260
|
+
else {
|
261
|
+
if (!this.persistentSelectedOptions.some((some) => some.value === opt.value)) {
|
262
|
+
opt.selected = true;
|
263
|
+
this.persistentSelectedOptions = [...this.persistentSelectedOptions, opt];
|
264
|
+
this.optionCount = this.countOptions(this.persistentSelectedOptions);
|
265
|
+
}
|
266
|
+
}
|
267
|
+
}
|
268
|
+
}
|
269
|
+
handleParentOptionClick(option) {
|
270
|
+
const allChildrenSelected = option.children.every(child => this.persistentSelectedOptions.some(selectedOption => selectedOption.value === child.value));
|
271
|
+
if (allChildrenSelected) {
|
272
|
+
this.persistentSelectedOptions = [...this.persistentSelectedOptions.filter(selectedOption => !option.children.some(child => child.value === selectedOption.value))];
|
273
|
+
option.selected = false;
|
274
|
+
option.children.forEach(child => {
|
275
|
+
child.selected = false;
|
276
|
+
});
|
277
|
+
}
|
278
|
+
else {
|
279
|
+
const newChildren = [...option.children.filter(childOption => !this.persistentSelectedOptions.some(selectedOption => selectedOption.value === childOption.value))];
|
280
|
+
option.selected = true;
|
281
|
+
option.children.forEach(child => {
|
282
|
+
child.selected = true;
|
283
|
+
});
|
284
|
+
this.persistentSelectedOptions = [...this.persistentSelectedOptions, ...newChildren];
|
285
|
+
}
|
286
|
+
}
|
287
|
+
handleChildOptionClick(option, wasSelected) {
|
288
|
+
if (wasSelected) {
|
289
|
+
this.persistentSelectedOptions = [...this.persistentSelectedOptions.filter(selectedOption => selectedOption.value !== option.value)];
|
290
|
+
option.selected = false;
|
291
|
+
}
|
292
|
+
else {
|
293
|
+
this.persistentSelectedOptions = [...this.persistentSelectedOptions, option];
|
294
|
+
option.selected = true;
|
295
|
+
}
|
296
|
+
this.updateParentSelectedState();
|
297
|
+
}
|
298
|
+
updateParentSelectedState() {
|
299
|
+
this.loadedOptions.forEach(option => {
|
300
|
+
var _a;
|
301
|
+
if (((_a = option.children) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
302
|
+
if (option.children.every(child => child.selected === true))
|
303
|
+
option.selected = true;
|
304
|
+
else {
|
305
|
+
option.selected = false;
|
306
|
+
if (this.isOptionIndeterminate(option)) {
|
307
|
+
option.indeterminate = true;
|
308
|
+
}
|
309
|
+
else {
|
310
|
+
option.indeterminate = false;
|
311
|
+
}
|
312
|
+
}
|
313
|
+
}
|
314
|
+
});
|
315
|
+
}
|
316
|
+
getSizeClass() {
|
317
|
+
return `${this.size}` === "s"
|
318
|
+
? "small-select"
|
319
|
+
: "medium-select";
|
320
|
+
}
|
321
|
+
toggleDropdown() {
|
322
|
+
this.dropdownOpen = !this.dropdownOpen;
|
323
|
+
setTimeout(() => {
|
324
|
+
if (this.dropdownOpen) {
|
325
|
+
document.addEventListener('click', this.handleDocumentClick);
|
326
|
+
}
|
327
|
+
// Dispatch the ifxOpen event
|
328
|
+
this.ifxOpen.emit(this.dropdownOpen);
|
329
|
+
}, 0);
|
330
|
+
}
|
331
|
+
waitForElement(querySelectorFunc, callback, maxTries = 50) {
|
332
|
+
let tries = 0;
|
333
|
+
function request() {
|
334
|
+
requestAnimationFrame(() => {
|
335
|
+
const elements = querySelectorFunc();
|
336
|
+
if (elements.length > 0 || tries > maxTries) {
|
337
|
+
callback(elements);
|
338
|
+
}
|
339
|
+
else {
|
340
|
+
tries++;
|
341
|
+
request();
|
342
|
+
}
|
343
|
+
});
|
344
|
+
}
|
345
|
+
request();
|
346
|
+
}
|
347
|
+
handleKeyDown(event) {
|
348
|
+
if (this.disabled)
|
349
|
+
return; // If it's disabled, don't do anything.
|
350
|
+
const options = this.dropdownElement.querySelectorAll('.option');
|
351
|
+
switch (event.code) {
|
352
|
+
case 'Enter':
|
353
|
+
this.toggleDropdown();
|
354
|
+
// Wait a bit for the dropdown to finish rendering
|
355
|
+
this.waitForElement(() => {
|
356
|
+
return this.dropdownElement.querySelectorAll('.option');
|
357
|
+
}, (options) => {
|
358
|
+
this.updateHighlightedOption(options);
|
359
|
+
});
|
360
|
+
break;
|
361
|
+
case 'Space':
|
362
|
+
this.toggleDropdown();
|
363
|
+
// Wait a bit for the dropdown to finish rendering
|
364
|
+
this.waitForElement(() => {
|
365
|
+
return this.dropdownElement.querySelectorAll('.option');
|
366
|
+
}, (options) => {
|
367
|
+
this.updateHighlightedOption(options);
|
368
|
+
});
|
369
|
+
break;
|
370
|
+
case 'ArrowDown':
|
371
|
+
this.handleArrowDown(options);
|
372
|
+
if (this.dropdownOpen) {
|
373
|
+
this.updateHighlightedOption(options);
|
374
|
+
}
|
375
|
+
break;
|
376
|
+
case 'ArrowUp':
|
377
|
+
this.handleArrowUp(options);
|
378
|
+
if (this.dropdownOpen) {
|
379
|
+
this.updateHighlightedOption(options);
|
380
|
+
}
|
381
|
+
break;
|
382
|
+
}
|
383
|
+
}
|
384
|
+
handleWrapperClick(event) {
|
385
|
+
// This is your existing logic for positioning the dropdown
|
386
|
+
this.positionDropdown();
|
387
|
+
// Check if the event target is the wrapper itself and not a child element.
|
388
|
+
if (event.currentTarget === event.target) {
|
389
|
+
this.toggleDropdown();
|
390
|
+
}
|
391
|
+
}
|
392
|
+
clearSelection() {
|
393
|
+
this.persistentSelectedOptions = [];
|
394
|
+
this.ifxSelect.emit(this.persistentSelectedOptions); // if you want to emit empty selection after clearing
|
395
|
+
}
|
396
|
+
positionDropdown() {
|
397
|
+
var _a;
|
398
|
+
const wrapperRect = (_a = this.el.shadowRoot.querySelector('.ifx-multiselect-wrapper')) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
399
|
+
const spaceBelow = window.innerHeight - wrapperRect.bottom;
|
400
|
+
const spaceAbove = wrapperRect.top;
|
401
|
+
// If there's more space above than below the trigger and the dropdown doesn't fit below
|
402
|
+
if ((spaceAbove > spaceBelow && wrapperRect.height > spaceBelow) || (wrapperRect.bottom > window.innerHeight)) {
|
403
|
+
this.dropdownFlipped = true;
|
404
|
+
}
|
405
|
+
else {
|
406
|
+
this.dropdownFlipped = false;
|
407
|
+
}
|
408
|
+
}
|
409
|
+
// Helper function to update highlighted option based on currentIndex
|
410
|
+
updateHighlightedOption(options) {
|
411
|
+
// Clear all highlights
|
412
|
+
options.forEach((option) => option.classList.remove('is-highlighted'));
|
413
|
+
// Apply highlight to the current option
|
414
|
+
if (this.currentIndex >= 0 && this.currentIndex < options.length) {
|
415
|
+
options[this.currentIndex].classList.add('is-highlighted');
|
416
|
+
options[this.currentIndex].focus();
|
417
|
+
}
|
418
|
+
}
|
419
|
+
// Helper function to handle arrow down navigation
|
420
|
+
handleArrowDown(options) {
|
421
|
+
if (this.currentIndex < options.length - 1) {
|
422
|
+
this.currentIndex++;
|
423
|
+
}
|
424
|
+
else {
|
425
|
+
this.currentIndex = 0; // Wrap to the beginning.
|
426
|
+
}
|
427
|
+
}
|
428
|
+
// Helper function to handle arrow up navigation
|
429
|
+
handleArrowUp(options) {
|
430
|
+
if (this.currentIndex > 0) {
|
431
|
+
this.currentIndex--;
|
432
|
+
}
|
433
|
+
else {
|
434
|
+
this.currentIndex = options.length - 1; // Wrap to the end.
|
435
|
+
}
|
436
|
+
}
|
437
|
+
handleOptionKeyDown(e, option) {
|
438
|
+
if (e.key !== 'ArrowUp' && e.key !== 'ArrowDown')
|
439
|
+
e.stopPropagation();
|
440
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
441
|
+
this.handleOptionClick(option);
|
442
|
+
}
|
443
|
+
}
|
444
|
+
renderOption(option, index$1) {
|
445
|
+
var _a;
|
446
|
+
const isIndeterminate = this.isOptionIndeterminate(option);
|
447
|
+
const isSelected = option.children ? isIndeterminate || this.isOptionSelected(option) : this.persistentSelectedOptions.some(selectedOption => selectedOption.value === option.value);
|
448
|
+
const disableCheckbox = !isSelected && this.maxItemCount && this.persistentSelectedOptions.length >= this.maxItemCount;
|
449
|
+
const uniqueId = `checkbox-${option.value}-${index$1}`; // Generate a unique ID using the index
|
450
|
+
return (index.h("div", { class: "option-wrapper" }, index.h("div", { class: `option ${isSelected ? 'selected' : ''} ${disableCheckbox ? 'disabled' : ''}
|
451
|
+
${this.getSizeClass()}`, "data-value": option.value, onKeyDown: (e) => !disableCheckbox && this.handleOptionKeyDown(e, option), onClick: () => !disableCheckbox && this.handleOptionClick(option), tabindex: "0", role: `${((_a = option.children) === null || _a === void 0 ? void 0 : _a.length) > 0 ? "treeitem" : "option"}` }, index.h("ifx-checkbox", { tabIndex: -1, ref: (el) => option.checkboxRef = el, id: uniqueId, size: "s", checked: isIndeterminate ? false : isSelected, indeterminate: isIndeterminate, disabled: disableCheckbox }), index.h("label", { htmlFor: uniqueId, onClick: (e) => e.stopPropagation() }, option.label)), option.children && option.children.map((child, childIndex) => this.renderSubOption(child, `${index$1}-${childIndex}`))));
|
452
|
+
}
|
453
|
+
isOptionSelected(option) {
|
454
|
+
if (!option.children)
|
455
|
+
return false;
|
456
|
+
return option.children.every(child => this.persistentSelectedOptions.some(persistentOption => persistentOption.value === child.value));
|
457
|
+
}
|
458
|
+
isOptionIndeterminate(option) {
|
459
|
+
if (!option.children)
|
460
|
+
return false;
|
461
|
+
const selectedChildren = option.children.filter(child => this.persistentSelectedOptions.some(persistentOption => persistentOption.value === child.value)).length;
|
462
|
+
return selectedChildren > 0 && selectedChildren < option.children.length;
|
463
|
+
}
|
464
|
+
findInOptions(options, searchTerm) {
|
465
|
+
for (const option of options) {
|
466
|
+
if (option.value === searchTerm) {
|
467
|
+
return option;
|
468
|
+
}
|
469
|
+
if (option.children) {
|
470
|
+
const foundInChildren = this.findInOptions(option.children, searchTerm);
|
471
|
+
if (foundInChildren) {
|
472
|
+
return foundInChildren;
|
473
|
+
}
|
474
|
+
}
|
475
|
+
}
|
476
|
+
return null;
|
477
|
+
}
|
478
|
+
renderSubOption(option, index$1) {
|
479
|
+
var _a;
|
480
|
+
const isSelected = this.persistentSelectedOptions.some(selectedOption => selectedOption.value === option.value);
|
481
|
+
const disableCheckbox = !isSelected && this.maxItemCount && this.persistentSelectedOptions.length >= this.maxItemCount;
|
482
|
+
const uniqueId = `checkbox-${option.value}-${index$1}`;
|
483
|
+
return (index.h("div", { class: `option sub-option ${isSelected ? 'selected' : ''} ${this.getSizeClass()} ${disableCheckbox ? 'disabled' : ''}`, "data-value": option.value, role: `${((_a = option.children) === null || _a === void 0 ? void 0 : _a.length) > 0 ? "option" : "treeitem"}`, onKeyDown: (e) => !disableCheckbox && this.handleOptionKeyDown(e, option), onClick: () => !disableCheckbox && this.handleOptionClick(option), tabindex: "0" }, index.h("ifx-checkbox", { tabIndex: -1, ref: (el) => option.checkboxRef = el, id: uniqueId, size: "s", checked: isSelected, disabled: disableCheckbox }), index.h("label", { htmlFor: uniqueId, onClick: (e) => e.stopPropagation() }, option.label)));
|
484
|
+
}
|
485
|
+
renderSelectAll() {
|
486
|
+
const allSelected = this.persistentSelectedOptions.length === this.optionCount;
|
487
|
+
const noneSelected = this.persistentSelectedOptions.length === 0;
|
488
|
+
const indeterminate = this.optionCount > 0 && !noneSelected && !allSelected;
|
489
|
+
const that = this;
|
490
|
+
function toggleSelectAll() {
|
491
|
+
if (allSelected) {
|
492
|
+
that.clearSelection();
|
493
|
+
}
|
494
|
+
else {
|
495
|
+
that.selectAll();
|
496
|
+
}
|
497
|
+
}
|
498
|
+
function handleSelectAllKeydown(e) {
|
499
|
+
if (e.key !== 'ArrowUp' && e.key !== 'ArrowDown')
|
500
|
+
e.stopPropagation();
|
501
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
502
|
+
toggleSelectAll();
|
503
|
+
}
|
504
|
+
}
|
505
|
+
return index.h("div", { class: "select-all-wrapper" }, index.h("div", { class: `option ${this.getSizeClass()}`, tabindex: '0', onKeyDown: (e) => handleSelectAllKeydown(e), onClick: toggleSelectAll }, index.h("ifx-checkbox", { tabIndex: -1, id: 'selectAll', checked: allSelected, indeterminate: indeterminate, size: "s" }), index.h("label", { htmlFor: 'selectAll' }, "Select all")), index.h("ifx-dropdown-separator", null));
|
506
|
+
}
|
507
|
+
render() {
|
508
|
+
// Create a label for the selected options
|
509
|
+
const selectedOptionsLabels = this.persistentSelectedOptions
|
510
|
+
.filter(option => {
|
511
|
+
// check if option is a child and its parent is selected
|
512
|
+
const isChildSelectedWithParent = this.persistentSelectedOptions.some(parentOption => parentOption.children &&
|
513
|
+
parentOption.children.some(child => child.value === option.value) &&
|
514
|
+
parentOption.selected);
|
515
|
+
return !isChildSelectedWithParent;
|
516
|
+
})
|
517
|
+
.map(option => option.label)
|
518
|
+
.join(', ');
|
519
|
+
return (index.h("div", { class: `ifx-multiselect-container`, ref: el => this.dropdownElement = el }, this.label ?
|
520
|
+
index.h("div", { class: "ifx-label-wrapper" }, index.h("span", null, this.label)) : null, index.h("div", { class: `ifx-multiselect-wrapper
|
521
|
+
${this.getSizeClass()}
|
522
|
+
${this.dropdownOpen ? 'active' : ''}
|
523
|
+
${this.dropdownFlipped ? 'is-flipped' : ''}
|
524
|
+
${this.internalError ? 'error' : ""}
|
525
|
+
${this.disabled ? 'disabled' : ""}`, tabindex: "0", onClick: this.disabled ? undefined : (event) => this.handleWrapperClick(event), onKeyDown: this.disabled ? undefined : (event) => this.handleKeyDown(event) }, index.h("div", { class: `ifx-multiselect-input
|
526
|
+
${this.persistentSelectedOptions.length === 0 ? 'placeholder' : ""}
|
527
|
+
`, onClick: this.disabled ? undefined : () => this.toggleDropdown() }, this.persistentSelectedOptions.length > 0 ? selectedOptionsLabels : this.placeholder), this.dropdownOpen && (index.h("div", { class: "ifx-multiselect-dropdown-menu", onScroll: (event) => this.handleScroll(event) }, this.showSearch && index.h("input", { type: "text", role: "textbox", class: "search-input", onKeyDown: (e) => { e.stopPropagation(); }, onInput: (event) => this.handleSearch(event.target), placeholder: "Search..." }), this.showSelectAll && this.renderSelectAll(), this.filteredOptions.map((option, index) => this.renderOption(option, index)), this.isLoading && index.h("div", null, "Loading more options..."))), index.h("div", { class: 'ifx-multiselect-icon-container' }, this.persistentSelectedOptions.length > 0 && (index.h("div", { class: `ifx-clear-button ${!this.showClearButton ? 'hide' : ''}`, onClick: this.disabled ? undefined : () => this.clearSelection() }, index.h("ifx-icon", { icon: "cRemove16" }))), index.h("div", { class: "icon-wrapper-up", onClick: this.disabled ? undefined : () => this.toggleDropdown() }, index.h("ifx-icon", { key: 'icon-up', icon: 'chevron-up-16' })), index.h("div", { class: "icon-wrapper-down", onClick: this.disabled ? undefined : () => this.toggleDropdown() }, index.h("ifx-icon", { key: 'icon-down', icon: 'chevron-down-16' })))), this.internalError ?
|
528
|
+
index.h("div", { class: "ifx-error-message-wrapper" }, index.h("span", null, this.internalErrorMessage)) : null));
|
529
|
+
}
|
530
|
+
static get formAssociated() { return true; }
|
531
|
+
get el() { return index.getElement(this); }
|
532
|
+
static get watchers() { return {
|
533
|
+
"options": ["updateOptions"],
|
534
|
+
"error": ["updateInternalError"],
|
535
|
+
"errorMessage": ["updateInternalErrorMessage"],
|
536
|
+
"loadedOptions": ["loadedOptionsChanged"],
|
537
|
+
"persistentSelectedOptions": ["onSelectionChange"]
|
538
|
+
}; }
|
539
|
+
};
|
540
|
+
Multiselect.globalZIndex = 1000; // This will be shared among all instances of the component.
|
541
|
+
Multiselect.style = IfxMultiselectStyle0;
|
542
|
+
|
543
|
+
exports.ifx_multiselect = Multiselect;
|
544
|
+
|
545
|
+
//# sourceMappingURL=ifx-multiselect.cjs.entry.js.map
|