import{r as e,c as t,h as l}from"./p-Cby2wKoI.js";const i=()=>``;const s=class{constructor(l){e(this,l);this.ifxFilterSelect=t(this,"ifxFilterSelect",7)}filterName;filterLabel;placeholder;type="text";options;filterValues=[];ifxFilterSelect;handleTextInputChange(e){const t=e.target;const l=t.value;this.ifxFilterSelect.emit({filterName:this.filterName,filterValues:[l],type:this.type})}handleSingleSelectChange(e){const t=e.detail.value;this.ifxFilterSelect.emit({filterName:this.filterName,filterValues:[t],type:this.type})}handleMultiselectOptionChange(e){this.filterValues=e.detail.map((e=>({label:e.value,value:e.value})));this.ifxFilterSelect.emit({filterName:this.filterName,filterValues:this.filterValues,type:this.type})}render(){let e=[];if(typeof this.options==="string"){try{e=JSON.parse(this.options)}catch(t){console.error("Failed to parse options:",t);e=[]}}else if(Array.isArray(this.options)){e=this.options}switch(this.type){case"text":return l("ifx-text-field",{error:false,disabled:false,placeholder:this.placeholder,onIfxInput:e=>this.handleTextInputChange(e)},this.filterLabel);case"single-select":return l("ifx-select",{placeholder:"true","search-enabled":"true","search-placeholder-value":"Search...",onIfxSelect:e=>this.handleSingleSelectChange(e),"ifx-placeholder-value":this.placeholder,"ifx-label":this.filterLabel,"ifx-options":this.options});case"multi-select":return l("ifx-multiselect",{label:this.filterLabel,placeholder:this.placeholder,onIfxSelect:e=>this.handleMultiselectOptionChange(e)},e.map((e=>l("ifx-multiselect-option",{value:e.value||e},e.label||e))));default:return null}}};s.style=i();export{s as ifx_set_filter};
//# sourceMappingURL=p-1e02f2a0.entry.js.map