import{d as h,c as k,e as r,f as o,s as n,g as i,k as y,F as b,H as v,B as g,n as l,J as C,w as B,j as O,a8 as S}from"./index-a0da86f0.js";import{_ as A}from"./_plugin-vue_export-helper-c27b6911.js";const M={class:"field-label"},N={key:0,class:"required"},j={class:"multicheck-container"},w=h({__name:"MultiCheck",props:{df:{},record:{},canEdit:{type:Boolean},ctx:{}},setup(f){const u=f,_=k(()=>u.df.label_layout||"vertical");function p(e,t){const a=e[t];return Array.isArray(a)?a:[]}function m(e,t,a,c){Array.isArray(e[t])||(e[t]=[]);const s=e[t];if(c)s.includes(a)||s.push(a);else{const d=s.indexOf(a);d>-1&&s.splice(d,1)}}return(e,t)=>(l(),r("div",{class:g(["field-wrapper",`layout-${_.value}`])},[o("label",M,[n(i(e.ctx.t(e.df.label||e.df.fieldname))+" ",1),e.df.reqd?(l(),r("span",N,"*")):y("",!0)]),o("div",j,[(l(!0),r(b,null,v(e.ctx.getSelectOptions?e.ctx.getSelectOptions(e.df):[],a=>(l(),C(O(S),{key:a.value,checked:p(e.record,e.df.fieldname).includes(a.value),"onUpdate:checked":c=>m(e.record,e.df.fieldname,a.value,c),disabled:!e.canEdit},{default:B(()=>[n(i(a.label),1)]),_:2},1032,["checked","onUpdate:checked","disabled"]))),128))])],2))}});const E=A(w,[["__scopeId","data-v-4f5f405e"]]),F=Object.freeze(Object.defineProperty({__proto__:null,default:E},Symbol.toStringTag,{value:"Module"}));export{F as _};
