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.0.7 to 1.0.8

177

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

@@ -482,4 +482,3 @@ var __defProp = Object.defineProperty;

type: Object,
default: () => {
}
default: () => null
},

@@ -509,3 +508,2 @@ serverItemsLength: {

"update:itemsSelected",
"update:isAllSelected",
"update:serverOptions"

@@ -516,9 +514,9 @@ ],

useCssVars((_ctx) => ({
"0bc07f05": unref(borderColor),
"25264b81": unref(maxHeightPx),
"66b91e2c": unref(fontSizePx),
"5544ec12": unref(rowHeightPx),
"6f932c96": unref(headerFontColor),
"ab32f114": __props.headerBackgroundColor,
"7fb28480": unref(bodyFontColor)
"394096bd": unref(borderColor),
"52a66339": unref(maxHeightPx),
"1134fb9c": unref(fontSizePx),
"02dda1af": unref(rowHeightPx),
"f8183526": unref(headerFontColor),
"ef534da4": __props.headerBackgroundColor,
"e4007110": unref(bodyFontColor)
}));

@@ -541,8 +539,13 @@ const {

get: () => {
var _a, _b, _c;
const {
page,
rowsPerPage,
sortBy,
sortType
} = props.serverOptions;
return {
page: 1,
rowsPerPage: (_a = props.serverOptions.rowsPerPage) != null ? _a : props.rowsPerPage,
sortBy: (_b = props.serverOptions.sortBy) != null ? _b : null,
sortType: (_c = props.serverOptions.sortType) != null ? _c : null
page,
rowsPerPage,
sortBy: sortBy != null ? sortBy : null,
sortType: sortType != null ? sortType : null
};

@@ -555,20 +558,28 @@ },

const isMutipleSelectable = computed(() => props.itemsSelected !== null);
const isServerSideMode = computed(() => props.serverItemsLength > 0);
const initHeadersForRender = () => {
const headersWithSortType = structuredClone(props.headers);
headersWithSortType.map((header) => {
const headerWithSortType = header;
const isServerSideMode = computed(() => props.serverOptions !== null);
const initClientSortOptions = () => {
if (props.sortBy !== "") {
return {
sortBy: props.sortBy,
sortDesc: props.sortType === "desc"
};
}
return null;
};
const clientSortOptions = ref(initClientSortOptions());
const headersForRender = computed(() => {
const headersSorting = props.headers.map((header) => {
const headerSorting = header;
if (header.sortable)
headerWithSortType.sortType = null;
if (isServerSideMode.value && header.value === props.serverOptions.sortBy) {
headerWithSortType.sortType = props.serverOptions.sortType;
headerSorting.sortType = "none";
if (isServerSideMode.value && header.value === serverOptionsComputed.value.sortBy && serverOptionsComputed.value.sortType) {
headerSorting.sortType = serverOptionsComputed.value.sortType;
}
if (!isServerSideMode.value && header.value === props.sortBy) {
headerWithSortType.sortType = props.sortType;
if (!isServerSideMode.value && clientSortOptions.value && header.value === clientSortOptions.value.sortBy) {
headerSorting.sortType = clientSortOptions.value.sortDesc ? "desc" : "asc";
}
return headerWithSortType;
return headerSorting;
});
return isMutipleSelectable.value ? [{ text: "checkbox", value: "checkbox" }, ...headersWithSortType] : headersWithSortType;
};
const headersForRender = ref(initHeadersForRender());
return isMutipleSelectable.value ? [{ text: "checkbox", value: "checkbox" }, ...headersSorting] : headersSorting;
});
const headerColumns = computed(() => headersForRender.value.map((header) => header.value));

@@ -597,4 +608,4 @@ const selectItemsComputed = computed({

});
const currentPaginationNumber = ref(1);
const rowsPerPageReactive = ref(props.rowsPerPage);
const currentPaginationNumber = ref(isServerSideMode.value ? props.serverOptions.page : 1);
const rowsPerPageReactive = ref(isServerSideMode.value ? props.serverOptions.rowsPerPage : props.rowsPerPage);
watch(rowsPerPageReactive, (value) => {

@@ -609,39 +620,16 @@ if (isServerSideMode.value) {

});
const initClientSortOptions = () => {
if (props.sortBy !== "") {
return {
sortBy: props.sortBy,
sortDesc: props.sortType === "desc"
};
const updateSortField = (newSortBy, oldSortType) => {
let newSortType = null;
if (oldSortType === "none") {
newSortType = "asc";
} else if (oldSortType === "asc") {
newSortType = "desc";
} else {
newSortType = null;
}
return null;
};
const clientSortOptions = ref(initClientSortOptions());
const updateSortField = (newSortBy) => {
let newSortType = null;
headersForRender.value.map((item) => {
const itemSortingUpdated = item;
if (item.sortable) {
if (item.value === newSortBy) {
if (item.sortType === null) {
newSortType = "asc";
} else if (item.sortType === "asc") {
newSortType = "desc";
} else {
newSortType = null;
}
itemSortingUpdated.sortType = newSortType;
} else {
itemSortingUpdated.sortType = null;
}
}
return itemSortingUpdated;
});
if (isServerSideMode.value) {
serverOptionsComputed.value = {
page: 1,
rowsPerPage: rowsPerPageReactive.value,
serverOptionsComputed.value = __spreadProps(__spreadValues({}, serverOptionsComputed.value), {
sortBy: newSortType !== null ? newSortBy : null,
sortType: newSortType
};
});
} else if (newSortType === null) {

@@ -672,3 +660,8 @@ clientSortOptions.value = null;

const totalItemsLength = computed(() => isServerSideMode.value ? props.serverItemsLength : itemsSearching.value.length);
const lastIndexOfItemsInCurrentPage = computed(() => Math.min(itemsSearching.value.length, currentPaginationNumber.value * rowsPerPageReactive.value));
const lastIndexOfItemsInCurrentPage = computed(() => {
if (isServerSideMode.value) {
return currentPaginationNumber.value * rowsPerPageReactive.value;
}
return Math.min(itemsSearching.value.length, currentPaginationNumber.value * rowsPerPageReactive.value);
});
const firstIndexOfItemsInCurrentPage = computed(() => (currentPaginationNumber.value - 1) * rowsPerPageReactive.value + 1);

@@ -678,4 +671,2 @@ const maxPaginationNumber = computed(() => Math.ceil(totalItemsLength.value / rowsPerPageReactive.value));

const isFirstPage = computed(() => currentPaginationNumber.value === 1);
const isLoadingFromServer = ref(false);
const pageLoadingFromServer = ref(1);
const { loading } = toRefs(props);

@@ -687,3 +678,3 @@ const nextPage = () => {

return;
if (isServerSideMode.value && props.items.length < currentPaginationNumber.value * rowsPerPageReactive.value + 1) {
if (isServerSideMode.value) {
const nextPaginationNumber = currentPaginationNumber.value + 1;

@@ -693,4 +684,2 @@ serverOptionsComputed.value = __spreadProps(__spreadValues({}, serverOptionsComputed.value), {

});
isLoadingFromServer.value = true;
pageLoadingFromServer.value = nextPaginationNumber;
} else {

@@ -700,9 +689,23 @@ currentPaginationNumber.value += 1;

};
const updatePaginationNumber = (value) => {
const prevPage = () => {
if (isFirstPage.value)
return;
if (loading.value)
return;
if (isServerSideMode.value) {
const prevPaginationNumber = currentPaginationNumber.value - 1;
serverOptionsComputed.value = __spreadProps(__spreadValues({}, serverOptionsComputed.value), {
page: prevPaginationNumber
});
} else {
currentPaginationNumber.value -= 1;
}
};
const updatePage = (value) => {
if (loading.value)
return;
if (isServerSideMode.value) {
serverOptionsComputed.value = __spreadProps(__spreadValues({}, serverOptionsComputed.value), {
page: value
});
isLoadingFromServer.value = true;
pageLoadingFromServer.value = value;
} else {

@@ -713,22 +716,12 @@ currentPaginationNumber.value = value;

watch(loading, (newVal, oldVal) => {
if (isLoadingFromServer.value) {
if (isServerSideMode.value) {
if (newVal === false && oldVal === true) {
currentPaginationNumber.value = pageLoadingFromServer.value;
isLoadingFromServer.value = false;
currentPaginationNumber.value = serverOptionsComputed.value.page;
}
}
});
const prevPage = () => {
if (isFirstPage.value)
return;
currentPaginationNumber.value -= 1;
};
const itemsInPage = computed(() => {
if (isServerSideMode.value)
return props.items;
const res = [];
for (let i = firstIndexOfItemsInCurrentPage.value - 1; i < lastIndexOfItemsInCurrentPage.value; i += 1) {
res.push(itemsSorting.value[i]);
}
return res;
return itemsSorting.value.slice(firstIndexOfItemsInCurrentPage.value - 1, lastIndexOfItemsInCurrentPage.value);
});

@@ -769,5 +762,5 @@ const itemsForRender = computed(() => {

createElementVNode("table", null, [
headersForRender.value.length ? (openBlock(), createElementBlock("thead", _hoisted_2, [
unref(headersForRender).length ? (openBlock(), createElementBlock("thead", _hoisted_2, [
createElementVNode("tr", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(headersForRender.value, (header, index) => {
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(headersForRender), (header, index) => {
return openBlock(), createElementBlock("th", {

@@ -777,7 +770,7 @@ key: index,

sortable: header.sortable,
"none": header.sortable && header.sortType === null,
"none": header.sortable && header.sortType === "none",
"desc": header.sortable && header.sortType === "desc",
"asc": header.sortable && header.sortType === "asc"
}),
onClick: ($event) => header.sortable ? updateSortField(header.value) : null
onClick: ($event) => header.sortable && header.sortType ? updateSortField(header.value, header.sortType) : null
}, [

@@ -853,3 +846,3 @@ header.text === "checkbox" ? (openBlock(), createBlock(MutipleSelectCheckBox, {

"max-pagination-number": unref(maxPaginationNumber),
onUpdatePage: updatePaginationNumber
onUpdatePage: updatePage
}, null, 8, ["current-pagination-number", "max-pagination-number"])

@@ -864,3 +857,3 @@ ])

});
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-40c7e760"]]);
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-20cd48de"]]);
export { DataTable as default };

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

(function(e,m){typeof exports=="object"&&typeof module!="undefined"?module.exports=m(require("vue")):typeof define=="function"&&define.amd?define(["vue"],m):(e=typeof globalThis!="undefined"?globalThis:e||self,e["vue3-easy-data-table"]=m(e.Vue))})(this,function(e){"use strict";var qe=Object.defineProperty,Je=Object.defineProperties;var Ue=Object.getOwnPropertyDescriptors;var J=Object.getOwnPropertySymbols;var We=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable;var U=(e,m,p)=>m in e?qe(e,m,{enumerable:!0,configurable:!0,writable:!0,value:p}):e[m]=p,P=(e,m)=>{for(var p in m||(m={}))We.call(m,p)&&U(e,p,m[p]);if(J)for(var p of J(m))Ge.call(m,p)&&U(e,p,m[p]);return e},L=(e,m)=>Je(e,Ue(m));var m="",p=(a,u)=>{const t=a.__vccOpts||a;for(const[c,d]of u)t[c]=d;return t};const W=a=>(e.pushScopeId("data-v-566775ba"),a=a(),e.popScopeId(),a),G=["onClick"],K=["checked"],Q=W(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var X=p(e.defineComponent({props:{status:{type:String,required:!0}},emits:["change"],setup(a,{emit:u}){const t=a;e.useCssVars(x=>({"7f84b28f":e.unref(y)}));const c=e.computed(()=>t.status==="allSelected"),d=()=>{u("change",!c.value)},y=e.inject("themeColor");return(x,b)=>(e.openBlock(),e.createElementBlock("div",{class:"multi-select__checkbox",onClick:e.withModifiers(d,["stop","prevent"])},[e.createElementVNode("input",{type:"checkbox",checked:e.unref(c),class:e.normalizeClass(a.status)},null,10,K),Q],8,G))}}),[["__scopeId","data-v-566775ba"]]),Qe="";const Y=a=>(e.pushScopeId("data-v-39f156fd"),a=a(),e.popScopeId(),a),Z=["checked"],v=Y(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var ee=p(e.defineComponent({props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(a,{emit:u}){e.useCssVars(c=>({"20cfc5a0":e.unref(t)}));const t=e.inject("themeColor");return(c,d)=>(e.openBlock(),e.createElementBlock("div",{class:"single-select__checkbox",onClick:d[0]||(d[0]=e.withModifiers(y=>u("change"),["stop","prevent"]))},[e.createElementVNode("input",{type:"checkbox",checked:a.checked},null,8,Z),v]))}}),[["__scopeId","data-v-39f156fd"]]),Ye="";const te=a=>(e.pushScopeId("data-v-490fbe16"),a=a(),e.popScopeId(),a),oe={class:"easy-data-table__rows-selector"},ne={class:"rows-input"},re=te(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),ae=["onClick"];var se=p(e.defineComponent({props:{modelValue:{type:Number,required:!0},rowsItems:{type:Array,required:!0}},emits:["update:modelValue"],setup(a,{emit:u}){const t=a;e.useCssVars(f=>({"10352173":e.unref(B)}));const c=e.ref(!1),d=e.computed({get:()=>t.modelValue,set:f=>{u("update:modelValue",f)}}),y=f=>{d.value=f,c.value=!1},x=(f,l)=>{let n=f.parentNode;for(;n!=null;){if(n.classList&&n.classList.contains(l))return!0;n=n.parentNode}return!1},b=f=>{x(f.target,"easy-data-table__rows-selector")||(c.value=!1)};e.onMounted(()=>{document.addEventListener("click",b)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",b)});const B=e.inject("themeColor");return(f,l)=>(e.openBlock(),e.createElementBlock("div",oe,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:l[0]||(l[0]=n=>c.value=!c.value)},[e.createElementVNode("div",ne,e.toDisplayString(e.unref(d)),1),re]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:c.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.rowsItems,n=>(e.openBlock(),e.createElementBlock("li",{key:n,class:e.normalizeClass({selected:n===e.unref(d)}),onClick:i=>y(n)},e.toDisplayString(n),11,ae))),128))],2)]))}}),[["__scopeId","data-v-490fbe16"]]),ve="";const le={class:"loader-line"};var ce=p(e.defineComponent({setup(a){e.useCssVars(t=>({"38295e65":e.unref(u)}));const u=e.inject("themeColor");return(t,c)=>(e.openBlock(),e.createElementBlock("div",le))}}),[["__scopeId","data-v-1ec0ad4e"]]),tt="";const ie={class:"buttons-pagination"},de=["onClick"];var pe=p(e.defineComponent({props:{maxPaginationNumber:{type:Number,required:!0},currentPaginationNumber:{type:Number,required:!0}},emits:["updatePage"],setup(a,{emit:u}){const t=a;e.useCssVars(l=>({ea020c26:e.unref(B),"556f69b6":e.unref(b),"013fc904":e.unref(f)}));const c=7,d=l=>{l.type==="button"&&!l.active&&u("updatePage",l.page)},y=e.computed(()=>{const l=[];if(t.maxPaginationNumber<=c)for(let n=1;n<=t.maxPaginationNumber;n+=1)l.push({type:"button",page:n,active:n===t.currentPaginationNumber});else if([1,2,t.maxPaginationNumber,t.maxPaginationNumber-1].includes(t.currentPaginationNumber))for(let n=1;n<=c;n+=1)if(n<=3)l.push({type:"button",page:n,active:n===t.currentPaginationNumber});else if(n===4)l.push({type:"omission"});else{const i=t.maxPaginationNumber-(c-n);l.push({type:"button",page:i,active:i===t.currentPaginationNumber})}else if([3,4].includes(t.currentPaginationNumber))for(let n=1;n<=c;n+=1)n<=5?l.push({type:"button",page:n,active:n===t.currentPaginationNumber}):n===6?l.push({type:"omission"}):l.push({type:"button",page:t.maxPaginationNumber,active:t.maxPaginationNumber===t.currentPaginationNumber});else if([t.maxPaginationNumber-2,t.maxPaginationNumber-3].includes(t.currentPaginationNumber))for(let n=1;n<=c;n+=1)if(n===1)l.push({type:"button",page:1,active:t.currentPaginationNumber===1});else if(n===2)l.push({type:"omission"});else{const i=t.maxPaginationNumber-(c-n);l.push({type:"button",page:i,active:i===t.currentPaginationNumber})}else for(let n=1;n<=c;n+=1)if(n===1)l.push({type:"button",page:1,active:t.currentPaginationNumber===1});else if(n===2||n===6)l.push({type:"omission"});else if(n===7)l.push({type:"button",page:t.maxPaginationNumber,active:t.maxPaginationNumber===t.currentPaginationNumber});else{const i=4-n,C=t.currentPaginationNumber-i;l.push({type:"button",page:C,active:C===t.currentPaginationNumber})}return l}),x=e.inject("rowHeight"),b=e.computed(()=>`${x*.6}px`),B=e.inject("borderColor"),f=e.inject("themeColor");return(l,n)=>(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(i,C)=>(e.openBlock(),e.createElementBlock("div",{key:C,class:e.normalizeClass(["item",{button:i.type==="button",active:i.type==="button"&&i.active,omission:i.type==="omission"}]),onClick:h=>d(i)},e.toDisplayString(i.type==="button"?i.page:"..."),11,de))),128))]))}}),[["__scopeId","data-v-f1674b60"]]),nt="";const z=a=>(e.pushScopeId("data-v-c9da5286"),a=a(),e.popScopeId(),a),ue=[z(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],me=[z(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var ge=p(e.defineComponent({props:{isFirstPage:{type:Boolean,required:!1},isLastPage:{type:Boolean,required:!1}},emits:["clickPrevPage","clickNextPage"],setup(a,{emit:u}){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":a.isFirstPage}]),onClick:d[0]||(d[0]=y=>u("clickPrevPage"))},ue,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":a.isLastPage}]),onClick:d[1]||(d[1]=y=>u("clickNextPage"))},me,2)],64))}}),[["__scopeId","data-v-c9da5286"]]);const fe={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48"},_e=[e.createElementVNode("path",{d:"M576 234.688V1024H448V234.688L213.312 469.312 128 384 512 0l384 384-85.312 85.312L576 234.688z",fill:"#373D41"},null,-1)];function he(a,u){return e.openBlock(),e.createElementBlock("svg",fe,_e)}var ye={render:he},ct="";const be={class:"data-table"},ke={key:0},Se=["onClick"],xe={key:1,class:"header-text__wrapper"},Ce={class:"header-text"},Pe=["colspan"],Be={key:0},Ne={key:0,class:"data-table__message"},we={key:1,class:"data-table__message"},$e={class:"data-table__footer"},Ve={class:"footer__rows-per-page"},Ee=e.createTextVNode(" rows per page: "),Ie={class:"footer__items-index"};var Te=p(e.defineComponent({props:{buttonsPagination:{type:Boolean,default:!1},borderColor:{type:String,default:"#e0e0e0"},bodyFontColor:{type:String,default:"#212121"},emptyMessage:{type:String,default:"No Available Data"},fixedHeader:{type:Boolean,default:!0},headerFontColor:{type:String,default:"#373737"},headerBackgroundColor:{type:String,default:"#fff"},bodyFontSize:{type:Number,default:12},headers:{type:Array,required:!0},items:{type:Array,required:!0},maxHeight:{type:Number,default:()=>400},wrapLines:{type:Boolean,default:!1},itemsSelected:{type:Array,default:null},searchField:{type:String,default:""},searchValue:{type:String,default:""},rowsPerPage:{type:Number,default:25},rowsItems:{type:Array,default:()=>[25,50,100]},loading:{type:Boolean,deault:!1},loadingMessage:{type:String,default:"Loading, please wait."},serverOptions:{type:Object,default:()=>{}},serverItemsLength:{type:Number,default:0},sortBy:{type:String,default:""},sortType:{type:String,default:"asc"},themeColor:{type:String,default:"#42b883"},dense:{type:Boolean,default:!1}},emits:["update:itemsSelected","update:isAllSelected","update:serverOptions"],setup(a,{emit:u}){const t=a;e.useCssVars(o=>({"0bc07f05":e.unref(c),"25264b81":e.unref(f),"66b91e2c":e.unref(x),"5544ec12":e.unref(B),"6f932c96":e.unref(d),ab32f114:a.headerBackgroundColor,"7fb28480":e.unref(y)}));const{borderColor:c,headerFontColor:d,bodyFontColor:y}=e.toRefs(t),x=e.computed(()=>`${t.bodyFontSize}px`),b=e.computed(()=>t.bodyFontSize*(t.dense?2:3)),B=e.computed(()=>`${b.value}px`),f=e.computed(()=>`${t.maxHeight}px`);e.provide("themeColor",t.themeColor),e.provide("rowHeight",b.value),e.provide("borderColor",c.value);const l=e.useSlots(),n=e.computed(()=>l.body),i=e.computed({get:()=>{var o,s,r;return{page:1,rowsPerPage:(o=t.serverOptions.rowsPerPage)!=null?o:t.rowsPerPage,sortBy:(s=t.serverOptions.sortBy)!=null?s:null,sortType:(r=t.serverOptions.sortType)!=null?r:null}},set:o=>{u("update:serverOptions",o)}}),C=e.computed(()=>t.itemsSelected!==null),h=e.computed(()=>t.serverItemsLength>0),Fe=()=>{const o=structuredClone(t.headers);return o.map(s=>{const r=s;return s.sortable&&(r.sortType=null),h.value&&s.value===t.serverOptions.sortBy&&(r.sortType=t.serverOptions.sortType),!h.value&&s.value===t.sortBy&&(r.sortType=t.sortType),r}),C.value?[{text:"checkbox",value:"checkbox"},...o]:o},V=e.ref(Fe()),O=e.computed(()=>V.value.map(o=>o.value)),k=e.computed({get:()=>t.itemsSelected,set:o=>{u("update:itemsSelected",o)}}),E=e.computed(()=>k.value.length===t.items.length?"allSelected":k.value.length===0?"noneSelected":"partSelected"),N=e.computed(()=>{if(!h.value&&t.searchValue!==""){const o=new RegExp(t.searchValue,"i");return t.items.filter(s=>o.test(t.searchField!==""?s[t.searchField]:Object.values(s).join("")))}return t.items}),_=e.ref(1),S=e.ref(t.rowsPerPage);e.watch(S,o=>{h.value&&(i.value=L(P({},i.value),{page:1,rowsPerPage:o})),_.value=1});const Le=()=>t.sortBy!==""?{sortBy:t.sortBy,sortDesc:t.sortType==="desc"}:null,I=e.ref(Le()),Oe=o=>{let s=null;V.value.map(r=>{const g=r;return r.sortable&&(r.value===o?(r.sortType===null?s="asc":r.sortType==="asc"?s="desc":s=null,g.sortType=s):g.sortType=null),g}),h.value?i.value={page:1,rowsPerPage:S.value,sortBy:s!==null?o:null,sortType:s}:s===null?I.value=null:I.value={sortBy:o,sortDesc:s==="desc"}},De=e.computed(()=>{if(h.value)return t.items;if(I.value===null)return N.value;const{sortBy:o,sortDesc:s}=I.value;return structuredClone(N.value).sort((g,$)=>g[o]<$[o]?s?1:-1:g[o]>$[o]?s?-1:1:0)}),A=e.computed(()=>h.value?t.serverItemsLength:N.value.length),M=e.computed(()=>Math.min(N.value.length,_.value*S.value)),H=e.computed(()=>(_.value-1)*S.value+1),j=e.computed(()=>Math.ceil(A.value/S.value)),R=e.computed(()=>_.value===j.value),q=e.computed(()=>_.value===1),T=e.ref(!1),D=e.ref(1),{loading:w}=e.toRefs(t),ze=()=>{if(!R.value&&!w.value)if(h.value&&t.items.length<_.value*S.value+1){const o=_.value+1;i.value=L(P({},i.value),{page:o}),T.value=!0,D.value=o}else _.value+=1},Ae=o=>{h.value?(i.value=L(P({},i.value),{page:o}),T.value=!0,D.value=o):_.value=o};e.watch(w,(o,s)=>{T.value&&o===!1&&s===!0&&(_.value=D.value,T.value=!1)});const Me=()=>{q.value||(_.value-=1)},F=e.computed(()=>{if(h.value)return t.items;const o=[];for(let s=H.value-1;s<M.value;s+=1)o.push(De.value[s]);return o}),He=e.computed(()=>C.value?E.value==="allSelected"?F.value.map(o=>P({checkbox:!0},o)):E.value==="noneSelected"?F.value.map(o=>P({checkbox:!1},o)):F.value.map(o=>{const s=k.value.findIndex(r=>JSON.stringify(r)===JSON.stringify(o))!==-1;return P({checkbox:s},o)}):F.value),je=o=>{k.value=o?N.value:[]},Re=o=>{const s=o.checkbox;if(delete o.checkbox,s)k.value=k.value.filter(r=>JSON.stringify(r)!==JSON.stringify(o));else{const r=k.value;r.unshift(o),k.value=r}};return(o,s)=>(e.openBlock(),e.createElementBlock("div",be,[e.createElementVNode("div",{class:e.normalizeClass(["data-table__body",{"fixed-header":a.fixedHeader,"wrap-lines":a.wrapLines}])},[e.createElementVNode("table",null,[V.value.length?(e.openBlock(),e.createElementBlock("thead",ke,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(r,g)=>(e.openBlock(),e.createElementBlock("th",{key:g,class:e.normalizeClass({sortable:r.sortable,none:r.sortable&&r.sortType===null,desc:r.sortable&&r.sortType==="desc",asc:r.sortable&&r.sortType==="asc"}),onClick:$=>r.sortable?Oe(r.value):null},[r.text==="checkbox"?(e.openBlock(),e.createBlock(X,{key:e.unref(E),status:e.unref(E),onChange:je},null,8,["status"])):(e.openBlock(),e.createElementBlock("span",xe,[e.createElementVNode("span",Ce,e.toDisplayString(r.text),1),r.sortable?(e.openBlock(),e.createBlock(e.unref(ye),{key:r.sortType?r.sortType:"none",class:e.normalizeClass(["sortType-icon",{desc:r.sortType==="desc"}])},null,8,["class"])):e.createCommentVNode("",!0)]))],10,Se))),128))]),e.unref(w)?(e.openBlock(),e.createElementBlock("th",{key:0,class:"loading-th",colspan:e.unref(O).length},[e.createVNode(ce)],8,Pe)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(n)?e.renderSlot(o.$slots,"body",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[a.items.length&&e.unref(O).length?(e.openBlock(),e.createElementBlock("tbody",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(He),r=>(e.openBlock(),e.createElementBlock("tr",{key:JSON.stringify(r)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(O),(g,$)=>(e.openBlock(),e.createElementBlock("td",{key:$},[e.unref(l)[g]?e.renderSlot(o.$slots,g,e.normalizeProps(e.mergeProps({key:0},r)),void 0,!0):g==="checkbox"?(e.openBlock(),e.createBlock(ee,{key:1,checked:r[g],onChange:dt=>Re(r)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(Array.isArray(r[g])?r[g].join(","):r[g]),1)],64))]))),128))]))),128))])):e.createCommentVNode("",!0)],64))]),!a.items.length&&!e.unref(w)?(e.openBlock(),e.createElementBlock("div",Ne,e.toDisplayString(a.emptyMessage),1)):e.createCommentVNode("",!0),!a.items.length&&e.unref(w)?(e.openBlock(),e.createElementBlock("div",we,e.toDisplayString(a.loadingMessage),1)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",$e,[e.createElementVNode("div",Ve,[Ee,e.createVNode(se,{modelValue:S.value,"onUpdate:modelValue":s[0]||(s[0]=r=>S.value=r),"rows-items":a.rowsItems},null,8,["modelValue","rows-items"])]),e.createElementVNode("div",Ie,e.toDisplayString(`${e.unref(H)}-${e.unref(M)}`)+" of "+e.toDisplayString(e.unref(A)),1),e.createVNode(ge,{"is-first-page":e.unref(q),"is-last-page":e.unref(R),onClickNextPage:ze,onClickPrevPage:Me},e.createSlots({_:2},[a.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(pe,{"current-pagination-number":_.value,"max-pagination-number":e.unref(j),onUpdatePage:Ae},null,8,["current-pagination-number","max-pagination-number"])])}:void 0]),1032,["is-first-page","is-last-page"])])]))}}),[["__scopeId","data-v-40c7e760"]]);return Te});
(function(e,m){typeof exports=="object"&&typeof module!="undefined"?module.exports=m(require("vue")):typeof define=="function"&&define.amd?define(["vue"],m):(e=typeof globalThis!="undefined"?globalThis:e||self,e["vue3-easy-data-table"]=m(e.Vue))})(this,function(e){"use strict";var je=Object.defineProperty,He=Object.defineProperties;var qe=Object.getOwnPropertyDescriptors;var q=Object.getOwnPropertySymbols;var Re=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable;var R=(e,m,p)=>m in e?je(e,m,{enumerable:!0,configurable:!0,writable:!0,value:p}):e[m]=p,b=(e,m)=>{for(var p in m||(m={}))Re.call(m,p)&&R(e,p,m[p]);if(q)for(var p of q(m))Je.call(m,p)&&R(e,p,m[p]);return e},w=(e,m)=>He(e,qe(m));var m="",p=(r,u)=>{const t=r.__vccOpts||r;for(const[c,d]of u)t[c]=d;return t};const J=r=>(e.pushScopeId("data-v-566775ba"),r=r(),e.popScopeId(),r),U=["onClick"],G=["checked"],K=J(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var Q=p(e.defineComponent({props:{status:{type:String,required:!0}},emits:["change"],setup(r,{emit:u}){const t=r;e.useCssVars(S=>({"7f84b28f":e.unref(y)}));const c=e.computed(()=>t.status==="allSelected"),d=()=>{u("change",!c.value)},y=e.inject("themeColor");return(S,k)=>(e.openBlock(),e.createElementBlock("div",{class:"multi-select__checkbox",onClick:e.withModifiers(d,["stop","prevent"])},[e.createElementVNode("input",{type:"checkbox",checked:e.unref(c),class:e.normalizeClass(r.status)},null,10,G),K],8,U))}}),[["__scopeId","data-v-566775ba"]]),Ge="";const W=r=>(e.pushScopeId("data-v-39f156fd"),r=r(),e.popScopeId(),r),X=["checked"],Y=W(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var Z=p(e.defineComponent({props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(r,{emit:u}){e.useCssVars(c=>({"20cfc5a0":e.unref(t)}));const t=e.inject("themeColor");return(c,d)=>(e.openBlock(),e.createElementBlock("div",{class:"single-select__checkbox",onClick:d[0]||(d[0]=e.withModifiers(y=>u("change"),["stop","prevent"]))},[e.createElementVNode("input",{type:"checkbox",checked:r.checked},null,8,X),Y]))}}),[["__scopeId","data-v-39f156fd"]]),Qe="";const v=r=>(e.pushScopeId("data-v-490fbe16"),r=r(),e.popScopeId(),r),ee={class:"easy-data-table__rows-selector"},te={class:"rows-input"},oe=v(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),ne=["onClick"];var ae=p(e.defineComponent({props:{modelValue:{type:Number,required:!0},rowsItems:{type:Array,required:!0}},emits:["update:modelValue"],setup(r,{emit:u}){const t=r;e.useCssVars(_=>({"10352173":e.unref($)}));const c=e.ref(!1),d=e.computed({get:()=>t.modelValue,set:_=>{u("update:modelValue",_)}}),y=_=>{d.value=_,c.value=!1},S=(_,l)=>{let a=_.parentNode;for(;a!=null;){if(a.classList&&a.classList.contains(l))return!0;a=a.parentNode}return!1},k=_=>{S(_.target,"easy-data-table__rows-selector")||(c.value=!1)};e.onMounted(()=>{document.addEventListener("click",k)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",k)});const $=e.inject("themeColor");return(_,l)=>(e.openBlock(),e.createElementBlock("div",ee,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:l[0]||(l[0]=a=>c.value=!c.value)},[e.createElementVNode("div",te,e.toDisplayString(e.unref(d)),1),oe]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:c.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.rowsItems,a=>(e.openBlock(),e.createElementBlock("li",{key:a,class:e.normalizeClass({selected:a===e.unref(d)}),onClick:s=>y(a)},e.toDisplayString(a),11,ne))),128))],2)]))}}),[["__scopeId","data-v-490fbe16"]]),Xe="";const re={class:"loader-line"};var se=p(e.defineComponent({setup(r){e.useCssVars(t=>({"38295e65":e.unref(u)}));const u=e.inject("themeColor");return(t,c)=>(e.openBlock(),e.createElementBlock("div",re))}}),[["__scopeId","data-v-1ec0ad4e"]]),Ze="";const le={class:"buttons-pagination"},ce=["onClick"];var ie=p(e.defineComponent({props:{maxPaginationNumber:{type:Number,required:!0},currentPaginationNumber:{type:Number,required:!0}},emits:["updatePage"],setup(r,{emit:u}){const t=r;e.useCssVars(l=>({ea020c26:e.unref($),"556f69b6":e.unref(k),"013fc904":e.unref(_)}));const c=7,d=l=>{l.type==="button"&&!l.active&&u("updatePage",l.page)},y=e.computed(()=>{const l=[];if(t.maxPaginationNumber<=c)for(let a=1;a<=t.maxPaginationNumber;a+=1)l.push({type:"button",page:a,active:a===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)l.push({type:"button",page:a,active:a===t.currentPaginationNumber});else if(a===4)l.push({type:"omission"});else{const s=t.maxPaginationNumber-(c-a);l.push({type:"button",page:s,active:s===t.currentPaginationNumber})}else if([3,4].includes(t.currentPaginationNumber))for(let a=1;a<=c;a+=1)a<=5?l.push({type:"button",page:a,active:a===t.currentPaginationNumber}):a===6?l.push({type:"omission"}):l.push({type:"button",page:t.maxPaginationNumber,active:t.maxPaginationNumber===t.currentPaginationNumber});else if([t.maxPaginationNumber-2,t.maxPaginationNumber-3].includes(t.currentPaginationNumber))for(let a=1;a<=c;a+=1)if(a===1)l.push({type:"button",page:1,active:t.currentPaginationNumber===1});else if(a===2)l.push({type:"omission"});else{const s=t.maxPaginationNumber-(c-a);l.push({type:"button",page:s,active:s===t.currentPaginationNumber})}else for(let a=1;a<=c;a+=1)if(a===1)l.push({type:"button",page:1,active:t.currentPaginationNumber===1});else if(a===2||a===6)l.push({type:"omission"});else if(a===7)l.push({type:"button",page:t.maxPaginationNumber,active:t.maxPaginationNumber===t.currentPaginationNumber});else{const s=4-a,C=t.currentPaginationNumber-s;l.push({type:"button",page:C,active:C===t.currentPaginationNumber})}return l}),S=e.inject("rowHeight"),k=e.computed(()=>`${S*.6}px`),$=e.inject("borderColor"),_=e.inject("themeColor");return(l,a)=>(e.openBlock(),e.createElementBlock("div",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(s,C)=>(e.openBlock(),e.createElementBlock("div",{key:C,class:e.normalizeClass(["item",{button:s.type==="button",active:s.type==="button"&&s.active,omission:s.type==="omission"}]),onClick:g=>d(s)},e.toDisplayString(s.type==="button"?s.page:"..."),11,ce))),128))]))}}),[["__scopeId","data-v-f1674b60"]]),et="";const O=r=>(e.pushScopeId("data-v-c9da5286"),r=r(),e.popScopeId(),r),de=[O(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],pe=[O(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var ue=p(e.defineComponent({props:{isFirstPage:{type:Boolean,required:!1},isLastPage:{type:Boolean,required:!1}},emits:["clickPrevPage","clickNextPage"],setup(r,{emit:u}){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":r.isFirstPage}]),onClick:d[0]||(d[0]=y=>u("clickPrevPage"))},de,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":r.isLastPage}]),onClick:d[1]||(d[1]=y=>u("clickNextPage"))},pe,2)],64))}}),[["__scopeId","data-v-c9da5286"]]);const me={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48"},ge=[e.createElementVNode("path",{d:"M576 234.688V1024H448V234.688L213.312 469.312 128 384 512 0l384 384-85.312 85.312L576 234.688z",fill:"#373D41"},null,-1)];function fe(r,u){return e.openBlock(),e.createElementBlock("svg",me,ge)}var _e={render:fe},rt="";const he={class:"data-table"},ye={key:0},be=["onClick"],ke={key:1,class:"header-text__wrapper"},xe={class:"header-text"},Se=["colspan"],Ce={key:0},Be={key:0,class:"data-table__message"},Pe={key:1,class:"data-table__message"},Ne={class:"data-table__footer"},we={class:"footer__rows-per-page"},$e=e.createTextVNode(" rows per page: "),Ve={class:"footer__items-index"};var Ee=p(e.defineComponent({props:{buttonsPagination:{type:Boolean,default:!1},borderColor:{type:String,default:"#e0e0e0"},bodyFontColor:{type:String,default:"#212121"},emptyMessage:{type:String,default:"No Available Data"},fixedHeader:{type:Boolean,default:!0},headerFontColor:{type:String,default:"#373737"},headerBackgroundColor:{type:String,default:"#fff"},bodyFontSize:{type:Number,default:12},headers:{type:Array,required:!0},items:{type:Array,required:!0},maxHeight:{type:Number,default:()=>400},wrapLines:{type:Boolean,default:!1},itemsSelected:{type:Array,default:null},searchField:{type:String,default:""},searchValue:{type:String,default:""},rowsPerPage:{type:Number,default:25},rowsItems:{type:Array,default:()=>[25,50,100]},loading:{type:Boolean,deault:!1},loadingMessage:{type:String,default:"Loading, please wait."},serverOptions:{type:Object,default:()=>null},serverItemsLength:{type:Number,default:0},sortBy:{type:String,default:""},sortType:{type:String,default:"asc"},themeColor:{type:String,default:"#42b883"},dense:{type:Boolean,default:!1}},emits:["update:itemsSelected","update:serverOptions"],setup(r,{emit:u}){const t=r;e.useCssVars(n=>({"394096bd":e.unref(c),"52a66339":e.unref(_),"1134fb9c":e.unref(S),"02dda1af":e.unref($),f8183526:e.unref(d),ef534da4:r.headerBackgroundColor,e4007110:e.unref(y)}));const{borderColor:c,headerFontColor:d,bodyFontColor:y}=e.toRefs(t),S=e.computed(()=>`${t.bodyFontSize}px`),k=e.computed(()=>t.bodyFontSize*(t.dense?2:3)),$=e.computed(()=>`${k.value}px`),_=e.computed(()=>`${t.maxHeight}px`);e.provide("themeColor",t.themeColor),e.provide("rowHeight",k.value),e.provide("borderColor",c.value);const l=e.useSlots(),a=e.computed(()=>l.body),s=e.computed({get:()=>{const{page:n,rowsPerPage:i,sortBy:o,sortType:f}=t.serverOptions;return{page:n,rowsPerPage:i,sortBy:o!=null?o:null,sortType:f!=null?f:null}},set:n=>{u("update:serverOptions",n)}}),C=e.computed(()=>t.itemsSelected!==null),g=e.computed(()=>t.serverOptions!==null),Ie=()=>t.sortBy!==""?{sortBy:t.sortBy,sortDesc:t.sortType==="desc"}:null,B=e.ref(Ie()),L=e.computed(()=>{const n=t.headers.map(i=>{const o=i;return i.sortable&&(o.sortType="none"),g.value&&i.value===s.value.sortBy&&s.value.sortType&&(o.sortType=s.value.sortType),!g.value&&B.value&&i.value===B.value.sortBy&&(o.sortType=B.value.sortDesc?"desc":"asc"),o});return C.value?[{text:"checkbox",value:"checkbox"},...n]:n}),T=e.computed(()=>L.value.map(n=>n.value)),x=e.computed({get:()=>t.itemsSelected,set:n=>{u("update:itemsSelected",n)}}),I=e.computed(()=>x.value.length===t.items.length?"allSelected":x.value.length===0?"noneSelected":"partSelected"),V=e.computed(()=>{if(!g.value&&t.searchValue!==""){const n=new RegExp(t.searchValue,"i");return t.items.filter(i=>n.test(t.searchField!==""?i[t.searchField]:Object.values(i).join("")))}return t.items}),h=e.ref(g.value?t.serverOptions.page:1),P=e.ref(g.value?t.serverOptions.rowsPerPage:t.rowsPerPage);e.watch(P,n=>{g.value&&(s.value=w(b({},s.value),{page:1,rowsPerPage:n})),h.value=1});const Fe=(n,i)=>{let o=null;i==="none"?o="asc":i==="asc"?o="desc":o=null,g.value?s.value=w(b({},s.value),{sortBy:o!==null?n:null,sortType:o}):o===null?B.value=null:B.value={sortBy:n,sortDesc:o==="desc"}},Le=e.computed(()=>{if(g.value)return t.items;if(B.value===null)return V.value;const{sortBy:n,sortDesc:i}=B.value;return structuredClone(V.value).sort((f,E)=>f[n]<E[n]?i?1:-1:f[n]>E[n]?i?-1:1:0)}),D=e.computed(()=>g.value?t.serverItemsLength:V.value.length),z=e.computed(()=>g.value?h.value*P.value:Math.min(V.value.length,h.value*P.value)),A=e.computed(()=>(h.value-1)*P.value+1),M=e.computed(()=>Math.ceil(D.value/P.value)),j=e.computed(()=>h.value===M.value),H=e.computed(()=>h.value===1),{loading:N}=e.toRefs(t),Te=()=>{if(!j.value&&!N.value)if(g.value){const n=h.value+1;s.value=w(b({},s.value),{page:n})}else h.value+=1},Oe=()=>{if(!H.value&&!N.value)if(g.value){const n=h.value-1;s.value=w(b({},s.value),{page:n})}else h.value-=1},De=n=>{N.value||(g.value?s.value=w(b({},s.value),{page:n}):h.value=n)};e.watch(N,(n,i)=>{g.value&&n===!1&&i===!0&&(h.value=s.value.page)});const F=e.computed(()=>g.value?t.items:Le.value.slice(A.value-1,z.value)),ze=e.computed(()=>C.value?I.value==="allSelected"?F.value.map(n=>b({checkbox:!0},n)):I.value==="noneSelected"?F.value.map(n=>b({checkbox:!1},n)):F.value.map(n=>{const i=x.value.findIndex(o=>JSON.stringify(o)===JSON.stringify(n))!==-1;return b({checkbox:i},n)}):F.value),Ae=n=>{x.value=n?V.value:[]},Me=n=>{const i=n.checkbox;if(delete n.checkbox,i)x.value=x.value.filter(o=>JSON.stringify(o)!==JSON.stringify(n));else{const o=x.value;o.unshift(n),x.value=o}};return(n,i)=>(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",{class:e.normalizeClass(["data-table__body",{"fixed-header":r.fixedHeader,"wrap-lines":r.wrapLines}])},[e.createElementVNode("table",null,[e.unref(L).length?(e.openBlock(),e.createElementBlock("thead",ye,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L),(o,f)=>(e.openBlock(),e.createElementBlock("th",{key:f,class:e.normalizeClass({sortable:o.sortable,none:o.sortable&&o.sortType==="none",desc:o.sortable&&o.sortType==="desc",asc:o.sortable&&o.sortType==="asc"}),onClick:E=>o.sortable&&o.sortType?Fe(o.value,o.sortType):null},[o.text==="checkbox"?(e.openBlock(),e.createBlock(Q,{key:e.unref(I),status:e.unref(I),onChange:Ae},null,8,["status"])):(e.openBlock(),e.createElementBlock("span",ke,[e.createElementVNode("span",xe,e.toDisplayString(o.text),1),o.sortable?(e.openBlock(),e.createBlock(e.unref(_e),{key:o.sortType?o.sortType:"none",class:e.normalizeClass(["sortType-icon",{desc:o.sortType==="desc"}])},null,8,["class"])):e.createCommentVNode("",!0)]))],10,be))),128))]),e.unref(N)?(e.openBlock(),e.createElementBlock("th",{key:0,class:"loading-th",colspan:e.unref(T).length},[e.createVNode(se)],8,Se)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(a)?e.renderSlot(n.$slots,"body",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[r.items.length&&e.unref(T).length?(e.openBlock(),e.createElementBlock("tbody",Ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ze),o=>(e.openBlock(),e.createElementBlock("tr",{key:JSON.stringify(o)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(T),(f,E)=>(e.openBlock(),e.createElementBlock("td",{key:E},[e.unref(l)[f]?e.renderSlot(n.$slots,f,e.normalizeProps(e.mergeProps({key:0},o)),void 0,!0):f==="checkbox"?(e.openBlock(),e.createBlock(Z,{key:1,checked:o[f],onChange:lt=>Me(o)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(Array.isArray(o[f])?o[f].join(","):o[f]),1)],64))]))),128))]))),128))])):e.createCommentVNode("",!0)],64))]),!r.items.length&&!e.unref(N)?(e.openBlock(),e.createElementBlock("div",Be,e.toDisplayString(r.emptyMessage),1)):e.createCommentVNode("",!0),!r.items.length&&e.unref(N)?(e.openBlock(),e.createElementBlock("div",Pe,e.toDisplayString(r.loadingMessage),1)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",Ne,[e.createElementVNode("div",we,[$e,e.createVNode(ae,{modelValue:P.value,"onUpdate:modelValue":i[0]||(i[0]=o=>P.value=o),"rows-items":r.rowsItems},null,8,["modelValue","rows-items"])]),e.createElementVNode("div",Ve,e.toDisplayString(`${e.unref(A)}-${e.unref(z)}`)+" of "+e.toDisplayString(e.unref(D)),1),e.createVNode(ue,{"is-first-page":e.unref(H),"is-last-page":e.unref(j),onClickNextPage:Te,onClickPrevPage:Oe},e.createSlots({_:2},[r.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(ie,{"current-pagination-number":h.value,"max-pagination-number":e.unref(M),onUpdatePage:De},null,8,["current-pagination-number","max-pagination-number"])])}:void 0]),1032,["is-first-page","is-last-page"])])]))}}),[["__scopeId","data-v-20cd48de"]]);return Ee});

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

"private": false,
"version": "1.0.7",
"version": "1.0.8",
"types": "./types/main.d.ts",

@@ -9,0 +9,0 @@ "files": [

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