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