UNPKG

vue-data-ui-hq

Version:

A user-empowering data visualization Vue 3 components library for eloquent data storytelling

14 lines 74.2 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-ZfICPrrM.cjs"),e=require("vue"),p=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),b={name:"vue-ui-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},data(){return{uid:`vue-ui-table-${Math.random()}`,bodyCopy:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),buttonTimeout:null,canMoveChart:!1,chart:{height:316,type:"bar",width:512},constants:{ASC:1,BAR:"bar",DATE:"date",DESC:-1,DONUT:"donut",LINE:"line",NUMERIC:"numeric",PERCENTAGE:"percentage",TEXT:"text"},clientX:100,clientY:100,cssClass:{CELL:"smart-td-selected",FIRST_TD:"smart-td-selected-first",LAST_TD:"smart-td-selected-last",ROW:"smart-td-selected-neighbor"},currentDonut:void 0,currentFilter:void 0,currentSearch:void 0,currentSelectionSpan:{col:void 0,rows:[]},currentPage:0,dates:{},filteredDatesIndexes:{},hasNaN:{},iconColor:"#2D353C",iconSize:20,immutableRangeFilters:{},isExportRequest:!1,isLoading:!1,itemsPerPage:this.config.rowsPerPage?this.config.rowsPerPage:25,multiselects:{},paginatorOptions:[...new Set([10,25,50,100,250,500,this.config.rowsPerPage?this.config.rowsPerPage:25,this.dataset.body.length])].sort((l,o)=>l-o),palette:m.palette,percentages:{},rafId:null,rangeFilters:{},searches:{},selectedColumn:void 0,selectedDonutCategory:void 0,selectedPlot:void 0,showChart:!1,showDonutOptions:!1,sorts:{},tableBody:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),tableHead:JSON.parse(JSON.stringify(this.dataset.header)).map(l=>({average:Object.hasOwn(l,"average")?l.average:!1,decimals:Object.hasOwn(l,"decimals")?l.decimals:0,isMultiselect:Object.hasOwn(l,"isMultiselect")?l.isMultiselect:!1,isPercentage:Object.hasOwn(l,"isPercentage")?l.isPercentage:!1,isSearch:Object.hasOwn(l,"isSearch")?l.isSearch:!1,isSort:Object.hasOwn(l,"isSort")?l.isSort:!1,name:l.name,percentageTo:Object.hasOwn(l,"percentageTo")?l.percentageTo:void 0,prefix:Object.hasOwn(l,"prefix")?l.prefix:"",rangeFilter:Object.hasOwn(l,"rangeFilter")?l.rangeFilter:!1,suffix:Object.hasOwn(l,"suffix")?l.suffix:"",sum:Object.hasOwn(l,"sum")?l.sum:!1,type:l.type}))}},mounted(){if(this.dataset.header.length===0)throw new Error(`vue-ui-table error: missing header data. Provide an array of objects of type: { name: string; type: string; ('text' | 'numeric' | 'date') average: boolean; decimals: number | undefined; sum: boolean; isSort:boolean; isSearch: boolean; isMultiselect: boolean; isPercentage: boolean; percentageTo: string; (or '') }`);if(this.dataset.body.length===0)throw new Error("vue-ui-table error: missing body data");this.isLoading=!0,this.promiseWithAsyncFunction(this.prepareBodyCopy,()=>{this.$forceUpdate(),this.isLoading=!1}),document.addEventListener("keydown",n=>{const l=document.activeElement;(l&&Array.from(l.classList).includes("td-focusable")&&n.key.includes("Arrow")||n.code==="Space")&&n.preventDefault()})},watch:{showChart:function(n){n&&this.$nextTick(()=>{this.closeDragElement();const l=this.$refs.chartModal;l.onmousedown=this.dragMouseDown})}},computed:{availableDonutCategories(){return Object.keys(this.multiselects).map(n=>({index:n,name:this.dataset.header[n].name,options:this.multiselects[n]}))},canChart(){return this.FINAL_CONFIG.useChart&&this.currentSelectionSpan.rows.length>1},chartData(){if(!this.canChart)return[];const n=316,l=512,o=this.currentSelectionSpan.rows.length,c=l/o,r=Math.max(...this.currentSelectionSpan.rows.map(h=>h.value)),t=Math.min(...this.currentSelectionSpan.rows.map(h=>h.value)),s=t>=0?0:Math.abs(t),a=r+s,i=r<0&&t<0,u=this.dataset.header[this.currentSelectionSpan.col].isPercentage,d=this.currentSelectionSpan.rows.map((h,N)=>({x:c*N+c/2,y:(1-(h.value+s)/a)*n,value:u?h.value*100:h.value,suffix:u?"%":this.dataset.header[this.currentSelectionSpan.col].suffix?this.dataset.header[this.currentSelectionSpan.col].suffix:"",prefix:this.dataset.header[this.currentSelectionSpan.col].prefix?this.dataset.header[this.currentSelectionSpan.col].prefix:"",index:h.index,absoluteValue:u?Math.abs(h.value)*100:Math.abs(h.value)})),y=n-n*(s/a);return{isAllNegative:i,zero:y,plots:d,slot:c,progression:d.length>=2?this.calcLinearProgression(d):!1}},donutHollowLabels(){return{total:Number((this.currentDonut.map(n=>n.absoluteValue).reduce((n,l)=>n+l,0)*(this.dataset.header[this.currentSelectionSpan.col].isPercentage?100:1)).toFixed(this.dataset.header[this.currentSelectionSpan.col].decimals)).toLocaleString(),average:Number((this.currentDonut.map(n=>n.absoluteValue).reduce((n,l)=>n+l,0)/this.currentSelectionSpan.rows.length*(this.dataset.header[this.currentSelectionSpan.col].isPercentage?100:1)).toFixed(this.dataset.header[this.currentSelectionSpan.col].decimals)).toLocaleString()}},hasNumericTypes(){return this.dataset.header.map(n=>n.type).includes(this.constants.NUMERIC)},icons(){return{arrowSort:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 9l4 -4l4 4m-4 -4v14" /><path d="M21 15l-4 4l-4 -4m4 4v-14" /></svg>`,bar:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 12m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z" /><path d="M9 8m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z" /><path d="M15 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z" /><path d="M4 20l14 0" /></svg>`,chart:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 19l16 0" /><path d="M4 15l4 -6l4 2l4 -5l4 4" /></svg>`,chevronDown:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 9l6 6l6 -6" /></svg>`,chevronLeft:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize*1.6}" height="${this.iconSize*1.6}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 6l-6 6l6 6" /></svg>`,chevronRight:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize*1.6}" height="${this.iconSize*1.6}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l6 6l-6 6" /></svg>`,donut:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize*.8}" height="${this.iconSize*.8}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 3v5m4 4h5" /><path d="M8.929 14.582l-3.429 2.918" /><path d="M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" /><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /></svg>`,export:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12.5 21h-7.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7.5" /><path d="M3 10h18" /><path d="M10 3v18" /><path d="M16 19h6" /><path d="M19 16l3 3l-3 3" /></svg>`,fileDownload:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4" /><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /><path d="M12 17v-6" /><path d="M9.5 14.5l2.5 2.5l2.5 -2.5" /></svg>`,filter:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" /></svg>`,move:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 9l3 3l-3 3" /><path d="M15 12h6" /><path d="M6 9l-3 3l3 3" /><path d="M3 12h6" /><path d="M9 18l3 3l3 -3" /><path d="M12 15v6" /><path d="M15 6l-3 -3l-3 3" /><path d="M12 3v6" /></svg>`,sort09:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 15l3 3l3 -3" /><path d="M7 6v12" /><path d="M17 3a2 2 0 0 1 2 2v3a2 2 0 1 1 -4 0v-3a2 2 0 0 1 2 -2z" /><path d="M17 16m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /><path d="M19 16v3a2 2 0 0 1 -2 2h-1.5" /></svg>`,sort90:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 15l3 3l3 -3" /><path d="M7 6v12" /><path d="M17 14a2 2 0 0 1 2 2v3a2 2 0 1 1 -4 0v-3a2 2 0 0 1 2 -2z" /><path d="M17 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /><path d="M19 5v3a2 2 0 0 1 -2 2h-1.5" /></svg>`,sortAZ:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 10v-5c0 -1.38 .62 -2 2 -2s2 .62 2 2v5m0 -3h-4" /><path d="M19 21h-4l4 -7h-4" /><path d="M4 15l3 3l3 -3" /><path d="M7 6v12" /></svg>`,sortZA:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 21v-5c0 -1.38 .62 -2 2 -2s2 .62 2 2v5m0 -3h-4" /><path d="M19 10h-4l4 -7h-4" /><path d="M4 15l3 3l3 -3" /><path d="M7 6v12" /></svg>`,sum:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>`,table:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" fill="white" d="M 10 2, 21 2, 21 21, 10 21Z"/><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" /><path d="M3 10h18" /><path d="M10 3v18" /></svg>`,warning:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize*.8}" height="${this.iconSize*.8}" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z" /><path d="M12 9v4" /><path d="M12 17h.01" /></svg>`}},pages(){const n=[];if(this.bodyCopy.length)for(let l=0;l<this.bodyCopy.length;l+=this.itemsPerPage)n.push(this.bodyCopy.slice(l,l+this.itemsPerPage));return n},rows(){return this.bodyCopy.map(n=>n.td)},selectedCellsCalculations(){return{sumPercentage:Number((this.currentSelectionSpan.rows.map(n=>n.value).reduce((n,l)=>n+l,0)*100).toFixed(this.dataset.header[this.currentSelectionSpan.col].decimals)).toLocaleString(),sumRegular:Number(this.currentSelectionSpan.rows.map(n=>n.value).reduce((n,l)=>n+l,0).toFixed(this.dataset.header[this.currentSelectionSpan.col].decimals)).toLocaleString(),averagePercentage:Number((this.currentSelectionSpan.rows.map(n=>n.value).reduce((n,l)=>n+l,0)/this.currentSelectionSpan.rows.length*100).toFixed(this.dataset.header[this.currentSelectionSpan.col].decimals)).toLocaleString(),averageRegular:Number((this.currentSelectionSpan.rows.map(n=>n.value).reduce((n,l)=>n+l,0)/this.currentSelectionSpan.rows.length).toFixed(this.dataset.header[this.currentSelectionSpan.col].decimals)).toLocaleString()}},FINAL_CONFIG(){const{vue_ui_table:n}=m.useConfig();if(!Object.keys(this.config||{}).length)return n;const l=this.treeShake({defaultConfig:n,userConfig:this.config});return this.convertConfigColors(l)},visibleRows(){return this.pages[this.currentPage]}},methods:{treeShake:m.treeShake,makeDonut:m.makeDonut,convertColorToHex:m.convertColorToHex,convertConfigColors:m.convertConfigColors,createCsvContent:m.createCsvContent,downloadCsv:m.downloadCsv,applyDonutOption(){const n=this.selectedDonutCategory.options.map((l,o)=>({name:l,color:this.palette[o]||this.palette[o%this.palette.length],value:this.visibleRows.filter((c,r)=>c.td[this.selectedDonutCategory.index]===l&&this.currentSelectionSpan.rows.map(t=>t.index).includes(r)).map(c=>c.td[this.currentSelectionSpan.col]).reduce((c,r)=>Math.abs(c)+Math.abs(r),0),absoluteValue:this.visibleRows.filter((c,r)=>c.td[this.selectedDonutCategory.index]===l&&this.currentSelectionSpan.rows.map(t=>t.index).includes(r)).map(c=>c.td[this.currentSelectionSpan.col]).reduce((c,r)=>c+r,0)})).sort((l,o)=>o.value-l.value);this.currentDonut=this.makeDonut({series:n},50,50,30,30),this.$nextTick(()=>{this.chart.type=this.constants.DONUT,this.showDonutOptions=!1})},calcRectY(n,l){return n>=0?l:this.chartData.zero},canResetColumn(n,l){return!this.hasNaN[n]&&(l.isSort||l.isSearch||l.isMultiselect||l.rangeFilter)&&![this.constants.DATE].includes(l.type)},createXls(n="all"){const l=this.dataset.header.map(t=>t.name),o=n==="all"?this.bodyCopy.map(t=>t.td):this.visibleRows.map(t=>t.td),c=[l].concat(o),r=this.createCsvContent(c);this.downloadCsv({csvContent:r,title:"vue-ui-table"})},calcLinearProgression:m.calcLinearProgression,closeAllDropdowns(){const n=document.getElementsByClassName("th-dropdown");n.length&&Array.from(n).forEach(l=>{l.dataset.isOpen=!1})},debounce(n,l){let o;clearTimeout(o),o=setTimeout(n,l)},filterBody(){this.bodyCopy=this.tableBody.filter(n=>{for(const l in this.searches)if(!n.td[l].toUpperCase().includes(this.searches[l].toUpperCase()))return!1;for(const l in this.multiselects)if(!this.multiselects[l].some(c=>c===n.td[l]))return!1;for(const l in this.dates){const o=new Date(n.td[l]),c=new Date(this.dates[l].from),r=new Date(this.dates[l].to);if(o<c||o>r)return!1}return!0}),this.sortBody()},getAverage(n){return this.rows.map(l=>l[n]).map(l=>isNaN(Number(l))?0:l).reduce((l,o)=>l+o,0)/this.bodyCopy.length},getDatesRange(n){const l=this.dataset.body.map(h=>new Date(h.td[n])),o=new Date(Math.min(...l)),c=new Date(Math.max(...l)),r=o.getFullYear(),t=c.getFullYear(),s=String(o.getMonth()+1).padStart(2,"0"),a=String(c.getMonth()+1).padStart(2,"0"),i=String(o.getDate()).padStart(2,"0"),u=String(c.getDate()).padStart(2,"0"),d=`${r}-${s}-${i}`,y=`${t}-${a}-${u}`;return{from:d,to:y}},getDonutLegendValue(n){return Number((n*(this.dataset.header[this.currentSelectionSpan.col].isPercentage?100:1)).toFixed(this.dataset.header[this.currentSelectionSpan.col].decimals)).toLocaleString()},getDropdownOptions(n){return[...new Set(this.dataset.body.map(l=>l.td[n]))]},getSum(n){return this.rows.map(l=>l[n]).map(l=>isNaN(Number(l))?0:l).reduce((l,o)=>l+o,0)},includesNaN(n){return n.includes(NaN)},isDropdownOptionSelected(n,l){return this.multiselects[l]?this.multiselects[l].includes(n):!0},isNumeric(n){return!isNaN(Number(String(n).replaceAll("%","")))},isResetDisabled(n,l){const o=l.isSort,c=l.isSearch,r=l.isMultiselect&&this.multiselects[n],t=l.rangeFilter,s=a=>{if(t&&this.rangeFilters[a])return Math.round(this.rangeFilters[a].min)===this.immutableRangeFilters[a].min&&Math.round(this.rangeFilters[a].max)===this.immutableRangeFilters[a].max};if(o&&c&&r&&t)return["",void 0].includes(this.searches[n])&&[void 0].includes(this.sorts[n])&&this.multiselects[n].length===this.getDropdownOptions(n).length&&s(n);if(o&&c&&r)return["",void 0].includes(this.searches[n])&&[void 0].includes(this.sorts[n])&&this.multiselects[n].length===this.getDropdownOptions(n).length;if(o&&c&&t)return["",void 0].includes(this.searches[n])&&[void 0].includes(this.sorts[n])&&s(n);if(o&&c)return["",void 0].includes(this.searches[n])&&[void 0].includes(this.sorts[n]);if(o&&r&&t)return[void 0].includes(this.sorts[n])&&this.multiselects[n].length===this.getDropdownOptions(n).length&&s(n);if(o&&r)return[void 0].includes(this.sorts[n])&&this.multiselects[n].length===this.getDropdownOptions(n).length;if(c&&r&&t)return["",void 0].includes(this.searches[n])&&this.multiselects[n].length===this.getDropdownOptions(n).length&&s(n);if(c&&r)return["",void 0].includes(this.searches[n])&&this.multiselects[n].length===this.getDropdownOptions(n).length;if(c&&t)return["",void 0].includes(this.searches[n])&&s(n);if(c)return["",void 0].includes(this.searches[n]);if(o&&t)return[void 0].includes(this.sorts[n])&&s(n);if(o)return[void 0].includes(this.sorts[n]);if(r&&t)return this.multiselects[n].length===this.getDropdownOptions(n).length&&s(n);if(r)return this.multiselects[n].length===this.getDropdownOptions(n).length},navigate(n){this.resetSelection(),n==="next"&&this.currentPage<this.pages.length?this.currentPage+=1:n==="previous"&&this.currentPage>=1?this.currentPage-=1:this.currentPage=n-1,this.$refs.tableWrapper.scrollTo({top:0,left:0,behavior:"smooth"})},navigateCell(n){n.preventDefault();const l=n.keyCode,o=38,c=40,r=37,t=39;if(![o,c,r,t].includes(l))return;const s=n.target.id,a=/cell_(\d+)_(\d+)_vue-ui-table-(\d+)/,i=s.match(a),u=parseInt(i[1]),d=parseInt(i[2]),y=document.getElementById(`cell_${u}_${d+1}_${this.uid}`),h=document.getElementById(`cell_${u}_${d-1}_${this.uid}`),N=document.getElementById(`cell_${u+1}_${d}_${this.uid}`),k=document.getElementById(`cell_${u-1}_${d}_${this.uid}`);let g;switch(!0){case l===t:g=y;break;case l===r:g=h;break;case l===o:g=k;break;case l===c:g=N;break;default:return}g&&(g.focus(),g.scrollIntoView({behavior:"smooth",block:"center"}))},openDonutOptions(){this.selectedDonutCategory=this.availableDonutCategories[0],this.showDonutOptions=!0},placeLabelOnTopOrBottom({previousPlot:n,currentPlot:l,nextPlot:o}){const c=l.y-38,r=l.y+16;return n&&o?n.value<l.value&&o.value<l.value?c:n.value>l.value&&o.value>l.value?r:(n.value>l.value&&o.value<l.value||n.value<l.value&&o.value>l.value,c):n&&!o?n.value>l.value?r:c:!n&&o&&o.value>l.value?r:c},async prepareBodyCopy(){return new Promise(n=>{const l=[];this.tableHead.forEach((o,c)=>{if(o.isSearch&&Object.assign(this.searches,{[c]:""}),o.isMultiselect&&Object.assign(this.multiselects,{[c]:this.getDropdownOptions(c)}),o.type===this.constants.DATE&&(Object.assign(this.dates,{[c]:this.getDatesRange(c)}),Object.assign(this.filteredDatesIndexes,{[c]:!1})),(o.isPercentage||o.percentageTo)&&Object.assign(this.percentages,{[c]:{reference:o.percentageTo,referenceIndex:this.dataset.header.map(r=>r.name).indexOf(o.percentageTo)}}),o.rangeFilter&&(Object.assign(this.rangeFilters,{[c]:{min:Math.round(Math.min(...this.dataset.body.map(r=>r.td).map(r=>r[c]))),max:Math.round(Math.max(...this.dataset.body.map(r=>r.td).map(r=>r[c])))}}),Object.assign(this.immutableRangeFilters,{[c]:{min:Math.round(Math.min(...this.dataset.body.map(r=>r.td).map(r=>r[c]))),max:Math.round(Math.max(...this.dataset.body.map(r=>r.td).map(r=>r[c])))}})),o.isPercentage){const r=this.dataset.header.map(s=>s.name).indexOf(o.percentageTo),t=this.dataset.body.map(s=>s.td[r]).reduce((s,a)=>s+a,0);l.push([c,r,t])}o.type===this.constants.NUMERIC&&!o.isPercentage&&Object.assign(this.hasNaN,{[c]:this.includesNaN(this.dataset.body.map(r=>Number(r.td[c])))})}),this.bodyCopy.forEach((o,c)=>{l.map(r=>{const[t,s,a]=r;o.td[t]=o.td[s]/a}),o.td.forEach((r,t)=>{this.dataset.header[t].type===this.constants.TEXT&&this.dataset.header[t].isSearch&&(o[t]=this.stringToNumber(r)),this.dataset.header[t].type===this.constants.DATE&&(o[t]=new Date(r).getTime()),this.dataset.header[t].type===this.constants.NUMERIC&&(o[t]=isNaN(Number(r))?t:r),this.tableBody[c][t]=o[t]})}),n(!0)})},promiseWithAsyncFunction(n,l){return new Promise((o,c)=>{n().then(r=>{try{const t=l(r);o(t)}catch(t){c(t)}}).catch(r=>{c(r)})})},resetDates(n){this.dates[n]={from:this.getDatesRange(n).from,to:this.getDatesRange(n).to},this.filteredDatesIndexes[n]=!1,this.$forceUpdate(),this.filterBody()},resetFilter(n,l,o){const c=o.currentTarget;clearTimeout(this.buttonTimeout),c.classList.add("clicked"),this.buttonTimeout=setTimeout(()=>{c.classList.remove("clicked")},200),this.currentFilter=void 0,l.rangeFilter&&(this.rangeFilters[n].min=this.immutableRangeFilters[n].min,this.rangeFilters[n].max=this.immutableRangeFilters[n].max),l.isMultiselect?(this.multiselects[n]=this.getDropdownOptions(n),l.type===this.constants.TEXT&&(this.sorts[n]=void 0),l.isSearch&&(this.searches[n]="")):l.type===this.constants.NUMERIC?this.sorts[n]=void 0:l.type===this.constants.TEXT?(this.sorts[n]=void 0,this.searches[n]=""):l.type===this.constants.DATE&&(this.sorts[n]=void 0),this.filterBody()},resetSelection(){const n=document.getElementsByClassName(`tr_${this.uid}`);Array.from(n).forEach(l=>{Array.from(l.getElementsByTagName("td")).forEach(o=>{o.dataset.row==="even"?(o.style.background=this.FINAL_CONFIG.style.rows.even.backgroundColor,o.style.color=this.FINAL_CONFIG.style.rows.even.color):(o.style.background=this.FINAL_CONFIG.style.rows.odd.backgroundColor,o.style.color=this.FINAL_CONFIG.style.rows.odd.color)})}),Array.from(n).forEach(l=>l.dataset.selected="false"),this.currentPage>this.pages.length-1&&(this.currentPage=this.pages.length-1),this.showChart=!1,this.currentDonut=void 0,this.selectedColumn=void 0,this.chart.type=this.constants.BAR,this.currentSelectionSpan={col:void 0,rows:[]},this.clientX=100,this.clientY=100},selectColumn(n){this.currentSelectionSpan.col!==n?(this.visibleRows.forEach((l,o)=>{this.selectTd({td:l.td[n],rowIndex:o,colIndex:n,headerType:this.constants.NUMERIC,event:{currentTarget:document.getElementById(`cell_${o}_${n}_${this.uid}`)}})}),this.selectedColumn=n):(this.selectedColumn=void 0,this.resetSelection())},selectDropdownOption(n,l){this.multiselects[l].includes(n)?this.multiselects[l]=this.multiselects[l].filter(o=>o!==n):this.multiselects[l].push(n),this.$forceUpdate(),this.filterBody()},selectTd({td:n,rowIndex:l,colIndex:o,headerType:c,event:r}){if(c!==this.constants.NUMERIC||isNaN(Number(n))){this.resetSelection();return}this.currentSelectionSpan.col!==o&&this.resetSelection();const t=r.currentTarget.parentNode;this.currentSelectionSpan.col=o,this.currentSelectionSpan.rows.map(s=>s.index).includes(l)?(t.dataset.selected="false",this.currentSelectionSpan.rows=this.currentSelectionSpan.rows.filter(s=>s.index!==l),r.currentTarget.classList.remove(this.cssClass.CELL),Array.from(t.children).forEach((s,a)=>{s.dataset.row==="even"?(s.style.background=this.FINAL_CONFIG.style.rows.even.backgroundColor,s.style.color=this.FINAL_CONFIG.style.rows.even.olor):(s.style.background=this.FINAL_CONFIG.style.rows.odd.backgroundColor,s.style.color=this.FINAL_CONFIG.style.rows.odd.color)}),r.currentTarget.dataset.row==="even"?(r.currentTarget.style.background=this.FINAL_CONFIG.style.rows.even.backgroundColor,r.currentTarget.style.color=this.FINAL_CONFIG.style.rows.even.color):(r.currentTarget.style.background=this.FINAL_CONFIG.style.rows.odd.backgroundColor,r.currentTarget.style.color=this.FINAL_CONFIG.style.rows.odd.color)):(t.dataset.selected="true",this.currentSelectionSpan.rows.push({index:l,value:n}),Array.from(t.children).forEach((s,a)=>{s.dataset.row==="even"?(s.style.background=this.FINAL_CONFIG.style.rows.even.selectedNeighbors.backgroundColor,s.style.color=this.FINAL_CONFIG.style.rows.even.selectedNeighbors.color):(s.style.background=this.FINAL_CONFIG.style.rows.odd.selectedNeighbors.backgroundColor,s.style.color=this.FINAL_CONFIG.style.rows.odd.selectedNeighbors.color)}),r.currentTarget.dataset.row==="odd"?(r.currentTarget.style.background=this.FINAL_CONFIG.style.rows.odd.selectedCell.backgroundColor,r.currentTarget.style.color=this.FINAL_CONFIG.style.rows.odd.selectedCell.color):(r.currentTarget.style.background=this.FINAL_CONFIG.style.rows.even.selectedCell.backgroundColor,r.currentTarget.style.color=this.FINAL_CONFIG.style.rows.even.selectedCell.color)),this.currentSelectionSpan.rows=this.currentSelectionSpan.rows.sort((s,a)=>s.index-a.index),this.chart.type===this.constants.DONUT&&this.currentSelectionSpan.rows.length>0&&this.applyDonutOption()},setFilterDatesIndexes(n){this.filteredDatesIndexes[n]=!(this.getDatesRange(n).from===this.dates[n].from&&this.getDatesRange(n).to===this.dates[n].to)},sortBody(){this.resetSelection(),Object.keys(this.rangeFilters).forEach(n=>{this.filterByRange(this.bodyCopy,n)}),Object.keys(this.sorts).forEach(n=>{this.sortByNumber(this.bodyCopy,n)}),this.currentFilter!==void 0&&this.sortByNumber(this.bodyCopy,this.currentFilter),this.dataset.header.forEach((n,l)=>{if(n.isPercentage){const o=this.percentages[l].referenceIndex,c=this.bodyCopy.map(r=>r.td[o]).reduce((r,t)=>r+t,0);this.bodyCopy.forEach(r=>{r.td[l]=r.td[o]/c})}}),this.currentPage>this.pages.length-1&&(this.currentPage=this.pages.length-1),[-1].includes(this.currentPage)&&(this.currentPage=0),this.$forceUpdate()},filterByRange(n,l){this.bodyCopy=n.filter(o=>o.td[l]>=this.rangeFilters[l].min&&o[l]<=this.rangeFilters[l].max)},sortByNumber(n,l){if(this.sorts[l]===this.constants.ASC&&(n=n.sort((o,c)=>o[l]-c[l])),this.sorts[l]===this.constants.DESC)n=n.sort((o,c)=>c[l]-o[l]);else return 0},sortTh(n,l){this.currentFilter=n;const o=l.currentTarget;clearTimeout(this.buttonTimeout),o.classList.add("clicked"),this.buttonTimeout=setTimeout(()=>{o.classList.remove("clicked")},200),this.sorts[n]===1?this.sorts[n]=this.constants.DESC:this.sorts[n]=this.constants.ASC,this.sortBody()},stringToNumber(n){let l=0;for(let o=0;o<n.length;o+=1)l+=n.charCodeAt(o);return l},toggleMultiselect(n,l,o){const c=o.currentTarget;clearTimeout(this.buttonTimeout),c.classList.add("clicked"),this.buttonTimeout=setTimeout(()=>{c.classList.remove("clicked")},200);const r=document.getElementById(`th_dropdown_${n}`);r.dataset.isOpen==="false"?r.dataset.isOpen="true":r.dataset.isOpen="false"},updateCurrentPage(n){this.resetSelection(),this.currentPage=Number(n.target.value)},calcDonutMarkerConnectorColor(n){return n.proportion*100>3?n.color:"transparent"},calcDonutMarkerLabelPositionX(n){return n.center.endX+this.calcMarkerOffset(n,50)},calcMarkerOffset(n,l){return n.center.endX-l>=0?3:-2},displayArcPercentage(n,l){return isNaN(n.value/this.sumValues(l))?0:(n.value/this.sumValues(l)*100).toFixed(0)+"%"},isArcBigEnough(n){return n.proportion*100>3},sumValues(n){return[...n].map(l=>l.value).reduce((l,o)=>l+o,0)},closeDragElement(){document.onmouseup=null,document.onmousemove=null},dragMouseDown(n){n=n||window.event,n.preventDefault(),document.onmouseup=this.closeDragElement,document.onmousemove=this.elementDrag},elementDrag(n){this.rafId||(this.rafId=window.requestAnimationFrame(()=>this.onElementDrag(n)))},onElementDrag(n){n=n||window.event,n.preventDefault();const o=this.$refs.chartModal.getBoundingClientRect();this.clientX=n.clientX-o.width/2,this.clientY=n.clientY-o.height/2,this.rafId=null}}},C={class:"vue-ui-table-export-hub"},f=["innerHTML"],F=["data-is-open"],I={class:"vue-ui-table-export-hub-options"},S={class:"vue-ui-table-export-hub-option-wrapper"},_={class:"label"},v=["innerHTML"],w={class:"vue-ui-table-export-hub-option-wrapper"},D={class:"label"},L=["innerHTML"],O={class:"vue-ui-table"},E={id:"tableHead"},B={key:0},A={key:0},x={key:1},M={key:0,style:{display:"flex","align-items":"center","justify-content":"flex-end"}},G=["innerHTML"],V={key:0,style:{"margin-left":"3px"}},T={key:0},z={class:"th-filter"},H={key:0,class:"th-date"},P={class:"date-wrapper--inputs"},R={class:"date-fieldset"},U=["for"],j=["id","onUpdate:modelValue","onInput"],X={class:"date-fieldset"},W=["for"],Y=["id","onUpdate:modelValue","onInput"],K={class:"date-wrapper--button"},q=["onClick"],Z=["innerHTML"],J=["innerHTML"],Q=["innerHTML"],$=["onClick","disabled"],ee=["placeholder","onUpdate:modelValue","name"],te=["onClick"],re=["innerHTML"],le=["innerHTML"],ne=["innerHTML"],se=["onClick","innerHTML"],oe=["innerHTML"],ae={key:5,class:"th-range-filter"},ce=["for"],ie=["id","max","min","onUpdate:modelValue"],ue=["id","max","min","onUpdate:modelValue"],de=["for"],he=["onClick","disabled"],me=["id"],ge=["onClick"],ye=["onClick","onKeyup"],Ne=["innerHTML","onClick","onKeyup"],ke=["data-row"],pe=["data-row"],be=["data-row","onClick","onKeyup","id"],Ce=["innerHTML"],fe={key:1},Fe={key:2},Ie={key:5},Se=["innerHTML"],_e={key:0},ve={style:{"margin-left":"12px"}},we={class:"format-num"},De={style:{"margin-left":"12px"}},Le={key:0,class:"format-num"},Oe={key:1,class:"format-num"},Ee={key:2},Be={style:{"margin-left":"12px"}},Ae={key:0,class:"format-num"},xe={key:1,class:"format-num"},Me={key:2},Ge={key:0,class:"vue-ui-table-paginator format-num"},Ve={key:1,class:"vue-ui-table-size-warning"},Te=["innerHTML"],ze={key:3,class:"vue-ui-table-pagination format-num"},He=["innerHTML","disabled"],Pe=["disabled"],Re={key:0,class:"vue-ui-table-page-scroller-wrapper"},Ue={for:"pageScroller",style:{"font-size":"14px"}},je=["max","value"],Xe={key:1},We=["disabled"],Ye=["innerHTML","disabled"],Ke={class:"chart-modal-options"},qe=["innerHTML"],Ze=["innerHTML"],Je=["innerHTML"],Qe={style:{"margin-bottom":"12px"}},$e={key:0},et={key:1},tt={style:{width:"100%",height:"fit-content",cursor:"move"},ref:"chartModal"},rt={class:"vue-ui-table-fieldset"},lt={class:"vue-ui-table-fieldset-wrapper"},nt=["name","id","checked","onInput"],st=["for"],ot=["disabled"],at=["innerHTML"],ct=["viewBox"],it=["markerWidth","markerHeight","refY"],ut=["points","fill"],dt=["x2","y1","y2","stroke","stroke-width"],ht=["y2","stroke","stroke-width"],mt=["x","width","height","fill"],gt=["x","y","height","width","fill","stroke"],yt=["x","y","width"],Nt=["x1","y1","x2","y2","stroke-width","stroke"],kt=["x1","y1","x2","y2","stroke","stroke-width","stroke-dasharray"],pt=["cx","cy","r","fill","stroke","stroke-width"],bt=["x","y","width"],Ct=["x","width","height","onMouseenter"],ft=["x1","y1","x2","y2","stroke","stroke-width","stroke-dasharray"],Ft=["d","stroke"],It=["x","y"],St={class:"vue-ui-table-donut-label-name"},_t=["fill"],vt=["fill"],wt=["fill"],Dt=["fill"],Lt={class:"vue-ui-table-donut-legend"};function Ot(n,l,o,c,r,t){return e.openBlock(),e.createElementBlock("div",{class:"vue-ui-table-main",style:e.normalizeStyle(`font-family: ${t.FINAL_CONFIG.fontFamily}`)},[e.createElementVNode("div",C,[e.createElementVNode("button",{onClick:l[0]||(l[0]=s=>r.isExportRequest=!r.isExportRequest),innerHTML:t.icons.export,style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.exportMenu.backgroundColor};color:${t.FINAL_CONFIG.style.exportMenu.color}`)},null,12,f),e.createElementVNode("div",{class:"vue-ui-table-export-hub-dropdown","data-is-open":r.isExportRequest||"false",style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.exportMenu.backgroundColor};color:${t.FINAL_CONFIG.style.exportMenu.color}`)},[l[24]||(l[24]=e.createElementVNode("b",{class:"vue-ui-table-export-hub-title"}," Export ",-1)),e.createElementVNode("button",{class:"close-dropdown",onClick:l[1]||(l[1]=s=>r.isExportRequest=!1),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.closeButtons.backgroundColor};color:${t.FINAL_CONFIG.style.closeButtons.color};border-radius:${t.FINAL_CONFIG.style.closeButtons.borderRadius}`)}," ✖ ",4),e.createElementVNode("div",I,[e.createElementVNode("div",S,[e.createElementVNode("div",_,e.toDisplayString(t.FINAL_CONFIG.translations.exportAllLabel)+" ("+e.toDisplayString(r.bodyCopy.length)+") ",1),e.createElementVNode("button",{id:"exportAll",onClick:l[2]||(l[2]=s=>t.createXls("all")),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.exportMenu.buttons.backgroundColor};color:${t.FINAL_CONFIG.style.exportMenu.buttons.color}`)},[e.createElementVNode("div",{innerHTML:t.icons.fileDownload},null,8,v),e.createElementVNode("span",null,e.toDisplayString(t.FINAL_CONFIG.translations.exportAllButton),1)],4)]),e.createElementVNode("div",w,[e.createElementVNode("div",D,e.toDisplayString(t.FINAL_CONFIG.translations.exportPageLabel),1),e.createElementVNode("button",{id:"exportPage",onClick:l[3]||(l[3]=s=>t.createXls("page")),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.exportMenu.buttons.backgroundColor};color:${t.FINAL_CONFIG.style.exportMenu.buttons.color}`)},[e.createElementVNode("div",{innerHTML:t.icons.fileDownload},null,8,L),e.createElementVNode("span",null,e.toDisplayString(t.FINAL_CONFIG.translations.exportPageButton),1)],4)])])],12,F)]),e.createElementVNode("div",{class:"vue-ui-table__wrapper",style:e.normalizeStyle(`max-height:${t.FINAL_CONFIG.maxHeight}px`),ref:"tableWrapper"},[e.createElementVNode("table",O,[e.createElementVNode("thead",E,[e.createElementVNode("tr",null,[l[25]||(l[25]=e.createElementVNode("th",{class:"invisible-cell"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.tableHead,(s,a)=>(e.openBlock(),e.createElementBlock("th",{key:`thead_${a}`,style:e.normalizeStyle(`overflow: visible;background:${t.FINAL_CONFIG.style.th.backgroundColor};color:${t.FINAL_CONFIG.style.th.color};outline:${t.FINAL_CONFIG.style.th.outline}`),class:e.normalizeClass({"th-has-nan":r.hasNaN[a]})},[t.hasNumericTypes&&([r.constants.TEXT,r.constants.DATE].includes(s.type)||s.isPercentage)?(e.openBlock(),e.createElementBlock("span",B,[e.createTextVNode(e.toDisplayString(s.name)+" ",1),s.isPercentage?(e.openBlock(),e.createElementBlock("span",A," / "+e.toDisplayString(s.percentageTo),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("span",x,e.toDisplayString(s.name),1))],6))),128))]),t.hasNumericTypes?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("tr",null,[l[26]||(l[26]=e.createElementVNode("th",{class:"invisible-cell"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.tableHead,(s,a)=>(e.openBlock(),e.createElementBlock("th",{key:`thead_${a}`,class:e.normalizeClass({"th-numeric":!0,"th-has-nan":r.hasNaN[a]}),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.th.backgroundColor};color:${t.FINAL_CONFIG.style.th.color};outline:${t.FINAL_CONFIG.style.th.outline}`)},[s.sum&&!r.hasNaN[a]?(e.openBlock(),e.createElementBlock("span",M,[e.createElementVNode("span",{innerHTML:t.icons.sum,style:{"margin-bottom":"-4px","margin-right":"3px"}},null,8,G),e.createTextVNode(" "+e.toDisplayString(s.prefix)+" "+e.toDisplayString(Number(t.getSum(a).toFixed(s.decimals)).toLocaleString())+" "+e.toDisplayString(s.suffix)+" ",1),r.percentages[a]&&s.percentageTo&&!s.isPercentage?(e.openBlock(),e.createElementBlock("span",V," ("+e.toDisplayString(isNaN(t.getSum(a)/t.getSum(r.percentages[a].referenceIndex))?"-":(t.getSum(a)/t.getSum(r.percentages[a].referenceIndex)*100).toFixed(s.decimals))+"%) ",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],6))),128))]),e.createElementVNode("tr",null,[l[27]||(l[27]=e.createElementVNode("th",{class:"invisible-cell"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.tableHead,(s,a)=>(e.openBlock(),e.createElementBlock("th",{key:`thead_${a}`,class:e.normalizeClass({"th-numeric":!0,"th-has-nan":r.hasNaN[a]}),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.th.backgroundColor};color:${t.FINAL_CONFIG.style.th.color};outline:${t.FINAL_CONFIG.style.th.outline}`)},[s.average&&!r.hasNaN[a]?(e.openBlock(),e.createElementBlock("span",T," ~ "+e.toDisplayString(s.prefix)+" "+e.toDisplayString(isNaN(t.getAverage(a))?"":Number(t.getAverage(a).toFixed(s.decimals)).toLocaleString())+" "+e.toDisplayString(s.suffix),1)):e.createCommentVNode("",!0)],6))),128))]),e.createElementVNode("tr",null,[l[30]||(l[30]=e.createElementVNode("th",{class:"invisible-cell"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.tableHead,(s,a)=>(e.openBlock(),e.createElementBlock("th",{key:`thead_${a}`,class:e.normalizeClass({"th-has-nan":r.hasNaN[a]}),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.th.backgroundColor};color:${t.FINAL_CONFIG.style.th.color};outline:${t.FINAL_CONFIG.style.th.outline}`)},[e.createElementVNode("div",z,[s.type===r.constants.DATE&&r.dates[a]?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",P,[e.createElementVNode("div",R,[e.createElementVNode("label",{for:`from_${a}`},e.toDisplayString(t.FINAL_CONFIG.translations.from),9,U),e.withDirectives(e.createElementVNode("input",{id:`from_${a}`,type:"date","onUpdate:modelValue":i=>r.dates[a].from=i,onInput:i=>{t.filterBody(),t.setFilterDatesIndexes(a)},style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.inputs.backgroundColor};color:${t.FINAL_CONFIG.style.inputs.color};border:${t.FINAL_CONFIG.style.inputs.border}`)},null,44,j),[[e.vModelText,r.dates[a].from]])]),e.createElementVNode("div",X,[e.createElementVNode("label",{for:`to_${a}`},e.toDisplayString(t.FINAL_CONFIG.translations.to),9,W),e.withDirectives(e.createElementVNode("input",{id:`to_${a}`,type:"date","onUpdate:modelValue":i=>r.dates[a].to=i,onInput:i=>{t.filterBody(),t.setFilterDatesIndexes(a)},style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.inputs.backgroundColor};color:${t.FINAL_CONFIG.style.inputs.color};border:${t.FINAL_CONFIG.style.inputs.border}`)},null,44,Y),[[e.vModelText,r.dates[a].to]])])]),e.createElementVNode("div",K,[s.isSort?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:i=>t.sortTh(a,i),class:e.normalizeClass({"th-button-active":[r.constants.DESC,r.constants.ASC].includes(r.sorts[a])}),style:e.normalizeStyle(`background:${[r.constants.DESC,r.constants.ASC].includes(r.sorts[a])?"":t.FINAL_CONFIG.style.pagination.buttons.backgroundColor};color:${[r.constants.DESC,r.constants.ASC].includes(r.sorts[a])?"":t.FINAL_CONFIG.style.pagination.buttons.color}`)},[r.sorts[a]===r.constants.ASC?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:[r.constants.DATE].includes(s.type)?t.icons.sort09:t.icons.sortAZ},null,8,Z)):r.sorts[a]===r.constants.DESC?(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:[r.constants.DATE].includes(s.type)?t.icons.sort90:t.icons.sortZA},null,8,J)):(e.openBlock(),e.createElementBlock("span",{key:2,innerHTML:t.icons.arrowSort},null,8,Q))],14,q)):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:i=>{t.resetDates(a),t.resetFilter(a,s,i)},disabled:!r.filteredDatesIndexes[a]&&t.isResetDisabled(a,s),class:"th-reset"}," ✖ ",8,$)])])):e.createCommentVNode("",!0),s.isSearch?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,placeholder:t.FINAL_CONFIG.translations.inputPlaceholder,"onUpdate:modelValue":i=>r.searches[a]=i,onInput:l[4]||(l[4]=i=>t.debounce(t.filterBody,400)),name:`search_${a}`,style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.inputs.backgroundColor};color:${t.FINAL_CONFIG.style.inputs.color};border:${t.FINAL_CONFIG.style.inputs.border}`)},null,44,ee)),[[e.vModelText,r.searches[a]]]):e.createCommentVNode("",!0),!r.hasNaN[a]&&s.isSort&&s.type!==r.constants.DATE?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:i=>t.sortTh(a,i),class:e.normalizeClass({"th-button-active":[r.constants.DESC,r.constants.ASC].includes(r.sorts[a])}),style:e.normalizeStyle(`background:${[r.constants.DESC,r.constants.ASC].includes(r.sorts[a])?"":t.FINAL_CONFIG.style.pagination.buttons.backgroundColor};color:${[r.constants.DESC,r.constants.ASC].includes(r.sorts[a])?"":t.FINAL_CONFIG.style.pagination.buttons.color}`)},[r.sorts[a]===r.constants.ASC?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:[r.constants.NUMERIC].includes(s.type)?t.icons.sort09:t.icons.sortZA},null,8,re)):r.sorts[a]===r.constants.DESC?(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:[r.constants.NUMERIC].includes(s.type)?t.icons.sort90:t.icons.sortAZ},null,8,le)):(e.openBlock(),e.createElementBlock("span",{key:2,innerHTML:t.icons.arrowSort},null,8,ne))],14,te)):e.createCommentVNode("",!0),s.isMultiselect?(e.openBlock(),e.createElementBlock("button",{key:3,onClick:i=>t.toggleMultiselect(a,s,i),innerHTML:t.icons.filter,class:e.normalizeClass({"th-button-active":r.multiselects[a]&&r.multiselects[a].length!==t.getDropdownOptions(a).length}),style:e.normalizeStyle(`background:${r.multiselects[a]&&r.multiselects[a].length!==t.getDropdownOptions(a).length?"":t.FINAL_CONFIG.style.pagination.buttons.backgroundColor};color:${r.multiselects[a]&&r.multiselects[a].length!==t.getDropdownOptions(a).length?"":t.FINAL_CONFIG.style.pagination.buttons.color}`)},null,14,se)):e.createCommentVNode("",!0),r.currentSelectionSpan.col===a&&t.canChart?(e.openBlock(),e.createElementBlock("button",{key:4,onClick:l[5]||(l[5]=i=>r.showChart=!r.showChart),innerHTML:t.icons.chart,class:e.normalizeClass({"th-button-active":r.showChart}),style:e.normalizeStyle(`background:${r.showChart?"":t.FINAL_CONFIG.style.pagination.buttons.backgroundColor};color:${r.showChart?"":t.FINAL_CONFIG.style.pagination.buttons.color}`)},null,14,oe)):e.createCommentVNode("",!0),s.rangeFilter&&r.rangeFilters[a]&&!r.hasNaN[a]?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("label",{for:`rangeMin${a}`},l[28]||(l[28]=[e.createElementVNode("span",{style:{color:"grey"}},"ᒥ",-1),e.createTextVNode(" min "),e.createElementVNode("span",{style:{color:"grey"}},"ᒣ",-1)]),8,ce),e.withDirectives(e.createElementVNode("input",{type:"number",id:`rangeMin${a}`,max:r.immutableRangeFilters[a].max,min:r.immutableRangeFilters[a].min,"onUpdate:modelValue":i=>r.rangeFilters[a].min=i,onInput:l[6]||(l[6]=i=>t.debounce(t.filterBody,400)),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.inputs.backgroundColor};color:${t.FINAL_CONFIG.style.inputs.color};border:${t.FINAL_CONFIG.style.inputs.border}`)},null,44,ie),[[e.vModelText,r.rangeFilters[a].min,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"number",id:`rangeMax${a}`,max:r.immutableRangeFilters[a].max,min:r.immutableRangeFilters[a].min,"onUpdate:modelValue":i=>r.rangeFilters[a].max=i,onInput:l[7]||(l[7]=i=>t.debounce(t.filterBody,400)),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.inputs.backgroundColor};color:${t.FINAL_CONFIG.style.inputs.color};border:${t.FINAL_CONFIG.style.inputs.border}`)},null,44,ue),[[e.vModelText,r.rangeFilters[a].max,void 0,{number:!0}]]),e.createElementVNode("label",{for:`rangeMax${a}`},l[29]||(l[29]=[e.createElementVNode("span",{style:{color:"grey"}},"ᒪ",-1),e.createTextVNode(" max "),e.createElementVNode("span",{style:{color:"grey"}},"ᒧ",-1)]),8,de)])):e.createCommentVNode("",!0),t.canResetColumn(a,s)?(e.openBlock(),e.createElementBlock("button",{key:6,onClick:i=>t.resetFilter(a,s,i),disabled:t.isResetDisabled(a,s),class:"th-reset"}," ✖ ",8,he)):e.createCommentVNode("",!0),s.isMultiselect?(e.openBlock(),e.createElementBlock("div",{key:7,class:"th-dropdown","data-is-open":"false",id:`th_dropdown_${a}`,style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.dropdowns.backgroundColor};color:${t.FINAL_CONFIG.style.dropdowns.color}`)},[e.createElementVNode("button",{class:"close-dropdown",onClick:i=>t.toggleMultiselect(a,s,i),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.closeButtons.backgroundColor};color:${t.FINAL_CONFIG.style.closeButtons.color}`)}," ✖ ",12,ge),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.getDropdownOptions(a),(i,u)=>(e.openBlock(),e.createElementBlock("span",{class:"th-option",key:`th_option_${a}_${u}`,onClick:d=>t.selectDropdownOption(i,a),onKeyup:[e.withKeys(d=>t.selectDropdownOption(i,a),["enter"]),e.withKeys(d=>t.selectDropdownOption(i,a),["space"])],style:e.normalizeStyle(`opacity:${t.isDropdownOptionSelected(i,a)?1:.5}`),tabindex:"0"},[t.isDropdownOptionSelected(i,a)?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`color:${t.FINAL_CONFIG.style.dropdowns.icons.selected.color};margin-right:5px`),class:"th-icon-green"},e.toDisplayString(t.FINAL_CONFIG.style.dropdowns.icons.selected.unicode),5)):(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`color:${t.FINAL_CONFIG.style.dropdowns.icons.unselected.color};margin-right:5px`),class:"th-icon-red"},e.toDisplayString(t.FINAL_CONFIG.style.dropdowns.icons.unselected.unicode),5)),e.createElementVNode("span",null,e.toDisplayString(i),1)],44,ye))),128))],12,me)):e.createCommentVNode("",!0)])],6))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("tr",null,[l[31]||(l[31]=e.createElementVNode("th",{class:"invisible-cell"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.tableHead,(s,a)=>(e.openBlock(),e.createElementBlock("th",{key:`col_selector_${a}`,class:e.normalizeClass({"vue-ui-table-col-selector":!r.hasNaN[a],"th-has-nan":r.hasNaN[a]}),style:e.normalizeStyle(`background:${a===r.selectedColumn&&!r.hasNaN[a]?t.FINAL_CONFIG.style.th.selected.backgroundColor:t.FINAL_CONFIG.style.th.backgroundColor};color:${a===r.selectedColumn&&!r.hasNaN[a]?t.FINAL_CONFIG.style.th.selected.color:t.FINAL_CONFIG.style.th.color};outline:${t.FINAL_CONFIG.style.th.outline}`)},[r.hasNaN[a]?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:r.tableHead[a].type===r.constants.NUMERIC?t.icons.chevronDown:"",class:e.normalizeClass({"col-selector":r.tableHead[a].type===r.constants.NUMERIC}),tabindex:"0",onClick:e.withModifiers(i=>t.selectColumn(a),["stop"]),onKeyup:e.withKeys(i=>t.selectColumn(a),["enter"])},null,42,Ne))],6))),128))])]),e.createElementVNode("tbody",{onClick:l[8]||(l[8]=(...s)=>t.closeAllDropdowns&&t.closeAllDropdowns(...s)),onKeydown:l[9]||(l[9]=s=>t.navigateCell(s))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.visibleRows,(s,a)=>(e.openBlock(),e.createElementBlock("tr",{key:`tbody_${a}`,"data-row":a%2===0?"odd":"even",class:e.normalizeClass(`tr_${r.uid}`),style:e.normalizeStyle(`${a%2===0?`background:${t.FINAL_CONFIG.style.rows.odd.backgroundColor};color:${t.FINAL_CONFIG.style.rows.odd.color}`:`background:${t.FINAL_CONFIG.style.rows.even.backgroundColor};color:${t.FINAL_CONFIG.style.rows.even.color}`}`)},[e.createElementVNode("td",{class:"vue-ui-table-td-iteration","data-row":a%2===0?"odd":"even"},e.toDisplayString(s.absoluteIndex+1),9,pe),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.td,(i,u)=>(e.openBlock(),e.createElementBlock("td",{"data-row":a%2===0?"odd":"even",key:`td_${a}_${u}`,style:e.normalizeStyle(t.isNumeric(i)||o.dataset.header[u].type===r.constants.DATE?"text-align:right;font-variant-numeric: tabular-nums;":""),onClick:d=>t.selectTd({td:i,rowIndex:a,colIndex:u,headerType:o.dataset.header[u].type,event:d}),onKeyup:[e.withKeys(d=>t.selectTd({td:i,rowIndex:a,colIndex:u,headerType:o.dataset.header[u].type,event:d}),["enter"]),e.withKeys(d=>t.selectTd({td:i,rowIndex:a,colIndex:u,headerType:o.dataset.header[u].type,event:d}),["space"])],class:e.normalizeClass({"td-numeric":o.dataset.header[u].type===r.constants.NUMERIC,"td-focusable":!0,"td-has-nan":r.hasNaN[u]}),id:`cell_${a}_${u}_${r.uid}`,tabindex:"0"},[s.meta&&s.meta.markerIndices.includes(u)&&s.meta.unicodeIcon?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`color:${s.meta.color};margin-right:3px`),innerHTML:s.meta.unicodeIcon},null,12,Ce)):e.createCommentVNode("",!0),o.dataset.header[u].type===r.constants.DATE?(e.openBlock(),e.createElementBlock("span",fe,e.toDisplayString(o.dataset.header[u].prefix)+" "+e.toDisplayString(new Date(i).toLocaleString().slice(0,10))+" "+e.toDisplayString(o.dataset.header[u].suffix),1)):o.dataset.header[u].isPercentage?(e.openBlock(),e.createElementBlock("span",Fe,e.toDisplayString(Number((i*100).toFixed(o.dataset.header[u].decimals)).toLocaleString())+"% ",1)):r.percentages[u]&&o.dataset.header[u].percentageTo&&!o.dataset.header[u].isPercentage?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass({"td-nan":isNaN(Number(i))})},e.toDisplayString(o.dataset.header[u].prefix)+" "+e.toDisplayString(isNaN(Number(i))?`${i} is not ${r.constants.NUMERIC}`:Number(i.toFixed(o.dataset.header[u].decimals)).toLocaleString())+" "+e.toDisplayString(o.dataset.header[u].suffix)+" ("+e.toDisplayString(isNaN(Number(i))?"":Number((i/t.getSum(r.percentages[u].referenceIndex)*100).toFixed(o.dataset.header[u].decimals)).toLocaleString())+"%) ",3)):o.dataset.header[u].type===r.constants.NUMERIC?(e.openBlock(),e.createElementBlock("span",{key:4,class:e.normalizeClass({"td-nan":isNaN(Number(i))})},e.toDisplayString(o.dataset