vue3-easy-data-table
Advanced tools
Comparing version 1.5.6 to 1.5.7
@@ -868,6 +868,18 @@ var __defProp = Object.defineProperty; | ||
function useTotalItems(clientSortOptions, filterOptions, isServerSideMode, items, itemsSelected, searchField, searchValue, serverItemsLength, multiSort, emits) { | ||
const generateSearchingTarget = (item) => { | ||
if (typeof searchField.value === "string" && searchField.value !== "") | ||
return item[searchField.value]; | ||
if (Array.isArray(searchField.value)) { | ||
let searchString = ""; | ||
searchField.value.forEach((field) => { | ||
searchString += getItemValue(field, item); | ||
}); | ||
return searchString; | ||
} | ||
return Object.values(item).join(" "); | ||
}; | ||
const itemsSearching = computed(() => { | ||
if (!isServerSideMode.value && searchValue.value !== "") { | ||
const regex = new RegExp(searchValue.value, "i"); | ||
return items.value.filter((item) => regex.test(searchField.value !== "" ? item[searchField.value] : Object.values(item).join(" "))); | ||
return items.value.filter((item) => regex.test(generateSearchingTarget(item))); | ||
} | ||
@@ -1075,3 +1087,3 @@ return items.value; | ||
searchField: { | ||
type: String, | ||
type: [String, Array], | ||
default: "" | ||
@@ -1158,3 +1170,3 @@ }, | ||
var DataTable_vue_vue_type_style_index_1_scoped_true_lang = ""; | ||
const _withScopeId = (n) => (pushScopeId("data-v-6fc1a270"), n = n(), popScopeId(), n); | ||
const _withScopeId = (n) => (pushScopeId("data-v-8c691ab2"), n = n(), popScopeId(), n); | ||
const _hoisted_1 = ["onClick"]; | ||
@@ -1212,4 +1224,4 @@ const _hoisted_2 = { | ||
useCssVars((_ctx) => ({ | ||
"3cc391f1": unref(tableMinHeightPx), | ||
"750630c2": unref(tableHeightPx) | ||
"0f3c39d7": unref(tableMinHeightPx), | ||
"4ae9b979": unref(tableHeightPx) | ||
})); | ||
@@ -1474,10 +1486,10 @@ const { | ||
}, [ | ||
unref(slots)[`item-${column}`] ? renderSlot(_ctx.$slots, `item-${column}`, normalizeProps(mergeProps({ key: 0 }, item)), void 0, true) : unref(slots)[`item-${column.toLowerCase()}`] ? renderSlot(_ctx.$slots, `item-${column.toLowerCase()}`, normalizeProps(mergeProps({ key: 1 }, item)), void 0, true) : column === "expand" ? (openBlock(), createElementBlock("i", { | ||
key: 2, | ||
unref(slots)[`item-${column}`] ? renderSlot(_ctx.$slots, `item-${column}`, normalizeProps(mergeProps({ key: 0 }, item)), void 0, true) : column === "expand" ? (openBlock(), createElementBlock("i", { | ||
key: 1, | ||
class: normalizeClass(["expand-icon", { "expanding": unref(expandingItemIndexList).includes(unref(prevPageEndIndex) + index) }]) | ||
}, null, 2)) : column === "checkbox" ? (openBlock(), createBlock(SingleSelectCheckBox, { | ||
key: 3, | ||
key: 2, | ||
checked: item[column], | ||
onChange: ($event) => unref(toggleSelectItem)(item) | ||
}, null, 8, ["checked", "onChange"])) : (openBlock(), createElementBlock(Fragment, { key: 4 }, [ | ||
}, null, 8, ["checked", "onChange"])) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [ | ||
createTextVNode(toDisplayString(unref(generateColumnContent)(column, item)), 1) | ||
@@ -1567,3 +1579,3 @@ ], 64)) | ||
}); | ||
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6fc1a270"]]); | ||
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8c691ab2"]]); | ||
if (typeof window !== "undefined" && window.Vue) { | ||
@@ -1570,0 +1582,0 @@ window.Vue.createApp({}).component("Vue3EasyDataTable", DataTable); |
@@ -1,1 +0,1 @@ | ||
(function(e,B){typeof exports=="object"&&typeof module!="undefined"?module.exports=B(require("vue")):typeof define=="function"&&define.amd?define(["vue"],B):(e=typeof globalThis!="undefined"?globalThis:e||self,e["vue3-easy-data-table"]=B(e.Vue))})(this,function(e){"use strict";var Ut=Object.defineProperty,Gt=Object.defineProperties;var Kt=Object.getOwnPropertyDescriptors;var $e=Object.getOwnPropertySymbols;var Qt=Object.prototype.hasOwnProperty,Xt=Object.prototype.propertyIsEnumerable;var Ee=(e,B,N)=>B in e?Ut(e,B,{enumerable:!0,configurable:!0,writable:!0,value:N}):e[B]=N,T=(e,B)=>{for(var N in B||(B={}))Qt.call(B,N)&&Ee(e,N,B[N]);if($e)for(var N of $e(B))Xt.call(B,N)&&Ee(e,N,B[N]);return e},ae=(e,B)=>Gt(e,Kt(B));var B="",N=(n,l)=>{const t=n.__vccOpts||n;for(const[a,u]of l)t[a]=u;return t};const ve=n=>(e.pushScopeId("data-v-e0a0b7f0"),n=n(),e.popScopeId(),n),Ve=["onClick"],Ae=["checked"],Le=ve(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var Fe=N(e.defineComponent({props:{status:{type:String,required:!0}},emits:["change"],setup(n,{emit:l}){const t=n;e.useCssVars(g=>({"51ab8a49":e.unref(s)}));const a=e.computed(()=>t.status==="allSelected"),u=()=>{l("change",!a.value)},s=e.inject("themeColor");return(g,o)=>(e.openBlock(),e.createElementBlock("div",{class:"easy-checkbox",onClick:e.withModifiers(u,["stop","prevent"])},[e.createElementVNode("input",{type:"checkbox",checked:e.unref(a),class:e.normalizeClass(n.status)},null,10,Ae),Le],8,Ve))}}),[["__scopeId","data-v-e0a0b7f0"]]),Zt="";const Re=n=>(e.pushScopeId("data-v-7e69a276"),n=n(),e.popScopeId(),n),Te=["checked"],De=Re(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var ze=N(e.defineComponent({props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(n,{emit:l}){e.useCssVars(a=>({fdaf7e9e:e.unref(t)}));const t=e.inject("themeColor");return(a,u)=>(e.openBlock(),e.createElementBlock("div",{class:"easy-checkbox",onClick:u[0]||(u[0]=e.withModifiers(s=>l("change"),["stop","prevent"]))},[e.createElementVNode("input",{type:"checkbox",checked:n.checked},null,8,Te),De]))}}),[["__scopeId","data-v-7e69a276"]]),ta="";const He=n=>(e.pushScopeId("data-v-09dad912"),n=n(),e.popScopeId(),n),Oe={class:"easy-data-table__rows-selector"},Me={class:"rows-input"},je=He(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),We=["onClick"];var qe=N(e.defineComponent({props:{modelValue:{type:Number,required:!0},rowsItems:{type:Array,required:!0}},emits:["update:modelValue"],setup(n,{emit:l}){const t=n;e.useCssVars(p=>({"7fe9410c":e.unref(y)}));const a=e.ref(!1),u=e.ref(!1),s=e.inject("dataTable");e.watch(a,p=>{if(p&&s){const x=window.innerHeight,b=s.value.getBoundingClientRect().height,A=s.value.getBoundingClientRect().top;x-(b+A)<=100?u.value=!0:u.value=!1}});const g=e.computed({get:()=>t.modelValue,set:p=>{l("update:modelValue",p)}}),o=p=>{g.value=p,a.value=!1},r=(p,x)=>{let b=p.parentNode;for(;b!=null;){if(b.classList&&b.classList.contains(x))return!0;b=b.parentNode}return!1},i=p=>{r(p.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(p,x)=>(e.openBlock(),e.createElementBlock("div",Oe,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:x[0]||(x[0]=b=>a.value=!a.value)},[e.createElementVNode("div",Me,e.toDisplayString(e.unref(g)),1),je]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:a.value,inside:u.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rowsItems,b=>(e.openBlock(),e.createElementBlock("li",{key:b,class:e.normalizeClass({selected:b===e.unref(g)}),onClick:A=>o(b)},e.toDisplayString(b),11,We))),128))],2)]))}}),[["__scopeId","data-v-09dad912"]]),na="";const ne=n=>(e.pushScopeId("data-v-1fa3a520"),n=n(),e.popScopeId(),n),Je={class:"lds-ring"},Ue=[ne(()=>e.createElementVNode("div",null,null,-1)),ne(()=>e.createElementVNode("div",null,null,-1)),ne(()=>e.createElementVNode("div",null,null,-1)),ne(()=>e.createElementVNode("div",null,null,-1))];var Ge=N(e.defineComponent({setup(n){e.useCssVars(t=>({"26774109":e.unref(l)}));const l=e.inject("themeColor");return(t,a)=>(e.openBlock(),e.createElementBlock("div",Je,Ue))}}),[["__scopeId","data-v-1fa3a520"]]),ca="";const Ke={class:"loader-line"};var Qe=N(e.defineComponent({setup(n){e.useCssVars(t=>({"0d327f57":e.unref(l)}));const l=e.inject("themeColor");return(t,a)=>(e.openBlock(),e.createElementBlock("div",Ke))}}),[["__scopeId","data-v-7d281cac"]]),ua="";const Xe={class:"buttons-pagination"},Ye=["onClick"];var Ze=N(e.defineComponent({props:{maxPaginationNumber:{type:Number,required:!0},currentPaginationNumber:{type:Number,required:!0}},emits:["updatePage"],setup(n,{emit:l}){const t=n;e.useCssVars(o=>({"40dd4f07":e.unref(g)}));const a=7,u=o=>{o.type==="button"&&!o.active&&l("updatePage",o.page)},s=e.computed(()=>{const o=[];if(t.maxPaginationNumber<=a)for(let r=1;r<=t.maxPaginationNumber;r+=1)o.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)o.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if(r===4)o.push({type:"omission"});else{const i=t.maxPaginationNumber-(a-r);o.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?o.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber}):r===6?o.push({type:"omission"}):o.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)o.push({type:"button",page:1,active:t.currentPaginationNumber===1,activePrev:r+1===t.currentPaginationNumber});else if(r===2)o.push({type:"omission"});else{const i=t.maxPaginationNumber-(a-r);o.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)o.push({type:"button",page:1,active:t.currentPaginationNumber===1,activePrev:r+1===t.currentPaginationNumber});else if(r===2||r===6)o.push({type:"omission"});else if(r===7)o.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;o.push({type:"button",page:y,active:y===t.currentPaginationNumber,activePrev:y+1===t.currentPaginationNumber})}return o}),g=e.inject("themeColor");return(o,r)=>(e.openBlock(),e.createElementBlock("div",Xe,[(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:p=>u(i)},e.toDisplayString(i.type==="button"?i.page:"..."),11,Ye))),128))]))}}),[["__scopeId","data-v-4c681fa2"]]),fa="";const pe=n=>(e.pushScopeId("data-v-c9da5286"),n=n(),e.popScopeId(),n),et=[pe(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],tt=[pe(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var at=N(e.defineComponent({props:{isFirstPage:{type:Boolean,required:!1},isLastPage:{type:Boolean,required:!1}},emits:["clickPrevPage","clickNextPage"],setup(n,{emit:l}){const t=e.useSlots();return(a,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["previous-page__click-button",{"first-page":n.isFirstPage}]),onClick:u[0]||(u[0]=s=>l("clickPrevPage"))},et,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":n.isLastPage}]),onClick:u[1]||(u[1]=s=>l("clickNextPage"))},tt,2)],64))}}),[["__scopeId","data-v-c9da5286"]]);function nt(n,l,t){return{clickRow:u=>{const s=T({},u);if(n.value){const{checkbox:g}=u;delete s.checkbox,s.isSelected=g}if(l.value){const{index:g}=u;delete s.index,s.indexInCurrentPage=g}t("clickRow",s)}}}function rt(n,l,t){const a=e.ref([]);return{expandingItemIndexList:a,updateExpandingItemIndexList:(g,o,r)=>{r.stopPropagation();const i=a.value.indexOf(g);if(i!==-1)a.value.splice(i,1);else{const y=n.value.findIndex(p=>JSON.stringify(p)===JSON.stringify(o));t("expandRow",l.value+y),a.value.push(l.value+y)}},clearExpandingItemIndexList:()=>{a.value=[]}}}function ot(n){const l=e.computed(()=>n.value.filter(u=>u.fixed)),t=e.computed(()=>l.value.length?l.value[l.value.length-1].value:""),a=e.computed(()=>{if(!l.value.length)return[];const u=l.value.map(s=>{var g;return(g=s.width)!=null?g:100});return l.value.map((s,g)=>{var o,r;return{value:s.value,fixed:(o=s.fixed)!=null?o:!0,width:(r=s.width)!=null?r:100,distance:g===0?0:u.reduce((i,y,p)=>{let x=i;return p<g&&(x+=y),x})}})});return{fixedHeaders:l,lastFixedColumn:t,fixedColumnsInfos:a}}function lt(n,l,t,a,u,s,g,o,r,i,y,p,x,b,A,_,L,F){const c=e.computed(()=>s.value.findIndex(h=>h.fixed)!==-1),S=e.computed(()=>c.value?s.value.filter(h=>h.fixed):[]),P=e.computed(()=>s.value.filter(h=>!h.fixed)),I=(h,D)=>Array.isArray(h)&&Array.isArray(D)?{sortBy:h,sortDesc:D.map(k=>k==="desc")}:h!==""?{sortBy:b.value,sortDesc:A.value==="desc"}:null,f=e.ref(I(b.value,A.value)),C=e.computed(()=>{var re;const D=[...S.value,...P.value].map(U=>{const w=Object.assign(U);if(_.value&&(w.sortable=!0),w.sortable&&(w.sortType="none"),p.value)if(Array.isArray(p.value.sortBy)&&Array.isArray(p.value.sortType)&&p.value.sortBy.includes(w.value)){const z=p.value.sortBy.indexOf(w.value);w.sortType=p.value.sortType[z]}else w.value===p.value.sortBy&&p.value.sortType&&(w.sortType=p.value.sortType);if(f.value&&Array.isArray(f.value.sortBy)&&Array.isArray(f.value.sortDesc)&&f.value.sortBy.includes(w.value)){const z=f.value.sortBy.indexOf(w.value);w.sortType=f.value.sortDesc[z]?"desc":"asc"}else f.value&&w.value===f.value.sortBy&&(w.sortType=f.value.sortDesc?"desc":"asc");return w});let k=[];g.value?k=[a.value||c.value?{text:"",value:"expand",fixed:!0,width:l.value}:{text:"",value:"expand"},...D]:k=D;let R=[];x.value?R=[u.value||c.value?{text:"#",value:"index",fixed:!0,width:o.value}:{text:"#",value:"index"},...k]:R=k;let K=[];return r.value?K=[t.value||c.value?{text:"checkbox",value:"checkbox",fixed:!0,width:(re=n.value)!=null?re:36}:{text:"checkbox",value:"checkbox"},...R]:K=R,K}),$=e.computed(()=>C.value.map(h=>h.value));return{clientSortOptions:f,headerColumns:$,headersForRender:C,updateSortField:(h,D)=>{let k=null;if(D==="none"?k="asc":D==="asc"?k="desc":k=y.value?"asc":null,i.value&&L(h,k),f.value&&Array.isArray(f.value.sortBy)&&Array.isArray(f.value.sortDesc)){const R=f.value.sortBy.indexOf(h);R===-1?k!==null&&(f.value.sortBy.push(h),f.value.sortDesc.push(k==="desc")):k===null?(f.value.sortDesc.splice(R,1),f.value.sortBy.splice(R,1)):f.value.sortDesc[R]=k==="desc"}else k===null?f.value=null:f.value={sortBy:h,sortDesc:k==="desc"};F("updateSort",{sortType:k,sortBy:h})},isMultiSorting:h=>p.value&&Array.isArray(p.value.sortBy)?p.value.sortBy.includes(h):f.value&&Array.isArray(f.value.sortBy)?f.value.sortBy.includes(h):!1,getMultiSortNumber:h=>p.value&&Array.isArray(p.value.sortBy)?p.value.sortBy.indexOf(h)+1:f.value&&Array.isArray(f.value.sortBy)?f.value.sortBy.indexOf(h)+1:!1}}function st(n,l,t,a,u,s,g,o,r){const i=e.computed(()=>(n.value-1)*u.value+1),y=e.computed(()=>t.value?Math.min(r.value,n.value*u.value):Math.min(o.value.length,n.value*u.value)),p=e.computed(()=>t.value?a.value:o.value.slice(i.value-1,y.value)),x=e.computed(()=>g.value?p.value.map((_,L)=>T({index:i.value+L},_)):p.value),b=e.computed(()=>s.value.length===0||s.value.every(L=>o.value.findIndex(F=>JSON.stringify(L)===JSON.stringify(F))===-1)?"noneSelected":s.value.length===o.value.length&&s.value.every(F=>o.value.findIndex(c=>JSON.stringify(F)===JSON.stringify(c))!==-1)?"allSelected":"partSelected"),A=e.computed(()=>l.value?b.value==="allSelected"?x.value.map(_=>T({checkbox:!0},_)):b.value==="noneSelected"?x.value.map(_=>T({checkbox:!1},_)):x.value.map(_=>{const L=s.value.findIndex(F=>{const c=T({},_);return delete c.index,JSON.stringify(F)===JSON.stringify(c)})!==-1;return T({checkbox:L},_)}):x.value);return{currentPageFirstIndex:i,currentPageLastIndex:y,multipleSelectStatus:b,pageItems:A}}function it(n,l,t,a,u,s,g){const o=e.ref(s.value?s.value.page:n.value),r=e.computed(()=>Math.ceil(a.value/u.value)),i=e.computed(()=>r.value===0||o.value===r.value),y=e.computed(()=>o.value===1);return{currentPaginationNumber:o,maxPaginationNumber:r,isLastPage:i,isFirstPage:y,nextPage:()=>{if(a.value!==0&&!i.value&&!t.value)if(l.value){const _=o.value+1;g(_)}else o.value+=1},prevPage:()=>{if(a.value!==0&&!y.value&&!t.value)if(l.value){const _=o.value-1;g(_)}else o.value-=1},updatePage:_=>{t.value||(l.value?g(_):o.value=_)},updateCurrentPaginationNumber:_=>{o.value=_}}}function ct(n,l,t,a){const u=e.computed(()=>!n.value&&l.value.findIndex(o=>o===a.value)===-1?[a.value,...l.value]:l.value),s=e.ref(t.value?t.value.rowsPerPage:a.value);return{rowsItemsComputed:u,rowsPerPageRef:s,updateRowsPerPage:o=>{s.value=o}}}function dt(n,l,t){const a=e.computed({get:()=>{if(n.value){const{page:o,rowsPerPage:r,sortBy:i,sortType:y}=n.value;return{page:o,rowsPerPage:r,sortBy:i!=null?i:null,sortType:y!=null?y:null}}return null},set:o=>{t("update:serverOptions",o)}});return{serverOptionsComputed:a,updateServerOptionsPage:o=>{a.value&&(a.value=ae(T({},a.value),{page:o}))},updateServerOptionsSort:(o,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===o);i===-1&&r!==null&&(a.value.sortBy.push(o),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=ae(T({},a.value),{sortBy:r!==null?o:null,sortType:r})},updateServerOptionsRowsPerPage:o=>{a.value&&(a.value=ae(T({},a.value),{page:1,rowsPerPage:o}))}}}function V(n,l){if(n.includes(".")){let t="";const a=n.split("."),{length:u}=a;let s=0;for(;s<u&&(t=s===0?l[a[s]]:t[a[s]],s+=1,t!==void 0););return t}return l[n]}function ut(n,l){const t=V(n,l);return Array.isArray(t)?t.join(","):t}function pt(n,l,t,a,u,s,g,o,r,i){const y=e.computed(()=>{if(!t.value&&g.value!==""){const c=new RegExp(g.value,"i");return a.value.filter(S=>c.test(s.value!==""?S[s.value]:Object.values(S).join(" ")))}return a.value}),p=e.computed(()=>{let c=[...y.value];return l.value?(l.value.forEach(S=>{c=c.filter(P=>{const{field:I,comparison:f,criteria:C}=S;if(typeof f=="function")return f(V(I,P),C);const $=V(I,P);switch(f){case"=":return $===C;case"!=":return $!==C;case">":return $>C;case"<":return $<C;case"<=":return $<=C;case">=":return $>=C;case"between":return $>=Math.min(...C)&&$<=Math.max(...C);default:return $===C}})}),c):y.value});function x(c,S,P,I){const f=c[I],C=S[I];return(I===0?P:x(c,S,P,I-1)).sort((J,O)=>{let W=!0;for(let h=0;h<I;h+=1)if(V(c[h],J)!==V(c[h],O)){W=!1;break}return W?V(f,J)<V(f,O)?C?1:-1:V(f,J)>V(f,O)?C?-1:1:0:0})}const b=e.computed(()=>{if(t.value)return a.value;if(n.value===null)return p.value;const{sortBy:c,sortDesc:S}=n.value,P=[...p.value];return r&&Array.isArray(c)&&Array.isArray(S)?c.length===0?P:x(c,S,P,c.length-1):P.sort((I,f)=>V(c,I)<V(c,f)?S?1:-1:V(c,I)>V(c,f)?S?-1:1:0)}),A=e.computed(()=>t.value?o.value:b.value.length),_=e.computed({get:()=>{var c;return(c=u.value)!=null?c:[]},set:c=>{i("update:itemsSelected",c)}});return{totalItems:b,selectItemsComputed:_,totalItemsLength:A,toggleSelectAll:c=>{_.value=c?b.value:[]},toggleSelectItem:c=>{const S=c.checkbox;if(delete c.checkbox,delete c.index,S)_.value=_.value.filter(P=>JSON.stringify(P)!==JSON.stringify(c));else{const P=_.value;P.unshift(c),_.value=P}}}}var ft={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,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:""},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"}},ha="",_a="";const mt=n=>(e.pushScopeId("data-v-6fc1a270"),n=n(),e.popScopeId(),n),gt=["onClick"],yt={key:1,class:"header-text"},ht={key:3,class:"multi-sort__number"},_t=["onClick"],bt=["onClick"],xt=["colspan"],kt={key:0,class:"vue3-easy-data-table__loading"},Pt=mt(()=>e.createElementVNode("div",{class:"vue3-easy-data-table__loading-mask"},null,-1)),Nt={class:"loading-entity"},Ct={key:1,class:"vue3-easy-data-table__message"},St={key:0,class:"vue3-easy-data-table__footer"},Bt={key:0,class:"pagination__rows-per-page"},wt={class:"pagination__items-index"},It=e.defineComponent({props:ae(T({},ft),{items:{type:Array,required:!0},headers:{type:Array,required:!0}}),emits:["clickRow","expandRow","updateSort","update:itemsSelected","update:serverOptions"],setup(n,{expose:l,emit:t}){const a=n;e.useCssVars(m=>({"3cc391f1":e.unref(w),"750630c2":e.unref(U)}));const{bodyTextDirection:u,checkboxColumnWidth:s,currentPage:g,expandColumnWidth:o,filterOptions:r,fixedCheckbox:i,fixedExpand:y,fixedHeader:p,fixedIndex:x,headers:b,headerTextDirection:A,indexColumnWidth:_,items:L,itemsSelected:F,loading:c,mustSort:S,multiSort:P,rowsItems:I,rowsPerPage:f,searchField:C,searchValue:$,serverItemsLength:J,serverOptions:O,showIndex:W,sortBy:h,sortType:D,tableHeight:k,tableMinHeight:R,themeColor:K,rowsOfPageSeparatorMessage:re}=e.toRefs(a),U=e.computed(()=>k.value?`${k.value}px`:null),w=e.computed(()=>`${R.value}px`);e.provide("themeColor",K.value);const z=e.useSlots(),$t=e.computed(()=>!!z.pagination),Et=e.computed(()=>!!z.loading),me=e.computed(()=>!!z.expand),ge=e.ref(),se=e.ref();e.provide("dataTable",ge);const ye=e.ref(!1);e.onMounted(()=>{se.value.addEventListener("scroll",()=>{ye.value=se.value.scrollLeft>0})});const ie=e.computed(()=>F.value!==null),G=e.computed(()=>O.value!==null),{serverOptionsComputed:ce,updateServerOptionsPage:vt,updateServerOptionsSort:Vt,updateServerOptionsRowsPerPage:At}=dt(O,P,t),{clientSortOptions:he,headerColumns:_e,headersForRender:q,updateSortField:Lt,isMultiSorting:Ft,getMultiSortNumber:Rt}=lt(s,o,i,y,x,b,me,_,ie,G,S,ce,W,h,D,P,Vt,t),{rowsItemsComputed:be,rowsPerPageRef:j,updateRowsPerPage:Tt}=ct(G,I,O,f),{totalItems:Dt,selectItemsComputed:zt,totalItemsLength:oe,toggleSelectAll:Ht,toggleSelectItem:Ot}=pt(he,r,G,L,F,C,$,J,P,t),{currentPaginationNumber:M,maxPaginationNumber:Q,isLastPage:X,isFirstPage:Y,nextPage:Z,prevPage:ee,updatePage:de,updateCurrentPaginationNumber:Mt}=it(g,G,c,oe,j,O,vt),{currentPageFirstIndex:xe,currentPageLastIndex:ke,multipleSelectStatus:Pe,pageItems:te}=st(M,ie,G,L,j,zt,W,Dt,oe),le=e.computed(()=>M.value===0?0:(M.value-1)*j.value),{expandingItemIndexList:Ne,updateExpandingItemIndexList:jt,clearExpandingItemIndexList:Ce}=rt(te,le,t),{fixedHeaders:ue,lastFixedColumn:Se,fixedColumnsInfos:Wt}=ot(q),{clickRow:qt}=nt(ie,W,t),Jt=m=>{var d;const H=(d=m.width)!=null?d:ue.value.length?100:null;if(H)return`width: ${H}px; min-width: ${H}px;`},Be=(m,H="th")=>{if(!ue.value.length)return;const d=Wt.value.find(v=>v.value===m);if(d)return`left: ${d.distance}px;z-index: ${H==="th"?3:1};position: sticky;`};return e.watch(c,(m,H)=>{ce.value&&m===!1&&H===!0&&(Mt(ce.value.page),Ce())}),e.watch(j,m=>{G.value?At(m):de(1)}),e.watch([M,he,C,$,r],()=>{Ce()},{deep:!0}),l({currentPageFirstIndex:xe,currentPageLastIndex:ke,clientItemsLength:oe,maxPaginationNumber:Q,currentPaginationNumber:M,isLastPage:X,isFirstPage:Y,nextPage:Z,prevPage:ee,updatePage:de,rowsPerPageOptions:be,rowsPerPageActiveOption:j,updateRowsPerPageActiveOption:Tt}),(m,H)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataTable",ref:ge,class:e.normalizeClass(["vue3-easy-data-table",[m.tableClassName]])},[e.createElementVNode("div",{ref_key:"tableBody",ref:se,class:e.normalizeClass(["vue3-easy-data-table__main",{"fixed-header":e.unref(p),"fixed-height":e.unref(k),"show-shadow":ye.value,"table-fixed":e.unref(ue).length,hoverable:!m.noHover,"border-cell":m.borderCell}])},[e.createElementVNode("table",null,[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(q),(d,v)=>(e.openBlock(),e.createElementBlock("col",{key:v,style:e.normalizeStyle(Jt(d))},null,4))),128))]),e.unref(q).length&&!m.hideHeader?(e.openBlock(),e.createElementBlock("thead",{key:0,class:e.normalizeClass(["vue3-easy-data-table__header",[m.headerClassName]])},[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(q),(d,v)=>(e.openBlock(),e.createElementBlock("th",{key:v,class:e.normalizeClass([{sortable:d.sortable,none:d.sortable&&d.sortType==="none",desc:d.sortable&&d.sortType==="desc",asc:d.sortable&&d.sortType==="asc",shadow:d.value===e.unref(Se)},typeof m.headerItemClassName=="string"?m.headerItemClassName:m.headerItemClassName(d,v)]),style:e.normalizeStyle(Be(d.value)),onClick:e.withModifiers(E=>d.sortable&&d.sortType?e.unref(Lt)(d.value,d.sortType):null,["stop"])},[d.text==="checkbox"?(e.openBlock(),e.createBlock(Fe,{key:e.unref(Pe),status:e.unref(Pe),onChange:e.unref(Ht)},null,8,["status","onChange"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["header",`direction-${e.unref(A)}`])},[e.unref(z)[`header-${d.value}`]?e.renderSlot(m.$slots,`header-${d.value}`,e.normalizeProps(e.mergeProps({key:0},d)),void 0,!0):(e.openBlock(),e.createElementBlock("span",yt,e.toDisplayString(d.text),1)),d.sortable?(e.openBlock(),e.createElementBlock("i",{key:d.sortType?d.sortType:"none",class:e.normalizeClass(["sortType-icon",{desc:d.sortType==="desc"}])},null,2)):e.createCommentVNode("",!0),e.unref(P)&&e.unref(Ft)(d.value)?(e.openBlock(),e.createElementBlock("span",ht,e.toDisplayString(e.unref(Rt)(d.value)),1)):e.createCommentVNode("",!0)],2))],14,gt))),128))])],2)):e.createCommentVNode("",!0),e.unref(_e).length?(e.openBlock(),e.createElementBlock("tbody",{key:1,class:e.normalizeClass(["vue3-easy-data-table__body",{"row-alternation":m.alternating}])},[e.renderSlot(m.$slots,"body-prepend",e.normalizeProps(e.guardReactiveProps({items:e.unref(te),pagination:{isFirstPage:e.unref(Y),isLastPage:e.unref(X),currentPaginationNumber:e.unref(M),maxPaginationNumber:e.unref(Q),nextPage:e.unref(Z),prevPage:e.unref(ee)},headers:e.unref(q)})),void 0,!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(te),(d,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:v},[e.createElementVNode("tr",{class:e.normalizeClass([{"even-row":(v+1)%2===0},typeof m.bodyRowClassName=="string"?m.bodyRowClassName:m.bodyRowClassName(d,v)]),onClick:E=>e.unref(qt)(d)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(_e),(E,we)=>(e.openBlock(),e.createElementBlock("td",{key:we,style:e.normalizeStyle(Be(E,"td")),class:e.normalizeClass([{shadow:E===e.unref(Se),"can-expand":E==="expand"},typeof m.bodyItemClassName=="string"?m.bodyItemClassName:m.bodyItemClassName(E,we),`direction-${e.unref(u)}`]),onClick:Ie=>E==="expand"?e.unref(jt)(v+e.unref(le),d,Ie):null},[e.unref(z)[`item-${E}`]?e.renderSlot(m.$slots,`item-${E}`,e.normalizeProps(e.mergeProps({key:0},d)),void 0,!0):e.unref(z)[`item-${E.toLowerCase()}`]?e.renderSlot(m.$slots,`item-${E.toLowerCase()}`,e.normalizeProps(e.mergeProps({key:1},d)),void 0,!0):E==="expand"?(e.openBlock(),e.createElementBlock("i",{key:2,class:e.normalizeClass(["expand-icon",{expanding:e.unref(Ne).includes(e.unref(le)+v)}])},null,2)):E==="checkbox"?(e.openBlock(),e.createBlock(ze,{key:3,checked:d[E],onChange:Ie=>e.unref(Ot)(d)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(e.unref(ut)(E,d)),1)],64))],14,bt))),128))],10,_t),e.unref(me)&&e.unref(Ne).includes(v+e.unref(le))?(e.openBlock(),e.createElementBlock("tr",{key:0,class:e.normalizeClass({"even-row":(v+1)%2===0})},[e.createElementVNode("td",{colspan:e.unref(q).length,class:"expand"},[d.expandLoading?(e.openBlock(),e.createBlock(Qe,{key:0,class:"expand-loading"})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"expand",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)],8,xt)],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(m.$slots,"body-append",e.normalizeProps(e.guardReactiveProps({items:e.unref(te),pagination:{isFirstPage:e.unref(Y),isLastPage:e.unref(X),currentPaginationNumber:e.unref(M),maxPaginationNumber:e.unref(Q),nextPage:e.unref(Z),prevPage:e.unref(ee)},headers:e.unref(q)})),void 0,!0)],2)):e.createCommentVNode("",!0)]),e.unref(c)?(e.openBlock(),e.createElementBlock("div",kt,[Pt,e.createElementVNode("div",Nt,[e.unref(Et)?e.renderSlot(m.$slots,"loading",{key:0},void 0,!0):(e.openBlock(),e.createBlock(Ge,{key:1}))])])):e.createCommentVNode("",!0),!e.unref(te).length&&!e.unref(c)?(e.openBlock(),e.createElementBlock("div",Ct,e.toDisplayString(m.emptyMessage),1)):e.createCommentVNode("",!0)],2),m.hideFooter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",St,[m.hideRowsPerPage?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Bt,[e.createTextVNode(e.toDisplayString(m.rowsPerPageMessage)+" ",1),e.createVNode(qe,{modelValue:e.unref(j),"onUpdate:modelValue":H[0]||(H[0]=d=>e.isRef(j)?j.value=d:null),"rows-items":e.unref(be)},null,8,["modelValue","rows-items"])])),e.createElementVNode("div",wt,e.toDisplayString(`${e.unref(xe)}\u2013${e.unref(ke)}`)+" "+e.toDisplayString(e.unref(re))+" "+e.toDisplayString(e.unref(oe)),1),e.unref($t)?e.renderSlot(m.$slots,"pagination",e.normalizeProps(e.mergeProps({key:1},{isFirstPage:e.unref(Y),isLastPage:e.unref(X),currentPaginationNumber:e.unref(M),maxPaginationNumber:e.unref(Q),nextPage:e.unref(Z),prevPage:e.unref(ee)})),void 0,!0):(e.openBlock(),e.createBlock(at,{key:2,"is-first-page":e.unref(Y),"is-last-page":e.unref(X),onClickNextPage:e.unref(Z),onClickPrevPage:e.unref(ee)},e.createSlots({_:2},[m.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(Ze,{"current-pagination-number":e.unref(M),"max-pagination-number":e.unref(Q),onUpdatePage:e.unref(de)},null,8,["current-pagination-number","max-pagination-number","onUpdatePage"])])}:void 0]),1032,["is-first-page","is-last-page","onClickNextPage","onClickPrevPage"]))]))],2))}});var fe=N(It,[["__scopeId","data-v-6fc1a270"]]);return typeof window!="undefined"&&window.Vue&&window.Vue.createApp({}).component("Vue3EasyDataTable",fe),fe}); | ||
(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 Ut=Object.defineProperty,Gt=Object.defineProperties;var Kt=Object.getOwnPropertyDescriptors;var Ee=Object.getOwnPropertySymbols;var Qt=Object.prototype.hasOwnProperty,Xt=Object.prototype.propertyIsEnumerable;var $e=(e,w,S)=>w in e?Ut(e,w,{enumerable:!0,configurable:!0,writable:!0,value:S}):e[w]=S,z=(e,w)=>{for(var S in w||(w={}))Qt.call(w,S)&&$e(e,S,w[S]);if(Ee)for(var S of Ee(w))Xt.call(w,S)&&$e(e,S,w[S]);return e},ae=(e,w)=>Gt(e,Kt(w));var w="",S=(n,s)=>{const t=n.__vccOpts||n;for(const[a,d]of s)t[a]=d;return t};const ve=n=>(e.pushScopeId("data-v-e0a0b7f0"),n=n(),e.popScopeId(),n),Ve=["onClick"],Ae=["checked"],Le=ve(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var Re=S(e.defineComponent({props:{status:{type:String,required:!0}},emits:["change"],setup(n,{emit:s}){const t=n;e.useCssVars(g=>({"51ab8a49":e.unref(l)}));const a=e.computed(()=>t.status==="allSelected"),d=()=>{s("change",!a.value)},l=e.inject("themeColor");return(g,o)=>(e.openBlock(),e.createElementBlock("div",{class:"easy-checkbox",onClick:e.withModifiers(d,["stop","prevent"])},[e.createElementVNode("input",{type:"checkbox",checked:e.unref(a),class:e.normalizeClass(n.status)},null,10,Ae),Le],8,Ve))}}),[["__scopeId","data-v-e0a0b7f0"]]),Zt="";const Te=n=>(e.pushScopeId("data-v-7e69a276"),n=n(),e.popScopeId(),n),Fe=["checked"],De=Te(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var ze=S(e.defineComponent({props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(n,{emit:s}){e.useCssVars(a=>({fdaf7e9e:e.unref(t)}));const t=e.inject("themeColor");return(a,d)=>(e.openBlock(),e.createElementBlock("div",{class:"easy-checkbox",onClick:d[0]||(d[0]=e.withModifiers(l=>s("change"),["stop","prevent"]))},[e.createElementVNode("input",{type:"checkbox",checked:n.checked},null,8,Fe),De]))}}),[["__scopeId","data-v-7e69a276"]]),ta="";const He=n=>(e.pushScopeId("data-v-09dad912"),n=n(),e.popScopeId(),n),Oe={class:"easy-data-table__rows-selector"},Me={class:"rows-input"},je=He(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),We=["onClick"];var qe=S(e.defineComponent({props:{modelValue:{type:Number,required:!0},rowsItems:{type:Array,required:!0}},emits:["update:modelValue"],setup(n,{emit:s}){const t=n;e.useCssVars(u=>({"7fe9410c":e.unref(y)}));const a=e.ref(!1),d=e.ref(!1),l=e.inject("dataTable");e.watch(a,u=>{if(u&&l){const k=window.innerHeight,_=l.value.getBoundingClientRect().height,A=l.value.getBoundingClientRect().top;k-(_+A)<=100?d.value=!0:d.value=!1}});const g=e.computed({get:()=>t.modelValue,set:u=>{s("update:modelValue",u)}}),o=u=>{g.value=u,a.value=!1},r=(u,k)=>{let _=u.parentNode;for(;_!=null;){if(_.classList&&_.classList.contains(k))return!0;_=_.parentNode}return!1},i=u=>{r(u.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(u,k)=>(e.openBlock(),e.createElementBlock("div",Oe,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:k[0]||(k[0]=_=>a.value=!a.value)},[e.createElementVNode("div",Me,e.toDisplayString(e.unref(g)),1),je]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:a.value,inside:d.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rowsItems,_=>(e.openBlock(),e.createElementBlock("li",{key:_,class:e.normalizeClass({selected:_===e.unref(g)}),onClick:A=>o(_)},e.toDisplayString(_),11,We))),128))],2)]))}}),[["__scopeId","data-v-09dad912"]]),na="";const ne=n=>(e.pushScopeId("data-v-1fa3a520"),n=n(),e.popScopeId(),n),Je={class:"lds-ring"},Ue=[ne(()=>e.createElementVNode("div",null,null,-1)),ne(()=>e.createElementVNode("div",null,null,-1)),ne(()=>e.createElementVNode("div",null,null,-1)),ne(()=>e.createElementVNode("div",null,null,-1))];var Ge=S(e.defineComponent({setup(n){e.useCssVars(t=>({"26774109":e.unref(s)}));const s=e.inject("themeColor");return(t,a)=>(e.openBlock(),e.createElementBlock("div",Je,Ue))}}),[["__scopeId","data-v-1fa3a520"]]),ca="";const Ke={class:"loader-line"};var Qe=S(e.defineComponent({setup(n){e.useCssVars(t=>({"0d327f57":e.unref(s)}));const s=e.inject("themeColor");return(t,a)=>(e.openBlock(),e.createElementBlock("div",Ke))}}),[["__scopeId","data-v-7d281cac"]]),ua="";const Xe={class:"buttons-pagination"},Ye=["onClick"];var Ze=S(e.defineComponent({props:{maxPaginationNumber:{type:Number,required:!0},currentPaginationNumber:{type:Number,required:!0}},emits:["updatePage"],setup(n,{emit:s}){const t=n;e.useCssVars(o=>({"40dd4f07":e.unref(g)}));const a=7,d=o=>{o.type==="button"&&!o.active&&s("updatePage",o.page)},l=e.computed(()=>{const o=[];if(t.maxPaginationNumber<=a)for(let r=1;r<=t.maxPaginationNumber;r+=1)o.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)o.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if(r===4)o.push({type:"omission"});else{const i=t.maxPaginationNumber-(a-r);o.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?o.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber}):r===6?o.push({type:"omission"}):o.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)o.push({type:"button",page:1,active:t.currentPaginationNumber===1,activePrev:r+1===t.currentPaginationNumber});else if(r===2)o.push({type:"omission"});else{const i=t.maxPaginationNumber-(a-r);o.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)o.push({type:"button",page:1,active:t.currentPaginationNumber===1,activePrev:r+1===t.currentPaginationNumber});else if(r===2||r===6)o.push({type:"omission"});else if(r===7)o.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;o.push({type:"button",page:y,active:y===t.currentPaginationNumber,activePrev:y+1===t.currentPaginationNumber})}return o}),g=e.inject("themeColor");return(o,r)=>(e.openBlock(),e.createElementBlock("div",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),(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:u=>d(i)},e.toDisplayString(i.type==="button"?i.page:"..."),11,Ye))),128))]))}}),[["__scopeId","data-v-4c681fa2"]]),fa="";const pe=n=>(e.pushScopeId("data-v-c9da5286"),n=n(),e.popScopeId(),n),et=[pe(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],tt=[pe(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var at=S(e.defineComponent({props:{isFirstPage:{type:Boolean,required:!1},isLastPage:{type:Boolean,required:!1}},emits:["clickPrevPage","clickNextPage"],setup(n,{emit:s}){const t=e.useSlots();return(a,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["previous-page__click-button",{"first-page":n.isFirstPage}]),onClick:d[0]||(d[0]=l=>s("clickPrevPage"))},et,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":n.isLastPage}]),onClick:d[1]||(d[1]=l=>s("clickNextPage"))},tt,2)],64))}}),[["__scopeId","data-v-c9da5286"]]);function nt(n,s,t){return{clickRow:d=>{const l=z({},d);if(n.value){const{checkbox:g}=d;delete l.checkbox,l.isSelected=g}if(s.value){const{index:g}=d;delete l.index,l.indexInCurrentPage=g}t("clickRow",l)}}}function rt(n,s,t){const a=e.ref([]);return{expandingItemIndexList:a,updateExpandingItemIndexList:(g,o,r)=>{r.stopPropagation();const i=a.value.indexOf(g);if(i!==-1)a.value.splice(i,1);else{const y=n.value.findIndex(u=>JSON.stringify(u)===JSON.stringify(o));t("expandRow",s.value+y),a.value.push(s.value+y)}},clearExpandingItemIndexList:()=>{a.value=[]}}}function ot(n){const s=e.computed(()=>n.value.filter(d=>d.fixed)),t=e.computed(()=>s.value.length?s.value[s.value.length-1].value:""),a=e.computed(()=>{if(!s.value.length)return[];const d=s.value.map(l=>{var g;return(g=l.width)!=null?g:100});return s.value.map((l,g)=>{var o,r;return{value:l.value,fixed:(o=l.fixed)!=null?o:!0,width:(r=l.width)!=null?r:100,distance:g===0?0:d.reduce((i,y,u)=>{let k=i;return u<g&&(k+=y),k})}})});return{fixedHeaders:s,lastFixedColumn:t,fixedColumnsInfos:a}}function lt(n,s,t,a,d,l,g,o,r,i,y,u,k,_,A,b,C,F){const $=e.computed(()=>l.value.findIndex(h=>h.fixed)!==-1),f=e.computed(()=>$.value?l.value.filter(h=>h.fixed):[]),x=e.computed(()=>l.value.filter(h=>!h.fixed)),N=(h,v)=>Array.isArray(h)&&Array.isArray(v)?{sortBy:h,sortDesc:v.map(P=>P==="desc")}:h!==""?{sortBy:_.value,sortDesc:A.value==="desc"}:null,p=e.ref(N(_.value,A.value)),I=e.computed(()=>{var re;const v=[...f.value,...x.value].map(U=>{const E=Object.assign(U);if(b.value&&(E.sortable=!0),E.sortable&&(E.sortType="none"),u.value)if(Array.isArray(u.value.sortBy)&&Array.isArray(u.value.sortType)&&u.value.sortBy.includes(E.value)){const M=u.value.sortBy.indexOf(E.value);E.sortType=u.value.sortType[M]}else E.value===u.value.sortBy&&u.value.sortType&&(E.sortType=u.value.sortType);if(p.value&&Array.isArray(p.value.sortBy)&&Array.isArray(p.value.sortDesc)&&p.value.sortBy.includes(E.value)){const M=p.value.sortBy.indexOf(E.value);E.sortType=p.value.sortDesc[M]?"desc":"asc"}else p.value&&E.value===p.value.sortBy&&(E.sortType=p.value.sortDesc?"desc":"asc");return E});let P=[];g.value?P=[a.value||$.value?{text:"",value:"expand",fixed:!0,width:s.value}:{text:"",value:"expand"},...v]:P=v;let D=[];k.value?D=[d.value||$.value?{text:"#",value:"index",fixed:!0,width:o.value}:{text:"#",value:"index"},...P]:D=P;let K=[];return r.value?K=[t.value||$.value?{text:"checkbox",value:"checkbox",fixed:!0,width:(re=n.value)!=null?re:36}:{text:"checkbox",value:"checkbox"},...D]:K=D,K}),B=e.computed(()=>I.value.map(h=>h.value));return{clientSortOptions:p,headerColumns:B,headersForRender:I,updateSortField:(h,v)=>{let P=null;if(v==="none"?P="asc":v==="asc"?P="desc":P=y.value?"asc":null,i.value&&C(h,P),p.value&&Array.isArray(p.value.sortBy)&&Array.isArray(p.value.sortDesc)){const D=p.value.sortBy.indexOf(h);D===-1?P!==null&&(p.value.sortBy.push(h),p.value.sortDesc.push(P==="desc")):P===null?(p.value.sortDesc.splice(D,1),p.value.sortBy.splice(D,1)):p.value.sortDesc[D]=P==="desc"}else P===null?p.value=null:p.value={sortBy:h,sortDesc:P==="desc"};F("updateSort",{sortType:P,sortBy:h})},isMultiSorting:h=>u.value&&Array.isArray(u.value.sortBy)?u.value.sortBy.includes(h):p.value&&Array.isArray(p.value.sortBy)?p.value.sortBy.includes(h):!1,getMultiSortNumber:h=>u.value&&Array.isArray(u.value.sortBy)?u.value.sortBy.indexOf(h)+1:p.value&&Array.isArray(p.value.sortBy)?p.value.sortBy.indexOf(h)+1:!1}}function st(n,s,t,a,d,l,g,o,r){const i=e.computed(()=>(n.value-1)*d.value+1),y=e.computed(()=>t.value?Math.min(r.value,n.value*d.value):Math.min(o.value.length,n.value*d.value)),u=e.computed(()=>t.value?a.value:o.value.slice(i.value-1,y.value)),k=e.computed(()=>g.value?u.value.map((b,C)=>z({index:i.value+C},b)):u.value),_=e.computed(()=>l.value.length===0||l.value.every(C=>o.value.findIndex(F=>JSON.stringify(C)===JSON.stringify(F))===-1)?"noneSelected":l.value.length===o.value.length&&l.value.every(F=>o.value.findIndex($=>JSON.stringify(F)===JSON.stringify($))!==-1)?"allSelected":"partSelected"),A=e.computed(()=>s.value?_.value==="allSelected"?k.value.map(b=>z({checkbox:!0},b)):_.value==="noneSelected"?k.value.map(b=>z({checkbox:!1},b)):k.value.map(b=>{const C=l.value.findIndex(F=>{const $=z({},b);return delete $.index,JSON.stringify(F)===JSON.stringify($)})!==-1;return z({checkbox:C},b)}):k.value);return{currentPageFirstIndex:i,currentPageLastIndex:y,multipleSelectStatus:_,pageItems:A}}function it(n,s,t,a,d,l,g){const o=e.ref(l.value?l.value.page:n.value),r=e.computed(()=>Math.ceil(a.value/d.value)),i=e.computed(()=>r.value===0||o.value===r.value),y=e.computed(()=>o.value===1);return{currentPaginationNumber:o,maxPaginationNumber:r,isLastPage:i,isFirstPage:y,nextPage:()=>{if(a.value!==0&&!i.value&&!t.value)if(s.value){const b=o.value+1;g(b)}else o.value+=1},prevPage:()=>{if(a.value!==0&&!y.value&&!t.value)if(s.value){const b=o.value-1;g(b)}else o.value-=1},updatePage:b=>{t.value||(s.value?g(b):o.value=b)},updateCurrentPaginationNumber:b=>{o.value=b}}}function ct(n,s,t,a){const d=e.computed(()=>!n.value&&s.value.findIndex(o=>o===a.value)===-1?[a.value,...s.value]:s.value),l=e.ref(t.value?t.value.rowsPerPage:a.value);return{rowsItemsComputed:d,rowsPerPageRef:l,updateRowsPerPage:o=>{l.value=o}}}function dt(n,s,t){const a=e.computed({get:()=>{if(n.value){const{page:o,rowsPerPage:r,sortBy:i,sortType:y}=n.value;return{page:o,rowsPerPage:r,sortBy:i!=null?i:null,sortType:y!=null?y:null}}return null},set:o=>{t("update:serverOptions",o)}});return{serverOptionsComputed:a,updateServerOptionsPage:o=>{a.value&&(a.value=ae(z({},a.value),{page:o}))},updateServerOptionsSort:(o,r)=>{if(a.value)if(s.value&&Array.isArray(a.value.sortBy)&&Array.isArray(a.value.sortType)){const i=a.value.sortBy.findIndex(y=>y===o);i===-1&&r!==null&&(a.value.sortBy.push(o),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=ae(z({},a.value),{sortBy:r!==null?o:null,sortType:r})},updateServerOptionsRowsPerPage:o=>{a.value&&(a.value=ae(z({},a.value),{page:1,rowsPerPage:o}))}}}function V(n,s){if(n.includes(".")){let t="";const a=n.split("."),{length:d}=a;let l=0;for(;l<d&&(t=l===0?s[a[l]]:t[a[l]],l+=1,t!==void 0););return t}return s[n]}function ut(n,s){const t=V(n,s);return Array.isArray(t)?t.join(","):t}function pt(n,s,t,a,d,l,g,o,r,i){const y=f=>{if(typeof l.value=="string"&&l.value!=="")return f[l.value];if(Array.isArray(l.value)){let x="";return l.value.forEach(N=>{x+=V(N,f)}),x}return Object.values(f).join(" ")},u=e.computed(()=>{if(!t.value&&g.value!==""){const f=new RegExp(g.value,"i");return a.value.filter(x=>f.test(y(x)))}return a.value}),k=e.computed(()=>{let f=[...u.value];return s.value?(s.value.forEach(x=>{f=f.filter(N=>{const{field:p,comparison:I,criteria:B}=x;if(typeof I=="function")return I(V(p,N),B);const R=V(p,N);switch(I){case"=":return R===B;case"!=":return R!==B;case">":return R>B;case"<":return R<B;case"<=":return R<=B;case">=":return R>=B;case"between":return R>=Math.min(...B)&&R<=Math.max(...B);default:return R===B}})}),f):u.value});function _(f,x,N,p){const I=f[p],B=x[p];return(p===0?N:_(f,x,N,p-1)).sort((O,W)=>{let h=!0;for(let v=0;v<p;v+=1)if(V(f[v],O)!==V(f[v],W)){h=!1;break}return h?V(I,O)<V(I,W)?B?1:-1:V(I,O)>V(I,W)?B?-1:1:0:0})}const A=e.computed(()=>{if(t.value)return a.value;if(n.value===null)return k.value;const{sortBy:f,sortDesc:x}=n.value,N=[...k.value];return r&&Array.isArray(f)&&Array.isArray(x)?f.length===0?N:_(f,x,N,f.length-1):N.sort((p,I)=>V(f,p)<V(f,I)?x?1:-1:V(f,p)>V(f,I)?x?-1:1:0)}),b=e.computed(()=>t.value?o.value:A.value.length),C=e.computed({get:()=>{var f;return(f=d.value)!=null?f:[]},set:f=>{i("update:itemsSelected",f)}});return{totalItems:A,selectItemsComputed:C,totalItemsLength:b,toggleSelectAll:f=>{C.value=f?A.value:[]},toggleSelectItem:f=>{const x=f.checkbox;if(delete f.checkbox,delete f.index,x)C.value=C.value.filter(N=>JSON.stringify(N)!==JSON.stringify(f));else{const N=C.value;N.unshift(f),C.value=N}}}}var ft={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:""},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"}},ha="",_a="";const mt=n=>(e.pushScopeId("data-v-8c691ab2"),n=n(),e.popScopeId(),n),gt=["onClick"],yt={key:1,class:"header-text"},ht={key:3,class:"multi-sort__number"},_t=["onClick"],bt=["onClick"],xt=["colspan"],kt={key:0,class:"vue3-easy-data-table__loading"},Pt=mt(()=>e.createElementVNode("div",{class:"vue3-easy-data-table__loading-mask"},null,-1)),Nt={class:"loading-entity"},St={key:1,class:"vue3-easy-data-table__message"},Ct={key:0,class:"vue3-easy-data-table__footer"},Bt={key:0,class:"pagination__rows-per-page"},wt={class:"pagination__items-index"},It=e.defineComponent({props:ae(z({},ft),{items:{type:Array,required:!0},headers:{type:Array,required:!0}}),emits:["clickRow","expandRow","updateSort","update:itemsSelected","update:serverOptions"],setup(n,{expose:s,emit:t}){const a=n;e.useCssVars(m=>({"0f3c39d7":e.unref(E),"4ae9b979":e.unref(U)}));const{bodyTextDirection:d,checkboxColumnWidth:l,currentPage:g,expandColumnWidth:o,filterOptions:r,fixedCheckbox:i,fixedExpand:y,fixedHeader:u,fixedIndex:k,headers:_,headerTextDirection:A,indexColumnWidth:b,items:C,itemsSelected:F,loading:$,mustSort:f,multiSort:x,rowsItems:N,rowsPerPage:p,searchField:I,searchValue:B,serverItemsLength:R,serverOptions:O,showIndex:W,sortBy:h,sortType:v,tableHeight:P,tableMinHeight:D,themeColor:K,rowsOfPageSeparatorMessage:re}=e.toRefs(a),U=e.computed(()=>P.value?`${P.value}px`:null),E=e.computed(()=>`${D.value}px`);e.provide("themeColor",K.value);const M=e.useSlots(),Et=e.computed(()=>!!M.pagination),$t=e.computed(()=>!!M.loading),me=e.computed(()=>!!M.expand),ge=e.ref(),se=e.ref();e.provide("dataTable",ge);const ye=e.ref(!1);e.onMounted(()=>{se.value.addEventListener("scroll",()=>{ye.value=se.value.scrollLeft>0})});const ie=e.computed(()=>F.value!==null),G=e.computed(()=>O.value!==null),{serverOptionsComputed:ce,updateServerOptionsPage:vt,updateServerOptionsSort:Vt,updateServerOptionsRowsPerPage:At}=dt(O,x,t),{clientSortOptions:he,headerColumns:_e,headersForRender:J,updateSortField:Lt,isMultiSorting:Rt,getMultiSortNumber:Tt}=lt(l,o,i,y,k,_,me,b,ie,G,f,ce,W,h,v,x,Vt,t),{rowsItemsComputed:be,rowsPerPageRef:q,updateRowsPerPage:Ft}=ct(G,N,O,p),{totalItems:Dt,selectItemsComputed:zt,totalItemsLength:oe,toggleSelectAll:Ht,toggleSelectItem:Ot}=pt(he,r,G,C,F,I,B,R,x,t),{currentPaginationNumber:j,maxPaginationNumber:Q,isLastPage:X,isFirstPage:Y,nextPage:Z,prevPage:ee,updatePage:de,updateCurrentPaginationNumber:Mt}=it(g,G,$,oe,q,O,vt),{currentPageFirstIndex:xe,currentPageLastIndex:ke,multipleSelectStatus:Pe,pageItems:te}=st(j,ie,G,C,q,zt,W,Dt,oe),le=e.computed(()=>j.value===0?0:(j.value-1)*q.value),{expandingItemIndexList:Ne,updateExpandingItemIndexList:jt,clearExpandingItemIndexList:Se}=rt(te,le,t),{fixedHeaders:ue,lastFixedColumn:Ce,fixedColumnsInfos:Wt}=ot(J),{clickRow:qt}=nt(ie,W,t),Jt=m=>{var c;const H=(c=m.width)!=null?c:ue.value.length?100:null;if(H)return`width: ${H}px; min-width: ${H}px;`},Be=(m,H="th")=>{if(!ue.value.length)return;const c=Wt.value.find(L=>L.value===m);if(c)return`left: ${c.distance}px;z-index: ${H==="th"?3:1};position: sticky;`};return e.watch($,(m,H)=>{ce.value&&m===!1&&H===!0&&(Mt(ce.value.page),Se())}),e.watch(q,m=>{G.value?At(m):de(1)}),e.watch([j,he,I,B,r],()=>{Se()},{deep:!0}),s({currentPageFirstIndex:xe,currentPageLastIndex:ke,clientItemsLength:oe,maxPaginationNumber:Q,currentPaginationNumber:j,isLastPage:X,isFirstPage:Y,nextPage:Z,prevPage:ee,updatePage:de,rowsPerPageOptions:be,rowsPerPageActiveOption:q,updateRowsPerPageActiveOption:Ft}),(m,H)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataTable",ref:ge,class:e.normalizeClass(["vue3-easy-data-table",[m.tableClassName]])},[e.createElementVNode("div",{ref_key:"tableBody",ref:se,class:e.normalizeClass(["vue3-easy-data-table__main",{"fixed-header":e.unref(u),"fixed-height":e.unref(P),"show-shadow":ye.value,"table-fixed":e.unref(ue).length,hoverable:!m.noHover,"border-cell":m.borderCell}])},[e.createElementVNode("table",null,[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(J),(c,L)=>(e.openBlock(),e.createElementBlock("col",{key:L,style:e.normalizeStyle(Jt(c))},null,4))),128))]),e.unref(J).length&&!m.hideHeader?(e.openBlock(),e.createElementBlock("thead",{key:0,class:e.normalizeClass(["vue3-easy-data-table__header",[m.headerClassName]])},[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(J),(c,L)=>(e.openBlock(),e.createElementBlock("th",{key:L,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(Ce)},typeof m.headerItemClassName=="string"?m.headerItemClassName:m.headerItemClassName(c,L)]),style:e.normalizeStyle(Be(c.value)),onClick:e.withModifiers(T=>c.sortable&&c.sortType?e.unref(Lt)(c.value,c.sortType):null,["stop"])},[c.text==="checkbox"?(e.openBlock(),e.createBlock(Re,{key:e.unref(Pe),status:e.unref(Pe),onChange:e.unref(Ht)},null,8,["status","onChange"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["header",`direction-${e.unref(A)}`])},[e.unref(M)[`header-${c.value}`]?e.renderSlot(m.$slots,`header-${c.value}`,e.normalizeProps(e.mergeProps({key:0},c)),void 0,!0):(e.openBlock(),e.createElementBlock("span",yt,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(x)&&e.unref(Rt)(c.value)?(e.openBlock(),e.createElementBlock("span",ht,e.toDisplayString(e.unref(Tt)(c.value)),1)):e.createCommentVNode("",!0)],2))],14,gt))),128))])],2)):e.createCommentVNode("",!0),e.unref(_e).length?(e.openBlock(),e.createElementBlock("tbody",{key:1,class:e.normalizeClass(["vue3-easy-data-table__body",{"row-alternation":m.alternating}])},[e.renderSlot(m.$slots,"body-prepend",e.normalizeProps(e.guardReactiveProps({items:e.unref(te),pagination:{isFirstPage:e.unref(Y),isLastPage:e.unref(X),currentPaginationNumber:e.unref(j),maxPaginationNumber:e.unref(Q),nextPage:e.unref(Z),prevPage:e.unref(ee)},headers:e.unref(J)})),void 0,!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(te),(c,L)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:L},[e.createElementVNode("tr",{class:e.normalizeClass([{"even-row":(L+1)%2===0},typeof m.bodyRowClassName=="string"?m.bodyRowClassName:m.bodyRowClassName(c,L)]),onClick:T=>e.unref(qt)(c)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(_e),(T,we)=>(e.openBlock(),e.createElementBlock("td",{key:we,style:e.normalizeStyle(Be(T,"td")),class:e.normalizeClass([{shadow:T===e.unref(Ce),"can-expand":T==="expand"},typeof m.bodyItemClassName=="string"?m.bodyItemClassName:m.bodyItemClassName(T,we),`direction-${e.unref(d)}`]),onClick:Ie=>T==="expand"?e.unref(jt)(L+e.unref(le),c,Ie):null},[e.unref(M)[`item-${T}`]?e.renderSlot(m.$slots,`item-${T}`,e.normalizeProps(e.mergeProps({key:0},c)),void 0,!0):T==="expand"?(e.openBlock(),e.createElementBlock("i",{key:1,class:e.normalizeClass(["expand-icon",{expanding:e.unref(Ne).includes(e.unref(le)+L)}])},null,2)):T==="checkbox"?(e.openBlock(),e.createBlock(ze,{key:2,checked:c[T],onChange:Ie=>e.unref(Ot)(c)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(e.unref(ut)(T,c)),1)],64))],14,bt))),128))],10,_t),e.unref(me)&&e.unref(Ne).includes(L+e.unref(le))?(e.openBlock(),e.createElementBlock("tr",{key:0,class:e.normalizeClass({"even-row":(L+1)%2===0})},[e.createElementVNode("td",{colspan:e.unref(J).length,class:"expand"},[c.expandLoading?(e.openBlock(),e.createBlock(Qe,{key:0,class:"expand-loading"})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"expand",e.normalizeProps(e.guardReactiveProps(c)),void 0,!0)],8,xt)],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(m.$slots,"body-append",e.normalizeProps(e.guardReactiveProps({items:e.unref(te),pagination:{isFirstPage:e.unref(Y),isLastPage:e.unref(X),currentPaginationNumber:e.unref(j),maxPaginationNumber:e.unref(Q),nextPage:e.unref(Z),prevPage:e.unref(ee)},headers:e.unref(J)})),void 0,!0)],2)):e.createCommentVNode("",!0)]),e.unref($)?(e.openBlock(),e.createElementBlock("div",kt,[Pt,e.createElementVNode("div",Nt,[e.unref($t)?e.renderSlot(m.$slots,"loading",{key:0},void 0,!0):(e.openBlock(),e.createBlock(Ge,{key:1}))])])):e.createCommentVNode("",!0),!e.unref(te).length&&!e.unref($)?(e.openBlock(),e.createElementBlock("div",St,e.toDisplayString(m.emptyMessage),1)):e.createCommentVNode("",!0)],2),m.hideFooter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ct,[m.hideRowsPerPage?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Bt,[e.createTextVNode(e.toDisplayString(m.rowsPerPageMessage)+" ",1),e.createVNode(qe,{modelValue:e.unref(q),"onUpdate:modelValue":H[0]||(H[0]=c=>e.isRef(q)?q.value=c:null),"rows-items":e.unref(be)},null,8,["modelValue","rows-items"])])),e.createElementVNode("div",wt,e.toDisplayString(`${e.unref(xe)}\u2013${e.unref(ke)}`)+" "+e.toDisplayString(e.unref(re))+" "+e.toDisplayString(e.unref(oe)),1),e.unref(Et)?e.renderSlot(m.$slots,"pagination",e.normalizeProps(e.mergeProps({key:1},{isFirstPage:e.unref(Y),isLastPage:e.unref(X),currentPaginationNumber:e.unref(j),maxPaginationNumber:e.unref(Q),nextPage:e.unref(Z),prevPage:e.unref(ee)})),void 0,!0):(e.openBlock(),e.createBlock(at,{key:2,"is-first-page":e.unref(Y),"is-last-page":e.unref(X),onClickNextPage:e.unref(Z),onClickPrevPage:e.unref(ee)},e.createSlots({_:2},[m.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(Ze,{"current-pagination-number":e.unref(j),"max-pagination-number":e.unref(Q),onUpdatePage:e.unref(de)},null,8,["current-pagination-number","max-pagination-number","onUpdatePage"])])}:void 0]),1032,["is-first-page","is-last-page","onClickNextPage","onClickPrevPage"]))]))],2))}});var fe=S(It,[["__scopeId","data-v-8c691ab2"]]);return typeof window!="undefined"&&window.Vue&&window.Vue.createApp({}).component("Vue3EasyDataTable",fe),fe}); |
@@ -6,3 +6,3 @@ { | ||
"private": false, | ||
"version": "1.5.6", | ||
"version": "1.5.7", | ||
"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
114071
1802