import{t as w,r as n,o as p,k as g,l as e,d as B,f as t,u as L,m as M,q as N,p as C,z as S,e as l,b as F,x as u,y as s,a as I,A as O,F as E}from"./app-44623493.js";const U={class:"grid grid-cols-3 gap-6"},q={class:"col-span-3 sm:col-span-1"},z={__name:"Filter",emits:["hide"],setup(m,{emit:k}){const r={title:""},d=w({...r});return(v,c)=>{const f=n("BaseInput"),y=n("FilterForm");return p(),g(y,{"init-form":r,form:d,onHide:c[1]||(c[1]=$=>k("hide"))},{default:e(()=>[B("div",U,[B("div",q,[t(f,{type:"text",modelValue:d.title,"onUpdate:modelValue":c[0]||(c[0]=$=>d.title=$),name:"title",label:v.$trans("employee.document.props.title")},null,8,["modelValue","label"])])])]),_:1},8,["form"])}}},G={name:"EmployeeDocumentList"},K=Object.assign(G,{props:{employee:{type:Object,default(){return{}}}},setup(m){const k=L(),r=M(),d=N("emitter");let v=["filter"];C("employee:edit")&&v.unshift("create");const c="employee/document/",f=S(!1),y=w({}),$=o=>{Object.assign(y,o)};return(o,i)=>{const V=n("PageHeaderAction"),A=n("PageHeader"),h=n("ParentTransition"),_=n("DataCell"),D=n("FloatingMenuItem"),H=n("FloatingMenu"),P=n("DataRow"),R=n("BaseButton"),T=n("DataTable"),j=n("ListItem");return p(),g(j,{"init-url":c,uuid:l(k).params.uuid,onSetItems:$},{header:e(()=>[m.employee.uuid?(p(),g(A,{key:0,title:o.$trans("employee.document.document"),navs:[{label:o.$trans("employee.employee"),path:"Employee"},{label:m.employee.contact.name,path:{name:"EmployeeShow",params:{uuid:m.employee.uuid}}}]},{default:e(()=>[t(V,{url:`employees/${m.employee.uuid}/documents/`,name:"EmployeeDocument",title:o.$trans("employee.document.document"),actions:l(v),"dropdown-actions":["print","pdf","excel"],onToggleFilter:i[0]||(i[0]=a=>f.value=!f.value)},null,8,["url","title","actions"])]),_:1},8,["title","navs"])):F("",!0)]),filter:e(()=>[t(h,{appear:"",visibility:f.value},{default:e(()=>[t(z,{onRefresh:i[1]||(i[1]=a=>l(d).emit("listItems")),onHide:i[2]||(i[2]=a=>f.value=!1)})]),_:1},8,["visibility"])]),default:e(()=>[t(h,{appear:"",visibility:!0},{default:e(()=>[t(T,{header:y.headers,meta:y.meta,module:"employee.document",onRefresh:i[4]||(i[4]=a=>l(d).emit("listItems"))},{actionButton:e(()=>[l(C)("employee:edit")?(p(),g(R,{key:0,onClick:i[3]||(i[3]=a=>l(r).push({name:"EmployeeDocumentCreate"}))},{default:e(()=>[u(s(o.$trans("global.add",{attribute:o.$trans("employee.document.document")})),1)]),_:1})):F("",!0)]),default:e(()=>[(p(!0),I(E,null,O(y.data,a=>(p(),g(P,{key:a.uuid},{default:e(()=>[t(_,{name:"title"},{default:e(()=>[u(s(a.title),1)]),_:2},1024),t(_,{name:"type"},{default:e(()=>[u(s(a.type.name),1)]),_:2},1024),t(_,{name:"startDate"},{default:e(()=>[u(s(a.startDate.formatted),1)]),_:2},1024),t(_,{name:"endDate"},{default:e(()=>[u(s(a.endDate.formatted),1)]),_:2},1024),t(_,{name:"createdAt"},{default:e(()=>[u(s(a.createdAt.formatted),1)]),_:2},1024),t(_,{name:"action"},{default:e(()=>[t(H,null,{default:e(()=>[t(D,{icon:"fas fa-arrow-circle-right",onClick:b=>l(r).push({name:"EmployeeDocumentShow",params:{uuid:m.employee.uuid,muuid:a.uuid}})},{default:e(()=>[u(s(o.$trans("general.show")),1)]),_:2},1032,["onClick"]),l(C)("employee:edit")?(p(),I(E,{key:0},[t(D,{icon:"fas fa-edit",onClick:b=>l(r).push({name:"EmployeeDocumentEdit",params:{uuid:m.employee.uuid,muuid:a.uuid}})},{default:e(()=>[u(s(o.$trans("general.edit")),1)]),_:2},1032,["onClick"]),t(D,{icon:"fas fa-copy",onClick:b=>l(r).push({name:"EmployeeDocumentDuplicate",params:{uuid:m.employee.uuid,muuid:a.uuid}})},{default:e(()=>[u(s(o.$trans("general.duplicate")),1)]),_:2},1032,["onClick"]),t(D,{icon:"fas fa-trash",onClick:b=>l(d).emit("deleteItem",{uuid:m.employee.uuid,moduleUuid:a.uuid})},{default:e(()=>[u(s(o.$trans("general.delete")),1)]),_:2},1032,["onClick"])],64)):F("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["header","meta"])]),_:1})]),_:1},8,["uuid"])}}});export{K as default};
