import{p as e,H as t,c as i,h as a,t as r}from"./p-Bpcl2TqF.js";import{d as s}from"./p-KvSIaMXJ.js";import{d as l}from"./p-Do8YsFMA.js";const f=()=>`.sidebar-filter-search-wrapper{display:flex;padding:12px 16px 16px 16px;flex-direction:column;align-items:flex-start;align-self:stretch;gap:4px;font-family:var(--ifx-font-family);background:#EEEDED}.topbar-filter-search-wrapper{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch;gap:4px;font-family:var(--ifx-font-family)}.topbar-filter-search-wrapper ifx-search-field{width:100%;}.filter-name{font-size:1rem;line-height:1.5rem;font-weight:600}`;const h=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.ifxFilterSearchChange=i(this,"ifxFilterSearchChange",7)}get host(){return this}filterName;disabled=false;filterValue;filterKey;showDeleteIcon=false;filterOrientation="sidebar";placeholder;ifxFilterSearchChange;valueChanged(e){this.host.setAttribute("value",e.toString())}handleFilterSearchChange(e){const t=this.host.parentElement.querySelector(`ifx-filter-search[filter-name="${this.filterName}"]`);if(t&&t!==this.host){throw new Error(`A search filter with the name '${this.filterName}' already exists.`)}this.filterValue=e.detail;this.showDeleteIcon=this.filterValue!=="";this.ifxFilterSearchChange.emit({filterName:this.filterName,filterValue:this.filterValue,filterKey:this.filterKey})}render(){return a("div",{key:"3f79ee17d44f49aa638e27e0031103fb13109b41",class:`${this.filterOrientation==="sidebar"?"sidebar-filter-search-wrapper":"topbar-filter-search-wrapper"}`},a("div",{key:"463f29f7db59aeae88156325997081f88a4c6b43",class:"filter-name"},this.filterName),a("ifx-search-field",{key:"58e6c3238a9d7892ff7f30949932a6260392e3f4",placeholder:this.placeholder,"show-delete-icon":this.showDeleteIcon,disabled:this.disabled,value:this.filterValue}))}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return f()}},[513,"ifx-filter-search",{filterName:[1,"filter-name"],disabled:[4],filterValue:[1025,"filter-value"],filterKey:[1,"filter-key"],filterOrientation:[1,"filter-orientation"],placeholder:[1],showDeleteIcon:[32]},[[0,"ifxInput","handleFilterSearchChange"]],{value:[{valueChanged:0}]}]);function n(){if(typeof customElements==="undefined"){return}const e=["ifx-filter-search","ifx-icon","ifx-search-field"];e.forEach((e=>{switch(e){case"ifx-filter-search":if(!customElements.get(r(e))){customElements.define(r(e),h)}break;case"ifx-icon":if(!customElements.get(r(e))){s()}break;case"ifx-search-field":if(!customElements.get(r(e))){l()}break}}))}const c=h;const o=n;export{c as IfxFilterSearch,o as defineCustomElement};
//# sourceMappingURL=ifx-filter-search.js.map