@infineon/infineon-design-system-stencil 36.0.0--canary.1926.86a1df11731565157908476035b4c6e79bff14ce.0 → 36.0.0--canary.1926.f081616d24f4027c378085d67f935a5b3da8a95e.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-accordion_2.cjs.entry.js +25 -25
- package/dist/cjs/ifx-accordion_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-basic-table.cjs.entry.js +4 -4
- package/dist/cjs/ifx-basic-table.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-multiselect_2.cjs.entry.js +1 -11
- package/dist/cjs/ifx-multiselect_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-step.cjs.entry.js +1 -1
- package/dist/cjs/ifx-step.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-table.cjs.entry.js +5 -5
- package/dist/cjs/ifx-table.cjs.entry.js.map +1 -1
- package/dist/collection/components/accordion/accordionItem.css +0 -4
- package/dist/collection/components/accordion/accordionItem.js +24 -24
- package/dist/collection/components/accordion/accordionItem.js.map +1 -1
- package/dist/collection/components/footer/footer.stories.js +4 -4
- package/dist/collection/components/footer/footer.stories.js.map +1 -1
- package/dist/collection/components/select/multi-select/multiselect.js +1 -11
- package/dist/collection/components/select/multi-select/multiselect.js.map +1 -1
- package/dist/collection/components/stepper/step/step.js +1 -1
- package/dist/collection/components/stepper/step/step.js.map +1 -1
- package/dist/collection/components/table-advanced-version/table.js +5 -5
- package/dist/collection/components/table-advanced-version/table.js.map +1 -1
- package/dist/collection/components/table-basic-version/table.js +4 -4
- package/dist/collection/components/table-basic-version/table.js.map +1 -1
- package/dist/components/ifx-accordion-item.js +1 -1
- package/dist/components/ifx-basic-table.js +4 -4
- package/dist/components/ifx-basic-table.js.map +1 -1
- package/dist/components/ifx-faq.js +1 -1
- package/dist/components/ifx-multiselect.js +1 -1
- package/dist/components/ifx-set-filter.js +1 -1
- package/dist/components/ifx-step.js +1 -1
- package/dist/components/ifx-step.js.map +1 -1
- package/dist/components/ifx-table.js +5 -5
- package/dist/components/ifx-table.js.map +1 -1
- package/dist/components/{p-1c80b52e.js → p-4eec7e6a.js} +2 -12
- package/dist/components/p-4eec7e6a.js.map +1 -0
- package/dist/components/p-5c96860f.js +119 -0
- package/dist/components/p-5c96860f.js.map +1 -0
- package/dist/esm/ifx-accordion_2.entry.js +25 -25
- package/dist/esm/ifx-accordion_2.entry.js.map +1 -1
- package/dist/esm/ifx-basic-table.entry.js +4 -4
- package/dist/esm/ifx-basic-table.entry.js.map +1 -1
- package/dist/esm/ifx-multiselect_2.entry.js +1 -11
- package/dist/esm/ifx-multiselect_2.entry.js.map +1 -1
- package/dist/esm/ifx-step.entry.js +1 -1
- package/dist/esm/ifx-step.entry.js.map +1 -1
- package/dist/esm/ifx-table.entry.js +5 -5
- package/dist/esm/ifx-table.entry.js.map +1 -1
- package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js +1 -1
- package/dist/infineon-design-system-stencil/p-0d3e5a0d.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-0d3e5a0d.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/{p-b7cb706f.entry.js → p-18a81f5f.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-b7cb706f.entry.js.map → p-18a81f5f.entry.js.map} +1 -1
- package/dist/infineon-design-system-stencil/{p-3349d2da.entry.js → p-28ca6f49.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/p-28ca6f49.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/{p-cf937da8.entry.js → p-4d9a4329.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/p-4d9a4329.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/{p-d7b49615.entry.js → p-ad7b58c3.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-d7b49615.entry.js.map → p-ad7b58c3.entry.js.map} +1 -1
- package/dist/types/components/accordion/accordionItem.d.ts +2 -1
- package/package.json +1 -1
- package/dist/components/p-1c80b52e.js.map +0 -1
- package/dist/components/p-4cf462ca.js +0 -119
- package/dist/components/p-4cf462ca.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-3349d2da.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-a356a82d.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-a356a82d.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-cf937da8.entry.js.map +0 -1
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as t,c as e,h as i,g as s,a as o}from"./p-b7a462e5.js";const n=':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: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;display:flex;align-items:center;border:1px solid #8D8786;border-radius:1px;width:100%;font-weight:400;font-style:normal;height:40px;line-height:24px;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;display:flex;align-items:center;gap:8px}.ifx-multiselect-container .ifx-multiselect-icon-container .ifx-multiselect-icon-container{display:flex}.ifx-multiselect-container .ifx-multiselect-icon-container .icon-wrapper{display:flex;align-items:center;transition:transform 0.2s ease-in-out}.ifx-multiselect-container .ifx-multiselect-icon-container .icon-wrapper--open{transform:rotate(180deg)}.ifx-multiselect-container .ifx-clear-button{display:flex;align-items:center}.ifx-multiselect-container .ifx-clear-button.hide{display:none}.ifx-multiselect-container .ifx-multiselect-dropdown-menu{box-sizing:border-box;position:absolute;top:100%;left:0;width:100%;margin-top:4px;border:1px solid #EEEDED;background-color:#fff;box-shadow:0px 6px 9px 0px rgba(29, 29, 29, 0.1);max-height:300px;z-index:1000;display:flex;flex-direction:column}.ifx-multiselect-dropdown-functions{padding:12px 16px;border-bottom:1px solid #EEEDED;flex-shrink:0}.ifx-multiselect-dropdown-search{margin-bottom:12px}.ifx-multiselect-dropdown-controls{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px}.ifx-multiselect-dropdown-controls .select-all-wrapper{display:flex}.ifx-multiselect-dropdown-controls .expand-collapse-controls{display:flex;gap:12px}.ifx-multiselect-dropdown-controls .control-item{font-size:0.875rem;line-height:1.25rem}.ifx-multiselect-dropdown-controls .control-item:focus{outline:none}.ifx-multiselect-dropdown-controls .control-item:focus-visible{outline:2px solid #0A8276;outline-offset:2px;border-radius:1px}.ifx-multiselect-options{flex:1;overflow-y:auto;padding-top:12px;padding-bottom:12px}.ifx-multiselect-options.show-no-results .ifx-multiselect-no-results{display:block}.ifx-multiselect-no-results{padding-left:16px;padding-right:16px;display:none}';const l=n;function r(t,e){let i;return function s(...o){const n=()=>{clearTimeout(i);t(...o)};clearTimeout(i);i=setTimeout(n,e)}}const a=class{constructor(i){t(this,i);this.ifxSelect=e(this,"ifxSelect",7);this.ifxOpen=e(this,"ifxOpen",7);if(i.$hostElement$["s-ei"]){this.internals=i.$hostElement$["s-ei"]}else{this.internals=i.$hostElement$.attachInternals();i.$hostElement$["s-ei"]=this.internals}this.disabled=false;this.error=false;this.errorMessage="Error";this.label="";this.placeholder="";this.showSearch=true;this.showSelectAll=true;this.showClearButton=true;this.showExpandCollapse=true;this.noResultsMessage="No results found.";this.showNoResultsMessage=true;this.searchPlaceholder="Search";this.selectAllLabel="Select all";this.expandLabel="Expand";this.collapseLabel="Collapse";this.ariaMultiSelectLabel="Multi-select dropdown";this.ariaMultiSelectLabelledBy="";this.ariaMultiSelectDescribedBy="";this.ariaSearchLabel="Search options";this.ariaClearLabel="Clear all selections";this.ariaToggleLabel="Toggle dropdown";this.ariaSelectAllLabel="Select all options";this.ariaExpandAllLabel="Expand all categories";this.ariaCollapseAllLabel="Collapse all categories";this.internalError=false;this.persistentSelectedOptions=[];this.dropdownOpen=false;this.searchTerm="";this.handleSearch=r((t=>{const e=t.value.toLowerCase();const i=e!=="";this.searchTerm=e;const s=this.el.shadowRoot.querySelector(".ifx-multiselect-wrapper");if(s){if(i){s.classList.remove("active")}else{const t=this.el.shadowRoot.querySelector("ifx-search-field");const e=t&&t.matches(":focus-within");if(!e){s.classList.add("active")}}}const o=this.el.shadowRoot.querySelector(".ifx-multiselect-options");if(o){if(i){o.classList.add("has-search-filter")}else{o.classList.remove("has-search-filter")}}requestAnimationFrame((()=>{const t=this.el.querySelectorAll("ifx-multiselect-option");t.forEach((t=>{const s=new CustomEvent("ifx-search-filter",{detail:{searchTerm:e,isActive:i}});t.dispatchEvent(s)}));if(i){setTimeout((()=>{const t=this.el.querySelectorAll("ifx-multiselect-option");let e=0;t.forEach((t=>{const i=window.getComputedStyle(t);const s=t.getBoundingClientRect();if(i.display!=="none"&&i.visibility!=="hidden"&&i.opacity!=="0"&&s.height>0){e++}}));const i=this.el.shadowRoot.querySelector(".ifx-multiselect-options");if(i){if(e===0){i.classList.add("show-no-results")}else{i.classList.remove("show-no-results")}}}),200)}else{const t=this.el.shadowRoot.querySelector(".ifx-multiselect-options");if(t){t.classList.remove("show-no-results")}}}))}),150);this.handleDocumentClick=t=>{const e=t.composedPath();if(!e.includes(this.dropdownElement)){this.dropdownOpen=false;document.removeEventListener("click",this.handleDocumentClick);this.resetSearch();this.ifxOpen.emit(this.dropdownOpen)}}}parseChildOptions(){const t=[];const e=Array.from(this.el.children);e.forEach(((e,i)=>{if(e.tagName==="IFX-MULTISELECT-OPTION"){const s=this.parseOptionElement(e,i);if(s){t.push(s)}}}));return t}parseOptionElement(t,e){const i=t.getAttribute("value")||`option-${e}`;const s=t.hasAttribute("selected");const o=t.hasAttribute("disabled");const n=t.hasAttribute("indeterminate");const l={value:i,selected:s,disabled:o,indeterminate:n};const r=Array.from(t.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION")).map(((t,e)=>this.parseOptionElement(t,e))).filter((t=>t!==null));if(r.length>0){l.children=r}return l}loadInitialOptions(){this.internalError=this.error;this.internalErrorMessage=this.errorMessage;const t=this.parseChildOptions();const e=this.collectSelectedOptions(t);const i=e.filter((t=>!this.persistentSelectedOptions.some((e=>e.value==t.value))));this.persistentSelectedOptions=[...this.persistentSelectedOptions,...i]}collectSelectedOptions(t){let e=[];for(const i of t){if(i.selected){if(i.children&&i.children.length>0){e=e.concat(this.collectLeafOptions(i.children))}else{if(!e.some((t=>t.value===i.value))){e.push(i)}}}else{if(i.children&&i.children.length>0){e=e.concat(this.collectSelectedOptions(i.children))}}}return e}collectLeafOptions(t){let e=[];for(const i of t){if(i.children&&i.children.length>0){e=e.concat(this.collectLeafOptions(i.children))}else{e.push(i)}}return e}handleSearchFocus(t){const e=this.el.shadowRoot.querySelector(".ifx-multiselect-wrapper");if(e){if(t||this.searchTerm!==""){e.classList.remove("active")}else{e.classList.add("active")}}}positionDropdown(){var t;const e=(t=this.el.shadowRoot.querySelector(".ifx-multiselect-wrapper"))===null||t===void 0?void 0:t.getBoundingClientRect();const i=window.innerHeight-e.bottom;const s=e.top;if(s>i&&e.height>i||e.bottom>window.innerHeight){this.dropdownFlipped=true}else{this.dropdownFlipped=false}}updateSlotBasedSelections(t=false){const e=this.el.querySelectorAll("ifx-multiselect-option");const i=[];e.forEach((t=>{const e=t["__stencil_instance"];if(e&&e.selected&&!e.hasChildren){i.push({value:e.value,selected:true,disabled:e.disabled})}}));this.persistentSelectedOptions=i;if(t){this.ifxSelect.emit(this.persistentSelectedOptions)}}updateInitialParentStates(){const t=this.el.querySelectorAll("ifx-multiselect-option");const e=Array.from(t).map((t=>({element:t,instance:t["__stencil_instance"],depth:parseInt(t.getAttribute("data-level")||"0")}))).filter((t=>t.instance)).sort(((t,e)=>e.depth-t.depth));e.forEach((({instance:t})=>{if(t.hasChildren){this.updateParentState(t)}}))}updateParentState(t){const e=Array.from(t.el.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION")).map((t=>t["__stencil_instance"])).filter((t=>t!==null));const i=e.filter((t=>t.selected)).length;const s=e.filter((t=>t.indeterminate)).length;const o=e.length;if(i===o&&s===0){t.selected=true;t.indeterminate=false}else if(i===0&&s===0){t.selected=false;t.indeterminate=false}else{t.selected=false;t.indeterminate=true}}componentDidLoad(){setTimeout((()=>{this.positionDropdown()}),500);this.el.addEventListener("ifx-option-changed",(()=>{requestAnimationFrame((()=>{this.updateSlotBasedSelections(true)}))}));setTimeout((()=>{this.updateSlotBasedSelections(false);this.updateInitialParentStates()}),100)}componentWillLoad(){this.loadInitialOptions()}updateInternalError(){this.internalError=this.error}updateInternalErrorMessage(){this.internalErrorMessage=this.errorMessage}onSelectionChange(t,e){const i=new FormData;t.forEach((t=>i.append(this.name,t.value)));this.internals.setFormValue(i)}collapseAll(){const t=this.el.querySelectorAll("ifx-multiselect-option");t.forEach((t=>{const e=t["__stencil_instance"];if(e&&e.hasChildren){e.isExpanded=false}}))}expandAll(){const t=this.el.querySelectorAll("ifx-multiselect-option");t.forEach((t=>{const e=t["__stencil_instance"];if(e&&e.hasChildren){e.isExpanded=true}}))}selectAll(){this.resetSearch();const t=this.el.querySelectorAll("ifx-multiselect-option");t.forEach((t=>{const e=t["__stencil_instance"];if(e){if(e.hasChildren){e.isExpanded=true}else{e.selected=true}}}));setTimeout((()=>{this.updateInitialParentStates();this.updateSlotBasedSelections(false);this.ifxSelect.emit(this.persistentSelectedOptions)}),0)}async clearSelection(){const t=this.el.querySelectorAll("ifx-multiselect-option");t.forEach((t=>{const e=t["__stencil_instance"];if(e){e.selected=false;e.indeterminate=false;if(e.hasChildren){e.isExpanded=false}}}));this.persistentSelectedOptions=[];setTimeout((()=>{this.updateSlotBasedSelections(false);this.ifxSelect.emit(this.persistentSelectedOptions)}),0)}toggleDropdown(){this.dropdownOpen=!this.dropdownOpen;setTimeout((()=>{if(this.dropdownOpen){document.addEventListener("click",this.handleDocumentClick)}else{this.resetSearch()}this.ifxOpen.emit(this.dropdownOpen)}),0)}resetSearch(){this.searchTerm="";const t=this.el.shadowRoot.querySelector("ifx-search-field");if(t){t.value=""}const e=this.el.shadowRoot.querySelector(".ifx-multiselect-options");if(e){e.classList.remove("has-search-filter")}const i=this.el.querySelectorAll("ifx-multiselect-option");i.forEach((t=>{const e=new CustomEvent("ifx-search-filter",{detail:{searchTerm:"",isActive:false}});t.dispatchEvent(e)}))}handleWrapperClick(t){this.positionDropdown();if(t.currentTarget===t.target){this.toggleDropdown()}}handleKeyDown(t){if(this.disabled)return;if(!this.dropdownOpen){switch(t.code){case"Enter":case"Space":case"ArrowDown":t.preventDefault();this.toggleDropdown();break}return}switch(t.code){case"Escape":t.preventDefault();this.toggleDropdown();break;case"Enter":case"Space":const e=t.target;if(!e.closest(".ifx-multiselect-dropdown-functions")){t.preventDefault();this.toggleDropdown()}break;case"ArrowDown":case"ArrowUp":t.preventDefault();this.focusFirstOption();break}}focusFirstOption(){var t;const e=this.el.querySelector("ifx-multiselect-option:not(.search-hidden)");if(e){const i=(t=e.shadowRoot)===null||t===void 0?void 0:t.querySelector(".option-label");i===null||i===void 0?void 0:i.focus()}}renderSelectAll(){const t=this.el.querySelectorAll("ifx-multiselect-option");const e=Array.from(t).filter((t=>!t.hasChildren));const s=Array.from(t).filter((t=>!t.hasChildren&&t.selected));const o=e.length>0&&s.length===e.length;const n=t=>{if(t){t.preventDefault();t.stopPropagation()}if(o){this.clearSelection()}else{this.selectAll()}};return i("div",{class:"select-all-wrapper"},i("ifx-checkbox",{id:"selectAll",checked:o,size:"s","aria-label":this.ariaSelectAllLabel,onClick:n,onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();t.stopPropagation();n(t)}}},this.selectAllLabel))}renderNoResultsMessage(){return i("div",{class:"ifx-multiselect-no-results"},i("div",{class:"no-results-content"},i("span",{class:"no-results-text"},this.noResultsMessage)))}render(){const t=this.persistentSelectedOptions.map((t=>{var e;const i=this.el.querySelector(`ifx-multiselect-option[value="${t.value}"]`);return((e=i===null||i===void 0?void 0:i.textContent)===null||e===void 0?void 0:e.trim())||t.value})).join(", ");const e=this.persistentSelectedOptions.length>0;let s=false;const o=this.el.querySelectorAll("ifx-multiselect-option");if(o.length>0){s=Array.from(o).every((t=>t.children.length===0))}return i("div",{class:`ifx-multiselect-container`,ref:t=>this.dropdownElement=t},this.label?i("div",{class:"ifx-label-wrapper"},i("span",null,this.label)):null,i("div",{class:`ifx-multiselect-wrapper\n ${this.dropdownOpen?"active":""}\n ${this.dropdownFlipped?"is-flipped":""}\n ${this.internalError?"error":""}\n ${this.disabled?"disabled":""}`,role:"combobox","aria-label":this.ariaMultiSelectLabel,"aria-labelledby":this.ariaMultiSelectLabelledBy||undefined,"aria-describedby":this.ariaMultiSelectDescribedBy||undefined,"aria-expanded":this.dropdownOpen,"aria-haspopup":"listbox","aria-disabled":this.disabled,tabindex:"0",onClick:this.disabled?undefined:t=>this.handleWrapperClick(t),onKeyDown:this.disabled?undefined:t=>this.handleKeyDown(t)},i("div",{class:`ifx-multiselect-input\n ${e?"":"placeholder"}\n `,onClick:this.disabled?undefined:()=>this.toggleDropdown()},e?t:this.placeholder),this.dropdownOpen&&i("div",{class:"ifx-multiselect-dropdown-menu"},(this.showSearch||this.showSelectAll||this.showExpandCollapse&&!s)&&i("div",{class:"ifx-multiselect-dropdown-functions",onClick:t=>t.stopPropagation()},this.showSearch&&i("div",{class:"ifx-multiselect-dropdown-search"},i("ifx-search-field",{class:"search-input",placeholder:this.searchPlaceholder,size:"s","show-delete-icon":"true","aria-label":this.ariaSearchLabel,onKeyDown:t=>{t.stopPropagation()},onIfxInput:t=>this.handleSearch(t.target),onFocus:()=>this.handleSearchFocus(true),onBlur:()=>this.handleSearchFocus(false)})),i("div",{class:"ifx-multiselect-dropdown-controls"},this.showSelectAll&&this.renderSelectAll(),this.showExpandCollapse&&!s&&i("div",{class:"expand-collapse-controls"},i("span",{class:"control-item",role:"button",tabIndex:0,"aria-label":this.ariaExpandAllLabel,onClick:t=>{t.stopPropagation();this.expandAll()},onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();t.stopPropagation();this.expandAll()}}},this.expandLabel),i("span",{class:"control-item",role:"button",tabIndex:0,"aria-label":this.ariaCollapseAllLabel,onClick:t=>{t.stopPropagation();this.collapseAll()},onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();t.stopPropagation();this.collapseAll()}}},this.collapseLabel)))),i("div",{class:"ifx-multiselect-options",role:"listbox","aria-multiselectable":"true"},i("slot",null),this.searchTerm&&this.showNoResultsMessage&&this.renderNoResultsMessage())),i("div",{class:"ifx-multiselect-icon-container"},e&&i("div",{class:`ifx-clear-button ${!this.showClearButton?"hide":""}`,"aria-label":this.ariaClearLabel,role:"button",tabIndex:0,onClick:this.disabled?undefined:t=>{t.stopPropagation();this.clearSelection()},onKeyDown:this.disabled?undefined:t=>{if(t.key==="Enter"||t.key===" "){t.stopPropagation();this.clearSelection()}}},i("ifx-icon",{icon:"c-remove-16",key:"clear-icon"})),i("div",{class:`icon-wrapper ${this.dropdownOpen?"icon-wrapper--open":"icon-wrapper--closed"}`,"aria-label":this.ariaToggleLabel,role:"button",tabIndex:0,onClick:this.disabled?undefined:t=>{t.stopPropagation();this.toggleDropdown()},onKeyDown:this.disabled?undefined:t=>{if(t.key==="Enter"||t.key===" "){t.stopPropagation();this.toggleDropdown()}}},i("ifx-icon",{icon:"chevron-down-16",key:"chevron-icon"})))),this.internalError?i("div",{class:"ifx-error-message-wrapper"},i("span",null,this.internalErrorMessage)):null)}static get formAssociated(){return true}get el(){return s(this)}static get watchers(){return{error:["updateInternalError"],errorMessage:["updateInternalErrorMessage"],persistentSelectedOptions:["onSelectionChange"]}}};a.style=l;const c=":host{display:block;width:100%}.option{display:flex;flex-direction:column;position:relative;cursor:pointer;list-style:none}.option.option--expanded{position:relative}.option.option--has-children{position:relative}.option.option--has-children .option-item>.chevron-wrapper{display:flex}.option--disabled{cursor:not-allowed;pointer-events:none;color:#BFBBBB}.option.search-hidden{display:none !important}.option.search-match .option-item .option-label .search-highlight{font-weight:bold}.option-item{display:flex;flex-direction:row;align-items:center;white-space:nowrap;min-height:20px;padding:4px 16px;background-color:#FFFFFF;transition:background-color 0.2s ease-in-out}.option-item:hover{background-color:#F7F7F7}.option--disabled .option-item:hover{background-color:transparent}.option-children{display:block}.chevron-wrapper{display:none;align-items:center;justify-content:center;margin-right:8px;width:20px;height:20px;flex-shrink:0}.chevron-wrapper:focus{outline:none}.chevron-wrapper:focus-visible{outline:2px solid #0A8276;outline-offset:2px;border-radius:1px}.option--has-children .chevron-wrapper{display:flex}.chevron-wrapper .chevron{transition:transform 0.2s ease-in-out;color:#3C3A39}.chevron-wrapper .chevron.chevron--expanded{transform:rotate(90deg)}.chevron-wrapper .chevron.chevron--collapsed{transform:rotate(0deg)}.checkbox-wrapper{display:flex;align-items:center;margin-right:8px;flex-shrink:0}.option-label{flex-grow:1;display:flex;align-items:center;cursor:pointer;padding:2px 0;font-size:0.875rem}.option-label:focus{outline:none}.option-label:focus-visible{outline:2px solid #0A8276;outline-offset:2px;border-radius:1px}.option--disabled .option-label{cursor:not-allowed;color:#BFBBBB}";const h=c;const f=class{constructor(e){t(this,e);this.selected=false;this.disabled=false;this.indeterminate=false;this.isExpanded=false;this.hasChildren=false;this.depth=0;this.searchTerm="";this.isSearchActive=false;this.isSearchDisabled=false;this.handleSearchFilter=t=>{const{searchTerm:e,isActive:i}=t.detail;this.searchTerm=e.toLowerCase();this.isSearchActive=i;requestAnimationFrame((()=>{this.updateSearchClasses()}))};this.handleCheckboxClick=t=>{if(this.disabled||this.isSearchActive&&this.isSearchDisabled)return;t.stopPropagation();let e;if(this.indeterminate){e=true}else{e=!this.selected}this.selected=e;this.indeterminate=false;if(this.hasChildren){this.isExpanded=e;requestAnimationFrame((()=>{this.selectAllChildren(e);this.expandAllChildren(e)}))}this.updateParentStates();this.notifyMultiselect()};this.handleHeaderClick=t=>{t.stopPropagation();if(!this.disabled&&!(this.isSearchActive&&this.isSearchDisabled)){this.handleClick(t)}}}componentWillLoad(){this.hasChildren=this.el.children.length>0;this.depth=this.calculateDepth();this.el.setAttribute("data-level",this.depth.toString());if(this.hasChildren){const t=this.hasAnySelectedChildren();if(t){this.isExpanded=true}}}componentDidLoad(){this.el["__stencil_instance"]=this;this.notifyMultiselect();this.el.addEventListener("ifx-search-filter",this.handleSearchFilter)}disconnectedCallback(){this.el.removeEventListener("ifx-search-filter",this.handleSearchFilter)}updateSearchClasses(){var t;const e=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector(".option");if(!e)return;if(!this.isSearchActive){e.classList.remove("search-hidden","search-parent","search-match");this.removeHighlighting();this.isSearchDisabled=false;return}const i=this.getTextContent().toLowerCase();const s=i.includes(this.searchTerm);const o=this.hasMatchingParent();requestAnimationFrame((()=>{const t=this.hasMatchingChildren();e.classList.remove("search-hidden","search-parent","search-match");this.isSearchDisabled=false;if(s&&!this.hasChildren){e.classList.add("search-match");this.highlightSearchTerm()}else if(s&&this.hasChildren){e.classList.add("search-match");this.highlightSearchTerm();this.isExpanded=true}else if(!s&&this.hasChildren&&t){e.classList.add("search-parent");this.removeHighlighting();this.isExpanded=true;this.isSearchDisabled=true}else if(o){e.classList.add("search-match");this.removeHighlighting()}else{e.classList.add("search-hidden");this.removeHighlighting()}}))}highlightSearchTerm(){var t;if(!this.searchTerm)return;const e=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector(".option-label");if(!e)return;const i=e.querySelector("slot");if(!i)return;this.removeHighlighting();const s=this.getTextContent();const o=this.searchTerm.toLowerCase();const n=s.toLowerCase();if(!n.includes(o))return;const l=n.indexOf(o);if(l===-1)return;const r=s.substring(0,l);const a=s.substring(l,l+o.length);const c=s.substring(l+o.length);const h=document.createElement("span");h.className="highlighted-text";if(r){h.appendChild(document.createTextNode(r))}const f=document.createElement("strong");f.className="search-highlight";f.textContent=a;h.appendChild(f);if(c){h.appendChild(document.createTextNode(c))}e.setAttribute("data-original-content","true");i.style.display="none";e.appendChild(h)}removeHighlighting(){var t;const e=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector(".option-label");if(!e)return;const i=e.querySelector("slot");const s=e.querySelector(".highlighted-text");if(s){e.removeChild(s)}if(i){i.style.display=""}e.removeAttribute("data-original-content")}getTextContent(){let t="";Array.from(this.el.childNodes).forEach((e=>{var i;if(e.nodeType===Node.TEXT_NODE){t+=((i=e.textContent)===null||i===void 0?void 0:i.trim())||""}}));return t||this.value||""}hasMatchingChildren(){if(!this.hasChildren)return false;const t=Array.from(this.el.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION"));return t.some((t=>{const e=t["__stencil_instance"];if(!e)return false;const i=e.getTextContent().toLowerCase();const s=i.includes(this.searchTerm);const o=e.hasMatchingChildren();return s||o}))}hasMatchingParent(){let t=this.el.parentElement;while(t&&t.tagName==="IFX-MULTISELECT-OPTION"){const e=t["__stencil_instance"];if(e){const t=e.getTextContent().toLowerCase();if(t.includes(this.searchTerm)){return true}}t=t.parentElement}return false}calculateDepth(){let t=0;let e=this.el.parentElement;while(e&&e.tagName!=="IFX-MULTISELECT"){if(e.tagName==="IFX-MULTISELECT-OPTION"){t++}e=e.parentElement}return t}handleClick(t){if(this.disabled||this.isSearchActive&&this.isSearchDisabled)return;t.stopPropagation();if(t.type==="click"&&t.target.closest(".chevron-wrapper")){this.toggleExpansion();return}let e;if(this.indeterminate){e=true}else{e=!this.selected}this.selected=e;this.indeterminate=false;if(this.hasChildren){this.isExpanded=e;requestAnimationFrame((()=>{this.selectAllChildren(e);this.expandAllChildren(e)}))}this.updateParentStates();this.notifyMultiselect()}handleKeyDown(t){if(this.disabled||this.isSearchActive&&this.isSearchDisabled)return;const e=t.target;if(e.closest(".chevron-wrapper")||e.closest(".checkbox-wrapper")){return}if(t.key!=="ArrowUp"&&t.key!=="ArrowDown"){t.stopPropagation()}if(t.key==="ArrowRight"&&this.hasChildren){this.isExpanded=true}if(t.key==="ArrowLeft"&&this.hasChildren){this.isExpanded=false}}notifyMultiselect(){const t=new CustomEvent("ifx-option-changed",{bubbles:true,detail:{value:this.value,selected:this.selected,indeterminate:this.indeterminate}});this.el.dispatchEvent(t)}selectAllChildren(t){const e=Array.from(this.el.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION"));e.forEach((e=>{var i;const s=e["__stencil_instance"];if(s){s.selected=t;s.indeterminate=false;if(s.hasChildren){s.isExpanded=t;s.selectAllChildren(t)}(i=s.notifyMultiselect)===null||i===void 0?void 0:i.call(s)}}))}expandAllChildren(t){const e=Array.from(this.el.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION"));e.forEach((e=>{const i=e["__stencil_instance"];if(i&&i.hasChildren){i.isExpanded=t;i.expandAllChildren(t)}}))}updateParentStates(){var t;let e=this.el.parentElement;while(e&&e.tagName==="IFX-MULTISELECT-OPTION"){const i=e["__stencil_instance"];if(!i){e=e.parentElement;continue}const s=Array.from(e.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION")).map((t=>t["__stencil_instance"])).filter((t=>t!==null));const o=s.filter((t=>t.selected)).length;const n=s.filter((t=>t.indeterminate)).length;const l=s.length;if(o===l&&n===0){i.selected=true;i.indeterminate=false}else if(o===0&&n===0){i.selected=false;i.indeterminate=false}else{i.selected=false;i.indeterminate=true}(t=i.notifyMultiselect)===null||t===void 0?void 0:t.call(i);e=e.parentElement}}toggleExpansion(){this.isExpanded=!this.isExpanded}hasAnySelectedChildren(){const t=Array.from(this.el.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION"));return t.some((t=>{const e=t.hasAttribute("selected");const i=this.checkForSelectedDescendants(t);return e||i}))}checkForSelectedDescendants(t){const e=Array.from(t.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION"));return e.some((t=>{const e=t.hasAttribute("selected");const i=this.checkForSelectedDescendants(t);return e||i}))}render(){let t=false;const e=this.el.closest("ifx-multiselect");if(e){const i=Array.from(e.querySelectorAll("ifx-multiselect-option"));t=i.every((t=>t.children.length===0))}const s=this.depth*28+16;const n=this.hasChildren?0:28;let l=s+n;const r=t?undefined:{paddingLeft:`${l}px`};return i(o,{key:"f836f58884e2e57c4c5fb4953f10d5ff4a34c8da"},i("div",{key:"9eca6e87bb3c21512a051596b1e92931b707e88f",class:{option:true,"option--has-children":this.hasChildren,"option--expanded":this.isExpanded,"option--disabled":this.disabled,"option--selected":this.selected},role:"option","aria-expanded":this.hasChildren?this.isExpanded?"true":"false":undefined,"aria-selected":this.selected?"true":"false","aria-disabled":this.disabled?"true":"false","data-level":this.depth,"data-value":this.value},i("div",{key:"41d24ef38470f5f7f8aa36daa33b339b7d8079f3",class:"option-item",style:r},i("div",{key:"27d33336e7d15ccce1703429b70494fe86808214",class:"chevron-wrapper",tabIndex:this.hasChildren?0:-1,role:this.hasChildren?"button":undefined,"aria-label":this.hasChildren?this.isExpanded?"Collapse":"Expand":undefined,onClick:t=>{t.stopPropagation();this.toggleExpansion()},onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();t.stopPropagation();this.toggleExpansion()}}},this.hasChildren&&i("ifx-icon",{key:"68e975b49b4aa9edf564b80644c5a55809185629",class:`chevron ${this.isExpanded?"chevron--expanded":"chevron--collapsed"}`,icon:"chevron-right-16"})),i("div",{key:"f651aefe4cc30db6056331ffaafd8e6ea17039fc",class:"checkbox-wrapper",onClick:t=>t.stopPropagation()},i("ifx-checkbox",{key:"e8cb2c7a75921a81e0321ff22718d9373cb6f437",size:"s",checked:this.isSearchActive&&this.isSearchDisabled?false:this.indeterminate?false:this.selected,indeterminate:this.isSearchActive&&this.isSearchDisabled?false:this.indeterminate,onClick:this.handleCheckboxClick,disabled:this.disabled||this.isSearchActive&&this.isSearchDisabled,onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();t.stopPropagation();this.handleCheckboxClick(t)}}})),i("div",{key:"4f626380753927d4bedca0f78643e6647eff6356",class:"option-label",onClick:this.handleHeaderClick,tabIndex:-1},i("slot",{key:"8207d9f952bff231fda0bf0be43e1c567aa6a6da"}))),this.isExpanded&&i("div",{key:"930d611f27451ff393d1403386bb6cd6b4a54980",class:"option-children"},i("slot",{key:"269eb6381257f82b74b888188646559e6881a9d9",name:"children"}))))}get el(){return s(this)}};f.style=h;export{a as ifx_multiselect,f as ifx_multiselect_option};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as t,c as e,h as i,g as s,a as o}from"./p-b7a462e5.js";const n=':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: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;display:flex;align-items:center;border:1px solid #8D8786;border-radius:1px;width:100%;font-weight:400;font-style:normal;height:40px;line-height:24px;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;display:flex;align-items:center;gap:8px}.ifx-multiselect-container .ifx-multiselect-icon-container .ifx-multiselect-icon-container{display:flex}.ifx-multiselect-container .ifx-multiselect-icon-container .icon-wrapper{display:flex;align-items:center;transition:transform 0.2s ease-in-out}.ifx-multiselect-container .ifx-multiselect-icon-container .icon-wrapper--open{transform:rotate(180deg)}.ifx-multiselect-container .ifx-clear-button{display:flex;align-items:center}.ifx-multiselect-container .ifx-clear-button.hide{display:none}.ifx-multiselect-container .ifx-multiselect-dropdown-menu{box-sizing:border-box;position:absolute;top:100%;left:0;width:100%;margin-top:4px;border:1px solid #EEEDED;background-color:#fff;box-shadow:0px 6px 9px 0px rgba(29, 29, 29, 0.1);max-height:300px;z-index:1000;display:flex;flex-direction:column}.ifx-multiselect-dropdown-functions{padding:12px 16px;border-bottom:1px solid #EEEDED;flex-shrink:0}.ifx-multiselect-dropdown-search{margin-bottom:12px}.ifx-multiselect-dropdown-controls{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px}.ifx-multiselect-dropdown-controls .select-all-wrapper{display:flex}.ifx-multiselect-dropdown-controls .expand-collapse-controls{display:flex;gap:12px}.ifx-multiselect-dropdown-controls .control-item{font-size:0.875rem;line-height:1.25rem}.ifx-multiselect-dropdown-controls .control-item:focus{outline:none}.ifx-multiselect-dropdown-controls .control-item:focus-visible{outline:2px solid #0A8276;outline-offset:2px;border-radius:1px}.ifx-multiselect-options{flex:1;overflow-y:auto;padding-top:12px;padding-bottom:12px}.ifx-multiselect-options.show-no-results .ifx-multiselect-no-results{display:block}.ifx-multiselect-no-results{padding-left:16px;padding-right:16px;display:none}';const l=n;function r(t,e){let i;return function s(...o){const n=()=>{clearTimeout(i);t(...o)};clearTimeout(i);i=setTimeout(n,e)}}const c=class{constructor(i){t(this,i);this.ifxSelect=e(this,"ifxSelect",7);this.ifxOpen=e(this,"ifxOpen",7);if(i.$hostElement$["s-ei"]){this.internals=i.$hostElement$["s-ei"]}else{this.internals=i.$hostElement$.attachInternals();i.$hostElement$["s-ei"]=this.internals}this.disabled=false;this.error=false;this.errorMessage="Error";this.label="";this.placeholder="";this.showSearch=true;this.showSelectAll=true;this.showClearButton=true;this.showExpandCollapse=true;this.noResultsMessage="No results found.";this.showNoResultsMessage=true;this.searchPlaceholder="Search";this.selectAllLabel="Select all";this.expandLabel="Expand";this.collapseLabel="Collapse";this.ariaMultiSelectLabel="Multi-select dropdown";this.ariaMultiSelectLabelledBy="";this.ariaMultiSelectDescribedBy="";this.ariaSearchLabel="Search options";this.ariaClearLabel="Clear all selections";this.ariaToggleLabel="Toggle dropdown";this.ariaSelectAllLabel="Select all options";this.ariaExpandAllLabel="Expand all categories";this.ariaCollapseAllLabel="Collapse all categories";this.internalError=false;this.persistentSelectedOptions=[];this.dropdownOpen=false;this.searchTerm="";this.handleSearch=r((t=>{const e=t.value.toLowerCase();const i=e!=="";this.searchTerm=e;const s=this.el.shadowRoot.querySelector(".ifx-multiselect-wrapper");if(s){if(i){s.classList.remove("active")}else{const t=this.el.shadowRoot.querySelector("ifx-search-field");const e=t&&t.matches(":focus-within");if(!e){s.classList.add("active")}}}const o=this.el.shadowRoot.querySelector(".ifx-multiselect-options");if(o){if(i){o.classList.add("has-search-filter")}else{o.classList.remove("has-search-filter")}}requestAnimationFrame((()=>{const t=this.el.querySelectorAll("ifx-multiselect-option");t.forEach((t=>{const s=new CustomEvent("ifx-search-filter",{detail:{searchTerm:e,isActive:i}});t.dispatchEvent(s)}));if(i){setTimeout((()=>{const t=this.el.querySelectorAll("ifx-multiselect-option");let e=0;t.forEach((t=>{const i=window.getComputedStyle(t);const s=t.getBoundingClientRect();if(i.display!=="none"&&i.visibility!=="hidden"&&i.opacity!=="0"&&s.height>0){e++}}));const i=this.el.shadowRoot.querySelector(".ifx-multiselect-options");if(i){if(e===0){i.classList.add("show-no-results")}else{i.classList.remove("show-no-results")}}}),200)}else{const t=this.el.shadowRoot.querySelector(".ifx-multiselect-options");if(t){t.classList.remove("show-no-results")}}}))}),150);this.handleDocumentClick=t=>{const e=t.composedPath();if(!e.includes(this.dropdownElement)){this.dropdownOpen=false;document.removeEventListener("click",this.handleDocumentClick);this.resetSearch();this.ifxOpen.emit(this.dropdownOpen)}}}parseChildOptions(){const t=[];const e=Array.from(this.el.children);e.forEach(((e,i)=>{if(e.tagName==="IFX-MULTISELECT-OPTION"){const s=this.parseOptionElement(e,i);if(s){t.push(s)}}}));return t}parseOptionElement(t,e){const i=t.getAttribute("value")||`option-${e}`;const s=t.hasAttribute("selected");const o=t.hasAttribute("disabled");const n=t.hasAttribute("indeterminate");const l={value:i,selected:s,disabled:o,indeterminate:n};const r=Array.from(t.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION")).map(((t,e)=>this.parseOptionElement(t,e))).filter((t=>t!==null));if(r.length>0){l.children=r}return l}loadInitialOptions(){this.internalError=this.error;this.internalErrorMessage=this.errorMessage;const t=this.parseChildOptions();const e=this.collectSelectedOptions(t);const i=e.filter((t=>!this.persistentSelectedOptions.some((e=>e.value==t.value))));this.persistentSelectedOptions=[...this.persistentSelectedOptions,...i]}collectSelectedOptions(t){let e=[];for(const i of t){if(i.selected){if(i.children&&i.children.length>0){e=e.concat(this.collectLeafOptions(i.children))}else{if(!e.some((t=>t.value===i.value))){e.push(i)}}}else{if(i.children&&i.children.length>0){e=e.concat(this.collectSelectedOptions(i.children))}}}return e}collectLeafOptions(t){let e=[];for(const i of t){if(i.children&&i.children.length>0){e=e.concat(this.collectLeafOptions(i.children))}else{e.push(i)}}return e}handleSearchFocus(t){const e=this.el.shadowRoot.querySelector(".ifx-multiselect-wrapper");if(e){if(t||this.searchTerm!==""){e.classList.remove("active")}else{e.classList.add("active")}}}positionDropdown(){var t;const e=(t=this.el.shadowRoot.querySelector(".ifx-multiselect-wrapper"))===null||t===void 0?void 0:t.getBoundingClientRect();const i=window.innerHeight-e.bottom;const s=e.top;if(s>i&&e.height>i||e.bottom>window.innerHeight){this.dropdownFlipped=true}else{this.dropdownFlipped=false}}updateSlotBasedSelections(t=false){const e=this.el.querySelectorAll("ifx-multiselect-option");const i=[];e.forEach((t=>{const e=t["__stencil_instance"];if(e&&e.selected&&!e.hasChildren){i.push({value:e.value,selected:true,disabled:e.disabled})}}));this.persistentSelectedOptions=i;if(t){this.ifxSelect.emit(this.persistentSelectedOptions)}}updateInitialParentStates(){const t=this.el.querySelectorAll("ifx-multiselect-option");const e=Array.from(t).map((t=>({element:t,instance:t["__stencil_instance"],depth:parseInt(t.getAttribute("data-level")||"0")}))).filter((t=>t.instance)).sort(((t,e)=>e.depth-t.depth));e.forEach((({instance:t})=>{if(t.hasChildren){this.updateParentState(t)}}))}updateParentState(t){const e=Array.from(t.el.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION")).map((t=>t["__stencil_instance"])).filter((t=>t!==null));const i=e.filter((t=>t.selected)).length;const s=e.filter((t=>t.indeterminate)).length;const o=e.length;if(i===o&&s===0){t.selected=true;t.indeterminate=false}else if(i===0&&s===0){t.selected=false;t.indeterminate=false}else{t.selected=false;t.indeterminate=true}}componentDidLoad(){setTimeout((()=>{this.positionDropdown()}),500);this.el.addEventListener("ifx-option-changed",(()=>{requestAnimationFrame((()=>{this.updateSlotBasedSelections(true)}))}));setTimeout((()=>{this.updateSlotBasedSelections(false);this.updateInitialParentStates()}),100)}componentWillLoad(){this.loadInitialOptions()}updateInternalError(){this.internalError=this.error}updateInternalErrorMessage(){this.internalErrorMessage=this.errorMessage}onSelectionChange(t,e){const i=new FormData;t.forEach((t=>i.append(this.name,t.value)));this.internals.setFormValue(i)}collapseAll(){const t=this.el.querySelectorAll("ifx-multiselect-option");t.forEach((t=>{const e=t["__stencil_instance"];if(e&&e.hasChildren){e.isExpanded=false}}))}expandAll(){const t=this.el.querySelectorAll("ifx-multiselect-option");t.forEach((t=>{const e=t["__stencil_instance"];if(e&&e.hasChildren){e.isExpanded=true}}))}selectAll(){this.resetSearch();const t=this.el.querySelectorAll("ifx-multiselect-option");t.forEach((t=>{const e=t["__stencil_instance"];if(e){if(e.hasChildren){e.isExpanded=true}else{e.selected=true}}}));setTimeout((()=>{this.updateInitialParentStates();this.updateSlotBasedSelections(false);this.ifxSelect.emit(this.persistentSelectedOptions)}),0)}async clearSelection(){const t=this.el.querySelectorAll("ifx-multiselect-option");t.forEach((t=>{const e=t["__stencil_instance"];if(e){e.selected=false;e.indeterminate=false;if(e.hasChildren){e.isExpanded=false}}}));this.persistentSelectedOptions=[];setTimeout((()=>{this.updateSlotBasedSelections(false);this.ifxSelect.emit(this.persistentSelectedOptions)}),0)}toggleDropdown(){this.dropdownOpen=!this.dropdownOpen;setTimeout((()=>{if(this.dropdownOpen){document.addEventListener("click",this.handleDocumentClick)}else{this.resetSearch()}this.ifxOpen.emit(this.dropdownOpen)}),0)}resetSearch(){this.searchTerm="";const t=this.el.shadowRoot.querySelector("ifx-search-field");if(t){t.value=""}const e=this.el.shadowRoot.querySelector(".ifx-multiselect-options");if(e){e.classList.remove("has-search-filter")}const i=this.el.querySelectorAll("ifx-multiselect-option");i.forEach((t=>{const e=new CustomEvent("ifx-search-filter",{detail:{searchTerm:"",isActive:false}});t.dispatchEvent(e)}))}handleWrapperClick(t){this.positionDropdown();if(t.currentTarget===t.target){this.toggleDropdown()}}handleKeyDown(t){if(this.disabled)return;if(!this.dropdownOpen){switch(t.code){case"Enter":case"Space":case"ArrowDown":t.preventDefault();this.toggleDropdown();break}return}switch(t.code){case"Escape":t.preventDefault();this.toggleDropdown();break;case"Enter":case"Space":const e=t.target;if(!e.closest(".ifx-multiselect-dropdown-functions")){t.preventDefault();this.toggleDropdown()}break;case"ArrowDown":case"ArrowUp":t.preventDefault();this.focusFirstOption();break}}focusFirstOption(){var t;const e=this.el.querySelector("ifx-multiselect-option:not(.search-hidden)");if(e){const i=(t=e.shadowRoot)===null||t===void 0?void 0:t.querySelector(".option-label");i===null||i===void 0?void 0:i.focus()}}renderSelectAll(){const t=this.el.querySelectorAll("ifx-multiselect-option");const e=Array.from(t).filter((t=>!t.hasChildren));const s=Array.from(t).filter((t=>!t.hasChildren&&t.selected));const o=e.length>0&&s.length===e.length;const n=t=>{if(t){t.preventDefault();t.stopPropagation()}if(o){this.clearSelection()}else{this.selectAll()}};return i("div",{class:"select-all-wrapper"},i("ifx-checkbox",{id:"selectAll",checked:o,size:"s","aria-label":this.ariaSelectAllLabel,onClick:n,onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();t.stopPropagation();n(t)}}},this.selectAllLabel))}renderNoResultsMessage(){return i("div",{class:"ifx-multiselect-no-results"},i("div",{class:"no-results-content"},i("span",{class:"no-results-text"},this.noResultsMessage)))}render(){const t=this.persistentSelectedOptions.map((t=>{var e;const i=this.el.querySelector(`ifx-multiselect-option[value="${t.value}"]`);return((e=i===null||i===void 0?void 0:i.textContent)===null||e===void 0?void 0:e.trim())||t.value})).join(", ");const e=this.persistentSelectedOptions.length>0;let s=false;const o=this.el.querySelectorAll("ifx-multiselect-option");if(o.length>0){s=Array.from(o).every((t=>t.children.length===0))}return i("div",{class:`ifx-multiselect-container`,ref:t=>this.dropdownElement=t},this.label?i("div",{class:"ifx-label-wrapper"},i("span",null,this.label)):null,i("div",{class:`ifx-multiselect-wrapper\n ${this.dropdownOpen?"active":""}\n ${this.dropdownFlipped?"is-flipped":""}\n ${this.internalError?"error":""}\n ${this.disabled?"disabled":""}`,role:"combobox","aria-label":this.ariaMultiSelectLabel,"aria-labelledby":this.ariaMultiSelectLabelledBy||undefined,"aria-describedby":this.ariaMultiSelectDescribedBy||undefined,"aria-expanded":this.dropdownOpen,"aria-haspopup":"listbox","aria-disabled":this.disabled,tabindex:"0",onClick:this.disabled?undefined:t=>this.handleWrapperClick(t),onKeyDown:this.disabled?undefined:t=>this.handleKeyDown(t)},i("div",{class:`ifx-multiselect-input\n ${e?"":"placeholder"}\n `,onClick:this.disabled?undefined:()=>this.toggleDropdown()},e?t:this.placeholder),this.dropdownOpen&&i("div",{class:"ifx-multiselect-dropdown-menu"},(this.showSearch||this.showSelectAll||this.showExpandCollapse&&!s)&&i("div",{class:"ifx-multiselect-dropdown-functions",onClick:t=>t.stopPropagation()},this.showSearch&&i("div",{class:"ifx-multiselect-dropdown-search"},i("ifx-search-field",{class:"search-input",placeholder:this.searchPlaceholder,size:"s","show-delete-icon":"true","aria-label":this.ariaSearchLabel,onKeyDown:t=>{t.stopPropagation()},onIfxInput:t=>this.handleSearch(t.target),onFocus:()=>this.handleSearchFocus(true),onBlur:()=>this.handleSearchFocus(false)})),i("div",{class:"ifx-multiselect-dropdown-controls"},this.showSelectAll&&this.renderSelectAll(),this.showExpandCollapse&&!s&&i("div",{class:"expand-collapse-controls"},i("span",{class:"control-item",role:"button",tabIndex:0,"aria-label":this.ariaExpandAllLabel,onClick:t=>{t.stopPropagation();this.expandAll()},onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();t.stopPropagation();this.expandAll()}}},this.expandLabel),i("span",{class:"control-item",role:"button",tabIndex:0,"aria-label":this.ariaCollapseAllLabel,onClick:t=>{t.stopPropagation();this.collapseAll()},onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();t.stopPropagation();this.collapseAll()}}},this.collapseLabel)))),i("div",{class:"ifx-multiselect-options",role:"listbox","aria-multiselectable":"true"},i("slot",null),this.searchTerm&&this.showNoResultsMessage&&this.renderNoResultsMessage())),i("div",{class:"ifx-multiselect-icon-container"},this.persistentSelectedOptions.length>0&&i("div",{class:`ifx-clear-button ${!this.showClearButton?"hide":""}`,onClick:this.disabled?undefined:()=>this.clearSelection()},i("ifx-icon",{icon:"cRemove16"})),i("div",{class:"icon-wrapper-up",onClick:this.disabled?undefined:()=>this.toggleDropdown()},i("ifx-icon",{key:"icon-up",icon:"chevron-up-16"})),i("div",{class:"icon-wrapper-down",onClick:this.disabled?undefined:()=>this.toggleDropdown()},i("ifx-icon",{key:"icon-down",icon:"chevron-down-16"})))),this.internalError?i("div",{class:"ifx-error-message-wrapper"},i("span",null,this.internalErrorMessage)):null)}static get formAssociated(){return true}get el(){return s(this)}static get watchers(){return{error:["updateInternalError"],errorMessage:["updateInternalErrorMessage"],persistentSelectedOptions:["onSelectionChange"]}}};c.style=l;const a=":host{display:block;width:100%}.option{display:flex;flex-direction:column;position:relative;cursor:pointer;list-style:none}.option.option--expanded{position:relative}.option.option--has-children{position:relative}.option.option--has-children .option-item>.chevron-wrapper{display:flex}.option--disabled{cursor:not-allowed;pointer-events:none;color:#BFBBBB}.option.search-hidden{display:none !important}.option.search-match .option-item .option-label .search-highlight{font-weight:bold}.option-item{display:flex;flex-direction:row;align-items:center;white-space:nowrap;min-height:20px;padding:4px 16px;background-color:#FFFFFF;transition:background-color 0.2s ease-in-out}.option-item:hover{background-color:#F7F7F7}.option--disabled .option-item:hover{background-color:transparent}.option-children{display:block}.chevron-wrapper{display:none;align-items:center;justify-content:center;margin-right:8px;width:20px;height:20px;flex-shrink:0}.chevron-wrapper:focus{outline:none}.chevron-wrapper:focus-visible{outline:2px solid #0A8276;outline-offset:2px;border-radius:1px}.option--has-children .chevron-wrapper{display:flex}.chevron-wrapper .chevron{transition:transform 0.2s ease-in-out;color:#3C3A39}.chevron-wrapper .chevron.chevron--expanded{transform:rotate(90deg)}.chevron-wrapper .chevron.chevron--collapsed{transform:rotate(0deg)}.checkbox-wrapper{display:flex;align-items:center;margin-right:8px;flex-shrink:0}.option-label{flex-grow:1;display:flex;align-items:center;cursor:pointer;padding:2px 0;font-size:0.875rem}.option-label:focus{outline:none}.option-label:focus-visible{outline:2px solid #0A8276;outline-offset:2px;border-radius:1px}.option--disabled .option-label{cursor:not-allowed;color:#BFBBBB}";const h=a;const f=class{constructor(e){t(this,e);this.selected=false;this.disabled=false;this.indeterminate=false;this.isExpanded=false;this.hasChildren=false;this.depth=0;this.searchTerm="";this.isSearchActive=false;this.isSearchDisabled=false;this.handleSearchFilter=t=>{const{searchTerm:e,isActive:i}=t.detail;this.searchTerm=e.toLowerCase();this.isSearchActive=i;requestAnimationFrame((()=>{this.updateSearchClasses()}))};this.handleCheckboxClick=t=>{if(this.disabled||this.isSearchActive&&this.isSearchDisabled)return;t.stopPropagation();let e;if(this.indeterminate){e=true}else{e=!this.selected}this.selected=e;this.indeterminate=false;if(this.hasChildren){this.isExpanded=e;requestAnimationFrame((()=>{this.selectAllChildren(e);this.expandAllChildren(e)}))}this.updateParentStates();this.notifyMultiselect()};this.handleHeaderClick=t=>{t.stopPropagation();if(!this.disabled&&!(this.isSearchActive&&this.isSearchDisabled)){this.handleClick(t)}}}componentWillLoad(){this.hasChildren=this.el.children.length>0;this.depth=this.calculateDepth();this.el.setAttribute("data-level",this.depth.toString());if(this.hasChildren){const t=this.hasAnySelectedChildren();if(t){this.isExpanded=true}}}componentDidLoad(){this.el["__stencil_instance"]=this;this.notifyMultiselect();this.el.addEventListener("ifx-search-filter",this.handleSearchFilter)}disconnectedCallback(){this.el.removeEventListener("ifx-search-filter",this.handleSearchFilter)}updateSearchClasses(){var t;const e=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector(".option");if(!e)return;if(!this.isSearchActive){e.classList.remove("search-hidden","search-parent","search-match");this.removeHighlighting();this.isSearchDisabled=false;return}const i=this.getTextContent().toLowerCase();const s=i.includes(this.searchTerm);const o=this.hasMatchingParent();requestAnimationFrame((()=>{const t=this.hasMatchingChildren();e.classList.remove("search-hidden","search-parent","search-match");this.isSearchDisabled=false;if(s&&!this.hasChildren){e.classList.add("search-match");this.highlightSearchTerm()}else if(s&&this.hasChildren){e.classList.add("search-match");this.highlightSearchTerm();this.isExpanded=true}else if(!s&&this.hasChildren&&t){e.classList.add("search-parent");this.removeHighlighting();this.isExpanded=true;this.isSearchDisabled=true}else if(o){e.classList.add("search-match");this.removeHighlighting()}else{e.classList.add("search-hidden");this.removeHighlighting()}}))}highlightSearchTerm(){var t;if(!this.searchTerm)return;const e=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector(".option-label");if(!e)return;const i=e.querySelector("slot");if(!i)return;this.removeHighlighting();const s=this.getTextContent();const o=this.searchTerm.toLowerCase();const n=s.toLowerCase();if(!n.includes(o))return;const l=n.indexOf(o);if(l===-1)return;const r=s.substring(0,l);const c=s.substring(l,l+o.length);const a=s.substring(l+o.length);const h=document.createElement("span");h.className="highlighted-text";if(r){h.appendChild(document.createTextNode(r))}const f=document.createElement("strong");f.className="search-highlight";f.textContent=c;h.appendChild(f);if(a){h.appendChild(document.createTextNode(a))}e.setAttribute("data-original-content","true");i.style.display="none";e.appendChild(h)}removeHighlighting(){var t;const e=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector(".option-label");if(!e)return;const i=e.querySelector("slot");const s=e.querySelector(".highlighted-text");if(s){e.removeChild(s)}if(i){i.style.display=""}e.removeAttribute("data-original-content")}getTextContent(){let t="";Array.from(this.el.childNodes).forEach((e=>{var i;if(e.nodeType===Node.TEXT_NODE){t+=((i=e.textContent)===null||i===void 0?void 0:i.trim())||""}}));return t||this.value||""}hasMatchingChildren(){if(!this.hasChildren)return false;const t=Array.from(this.el.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION"));return t.some((t=>{const e=t["__stencil_instance"];if(!e)return false;const i=e.getTextContent().toLowerCase();const s=i.includes(this.searchTerm);const o=e.hasMatchingChildren();return s||o}))}hasMatchingParent(){let t=this.el.parentElement;while(t&&t.tagName==="IFX-MULTISELECT-OPTION"){const e=t["__stencil_instance"];if(e){const t=e.getTextContent().toLowerCase();if(t.includes(this.searchTerm)){return true}}t=t.parentElement}return false}calculateDepth(){let t=0;let e=this.el.parentElement;while(e&&e.tagName!=="IFX-MULTISELECT"){if(e.tagName==="IFX-MULTISELECT-OPTION"){t++}e=e.parentElement}return t}handleClick(t){if(this.disabled||this.isSearchActive&&this.isSearchDisabled)return;t.stopPropagation();if(t.type==="click"&&t.target.closest(".chevron-wrapper")){this.toggleExpansion();return}let e;if(this.indeterminate){e=true}else{e=!this.selected}this.selected=e;this.indeterminate=false;if(this.hasChildren){this.isExpanded=e;requestAnimationFrame((()=>{this.selectAllChildren(e);this.expandAllChildren(e)}))}this.updateParentStates();this.notifyMultiselect()}handleKeyDown(t){if(this.disabled||this.isSearchActive&&this.isSearchDisabled)return;const e=t.target;if(e.closest(".chevron-wrapper")||e.closest(".checkbox-wrapper")){return}if(t.key!=="ArrowUp"&&t.key!=="ArrowDown"){t.stopPropagation()}if(t.key==="ArrowRight"&&this.hasChildren){this.isExpanded=true}if(t.key==="ArrowLeft"&&this.hasChildren){this.isExpanded=false}}notifyMultiselect(){const t=new CustomEvent("ifx-option-changed",{bubbles:true,detail:{value:this.value,selected:this.selected,indeterminate:this.indeterminate}});this.el.dispatchEvent(t)}selectAllChildren(t){const e=Array.from(this.el.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION"));e.forEach((e=>{var i;const s=e["__stencil_instance"];if(s){s.selected=t;s.indeterminate=false;if(s.hasChildren){s.isExpanded=t;s.selectAllChildren(t)}(i=s.notifyMultiselect)===null||i===void 0?void 0:i.call(s)}}))}expandAllChildren(t){const e=Array.from(this.el.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION"));e.forEach((e=>{const i=e["__stencil_instance"];if(i&&i.hasChildren){i.isExpanded=t;i.expandAllChildren(t)}}))}updateParentStates(){var t;let e=this.el.parentElement;while(e&&e.tagName==="IFX-MULTISELECT-OPTION"){const i=e["__stencil_instance"];if(!i){e=e.parentElement;continue}const s=Array.from(e.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION")).map((t=>t["__stencil_instance"])).filter((t=>t!==null));const o=s.filter((t=>t.selected)).length;const n=s.filter((t=>t.indeterminate)).length;const l=s.length;if(o===l&&n===0){i.selected=true;i.indeterminate=false}else if(o===0&&n===0){i.selected=false;i.indeterminate=false}else{i.selected=false;i.indeterminate=true}(t=i.notifyMultiselect)===null||t===void 0?void 0:t.call(i);e=e.parentElement}}toggleExpansion(){this.isExpanded=!this.isExpanded}hasAnySelectedChildren(){const t=Array.from(this.el.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION"));return t.some((t=>{const e=t.hasAttribute("selected");const i=this.checkForSelectedDescendants(t);return e||i}))}checkForSelectedDescendants(t){const e=Array.from(t.children).filter((t=>t.tagName==="IFX-MULTISELECT-OPTION"));return e.some((t=>{const e=t.hasAttribute("selected");const i=this.checkForSelectedDescendants(t);return e||i}))}render(){let t=false;const e=this.el.closest("ifx-multiselect");if(e){const i=Array.from(e.querySelectorAll("ifx-multiselect-option"));t=i.every((t=>t.children.length===0))}const s=this.depth*28+16;const n=this.hasChildren?0:28;let l=s+n;const r=t?undefined:{paddingLeft:`${l}px`};return i(o,{key:"f836f58884e2e57c4c5fb4953f10d5ff4a34c8da"},i("div",{key:"9eca6e87bb3c21512a051596b1e92931b707e88f",class:{option:true,"option--has-children":this.hasChildren,"option--expanded":this.isExpanded,"option--disabled":this.disabled,"option--selected":this.selected},role:"option","aria-expanded":this.hasChildren?this.isExpanded?"true":"false":undefined,"aria-selected":this.selected?"true":"false","aria-disabled":this.disabled?"true":"false","data-level":this.depth,"data-value":this.value},i("div",{key:"41d24ef38470f5f7f8aa36daa33b339b7d8079f3",class:"option-item",style:r},i("div",{key:"27d33336e7d15ccce1703429b70494fe86808214",class:"chevron-wrapper",tabIndex:this.hasChildren?0:-1,role:this.hasChildren?"button":undefined,"aria-label":this.hasChildren?this.isExpanded?"Collapse":"Expand":undefined,onClick:t=>{t.stopPropagation();this.toggleExpansion()},onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();t.stopPropagation();this.toggleExpansion()}}},this.hasChildren&&i("ifx-icon",{key:"68e975b49b4aa9edf564b80644c5a55809185629",class:`chevron ${this.isExpanded?"chevron--expanded":"chevron--collapsed"}`,icon:"chevron-right-16"})),i("div",{key:"f651aefe4cc30db6056331ffaafd8e6ea17039fc",class:"checkbox-wrapper",onClick:t=>t.stopPropagation()},i("ifx-checkbox",{key:"e8cb2c7a75921a81e0321ff22718d9373cb6f437",size:"s",checked:this.isSearchActive&&this.isSearchDisabled?false:this.indeterminate?false:this.selected,indeterminate:this.isSearchActive&&this.isSearchDisabled?false:this.indeterminate,onClick:this.handleCheckboxClick,disabled:this.disabled||this.isSearchActive&&this.isSearchDisabled,onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();t.stopPropagation();this.handleCheckboxClick(t)}}})),i("div",{key:"4f626380753927d4bedca0f78643e6647eff6356",class:"option-label",onClick:this.handleHeaderClick,tabIndex:-1},i("slot",{key:"8207d9f952bff231fda0bf0be43e1c567aa6a6da"}))),this.isExpanded&&i("div",{key:"930d611f27451ff393d1403386bb6cd6b4a54980",class:"option-children"},i("slot",{key:"269eb6381257f82b74b888188646559e6881a9d9",name:"children"}))))}get el(){return s(this)}};f.style=h;export{c as ifx_multiselect,f as ifx_multiselect_option};
|
2
|
+
//# sourceMappingURL=p-28ca6f49.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["multiselectCss","IfxMultiselectStyle0","debounce","func","wait","timeout","executedFunction","args","later","clearTimeout","setTimeout","Multiselect","constructor","hostRef","this","disabled","error","errorMessage","label","placeholder","showSearch","showSelectAll","showClearButton","showExpandCollapse","noResultsMessage","showNoResultsMessage","searchPlaceholder","selectAllLabel","expandLabel","collapseLabel","ariaMultiSelectLabel","ariaMultiSelectLabelledBy","ariaMultiSelectDescribedBy","ariaSearchLabel","ariaClearLabel","ariaToggleLabel","ariaSelectAllLabel","ariaExpandAllLabel","ariaCollapseAllLabel","internalError","persistentSelectedOptions","dropdownOpen","searchTerm","handleSearch","targetElement","value","toLowerCase","isSearchActive","wrapper","el","shadowRoot","querySelector","classList","remove","searchField","searchFieldHasFocus","matches","add","optionsContainer","requestAnimationFrame","allOptions","querySelectorAll","forEach","option","searchEvent","CustomEvent","detail","isActive","dispatchEvent","visibleCount","style","window","getComputedStyle","rect","getBoundingClientRect","display","visibility","opacity","height","handleDocumentClick","event","path","composedPath","includes","dropdownElement","document","removeEventListener","resetSearch","ifxOpen","emit","parseChildOptions","options","childElements","Array","from","children","child","index","tagName","parseOptionElement","push","element","getAttribute","selected","hasAttribute","indeterminate","nestedOptions","filter","map","childIndex","opt","length","loadInitialOptions","internalErrorMessage","initiallySelected","collectSelectedOptions","initiallySelectedNotInState","init","some","selectedOptions","concat","collectLeafOptions","existingOption","leafOptions","handleSearchFocus","hasFocus","positionDropdown","wrapperRect","_a","spaceBelow","innerHeight","bottom","spaceAbove","top","dropdownFlipped","updateSlotBasedSelections","emitEvent","allOptionElements","selectedLeafOptions","optionEl","instance","hasChildren","ifxSelect","updateInitialParentStates","optionsByDepth","depth","parseInt","item","sort","a","b","updateParentState","parentInstance","directChildren","selectedCount","indeterminateCount","totalCount","componentDidLoad","addEventListener","componentWillLoad","updateInternalError","updateInternalErrorMessage","onSelectionChange","newValue","_","formData","FormData","append","name","internals","setFormValue","collapseAll","isExpanded","expandAll","selectAll","clearSelection","toggleDropdown","handleWrapperClick","currentTarget","target","handleKeyDown","code","preventDefault","closest","focusFirstOption","firstOption","labelElement","focus","renderSelectAll","allSelected","toggleSelectAll","stopPropagation","h","class","id","checked","size","onClick","onKeyDown","e","key","renderNoResultsMessage","render","selectedOptionsLabels","optionElement","textContent","trim","join","hasSelections","isFlatMultiselect","every","ref","role","undefined","tabindex","onIfxInput","onFocus","onBlur","tabIndex","icon","multiselectOptionCss","IfxMultiselectOptionStyle0","MultiselectOption","isSearchDisabled","handleSearchFilter","updateSearchClasses","handleCheckboxClick","newSelectedState","selectAllChildren","expandAllChildren","updateParentStates","notifyMultiselect","handleHeaderClick","handleClick","calculateDepth","setAttribute","toString","hasSelectedChildren","hasAnySelectedChildren","disconnectedCallback","optionDiv","removeHighlighting","getTextContent","matchesSearch","hasMatchingParent","hasMatchingChildren","highlightSearchTerm","slotElement","originalText","searchTermLower","originalTextLower","searchIndex","indexOf","beforeMatch","substring","matchText","afterMatch","highlightedContent","createElement","className","appendChild","createTextNode","boldElement","highlightedElement","removeChild","removeAttribute","text","childNodes","node","nodeType","Node","TEXT_NODE","childOptions","childInstance","childText","childMatches","grandChildrenMatch","parent","parentElement","parentText","type","toggleExpansion","updateEvent","bubbles","call","expanded","siblings","sibling","hasSelected","hasSelectedDescendants","checkForSelectedDescendants","nestedChild","isSelected","hasSelectedNested","parentMultiselect","basePadding","additionalPadding","totalPadding","optionItemStyle","paddingLeft","Host"],"sources":["src/components/select/multi-select/multiselect.scss?tag=ifx-multiselect&encapsulation=shadow","src/components/select/multi-select/multiselect.tsx","src/components/select/multi-select/multiselect-option.scss?tag=ifx-multiselect-option&encapsulation=shadow","src/components/select/multi-select/multiselect-option.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: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n\n &:hover {\n cursor: pointer;\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 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 height: 40px;\n line-height: 24px;\n padding: 8px 16px;\n font-size: tokens.$ifxFontSizeM;\n line-height: tokens.$ifxLineHeightM;\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 display: flex;\n align-items: center;\n gap: tokens.$ifxSpace100;\n\n .ifx-multiselect-icon-container {\n display: flex;\n }\n\n .icon-wrapper {\n display: flex;\n align-items: center;\n transition: transform 0.2s ease-in-out;\n }\n\n .icon-wrapper--open {\n transform: rotate(180deg);\n }\n }\n\n .ifx-clear-button {\n display: flex;\n align-items: center;\n\n &.hide {\n display: none;\n }\n }\n\n .ifx-multiselect-dropdown-menu {\n box-sizing: border-box;\n position: absolute;\n top: 100%;\n left: 0;\n width: 100%;\n margin-top: tokens.$ifxSpace50;\n border: 1px solid tokens.$ifxColorEngineering200;\n background-color: #fff;\n box-shadow: 0px 6px 9px 0px rgba(29, 29, 29, 0.10);\n max-height: 300px;\n z-index: 1000;\n display: flex;\n flex-direction: column;\n }\n}\n\n.ifx-multiselect-dropdown-functions {\n padding: tokens.$ifxSpace150 tokens.$ifxSpace200;\n border-bottom: 1px solid tokens.$ifxColorEngineering200;\n flex-shrink: 0;\n}\n\n.ifx-multiselect-dropdown-search {\n margin-bottom: tokens.$ifxSpace150;\n}\n\n.ifx-multiselect-dropdown-controls {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n gap: tokens.$ifxSpace100;\n\n .select-all-wrapper {\n display: flex;\n }\n\n .expand-collapse-controls {\n display: flex;\n gap: tokens.$ifxSpace150;\n }\n\n .control-item {\n font-size: tokens.$ifxFontSizeS;\n line-height: tokens.$ifxLineHeightS;\n\n &:focus {\n outline: none;\n }\n\n &:focus-visible {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n border-radius: tokens.$ifxBorderRadius12;\n }\n }\n}\n\n.ifx-multiselect-options {\n flex: 1;\n overflow-y: auto;\n padding-top: tokens.$ifxSpace150;\n padding-bottom: tokens.$ifxSpace150;\n\n &.show-no-results {\n .ifx-multiselect-no-results {\n display: block;\n }\n }\n}\n\n.ifx-multiselect-no-results {\n padding-left: tokens.$ifxSpace200;\n padding-right: tokens.$ifxSpace200;\n display: none;\n}\n\n","import { Component, Prop, State, Event, EventEmitter, Element, AttachInternals, h, Watch, Method } from '@stencil/core';\nimport { Option } from './interfaces';\n\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\nexport class Multiselect {\n @Prop() name: string;\n @Prop() disabled: boolean = false;\n @Prop() error: boolean = false;\n @Prop() errorMessage: string = \"Error\";\n @Prop() label: string = \"\";\n @Prop() placeholder: string = \"\";\n @Prop() showSearch: boolean = true;\n @Prop() showSelectAll: boolean = true;\n @Prop() showClearButton: boolean = true;\n @Prop() showExpandCollapse: boolean = true;\n @Prop() noResultsMessage: string = \"No results found.\";\n @Prop() showNoResultsMessage: boolean = true;\n @Prop() searchPlaceholder: string = \"Search\";\n @Prop() selectAllLabel: string = \"Select all\";\n @Prop() expandLabel: string = \"Expand\";\n @Prop() collapseLabel: string = \"Collapse\";\n @Prop() ariaMultiSelectLabel: string = \"Multi-select dropdown\";\n @Prop() ariaMultiSelectLabelledBy: string = \"\";\n @Prop() ariaMultiSelectDescribedBy: string = \"\";\n @Prop() ariaSearchLabel: string = \"Search options\";\n @Prop() ariaClearLabel: string = \"Clear all selections\";\n @Prop() ariaToggleLabel: string = \"Toggle dropdown\";\n @Prop() ariaSelectAllLabel: string = \"Select all options\";\n @Prop() ariaExpandAllLabel: string = \"Expand all categories\";\n @Prop() ariaCollapseAllLabel: string = \"Collapse all categories\";\n\n @State() internalError: boolean = false;\n @State() internalErrorMessage: string;\n @State() persistentSelectedOptions: Option[] = [];\n @State() dropdownOpen = false;\n @State() dropdownFlipped: boolean;\n @State() searchTerm: string = '';\n\n @Event() ifxSelect: EventEmitter;\n @Event() ifxOpen: EventEmitter;\n\n @Element() el: HTMLElement;\n dropdownElement!: HTMLElement;\n\n @AttachInternals() internals: ElementInternals;\n private parseChildOptions(): Option[] {\n const options: Option[] = [];\n const childElements = Array.from(this.el.children);\n\n childElements.forEach((child, index) => {\n if (child.tagName === 'IFX-MULTISELECT-OPTION') {\n const option = this.parseOptionElement(child as HTMLElement, index);\n if (option) {\n options.push(option);\n }\n }\n });\n\n return options;\n }\n\n private parseOptionElement(element: HTMLElement, index: number): Option | null {\n const value = element.getAttribute('value') || `option-${index}`;\n const selected = element.hasAttribute('selected');\n const disabled = element.hasAttribute('disabled');\n const indeterminate = element.hasAttribute('indeterminate');\n\n const option: Option = {\n value,\n selected,\n disabled,\n indeterminate\n };\n\n const nestedOptions = Array.from(element.children)\n .filter(child => child.tagName === 'IFX-MULTISELECT-OPTION')\n .map((child, childIndex) => this.parseOptionElement(child as HTMLElement, childIndex))\n .filter(opt => opt !== null) as Option[];\n\n if (nestedOptions.length > 0) {\n option.children = nestedOptions;\n }\n\n return option;\n }\n\n loadInitialOptions() {\n this.internalError = this.error;\n this.internalErrorMessage = this.errorMessage;\n\n const allOptions = this.parseChildOptions();\n const initiallySelected = this.collectSelectedOptions(allOptions);\n const initiallySelectedNotInState = initiallySelected.filter(init =>\n !this.persistentSelectedOptions.some(opt => opt.value == init.value)\n );\n this.persistentSelectedOptions = [...this.persistentSelectedOptions, ...initiallySelectedNotInState];\n }\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 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 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 handleSearch = debounce((targetElement: HTMLInputElement) => {\n const searchTerm = targetElement.value.toLowerCase();\n const isSearchActive = searchTerm !== '';\n\n this.searchTerm = searchTerm;\n\n const wrapper = this.el.shadowRoot.querySelector('.ifx-multiselect-wrapper');\n if (wrapper) {\n if (isSearchActive) {\n wrapper.classList.remove('active');\n } else {\n const searchField = this.el.shadowRoot.querySelector('ifx-search-field');\n const searchFieldHasFocus = searchField && searchField.matches(':focus-within');\n if (!searchFieldHasFocus) {\n wrapper.classList.add('active');\n }\n }\n }\n\n const optionsContainer = this.el.shadowRoot.querySelector('.ifx-multiselect-options');\n if (optionsContainer) {\n if (isSearchActive) {\n optionsContainer.classList.add('has-search-filter');\n } else {\n optionsContainer.classList.remove('has-search-filter');\n }\n }\n\n requestAnimationFrame(() => {\n const allOptions = this.el.querySelectorAll('ifx-multiselect-option');\n allOptions.forEach(option => {\n const searchEvent = new CustomEvent('ifx-search-filter', {\n detail: { searchTerm, isActive: isSearchActive }\n });\n option.dispatchEvent(searchEvent);\n });\n\n if (isSearchActive) {\n setTimeout(() => {\n const allOptions = this.el.querySelectorAll('ifx-multiselect-option');\n let visibleCount = 0;\n\n allOptions.forEach(option => {\n const style = window.getComputedStyle(option);\n const rect = option.getBoundingClientRect();\n\n if (style.display !== 'none' &&\n style.visibility !== 'hidden' &&\n style.opacity !== '0' &&\n rect.height > 0) {\n visibleCount++;\n }\n });\n\n const optionsContainer = this.el.shadowRoot.querySelector('.ifx-multiselect-options');\n if (optionsContainer) {\n if (visibleCount === 0) {\n optionsContainer.classList.add('show-no-results');\n } else {\n optionsContainer.classList.remove('show-no-results');\n }\n }\n }, 200);\n } else {\n const optionsContainer = this.el.shadowRoot.querySelector('.ifx-multiselect-options');\n if (optionsContainer) {\n optionsContainer.classList.remove('show-no-results');\n }\n }\n });\n }, 150);\n\n private handleSearchFocus(hasFocus: boolean) {\n const wrapper = this.el.shadowRoot.querySelector('.ifx-multiselect-wrapper');\n if (wrapper) {\n if (hasFocus || this.searchTerm !== '') {\n wrapper.classList.remove('active');\n } else {\n wrapper.classList.add('active');\n }\n }\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 ((spaceAbove > spaceBelow && wrapperRect.height > spaceBelow) || (wrapperRect.bottom > window.innerHeight)) {\n this.dropdownFlipped = true;\n } else {\n this.dropdownFlipped = false;\n }\n }\n\n public updateSlotBasedSelections(emitEvent: boolean = false) {\n const allOptionElements = this.el.querySelectorAll('ifx-multiselect-option');\n const selectedLeafOptions: Option[] = [];\n\n allOptionElements.forEach((optionEl: any) => {\n const instance = optionEl['__stencil_instance'];\n if (instance && instance.selected && !instance.hasChildren) {\n selectedLeafOptions.push({\n value: instance.value,\n selected: true,\n disabled: instance.disabled\n });\n }\n });\n\n this.persistentSelectedOptions = selectedLeafOptions;\n\n if (emitEvent) {\n this.ifxSelect.emit(this.persistentSelectedOptions);\n }\n }\n\n private updateInitialParentStates() {\n const allOptionElements = this.el.querySelectorAll('ifx-multiselect-option');\n const optionsByDepth = Array.from(allOptionElements)\n .map(el => ({\n element: el,\n instance: (el as any)['__stencil_instance'],\n depth: parseInt(el.getAttribute('data-level') || '0')\n }))\n .filter(item => item.instance)\n .sort((a, b) => b.depth - a.depth);\n\n optionsByDepth.forEach(({ instance }) => {\n if (instance.hasChildren) {\n this.updateParentState(instance);\n }\n });\n }\n\n private updateParentState(parentInstance: any) {\n const directChildren = Array.from(parentInstance.el.children as HTMLCollection)\n .filter((child: Element) => child.tagName === 'IFX-MULTISELECT-OPTION')\n .map(child => (child as any)['__stencil_instance'])\n .filter(instance => instance !== null);\n\n const selectedCount = directChildren.filter(child => child.selected).length;\n const indeterminateCount = directChildren.filter(child => child.indeterminate).length;\n const totalCount = directChildren.length;\n\n if (selectedCount === totalCount && indeterminateCount === 0) {\n parentInstance.selected = true;\n parentInstance.indeterminate = false;\n } else if (selectedCount === 0 && indeterminateCount === 0) {\n parentInstance.selected = false;\n parentInstance.indeterminate = false;\n } else {\n parentInstance.selected = false;\n parentInstance.indeterminate = true;\n }\n }\n\n componentDidLoad() {\n setTimeout(() => {\n this.positionDropdown();\n }, 500);\n\n this.el.addEventListener('ifx-option-changed', () => {\n requestAnimationFrame(() => {\n this.updateSlotBasedSelections(true);\n });\n });\n\n setTimeout(() => {\n this.updateSlotBasedSelections(false);\n this.updateInitialParentStates();\n }, 100);\n }\n\n componentWillLoad() {\n this.loadInitialOptions();\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('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 collapseAll() {\n const allOptionElements = this.el.querySelectorAll('ifx-multiselect-option');\n allOptionElements.forEach((optionEl: any) => {\n const instance = optionEl['__stencil_instance'];\n if (instance && instance.hasChildren) {\n instance.isExpanded = false;\n }\n });\n }\n\n expandAll() {\n const allOptionElements = this.el.querySelectorAll('ifx-multiselect-option');\n allOptionElements.forEach((optionEl: any) => {\n const instance = optionEl['__stencil_instance'];\n if (instance && instance.hasChildren) {\n instance.isExpanded = true;\n }\n });\n }\n\n selectAll() {\n this.resetSearch();\n\n const allOptionElements = this.el.querySelectorAll('ifx-multiselect-option');\n\n allOptionElements.forEach((optionEl: any) => {\n const instance = optionEl['__stencil_instance'];\n if (instance) {\n if (instance.hasChildren) {\n instance.isExpanded = true;\n } else {\n instance.selected = true;\n }\n }\n });\n\n setTimeout(() => {\n this.updateInitialParentStates();\n this.updateSlotBasedSelections(false);\n this.ifxSelect.emit(this.persistentSelectedOptions);\n }, 0);\n }\n\n @Method()\n async clearSelection() {\n const allOptionElements = this.el.querySelectorAll('ifx-multiselect-option');\n allOptionElements.forEach((optionEl: any) => {\n const instance = optionEl['__stencil_instance'];\n if (instance) {\n instance.selected = false;\n instance.indeterminate = false;\n if (instance.hasChildren) {\n instance.isExpanded = false;\n }\n }\n });\n\n this.persistentSelectedOptions = [];\n\n setTimeout(() => {\n this.updateSlotBasedSelections(false);\n this.ifxSelect.emit(this.persistentSelectedOptions);\n }, 0);\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.resetSearch();\n this.ifxOpen.emit(this.dropdownOpen);\n }\n }\n\n toggleDropdown() {\n this.dropdownOpen = !this.dropdownOpen;\n setTimeout(() => {\n if (this.dropdownOpen) {\n document.addEventListener('click', this.handleDocumentClick);\n } else {\n this.resetSearch();\n }\n this.ifxOpen.emit(this.dropdownOpen);\n }, 0);\n }\n\n private resetSearch() {\n this.searchTerm = '';\n\n const searchField = this.el.shadowRoot.querySelector('ifx-search-field') as any;\n if (searchField) {\n searchField.value = '';\n }\n\n const optionsContainer = this.el.shadowRoot.querySelector('.ifx-multiselect-options');\n if (optionsContainer) {\n optionsContainer.classList.remove('has-search-filter');\n }\n\n const allOptions = this.el.querySelectorAll('ifx-multiselect-option');\n allOptions.forEach(option => {\n const searchEvent = new CustomEvent('ifx-search-filter', {\n detail: { searchTerm: '', isActive: false }\n });\n option.dispatchEvent(searchEvent);\n });\n }\n\n handleWrapperClick(event: MouseEvent) {\n this.positionDropdown();\n\n if (event.currentTarget === event.target) {\n this.toggleDropdown();\n }\n }\n\n handleKeyDown(event: KeyboardEvent) {\n if (this.disabled) return;\n\n // If dropdown is closed, only allow opening\n if (!this.dropdownOpen) {\n switch (event.code) {\n case 'Enter':\n case 'Space':\n case 'ArrowDown':\n event.preventDefault();\n this.toggleDropdown();\n break;\n }\n return;\n }\n\n // Dropdown is open - handle navigation and controls\n switch (event.code) {\n case 'Escape':\n event.preventDefault();\n this.toggleDropdown();\n break;\n case 'Enter':\n case 'Space':\n // Don't close dropdown when pressing space/enter in controls area\n const target = event.target as HTMLElement;\n if (!target.closest('.ifx-multiselect-dropdown-functions')) {\n event.preventDefault();\n this.toggleDropdown();\n }\n break;\n case 'ArrowDown':\n case 'ArrowUp':\n // Focus first/last option for navigation\n event.preventDefault();\n this.focusFirstOption();\n break;\n }\n }\n\n private focusFirstOption() {\n const firstOption = this.el.querySelector('ifx-multiselect-option:not(.search-hidden)');\n if (firstOption) {\n const labelElement = firstOption.shadowRoot?.querySelector('.option-label') as HTMLElement;\n labelElement?.focus();\n }\n }\n\n private renderSelectAll() {\n const allOptionElements = this.el.querySelectorAll('ifx-multiselect-option');\n const leafOptions = Array.from(allOptionElements).filter((el: any) => !el.hasChildren);\n const selectedLeafOptions = Array.from(allOptionElements).filter((el: any) => !el.hasChildren && el.selected);\n\n const allSelected = leafOptions.length > 0 && selectedLeafOptions.length === leafOptions.length;\n\n const toggleSelectAll = (event?: Event) => {\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n if (allSelected) {\n this.clearSelection();\n } else {\n this.selectAll();\n }\n };\n\n return (\n <div class=\"select-all-wrapper\">\n <ifx-checkbox\n id='selectAll'\n checked={allSelected}\n size=\"s\"\n aria-label={this.ariaSelectAllLabel}\n onClick={toggleSelectAll}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n toggleSelectAll(e);\n }\n }}\n >\n {this.selectAllLabel}\n </ifx-checkbox>\n </div>\n );\n }\n\n private renderNoResultsMessage() {\n return (\n <div class=\"ifx-multiselect-no-results\">\n <div class=\"no-results-content\">\n <span class=\"no-results-text\">{this.noResultsMessage}</span>\n </div>\n </div>\n );\n }\n\n render() {\n const selectedOptionsLabels = this.persistentSelectedOptions\n .map((option) => {\n const optionElement = this.el.querySelector(`ifx-multiselect-option[value=\"${option.value}\"]`);\n return optionElement?.textContent?.trim() || option.value;\n })\n .join(', ');\n\n const hasSelections = this.persistentSelectedOptions.length > 0;\n\n let isFlatMultiselect = false;\n const allOptionElements = this.el.querySelectorAll('ifx-multiselect-option');\n if (allOptionElements.length > 0) {\n isFlatMultiselect = Array.from(allOptionElements).every(option => option.children.length === 0);\n }\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.dropdownOpen ? 'active' : ''}\n ${this.dropdownFlipped ? 'is-flipped' : ''}\n ${this.internalError ? 'error' : \"\"}\n ${this.disabled ? 'disabled' : \"\"}`}\n role=\"combobox\"\n aria-label={this.ariaMultiSelectLabel}\n aria-labelledby={this.ariaMultiSelectLabelledBy || undefined}\n aria-describedby={this.ariaMultiSelectDescribedBy || undefined}\n aria-expanded={this.dropdownOpen}\n aria-haspopup=\"listbox\"\n aria-disabled={this.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 ${hasSelections ? '' : 'placeholder'}\n `}\n onClick={this.disabled ? undefined : () => this.toggleDropdown()}\n >\n {hasSelections ? selectedOptionsLabels : this.placeholder}\n </div>\n {this.dropdownOpen && (\n <div class=\"ifx-multiselect-dropdown-menu\">\n\n {(this.showSearch || this.showSelectAll || (this.showExpandCollapse && !isFlatMultiselect)) && (\n <div class=\"ifx-multiselect-dropdown-functions\" onClick={(e) => e.stopPropagation()}>\n {this.showSearch && (\n <div class=\"ifx-multiselect-dropdown-search\">\n <ifx-search-field\n class=\"search-input\"\n placeholder={this.searchPlaceholder}\n size=\"s\"\n show-delete-icon=\"true\"\n aria-label={this.ariaSearchLabel}\n onKeyDown={(e) => { e.stopPropagation() }}\n onIfxInput={(event) => this.handleSearch(event.target)}\n onFocus={() => this.handleSearchFocus(true)}\n onBlur={() => this.handleSearchFocus(false)}\n ></ifx-search-field>\n </div>\n )}\n\n <div class=\"ifx-multiselect-dropdown-controls\">\n {this.showSelectAll && this.renderSelectAll()}\n {this.showExpandCollapse && !isFlatMultiselect && (\n <div class=\"expand-collapse-controls\">\n <span\n class=\"control-item\"\n role=\"button\"\n tabIndex={0}\n aria-label={this.ariaExpandAllLabel}\n onClick={(e) => { e.stopPropagation(); this.expandAll(); }}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n this.expandAll();\n }\n }}\n >\n {this.expandLabel}\n </span>\n <span\n class=\"control-item\"\n role=\"button\"\n tabIndex={0}\n aria-label={this.ariaCollapseAllLabel}\n onClick={(e) => { e.stopPropagation(); this.collapseAll(); }}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n this.collapseAll();\n }\n }}\n >\n {this.collapseLabel}\n </span>\n </div>\n )}\n </div>\n </div>\n )}\n\n <div class=\"ifx-multiselect-options\" role=\"listbox\" aria-multiselectable=\"true\">\n <slot />\n {this.searchTerm && this.showNoResultsMessage && this.renderNoResultsMessage()}\n </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='chevron-up-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","@use \"~@infineon/design-system-tokens/dist/tokens\";\n\n:host {\n display: block;\n width: 100%;\n}\n\n.option {\n display: flex;\n flex-direction: column;\n position: relative;\n cursor: pointer;\n list-style: none;\n\n &.option--expanded {\n position: relative;\n }\n\n &.option--has-children {\n position: relative;\n\n .option-item > .chevron-wrapper {\n display: flex;\n }\n }\n\n &--disabled {\n cursor: not-allowed;\n pointer-events: none;\n color: tokens.$ifxColorEngineering300;\n }\n\n &--selected {\n // Additional styles for selected state if needed\n // .option-item {\n // background: red;\n // }\n }\n\n &.search-hidden {\n display: none !important;\n }\n\n &.search-match {\n .option-item {\n .option-label {\n .search-highlight {\n font-weight: bold;\n // color: tokens.$ifxColorOcean400;\n }\n }\n }\n }\n}\n\n.option-item {\n display: flex;\n flex-direction: row;\n align-items: center;\n white-space: nowrap;\n min-height: tokens.$ifxSize250;\n padding: tokens.$ifxSize50 tokens.$ifxSpace200;\n background-color: tokens.$ifxColorBaseWhite;\n transition: background-color 0.2s ease-in-out;\n\n &:hover {\n background-color: tokens.$ifxColorEngineering100;\n }\n\n .option--disabled & {\n &:hover {\n background-color: transparent;\n }\n }\n}\n\n.option-children {\n display: block;\n}\n\n.chevron-wrapper {\n display: none;\n align-items: center;\n justify-content: center;\n margin-right: tokens.$ifxSpace100;\n width: tokens.$ifxSize250;\n height: tokens.$ifxSize250;\n flex-shrink: 0;\n\n &:focus {\n outline: none;\n }\n\n &:focus-visible {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n border-radius: tokens.$ifxBorderRadius12;\n }\n\n .option--has-children & {\n display: flex;\n }\n\n .chevron {\n transition: transform 0.2s ease-in-out;\n color: tokens.$ifxColorEngineering600;\n\n &.chevron--expanded {\n transform: rotate(90deg);\n }\n\n &.chevron--collapsed {\n transform: rotate(0deg);\n }\n }\n}\n\n.checkbox-wrapper {\n display: flex;\n align-items: center;\n margin-right: tokens.$ifxSpace100;\n flex-shrink: 0;\n}\n\n.option-label {\n flex-grow: 1;\n display: flex;\n align-items: center;\n cursor: pointer;\n padding: tokens.$ifxSpace25 0;\n font-size: tokens.$ifxFontSizeS;\n\n &:focus {\n outline: none;\n }\n\n &:focus-visible {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n border-radius: tokens.$ifxBorderRadius12;\n }\n\n .option--disabled & {\n cursor: not-allowed;\n color: tokens.$ifxColorEngineering300;\n }\n}\n","import { Component, Prop, Element, h, Host, State, Listen } from '@stencil/core';\n\n@Component({\n tag: 'ifx-multiselect-option',\n styleUrl: 'multiselect-option.scss',\n shadow: true,\n})\nexport class MultiselectOption {\n @Element() el: HTMLElement;\n\n @Prop() value: string;\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n @Prop({ reflect: true, mutable: true }) disabled: boolean = false;\n @Prop({ reflect: true, mutable: true }) indeterminate: boolean = false;\n\n @State() private isExpanded: boolean = false;\n @State() private hasChildren: boolean = false;\n @State() private depth: number = 0;\n @State() private searchTerm: string = '';\n @State() private isSearchActive: boolean = false;\n @State() private isSearchDisabled: boolean = false;\n\n componentWillLoad() {\n this.hasChildren = this.el.children.length > 0;\n this.depth = this.calculateDepth();\n\n this.el.setAttribute('data-level', this.depth.toString());\n\n if (this.hasChildren) {\n const hasSelectedChildren = this.hasAnySelectedChildren();\n if (hasSelectedChildren) {\n this.isExpanded = true;\n }\n }\n }\n\n componentDidLoad() {\n (this.el as any)['__stencil_instance'] = this;\n this.notifyMultiselect();\n this.el.addEventListener('ifx-search-filter', this.handleSearchFilter);\n }\n\n disconnectedCallback() {\n this.el.removeEventListener('ifx-search-filter', this.handleSearchFilter);\n }\n\n private handleSearchFilter = (event: CustomEvent) => {\n const { searchTerm, isActive } = event.detail;\n this.searchTerm = searchTerm.toLowerCase();\n this.isSearchActive = isActive;\n\n requestAnimationFrame(() => {\n this.updateSearchClasses();\n });\n }\n\n private updateSearchClasses() {\n const optionDiv = this.el.shadowRoot?.querySelector('.option');\n if (!optionDiv) return;\n\n if (!this.isSearchActive) {\n optionDiv.classList.remove('search-hidden', 'search-parent', 'search-match');\n this.removeHighlighting();\n this.isSearchDisabled = false;\n return;\n }\n\n const textContent = this.getTextContent().toLowerCase();\n const matchesSearch = textContent.includes(this.searchTerm);\n const hasMatchingParent = this.hasMatchingParent();\n\n requestAnimationFrame(() => {\n const hasMatchingChildren = this.hasMatchingChildren();\n\n optionDiv.classList.remove('search-hidden', 'search-parent', 'search-match');\n this.isSearchDisabled = false;\n\n if (matchesSearch && !this.hasChildren) {\n optionDiv.classList.add('search-match');\n this.highlightSearchTerm();\n } else if (matchesSearch && this.hasChildren) {\n optionDiv.classList.add('search-match');\n this.highlightSearchTerm();\n this.isExpanded = true;\n } else if (!matchesSearch && this.hasChildren && hasMatchingChildren) {\n optionDiv.classList.add('search-parent');\n this.removeHighlighting();\n this.isExpanded = true;\n this.isSearchDisabled = true;\n } else if (hasMatchingParent) {\n optionDiv.classList.add('search-match');\n this.removeHighlighting();\n } else {\n optionDiv.classList.add('search-hidden');\n this.removeHighlighting();\n }\n });\n }\n\n private highlightSearchTerm() {\n if (!this.searchTerm) return;\n\n const labelElement = this.el.shadowRoot?.querySelector('.option-label');\n if (!labelElement) return;\n\n const slotElement = labelElement.querySelector('slot');\n if (!slotElement) return;\n\n this.removeHighlighting();\n\n const originalText = this.getTextContent();\n const searchTermLower = this.searchTerm.toLowerCase();\n const originalTextLower = originalText.toLowerCase();\n\n if (!originalTextLower.includes(searchTermLower)) return;\n\n const searchIndex = originalTextLower.indexOf(searchTermLower);\n\n if (searchIndex === -1) return;\n\n const beforeMatch = originalText.substring(0, searchIndex);\n const matchText = originalText.substring(searchIndex, searchIndex + searchTermLower.length);\n const afterMatch = originalText.substring(searchIndex + searchTermLower.length);\n\n const highlightedContent = document.createElement('span');\n highlightedContent.className = 'highlighted-text';\n\n if (beforeMatch) {\n highlightedContent.appendChild(document.createTextNode(beforeMatch));\n }\n\n const boldElement = document.createElement('strong');\n boldElement.className = 'search-highlight';\n boldElement.textContent = matchText;\n highlightedContent.appendChild(boldElement);\n\n if (afterMatch) {\n highlightedContent.appendChild(document.createTextNode(afterMatch));\n }\n\n labelElement.setAttribute('data-original-content', 'true');\n slotElement.style.display = 'none';\n labelElement.appendChild(highlightedContent);\n }\n\n private removeHighlighting() {\n const labelElement = this.el.shadowRoot?.querySelector('.option-label');\n if (!labelElement) return;\n\n const slotElement = labelElement.querySelector('slot');\n const highlightedElement = labelElement.querySelector('.highlighted-text');\n\n if (highlightedElement) {\n labelElement.removeChild(highlightedElement);\n }\n\n if (slotElement) {\n slotElement.style.display = '';\n }\n\n labelElement.removeAttribute('data-original-content');\n }\n\n private getTextContent(): string {\n let text = '';\n Array.from(this.el.childNodes).forEach(node => {\n if (node.nodeType === Node.TEXT_NODE) {\n text += node.textContent?.trim() || '';\n }\n });\n return text || this.value || '';\n }\n\n private hasMatchingChildren(): boolean {\n if (!this.hasChildren) return false;\n\n const childOptions = Array.from(this.el.children)\n .filter(child => child.tagName === 'IFX-MULTISELECT-OPTION') as HTMLElement[];\n\n return childOptions.some(child => {\n const childInstance = (child as any)['__stencil_instance'];\n if (!childInstance) return false;\n\n const childText = childInstance.getTextContent().toLowerCase();\n const childMatches = childText.includes(this.searchTerm);\n const grandChildrenMatch = childInstance.hasMatchingChildren();\n\n return childMatches || grandChildrenMatch;\n });\n }\n\n private hasMatchingParent(): boolean {\n let parent = this.el.parentElement;\n while (parent && parent.tagName === 'IFX-MULTISELECT-OPTION') {\n const parentInstance = (parent as any)['__stencil_instance'];\n if (parentInstance) {\n const parentText = parentInstance.getTextContent().toLowerCase();\n if (parentText.includes(this.searchTerm)) {\n return true;\n }\n }\n parent = parent.parentElement;\n }\n return false;\n }\n\n private calculateDepth(): number {\n let depth = 0;\n let parent = this.el.parentElement;\n while (parent && parent.tagName !== 'IFX-MULTISELECT') {\n if (parent.tagName === 'IFX-MULTISELECT-OPTION') {\n depth++;\n }\n parent = parent.parentElement;\n }\n return depth;\n }\n\n @Listen('click')\n handleClick(event: Event) {\n if (this.disabled || (this.isSearchActive && this.isSearchDisabled)) return;\n\n event.stopPropagation();\n\n if (event.type === 'click' && (event.target as HTMLElement).closest('.chevron-wrapper')) {\n this.toggleExpansion();\n return;\n }\n\n let newSelectedState: boolean;\n\n if (this.indeterminate) {\n newSelectedState = true;\n } else {\n newSelectedState = !this.selected;\n }\n\n this.selected = newSelectedState;\n this.indeterminate = false;\n\n if (this.hasChildren) {\n this.isExpanded = newSelectedState;\n\n requestAnimationFrame(() => {\n this.selectAllChildren(newSelectedState);\n this.expandAllChildren(newSelectedState);\n });\n }\n\n this.updateParentStates();\n this.notifyMultiselect();\n }\n\n @Listen('keydown')\n handleKeyDown(event: KeyboardEvent) {\n if (this.disabled || (this.isSearchActive && this.isSearchDisabled)) return;\n\n const target = event.target as HTMLElement;\n\n if (target.closest('.chevron-wrapper') || target.closest('.checkbox-wrapper')) {\n return;\n }\n\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') {\n event.stopPropagation();\n }\n\n if (event.key === 'ArrowRight' && this.hasChildren) {\n this.isExpanded = true;\n }\n\n if (event.key === 'ArrowLeft' && this.hasChildren) {\n this.isExpanded = false;\n }\n }\n\n private notifyMultiselect() {\n const updateEvent = new CustomEvent('ifx-option-changed', {\n bubbles: true,\n detail: {\n value: this.value,\n selected: this.selected,\n indeterminate: this.indeterminate\n }\n });\n this.el.dispatchEvent(updateEvent);\n }\n\n private selectAllChildren(selected: boolean) {\n const directChildren = Array.from(this.el.children)\n .filter(child => child.tagName === 'IFX-MULTISELECT-OPTION') as any[];\n\n directChildren.forEach((child: any) => {\n const childInstance = child['__stencil_instance'];\n if (childInstance) {\n childInstance.selected = selected;\n childInstance.indeterminate = false;\n\n if (childInstance.hasChildren) {\n childInstance.isExpanded = selected;\n childInstance.selectAllChildren(selected);\n }\n childInstance.notifyMultiselect?.();\n }\n });\n }\n\n private expandAllChildren(expanded: boolean) {\n const directChildren = Array.from(this.el.children)\n .filter(child => child.tagName === 'IFX-MULTISELECT-OPTION') as any[];\n\n directChildren.forEach((child: any) => {\n const childInstance = child['__stencil_instance'];\n if (childInstance && childInstance.hasChildren) {\n childInstance.isExpanded = expanded;\n childInstance.expandAllChildren(expanded);\n }\n });\n }\n\n private updateParentStates() {\n let parent = this.el.parentElement;\n while (parent && parent.tagName === 'IFX-MULTISELECT-OPTION') {\n const parentInstance = (parent as any)['__stencil_instance'];\n if (!parentInstance) {\n parent = parent.parentElement;\n continue;\n }\n\n const siblings = Array.from(parent.children)\n .filter(child => child.tagName === 'IFX-MULTISELECT-OPTION')\n .map(child => (child as any)['__stencil_instance'])\n .filter(instance => instance !== null);\n\n const selectedCount = siblings.filter(sibling => sibling.selected).length;\n const indeterminateCount = siblings.filter(sibling => sibling.indeterminate).length;\n const totalCount = siblings.length;\n\n if (selectedCount === totalCount && indeterminateCount === 0) {\n parentInstance.selected = true;\n parentInstance.indeterminate = false;\n } else if (selectedCount === 0 && indeterminateCount === 0) {\n parentInstance.selected = false;\n parentInstance.indeterminate = false;\n } else {\n parentInstance.selected = false;\n parentInstance.indeterminate = true;\n }\n\n parentInstance.notifyMultiselect?.();\n parent = parent.parentElement;\n }\n }\n\n private toggleExpansion() {\n this.isExpanded = !this.isExpanded;\n }\n\n private handleCheckboxClick = (event: Event) => {\n if (this.disabled || (this.isSearchActive && this.isSearchDisabled)) return;\n\n event.stopPropagation();\n\n let newSelectedState: boolean;\n\n if (this.indeterminate) {\n newSelectedState = true;\n } else {\n newSelectedState = !this.selected;\n }\n\n this.selected = newSelectedState;\n this.indeterminate = false;\n\n if (this.hasChildren) {\n this.isExpanded = newSelectedState;\n\n requestAnimationFrame(() => {\n this.selectAllChildren(newSelectedState);\n this.expandAllChildren(newSelectedState);\n });\n }\n\n this.updateParentStates();\n this.notifyMultiselect();\n }\n\n private handleHeaderClick = (event: Event) => {\n event.stopPropagation();\n if (!this.disabled && !(this.isSearchActive && this.isSearchDisabled)) {\n this.handleClick(event);\n }\n }\n\n private hasAnySelectedChildren(): boolean {\n const childOptions = Array.from(this.el.children)\n .filter(child => child.tagName === 'IFX-MULTISELECT-OPTION') as HTMLElement[];\n\n return childOptions.some(child => {\n const hasSelected = child.hasAttribute('selected');\n const hasSelectedDescendants = this.checkForSelectedDescendants(child);\n\n return hasSelected || hasSelectedDescendants;\n });\n }\n\n private checkForSelectedDescendants(element: HTMLElement): boolean {\n const nestedOptions = Array.from(element.children)\n .filter(child => child.tagName === 'IFX-MULTISELECT-OPTION') as HTMLElement[];\n\n return nestedOptions.some(nestedChild => {\n const isSelected = nestedChild.hasAttribute('selected');\n const hasSelectedNested = this.checkForSelectedDescendants(nestedChild);\n\n return isSelected || hasSelectedNested;\n });\n }\n\n render() {\n let isFlatMultiselect = false;\n const parentMultiselect = this.el.closest('ifx-multiselect');\n if (parentMultiselect) {\n const allOptions = Array.from(parentMultiselect.querySelectorAll('ifx-multiselect-option'));\n isFlatMultiselect = allOptions.every(option => option.children.length === 0);\n }\n\n const basePadding = this.depth * 28 + 16;\n const additionalPadding = this.hasChildren ? 0 : 28;\n let totalPadding = basePadding + additionalPadding;\n\n const optionItemStyle = isFlatMultiselect ? undefined : { paddingLeft: `${totalPadding}px` };\n\n return (\n <Host>\n <div\n class={{\n 'option': true,\n 'option--has-children': this.hasChildren,\n 'option--expanded': this.isExpanded,\n 'option--disabled': this.disabled,\n 'option--selected': this.selected,\n }}\n role=\"option\"\n aria-expanded={this.hasChildren ? (this.isExpanded ? 'true' : 'false') : undefined}\n aria-selected={this.selected ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n data-level={this.depth}\n data-value={this.value}\n >\n <div\n class=\"option-item\"\n style={optionItemStyle}\n >\n <div\n class=\"chevron-wrapper\"\n tabIndex={this.hasChildren ? 0 : -1}\n role={this.hasChildren ? \"button\" : undefined}\n aria-label={this.hasChildren ? (this.isExpanded ? \"Collapse\" : \"Expand\") : undefined}\n onClick={(e) => { e.stopPropagation(); this.toggleExpansion(); }}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n this.toggleExpansion();\n }\n }}\n >\n {this.hasChildren && (\n <ifx-icon\n class={`chevron ${this.isExpanded ? 'chevron--expanded' : 'chevron--collapsed'}`}\n icon=\"chevron-right-16\"\n />\n )}\n </div>\n\n <div class=\"checkbox-wrapper\" onClick={(e) => e.stopPropagation()}>\n <ifx-checkbox\n size='s'\n checked={(this.isSearchActive && this.isSearchDisabled) ? false : (this.indeterminate ? false : this.selected)}\n indeterminate={(this.isSearchActive && this.isSearchDisabled) ? false : this.indeterminate}\n onClick={this.handleCheckboxClick}\n disabled={this.disabled || (this.isSearchActive && this.isSearchDisabled)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n this.handleCheckboxClick(e);\n }\n }}\n />\n </div>\n\n <div\n class=\"option-label\"\n onClick={this.handleHeaderClick}\n tabIndex={-1}\n >\n <slot/>\n </div>\n </div>\n\n {this.isExpanded && <div class=\"option-children\"><slot name=\"children\"/></div>}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAiB,8xIACvB,MAAAC,EAAeD,ECEf,SAASE,EAASC,EAAMC,GACtB,IAAIC,EACJ,OAAO,SAASC,KAAoBC,GAClC,MAAMC,EAAQ,KACZC,aAAaJ,GACbF,KAAQI,EAAK,EAEfE,aAAaJ,GACbA,EAAUK,WAAWF,EAAOJ,E,CAEhC,C,MASaO,EAAW,MAPxB,WAAAC,CAAAC,G,gPASUC,KAAAC,SAAoB,MACpBD,KAAAE,MAAiB,MACjBF,KAAAG,aAAuB,QACvBH,KAAAI,MAAgB,GAChBJ,KAAAK,YAAsB,GACtBL,KAAAM,WAAsB,KACtBN,KAAAO,cAAyB,KACzBP,KAAAQ,gBAA2B,KAC3BR,KAAAS,mBAA8B,KAC9BT,KAAAU,iBAA2B,oBAC3BV,KAAAW,qBAAgC,KAChCX,KAAAY,kBAA4B,SAC5BZ,KAAAa,eAAyB,aACzBb,KAAAc,YAAsB,SACtBd,KAAAe,cAAwB,WACxBf,KAAAgB,qBAA+B,wBAC/BhB,KAAAiB,0B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