import{k as g,h as n,r as i,e as u,o as r,a as h,w as d,F as b,g as B,c as V,d as m}from"./vue.esm-bundler.js?ver=1.3.17";const k={class:"input-append"},w={__name:"Products",props:{form:{type:Object},field:{type:Object},value:{type:Object},fieldKey:{type:String}},setup(l){const f=g().ctx,s=n([]),a=n(""),c=n(null),v=o=>{if(o==="")return!1;a.value=!0,clearTimeout(c.value),c.value=setTimeout(()=>{f.$get("products/searchVariantByName",{name:o}).then(e=>{s.value=e.products}).catch(e=>{}).finally(()=>{a.value=!1})},500)};return(o,e)=>{const p=i("el-option"),y=i("el-select");return r(),u("div",k,[h(y,{modelValue:l.value[l.fieldKey],"onUpdate:modelValue":e[0]||(e[0]=t=>l.value[l.fieldKey]=t),multiple:"",placeholder:l.field.placeholder,filterable:"",remote:"","reserve-keyword":!1,"remote-method":v,loading:a.value},{loading:d(()=>e[1]||(e[1]=[m("svg",{class:"circular",viewBox:"0 0 50 50"},[m("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})],-1)])),default:d(()=>[(r(!0),u(b,null,B(s.value,t=>(r(),V(p,{key:t.id,label:t.variation_title,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","loading"])])}}};export{w as default};
