var f=(t,n,r)=>new Promise((p,m)=>{var l=o=>{try{s(r.next(o))}catch(a){m(a)}},i=o=>{try{s(r.throw(o))}catch(a){m(a)}},s=o=>o.done?p(o.value):Promise.resolve(o.value).then(l,i);s((r=r.apply(t,n)).next())});import{u as N}from"./useEntityForm-CMwp7TbN.js";import{b6 as e}from"./bootstrap-Bqxdt4iG.js";import{a1 as g,ai as b,aj as P,a9 as y}from"../jse/index-index-BUJ_4tQs.js";const F=g({__name:"driver-form",props:{driver:{default:null},mode:{}},emits:["submit"],setup(t,{expose:n,emit:r}){const p=t,m=r,l={name:"",icNo:"",passportNo:"",passportExpiry:null,phone:""},i=[{component:"Input",componentProps:{id:"driver-form-name-input",placeholder:e("page.tms.drivers.form.namePlaceholder")},fieldName:"name",formItemClass:"col-span-2",label:e("page.tms.drivers.form.name"),rules:"required"},{component:"Input",componentProps:{placeholder:e("page.tms.drivers.form.icNoPlaceholder")},fieldName:"icNo",formItemClass:"col-span-2",label:e("page.tms.drivers.form.icNo")},{component:"Input",componentProps:{placeholder:e("page.tms.drivers.form.passportNoPlaceholder")},fieldName:"passportNo",label:e("page.tms.drivers.form.passportNo")},{component:"DatePicker",componentProps:{class:"w-full",format:"YYYY-MM-DD",placeholder:e("page.tms.drivers.form.passportExpiryPlaceholder"),valueFormat:"YYYY-MM-DD"},fieldName:"passportExpiry",label:e("page.tms.drivers.form.passportExpiry")},{component:"Input",componentProps:{placeholder:e("page.tms.drivers.form.phonePlaceholder")},fieldName:"phone",formItemClass:"col-span-2",label:e("page.tms.drivers.form.phone")}],{Form:s,formApi:o,focus:a,isDirty:u,resetForm:d,submitForm:h,watchEntity:v}=N({emptyValues:l,schema:i,firstInputId:"driver-form-name-input",wrapperClass:"grid-cols-2 gap-x-6"});return v(()=>p.driver,()=>p.mode),n({cancel:()=>{d()},focus:a,formApi:o,isDirty:u,resetForm:d,submit:()=>f(null,null,function*(){const c=yield h();c&&m("submit",c)})}),(c,Y)=>(P(),b(y(s)))}});export{F as _};
