import{u as C,o as n,k as p,c as m,w as e,b as t,e as b,d as u,t as r,l as s,aa as _,a9 as g,F as h,n as v,A as I,E as V,R as x,an as T,C as k,H as E,aG as S,T as B,U as F,B as w,p as f,D as z}from"./index-e345ed95.js";import{_ as D}from"./_plugin-vue_export-helper-c27b6911.js";const G={name:"ItemCardGrid",setup(){const{t:a}=C();return{t:a}},props:{items:{type:Array,required:!0},titleField:{type:String,default:"id"},enabledField:{type:String,default:"enable"},emptyIcon:{type:String,default:"mdi-alert-circle-outline"},emptyText:{type:String,default:null}},emits:["toggle-enabled","delete","edit"],computed:{displayEmptyText(){return this.emptyText||this.t("core.common.itemCard.noData")}},methods:{getItemTitle(a){return a[this.titleField]},getItemEnabled(a){return a[this.enabledField]},toggleEnabled(a){this.$emit("toggle-enabled",a)}}},A={class:"text-grey mt-4"},N=["title"];function U(a,R,o,i,j,d){return n(),p("div",null,[o.items.length===0?(n(),m(g,{key:0},{default:e(()=>[t(_,{cols:"12",class:"text-center pa-8"},{default:e(()=>[t(b,{size:"64",color:"grey-lighten-1"},{default:e(()=>[u(r(o.emptyIcon),1)]),_:1}),s("p",A,r(d.displayEmptyText),1)]),_:1})]),_:1})):(n(),m(g,{key:1},{default:e(()=>[(n(!0),p(h,null,v(o.items,(l,y)=>(n(),m(_,{key:y,cols:"12",md:"6",lg:"4",xl:"3"},{default:e(()=>[t(z,{class:"item-card hover-elevation",color:d.getItemEnabled(l)?"":"grey-lighten-4"},{default:e(()=>[s("div",{class:I(["item-status-indicator",{active:d.getItemEnabled(l)}])},null,2),t(V,{class:"d-flex justify-space-between align-center pb-1 pt-3"},{default:e(()=>[s("span",{class:"text-h4 text-truncate",title:d.getItemTitle(l)},r(d.getItemTitle(l)),9,N),t(x,{location:"top"},{activator:e(({props:c})=>[t(T,k({color:"primary","hide-details":"",density:"compact","model-value":d.getItemEnabled(l)},c,{"onUpdate:modelValue":q=>d.toggleEnabled(l)}),null,16,["model-value","onUpdate:modelValue"])]),default:e(()=>[s("span",null,r(d.getItemEnabled(l)?i.t("core.common.itemCard.enabled"):i.t("core.common.itemCard.disabled")),1)]),_:2},1024)]),_:2},1024),t(E,null,{default:e(()=>[S(a.$slots,"item-details",{item:l},void 0,!0)]),_:2},1024),t(B),t(F,{class:"pa-2"},{default:e(()=>[t(w),t(f,{variant:"text",size:"small",color:"error","prepend-icon":"mdi-delete",onClick:c=>a.$emit("delete",l)},{default:e(()=>[u(r(i.t("core.common.itemCard.delete")),1)]),_:2},1032,["onClick"]),t(f,{variant:"text",size:"small",color:"primary","prepend-icon":"mdi-pencil",onClick:c=>a.$emit("edit",l)},{default:e(()=>[u(r(i.t("core.common.itemCard.edit")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1032,["color"])]),_:2},1024))),128))]),_:3}))])}const P=D(G,[["render",U],["__scopeId","data-v-8feeeeca"]]);export{P as I};
