import{d as k,c as v,e as i,f as s,h as w,j as l,B as r,s as b,g as c,n as u,t as o,p as C}from"./index-a0da86f0.js";import{_ as M}from"./_plugin-vue_export-helper-c27b6911.js";const B={class:"toolbar"},Q={class:"filters"},V={class:"view-toggle"},D=["title"],N=["title"],S=["disabled"],K=["disabled"],I=["disabled"],L=k({__name:"default_list_toolbar",props:{entity:{},searchQuery:{},viewMode:{},selectedKeys:{},loading:{type:Boolean}},emits:["update:searchQuery","update:viewMode","reload","create","delete-selected"],setup(_,{emit:g}){const f=_,a=g,p=v({get:()=>f.searchQuery,set:t=>a("update:searchQuery",t)}),d=v({get:()=>f.viewMode,set:t=>a("update:viewMode",t)});function y(){a("reload")}function m(){a("create")}function h(){a("delete-selected")}return(t,e)=>(u(),i("div",B,[s("div",Q,[w(l(C),{value:p.value,"onUpdate:value":e[0]||(e[0]=n=>p.value=n),placeholder:l(o)("Search"),clearable:"",style:{width:"200px"}},null,8,["value","placeholder"])]),s("div",V,[s("button",{class:r(["toggle-btn",{active:d.value==="list"}]),onClick:e[1]||(e[1]=n=>d.value="list"),title:l(o)("List View")},[...e[3]||(e[3]=[s("i",{class:"fa fa-list"},null,-1)])],10,D),s("button",{class:r(["toggle-btn",{active:d.value==="card"}]),onClick:e[2]||(e[2]=n=>d.value="card"),title:l(o)("Card View")},[...e[4]||(e[4]=[s("i",{class:"fa fa-th-large"},null,-1)])],10,N)]),s("button",{class:"refresh-btn",onClick:y,disabled:t.loading},[s("i",{class:r(t.loading?"fa fa-spinner fa-spin":"fa fa-refresh")},null,2)],8,S),t.selectedKeys.length===0?(u(),i("button",{key:0,class:"create-btn",onClick:m,disabled:t.loading},[e[5]||(e[5]=s("i",{class:"fa fa-plus"},null,-1)),b(" "+c(l(o)("Create")),1)],8,K)):(u(),i("button",{key:1,class:"delete-btn",onClick:h,disabled:t.loading},[e[6]||(e[6]=s("i",{class:"fa fa-trash"},null,-1)),b(" "+c(l(o)("Delete Selected"))+" ("+c(t.selectedKeys.length)+") ",1)],8,I))]))}});const j=M(L,[["__scopeId","data-v-d3c3ec18"]]);export{j as default};
