import{w,g as r,A as u,J as t,a8 as x,B as y,j as k,K as g,L as C,H as B,P as I,r as i,c as A,n as L}from"./index-DOFLUERq.js";import{I as S}from"./iconify-p99pbjf9.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";const M={class:"autocomplete-wrapper"},N={class:"combo-box-options"},O={class:"search-box"},$=["value","placeholder"],j={class:"combo-box-items"},q=["onClick","onMouseenter"],z={__name:"Autocomplete",props:{options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},modelValue:{type:String,default:""},show:{type:Boolean,default:!1}},emits:["update:modelValue","update:show","change"],setup(m,{emit:f}){const s=m,p=f,e=i(""),n=i(null),d=i(0),v=A(()=>e.value?s.options.filter(o=>o.label.toLowerCase().includes(e.value.toLowerCase())):s.options);function h(o){e.value="",p("change",o),p("update:show",!1)}function _(){e.value="",n.value?.focus()}return w(()=>s.show,o=>{o&&L(()=>{n.value?.focus()})}),(o,a)=>(r(),u("div",M,[t("div",N,[t("div",O,[t("input",{ref_key:"search",ref:n,class:"search-input form-control",type:"text",onInput:a[0]||(a[0]=l=>e.value=l.target.value),value:e.value,placeholder:s.placeholder,autocomplete:"off",onClick:a[1]||(a[1]=x(()=>{},["stop"]))},null,40,$),t("button",{class:"clear-button btn btn-sm",onClick:_},[y(k(S),{icon:"mdi:close",class:"icon-sm"})])]),t("div",j,[(r(!0),u(g,null,C(v.value,(l,c)=>(r(),u("div",{key:c,class:B(["combo-box-option",d.value===c?"active":""]),onClick:b=>h(l),onMouseenter:b=>d.value=c},I(l.label),43,q))),128))])])]))}},H=V(z,[["__scopeId","data-v-7fd074cb"]]);export{H as default};
