Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue3-easy-data-table

Package Overview
Dependencies
Maintainers
1
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-easy-data-table - npm Package Compare versions

Comparing version 1.4.2 to 1.4.3

422

dist/vue3-easy-data-table.es.js

@@ -34,2 +34,3 @@ var __defProp = Object.defineProperty;

const _sfc_main$7 = /* @__PURE__ */ defineComponent({
__name: "MutipleSelectCheckBox",
props: {

@@ -70,2 +71,3 @@ status: { type: String, required: true }

const _sfc_main$6 = /* @__PURE__ */ defineComponent({
__name: "SingleSelectCheckBox",
props: {

@@ -102,2 +104,3 @@ checked: { type: Boolean, required: true }

const _sfc_main$5 = /* @__PURE__ */ defineComponent({
__name: "RowsSelector",
props: {

@@ -198,2 +201,3 @@ modelValue: { type: Number, required: true },

const _sfc_main$4 = /* @__PURE__ */ defineComponent({
__name: "Loading",
setup(__props) {

@@ -213,2 +217,3 @@ useCssVars((_ctx) => ({

const _sfc_main$3 = /* @__PURE__ */ defineComponent({
__name: "LoadingLine",
setup(__props) {

@@ -229,2 +234,3 @@ useCssVars((_ctx) => ({

const _sfc_main$2 = /* @__PURE__ */ defineComponent({
__name: "ButtonsPagination",
props: {

@@ -389,2 +395,3 @@ maxPaginationNumber: { type: Number, required: true },

const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "PaginationArrows",
props: {

@@ -585,9 +592,9 @@ isFirstPage: { type: Boolean, required: false },

}
function usePageItems(currentPaginationNumber, isMutipleSelectable, isServerSideMode, items, rowsPerPageReactive, selectItemsComputed, showIndex, totalItems, totalItemsLength) {
const currentPageFirstIndex = computed(() => (currentPaginationNumber.value - 1) * rowsPerPageReactive.value + 1);
function usePageItems(currentPaginationNumber, isMutipleSelectable, isServerSideMode, items, rowsPerPageRef, selectItemsComputed, showIndex, totalItems, totalItemsLength) {
const currentPageFirstIndex = computed(() => (currentPaginationNumber.value - 1) * rowsPerPageRef.value + 1);
const currentPageLastIndex = computed(() => {
if (isServerSideMode.value) {
return Math.min(totalItemsLength.value, currentPaginationNumber.value * rowsPerPageReactive.value);
return Math.min(totalItemsLength.value, currentPaginationNumber.value * rowsPerPageRef.value);
}
return Math.min(totalItems.value.length, currentPaginationNumber.value * rowsPerPageReactive.value);
return Math.min(totalItems.value.length, currentPaginationNumber.value * rowsPerPageRef.value);
});

@@ -653,3 +660,3 @@ const itemsInPage = computed(() => {

}
function usePagination(isServerSideMode, loading, totalItemsLength, rowsPerPage, serverOptions, updateServerOptionsPage) {
function usePagination$1(isServerSideMode, loading, totalItemsLength, rowsPerPage, serverOptions, updateServerOptionsPage) {
const currentPaginationNumber = ref(serverOptions.value ? serverOptions.value.page : 1);

@@ -713,6 +720,6 @@ const maxPaginationNumber = computed(() => Math.ceil(totalItemsLength.value / rowsPerPage.value));

});
const rowsPerPageReactive = ref(serverOptions.value ? serverOptions.value.rowsPerPage : rowsPerPage.value);
const rowsPerPageRef = ref(serverOptions.value ? serverOptions.value.rowsPerPage : rowsPerPage.value);
return {
rowsItemsComputed,
rowsPerPageReactive
rowsPerPageRef
};

@@ -877,5 +884,151 @@ }

}
var withOptionalProps = {
alternating: {
type: Boolean,
default: false
},
buttonsPagination: {
type: Boolean,
default: false
},
checkboxColumnWidth: {
type: Number,
default: null
},
emptyMessage: {
type: String,
default: "No Available Data"
},
expandColumnWidth: {
type: Number,
default: 36
},
filterOptions: {
type: Array,
default: null
},
fixedExpand: {
type: Boolean,
default: false
},
fixedHeader: {
type: Boolean,
default: true
},
fixedCheckbox: {
type: Boolean,
default: false
},
fixedIndex: {
type: Boolean,
default: false
},
hideFooter: {
type: Boolean,
default: false
},
hideRowsPerPage: {
type: Boolean,
default: false
},
hideHeader: {
type: Boolean,
default: false
},
indexColumnWidth: {
type: Number,
default: 60
},
itemsSelected: {
type: Array,
default: null
},
loading: {
type: Boolean,
deault: false
},
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: false
},
sortBy: {
type: String,
default: ""
},
sortType: {
type: String,
default: "asc"
},
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: false
},
borderCell: {
type: Boolean,
default: false
},
mustSort: {
type: Boolean,
default: false
}
};
var DataTable_vue_vue_type_style_index_0_lang = "";
var DataTable_vue_vue_type_style_index_1_scoped_true_lang = "";
const _withScopeId = (n) => (pushScopeId("data-v-5ce3e42c"), n = n(), popScopeId(), n);
const _withScopeId = (n) => (pushScopeId("data-v-259651f8"), n = n(), popScopeId(), n);
const _hoisted_1 = ["onClick"];

@@ -913,156 +1066,13 @@ const _hoisted_2 = {

const _sfc_main = /* @__PURE__ */ defineComponent({
props: {
alternating: {
type: Boolean,
default: false
},
buttonsPagination: {
type: Boolean,
default: false
},
checkboxColumnWidth: {
type: Number,
default: null
},
emptyMessage: {
type: String,
default: "No Available Data"
},
expandColumnWidth: {
type: Number,
default: 36
},
filterOptions: {
__name: "DataTable",
props: __spreadProps(__spreadValues({}, withOptionalProps), {
items: {
type: Array,
default: null
required: true
},
fixedExpand: {
type: Boolean,
default: false
},
fixedHeader: {
type: Boolean,
default: true
},
fixedCheckbox: {
type: Boolean,
default: false
},
fixedIndex: {
type: Boolean,
default: false
},
headers: {
type: Array,
required: true
},
hideFooter: {
type: Boolean,
default: false
},
hideRowsPerPage: {
type: Boolean,
default: false
},
hideHeader: {
type: Boolean,
default: false
},
indexColumnWidth: {
type: Number,
default: 60
},
items: {
type: Array,
required: true
},
itemsSelected: {
type: Array,
default: null
},
loading: {
type: Boolean,
deault: false
},
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: false
},
sortBy: {
type: String,
default: ""
},
sortType: {
type: String,
default: "asc"
},
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: false
},
borderCell: {
type: Boolean,
default: false
},
mustSort: {
type: Boolean,
default: false
}
},
}),
emits: [

@@ -1077,3 +1087,3 @@ "clickRow",

useCssVars((_ctx) => ({
"6a2841eb": unref(tableHeightPx)
"25773339": unref(tableHeightPx)
}));

@@ -1137,3 +1147,3 @@ const {

rowsItemsComputed,
rowsPerPageReactive
rowsPerPageRef
} = useRows(isServerSideMode, rowsItems, serverOptions, rowsPerPage);

@@ -1156,3 +1166,3 @@ const {

updateCurrentPaginationNumber
} = usePagination(isServerSideMode, loading, totalItemsLength, rowsPerPageReactive, serverOptions, updateServerOptionsPage);
} = usePagination$1(isServerSideMode, loading, totalItemsLength, rowsPerPageRef, serverOptions, updateServerOptionsPage);
const {

@@ -1163,3 +1173,3 @@ currentPageFirstIndex,

pageItems
} = usePageItems(currentPaginationNumber, isMutipleSelectable, isServerSideMode, items, rowsPerPageReactive, selectItemsComputed, showIndex, totalItems, totalItemsLength);
} = usePageItems(currentPaginationNumber, isMutipleSelectable, isServerSideMode, items, rowsPerPageRef, selectItemsComputed, showIndex, totalItems, totalItemsLength);
const {

@@ -1204,3 +1214,3 @@ expandingItemIndexList,

}, { deep: true });
watch(rowsPerPageReactive, (value) => {
watch(rowsPerPageRef, (value) => {
if (!isServerSideMode.value) {

@@ -1228,3 +1238,3 @@ updatePage(1);

ref: dataTable,
class: normalizeClass(["vue3-easy-data-table", [__props.tableClassName]])
class: normalizeClass(["vue3-easy-data-table", [_ctx.tableClassName]])
}, [

@@ -1239,4 +1249,4 @@ createElementVNode("div", {

"table-fixed": unref(fixedHeaders).length,
"hoverable": !__props.noHover,
"border-cell": __props.borderCell
"hoverable": !_ctx.noHover,
"border-cell": _ctx.borderCell
}])

@@ -1253,5 +1263,5 @@ }, [

]),
unref(headersForRender).length && !__props.hideHeader ? (openBlock(), createElementBlock("thead", {
unref(headersForRender).length && !_ctx.hideHeader ? (openBlock(), createElementBlock("thead", {
key: 0,
class: normalizeClass(["vue3-easy-data-table__header", [__props.headerClassName]])
class: normalizeClass(["vue3-easy-data-table__header", [_ctx.headerClassName]])
}, [

@@ -1268,3 +1278,3 @@ createElementVNode("tr", null, [

"shadow": header.value === unref(lastFixedColumn)
}, typeof __props.headerItemClassName === "string" ? __props.headerItemClassName : __props.headerItemClassName(header, index)]),
}, typeof _ctx.headerItemClassName === "string" ? _ctx.headerItemClassName : _ctx.headerItemClassName(header, index)]),
style: normalizeStyle(getFixedDistance(header.value)),

@@ -1290,3 +1300,3 @@ onClick: withModifiers(($event) => header.sortable && header.sortType ? unref(updateSortField)(header.value, header.sortType) : null, ["stop"])

key: 1,
class: normalizeClass(["vue3-easy-data-table__body", { "row-alternation": __props.alternating }])
class: normalizeClass(["vue3-easy-data-table__body", { "row-alternation": _ctx.alternating }])
}, [

@@ -1298,3 +1308,3 @@ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(pageItems), (item, index) => {

{ "even-row": (index + 1) % 2 === 0 },
typeof __props.bodyRowClassName === "string" ? __props.bodyRowClassName : __props.bodyRowClassName(item, index)
typeof _ctx.bodyRowClassName === "string" ? _ctx.bodyRowClassName : _ctx.bodyRowClassName(item, index)
]),

@@ -1310,3 +1320,3 @@ onClick: ($event) => unref(clickRow)(item)

"can-expand": column === "expand"
}, typeof __props.bodyItemClassName === "string" ? __props.bodyItemClassName : __props.bodyItemClassName(column, i)]),
}, typeof _ctx.bodyItemClassName === "string" ? _ctx.bodyItemClassName : _ctx.bodyItemClassName(column, i)]),
onClick: ($event) => column === "expand" ? unref(updateExpandingItemIndexList)(index, item, $event) : null

@@ -1352,10 +1362,10 @@ }, [

])) : createCommentVNode("", true),
!unref(pageItems).length && !unref(loading) ? (openBlock(), createElementBlock("div", _hoisted_10, toDisplayString(__props.emptyMessage), 1)) : createCommentVNode("", true)
!unref(pageItems).length && !unref(loading) ? (openBlock(), createElementBlock("div", _hoisted_10, toDisplayString(_ctx.emptyMessage), 1)) : createCommentVNode("", true)
], 2),
!__props.hideFooter ? (openBlock(), createElementBlock("div", _hoisted_11, [
!__props.hideRowsPerPage ? (openBlock(), createElementBlock("div", _hoisted_12, [
createTextVNode(toDisplayString(__props.rowsPerPageMessage) + " ", 1),
!_ctx.hideFooter ? (openBlock(), createElementBlock("div", _hoisted_11, [
!_ctx.hideRowsPerPage ? (openBlock(), createElementBlock("div", _hoisted_12, [
createTextVNode(toDisplayString(_ctx.rowsPerPageMessage) + " ", 1),
createVNode(RowsSelector, {
modelValue: unref(rowsPerPageReactive),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(rowsPerPageReactive) ? rowsPerPageReactive.value = $event : null),
modelValue: unref(rowsPerPageRef),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(rowsPerPageRef) ? rowsPerPageRef.value = $event : null),
"rows-items": unref(rowsItemsComputed)

@@ -1379,3 +1389,3 @@ }, null, 8, ["modelValue", "rows-items"])

}, createSlots({ _: 2 }, [
__props.buttonsPagination ? {
_ctx.buttonsPagination ? {
name: "buttonsPagination",

@@ -1396,6 +1406,60 @@ fn: withCtx(() => [

});
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5ce3e42c"]]);
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-259651f8"]]);
function usePagination(dataTableRef) {
const currentPageFirstIndex = computed(() => {
var _a;
return (_a = dataTableRef.value) == null ? void 0 : _a.currentPageFirstIndex;
});
const currentPageLastIndex = computed(() => {
var _a;
return (_a = dataTableRef.value) == null ? void 0 : _a.currentPageLastIndex;
});
const clientItemsLength = computed(() => {
var _a;
return (_a = dataTableRef.value) == null ? void 0 : _a.clientItemsLength;
});
const maxPaginationNumber = computed(() => {
var _a;
return (_a = dataTableRef.value) == null ? void 0 : _a.maxPaginationNumber;
});
const currentPaginationNumber = computed(() => {
var _a;
return (_a = dataTableRef.value) == null ? void 0 : _a.currentPaginationNumber;
});
const isFirstPage = computed(() => {
var _a;
return (_a = dataTableRef.value) == null ? void 0 : _a.isFirstPage;
});
const isLastPage = computed(() => {
var _a;
return (_a = dataTableRef.value) == null ? void 0 : _a.isLastPage;
});
const nextPage = () => {
var _a;
(_a = dataTableRef.value) == null ? void 0 : _a.nextPage();
};
const prevPage = () => {
var _a;
(_a = dataTableRef.value) == null ? void 0 : _a.prevPage();
};
const updatePage = (paginationNumber) => {
var _a;
(_a = dataTableRef.value) == null ? void 0 : _a.updatePage(paginationNumber);
};
return {
currentPageFirstIndex,
currentPageLastIndex,
clientItemsLength,
maxPaginationNumber,
currentPaginationNumber,
isFirstPage,
isLastPage,
nextPage,
prevPage,
updatePage
};
}
if (typeof window !== "undefined" && window.Vue) {
window.Vue.createApp({}).component("Vue3EasyDataTable", DataTable);
}
export { DataTable as default };
export { DataTable as default, usePagination };

@@ -1,1 +0,1 @@

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

@@ -6,3 +6,3 @@ {

"private": false,
"version": "1.4.2",
"version": "1.4.3",
"types": "./types/main.d.ts",

@@ -9,0 +9,0 @@ "license": "MIT",

@@ -48,1 +48,3 @@ export type SortType = 'asc' | 'desc'

export type BodyItemClassNameFunction = (column: string, index: number) => string
export type { DataTableRef, UsePaginationReturn } from '../src/customization/usePagination';

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc