vue3-easy-data-table
Advanced tools
Comparing version 1.5.29 to 1.5.30
@@ -491,3 +491,3 @@ var __defProp = Object.defineProperty; | ||
} | ||
function useHeaders(checkboxColumnWidth, expandColumnWidth, fixedCheckbox, fixedExpand, fixedIndex, headers, ifHasExpandSlot, indexColumnWidth, isMultipleSelectable, isServerSideMode, mustSort, serverOptionsComputed, showIndex, sortBy, sortType, multiSort, updateServerOptionsSort, emits) { | ||
function useHeaders(showIndexSymbol, checkboxColumnWidth, expandColumnWidth, fixedCheckbox, fixedExpand, fixedIndex, headers, ifHasExpandSlot, indexColumnWidth, isMultipleSelectable, isServerSideMode, mustSort, serverOptionsComputed, showIndex, sortBy, sortType, multiSort, updateServerOptionsSort, emits) { | ||
const hasFixedColumnsFromUser = computed(() => headers.value.findIndex((header) => header.fixed) !== -1); | ||
@@ -559,7 +559,7 @@ const fixedHeadersFromUser = computed(() => { | ||
const headerIndex = fixedIndex.value || hasFixedColumnsFromUser.value ? { | ||
text: "#", | ||
text: showIndexSymbol.value, | ||
value: "index", | ||
fixed: true, | ||
width: indexColumnWidth.value | ||
} : { text: "#", value: "index" }; | ||
} : { text: showIndexSymbol.value, value: "index" }; | ||
headersWithIndex = [headerIndex, ...headersWithExpand]; | ||
@@ -1196,2 +1196,6 @@ } | ||
default: "" | ||
}, | ||
showIndexSymbol: { | ||
type: String, | ||
default: "#" | ||
} | ||
@@ -1201,3 +1205,3 @@ }; | ||
var DataTable_vue_vue_type_style_index_1_scoped_true_lang = ""; | ||
const _withScopeId = (n) => (pushScopeId("data-v-30ede217"), n = n(), popScopeId(), n); | ||
const _withScopeId = (n) => (pushScopeId("data-v-5814f6fe"), n = n(), popScopeId(), n); | ||
const _hoisted_1 = ["id"]; | ||
@@ -1255,3 +1259,5 @@ const _hoisted_2 = ["onClick"]; | ||
"update:itemsSelected", | ||
"update:serverOptions" | ||
"update:serverOptions", | ||
"updatePageItems", | ||
"updateTotalItems" | ||
], | ||
@@ -1261,4 +1267,4 @@ setup(__props, { expose, emit: emits }) { | ||
useCssVars((_ctx) => ({ | ||
"698e0e58": unref(tableMinHeightPx), | ||
"46f1c6d0": unref(tableHeightPx) | ||
"524b179e": unref(tableMinHeightPx), | ||
"cfebeddc": unref(tableHeightPx) | ||
})); | ||
@@ -1297,3 +1303,4 @@ const { | ||
themeColor, | ||
rowsOfPageSeparatorMessage | ||
rowsOfPageSeparatorMessage, | ||
showIndexSymbol | ||
} = toRefs(props); | ||
@@ -1332,3 +1339,3 @@ const tableHeightPx = computed(() => tableHeight.value ? `${tableHeight.value}px` : null); | ||
getMultiSortNumber | ||
} = useHeaders(checkboxColumnWidth, expandColumnWidth, fixedCheckbox, fixedExpand, fixedIndex, headers, ifHasExpandSlot, indexColumnWidth, isMultipleSelectable, isServerSideMode, mustSort, serverOptionsComputed, showIndex, sortBy, sortType, multiSort, updateServerOptionsSort, emits); | ||
} = useHeaders(showIndexSymbol, checkboxColumnWidth, expandColumnWidth, fixedCheckbox, fixedExpand, fixedIndex, headers, ifHasExpandSlot, indexColumnWidth, isMultipleSelectable, isServerSideMode, mustSort, serverOptionsComputed, showIndex, sortBy, sortType, multiSort, updateServerOptionsSort, emits); | ||
const { | ||
@@ -1419,2 +1426,8 @@ rowsItemsComputed, | ||
}, { deep: true }); | ||
watch(pageItems, (value) => { | ||
emits("updatePageItems", value); | ||
}, { deep: true }); | ||
watch(totalItems, (value) => { | ||
emits("updateTotalItems", value); | ||
}, { deep: true }); | ||
expose({ | ||
@@ -1635,3 +1648,3 @@ currentPageFirstIndex, | ||
}); | ||
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-30ede217"]]); | ||
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5814f6fe"]]); | ||
if (typeof window !== "undefined" && window.Vue) { | ||
@@ -1638,0 +1651,0 @@ window.Vue.createApp({}).component("Vue3EasyDataTable", DataTable); |
@@ -1,1 +0,1 @@ | ||
(function(e,C){typeof exports=="object"&&typeof module!="undefined"?module.exports=C(require("vue")):typeof define=="function"&&define.amd?define(["vue"],C):(e=typeof globalThis!="undefined"?globalThis:e||self,e["vue3-easy-data-table"]=C(e.Vue))})(this,function(e){"use strict";var Xt=Object.defineProperty,Yt=Object.defineProperties;var Zt=Object.getOwnPropertyDescriptors;var ve=Object.getOwnPropertySymbols;var ea=Object.prototype.hasOwnProperty,ta=Object.prototype.propertyIsEnumerable;var Ve=(e,C,S)=>C in e?Xt(e,C,{enumerable:!0,configurable:!0,writable:!0,value:S}):e[C]=S,D=(e,C)=>{for(var S in C||(C={}))ea.call(C,S)&&Ve(e,S,C[S]);if(ve)for(var S of ve(C))ta.call(C,S)&&Ve(e,S,C[S]);return e},oe=(e,C)=>Yt(e,Zt(C));var C="",S=(o,l)=>{const t=o.__vccOpts||o;for(const[a,m]of l)t[a]=m;return t};const Ae=o=>(e.pushScopeId("data-v-e0a0b7f0"),o=o(),e.popScopeId(),o),Re=["onClick"],Le=["checked"],Te=Ae(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var Fe=S(e.defineComponent({__name:"MultipleSelectCheckBox",props:{status:{type:String,required:!0}},emits:["change"],setup(o,{emit:l}){const t=o;e.useCssVars(g=>({"51ab8a49":e.unref(s)}));const a=e.computed(()=>t.status==="allSelected"),m=()=>{l("change",!a.value)},s=e.inject("themeColor");return(g,n)=>(e.openBlock(),e.createElementBlock("div",{class:"easy-checkbox",onClick:e.withModifiers(m,["stop","prevent"])},[e.createElementVNode("input",{type:"checkbox",checked:e.unref(a),class:e.normalizeClass(o.status)},null,10,Le),Te],8,Re))}}),[["__scopeId","data-v-e0a0b7f0"]]),na="";const De=o=>(e.pushScopeId("data-v-7e69a276"),o=o(),e.popScopeId(),o),ze=["checked"],He=De(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var Me=S(e.defineComponent({__name:"SingleSelectCheckBox",props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(o,{emit:l}){e.useCssVars(a=>({fdaf7e9e:e.unref(t)}));const t=e.inject("themeColor");return(a,m)=>(e.openBlock(),e.createElementBlock("div",{class:"easy-checkbox",onClick:m[0]||(m[0]=e.withModifiers(s=>l("change"),["stop","prevent"]))},[e.createElementVNode("input",{type:"checkbox",checked:o.checked},null,8,ze),He]))}}),[["__scopeId","data-v-7e69a276"]]),oa="";const Oe=o=>(e.pushScopeId("data-v-4ca5de3a"),o=o(),e.popScopeId(),o),je={class:"easy-data-table__rows-selector"},We={class:"rows-input"},qe=Oe(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),Je=["onClick"];var Ue=S(e.defineComponent({__name:"RowsSelector",props:{modelValue:{type:Number,required:!0},rowsItems:{type:Array,required:!0}},emits:["update:modelValue"],setup(o,{emit:l}){const t=o;e.useCssVars(f=>({"1b889342":e.unref(y)}));const a=e.ref(!1),m=e.ref(!1),s=e.inject("dataTable");e.watch(a,f=>{if(f&&s){const b=window.innerHeight,_=s.value.getBoundingClientRect().height,R=s.value.getBoundingClientRect().top;b-(_+R)<=100?m.value=!0:m.value=!1}});const g=e.computed({get:()=>t.modelValue,set:f=>{l("update:modelValue",f)}}),n=f=>{g.value=f,a.value=!1},r=(f,b)=>{let _=f.parentNode;for(;_!=null;){if(_.classList&&_.classList.contains(b))return!0;_=_.parentNode}return!1},i=f=>{r(f.target,"easy-data-table__rows-selector")||(a.value=!1)};e.onMounted(()=>{document.addEventListener("click",i)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",i)});const y=e.inject("themeColor");return(f,b)=>(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:b[0]||(b[0]=_=>a.value=!a.value)},[e.createElementVNode("div",We,e.toDisplayString(e.unref(g)),1),qe]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:a.value,inside:m.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.rowsItems,_=>(e.openBlock(),e.createElementBlock("li",{key:_,class:e.normalizeClass({selected:_===e.unref(g)}),onClick:R=>n(_)},e.toDisplayString(_),11,Je))),128))],2)]))}}),[["__scopeId","data-v-4ca5de3a"]]),sa="";const le=o=>(e.pushScopeId("data-v-1fa3a520"),o=o(),e.popScopeId(),o),Ge={class:"lds-ring"},Ke=[le(()=>e.createElementVNode("div",null,null,-1)),le(()=>e.createElementVNode("div",null,null,-1)),le(()=>e.createElementVNode("div",null,null,-1)),le(()=>e.createElementVNode("div",null,null,-1))];var Qe=S(e.defineComponent({__name:"Loading",setup(o){e.useCssVars(t=>({"26774109":e.unref(l)}));const l=e.inject("themeColor");return(t,a)=>(e.openBlock(),e.createElementBlock("div",Ge,Ke))}}),[["__scopeId","data-v-1fa3a520"]]),fa="";const Xe={class:"loader-line"};var Ye=S(e.defineComponent({__name:"LoadingLine",setup(o){e.useCssVars(t=>({"0d327f57":e.unref(l)}));const l=e.inject("themeColor");return(t,a)=>(e.openBlock(),e.createElementBlock("div",Xe))}}),[["__scopeId","data-v-7d281cac"]]),ga="";const Ze={class:"buttons-pagination"},et=["onClick"];var tt=S(e.defineComponent({__name:"ButtonsPagination",props:{maxPaginationNumber:{type:Number,required:!0},currentPaginationNumber:{type:Number,required:!0}},emits:["updatePage"],setup(o,{emit:l}){const t=o;e.useCssVars(n=>({"40dd4f07":e.unref(g)}));const a=7,m=n=>{n.type==="button"&&!n.active&&l("updatePage",n.page)},s=e.computed(()=>{const n=[];if(t.maxPaginationNumber<=a)for(let r=1;r<=t.maxPaginationNumber;r+=1)n.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if([1,2,t.maxPaginationNumber,t.maxPaginationNumber-1].includes(t.currentPaginationNumber))for(let r=1;r<=a;r+=1)if(r<=3)n.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if(r===4)n.push({type:"omission"});else{const i=t.maxPaginationNumber-(a-r);n.push({type:"button",page:i,active:i===t.currentPaginationNumber,activePrev:i+1===t.currentPaginationNumber})}else if([3,4].includes(t.currentPaginationNumber))for(let r=1;r<=a;r+=1)r<=5?n.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber}):r===6?n.push({type:"omission"}):n.push({type:"button",page:t.maxPaginationNumber,active:t.maxPaginationNumber===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if([t.maxPaginationNumber-2,t.maxPaginationNumber-3].includes(t.currentPaginationNumber))for(let r=1;r<=a;r+=1)if(r===1)n.push({type:"button",page:1,active:t.currentPaginationNumber===1,activePrev:r+1===t.currentPaginationNumber});else if(r===2)n.push({type:"omission"});else{const i=t.maxPaginationNumber-(a-r);n.push({type:"button",page:i,active:i===t.currentPaginationNumber,activePrev:i+1===t.currentPaginationNumber})}else for(let r=1;r<=a;r+=1)if(r===1)n.push({type:"button",page:1,active:t.currentPaginationNumber===1,activePrev:r+1===t.currentPaginationNumber});else if(r===2||r===6)n.push({type:"omission"});else if(r===7)n.push({type:"button",page:t.maxPaginationNumber,active:t.maxPaginationNumber===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else{const i=4-r,y=t.currentPaginationNumber-i;n.push({type:"button",page:y,active:y===t.currentPaginationNumber,activePrev:y+1===t.currentPaginationNumber})}return n}),g=e.inject("themeColor");return(n,r)=>(e.openBlock(),e.createElementBlock("div",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(i,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:e.normalizeClass(["item",{button:i.type==="button",active:i.type==="button"&&i.active,"active-prev":i.type==="button"&&i.activePrev,omission:i.type==="omission"}]),onClick:f=>m(i)},e.toDisplayString(i.type==="button"?i.page:"..."),11,et))),128))]))}}),[["__scopeId","data-v-4c681fa2"]]),ha="";const fe=o=>(e.pushScopeId("data-v-c9da5286"),o=o(),e.popScopeId(),o),at=[fe(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],nt=[fe(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var rt=S(e.defineComponent({__name:"PaginationArrows",props:{isFirstPage:{type:Boolean,required:!1},isLastPage:{type:Boolean,required:!1}},emits:["clickPrevPage","clickNextPage"],setup(o,{emit:l}){const t=e.useSlots();return(a,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["previous-page__click-button",{"first-page":o.isFirstPage}]),onClick:m[0]||(m[0]=s=>l("clickPrevPage"))},at,2),e.unref(t).buttonsPagination?e.renderSlot(a.$slots,"buttonsPagination",{key:0},void 0,!0):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["next-page__click-button",{"last-page":o.isLastPage}]),onClick:m[1]||(m[1]=s=>l("clickNextPage"))},nt,2)],64))}}),[["__scopeId","data-v-c9da5286"]]);function ot(o,l,t,a){return{clickRow:(s,g)=>{if(o.value!==g)return;const n=D({},s);if(l.value){const{checkbox:r}=s;delete n.checkbox,n.isSelected=r}if(t.value){const{index:r}=s;delete n.index,n.indexInCurrentPage=r}a("clickRow",n)}}}function lt(o,l,t){const a=e.ref([]);return{expandingItemIndexList:a,updateExpandingItemIndexList:(g,n,r)=>{r.stopPropagation();const i=a.value.indexOf(g);if(i!==-1)a.value.splice(i,1);else{const y=o.value.findIndex(f=>JSON.stringify(f)===JSON.stringify(n));t("expandRow",l.value+y,n),a.value.push(l.value+y)}},clearExpandingItemIndexList:()=>{a.value=[]}}}function st(o){const l=e.computed(()=>o.value.filter(m=>m.fixed)),t=e.computed(()=>l.value.length?l.value[l.value.length-1].value:""),a=e.computed(()=>{if(!l.value.length)return[];const m=l.value.map(s=>{var g;return(g=s.width)!=null?g:100});return l.value.map((s,g)=>{var n,r;return{value:s.value,fixed:(n=s.fixed)!=null?n:!0,width:(r=s.width)!=null?r:100,distance:g===0?0:m.reduce((i,y,f)=>{let b=i;return f<g&&(b+=y),b})}})});return{fixedHeaders:l,lastFixedColumn:t,fixedColumnsInfos:a}}function it(o,l,t,a,m,s,g,n,r,i,y,f,b,_,R,k,B,z){const T=e.computed(()=>s.value.findIndex(h=>h.fixed)!==-1),d=e.computed(()=>T.value?s.value.filter(h=>h.fixed):[]),x=e.computed(()=>s.value.filter(h=>!h.fixed)),P=(h,I)=>Array.isArray(h)&&Array.isArray(I)?{sortBy:h,sortDesc:I.map(N=>N==="desc")}:h!==""?{sortBy:_.value,sortDesc:R.value==="desc"}:null,u=e.ref(P(_.value,R.value)),v=e.computed(()=>{var se;const I=[...d.value,...x.value].map(K=>{const A=Object.assign(K);if(A.sortable&&(A.sortType="none"),f.value)if(Array.isArray(f.value.sortBy)&&Array.isArray(f.value.sortType)&&f.value.sortBy.includes(A.value)){const X=f.value.sortBy.indexOf(A.value);A.sortType=f.value.sortType[X]}else A.value===f.value.sortBy&&f.value.sortType&&(A.sortType=f.value.sortType);if(u.value&&Array.isArray(u.value.sortBy)&&Array.isArray(u.value.sortDesc)&&u.value.sortBy.includes(A.value)){const X=u.value.sortBy.indexOf(A.value);A.sortType=u.value.sortDesc[X]?"desc":"asc"}else u.value&&A.value===u.value.sortBy&&(A.sortType=u.value.sortDesc?"desc":"asc");return A});let N=[];g.value?N=[a.value||T.value?{text:"",value:"expand",fixed:!0,width:l.value}:{text:"",value:"expand"},...I]:N=I;let F=[];b.value?F=[m.value||T.value?{text:"#",value:"index",fixed:!0,width:n.value}:{text:"#",value:"index"},...N]:F=N;let q=[];return r.value?q=[t.value||T.value?{text:"checkbox",value:"checkbox",fixed:!0,width:(se=o.value)!=null?se:36}:{text:"checkbox",value:"checkbox"},...F]:q=F,q}),w=e.computed(()=>v.value.map(h=>h.value));return{clientSortOptions:u,headerColumns:w,headersForRender:v,updateSortField:(h,I)=>{let N=null;if(I==="none"?N="asc":I==="asc"?N="desc":N=y.value?"asc":null,i.value&&B(h,N),u.value&&Array.isArray(u.value.sortBy)&&Array.isArray(u.value.sortDesc)){const F=u.value.sortBy.indexOf(h);F===-1?N!==null&&(u.value.sortBy.push(h),u.value.sortDesc.push(N==="desc")):N===null?(u.value.sortDesc.splice(F,1),u.value.sortBy.splice(F,1)):u.value.sortDesc[F]=N==="desc"}else N===null?u.value=null:u.value={sortBy:h,sortDesc:N==="desc"};z("updateSort",{sortType:N,sortBy:h})},isMultiSorting:h=>f.value&&Array.isArray(f.value.sortBy)?f.value.sortBy.includes(h):u.value&&Array.isArray(u.value.sortBy)?u.value.sortBy.includes(h):!1,getMultiSortNumber:h=>f.value&&Array.isArray(f.value.sortBy)?f.value.sortBy.indexOf(h)+1:u.value&&Array.isArray(u.value.sortBy)?u.value.sortBy.indexOf(h)+1:!1}}function ct(o,l,t,a,m,s,g,n,r){const i=e.computed(()=>(o.value-1)*m.value+1),y=e.computed(()=>t.value?Math.min(r.value,o.value*m.value):Math.min(n.value.length,o.value*m.value)),f=e.computed(()=>t.value?a.value:n.value.slice(i.value-1,y.value)),b=e.computed(()=>g.value?f.value.map((k,B)=>D({index:i.value+B},k)):f.value),_=e.computed(()=>s.value.length===0||s.value.every(B=>n.value.findIndex(z=>JSON.stringify(B)===JSON.stringify(z))===-1)?"noneSelected":s.value.length===n.value.length&&s.value.every(z=>n.value.findIndex(T=>JSON.stringify(z)===JSON.stringify(T))!==-1)?"allSelected":"partSelected"),R=e.computed(()=>l.value?_.value==="allSelected"?b.value.map(k=>D({checkbox:!0},k)):_.value==="noneSelected"?b.value.map(k=>D({checkbox:!1},k)):b.value.map(k=>{const B=s.value.findIndex(z=>{const T=D({},k);return delete T.index,JSON.stringify(z)===JSON.stringify(T)})!==-1;return D({checkbox:B},k)}):b.value);return{currentPageFirstIndex:i,currentPageLastIndex:y,multipleSelectStatus:_,pageItems:R}}function dt(o,l,t,a,m,s,g){const n=e.ref(s.value?s.value.page:o.value),r=e.computed(()=>Math.ceil(a.value/m.value)),i=e.computed(()=>r.value===0||n.value===r.value),y=e.computed(()=>n.value===1);return{currentPaginationNumber:n,maxPaginationNumber:r,isLastPage:i,isFirstPage:y,nextPage:()=>{if(a.value!==0&&!i.value&&!t.value)if(l.value){const k=n.value+1;g(k)}else n.value+=1},prevPage:()=>{if(a.value!==0&&!y.value&&!t.value)if(l.value){const k=n.value-1;g(k)}else n.value-=1},updatePage:k=>{t.value||(l.value?g(k):n.value=k)},updateCurrentPaginationNumber:k=>{n.value=k}}}function ut(o,l,t,a){const m=e.computed(()=>!o.value&&l.value.findIndex(n=>n===a.value)===-1?[a.value,...l.value]:l.value),s=e.ref(t.value?t.value.rowsPerPage:a.value);return{rowsItemsComputed:m,rowsPerPageRef:s,updateRowsPerPage:n=>{s.value=n}}}function pt(o,l,t){const a=e.computed({get:()=>{if(o.value){const{page:n,rowsPerPage:r,sortBy:i,sortType:y}=o.value;return{page:n,rowsPerPage:r,sortBy:i!=null?i:null,sortType:y!=null?y:null}}return null},set:n=>{t("update:serverOptions",n)}});return{serverOptionsComputed:a,updateServerOptionsPage:n=>{a.value&&(a.value=oe(D({},a.value),{page:n}))},updateServerOptionsSort:(n,r)=>{if(a.value)if(l.value&&Array.isArray(a.value.sortBy)&&Array.isArray(a.value.sortType)){const i=a.value.sortBy.findIndex(y=>y===n);i===-1&&r!==null&&(a.value.sortBy.push(n),a.value.sortType.push(r)),r===null?(a.value.sortBy.splice(i,1),a.value.sortType.splice(i,1)):a.value.sortType[i]=r}else a.value=oe(D({},a.value),{sortBy:r!==null?n:null,sortType:r})},updateServerOptionsRowsPerPage:n=>{a.value&&(a.value=oe(D({},a.value),{page:1,rowsPerPage:n}))}}}function V(o,l){if(o.includes(".")){let t="";const a=o.split("."),{length:m}=a;let s=0;for(;s<m&&(t=s===0?l[a[s]]:t[a[s]],s+=1,t!==void 0););return t}return l[o]}function ft(o,l){const t=V(o,l);return Array.isArray(t)?t.join(","):t}function mt(o,l,t,a,m,s,g,n,r,i){const y=d=>{if(typeof s.value=="string"&&s.value!=="")return V(s.value,d);if(Array.isArray(s.value)){let x="";return s.value.forEach(P=>{x+=V(P,d)}),x}return Object.values(d).join(" ")},f=e.computed(()=>{if(!t.value&&g.value!==""){const d=new RegExp(g.value,"i");return a.value.filter(x=>d.test(y(x)))}return a.value}),b=e.computed(()=>{let d=[...f.value];return l.value?(l.value.forEach(x=>{d=d.filter(P=>{const{field:u,comparison:v,criteria:w}=x;if(typeof v=="function")return v(V(u,P),w);const L=V(u,P);switch(v){case"=":return L===w;case"!=":return L!==w;case">":return L>w;case"<":return L<w;case"<=":return L<=w;case">=":return L>=w;case"between":return L>=Math.min(...w)&&L<=Math.max(...w);default:return L===w}})}),d):f.value});e.watch(b,d=>{l.value&&i("updateFilter",d)},{immediate:!0,deep:!0});function _(d,x,P,u){const v=d[u],w=x[u];return(u===0?P:_(d,x,P,u-1)).sort((O,G)=>{let h=!0;for(let I=0;I<u;I+=1)if(V(d[I],O)!==V(d[I],G)){h=!1;break}return h?V(v,O)<V(v,G)?w?1:-1:V(v,O)>V(v,G)?w?-1:1:0:0})}const R=e.computed(()=>{if(t.value)return a.value;if(o.value===null)return b.value;const{sortBy:d,sortDesc:x}=o.value,P=[...b.value];return r&&Array.isArray(d)&&Array.isArray(x)?d.length===0?P:_(d,x,P,d.length-1):P.sort((u,v)=>V(d,u)<V(d,v)?x?1:-1:V(d,u)>V(d,v)?x?-1:1:0)}),k=e.computed(()=>t.value?n.value:R.value.length),B=e.computed({get:()=>{var d;return(d=m.value)!=null?d:[]},set:d=>{i("update:itemsSelected",d)}});return{totalItems:R,selectItemsComputed:B,totalItemsLength:k,toggleSelectAll:d=>{B.value=d?R.value:[]},toggleSelectItem:d=>{const x=d.checkbox;if(delete d.checkbox,delete d.index,x)B.value=B.value.filter(P=>JSON.stringify(P)!==JSON.stringify(d)),i("deselectRow",d);else{const P=B.value;P.unshift(d),B.value=P,i("selectRow",d)}}}}var gt={alternating:{type:Boolean,default:!1},buttonsPagination:{type:Boolean,default:!1},checkboxColumnWidth:{type:Number,default:null},currentPage:{type:Number,default:1},emptyMessage:{type:String,default:"No Available Data"},expandColumnWidth:{type:Number,default:36},filterOptions:{type:Array,default:null},fixedExpand:{type:Boolean,default:!1},fixedHeader:{type:Boolean,default:!0},fixedCheckbox:{type:Boolean,default:!1},fixedIndex:{type:Boolean,default:!1},headerTextDirection:{type:String,default:"left"},bodyTextDirection:{type:String,default:"left"},hideFooter:{type:Boolean,default:!1},hideRowsPerPage:{type:Boolean,default:!1},hideHeader:{type:Boolean,default:!1},indexColumnWidth:{type:Number,default:60},itemsSelected:{type:Array,default:null},loading:{type:Boolean,deault:!1},rowsPerPage:{type:Number,default:25},rowsItems:{type:Array,default:()=>[25,50,100]},rowsPerPageMessage:{type:String,default:"rows per page:"},searchField:{type:[String,Array],default:""},searchValue:{type:String,default:""},serverOptions:{type:Object,default:null},serverItemsLength:{type:Number,default:0},showIndex:{type:Boolean,default:!1},sortBy:{type:[String,Array],default:""},sortType:{type:[String,Array],default:"asc"},multiSort:{type:Boolean,default:!1},tableMinHeight:{type:Number,default:180},tableHeight:{type:Number,default:null},themeColor:{type:String,default:"#42b883"},tableClassName:{type:String,default:""},headerClassName:{type:String,default:""},headerItemClassName:{type:[Function,String],default:""},bodyRowClassName:{type:[Function,String],default:""},bodyExpandRowClassName:{type:[Function,String],default:""},bodyItemClassName:{type:[Function,String],default:""},noHover:{type:Boolean,default:!1},borderCell:{type:Boolean,default:!1},mustSort:{type:Boolean,default:!1},rowsOfPageSeparatorMessage:{type:String,default:"of"},clickEventType:{type:String,default:"single"},clickRowToExpand:{type:Boolean,default:!1},tableNodeId:{type:String,default:""}},xa="",Pa="";const yt=o=>(e.pushScopeId("data-v-30ede217"),o=o(),e.popScopeId(),o),ht=["id"],_t=["onClick"],bt={key:2,class:"header-text"},kt={key:4,class:"multi-sort__number"},xt=["onClick","onDblclick"],Pt=["onClick"],Nt=["colspan"],St={key:0,class:"vue3-easy-data-table__loading"},Ct=yt(()=>e.createElementVNode("div",{class:"vue3-easy-data-table__loading-mask"},null,-1)),Bt={class:"loading-entity"},wt={key:1,class:"vue3-easy-data-table__message"},It={key:0,class:"vue3-easy-data-table__footer"},Et={key:0,class:"pagination__rows-per-page"},$t={class:"pagination__items-index"},vt=e.defineComponent({__name:"DataTable",props:oe(D({},gt),{items:{type:Array,required:!0},headers:{type:Array,required:!0}}),emits:["clickRow","selectRow","deselectRow","expandRow","updateSort","updateFilter","update:itemsSelected","update:serverOptions"],setup(o,{expose:l,emit:t}){const a=o;e.useCssVars(p=>({"698e0e58":e.unref(Vt),"46f1c6d0":e.unref(X)}));const{tableNodeId:m,clickEventType:s,bodyTextDirection:g,checkboxColumnWidth:n,currentPage:r,expandColumnWidth:i,filterOptions:y,fixedCheckbox:f,fixedExpand:b,fixedHeader:_,fixedIndex:R,headers:k,headerTextDirection:B,indexColumnWidth:z,items:T,itemsSelected:d,loading:x,mustSort:P,multiSort:u,rowsItems:v,rowsPerPage:w,searchField:L,searchValue:O,serverItemsLength:G,serverOptions:h,showIndex:I,sortBy:N,sortType:F,tableHeight:q,tableMinHeight:se,themeColor:K,rowsOfPageSeparatorMessage:A}=e.toRefs(a),X=e.computed(()=>q.value?`${q.value}px`:null),Vt=e.computed(()=>`${se.value}px`);e.provide("themeColor",K.value);const j=e.useSlots(),At=e.computed(()=>!!j.pagination),Rt=e.computed(()=>!!j.loading),ge=e.computed(()=>!!j.expand),Lt=e.computed(()=>!!j.body),ye=e.ref(),ce=e.ref();e.provide("dataTable",ye);const he=e.ref(!1);e.onMounted(()=>{ce.value.addEventListener("scroll",()=>{he.value=ce.value.scrollLeft>0})});const de=e.computed(()=>d.value!==null),J=e.computed(()=>h.value!==null),{serverOptionsComputed:ue,updateServerOptionsPage:Tt,updateServerOptionsSort:Ft,updateServerOptionsRowsPerPage:Dt}=pt(h,u,t),{clientSortOptions:_e,headerColumns:be,headersForRender:U,updateSortField:zt,isMultiSorting:Ht,getMultiSortNumber:Mt}=it(n,i,f,b,R,k,ge,z,de,J,P,ue,I,N,F,u,Ft,t),{rowsItemsComputed:ke,rowsPerPageRef:W,updateRowsPerPage:Ot}=ut(J,v,h,w),{totalItems:jt,selectItemsComputed:Wt,totalItemsLength:ie,toggleSelectAll:qt,toggleSelectItem:Jt}=mt(_e,y,J,T,d,L,O,G,u,t),{currentPaginationNumber:M,maxPaginationNumber:Y,isLastPage:Z,isFirstPage:ee,nextPage:te,prevPage:ae,updatePage:ne,updateCurrentPaginationNumber:Ut}=dt(r,J,x,ie,W,h,Tt),{currentPageFirstIndex:xe,currentPageLastIndex:Pe,multipleSelectStatus:Ne,pageItems:Q}=ct(M,de,J,T,W,Wt,I,jt,ie),re=e.computed(()=>M.value===0?0:(M.value-1)*W.value),{expandingItemIndexList:Se,updateExpandingItemIndexList:Ce,clearExpandingItemIndexList:Be}=lt(Q,re,t),{fixedHeaders:pe,lastFixedColumn:we,fixedColumnsInfos:Gt}=st(U),{clickRow:Ie}=ot(s,de,I,t),Kt=p=>{var c;const H=(c=p.width)!=null?c:pe.value.length?100:null;if(H)return`width: ${H}px; min-width: ${H}px;`},Ee=(p,H="th")=>{if(!pe.value.length)return;const c=Gt.value.find(E=>E.value===p);if(c)return`left: ${c.distance}px;z-index: ${H==="th"?3:1};position: sticky;`};return e.watch(x,(p,H)=>{ue.value&&p===!1&&H===!0&&(Ut(ue.value.page),Be())}),e.watch(W,p=>{J.value?Dt(p):ne(1)}),e.watch([O,y],()=>{J.value||ne(1)}),e.watch([M,_e,L,O,y],()=>{Be()},{deep:!0}),l({currentPageFirstIndex:xe,currentPageLastIndex:Pe,clientItemsLength:ie,maxPaginationNumber:Y,currentPaginationNumber:M,isLastPage:Z,isFirstPage:ee,nextPage:te,prevPage:ae,updatePage:ne,rowsPerPageOptions:ke,rowsPerPageActiveOption:W,updateRowsPerPageActiveOption:Ot}),(p,H)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataTable",ref:ye,class:e.normalizeClass(["vue3-easy-data-table",[p.tableClassName]])},[e.createElementVNode("div",{ref_key:"tableBody",ref:ce,class:e.normalizeClass(["vue3-easy-data-table__main",{"fixed-header":e.unref(_),"fixed-height":e.unref(q),"show-shadow":he.value,"table-fixed":e.unref(pe).length,hoverable:!p.noHover,"border-cell":p.borderCell}])},[e.createElementVNode("table",{id:e.unref(m)},[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(U),(c,E)=>(e.openBlock(),e.createElementBlock("col",{key:E,style:e.normalizeStyle(Kt(c))},null,4))),128))]),e.unref(U).length&&!p.hideHeader?(e.openBlock(),e.createElementBlock("thead",{key:0,class:e.normalizeClass(["vue3-easy-data-table__header",[p.headerClassName]])},[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(U),(c,E)=>(e.openBlock(),e.createElementBlock("th",{key:E,class:e.normalizeClass([{sortable:c.sortable,none:c.sortable&&c.sortType==="none",desc:c.sortable&&c.sortType==="desc",asc:c.sortable&&c.sortType==="asc",shadow:c.value===e.unref(we)},typeof p.headerItemClassName=="string"?p.headerItemClassName:p.headerItemClassName(c,E+1)]),style:e.normalizeStyle(Ee(c.value)),onClick:e.withModifiers($=>c.sortable&&c.sortType?e.unref(zt)(c.value,c.sortType):null,["stop"])},[c.text==="checkbox"?(e.openBlock(),e.createBlock(Fe,{key:e.unref(Ne),status:e.unref(Ne),onChange:e.unref(qt)},null,8,["status","onChange"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["header",`direction-${e.unref(B)}`])},[e.unref(j)[`header-${c.value}`]?e.renderSlot(p.$slots,`header-${c.value}`,e.normalizeProps(e.mergeProps({key:0},c)),void 0,!0):e.unref(j)[`header-${c.value.toLowerCase()}`]?e.renderSlot(p.$slots,`header-${c.value.toLowerCase()}`,e.normalizeProps(e.mergeProps({key:1},c)),void 0,!0):(e.openBlock(),e.createElementBlock("span",bt,e.toDisplayString(c.text),1)),c.sortable?(e.openBlock(),e.createElementBlock("i",{key:c.sortType?c.sortType:"none",class:e.normalizeClass(["sortType-icon",{desc:c.sortType==="desc"}])},null,2)):e.createCommentVNode("",!0),e.unref(u)&&e.unref(Ht)(c.value)?(e.openBlock(),e.createElementBlock("span",kt,e.toDisplayString(e.unref(Mt)(c.value)),1)):e.createCommentVNode("",!0)],2))],14,_t))),128))])],2)):e.createCommentVNode("",!0),e.unref(Lt)?e.renderSlot(p.$slots,"body",e.normalizeProps(e.mergeProps({key:1},e.unref(Q))),void 0,!0):e.unref(be).length?(e.openBlock(),e.createElementBlock("tbody",{key:2,class:e.normalizeClass(["vue3-easy-data-table__body",{"row-alternation":p.alternating}])},[e.renderSlot(p.$slots,"body-prepend",e.normalizeProps(e.guardReactiveProps({items:e.unref(Q),pagination:{isFirstPage:e.unref(ee),isLastPage:e.unref(Z),currentPaginationNumber:e.unref(M),maxPaginationNumber:e.unref(Y),nextPage:e.unref(te),prevPage:e.unref(ae)},headers:e.unref(U)})),void 0,!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Q),(c,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E},[e.createElementVNode("tr",{class:e.normalizeClass([{"even-row":(E+1)%2===0},typeof p.bodyRowClassName=="string"?p.bodyRowClassName:p.bodyRowClassName(c,E+1)]),onClick:$=>{e.unref(Ie)(c,"single"),p.clickRowToExpand&&e.unref(Ce)(E+e.unref(re),c,$)},onDblclick:$=>e.unref(Ie)(c,"double")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(be),($,Qt)=>(e.openBlock(),e.createElementBlock("td",{key:Qt,style:e.normalizeStyle(Ee($,"td")),class:e.normalizeClass([{shadow:$===e.unref(we),"can-expand":$==="expand"},typeof p.bodyItemClassName=="string"?p.bodyItemClassName:p.bodyItemClassName($,E+1),`direction-${e.unref(g)}`]),onClick:$e=>$==="expand"?e.unref(Ce)(E+e.unref(re),c,$e):null},[e.unref(j)[`item-${$}`]?e.renderSlot(p.$slots,`item-${$}`,e.normalizeProps(e.mergeProps({key:0},c)),void 0,!0):e.unref(j)[`item-${$.toLowerCase()}`]?e.renderSlot(p.$slots,`item-${$.toLowerCase()}`,e.normalizeProps(e.mergeProps({key:1},c)),void 0,!0):$==="expand"?(e.openBlock(),e.createElementBlock("i",{key:2,class:e.normalizeClass(["expand-icon",{expanding:e.unref(Se).includes(e.unref(re)+E)}])},null,2)):$==="checkbox"?(e.openBlock(),e.createBlock(Me,{key:3,checked:c[$],onChange:$e=>e.unref(Jt)(c)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(e.unref(ft)($,c)),1)],64))],14,Pt))),128))],42,xt),e.unref(ge)&&e.unref(Se).includes(E+e.unref(re))?(e.openBlock(),e.createElementBlock("tr",{key:0,class:e.normalizeClass([{"even-row":(E+1)%2===0},typeof p.bodyExpandRowClassName=="string"?p.bodyExpandRowClassName:p.bodyExpandRowClassName(c,E+1)])},[e.createElementVNode("td",{colspan:e.unref(U).length,class:"expand"},[c.expandLoading?(e.openBlock(),e.createBlock(Ye,{key:0,class:"expand-loading"})):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"expand",e.normalizeProps(e.guardReactiveProps(c)),void 0,!0)],8,Nt)],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(p.$slots,"body-append",e.normalizeProps(e.guardReactiveProps({items:e.unref(Q),pagination:{isFirstPage:e.unref(ee),isLastPage:e.unref(Z),currentPaginationNumber:e.unref(M),maxPaginationNumber:e.unref(Y),nextPage:e.unref(te),prevPage:e.unref(ae),updatePage:e.unref(ne)},headers:e.unref(U)})),void 0,!0)],2)):e.createCommentVNode("",!0)],8,ht),e.unref(x)?(e.openBlock(),e.createElementBlock("div",St,[Ct,e.createElementVNode("div",Bt,[e.unref(Rt)?e.renderSlot(p.$slots,"loading",{key:0},void 0,!0):(e.openBlock(),e.createBlock(Qe,{key:1}))])])):e.createCommentVNode("",!0),!e.unref(Q).length&&!e.unref(x)?(e.openBlock(),e.createElementBlock("div",wt,e.toDisplayString(p.emptyMessage),1)):e.createCommentVNode("",!0)],2),p.hideFooter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",It,[p.hideRowsPerPage?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Et,[e.createTextVNode(e.toDisplayString(p.rowsPerPageMessage)+" ",1),e.createVNode(Ue,{modelValue:e.unref(W),"onUpdate:modelValue":H[0]||(H[0]=c=>e.isRef(W)?W.value=c:null),"rows-items":e.unref(ke)},null,8,["modelValue","rows-items"])])),e.createElementVNode("div",$t,e.toDisplayString(`${e.unref(xe)}\u2013${e.unref(Pe)}`)+" "+e.toDisplayString(e.unref(A))+" "+e.toDisplayString(e.unref(ie)),1),e.unref(At)?e.renderSlot(p.$slots,"pagination",e.normalizeProps(e.mergeProps({key:1},{isFirstPage:e.unref(ee),isLastPage:e.unref(Z),currentPaginationNumber:e.unref(M),maxPaginationNumber:e.unref(Y),nextPage:e.unref(te),prevPage:e.unref(ae)})),void 0,!0):(e.openBlock(),e.createBlock(rt,{key:2,"is-first-page":e.unref(ee),"is-last-page":e.unref(Z),onClickNextPage:e.unref(te),onClickPrevPage:e.unref(ae)},e.createSlots({_:2},[p.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(tt,{"current-pagination-number":e.unref(M),"max-pagination-number":e.unref(Y),onUpdatePage:e.unref(ne)},null,8,["current-pagination-number","max-pagination-number","onUpdatePage"])]),key:"0"}:void 0]),1032,["is-first-page","is-last-page","onClickNextPage","onClickPrevPage"]))]))],2))}});var me=S(vt,[["__scopeId","data-v-30ede217"]]);return typeof window!="undefined"&&window.Vue&&window.Vue.createApp({}).component("Vue3EasyDataTable",me),me}); | ||
(function(e,w){typeof exports=="object"&&typeof module!="undefined"?module.exports=w(require("vue")):typeof define=="function"&&define.amd?define(["vue"],w):(e=typeof globalThis!="undefined"?globalThis:e||self,e["vue3-easy-data-table"]=w(e.Vue))})(this,function(e){"use strict";var Yt=Object.defineProperty,Zt=Object.defineProperties;var ea=Object.getOwnPropertyDescriptors;var Ae=Object.getOwnPropertySymbols;var ta=Object.prototype.hasOwnProperty,aa=Object.prototype.propertyIsEnumerable;var Re=(e,w,S)=>w in e?Yt(e,w,{enumerable:!0,configurable:!0,writable:!0,value:S}):e[w]=S,T=(e,w)=>{for(var S in w||(w={}))ta.call(w,S)&&Re(e,S,w[S]);if(Ae)for(var S of Ae(w))aa.call(w,S)&&Re(e,S,w[S]);return e},le=(e,w)=>Zt(e,ea(w));var w="",S=(o,l)=>{const t=o.__vccOpts||o;for(const[a,f]of l)t[a]=f;return t};const Le=o=>(e.pushScopeId("data-v-e0a0b7f0"),o=o(),e.popScopeId(),o),Te=["onClick"],Fe=["checked"],De=Le(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var ze=S(e.defineComponent({__name:"MultipleSelectCheckBox",props:{status:{type:String,required:!0}},emits:["change"],setup(o,{emit:l}){const t=o;e.useCssVars(g=>({"51ab8a49":e.unref(c)}));const a=e.computed(()=>t.status==="allSelected"),f=()=>{l("change",!a.value)},c=e.inject("themeColor");return(g,n)=>(e.openBlock(),e.createElementBlock("div",{class:"easy-checkbox",onClick:e.withModifiers(f,["stop","prevent"])},[e.createElementVNode("input",{type:"checkbox",checked:e.unref(a),class:e.normalizeClass(o.status)},null,10,Fe),De],8,Te))}}),[["__scopeId","data-v-e0a0b7f0"]]),ra="";const He=o=>(e.pushScopeId("data-v-7e69a276"),o=o(),e.popScopeId(),o),Me=["checked"],Oe=He(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var je=S(e.defineComponent({__name:"SingleSelectCheckBox",props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(o,{emit:l}){e.useCssVars(a=>({fdaf7e9e:e.unref(t)}));const t=e.inject("themeColor");return(a,f)=>(e.openBlock(),e.createElementBlock("div",{class:"easy-checkbox",onClick:f[0]||(f[0]=e.withModifiers(c=>l("change"),["stop","prevent"]))},[e.createElementVNode("input",{type:"checkbox",checked:o.checked},null,8,Me),Oe]))}}),[["__scopeId","data-v-7e69a276"]]),la="";const We=o=>(e.pushScopeId("data-v-4ca5de3a"),o=o(),e.popScopeId(),o),qe={class:"easy-data-table__rows-selector"},Je={class:"rows-input"},Ue=We(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),Ge=["onClick"];var Ke=S(e.defineComponent({__name:"RowsSelector",props:{modelValue:{type:Number,required:!0},rowsItems:{type:Array,required:!0}},emits:["update:modelValue"],setup(o,{emit:l}){const t=o;e.useCssVars(_=>({"1b889342":e.unref(h)}));const a=e.ref(!1),f=e.ref(!1),c=e.inject("dataTable");e.watch(a,_=>{if(_&&c){const m=window.innerHeight,b=c.value.getBoundingClientRect().height,R=c.value.getBoundingClientRect().top;m-(b+R)<=100?f.value=!0:f.value=!1}});const g=e.computed({get:()=>t.modelValue,set:_=>{l("update:modelValue",_)}}),n=_=>{g.value=_,a.value=!1},r=(_,m)=>{let b=_.parentNode;for(;b!=null;){if(b.classList&&b.classList.contains(m))return!0;b=b.parentNode}return!1},s=_=>{r(_.target,"easy-data-table__rows-selector")||(a.value=!1)};e.onMounted(()=>{document.addEventListener("click",s)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",s)});const h=e.inject("themeColor");return(_,m)=>(e.openBlock(),e.createElementBlock("div",qe,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:m[0]||(m[0]=b=>a.value=!a.value)},[e.createElementVNode("div",Je,e.toDisplayString(e.unref(g)),1),Ue]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:a.value,inside:f.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.rowsItems,b=>(e.openBlock(),e.createElementBlock("li",{key:b,class:e.normalizeClass({selected:b===e.unref(g)}),onClick:R=>n(b)},e.toDisplayString(b),11,Ge))),128))],2)]))}}),[["__scopeId","data-v-4ca5de3a"]]),ia="";const se=o=>(e.pushScopeId("data-v-1fa3a520"),o=o(),e.popScopeId(),o),Qe={class:"lds-ring"},Xe=[se(()=>e.createElementVNode("div",null,null,-1)),se(()=>e.createElementVNode("div",null,null,-1)),se(()=>e.createElementVNode("div",null,null,-1)),se(()=>e.createElementVNode("div",null,null,-1))];var Ye=S(e.defineComponent({__name:"Loading",setup(o){e.useCssVars(t=>({"26774109":e.unref(l)}));const l=e.inject("themeColor");return(t,a)=>(e.openBlock(),e.createElementBlock("div",Qe,Xe))}}),[["__scopeId","data-v-1fa3a520"]]),ma="";const Ze={class:"loader-line"};var et=S(e.defineComponent({__name:"LoadingLine",setup(o){e.useCssVars(t=>({"0d327f57":e.unref(l)}));const l=e.inject("themeColor");return(t,a)=>(e.openBlock(),e.createElementBlock("div",Ze))}}),[["__scopeId","data-v-7d281cac"]]),ya="";const tt={class:"buttons-pagination"},at=["onClick"];var nt=S(e.defineComponent({__name:"ButtonsPagination",props:{maxPaginationNumber:{type:Number,required:!0},currentPaginationNumber:{type:Number,required:!0}},emits:["updatePage"],setup(o,{emit:l}){const t=o;e.useCssVars(n=>({"40dd4f07":e.unref(g)}));const a=7,f=n=>{n.type==="button"&&!n.active&&l("updatePage",n.page)},c=e.computed(()=>{const n=[];if(t.maxPaginationNumber<=a)for(let r=1;r<=t.maxPaginationNumber;r+=1)n.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if([1,2,t.maxPaginationNumber,t.maxPaginationNumber-1].includes(t.currentPaginationNumber))for(let r=1;r<=a;r+=1)if(r<=3)n.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if(r===4)n.push({type:"omission"});else{const s=t.maxPaginationNumber-(a-r);n.push({type:"button",page:s,active:s===t.currentPaginationNumber,activePrev:s+1===t.currentPaginationNumber})}else if([3,4].includes(t.currentPaginationNumber))for(let r=1;r<=a;r+=1)r<=5?n.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber}):r===6?n.push({type:"omission"}):n.push({type:"button",page:t.maxPaginationNumber,active:t.maxPaginationNumber===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if([t.maxPaginationNumber-2,t.maxPaginationNumber-3].includes(t.currentPaginationNumber))for(let r=1;r<=a;r+=1)if(r===1)n.push({type:"button",page:1,active:t.currentPaginationNumber===1,activePrev:r+1===t.currentPaginationNumber});else if(r===2)n.push({type:"omission"});else{const s=t.maxPaginationNumber-(a-r);n.push({type:"button",page:s,active:s===t.currentPaginationNumber,activePrev:s+1===t.currentPaginationNumber})}else for(let r=1;r<=a;r+=1)if(r===1)n.push({type:"button",page:1,active:t.currentPaginationNumber===1,activePrev:r+1===t.currentPaginationNumber});else if(r===2||r===6)n.push({type:"omission"});else if(r===7)n.push({type:"button",page:t.maxPaginationNumber,active:t.maxPaginationNumber===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else{const s=4-r,h=t.currentPaginationNumber-s;n.push({type:"button",page:h,active:h===t.currentPaginationNumber,activePrev:h+1===t.currentPaginationNumber})}return n}),g=e.inject("themeColor");return(n,r)=>(e.openBlock(),e.createElementBlock("div",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(s,h)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:e.normalizeClass(["item",{button:s.type==="button",active:s.type==="button"&&s.active,"active-prev":s.type==="button"&&s.activePrev,omission:s.type==="omission"}]),onClick:_=>f(s)},e.toDisplayString(s.type==="button"?s.page:"..."),11,at))),128))]))}}),[["__scopeId","data-v-4c681fa2"]]),_a="";const me=o=>(e.pushScopeId("data-v-c9da5286"),o=o(),e.popScopeId(),o),rt=[me(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],ot=[me(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var lt=S(e.defineComponent({__name:"PaginationArrows",props:{isFirstPage:{type:Boolean,required:!1},isLastPage:{type:Boolean,required:!1}},emits:["clickPrevPage","clickNextPage"],setup(o,{emit:l}){const t=e.useSlots();return(a,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["previous-page__click-button",{"first-page":o.isFirstPage}]),onClick:f[0]||(f[0]=c=>l("clickPrevPage"))},rt,2),e.unref(t).buttonsPagination?e.renderSlot(a.$slots,"buttonsPagination",{key:0},void 0,!0):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["next-page__click-button",{"last-page":o.isLastPage}]),onClick:f[1]||(f[1]=c=>l("clickNextPage"))},ot,2)],64))}}),[["__scopeId","data-v-c9da5286"]]);function st(o,l,t,a){return{clickRow:(c,g)=>{if(o.value!==g)return;const n=T({},c);if(l.value){const{checkbox:r}=c;delete n.checkbox,n.isSelected=r}if(t.value){const{index:r}=c;delete n.index,n.indexInCurrentPage=r}a("clickRow",n)}}}function it(o,l,t){const a=e.ref([]);return{expandingItemIndexList:a,updateExpandingItemIndexList:(g,n,r)=>{r.stopPropagation();const s=a.value.indexOf(g);if(s!==-1)a.value.splice(s,1);else{const h=o.value.findIndex(_=>JSON.stringify(_)===JSON.stringify(n));t("expandRow",l.value+h,n),a.value.push(l.value+h)}},clearExpandingItemIndexList:()=>{a.value=[]}}}function ct(o){const l=e.computed(()=>o.value.filter(f=>f.fixed)),t=e.computed(()=>l.value.length?l.value[l.value.length-1].value:""),a=e.computed(()=>{if(!l.value.length)return[];const f=l.value.map(c=>{var g;return(g=c.width)!=null?g:100});return l.value.map((c,g)=>{var n,r;return{value:c.value,fixed:(n=c.fixed)!=null?n:!0,width:(r=c.width)!=null?r:100,distance:g===0?0:f.reduce((s,h,_)=>{let m=s;return _<g&&(m+=h),m})}})});return{fixedHeaders:l,lastFixedColumn:t,fixedColumnsInfos:a}}function dt(o,l,t,a,f,c,g,n,r,s,h,_,m,b,R,k,$,F,D){const d=e.computed(()=>g.value.findIndex(y=>y.fixed)!==-1),x=e.computed(()=>d.value?g.value.filter(y=>y.fixed):[]),P=e.computed(()=>g.value.filter(y=>!y.fixed)),C=(y,z)=>Array.isArray(y)&&Array.isArray(z)?{sortBy:y,sortDesc:z.map(N=>N==="desc")}:y!==""?{sortBy:R.value,sortDesc:k.value==="desc"}:null,p=e.ref(C(R.value,k.value)),B=e.computed(()=>{var ie;const z=[...x.value,...P.value].map(Q=>{const A=Object.assign(Q);if(A.sortable&&(A.sortType="none"),m.value)if(Array.isArray(m.value.sortBy)&&Array.isArray(m.value.sortType)&&m.value.sortBy.includes(A.value)){const Y=m.value.sortBy.indexOf(A.value);A.sortType=m.value.sortType[Y]}else A.value===m.value.sortBy&&m.value.sortType&&(A.sortType=m.value.sortType);if(p.value&&Array.isArray(p.value.sortBy)&&Array.isArray(p.value.sortDesc)&&p.value.sortBy.includes(A.value)){const Y=p.value.sortBy.indexOf(A.value);A.sortType=p.value.sortDesc[Y]?"desc":"asc"}else p.value&&A.value===p.value.sortBy&&(A.sortType=p.value.sortDesc?"desc":"asc");return A});let N=[];n.value?N=[f.value||d.value?{text:"",value:"expand",fixed:!0,width:t.value}:{text:"",value:"expand"},...z]:N=z;let L=[];b.value?L=[c.value||d.value?{text:o.value,value:"index",fixed:!0,width:r.value}:{text:o.value,value:"index"},...N]:L=N;let X=[];return s.value?X=[a.value||d.value?{text:"checkbox",value:"checkbox",fixed:!0,width:(ie=l.value)!=null?ie:36}:{text:"checkbox",value:"checkbox"},...L]:X=L,X}),V=e.computed(()=>B.value.map(y=>y.value));return{clientSortOptions:p,headerColumns:V,headersForRender:B,updateSortField:(y,z)=>{let N=null;if(z==="none"?N="asc":z==="asc"?N="desc":N=_.value?"asc":null,h.value&&F(y,N),p.value&&Array.isArray(p.value.sortBy)&&Array.isArray(p.value.sortDesc)){const L=p.value.sortBy.indexOf(y);L===-1?N!==null&&(p.value.sortBy.push(y),p.value.sortDesc.push(N==="desc")):N===null?(p.value.sortDesc.splice(L,1),p.value.sortBy.splice(L,1)):p.value.sortDesc[L]=N==="desc"}else N===null?p.value=null:p.value={sortBy:y,sortDesc:N==="desc"};D("updateSort",{sortType:N,sortBy:y})},isMultiSorting:y=>m.value&&Array.isArray(m.value.sortBy)?m.value.sortBy.includes(y):p.value&&Array.isArray(p.value.sortBy)?p.value.sortBy.includes(y):!1,getMultiSortNumber:y=>m.value&&Array.isArray(m.value.sortBy)?m.value.sortBy.indexOf(y)+1:p.value&&Array.isArray(p.value.sortBy)?p.value.sortBy.indexOf(y)+1:!1}}function ut(o,l,t,a,f,c,g,n,r){const s=e.computed(()=>(o.value-1)*f.value+1),h=e.computed(()=>t.value?Math.min(r.value,o.value*f.value):Math.min(n.value.length,o.value*f.value)),_=e.computed(()=>t.value?a.value:n.value.slice(s.value-1,h.value)),m=e.computed(()=>g.value?_.value.map((k,$)=>T({index:s.value+$},k)):_.value),b=e.computed(()=>c.value.length===0||c.value.every($=>n.value.findIndex(F=>JSON.stringify($)===JSON.stringify(F))===-1)?"noneSelected":c.value.length===n.value.length&&c.value.every(F=>n.value.findIndex(D=>JSON.stringify(F)===JSON.stringify(D))!==-1)?"allSelected":"partSelected"),R=e.computed(()=>l.value?b.value==="allSelected"?m.value.map(k=>T({checkbox:!0},k)):b.value==="noneSelected"?m.value.map(k=>T({checkbox:!1},k)):m.value.map(k=>{const $=c.value.findIndex(F=>{const D=T({},k);return delete D.index,JSON.stringify(F)===JSON.stringify(D)})!==-1;return T({checkbox:$},k)}):m.value);return{currentPageFirstIndex:s,currentPageLastIndex:h,multipleSelectStatus:b,pageItems:R}}function pt(o,l,t,a,f,c,g){const n=e.ref(c.value?c.value.page:o.value),r=e.computed(()=>Math.ceil(a.value/f.value)),s=e.computed(()=>r.value===0||n.value===r.value),h=e.computed(()=>n.value===1);return{currentPaginationNumber:n,maxPaginationNumber:r,isLastPage:s,isFirstPage:h,nextPage:()=>{if(a.value!==0&&!s.value&&!t.value)if(l.value){const k=n.value+1;g(k)}else n.value+=1},prevPage:()=>{if(a.value!==0&&!h.value&&!t.value)if(l.value){const k=n.value-1;g(k)}else n.value-=1},updatePage:k=>{t.value||(l.value?g(k):n.value=k)},updateCurrentPaginationNumber:k=>{n.value=k}}}function ft(o,l,t,a){const f=e.computed(()=>!o.value&&l.value.findIndex(n=>n===a.value)===-1?[a.value,...l.value]:l.value),c=e.ref(t.value?t.value.rowsPerPage:a.value);return{rowsItemsComputed:f,rowsPerPageRef:c,updateRowsPerPage:n=>{c.value=n}}}function mt(o,l,t){const a=e.computed({get:()=>{if(o.value){const{page:n,rowsPerPage:r,sortBy:s,sortType:h}=o.value;return{page:n,rowsPerPage:r,sortBy:s!=null?s:null,sortType:h!=null?h:null}}return null},set:n=>{t("update:serverOptions",n)}});return{serverOptionsComputed:a,updateServerOptionsPage:n=>{a.value&&(a.value=le(T({},a.value),{page:n}))},updateServerOptionsSort:(n,r)=>{if(a.value)if(l.value&&Array.isArray(a.value.sortBy)&&Array.isArray(a.value.sortType)){const s=a.value.sortBy.findIndex(h=>h===n);s===-1&&r!==null&&(a.value.sortBy.push(n),a.value.sortType.push(r)),r===null?(a.value.sortBy.splice(s,1),a.value.sortType.splice(s,1)):a.value.sortType[s]=r}else a.value=le(T({},a.value),{sortBy:r!==null?n:null,sortType:r})},updateServerOptionsRowsPerPage:n=>{a.value&&(a.value=le(T({},a.value),{page:1,rowsPerPage:n}))}}}function v(o,l){if(o.includes(".")){let t="";const a=o.split("."),{length:f}=a;let c=0;for(;c<f&&(t=c===0?l[a[c]]:t[a[c]],c+=1,t!==void 0););return t}return l[o]}function gt(o,l){const t=v(o,l);return Array.isArray(t)?t.join(","):t}function yt(o,l,t,a,f,c,g,n,r,s){const h=d=>{if(typeof c.value=="string"&&c.value!=="")return v(c.value,d);if(Array.isArray(c.value)){let x="";return c.value.forEach(P=>{x+=v(P,d)}),x}return Object.values(d).join(" ")},_=e.computed(()=>{if(!t.value&&g.value!==""){const d=new RegExp(g.value,"i");return a.value.filter(x=>d.test(h(x)))}return a.value}),m=e.computed(()=>{let d=[..._.value];return l.value?(l.value.forEach(x=>{d=d.filter(P=>{const{field:C,comparison:p,criteria:B}=x;if(typeof p=="function")return p(v(C,P),B);const V=v(C,P);switch(p){case"=":return V===B;case"!=":return V!==B;case">":return V>B;case"<":return V<B;case"<=":return V<=B;case">=":return V>=B;case"between":return V>=Math.min(...B)&&V<=Math.max(...B);default:return V===B}})}),d):_.value});e.watch(m,d=>{l.value&&s("updateFilter",d)},{immediate:!0,deep:!0});function b(d,x,P,C){const p=d[C],B=x[C];return(C===0?P:b(d,x,P,C-1)).sort((O,K)=>{let j=!0;for(let y=0;y<C;y+=1)if(v(d[y],O)!==v(d[y],K)){j=!1;break}return j?v(p,O)<v(p,K)?B?1:-1:v(p,O)>v(p,K)?B?-1:1:0:0})}const R=e.computed(()=>{if(t.value)return a.value;if(o.value===null)return m.value;const{sortBy:d,sortDesc:x}=o.value,P=[...m.value];return r&&Array.isArray(d)&&Array.isArray(x)?d.length===0?P:b(d,x,P,d.length-1):P.sort((C,p)=>v(d,C)<v(d,p)?x?1:-1:v(d,C)>v(d,p)?x?-1:1:0)}),k=e.computed(()=>t.value?n.value:R.value.length),$=e.computed({get:()=>{var d;return(d=f.value)!=null?d:[]},set:d=>{s("update:itemsSelected",d)}});return{totalItems:R,selectItemsComputed:$,totalItemsLength:k,toggleSelectAll:d=>{$.value=d?R.value:[]},toggleSelectItem:d=>{const x=d.checkbox;if(delete d.checkbox,delete d.index,x)$.value=$.value.filter(P=>JSON.stringify(P)!==JSON.stringify(d)),s("deselectRow",d);else{const P=$.value;P.unshift(d),$.value=P,s("selectRow",d)}}}}var ht={alternating:{type:Boolean,default:!1},buttonsPagination:{type:Boolean,default:!1},checkboxColumnWidth:{type:Number,default:null},currentPage:{type:Number,default:1},emptyMessage:{type:String,default:"No Available Data"},expandColumnWidth:{type:Number,default:36},filterOptions:{type:Array,default:null},fixedExpand:{type:Boolean,default:!1},fixedHeader:{type:Boolean,default:!0},fixedCheckbox:{type:Boolean,default:!1},fixedIndex:{type:Boolean,default:!1},headerTextDirection:{type:String,default:"left"},bodyTextDirection:{type:String,default:"left"},hideFooter:{type:Boolean,default:!1},hideRowsPerPage:{type:Boolean,default:!1},hideHeader:{type:Boolean,default:!1},indexColumnWidth:{type:Number,default:60},itemsSelected:{type:Array,default:null},loading:{type:Boolean,deault:!1},rowsPerPage:{type:Number,default:25},rowsItems:{type:Array,default:()=>[25,50,100]},rowsPerPageMessage:{type:String,default:"rows per page:"},searchField:{type:[String,Array],default:""},searchValue:{type:String,default:""},serverOptions:{type:Object,default:null},serverItemsLength:{type:Number,default:0},showIndex:{type:Boolean,default:!1},sortBy:{type:[String,Array],default:""},sortType:{type:[String,Array],default:"asc"},multiSort:{type:Boolean,default:!1},tableMinHeight:{type:Number,default:180},tableHeight:{type:Number,default:null},themeColor:{type:String,default:"#42b883"},tableClassName:{type:String,default:""},headerClassName:{type:String,default:""},headerItemClassName:{type:[Function,String],default:""},bodyRowClassName:{type:[Function,String],default:""},bodyExpandRowClassName:{type:[Function,String],default:""},bodyItemClassName:{type:[Function,String],default:""},noHover:{type:Boolean,default:!1},borderCell:{type:Boolean,default:!1},mustSort:{type:Boolean,default:!1},rowsOfPageSeparatorMessage:{type:String,default:"of"},clickEventType:{type:String,default:"single"},clickRowToExpand:{type:Boolean,default:!1},tableNodeId:{type:String,default:""},showIndexSymbol:{type:String,default:"#"}},Pa="",Na="";const _t=o=>(e.pushScopeId("data-v-5814f6fe"),o=o(),e.popScopeId(),o),bt=["id"],kt=["onClick"],xt={key:2,class:"header-text"},Pt={key:4,class:"multi-sort__number"},Nt=["onClick","onDblclick"],St=["onClick"],Ct=["colspan"],Bt={key:0,class:"vue3-easy-data-table__loading"},wt=_t(()=>e.createElementVNode("div",{class:"vue3-easy-data-table__loading-mask"},null,-1)),It={class:"loading-entity"},Et={key:1,class:"vue3-easy-data-table__message"},$t={key:0,class:"vue3-easy-data-table__footer"},vt={key:0,class:"pagination__rows-per-page"},Vt={class:"pagination__items-index"},At=e.defineComponent({__name:"DataTable",props:le(T({},ht),{items:{type:Array,required:!0},headers:{type:Array,required:!0}}),emits:["clickRow","selectRow","deselectRow","expandRow","updateSort","updateFilter","update:itemsSelected","update:serverOptions","updatePageItems","updateTotalItems"],setup(o,{expose:l,emit:t}){const a=o;e.useCssVars(u=>({"524b179e":e.unref(Rt),cfebeddc:e.unref(Y)}));const{tableNodeId:f,clickEventType:c,bodyTextDirection:g,checkboxColumnWidth:n,currentPage:r,expandColumnWidth:s,filterOptions:h,fixedCheckbox:_,fixedExpand:m,fixedHeader:b,fixedIndex:R,headers:k,headerTextDirection:$,indexColumnWidth:F,items:D,itemsSelected:d,loading:x,mustSort:P,multiSort:C,rowsItems:p,rowsPerPage:B,searchField:V,searchValue:O,serverItemsLength:K,serverOptions:j,showIndex:y,sortBy:z,sortType:N,tableHeight:L,tableMinHeight:X,themeColor:ie,rowsOfPageSeparatorMessage:Q,showIndexSymbol:A}=e.toRefs(a),Y=e.computed(()=>L.value?`${L.value}px`:null),Rt=e.computed(()=>`${X.value}px`);e.provide("themeColor",ie.value);const W=e.useSlots(),Lt=e.computed(()=>!!W.pagination),Tt=e.computed(()=>!!W.loading),ye=e.computed(()=>!!W.expand),Ft=e.computed(()=>!!W.body),he=e.ref(),de=e.ref();e.provide("dataTable",he);const _e=e.ref(!1);e.onMounted(()=>{de.value.addEventListener("scroll",()=>{_e.value=de.value.scrollLeft>0})});const ue=e.computed(()=>d.value!==null),J=e.computed(()=>j.value!==null),{serverOptionsComputed:pe,updateServerOptionsPage:Dt,updateServerOptionsSort:zt,updateServerOptionsRowsPerPage:Ht}=mt(j,C,t),{clientSortOptions:be,headerColumns:ke,headersForRender:U,updateSortField:Mt,isMultiSorting:Ot,getMultiSortNumber:jt}=dt(A,n,s,_,m,R,k,ye,F,ue,J,P,pe,y,z,N,C,zt,t),{rowsItemsComputed:xe,rowsPerPageRef:q,updateRowsPerPage:Wt}=ft(J,p,j,B),{totalItems:Pe,selectItemsComputed:qt,totalItemsLength:ce,toggleSelectAll:Jt,toggleSelectItem:Ut}=yt(be,h,J,D,d,V,O,K,C,t),{currentPaginationNumber:M,maxPaginationNumber:Z,isLastPage:ee,isFirstPage:te,nextPage:ae,prevPage:ne,updatePage:re,updateCurrentPaginationNumber:Gt}=pt(r,J,x,ce,q,j,Dt),{currentPageFirstIndex:Ne,currentPageLastIndex:Se,multipleSelectStatus:Ce,pageItems:G}=ut(M,ue,J,D,q,qt,y,Pe,ce),oe=e.computed(()=>M.value===0?0:(M.value-1)*q.value),{expandingItemIndexList:Be,updateExpandingItemIndexList:we,clearExpandingItemIndexList:Ie}=it(G,oe,t),{fixedHeaders:fe,lastFixedColumn:Ee,fixedColumnsInfos:Kt}=ct(U),{clickRow:$e}=st(c,ue,y,t),Qt=u=>{var i;const H=(i=u.width)!=null?i:fe.value.length?100:null;if(H)return`width: ${H}px; min-width: ${H}px;`},ve=(u,H="th")=>{if(!fe.value.length)return;const i=Kt.value.find(I=>I.value===u);if(i)return`left: ${i.distance}px;z-index: ${H==="th"?3:1};position: sticky;`};return e.watch(x,(u,H)=>{pe.value&&u===!1&&H===!0&&(Gt(pe.value.page),Ie())}),e.watch(q,u=>{J.value?Ht(u):re(1)}),e.watch([O,h],()=>{J.value||re(1)}),e.watch([M,be,V,O,h],()=>{Ie()},{deep:!0}),e.watch(G,u=>{t("updatePageItems",u)},{deep:!0}),e.watch(Pe,u=>{t("updateTotalItems",u)},{deep:!0}),l({currentPageFirstIndex:Ne,currentPageLastIndex:Se,clientItemsLength:ce,maxPaginationNumber:Z,currentPaginationNumber:M,isLastPage:ee,isFirstPage:te,nextPage:ae,prevPage:ne,updatePage:re,rowsPerPageOptions:xe,rowsPerPageActiveOption:q,updateRowsPerPageActiveOption:Wt}),(u,H)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataTable",ref:he,class:e.normalizeClass(["vue3-easy-data-table",[u.tableClassName]])},[e.createElementVNode("div",{ref_key:"tableBody",ref:de,class:e.normalizeClass(["vue3-easy-data-table__main",{"fixed-header":e.unref(b),"fixed-height":e.unref(L),"show-shadow":_e.value,"table-fixed":e.unref(fe).length,hoverable:!u.noHover,"border-cell":u.borderCell}])},[e.createElementVNode("table",{id:e.unref(f)},[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(U),(i,I)=>(e.openBlock(),e.createElementBlock("col",{key:I,style:e.normalizeStyle(Qt(i))},null,4))),128))]),e.unref(U).length&&!u.hideHeader?(e.openBlock(),e.createElementBlock("thead",{key:0,class:e.normalizeClass(["vue3-easy-data-table__header",[u.headerClassName]])},[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(U),(i,I)=>(e.openBlock(),e.createElementBlock("th",{key:I,class:e.normalizeClass([{sortable:i.sortable,none:i.sortable&&i.sortType==="none",desc:i.sortable&&i.sortType==="desc",asc:i.sortable&&i.sortType==="asc",shadow:i.value===e.unref(Ee)},typeof u.headerItemClassName=="string"?u.headerItemClassName:u.headerItemClassName(i,I+1)]),style:e.normalizeStyle(ve(i.value)),onClick:e.withModifiers(E=>i.sortable&&i.sortType?e.unref(Mt)(i.value,i.sortType):null,["stop"])},[i.text==="checkbox"?(e.openBlock(),e.createBlock(ze,{key:e.unref(Ce),status:e.unref(Ce),onChange:e.unref(Jt)},null,8,["status","onChange"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["header",`direction-${e.unref($)}`])},[e.unref(W)[`header-${i.value}`]?e.renderSlot(u.$slots,`header-${i.value}`,e.normalizeProps(e.mergeProps({key:0},i)),void 0,!0):e.unref(W)[`header-${i.value.toLowerCase()}`]?e.renderSlot(u.$slots,`header-${i.value.toLowerCase()}`,e.normalizeProps(e.mergeProps({key:1},i)),void 0,!0):(e.openBlock(),e.createElementBlock("span",xt,e.toDisplayString(i.text),1)),i.sortable?(e.openBlock(),e.createElementBlock("i",{key:i.sortType?i.sortType:"none",class:e.normalizeClass(["sortType-icon",{desc:i.sortType==="desc"}])},null,2)):e.createCommentVNode("",!0),e.unref(C)&&e.unref(Ot)(i.value)?(e.openBlock(),e.createElementBlock("span",Pt,e.toDisplayString(e.unref(jt)(i.value)),1)):e.createCommentVNode("",!0)],2))],14,kt))),128))])],2)):e.createCommentVNode("",!0),e.unref(Ft)?e.renderSlot(u.$slots,"body",e.normalizeProps(e.mergeProps({key:1},e.unref(G))),void 0,!0):e.unref(ke).length?(e.openBlock(),e.createElementBlock("tbody",{key:2,class:e.normalizeClass(["vue3-easy-data-table__body",{"row-alternation":u.alternating}])},[e.renderSlot(u.$slots,"body-prepend",e.normalizeProps(e.guardReactiveProps({items:e.unref(G),pagination:{isFirstPage:e.unref(te),isLastPage:e.unref(ee),currentPaginationNumber:e.unref(M),maxPaginationNumber:e.unref(Z),nextPage:e.unref(ae),prevPage:e.unref(ne)},headers:e.unref(U)})),void 0,!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(G),(i,I)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:I},[e.createElementVNode("tr",{class:e.normalizeClass([{"even-row":(I+1)%2===0},typeof u.bodyRowClassName=="string"?u.bodyRowClassName:u.bodyRowClassName(i,I+1)]),onClick:E=>{e.unref($e)(i,"single"),u.clickRowToExpand&&e.unref(we)(I+e.unref(oe),i,E)},onDblclick:E=>e.unref($e)(i,"double")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ke),(E,Xt)=>(e.openBlock(),e.createElementBlock("td",{key:Xt,style:e.normalizeStyle(ve(E,"td")),class:e.normalizeClass([{shadow:E===e.unref(Ee),"can-expand":E==="expand"},typeof u.bodyItemClassName=="string"?u.bodyItemClassName:u.bodyItemClassName(E,I+1),`direction-${e.unref(g)}`]),onClick:Ve=>E==="expand"?e.unref(we)(I+e.unref(oe),i,Ve):null},[e.unref(W)[`item-${E}`]?e.renderSlot(u.$slots,`item-${E}`,e.normalizeProps(e.mergeProps({key:0},i)),void 0,!0):e.unref(W)[`item-${E.toLowerCase()}`]?e.renderSlot(u.$slots,`item-${E.toLowerCase()}`,e.normalizeProps(e.mergeProps({key:1},i)),void 0,!0):E==="expand"?(e.openBlock(),e.createElementBlock("i",{key:2,class:e.normalizeClass(["expand-icon",{expanding:e.unref(Be).includes(e.unref(oe)+I)}])},null,2)):E==="checkbox"?(e.openBlock(),e.createBlock(je,{key:3,checked:i[E],onChange:Ve=>e.unref(Ut)(i)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(e.unref(gt)(E,i)),1)],64))],14,St))),128))],42,Nt),e.unref(ye)&&e.unref(Be).includes(I+e.unref(oe))?(e.openBlock(),e.createElementBlock("tr",{key:0,class:e.normalizeClass([{"even-row":(I+1)%2===0},typeof u.bodyExpandRowClassName=="string"?u.bodyExpandRowClassName:u.bodyExpandRowClassName(i,I+1)])},[e.createElementVNode("td",{colspan:e.unref(U).length,class:"expand"},[i.expandLoading?(e.openBlock(),e.createBlock(et,{key:0,class:"expand-loading"})):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"expand",e.normalizeProps(e.guardReactiveProps(i)),void 0,!0)],8,Ct)],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(u.$slots,"body-append",e.normalizeProps(e.guardReactiveProps({items:e.unref(G),pagination:{isFirstPage:e.unref(te),isLastPage:e.unref(ee),currentPaginationNumber:e.unref(M),maxPaginationNumber:e.unref(Z),nextPage:e.unref(ae),prevPage:e.unref(ne),updatePage:e.unref(re)},headers:e.unref(U)})),void 0,!0)],2)):e.createCommentVNode("",!0)],8,bt),e.unref(x)?(e.openBlock(),e.createElementBlock("div",Bt,[wt,e.createElementVNode("div",It,[e.unref(Tt)?e.renderSlot(u.$slots,"loading",{key:0},void 0,!0):(e.openBlock(),e.createBlock(Ye,{key:1}))])])):e.createCommentVNode("",!0),!e.unref(G).length&&!e.unref(x)?(e.openBlock(),e.createElementBlock("div",Et,e.toDisplayString(u.emptyMessage),1)):e.createCommentVNode("",!0)],2),u.hideFooter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",$t,[u.hideRowsPerPage?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",vt,[e.createTextVNode(e.toDisplayString(u.rowsPerPageMessage)+" ",1),e.createVNode(Ke,{modelValue:e.unref(q),"onUpdate:modelValue":H[0]||(H[0]=i=>e.isRef(q)?q.value=i:null),"rows-items":e.unref(xe)},null,8,["modelValue","rows-items"])])),e.createElementVNode("div",Vt,e.toDisplayString(`${e.unref(Ne)}\u2013${e.unref(Se)}`)+" "+e.toDisplayString(e.unref(Q))+" "+e.toDisplayString(e.unref(ce)),1),e.unref(Lt)?e.renderSlot(u.$slots,"pagination",e.normalizeProps(e.mergeProps({key:1},{isFirstPage:e.unref(te),isLastPage:e.unref(ee),currentPaginationNumber:e.unref(M),maxPaginationNumber:e.unref(Z),nextPage:e.unref(ae),prevPage:e.unref(ne)})),void 0,!0):(e.openBlock(),e.createBlock(lt,{key:2,"is-first-page":e.unref(te),"is-last-page":e.unref(ee),onClickNextPage:e.unref(ae),onClickPrevPage:e.unref(ne)},e.createSlots({_:2},[u.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(nt,{"current-pagination-number":e.unref(M),"max-pagination-number":e.unref(Z),onUpdatePage:e.unref(re)},null,8,["current-pagination-number","max-pagination-number","onUpdatePage"])]),key:"0"}:void 0]),1032,["is-first-page","is-last-page","onClickNextPage","onClickPrevPage"]))]))],2))}});var ge=S(At,[["__scopeId","data-v-5814f6fe"]]);return typeof window!="undefined"&&window.Vue&&window.Vue.createApp({}).component("Vue3EasyDataTable",ge),ge}); |
@@ -6,3 +6,3 @@ { | ||
"private": false, | ||
"version": "1.5.29", | ||
"version": "1.5.30", | ||
"types": "./types/main.d.ts", | ||
@@ -9,0 +9,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
118313
1876