2 lines
1.3 KiB
JavaScript
2 lines
1.3 KiB
JavaScript
import{ay as e,aL as l,aK as o}from"./vendor-element-plus.js?ver=3.1.8";import{a6 as t,W as a,Y as s,a5 as i,X as d,J as r,az as m}from"./vendor.js?ver=3.1.8";import{_ as n}from"./fc-bits-ui.js?ver=3.1.8";const h=n({name:"TaxonomySelector",props:["field","modelValue"],emits:["update:modelValue"],data(){return{model:this.modelValue,loading:!1,options:[]}},watch:{model(e){this.$emit("update:modelValue",e)}},methods:{fetchOptions(e){this.loading=!0,this.$get("reports/taxonomy-terms",{search:e,values:this.model,taxonomy:this.field.taxonomy}).then(e=>{this.options=e.options}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1})}},mounted(){this.fetchOptions("")}},[["render",function(n,h,p,u,f,c){const v=l,y=o,b=e;return t((a(),s(y,{modelValue:f.model,"onUpdate:modelValue":h[0]||(h[0]=e=>f.model=e),multiple:p.field.is_multiple,filterable:"",remote:"","reserve-keyword":"",disabled:p.field.disabled,size:p.field.size,placeholder:p.field.placeholder||n.$t("Please enter a keyword"),"remote-method":c.fetchOptions},{default:i(()=>[(a(!0),d(r,null,m(f.options,e=>(a(),s(v,{key:e.id,label:e.title,value:e.id},null,8,["label","value"]))),128))],void 0),_:1},8,["modelValue","multiple","disabled","size","placeholder","remote-method"])),[[b,f.loading]])}]]);export{h as T};
|