import{l as g,i as n,a as i,c as u,o as r,d as h,w as d,F as b,h as B,b as V,f as m}from"./vue.esm-bundler-DZdE0M9V.js";const x={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",x,[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};
