import{p as e,H as i,c as o,h as t,t as n}from"./p-CHfEnK-2.js";const d=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.menuSize=o(this,"menuSize",7),this.ifxDropdownMenuItem=o(this,"ifxDropdownMenuItem",7)}isOpen=!1;size="l";hideTopPadding=!1;get el(){return this}menuSize;filteredItems=[];ifxDropdownMenuItem;handleMenuFilter(e){this.filterDropdownItems(e.detail)}handleDropdownItemValueEmission(e){this.ifxDropdownMenuItem.emit(e.detail)}filterDropdownItems(e){const i=Array.from(this.el.querySelectorAll("ifx-dropdown-item"));let o,t;const n=e.toUpperCase();for(let e=0;e<i.length;e++)o=i[e],t=o.textContent||o.innerText,t.toUpperCase().indexOf(n)>-1?o.setAttribute("hide",!1):o.setAttribute("hide",!0)}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"),i=this.el.querySelector("ifx-dropdown-header");this.hideTopPadding=!(!e&&!i)}render(){return t("div",{key:"f38b74a5ee24049d9f0b43d1cd1b9e69248ab49c",class:`dropdown-menu \n      ${this.isOpen?"show":""} \n      ${this.hideTopPadding?"hideTopPadding":""}\n      ${"s"===this.size?"small":""}`},t("slot",{key:"164f9659ea4294ef9da9bc5b2ca3e23c96f671d2"}))}static get style(){return":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}"}},[769,"ifx-dropdown-menu",{isOpen:[4,"is-open"],size:[1],hideTopPadding:[32],filteredItems:[32]},[[0,"ifxInput","handleMenuFilter"],[0,"ifxDropdownItem","handleDropdownItemValueEmission"]]]),s=d,p=function(){"undefined"!=typeof customElements&&["ifx-dropdown-menu"].forEach((e=>{"ifx-dropdown-menu"===e&&(customElements.get(n(e))||customElements.define(n(e),d))}))};export{s as IfxDropdownMenu,p as defineCustomElement}