import{d as h,c as i,e as a,F as r,f as d,s as f,g as p,k as u,B as _,n as o}from"./index-a0da86f0.js";import{_ as k}from"./_plugin-vue_export-helper-c27b6911.js";const m={class:"field-label"},v={key:0,class:"required"},y={class:"checkbox-container"},g=["id","checked","disabled"],C={class:"checkbox-container"},B=["id","checked","disabled"],q={class:"field-label"},E={key:0,class:"required"},S=h({__name:"Check",props:{df:{},record:{},canEdit:{type:Boolean},ctx:{}},setup(b){const l=b,n=i(()=>l.df.label_layout||"vertical"),c=i(()=>`checkbox-${l.df.fieldname}-${Math.random().toString(36).substr(2,9)}`);return(e,s)=>(o(),a("div",{class:_(["field-wrapper",`layout-${n.value}`])},[n.value==="vertical"?(o(),a(r,{key:0},[d("div",m,[f(p(e.ctx.t(e.df.label||e.df.fieldname))+" ",1),e.df.reqd?(o(),a("span",v,"*")):u("",!0)]),d("div",y,[d("input",{id:c.value,type:"checkbox",checked:!!e.record[e.df.fieldname],onChange:s[0]||(s[0]=t=>{e.record[e.df.fieldname]=t.target.checked?1:0}),disabled:!e.canEdit,class:"native-checkbox"},null,40,g)])],64)):(o(),a(r,{key:1},[d("div",C,[d("input",{id:c.value,type:"checkbox",checked:!!e.record[e.df.fieldname],onChange:s[1]||(s[1]=t=>{e.record[e.df.fieldname]=t.target.checked?1:0}),disabled:!e.canEdit,class:"native-checkbox"},null,40,B)]),d("div",q,[f(p(e.ctx.t(e.df.label||e.df.fieldname))+" ",1),e.df.reqd?(o(),a("span",E,"*")):u("",!0)])],64))],2))}});const N=k(S,[["__scopeId","data-v-08df56b7"]]),j=Object.freeze(Object.defineProperty({__proto__:null,default:N},Symbol.toStringTag,{value:"Module"}));export{j as _};
