import{d as y,r as i,c as v,w,o as t,e as a,l as b,ax as k,f as d,J as c,F as D,s as I,x as M,t as u,y as S,z as W,_ as C}from"./index-8C--RVV5.js";const g=e=>(S("data-v-0d4baa43"),e=e(),W(),e),x={class:"WdsDropdownMenu"},B={key:0,class:"WdsDropdownMenu__search"},q=g(()=>d("i",{class:"material-symbols-outlined"},"search",-1)),F=["onClick"],L={key:0,class:"material-symbols-outlined"},V={class:"WdsDropdownMenu__item__label"},z={key:1,class:"material-symbols-outlined"},N=y({__name:"WdsDropdownMenu",props:{options:{type:Array,default:()=>[]},hideIcons:{type:Boolean,required:!1},enableSearch:{type:Boolean,required:!1},selected:{type:String,required:!1,default:void 0}},emits:{select:e=>typeof e=="string",search:e=>typeof e=="string"},setup(e,{emit:p}){const r=e,_=p,h=i(),o=i("");function m(n){return r.hideIcons?"":n.icon??"help_center"}const f=v(()=>{if(!r.enableSearch)return r.options;const n=o.value.toLowerCase();return r.options.filter(l=>l.label.toLowerCase().includes(n))});return w(o,()=>_("search",o.value)),(n,l)=>(t(),a("div",x,[e.enableSearch?(t(),a("div",B,[q,b(d("input",{ref_key:"searchInput",ref:h,"onUpdate:modelValue":l[0]||(l[0]=s=>o.value=s),class:"WdsDropdownMenu__search__input",type:"text",placeholder:"Search",autocomplete:"off"},null,512),[[k,o.value]])])):c("",!0),(t(!0),a(D,null,I(f.value,s=>(t(),a("button",{key:s.value,class:M(["WdsDropdownMenu__item",{"WdsDropdownMenu__item--selected":s.value===e.selected}]),onClick:T=>n.$emit("select",s.value)},[e.hideIcons?c("",!0):(t(),a("i",L,u(m(s)),1)),d("div",V,u(s.label),1),s.value===e.selected?(t(),a("i",z," check ")):c("",!0)],10,F))),128))]))}}),A=C(N,[["__scopeId","data-v-0d4baa43"]]);export{A as default};
