import{p as e,H as i,c as t,h as o,t as n}from"./p-Bpcl2TqF.js";const s=()=>`:host{position:relative;z-index:1000}.dropdown-menu{display:none;visibility:hidden;flex-direction:column;width:224px;max-height:289px;min-width:224px;overflow-y:auto;background:#FFFFFF;box-shadow:0px 6px 9px 0px rgba(29, 29, 29, 0.1019607843);border:1px solid #EEEDED;padding:8px 4px;font-family:var(--ifx-font-family)}.dropdown-menu.small{max-height:266px;max-width:186px;overflow-y:auto}.dropdown-menu.hideTopPadding{padding-top:0px}.dropdown-menu.show{display:flex;visibility:visible}`;const d=e(class e extends i{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.menuSize=t(this,"menuSize",7);this.ifxDropdownMenuItem=t(this,"ifxDropdownMenuItem",7)}isOpen=false;size="l";hideTopPadding=false;get el(){return this}menuSize;filteredItems=[];ifxDropdownMenuItem;handleMenuFilter(e){const i=e.detail;this.filterDropdownItems(i)}handleDropdownItemValueEmission(e){this.ifxDropdownMenuItem.emit(e.detail)}filterDropdownItems(e){const i=Array.from(this.el.querySelectorAll("ifx-dropdown-item"));let t,o;const n=e.toUpperCase();for(let e=0;e<i.length;e++){t=i[e];o=t.textContent||t.innerText;if(o.toUpperCase().indexOf(n)>-1){t.setAttribute("hide",false)}else{t.setAttribute("hide",true)}}}componentWillUpdate(){this.menuSize.emit(this.size)}componentWillLoad(){this.filteredItems=Array.from(this.el.querySelectorAll("ifx-dropdown-item"));const e=this.el.querySelector("ifx-search-field");const i=this.el.querySelector("ifx-dropdown-header");if(e||i){this.hideTopPadding=true}else this.hideTopPadding=false}render(){return o("div",{key:"fcf5b206dd0c37a3fde56b7d4ce62e04ce2c7a08",class:`dropdown-menu \n      ${this.isOpen?"show":""} \n      ${this.hideTopPadding?"hideTopPadding":""}\n      ${this.size==="s"?"small":""}`},o("slot",{key:"6fa9b0415d71ddf2c03b2903de966c60faf2f225"}))}static get style(){return s()}},[769,"ifx-dropdown-menu",{isOpen:[4,"is-open"],size:[1],hideTopPadding:[32],filteredItems:[32]},[[0,"ifxInput","handleMenuFilter"],[0,"ifxDropdownItem","handleDropdownItemValueEmission"]]]);function r(){if(typeof customElements==="undefined"){return}const e=["ifx-dropdown-menu"];e.forEach((e=>{switch(e){case"ifx-dropdown-menu":if(!customElements.get(n(e))){customElements.define(n(e),d)}break}}))}const p=d;const l=r;export{p as IfxDropdownMenu,l as defineCustomElement};
//# sourceMappingURL=ifx-dropdown-menu.js.map