import{_ as j,az as x,aA as H,Q as I,r as s,c as y,o as d,a,w as n,aB as $,aC as F,l as r,t as u,ax as G,e as L,b as Q,Z,f as c,h as m,B as q,aD as J,aE as W,z as b,N as X,aF as Y,aG as ee,g as ae,E as ne,m as te,G as oe}from"./app-BOG5ezKh.js";import{A as le,f as se}from"./fields-3fuhfpcX.js";import{c as de}from"./crud-BhWWLrNT.js";import{A as ie}from"./AdminPageHeader-DmATz0CC.js";import"./apiAdmin-DBoC2A9r.js";import"./SaveOutlined-BfejBXOc.js";import"./datatable-D7avgBa3.js";import"./filter-Ben1TcU9.js";const re={components:{PlusOutlined:I,EditOutlined:H,DeleteOutlined:x,AddEdit:le,AdminPageHeader:ie},setup(){const{addEditUrl:e,initData:i,columns:h,filterableColumns:t}=se(),l=de(),{permsArray:C}=te();return oe(()=>{l.tableUrl.value={url:"expense-categories?fields=id,xid,name,description"},l.table.filterableColumns=t,l.fetch({page:1}),l.crudUrl.value=e,l.langKey.value="expense_category",l.initData.value={...i},l.formData.value={...i}}),{columns:h,...l,filterableColumns:t,permsArray:C}}},ue={class:"table-responsive"};function ce(e,i,h,t,l,C){const A=G,w=s("router-link"),g=F,E=$,S=s("AdminPageHeader"),D=s("PlusOutlined"),p=q,v=s("DeleteOutlined"),O=Z,_=Q,T=Y,B=W,P=ee,U=J,f=L,V=s("admin-page-filters"),N=s("AddEdit"),z=s("EditOutlined"),K=ne,M=s("admin-page-table-content");return d(),y(b,null,[a(S,null,{header:n(()=>[a(A,{title:e.$t("menu.expense_categories"),class:"p-0"},null,8,["title"])]),breadcrumb:n(()=>[a(E,{separator:"-",style:{"font-size":"12px"}},{default:n(()=>[a(g,null,{default:n(()=>[a(w,{to:{name:"admin.dashboard.index"}},{default:n(()=>[r(u(e.$t("menu.dashboard")),1)]),_:1})]),_:1}),a(g,null,{default:n(()=>[r(u(e.$t("menu.expense_manager")),1)]),_:1}),a(g,null,{default:n(()=>[r(u(e.$t("menu.expense_categories")),1)]),_:1})]),_:1})]),_:1}),a(V,null,{default:n(()=>[a(f,{gutter:[16,16]},{default:n(()=>[a(_,{xs:24,sm:24,md:12,lg:10,xl:10},{default:n(()=>[a(O,null,{default:n(()=>[t.permsArray.includes("expense_categories_create")||t.permsArray.includes("admin")?(d(),c(p,{key:0,type:"primary",onClick:e.addItem},{default:n(()=>[a(D),r(" "+u(e.$t("expense_category.add")),1)]),_:1},8,["onClick"])):m("v-if",!0),e.table.selectedRowKeys.length>0&&(t.permsArray.includes("expense_categories_delete")||t.permsArray.includes("admin"))?(d(),c(p,{key:1,type:"primary",onClick:e.showSelectedDeleteConfirm,danger:""},{icon:n(()=>[a(v)]),default:n(()=>[r(" "+u(e.$t("common.delete")),1)]),_:1},8,["onClick"])):m("v-if",!0)]),_:1})]),_:1}),a(_,{xs:24,sm:24,md:12,lg:14,xl:14},{default:n(()=>[a(f,{gutter:[16,16],justify:"end"},{default:n(()=>[a(_,{xs:24,sm:24,md:12,lg:12,xl:10},{default:n(()=>[a(U,{compact:""},{default:n(()=>[a(B,{style:{width:"25%"},value:e.table.searchColumn,"onUpdate:value":i[0]||(i[0]=o=>e.table.searchColumn=o),placeholder:e.$t("common.select_default_text",[""])},{default:n(()=>[(d(!0),y(b,null,X(t.filterableColumns,o=>(d(),c(T,{key:o.key},{default:n(()=>[r(u(o.value),1)]),_:2},1024))),128))]),_:1},8,["value","placeholder"]),a(P,{style:{width:"75%"},value:e.table.searchString,"onUpdate:value":i[1]||(i[1]=o=>e.table.searchString=o),"show-search":"",onChange:e.onTableSearch,onSearch:e.onTableSearch,loading:e.table.filterLoading},null,8,["value","onChange","onSearch","loading"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),a(M,null,{default:n(()=>[a(N,{addEditType:e.addEditType,visible:e.addEditVisible,url:e.addEditUrl,onAddEditSuccess:e.addEditSuccess,onClosed:e.onCloseAddEdit,formData:e.formData,data:e.viewData,pageTitle:e.pageTitle,successMessage:e.successMessage},null,8,["addEditType","visible","url","onAddEditSuccess","onClosed","formData","data","pageTitle","successMessage"]),a(f,null,{default:n(()=>[a(_,{span:24},{default:n(()=>[ae("div",ue,[a(K,{"row-selection":{selectedRowKeys:e.table.selectedRowKeys,onChange:e.onRowSelectChange,getCheckboxProps:o=>({disabled:!1,name:o.xid})},columns:t.columns,"row-key":o=>o.xid,"data-source":e.table.data,pagination:e.table.pagination,loading:e.table.loading,onChange:e.handleTableChange,bordered:"",size:"middle"},{bodyCell:n(({column:o,record:k})=>[o.dataIndex==="action"?(d(),y(b,{key:0},[t.permsArray.includes("expense_categories_edit")||t.permsArray.includes("admin")?(d(),c(p,{key:0,type:"primary",onClick:R=>e.editItem(k),style:{"margin-left":"4px"}},{icon:n(()=>[a(z)]),_:2},1032,["onClick"])):m("v-if",!0),t.permsArray.includes("expense_categories_delete")||t.permsArray.includes("admin")?(d(),c(p,{key:1,type:"primary",onClick:R=>e.showDeleteConfirm(k.xid),style:{"margin-left":"4px"}},{icon:n(()=>[a(v)]),_:2},1032,["onClick"])):m("v-if",!0)],64)):m("v-if",!0)]),_:1},8,["row-selection","columns","row-key","data-source","pagination","loading","onChange"])])]),_:1})]),_:1})]),_:1})],64)}const Ce=j(re,[["render",ce],["__file","/Users/rajeshkumawat/sites/stockifly/resources/js/main/views/expense-manager/expense-categories/index.vue"]]);export{Ce as default};
