import{d as m,r as v,w as p,A as s,J as b,_ as y,P as _,O as g,B as x,j as c,aF as i,H as B,i as N,c as u,g as r}from"./index-DOFLUERq.js";import{_ as k}from"./_plugin-vue_export-helper-DlAUqK2U.js";const F={class:"field-label"},h={key:0,class:"required"},C=m({__name:"Float",props:{df:{},record:{},canEdit:{type:Boolean},ctx:{},onlyInput:{type:Boolean}},setup(l){const e=l,f=u(()=>e.df.label_layout||"vertical"),o=v(e.record[e.df.fieldname]),t=u({get:()=>{const a=e.record[e.df.fieldname];return a===""||a===void 0?null:Number(a)},set:a=>{e.record[e.df.fieldname]=a}});return p(()=>e.record[e.df.fieldname],a=>{e.ctx?.onFieldChange&&a!==o.value&&e.ctx.onFieldChange(e.df.fieldname,a,o.value,e.record),o.value=a}),(a,d)=>l.onlyInput?(r(),N(c(i),{key:1,value:t.value,"onUpdate:value":d[1]||(d[1]=n=>t.value=n),precision:2,placeholder:"",disabled:!l.canEdit,style:{width:"100%"}},null,8,["value","disabled"])):(r(),s("div",{key:0,class:B(["field-wrapper",`layout-${f.value}`])},[b("label",F,[y(_(l.ctx.t(l.df.label||l.df.fieldname))+" ",1),l.df.reqd?(r(),s("span",h,"*")):g("",!0)]),x(c(i),{value:t.value,"onUpdate:value":d[0]||(d[0]=n=>t.value=n),precision:2,placeholder:"",disabled:!l.canEdit},null,8,["value","disabled"])],2))}}),E=k(C,[["__scopeId","data-v-612d5e7d"]]),j=Object.freeze(Object.defineProperty({__proto__:null,default:E},Symbol.toStringTag,{value:"Module"}));export{E as F,j as _};
