@infineon/infineon-design-system-stencil 33.1.8--canary.1723.782f240d6f59721681f44ae3d27a5f9902c8342b.0 → 33.2.0--canary.1844.90617798b9fc364b9629af439debd40a9212780b.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/ifx-multiselect.cjs.entry.js +3 -2
- package/dist/cjs/ifx-multiselect.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-select.cjs.entry.js +4 -3
- package/dist/cjs/ifx-select.cjs.entry.js.map +1 -1
- package/dist/cjs/infineon-design-system-stencil.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/select/multi-select/multiselect.css +3 -0
- package/dist/collection/components/select/multi-select/multiselect.js +22 -1
- package/dist/collection/components/select/multi-select/multiselect.js.map +1 -1
- package/dist/collection/components/select/multi-select/multiselect.stories.js +13 -1
- package/dist/collection/components/select/multi-select/multiselect.stories.js.map +1 -1
- package/dist/collection/components/select/single-select/select.js +24 -3
- package/dist/collection/components/select/single-select/select.js.map +1 -1
- package/dist/collection/components/select/single-select/select.stories.js +12 -0
- package/dist/collection/components/select/single-select/select.stories.js.map +1 -1
- package/dist/components/ifx-multiselect.js +1 -1
- package/dist/components/ifx-pagination.js +1 -1
- package/dist/components/ifx-select.js +1 -1
- package/dist/components/ifx-set-filter.js +2 -2
- package/dist/components/ifx-table.js +2 -2
- package/dist/components/{p-3a8e83f3.js → p-0ccba8b1.js} +2 -2
- package/dist/components/{p-3a8e83f3.js.map → p-0ccba8b1.js.map} +1 -1
- package/dist/components/{p-3e92c1e4.js → p-1d737cf7.js} +6 -4
- package/dist/components/p-1d737cf7.js.map +1 -0
- package/dist/components/{p-babc4920.js → p-b4e91450.js} +5 -3
- package/dist/components/p-b4e91450.js.map +1 -0
- package/dist/esm/ifx-multiselect.entry.js +3 -2
- package/dist/esm/ifx-multiselect.entry.js.map +1 -1
- package/dist/esm/ifx-select.entry.js +4 -3
- package/dist/esm/ifx-select.entry.js.map +1 -1
- 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-0a69604b.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-0a69604b.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/{p-ae4f7c93.entry.js → p-63679298.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/p-63679298.entry.js.map +1 -0
- package/dist/types/components/select/multi-select/multiselect.d.ts +1 -0
- package/dist/types/components/select/multi-select/multiselect.stories.d.ts +11 -0
- package/dist/types/components/select/single-select/select.d.ts +1 -0
- package/dist/types/components/select/single-select/select.stories.d.ts +11 -0
- package/dist/types/components.d.ts +4 -0
- package/package.json +1 -1
- package/dist/components/p-3e92c1e4.js.map +0 -1
- package/dist/components/p-babc4920.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-ad00518e.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-ad00518e.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-ae4f7c93.entry.js.map +0 -1
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-c9480f70.js');
|
6
6
|
|
7
|
-
const multiselectCss = ":root{font-family:\"Source Sans 3\", sans-serif}.ifx-multiselect-container{position:relative;box-sizing:border-box;font-family:\"Source Sans 3\"}.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-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}";
|
7
|
+
const multiselectCss = ":root{font-family:\"Source Sans 3\", sans-serif}.ifx-multiselect-container{position:relative;box-sizing:border-box;font-family:\"Source Sans 3\"}.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
8
|
const IfxMultiselectStyle0 = multiselectCss;
|
9
9
|
|
10
10
|
// Debounce function
|
@@ -47,6 +47,7 @@ const Multiselect = class {
|
|
47
47
|
this.filteredOptions = [];
|
48
48
|
this.showSearch = true;
|
49
49
|
this.showSelectAll = true;
|
50
|
+
this.showClearButton = true;
|
50
51
|
this.optionCount = 0; // number of all options (leaves of the tree)
|
51
52
|
this.optionsProcessed = false; // flag whether options have already been counted, intial selections saved
|
52
53
|
this.handleSearch = debounce((targetElement) => {
|
@@ -523,7 +524,7 @@ const Multiselect = class {
|
|
523
524
|
${this.internalError ? 'error' : ""}
|
524
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
|
525
526
|
${this.persistentSelectedOptions.length === 0 ? 'placeholder' : ""}
|
526
|
-
`, 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:
|
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: 'chevronup-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 ?
|
527
528
|
index.h("div", { class: "ifx-error-message-wrapper" }, index.h("span", null, this.internalErrorMessage)) : null));
|
528
529
|
}
|
529
530
|
static get formAssociated() { return true; }
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"ifx-multiselect.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,cAAc,GAAG,g6IAAg6I,CAAC;AACx7I,6BAAe,cAAc;;ACE7B;AACA,SAAS,QAAQ,CAAC,IAAI,EAAE,IAAI;IAC1B,IAAI,OAAO,CAAC;IACZ,OAAO,SAAS,gBAAgB,CAAC,GAAG,IAAI;QACtC,MAAM,KAAK,GAAG;YACZ,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;SACf,CAAC;QACF,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;KACnC,CAAC;AACJ,CAAC;MAWY,WAAW;IATxB;;;;;;;;;;;QAaU,cAAS,GAAW,EAAE,CAAC;QACvB,SAAI,GAAW,eAAe,CAAC;QAC/B,aAAQ,GAAY,KAAK,CAAC;QAC1B,UAAK,GAAY,KAAK,CAAC;QACtB,kBAAa,GAAY,KAAK,CAAC;QAChC,iBAAY,GAAW,OAAO,CAAC;QAE/B,UAAK,GAAW,EAAE,CAAC;QACjB,8BAAyB,GAAa,EAAE,CAAC;QAC3C,gBAAW,GAAW,EAAE,CAAC;QACxB,iBAAY,GAAG,KAAK,CAAC;QAItB,iBAAY,GAAW,CAAC,CAAC;QAC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C,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAC,WAAW,GAAS,EAC1M,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,eAAe,EAAE,EAC5C,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,KAAK,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,EAC7E,IAAI,CAAC,SAAS,IAAIA,+CAAkC,CACjD,CACP,EACDA,iBAAK,KAAK,EAAC,gCAAgC,IAGxC,IAAI,CAAC,yBAAyB,CAAC,MAAM,GAAG,CAAC,KACxCA,iBAAK,KAAK,EAAC,kBAAkB,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,GAAG,SAAS,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,IAC5FA,sBAAU,IAAI,EAAC,WAAW,GAAY,CAClC,CACP,EACDA,iBAAK,KAAK,EAAC,iBAAiB,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,GAAG,SAAS,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,IAC3FA,sBACE,GAAG,EAAC,SAAS,EACb,IAAI,EAAC,cAAc,GAAY,CAC7B,EACNA,iBAAK,KAAK,EAAC,mBAAmB,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,GAAG,SAAS,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,IAC7FA,sBACE,GAAG,EAAC,WAAW,EACf,IAAI,EAAC,iBAAiB,GAAY,CAChC,CACF,CAEF,EAEJ,IAAI,CAAC,aAAa;YAChBA,iBAAK,KAAK,EAAC,2BAA2B,IACpCA,sBAAO,IAAI,CAAC,oBAAoB,CAAQ,CACpC,GAAG,IAAI,CAEb,EACN;KACH;;;;;;;;;;;AA9oBM,wBAAY,GAAG,IAAI,CAAC;;;;;","names":["index","h"],"sources":["src/components/select/multi-select/multiselect.scss?tag=ifx-multiselect&encapsulation=shadow","src/components/select/multi-select/multiselect.tsx"],"sourcesContent":["// @import '~choices.js/public/assets/styles/choices.css';\n@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../../global/font.scss\";\n\n.ifx-multiselect-container {\n position: relative;\n box-sizing: border-box;\n font-family: tokens.$ifxFontFamilyBody;\n\n &.small-select {\n height: 36px;\n }\n\n &.medium-select {\n height: 40px;\n }\n\n &:hover {\n cursor: pointer;\n }\n\n\n .ifx-label-wrapper {\n font-size: tokens.$ifxFontSizeM;\n line-height: tokens.$ifxLineHeightM;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow-wrap: anywhere;\n max-width: 100%;\n }\n\n .ifx-error-message-wrapper {\n color: #CD002F;\n font-size: tokens.$ifxFontSizeXs;\n line-height: tokens.$ifxLineHeightXs;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow-wrap: anywhere;\n max-width: 100%;\n }\n\n .ifx-multiselect-wrapper {\n background-color: tokens.$ifxColorBaseWhite;\n box-sizing: border-box;\n position: relative;\n display: flex;\n align-items: center;\n border: 1px solid tokens.$ifxColorEngineering400;\n border-radius: tokens.$ifxBorderRadius12;\n width: 100%;\n font-weight: 400;\n font-style: normal;\n\n\n &.small-select {\n height: 36px;\n padding: 8px 12px;\n font-size: tokens.$ifxFontSizeS;\n line-height: tokens.$ifxLineHeightS;\n }\n\n &.medium-select {\n height: 40px;\n padding: 8px 16px;\n font-size: tokens.$ifxFontSizeM;\n line-height: tokens.$ifxLineHeightM;\n }\n\n &:focus-visible {\n outline: none;\n }\n\n &:focus-visible:not(.active):not(:active) {\n outline: none;\n\n &::before {\n content: '';\n position: absolute;\n width: calc(100% + 4px);\n height: calc(100% + 4px);\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n border: 2px solid tokens.$ifxColorOcean500;\n border-radius: 2px;\n\n }\n }\n\n &.disabled {\n background: tokens.$ifxColorEngineering200;\n color: #575352;\n border-color: #575352;\n cursor: default;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n\n &.error {\n border-color: #CD002F;\n }\n\n &:hover:not(.focus, :focus) {\n border-color: tokens.$ifxColorEngineering500;\n }\n\n &.active {\n border-color: tokens.$ifxColorOcean500 !important; // Active border color\n\n & .icon-wrapper-up {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-left: tokens.$ifxSpace100;\n }\n\n & .icon-wrapper-down {\n display: none\n }\n }\n\n\n & .icon-wrapper-up {\n display: none;\n }\n\n & .icon-wrapper-down {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-left: tokens.$ifxSpace100;\n }\n\n &.is-flipped {\n .ifx-multiselect-dropdown-menu {\n top: auto;\n bottom: 100%;\n }\n }\n }\n\n .ifx-multiselect-input {\n flex-grow: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &.placeholder {\n opacity: 0.5;\n }\n\n }\n\n\n .ifx-multiselect-icon-container {\n margin-left: auto;\n align-items: center;\n display: flex;\n }\n\n\n .ifx-clear-button {\n display: flex;\n }\n\n .ifx-multiselect-dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n width: 100%;\n margin-top: 2px;\n background-color: #fff;\n box-shadow: 0px 6px 9px 0px rgba(29, 29, 29, 0.10);\n max-height: 300px;\n /* Adjust based on your design */\n overflow-y: auto;\n z-index: 1000; \n\n .search-input {\n position: sticky;\n top: 0;\n left: 0;\n z-index: 1;\n width: 100%;\n padding: 8px 16px;\n font-size: tokens.$ifxFontSizeM;\n line-height: tokens.$ifxLineHeightM;\n font-style: normal;\n font-weight: 400;\n box-sizing: border-box;\n background-color: tokens.$ifxColorBaseWhite;\n border: none;\n border-bottom: 1px solid tokens.$ifxColorEngineering400;\n\n &:focus {\n outline: none;\n border: 1px solid tokens.$ifxColorOcean500;\n }\n\n // Optional: Placeholder style\n &::placeholder {\n color: #999;\n }\n }\n }\n\n .option {\n position: relative;\n padding: 8px 16px;\n gap: 8px;\n align-items: center;\n display: flex;\n font-style: normal;\n font-weight: 400;\n\n &.small-select {\n font-size: tokens.$ifxFontSizeS;\n line-height: tokens.$ifxLineHeightS;\n }\n\n &.medium-select {\n font-size: tokens.$ifxFontSizeM;\n line-height: tokens.$ifxLineHeightM;\n }\n\n &:hover {\n background-color: tokens.$ifxColorEngineering200;\n }\n\n &:focus:not(.disabled) {\n background-color: tokens.$ifxColorEngineering300;\n outline: none;\n }\n\n &.is-highlighted {\n background-color: tokens.$ifxColorEngineering200;\n ;\n }\n\n &.selected {\n // color: #0A8276;\n }\n\n &.sub-option {\n padding-left: 30px;\n /* or however much indentation you want */\n }\n\n &.disabled {\n &:hover {\n cursor: default;\n }\n }\n\n label {\n cursor: inherit;\n }\n }\n\n\n\n}\n\n.select-all-wrapper {\n padding-top: 8px;\n}","import { Component, Prop, State, Event, EventEmitter, Element, h, Watch, AttachInternals } from '@stencil/core';\nimport { Option } from './interfaces';\n\n// Debounce function\nfunction debounce(func, wait) {\n let timeout;\n return function executedFunction(...args) {\n const later = () => {\n clearTimeout(timeout);\n func(...args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n };\n};\n\n@Component({\n tag: 'ifx-multiselect',\n styleUrl: 'multiselect.scss',\n shadow: true,\n formAssociated: true\n})\n\n\n\nexport class Multiselect {\n\n @Prop() name: string;\n @Prop() options: any[] | string;\n @Prop() batchSize: number = 50;\n @Prop() size: string = 'medium (40px)';\n @Prop() disabled: boolean = false;\n @Prop() error: boolean = false;\n @State() internalError: boolean = false;\n @Prop() errorMessage: string = \"Error\";\n @State() internalErrorMessage: string;\n @Prop() label: string = \"\";\n @State() persistentSelectedOptions: Option[] = [];\n @Prop() placeholder: string = \"\";\n @State() dropdownOpen = false;\n @State() dropdownFlipped: boolean;\n @Prop() maxItemCount: number;\n static globalZIndex = 1000; // This will be shared among all instances of the component.\n private currentIndex: number = 0; //needed for option selection using keyboard\n @State() isLoading: boolean = false;\n @State() loadedOptions: Option[] = [];\n @State() filteredOptions: Option[] = [];\n @Prop() showSearch: boolean = true;\n @Prop() showSelectAll: boolean = true;\n @State() optionCount: number = 0; // number of all options (leaves of the tree)\n @State() optionsProcessed: boolean = false; // flag whether options have already been counted, intial selections saved\n\n\n @Event() ifxSelect: EventEmitter;\n @Event() ifxOpen: EventEmitter;\n\n @Element() el: HTMLElement;\n dropdownElement!: HTMLElement;\n\n @AttachInternals() internals: ElementInternals;\n\n\n @Watch('options')\n updateOptions() { \n this.loadedOptions = [];\n this.filteredOptions = [];\n this.optionCount = 0;\n this.optionsProcessed = false;\n this.persistentSelectedOptions = [];\n\n this.loadInitialOptions();\n }\n\n\n async loadInitialOptions() {\n this.isLoading = true;\n this.internalError = this.error;\n this.internalErrorMessage = this.errorMessage;\n // Load the first batch of options (e.g., first 20)\n this.loadedOptions = await this.fetchOptions(0, this.batchSize);\n this.isLoading = false;\n }\n\n async fetchMoreOptions() {\n this.isLoading = true;\n const moreOptions = await this.fetchOptions(this.loadedOptions.length, this.batchSize);\n this.loadedOptions = [...this.loadedOptions, ...moreOptions];\n this.isLoading = false;\n }\n\n\n handleScroll(event: UIEvent) {\n const element = event.target as HTMLElement;\n const halfwayPoint = Math.floor((element.scrollHeight - element.clientHeight) / 2); //loading more options when the user has scrolled halfway through the current list\n\n if (element.scrollTop >= halfwayPoint) {\n this.fetchMoreOptions();\n }\n }\n\n\n\n\n async fetchOptions(startIndex: number, count: number): Promise<Option[]> {\n let allOptions: Option[] = [];\n\n // Parse options if it's a string, or use directly if it's an array\n if (typeof this.options === 'string') {\n try {\n allOptions = JSON.parse(this.options);\n \n } catch (err) {\n console.error('Failed to parse options:', err);\n }\n } else if (Array.isArray(this.options)) {\n allOptions = this.options;\n } else {\n console.error('Unexpected value for options:', this.options);\n }\n\n if (!this.optionsProcessed) {\n this.optionCount = this.countOptions(allOptions);\n const initiallySelected = this.collectSelectedOptions(allOptions);\n const initallySelectedNotInState = initiallySelected.filter(init => !this.persistentSelectedOptions.some(opt => opt.value == init.value));\n this.persistentSelectedOptions = [...this.persistentSelectedOptions, ...initallySelectedNotInState];\n this.optionsProcessed = true;\n }\n // Slice the options array based on startIndex and count\n const slicedOptions = allOptions.slice(startIndex, startIndex + count);\n return slicedOptions;\n }\n\n /**\n * Collects and returns all options that are selected.\n * When the parent is selected, then the value of the children will be overriden with selected as well.\n * It will only collect the leaves of the tree.\n * \n * @param options A list of options.\n * @returns A list with all selected options\n */\n private collectSelectedOptions(options: Option[]): Option[] {\n let selectedOptions: Option[] = [];\n \n for (const option of options) {\n if (option.selected) {\n if (option.children && option.children.length > 0) {\n // if parent is selected, then select all child options\n selectedOptions = selectedOptions.concat(this.collectLeafOptions(option.children));\n } else {\n if (!selectedOptions.some(existingOption => existingOption.value === option.value)) {\n selectedOptions.push(option);\n }\n }\n } else {\n if (option.children && option.children.length > 0) {\n selectedOptions = selectedOptions.concat(this.collectSelectedOptions(option.children));\n }\n }\n }\n\n return selectedOptions;\n }\n\n /**\n * Collects all leaf children options.\n * \n * @param option A list with all leaf-children.\n */\n private collectLeafOptions(children: Option[]): Option[] {\n let leafOptions = [];\n \n for (const child of children) {\n if (child.children && child.children.length > 0) {\n leafOptions = leafOptions.concat(this.collectLeafOptions(child.children));\n } else {\n leafOptions.push(child);\n }\n } \n return leafOptions;\n }\n\n /**\n * Count the number of options. Only counts the leaves of the options tree.\n */\n countOptions(options: Option[]): number {\n let count = 0;\n for (const option of options) {\n if (option.children && option.children.length >= 0) {\n count += this.countOptions(option.children);\n } else {\n count++;\n }\n }\n return count;\n }\n\n\n handleSearch = debounce((targetElement: HTMLInputElement) => {\n const searchTerm = targetElement.value.toLowerCase();\n if (searchTerm === '') {\n this.filteredOptions = this.loadedOptions;\n } else {\n this.filteredOptions = this.loadedOptions.filter(option => {\n const matchesSearchTerm = option.label.toLowerCase().includes(searchTerm);\n if (option.children) {\n const childrenMatch = option.children.some(child => {\n return child.label.toLowerCase().includes(searchTerm);\n });\n return matchesSearchTerm || childrenMatch;\n }\n return matchesSearchTerm;\n });\n }\n }, 300);\n\n componentDidLoad() {\n setTimeout(() => {\n this.positionDropdown();\n }, 500);\n\n // setInterval(this.handleScroll, 5000); // Runs every 5 seconds (5000 milliseconds)\n }\n\n componentWillLoad() {\n this.loadInitialOptions();\n this.filteredOptions = [...this.loadedOptions];\n }\n\n @Watch('error')\n updateInternalError() {\n this.internalError = this.error;\n }\n\n @Watch('errorMessage')\n updateInternalErrorMessage() {\n this.internalErrorMessage = this.errorMessage;\n }\n\n @Watch('loadedOptions')\n loadedOptionsChanged() {\n this.filteredOptions = [...this.loadedOptions];\n }\n\n @Watch('persistentSelectedOptions')\n onSelectionChange(newValue: Option[], _: Option[]) {\n const formData = new FormData();\n newValue.forEach(option => formData.append(this.name, option.value));\n this.internals.setFormValue(formData);\n }\n\n handleOptionClick(option: Option) {\n this.internalError = false;\n\n if (!option.selected && this.isSelectionLimitReached(option)) {\n option.checkboxRef.toggleCheckedState(false)\n this.internalError = true;\n this.internalErrorMessage = \"Please consider the maximum number of items to choose from\";\n return;\n }\n \n this.updateSelection(option);\n this.ifxSelect.emit(this.persistentSelectedOptions);\n }\n\n\n isSelectionLimitReached(option: Option): boolean {\n let newOptionsLength = option.children ? option.children.length : 1;\n return this.maxItemCount && this.persistentSelectedOptions.length + newOptionsLength > this.maxItemCount &&\n !this.persistentSelectedOptions.some(selectedOption => selectedOption.value === option.value)\n }\n\n updateSelection(option: Option) {\n const wasSelected = this.persistentSelectedOptions.some(selectedOption => selectedOption.value === option.value);\n\n if (option.children && option.children.length > 0) {\n this.handleParentOptionClick(option);\n } else {\n this.handleChildOptionClick(option, wasSelected);\n }\n }\n\n async selectAll() {\n const allOptions = await this.fetchOptions(0, this.optionCount);\n this.selectAllRecursive(allOptions);\n \n this.ifxSelect.emit(this.persistentSelectedOptions);\n }\n\n private selectAllRecursive(options: Option[]) {\n for (const opt of options) {\n if (opt.children && opt.children.length > 0) {\n this.selectAllRecursive(opt.children);\n } else {\n if (!this.persistentSelectedOptions.some((some) => some.value === opt.value )) {\n opt.selected = true;\n this.persistentSelectedOptions = [...this.persistentSelectedOptions, opt];\n this.optionCount = this.countOptions( this.persistentSelectedOptions)\n }\n }\n }\n\n }\n\n handleParentOptionClick(option: Option) {\n const allChildrenSelected = option.children.every(child =>\n this.persistentSelectedOptions.some(selectedOption => selectedOption.value === child.value)\n );\n\n if (allChildrenSelected) {\n this.persistentSelectedOptions = [...this.persistentSelectedOptions.filter(\n selectedOption => !option.children.some(child => child.value === selectedOption.value)\n )];\n\n option.selected = false;\n option.children.forEach(child => {\n child.selected = false;\n })\n\n } else {\n const newChildren = [...option.children.filter(childOption =>\n !this.persistentSelectedOptions.some(selectedOption => selectedOption.value === childOption.value)\n )];\n option.selected = true;\n option.children.forEach(child => {\n child.selected = true;\n })\n this.persistentSelectedOptions = [...this.persistentSelectedOptions, ...newChildren];\n }\n }\n\n handleChildOptionClick(option: Option, wasSelected: boolean) {\n if (wasSelected) {\n this.persistentSelectedOptions = [...this.persistentSelectedOptions.filter(selectedOption => selectedOption.value !== option.value)];\n option.selected = false;\n } else {\n this.persistentSelectedOptions = [...this.persistentSelectedOptions, option];\n option.selected = true;\n }\n this.updateParentSelectedState();\n }\n\n updateParentSelectedState() {\n this.loadedOptions.forEach(option => {\n if(option.children?.length > 0) {\n if(option.children.every(child => child.selected === true)) option.selected = true;\n else {\n option.selected = false;\n if(this.isOptionIndeterminate(option)) {\n option.indeterminate = true;\n }else{\n option.indeterminate = false;\n }\n }\n }\n });\n }\n\n\n\n handleDocumentClick = (event: Event) => {\n const path = event.composedPath();\n if (!path.includes(this.dropdownElement)) {\n this.dropdownOpen = false;\n document.removeEventListener('click', this.handleDocumentClick);\n this.filteredOptions = this.loadedOptions;\n // Dispatch the ifxMultiselectIsOpen event\n this.ifxOpen.emit(this.dropdownOpen);\n }\n }\n\n getSizeClass() {\n return `${this.size}` === \"s\"\n ? \"small-select\"\n : \"medium-select\";\n }\n\n toggleDropdown() {\n this.dropdownOpen = !this.dropdownOpen;\n setTimeout(() => {\n if (this.dropdownOpen) {\n document.addEventListener('click', this.handleDocumentClick);\n }\n // Dispatch the ifxOpen event\n this.ifxOpen.emit(this.dropdownOpen);\n }, 0);\n }\n\n\n waitForElement(querySelectorFunc: Function, callback: Function, maxTries = 50) {\n let tries = 0;\n function request() {\n requestAnimationFrame(() => {\n const elements = querySelectorFunc();\n if (elements.length > 0 || tries > maxTries) {\n callback(elements);\n } else {\n tries++;\n request();\n }\n });\n }\n request();\n }\n\n\n handleKeyDown(event: KeyboardEvent) {\n if (this.disabled) return; // If it's disabled, don't do anything.\n\n const options = this.dropdownElement.querySelectorAll('.option');\n \n switch (event.code) {\n case 'Enter':\n this.toggleDropdown();\n // Wait a bit for the dropdown to finish rendering\n this.waitForElement(() => {\n return this.dropdownElement.querySelectorAll('.option');\n }, (options) => {\n this.updateHighlightedOption(options);\n });\n break;\n case 'Space': \n this.toggleDropdown();\n // Wait a bit for the dropdown to finish rendering\n this.waitForElement(() => {\n return this.dropdownElement.querySelectorAll('.option');\n }, (options) => {\n this.updateHighlightedOption(options);\n });\n break;\n case 'ArrowDown':\n this.handleArrowDown(options);\n if (this.dropdownOpen) {\n this.updateHighlightedOption(options);\n }\n break;\n case 'ArrowUp':\n this.handleArrowUp(options);\n if (this.dropdownOpen) {\n this.updateHighlightedOption(options);\n }\n break;\n }\n }\n\n handleWrapperClick(event: MouseEvent) {\n // This is your existing logic for positioning the dropdown\n this.positionDropdown();\n\n // Check if the event target is the wrapper itself and not a child element.\n if (event.currentTarget === event.target) {\n this.toggleDropdown();\n }\n }\n\n clearSelection() {\n this.persistentSelectedOptions = [];\n this.ifxSelect.emit(this.persistentSelectedOptions); // if you want to emit empty selection after clearing\n }\n\n positionDropdown() {\n const wrapperRect = this.el.shadowRoot.querySelector('.ifx-multiselect-wrapper')?.getBoundingClientRect();\n const spaceBelow = window.innerHeight - wrapperRect.bottom;\n const spaceAbove = wrapperRect.top;\n\n // If there's more space above than below the trigger and the dropdown doesn't fit below\n if ((spaceAbove > spaceBelow && wrapperRect.height > spaceBelow) || (wrapperRect.bottom > window.innerHeight)) {\n this.dropdownFlipped = true;\n } else {\n this.dropdownFlipped = false;\n }\n }\n\n\n\n // Helper function to update highlighted option based on currentIndex\n private updateHighlightedOption(options: NodeList) {\n // Clear all highlights\n options.forEach((option: Element) => option.classList.remove('is-highlighted'));\n\n // Apply highlight to the current option\n if (this.currentIndex >= 0 && this.currentIndex < options.length) {\n (options[this.currentIndex] as Element).classList.add('is-highlighted');\n (options[this.currentIndex] as HTMLElement).focus();\n }\n }\n\n // Helper function to handle arrow down navigation\n private handleArrowDown(options: NodeList) {\n if (this.currentIndex < options.length - 1) {\n this.currentIndex++;\n } else {\n this.currentIndex = 0; // Wrap to the beginning.\n }\n }\n\n // Helper function to handle arrow up navigation\n private handleArrowUp(options: NodeList) {\n if (this.currentIndex > 0) {\n this.currentIndex--;\n } else {\n this.currentIndex = options.length - 1; // Wrap to the end.\n }\n }\n \n handleOptionKeyDown(e: KeyboardEvent, option: Option) {\n if(e.key !== 'ArrowUp' && e.key !== 'ArrowDown') e.stopPropagation();\n if(e.key === 'Enter' || e.key === ' ') {\n this.handleOptionClick(option);\n }\n }\n\n renderOption(option: Option, index: number) {\n const isIndeterminate = this.isOptionIndeterminate(option);\n const isSelected = option.children ? isIndeterminate || this.isOptionSelected(option) : this.persistentSelectedOptions.some(selectedOption => selectedOption.value === option.value);\n const disableCheckbox = !isSelected && this.maxItemCount && this.persistentSelectedOptions.length >= this.maxItemCount;\n const uniqueId = `checkbox-${option.value}-${index}`; // Generate a unique ID using the index\n \n return (\n <div class=\"option-wrapper\">\n <div class={`option ${isSelected ? 'selected' : ''} ${disableCheckbox ? 'disabled' : ''} \n ${this.getSizeClass()}`}\n data-value={option.value}\n onKeyDown={(e) => !disableCheckbox && this.handleOptionKeyDown(e, option)}\n onClick={() => !disableCheckbox && this.handleOptionClick(option)}\n tabindex=\"0\"\n role={`${option.children?.length > 0 ? \"treeitem\" : \"option\"}`}>\n <ifx-checkbox tabIndex={-1} ref={(el) => option.checkboxRef = el} id={uniqueId} size=\"s\" checked={isIndeterminate ? false : isSelected} indeterminate={isIndeterminate} disabled={disableCheckbox}></ifx-checkbox>\n <label htmlFor={uniqueId} onClick={(e) => e.stopPropagation()}>{option.label}</label>\n </div>\n {option.children && option.children.map((child, childIndex) => this.renderSubOption(child, `${index}-${childIndex}`))}\n </div>\n );\n }\n\n isOptionSelected(option: Option): boolean {\n if (!option.children) return false;\n\n return option.children.every(child =>\n this.persistentSelectedOptions.some(persistentOption => persistentOption.value === child.value)\n );\n }\n\n\n isOptionIndeterminate(option: Option): boolean {\n if (!option.children) return false;\n\n const selectedChildren = option.children.filter(child =>\n this.persistentSelectedOptions.some(persistentOption => persistentOption.value === child.value)\n ).length;\n\n return selectedChildren > 0 && selectedChildren < option.children.length;\n }\n\n\n findInOptions(options: Option[], searchTerm: string): Option | null {\n for (const option of options) {\n if (option.value === searchTerm) {\n return option;\n }\n if (option.children) {\n const foundInChildren = this.findInOptions(option.children, searchTerm);\n if (foundInChildren) {\n return foundInChildren;\n }\n }\n }\n return null;\n }\n\n\n renderSubOption(option: Option, index: string) {\n const isSelected = this.persistentSelectedOptions.some(selectedOption => selectedOption.value === option.value);\n const disableCheckbox = !isSelected && this.maxItemCount && this.persistentSelectedOptions.length >= this.maxItemCount;\n const uniqueId = `checkbox-${option.value}-${index}`;\n\n return (\n <div class={`option sub-option ${isSelected ? 'selected' : ''} ${this.getSizeClass()} ${disableCheckbox ? 'disabled' : ''}`}\n data-value={option.value}\n role={`${option.children?.length > 0 ? \"option\" : \"treeitem\"}`}\n onKeyDown={(e) => !disableCheckbox && this.handleOptionKeyDown(e, option)}\n onClick={() => !disableCheckbox && this.handleOptionClick(option)}\n tabindex=\"0\">\n <ifx-checkbox tabIndex={-1} ref={(el) => option.checkboxRef = el} id={uniqueId} size=\"s\" checked={isSelected} disabled={disableCheckbox}></ifx-checkbox>\n <label htmlFor={uniqueId} onClick={(e) => e.stopPropagation()}>{option.label}</label>\n </div>\n );\n }\n\n private renderSelectAll() {\n const allSelected = this.persistentSelectedOptions.length === this.optionCount;\n const noneSelected = this.persistentSelectedOptions.length === 0;\n const indeterminate = this.optionCount > 0 && !noneSelected && !allSelected;\n\n const that = this;\n function toggleSelectAll() {\n if (allSelected) {\n that.clearSelection();\n } else {\n that.selectAll();\n }\n }\n\n function handleSelectAllKeydown(e: KeyboardEvent) {\n if(e.key !== 'ArrowUp' && e.key !== 'ArrowDown') e.stopPropagation();\n if(e.key === 'Enter' || e.key === ' ') {\n toggleSelectAll();\n }\n }\n\n return <div class=\"select-all-wrapper\">\n <div class={`option ${this.getSizeClass()}`} tabindex='0' onKeyDown={(e) => handleSelectAllKeydown(e)} onClick={toggleSelectAll}>\n <ifx-checkbox tabIndex={-1} id='selectAll' checked={allSelected} indeterminate={indeterminate} size=\"s\"></ifx-checkbox>\n <label htmlFor='selectAll'>Select all</label>\n </div>\n <ifx-dropdown-separator></ifx-dropdown-separator>\n </div>;\n }\n\n\n render() {\n // Create a label for the selected options\n const selectedOptionsLabels = this.persistentSelectedOptions\n .filter(option => {\n // check if option is a child and its parent is selected\n const isChildSelectedWithParent = this.persistentSelectedOptions.some(parentOption =>\n parentOption.children &&\n parentOption.children.some(child => child.value === option.value) &&\n parentOption.selected\n );\n return !isChildSelectedWithParent;\n })\n .map(option => option.label)\n .join(', ');\n\n return (\n <div class={`ifx-multiselect-container`} ref={el => this.dropdownElement = el as HTMLElement}>\n {\n this.label ?\n <div class=\"ifx-label-wrapper\">\n <span>{this.label}</span>\n </div> : null\n }\n <div class={`ifx-multiselect-wrapper \n ${this.getSizeClass()} \n ${this.dropdownOpen ? 'active' : ''} \n ${this.dropdownFlipped ? 'is-flipped' : ''}\n ${this.internalError ? 'error' : \"\"}\n ${this.disabled ? 'disabled' : \"\"}`}\n tabindex=\"0\"\n onClick={this.disabled ? undefined : (event) => this.handleWrapperClick(event)}\n onKeyDown={this.disabled ? undefined : (event) => this.handleKeyDown(event)} >\n <div class={`ifx-multiselect-input \n ${this.persistentSelectedOptions.length === 0 ? 'placeholder' : \"\"}\n `}\n onClick={this.disabled ? undefined : () => this.toggleDropdown()}\n >\n {this.persistentSelectedOptions.length > 0 ? selectedOptionsLabels : this.placeholder}\n </div>\n {this.dropdownOpen && (\n <div class=\"ifx-multiselect-dropdown-menu\"\n onScroll={(event) => this.handleScroll(event)}>\n {this.showSearch && <input type=\"text\" role=\"textbox\" class=\"search-input\" onKeyDown={(e) => { e.stopPropagation() }} onInput={(event) => this.handleSearch(event.target)} placeholder=\"Search...\"></input>}\n {this.showSelectAll && this.renderSelectAll()}\n {this.filteredOptions.map((option, index) => this.renderOption(option, index))}\n {this.isLoading && <div>Loading more options...</div>}\n </div>\n )}\n <div class=\"ifx-multiselect-icon-container\">\n\n {/* Clear Button - will show only if there's a selection */}\n {this.persistentSelectedOptions.length > 0 && ( \n <div class=\"ifx-clear-button\" onClick={this.disabled ? undefined : () => this.clearSelection()}>\n <ifx-icon icon=\"cremove16\"></ifx-icon>\n </div>\n )}\n <div class=\"icon-wrapper-up\" onClick={this.disabled ? undefined : () => this.toggleDropdown()}>\n <ifx-icon\n key='icon-up'\n icon='chevronup-16'></ifx-icon>\n </div>\n <div class=\"icon-wrapper-down\" onClick={this.disabled ? undefined : () => this.toggleDropdown()}>\n <ifx-icon\n key='icon-down'\n icon='chevron-down-16'></ifx-icon>\n </div>\n </div>\n\n </div>\n {\n this.internalError ?\n <div class=\"ifx-error-message-wrapper\">\n <span>{this.internalErrorMessage}</span>\n </div> : null\n }\n </div>\n );\n }\n\n}\n"],"version":3}
|
1
|
+
{"file":"ifx-multiselect.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,cAAc,GAAG,+9IAA+9I,CAAC;AACv/I,6BAAe,cAAc;;ACE7B;AACA,SAAS,QAAQ,CAAC,IAAI,EAAE,IAAI;IAC1B,IAAI,OAAO,CAAC;IACZ,OAAO,SAAS,gBAAgB,CAAC,GAAG,IAAI;QACtC,MAAM,KAAK,GAAG;YACZ,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;SACf,CA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I,CAAC,cAAc,EAAE,IAC3FA,sBACE,GAAG,EAAC,SAAS,EACb,IAAI,EAAC,cAAc,GAAY,CAC7B,EACNA,iBAAK,KAAK,EAAC,mBAAmB,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,GAAG,SAAS,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,IAC7FA,sBACE,GAAG,EAAC,WAAW,EACf,IAAI,EAAC,iBAAiB,GAAY,CAChC,CACF,CAEF,EAEJ,IAAI,CAAC,aAAa;YAChBA,iBAAK,KAAK,EAAC,2BAA2B,IACpCA,sBAAO,IAAI,CAAC,oBAAoB,CAAQ,CACpC,GAAG,IAAI,CAEb,EACN;KACH;;;;;;;;;;;AA/oBM,wBAAY,GAAG,IAAI,CAAC;;;;;","names":["index","h"],"sources":["src/components/select/multi-select/multiselect.scss?tag=ifx-multiselect&encapsulation=shadow","src/components/select/multi-select/multiselect.tsx"],"sourcesContent":["// @import '~choices.js/public/assets/styles/choices.css';\n@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../../global/font.scss\";\n\n.ifx-multiselect-container {\n position: relative;\n box-sizing: border-box;\n font-family: tokens.$ifxFontFamilyBody;\n\n &.small-select {\n height: 36px;\n }\n\n &.medium-select {\n height: 40px;\n }\n\n &:hover {\n cursor: pointer;\n }\n\n\n .ifx-label-wrapper {\n font-size: tokens.$ifxFontSizeM;\n line-height: tokens.$ifxLineHeightM;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow-wrap: anywhere;\n max-width: 100%;\n }\n\n .ifx-error-message-wrapper {\n color: #CD002F;\n font-size: tokens.$ifxFontSizeXs;\n line-height: tokens.$ifxLineHeightXs;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow-wrap: anywhere;\n max-width: 100%;\n }\n\n .ifx-multiselect-wrapper {\n background-color: tokens.$ifxColorBaseWhite;\n box-sizing: border-box;\n position: relative;\n display: flex;\n align-items: center;\n border: 1px solid tokens.$ifxColorEngineering400;\n border-radius: tokens.$ifxBorderRadius12;\n width: 100%;\n font-weight: 400;\n font-style: normal;\n\n\n &.small-select {\n height: 36px;\n padding: 8px 12px;\n font-size: tokens.$ifxFontSizeS;\n line-height: tokens.$ifxLineHeightS;\n }\n\n &.medium-select {\n height: 40px;\n padding: 8px 16px;\n font-size: tokens.$ifxFontSizeM;\n line-height: tokens.$ifxLineHeightM;\n }\n\n &:focus-visible {\n outline: none;\n }\n\n &:focus-visible:not(.active):not(:active) {\n outline: none;\n\n &::before {\n content: '';\n position: absolute;\n width: calc(100% + 4px);\n height: calc(100% + 4px);\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n border: 2px solid tokens.$ifxColorOcean500;\n border-radius: 2px;\n\n }\n }\n\n &.disabled {\n background: tokens.$ifxColorEngineering200;\n color: #575352;\n border-color: #575352;\n cursor: default;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n\n &.error {\n border-color: #CD002F;\n }\n\n &:hover:not(.focus, :focus) {\n border-color: tokens.$ifxColorEngineering500;\n }\n\n &.active {\n border-color: tokens.$ifxColorOcean500 !important; // Active border color\n\n & .icon-wrapper-up {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-left: tokens.$ifxSpace100;\n }\n\n & .icon-wrapper-down {\n display: none\n }\n }\n\n\n & .icon-wrapper-up {\n display: none;\n }\n\n & .icon-wrapper-down {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-left: tokens.$ifxSpace100;\n }\n\n &.is-flipped {\n .ifx-multiselect-dropdown-menu {\n top: auto;\n bottom: 100%;\n }\n }\n }\n\n .ifx-multiselect-input {\n flex-grow: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &.placeholder {\n opacity: 0.5;\n }\n\n }\n\n\n .ifx-multiselect-icon-container {\n margin-left: auto;\n align-items: center;\n display: flex;\n }\n\n .ifx-clear-button {\n display: flex;\n &.hide { \n display: none;\n }\n }\n\n .ifx-multiselect-dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n width: 100%;\n margin-top: 2px;\n background-color: #fff;\n box-shadow: 0px 6px 9px 0px rgba(29, 29, 29, 0.10);\n max-height: 300px;\n /* Adjust based on your design */\n overflow-y: auto;\n z-index: 1000; \n\n .search-input {\n position: sticky;\n top: 0;\n left: 0;\n z-index: 1;\n width: 100%;\n padding: 8px 16px;\n font-size: tokens.$ifxFontSizeM;\n line-height: tokens.$ifxLineHeightM;\n font-style: normal;\n font-weight: 400;\n box-sizing: border-box;\n background-color: tokens.$ifxColorBaseWhite;\n border: none;\n border-bottom: 1px solid tokens.$ifxColorEngineering400;\n\n &:focus {\n outline: none;\n border: 1px solid tokens.$ifxColorOcean500;\n }\n\n // Optional: Placeholder style\n &::placeholder {\n color: #999;\n }\n }\n }\n\n .option {\n position: relative;\n padding: 8px 16px;\n gap: 8px;\n align-items: center;\n display: flex;\n font-style: normal;\n font-weight: 400;\n\n &.small-select {\n font-size: tokens.$ifxFontSizeS;\n line-height: tokens.$ifxLineHeightS;\n }\n\n &.medium-select {\n font-size: tokens.$ifxFontSizeM;\n line-height: tokens.$ifxLineHeightM;\n }\n\n &:hover {\n background-color: tokens.$ifxColorEngineering200;\n }\n\n &:focus:not(.disabled) {\n background-color: tokens.$ifxColorEngineering300;\n outline: none;\n }\n\n &.is-highlighted {\n background-color: tokens.$ifxColorEngineering200;\n ;\n }\n\n &.sub-option {\n padding-left: 30px;\n /* or however much indentation you want */\n }\n\n &.disabled {\n &:hover {\n cursor: default;\n }\n }\n\n label {\n cursor: inherit;\n }\n }\n\n\n\n}\n\n.select-all-wrapper {\n padding-top: 8px;\n}","import { Component, Prop, State, Event, EventEmitter, Element, h, Watch, AttachInternals } from '@stencil/core';\nimport { Option } from './interfaces';\n\n// Debounce function\nfunction debounce(func, wait) {\n let timeout;\n return function executedFunction(...args) {\n const later = () => {\n clearTimeout(timeout);\n func(...args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n };\n};\n\n@Component({\n tag: 'ifx-multiselect',\n styleUrl: 'multiselect.scss',\n shadow: true,\n formAssociated: true\n})\n\n\n\nexport class Multiselect {\n\n @Prop() name: string;\n @Prop() options: any[] | string;\n @Prop() batchSize: number = 50;\n @Prop() size: string = 'medium (40px)';\n @Prop() disabled: boolean = false;\n @Prop() error: boolean = false;\n @State() internalError: boolean = false;\n @Prop() errorMessage: string = \"Error\";\n @State() internalErrorMessage: string;\n @Prop() label: string = \"\";\n @State() persistentSelectedOptions: Option[] = [];\n @Prop() placeholder: string = \"\";\n @State() dropdownOpen = false;\n @State() dropdownFlipped: boolean;\n @Prop() maxItemCount: number;\n static globalZIndex = 1000; // This will be shared among all instances of the component.\n private currentIndex: number = 0; //needed for option selection using keyboard\n @State() isLoading: boolean = false;\n @State() loadedOptions: Option[] = [];\n @State() filteredOptions: Option[] = [];\n @Prop() showSearch: boolean = true;\n @Prop() showSelectAll: boolean = true;\n @Prop() showClearButton: boolean = true;\n @State() optionCount: number = 0; // number of all options (leaves of the tree)\n @State() optionsProcessed: boolean = false; // flag whether options have already been counted, intial selections saved\n\n\n @Event() ifxSelect: EventEmitter;\n @Event() ifxOpen: EventEmitter;\n\n @Element() el: HTMLElement;\n dropdownElement!: HTMLElement;\n\n @AttachInternals() internals: ElementInternals;\n\n\n @Watch('options')\n updateOptions() { \n this.loadedOptions = [];\n this.filteredOptions = [];\n this.optionCount = 0;\n this.optionsProcessed = false;\n this.persistentSelectedOptions = [];\n\n this.loadInitialOptions();\n }\n\n\n async loadInitialOptions() {\n this.isLoading = true;\n this.internalError = this.error;\n this.internalErrorMessage = this.errorMessage;\n // Load the first batch of options (e.g., first 20)\n this.loadedOptions = await this.fetchOptions(0, this.batchSize);\n this.isLoading = false;\n }\n\n async fetchMoreOptions() {\n this.isLoading = true;\n const moreOptions = await this.fetchOptions(this.loadedOptions.length, this.batchSize);\n this.loadedOptions = [...this.loadedOptions, ...moreOptions];\n this.isLoading = false;\n }\n\n\n handleScroll(event: UIEvent) {\n const element = event.target as HTMLElement;\n const halfwayPoint = Math.floor((element.scrollHeight - element.clientHeight) / 2); //loading more options when the user has scrolled halfway through the current list\n\n if (element.scrollTop >= halfwayPoint) {\n this.fetchMoreOptions();\n }\n }\n\n\n\n\n async fetchOptions(startIndex: number, count: number): Promise<Option[]> {\n let allOptions: Option[] = [];\n\n // Parse options if it's a string, or use directly if it's an array\n if (typeof this.options === 'string') {\n try {\n allOptions = JSON.parse(this.options);\n \n } catch (err) {\n console.error('Failed to parse options:', err);\n }\n } else if (Array.isArray(this.options)) {\n allOptions = this.options;\n } else {\n console.error('Unexpected value for options:', this.options);\n }\n\n if (!this.optionsProcessed) {\n this.optionCount = this.countOptions(allOptions);\n const initiallySelected = this.collectSelectedOptions(allOptions);\n const initallySelectedNotInState = initiallySelected.filter(init => !this.persistentSelectedOptions.some(opt => opt.value == init.value));\n this.persistentSelectedOptions = [...this.persistentSelectedOptions, ...initallySelectedNotInState];\n this.optionsProcessed = true;\n }\n // Slice the options array based on startIndex and count\n const slicedOptions = allOptions.slice(startIndex, startIndex + count);\n return slicedOptions;\n }\n\n /**\n * Collects and returns all options that are selected.\n * When the parent is selected, then the value of the children will be overriden with selected as well.\n * It will only collect the leaves of the tree.\n * \n * @param options A list of options.\n * @returns A list with all selected options\n */\n private collectSelectedOptions(options: Option[]): Option[] {\n let selectedOptions: Option[] = [];\n \n for (const option of options) {\n if (option.selected) {\n if (option.children && option.children.length > 0) {\n // if parent is selected, then select all child options\n selectedOptions = selectedOptions.concat(this.collectLeafOptions(option.children));\n } else {\n if (!selectedOptions.some(existingOption => existingOption.value === option.value)) {\n selectedOptions.push(option);\n }\n }\n } else {\n if (option.children && option.children.length > 0) {\n selectedOptions = selectedOptions.concat(this.collectSelectedOptions(option.children));\n }\n }\n }\n\n return selectedOptions;\n }\n\n /**\n * Collects all leaf children options.\n * \n * @param option A list with all leaf-children.\n */\n private collectLeafOptions(children: Option[]): Option[] {\n let leafOptions = [];\n \n for (const child of children) {\n if (child.children && child.children.length > 0) {\n leafOptions = leafOptions.concat(this.collectLeafOptions(child.children));\n } else {\n leafOptions.push(child);\n }\n } \n return leafOptions;\n }\n\n /**\n * Count the number of options. Only counts the leaves of the options tree.\n */\n countOptions(options: Option[]): number {\n let count = 0;\n for (const option of options) {\n if (option.children && option.children.length >= 0) {\n count += this.countOptions(option.children);\n } else {\n count++;\n }\n }\n return count;\n }\n\n\n handleSearch = debounce((targetElement: HTMLInputElement) => {\n const searchTerm = targetElement.value.toLowerCase();\n if (searchTerm === '') {\n this.filteredOptions = this.loadedOptions;\n } else {\n this.filteredOptions = this.loadedOptions.filter(option => {\n const matchesSearchTerm = option.label.toLowerCase().includes(searchTerm);\n if (option.children) {\n const childrenMatch = option.children.some(child => {\n return child.label.toLowerCase().includes(searchTerm);\n });\n return matchesSearchTerm || childrenMatch;\n }\n return matchesSearchTerm;\n });\n }\n }, 300);\n\n componentDidLoad() {\n setTimeout(() => {\n this.positionDropdown();\n }, 500);\n\n // setInterval(this.handleScroll, 5000); // Runs every 5 seconds (5000 milliseconds)\n }\n\n componentWillLoad() {\n this.loadInitialOptions();\n this.filteredOptions = [...this.loadedOptions];\n }\n\n @Watch('error')\n updateInternalError() {\n this.internalError = this.error;\n }\n\n @Watch('errorMessage')\n updateInternalErrorMessage() {\n this.internalErrorMessage = this.errorMessage;\n }\n\n @Watch('loadedOptions')\n loadedOptionsChanged() {\n this.filteredOptions = [...this.loadedOptions];\n }\n\n @Watch('persistentSelectedOptions')\n onSelectionChange(newValue: Option[], _: Option[]) {\n const formData = new FormData();\n newValue.forEach(option => formData.append(this.name, option.value));\n this.internals.setFormValue(formData);\n }\n\n handleOptionClick(option: Option) {\n this.internalError = false;\n\n if (!option.selected && this.isSelectionLimitReached(option)) {\n option.checkboxRef.toggleCheckedState(false)\n this.internalError = true;\n this.internalErrorMessage = \"Please consider the maximum number of items to choose from\";\n return;\n }\n \n this.updateSelection(option);\n this.ifxSelect.emit(this.persistentSelectedOptions);\n }\n\n\n isSelectionLimitReached(option: Option): boolean {\n let newOptionsLength = option.children ? option.children.length : 1;\n return this.maxItemCount && this.persistentSelectedOptions.length + newOptionsLength > this.maxItemCount &&\n !this.persistentSelectedOptions.some(selectedOption => selectedOption.value === option.value)\n }\n\n updateSelection(option: Option) {\n const wasSelected = this.persistentSelectedOptions.some(selectedOption => selectedOption.value === option.value);\n\n if (option.children && option.children.length > 0) {\n this.handleParentOptionClick(option);\n } else {\n this.handleChildOptionClick(option, wasSelected);\n }\n }\n\n async selectAll() {\n const allOptions = await this.fetchOptions(0, this.optionCount);\n this.selectAllRecursive(allOptions);\n \n this.ifxSelect.emit(this.persistentSelectedOptions);\n }\n\n private selectAllRecursive(options: Option[]) {\n for (const opt of options) {\n if (opt.children && opt.children.length > 0) {\n this.selectAllRecursive(opt.children);\n } else {\n if (!this.persistentSelectedOptions.some((some) => some.value === opt.value )) {\n opt.selected = true;\n this.persistentSelectedOptions = [...this.persistentSelectedOptions, opt];\n this.optionCount = this.countOptions( this.persistentSelectedOptions)\n }\n }\n }\n\n }\n\n handleParentOptionClick(option: Option) {\n const allChildrenSelected = option.children.every(child =>\n this.persistentSelectedOptions.some(selectedOption => selectedOption.value === child.value)\n );\n\n if (allChildrenSelected) {\n this.persistentSelectedOptions = [...this.persistentSelectedOptions.filter(\n selectedOption => !option.children.some(child => child.value === selectedOption.value)\n )];\n\n option.selected = false;\n option.children.forEach(child => {\n child.selected = false;\n })\n\n } else {\n const newChildren = [...option.children.filter(childOption =>\n !this.persistentSelectedOptions.some(selectedOption => selectedOption.value === childOption.value)\n )];\n option.selected = true;\n option.children.forEach(child => {\n child.selected = true;\n })\n this.persistentSelectedOptions = [...this.persistentSelectedOptions, ...newChildren];\n }\n }\n\n handleChildOptionClick(option: Option, wasSelected: boolean) {\n if (wasSelected) {\n this.persistentSelectedOptions = [...this.persistentSelectedOptions.filter(selectedOption => selectedOption.value !== option.value)];\n option.selected = false;\n } else {\n this.persistentSelectedOptions = [...this.persistentSelectedOptions, option];\n option.selected = true;\n }\n this.updateParentSelectedState();\n }\n\n updateParentSelectedState() {\n this.loadedOptions.forEach(option => {\n if(option.children?.length > 0) {\n if(option.children.every(child => child.selected === true)) option.selected = true;\n else {\n option.selected = false;\n if(this.isOptionIndeterminate(option)) {\n option.indeterminate = true;\n }else{\n option.indeterminate = false;\n }\n }\n }\n });\n }\n\n\n\n handleDocumentClick = (event: Event) => {\n const path = event.composedPath();\n if (!path.includes(this.dropdownElement)) {\n this.dropdownOpen = false;\n document.removeEventListener('click', this.handleDocumentClick);\n this.filteredOptions = this.loadedOptions;\n // Dispatch the ifxMultiselectIsOpen event\n this.ifxOpen.emit(this.dropdownOpen);\n }\n }\n\n getSizeClass() {\n return `${this.size}` === \"s\"\n ? \"small-select\"\n : \"medium-select\";\n }\n\n toggleDropdown() {\n this.dropdownOpen = !this.dropdownOpen;\n setTimeout(() => {\n if (this.dropdownOpen) {\n document.addEventListener('click', this.handleDocumentClick);\n }\n // Dispatch the ifxOpen event\n this.ifxOpen.emit(this.dropdownOpen);\n }, 0);\n }\n\n\n waitForElement(querySelectorFunc: Function, callback: Function, maxTries = 50) {\n let tries = 0;\n function request() {\n requestAnimationFrame(() => {\n const elements = querySelectorFunc();\n if (elements.length > 0 || tries > maxTries) {\n callback(elements);\n } else {\n tries++;\n request();\n }\n });\n }\n request();\n }\n\n\n handleKeyDown(event: KeyboardEvent) {\n if (this.disabled) return; // If it's disabled, don't do anything.\n\n const options = this.dropdownElement.querySelectorAll('.option');\n \n switch (event.code) {\n case 'Enter':\n this.toggleDropdown();\n // Wait a bit for the dropdown to finish rendering\n this.waitForElement(() => {\n return this.dropdownElement.querySelectorAll('.option');\n }, (options) => {\n this.updateHighlightedOption(options);\n });\n break;\n case 'Space': \n this.toggleDropdown();\n // Wait a bit for the dropdown to finish rendering\n this.waitForElement(() => {\n return this.dropdownElement.querySelectorAll('.option');\n }, (options) => {\n this.updateHighlightedOption(options);\n });\n break;\n case 'ArrowDown':\n this.handleArrowDown(options);\n if (this.dropdownOpen) {\n this.updateHighlightedOption(options);\n }\n break;\n case 'ArrowUp':\n this.handleArrowUp(options);\n if (this.dropdownOpen) {\n this.updateHighlightedOption(options);\n }\n break;\n }\n }\n\n handleWrapperClick(event: MouseEvent) {\n // This is your existing logic for positioning the dropdown\n this.positionDropdown();\n\n // Check if the event target is the wrapper itself and not a child element.\n if (event.currentTarget === event.target) {\n this.toggleDropdown();\n }\n }\n\n clearSelection() {\n this.persistentSelectedOptions = [];\n this.ifxSelect.emit(this.persistentSelectedOptions); // if you want to emit empty selection after clearing\n }\n\n positionDropdown() {\n const wrapperRect = this.el.shadowRoot.querySelector('.ifx-multiselect-wrapper')?.getBoundingClientRect();\n const spaceBelow = window.innerHeight - wrapperRect.bottom;\n const spaceAbove = wrapperRect.top;\n\n // If there's more space above than below the trigger and the dropdown doesn't fit below\n if ((spaceAbove > spaceBelow && wrapperRect.height > spaceBelow) || (wrapperRect.bottom > window.innerHeight)) {\n this.dropdownFlipped = true;\n } else {\n this.dropdownFlipped = false;\n }\n }\n\n\n\n // Helper function to update highlighted option based on currentIndex\n private updateHighlightedOption(options: NodeList) {\n // Clear all highlights\n options.forEach((option: Element) => option.classList.remove('is-highlighted'));\n\n // Apply highlight to the current option\n if (this.currentIndex >= 0 && this.currentIndex < options.length) {\n (options[this.currentIndex] as Element).classList.add('is-highlighted');\n (options[this.currentIndex] as HTMLElement).focus();\n }\n }\n\n // Helper function to handle arrow down navigation\n private handleArrowDown(options: NodeList) {\n if (this.currentIndex < options.length - 1) {\n this.currentIndex++;\n } else {\n this.currentIndex = 0; // Wrap to the beginning.\n }\n }\n\n // Helper function to handle arrow up navigation\n private handleArrowUp(options: NodeList) {\n if (this.currentIndex > 0) {\n this.currentIndex--;\n } else {\n this.currentIndex = options.length - 1; // Wrap to the end.\n }\n }\n \n handleOptionKeyDown(e: KeyboardEvent, option: Option) {\n if(e.key !== 'ArrowUp' && e.key !== 'ArrowDown') e.stopPropagation();\n if(e.key === 'Enter' || e.key === ' ') {\n this.handleOptionClick(option);\n }\n }\n\n renderOption(option: Option, index: number) {\n const isIndeterminate = this.isOptionIndeterminate(option);\n const isSelected = option.children ? isIndeterminate || this.isOptionSelected(option) : this.persistentSelectedOptions.some(selectedOption => selectedOption.value === option.value);\n const disableCheckbox = !isSelected && this.maxItemCount && this.persistentSelectedOptions.length >= this.maxItemCount;\n const uniqueId = `checkbox-${option.value}-${index}`; // Generate a unique ID using the index\n \n return (\n <div class=\"option-wrapper\">\n <div class={`option ${isSelected ? 'selected' : ''} ${disableCheckbox ? 'disabled' : ''} \n ${this.getSizeClass()}`}\n data-value={option.value}\n onKeyDown={(e) => !disableCheckbox && this.handleOptionKeyDown(e, option)}\n onClick={() => !disableCheckbox && this.handleOptionClick(option)}\n tabindex=\"0\"\n role={`${option.children?.length > 0 ? \"treeitem\" : \"option\"}`}>\n <ifx-checkbox tabIndex={-1} ref={(el) => option.checkboxRef = el} id={uniqueId} size=\"s\" checked={isIndeterminate ? false : isSelected} indeterminate={isIndeterminate} disabled={disableCheckbox}></ifx-checkbox>\n <label htmlFor={uniqueId} onClick={(e) => e.stopPropagation()}>{option.label}</label>\n </div>\n {option.children && option.children.map((child, childIndex) => this.renderSubOption(child, `${index}-${childIndex}`))}\n </div>\n );\n }\n\n isOptionSelected(option: Option): boolean {\n if (!option.children) return false;\n\n return option.children.every(child =>\n this.persistentSelectedOptions.some(persistentOption => persistentOption.value === child.value)\n );\n }\n\n\n isOptionIndeterminate(option: Option): boolean {\n if (!option.children) return false;\n\n const selectedChildren = option.children.filter(child =>\n this.persistentSelectedOptions.some(persistentOption => persistentOption.value === child.value)\n ).length;\n\n return selectedChildren > 0 && selectedChildren < option.children.length;\n }\n\n\n findInOptions(options: Option[], searchTerm: string): Option | null {\n for (const option of options) {\n if (option.value === searchTerm) {\n return option;\n }\n if (option.children) {\n const foundInChildren = this.findInOptions(option.children, searchTerm);\n if (foundInChildren) {\n return foundInChildren;\n }\n }\n }\n return null;\n }\n\n\n renderSubOption(option: Option, index: string) {\n const isSelected = this.persistentSelectedOptions.some(selectedOption => selectedOption.value === option.value);\n const disableCheckbox = !isSelected && this.maxItemCount && this.persistentSelectedOptions.length >= this.maxItemCount;\n const uniqueId = `checkbox-${option.value}-${index}`;\n\n return (\n <div class={`option sub-option ${isSelected ? 'selected' : ''} ${this.getSizeClass()} ${disableCheckbox ? 'disabled' : ''}`}\n data-value={option.value}\n role={`${option.children?.length > 0 ? \"option\" : \"treeitem\"}`}\n onKeyDown={(e) => !disableCheckbox && this.handleOptionKeyDown(e, option)}\n onClick={() => !disableCheckbox && this.handleOptionClick(option)}\n tabindex=\"0\">\n <ifx-checkbox tabIndex={-1} ref={(el) => option.checkboxRef = el} id={uniqueId} size=\"s\" checked={isSelected} disabled={disableCheckbox}></ifx-checkbox>\n <label htmlFor={uniqueId} onClick={(e) => e.stopPropagation()}>{option.label}</label>\n </div>\n );\n }\n\n private renderSelectAll() {\n const allSelected = this.persistentSelectedOptions.length === this.optionCount;\n const noneSelected = this.persistentSelectedOptions.length === 0;\n const indeterminate = this.optionCount > 0 && !noneSelected && !allSelected;\n\n const that = this;\n function toggleSelectAll() {\n if (allSelected) {\n that.clearSelection();\n } else {\n that.selectAll();\n }\n }\n\n function handleSelectAllKeydown(e: KeyboardEvent) {\n if(e.key !== 'ArrowUp' && e.key !== 'ArrowDown') e.stopPropagation();\n if(e.key === 'Enter' || e.key === ' ') {\n toggleSelectAll();\n }\n }\n\n return <div class=\"select-all-wrapper\">\n <div class={`option ${this.getSizeClass()}`} tabindex='0' onKeyDown={(e) => handleSelectAllKeydown(e)} onClick={toggleSelectAll}>\n <ifx-checkbox tabIndex={-1} id='selectAll' checked={allSelected} indeterminate={indeterminate} size=\"s\"></ifx-checkbox>\n <label htmlFor='selectAll'>Select all</label>\n </div>\n <ifx-dropdown-separator></ifx-dropdown-separator>\n </div>;\n }\n\n\n render() {\n // Create a label for the selected options\n const selectedOptionsLabels = this.persistentSelectedOptions\n .filter(option => {\n // check if option is a child and its parent is selected\n const isChildSelectedWithParent = this.persistentSelectedOptions.some(parentOption =>\n parentOption.children &&\n parentOption.children.some(child => child.value === option.value) &&\n parentOption.selected\n );\n return !isChildSelectedWithParent;\n })\n .map(option => option.label)\n .join(', ');\n\n return (\n <div class={`ifx-multiselect-container`} ref={el => this.dropdownElement = el as HTMLElement}>\n {\n this.label ?\n <div class=\"ifx-label-wrapper\">\n <span>{this.label}</span>\n </div> : null\n }\n <div class={`ifx-multiselect-wrapper \n ${this.getSizeClass()} \n ${this.dropdownOpen ? 'active' : ''} \n ${this.dropdownFlipped ? 'is-flipped' : ''}\n ${this.internalError ? 'error' : \"\"}\n ${this.disabled ? 'disabled' : \"\"}`}\n tabindex=\"0\"\n onClick={this.disabled ? undefined : (event) => this.handleWrapperClick(event)}\n onKeyDown={this.disabled ? undefined : (event) => this.handleKeyDown(event)} >\n <div class={`ifx-multiselect-input \n ${this.persistentSelectedOptions.length === 0 ? 'placeholder' : \"\"}\n `}\n onClick={this.disabled ? undefined : () => this.toggleDropdown()}\n >\n {this.persistentSelectedOptions.length > 0 ? selectedOptionsLabels : this.placeholder}\n </div>\n {this.dropdownOpen && (\n <div class=\"ifx-multiselect-dropdown-menu\"\n onScroll={(event) => this.handleScroll(event)}>\n {this.showSearch && <input type=\"text\" role=\"textbox\" class=\"search-input\" onKeyDown={(e) => { e.stopPropagation() }} onInput={(event) => this.handleSearch(event.target)} placeholder=\"Search...\"></input>}\n {this.showSelectAll && this.renderSelectAll()}\n {this.filteredOptions.map((option, index) => this.renderOption(option, index))}\n {this.isLoading && <div>Loading more options...</div>}\n </div>\n )}\n <div class='ifx-multiselect-icon-container'>\n\n {/* Clear Button - will show only if there's a selection */}\n {this.persistentSelectedOptions.length > 0 && ( \n <div class={`ifx-clear-button ${!this.showClearButton ? 'hide' : ''}`} onClick={this.disabled ? undefined : () => this.clearSelection()}>\n <ifx-icon icon=\"cremove16\"></ifx-icon>\n </div>\n )}\n <div class=\"icon-wrapper-up\" onClick={this.disabled ? undefined : () => this.toggleDropdown()}>\n <ifx-icon\n key='icon-up'\n icon='chevronup-16'></ifx-icon>\n </div>\n <div class=\"icon-wrapper-down\" onClick={this.disabled ? undefined : () => this.toggleDropdown()}>\n <ifx-icon\n key='icon-down'\n icon='chevron-down-16'></ifx-icon>\n </div>\n </div>\n\n </div>\n {\n this.internalError ?\n <div class=\"ifx-error-message-wrapper\">\n <span>{this.internalErrorMessage}</span>\n </div> : null\n }\n </div>\n );\n }\n\n}\n"],"version":3}
|
@@ -6851,6 +6851,7 @@ const Choices = class {
|
|
6851
6851
|
this.size = 'medium (40px)';
|
6852
6852
|
this.selectedOption = null;
|
6853
6853
|
this.optionIsSelected = false;
|
6854
|
+
this.showClearButton = true;
|
6854
6855
|
this.previousOptions = [];
|
6855
6856
|
}
|
6856
6857
|
watchDisabled(newValue) {
|
@@ -6974,7 +6975,7 @@ const Choices = class {
|
|
6974
6975
|
if (width <= 180) {
|
6975
6976
|
deleteIconWrapper.classList.add('hide');
|
6976
6977
|
}
|
6977
|
-
else {
|
6978
|
+
else if (this.showClearButton) {
|
6978
6979
|
deleteIconWrapper.classList.remove('hide');
|
6979
6980
|
}
|
6980
6981
|
}
|
@@ -7057,9 +7058,9 @@ const Choices = class {
|
|
7057
7058
|
// destroy choices element to restore previous dom structure
|
7058
7059
|
// so vdom can replace the element correctly
|
7059
7060
|
this.destroy();
|
7060
|
-
return (index.h("div", { key: '
|
7061
|
+
return (index.h("div", { key: 'a5ff225792f66dc57e40595a163e465739d85ee2', class: `ifx-select-container` }, this.label ? (index.h("div", { class: "ifx-label-wrapper" }, index.h("span", null, this.label))) : null, index.h("div", { key: 'fbd9661dbd4c6298b6107722ce0c630c35292c05', class: `${choicesWrapperClass}
|
7061
7062
|
${this.disabled ? 'disabled' : ''}
|
7062
|
-
${this.error ? 'error' : ''}`, onClick: this.disabled ? undefined : (e) => this.handleWrapperClick(e), onKeyDown: event => this.handleKeyDown(event) }, index.h("select", Object.assign({ key: '
|
7063
|
+
${this.error ? 'error' : ''}`, onClick: this.disabled ? undefined : (e) => this.handleWrapperClick(e), onKeyDown: event => this.handleKeyDown(event) }, index.h("select", Object.assign({ key: '7cf5a5c7deaa170d9a5a761901e9c5328d376285', class: 'single__select-input-field', disabled: this.disabled }, attributes, { "data-trigger": true, onChange: () => this.handleChange() }), this.createSelectOptions(this.options)), index.h("div", { key: 'fce1dfb5de7596657ad10c0e830ed6c058f409f3', class: 'single__select-icon-container' }, this.optionIsSelected && (index.h("div", { key: 'd9f5613d5366fb1db8935e41b9b78baf919e1c87', class: `ifx-choices__icon-wrapper-delete ${!this.showClearButton ? 'hide' : ''}` }, index.h("ifx-icon", { key: '87ad84ac1670bd59f85c20700aab1a81c5ef4532', icon: "cremove16", onClick: () => this.handleDeleteSelection() }))), index.h("div", { key: 'd5f0ac486df576de6a0f22b60c56a1db689174d5', class: "ifx-choices__icon-wrapper-up" }, index.h("ifx-icon", { key: "icon-up", icon: "chevronup-16" })), index.h("div", { key: '0e62a39fab954be07046e9cbb7f8c5bc304fb35e', class: "ifx-choices__icon-wrapper-down" }, index.h("ifx-icon", { key: "icon-down", icon: "chevron-down-16" })))), this.error ? (index.h("div", { class: "ifx-error-message-wrapper" }, index.h("span", null, this.errorMessage))) : null));
|
7063
7064
|
}
|
7064
7065
|
toggleDropdown() {
|
7065
7066
|
const div = this.root.querySelector('.ifx-choices__wrapper');
|