vue3-easy-data-table
Advanced tools
Comparing version 1.1.22 to 1.1.23
@@ -486,3 +486,3 @@ var __defProp = Object.defineProperty; | ||
}, | ||
maxHeight: { | ||
tableHeight: { | ||
type: Number, | ||
@@ -563,21 +563,22 @@ default: () => null | ||
useCssVars((_ctx) => ({ | ||
"ec4464fc": unref(tableBorderColor), | ||
"fc52e04c": unref(maxHeightPx), | ||
"5b1bc799": unref(loadingWrapperSizePx), | ||
"320dce50": unref(rowHeightPx), | ||
"81c6851e": unref(fontSizePx), | ||
"1291c3b3": unref(rowFontColor), | ||
"0b89eaf4": unref(rowBackgroundColor), | ||
"3e0c6236": unref(rowBorderColor), | ||
"100ad98e": unref(headerFontColor), | ||
"6e13f08f": __props.headerBackgroundColor, | ||
"5ba5fd33": unref(sortTypeIconSizePx), | ||
"6d04ce94": unref(sortTypeAscIconMarginTopPx), | ||
"0f3615d4": unref(sortTypeDescIconMarginTopPx), | ||
"af62e58c": unref(rowHoverBackgroundColor), | ||
"3ef71279": unref(rowHoverFontColor), | ||
"4aac3d6d": unref(evenRowFontColor), | ||
"ed269da4": unref(evenRowBackgroundColor), | ||
"2cb8407e": unref(footerBackgroundColor), | ||
"957ad380": unref(footerFontColor) | ||
"35415a6e": unref(tableBorderColor), | ||
"5ac9cd21": unref(minHeightPx), | ||
"ab3842c6": unref(tableHeightPx), | ||
"643b5160": unref(loadingWrapperSizePx), | ||
"3361d8a9": unref(rowHeightPx), | ||
"b33cf810": unref(fontSizePx), | ||
"3bbf047a": unref(rowFontColor), | ||
"e6818b0a": unref(rowBackgroundColor), | ||
"5e26e586": unref(rowBorderColor), | ||
"4d9fe132": unref(headerFontColor), | ||
"ee34c0b0": __props.headerBackgroundColor, | ||
"4649668c": unref(sortTypeIconSizePx), | ||
"d7eb1d86": unref(sortTypeAscIconMarginTopPx), | ||
"d37763a6": unref(sortTypeDescIconMarginTopPx), | ||
"5570da13": unref(rowHoverBackgroundColor), | ||
"53a63612": unref(rowHoverFontColor), | ||
"b3a47a98": unref(evenRowFontColor), | ||
"6e5e3596": unref(evenRowBackgroundColor), | ||
"04758eda": unref(footerBackgroundColor), | ||
"7e67cc19": unref(footerFontColor) | ||
})); | ||
@@ -600,3 +601,4 @@ const { | ||
const rowHeightPx = computed(() => `${rowHeight.value}px`); | ||
const maxHeightPx = computed(() => props.maxHeight ? `${props.maxHeight}px` : null); | ||
const tableHeightPx = computed(() => props.tableHeight ? `${props.tableHeight}px` : null); | ||
const minHeightPx = computed(() => `${rowHeight.value * 5}px`); | ||
const sortTypeIconSize = computed(() => Math.round(props.tableFontSize / 2.5)); | ||
@@ -608,3 +610,3 @@ const sortTypeIconSizePx = computed(() => `${sortTypeIconSize.value}px`); | ||
const loadingEntitySizePx = computed(() => `${props.tableFontSize * 5}px`); | ||
const loadingWrapperSizePx = computed(() => props.maxHeight ? `${props.maxHeight - rowHeight.value}px` : `${props.tableFontSize * 5 * 2}px`); | ||
const loadingWrapperSizePx = computed(() => props.tableHeight ? `${props.tableHeight - rowHeight.value}px` : `${props.tableFontSize * 5 * 2}px`); | ||
provide("themeColor", props.themeColor); | ||
@@ -878,3 +880,3 @@ provide("loadingEntitySizePx", loadingEntitySizePx.value); | ||
"fixed-header": __props.fixedHeader, | ||
"max-height": __props.maxHeight | ||
"fixed-height": __props.tableHeight | ||
}]) | ||
@@ -989,3 +991,3 @@ }, [ | ||
}); | ||
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2b5862d8"]]); | ||
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-365c0f25"]]); | ||
export { DataTable as default }; |
@@ -1,1 +0,1 @@ | ||
(function(e,f){typeof exports=="object"&&typeof module!="undefined"?module.exports=f(require("vue")):typeof define=="function"&&define.amd?define(["vue"],f):(e=typeof globalThis!="undefined"?globalThis:e||self,e["vue3-easy-data-table"]=f(e.Vue))})(this,function(e){"use strict";var nt=Object.defineProperty,at=Object.defineProperties;var rt=Object.getOwnPropertyDescriptors;var re=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable;var le=(e,f,u)=>f in e?nt(e,f,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[f]=u,x=(e,f)=>{for(var u in f||(f={}))lt.call(f,u)&&le(e,u,f[u]);if(re)for(var u of re(f))st.call(f,u)&&le(e,u,f[u]);return e},F=(e,f)=>at(e,rt(f));var f="",u=(n,_)=>{const r=n.__vccOpts||n;for(const[t,d]of _)r[t]=d;return r};const se=n=>(e.pushScopeId("data-v-566775ba"),n=n(),e.popScopeId(),n),ce=["onClick"],ie=["checked"],de=se(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var pe=u(e.defineComponent({props:{status:{type:String,required:!0}},emits:["change"],setup(n,{emit:_}){const r=n;e.useCssVars(B=>({"7f84b28f":e.unref(b)}));const t=e.computed(()=>r.status==="allSelected"),d=()=>{_("change",!t.value)},b=e.inject("themeColor");return(B,E)=>(e.openBlock(),e.createElementBlock("div",{class:"multi-select__checkbox",onClick:e.withModifiers(d,["stop","prevent"])},[e.createElementVNode("input",{type:"checkbox",checked:e.unref(t),class:e.normalizeClass(n.status)},null,10,ie),de],8,ce))}}),[["__scopeId","data-v-566775ba"]]),it="";const ue=n=>(e.pushScopeId("data-v-39f156fd"),n=n(),e.popScopeId(),n),me=["checked"],fe=ue(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var ge=u(e.defineComponent({props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(n,{emit:_}){e.useCssVars(t=>({"20cfc5a0":e.unref(r)}));const r=e.inject("themeColor");return(t,d)=>(e.openBlock(),e.createElementBlock("div",{class:"single-select__checkbox",onClick:d[0]||(d[0]=e.withModifiers(b=>_("change"),["stop","prevent"]))},[e.createElementVNode("input",{type:"checkbox",checked:n.checked},null,8,me),fe]))}}),[["__scopeId","data-v-39f156fd"]]),pt="";const _e=n=>(e.pushScopeId("data-v-0ed08e20"),n=n(),e.popScopeId(),n),he={class:"easy-data-table__rows-selector"},ye={class:"rows-input"},ke=_e(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),be=["onClick"];var xe=u(e.defineComponent({props:{modelValue:{type:Number,required:!0},rowsItems:{type:Array,required:!0}},emits:["update:modelValue"],setup(n,{emit:_}){const r=n;e.useCssVars(m=>({"83c11052":e.unref(p),"6b60f418":e.unref(l),"346ac97c":e.unref(s)}));const t=e.ref(!1),d=e.ref(!1),b=e.inject("dataTable");e.watch(t,m=>{if(m&&b){const C=window.innerHeight,h=b.value.getBoundingClientRect().height,V=b.value.getBoundingClientRect().top;C-(h+V)<=100?d.value=!0:d.value=!1}});const B=e.computed({get:()=>r.modelValue,set:m=>{_("update:modelValue",m)}}),E=m=>{B.value=m,t.value=!1},T=(m,C)=>{let h=m.parentNode;for(;h!=null;){if(h.classList&&h.classList.contains(C))return!0;h=h.parentNode}return!1},I=m=>{T(m.target,"easy-data-table__rows-selector")||(t.value=!1)};e.onMounted(()=>{document.addEventListener("click",I)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",I)});const s=e.inject("themeColor"),l=e.inject("footerBackgroundColor"),p=e.inject("footerFontColor");return(m,C)=>(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:C[0]||(C[0]=h=>t.value=!t.value)},[e.createElementVNode("div",ye,e.toDisplayString(e.unref(B)),1),ke]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:t.value,inside:d.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rowsItems,h=>(e.openBlock(),e.createElementBlock("li",{key:h,class:e.normalizeClass({selected:h===e.unref(B)}),onClick:V=>E(h)},e.toDisplayString(h),11,be))),128))],2)]))}}),[["__scopeId","data-v-0ed08e20"]]),mt="";const z=n=>(e.pushScopeId("data-v-969989cc"),n=n(),e.popScopeId(),n),Ce={class:"lds-ring"},Se=[z(()=>e.createElementVNode("div",null,null,-1)),z(()=>e.createElementVNode("div",null,null,-1)),z(()=>e.createElementVNode("div",null,null,-1)),z(()=>e.createElementVNode("div",null,null,-1))];var Be=u(e.defineComponent({setup(n){e.useCssVars(t=>({"284c10f4":e.unref(r),"90c4d0a4":e.unref(_)}));const _=e.inject("themeColor"),r=e.inject("loadingEntitySizePx");return(t,d)=>(e.openBlock(),e.createElementBlock("div",Ce,Se))}}),[["__scopeId","data-v-969989cc"]]),kt="";const Pe={class:"buttons-pagination"},Ne=["onClick"];var we=u(e.defineComponent({props:{maxPaginationNumber:{type:Number,required:!0},currentPaginationNumber:{type:Number,required:!0}},emits:["updatePage"],setup(n,{emit:_}){const r=n;e.useCssVars(s=>({aa5730a0:e.unref(E),"24829312":e.unref(T),"98a0e762":e.unref(I)}));const t=7,d=s=>{s.type==="button"&&!s.active&&_("updatePage",s.page)},b=e.computed(()=>{const s=[];if(r.maxPaginationNumber<=t)for(let l=1;l<=r.maxPaginationNumber;l+=1)s.push({type:"button",page:l,active:l===r.currentPaginationNumber});else if([1,2,r.maxPaginationNumber,r.maxPaginationNumber-1].includes(r.currentPaginationNumber))for(let l=1;l<=t;l+=1)if(l<=3)s.push({type:"button",page:l,active:l===r.currentPaginationNumber});else if(l===4)s.push({type:"omission"});else{const p=r.maxPaginationNumber-(t-l);s.push({type:"button",page:p,active:p===r.currentPaginationNumber})}else if([3,4].includes(r.currentPaginationNumber))for(let l=1;l<=t;l+=1)l<=5?s.push({type:"button",page:l,active:l===r.currentPaginationNumber}):l===6?s.push({type:"omission"}):s.push({type:"button",page:r.maxPaginationNumber,active:r.maxPaginationNumber===r.currentPaginationNumber});else if([r.maxPaginationNumber-2,r.maxPaginationNumber-3].includes(r.currentPaginationNumber))for(let l=1;l<=t;l+=1)if(l===1)s.push({type:"button",page:1,active:r.currentPaginationNumber===1});else if(l===2)s.push({type:"omission"});else{const p=r.maxPaginationNumber-(t-l);s.push({type:"button",page:p,active:p===r.currentPaginationNumber})}else for(let l=1;l<=t;l+=1)if(l===1)s.push({type:"button",page:1,active:r.currentPaginationNumber===1});else if(l===2||l===6)s.push({type:"omission"});else if(l===7)s.push({type:"button",page:r.maxPaginationNumber,active:r.maxPaginationNumber===r.currentPaginationNumber});else{const p=4-l,m=r.currentPaginationNumber-p;s.push({type:"button",page:m,active:m===r.currentPaginationNumber})}return s}),B=e.inject("rowHeight"),E=e.computed(()=>`${B*.6}px`),T=e.inject("rowBorderColor"),I=e.inject("themeColor");return(s,l)=>(e.openBlock(),e.createElementBlock("div",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),(p,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:e.normalizeClass(["item",{button:p.type==="button",active:p.type==="button"&&p.active,omission:p.type==="omission"}]),onClick:C=>d(p)},e.toDisplayString(p.type==="button"?p.page:"..."),11,Ne))),128))]))}}),[["__scopeId","data-v-4f534e20"]]),xt="";const U=n=>(e.pushScopeId("data-v-c9da5286"),n=n(),e.popScopeId(),n),$e=[U(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],Ee=[U(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var Ie=u(e.defineComponent({props:{isFirstPage:{type:Boolean,required:!1},isLastPage:{type:Boolean,required:!1}},emits:["clickPrevPage","clickNextPage"],setup(n,{emit:_}){const r=e.useSlots();return(t,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["previous-page__click-button",{"first-page":n.isFirstPage}]),onClick:d[0]||(d[0]=b=>_("clickPrevPage"))},$e,2),e.unref(r).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":n.isLastPage}]),onClick:d[1]||(d[1]=b=>_("clickNextPage"))},Ee,2)],64))}}),[["__scopeId","data-v-c9da5286"]]),Pt="";const Ve={key:0},Fe=["onClick"],Te={key:1,class:"header-text__wrapper"},ze={class:"header-text"},He={class:"loading-entity"},Le={key:1,class:"data-table__message"},Oe={key:0,class:"data-table__footer"},De={class:"footer__rows-per-page"},Re=e.createTextVNode(" rows per page: "),je={class:"footer__items-index"};var Me=u(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},maxHeight:{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}},emits:["update:itemsSelected","update:serverOptions"],setup(n,{expose:_,emit:r}){const t=n;e.useCssVars(o=>({ec4464fc:e.unref(b),fc52e04c:e.unref(qe),"5b1bc799":e.unref(Ke),"320dce50":e.unref(Ae),"81c6851e":e.unref(h),"1291c3b3":e.unref(E),"0b89eaf4":e.unref(l),"3e0c6236":e.unref(d),"100ad98e":e.unref(B),"6e13f08f":n.headerBackgroundColor,"5ba5fd33":e.unref(Je),"6d04ce94":e.unref(We),"0f3615d4":e.unref(Ue),af62e58c:e.unref(T),"3ef71279":e.unref(I),"4aac3d6d":e.unref(m),ed269da4:e.unref(p),"2cb8407e":e.unref(s),"957ad380":e.unref(C)}));const{rowBorderColor:d,tableBorderColor:b,headerFontColor:B,rowFontColor:E,rowHoverBackgroundColor:T,rowHoverFontColor:I,footerBackgroundColor:s,rowBackgroundColor:l,evenRowBackgroundColor:p,evenRowFontColor:m,footerFontColor:C}=e.toRefs(t),h=e.computed(()=>`${t.tableFontSize}px`),V=e.computed(()=>t.tableFontSize*(t.dense?2:3)),Ae=e.computed(()=>`${V.value}px`),qe=e.computed(()=>t.maxHeight?`${t.maxHeight}px`:null),G=e.computed(()=>Math.round(t.tableFontSize/2.5)),Je=e.computed(()=>`${G.value}px`),K=e.computed(()=>Math.round(G.value)),We=e.computed(()=>`-${K.value}px`),Ue=e.computed(()=>`${K.value}px`),Ge=e.computed(()=>`${t.tableFontSize*5}px`),Ke=e.computed(()=>t.maxHeight?`${t.maxHeight-V.value}px`:`${t.tableFontSize*5*2}px`);e.provide("themeColor",t.themeColor),e.provide("loadingEntitySizePx",Ge.value),e.provide("rowHeight",V.value),e.provide("rowBorderColor",d.value),e.provide("footerBackgroundColor",s.value),e.provide("footerFontColor",C.value);const H=e.useSlots(),Qe=e.computed(()=>H.body),Xe=e.computed(()=>H.pagination),Ye=e.computed(()=>H.loading),Q=e.ref();e.provide("dataTable",Q);const k=e.computed({get:()=>{if(t.serverOptions){const{page:o,rowsPerPage:c,sortBy:a,sortType:i}=t.serverOptions;return{page:o,rowsPerPage:c,sortBy:a!=null?a:null,sortType:i!=null?i:null}}return{page:1,rowsPerPage:25,sortBy:null,sortType:null}},set:o=>{r("update:serverOptions",o)}}),X=e.computed(()=>t.itemsSelected!==null),y=e.computed(()=>t.serverOptions!==null),Ze=()=>t.sortBy!==""?{sortBy:t.sortBy,sortDesc:t.sortType==="desc"}:null,w=e.ref(Ze()),A=e.computed(()=>{const o=t.headers.map(i=>{const S=i;return i.sortable&&(S.sortType="none"),y.value&&i.value===k.value.sortBy&&k.value.sortType&&(S.sortType=k.value.sortType),!y.value&&w.value&&i.value===w.value.sortBy&&(S.sortType=w.value.sortDesc?"desc":"asc"),S}),c=t.showIndex?[{text:"#",value:"index"},...o]:o;return X.value?[{text:"checkbox",value:"checkbox"},...c]:c}),Y=e.computed(()=>A.value.map(o=>o.value)),N=e.computed({get:()=>{var o;return(o=t.itemsSelected)!=null?o:[]},set:o=>{r("update:itemsSelected",o)}}),L=e.computed(()=>N.value.length===0?"noneSelected":N.value.length===t.items.length?"allSelected":"partSelected"),O=e.computed(()=>{if(!y.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}),g=e.ref(y.value?t.serverOptions.page:1),P=e.ref(y.value?t.serverOptions.rowsPerPage:t.rowsPerPage);e.watch(P,o=>{y.value&&(k.value=F(x({},k.value),{page:1,rowsPerPage:o})),g.value=1});const ve=(o,c)=>{let a=null;c==="none"?a="asc":c==="asc"?a="desc":a=null,y.value?k.value=F(x({},k.value),{sortBy:a!==null?o:null,sortType:a}):a===null?w.value=null:w.value={sortBy:o,sortDesc:a==="desc"}},Z=e.computed(()=>{if(y.value)return t.items;if(w.value===null)return O.value;const{sortBy:o,sortDesc:c}=w.value;return[...O.value].sort((i,S)=>i[o]<S[o]?c?1:-1:i[o]>S[o]?c?-1:1:0)}),q=e.computed(()=>y.value?t.serverItemsLength:O.value.length),v=e.computed(()=>y.value?g.value*P.value:Math.min(O.value.length,g.value*P.value)),ee=e.computed(()=>(g.value-1)*P.value+1),D=e.computed(()=>Math.ceil(q.value/P.value)),R=e.computed(()=>g.value===D.value),j=e.computed(()=>g.value===1),{loading:$}=e.toRefs(t),J=()=>{if(!R.value&&!$.value)if(y.value){const o=g.value+1;k.value=F(x({},k.value),{page:o})}else g.value+=1},W=()=>{if(!j.value&&!$.value)if(y.value){const o=g.value-1;k.value=F(x({},k.value),{page:o})}else g.value-=1},te=o=>{$.value||(y.value?k.value=F(x({},k.value),{page:o}):g.value=o)};e.watch($,(o,c)=>{y.value&&o===!1&&c===!0&&(g.value=k.value.page)});const oe=e.computed(()=>y.value?t.items:Z.value.slice(ee.value-1,v.value)),ne=e.computed(()=>P.value*(g.value-1)+1),et=e.computed(()=>P.value*g.value),M=e.computed(()=>t.showIndex?oe.value.map((o,c)=>x({index:ne.value+c},o)):oe.value),ae=e.computed(()=>X.value?L.value==="allSelected"?M.value.map(o=>x({checkbox:!0},o)):L.value==="noneSelected"?M.value.map(o=>x({checkbox:!1},o)):M.value.map(o=>{const c=N.value.findIndex(a=>{const i=x({},o);return delete i.index,JSON.stringify(a)===JSON.stringify(i)})!==-1;return x({checkbox:c},o)}):M.value),tt=o=>{N.value=o?Z.value:[]},ot=o=>{const c=o.checkbox;if(delete o.checkbox,delete o.index,c)N.value=N.value.filter(a=>JSON.stringify(a)!==JSON.stringify(o));else{const a=N.value;a.unshift(o),N.value=a}};return _({clientItemsLength:q,currentPageFirstIndex:ne,currentPageLastIndex:et,maxPaginationNumber:D,currentPaginationNumber:g,isLastPage:R,isFirstPage:j,nextPage:J,prevPage:W,updatePage:te}),(o,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataTable",ref:Q,class:"vue3-easy-data-table"},[e.createElementVNode("div",{class:e.normalizeClass(["data-table__body",{"fixed-header":n.fixedHeader,"max-height":n.maxHeight}])},[e.createElementVNode("table",null,[e.unref(A).length?(e.openBlock(),e.createElementBlock("thead",Ve,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(A),(a,i)=>(e.openBlock(),e.createElementBlock("th",{key:i,class:e.normalizeClass({sortable:a.sortable,none:a.sortable&&a.sortType==="none",desc:a.sortable&&a.sortType==="desc",asc:a.sortable&&a.sortType==="asc"}),onClick:S=>a.sortable&&a.sortType?ve(a.value,a.sortType):null},[a.text==="checkbox"?(e.openBlock(),e.createBlock(pe,{key:e.unref(L),status:e.unref(L),onChange:tt},null,8,["status"])):(e.openBlock(),e.createElementBlock("span",Te,[e.createElementVNode("span",ze,e.toDisplayString(a.text),1),a.sortable?(e.openBlock(),e.createElementBlock("i",{key:a.sortType?a.sortType:"none",class:e.normalizeClass(["sortType-icon",{desc:a.sortType==="desc"}])},null,2)):e.createCommentVNode("",!0)]))],10,Fe))),128))])])):e.createCommentVNode("",!0),e.unref(Qe)?e.renderSlot(o.$slots,"body",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n.items.length&&e.unref(Y).length?(e.openBlock(),e.createElementBlock("tbody",{key:0,class:e.normalizeClass({"row-alternation":n.alternating,"hover-to-change-color":n.hoverToChangeColor})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ae),a=>(e.openBlock(),e.createElementBlock("tr",{key:JSON.stringify(a)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Y),(i,S)=>(e.openBlock(),e.createElementBlock("td",{key:S},[e.unref(H)[i]?e.renderSlot(o.$slots,i,e.normalizeProps(e.mergeProps({key:0},a)),void 0,!0):i==="checkbox"?(e.openBlock(),e.createBlock(ge,{key:1,checked:a[i],onChange:wt=>ot(a)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(Array.isArray(a[i])?a[i].join(","):a[i]),1)],64))]))),128))]))),128))],2)):e.createCommentVNode("",!0)],64))]),e.unref($)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["loading-wrapper",{"initial-loading":!n.items.length&&e.unref($)}])},[e.createElementVNode("div",{class:e.normalizeClass(["loading-mask",{"no-footer":!n.showFooter}])},null,2),e.createElementVNode("div",He,[e.unref(Ye)?e.renderSlot(o.$slots,"loading",{key:0},void 0,!0):(e.openBlock(),e.createBlock(Be,{key:1}))])],2)):e.createCommentVNode("",!0),!e.unref(ae).length&&!e.unref($)?(e.openBlock(),e.createElementBlock("div",Le,e.toDisplayString(n.emptyMessage),1)):e.createCommentVNode("",!0)],2),n.showFooter?(e.openBlock(),e.createElementBlock("div",Oe,[e.createElementVNode("div",De,[Re,e.createVNode(xe,{modelValue:P.value,"onUpdate:modelValue":c[0]||(c[0]=a=>P.value=a),"rows-items":n.rowsItems},null,8,["modelValue","rows-items"])]),e.createElementVNode("div",je,e.toDisplayString(`${e.unref(ee)}-${e.unref(v)}`)+" of "+e.toDisplayString(e.unref(q)),1),e.unref(Xe)?e.renderSlot(o.$slots,"pagination",e.normalizeProps(e.mergeProps({key:0},{isFirstPage:e.unref(j),isLastPage:e.unref(R),currentPaginationNumber:g.value,maxPaginationNumber:e.unref(D),nextPage:J,prevPage:W})),void 0,!0):(e.openBlock(),e.createBlock(Ie,{key:1,"is-first-page":e.unref(j),"is-last-page":e.unref(R),onClickNextPage:J,onClickPrevPage:W},e.createSlots({_:2},[n.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(we,{"current-pagination-number":g.value,"max-pagination-number":e.unref(D),onUpdatePage:te},null,8,["current-pagination-number","max-pagination-number"])])}:void 0]),1032,["is-first-page","is-last-page"]))])):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-2b5862d8"]]);return Me}); | ||
(function(e,f){typeof exports=="object"&&typeof module!="undefined"?module.exports=f(require("vue")):typeof define=="function"&&define.amd?define(["vue"],f):(e=typeof globalThis!="undefined"?globalThis:e||self,e["vue3-easy-data-table"]=f(e.Vue))})(this,function(e){"use strict";var at=Object.defineProperty,rt=Object.defineProperties;var lt=Object.getOwnPropertyDescriptors;var re=Object.getOwnPropertySymbols;var st=Object.prototype.hasOwnProperty,ct=Object.prototype.propertyIsEnumerable;var le=(e,f,u)=>f in e?at(e,f,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[f]=u,C=(e,f)=>{for(var u in f||(f={}))st.call(f,u)&&le(e,u,f[u]);if(re)for(var u of re(f))ct.call(f,u)&&le(e,u,f[u]);return e},F=(e,f)=>rt(e,lt(f));var f="",u=(n,_)=>{const r=n.__vccOpts||n;for(const[t,d]of _)r[t]=d;return r};const se=n=>(e.pushScopeId("data-v-566775ba"),n=n(),e.popScopeId(),n),ce=["onClick"],ie=["checked"],de=se(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var pe=u(e.defineComponent({props:{status:{type:String,required:!0}},emits:["change"],setup(n,{emit:_}){const r=n;e.useCssVars(B=>({"7f84b28f":e.unref(k)}));const t=e.computed(()=>r.status==="allSelected"),d=()=>{_("change",!t.value)},k=e.inject("themeColor");return(B,I)=>(e.openBlock(),e.createElementBlock("div",{class:"multi-select__checkbox",onClick:e.withModifiers(d,["stop","prevent"])},[e.createElementVNode("input",{type:"checkbox",checked:e.unref(t),class:e.normalizeClass(n.status)},null,10,ie),de],8,ce))}}),[["__scopeId","data-v-566775ba"]]),dt="";const ue=n=>(e.pushScopeId("data-v-39f156fd"),n=n(),e.popScopeId(),n),me=["checked"],fe=ue(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var ge=u(e.defineComponent({props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(n,{emit:_}){e.useCssVars(t=>({"20cfc5a0":e.unref(r)}));const r=e.inject("themeColor");return(t,d)=>(e.openBlock(),e.createElementBlock("div",{class:"single-select__checkbox",onClick:d[0]||(d[0]=e.withModifiers(k=>_("change"),["stop","prevent"]))},[e.createElementVNode("input",{type:"checkbox",checked:n.checked},null,8,me),fe]))}}),[["__scopeId","data-v-39f156fd"]]),ut="";const _e=n=>(e.pushScopeId("data-v-0ed08e20"),n=n(),e.popScopeId(),n),he={class:"easy-data-table__rows-selector"},ye={class:"rows-input"},be=_e(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),ke=["onClick"];var Ce=u(e.defineComponent({props:{modelValue:{type:Number,required:!0},rowsItems:{type:Array,required:!0}},emits:["update:modelValue"],setup(n,{emit:_}){const r=n;e.useCssVars(m=>({"83c11052":e.unref(p),"6b60f418":e.unref(l),"346ac97c":e.unref(s)}));const t=e.ref(!1),d=e.ref(!1),k=e.inject("dataTable");e.watch(t,m=>{if(m&&k){const x=window.innerHeight,h=k.value.getBoundingClientRect().height,w=k.value.getBoundingClientRect().top;x-(h+w)<=100?d.value=!0:d.value=!1}});const B=e.computed({get:()=>r.modelValue,set:m=>{_("update:modelValue",m)}}),I=m=>{B.value=m,t.value=!1},T=(m,x)=>{let h=m.parentNode;for(;h!=null;){if(h.classList&&h.classList.contains(x))return!0;h=h.parentNode}return!1},V=m=>{T(m.target,"easy-data-table__rows-selector")||(t.value=!1)};e.onMounted(()=>{document.addEventListener("click",V)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",V)});const s=e.inject("themeColor"),l=e.inject("footerBackgroundColor"),p=e.inject("footerFontColor");return(m,x)=>(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:x[0]||(x[0]=h=>t.value=!t.value)},[e.createElementVNode("div",ye,e.toDisplayString(e.unref(B)),1),be]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:t.value,inside:d.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rowsItems,h=>(e.openBlock(),e.createElementBlock("li",{key:h,class:e.normalizeClass({selected:h===e.unref(B)}),onClick:w=>I(h)},e.toDisplayString(h),11,ke))),128))],2)]))}}),[["__scopeId","data-v-0ed08e20"]]),ft="";const z=n=>(e.pushScopeId("data-v-969989cc"),n=n(),e.popScopeId(),n),xe={class:"lds-ring"},Se=[z(()=>e.createElementVNode("div",null,null,-1)),z(()=>e.createElementVNode("div",null,null,-1)),z(()=>e.createElementVNode("div",null,null,-1)),z(()=>e.createElementVNode("div",null,null,-1))];var Be=u(e.defineComponent({setup(n){e.useCssVars(t=>({"284c10f4":e.unref(r),"90c4d0a4":e.unref(_)}));const _=e.inject("themeColor"),r=e.inject("loadingEntitySizePx");return(t,d)=>(e.openBlock(),e.createElementBlock("div",xe,Se))}}),[["__scopeId","data-v-969989cc"]]),kt="";const Pe={class:"buttons-pagination"},Ne=["onClick"];var we=u(e.defineComponent({props:{maxPaginationNumber:{type:Number,required:!0},currentPaginationNumber:{type:Number,required:!0}},emits:["updatePage"],setup(n,{emit:_}){const r=n;e.useCssVars(s=>({aa5730a0:e.unref(I),"24829312":e.unref(T),"98a0e762":e.unref(V)}));const t=7,d=s=>{s.type==="button"&&!s.active&&_("updatePage",s.page)},k=e.computed(()=>{const s=[];if(r.maxPaginationNumber<=t)for(let l=1;l<=r.maxPaginationNumber;l+=1)s.push({type:"button",page:l,active:l===r.currentPaginationNumber});else if([1,2,r.maxPaginationNumber,r.maxPaginationNumber-1].includes(r.currentPaginationNumber))for(let l=1;l<=t;l+=1)if(l<=3)s.push({type:"button",page:l,active:l===r.currentPaginationNumber});else if(l===4)s.push({type:"omission"});else{const p=r.maxPaginationNumber-(t-l);s.push({type:"button",page:p,active:p===r.currentPaginationNumber})}else if([3,4].includes(r.currentPaginationNumber))for(let l=1;l<=t;l+=1)l<=5?s.push({type:"button",page:l,active:l===r.currentPaginationNumber}):l===6?s.push({type:"omission"}):s.push({type:"button",page:r.maxPaginationNumber,active:r.maxPaginationNumber===r.currentPaginationNumber});else if([r.maxPaginationNumber-2,r.maxPaginationNumber-3].includes(r.currentPaginationNumber))for(let l=1;l<=t;l+=1)if(l===1)s.push({type:"button",page:1,active:r.currentPaginationNumber===1});else if(l===2)s.push({type:"omission"});else{const p=r.maxPaginationNumber-(t-l);s.push({type:"button",page:p,active:p===r.currentPaginationNumber})}else for(let l=1;l<=t;l+=1)if(l===1)s.push({type:"button",page:1,active:r.currentPaginationNumber===1});else if(l===2||l===6)s.push({type:"omission"});else if(l===7)s.push({type:"button",page:r.maxPaginationNumber,active:r.maxPaginationNumber===r.currentPaginationNumber});else{const p=4-l,m=r.currentPaginationNumber-p;s.push({type:"button",page:m,active:m===r.currentPaginationNumber})}return s}),B=e.inject("rowHeight"),I=e.computed(()=>`${B*.6}px`),T=e.inject("rowBorderColor"),V=e.inject("themeColor");return(s,l)=>(e.openBlock(),e.createElementBlock("div",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(k),(p,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:e.normalizeClass(["item",{button:p.type==="button",active:p.type==="button"&&p.active,omission:p.type==="omission"}]),onClick:x=>d(p)},e.toDisplayString(p.type==="button"?p.page:"..."),11,Ne))),128))]))}}),[["__scopeId","data-v-4f534e20"]]),xt="";const U=n=>(e.pushScopeId("data-v-c9da5286"),n=n(),e.popScopeId(),n),$e=[U(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],Ee=[U(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var Ie=u(e.defineComponent({props:{isFirstPage:{type:Boolean,required:!1},isLastPage:{type:Boolean,required:!1}},emits:["clickPrevPage","clickNextPage"],setup(n,{emit:_}){const r=e.useSlots();return(t,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["previous-page__click-button",{"first-page":n.isFirstPage}]),onClick:d[0]||(d[0]=k=>_("clickPrevPage"))},$e,2),e.unref(r).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":n.isLastPage}]),onClick:d[1]||(d[1]=k=>_("clickNextPage"))},Ee,2)],64))}}),[["__scopeId","data-v-c9da5286"]]),Nt="";const Ve={key:0},Fe=["onClick"],Te={key:1,class:"header-text__wrapper"},ze={class:"header-text"},He={class:"loading-entity"},Le={key:1,class:"data-table__message"},Oe={key:0,class:"data-table__footer"},De={class:"footer__rows-per-page"},Re=e.createTextVNode(" rows per page: "),je={class:"footer__items-index"};var Me=u(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}},emits:["update:itemsSelected","update:serverOptions"],setup(n,{expose:_,emit:r}){const t=n;e.useCssVars(o=>({"35415a6e":e.unref(k),"5ac9cd21":e.unref(Je),ab3842c6:e.unref(qe),"643b5160":e.unref(Qe),"3361d8a9":e.unref(Ae),b33cf810:e.unref(h),"3bbf047a":e.unref(I),e6818b0a:e.unref(l),"5e26e586":e.unref(d),"4d9fe132":e.unref(B),ee34c0b0:n.headerBackgroundColor,"4649668c":e.unref(We),d7eb1d86:e.unref(Ue),d37763a6:e.unref(Ge),"5570da13":e.unref(T),"53a63612":e.unref(V),b3a47a98:e.unref(m),"6e5e3596":e.unref(p),"04758eda":e.unref(s),"7e67cc19":e.unref(x)}));const{rowBorderColor:d,tableBorderColor:k,headerFontColor:B,rowFontColor:I,rowHoverBackgroundColor:T,rowHoverFontColor:V,footerBackgroundColor:s,rowBackgroundColor:l,evenRowBackgroundColor:p,evenRowFontColor:m,footerFontColor:x}=e.toRefs(t),h=e.computed(()=>`${t.tableFontSize}px`),w=e.computed(()=>t.tableFontSize*(t.dense?2:3)),Ae=e.computed(()=>`${w.value}px`),qe=e.computed(()=>t.tableHeight?`${t.tableHeight}px`:null),Je=e.computed(()=>`${w.value*5}px`),G=e.computed(()=>Math.round(t.tableFontSize/2.5)),We=e.computed(()=>`${G.value}px`),K=e.computed(()=>Math.round(G.value)),Ue=e.computed(()=>`-${K.value}px`),Ge=e.computed(()=>`${K.value}px`),Ke=e.computed(()=>`${t.tableFontSize*5}px`),Qe=e.computed(()=>t.tableHeight?`${t.tableHeight-w.value}px`:`${t.tableFontSize*5*2}px`);e.provide("themeColor",t.themeColor),e.provide("loadingEntitySizePx",Ke.value),e.provide("rowHeight",w.value),e.provide("rowBorderColor",d.value),e.provide("footerBackgroundColor",s.value),e.provide("footerFontColor",x.value);const H=e.useSlots(),Xe=e.computed(()=>H.body),Ye=e.computed(()=>H.pagination),Ze=e.computed(()=>H.loading),Q=e.ref();e.provide("dataTable",Q);const b=e.computed({get:()=>{if(t.serverOptions){const{page:o,rowsPerPage:c,sortBy:a,sortType:i}=t.serverOptions;return{page:o,rowsPerPage:c,sortBy:a!=null?a:null,sortType:i!=null?i:null}}return{page:1,rowsPerPage:25,sortBy:null,sortType:null}},set:o=>{r("update:serverOptions",o)}}),X=e.computed(()=>t.itemsSelected!==null),y=e.computed(()=>t.serverOptions!==null),ve=()=>t.sortBy!==""?{sortBy:t.sortBy,sortDesc:t.sortType==="desc"}:null,$=e.ref(ve()),A=e.computed(()=>{const o=t.headers.map(i=>{const S=i;return i.sortable&&(S.sortType="none"),y.value&&i.value===b.value.sortBy&&b.value.sortType&&(S.sortType=b.value.sortType),!y.value&&$.value&&i.value===$.value.sortBy&&(S.sortType=$.value.sortDesc?"desc":"asc"),S}),c=t.showIndex?[{text:"#",value:"index"},...o]:o;return X.value?[{text:"checkbox",value:"checkbox"},...c]:c}),Y=e.computed(()=>A.value.map(o=>o.value)),N=e.computed({get:()=>{var o;return(o=t.itemsSelected)!=null?o:[]},set:o=>{r("update:itemsSelected",o)}}),L=e.computed(()=>N.value.length===0?"noneSelected":N.value.length===t.items.length?"allSelected":"partSelected"),O=e.computed(()=>{if(!y.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}),g=e.ref(y.value?t.serverOptions.page:1),P=e.ref(y.value?t.serverOptions.rowsPerPage:t.rowsPerPage);e.watch(P,o=>{y.value&&(b.value=F(C({},b.value),{page:1,rowsPerPage:o})),g.value=1});const et=(o,c)=>{let a=null;c==="none"?a="asc":c==="asc"?a="desc":a=null,y.value?b.value=F(C({},b.value),{sortBy:a!==null?o:null,sortType:a}):a===null?$.value=null:$.value={sortBy:o,sortDesc:a==="desc"}},Z=e.computed(()=>{if(y.value)return t.items;if($.value===null)return O.value;const{sortBy:o,sortDesc:c}=$.value;return[...O.value].sort((i,S)=>i[o]<S[o]?c?1:-1:i[o]>S[o]?c?-1:1:0)}),q=e.computed(()=>y.value?t.serverItemsLength:O.value.length),v=e.computed(()=>y.value?g.value*P.value:Math.min(O.value.length,g.value*P.value)),ee=e.computed(()=>(g.value-1)*P.value+1),D=e.computed(()=>Math.ceil(q.value/P.value)),R=e.computed(()=>g.value===D.value),j=e.computed(()=>g.value===1),{loading:E}=e.toRefs(t),J=()=>{if(!R.value&&!E.value)if(y.value){const o=g.value+1;b.value=F(C({},b.value),{page:o})}else g.value+=1},W=()=>{if(!j.value&&!E.value)if(y.value){const o=g.value-1;b.value=F(C({},b.value),{page:o})}else g.value-=1},te=o=>{E.value||(y.value?b.value=F(C({},b.value),{page:o}):g.value=o)};e.watch(E,(o,c)=>{y.value&&o===!1&&c===!0&&(g.value=b.value.page)});const oe=e.computed(()=>y.value?t.items:Z.value.slice(ee.value-1,v.value)),ne=e.computed(()=>P.value*(g.value-1)+1),tt=e.computed(()=>P.value*g.value),M=e.computed(()=>t.showIndex?oe.value.map((o,c)=>C({index:ne.value+c},o)):oe.value),ae=e.computed(()=>X.value?L.value==="allSelected"?M.value.map(o=>C({checkbox:!0},o)):L.value==="noneSelected"?M.value.map(o=>C({checkbox:!1},o)):M.value.map(o=>{const c=N.value.findIndex(a=>{const i=C({},o);return delete i.index,JSON.stringify(a)===JSON.stringify(i)})!==-1;return C({checkbox:c},o)}):M.value),ot=o=>{N.value=o?Z.value:[]},nt=o=>{const c=o.checkbox;if(delete o.checkbox,delete o.index,c)N.value=N.value.filter(a=>JSON.stringify(a)!==JSON.stringify(o));else{const a=N.value;a.unshift(o),N.value=a}};return _({clientItemsLength:q,currentPageFirstIndex:ne,currentPageLastIndex:tt,maxPaginationNumber:D,currentPaginationNumber:g,isLastPage:R,isFirstPage:j,nextPage:J,prevPage:W,updatePage:te}),(o,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataTable",ref:Q,class:"vue3-easy-data-table"},[e.createElementVNode("div",{class:e.normalizeClass(["data-table__body",{"fixed-header":n.fixedHeader,"fixed-height":n.tableHeight}])},[e.createElementVNode("table",null,[e.unref(A).length?(e.openBlock(),e.createElementBlock("thead",Ve,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(A),(a,i)=>(e.openBlock(),e.createElementBlock("th",{key:i,class:e.normalizeClass({sortable:a.sortable,none:a.sortable&&a.sortType==="none",desc:a.sortable&&a.sortType==="desc",asc:a.sortable&&a.sortType==="asc"}),onClick:S=>a.sortable&&a.sortType?et(a.value,a.sortType):null},[a.text==="checkbox"?(e.openBlock(),e.createBlock(pe,{key:e.unref(L),status:e.unref(L),onChange:ot},null,8,["status"])):(e.openBlock(),e.createElementBlock("span",Te,[e.createElementVNode("span",ze,e.toDisplayString(a.text),1),a.sortable?(e.openBlock(),e.createElementBlock("i",{key:a.sortType?a.sortType:"none",class:e.normalizeClass(["sortType-icon",{desc:a.sortType==="desc"}])},null,2)):e.createCommentVNode("",!0)]))],10,Fe))),128))])])):e.createCommentVNode("",!0),e.unref(Xe)?e.renderSlot(o.$slots,"body",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n.items.length&&e.unref(Y).length?(e.openBlock(),e.createElementBlock("tbody",{key:0,class:e.normalizeClass({"row-alternation":n.alternating,"hover-to-change-color":n.hoverToChangeColor})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ae),a=>(e.openBlock(),e.createElementBlock("tr",{key:JSON.stringify(a)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Y),(i,S)=>(e.openBlock(),e.createElementBlock("td",{key:S},[e.unref(H)[i]?e.renderSlot(o.$slots,i,e.normalizeProps(e.mergeProps({key:0},a)),void 0,!0):i==="checkbox"?(e.openBlock(),e.createBlock(ge,{key:1,checked:a[i],onChange:$t=>nt(a)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(Array.isArray(a[i])?a[i].join(","):a[i]),1)],64))]))),128))]))),128))],2)):e.createCommentVNode("",!0)],64))]),e.unref(E)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["loading-wrapper",{"initial-loading":!n.items.length&&e.unref(E)}])},[e.createElementVNode("div",{class:e.normalizeClass(["loading-mask",{"no-footer":!n.showFooter}])},null,2),e.createElementVNode("div",He,[e.unref(Ze)?e.renderSlot(o.$slots,"loading",{key:0},void 0,!0):(e.openBlock(),e.createBlock(Be,{key:1}))])],2)):e.createCommentVNode("",!0),!e.unref(ae).length&&!e.unref(E)?(e.openBlock(),e.createElementBlock("div",Le,e.toDisplayString(n.emptyMessage),1)):e.createCommentVNode("",!0)],2),n.showFooter?(e.openBlock(),e.createElementBlock("div",Oe,[e.createElementVNode("div",De,[Re,e.createVNode(Ce,{modelValue:P.value,"onUpdate:modelValue":c[0]||(c[0]=a=>P.value=a),"rows-items":n.rowsItems},null,8,["modelValue","rows-items"])]),e.createElementVNode("div",je,e.toDisplayString(`${e.unref(ee)}-${e.unref(v)}`)+" of "+e.toDisplayString(e.unref(q)),1),e.unref(Ye)?e.renderSlot(o.$slots,"pagination",e.normalizeProps(e.mergeProps({key:0},{isFirstPage:e.unref(j),isLastPage:e.unref(R),currentPaginationNumber:g.value,maxPaginationNumber:e.unref(D),nextPage:J,prevPage:W})),void 0,!0):(e.openBlock(),e.createBlock(Ie,{key:1,"is-first-page":e.unref(j),"is-last-page":e.unref(R),onClickNextPage:J,onClickPrevPage:W},e.createSlots({_:2},[n.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(we,{"current-pagination-number":g.value,"max-pagination-number":e.unref(D),onUpdatePage:te},null,8,["current-pagination-number","max-pagination-number"])])}:void 0]),1032,["is-first-page","is-last-page"]))])):e.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-365c0f25"]]);return Me}); |
{ | ||
"name": "vue3-easy-data-table", | ||
"author": "HC200ok", | ||
"description": "A data table component made with vue.js 3.x", | ||
"description": "A customizable and easy-to-use data table component made with Vue.js 3.x.", | ||
"private": false, | ||
"version": "1.1.22", | ||
"version": "1.1.23", | ||
"types": "./types/main.d.ts", | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
@@ -23,4 +23,4 @@ <p align="center"> | ||
9. [Loading slot](https://hc200ok.github.io/vue3-easy-data-table-doc/features/loading-slot.html) | ||
10. [Footer customization](https://hc200ok.github.io/vue3-easy-data-table-doc/features/footer-customization.html) | ||
## Getting started | ||
@@ -27,0 +27,0 @@ ### Install |
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
75450
1122