vue3-easy-data-table
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -566,22 +566,22 @@ var __defProp = Object.defineProperty; | ||
useCssVars((_ctx) => ({ | ||
"51e386bc": unref(tableBorderColor), | ||
"d188a564": unref(minHeightPx), | ||
"dc4330ec": unref(tableHeightPx), | ||
"6a63585a": unref(loadingWrapperSizePx), | ||
"6fd3b8d6": unref(rowHeightPx), | ||
"f1672baa": unref(fontSizePx), | ||
"e4edac26": unref(rowFontColor), | ||
"2df384a4": unref(rowBackgroundColor), | ||
"4e79bc20": unref(rowBorderColor), | ||
"67a7ddd8": unref(headerFontColor), | ||
"169a28d6": __props.headerBackgroundColor, | ||
"39224fed": unref(sortTypeIconSizePx), | ||
"10409170": unref(sortTypeAscIconMarginTopPx), | ||
"be5b974c": unref(sortTypeDescIconMarginTopPx), | ||
"031adec0": unref(rowHoverBackgroundColor), | ||
"77a8807f": unref(rowHoverFontColor), | ||
"12b1f6a7": unref(evenRowFontColor), | ||
"52a5d230": unref(evenRowBackgroundColor), | ||
"7042dac7": unref(footerBackgroundColor), | ||
"7163cdc6": unref(footerFontColor) | ||
"c65bd006": unref(tableBorderColor), | ||
"b254d126": unref(minHeightPx), | ||
"22a645e9": unref(tableHeightPx), | ||
"24bf46d8": unref(loadingWrapperSizePx), | ||
"7f6da2f5": unref(rowHeightPx), | ||
"f0657fa8": unref(fontSizePx), | ||
"712c83ae": unref(rowFontColor), | ||
"329582af": unref(rowBackgroundColor), | ||
"60f70f71": unref(rowBorderColor), | ||
"4a75d3b3": unref(headerFontColor), | ||
"2c21faf4": __props.headerBackgroundColor, | ||
"fa9cd624": unref(sortTypeIconSizePx), | ||
"60ff4571": unref(sortTypeAscIconMarginTopPx), | ||
"67ea0079": unref(sortTypeDescIconMarginTopPx), | ||
"1b03925f": unref(rowHoverBackgroundColor), | ||
"eae7d144": unref(rowHoverFontColor), | ||
"5da087e8": unref(evenRowFontColor), | ||
"e5c0192e": unref(evenRowBackgroundColor), | ||
"b09c2bb4": unref(footerBackgroundColor), | ||
"20a4df36": unref(footerFontColor) | ||
})); | ||
@@ -800,3 +800,3 @@ const { | ||
} | ||
return Math.min(itemsSearching.value.length, currentPaginationNumber.value * rowsPerPageReactive.value); | ||
return Math.min(itemsFiltering.value.length, currentPaginationNumber.value * rowsPerPageReactive.value); | ||
}); | ||
@@ -1031,3 +1031,3 @@ const firstIndexOfItemsInCurrentPage = computed(() => (currentPaginationNumber.value - 1) * rowsPerPageReactive.value + 1); | ||
}); | ||
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-10cc3a3c"]]); | ||
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5129d26c"]]); | ||
export { DataTable as default }; |
@@ -1,1 +0,1 @@ | ||
(function(e,g){typeof exports=="object"&&typeof module!="undefined"?module.exports=g(require("vue")):typeof define=="function"&&define.amd?define(["vue"],g):(e=typeof globalThis!="undefined"?globalThis:e||self,e["vue3-easy-data-table"]=g(e.Vue))})(this,function(e){"use strict";var lt=Object.defineProperty,st=Object.defineProperties;var ct=Object.getOwnPropertyDescriptors;var se=Object.getOwnPropertySymbols;var it=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var ce=(e,g,f)=>g in e?lt(e,g,{enumerable:!0,configurable:!0,writable:!0,value:f}):e[g]=f,S=(e,g)=>{for(var f in g||(g={}))it.call(g,f)&&ce(e,f,g[f]);if(se)for(var f of se(g))dt.call(g,f)&&ce(e,f,g[f]);return e},z=(e,g)=>st(e,ct(g));var g="",f=(r,h)=>{const a=r.__vccOpts||r;for(const[t,p]of h)a[t]=p;return a};const ie=r=>(e.pushScopeId("data-v-566775ba"),r=r(),e.popScopeId(),r),de=["onClick"],pe=["checked"],ue=ie(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var fe=f(e.defineComponent({props:{status:{type:String,required:!0}},emits:["change"],setup(r,{emit:h}){const a=r;e.useCssVars(P=>({"7f84b28f":e.unref(k)}));const t=e.computed(()=>a.status==="allSelected"),p=()=>{h("change",!t.value)},k=e.inject("themeColor");return(P,V)=>(e.openBlock(),e.createElementBlock("div",{class:"multi-select__checkbox",onClick:e.withModifiers(p,["stop","prevent"])},[e.createElementVNode("input",{type:"checkbox",checked:e.unref(t),class:e.normalizeClass(r.status)},null,10,pe),ue],8,de))}}),[["__scopeId","data-v-566775ba"]]),ut="";const me=r=>(e.pushScopeId("data-v-39f156fd"),r=r(),e.popScopeId(),r),ge=["checked"],_e=me(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var he=f(e.defineComponent({props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(r,{emit:h}){e.useCssVars(t=>({"20cfc5a0":e.unref(a)}));const a=e.inject("themeColor");return(t,p)=>(e.openBlock(),e.createElementBlock("div",{class:"single-select__checkbox",onClick:p[0]||(p[0]=e.withModifiers(k=>h("change"),["stop","prevent"]))},[e.createElementVNode("input",{type:"checkbox",checked:r.checked},null,8,ge),_e]))}}),[["__scopeId","data-v-39f156fd"]]),mt="";const ye=r=>(e.pushScopeId("data-v-0ed08e20"),r=r(),e.popScopeId(),r),ke={class:"easy-data-table__rows-selector"},be={class:"rows-input"},Se=ye(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),xe=["onClick"];var Ce=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(m=>({"83c11052":e.unref(u),"6b60f418":e.unref(l),"346ac97c":e.unref(i)}));const t=e.ref(!1),p=e.ref(!1),k=e.inject("dataTable");e.watch(t,m=>{if(m&&k){const x=window.innerHeight,y=k.value.getBoundingClientRect().height,$=k.value.getBoundingClientRect().top;x-(y+$)<=100?p.value=!0:p.value=!1}});const P=e.computed({get:()=>a.modelValue,set:m=>{h("update:modelValue",m)}}),V=m=>{P.value=m,t.value=!1},O=(m,x)=>{let y=m.parentNode;for(;y!=null;){if(y.classList&&y.classList.contains(x))return!0;y=y.parentNode}return!1},F=m=>{O(m.target,"easy-data-table__rows-selector")||(t.value=!1)};e.onMounted(()=>{document.addEventListener("click",F)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",F)});const i=e.inject("themeColor"),l=e.inject("footerBackgroundColor"),u=e.inject("footerFontColor");return(m,x)=>(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:x[0]||(x[0]=y=>t.value=!t.value)},[e.createElementVNode("div",be,e.toDisplayString(e.unref(P)),1),Se]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:t.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:$=>V(y)},e.toDisplayString(y),11,xe))),128))],2)]))}}),[["__scopeId","data-v-0ed08e20"]]),_t="";const H=r=>(e.pushScopeId("data-v-969989cc"),r=r(),e.popScopeId(),r),Be={class:"lds-ring"},Pe=[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 Ne=f(e.defineComponent({setup(r){e.useCssVars(t=>({"284c10f4":e.unref(a),"90c4d0a4":e.unref(h)}));const h=e.inject("themeColor"),a=e.inject("loadingEntitySizePx");return(t,p)=>(e.openBlock(),e.createElementBlock("div",Be,Pe))}}),[["__scopeId","data-v-969989cc"]]),xt="";const we={class:"buttons-pagination"},$e=["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(V),"24829312":e.unref(O),"98a0e762":e.unref(F)}));const t=7,p=i=>{i.type==="button"&&!i.active&&h("updatePage",i.page)},k=e.computed(()=>{const i=[];if(a.maxPaginationNumber<=t)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<=t;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-(t-l);i.push({type:"button",page:u,active:u===a.currentPaginationNumber})}else if([3,4].includes(a.currentPaginationNumber))for(let l=1;l<=t;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<=t;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-(t-l);i.push({type:"button",page:u,active:u===a.currentPaginationNumber})}else for(let l=1;l<=t;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,m=a.currentPaginationNumber-u;i.push({type:"button",page:m,active:m===a.currentPaginationNumber})}return i}),P=e.inject("rowHeight"),V=e.computed(()=>`${P*.6}px`),O=e.inject("rowBorderColor"),F=e.inject("themeColor");return(i,l)=>(e.openBlock(),e.createElementBlock("div",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(k),(u,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:e.normalizeClass(["item",{button:u.type==="button",active:u.type==="button"&&u.active,omission:u.type==="omission"}]),onClick:x=>p(u)},e.toDisplayString(u.type==="button"?u.page:"..."),11,$e))),128))]))}}),[["__scopeId","data-v-4f534e20"]]),Bt="";const K=r=>(e.pushScopeId("data-v-c9da5286"),r=r(),e.popScopeId(),r),Ie=[K(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],Ve=[K(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var Fe=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(t,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]=k=>h("clickPrevPage"))},Ie,2),e.unref(a).buttonsPagination?e.renderSlot(t.$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]=k=>h("clickNextPage"))},Ve,2)],64))}}),[["__scopeId","data-v-c9da5286"]]),$t="";const Te={key:0},ze=["onClick"],Oe={key:1,class:"header-text__wrapper"},He={class:"header-text"},Le={class:"loading-entity"},De={key:1,class:"data-table__message"},Me={key:0,class:"data-table__footer"},Ae={class:"footer__rows-per-page"},Re=e.createTextVNode(" rows per page: "),je={class:"footer__items-index"};var qe=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"],setup(r,{expose:h,emit:a}){const t=r;e.useCssVars(o=>({"51e386bc":e.unref(k),d188a564:e.unref(Ue),dc4330ec:e.unref(We),"6a63585a":e.unref(Ye),"6fd3b8d6":e.unref(Je),f1672baa:e.unref(y),e4edac26:e.unref(V),"2df384a4":e.unref(l),"4e79bc20":e.unref(p),"67a7ddd8":e.unref(P),"169a28d6":r.headerBackgroundColor,"39224fed":e.unref(Ge),"10409170":e.unref(Ke),be5b974c:e.unref(Qe),"031adec0":e.unref(O),"77a8807f":e.unref(F),"12b1f6a7":e.unref(m),"52a5d230":e.unref(u),"7042dac7":e.unref(i),"7163cdc6":e.unref(x)}));const{rowBorderColor:p,tableBorderColor:k,headerFontColor:P,rowFontColor:V,rowHoverBackgroundColor:O,rowHoverFontColor:F,footerBackgroundColor:i,rowBackgroundColor:l,evenRowBackgroundColor:u,evenRowFontColor:m,footerFontColor:x}=e.toRefs(t),y=e.computed(()=>`${t.tableFontSize}px`),$=e.computed(()=>t.tableFontSize*(t.dense?2:3)),Je=e.computed(()=>`${$.value}px`),We=e.computed(()=>t.tableHeight?`${t.tableHeight}px`:null),Ue=e.computed(()=>`${$.value*5}px`),Q=e.computed(()=>Math.round(t.tableFontSize/2.5)),Ge=e.computed(()=>`${Q.value}px`),X=e.computed(()=>Math.round(Q.value)),Ke=e.computed(()=>`-${X.value}px`),Qe=e.computed(()=>`${X.value}px`),Xe=e.computed(()=>`${t.tableFontSize*5}px`),Ye=e.computed(()=>t.tableHeight?`${t.tableHeight-$.value}px`:`${t.tableFontSize*5*2}px`);e.provide("themeColor",t.themeColor),e.provide("loadingEntitySizePx",Xe.value),e.provide("rowHeight",$.value),e.provide("rowBorderColor",p.value),e.provide("footerBackgroundColor",i.value),e.provide("footerFontColor",x.value);const L=e.useSlots(),Ze=e.computed(()=>L.body),ve=e.computed(()=>L.pagination),et=e.computed(()=>L.loading),Y=e.ref();e.provide("dataTable",Y);const d=e.computed({get:()=>{if(t.serverOptions){const{page:o,rowsPerPage:c,sortBy:n,sortType:s}=t.serverOptions;return{page:o,rowsPerPage:c,sortBy:n!=null?n:null,sortType:s!=null?s:null}}return null},set:o=>{a("update:serverOptions",o)}}),Z=e.computed(()=>t.itemsSelected!==null),w=e.computed(()=>d.value!==null),tt=()=>t.sortBy!==""?{sortBy:t.sortBy,sortDesc:t.sortType==="desc"}:null,E=e.ref(tt()),q=e.computed(()=>{const o=t.headers.map(s=>{const b=s;return s.sortable&&(b.sortType="none"),d.value&&s.value===d.value.sortBy&&d.value.sortType&&(b.sortType=d.value.sortType),!w.value&&E.value&&s.value===E.value.sortBy&&(b.sortType=E.value.sortDesc?"desc":"asc"),b}),c=t.showIndex?[{text:"#",value:"index"},...o]:o;return Z.value?[{text:"checkbox",value:"checkbox"},...c]:c}),v=e.computed(()=>q.value.map(o=>o.value)),C=e.computed({get:()=>{var o;return(o=t.itemsSelected)!=null?o:[]},set:o=>{a("update:itemsSelected",o)}}),J=e.computed(()=>{if(!w.value&&t.searchValue!==""){const o=new RegExp(t.searchValue,"i");return t.items.filter(c=>o.test(t.searchField!==""?c[t.searchField]:Object.values(c).join(" ")))}return t.items}),T=e.computed(()=>{let o=[...J.value];return t.filterOptions?(t.filterOptions.forEach(c=>{o=o.filter(n=>{const{field:s,comparison:b,criteria:B}=c;switch(b){case"=":return n[s]===B;case"!=":return n[s]!==B;case">":return n[s]>B;case"<":return n[s]<B;case"<=":return n[s]<=B;case">=":return n[s]>=B;case"between":return n[s]>=Math.min(...B)&&n[s]<=Math.max(...B);default:return n[s]===B}})}),o):J.value}),D=e.computed(()=>C.value.length===0||C.value.every(c=>T.value.findIndex(n=>JSON.stringify(c)===JSON.stringify(n))===-1)?"noneSelected":C.value.length===T.value.length&&C.value.every(n=>T.value.findIndex(s=>JSON.stringify(n)===JSON.stringify(s))!==-1)?"allSelected":"partSelected"),_=e.ref(w.value?t.serverOptions.page:1),N=e.ref(w.value?t.serverOptions.rowsPerPage:t.rowsPerPage);e.watch(N,o=>{d.value&&(d.value=z(S({},d.value),{page:1,rowsPerPage:o})),_.value=1});const ot=(o,c)=>{let n=null;c==="none"?n="asc":c==="asc"?n="desc":n=null,d.value?d.value=z(S({},d.value),{sortBy:n!==null?o:null,sortType:n}):n===null?E.value=null:E.value={sortBy:o,sortDesc:n==="desc"}},ee=e.computed(()=>{if(w.value)return t.items;if(E.value===null)return T.value;const{sortBy:o,sortDesc:c}=E.value;return[...T.value].sort((s,b)=>s[o]<b[o]?c?1:-1:s[o]>b[o]?c?-1:1:0)}),W=e.computed(()=>w.value?t.serverItemsLength:T.value.length),te=e.computed(()=>w.value?_.value*N.value:Math.min(J.value.length,_.value*N.value)),oe=e.computed(()=>(_.value-1)*N.value+1),M=e.computed(()=>Math.ceil(W.value/N.value)),A=e.computed(()=>_.value===M.value),R=e.computed(()=>_.value===1),{loading:I}=e.toRefs(t),U=()=>{if(!A.value&&!I.value)if(d.value){const o=_.value+1;d.value=z(S({},d.value),{page:o})}else _.value+=1},G=()=>{if(!R.value&&!I.value)if(d.value){const o=_.value-1;d.value=z(S({},d.value),{page:o})}else _.value-=1},ne=o=>{I.value||(d.value?d.value=z(S({},d.value),{page:o}):_.value=o)};e.watch(I,(o,c)=>{d.value&&o===!1&&c===!0&&(_.value=d.value.page)});const re=e.computed(()=>w.value?t.items:ee.value.slice(oe.value-1,te.value)),ae=e.computed(()=>N.value*(_.value-1)+1),nt=e.computed(()=>N.value*_.value),j=e.computed(()=>t.showIndex?re.value.map((o,c)=>S({index:ae.value+c},o)):re.value),le=e.computed(()=>Z.value?D.value==="allSelected"?j.value.map(o=>S({checkbox:!0},o)):D.value==="noneSelected"?j.value.map(o=>S({checkbox:!1},o)):j.value.map(o=>{const c=C.value.findIndex(n=>{const s=S({},o);return delete s.index,JSON.stringify(n)===JSON.stringify(s)})!==-1;return S({checkbox:c},o)}):j.value),rt=o=>{C.value=o?ee.value:[]},at=o=>{const c=o.checkbox;if(delete o.checkbox,delete o.index,c)C.value=C.value.filter(n=>JSON.stringify(n)!==JSON.stringify(o));else{const n=C.value;n.unshift(o),C.value=n}};return h({clientItemsLength:W,currentPageFirstIndex:ae,currentPageLastIndex:nt,maxPaginationNumber:M,currentPaginationNumber:_,isLastPage:A,isFirstPage:R,nextPage:U,prevPage:G,updatePage:ne}),(o,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataTable",ref:Y,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(q).length?(e.openBlock(),e.createElementBlock("thead",Te,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(q),(n,s)=>(e.openBlock(),e.createElementBlock("th",{key:s,class:e.normalizeClass({sortable:n.sortable,none:n.sortable&&n.sortType==="none",desc:n.sortable&&n.sortType==="desc",asc:n.sortable&&n.sortType==="asc"}),onClick:b=>n.sortable&&n.sortType?ot(n.value,n.sortType):null},[n.text==="checkbox"?(e.openBlock(),e.createBlock(fe,{key:e.unref(D),status:e.unref(D),onChange:rt},null,8,["status"])):(e.openBlock(),e.createElementBlock("span",Oe,[e.createElementVNode("span",He,e.toDisplayString(n.text),1),n.sortable?(e.openBlock(),e.createElementBlock("i",{key:n.sortType?n.sortType:"none",class:e.normalizeClass(["sortType-icon",{desc:n.sortType==="desc"}])},null,2)):e.createCommentVNode("",!0)]))],10,ze))),128))])])):e.createCommentVNode("",!0),e.unref(Ze)?e.renderSlot(o.$slots,"body",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[r.items.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(le),n=>(e.openBlock(),e.createElementBlock("tr",{key:JSON.stringify(n)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(s,b)=>(e.openBlock(),e.createElementBlock("td",{key:b},[e.unref(L)[s]?e.renderSlot(o.$slots,s,e.normalizeProps(e.mergeProps({key:0},n)),void 0,!0):s==="checkbox"?(e.openBlock(),e.createBlock(he,{key:1,checked:n[s],onChange:B=>at(n)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(Array.isArray(n[s])?n[s].join(","):n[s]),1)],64))]))),128))]))),128))],2)):e.createCommentVNode("",!0)],64))]),e.unref(I)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["loading-wrapper",{"initial-loading":!r.items.length&&e.unref(I)}])},[e.createElementVNode("div",{class:e.normalizeClass(["loading-mask",{"no-footer":!r.showFooter}])},null,2),e.createElementVNode("div",Le,[e.unref(et)?e.renderSlot(o.$slots,"loading",{key:0},void 0,!0):(e.openBlock(),e.createBlock(Ne,{key:1}))])],2)):e.createCommentVNode("",!0),!e.unref(le).length&&!e.unref(I)?(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",Ae,[Re,e.createVNode(Ce,{modelValue:N.value,"onUpdate:modelValue":c[0]||(c[0]=n=>N.value=n),"rows-items":r.rowsItems},null,8,["modelValue","rows-items"])]),e.createElementVNode("div",je,e.toDisplayString(`${e.unref(oe)}-${e.unref(te)}`)+" of "+e.toDisplayString(e.unref(W)),1),e.unref(ve)?e.renderSlot(o.$slots,"pagination",e.normalizeProps(e.mergeProps({key:0},{isFirstPage:e.unref(R),isLastPage:e.unref(A),currentPaginationNumber:_.value,maxPaginationNumber:e.unref(M),nextPage:U,prevPage:G})),void 0,!0):(e.openBlock(),e.createBlock(Fe,{key:1,"is-first-page":e.unref(R),"is-last-page":e.unref(A),onClickNextPage:U,onClickPrevPage:G},e.createSlots({_:2},[r.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(Ee,{"current-pagination-number":_.value,"max-pagination-number":e.unref(M),onUpdatePage:ne},null,8,["current-pagination-number","max-pagination-number"])])}:void 0]),1032,["is-first-page","is-last-page"]))])):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-10cc3a3c"]]);return qe}); | ||
(function(e,g){typeof exports=="object"&&typeof module!="undefined"?module.exports=g(require("vue")):typeof define=="function"&&define.amd?define(["vue"],g):(e=typeof globalThis!="undefined"?globalThis:e||self,e["vue3-easy-data-table"]=g(e.Vue))})(this,function(e){"use strict";var lt=Object.defineProperty,st=Object.defineProperties;var ct=Object.getOwnPropertyDescriptors;var se=Object.getOwnPropertySymbols;var it=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var ce=(e,g,f)=>g in e?lt(e,g,{enumerable:!0,configurable:!0,writable:!0,value:f}):e[g]=f,S=(e,g)=>{for(var f in g||(g={}))it.call(g,f)&&ce(e,f,g[f]);if(se)for(var f of se(g))dt.call(g,f)&&ce(e,f,g[f]);return e},z=(e,g)=>st(e,ct(g));var g="",f=(r,h)=>{const a=r.__vccOpts||r;for(const[t,p]of h)a[t]=p;return a};const ie=r=>(e.pushScopeId("data-v-566775ba"),r=r(),e.popScopeId(),r),de=["onClick"],pe=["checked"],ue=ie(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var fe=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 t=e.computed(()=>a.status==="allSelected"),p=()=>{h("change",!t.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(t),class:e.normalizeClass(r.status)},null,10,pe),ue],8,de))}}),[["__scopeId","data-v-566775ba"]]),ut="";const me=r=>(e.pushScopeId("data-v-39f156fd"),r=r(),e.popScopeId(),r),ge=["checked"],_e=me(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var he=f(e.defineComponent({props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(r,{emit:h}){e.useCssVars(t=>({"20cfc5a0":e.unref(a)}));const a=e.inject("themeColor");return(t,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,ge),_e]))}}),[["__scopeId","data-v-39f156fd"]]),mt="";const ye=r=>(e.pushScopeId("data-v-0ed08e20"),r=r(),e.popScopeId(),r),be={class:"easy-data-table__rows-selector"},ke={class:"rows-input"},Se=ye(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),xe=["onClick"];var Ce=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(m=>({"83c11052":e.unref(u),"6b60f418":e.unref(l),"346ac97c":e.unref(i)}));const t=e.ref(!1),p=e.ref(!1),b=e.inject("dataTable");e.watch(t,m=>{if(m&&b){const x=window.innerHeight,y=b.value.getBoundingClientRect().height,$=b.value.getBoundingClientRect().top;x-(y+$)<=100?p.value=!0:p.value=!1}});const P=e.computed({get:()=>a.modelValue,set:m=>{h("update:modelValue",m)}}),F=m=>{P.value=m,t.value=!1},O=(m,x)=>{let y=m.parentNode;for(;y!=null;){if(y.classList&&y.classList.contains(x))return!0;y=y.parentNode}return!1},T=m=>{O(m.target,"easy-data-table__rows-selector")||(t.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(m,x)=>(e.openBlock(),e.createElementBlock("div",be,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:x[0]||(x[0]=y=>t.value=!t.value)},[e.createElementVNode("div",ke,e.toDisplayString(e.unref(P)),1),Se]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:t.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,xe))),128))],2)]))}}),[["__scopeId","data-v-0ed08e20"]]),_t="";const H=r=>(e.pushScopeId("data-v-969989cc"),r=r(),e.popScopeId(),r),Be={class:"lds-ring"},Pe=[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 Ne=f(e.defineComponent({setup(r){e.useCssVars(t=>({"284c10f4":e.unref(a),"90c4d0a4":e.unref(h)}));const h=e.inject("themeColor"),a=e.inject("loadingEntitySizePx");return(t,p)=>(e.openBlock(),e.createElementBlock("div",Be,Pe))}}),[["__scopeId","data-v-969989cc"]]),xt="";const we={class:"buttons-pagination"},$e=["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 t=7,p=i=>{i.type==="button"&&!i.active&&h("updatePage",i.page)},b=e.computed(()=>{const i=[];if(a.maxPaginationNumber<=t)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<=t;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-(t-l);i.push({type:"button",page:u,active:u===a.currentPaginationNumber})}else if([3,4].includes(a.currentPaginationNumber))for(let l=1;l<=t;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<=t;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-(t-l);i.push({type:"button",page:u,active:u===a.currentPaginationNumber})}else for(let l=1;l<=t;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,m=a.currentPaginationNumber-u;i.push({type:"button",page:m,active:m===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",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),(u,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:e.normalizeClass(["item",{button:u.type==="button",active:u.type==="button"&&u.active,omission:u.type==="omission"}]),onClick:x=>p(u)},e.toDisplayString(u.type==="button"?u.page:"..."),11,$e))),128))]))}}),[["__scopeId","data-v-4f534e20"]]),Bt="";const G=r=>(e.pushScopeId("data-v-c9da5286"),r=r(),e.popScopeId(),r),Ie=[G(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],Ve=[G(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var Fe=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(t,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"))},Ie,2),e.unref(a).buttonsPagination?e.renderSlot(t.$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"))},Ve,2)],64))}}),[["__scopeId","data-v-c9da5286"]]),$t="";const Te={key:0},ze=["onClick"],Oe={key:1,class:"header-text__wrapper"},He={class:"header-text"},Le={class:"loading-entity"},De={key:1,class:"data-table__message"},Me={key:0,class:"data-table__footer"},Ae={class:"footer__rows-per-page"},Re=e.createTextVNode(" rows per page: "),je={class:"footer__items-index"};var qe=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"],setup(r,{expose:h,emit:a}){const t=r;e.useCssVars(o=>({c65bd006:e.unref(b),b254d126:e.unref(Ue),"22a645e9":e.unref(We),"24bf46d8":e.unref(Ye),"7f6da2f5":e.unref(Je),f0657fa8:e.unref(y),"712c83ae":e.unref(F),"329582af":e.unref(l),"60f70f71":e.unref(p),"4a75d3b3":e.unref(P),"2c21faf4":r.headerBackgroundColor,fa9cd624:e.unref(Ge),"60ff4571":e.unref(Ke),"67ea0079":e.unref(Qe),"1b03925f":e.unref(O),eae7d144:e.unref(T),"5da087e8":e.unref(m),e5c0192e:e.unref(u),b09c2bb4:e.unref(i),"20a4df36":e.unref(x)}));const{rowBorderColor:p,tableBorderColor:b,headerFontColor:P,rowFontColor:F,rowHoverBackgroundColor:O,rowHoverFontColor:T,footerBackgroundColor:i,rowBackgroundColor:l,evenRowBackgroundColor:u,evenRowFontColor:m,footerFontColor:x}=e.toRefs(t),y=e.computed(()=>`${t.tableFontSize}px`),$=e.computed(()=>t.tableFontSize*(t.dense?2:3)),Je=e.computed(()=>`${$.value}px`),We=e.computed(()=>t.tableHeight?`${t.tableHeight}px`:null),Ue=e.computed(()=>`${$.value*5}px`),K=e.computed(()=>Math.round(t.tableFontSize/2.5)),Ge=e.computed(()=>`${K.value}px`),Q=e.computed(()=>Math.round(K.value)),Ke=e.computed(()=>`-${Q.value}px`),Qe=e.computed(()=>`${Q.value}px`),Xe=e.computed(()=>`${t.tableFontSize*5}px`),Ye=e.computed(()=>t.tableHeight?`${t.tableHeight-$.value}px`:`${t.tableFontSize*5*2}px`);e.provide("themeColor",t.themeColor),e.provide("loadingEntitySizePx",Xe.value),e.provide("rowHeight",$.value),e.provide("rowBorderColor",p.value),e.provide("footerBackgroundColor",i.value),e.provide("footerFontColor",x.value);const L=e.useSlots(),Ze=e.computed(()=>L.body),ve=e.computed(()=>L.pagination),et=e.computed(()=>L.loading),X=e.ref();e.provide("dataTable",X);const d=e.computed({get:()=>{if(t.serverOptions){const{page:o,rowsPerPage:c,sortBy:n,sortType:s}=t.serverOptions;return{page:o,rowsPerPage:c,sortBy:n!=null?n:null,sortType:s!=null?s:null}}return null},set:o=>{a("update:serverOptions",o)}}),Y=e.computed(()=>t.itemsSelected!==null),w=e.computed(()=>d.value!==null),tt=()=>t.sortBy!==""?{sortBy:t.sortBy,sortDesc:t.sortType==="desc"}:null,E=e.ref(tt()),q=e.computed(()=>{const o=t.headers.map(s=>{const k=s;return s.sortable&&(k.sortType="none"),d.value&&s.value===d.value.sortBy&&d.value.sortType&&(k.sortType=d.value.sortType),!w.value&&E.value&&s.value===E.value.sortBy&&(k.sortType=E.value.sortDesc?"desc":"asc"),k}),c=t.showIndex?[{text:"#",value:"index"},...o]:o;return Y.value?[{text:"checkbox",value:"checkbox"},...c]:c}),Z=e.computed(()=>q.value.map(o=>o.value)),C=e.computed({get:()=>{var o;return(o=t.itemsSelected)!=null?o:[]},set:o=>{a("update:itemsSelected",o)}}),v=e.computed(()=>{if(!w.value&&t.searchValue!==""){const o=new RegExp(t.searchValue,"i");return t.items.filter(c=>o.test(t.searchField!==""?c[t.searchField]:Object.values(c).join(" ")))}return t.items}),I=e.computed(()=>{let o=[...v.value];return t.filterOptions?(t.filterOptions.forEach(c=>{o=o.filter(n=>{const{field:s,comparison:k,criteria:B}=c;switch(k){case"=":return n[s]===B;case"!=":return n[s]!==B;case">":return n[s]>B;case"<":return n[s]<B;case"<=":return n[s]<=B;case">=":return n[s]>=B;case"between":return n[s]>=Math.min(...B)&&n[s]<=Math.max(...B);default:return n[s]===B}})}),o):v.value}),D=e.computed(()=>C.value.length===0||C.value.every(c=>I.value.findIndex(n=>JSON.stringify(c)===JSON.stringify(n))===-1)?"noneSelected":C.value.length===I.value.length&&C.value.every(n=>I.value.findIndex(s=>JSON.stringify(n)===JSON.stringify(s))!==-1)?"allSelected":"partSelected"),_=e.ref(w.value?t.serverOptions.page:1),N=e.ref(w.value?t.serverOptions.rowsPerPage:t.rowsPerPage);e.watch(N,o=>{d.value&&(d.value=z(S({},d.value),{page:1,rowsPerPage:o})),_.value=1});const ot=(o,c)=>{let n=null;c==="none"?n="asc":c==="asc"?n="desc":n=null,d.value?d.value=z(S({},d.value),{sortBy:n!==null?o:null,sortType:n}):n===null?E.value=null:E.value={sortBy:o,sortDesc:n==="desc"}},ee=e.computed(()=>{if(w.value)return t.items;if(E.value===null)return I.value;const{sortBy:o,sortDesc:c}=E.value;return[...I.value].sort((s,k)=>s[o]<k[o]?c?1:-1:s[o]>k[o]?c?-1:1:0)}),J=e.computed(()=>w.value?t.serverItemsLength:I.value.length),te=e.computed(()=>w.value?_.value*N.value:Math.min(I.value.length,_.value*N.value)),oe=e.computed(()=>(_.value-1)*N.value+1),M=e.computed(()=>Math.ceil(J.value/N.value)),A=e.computed(()=>_.value===M.value),R=e.computed(()=>_.value===1),{loading:V}=e.toRefs(t),W=()=>{if(!A.value&&!V.value)if(d.value){const o=_.value+1;d.value=z(S({},d.value),{page:o})}else _.value+=1},U=()=>{if(!R.value&&!V.value)if(d.value){const o=_.value-1;d.value=z(S({},d.value),{page:o})}else _.value-=1},ne=o=>{V.value||(d.value?d.value=z(S({},d.value),{page:o}):_.value=o)};e.watch(V,(o,c)=>{d.value&&o===!1&&c===!0&&(_.value=d.value.page)});const re=e.computed(()=>w.value?t.items:ee.value.slice(oe.value-1,te.value)),ae=e.computed(()=>N.value*(_.value-1)+1),nt=e.computed(()=>N.value*_.value),j=e.computed(()=>t.showIndex?re.value.map((o,c)=>S({index:ae.value+c},o)):re.value),le=e.computed(()=>Y.value?D.value==="allSelected"?j.value.map(o=>S({checkbox:!0},o)):D.value==="noneSelected"?j.value.map(o=>S({checkbox:!1},o)):j.value.map(o=>{const c=C.value.findIndex(n=>{const s=S({},o);return delete s.index,JSON.stringify(n)===JSON.stringify(s)})!==-1;return S({checkbox:c},o)}):j.value),rt=o=>{C.value=o?ee.value:[]},at=o=>{const c=o.checkbox;if(delete o.checkbox,delete o.index,c)C.value=C.value.filter(n=>JSON.stringify(n)!==JSON.stringify(o));else{const n=C.value;n.unshift(o),C.value=n}};return h({clientItemsLength:J,currentPageFirstIndex:ae,currentPageLastIndex:nt,maxPaginationNumber:M,currentPaginationNumber:_,isLastPage:A,isFirstPage:R,nextPage:W,prevPage:U,updatePage:ne}),(o,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataTable",ref:X,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(q).length?(e.openBlock(),e.createElementBlock("thead",Te,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(q),(n,s)=>(e.openBlock(),e.createElementBlock("th",{key:s,class:e.normalizeClass({sortable:n.sortable,none:n.sortable&&n.sortType==="none",desc:n.sortable&&n.sortType==="desc",asc:n.sortable&&n.sortType==="asc"}),onClick:k=>n.sortable&&n.sortType?ot(n.value,n.sortType):null},[n.text==="checkbox"?(e.openBlock(),e.createBlock(fe,{key:e.unref(D),status:e.unref(D),onChange:rt},null,8,["status"])):(e.openBlock(),e.createElementBlock("span",Oe,[e.createElementVNode("span",He,e.toDisplayString(n.text),1),n.sortable?(e.openBlock(),e.createElementBlock("i",{key:n.sortType?n.sortType:"none",class:e.normalizeClass(["sortType-icon",{desc:n.sortType==="desc"}])},null,2)):e.createCommentVNode("",!0)]))],10,ze))),128))])])):e.createCommentVNode("",!0),e.unref(Ze)?e.renderSlot(o.$slots,"body",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[r.items.length&&e.unref(Z).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(le),n=>(e.openBlock(),e.createElementBlock("tr",{key:JSON.stringify(n)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Z),(s,k)=>(e.openBlock(),e.createElementBlock("td",{key:k},[e.unref(L)[s]?e.renderSlot(o.$slots,s,e.normalizeProps(e.mergeProps({key:0},n)),void 0,!0):s==="checkbox"?(e.openBlock(),e.createBlock(he,{key:1,checked:n[s],onChange:B=>at(n)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(Array.isArray(n[s])?n[s].join(","):n[s]),1)],64))]))),128))]))),128))],2)):e.createCommentVNode("",!0)],64))]),e.unref(V)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["loading-wrapper",{"initial-loading":!r.items.length&&e.unref(V)}])},[e.createElementVNode("div",{class:e.normalizeClass(["loading-mask",{"no-footer":!r.showFooter}])},null,2),e.createElementVNode("div",Le,[e.unref(et)?e.renderSlot(o.$slots,"loading",{key:0},void 0,!0):(e.openBlock(),e.createBlock(Ne,{key:1}))])],2)):e.createCommentVNode("",!0),!e.unref(le).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",Ae,[Re,e.createVNode(Ce,{modelValue:N.value,"onUpdate:modelValue":c[0]||(c[0]=n=>N.value=n),"rows-items":r.rowsItems},null,8,["modelValue","rows-items"])]),e.createElementVNode("div",je,e.toDisplayString(`${e.unref(oe)}-${e.unref(te)}`)+" of "+e.toDisplayString(e.unref(J)),1),e.unref(ve)?e.renderSlot(o.$slots,"pagination",e.normalizeProps(e.mergeProps({key:0},{isFirstPage:e.unref(R),isLastPage:e.unref(A),currentPaginationNumber:_.value,maxPaginationNumber:e.unref(M),nextPage:W,prevPage:U})),void 0,!0):(e.openBlock(),e.createBlock(Fe,{key:1,"is-first-page":e.unref(R),"is-last-page":e.unref(A),onClickNextPage:W,onClickPrevPage:U},e.createSlots({_:2},[r.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(Ee,{"current-pagination-number":_.value,"max-pagination-number":e.unref(M),onUpdatePage:ne},null,8,["current-pagination-number","max-pagination-number"])])}:void 0]),1032,["is-first-page","is-last-page"]))])):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-5129d26c"]]);return qe}); |
@@ -6,3 +6,3 @@ { | ||
"private": false, | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"types": "./types/main.d.ts", | ||
@@ -9,0 +9,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78232