import h from"./FilterBar-J9h-Lc5V.js";import{d as g,g as _,i as F,O as y,c as B}from"./index-DOFLUERq.js";import{_ as C}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./iconify-p99pbjf9.js";import"./common-DEIQtiPI.js";const O=g({__name:"default_list_filterbar",props:{fields:{},filters:{},sortBy:{default:"modified"},sortOrder:{default:"desc"},pageMeta:{default:void 0}},emits:["update:filters","filter-change","update:sortBy","update:sortOrder","sortChange"],setup(a,{emit:l}){const d=a,r=l,o=B(()=>{const e=d.fields||[];if(d.pageMeta?.hide_id_in_list===1||d.pageMeta?.hide_id_in_list===!0)return e.filter(t=>t.fieldname!=="name");if(e.some(t=>t.fieldname==="name")){const t=e.find(n=>n.fieldname==="name"),p=e.filter(n=>n.fieldname!=="name");return[t,...p]}else return[{fieldname:"name",label:"ID",fieldtype:"Data",in_standard_filter:1},...e]});function s(e){r("update:filters",e)}function f(){r("filter-change")}function m(e){r("update:sortBy",e)}function u(e){r("update:sortOrder",e)}function c(e,i){r("sortChange",e,i)}return(e,i)=>o.value.length>0?(_(),F(h,{key:0,fields:o.value,"model-value":a.filters,"show-sort":!0,"sort-by":a.sortBy,"sort-order":a.sortOrder,"page-meta":a.pageMeta,"onUpdate:modelValue":s,onFilterChange:f,"onUpdate:sortBy":m,"onUpdate:sortOrder":u,onSortChange:c},null,8,["fields","model-value","sort-by","sort-order","page-meta"])):y("",!0)}}),S=C(O,[["__scopeId","data-v-9ddf7623"]]);export{S as default};
