vue3-easy-data-table
Advanced tools
Comparing version 1.5.12 to 1.5.13
@@ -406,4 +406,6 @@ var __defProp = Object.defineProperty; | ||
var PaginationArrows = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-c9da5286"]]); | ||
function useClickRow(isMultipleSelectable, showIndex, emits) { | ||
const clickRow = (item) => { | ||
function useClickRow(clickEventType, isMultipleSelectable, showIndex, emits) { | ||
const clickRow = (item, clickType) => { | ||
if (clickEventType.value !== clickType) | ||
return; | ||
const clickRowArgument = __spreadValues({}, item); | ||
@@ -1172,2 +1174,6 @@ if (isMultipleSelectable.value) { | ||
default: "of" | ||
}, | ||
clickEventType: { | ||
type: String, | ||
default: "single" | ||
} | ||
@@ -1177,3 +1183,3 @@ }; | ||
var DataTable_vue_vue_type_style_index_1_scoped_true_lang = ""; | ||
const _withScopeId = (n) => (pushScopeId("data-v-0a021d30"), n = n(), popScopeId(), n); | ||
const _withScopeId = (n) => (pushScopeId("data-v-9d7294d0"), n = n(), popScopeId(), n); | ||
const _hoisted_1 = ["onClick"]; | ||
@@ -1188,3 +1194,3 @@ const _hoisted_2 = { | ||
}; | ||
const _hoisted_4 = ["onClick"]; | ||
const _hoisted_4 = ["onClick", "onDblclick"]; | ||
const _hoisted_5 = ["onClick"]; | ||
@@ -1233,6 +1239,7 @@ const _hoisted_6 = ["colspan"]; | ||
useCssVars((_ctx) => ({ | ||
"674340a8": unref(tableMinHeightPx), | ||
"46946bc4": unref(tableHeightPx) | ||
"fc9c1b54": unref(tableMinHeightPx), | ||
"7b77e95a": unref(tableHeightPx) | ||
})); | ||
const { | ||
clickEventType, | ||
bodyTextDirection, | ||
@@ -1347,3 +1354,3 @@ checkboxColumnWidth, | ||
clickRow | ||
} = useClickRow(isMultipleSelectable, showIndex, emits); | ||
} = useClickRow(clickEventType, isMultipleSelectable, showIndex, emits); | ||
const getColStyle = (header) => { | ||
@@ -1490,3 +1497,4 @@ var _a; | ||
]), | ||
onClick: ($event) => unref(clickRow)(item) | ||
onClick: ($event) => unref(clickRow)(item, "single"), | ||
onDblclick: ($event) => unref(clickRow)(item, "double") | ||
}, [ | ||
@@ -1515,3 +1523,3 @@ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(headerColumns), (column, i) => { | ||
}), 128)) | ||
], 10, _hoisted_4), | ||
], 42, _hoisted_4), | ||
unref(ifHasExpandSlot) && unref(expandingItemIndexList).includes(index + unref(prevPageEndIndex)) ? (openBlock(), createElementBlock("tr", { | ||
@@ -1599,3 +1607,3 @@ key: 0, | ||
}); | ||
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0a021d30"]]); | ||
var DataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9d7294d0"]]); | ||
if (typeof window !== "undefined" && window.Vue) { | ||
@@ -1602,0 +1610,0 @@ window.Vue.createApp({}).component("Vue3EasyDataTable", DataTable); |
@@ -1,1 +0,1 @@ | ||
(function(e,w){typeof exports=="object"&&typeof module!="undefined"?module.exports=w(require("vue")):typeof define=="function"&&define.amd?define(["vue"],w):(e=typeof globalThis!="undefined"?globalThis:e||self,e["vue3-easy-data-table"]=w(e.Vue))})(this,function(e){"use strict";var Gt=Object.defineProperty,Kt=Object.defineProperties;var Qt=Object.getOwnPropertyDescriptors;var Ee=Object.getOwnPropertySymbols;var Xt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable;var $e=(e,w,S)=>w in e?Gt(e,w,{enumerable:!0,configurable:!0,writable:!0,value:S}):e[w]=S,H=(e,w)=>{for(var S in w||(w={}))Xt.call(w,S)&&$e(e,S,w[S]);if(Ee)for(var S of Ee(w))Yt.call(w,S)&&$e(e,S,w[S]);return e},ae=(e,w)=>Kt(e,Qt(w));var w="",S=(n,l)=>{const t=n.__vccOpts||n;for(const[a,d]of l)t[a]=d;return t};const ve=n=>(e.pushScopeId("data-v-e0a0b7f0"),n=n(),e.popScopeId(),n),Ve=["onClick"],Ae=["checked"],Le=ve(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var Re=S(e.defineComponent({props:{status:{type:String,required:!0}},emits:["change"],setup(n,{emit:l}){const t=n;e.useCssVars(g=>({"51ab8a49":e.unref(s)}));const a=e.computed(()=>t.status==="allSelected"),d=()=>{l("change",!a.value)},s=e.inject("themeColor");return(g,o)=>(e.openBlock(),e.createElementBlock("div",{class:"easy-checkbox",onClick:e.withModifiers(d,["stop","prevent"])},[e.createElementVNode("input",{type:"checkbox",checked:e.unref(a),class:e.normalizeClass(n.status)},null,10,Ae),Le],8,Ve))}}),[["__scopeId","data-v-e0a0b7f0"]]),ea="";const Fe=n=>(e.pushScopeId("data-v-7e69a276"),n=n(),e.popScopeId(),n),Te=["checked"],De=Fe(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var ze=S(e.defineComponent({props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(n,{emit:l}){e.useCssVars(a=>({fdaf7e9e:e.unref(t)}));const t=e.inject("themeColor");return(a,d)=>(e.openBlock(),e.createElementBlock("div",{class:"easy-checkbox",onClick:d[0]||(d[0]=e.withModifiers(s=>l("change"),["stop","prevent"]))},[e.createElementVNode("input",{type:"checkbox",checked:n.checked},null,8,Te),De]))}}),[["__scopeId","data-v-7e69a276"]]),aa="";const He=n=>(e.pushScopeId("data-v-09dad912"),n=n(),e.popScopeId(),n),Me={class:"easy-data-table__rows-selector"},Oe={class:"rows-input"},je=He(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),We=["onClick"];var qe=S(e.defineComponent({props:{modelValue:{type:Number,required:!0},rowsItems:{type:Array,required:!0}},emits:["update:modelValue"],setup(n,{emit:l}){const t=n;e.useCssVars(p=>({"7fe9410c":e.unref(y)}));const a=e.ref(!1),d=e.ref(!1),s=e.inject("dataTable");e.watch(a,p=>{if(p&&s){const b=window.innerHeight,_=s.value.getBoundingClientRect().height,R=s.value.getBoundingClientRect().top;b-(_+R)<=100?d.value=!0:d.value=!1}});const g=e.computed({get:()=>t.modelValue,set:p=>{l("update:modelValue",p)}}),o=p=>{g.value=p,a.value=!1},r=(p,b)=>{let _=p.parentNode;for(;_!=null;){if(_.classList&&_.classList.contains(b))return!0;_=_.parentNode}return!1},i=p=>{r(p.target,"easy-data-table__rows-selector")||(a.value=!1)};e.onMounted(()=>{document.addEventListener("click",i)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",i)});const y=e.inject("themeColor");return(p,b)=>(e.openBlock(),e.createElementBlock("div",Me,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:b[0]||(b[0]=_=>a.value=!a.value)},[e.createElementVNode("div",Oe,e.toDisplayString(e.unref(g)),1),je]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:a.value,inside:d.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rowsItems,_=>(e.openBlock(),e.createElementBlock("li",{key:_,class:e.normalizeClass({selected:_===e.unref(g)}),onClick:R=>o(_)},e.toDisplayString(_),11,We))),128))],2)]))}}),[["__scopeId","data-v-09dad912"]]),ra="";const ne=n=>(e.pushScopeId("data-v-1fa3a520"),n=n(),e.popScopeId(),n),Je={class:"lds-ring"},Ue=[ne(()=>e.createElementVNode("div",null,null,-1)),ne(()=>e.createElementVNode("div",null,null,-1)),ne(()=>e.createElementVNode("div",null,null,-1)),ne(()=>e.createElementVNode("div",null,null,-1))];var Ge=S(e.defineComponent({setup(n){e.useCssVars(t=>({"26774109":e.unref(l)}));const l=e.inject("themeColor");return(t,a)=>(e.openBlock(),e.createElementBlock("div",Je,Ue))}}),[["__scopeId","data-v-1fa3a520"]]),da="";const Ke={class:"loader-line"};var Qe=S(e.defineComponent({setup(n){e.useCssVars(t=>({"0d327f57":e.unref(l)}));const l=e.inject("themeColor");return(t,a)=>(e.openBlock(),e.createElementBlock("div",Ke))}}),[["__scopeId","data-v-7d281cac"]]),pa="";const Xe={class:"buttons-pagination"},Ye=["onClick"];var Ze=S(e.defineComponent({props:{maxPaginationNumber:{type:Number,required:!0},currentPaginationNumber:{type:Number,required:!0}},emits:["updatePage"],setup(n,{emit:l}){const t=n;e.useCssVars(o=>({"40dd4f07":e.unref(g)}));const a=7,d=o=>{o.type==="button"&&!o.active&&l("updatePage",o.page)},s=e.computed(()=>{const o=[];if(t.maxPaginationNumber<=a)for(let r=1;r<=t.maxPaginationNumber;r+=1)o.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if([1,2,t.maxPaginationNumber,t.maxPaginationNumber-1].includes(t.currentPaginationNumber))for(let r=1;r<=a;r+=1)if(r<=3)o.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if(r===4)o.push({type:"omission"});else{const i=t.maxPaginationNumber-(a-r);o.push({type:"button",page:i,active:i===t.currentPaginationNumber,activePrev:i+1===t.currentPaginationNumber})}else if([3,4].includes(t.currentPaginationNumber))for(let r=1;r<=a;r+=1)r<=5?o.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber}):r===6?o.push({type:"omission"}):o.push({type:"button",page:t.maxPaginationNumber,active:t.maxPaginationNumber===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if([t.maxPaginationNumber-2,t.maxPaginationNumber-3].includes(t.currentPaginationNumber))for(let r=1;r<=a;r+=1)if(r===1)o.push({type:"button",page:1,active:t.currentPaginationNumber===1,activePrev:r+1===t.currentPaginationNumber});else if(r===2)o.push({type:"omission"});else{const i=t.maxPaginationNumber-(a-r);o.push({type:"button",page:i,active:i===t.currentPaginationNumber,activePrev:i+1===t.currentPaginationNumber})}else for(let r=1;r<=a;r+=1)if(r===1)o.push({type:"button",page:1,active:t.currentPaginationNumber===1,activePrev:r+1===t.currentPaginationNumber});else if(r===2||r===6)o.push({type:"omission"});else if(r===7)o.push({type:"button",page:t.maxPaginationNumber,active:t.maxPaginationNumber===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else{const i=4-r,y=t.currentPaginationNumber-i;o.push({type:"button",page:y,active:y===t.currentPaginationNumber,activePrev:y+1===t.currentPaginationNumber})}return o}),g=e.inject("themeColor");return(o,r)=>(e.openBlock(),e.createElementBlock("div",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(i,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:e.normalizeClass(["item",{button:i.type==="button",active:i.type==="button"&&i.active,"active-prev":i.type==="button"&&i.activePrev,omission:i.type==="omission"}]),onClick:p=>d(i)},e.toDisplayString(i.type==="button"?i.page:"..."),11,Ye))),128))]))}}),[["__scopeId","data-v-4c681fa2"]]),ma="";const pe=n=>(e.pushScopeId("data-v-c9da5286"),n=n(),e.popScopeId(),n),et=[pe(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],tt=[pe(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var at=S(e.defineComponent({props:{isFirstPage:{type:Boolean,required:!1},isLastPage:{type:Boolean,required:!1}},emits:["clickPrevPage","clickNextPage"],setup(n,{emit:l}){const t=e.useSlots();return(a,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]=s=>l("clickPrevPage"))},et,2),e.unref(t).buttonsPagination?e.renderSlot(a.$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]=s=>l("clickNextPage"))},tt,2)],64))}}),[["__scopeId","data-v-c9da5286"]]);function nt(n,l,t){return{clickRow:d=>{const s=H({},d);if(n.value){const{checkbox:g}=d;delete s.checkbox,s.isSelected=g}if(l.value){const{index:g}=d;delete s.index,s.indexInCurrentPage=g}t("clickRow",s)}}}function rt(n,l,t){const a=e.ref([]);return{expandingItemIndexList:a,updateExpandingItemIndexList:(g,o,r)=>{r.stopPropagation();const i=a.value.indexOf(g);if(i!==-1)a.value.splice(i,1);else{const y=n.value.findIndex(p=>JSON.stringify(p)===JSON.stringify(o));t("expandRow",l.value+y),a.value.push(l.value+y)}},clearExpandingItemIndexList:()=>{a.value=[]}}}function ot(n){const l=e.computed(()=>n.value.filter(d=>d.fixed)),t=e.computed(()=>l.value.length?l.value[l.value.length-1].value:""),a=e.computed(()=>{if(!l.value.length)return[];const d=l.value.map(s=>{var g;return(g=s.width)!=null?g:100});return l.value.map((s,g)=>{var o,r;return{value:s.value,fixed:(o=s.fixed)!=null?o:!0,width:(r=s.width)!=null?r:100,distance:g===0?0:d.reduce((i,y,p)=>{let b=i;return p<g&&(b+=y),b})}})});return{fixedHeaders:l,lastFixedColumn:t,fixedColumnsInfos:a}}function lt(n,l,t,a,d,s,g,o,r,i,y,p,b,_,R,k,B,T){const $=e.computed(()=>s.value.findIndex(h=>h.fixed)!==-1),u=e.computed(()=>$.value?s.value.filter(h=>h.fixed):[]),x=e.computed(()=>s.value.filter(h=>!h.fixed)),N=(h,v)=>Array.isArray(h)&&Array.isArray(v)?{sortBy:h,sortDesc:v.map(P=>P==="desc")}:h!==""?{sortBy:_.value,sortDesc:R.value==="desc"}:null,f=e.ref(N(_.value,R.value)),I=e.computed(()=>{var re;const v=[...u.value,...x.value].map(G=>{const V=Object.assign(G);if(V.sortable&&(V.sortType="none"),p.value)if(Array.isArray(p.value.sortBy)&&Array.isArray(p.value.sortType)&&p.value.sortBy.includes(V.value)){const z=p.value.sortBy.indexOf(V.value);V.sortType=p.value.sortType[z]}else V.value===p.value.sortBy&&p.value.sortType&&(V.sortType=p.value.sortType);if(f.value&&Array.isArray(f.value.sortBy)&&Array.isArray(f.value.sortDesc)&&f.value.sortBy.includes(V.value)){const z=f.value.sortBy.indexOf(V.value);V.sortType=f.value.sortDesc[z]?"desc":"asc"}else f.value&&V.value===f.value.sortBy&&(V.sortType=f.value.sortDesc?"desc":"asc");return V});let P=[];g.value?P=[a.value||$.value?{text:"",value:"expand",fixed:!0,width:l.value}:{text:"",value:"expand"},...v]:P=v;let D=[];b.value?D=[d.value||$.value?{text:"#",value:"index",fixed:!0,width:o.value}:{text:"#",value:"index"},...P]:D=P;let Q=[];return r.value?Q=[t.value||$.value?{text:"checkbox",value:"checkbox",fixed:!0,width:(re=n.value)!=null?re:36}:{text:"checkbox",value:"checkbox"},...D]:Q=D,Q}),C=e.computed(()=>I.value.map(h=>h.value));return{clientSortOptions:f,headerColumns:C,headersForRender:I,updateSortField:(h,v)=>{let P=null;if(v==="none"?P="asc":v==="asc"?P="desc":P=y.value?"asc":null,i.value&&B(h,P),f.value&&Array.isArray(f.value.sortBy)&&Array.isArray(f.value.sortDesc)){const D=f.value.sortBy.indexOf(h);D===-1?P!==null&&(f.value.sortBy.push(h),f.value.sortDesc.push(P==="desc")):P===null?(f.value.sortDesc.splice(D,1),f.value.sortBy.splice(D,1)):f.value.sortDesc[D]=P==="desc"}else P===null?f.value=null:f.value={sortBy:h,sortDesc:P==="desc"};T("updateSort",{sortType:P,sortBy:h})},isMultiSorting:h=>p.value&&Array.isArray(p.value.sortBy)?p.value.sortBy.includes(h):f.value&&Array.isArray(f.value.sortBy)?f.value.sortBy.includes(h):!1,getMultiSortNumber:h=>p.value&&Array.isArray(p.value.sortBy)?p.value.sortBy.indexOf(h)+1:f.value&&Array.isArray(f.value.sortBy)?f.value.sortBy.indexOf(h)+1:!1}}function st(n,l,t,a,d,s,g,o,r){const i=e.computed(()=>(n.value-1)*d.value+1),y=e.computed(()=>t.value?Math.min(r.value,n.value*d.value):Math.min(o.value.length,n.value*d.value)),p=e.computed(()=>t.value?a.value:o.value.slice(i.value-1,y.value)),b=e.computed(()=>g.value?p.value.map((k,B)=>H({index:i.value+B},k)):p.value),_=e.computed(()=>s.value.length===0||s.value.every(B=>o.value.findIndex(T=>JSON.stringify(B)===JSON.stringify(T))===-1)?"noneSelected":s.value.length===o.value.length&&s.value.every(T=>o.value.findIndex($=>JSON.stringify(T)===JSON.stringify($))!==-1)?"allSelected":"partSelected"),R=e.computed(()=>l.value?_.value==="allSelected"?b.value.map(k=>H({checkbox:!0},k)):_.value==="noneSelected"?b.value.map(k=>H({checkbox:!1},k)):b.value.map(k=>{const B=s.value.findIndex(T=>{const $=H({},k);return delete $.index,JSON.stringify(T)===JSON.stringify($)})!==-1;return H({checkbox:B},k)}):b.value);return{currentPageFirstIndex:i,currentPageLastIndex:y,multipleSelectStatus:_,pageItems:R}}function it(n,l,t,a,d,s,g){const o=e.ref(s.value?s.value.page:n.value),r=e.computed(()=>Math.ceil(a.value/d.value)),i=e.computed(()=>r.value===0||o.value===r.value),y=e.computed(()=>o.value===1);return{currentPaginationNumber:o,maxPaginationNumber:r,isLastPage:i,isFirstPage:y,nextPage:()=>{if(a.value!==0&&!i.value&&!t.value)if(l.value){const k=o.value+1;g(k)}else o.value+=1},prevPage:()=>{if(a.value!==0&&!y.value&&!t.value)if(l.value){const k=o.value-1;g(k)}else o.value-=1},updatePage:k=>{t.value||(l.value?g(k):o.value=k)},updateCurrentPaginationNumber:k=>{o.value=k}}}function ct(n,l,t,a){const d=e.computed(()=>!n.value&&l.value.findIndex(o=>o===a.value)===-1?[a.value,...l.value]:l.value),s=e.ref(t.value?t.value.rowsPerPage:a.value);return{rowsItemsComputed:d,rowsPerPageRef:s,updateRowsPerPage:o=>{s.value=o}}}function dt(n,l,t){const a=e.computed({get:()=>{if(n.value){const{page:o,rowsPerPage:r,sortBy:i,sortType:y}=n.value;return{page:o,rowsPerPage:r,sortBy:i!=null?i:null,sortType:y!=null?y:null}}return null},set:o=>{t("update:serverOptions",o)}});return{serverOptionsComputed:a,updateServerOptionsPage:o=>{a.value&&(a.value=ae(H({},a.value),{page:o}))},updateServerOptionsSort:(o,r)=>{if(a.value)if(l.value&&Array.isArray(a.value.sortBy)&&Array.isArray(a.value.sortType)){const i=a.value.sortBy.findIndex(y=>y===o);i===-1&&r!==null&&(a.value.sortBy.push(o),a.value.sortType.push(r)),r===null?(a.value.sortBy.splice(i,1),a.value.sortType.splice(i,1)):a.value.sortType[i]=r}else a.value=ae(H({},a.value),{sortBy:r!==null?o:null,sortType:r})},updateServerOptionsRowsPerPage:o=>{a.value&&(a.value=ae(H({},a.value),{page:1,rowsPerPage:o}))}}}function E(n,l){if(n.includes(".")){let t="";const a=n.split("."),{length:d}=a;let s=0;for(;s<d&&(t=s===0?l[a[s]]:t[a[s]],s+=1,t!==void 0););return t}return l[n]}function ut(n,l){const t=E(n,l);return Array.isArray(t)?t.join(","):t}function pt(n,l,t,a,d,s,g,o,r,i){const y=u=>{if(typeof s.value=="string"&&s.value!=="")return E(s.value,u);if(Array.isArray(s.value)){let x="";return s.value.forEach(N=>{x+=E(N,u)}),x}return Object.values(u).join(" ")},p=e.computed(()=>{if(!t.value&&g.value!==""){const u=new RegExp(g.value,"i");return a.value.filter(x=>u.test(y(x)))}return a.value}),b=e.computed(()=>{let u=[...p.value];return l.value?(l.value.forEach(x=>{u=u.filter(N=>{const{field:f,comparison:I,criteria:C}=x;if(typeof I=="function")return I(E(f,N),C);const F=E(f,N);switch(I){case"=":return F===C;case"!=":return F!==C;case">":return F>C;case"<":return F<C;case"<=":return F<=C;case">=":return F>=C;case"between":return F>=Math.min(...C)&&F<=Math.max(...C);default:return F===C}})}),u):p.value});e.watch(b,u=>{l.value&&i("updateFilter",u)},{immediate:!0,deep:!0});function _(u,x,N,f){const I=u[f],C=x[f];return(f===0?N:_(u,x,N,f-1)).sort((O,W)=>{let h=!0;for(let v=0;v<f;v+=1)if(E(u[v],O)!==E(u[v],W)){h=!1;break}return h?E(I,O)<E(I,W)?C?1:-1:E(I,O)>E(I,W)?C?-1:1:0:0})}const R=e.computed(()=>{if(t.value)return a.value;if(n.value===null)return b.value;const{sortBy:u,sortDesc:x}=n.value,N=[...b.value];return r&&Array.isArray(u)&&Array.isArray(x)?u.length===0?N:_(u,x,N,u.length-1):N.sort((f,I)=>E(u,f)<E(u,I)?x?1:-1:E(u,f)>E(u,I)?x?-1:1:0)}),k=e.computed(()=>t.value?o.value:R.value.length),B=e.computed({get:()=>{var u;return(u=d.value)!=null?u:[]},set:u=>{i("update:itemsSelected",u)}});return{totalItems:R,selectItemsComputed:B,totalItemsLength:k,toggleSelectAll:u=>{B.value=u?R.value:[]},toggleSelectItem:u=>{const x=u.checkbox;if(delete u.checkbox,delete u.index,x)B.value=B.value.filter(N=>JSON.stringify(N)!==JSON.stringify(u));else{const N=B.value;N.unshift(u),B.value=N}}}}var ft={alternating:{type:Boolean,default:!1},buttonsPagination:{type:Boolean,default:!1},checkboxColumnWidth:{type:Number,default:null},currentPage:{type:Number,default:1},emptyMessage:{type:String,default:"No Available Data"},expandColumnWidth:{type:Number,default:36},filterOptions:{type:Array,default:null},fixedExpand:{type:Boolean,default:!1},fixedHeader:{type:Boolean,default:!0},fixedCheckbox:{type:Boolean,default:!1},fixedIndex:{type:Boolean,default:!1},headerTextDirection:{type:String,default:"left"},bodyTextDirection:{type:String,default:"left"},hideFooter:{type:Boolean,default:!1},hideRowsPerPage:{type:Boolean,default:!1},hideHeader:{type:Boolean,default:!1},indexColumnWidth:{type:Number,default:60},itemsSelected:{type:Array,default:null},loading:{type:Boolean,deault:!1},rowsPerPage:{type:Number,default:25},rowsItems:{type:Array,default:()=>[25,50,100]},rowsPerPageMessage:{type:String,default:"rows per page:"},searchField:{type:[String,Array],default:""},searchValue:{type:String,default:""},serverOptions:{type:Object,default:null},serverItemsLength:{type:Number,default:0},showIndex:{type:Boolean,default:!1},sortBy:{type:[String,Array],default:""},sortType:{type:[String,Array],default:"asc"},multiSort:{type:Boolean,default:!1},tableMinHeight:{type:Number,default:180},tableHeight:{type:Number,default:null},themeColor:{type:String,default:"#42b883"},tableClassName:{type:String,default:""},headerClassName:{type:String,default:""},headerItemClassName:{type:[Function,String],default:""},bodyRowClassName:{type:[Function,String],default:""},bodyExpandRowClassName:{type:[Function,String],default:""},bodyItemClassName:{type:[Function,String],default:""},noHover:{type:Boolean,default:!1},borderCell:{type:Boolean,default:!1},mustSort:{type:Boolean,default:!1},rowsOfPageSeparatorMessage:{type:String,default:"of"}},_a="",ba="";const mt=n=>(e.pushScopeId("data-v-0a021d30"),n=n(),e.popScopeId(),n),gt=["onClick"],yt={key:1,class:"header-text"},ht={key:3,class:"multi-sort__number"},_t=["onClick"],bt=["onClick"],kt=["colspan"],xt={key:0,class:"vue3-easy-data-table__loading"},Pt=mt(()=>e.createElementVNode("div",{class:"vue3-easy-data-table__loading-mask"},null,-1)),Nt={class:"loading-entity"},St={key:1,class:"vue3-easy-data-table__message"},Ct={key:0,class:"vue3-easy-data-table__footer"},Bt={key:0,class:"pagination__rows-per-page"},wt={class:"pagination__items-index"},It=e.defineComponent({props:ae(H({},ft),{items:{type:Array,required:!0},headers:{type:Array,required:!0}}),emits:["clickRow","expandRow","updateSort","updateFilter","update:itemsSelected","update:serverOptions"],setup(n,{expose:l,emit:t}){const a=n;e.useCssVars(m=>({"674340a8":e.unref(V),"46946bc4":e.unref(G)}));const{bodyTextDirection:d,checkboxColumnWidth:s,currentPage:g,expandColumnWidth:o,filterOptions:r,fixedCheckbox:i,fixedExpand:y,fixedHeader:p,fixedIndex:b,headers:_,headerTextDirection:R,indexColumnWidth:k,items:B,itemsSelected:T,loading:$,mustSort:u,multiSort:x,rowsItems:N,rowsPerPage:f,searchField:I,searchValue:C,serverItemsLength:F,serverOptions:O,showIndex:W,sortBy:h,sortType:v,tableHeight:P,tableMinHeight:D,themeColor:Q,rowsOfPageSeparatorMessage:re}=e.toRefs(a),G=e.computed(()=>P.value?`${P.value}px`:null),V=e.computed(()=>`${D.value}px`);e.provide("themeColor",Q.value);const z=e.useSlots(),Et=e.computed(()=>!!z.pagination),$t=e.computed(()=>!!z.loading),me=e.computed(()=>!!z.expand),vt=e.computed(()=>!!z.body),ge=e.ref(),ie=e.ref();e.provide("dataTable",ge);const ye=e.ref(!1);e.onMounted(()=>{ie.value.addEventListener("scroll",()=>{ye.value=ie.value.scrollLeft>0})});const ce=e.computed(()=>T.value!==null),J=e.computed(()=>O.value!==null),{serverOptionsComputed:de,updateServerOptionsPage:Vt,updateServerOptionsSort:At,updateServerOptionsRowsPerPage:Lt}=dt(O,x,t),{clientSortOptions:he,headerColumns:_e,headersForRender:U,updateSortField:Rt,isMultiSorting:Ft,getMultiSortNumber:Tt}=lt(s,o,i,y,b,_,me,k,ce,J,u,de,W,h,v,x,At,t),{rowsItemsComputed:be,rowsPerPageRef:q,updateRowsPerPage:Dt}=ct(J,N,O,f),{totalItems:zt,selectItemsComputed:Ht,totalItemsLength:oe,toggleSelectAll:Mt,toggleSelectItem:Ot}=pt(he,r,J,B,T,I,C,F,x,t),{currentPaginationNumber:j,maxPaginationNumber:X,isLastPage:Y,isFirstPage:Z,nextPage:ee,prevPage:te,updatePage:le,updateCurrentPaginationNumber:jt}=it(g,J,$,oe,q,O,Vt),{currentPageFirstIndex:ke,currentPageLastIndex:xe,multipleSelectStatus:Pe,pageItems:K}=st(j,ce,J,B,q,Ht,W,zt,oe),se=e.computed(()=>j.value===0?0:(j.value-1)*q.value),{expandingItemIndexList:Ne,updateExpandingItemIndexList:Wt,clearExpandingItemIndexList:Se}=rt(K,se,t),{fixedHeaders:ue,lastFixedColumn:Ce,fixedColumnsInfos:qt}=ot(U),{clickRow:Jt}=nt(ce,W,t),Ut=m=>{var c;const M=(c=m.width)!=null?c:ue.value.length?100:null;if(M)return`width: ${M}px; min-width: ${M}px;`},Be=(m,M="th")=>{if(!ue.value.length)return;const c=qt.value.find(A=>A.value===m);if(c)return`left: ${c.distance}px;z-index: ${M==="th"?3:1};position: sticky;`};return e.watch($,(m,M)=>{de.value&&m===!1&&M===!0&&(jt(de.value.page),Se())}),e.watch(q,m=>{J.value?Lt(m):le(1)}),e.watch(C,()=>{J.value||le(1)}),e.watch([j,he,I,C,r],()=>{Se()},{deep:!0}),l({currentPageFirstIndex:ke,currentPageLastIndex:xe,clientItemsLength:oe,maxPaginationNumber:X,currentPaginationNumber:j,isLastPage:Y,isFirstPage:Z,nextPage:ee,prevPage:te,updatePage:le,rowsPerPageOptions:be,rowsPerPageActiveOption:q,updateRowsPerPageActiveOption:Dt}),(m,M)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataTable",ref:ge,class:e.normalizeClass(["vue3-easy-data-table",[m.tableClassName]])},[e.createElementVNode("div",{ref_key:"tableBody",ref:ie,class:e.normalizeClass(["vue3-easy-data-table__main",{"fixed-header":e.unref(p),"fixed-height":e.unref(P),"show-shadow":ye.value,"table-fixed":e.unref(ue).length,hoverable:!m.noHover,"border-cell":m.borderCell}])},[e.createElementVNode("table",null,[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(U),(c,A)=>(e.openBlock(),e.createElementBlock("col",{key:A,style:e.normalizeStyle(Ut(c))},null,4))),128))]),e.unref(U).length&&!m.hideHeader?(e.openBlock(),e.createElementBlock("thead",{key:0,class:e.normalizeClass(["vue3-easy-data-table__header",[m.headerClassName]])},[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(U),(c,A)=>(e.openBlock(),e.createElementBlock("th",{key:A,class:e.normalizeClass([{sortable:c.sortable,none:c.sortable&&c.sortType==="none",desc:c.sortable&&c.sortType==="desc",asc:c.sortable&&c.sortType==="asc",shadow:c.value===e.unref(Ce)},typeof m.headerItemClassName=="string"?m.headerItemClassName:m.headerItemClassName(c,A)]),style:e.normalizeStyle(Be(c.value)),onClick:e.withModifiers(L=>c.sortable&&c.sortType?e.unref(Rt)(c.value,c.sortType):null,["stop"])},[c.text==="checkbox"?(e.openBlock(),e.createBlock(Re,{key:e.unref(Pe),status:e.unref(Pe),onChange:e.unref(Mt)},null,8,["status","onChange"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["header",`direction-${e.unref(R)}`])},[e.unref(z)[`header-${c.value}`]?e.renderSlot(m.$slots,`header-${c.value}`,e.normalizeProps(e.mergeProps({key:0},c)),void 0,!0):(e.openBlock(),e.createElementBlock("span",yt,e.toDisplayString(c.text),1)),c.sortable?(e.openBlock(),e.createElementBlock("i",{key:c.sortType?c.sortType:"none",class:e.normalizeClass(["sortType-icon",{desc:c.sortType==="desc"}])},null,2)):e.createCommentVNode("",!0),e.unref(x)&&e.unref(Ft)(c.value)?(e.openBlock(),e.createElementBlock("span",ht,e.toDisplayString(e.unref(Tt)(c.value)),1)):e.createCommentVNode("",!0)],2))],14,gt))),128))])],2)):e.createCommentVNode("",!0),e.unref(vt)?e.renderSlot(m.$slots,"body",e.normalizeProps(e.mergeProps({key:1},e.unref(K))),void 0,!0):e.unref(_e).length?(e.openBlock(),e.createElementBlock("tbody",{key:2,class:e.normalizeClass(["vue3-easy-data-table__body",{"row-alternation":m.alternating}])},[e.renderSlot(m.$slots,"body-prepend",e.normalizeProps(e.guardReactiveProps({items:e.unref(K),pagination:{isFirstPage:e.unref(Z),isLastPage:e.unref(Y),currentPaginationNumber:e.unref(j),maxPaginationNumber:e.unref(X),nextPage:e.unref(ee),prevPage:e.unref(te)},headers:e.unref(U)})),void 0,!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(K),(c,A)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:A},[e.createElementVNode("tr",{class:e.normalizeClass([{"even-row":(A+1)%2===0},typeof m.bodyRowClassName=="string"?m.bodyRowClassName:m.bodyRowClassName(c,A)]),onClick:L=>e.unref(Jt)(c)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(_e),(L,we)=>(e.openBlock(),e.createElementBlock("td",{key:we,style:e.normalizeStyle(Be(L,"td")),class:e.normalizeClass([{shadow:L===e.unref(Ce),"can-expand":L==="expand"},typeof m.bodyItemClassName=="string"?m.bodyItemClassName:m.bodyItemClassName(L,we),`direction-${e.unref(d)}`]),onClick:Ie=>L==="expand"?e.unref(Wt)(A+e.unref(se),c,Ie):null},[e.unref(z)[`item-${L}`]?e.renderSlot(m.$slots,`item-${L}`,e.normalizeProps(e.mergeProps({key:0},c)),void 0,!0):e.unref(z)[`item-${L.toLowerCase()}`]?e.renderSlot(m.$slots,`item-${L.toLowerCase()}`,e.normalizeProps(e.mergeProps({key:1},c)),void 0,!0):L==="expand"?(e.openBlock(),e.createElementBlock("i",{key:2,class:e.normalizeClass(["expand-icon",{expanding:e.unref(Ne).includes(e.unref(se)+A)}])},null,2)):L==="checkbox"?(e.openBlock(),e.createBlock(ze,{key:3,checked:c[L],onChange:Ie=>e.unref(Ot)(c)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(e.unref(ut)(L,c)),1)],64))],14,bt))),128))],10,_t),e.unref(me)&&e.unref(Ne).includes(A+e.unref(se))?(e.openBlock(),e.createElementBlock("tr",{key:0,class:e.normalizeClass([{"even-row":(A+1)%2===0},typeof m.bodyExpandRowClassName=="string"?m.bodyExpandRowClassName:m.bodyExpandRowClassName(c,A)])},[e.createElementVNode("td",{colspan:e.unref(U).length,class:"expand"},[c.expandLoading?(e.openBlock(),e.createBlock(Qe,{key:0,class:"expand-loading"})):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"expand",e.normalizeProps(e.guardReactiveProps(c)),void 0,!0)],8,kt)],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(m.$slots,"body-append",e.normalizeProps(e.guardReactiveProps({items:e.unref(K),pagination:{isFirstPage:e.unref(Z),isLastPage:e.unref(Y),currentPaginationNumber:e.unref(j),maxPaginationNumber:e.unref(X),nextPage:e.unref(ee),prevPage:e.unref(te)},headers:e.unref(U)})),void 0,!0)],2)):e.createCommentVNode("",!0)]),e.unref($)?(e.openBlock(),e.createElementBlock("div",xt,[Pt,e.createElementVNode("div",Nt,[e.unref($t)?e.renderSlot(m.$slots,"loading",{key:0},void 0,!0):(e.openBlock(),e.createBlock(Ge,{key:1}))])])):e.createCommentVNode("",!0),!e.unref(K).length&&!e.unref($)?(e.openBlock(),e.createElementBlock("div",St,e.toDisplayString(m.emptyMessage),1)):e.createCommentVNode("",!0)],2),m.hideFooter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ct,[m.hideRowsPerPage?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Bt,[e.createTextVNode(e.toDisplayString(m.rowsPerPageMessage)+" ",1),e.createVNode(qe,{modelValue:e.unref(q),"onUpdate:modelValue":M[0]||(M[0]=c=>e.isRef(q)?q.value=c:null),"rows-items":e.unref(be)},null,8,["modelValue","rows-items"])])),e.createElementVNode("div",wt,e.toDisplayString(`${e.unref(ke)}\u2013${e.unref(xe)}`)+" "+e.toDisplayString(e.unref(re))+" "+e.toDisplayString(e.unref(oe)),1),e.unref(Et)?e.renderSlot(m.$slots,"pagination",e.normalizeProps(e.mergeProps({key:1},{isFirstPage:e.unref(Z),isLastPage:e.unref(Y),currentPaginationNumber:e.unref(j),maxPaginationNumber:e.unref(X),nextPage:e.unref(ee),prevPage:e.unref(te)})),void 0,!0):(e.openBlock(),e.createBlock(at,{key:2,"is-first-page":e.unref(Z),"is-last-page":e.unref(Y),onClickNextPage:e.unref(ee),onClickPrevPage:e.unref(te)},e.createSlots({_:2},[m.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(Ze,{"current-pagination-number":e.unref(j),"max-pagination-number":e.unref(X),onUpdatePage:e.unref(le)},null,8,["current-pagination-number","max-pagination-number","onUpdatePage"])])}:void 0]),1032,["is-first-page","is-last-page","onClickNextPage","onClickPrevPage"]))]))],2))}});var fe=S(It,[["__scopeId","data-v-0a021d30"]]);return typeof window!="undefined"&&window.Vue&&window.Vue.createApp({}).component("Vue3EasyDataTable",fe),fe}); | ||
(function(e,B){typeof exports=="object"&&typeof module!="undefined"?module.exports=B(require("vue")):typeof define=="function"&&define.amd?define(["vue"],B):(e=typeof globalThis!="undefined"?globalThis:e||self,e["vue3-easy-data-table"]=B(e.Vue))})(this,function(e){"use strict";var Kt=Object.defineProperty,Qt=Object.defineProperties;var Xt=Object.getOwnPropertyDescriptors;var ve=Object.getOwnPropertySymbols;var Yt=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable;var Ve=(e,B,S)=>B in e?Kt(e,B,{enumerable:!0,configurable:!0,writable:!0,value:S}):e[B]=S,z=(e,B)=>{for(var S in B||(B={}))Yt.call(B,S)&&Ve(e,S,B[S]);if(ve)for(var S of ve(B))Zt.call(B,S)&&Ve(e,S,B[S]);return e},ne=(e,B)=>Qt(e,Xt(B));var B="",S=(o,l)=>{const t=o.__vccOpts||o;for(const[a,m]of l)t[a]=m;return t};const Ae=o=>(e.pushScopeId("data-v-e0a0b7f0"),o=o(),e.popScopeId(),o),Le=["onClick"],Re=["checked"],Fe=Ae(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var Te=S(e.defineComponent({props:{status:{type:String,required:!0}},emits:["change"],setup(o,{emit:l}){const t=o;e.useCssVars(g=>({"51ab8a49":e.unref(s)}));const a=e.computed(()=>t.status==="allSelected"),m=()=>{l("change",!a.value)},s=e.inject("themeColor");return(g,n)=>(e.openBlock(),e.createElementBlock("div",{class:"easy-checkbox",onClick:e.withModifiers(m,["stop","prevent"])},[e.createElementVNode("input",{type:"checkbox",checked:e.unref(a),class:e.normalizeClass(o.status)},null,10,Re),Fe],8,Le))}}),[["__scopeId","data-v-e0a0b7f0"]]),ta="";const De=o=>(e.pushScopeId("data-v-7e69a276"),o=o(),e.popScopeId(),o),ze=["checked"],He=De(()=>e.createElementVNode("label",{for:"checbox"},null,-1));var Me=S(e.defineComponent({props:{checked:{type:Boolean,required:!0}},emits:["change"],setup(o,{emit:l}){e.useCssVars(a=>({fdaf7e9e:e.unref(t)}));const t=e.inject("themeColor");return(a,m)=>(e.openBlock(),e.createElementBlock("div",{class:"easy-checkbox",onClick:m[0]||(m[0]=e.withModifiers(s=>l("change"),["stop","prevent"]))},[e.createElementVNode("input",{type:"checkbox",checked:o.checked},null,8,ze),He]))}}),[["__scopeId","data-v-7e69a276"]]),na="";const Oe=o=>(e.pushScopeId("data-v-09dad912"),o=o(),e.popScopeId(),o),je={class:"easy-data-table__rows-selector"},We={class:"rows-input"},qe=Oe(()=>e.createElementVNode("div",{class:"triangle"},null,-1)),Je=["onClick"];var Ue=S(e.defineComponent({props:{modelValue:{type:Number,required:!0},rowsItems:{type:Array,required:!0}},emits:["update:modelValue"],setup(o,{emit:l}){const t=o;e.useCssVars(u=>({"7fe9410c":e.unref(h)}));const a=e.ref(!1),m=e.ref(!1),s=e.inject("dataTable");e.watch(a,u=>{if(u&&s){const b=window.innerHeight,_=s.value.getBoundingClientRect().height,R=s.value.getBoundingClientRect().top;b-(_+R)<=100?m.value=!0:m.value=!1}});const g=e.computed({get:()=>t.modelValue,set:u=>{l("update:modelValue",u)}}),n=u=>{g.value=u,a.value=!1},r=(u,b)=>{let _=u.parentNode;for(;_!=null;){if(_.classList&&_.classList.contains(b))return!0;_=_.parentNode}return!1},i=u=>{r(u.target,"easy-data-table__rows-selector")||(a.value=!1)};e.onMounted(()=>{document.addEventListener("click",i)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",i)});const h=e.inject("themeColor");return(u,b)=>(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",{class:"rows-input__wrapper",onClick:b[0]||(b[0]=_=>a.value=!a.value)},[e.createElementVNode("div",We,e.toDisplayString(e.unref(g)),1),qe]),e.createElementVNode("ul",{class:e.normalizeClass(["select-items",{show:a.value,inside:m.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.rowsItems,_=>(e.openBlock(),e.createElementBlock("li",{key:_,class:e.normalizeClass({selected:_===e.unref(g)}),onClick:R=>n(_)},e.toDisplayString(_),11,Je))),128))],2)]))}}),[["__scopeId","data-v-09dad912"]]),oa="";const re=o=>(e.pushScopeId("data-v-1fa3a520"),o=o(),e.popScopeId(),o),Ge={class:"lds-ring"},Ke=[re(()=>e.createElementVNode("div",null,null,-1)),re(()=>e.createElementVNode("div",null,null,-1)),re(()=>e.createElementVNode("div",null,null,-1)),re(()=>e.createElementVNode("div",null,null,-1))];var Qe=S(e.defineComponent({setup(o){e.useCssVars(t=>({"26774109":e.unref(l)}));const l=e.inject("themeColor");return(t,a)=>(e.openBlock(),e.createElementBlock("div",Ge,Ke))}}),[["__scopeId","data-v-1fa3a520"]]),ua="";const Xe={class:"loader-line"};var Ye=S(e.defineComponent({setup(o){e.useCssVars(t=>({"0d327f57":e.unref(l)}));const l=e.inject("themeColor");return(t,a)=>(e.openBlock(),e.createElementBlock("div",Xe))}}),[["__scopeId","data-v-7d281cac"]]),fa="";const Ze={class:"buttons-pagination"},et=["onClick"];var tt=S(e.defineComponent({props:{maxPaginationNumber:{type:Number,required:!0},currentPaginationNumber:{type:Number,required:!0}},emits:["updatePage"],setup(o,{emit:l}){const t=o;e.useCssVars(n=>({"40dd4f07":e.unref(g)}));const a=7,m=n=>{n.type==="button"&&!n.active&&l("updatePage",n.page)},s=e.computed(()=>{const n=[];if(t.maxPaginationNumber<=a)for(let r=1;r<=t.maxPaginationNumber;r+=1)n.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if([1,2,t.maxPaginationNumber,t.maxPaginationNumber-1].includes(t.currentPaginationNumber))for(let r=1;r<=a;r+=1)if(r<=3)n.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if(r===4)n.push({type:"omission"});else{const i=t.maxPaginationNumber-(a-r);n.push({type:"button",page:i,active:i===t.currentPaginationNumber,activePrev:i+1===t.currentPaginationNumber})}else if([3,4].includes(t.currentPaginationNumber))for(let r=1;r<=a;r+=1)r<=5?n.push({type:"button",page:r,active:r===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber}):r===6?n.push({type:"omission"}):n.push({type:"button",page:t.maxPaginationNumber,active:t.maxPaginationNumber===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else if([t.maxPaginationNumber-2,t.maxPaginationNumber-3].includes(t.currentPaginationNumber))for(let r=1;r<=a;r+=1)if(r===1)n.push({type:"button",page:1,active:t.currentPaginationNumber===1,activePrev:r+1===t.currentPaginationNumber});else if(r===2)n.push({type:"omission"});else{const i=t.maxPaginationNumber-(a-r);n.push({type:"button",page:i,active:i===t.currentPaginationNumber,activePrev:i+1===t.currentPaginationNumber})}else for(let r=1;r<=a;r+=1)if(r===1)n.push({type:"button",page:1,active:t.currentPaginationNumber===1,activePrev:r+1===t.currentPaginationNumber});else if(r===2||r===6)n.push({type:"omission"});else if(r===7)n.push({type:"button",page:t.maxPaginationNumber,active:t.maxPaginationNumber===t.currentPaginationNumber,activePrev:r+1===t.currentPaginationNumber});else{const i=4-r,h=t.currentPaginationNumber-i;n.push({type:"button",page:h,active:h===t.currentPaginationNumber,activePrev:h+1===t.currentPaginationNumber})}return n}),g=e.inject("themeColor");return(n,r)=>(e.openBlock(),e.createElementBlock("div",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(i,h)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:e.normalizeClass(["item",{button:i.type==="button",active:i.type==="button"&&i.active,"active-prev":i.type==="button"&&i.activePrev,omission:i.type==="omission"}]),onClick:u=>m(i)},e.toDisplayString(i.type==="button"?i.page:"..."),11,et))),128))]))}}),[["__scopeId","data-v-4c681fa2"]]),ga="";const fe=o=>(e.pushScopeId("data-v-c9da5286"),o=o(),e.popScopeId(),o),at=[fe(()=>e.createElementVNode("span",{class:"arrow arrow-right"},null,-1))],nt=[fe(()=>e.createElementVNode("span",{class:"arrow arrow-left"},null,-1))];var rt=S(e.defineComponent({props:{isFirstPage:{type:Boolean,required:!1},isLastPage:{type:Boolean,required:!1}},emits:["clickPrevPage","clickNextPage"],setup(o,{emit:l}){const t=e.useSlots();return(a,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["previous-page__click-button",{"first-page":o.isFirstPage}]),onClick:m[0]||(m[0]=s=>l("clickPrevPage"))},at,2),e.unref(t).buttonsPagination?e.renderSlot(a.$slots,"buttonsPagination",{key:0},void 0,!0):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["next-page__click-button",{"last-page":o.isLastPage}]),onClick:m[1]||(m[1]=s=>l("clickNextPage"))},nt,2)],64))}}),[["__scopeId","data-v-c9da5286"]]);function ot(o,l,t,a){return{clickRow:(s,g)=>{if(o.value!==g)return;const n=z({},s);if(l.value){const{checkbox:r}=s;delete n.checkbox,n.isSelected=r}if(t.value){const{index:r}=s;delete n.index,n.indexInCurrentPage=r}a("clickRow",n)}}}function lt(o,l,t){const a=e.ref([]);return{expandingItemIndexList:a,updateExpandingItemIndexList:(g,n,r)=>{r.stopPropagation();const i=a.value.indexOf(g);if(i!==-1)a.value.splice(i,1);else{const h=o.value.findIndex(u=>JSON.stringify(u)===JSON.stringify(n));t("expandRow",l.value+h),a.value.push(l.value+h)}},clearExpandingItemIndexList:()=>{a.value=[]}}}function st(o){const l=e.computed(()=>o.value.filter(m=>m.fixed)),t=e.computed(()=>l.value.length?l.value[l.value.length-1].value:""),a=e.computed(()=>{if(!l.value.length)return[];const m=l.value.map(s=>{var g;return(g=s.width)!=null?g:100});return l.value.map((s,g)=>{var n,r;return{value:s.value,fixed:(n=s.fixed)!=null?n:!0,width:(r=s.width)!=null?r:100,distance:g===0?0:m.reduce((i,h,u)=>{let b=i;return u<g&&(b+=h),b})}})});return{fixedHeaders:l,lastFixedColumn:t,fixedColumnsInfos:a}}function it(o,l,t,a,m,s,g,n,r,i,h,u,b,_,R,k,w,D){const F=e.computed(()=>s.value.findIndex(y=>y.fixed)!==-1),d=e.computed(()=>F.value?s.value.filter(y=>y.fixed):[]),P=e.computed(()=>s.value.filter(y=>!y.fixed)),x=(y,V)=>Array.isArray(y)&&Array.isArray(V)?{sortBy:y,sortDesc:V.map(N=>N==="desc")}:y!==""?{sortBy:_.value,sortDesc:R.value==="desc"}:null,p=e.ref(x(_.value,R.value)),I=e.computed(()=>{var oe;const V=[...d.value,...P.value].map(G=>{const A=Object.assign(G);if(A.sortable&&(A.sortType="none"),u.value)if(Array.isArray(u.value.sortBy)&&Array.isArray(u.value.sortType)&&u.value.sortBy.includes(A.value)){const X=u.value.sortBy.indexOf(A.value);A.sortType=u.value.sortType[X]}else A.value===u.value.sortBy&&u.value.sortType&&(A.sortType=u.value.sortType);if(p.value&&Array.isArray(p.value.sortBy)&&Array.isArray(p.value.sortDesc)&&p.value.sortBy.includes(A.value)){const X=p.value.sortBy.indexOf(A.value);A.sortType=p.value.sortDesc[X]?"desc":"asc"}else p.value&&A.value===p.value.sortBy&&(A.sortType=p.value.sortDesc?"desc":"asc");return A});let N=[];g.value?N=[a.value||F.value?{text:"",value:"expand",fixed:!0,width:l.value}:{text:"",value:"expand"},...V]:N=V;let T=[];b.value?T=[m.value||F.value?{text:"#",value:"index",fixed:!0,width:n.value}:{text:"#",value:"index"},...N]:T=N;let Q=[];return r.value?Q=[t.value||F.value?{text:"checkbox",value:"checkbox",fixed:!0,width:(oe=o.value)!=null?oe:36}:{text:"checkbox",value:"checkbox"},...T]:Q=T,Q}),C=e.computed(()=>I.value.map(y=>y.value));return{clientSortOptions:p,headerColumns:C,headersForRender:I,updateSortField:(y,V)=>{let N=null;if(V==="none"?N="asc":V==="asc"?N="desc":N=h.value?"asc":null,i.value&&w(y,N),p.value&&Array.isArray(p.value.sortBy)&&Array.isArray(p.value.sortDesc)){const T=p.value.sortBy.indexOf(y);T===-1?N!==null&&(p.value.sortBy.push(y),p.value.sortDesc.push(N==="desc")):N===null?(p.value.sortDesc.splice(T,1),p.value.sortBy.splice(T,1)):p.value.sortDesc[T]=N==="desc"}else N===null?p.value=null:p.value={sortBy:y,sortDesc:N==="desc"};D("updateSort",{sortType:N,sortBy:y})},isMultiSorting:y=>u.value&&Array.isArray(u.value.sortBy)?u.value.sortBy.includes(y):p.value&&Array.isArray(p.value.sortBy)?p.value.sortBy.includes(y):!1,getMultiSortNumber:y=>u.value&&Array.isArray(u.value.sortBy)?u.value.sortBy.indexOf(y)+1:p.value&&Array.isArray(p.value.sortBy)?p.value.sortBy.indexOf(y)+1:!1}}function ct(o,l,t,a,m,s,g,n,r){const i=e.computed(()=>(o.value-1)*m.value+1),h=e.computed(()=>t.value?Math.min(r.value,o.value*m.value):Math.min(n.value.length,o.value*m.value)),u=e.computed(()=>t.value?a.value:n.value.slice(i.value-1,h.value)),b=e.computed(()=>g.value?u.value.map((k,w)=>z({index:i.value+w},k)):u.value),_=e.computed(()=>s.value.length===0||s.value.every(w=>n.value.findIndex(D=>JSON.stringify(w)===JSON.stringify(D))===-1)?"noneSelected":s.value.length===n.value.length&&s.value.every(D=>n.value.findIndex(F=>JSON.stringify(D)===JSON.stringify(F))!==-1)?"allSelected":"partSelected"),R=e.computed(()=>l.value?_.value==="allSelected"?b.value.map(k=>z({checkbox:!0},k)):_.value==="noneSelected"?b.value.map(k=>z({checkbox:!1},k)):b.value.map(k=>{const w=s.value.findIndex(D=>{const F=z({},k);return delete F.index,JSON.stringify(D)===JSON.stringify(F)})!==-1;return z({checkbox:w},k)}):b.value);return{currentPageFirstIndex:i,currentPageLastIndex:h,multipleSelectStatus:_,pageItems:R}}function dt(o,l,t,a,m,s,g){const n=e.ref(s.value?s.value.page:o.value),r=e.computed(()=>Math.ceil(a.value/m.value)),i=e.computed(()=>r.value===0||n.value===r.value),h=e.computed(()=>n.value===1);return{currentPaginationNumber:n,maxPaginationNumber:r,isLastPage:i,isFirstPage:h,nextPage:()=>{if(a.value!==0&&!i.value&&!t.value)if(l.value){const k=n.value+1;g(k)}else n.value+=1},prevPage:()=>{if(a.value!==0&&!h.value&&!t.value)if(l.value){const k=n.value-1;g(k)}else n.value-=1},updatePage:k=>{t.value||(l.value?g(k):n.value=k)},updateCurrentPaginationNumber:k=>{n.value=k}}}function ut(o,l,t,a){const m=e.computed(()=>!o.value&&l.value.findIndex(n=>n===a.value)===-1?[a.value,...l.value]:l.value),s=e.ref(t.value?t.value.rowsPerPage:a.value);return{rowsItemsComputed:m,rowsPerPageRef:s,updateRowsPerPage:n=>{s.value=n}}}function pt(o,l,t){const a=e.computed({get:()=>{if(o.value){const{page:n,rowsPerPage:r,sortBy:i,sortType:h}=o.value;return{page:n,rowsPerPage:r,sortBy:i!=null?i:null,sortType:h!=null?h:null}}return null},set:n=>{t("update:serverOptions",n)}});return{serverOptionsComputed:a,updateServerOptionsPage:n=>{a.value&&(a.value=ne(z({},a.value),{page:n}))},updateServerOptionsSort:(n,r)=>{if(a.value)if(l.value&&Array.isArray(a.value.sortBy)&&Array.isArray(a.value.sortType)){const i=a.value.sortBy.findIndex(h=>h===n);i===-1&&r!==null&&(a.value.sortBy.push(n),a.value.sortType.push(r)),r===null?(a.value.sortBy.splice(i,1),a.value.sortType.splice(i,1)):a.value.sortType[i]=r}else a.value=ne(z({},a.value),{sortBy:r!==null?n:null,sortType:r})},updateServerOptionsRowsPerPage:n=>{a.value&&(a.value=ne(z({},a.value),{page:1,rowsPerPage:n}))}}}function $(o,l){if(o.includes(".")){let t="";const a=o.split("."),{length:m}=a;let s=0;for(;s<m&&(t=s===0?l[a[s]]:t[a[s]],s+=1,t!==void 0););return t}return l[o]}function ft(o,l){const t=$(o,l);return Array.isArray(t)?t.join(","):t}function mt(o,l,t,a,m,s,g,n,r,i){const h=d=>{if(typeof s.value=="string"&&s.value!=="")return $(s.value,d);if(Array.isArray(s.value)){let P="";return s.value.forEach(x=>{P+=$(x,d)}),P}return Object.values(d).join(" ")},u=e.computed(()=>{if(!t.value&&g.value!==""){const d=new RegExp(g.value,"i");return a.value.filter(P=>d.test(h(P)))}return a.value}),b=e.computed(()=>{let d=[...u.value];return l.value?(l.value.forEach(P=>{d=d.filter(x=>{const{field:p,comparison:I,criteria:C}=P;if(typeof I=="function")return I($(p,x),C);const v=$(p,x);switch(I){case"=":return v===C;case"!=":return v!==C;case">":return v>C;case"<":return v<C;case"<=":return v<=C;case">=":return v>=C;case"between":return v>=Math.min(...C)&&v<=Math.max(...C);default:return v===C}})}),d):u.value});e.watch(b,d=>{l.value&&i("updateFilter",d)},{immediate:!0,deep:!0});function _(d,P,x,p){const I=d[p],C=P[p];return(p===0?x:_(d,P,x,p-1)).sort((U,M)=>{let y=!0;for(let V=0;V<p;V+=1)if($(d[V],U)!==$(d[V],M)){y=!1;break}return y?$(I,U)<$(I,M)?C?1:-1:$(I,U)>$(I,M)?C?-1:1:0:0})}const R=e.computed(()=>{if(t.value)return a.value;if(o.value===null)return b.value;const{sortBy:d,sortDesc:P}=o.value,x=[...b.value];return r&&Array.isArray(d)&&Array.isArray(P)?d.length===0?x:_(d,P,x,d.length-1):x.sort((p,I)=>$(d,p)<$(d,I)?P?1:-1:$(d,p)>$(d,I)?P?-1:1:0)}),k=e.computed(()=>t.value?n.value:R.value.length),w=e.computed({get:()=>{var d;return(d=m.value)!=null?d:[]},set:d=>{i("update:itemsSelected",d)}});return{totalItems:R,selectItemsComputed:w,totalItemsLength:k,toggleSelectAll:d=>{w.value=d?R.value:[]},toggleSelectItem:d=>{const P=d.checkbox;if(delete d.checkbox,delete d.index,P)w.value=w.value.filter(x=>JSON.stringify(x)!==JSON.stringify(d));else{const x=w.value;x.unshift(d),w.value=x}}}}var gt={alternating:{type:Boolean,default:!1},buttonsPagination:{type:Boolean,default:!1},checkboxColumnWidth:{type:Number,default:null},currentPage:{type:Number,default:1},emptyMessage:{type:String,default:"No Available Data"},expandColumnWidth:{type:Number,default:36},filterOptions:{type:Array,default:null},fixedExpand:{type:Boolean,default:!1},fixedHeader:{type:Boolean,default:!0},fixedCheckbox:{type:Boolean,default:!1},fixedIndex:{type:Boolean,default:!1},headerTextDirection:{type:String,default:"left"},bodyTextDirection:{type:String,default:"left"},hideFooter:{type:Boolean,default:!1},hideRowsPerPage:{type:Boolean,default:!1},hideHeader:{type:Boolean,default:!1},indexColumnWidth:{type:Number,default:60},itemsSelected:{type:Array,default:null},loading:{type:Boolean,deault:!1},rowsPerPage:{type:Number,default:25},rowsItems:{type:Array,default:()=>[25,50,100]},rowsPerPageMessage:{type:String,default:"rows per page:"},searchField:{type:[String,Array],default:""},searchValue:{type:String,default:""},serverOptions:{type:Object,default:null},serverItemsLength:{type:Number,default:0},showIndex:{type:Boolean,default:!1},sortBy:{type:[String,Array],default:""},sortType:{type:[String,Array],default:"asc"},multiSort:{type:Boolean,default:!1},tableMinHeight:{type:Number,default:180},tableHeight:{type:Number,default:null},themeColor:{type:String,default:"#42b883"},tableClassName:{type:String,default:""},headerClassName:{type:String,default:""},headerItemClassName:{type:[Function,String],default:""},bodyRowClassName:{type:[Function,String],default:""},bodyExpandRowClassName:{type:[Function,String],default:""},bodyItemClassName:{type:[Function,String],default:""},noHover:{type:Boolean,default:!1},borderCell:{type:Boolean,default:!1},mustSort:{type:Boolean,default:!1},rowsOfPageSeparatorMessage:{type:String,default:"of"},clickEventType:{type:String,default:"single"}},ba="",ka="";const yt=o=>(e.pushScopeId("data-v-9d7294d0"),o=o(),e.popScopeId(),o),ht=["onClick"],_t={key:1,class:"header-text"},bt={key:3,class:"multi-sort__number"},kt=["onClick","onDblclick"],xt=["onClick"],Pt=["colspan"],Nt={key:0,class:"vue3-easy-data-table__loading"},St=yt(()=>e.createElementVNode("div",{class:"vue3-easy-data-table__loading-mask"},null,-1)),Ct={class:"loading-entity"},Bt={key:1,class:"vue3-easy-data-table__message"},wt={key:0,class:"vue3-easy-data-table__footer"},It={key:0,class:"pagination__rows-per-page"},Et={class:"pagination__items-index"},$t=e.defineComponent({props:ne(z({},gt),{items:{type:Array,required:!0},headers:{type:Array,required:!0}}),emits:["clickRow","expandRow","updateSort","updateFilter","update:itemsSelected","update:serverOptions"],setup(o,{expose:l,emit:t}){const a=o;e.useCssVars(f=>({fc9c1b54:e.unref(X),"7b77e95a":e.unref(A)}));const{clickEventType:m,bodyTextDirection:s,checkboxColumnWidth:g,currentPage:n,expandColumnWidth:r,filterOptions:i,fixedCheckbox:h,fixedExpand:u,fixedHeader:b,fixedIndex:_,headers:R,headerTextDirection:k,indexColumnWidth:w,items:D,itemsSelected:F,loading:d,mustSort:P,multiSort:x,rowsItems:p,rowsPerPage:I,searchField:C,searchValue:v,serverItemsLength:U,serverOptions:M,showIndex:y,sortBy:V,sortType:N,tableHeight:T,tableMinHeight:Q,themeColor:oe,rowsOfPageSeparatorMessage:G}=e.toRefs(a),A=e.computed(()=>T.value?`${T.value}px`:null),X=e.computed(()=>`${Q.value}px`);e.provide("themeColor",oe.value);const W=e.useSlots(),vt=e.computed(()=>!!W.pagination),Vt=e.computed(()=>!!W.loading),ge=e.computed(()=>!!W.expand),At=e.computed(()=>!!W.body),ye=e.ref(),ce=e.ref();e.provide("dataTable",ye);const he=e.ref(!1);e.onMounted(()=>{ce.value.addEventListener("scroll",()=>{he.value=ce.value.scrollLeft>0})});const de=e.computed(()=>F.value!==null),q=e.computed(()=>M.value!==null),{serverOptionsComputed:ue,updateServerOptionsPage:Lt,updateServerOptionsSort:Rt,updateServerOptionsRowsPerPage:Ft}=pt(M,x,t),{clientSortOptions:_e,headerColumns:be,headersForRender:J,updateSortField:Tt,isMultiSorting:Dt,getMultiSortNumber:zt}=it(g,r,h,u,_,R,ge,w,de,q,P,ue,y,V,N,x,Rt,t),{rowsItemsComputed:ke,rowsPerPageRef:j,updateRowsPerPage:Ht}=ut(q,p,M,I),{totalItems:Mt,selectItemsComputed:Ot,totalItemsLength:le,toggleSelectAll:jt,toggleSelectItem:Wt}=mt(_e,i,q,D,F,C,v,U,x,t),{currentPaginationNumber:O,maxPaginationNumber:Y,isLastPage:Z,isFirstPage:ee,nextPage:te,prevPage:ae,updatePage:se,updateCurrentPaginationNumber:qt}=dt(n,q,d,le,j,M,Lt),{currentPageFirstIndex:xe,currentPageLastIndex:Pe,multipleSelectStatus:Ne,pageItems:K}=ct(O,de,q,D,j,Ot,y,Mt,le),ie=e.computed(()=>O.value===0?0:(O.value-1)*j.value),{expandingItemIndexList:Se,updateExpandingItemIndexList:Jt,clearExpandingItemIndexList:Ce}=lt(K,ie,t),{fixedHeaders:pe,lastFixedColumn:Be,fixedColumnsInfos:Ut}=st(J),{clickRow:we}=ot(m,de,y,t),Gt=f=>{var c;const H=(c=f.width)!=null?c:pe.value.length?100:null;if(H)return`width: ${H}px; min-width: ${H}px;`},Ie=(f,H="th")=>{if(!pe.value.length)return;const c=Ut.value.find(L=>L.value===f);if(c)return`left: ${c.distance}px;z-index: ${H==="th"?3:1};position: sticky;`};return e.watch(d,(f,H)=>{ue.value&&f===!1&&H===!0&&(qt(ue.value.page),Ce())}),e.watch(j,f=>{q.value?Ft(f):se(1)}),e.watch(v,()=>{q.value||se(1)}),e.watch([O,_e,C,v,i],()=>{Ce()},{deep:!0}),l({currentPageFirstIndex:xe,currentPageLastIndex:Pe,clientItemsLength:le,maxPaginationNumber:Y,currentPaginationNumber:O,isLastPage:Z,isFirstPage:ee,nextPage:te,prevPage:ae,updatePage:se,rowsPerPageOptions:ke,rowsPerPageActiveOption:j,updateRowsPerPageActiveOption:Ht}),(f,H)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dataTable",ref:ye,class:e.normalizeClass(["vue3-easy-data-table",[f.tableClassName]])},[e.createElementVNode("div",{ref_key:"tableBody",ref:ce,class:e.normalizeClass(["vue3-easy-data-table__main",{"fixed-header":e.unref(b),"fixed-height":e.unref(T),"show-shadow":he.value,"table-fixed":e.unref(pe).length,hoverable:!f.noHover,"border-cell":f.borderCell}])},[e.createElementVNode("table",null,[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(J),(c,L)=>(e.openBlock(),e.createElementBlock("col",{key:L,style:e.normalizeStyle(Gt(c))},null,4))),128))]),e.unref(J).length&&!f.hideHeader?(e.openBlock(),e.createElementBlock("thead",{key:0,class:e.normalizeClass(["vue3-easy-data-table__header",[f.headerClassName]])},[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(J),(c,L)=>(e.openBlock(),e.createElementBlock("th",{key:L,class:e.normalizeClass([{sortable:c.sortable,none:c.sortable&&c.sortType==="none",desc:c.sortable&&c.sortType==="desc",asc:c.sortable&&c.sortType==="asc",shadow:c.value===e.unref(Be)},typeof f.headerItemClassName=="string"?f.headerItemClassName:f.headerItemClassName(c,L)]),style:e.normalizeStyle(Ie(c.value)),onClick:e.withModifiers(E=>c.sortable&&c.sortType?e.unref(Tt)(c.value,c.sortType):null,["stop"])},[c.text==="checkbox"?(e.openBlock(),e.createBlock(Te,{key:e.unref(Ne),status:e.unref(Ne),onChange:e.unref(jt)},null,8,["status","onChange"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["header",`direction-${e.unref(k)}`])},[e.unref(W)[`header-${c.value}`]?e.renderSlot(f.$slots,`header-${c.value}`,e.normalizeProps(e.mergeProps({key:0},c)),void 0,!0):(e.openBlock(),e.createElementBlock("span",_t,e.toDisplayString(c.text),1)),c.sortable?(e.openBlock(),e.createElementBlock("i",{key:c.sortType?c.sortType:"none",class:e.normalizeClass(["sortType-icon",{desc:c.sortType==="desc"}])},null,2)):e.createCommentVNode("",!0),e.unref(x)&&e.unref(Dt)(c.value)?(e.openBlock(),e.createElementBlock("span",bt,e.toDisplayString(e.unref(zt)(c.value)),1)):e.createCommentVNode("",!0)],2))],14,ht))),128))])],2)):e.createCommentVNode("",!0),e.unref(At)?e.renderSlot(f.$slots,"body",e.normalizeProps(e.mergeProps({key:1},e.unref(K))),void 0,!0):e.unref(be).length?(e.openBlock(),e.createElementBlock("tbody",{key:2,class:e.normalizeClass(["vue3-easy-data-table__body",{"row-alternation":f.alternating}])},[e.renderSlot(f.$slots,"body-prepend",e.normalizeProps(e.guardReactiveProps({items:e.unref(K),pagination:{isFirstPage:e.unref(ee),isLastPage:e.unref(Z),currentPaginationNumber:e.unref(O),maxPaginationNumber:e.unref(Y),nextPage:e.unref(te),prevPage:e.unref(ae)},headers:e.unref(J)})),void 0,!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(K),(c,L)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:L},[e.createElementVNode("tr",{class:e.normalizeClass([{"even-row":(L+1)%2===0},typeof f.bodyRowClassName=="string"?f.bodyRowClassName:f.bodyRowClassName(c,L)]),onClick:E=>e.unref(we)(c,"single"),onDblclick:E=>e.unref(we)(c,"double")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(be),(E,Ee)=>(e.openBlock(),e.createElementBlock("td",{key:Ee,style:e.normalizeStyle(Ie(E,"td")),class:e.normalizeClass([{shadow:E===e.unref(Be),"can-expand":E==="expand"},typeof f.bodyItemClassName=="string"?f.bodyItemClassName:f.bodyItemClassName(E,Ee),`direction-${e.unref(s)}`]),onClick:$e=>E==="expand"?e.unref(Jt)(L+e.unref(ie),c,$e):null},[e.unref(W)[`item-${E}`]?e.renderSlot(f.$slots,`item-${E}`,e.normalizeProps(e.mergeProps({key:0},c)),void 0,!0):e.unref(W)[`item-${E.toLowerCase()}`]?e.renderSlot(f.$slots,`item-${E.toLowerCase()}`,e.normalizeProps(e.mergeProps({key:1},c)),void 0,!0):E==="expand"?(e.openBlock(),e.createElementBlock("i",{key:2,class:e.normalizeClass(["expand-icon",{expanding:e.unref(Se).includes(e.unref(ie)+L)}])},null,2)):E==="checkbox"?(e.openBlock(),e.createBlock(Me,{key:3,checked:c[E],onChange:$e=>e.unref(Wt)(c)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(e.unref(ft)(E,c)),1)],64))],14,xt))),128))],42,kt),e.unref(ge)&&e.unref(Se).includes(L+e.unref(ie))?(e.openBlock(),e.createElementBlock("tr",{key:0,class:e.normalizeClass([{"even-row":(L+1)%2===0},typeof f.bodyExpandRowClassName=="string"?f.bodyExpandRowClassName:f.bodyExpandRowClassName(c,L)])},[e.createElementVNode("td",{colspan:e.unref(J).length,class:"expand"},[c.expandLoading?(e.openBlock(),e.createBlock(Ye,{key:0,class:"expand-loading"})):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"expand",e.normalizeProps(e.guardReactiveProps(c)),void 0,!0)],8,Pt)],2)):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(f.$slots,"body-append",e.normalizeProps(e.guardReactiveProps({items:e.unref(K),pagination:{isFirstPage:e.unref(ee),isLastPage:e.unref(Z),currentPaginationNumber:e.unref(O),maxPaginationNumber:e.unref(Y),nextPage:e.unref(te),prevPage:e.unref(ae)},headers:e.unref(J)})),void 0,!0)],2)):e.createCommentVNode("",!0)]),e.unref(d)?(e.openBlock(),e.createElementBlock("div",Nt,[St,e.createElementVNode("div",Ct,[e.unref(Vt)?e.renderSlot(f.$slots,"loading",{key:0},void 0,!0):(e.openBlock(),e.createBlock(Qe,{key:1}))])])):e.createCommentVNode("",!0),!e.unref(K).length&&!e.unref(d)?(e.openBlock(),e.createElementBlock("div",Bt,e.toDisplayString(f.emptyMessage),1)):e.createCommentVNode("",!0)],2),f.hideFooter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",wt,[f.hideRowsPerPage?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",It,[e.createTextVNode(e.toDisplayString(f.rowsPerPageMessage)+" ",1),e.createVNode(Ue,{modelValue:e.unref(j),"onUpdate:modelValue":H[0]||(H[0]=c=>e.isRef(j)?j.value=c:null),"rows-items":e.unref(ke)},null,8,["modelValue","rows-items"])])),e.createElementVNode("div",Et,e.toDisplayString(`${e.unref(xe)}\u2013${e.unref(Pe)}`)+" "+e.toDisplayString(e.unref(G))+" "+e.toDisplayString(e.unref(le)),1),e.unref(vt)?e.renderSlot(f.$slots,"pagination",e.normalizeProps(e.mergeProps({key:1},{isFirstPage:e.unref(ee),isLastPage:e.unref(Z),currentPaginationNumber:e.unref(O),maxPaginationNumber:e.unref(Y),nextPage:e.unref(te),prevPage:e.unref(ae)})),void 0,!0):(e.openBlock(),e.createBlock(rt,{key:2,"is-first-page":e.unref(ee),"is-last-page":e.unref(Z),onClickNextPage:e.unref(te),onClickPrevPage:e.unref(ae)},e.createSlots({_:2},[f.buttonsPagination?{name:"buttonsPagination",fn:e.withCtx(()=>[e.createVNode(tt,{"current-pagination-number":e.unref(O),"max-pagination-number":e.unref(Y),onUpdatePage:e.unref(se)},null,8,["current-pagination-number","max-pagination-number","onUpdatePage"])])}:void 0]),1032,["is-first-page","is-last-page","onClickNextPage","onClickPrevPage"]))]))],2))}});var me=S($t,[["__scopeId","data-v-9d7294d0"]]);return typeof window!="undefined"&&window.Vue&&window.Vue.createApp({}).component("Vue3EasyDataTable",me),me}); |
@@ -6,3 +6,3 @@ { | ||
"private": false, | ||
"version": "1.5.12", | ||
"version": "1.5.13", | ||
"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
115883
1831