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