import{d as g,A as d,J as _,_ as b,P as v,O as N,B as y,j as S,b9 as T,H as h,c,g as u}from"./index-DOFLUERq.js";import{_ as x}from"./_plugin-vue_export-helper-DlAUqK2U.js";const B={class:"field-label"},V={key:0,class:"required"},k=g({__name:"Time",props:{df:{},record:{},canEdit:{type:Boolean},ctx:{}},setup(n){const s=n,f=c(()=>s.df.label_layout||"vertical");function m(e){if(!e||typeof e!="string")return null;const t=e.split(":");if(t.length<2)return null;const a=parseInt(t[0],10),r=parseInt(t[1],10),o=t.length>2?parseInt(t[2],10):0;if(isNaN(a)||isNaN(r)||isNaN(o))return null;const i=new Date;return i.setHours(a,r,o,0),i.getTime()}function p(e){if(e==null)return"";const t=new Date(e),a=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return`${a}:${r}:${o}`}const l=c({get(){const e=s.record[s.df.fieldname];return e?typeof e=="number"?e:m(e):null},set(e){s.record[s.df.fieldname]=p(e)}});return(e,t)=>(u(),d("div",{class:h(["field-wrapper",`layout-${f.value}`])},[_("label",B,[b(v(n.ctx.t(n.df.label||n.df.fieldname))+" ",1),n.df.reqd?(u(),d("span",V,"*")):N("",!0)]),y(S(T),{value:l.value,"onUpdate:value":t[0]||(t[0]=a=>l.value=a),placeholder:"",disabled:!n.canEdit},null,8,["value","disabled"])],2))}}),I=x(k,[["__scopeId","data-v-6ff0d3e4"]]),w=Object.freeze(Object.defineProperty({__proto__:null,default:I},Symbol.toStringTag,{value:"Module"}));export{w as _};
