import{d as v,r as i,c as w,w as y,o as s,e as a,f as c,l as b,aS as D,L as d,s as k,x as I,y as M,t as u,z as S,A as W,_ as g}from"./index-BEZl8isL.js";const C=e=>(S("data-v-6c23d78a"),e=e(),W(),e),x={class:"WdsDropdownMenu"},B={key:0,class:"WdsDropdownMenu__search-wrapper"},q={class:"WdsDropdownMenu__search"},L=C(()=>c("i",{class:"material-symbols-outlined"},"search",-1)),V=["onClick"],z={key:0,class:"material-symbols-outlined"},A=["data-writer-tooltip"],F={key:1,class:"material-symbols-outlined"},N=v({__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 n=e,_=p,h=i(),o=i("");function m(r){return n.hideIcons?"":r.icon??"help_center"}const f=w(()=>{if(!n.enableSearch)return n.options;const r=o.value.toLowerCase();return n.options.filter(l=>l.label.toLowerCase().includes(r))});return y(o,()=>_("search",o.value)),(r,l)=>(s(),a("div",x,[e.enableSearch?(s(),a("div",B,[c("div",q,[L,b(c("input",{ref_key:"searchInput",ref:h,"onUpdate:modelValue":l[0]||(l[0]=t=>o.value=t),class:"WdsDropdownMenu__search__input",type:"text",placeholder:"Search",autocomplete:"off"},null,512),[[D,o.value]])])])):d("",!0),(s(!0),a(k,null,I(f.value,t=>(s(),a("button",{key:t.value,class:M(["WdsDropdownMenu__item",{"WdsDropdownMenu__item--selected":t.value===e.selected}]),onClick:T=>r.$emit("select",t.value)},[e.hideIcons?d("",!0):(s(),a("i",z,u(m(t)),1)),c("div",{class:"WdsDropdownMenu__item__label","data-writer-tooltip":t.label,"data-writer-tooltip-strategy":"overflow"},u(t.label),9,A),t.value===e.selected?(s(),a("i",F," check ")):d("",!0)],10,V))),128))]))}}),E=g(N,[["__scopeId","data-v-6c23d78a"]]);export{E as default};
