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.2.7 to 1.2.8

63

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

@@ -568,22 +568,22 @@ var __defProp = Object.defineProperty;

useCssVars((_ctx) => ({
"6c9f4295": unref(tableBorderColor),
"7e6e2dd5": unref(minHeightPx),
"7672e251": unref(tableHeightPx),
"67267b2c": unref(loadingWrapperSizePx),
"5706395d": unref(rowHeightPx),
"4dd78678": unref(fontSizePx),
"e6b28b74": unref(rowFontColor),
"43c26747": unref(rowBackgroundColor),
"f283ffee": unref(rowBorderColor),
"44e613ca": unref(headerFontColor),
"3940a148": __props.headerBackgroundColor,
"d8430cf4": unref(sortTypeIconSizePx),
"fcabdbee": unref(sortTypeAscIconMarginTopPx),
"5c98c6e1": unref(sortTypeDescIconMarginTopPx),
"0cb46672": unref(rowHoverBackgroundColor),
"97378074": unref(rowHoverFontColor),
"2d6db280": unref(evenRowFontColor),
"84ce67fe": unref(evenRowBackgroundColor),
"5eef9e8e": unref(footerBackgroundColor),
"fa769a66": unref(footerFontColor)
"3b7cb738": unref(tableBorderColor),
"70e5c15c": unref(minHeightPx),
"18c92ee4": unref(tableHeightPx),
"29ba3362": unref(loadingWrapperSizePx),
"bfb5aa4c": unref(rowHeightPx),
"25c2a7a7": unref(fontSizePx),
"6765f869": unref(rowFontColor),
"5dd581ac": unref(rowBackgroundColor),
"a2b37d28": unref(rowBorderColor),
"9aa63dd0": unref(headerFontColor),
"421eaece": __props.headerBackgroundColor,
"21315169": unref(sortTypeIconSizePx),
"e2375228": unref(sortTypeAscIconMarginTopPx),
"12b1c344": unref(sortTypeDescIconMarginTopPx),
"54dd6ac4": unref(rowHoverBackgroundColor),
"7d9540fa": unref(rowHoverFontColor),
"0769b1ba": unref(evenRowFontColor),
"3426fa64": unref(evenRowBackgroundColor),
"5a8097cb": unref(footerBackgroundColor),
"57e49dca": unref(footerFontColor)
}));

@@ -679,12 +679,15 @@ const {

const headerColumns = computed(() => headersForRender.value.map((header) => header.value));
const generateColumnContent = (column, item) => {
let content = "";
const getItemValue = (column, item) => {
if (column.includes(".")) {
const propertyArr = column.split(".");
propertyArr.forEach((property, index) => {
content = index === 0 ? item[property] : content[property];
let content = "";
const keysArr = column.split(".");
keysArr.forEach((key, index) => {
content = index === 0 ? item[key] : content[key];
});
} else {
content = item[column];
return content;
}
return item[column];
};
const generateColumnContent = (column, item) => {
const content = getItemValue(column, item);
return Array.isArray(content) ? content.join(",") : content;

@@ -807,5 +810,5 @@ };

return itemsFilteringSorted.sort((a, b) => {
if (a[sortBy] < b[sortBy])
if (getItemValue(sortBy, a) < getItemValue(sortBy, b))
return sortDesc ? 1 : -1;
if (a[sortBy] > b[sortBy])
if (getItemValue(sortBy, a) > getItemValue(sortBy, b))
return sortDesc ? -1 : 1;

@@ -1065,3 +1068,3 @@ return 0;

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

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

(function(e,_){typeof exports=="object"&&typeof module!="undefined"?module.exports=_(require("vue")):typeof define=="function"&&define.amd?define(["vue"],_):(e=typeof globalThis!="undefined"?globalThis:e||self,e["vue3-easy-data-table"]=_(e.Vue))})(this,function(e){"use strict";var dt=Object.defineProperty,pt=Object.defineProperties;var ut=Object.getOwnPropertyDescriptors;var ce=Object.getOwnPropertySymbols;var ft=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable;var ie=(e,_,f)=>_ in e?dt(e,_,{enumerable:!0,configurable:!0,writable:!0,value:f}):e[_]=f,C=(e,_)=>{for(var f in _||(_={}))ft.call(_,f)&&ie(e,f,_[f]);if(ce)for(var f of ce(_))gt.call(_,f)&&ie(e,f,_[f]);return e},z=(e,_)=>pt(e,ut(_));var _="",f=(r,h)=>{const a=r.__vccOpts||r;for(const[n,p]of h)a[n]=p;return a};const de=r=>(e.pushScopeId("data-v-566775ba"),r=r(),e.popScopeId(),r),pe=["onClick"],ue=["checked"],fe=de(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var ge=f(e.defineComponent({props:{status:{type:String,required:!0}},emits:["change"],setup(r,{emit:h}){const a=r;e.useCssVars(P=>({"7f84b28f":e.unref(b)}));const n=e.computed(()=>a.status==="allSelected"),p=()=>{h("change",!n.value)},b=e.inject("themeColor");return(P,F)=>(e.openBlock(),e.createElementBlock("div",{class:"multi-select__checkbox",onClick:e.withModifiers(p,["stop","prevent"])},[e.createElementVNode("input",{type:"checkbox",checked:e.unref(n),class:e.normalizeClass(r.status)},null,10,ue),fe],8,pe))}}),[["__scopeId","data-v-566775ba"]]),_t="";const me=r=>(e.pushScopeId("data-v-39f156fd"),r=r(),e.popScopeId(),r),_e=["checked"],he=me(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var ye=f(e.defineComponent({props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(r,{emit:h}){e.useCssVars(n=>({"20cfc5a0":e.unref(a)}));const a=e.inject("themeColor");return(n,p)=>(e.openBlock(),e.createElementBlock("div",{class:"single-select__checkbox",onClick:p[0]||(p[0]=e.withModifiers(b=>h("change"),["stop","prevent"]))},[e.createElementVNode("input",{type:"checkbox",checked:r.checked},null,8,_e),he]))}}),[["__scopeId","data-v-39f156fd"]]),yt="";const ke=r=>(e.pushScopeId("data-v-0ed08e20"),r=r(),e.popScopeId(),r),be={class:"easy-data-table__rows-selector"},xe={class:"rows-input"},Ce=ke(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),Se=["onClick"];var Be=f(e.defineComponent({props:{modelValue:{type:Number,required:!0},rowsItems:{type:Array,required:!0}},emits:["update:modelValue"],setup(r,{emit:h}){const a=r;e.useCssVars(g=>({"83c11052":e.unref(u),"6b60f418":e.unref(l),"346ac97c":e.unref(i)}));const n=e.ref(!1),p=e.ref(!1),b=e.inject("dataTable");e.watch(n,g=>{if(g&&b){const S=window.innerHeight,y=b.value.getBoundingClientRect().height,$=b.value.getBoundingClientRect().top;S-(y+$)<=100?p.value=!0:p.value=!1}});const P=e.computed({get:()=>a.modelValue,set:g=>{h("update:modelValue",g)}}),F=g=>{P.value=g,n.value=!1},O=(g,S)=>{let y=g.parentNode;for(;y!=null;){if(y.classList&&y.classList.contains(S))return!0;y=y.parentNode}return!1},T=g=>{O(g.target,"easy-data-table__rows-selector")||(n.value=!1)};e.onMounted(()=>{document.addEventListener("click",T)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",T)});const i=e.inject("themeColor"),l=e.inject("footerBackgroundColor"),u=e.inject("footerFontColor");return(g,S)=>(e.openBlock(),e.createElementBlock("div",be,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:S[0]||(S[0]=y=>n.value=!n.value)},[e.createElementVNode("div",xe,e.toDisplayString(e.unref(P)),1),Ce]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:n.value,inside:p.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.rowsItems,y=>(e.openBlock(),e.createElementBlock("li",{key:y,class:e.normalizeClass({selected:y===e.unref(P)}),onClick:$=>F(y)},e.toDisplayString(y),11,Se))),128))],2)]))}}),[["__scopeId","data-v-0ed08e20"]]),bt="";const H=r=>(e.pushScopeId("data-v-969989cc"),r=r(),e.popScopeId(),r),Pe={class:"lds-ring"},Ne=[H(()=>e.createElementVNode("div",null,null,-1)),H(()=>e.createElementVNode("div",null,null,-1)),H(()=>e.createElementVNode("div",null,null,-1)),H(()=>e.createElementVNode("div",null,null,-1))];var we=f(e.defineComponent({setup(r){e.useCssVars(n=>({"284c10f4":e.unref(a),"90c4d0a4":e.unref(h)}));const h=e.inject("themeColor"),a=e.inject("loadingEntitySizePx");return(n,p)=>(e.openBlock(),e.createElementBlock("div",Pe,Ne))}}),[["__scopeId","data-v-969989cc"]]),Nt="";const $e={class:"buttons-pagination"},Ie=["onClick"];var Ee=f(e.defineComponent({props:{maxPaginationNumber:{type:Number,required:!0},currentPaginationNumber:{type:Number,required:!0}},emits:["updatePage"],setup(r,{emit:h}){const a=r;e.useCssVars(i=>({aa5730a0:e.unref(F),"24829312":e.unref(O),"98a0e762":e.unref(T)}));const n=7,p=i=>{i.type==="button"&&!i.active&&h("updatePage",i.page)},b=e.computed(()=>{const i=[];if(a.maxPaginationNumber<=n)for(let l=1;l<=a.maxPaginationNumber;l+=1)i.push({type:"button",page:l,active:l===a.currentPaginationNumber});else if([1,2,a.maxPaginationNumber,a.maxPaginationNumber-1].includes(a.currentPaginationNumber))for(let l=1;l<=n;l+=1)if(l<=3)i.push({type:"button",page:l,active:l===a.currentPaginationNumber});else if(l===4)i.push({type:"omission"});else{const u=a.maxPaginationNumber-(n-l);i.push({type:"button",page:u,active:u===a.currentPaginationNumber})}else if([3,4].includes(a.currentPaginationNumber))for(let l=1;l<=n;l+=1)l<=5?i.push({type:"button",page:l,active:l===a.currentPaginationNumber}):l===6?i.push({type:"omission"}):i.push({type:"button",page:a.maxPaginationNumber,active:a.maxPaginationNumber===a.currentPaginationNumber});else if([a.maxPaginationNumber-2,a.maxPaginationNumber-3].includes(a.currentPaginationNumber))for(let l=1;l<=n;l+=1)if(l===1)i.push({type:"button",page:1,active:a.currentPaginationNumber===1});else if(l===2)i.push({type:"omission"});else{const u=a.maxPaginationNumber-(n-l);i.push({type:"button",page:u,active:u===a.currentPaginationNumber})}else for(let l=1;l<=n;l+=1)if(l===1)i.push({type:"button",page:1,active:a.currentPaginationNumber===1});else if(l===2||l===6)i.push({type:"omission"});else if(l===7)i.push({type:"button",page:a.maxPaginationNumber,active:a.maxPaginationNumber===a.currentPaginationNumber});else{const u=4-l,g=a.currentPaginationNumber-u;i.push({type:"button",page:g,active:g===a.currentPaginationNumber})}return i}),P=e.inject("rowHeight"),F=e.computed(()=>`${P*.6}px`),O=e.inject("rowBorderColor"),T=e.inject("themeColor");return(i,l)=>(e.openBlock(),e.createElementBlock("div",$e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),(u,g)=>(e.openBlock(),e.createElementBlock("div",{key:g,class:e.normalizeClass(["item",{button:u.type==="button",active:u.type==="button"&&u.active,omission:u.type==="omission"}]),onClick:S=>p(u)},e.toDisplayString(u.type==="button"?u.page:"..."),11,Ie))),128))]))}}),[["__scopeId","data-v-4f534e20"]]),$t="";const Q=r=>(e.pushScopeId("data-v-c9da5286"),r=r(),e.popScopeId(),r),Ve=[Q(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],Fe=[Q(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var Te=f(e.defineComponent({props:{isFirstPage:{type:Boolean,required:!1},isLastPage:{type:Boolean,required:!1}},emits:["clickPrevPage","clickNextPage"],setup(r,{emit:h}){const a=e.useSlots();return(n,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["previous-page__click-button",{"first-page":r.isFirstPage}]),onClick:p[0]||(p[0]=b=>h("clickPrevPage"))},Ve,2),e.unref(a).buttonsPagination?e.renderSlot(n.$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:p[1]||(p[1]=b=>h("clickNextPage"))},Fe,2)],64))}}),[["__scopeId","data-v-c9da5286"]]),Ft="";const ze={key:0},Oe=["onClick"],He={key:1,class:"header-text__wrapper"},Le={class:"header-text"},Re=["onClick"],Ae={class:"loading-entity"},De={key:1,class:"data-table__message"},Me={key:0,class:"data-table__footer"},je={class:"footer__rows-per-page"},qe=e.createTextVNode(" rows per page: "),Je={class:"footer__items-index"};var We=f(e.defineComponent({props:{alternating:{type:Boolean,default:!1},buttonsPagination:{type:Boolean,default:!1},rowBorderColor:{type:String,default:"#e0e0e0"},tableBorderColor:{type:String,default:"#e0e0e0"},rowBackgroundColor:{type:String,default:"#fff"},footerBackgroundColor:{type:String,default:"#fff"},rowFontColor:{type:String,default:"#212121"},footerFontColor:{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"},tableFontSize:{type:Number,default:12},evenRowBackgroundColor:{type:String,default:"#fafafa"},evenRowFontColor:{type:String,default:"#212121"},headers:{type:Array,required:!0},hoverToChangeColor:{type:Boolean,default:!0},items:{type:Array,required:!0},tableHeight:{type:Number,default:()=>null},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]},rowHoverBackgroundColor:{type:String,default:"#eee"},rowHoverFontColor:{type:String,default:"#212121"},loading:{type:Boolean,deault:!1},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},showIndex:{type:Boolean,default:!1},showFooter:{type:Boolean,default:!0},filterOptions:{type:Array,default:null}},emits:["update:itemsSelected","update:serverOptions","clickRow"],setup(r,{expose:h,emit:a}){const n=r;e.useCssVars(o=>({"6c9f4295":e.unref(b),"7e6e2dd5":e.unref(Ke),"7672e251":e.unref(Ge),"67267b2c":e.unref(ve),"5706395d":e.unref(Ue),"4dd78678":e.unref(y),e6b28b74:e.unref(F),"43c26747":e.unref(l),f283ffee:e.unref(p),"44e613ca":e.unref(P),"3940a148":r.headerBackgroundColor,d8430cf4:e.unref(Qe),fcabdbee:e.unref(Xe),"5c98c6e1":e.unref(Ye),"0cb46672":e.unref(O),"97378074":e.unref(T),"2d6db280":e.unref(g),"84ce67fe":e.unref(u),"5eef9e8e":e.unref(i),fa769a66:e.unref(S)}));const{rowBorderColor:p,tableBorderColor:b,headerFontColor:P,rowFontColor:F,rowHoverBackgroundColor:O,rowHoverFontColor:T,footerBackgroundColor:i,rowBackgroundColor:l,evenRowBackgroundColor:u,evenRowFontColor:g,footerFontColor:S}=e.toRefs(n),y=e.computed(()=>`${n.tableFontSize}px`),$=e.computed(()=>n.tableFontSize*(n.dense?2:3)),Ue=e.computed(()=>`${$.value}px`),Ge=e.computed(()=>n.tableHeight?`${n.tableHeight}px`:null),Ke=e.computed(()=>`${$.value*5}px`),X=e.computed(()=>Math.round(n.tableFontSize/2.5)),Qe=e.computed(()=>`${X.value}px`),Y=e.computed(()=>Math.round(X.value)),Xe=e.computed(()=>`-${Y.value}px`),Ye=e.computed(()=>`${Y.value}px`),Ze=e.computed(()=>`${n.tableFontSize*5}px`),ve=e.computed(()=>n.tableHeight?`${n.tableHeight-$.value}px`:`${n.tableFontSize*5*2}px`);e.provide("themeColor",n.themeColor),e.provide("loadingEntitySizePx",Ze.value),e.provide("rowHeight",$.value),e.provide("rowBorderColor",p.value),e.provide("footerBackgroundColor",i.value),e.provide("footerFontColor",S.value);const L=e.useSlots(),et=e.computed(()=>L.body),tt=e.computed(()=>L.pagination),ot=e.computed(()=>L.loading),Z=e.ref();e.provide("dataTable",Z);const d=e.computed({get:()=>{if(n.serverOptions){const{page:o,rowsPerPage:s,sortBy:t,sortType:c}=n.serverOptions;return{page:o,rowsPerPage:s,sortBy:t!=null?t:null,sortType:c!=null?c:null}}return null},set:o=>{a("update:serverOptions",o)}}),q=e.computed(()=>n.itemsSelected!==null),w=e.computed(()=>d.value!==null),nt=()=>n.sortBy!==""?{sortBy:n.sortBy,sortDesc:n.sortType==="desc"}:null,I=e.ref(nt()),J=e.computed(()=>{const o=n.headers.map(c=>{const k=c;return c.sortable&&(k.sortType="none"),d.value&&c.value===d.value.sortBy&&d.value.sortType&&(k.sortType=d.value.sortType),!w.value&&I.value&&c.value===I.value.sortBy&&(k.sortType=I.value.sortDesc?"desc":"asc"),k}),s=n.showIndex?[{text:"#",value:"index"},...o]:o;return q.value?[{text:"checkbox",value:"checkbox"},...s]:s}),v=e.computed(()=>J.value.map(o=>o.value)),rt=(o,s)=>{let t="";return o.includes(".")?o.split(".").forEach((k,x)=>{t=x===0?s[k]:t[k]}):t=s[o],Array.isArray(t)?t.join(","):t},B=e.computed({get:()=>{var o;return(o=n.itemsSelected)!=null?o:[]},set:o=>{a("update:itemsSelected",o)}}),ee=e.computed(()=>{if(!w.value&&n.searchValue!==""){const o=new RegExp(n.searchValue,"i");return n.items.filter(s=>o.test(n.searchField!==""?s[n.searchField]:Object.values(s).join(" ")))}return n.items}),E=e.computed(()=>{let o=[...ee.value];return n.filterOptions?(n.filterOptions.forEach(s=>{o=o.filter(t=>{const{field:c,comparison:k,criteria:x}=s;switch(k){case"=":return t[c]===x;case"!=":return t[c]!==x;case">":return t[c]>x;case"<":return t[c]<x;case"<=":return t[c]<=x;case">=":return t[c]>=x;case"between":return t[c]>=Math.min(...x)&&t[c]<=Math.max(...x);default:return t[c]===x}})}),o):ee.value}),R=e.computed(()=>B.value.length===0||B.value.every(s=>E.value.findIndex(t=>JSON.stringify(s)===JSON.stringify(t))===-1)?"noneSelected":B.value.length===E.value.length&&B.value.every(t=>E.value.findIndex(c=>JSON.stringify(t)===JSON.stringify(c))!==-1)?"allSelected":"partSelected"),m=e.ref(w.value?n.serverOptions.page:1),{items:W}=e.toRefs(n);e.watch(W,()=>{m.value=1},{deep:!0});const N=e.ref(w.value?n.serverOptions.rowsPerPage:n.rowsPerPage);e.watch(N,o=>{d.value&&(d.value=z(C({},d.value),{page:1,rowsPerPage:o})),m.value=1});const at=(o,s)=>{let t=null;s==="none"?t="asc":s==="asc"?t="desc":t=null,d.value?d.value=z(C({},d.value),{sortBy:t!==null?o:null,sortType:t}):t===null?I.value=null:I.value={sortBy:o,sortDesc:t==="desc"}},te=e.computed(()=>{if(w.value)return n.items;if(I.value===null)return E.value;const{sortBy:o,sortDesc:s}=I.value;return[...E.value].sort((c,k)=>c[o]<k[o]?s?1:-1:c[o]>k[o]?s?-1:1:0)}),U=e.computed(()=>w.value?n.serverItemsLength:E.value.length),oe=e.computed(()=>w.value?m.value*N.value:Math.min(E.value.length,m.value*N.value)),ne=e.computed(()=>(m.value-1)*N.value+1),A=e.computed(()=>Math.ceil(U.value/N.value)),D=e.computed(()=>m.value===A.value),M=e.computed(()=>m.value===1),{loading:V}=e.toRefs(n),G=()=>{if(!D.value&&!V.value)if(d.value){const o=m.value+1;d.value=z(C({},d.value),{page:o})}else m.value+=1},K=()=>{if(!M.value&&!V.value)if(d.value){const o=m.value-1;d.value=z(C({},d.value),{page:o})}else m.value-=1},re=o=>{V.value||(d.value?d.value=z(C({},d.value),{page:o}):m.value=o)};e.watch(V,(o,s)=>{d.value&&o===!1&&s===!0&&(m.value=d.value.page)});const ae=e.computed(()=>w.value?n.items:te.value.slice(ne.value-1,oe.value)),le=e.computed(()=>N.value*(m.value-1)+1),lt=e.computed(()=>N.value*m.value),j=e.computed(()=>n.showIndex?ae.value.map((o,s)=>C({index:le.value+s},o)):ae.value),se=e.computed(()=>q.value?R.value==="allSelected"?j.value.map(o=>C({checkbox:!0},o)):R.value==="noneSelected"?j.value.map(o=>C({checkbox:!1},o)):j.value.map(o=>{const s=B.value.findIndex(t=>{const c=C({},o);return delete c.index,JSON.stringify(t)===JSON.stringify(c)})!==-1;return C({checkbox:s},o)}):j.value),st=o=>{B.value=o?te.value:[]},ct=o=>{const s=o.checkbox;if(delete o.checkbox,delete o.index,s)B.value=B.value.filter(t=>JSON.stringify(t)!==JSON.stringify(o));else{const t=B.value;t.unshift(o),B.value=t}},it=o=>{const s=C({},o);if(q.value){const{checkbox:t}=o;delete s.checkbox,s.isSelected=t}if(n.showIndex){const{index:t}=o;delete s.index,s.indexInCurrentPage=t}a("clickRow",s)};return h({clientItemsLength:U,currentPageFirstIndex:le,currentPageLastIndex:lt,maxPaginationNumber:A,currentPaginationNumber:m,isLastPage:D,isFirstPage:M,nextPage:G,prevPage:K,updatePage:re}),(o,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataTable",ref:Z,class:"vue3-easy-data-table"},[e.createElementVNode("div",{class:e.normalizeClass(["data-table__body",{"fixed-header":r.fixedHeader,"fixed-height":r.tableHeight}])},[e.createElementVNode("table",null,[e.unref(J).length?(e.openBlock(),e.createElementBlock("thead",ze,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(J),(t,c)=>(e.openBlock(),e.createElementBlock("th",{key:c,class:e.normalizeClass({sortable:t.sortable,none:t.sortable&&t.sortType==="none",desc:t.sortable&&t.sortType==="desc",asc:t.sortable&&t.sortType==="asc"}),onClick:k=>t.sortable&&t.sortType?at(t.value,t.sortType):null},[t.text==="checkbox"?(e.openBlock(),e.createBlock(ge,{key:e.unref(R),status:e.unref(R),onChange:st},null,8,["status"])):(e.openBlock(),e.createElementBlock("span",He,[e.createElementVNode("span",Le,e.toDisplayString(t.text),1),t.sortable?(e.openBlock(),e.createElementBlock("i",{key:t.sortType?t.sortType:"none",class:e.normalizeClass(["sortType-icon",{desc:t.sortType==="desc"}])},null,2)):e.createCommentVNode("",!0)]))],10,Oe))),128))])])):e.createCommentVNode("",!0),e.unref(et)?e.renderSlot(o.$slots,"body",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.unref(W).length&&e.unref(v).length?(e.openBlock(),e.createElementBlock("tbody",{key:0,class:e.normalizeClass({"row-alternation":r.alternating,"hover-to-change-color":r.hoverToChangeColor})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(se),t=>(e.openBlock(),e.createElementBlock("tr",{key:JSON.stringify(t),onClick:c=>it(t)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(c,k)=>(e.openBlock(),e.createElementBlock("td",{key:k},[e.unref(L)[c]?e.renderSlot(o.$slots,c,e.normalizeProps(e.mergeProps({key:0},t)),void 0,!0):c==="checkbox"?(e.openBlock(),e.createBlock(ye,{key:1,checked:t[c],onChange:x=>ct(t)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(rt(c,t)),1)],64))]))),128))],8,Re))),128))],2)):e.createCommentVNode("",!0)],64))]),e.unref(V)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["loading-wrapper",{"initial-loading":!e.unref(W).length&&e.unref(V)}])},[e.createElementVNode("div",{class:e.normalizeClass(["loading-mask",{"no-footer":!r.showFooter}])},null,2),e.createElementVNode("div",Ae,[e.unref(ot)?e.renderSlot(o.$slots,"loading",{key:0},void 0,!0):(e.openBlock(),e.createBlock(we,{key:1}))])],2)):e.createCommentVNode("",!0),!e.unref(se).length&&!e.unref(V)?(e.openBlock(),e.createElementBlock("div",De,e.toDisplayString(r.emptyMessage),1)):e.createCommentVNode("",!0)],2),r.showFooter?(e.openBlock(),e.createElementBlock("div",Me,[e.createElementVNode("div",je,[qe,e.createVNode(Be,{modelValue:N.value,"onUpdate:modelValue":s[0]||(s[0]=t=>N.value=t),"rows-items":r.rowsItems},null,8,["modelValue","rows-items"])]),e.createElementVNode("div",Je,e.toDisplayString(`${e.unref(ne)}-${e.unref(oe)}`)+" of "+e.toDisplayString(e.unref(U)),1),e.unref(tt)?e.renderSlot(o.$slots,"pagination",e.normalizeProps(e.mergeProps({key:0},{isFirstPage:e.unref(M),isLastPage:e.unref(D),currentPaginationNumber:m.value,maxPaginationNumber:e.unref(A),nextPage:G,prevPage:K})),void 0,!0):(e.openBlock(),e.createBlock(Te,{key:1,"is-first-page":e.unref(M),"is-last-page":e.unref(D),onClickNextPage:G,onClickPrevPage:K},e.createSlots({_:2},[r.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(Ee,{"current-pagination-number":m.value,"max-pagination-number":e.unref(A),onUpdatePage:re},null,8,["current-pagination-number","max-pagination-number"])])}:void 0]),1032,["is-first-page","is-last-page"]))])):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-a8a5512a"]]);return We});
(function(e,_){typeof exports=="object"&&typeof module!="undefined"?module.exports=_(require("vue")):typeof define=="function"&&define.amd?define(["vue"],_):(e=typeof globalThis!="undefined"?globalThis:e||self,e["vue3-easy-data-table"]=_(e.Vue))})(this,function(e){"use strict";var pt=Object.defineProperty,ut=Object.defineProperties;var ft=Object.getOwnPropertyDescriptors;var ie=Object.getOwnPropertySymbols;var gt=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable;var de=(e,_,f)=>_ in e?pt(e,_,{enumerable:!0,configurable:!0,writable:!0,value:f}):e[_]=f,C=(e,_)=>{for(var f in _||(_={}))gt.call(_,f)&&de(e,f,_[f]);if(ie)for(var f of ie(_))mt.call(_,f)&&de(e,f,_[f]);return e},z=(e,_)=>ut(e,ft(_));var _="",f=(r,h)=>{const a=r.__vccOpts||r;for(const[n,p]of h)a[n]=p;return a};const pe=r=>(e.pushScopeId("data-v-566775ba"),r=r(),e.popScopeId(),r),ue=["onClick"],fe=["checked"],ge=pe(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var me=f(e.defineComponent({props:{status:{type:String,required:!0}},emits:["change"],setup(r,{emit:h}){const a=r;e.useCssVars(P=>({"7f84b28f":e.unref(b)}));const n=e.computed(()=>a.status==="allSelected"),p=()=>{h("change",!n.value)},b=e.inject("themeColor");return(P,F)=>(e.openBlock(),e.createElementBlock("div",{class:"multi-select__checkbox",onClick:e.withModifiers(p,["stop","prevent"])},[e.createElementVNode("input",{type:"checkbox",checked:e.unref(n),class:e.normalizeClass(r.status)},null,10,fe),ge],8,ue))}}),[["__scopeId","data-v-566775ba"]]),ht="";const _e=r=>(e.pushScopeId("data-v-39f156fd"),r=r(),e.popScopeId(),r),he=["checked"],ye=_e(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var ke=f(e.defineComponent({props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(r,{emit:h}){e.useCssVars(n=>({"20cfc5a0":e.unref(a)}));const a=e.inject("themeColor");return(n,p)=>(e.openBlock(),e.createElementBlock("div",{class:"single-select__checkbox",onClick:p[0]||(p[0]=e.withModifiers(b=>h("change"),["stop","prevent"]))},[e.createElementVNode("input",{type:"checkbox",checked:r.checked},null,8,he),ye]))}}),[["__scopeId","data-v-39f156fd"]]),kt="";const be=r=>(e.pushScopeId("data-v-0ed08e20"),r=r(),e.popScopeId(),r),xe={class:"easy-data-table__rows-selector"},Ce={class:"rows-input"},Se=be(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),Be=["onClick"];var Pe=f(e.defineComponent({props:{modelValue:{type:Number,required:!0},rowsItems:{type:Array,required:!0}},emits:["update:modelValue"],setup(r,{emit:h}){const a=r;e.useCssVars(g=>({"83c11052":e.unref(u),"6b60f418":e.unref(s),"346ac97c":e.unref(i)}));const n=e.ref(!1),p=e.ref(!1),b=e.inject("dataTable");e.watch(n,g=>{if(g&&b){const S=window.innerHeight,y=b.value.getBoundingClientRect().height,$=b.value.getBoundingClientRect().top;S-(y+$)<=100?p.value=!0:p.value=!1}});const P=e.computed({get:()=>a.modelValue,set:g=>{h("update:modelValue",g)}}),F=g=>{P.value=g,n.value=!1},O=(g,S)=>{let y=g.parentNode;for(;y!=null;){if(y.classList&&y.classList.contains(S))return!0;y=y.parentNode}return!1},T=g=>{O(g.target,"easy-data-table__rows-selector")||(n.value=!1)};e.onMounted(()=>{document.addEventListener("click",T)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",T)});const i=e.inject("themeColor"),s=e.inject("footerBackgroundColor"),u=e.inject("footerFontColor");return(g,S)=>(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:S[0]||(S[0]=y=>n.value=!n.value)},[e.createElementVNode("div",Ce,e.toDisplayString(e.unref(P)),1),Se]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:n.value,inside:p.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.rowsItems,y=>(e.openBlock(),e.createElementBlock("li",{key:y,class:e.normalizeClass({selected:y===e.unref(P)}),onClick:$=>F(y)},e.toDisplayString(y),11,Be))),128))],2)]))}}),[["__scopeId","data-v-0ed08e20"]]),xt="";const L=r=>(e.pushScopeId("data-v-969989cc"),r=r(),e.popScopeId(),r),Ne={class:"lds-ring"},we=[L(()=>e.createElementVNode("div",null,null,-1)),L(()=>e.createElementVNode("div",null,null,-1)),L(()=>e.createElementVNode("div",null,null,-1)),L(()=>e.createElementVNode("div",null,null,-1))];var $e=f(e.defineComponent({setup(r){e.useCssVars(n=>({"284c10f4":e.unref(a),"90c4d0a4":e.unref(h)}));const h=e.inject("themeColor"),a=e.inject("loadingEntitySizePx");return(n,p)=>(e.openBlock(),e.createElementBlock("div",Ne,we))}}),[["__scopeId","data-v-969989cc"]]),wt="";const Ie={class:"buttons-pagination"},Ee=["onClick"];var Ve=f(e.defineComponent({props:{maxPaginationNumber:{type:Number,required:!0},currentPaginationNumber:{type:Number,required:!0}},emits:["updatePage"],setup(r,{emit:h}){const a=r;e.useCssVars(i=>({aa5730a0:e.unref(F),"24829312":e.unref(O),"98a0e762":e.unref(T)}));const n=7,p=i=>{i.type==="button"&&!i.active&&h("updatePage",i.page)},b=e.computed(()=>{const i=[];if(a.maxPaginationNumber<=n)for(let s=1;s<=a.maxPaginationNumber;s+=1)i.push({type:"button",page:s,active:s===a.currentPaginationNumber});else if([1,2,a.maxPaginationNumber,a.maxPaginationNumber-1].includes(a.currentPaginationNumber))for(let s=1;s<=n;s+=1)if(s<=3)i.push({type:"button",page:s,active:s===a.currentPaginationNumber});else if(s===4)i.push({type:"omission"});else{const u=a.maxPaginationNumber-(n-s);i.push({type:"button",page:u,active:u===a.currentPaginationNumber})}else if([3,4].includes(a.currentPaginationNumber))for(let s=1;s<=n;s+=1)s<=5?i.push({type:"button",page:s,active:s===a.currentPaginationNumber}):s===6?i.push({type:"omission"}):i.push({type:"button",page:a.maxPaginationNumber,active:a.maxPaginationNumber===a.currentPaginationNumber});else if([a.maxPaginationNumber-2,a.maxPaginationNumber-3].includes(a.currentPaginationNumber))for(let s=1;s<=n;s+=1)if(s===1)i.push({type:"button",page:1,active:a.currentPaginationNumber===1});else if(s===2)i.push({type:"omission"});else{const u=a.maxPaginationNumber-(n-s);i.push({type:"button",page:u,active:u===a.currentPaginationNumber})}else for(let s=1;s<=n;s+=1)if(s===1)i.push({type:"button",page:1,active:a.currentPaginationNumber===1});else if(s===2||s===6)i.push({type:"omission"});else if(s===7)i.push({type:"button",page:a.maxPaginationNumber,active:a.maxPaginationNumber===a.currentPaginationNumber});else{const u=4-s,g=a.currentPaginationNumber-u;i.push({type:"button",page:g,active:g===a.currentPaginationNumber})}return i}),P=e.inject("rowHeight"),F=e.computed(()=>`${P*.6}px`),O=e.inject("rowBorderColor"),T=e.inject("themeColor");return(i,s)=>(e.openBlock(),e.createElementBlock("div",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),(u,g)=>(e.openBlock(),e.createElementBlock("div",{key:g,class:e.normalizeClass(["item",{button:u.type==="button",active:u.type==="button"&&u.active,omission:u.type==="omission"}]),onClick:S=>p(u)},e.toDisplayString(u.type==="button"?u.page:"..."),11,Ee))),128))]))}}),[["__scopeId","data-v-4f534e20"]]),It="";const X=r=>(e.pushScopeId("data-v-c9da5286"),r=r(),e.popScopeId(),r),Fe=[X(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],Te=[X(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var ze=f(e.defineComponent({props:{isFirstPage:{type:Boolean,required:!1},isLastPage:{type:Boolean,required:!1}},emits:["clickPrevPage","clickNextPage"],setup(r,{emit:h}){const a=e.useSlots();return(n,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["previous-page__click-button",{"first-page":r.isFirstPage}]),onClick:p[0]||(p[0]=b=>h("clickPrevPage"))},Fe,2),e.unref(a).buttonsPagination?e.renderSlot(n.$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:p[1]||(p[1]=b=>h("clickNextPage"))},Te,2)],64))}}),[["__scopeId","data-v-c9da5286"]]),Tt="";const Oe={key:0},He=["onClick"],Le={key:1,class:"header-text__wrapper"},Re={class:"header-text"},Ae=["onClick"],De={class:"loading-entity"},Me={key:1,class:"data-table__message"},je={key:0,class:"data-table__footer"},qe={class:"footer__rows-per-page"},Je=e.createTextVNode(" rows per page: "),We={class:"footer__items-index"};var Ue=f(e.defineComponent({props:{alternating:{type:Boolean,default:!1},buttonsPagination:{type:Boolean,default:!1},rowBorderColor:{type:String,default:"#e0e0e0"},tableBorderColor:{type:String,default:"#e0e0e0"},rowBackgroundColor:{type:String,default:"#fff"},footerBackgroundColor:{type:String,default:"#fff"},rowFontColor:{type:String,default:"#212121"},footerFontColor:{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"},tableFontSize:{type:Number,default:12},evenRowBackgroundColor:{type:String,default:"#fafafa"},evenRowFontColor:{type:String,default:"#212121"},headers:{type:Array,required:!0},hoverToChangeColor:{type:Boolean,default:!0},items:{type:Array,required:!0},tableHeight:{type:Number,default:()=>null},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]},rowHoverBackgroundColor:{type:String,default:"#eee"},rowHoverFontColor:{type:String,default:"#212121"},loading:{type:Boolean,deault:!1},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},showIndex:{type:Boolean,default:!1},showFooter:{type:Boolean,default:!0},filterOptions:{type:Array,default:null}},emits:["update:itemsSelected","update:serverOptions","clickRow"],setup(r,{expose:h,emit:a}){const n=r;e.useCssVars(o=>({"3b7cb738":e.unref(b),"70e5c15c":e.unref(Qe),"18c92ee4":e.unref(Ke),"29ba3362":e.unref(et),bfb5aa4c:e.unref(Ge),"25c2a7a7":e.unref(y),"6765f869":e.unref(F),"5dd581ac":e.unref(s),a2b37d28:e.unref(p),"9aa63dd0":e.unref(P),"421eaece":r.headerBackgroundColor,"21315169":e.unref(Xe),e2375228:e.unref(Ye),"12b1c344":e.unref(Ze),"54dd6ac4":e.unref(O),"7d9540fa":e.unref(T),"0769b1ba":e.unref(g),"3426fa64":e.unref(u),"5a8097cb":e.unref(i),"57e49dca":e.unref(S)}));const{rowBorderColor:p,tableBorderColor:b,headerFontColor:P,rowFontColor:F,rowHoverBackgroundColor:O,rowHoverFontColor:T,footerBackgroundColor:i,rowBackgroundColor:s,evenRowBackgroundColor:u,evenRowFontColor:g,footerFontColor:S}=e.toRefs(n),y=e.computed(()=>`${n.tableFontSize}px`),$=e.computed(()=>n.tableFontSize*(n.dense?2:3)),Ge=e.computed(()=>`${$.value}px`),Ke=e.computed(()=>n.tableHeight?`${n.tableHeight}px`:null),Qe=e.computed(()=>`${$.value*5}px`),Y=e.computed(()=>Math.round(n.tableFontSize/2.5)),Xe=e.computed(()=>`${Y.value}px`),Z=e.computed(()=>Math.round(Y.value)),Ye=e.computed(()=>`-${Z.value}px`),Ze=e.computed(()=>`${Z.value}px`),ve=e.computed(()=>`${n.tableFontSize*5}px`),et=e.computed(()=>n.tableHeight?`${n.tableHeight-$.value}px`:`${n.tableFontSize*5*2}px`);e.provide("themeColor",n.themeColor),e.provide("loadingEntitySizePx",ve.value),e.provide("rowHeight",$.value),e.provide("rowBorderColor",p.value),e.provide("footerBackgroundColor",i.value),e.provide("footerFontColor",S.value);const R=e.useSlots(),tt=e.computed(()=>R.body),ot=e.computed(()=>R.pagination),nt=e.computed(()=>R.loading),v=e.ref();e.provide("dataTable",v);const d=e.computed({get:()=>{if(n.serverOptions){const{page:o,rowsPerPage:l,sortBy:t,sortType:c}=n.serverOptions;return{page:o,rowsPerPage:l,sortBy:t!=null?t:null,sortType:c!=null?c:null}}return null},set:o=>{a("update:serverOptions",o)}}),J=e.computed(()=>n.itemsSelected!==null),w=e.computed(()=>d.value!==null),rt=()=>n.sortBy!==""?{sortBy:n.sortBy,sortDesc:n.sortType==="desc"}:null,I=e.ref(rt()),W=e.computed(()=>{const o=n.headers.map(c=>{const k=c;return c.sortable&&(k.sortType="none"),d.value&&c.value===d.value.sortBy&&d.value.sortType&&(k.sortType=d.value.sortType),!w.value&&I.value&&c.value===I.value.sortBy&&(k.sortType=I.value.sortDesc?"desc":"asc"),k}),l=n.showIndex?[{text:"#",value:"index"},...o]:o;return J.value?[{text:"checkbox",value:"checkbox"},...l]:l}),ee=e.computed(()=>W.value.map(o=>o.value)),H=(o,l)=>{if(o.includes(".")){let t="";return o.split(".").forEach((k,x)=>{t=x===0?l[k]:t[k]}),t}return l[o]},at=(o,l)=>{const t=H(o,l);return Array.isArray(t)?t.join(","):t},B=e.computed({get:()=>{var o;return(o=n.itemsSelected)!=null?o:[]},set:o=>{a("update:itemsSelected",o)}}),te=e.computed(()=>{if(!w.value&&n.searchValue!==""){const o=new RegExp(n.searchValue,"i");return n.items.filter(l=>o.test(n.searchField!==""?l[n.searchField]:Object.values(l).join(" ")))}return n.items}),E=e.computed(()=>{let o=[...te.value];return n.filterOptions?(n.filterOptions.forEach(l=>{o=o.filter(t=>{const{field:c,comparison:k,criteria:x}=l;switch(k){case"=":return t[c]===x;case"!=":return t[c]!==x;case">":return t[c]>x;case"<":return t[c]<x;case"<=":return t[c]<=x;case">=":return t[c]>=x;case"between":return t[c]>=Math.min(...x)&&t[c]<=Math.max(...x);default:return t[c]===x}})}),o):te.value}),A=e.computed(()=>B.value.length===0||B.value.every(l=>E.value.findIndex(t=>JSON.stringify(l)===JSON.stringify(t))===-1)?"noneSelected":B.value.length===E.value.length&&B.value.every(t=>E.value.findIndex(c=>JSON.stringify(t)===JSON.stringify(c))!==-1)?"allSelected":"partSelected"),m=e.ref(w.value?n.serverOptions.page:1),{items:U}=e.toRefs(n);e.watch(U,()=>{m.value=1},{deep:!0});const N=e.ref(w.value?n.serverOptions.rowsPerPage:n.rowsPerPage);e.watch(N,o=>{d.value&&(d.value=z(C({},d.value),{page:1,rowsPerPage:o})),m.value=1});const lt=(o,l)=>{let t=null;l==="none"?t="asc":l==="asc"?t="desc":t=null,d.value?d.value=z(C({},d.value),{sortBy:t!==null?o:null,sortType:t}):t===null?I.value=null:I.value={sortBy:o,sortDesc:t==="desc"}},oe=e.computed(()=>{if(w.value)return n.items;if(I.value===null)return E.value;const{sortBy:o,sortDesc:l}=I.value;return[...E.value].sort((c,k)=>H(o,c)<H(o,k)?l?1:-1:H(o,c)>H(o,k)?l?-1:1:0)}),G=e.computed(()=>w.value?n.serverItemsLength:E.value.length),ne=e.computed(()=>w.value?m.value*N.value:Math.min(E.value.length,m.value*N.value)),re=e.computed(()=>(m.value-1)*N.value+1),D=e.computed(()=>Math.ceil(G.value/N.value)),M=e.computed(()=>m.value===D.value),j=e.computed(()=>m.value===1),{loading:V}=e.toRefs(n),K=()=>{if(!M.value&&!V.value)if(d.value){const o=m.value+1;d.value=z(C({},d.value),{page:o})}else m.value+=1},Q=()=>{if(!j.value&&!V.value)if(d.value){const o=m.value-1;d.value=z(C({},d.value),{page:o})}else m.value-=1},ae=o=>{V.value||(d.value?d.value=z(C({},d.value),{page:o}):m.value=o)};e.watch(V,(o,l)=>{d.value&&o===!1&&l===!0&&(m.value=d.value.page)});const le=e.computed(()=>w.value?n.items:oe.value.slice(re.value-1,ne.value)),se=e.computed(()=>N.value*(m.value-1)+1),st=e.computed(()=>N.value*m.value),q=e.computed(()=>n.showIndex?le.value.map((o,l)=>C({index:se.value+l},o)):le.value),ce=e.computed(()=>J.value?A.value==="allSelected"?q.value.map(o=>C({checkbox:!0},o)):A.value==="noneSelected"?q.value.map(o=>C({checkbox:!1},o)):q.value.map(o=>{const l=B.value.findIndex(t=>{const c=C({},o);return delete c.index,JSON.stringify(t)===JSON.stringify(c)})!==-1;return C({checkbox:l},o)}):q.value),ct=o=>{B.value=o?oe.value:[]},it=o=>{const l=o.checkbox;if(delete o.checkbox,delete o.index,l)B.value=B.value.filter(t=>JSON.stringify(t)!==JSON.stringify(o));else{const t=B.value;t.unshift(o),B.value=t}},dt=o=>{const l=C({},o);if(J.value){const{checkbox:t}=o;delete l.checkbox,l.isSelected=t}if(n.showIndex){const{index:t}=o;delete l.index,l.indexInCurrentPage=t}a("clickRow",l)};return h({clientItemsLength:G,currentPageFirstIndex:se,currentPageLastIndex:st,maxPaginationNumber:D,currentPaginationNumber:m,isLastPage:M,isFirstPage:j,nextPage:K,prevPage:Q,updatePage:ae}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataTable",ref:v,class:"vue3-easy-data-table"},[e.createElementVNode("div",{class:e.normalizeClass(["data-table__body",{"fixed-header":r.fixedHeader,"fixed-height":r.tableHeight}])},[e.createElementVNode("table",null,[e.unref(W).length?(e.openBlock(),e.createElementBlock("thead",Oe,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(W),(t,c)=>(e.openBlock(),e.createElementBlock("th",{key:c,class:e.normalizeClass({sortable:t.sortable,none:t.sortable&&t.sortType==="none",desc:t.sortable&&t.sortType==="desc",asc:t.sortable&&t.sortType==="asc"}),onClick:k=>t.sortable&&t.sortType?lt(t.value,t.sortType):null},[t.text==="checkbox"?(e.openBlock(),e.createBlock(me,{key:e.unref(A),status:e.unref(A),onChange:ct},null,8,["status"])):(e.openBlock(),e.createElementBlock("span",Le,[e.createElementVNode("span",Re,e.toDisplayString(t.text),1),t.sortable?(e.openBlock(),e.createElementBlock("i",{key:t.sortType?t.sortType:"none",class:e.normalizeClass(["sortType-icon",{desc:t.sortType==="desc"}])},null,2)):e.createCommentVNode("",!0)]))],10,He))),128))])])):e.createCommentVNode("",!0),e.unref(tt)?e.renderSlot(o.$slots,"body",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.unref(U).length&&e.unref(ee).length?(e.openBlock(),e.createElementBlock("tbody",{key:0,class:e.normalizeClass({"row-alternation":r.alternating,"hover-to-change-color":r.hoverToChangeColor})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ce),t=>(e.openBlock(),e.createElementBlock("tr",{key:JSON.stringify(t),onClick:c=>dt(t)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ee),(c,k)=>(e.openBlock(),e.createElementBlock("td",{key:k},[e.unref(R)[c]?e.renderSlot(o.$slots,c,e.normalizeProps(e.mergeProps({key:0},t)),void 0,!0):c==="checkbox"?(e.openBlock(),e.createBlock(ke,{key:1,checked:t[c],onChange:x=>it(t)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(at(c,t)),1)],64))]))),128))],8,Ae))),128))],2)):e.createCommentVNode("",!0)],64))]),e.unref(V)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["loading-wrapper",{"initial-loading":!e.unref(U).length&&e.unref(V)}])},[e.createElementVNode("div",{class:e.normalizeClass(["loading-mask",{"no-footer":!r.showFooter}])},null,2),e.createElementVNode("div",De,[e.unref(nt)?e.renderSlot(o.$slots,"loading",{key:0},void 0,!0):(e.openBlock(),e.createBlock($e,{key:1}))])],2)):e.createCommentVNode("",!0),!e.unref(ce).length&&!e.unref(V)?(e.openBlock(),e.createElementBlock("div",Me,e.toDisplayString(r.emptyMessage),1)):e.createCommentVNode("",!0)],2),r.showFooter?(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",qe,[Je,e.createVNode(Pe,{modelValue:N.value,"onUpdate:modelValue":l[0]||(l[0]=t=>N.value=t),"rows-items":r.rowsItems},null,8,["modelValue","rows-items"])]),e.createElementVNode("div",We,e.toDisplayString(`${e.unref(re)}-${e.unref(ne)}`)+" of "+e.toDisplayString(e.unref(G)),1),e.unref(ot)?e.renderSlot(o.$slots,"pagination",e.normalizeProps(e.mergeProps({key:0},{isFirstPage:e.unref(j),isLastPage:e.unref(M),currentPaginationNumber:m.value,maxPaginationNumber:e.unref(D),nextPage:K,prevPage:Q})),void 0,!0):(e.openBlock(),e.createBlock(ze,{key:1,"is-first-page":e.unref(j),"is-last-page":e.unref(M),onClickNextPage:K,onClickPrevPage:Q},e.createSlots({_:2},[r.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(Ve,{"current-pagination-number":m.value,"max-pagination-number":e.unref(D),onUpdatePage:ae},null,8,["current-pagination-number","max-pagination-number"])])}:void 0]),1032,["is-first-page","is-last-page"]))])):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-fc863ed0"]]);return Ue});

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

"private": false,
"version": "1.2.7",
"version": "1.2.8",
"types": "./types/main.d.ts",

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

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