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