import{u as V,s as E,t as D,r,o as y,k as _,l as b,d as m,e as a,b as F,f as d,L as P,a as H,F as S}from"./app-44623493.js";const T={class:"grid grid-cols-3 gap-6"},j={class:"col-span-3 sm:col-span-1"},A={class:"col-span-3 sm:col-span-1"},L={class:"col-span-2 sm:col-span-1"},O={class:"col-span-2 sm:col-span-1"},h={class:"col-span-3 sm:col-span-2"},C={class:"grid grid-cols-1"},N={class:"col"},w={name:"EmployeeDocumentForm"},I=Object.assign(w,{setup(u){const i=V(),l={type:"",title:"",description:"",startDate:"",endDate:"",media:[],mediaToken:"",mediaHash:""},c="employee/document/",n=E(c),o=D({...l}),p=D({type:"",isLoaded:!i.params.muuid}),g=s=>{var e;Object.assign(l,{...s,type:(e=s.type)==null?void 0:e.uuid}),Object.assign(o,P(l)),p.type=s.type.name,p.isLoaded=!0};return(s,e)=>{const v=r("BaseSelectSearch"),$=r("BaseInput"),f=r("DatePicker"),U=r("BaseTextarea"),k=r("MediaUpload"),B=r("FormAction");return y(),_(B,{"no-data-fetch":"","init-url":c,uuid:a(i).params.uuid,"module-uuid":a(i).params.muuid,"init-form":l,form:o,"set-form":g,redirect:{name:"EmployeeDocument",params:{uuid:a(i).params.uuid}}},{default:b(()=>[m("div",T,[m("div",j,[p.isLoaded?(y(),_(v,{key:0,name:"type",label:s.$trans("global.select",{attribute:s.$trans("employee.document_type.document_type")}),modelValue:o.type,"onUpdate:modelValue":e[0]||(e[0]=t=>o.type=t),error:a(n).type,"onUpdate:error":e[1]||(e[1]=t=>a(n).type=t),"label-prop":"name","value-prop":"uuid","init-search":p.type,"init-search-key":"name","search-action":"option/list","additional-search-query":{type:"document_type"}},null,8,["label","modelValue","error","init-search"])):F("",!0)]),m("div",A,[d($,{type:"text",modelValue:o.title,"onUpdate:modelValue":e[2]||(e[2]=t=>o.title=t),name:"title",label:s.$trans("employee.document.props.title"),error:a(n).title,"onUpdate:error":e[3]||(e[3]=t=>a(n).title=t),autofocus:""},null,8,["modelValue","label","error"])]),m("div",L,[d(f,{modelValue:o.startDate,"onUpdate:modelValue":e[4]||(e[4]=t=>o.startDate=t),name:"startDate",label:s.$trans("employee.document.props.start_date"),error:a(n).startDate,"onUpdate:error":e[5]||(e[5]=t=>a(n).startDate=t)},null,8,["modelValue","label","error"])]),m("div",O,[d(f,{modelValue:o.endDate,"onUpdate:modelValue":e[6]||(e[6]=t=>o.endDate=t),name:"endDate",label:s.$trans("employee.document.props.end_date"),error:a(n).endDate,"onUpdate:error":e[7]||(e[7]=t=>a(n).endDate=t)},null,8,["modelValue","label","error"])]),m("div",h,[d(U,{modelValue:o.description,"onUpdate:modelValue":e[8]||(e[8]=t=>o.description=t),name:"description",label:s.$trans("employee.document.props.description"),error:a(n).description,"onUpdate:error":e[9]||(e[9]=t=>a(n).description=t)},null,8,["modelValue","label","error"])])]),m("div",C,[m("div",N,[d(k,{multiple:"",label:s.$trans("general.file"),module:"employee_document",media:o.media,onSetHash:e[10]||(e[10]=t=>o.mediaHash=t),onSetToken:e[11]||(e[11]=t=>o.mediaToken=t)},null,8,["label","media"])])])]),_:1},8,["uuid","module-uuid","form","redirect"])}}}),M={name:"EmployeeDocumentAction"},R=Object.assign(M,{props:{employee:{type:Object,default(){return{}}}},setup(u){const i=V();return(l,c)=>{const n=r("PageHeaderAction"),o=r("PageHeader"),p=r("ParentTransition");return y(),H(S,null,[d(o,{title:l.$trans(a(i).meta.trans,{attribute:l.$trans(a(i).meta.label)}),navs:[{label:l.$trans("employee.employee"),path:"EmployeeList"},{label:u.employee.contact.name,path:{name:"EmployeeShow",params:{uuid:u.employee.uuid}}},{label:l.$trans("employee.document.document"),path:{name:"EmployeeDocument",params:{uuid:u.employee.uuid}}}]},{default:b(()=>[d(n,{name:"EmployeeDocument",title:l.$trans("employee.document.document"),actions:["list"]},null,8,["title"])]),_:1},8,["title","navs"]),d(p,{appear:"",visibility:!0},{default:b(()=>[d(I)]),_:1})],64)}}});export{R as default};
