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