vue-data-ui 2.11.2 → 2.11.3-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-OttzfahM.js → Arrow-DCGOHM6k.js} +1 -1
- package/dist/{BaseIcon-CpIcYACc.js → BaseIcon-B7gTspPS.js} +1 -1
- package/dist/{ColorPicker-BnsG9Qeu.js → ColorPicker-BZpHLKFj.js} +3 -3
- package/dist/{DataTable-CJOtzfgn.js → DataTable-CfJNJ7NR.js} +2 -2
- package/dist/{Legend-DKQ4psNY.js → Legend-Ci-FO3V2.js} +2 -2
- package/dist/{PackageVersion-D-aPPO0L.js → PackageVersion-Bye0MT5W.js} +3 -3
- package/dist/{PenAndPaper-D9g_r8-6.js → PenAndPaper-YLAKASXp.js} +3 -3
- package/dist/{Shape-DLjaeo5U.js → Shape-B1e1H4lS.js} +1 -1
- package/dist/{Slicer-DuqI_UVS.js → Slicer-CWPgea7y.js} +2 -2
- package/dist/{Title-DIYoufYR.js → Title-DqRYBmPn.js} +1 -1
- package/dist/{Tooltip-BFz2yelJ.js → Tooltip-Cn5TRz5k.js} +1 -1
- package/dist/{dom-to-png-BB-m1MuD.js → dom-to-png-D-0uAVLJ.js} +1 -1
- package/dist/{img-Cyr1eIO7.js → img-DP7bwOa0.js} +1 -1
- package/dist/{index-d3erwTWB.js → index-BHDxYxsA.js} +1 -1
- package/dist/{pdf-BQRTRQlZ.js → pdf-DSSAgKci.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-BqKuhIvF.js → useNestedProp-CX8MPjxN.js} +1 -1
- package/dist/{usePrinter-CHrKIDM7.js → usePrinter-mUOYqNDs.js} +3 -3
- package/dist/{vue-data-ui-BRKcN5_z.js → vue-data-ui-Bt_OX-Tr.js} +63 -63
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-BIw7nTYA.js → vue-ui-3d-bar-ne-FQ3BQ.js} +9 -9
- package/dist/{vue-ui-accordion-BJyaBDyF.js → vue-ui-accordion-BA4dEISn.js} +3 -3
- package/dist/{vue-ui-age-pyramid-Dn_061NF.js → vue-ui-age-pyramid-gOYNoKxJ.js} +10 -10
- package/dist/{vue-ui-annotator-Y65oZVga.js → vue-ui-annotator-cclttELo.js} +2 -2
- package/dist/{vue-ui-bullet-B5mjXy0q.js → vue-ui-bullet-CvKSOwAe.js} +8 -8
- package/dist/{vue-ui-candlestick-BIC2-GAV.js → vue-ui-candlestick-B6X1XUi6.js} +11 -11
- package/dist/{vue-ui-carousel-table-CnvQ0CeQ.js → vue-ui-carousel-table-BfRMRgxl.js} +4 -4
- package/dist/{vue-ui-chestnut-IsRTDol2.js → vue-ui-chestnut-CmmSzRZK.js} +8 -8
- package/dist/{vue-ui-chord-iSsr3a59.js → vue-ui-chord-BXpdoJTc.js} +14 -14
- package/dist/{vue-ui-circle-pack-CS2l9IXg.js → vue-ui-circle-pack-DACAa7Po.js} +9 -9
- package/dist/{vue-ui-cursor-Cq9lPDB7.js → vue-ui-cursor-BCzCHBrt.js} +2 -2
- package/dist/{vue-ui-dashboard-7Cm-15oc.js → vue-ui-dashboard-Asv4ojaV.js} +62 -62
- package/dist/{vue-ui-digits-BecNI-j7.js → vue-ui-digits-B5FgN7v8.js} +2 -2
- package/dist/{vue-ui-donut-D_bFxovZ.js → vue-ui-donut-BBwG3_eI.js} +12 -12
- package/dist/{vue-ui-donut-evolution-C8dlmVur.js → vue-ui-donut-evolution-BfZgT3LC.js} +11 -11
- package/dist/{vue-ui-dumbbell-Ds41wAQh.js → vue-ui-dumbbell-D6_AcFXT.js} +10 -10
- package/dist/{vue-ui-flow-CqdSvk4_.js → vue-ui-flow-a_27wEq2.js} +11 -11
- package/dist/{vue-ui-funnel-CNDgAWjp.js → vue-ui-funnel-BQIASo-h.js} +9 -9
- package/dist/{vue-ui-galaxy-DzUAHZ4G.js → vue-ui-galaxy-D08PJlS7.js} +11 -11
- package/dist/{vue-ui-gauge-Cj-4ZhyL.js → vue-ui-gauge-BST6gr3o.js} +7 -7
- package/dist/{vue-ui-gizmo-CCS3u0qr.js → vue-ui-gizmo-CaTpG11y.js} +3 -3
- package/dist/{vue-ui-heatmap-CBRd8kvj.js → vue-ui-heatmap-DiuiJH7J.js} +10 -10
- package/dist/{vue-ui-history-plot-4XT22zB_.js → vue-ui-history-plot-CvGSOLla.js} +11 -11
- package/dist/{vue-ui-kpi-B-lBgRvZ.js → vue-ui-kpi-vDq_MbTb.js} +3 -3
- package/dist/{vue-ui-mini-loader-_ksyazrb.js → vue-ui-mini-loader-9J8LdVRw.js} +2 -2
- package/dist/{vue-ui-molecule-Db_QmLY6.js → vue-ui-molecule-B1Ykknv1.js} +11 -11
- package/dist/{vue-ui-mood-radar-Y_CGEC1L.js → vue-ui-mood-radar-Bo_9AlGw.js} +11 -11
- package/dist/{vue-ui-nested-donuts-DosW9Sfg.js → vue-ui-nested-donuts-C6etC_8f.js} +11 -11
- package/dist/{vue-ui-onion-CQwIVcfN.js → vue-ui-onion-E77bkiI8.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-Cdu0SvMZ.js → vue-ui-parallel-coordinate-plot-DRX5p5wU.js} +12 -12
- package/dist/{vue-ui-quadrant-B8H5sBMi.js → vue-ui-quadrant-BWvOT4Yn.js} +12 -12
- package/dist/{vue-ui-quick-chart-ClB6jwSV.js → vue-ui-quick-chart-D0yCkwLS.js} +9 -9
- package/dist/{vue-ui-radar-BTluZs04.js → vue-ui-radar-Dxb-NhkQ.js} +12 -12
- package/dist/{vue-ui-rating-CTNYeoXO.js → vue-ui-rating-BGBXFzF9.js} +2 -2
- package/dist/{vue-ui-relation-circle-CdHhoGcO.js → vue-ui-relation-circle-BhxPABn9.js} +7 -7
- package/dist/{vue-ui-ridgeline-Dr6UOfwb.js → vue-ui-ridgeline-CRKQ44VU.js} +12 -12
- package/dist/{vue-ui-rings-N2mHKtLh.js → vue-ui-rings-Bm_M6lPM.js} +12 -12
- package/dist/{vue-ui-scatter-BcJRyqbE.js → vue-ui-scatter-vrdnuI9T.js} +12 -12
- package/dist/{vue-ui-skeleton-BOtCpAcY.js → vue-ui-skeleton-BCAWMgrf.js} +3 -3
- package/dist/{vue-ui-smiley-BPqpTUTh.js → vue-ui-smiley-BbDcE-5m.js} +2 -2
- package/dist/{vue-ui-spark-trend-BXo8mbxJ.js → vue-ui-spark-trend-dGhL6Ncl.js} +5 -5
- package/dist/{vue-ui-sparkbar-DEsL52nJ.js → vue-ui-sparkbar-jBdFxBjW.js} +4 -4
- package/dist/{vue-ui-sparkgauge-DkawMq8d.js → vue-ui-sparkgauge-CH1PgkFm.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-D8ZCXl7m.js → vue-ui-sparkhistogram-DxuZF7Jp.js} +5 -5
- package/dist/{vue-ui-sparkline-D8LYPXpr.js → vue-ui-sparkline-gCNfPXIx.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-DzeVCG0H.js → vue-ui-sparkstackbar-CXbLZhzW.js} +5 -5
- package/dist/{vue-ui-stackbar-DQ9CcKUd.js → vue-ui-stackbar-CQUmq-Zs.js} +13 -13
- package/dist/{vue-ui-strip-plot-C6gcQLMI.js → vue-ui-strip-plot-CwH7POxM.js} +11 -11
- package/dist/{vue-ui-table-D7azsjo3.js → vue-ui-table-Bb1L4BbK.js} +3 -3
- package/dist/{vue-ui-table-heatmap-DINNMAyX.js → vue-ui-table-heatmap-Bnn-JBcA.js} +4 -4
- package/dist/{vue-ui-table-sparkline-BrYh6fVq.js → vue-ui-table-sparkline-Dtyp35z5.js} +5 -5
- package/dist/{vue-ui-thermometer-J0A6MZy_.js → vue-ui-thermometer-nqM9BT70.js} +7 -7
- package/dist/{vue-ui-timer-CI8zPXh3.js → vue-ui-timer-C2PW101V.js} +5 -5
- package/dist/{vue-ui-tiremarks-BuNik_Pf.js → vue-ui-tiremarks-C89aeRJ0.js} +7 -7
- package/dist/{vue-ui-treemap-oUtdOGWu.js → vue-ui-treemap-Dj1uUDg4.js} +12 -12
- package/dist/{vue-ui-vertical-bar-2bHPN2lr.js → vue-ui-vertical-bar-BwiU9hmU.js} +12 -12
- package/dist/{vue-ui-waffle-BuISvHw-.js → vue-ui-waffle-B8cjT4Kp.js} +12 -12
- package/dist/{vue-ui-wheel-CSy7_x22.js → vue-ui-wheel-BWUlrmeo.js} +7 -7
- package/dist/{vue-ui-word-cloud-DEpoSRMP.js → vue-ui-word-cloud-CLKZ_Ss2.js} +10 -10
- package/dist/{vue-ui-world-Cy1VBlK3.js → vue-ui-world-BA6Bpswn.js} +11 -11
- package/dist/{vue-ui-xy-PaM6vcjk.js → vue-ui-xy-CsHZNZlq.js} +16 -16
- package/dist/{vue-ui-xy-canvas-CSyX_xLO.js → vue-ui-xy-canvas-Cy_2j84B.js} +12 -12
- package/package.json +1 -2
- package/dist/Arrow-CogAJvGp.cjs +0 -1
- package/dist/BaseIcon-DY-33nfj.cjs +0 -1
- package/dist/ColorPicker-CrMLe8x_.cjs +0 -1
- package/dist/DataTable-CNCnRrD-.cjs +0 -1
- package/dist/Legend-ieOu_fKK.cjs +0 -1
- package/dist/PackageVersion-BxSGdh6L.cjs +0 -1
- package/dist/PenAndPaper-ByAFuR-l.cjs +0 -1
- package/dist/Shape-BQIcurpe.cjs +0 -1
- package/dist/Slicer-FXxFjXOP.cjs +0 -1
- package/dist/Title-D62pPwLz.cjs +0 -1
- package/dist/Tooltip-C_H6-uAa.cjs +0 -9
- package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +0 -1
- package/dist/dom-to-png-B3SeX1JP.cjs +0 -3
- package/dist/img-Bl4Pt1QH.cjs +0 -1
- package/dist/index-Cn2tUOoX.cjs +0 -9
- package/dist/pdf-BQABl7QG.cjs +0 -1
- package/dist/useChartAccessibility-Cm7nkzTG.cjs +0 -1
- package/dist/useNestedProp-C8955nsn.cjs +0 -1
- package/dist/usePanZoom-PXRi2Rwx.cjs +0 -1
- package/dist/usePrinter-BrH80VBz.cjs +0 -1
- package/dist/useResponsive-BBkmXXaa.cjs +0 -1
- package/dist/useUserOptionState-BgepsfED.cjs +0 -1
- package/dist/vue-data-ui-BbzW2_-6.cjs +0 -9
- package/dist/vue-data-ui.cjs +0 -1
- package/dist/vue-ui-3d-bar-WFymJ4EL.cjs +0 -19
- package/dist/vue-ui-accordion-7GoAZx3k.cjs +0 -1
- package/dist/vue-ui-age-pyramid-DGpLdvsL.cjs +0 -1
- package/dist/vue-ui-annotator-ypStRKCB.cjs +0 -371
- package/dist/vue-ui-bullet-C_Ppz5nn.cjs +0 -34
- package/dist/vue-ui-candlestick-BrDk_pc_.cjs +0 -2
- package/dist/vue-ui-carousel-table-BTxtBHvb.cjs +0 -1
- package/dist/vue-ui-chestnut-D_NZDyDN.cjs +0 -6
- package/dist/vue-ui-chord-CZ66gJ7w.cjs +0 -16
- package/dist/vue-ui-circle-pack-lGkj98rL.cjs +0 -1
- package/dist/vue-ui-cursor-YZyc0ARl.cjs +0 -1
- package/dist/vue-ui-dashboard-jP2U4qtK.cjs +0 -1
- package/dist/vue-ui-digits-C5PfeED6.cjs +0 -1
- package/dist/vue-ui-donut-BM9i2XHJ.cjs +0 -1
- package/dist/vue-ui-donut-evolution-Oga32kTV.cjs +0 -1
- package/dist/vue-ui-dumbbell-ClzXgan7.cjs +0 -9
- package/dist/vue-ui-flow-Bp1oqzTj.cjs +0 -3
- package/dist/vue-ui-funnel-y3hN7BGU.cjs +0 -1
- package/dist/vue-ui-galaxy-D5vKPiFH.cjs +0 -1
- package/dist/vue-ui-gauge-57ahTSbZ.cjs +0 -1
- package/dist/vue-ui-gizmo-D5_kCO9e.cjs +0 -1
- package/dist/vue-ui-heatmap-B8sfOhVF.cjs +0 -1
- package/dist/vue-ui-history-plot-DQVpKlp1.cjs +0 -1
- package/dist/vue-ui-kpi-DjI1yXtc.cjs +0 -1
- package/dist/vue-ui-mini-loader-BpAnNEHG.cjs +0 -1
- package/dist/vue-ui-molecule-BqpYPmrd.cjs +0 -1
- package/dist/vue-ui-mood-radar-DI_FioVr.cjs +0 -1
- package/dist/vue-ui-nested-donuts-B0rJlEH0.cjs +0 -17
- package/dist/vue-ui-onion-CEHc9oKt.cjs +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-C1sxm3Nr.cjs +0 -8
- package/dist/vue-ui-pattern-CT3p_iOg.cjs +0 -1
- package/dist/vue-ui-quadrant-DM3Afg_i.cjs +0 -1
- package/dist/vue-ui-quick-chart-ClJi48bc.cjs +0 -15
- package/dist/vue-ui-radar-f0QY_Mal.cjs +0 -1
- package/dist/vue-ui-rating-B71_TxmN.cjs +0 -1
- package/dist/vue-ui-relation-circle-DHOG2jKh.cjs +0 -1
- package/dist/vue-ui-ridgeline-CxhklaLX.cjs +0 -1
- package/dist/vue-ui-rings-DoGxh2qe.cjs +0 -2
- package/dist/vue-ui-scatter-BnRkkP5Z.cjs +0 -1
- package/dist/vue-ui-skeleton-Mcoev-5q.cjs +0 -41
- package/dist/vue-ui-smiley-Ch9trBZA.cjs +0 -2
- package/dist/vue-ui-spark-trend-PqEN-rL8.cjs +0 -1
- package/dist/vue-ui-sparkbar-DnRQFo63.cjs +0 -1
- package/dist/vue-ui-sparkgauge-C0E5Sojk.cjs +0 -1
- package/dist/vue-ui-sparkhistogram-Bqtsbb3w.cjs +0 -1
- package/dist/vue-ui-sparkline-BTruGe7A.cjs +0 -1
- package/dist/vue-ui-sparkstackbar-DeXUgBIH.cjs +0 -1
- package/dist/vue-ui-stackbar-CaFp42Tn.cjs +0 -6
- package/dist/vue-ui-strip-plot-DzNU6VRW.cjs +0 -1
- package/dist/vue-ui-table-DP2ZaGWa.cjs +0 -14
- package/dist/vue-ui-table-heatmap-B2gZkAqm.cjs +0 -1
- package/dist/vue-ui-table-sparkline-CgN2nMYT.cjs +0 -1
- package/dist/vue-ui-thermometer-DgZfQbR2.cjs +0 -1
- package/dist/vue-ui-timer-ClM5FpoU.cjs +0 -64
- package/dist/vue-ui-tiremarks-19Krsd1f.cjs +0 -1
- package/dist/vue-ui-treemap-DvmJ1MOU.cjs +0 -1
- package/dist/vue-ui-vertical-bar-RT-SM-us.cjs +0 -4
- package/dist/vue-ui-waffle-BSKRUJbJ.cjs +0 -1
- package/dist/vue-ui-wheel-DfBVkT9x.cjs +0 -1
- package/dist/vue-ui-word-cloud-BlfCmzD-.cjs +0 -1
- package/dist/vue-ui-world-EgFhVXSY.cjs +0 -19
- package/dist/vue-ui-xy-aQEDcKbT.cjs +0 -3
- package/dist/vue-ui-xy-canvas-C6-sYgU_.cjs +0 -9
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-Cn2tUOoX.cjs"),b=require("./useNestedProp-C8955nsn.cjs"),w=require("./vue-ui-skeleton-Mcoev-5q.cjs"),S=require("./PackageVersion-BxSGdh6L.cjs"),B=require("./useChartAccessibility-Cm7nkzTG.cjs"),E=["xmlns","viewBox"],L=["width","height"],A=["id"],M=["stop-color"],V=["stop-color"],z=["d","stroke","stroke-linecap"],q=["d","stroke","stroke-linecap","stroke-dashoffset"],O=["x","y","font-size","fill","font-weight"],j={key:4,ref:"source",dir:"auto"},D={__name:"vue-ui-sparkgauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(C){const{vue_ui_sparkgauge:_}=s.useConfig(),l=C,c=e.computed(()=>!!l.dataset&&Object.keys(l.dataset).length);e.onMounted(()=>{d()});function d(){s.objectIsEmpty(l.dataset)?s.error({componentName:"VueUiSparkgauge",type:"dataset"}):s.getMissingDatasetAttributes({datasetObject:l.dataset,requiredAttributes:["value","min","max"]}).forEach(a=>{s.error({componentName:"VueUiSparkgauge",type:"datasetAttribute",property:a})})}const v=e.ref(s.createUid()),t=e.computed({get:()=>m(),set:a=>a}),{svgRef:N}=B.useChartAccessibility({config:{text:l.dataset.title}});function m(){const a=b.useNestedProp({userConfig:l.config,defaultConfig:_});return a.theme?{...b.useNestedProp({userConfig:s.themes.vue_ui_sparkgauge[a.theme]||l.config,defaultConfig:a})}:a}e.watch(()=>l.config,a=>{t.value=m(),d()},{deep:!0});const u=e.computed(()=>({height:t.value.style.height,width:128,base:t.value.style.basePosition})),n=e.computed(()=>{const a=l.dataset.min??0,r=l.dataset.max??0,$=r-a;return{min:a,max:r,diff:$}}),o=e.ref(t.value.style.animation.show?n.value.min:l.dataset.value);e.watch(()=>l.dataset.value,()=>{y(l.dataset.value||0)});const f=e.computed(()=>o.value>n.value.max?n.value.max:o.value<n.value.min?n.value.min:o.value),p=e.computed(()=>n.value.diff/t.value.style.animation.speedMs);e.onMounted(()=>{y(l.dataset.value||0)});function y(a){function r(){o.value<a?o.value=Math.min(o.value+p.value,a):o.value>a&&(o.value=Math.max(o.value-p.value,a)),o.value!==a&&requestAnimationFrame(r)}r()}const i=e.computed(()=>l.dataset.title??""),g=e.computed(()=>o.value>=0?(f.value-n.value.min)/n.value.diff:(Math.abs(n.value.min)-Math.abs(f.value))/n.value.diff),h=e.computed(()=>s.interpolateColorHex(t.value.style.colors.min,t.value.style.colors.max,n.value.min,n.value.max,o.value)),k=e.computed(()=>t.value.style.dataLabel.autoColor?h.value:t.value.style.dataLabel.color),x=e.computed(()=>t.value.style.track.autoColor?h.value:t.value.style.track.color);return(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-sparkgauge",style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width: 100%; background:${t.value.style.background}`)},[t.value.style.title.show&&i.value&&t.value.style.title.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(i.value),5)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:1,ref_key:"svgRef",ref:N,xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${u.value.width} ${u.value.height}`,style:"overflow: visible; background:transparent; width:100%;"},[e.createVNode(S._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:u.value.width,height:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background")],8,L)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`gradient_${v.value}`,x1:"-10%",y1:"100%",x2:"110%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.colors.min},null,8,M),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.max},null,8,V)],8,A)]),e.createElementVNode("path",{d:`M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,stroke:t.value.style.gutter.color,"stroke-width":8,"stroke-linecap":t.value.style.gutter.strokeLinecap,fill:"none"},null,8,z),g.value!==0?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,stroke:t.value.style.colors.showGradient?`url(#gradient_${v.value})`:x.value,"stroke-width":8,"stroke-linecap":t.value.style.track.strokeLinecap,fill:"none","stroke-dasharray":169.5,"stroke-dashoffset":169.5-169.5*g.value,class:e.normalizeClass({"vue-ui-sparkgauge-track":t.value.style.animation.show}),style:e.normalizeStyle(t.value.style.animation.show?`animation: vue-ui-sparkgauge-animation ${t.value.style.animation.speedMs}ms ease-in;`:"")},null,14,q)):e.createCommentVNode("",!0),e.createElementVNode("text",{"text-anchor":"middle",x:u.value.width/2,y:u.value.base+6+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,fill:k.value,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.dataLabel.formatter,e.unref(s.checkNaN)(o.value),e.unref(s.dataLabel)({p:t.value.style.dataLabel.prefix,v:e.unref(s.checkNaN)(o.value),s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding}),{datapoint:e.unref(s.checkNaN)(o.value),color:k.value})),9,O)],8,E)):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(w.default,{key:2,config:{type:"gauge",style:{backgroundColor:t.value.style.background,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.title.show&&i.value&&t.value.style.title.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:3,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(i.value),5)):e.createCommentVNode("",!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",j,[e.renderSlot(a.$slots,"source")],512)):e.createCommentVNode("",!0)],4))}};exports.default=D;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-Cn2tUOoX.cjs"),_=require("./useNestedProp-C8955nsn.cjs"),M=require("./Shape-BQIcurpe.cjs"),O=require("./vue-ui-skeleton-Mcoev-5q.cjs"),q=require("./PackageVersion-BxSGdh6L.cjs"),H=require("./useChartAccessibility-Cm7nkzTG.cjs"),I=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U={key:0},W={key:1},j=["xmlns","viewBox"],P=["width","height"],R=["id"],G=["stop-color"],T=["stop-color"],X=["id"],Y=["stop-color"],J=["stop-color"],K=["id"],Q=["stop-color"],Z=["stop-color"],ee={key:1},te=["x","y","height","width","fill","stroke","stroke-width","rx"],le={key:2},oe=["x","y","font-size","font-weight","fill"],ae=["x","y","font-size","fill"],se=["x","y","font-size","fill"],ne=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],re={key:2,ref:"source",dir:"auto"},ie={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(B,{emit:x}){e.useCssVars(o=>({"40b52890":L.value}));const{vue_ui_sparkhistogram:E}=a.useConfig(),c=B,f=e.computed(()=>!!c.dataset&&c.dataset.length);e.onMounted(()=>{k()});function k(){a.objectIsEmpty(c.dataset)?a.error({componentName:"VueUiSparkHistogram",type:"dataset"}):c.dataset.forEach((o,r)=>{a.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["value"]}).forEach(l=>{a.error({componentName:"VueUiSparkHistogram",type:"datasetSerieAttribute",property:l,index:r})})})}const v=e.ref(a.createUid()),t=e.computed({get:()=>b(),set:o=>o}),{svgRef:w}=H.useChartAccessibility({config:t.value.style.title});function b(){const o=_.useNestedProp({userConfig:c.config,defaultConfig:E});return o.theme?{..._.useNestedProp({userConfig:a.themes.vue_ui_sparkhistogram[o.theme]||c.config,defaultConfig:o})}:o}e.watch(()=>c.config,o=>{t.value=b(),k()},{deep:!0});const u=e.computed(()=>{const o=t.value.style.layout.height,r=t.value.style.layout.width,l=t.value.style.layout.padding.top,s=o-t.value.style.layout.padding.bottom,d=t.value.style.layout.padding.left,y=r-t.value.style.layout.padding.right,p=l+(o-l-t.value.style.layout.padding.bottom)/2,g=o-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,m=r-t.value.style.layout.padding.left-t.value.style.layout.padding.right;return{bottom:s,centerY:p,drawingHeight:g,drawingWidth:m,height:o,left:d,right:y,top:l,width:r}}),C=e.computed(()=>Math.max(...c.dataset.map(o=>Math.abs(o.value||0))));function $(o){return Math.abs(o)/C.value}const i=e.computed(()=>c.dataset.map((o,r)=>{const l=$(o.value||0),s=u.value.drawingHeight*l,d=u.value.drawingWidth/c.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,g=u.value.centerY-s/2,m=u.value.left+(y/2+r*d),V=u.value.left+r*d,h=typeof o.intensity>"u"?100:Math.round(o.intensity*100),z=o.color?o.color:o.value>=0?a.setOpacity(t.value.style.bars.colors.positive,h):a.setOpacity(t.value.style.bars.colors.negative,h),D=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,A=o.color?`url(#gradient_datapoint_${r}_${v.value})`:o.value>=0?`url(#gradient_positive_${r}_${v.value})`:`url(#gradient_negative_${r}_${v.value})`,F=m+p/2;return{...o,color:z,gradient:A,height:s,intensity:h,proportion:l,stroke:D,textAnchor:F,trapX:V,unitWidth:d,width:p,x:m,y:g}})),n=e.ref(null),S=x;function N(o,r){S("selectDatapoint",{datapoint:o,index:r})}const L=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-spark-histogram",style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily}`),onMouseleave:r[1]||(r[1]=l=>n.value=null)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},[e.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),n.value!==null?(e.openBlock(),e.createElementBlock("span",U,"- "+e.toDisplayString(i.value[n.value].timeLabel||"")+" "+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,i.value[n.value].value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:i.value[n.value].value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:i.value[n.value],seriesIndex:n.value})),1)):e.createCommentVNode("",!0),![void 0,null].includes(n.value)&&![null,void 0].includes(i.value[n.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",W,"("+e.toDisplayString(i.value[n.value].valueLabel||0)+")",1)):e.createCommentVNode("",!0)],4),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,ref_key:"svgRef",ref:w,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${u.value.width} ${u.value.height}`,style:{overflow:"visible"}},[e.createVNode(q._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:u.value.width,height:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,P)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.positive,.05),l.intensity)},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.positive,l.intensity)},null,8,T)],8,R))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.negative,.05),l.intensity)},null,8,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.negative,l.intensity)},null,8,J)],8,X))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_datapoint_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(l.color,.05),l.intensity)},null,8,Q),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(l.color,l.intensity)},null,8,Z)],8,K))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("rect",{x:l.x,y:l.y,height:l.height,width:l.width,fill:t.value.style.bars.colors.gradient.show?l.gradient:l.color,stroke:l.stroke,"stroke-width":t.value.style.bars.strokeWidth,rx:`${t.value.style.bars.borderRadius*l.proportion/12}%`,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,10,te))),256))])):(e.openBlock(),e.createElementBlock("g",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createBlock(M._sfc_main,{plot:{x:l.x+l.width/2,y:l.y+l.height/2},color:t.value.style.bars.colors.gradient.show?l.gradient:l.color,shape:t.value.style.bars.shape,radius:l.height*.4,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,8,["plot","color","shape","radius","class"]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"middle",x:l.textAnchor,y:l.y-t.value.style.labels.value.fontSize/3+t.value.style.labels.value.offsetY,"font-size":t.value.style.labels.value.fontSize,"font-weight":t.value.style.labels.value.bold?"bold":"normal",fill:t.value.style.labels.value.color},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,l.value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:l.value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:i.value[n.value],seriesIndex:n.value})),9,oe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.valueLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:l.y+l.height+t.value.style.labels.valueLabel.fontSize,"font-size":t.value.style.labels.valueLabel.fontSize,"text-anchor":"middle",fill:t.value.style.labels.valueLabel.color},e.toDisplayString(l.valueLabel),9,ae)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:u.value.height-t.value.style.labels.timeLabel.fontSize/2,"font-size":t.value.style.labels.timeLabel.fontSize,fill:t.value.style.labels.timeLabel.color,"text-anchor":"middle"},e.toDisplayString(l.timeLabel),9,se)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:u.value.height,width:l.unitWidth,fill:"transparent",x:l.trapX,y:0,onMouseover:d=>n.value=s,onMouseleave:r[0]||(r[0]=d=>n.value=null),stroke:n.value!==null&&n.value===s?t.value.style.selector.stroke:"","stroke-width":n.value!==null&&n.value===s?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>N(l,s)},null,40,ne)]))),256))],8,j)):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(O.default,{key:3,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},ue=I._export_sfc(ie,[["__scopeId","data-v-c92ac914"]]);exports.default=ue;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-Cn2tUOoX.cjs"),A=require("./useNestedProp-C8955nsn.cjs"),X=require("./vue-ui-skeleton-Mcoev-5q.cjs"),O=require("./useResponsive-BBkmXXaa.cjs"),H=require("./PackageVersion-BxSGdh6L.cjs"),U=require("./useChartAccessibility-Cm7nkzTG.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Z={__name:"SparkTooltip",props:{svgRef:{type:Object},x:{type:Number,required:!0},y:{type:Number,required:!0},prevX:{type:Number,required:!0},prevY:{type:Number,required:!0},offsetY:{type:Number,default:0},background:{type:String},backgroundOpacity:{type:Number,default:100},borderRadius:{type:Number,default:2},borderWidth:{type:Number,default:0},borderColor:{type:String,default:"#FFFFFF"},color:{type:String},fontSize:{type:Number}},setup(f){const c=f,w=e.toRef(c.svgRef),u=e.ref(null),y=e.ref(0),p=e.ref(0),m=e.ref(!1),V=e.computed(()=>r.setOpacity(c.background,c.backgroundOpacity)),N=async()=>{if(!w.value||!u.value)return;const t=r.placeHTMLElementAtSVGCoordinates({svgElement:w.value,element:u.value,x:c.x,y:c.y,offsetY:c.offsetY}),g=r.placeHTMLElementAtSVGCoordinates({svgElement:w.value,element:u.value,x:c.prevX,y:c.prevY,offsetY:c.offsetY});!t||!g||(m.value=!1,y.value=g.top,p.value=g.left,await e.nextTick(),setTimeout(()=>{m.value=!0,y.value=t.top,p.value=t.left},50))};return e.onMounted(N),e.watch(()=>[c.x,c.y,c.prevX,c.prevY],()=>N(),{immediate:!0}),(t,g)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tooltipRef",ref:u,class:"vue-data-ui-spark-tooltip",style:e.normalizeStyle({position:"fixed",top:`${y.value}px`,left:`${p.value}px`,pointerEvents:"none",background:V.value,color:c.color,fontSize:`${c.fontSize}px`,borderRadius:`${c.borderRadius}px`,border:`${c.borderWidth}px solid ${c.borderColor}`,transition:m.value?"top 0.3s ease-out, left 0.3s ease-out":"none"})},[e.renderSlot(t.$slots,"default",{},void 0,!0)],4))}},J=D._export_sfc(Z,[["__scopeId","data-v-c8e27542"]]),K=["id"],Q=["xmlns","viewBox"],ee=["width","height"],te=["id"],le=["stop-color"],ae=["stop-color"],oe=["id"],re=["stop-color"],ue=["stop-color"],ne=["id"],se=["stop-color"],ie=["stop-color"],de={key:1},ce=["d","fill"],ve=["d","fill"],pe=["d","stroke","stroke-width"],fe=["d","stroke","stroke-width"],ye=["x","y","width","height","fill","rx"],he=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],me=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ge=["cx","cy","r","fill","stroke","stroke-width"],ke=["x","y","font-size","font-weight","fill"],be=["x","y","height","width","onMouseenter","onClick"],xe={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0},heightRatio:{type:Number,default:1},forcedPadding:{type:Number,default:30}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:c}){const{vue_ui_sparkline:w}=r.useConfig(),u=f,y=e.computed(()=>Array.isArray(u.dataset)&&u.dataset.length>0),p=e.ref(r.createUid()),m=e.ref(null),V=e.ref(null),N=e.ref(null),t=e.computed({get:()=>M(),set:l=>l}),{svgRef:g}=U.useChartAccessibility({config:t.value.style.title});function M(){const l=A.useNestedProp({userConfig:u.config,defaultConfig:w});let o={};return l.theme?o={...A.useNestedProp({userConfig:r.themes.vue_ui_sparkline[l.theme]||u.config,defaultConfig:l})}:o=l,u.config&&r.hasDeepProperty(u.config,"style.scaleMin")?o.style.scaleMin=u.config.style.scaleMin:o.style.scaleMin=null,u.config&&r.hasDeepProperty(u.config,"style.scaleMax")?o.style.scaleMax=u.config.style.scaleMax:o.style.scaleMax=null,o}const L=e.computed(()=>r.largestTriangleThreeBucketsArrayObjects({data:u.dataset,threshold:t.value.downsample.threshold}));e.watch(()=>u.config,l=>{t.value=M(),z(),n.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>u.dataset,l=>{k.value=r.largestTriangleThreeBucketsArrayObjects({data:u.dataset.map(o=>({...o,value:[void 0].includes(o.value)?null:o.value})),threshold:t.value.downsample.threshold})},{deep:!0});const k=e.ref(W());function W(){return r.largestTriangleThreeBucketsArrayObjects({data:u.dataset.map(l=>t.value.style.animation.show&&u.dataset.length>1?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}),threshold:t.value.downsample.threshold})}const I=e.ref(null);e.onMounted(()=>{if(z(),t.value.style.animation.show&&u.dataset.length>1){let a=function(){o<L.value.length?(k.value.push(L.value[o]),setTimeout(()=>{requestAnimationFrame(a)},l)):k.value=L.value,o+=1};k.value=[];const l=t.value.style.animation.animationFrames/u.dataset.length;let o=0;a()}});function z(){if(r.objectIsEmpty(u.dataset)?r.error({componentName:"VueUiSparkline",type:"dataset"}):u.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{r.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=O.throttle(()=>{const{width:o,height:a}=O.useResponsive({chart:m.value,title:t.value.style.title.show&&u.showInfo?V.value:null,source:N.value});requestAnimationFrame(()=>{n.value.width=o,n.value.height=a,n.value.chartWidth=t.value.style.chartWidth/500*o,n.value.padding=u.forcedPadding/500*o})});I.value=new ResizeObserver(l),I.value.observe(m.value.parentNode)}}const n=e.ref({height:80*u.heightRatio,width:500,chartWidth:t.value.style.chartWidth,padding:u.forcedPadding}),$=c,s=e.computed(()=>{const{top:l,right:o,bottom:a,left:i}=t.value.style.padding;return{top:l,left:i,right:n.value.width-o,bottom:n.value.height-a,start:u.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?n.value.width-n.value.chartWidth+i:n.value.padding+i,width:u.showInfo&&t.value.style.dataLabel.show?n.value.chartWidth-i-o:n.value.width-n.value.padding-i-o,height:n.value.height-l-a}}),E=e.computed(()=>[null,void 0].includes(t.value.style.scaleMin)?Math.min(...k.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0)):t.value.style.scaleMin),F=e.computed(()=>[null,void 0].includes(t.value.style.scaleMax)?Math.max(...k.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0)):t.value.style.scaleMax),B=e.computed(()=>{const l=E.value>=0?0:E.value;return Math.abs(l)}),P=e.computed(()=>F.value+B.value),x=e.computed(()=>s.value.bottom-s.value.height*S(B.value));function S(l){return isNaN(l/P.value)?0:l/P.value}const b=e.computed(()=>L.value.length-1),v=e.computed(()=>k.value.map((l,o)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0,i=s.value.width/(b.value+1)>n.padding?n.padding:s.value.width/(b.value+1);return{absoluteValue:a,period:l.period,plotValue:a+B.value,toMax:S(a+B.value),x:s.value.start+o*(i>s.value.width/12?s.value.width/12:i),y:s.value.bottom-s.value.height*S(a+B.value),id:`plot_${p.value}_${o}`,color:C.value?t.value.style.bar.color:t.value.style.area.useGradient?r.shiftHue(t.value.style.line.color,.05*(1-o/b.value)):t.value.style.line.color,width:i>s.value.width/12?s.value.width/12:i}})),q=e.computed(()=>{const l={x:v.value[0].x||0,y:(n.value.height||0)-6},o={x:v.value[v.value.length-1].x||0,y:(n.value.height||0)-6},a=[];return v.value.forEach(i=>{a.push(`${i.x||0},${i.y||0} `)}),[l.x,l.y,...a,o.x,o.y].toString()}),d=e.ref(void 0),_=e.ref(void 0);function Y(l,o){d.value=l,_.value||(_.value=l),$("hoverIndex",{index:o})}function j(){_.value=d.value,d.value=void 0,$("hoverIndex",{index:void 0})}const h=e.computed(()=>{if(y.value){const l=v.value.map(a=>a.absoluteValue),o=l.reduce((a,i)=>a+i,0);return{latest:v.value[v.value.length-1].absoluteValue,sum:o,average:o/v.value.length,median:r.calcMedian(l),trend:r.calcLinearProgression(v.value.map(({x:a,y:i,absoluteValue:T})=>({x:a,y:i,value:T}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),R=e.computed(()=>y.value?t.value.style.dataLabel.valueType==="latest"?h.value.latest:t.value.style.dataLabel.valueType==="sum"?h.value.sum:t.value.style.dataLabel.valueType==="average"?h.value.average:0:0),C=e.computed(()=>t.value.type&&t.value.type==="bar");function G(l,o){$("selectDatapoint",{datapoint:l,index:o})}return(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:m,class:"vue-ui-sparkline",id:p.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily};`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:d.value,latest:h.value.latest,sum:h.value.sum,average:h.value.average,median:h.value.median,trend:h.value.trend})),void 0,!0),t.value.style.title.show&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:V,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(d.value?d.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("svg",{key:1,ref_key:"svgRef",ref:g,xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${n.value.width} ${n.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`),onMouseleave:o[0]||(o[0]=a=>_.value=void 0)},[e.createVNode(H._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:n.value.width<=0?10:n.value.width,height:n.value.height<=0?10:n.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,ee)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${p.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,le),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ae)],8,te),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${p.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,re),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.shiftHue)(t.value.style.bar.color,.05)},null,8,ue)],8,oe),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${p.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.shiftHue)(t.value.style.bar.color,.05)},null,8,se),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,ie)],8,ne)]),t.value.style.area.show&&!C.value&&v.value[0]?(e.openBlock(),e.createElementBlock("g",de,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${v.value[0].x},${s.value.bottom} ${e.unref(r.createSmoothPath)(v.value)} L ${v.value.at(-1).x},${s.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${p.value})`:e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ce)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${q.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${p.value})`:e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ve))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!C.value?(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${e.unref(r.createSmoothPath)(v.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,pe)):e.createCommentVNode("",!0),!t.value.style.line.smooth&&!C.value?(e.openBlock(),e.createElementBlock("path",{key:3,d:`M ${e.unref(r.createStraightPath)(v.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,fe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(a,i)=>(e.openBlock(),e.createElementBlock("g",null,[C.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:a.x-a.width/2,y:isNaN(a.absoluteValue>0?a.y:x.value)?0:a.absoluteValue>0?a.y:x.value,width:a.width,height:isNaN(Math.abs(a.y-x.value))?0:Math.abs(a.y-x.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${p.value})`:`url(#sparkline_bar_gradient_neg_${p.value})`,rx:t.value.style.bar.borderRadius},null,8,ye)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(d.value&&a.id===d.value.id||f.selectedIndex===i)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:a.x,x2:a.x,y1:s.value.top-6,y2:s.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,he)):e.createCommentVNode("",!0)]))),256)),E.value<0?(e.openBlock(),e.createElementBlock("line",{key:4,x1:s.value.start,x2:s.value.start+s.value.width-16,y1:e.unref(r.forceValidValue)(x.value,s.value.bottom),y2:e.unref(r.forceValidValue)(x.value,s.value.bottom),stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,me)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:5},e.renderList(v.value,(a,i)=>(e.openBlock(),e.createElementBlock("g",null,[d.value&&a.id===d.value.id||f.selectedIndex===i||f.dataset.length===1?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:a.x,cy:a.y,r:t.value.style.plot.radius,fill:a.color,stroke:t.value.style.plot.stroke,"stroke-width":t.value.style.plot.strokeWidth},null,8,ge)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:6,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:s.value.width+12+t.value.style.dataLabel.offsetX,y:n.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(d.value?e.unref(r.applyDataLabel)(t.value.style.dataLabel.formatter,d.value.absoluteValue,e.unref(r.dataLabel)({p:t.value.style.dataLabel.prefix,v:d.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:d.value}):e.unref(r.applyDataLabel)(t.value.style.dataLabel.formatter,R.value,e.unref(r.dataLabel)({p:t.value.style.dataLabel.prefix,v:R.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,ke)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(a,i)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(s.value.width/(b.value+1)>n.value.padding?n.value.padding:s.value.width/(b.value+1))/2,y:s.value.top-6,height:s.value.height+6,width:s.value.width/(b.value+1)>n.value.padding?n.value.padding:s.value.width/(b.value+1),fill:"transparent",onMouseenter:T=>Y(a,i),onMouseleave:j,onClick:()=>G(a,i)},null,40,be))),256)),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],44,Q)):e.createCommentVNode("",!0),d.value&&t.value.style.tooltip.show?(e.openBlock(),e.createBlock(J,{key:2,x:d.value.x,y:d.value.y,prevX:_.value.x,prevY:_.value.y,offsetY:t.value.style.plot.radius*3+t.value.style.tooltip.offsetY,svgRef:e.unref(g),background:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderWidth:t.value.style.tooltip.borderWidth,borderColor:t.value.style.tooltip.borderColor,borderRadius:t.value.style.tooltip.borderRadius,backgroundOpacity:t.value.style.tooltip.backgroundOpacity},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip",e.normalizeProps(e.guardReactiveProps({...d.value})),()=>[e.createTextVNode(e.toDisplayString(d.value.period)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.dataLabel.formatter,d.value.absoluteValue,e.unref(r.dataLabel)({p:t.value.style.dataLabel.prefix,v:d.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:d.value})),1)],!0)]),_:3},8,["x","y","prevX","prevY","offsetY","svgRef","background","color","fontSize","borderWidth","borderColor","borderRadius","backgroundOpacity"])):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"source",ref:N,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(X.default,{key:4,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,K))}},_e=D._export_sfc(xe,[["__scopeId","data-v-246ce941"]]);exports.default=_e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-Cn2tUOoX.cjs"),V=require("./useNestedProp-C8955nsn.cjs"),U=require("./vue-ui-skeleton-Mcoev-5q.cjs"),M=require("./PackageVersion-BxSGdh6L.cjs"),j=require("./Tooltip-C_H6-uAa.cjs"),R=require("./useChartAccessibility-Cm7nkzTG.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),I=["xmlns","viewBox"],W=["id"],Y=["stop-color"],G=["stop-color"],X=["stop-color"],J={id:"stackPill",clipPathUnits:"objectBoundingBox"},K=["fill"],Q={key:0,"clip-path":"url(#stackPill)"},Z=["x","width","height","fill"],ee=["x","width","height","fill","stroke"],te=["onClick","x","width","height","onMouseenter"],le=["width","height","rx"],oe=["onClick"],ae={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},re=["height","width"],ne=["fill"],se={key:4,ref:"source",dir:"auto"},ue={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const{vue_ui_sparkstackbar:L}=a.useConfig(),u=P,F=e.useSlots();e.onMounted(()=>{F["chart-background"]&&console.warn("VueUiSparkStackbar does not support the #chart-background slot.")});const x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),C=e.ref(""),t=e.computed({get:()=>$(),set:l=>l}),{svgRef:A}=R.useChartAccessibility({config:t.value.style.title});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{p.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),p=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let v=function(){r+=o/l,r<o?(p.value=p.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(v)):(g.value=!1,p.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,v()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>p.value.map((l,n)=>{const o=l.value||0,r=o/N.value,v=isNaN(r)?0:r,s=v*c.value.width;return{...l,value:o,proportion:v,width:s,proportionLabel:a.dataLabel({v:v*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),_=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function T(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<p.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<_.value.length;o+=1)n.push({..._.value[o],start:l}),l+=_.value[o].width;return n}),q=D;function z(l,n){q("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function O({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(C.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,C.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-spark-stackbar",ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{class:"atom-title",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"atom-subtitle",style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,ref_key:"svgRef",ref:A,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(M._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,Y),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,X)],8,W))),128)),e.createElementVNode("clipPath",J,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,K)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,Z))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,ee))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>O({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=v=>{b.value=!1,m.value=null})},null,42,te))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,le))],8,I)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(U.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":d.value.includes(r)}),onClick:v=>{T(r),z(o,r)}},[e.createElementVNode("div",ae,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:o.color},null,8,ne)],8,re)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(o.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(d.value.includes(r)?" - ":o.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,oe))),256))],4)):e.createCommentVNode("",!0),e.createVNode(j._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:C.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},ie=H._export_sfc(ue,[["__scopeId","data-v-7955299f"]]);exports.default=ie;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-Cn2tUOoX.cjs"),Te=require("./useNestedProp-C8955nsn.cjs"),Me=require("./useResponsive-BBkmXXaa.cjs"),Fe=require("./usePrinter-BrH80VBz.cjs"),ot=require("./Slicer-FXxFjXOP.cjs"),rt=require("./Tooltip-C_H6-uAa.cjs"),st=require("./Title-D62pPwLz.cjs"),nt=require("./Legend-ieOu_fKK.cjs"),it=require("./vue-ui-accordion-7GoAZx3k.cjs"),ut=require("./DataTable-CNCnRrD-.cjs"),ct=require("./vue-ui-skeleton-Mcoev-5q.cjs"),dt=require("./PackageVersion-BxSGdh6L.cjs"),ht=require("./PenAndPaper-ByAFuR-l.cjs"),vt=require("./useUserOptionState-BgepsfED.cjs"),mt=require("./Shape-BQIcurpe.cjs"),gt=require("./useChartAccessibility-Cm7nkzTG.cjs"),yt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),bt=["id"],ft=["xmlns","viewBox"],pt=["x","y","width","height"],kt={key:1},xt=["id"],wt=["stop-color"],Bt=["stop-color"],Ct=["stop-color"],St=["x1","x2","y1","y2","stroke"],zt=["x1","x2","y1","y2","stroke"],Lt=["x1","x2","y1","y2","stroke"],_t=["x1","x2","y1","y2","stroke"],Et={key:0},Nt=["x","y","height","rx","width","fill","stroke","stroke-width"],$t={key:0},Vt=["x","y","height","rx","width","fill","stroke","stroke-width"],Tt=["x","y","width","rx","height","fill","stroke","stroke-width"],Mt={key:0},Ft=["x","y","width","rx","height","fill","stroke","stroke-width"],Pt=["x1","x2","y1","y2","stroke","stroke-width"],It=["x1","x2","y1","y2","stroke","stroke-width"],Rt=["x","y","font-size","fill","font-weight"],Ot=["transform","font-size","fill","font-weight"],Dt=["x","y","font-size","fill","font-weight"],At={key:0},qt=["x","y","font-size","font-weight","fill"],Ht=["x","y","font-size","fill","font-weight"],Ut={key:0},Wt=["x","y","font-size","font-weight","fill"],Yt=["x1","x2","y1","y2","stroke"],Xt=["x","y","font-size","font-weight","fill"],Gt=["x1","x2","y1","y2","stroke"],Jt=["font-size","font-weight","fill","text-anchor","transform"],Zt={key:0},Kt={key:1},Qt=["text-anchor","font-size","font-weight","fill","transform","onClick"],jt={key:0},ea={key:1},ta=["font-size","font-weight","fill","x","y","onClick"],aa=["x","y","width","height","onClick","onMouseenter","fill"],la=["x","y","width","height","onClick","onMouseenter","fill"],oa={key:4,class:"vue-data-ui-watermark"},ra=["onClick"],sa=["innerHTML"],na={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(G,{expose:Pe,emit:Ie}){const{vue_ui_stackbar:Re}=u.useConfig(),Oe=e.useSlots(),h=G,J=Ie,T=e.computed({get(){return!!h.dataset&&h.dataset.length},set(l){return l}}),F=e.ref(null),C=e.ref(u.createUid()),D=e.ref(!1),Z=e.ref(null),K=e.ref(""),f=e.ref([]),te=e.ref(0),ae=e.ref(null),le=e.ref(null),oe=e.ref(null),re=e.ref(null),se=e.ref(0),A=e.ref(!1),P=e.ref(null),_=e.ref(!1),De=e.ref(0),Ae=e.ref(0),qe=e.ref(0),M=e.ref(null);e.onMounted(()=>{j()});const t=e.computed({get:()=>ce(),set:l=>l}),{userOptionsVisible:Q,setUserOptionsVisibility:ne,keepUserOptionState:ie}=vt.useUserOptionState({config:t.value}),{svgRef:ue}=gt.useChartAccessibility({config:t.value.style.chart.title});function ce(){const l=Te.useNestedProp({userConfig:h.config,defaultConfig:Re});let r={};return l.theme?r={...Te.useNestedProp({userConfig:u.themes.vue_ui_stackbar[l.theme]||h.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:r=l,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=h.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=h.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.startIndex")?r.style.chart.zoom.startIndex=h.config.style.chart.zoom.startIndex:r.style.chart.zoom.startIndex=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.endIndex")?r.style.chart.zoom.endIndex=h.config.style.chart.zoom.endIndex:r.style.chart.zoom.endIndex=null,r}e.watch(()=>h.config,l=>{t.value=ce(),Q.value=!t.value.userOptions.showOnChartHover,j(),De.value+=1,Ae.value+=1,qe.value+=1,y.value.dataLabels.show=t.value.style.chart.bars.dataLabels.show,y.value.showTable=t.value.table.show,y.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0}),e.watch(()=>h.dataset,l=>{be()},{deep:!0});const y=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:de,isImaging:he,generatePdf:ve,generateImage:me}=Fe.usePrinter({elementId:`stackbar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar",options:t.value.userOptions.print}),q=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),He=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),ge=e.ref(null),ye=e.ref(null);e.onMounted(()=>{j()});function j(){if(u.objectIsEmpty(h.dataset)?u.error({componentName:"VueUiStackbar",type:"dataset"}):h.dataset.forEach((l,r)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{T.value=!1,u.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{_.value=!0},10),t.value.responsive){const l=Me.throttle(()=>{_.value=!1;const{width:r,height:a}=Me.useResponsive({chart:F.value,title:t.value.style.chart.title.text?ae.value:null,legend:t.value.style.chart.legend.show?le.value:null,slicer:t.value.style.chart.zoom.show&&z.value>1?oe.value:null,source:re.value});requestAnimationFrame(()=>{q.value.width=r,q.value.height=a,clearTimeout(ye.value),ye.value=setTimeout(()=>{_.value=!0},10)})});ge.value=new ResizeObserver(l),ge.value.observe(F.value.parentNode)}fe()}const s=e.computed(()=>{const{height:l,width:r}=q.value,{right:a}=q.value.paddingRatio,o=t.value.style.chart.padding.top,i=r-r*a,n=l-t.value.style.chart.padding.bottom,b=t.value.style.chart.padding.left,E=r-b-r*a,N=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:i,bottom:n,left:b,width:E,height:N<0?0:N}}),S=e.computed(()=>h.dataset.map((l,r)=>{const a=u.convertColorToHex(l.color)||He.value[r]||u.palette[r]||u.palette[r%u.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:u.createUid(),color:a}})),z=e.computed(()=>Math.max(...S.value.filter(l=>!f.value.includes(l.id)).map(l=>l.series.length))),c=e.ref({start:0,end:Math.max(...h.dataset.map(l=>l.series.length))});function be(){fe()}async function fe(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&M.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setEndValue(Ue(t.value.style.chart.zoom.endIndex+1)))):(c.value={start:0,end:Math.max(...h.dataset.map(l=>l.series.length))},se.value+=1)}function Ue(l){const r=Math.max(...h.dataset.map(a=>a.series.length));return l>r?r:l<0||t.value.style.chart.zoom.startIndex!==null&&l<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:l}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(c.value.end-c.value.start):l=s.value.height/(c.value.end-c.value.start),l<=0?0:l}),I=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id))).slice(c.value.start,c.value.end)),We=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(c.value.start,c.value.end)),H=e.computed(()=>{const l=S.value.filter(r=>!f.value.includes(r.id));return{positive:u.sumSeries(l.map(r=>({...r,series:r.series.slice(c.value.start,c.value.end).map(a=>a>=0?a:0)}))),negative:u.sumSeries(l.map(r=>({...r,series:r.series.slice(c.value.start,c.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...H.value.positive),r=Math.min(...H.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(i=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((i+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((i+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:i}))}),L=e.computed(()=>{const l=[];for(let r=0;r<z.value;r+=1)l.push({text:t.value.style.chart.grid.x.timeLabels.values[r]||String(r),absoluteIndex:r});return l.slice(c.value.start,c.value.end)}),g=e.computed(()=>{if(!T.value)return[];let l=Array(z.value).fill(0),r=Array(z.value).fill(0),a=Array(z.value).fill(0),o=Array(z.value).fill(0);const i=Math.max(...H.value.positive)||0,n=Math.min(...H.value.negative),b=[-1/0,1/0,NaN,void 0,null].includes(n)?0:n,E=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks),{min:N,max:R}=E,$=R+(N>=0?0:Math.abs(N))||1,p=s.value.height,X=s.value.width,$e=w.value[0]?w.value[0].zero:s.value.bottom,Ve=w.value[0]?w.value[0].horizontal_zero:s.value.left;return S.value.filter(O=>!f.value.includes(O.id)).map(O=>{const B=O.series.slice(c.value.start,c.value.end),Ze=O.signedSeries.slice(c.value.start,c.value.end),Ke=B.map((v,m)=>s.value.left+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Qe=B.map((v,m)=>s.value.top+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),je=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=p*k,V=$e-x-l[m],l[m]+=x):(x=p*k,V=$e+a[m],a[m]+=Math.abs(x)),V}),et=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=X*k,V=Ve+r[m],r[m]+=x):(x=X*k,V=Ve-Math.abs(x)-o[m],o[m]+=Math.abs(x)),V}),tt=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?p*k:p*Math.abs(k)}),at=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?X*k:X*Math.abs(k)}),lt=B.map(v=>Math.abs(v)).reduce((v,m)=>v+m,0);return{...O,proportions:B.map((v,m)=>t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/lt),series:B,signedSeries:Ze,x:Ke,y:je,height:tt,horizontal_width:at,horizontal_y:Qe,horizontal_x:et}})}),pe=e.computed(()=>We.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function U(l,r,a,o,i){const n=i===-1&&l>=0?-l:l;return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,n,u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:n,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ke(l,r,a,o){return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,u.dataLabel({v:isNaN(l)?0:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function xe(l){const r=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));J("selectDatapoint",{datapoint:r,period:L.value[l]})}function we(l){P.value=l,D.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(i=>({name:i.name,absoluteIndex:i.absoluteIndex,value:i.series[l]===0?0:(i.signedSeries[l]===-1&&i.series[l]>=0?-i.series[l]:i.series[l])||null,proportion:i.proportions[l]||null,color:i.color,id:i.id}));Z.value={datapoint:a,seriesIndex:l,config:t.value,series:g.value};const o=a.map(i=>Math.abs(i.value)).reduce((i,n)=>i+n,0);if(u.isFunction(r)&&u.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))K.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:i,showPercentage:n,borderColor:b,roundingValue:E,roundingPercentage:N}=t.value.style.chart.tooltip;let R="";L.value[l]&&L.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(R+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${b};padding-bottom:6px;margin-bottom:3px;">${L.value[l].text}</div>`);const $=[i&&n?"(":"",i&&n?")":""];a.reverse().forEach(p=>{R+=`
|
|
2
|
-
<div style="display:flex;flex-direction:row;align-items:center;gap:4px">
|
|
3
|
-
<svg viewBox="0 0 60 60" height="14" width="14"><rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${p.id})`:p.color}"/>${Oe.pattern?`<rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="url(#pattern_${C.value}_${p.absoluteIndex})"/>`:""}</svg>
|
|
4
|
-
${p.name}${i||n?":":""} ${i?u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:p.value,s:t.value.style.chart.bars.dataLabels.suffix,r:E}):""} ${$[0]}${n?u.dataLabel({v:isNaN(p.value/o)?0:Math.abs(p.value)/o*100,s:"%",r:N}):""}${$[1]}
|
|
5
|
-
</div>
|
|
6
|
-
`}),K.value=`<div>${R}</div>`}}function Ye(l){A.value=l,te.value+=1}function Be(){y.value.showTable=!y.value.showTable}function Ce(){y.value.dataLabels.show=!y.value.dataLabels.show}function Se(){y.value.showTooltip=!y.value.showTooltip}function Xe(){return g.value}const ze=e.computed(()=>{if(g.value.length===0)return{head:[],body:[],config:{},columnNames:[]};const l=g.value.map(({name:a,color:o})=>({label:a,color:o})),r=[];for(let a=c.value.start;a<c.value.end;a+=1){const o=[t.value.style.chart.grid.x.timeLabels.values[a]||a+1];S.value.forEach(i=>{o.push(Number((i.series[a]||0).toFixed(t.value.table.td.roundingValue)))}),r.push(o)}return{head:l,body:r}});function Le(){const l=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],r=["",...ze.value.head.map(n=>n.label)],a=ze.value.body,o=l.concat([r]).concat(a),i=u.createCsvContent(o);u.downloadCsv({csvContent:i,title:t.value.style.chart.title.text||"vue-ui-stackbar"})}const W=e.computed(()=>{const l=[""].concat(g.value.map(i=>i.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" 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>');let r=[];for(let i=0;i<z.value;i+=1){const n=g.value.map(b=>b.series[i]??0).reduce((b,E)=>b+E,0);r.push([t.value.style.chart.grid.x.timeLabels.values.slice(c.value.start,c.value.end)[i]??i+1].concat(g.value.map(b=>(b.series[i]??0).toFixed(t.value.table.td.roundingValue))).concat((n??0).toFixed(t.value.table.td.roundingValue)))}const a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint},o=[t.value.table.columnNames.period].concat(g.value.map(i=>i.name)).concat(t.value.table.columnNames.total);return{head:l,body:r.slice(0,c.value.end-c.value.start),config:a,colNames:o}});function Ge(l,r){if(J("selectLegend",g.value.find(a=>a.absoluteIndex===l)),f.value.includes(r.id))f.value=f.value.filter(a=>a!==r.id);else{if(f.value.length===S.value.length-1)return;f.value.push(r.id)}}const _e=e.computed(()=>S.value.map((l,r)=>({...l,shape:"square"})).map(l=>({...l,opacity:f.value.includes(l.id)?.5:1,segregate:()=>Ge(l.absoluteIndex,l),isSegregated:f.value.includes(l.id)}))),Je=e.computed(()=>({cy:"stackbar-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),Y=e.ref(!1);function ee(){Y.value=!Y.value}function Ee(l,r){const a=JSON.parse(JSON.stringify(g.value)).map(o=>({name:o.name,value:o.series[r]===0?0:(o.signedSeries[r]===-1&&o.series[r]>=0?-o.series[r]:o.series[r])||null,proportion:o.proportions[r]||null,color:o.color,id:o.id}));J("selectTimeLabel",{datapoint:a,absoluteIndex:l.absoluteIndex,label:l.text})}function Ne(l,r){return t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?t.value.style.chart.bars.dataLabels.hideEmptyPercentages?r>0:!0:t.value.style.chart.bars.dataLabels.hideEmptyValues?l!==0:!0}return Pe({getData:Xe,generatePdf:ve,generateCsv:Le,generateImage:me,toggleTable:Be,toggleLabels:Ce,toggleTooltip:Se,toggleAnnotator:ee}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{id:`stackbar_${C.value}`,ref_key:"stackbarChart",ref:F,class:e.normalizeClass({"vue-ui-stackbar":!0,"vue-data-ui-wrapper-fullscreen":A.value}),style:e.normalizeStyle(`background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}; position: relative; ${t.value.responsive?"height: 100%":""}`),onMouseenter:r[6]||(r[6]=()=>e.unref(ne)(!0)),onMouseleave:r[7]||(r[7]=()=>e.unref(ne)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ht._sfc_main,{key:0,svgRef:e.unref(ue),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:Y.value,onClose:ee},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"userConfig",{},void 0,!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"chartTitle",ref:ae,style:"width:100%;background:transparent;padding-bottom:24px"},[e.createVNode(st._sfc_main,{config:{title:{cy:"stackbar-title",...t.value.style.chart.title},subtitle:{cy:"stackbar-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&T.value&&(e.unref(ie)||e.unref(Q))?(e.openBlock(),e.createBlock(Fe.UserOptions,{ref:"details",key:`user_option_${te.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(de),isImaging:e.unref(he),uid:C.value,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:A.value,chartElement:F.value,position:t.value.userOptions.position,isTooltip:y.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:Y.value,onToggleFullscreen:Ye,onGeneratePdf:e.unref(ve),onGenerateCsv:Le,onGenerateImage:e.unref(me),onToggleTable:Be,onToggleLabels:Ce,onToggleTooltip:Se,onToggleAnnotator:ee,style:e.normalizeStyle({visibility:e.unref(ie)?e.unref(Q)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:a,color:o})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:a,color:o})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"6"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:o})),void 0,!0)]),key:"7"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:o})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:o})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasLabel","hasFullscreen","isFullscreen","chartElement","position","isTooltip","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createElementBlock("svg",{key:3,ref_key:"svgRef",ref:ue,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${s.value.chartWidth<=0?10:s.value.chartWidth} ${s.value.chartHeight<=0?10:s.value.chartHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(dt._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:s.value.left,y:s.value.top,width:s.value.width<=0?10:s.value.width,height:s.value.height<=0?10:s.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,pt)):e.createCommentVNode("",!0),t.value.style.chart.bars.gradient.show?(e.openBlock(),e.createElementBlock("defs",kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,o)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`gradient_${a.id}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,wt),e.createElementVNode("stop",{offset:"61.8%","stop-color":e.unref(u.lightenHexColor)(a.color,t.value.style.chart.bars.gradient.intensity/100)},null,8,Bt),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Ct)],8,xt))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.right,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,St))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(c.value.end-c.value.start+1,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.right,y1:s.value.top+d.value*o,y2:s.value.top+d.value*o,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,zt))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.showVerticalLines&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:4},e.renderList(c.value.end-c.value.start+1,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left+d.value*o,x2:s.value.left+d.value*o,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,Lt))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:5},e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:a.horizontal_x,x2:a.horizontal_x,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,_t))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[l.$slots.pattern?(e.openBlock(),e.createElementBlock("defs",Et,[e.renderSlot(l.$slots,"pattern",e.mergeProps({ref_for:!0},{seriesIndex:a.absoluteIndex,patternId:`pattern_${C.value}_${a.absoluteIndex}`}),void 0,!0)])):e.createCommentVNode("",!0),t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.x,(i,n)=>(e.openBlock(),e.createElementBlock("rect",{x:i,y:a.y[n]<0?0:a.y[n],height:a.height[n]<0?1e-4:a.height[n]||0,rx:t.value.style.chart.bars.borderRadius>a.height[n]/2?(a.height[n]<0?0:a.height[n])/2:t.value.style.chart.bars.borderRadius,width:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:t.value.style.chart.bars.gradient.show?`url(#gradient_${a.id})`:a.color,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":_.value})},null,10,Nt))),256)),l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.x,(i,n)=>(e.openBlock(),e.createElementBlock("rect",{x:i,y:a.y[n]<0?0:a.y[n],height:a.height[n]<0?1e-4:a.height[n]||0,rx:t.value.style.chart.bars.borderRadius>a.height[n]/2?(a.height[n]<0?0:a.height[n])/2:t.value.style.chart.bars.borderRadius,width:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:`url(#pattern_${C.value}_${a.absoluteIndex})`,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":_.value})},null,10,Vt))),256))])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.horizontal_x,(i,n)=>(e.openBlock(),e.createElementBlock("rect",{x:e.unref(u.forceValidValue)(i,s.value.left),y:a.horizontal_y[n]<0?0:a.horizontal_y[n],width:e.unref(u.forceValidValue)(a.horizontal_width[n]<0?1e-4:a.horizontal_width[n]),rx:t.value.style.chart.bars.borderRadius>a.height[n]/2?(a.height[n]<0?0:a.height[n])/2:t.value.style.chart.bars.borderRadius,height:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:t.value.style.chart.bars.gradient.show?`url(#gradient_${a.id})`:a.color,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":_.value})},null,10,Tt))),256)),l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",Mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.horizontal_x,(i,n)=>(e.openBlock(),e.createElementBlock("rect",{x:e.unref(u.forceValidValue)(i,s.value.left),y:a.horizontal_y[n]<0?0:a.horizontal_y[n],width:e.unref(u.forceValidValue)(a.horizontal_width[n]<0?1e-4:a.horizontal_width[n]),rx:t.value.style.chart.bars.borderRadius>a.height[n]/2?(a.height[n]<0?0:a.height[n])/2:t.value.style.chart.bars.borderRadius,height:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:`url(#pattern_${C.value}_${a.absoluteIndex})`,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":_.value})},null,10,Ft))),256))])):e.createCommentVNode("",!0)],64))]))),256)),t.value.style.chart.grid.x.showAxis?(e.openBlock(),e.createElementBlock("line",{key:6,x1:s.value.left,x2:s.value.right,y1:s.value.bottom,y2:s.value.bottom,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":t.value.style.chart.grid.x.axisThickness,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,Pt)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.showAxis&&!t.value.style.chart.bars.distributed?(e.openBlock(),e.createElementBlock("line",{key:7,x1:s.value.left,x2:s.value.left,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":t.value.style.chart.grid.y.axisThickness,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,It)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.axisName.show&&t.value.style.chart.grid.x.axisName.text?(e.openBlock(),e.createElementBlock("text",{key:8,x:s.value.left+s.value.width/2,y:s.value.chartHeight+t.value.style.chart.grid.x.axisName.offsetY,"font-size":t.value.style.chart.grid.x.axisName.fontSize,fill:t.value.style.chart.grid.x.axisName.color,"font-weight":t.value.style.chart.grid.x.axisName.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.grid.x.axisName.text),9,Rt)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisName.show&&t.value.style.chart.grid.y.axisName.text?(e.openBlock(),e.createElementBlock("text",{key:9,transform:`translate(${t.value.style.chart.grid.y.axisName.fontSize+t.value.style.chart.grid.y.axisName.offsetX}, ${s.value.top+s.value.height/2}) rotate(-90)`,"font-size":t.value.style.chart.grid.y.axisName.fontSize,fill:t.value.style.chart.grid.y.axisName.color,"font-weight":t.value.style.chart.grid.y.axisName.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.grid.y.axisName.text),9,Ot)):e.createCommentVNode("",!0),y.value.dataLabels.show&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.x,(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[Ne(a.series[n],a.proportions[n])?(e.openBlock(),e.createElementBlock("text",{key:0,x:i+d.value*(1-t.value.style.chart.bars.gapRatio/2)/2,y:a.y[n]+a.height[n]/2+t.value.style.chart.bars.dataLabels.fontSize/3,"font-size":t.value.style.chart.bars.dataLabels.fontSize,fill:t.value.style.chart.bars.dataLabels.adaptColorToBackground?e.unref(u.adaptColorToBackground)(a.color):t.value.style.chart.bars.dataLabels.color,"font-weight":t.value.style.chart.bars.dataLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?ke(a.proportions[n]*100,a,o,n):U(a.series[n],a,o,n,a.signedSeries[n])),9,Dt)):e.createCommentVNode("",!0)],64))),256))]))),256)),t.value.style.chart.bars.totalValues.show&&g.value.length>1?(e.openBlock(),e.createElementBlock("g",At,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!t.value.style.chart.bars.dataLabels.hideEmptyValues||a.value!==0?(e.openBlock(),e.createElementBlock("text",{key:0,x:s.value.left+d.value*o+d.value/2,y:s.value.top-t.value.style.chart.bars.totalValues.fontSize/3,"text-anchor":"middle","font-size":t.value.style.chart.bars.totalValues.fontSize,"font-weight":t.value.style.chart.bars.totalValues.bold?"bold":"normal",fill:t.value.style.chart.bars.totalValues.color},e.toDisplayString(U(a.value,a,o,a.sign)),9,qt)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),y.value.dataLabels.show&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.horizontal_x,(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[Ne(a.series[n],a.proportions[n])?(e.openBlock(),e.createElementBlock("text",{key:0,x:i+(a.horizontal_width[n]<0?1e-4:a.horizontal_width[n])/2,y:a.horizontal_y[n]+d.value*(1-t.value.style.chart.bars.gapRatio/2)/2+t.value.style.chart.bars.dataLabels.fontSize/3,"font-size":t.value.style.chart.bars.dataLabels.fontSize,fill:t.value.style.chart.bars.dataLabels.adaptColorToBackground?e.unref(u.adaptColorToBackground)(a.color):t.value.style.chart.bars.dataLabels.color,"font-weight":t.value.style.chart.bars.dataLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?ke(a.proportions[n]*100,a,o,n):U(a.series[n],a,o,n,a.signedSeries[n])),9,Ht)):e.createCommentVNode("",!0)],64))),256))]))),256)),t.value.style.chart.bars.totalValues.show&&g.value.length>1?(e.openBlock(),e.createElementBlock("g",Ut,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[!t.value.style.chart.bars.dataLabels.hideEmptyValues||a.value!==0?(e.openBlock(),e.createElementBlock("text",{key:0,x:s.value.right+t.value.style.chart.bars.totalValues.fontSize/3,y:s.value.top+d.value*o+d.value/2,"text-anchor":"start","font-size":t.value.style.chart.bars.totalValues.fontSize,"font-weight":t.value.style.chart.bars.totalValues.bold?"bold":"normal",fill:t.value.style.chart.bars.totalValues.color},e.toDisplayString(U(a.value,a,o,a.sign)),9,Wt)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisLabels.show&&!t.value.style.chart.bars.distributed&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.left-6,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1},null,8,Yt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{x:a.x,y:a.y+t.value.style.chart.grid.y.axisLabels.fontSize/3,"font-size":t.value.style.chart.grid.y.axisLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(u.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.grid.y.axisLabels.rounding})),9,Xt))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisLabels.show&&!t.value.style.chart.bars.distributed&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:a.horizontal_x,x2:a.horizontal_x,y1:s.value.bottom,y2:s.value.bottom+6,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,Gt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{"font-size":t.value.style.chart.grid.x.timeLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,"text-anchor":t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle",transform:`translate(${a.horizontal_x}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`},e.toDisplayString(e.unref(u.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.grid.y.axisLabels.rounding})),9,Jt))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.timeLabels.show&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[l.$slots["time-label"]?(e.openBlock(),e.createElementBlock("g",Zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.renderSlot(l.$slots,"time-label",e.mergeProps({ref_for:!0},{x:s.value.left+d.value*o+d.value/2,y:s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY,fontSize:t.value.style.chart.grid.x.timeLabels.fontSize,fill:t.value.style.chart.grid.x.timeLabels.color,transform:`translate(${s.value.left+d.value*o+d.value/2}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`,absoluteIndex:a.absoluteIndex,content:a.text,textAnchor:t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle",show:!0}),void 0,!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",Kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle","font-size":t.value.style.chart.grid.x.timeLabels.fontSize,"font-weight":t.value.style.chart.grid.x.timeLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.x.timeLabels.color,transform:`translate(${s.value.left+d.value*o+d.value/2}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`,style:{cursor:"pointer"},onClick:()=>Ee(a,o)},e.toDisplayString(a.text),9,Qt))),256))]))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.timeLabels.show&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[l.$slots["time-label"]?(e.openBlock(),e.createElementBlock("g",jt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.renderSlot(l.$slots,"time-label",e.mergeProps({ref_for:!0},{x:s.value.left-8,y:s.value.top+d.value*o+d.value/2+t.value.style.chart.grid.y.axisLabels.fontSize/3,fontSize:t.value.style.chart.grid.x.timeLabels.fontSize,fill:t.value.style.chart.grid.x.timeLabels.color,transform:null,absoluteIndex:a.absoluteIndex,content:a.text,textAnchor:"end",show:!0}),void 0,!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",ea,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"end","font-size":t.value.style.chart.grid.y.axisLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,x:s.value.left-8,y:s.value.top+d.value*o+d.value/2+t.value.style.chart.grid.y.axisLabels.fontSize/3,style:{cursor:"pointer"},onClick:()=>Ee(a,o)},e.toDisplayString(a.text),9,ta))),256))]))],64)):e.createCommentVNode("",!0),y.value.showTooltip&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:16},e.renderList(c.value.end-c.value.start,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{x:s.value.left+o*d.value,y:s.value.top,width:d.value,height:s.value.height<0?0:s.value.height,onClick:i=>xe(o),onMouseenter:i=>we(o),onMouseleave:r[0]||(r[0]=i=>{P.value=null,D.value=!1}),fill:o===P.value?t.value.style.chart.highlighter.color:"transparent",style:e.normalizeStyle({opacity:t.value.style.chart.highlighter.opacity/100})},null,44,aa))),256)):e.createCommentVNode("",!0),y.value.showTooltip&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:17},e.renderList(c.value.end-c.value.start,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{x:s.value.left,y:s.value.top+o*d.value,width:s.value.width<0?0:s.value.width,height:d.value,onClick:i=>xe(o),onMouseenter:i=>we(o),onMouseleave:r[1]||(r[1]=i=>{P.value=null,D.value=!1}),fill:o===P.value?t.value.style.chart.highlighter.color:"transparent",style:e.normalizeStyle({opacity:t.value.style.chart.highlighter.opacity/100})},null,44,la))),256)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({...s.value})),void 0,!0)],12,ft)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",oa,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(de)||e.unref(he)})),void 0,!0)])):e.createCommentVNode("",!0),T.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ct.default,{key:5,config:{type:"bar",style:{backgroundColor:t.value.style.chart.backgroundColor,bar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartSlicer",ref:oe,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`),"data-dom-to-png-ignore":""},[t.value.style.chart.zoom.show&&z.value>1?(e.openBlock(),e.createBlock(ot.Slicer,{ref_key:"slicerComponent",ref:M,key:`slicer_${se.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.grid.x.timeLabels.values[c.value.start]?t.value.style.chart.grid.x.timeLabels.values[c.value.start]:"",labelRight:t.value.style.chart.grid.x.timeLabels.values[c.value.end-1]?t.value.style.chart.grid.x.timeLabels.values[c.value.end-1]:"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:Math.max(...G.dataset.map(a=>a.series.length)),min:0,valueStart:c.value.start,valueEnd:c.value.end,start:c.value.start,"onUpdate:start":r[2]||(r[2]=a=>c.value.start=a),end:c.value.end,"onUpdate:end":r[3]||(r[3]=a=>c.value.end=a),refreshStartPoint:t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex:0,refreshEndPoint:t.value.style.chart.zoom.endIndex!==null?t.value.style.chart.zoom.endIndex+1:Math.max(...G.dataset.map(a=>a.series.length)),enableRangeHandles:t.value.style.chart.zoom.enableRangeHandles,enableSelectionDrag:t.value.style.chart.zoom.enableSelectionDrag,onReset:be},{"reset-action":e.withCtx(({reset:a})=>[e.renderSlot(l.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:a})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end","refreshStartPoint","refreshEndPoint","enableRangeHandles","enableSelectionDrag"])):e.createCommentVNode("",!0)],4),e.createVNode(rt._sfc_main,{show:y.value.showTooltip&&D.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:F.value,content:K.value,isFullscreen:A.value,isCustom:e.unref(u.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...Z.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...Z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),e.createElementVNode("div",{ref_key:"chartLegend",ref:le},[t.value.style.chart.legend.show&&T.value?(e.openBlock(),e.createBlock(nt.Legend,{key:0,legendSet:_e.value,config:Je.value,onClickMarker:r[4]||(r[4]=({legend:a})=>a.segregate())},e.createSlots({item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:o=>a.segregate(),style:e.normalizeStyle(`opacity:${f.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name),13,ra)]),_:2},[l.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:a,index:o})=>[e.createVNode(mt._sfc_main,{shape:a.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${C.value}_${o})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_e.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:re,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),c.value.end-c.value.start<200?(e.openBlock(),e.createBlock(it.default,{key:7,hideDetails:"",config:{open:y.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ut.DataTable,{colNames:W.value.colNames,head:W.value.head,body:W.value.body,config:W.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[5]||(r[5]=a=>y.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a},null,8,sa)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(isNaN(Number(a))?a:e.unref(u.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.table.td.roundingValue})),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,bt))}},ia=yt._export_sfc(na,[["__scopeId","data-v-1c876490"]]);exports.default=ia;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-Cn2tUOoX.cjs"),re=require("./useResponsive-BBkmXXaa.cjs"),ge=require("./Title-D62pPwLz.cjs"),se=require("./usePrinter-BrH80VBz.cjs"),ke=require("./Tooltip-C_H6-uAa.cjs"),xe=require("./DataTable-CNCnRrD-.cjs"),Ce=require("./vue-ui-skeleton-Mcoev-5q.cjs"),we=require("./Shape-BQIcurpe.cjs"),Be=require("./vue-ui-accordion-7GoAZx3k.cjs"),ne=require("./useNestedProp-C8955nsn.cjs"),Se=require("./PackageVersion-BxSGdh6L.cjs"),$e=require("./PenAndPaper-ByAFuR-l.cjs"),Ne=require("./useUserOptionState-BgepsfED.cjs"),_e=require("./useChartAccessibility-Cm7nkzTG.cjs"),Te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Le=["id"],Pe=["xmlns","viewBox"],Ee=["x","y","width","height"],Ae={key:1},ze={key:0},Ve=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Oe={key:1},Fe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],De=["x1","x2","y1","y2","stroke","stroke-width"],Me=["x1","x2","y1","y2","stroke","stroke-width"],Ie=["x","y","fill","font-size"],We=["x","y","font-size","fill"],qe=["fill","font-size","transform"],Re=["fill","font-size","x","y"],Ge=["x1","x2","y1","y2","stroke"],Ue=["cx","cy","fill"],He=["cx","cy","fill"],je=["id"],Xe=["stop-color"],Ye=["stop-color"],Je=["stop-color"],Ke={key:0},Qe=["x","y","font-size","fill"],Ze={key:5,class:"vue-data-ui-watermark"},et=["innerHTML"],tt={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ue,{expose:ie,emit:ce}){const{vue_ui_strip_plot:ve}=r.useConfig(),v=ue,de=ce,p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(r.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),g=e.ref(null),D=e.ref(null),M=e.ref(null),I=e.ref(null),W=e.ref(!1),q=e.ref(0),R=e.ref(0),t=e.computed({get:()=>j(),set:l=>l}),{userOptionsVisible:A,setUserOptionsVisibility:G,keepUserOptionState:U}=Ne.useUserOptionState({config:t.value}),{svgRef:H}=_e.useChartAccessibility({config:t.value.style.chart.title});function j(){const l=ne.useNestedProp({userConfig:v.config,defaultConfig:ve});return l.theme?{...ne.useNestedProp({userConfig:r.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>v.config,l=>{t.value=j(),A.value=!t.value.userOptions.showOnChartHover,X(),q.value+=1,R.value+=1,c.value.dataLabels.show=t.value.style.chart.labels.bestPlotLabel.show,c.value.showTable=t.value.table.show,c.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const C=e.ref(null);e.onMounted(()=>{X()});function X(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(o=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:o,index:s})}),l.plots&&l.plots.forEach((o,n)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=re.throttle(()=>{const{width:s,height:o}=re.useResponsive({chart:g.value,title:t.value.style.chart.title.text?D.value:null,source:M.value,noTitle:I.value});requestAnimationFrame(()=>{w.value=o,y.value.width=s,y.value.height=o,x.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=r.translateSize({relator:Math.min(o,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})})});C.value=new ResizeObserver(l),C.value.observe(g.value.parentNode)}W.value=!0,setTimeout(()=>{k.value=!1},pe.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:Y,isImaging:J,generatePdf:K,generateImage:Q}=se.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot",options:t.value.userOptions.print}),he=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Z=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),k=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),x=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),y=e.ref({width:x.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),a=e.computed(()=>{const l=x.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:x.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:x.value,absoluteHeight:w.value,absoluteWidth:l}}),S=e.computed(()=>p.value?v.dataset.map((l,s)=>{const o=r.createUid();return{...l,id:o,color:l.color?r.convertColorToHex(l.color):Z.value[s]||r.palette[s]||r.palette[s%r.palette.length],plots:l.plots.map(n=>({...n,value:r.checkNaN(n.value),parentId:o,color:l.color?r.convertColorToHex(l.color):Z.value[s]||r.palette[s]||r.palette[s%r.palette.length],id:r.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(S.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,x:a.value.left+(s+1)*a.value.stripWidth-a.value.stripWidth/2}))}))),pe=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),z=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(o=>o.value));return{max:Math.max(...l),min:Math.min(...l)}}),f=e.computed(()=>r.calculateNiceScale(z.value.min<0?z.value.min:0,z.value.max,t.value.style.chart.grid.scaleSteps)),fe=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,y:a.value.bottom-(o.value+Math.abs(f.value.min))/(f.value.max+Math.abs(f.value.min))*a.value.height}))}))),ee=e.computed(()=>f.value.ticks.map(l=>({y:a.value.bottom-a.value.height*((l+Math.abs(f.value.min))/(f.value.max+Math.abs(f.value.min))),x1:a.value.left,x2:a.value.right,value:l}))),V=e.ref(null),i=e.ref(null);function me({datapoint:l,seriesIndex:s}){V.value={datapoint:l,seriesIndex:s,config:t.value,series:S.value},P.value=!0,i.value=l;const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:s,datapoint:l,series:S.value,config:t.value})))E.value=o({seriesIndex:s,datapoint:l,series:S.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${r.applyDataLabel(t.value.style.chart.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,E.value=`<div>${n}</div>`}}const $=e.computed(()=>{const l=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${o.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function te(){e.nextTick(()=>{const l=$.value.head.map((n,u)=>[[n.name],[$.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const N=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=$.value.head.map((u,m)=>{const T=r.dataLabel({p:t.value.style.chart.labels.prefix,v:$.value.body[m],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:o}}),b=e.ref(!1);function ye(l){b.value=l,F.value+=1}function be(){return h.value}function le(){c.value.showTable=!c.value.showTable}function oe(){c.value.dataLabels.show=!c.value.dataLabels.show}function ae(){c.value.showTooltip=!c.value.showTooltip}const _=e.ref(!1);function O(){_.value=!_.value}return ie({getData:be,generatePdf:K,generateCsv:te,generateImage:Q,toggleTable:le,toggleLabels:oe,toggleTooltip:ae,toggleAnnotator:O}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:g,class:e.normalizeClass(`vue-ui-strip-plot ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`,onMouseenter:s[2]||(s[2]=()=>e.unref(G)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(G)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock($e._sfc_main,{key:0,svgRef:e.unref(H),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:O},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:I,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:D,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ge._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value&&(e.unref(U)||e.unref(A))?(e.openBlock(),e.createBlock(se.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Y),isImaging:e.unref(J),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:b.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:ye,onGeneratePdf:e.unref(K),onGenerateCsv:te,onGenerateImage:e.unref(Q),onToggleTable:le,onToggleLabels:oe,onToggleTooltip:ae,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(U)?e.unref(A)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:n})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:n})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"6"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"7"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:H,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(Se._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.value.left,y:a.value.top,width:a.value.width,height:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Ee)):e.createCommentVNode("",!0),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Ae,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,o=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y,y2:o.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Ve))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("line",{x1:a.value.left+(n+1)*a.value.stripWidth,x2:a.value.left+(n+1)*a.value.stripWidth,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Fe))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:a.value.left,x2:a.value.left,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,De),e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:a.value.bottom,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Me)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(ee.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:o.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.labels.prefix,v:o.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:o,seriesIndex:n})),9,Ie))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.value.left+(n+1)*a.value.stripWidth-a.value.stripWidth/2,y:a.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(o.name),9,We))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${a.value.top+a.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,qe)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:5,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:a.value.left+a.value.width/2,y:a.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Re)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ge),e.createElementVNode("circle",{cx:a.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ue),e.createElementVNode("circle",{cx:a.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,He)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,o=>(e.openBlock(),e.createElementBlock("radialGradient",{id:o.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Xe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(o.color,.1)},null,8,Ye),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,Je)],8,je))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,m)=>(e.openBlock(),e.createBlock(we._sfc_main,e.mergeProps({plot:{x:u.x,y:W.value?u.y:a.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${o.id})`:o.color,onMouseenter:T=>me({datapoint:u,seriesIndex:m}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>de("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${k.value?`transition-delay:${m*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&k.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!k.value}},{ref_for:!0},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m===o.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&k.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(r.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:m}):""),13,Qe)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,Pe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ze,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Y)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ce.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:M,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ke._sfc_main,{show:c.value.showTooltip&&P.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:g.value,content:E.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(Be.default,{key:8,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(xe.DataTable,{key:`table_${R.value}`,colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=o=>c.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,et)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Le))}},lt=Te._export_sfc(tt,[["__scopeId","data-v-409e2195"]]);exports.default=lt;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./index-Cn2tUOoX.cjs"),S=require("./vue-ui-xy-aQEDcKbT.cjs"),w=require("./vue-ui-donut-BM9i2XHJ.cjs"),e=require("vue"),_=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),O={name:"vue-ui-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},components:{VueUiXy:S.default,VueUiDonut:w.default},data(){return{uid:`vue-ui-table-${Math.random()}`,bodyCopy:JSON.parse(JSON.stringify(this.dataset.body)).map((n,o)=>({...n,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,dragOffsetX:0,dragOffsetY:0,modalWidth:400,modalHeight:200,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((n,o)=>n-o),palette:N.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((n,o)=>({...n,absoluteIndex:o})),tableHead:JSON.parse(JSON.stringify(this.dataset.header)).map(n=>({average:Object.hasOwn(n,"average")?n.average:!1,decimals:Object.hasOwn(n,"decimals")?n.decimals:0,isMultiselect:Object.hasOwn(n,"isMultiselect")?n.isMultiselect:!1,isPercentage:Object.hasOwn(n,"isPercentage")?n.isPercentage:!1,isSearch:Object.hasOwn(n,"isSearch")?n.isSearch:!1,isSort:Object.hasOwn(n,"isSort")?n.isSort:!1,name:n.name,percentageTo:Object.hasOwn(n,"percentageTo")?n.percentageTo:void 0,prefix:Object.hasOwn(n,"prefix")?n.prefix:"",rangeFilter:Object.hasOwn(n,"rangeFilter")?n.rangeFilter:!1,suffix:Object.hasOwn(n,"suffix")?n.suffix:"",sum:Object.hasOwn(n,"sum")?n.sum:!1,type:n.type}))}},mounted(){if(this.dataset.header.length===0)throw new Error(`vue-ui-table error: missing header data.
|
|
2
|
-
Provide an array of objects of type:
|
|
3
|
-
{
|
|
4
|
-
name: string;
|
|
5
|
-
type: string; ('text' | 'numeric' | 'date')
|
|
6
|
-
average: boolean;
|
|
7
|
-
decimals: number | undefined;
|
|
8
|
-
sum: boolean;
|
|
9
|
-
isSort:boolean;
|
|
10
|
-
isSearch: boolean;
|
|
11
|
-
isMultiselect: boolean;
|
|
12
|
-
isPercentage: boolean;
|
|
13
|
-
percentageTo: string; (or '')
|
|
14
|
-
}`);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",r=>{const n=document.activeElement;(n&&Array.from(n.classList).includes("td-focusable")&&r.key.includes("Arrow")||r.code==="Space")&&r.preventDefault()})},watch:{showChart:function(r){r&&this.$nextTick(()=>{this.closeDragElement()})},dataset:{handler(r){this.isLoading=!0,this.bodyCopy=JSON.parse(JSON.stringify(r.body)).map((n,o)=>({...n,absoluteIndex:o})),this.tableBody=JSON.parse(JSON.stringify(r.body)).map((n,o)=>({...n,absoluteIndex:o})),this.tableHead=JSON.parse(JSON.stringify(r.header)).map(n=>({average:Object.hasOwn(n,"average")?n.average:!1,decimals:Object.hasOwn(n,"decimals")?n.decimals:0,isMultiselect:Object.hasOwn(n,"isMultiselect")?n.isMultiselect:!1,isPercentage:Object.hasOwn(n,"isPercentage")?n.isPercentage:!1,isSearch:Object.hasOwn(n,"isSearch")?n.isSearch:!1,isSort:Object.hasOwn(n,"isSort")?n.isSort:!1,name:n.name,percentageTo:Object.hasOwn(n,"percentageTo")?n.percentageTo:void 0,prefix:Object.hasOwn(n,"prefix")?n.prefix:"",rangeFilter:Object.hasOwn(n,"rangeFilter")?n.rangeFilter:!1,suffix:Object.hasOwn(n,"suffix")?n.suffix:"",sum:Object.hasOwn(n,"sum")?n.sum:!1,type:n.type})),this.currentSelectionSpan={col:void 0,rows:[]},this.selectedColumn=void 0,this.itemsPerPage=this.config.rowsPerPage?this.config.rowsPerPage:25,this.percentages={},this.dates={},this.filteredDatesIndexes={},this.hasNaN={},this.immutableRangeFilters={},this.rangeFilters={},this.multiselects={},this.searches={},this.sorts={},this.showChart=!1,this.currentDonut=void 0,this.selectedDonutCategory=void 0,this.selectedPlot=void 0,this.showDonutOptions=!1,this.currentSelectionSpan.col=void 0,this.currentSelectionSpan.rows=[],this.promiseWithAsyncFunction(this.prepareBodyCopy,()=>{this.$forceUpdate(),this.updateCurrentPage(),this.isLoading=!1})},deep:!0,immediate:!1}},computed:{availableDonutCategories(){return Object.keys(this.multiselects).map(r=>({index:r,name:this.dataset.header[r].name,options:this.multiselects[r]}))},canChart(){return this.FINAL_CONFIG.useChart&&this.currentSelectionSpan.rows.length>1},chartData(){if(!this.canChart)return[];const r=316,n=512,o=this.currentSelectionSpan.rows.length,i=n/o,s=Math.max(...this.currentSelectionSpan.rows.map(p=>p.value)),t=Math.min(...this.currentSelectionSpan.rows.map(p=>p.value)),u=this.dataset.header[this.currentSelectionSpan.col].isPercentage&&this.dataset.header[this.currentSelectionSpan.col].percentageTo,h=this.chart.type===this.constants.DONUT&&this.selectedDonutCategory&&this.selectedDonutCategory.name,a=this.dataset.header[this.currentSelectionSpan.col].name+(u?` / ${this.dataset.header[this.percentages[this.currentSelectionSpan.col].referenceIndex].name}`:"")+(h?` ${this.FINAL_CONFIG.translations.by} ${this.selectedDonutCategory.name}`:""),l=this.dataset.header[this.currentSelectionSpan.col].prefix,c=this.dataset.header[this.currentSelectionSpan.col].suffix,d=[{name:a,series:this.currentSelectionSpan.rows.map(p=>p.value),type:"line",useProgression:!0,smooth:this.FINAL_CONFIG.style.chart.layout.line.smooth,color:this.FINAL_CONFIG.style.chart.layout.line.stroke,useArea:this.FINAL_CONFIG.style.chart.layout.line.useArea}],y=[{name:a,series:this.currentSelectionSpan.rows.map(p=>p.value),type:"bar",useProgression:!0,color:this.FINAL_CONFIG.style.chart.layout.bar.fill}],b=this.FINAL_CONFIG.style.chart.modal.backgroundColor,g=this.adaptColorToBackground(b),m=this.dataset.header[this.currentSelectionSpan.col].decimals,F={chart:{backgroundColor:b,color:g,labels:{fontSize:18,prefix:l,suffix:c},grid:{stroke:N.lightenHexColor(g,.5),labels:{color:g,xAxisLabels:{show:!1}}},highlighter:{color:g},legend:{color:g},padding:{left:72,bottom:24,top:36},title:{text:a,color:g,fontSize:18},tooltip:{showTimeLabel:!1,backgroundOpacity:30,color:g,backgroundColor:b,showPercentage:!1,roundingValue:m},userOptions:{position:"left",buttons:{pdf:!1,csv:!1,table:!1,annotator:!1}},zoom:{show:!1}},line:{labels:{show:!0,color:g,rounding:m},dot:{useSerieColor:!1,fill:this.FINAL_CONFIG.style.chart.layout.line.plot.fill,strokeWidth:this.FINAL_CONFIG.style.chart.layout.line.plot.strokeWidth}},bar:{useGradient:!1,border:{useSerieColor:!1,stroke:this.FINAL_CONFIG.style.chart.layout.bar.stroke,strokeWidth:this.FINAL_CONFIG.style.chart.layout.bar.strokeWidth},labels:{show:!0,color:g,rounding:m}}},f=t>=0?0:Math.abs(t),I=s+f,C=this.dataset.header[this.currentSelectionSpan.col].isPercentage,k=this.currentSelectionSpan.rows.map((p,v)=>({x:i*v+i/2,y:(1-(p.value+f)/I)*r,value:C?p.value*100:p.value,suffix:C?"%":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:p.index,absoluteValue:C?Math.abs(p.value)*100:Math.abs(p.value)}));return{donutConfig:{userOptions:{position:"left",buttons:{pdf:!1,csv:!1,table:!1,annotator:!1}},style:{chart:{backgroundColor:b,color:g,layout:{curvedMarkers:!0,donut:{strokeWidth:64},labels:{dataLabels:{suffix:C?"%":"",prefix:l},value:{rounding:m},percentage:{color:g,rounding:m},name:{color:g},hollow:{average:{color:g,text:this.FINAL_CONFIG.translations.average,value:{color:g}},total:{color:g,offsetY:-12,text:this.FINAL_CONFIG.translations.total,value:{color:g,offsetY:-12}}}}},legend:{backgroundColor:b,color:g,roundingValue:m,roundingPercentage:m},padding:{left:12,right:12},title:{text:a,color:g,fontSize:18},tooltip:{backgroundOpacity:30,color:g,backgroundColor:b,roundingValue:m,roundingValue:m}}}},xyConfig:F,xyDatasetLine:d,xyDatasetBar:y,progression:k.length>=2?this.calcLinearProgression(k):!1}},hasNumericTypes(){return this.dataset.header.map(r=>r.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>`,grip:`<svg xmlns="http://www.w3.org/2000/svg" width="${this.iconSize}" height="${this.iconSize}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M5 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M5 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M12 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M12 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M19 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M19 15m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /></svg>`}},pages(){const r=[];if(this.bodyCopy.length)for(let n=0;n<this.bodyCopy.length;n+=this.itemsPerPage)r.push(this.bodyCopy.slice(n,n+this.itemsPerPage));return r},rows(){return this.bodyCopy.map(r=>r.td)},selectedCellsCalculations(){return{sumPercentage:Number((this.currentSelectionSpan.rows.map(r=>r.value).reduce((r,n)=>r+n,0)*100).toFixed(this.dataset.header[this.currentSelectionSpan.col].decimals)).toLocaleString(),sumRegular:Number(this.currentSelectionSpan.rows.map(r=>r.value).reduce((r,n)=>r+n,0).toFixed(this.dataset.header[this.currentSelectionSpan.col].decimals)).toLocaleString(),averagePercentage:Number((this.currentSelectionSpan.rows.map(r=>r.value).reduce((r,n)=>r+n,0)/this.currentSelectionSpan.rows.length*100).toFixed(this.dataset.header[this.currentSelectionSpan.col].decimals)).toLocaleString(),averageRegular:Number((this.currentSelectionSpan.rows.map(r=>r.value).reduce((r,n)=>r+n,0)/this.currentSelectionSpan.rows.length).toFixed(this.dataset.header[this.currentSelectionSpan.col].decimals)).toLocaleString()}},FINAL_CONFIG(){const{vue_ui_table:r}=N.useConfig();if(!Object.keys(this.config||{}).length)return r;const n=this.treeShake({defaultConfig:r,userConfig:this.config});return this.convertConfigColors(n)},visibleRows(){return this.pages[this.currentPage]}},methods:{adaptColorToBackground:N.adaptColorToBackground,convertColorToHex:N.convertColorToHex,convertConfigColors:N.convertConfigColors,createCsvContent:N.createCsvContent,darkenHexColor:N.darkenHexColor,dataLabel:N.dataLabel,downloadCsv:N.downloadCsv,lightenHexColor:N.lightenHexColor,treeShake:N.treeShake,applyDonutOption(){const r=this.selectedDonutCategory.options.map((n,o)=>({name:n,color:this.palette[o]||this.palette[o%this.palette.length],values:[this.visibleRows.filter((i,s)=>i.td[this.selectedDonutCategory.index]===n&&this.currentSelectionSpan.rows.map(t=>t.index).includes(s)).map(i=>i.td[this.currentSelectionSpan.col]).reduce((i,s)=>Math.abs(i)+Math.abs(s),0)],absoluteValue:this.visibleRows.filter((i,s)=>i.td[this.selectedDonutCategory.index]===n&&this.currentSelectionSpan.rows.map(t=>t.index).includes(s)).map(i=>i.td[this.currentSelectionSpan.col]).reduce((i,s)=>i+s,0)})).sort((n,o)=>o.value-n.value);this.currentDonut=r,this.$nextTick(()=>{this.chart.type=this.constants.DONUT,this.showDonutOptions=!1})},calcRectY(r,n){return r>=0?n:this.chartData.zero},canResetColumn(r,n){return!this.hasNaN[r]&&(n.isSort||n.isSearch||n.isMultiselect||n.rangeFilter)&&![this.constants.DATE].includes(n.type)},createXls(r="all"){const n=this.dataset.header.map(t=>t.name),o=r==="all"?this.bodyCopy.map(t=>t.td):this.visibleRows.map(t=>t.td),i=[n].concat(o),s=this.createCsvContent(i);this.downloadCsv({csvContent:s,title:"vue-ui-table"})},calcLinearProgression:N.calcLinearProgression,closeAllDropdowns(){const r=document.getElementsByClassName("th-dropdown");r.length&&Array.from(r).forEach(n=>{n.dataset.isOpen=!1})},debounce(r,n){let o;clearTimeout(o),o=setTimeout(r,n)},filterBody(){this.bodyCopy=this.tableBody.filter(r=>{for(const n in this.searches)if(!r.td[n].toUpperCase().includes(this.searches[n].toUpperCase()))return!1;for(const n in this.multiselects)if(!this.multiselects[n].some(i=>i===r.td[n]))return!1;for(const n in this.dates){const o=new Date(r.td[n]),i=new Date(this.dates[n].from),s=new Date(this.dates[n].to);if(o<i||o>s)return!1}return!0}),this.sortBody()},getAverage(r){return this.rows.map(n=>n[r]).map(n=>isNaN(Number(n))?0:n).reduce((n,o)=>n+o,0)/this.bodyCopy.length},getDatesRange(r){const n=this.dataset.body.map(y=>new Date(y.td[r])),o=new Date(Math.min(...n)),i=new Date(Math.max(...n)),s=o.getFullYear(),t=i.getFullYear(),u=String(o.getMonth()+1).padStart(2,"0"),h=String(i.getMonth()+1).padStart(2,"0"),a=String(o.getDate()).padStart(2,"0"),l=String(i.getDate()).padStart(2,"0"),c=`${s}-${u}-${a}`,d=`${t}-${h}-${l}`;return{from:c,to:d}},getDonutLegendValue(r){return Number((r*(this.dataset.header[this.currentSelectionSpan.col].isPercentage?100:1)).toFixed(this.dataset.header[this.currentSelectionSpan.col].decimals)).toLocaleString()},getDropdownOptions(r){return[...new Set(this.dataset.body.map(n=>n.td[r]))]},getSum(r){return this.rows.map(n=>n[r]).map(n=>isNaN(Number(n))?0:n).reduce((n,o)=>n+o,0)},includesNaN(r){return r.includes(NaN)},isDropdownOptionSelected(r,n){return this.multiselects[n]?this.multiselects[n].includes(r):!0},isNumeric(r){return!isNaN(Number(String(r).replaceAll("%","")))},isResetDisabled(r,n){const o=n.isSort,i=n.isSearch,s=n.isMultiselect&&this.multiselects[r],t=n.rangeFilter,u=h=>{if(t&&this.rangeFilters[h])return Math.round(this.rangeFilters[h].min)===this.immutableRangeFilters[h].min&&Math.round(this.rangeFilters[h].max)===this.immutableRangeFilters[h].max};if(o&&i&&s&&t)return["",void 0].includes(this.searches[r])&&[void 0].includes(this.sorts[r])&&this.multiselects[r].length===this.getDropdownOptions(r).length&&u(r);if(o&&i&&s)return["",void 0].includes(this.searches[r])&&[void 0].includes(this.sorts[r])&&this.multiselects[r].length===this.getDropdownOptions(r).length;if(o&&i&&t)return["",void 0].includes(this.searches[r])&&[void 0].includes(this.sorts[r])&&u(r);if(o&&i)return["",void 0].includes(this.searches[r])&&[void 0].includes(this.sorts[r]);if(o&&s&&t)return[void 0].includes(this.sorts[r])&&this.multiselects[r].length===this.getDropdownOptions(r).length&&u(r);if(o&&s)return[void 0].includes(this.sorts[r])&&this.multiselects[r].length===this.getDropdownOptions(r).length;if(i&&s&&t)return["",void 0].includes(this.searches[r])&&this.multiselects[r].length===this.getDropdownOptions(r).length&&u(r);if(i&&s)return["",void 0].includes(this.searches[r])&&this.multiselects[r].length===this.getDropdownOptions(r).length;if(i&&t)return["",void 0].includes(this.searches[r])&&u(r);if(i)return["",void 0].includes(this.searches[r]);if(o&&t)return[void 0].includes(this.sorts[r])&&u(r);if(o)return[void 0].includes(this.sorts[r]);if(s&&t)return this.multiselects[r].length===this.getDropdownOptions(r).length&&u(r);if(s)return this.multiselects[r].length===this.getDropdownOptions(r).length},navigate(r){this.resetSelection(),r==="next"&&this.currentPage<this.pages.length?this.currentPage+=1:r==="previous"&&this.currentPage>=1?this.currentPage-=1:this.currentPage=r-1,this.$refs.tableWrapper.scrollTo({top:0,left:0,behavior:"smooth"})},navigateCell(r){r.preventDefault();const n=r.keyCode,o=38,i=40,s=37,t=39;if(![o,i,s,t].includes(n))return;const u=r.target.id,h=/cell_(\d+)_(\d+)_vue-ui-table-(\d+)/,a=u.match(h),l=parseInt(a[1]),c=parseInt(a[2]),d=document.getElementById(`cell_${l}_${c+1}_${this.uid}`),y=document.getElementById(`cell_${l}_${c-1}_${this.uid}`),b=document.getElementById(`cell_${l+1}_${c}_${this.uid}`),g=document.getElementById(`cell_${l-1}_${c}_${this.uid}`);let m;switch(!0){case n===t:m=d;break;case n===s:m=y;break;case n===o:m=g;break;case n===i:m=b;break;default:return}m&&(m.focus(),m.scrollIntoView({behavior:"smooth",block:"center"}))},openDonutOptions(){this.selectedDonutCategory=this.availableDonutCategories[0],this.showDonutOptions=!0},placeLabelOnTopOrBottom({previousPlot:r,currentPlot:n,nextPlot:o}){const i=n.y-38,s=n.y+16;return r&&o?r.value<n.value&&o.value<n.value?i:r.value>n.value&&o.value>n.value?s:(r.value>n.value&&o.value<n.value||r.value<n.value&&o.value>n.value,i):r&&!o?r.value>n.value?s:i:!r&&o&&o.value>n.value?s:i},async prepareBodyCopy(){return new Promise(r=>{const n=[];this.tableHead.forEach((o,i)=>{if(o.isSearch&&Object.assign(this.searches,{[i]:""}),o.isMultiselect&&Object.assign(this.multiselects,{[i]:this.getDropdownOptions(i)}),o.type===this.constants.DATE&&(Object.assign(this.dates,{[i]:this.getDatesRange(i)}),Object.assign(this.filteredDatesIndexes,{[i]:!1})),(o.isPercentage||o.percentageTo)&&Object.assign(this.percentages,{[i]:{reference:o.percentageTo,referenceIndex:this.dataset.header.map(s=>s.name).indexOf(o.percentageTo)}}),o.rangeFilter&&(Object.assign(this.rangeFilters,{[i]:{min:Math.round(Math.min(...this.dataset.body.map(s=>s.td).map(s=>s[i]))),max:Math.round(Math.max(...this.dataset.body.map(s=>s.td).map(s=>s[i])))}}),Object.assign(this.immutableRangeFilters,{[i]:{min:Math.round(Math.min(...this.dataset.body.map(s=>s.td).map(s=>s[i]))),max:Math.round(Math.max(...this.dataset.body.map(s=>s.td).map(s=>s[i])))}})),o.isPercentage){const s=this.dataset.header.map(u=>u.name).indexOf(o.percentageTo),t=this.dataset.body.map(u=>u.td[s]).reduce((u,h)=>u+h,0);n.push([i,s,t])}o.type===this.constants.NUMERIC&&!o.isPercentage&&Object.assign(this.hasNaN,{[i]:this.includesNaN(this.dataset.body.map(s=>Number(s.td[i])))})}),this.bodyCopy.forEach((o,i)=>{n.map(s=>{const[t,u,h]=s;o.td[t]=o.td[u]/h}),o.td.forEach((s,t)=>{this.dataset.header[t].type===this.constants.TEXT&&this.dataset.header[t].isSearch&&(o[t]=this.stringToNumber(s)),this.dataset.header[t].type===this.constants.DATE&&(o[t]=new Date(s).getTime()),this.dataset.header[t].type===this.constants.NUMERIC&&(o[t]=isNaN(Number(s))?t:s),this.tableBody[i][t]=o[t]})}),r(!0)})},promiseWithAsyncFunction(r,n){return new Promise((o,i)=>{r().then(s=>{try{const t=n(s);o(t)}catch(t){i(t)}}).catch(s=>{i(s)})})},resetDates(r){this.dates[r]={from:this.getDatesRange(r).from,to:this.getDatesRange(r).to},this.filteredDatesIndexes[r]=!1,this.$forceUpdate(),this.filterBody()},resetFilter(r,n,o){const i=o.currentTarget;clearTimeout(this.buttonTimeout),i.classList.add("clicked"),this.buttonTimeout=setTimeout(()=>{i.classList.remove("clicked")},200),this.currentFilter=void 0,n.rangeFilter&&(this.rangeFilters[r].min=this.immutableRangeFilters[r].min,this.rangeFilters[r].max=this.immutableRangeFilters[r].max),n.isMultiselect?(this.multiselects[r]=this.getDropdownOptions(r),n.type===this.constants.TEXT&&(this.sorts[r]=void 0),n.isSearch&&(this.searches[r]="")):n.type===this.constants.NUMERIC?this.sorts[r]=void 0:n.type===this.constants.TEXT?(this.sorts[r]=void 0,this.searches[r]=""):n.type===this.constants.DATE&&(this.sorts[r]=void 0),this.filterBody()},resetSelection(){const r=document.getElementsByClassName(`tr_${this.uid}`);Array.from(r).forEach(n=>{Array.from(n.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(r).forEach(n=>n.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(r){this.currentSelectionSpan.col!==r?(this.visibleRows.forEach((n,o)=>{this.selectTd({td:n.td[r],rowIndex:o,colIndex:r,headerType:this.constants.NUMERIC,event:{currentTarget:document.getElementById(`cell_${o}_${r}_${this.uid}`)}})}),this.selectedColumn=r):(this.selectedColumn=void 0,this.resetSelection())},selectDropdownOption(r,n){this.multiselects[n].includes(r)?this.multiselects[n]=this.multiselects[n].filter(o=>o!==r):this.multiselects[n].push(r),this.$forceUpdate(),this.filterBody()},selectTd({td:r,rowIndex:n,colIndex:o,headerType:i,event:s}){if(i!==this.constants.NUMERIC||isNaN(Number(r))){this.resetSelection();return}this.currentSelectionSpan.col!==o&&this.resetSelection();const t=s.currentTarget.parentNode;this.currentSelectionSpan.col=o,this.currentSelectionSpan.rows.map(u=>u.index).includes(n)?(t.dataset.selected="false",this.currentSelectionSpan.rows=this.currentSelectionSpan.rows.filter(u=>u.index!==n),s.currentTarget.classList.remove(this.cssClass.CELL),Array.from(t.children).forEach((u,h)=>{u.dataset.row==="even"?(u.style.background=this.FINAL_CONFIG.style.rows.even.backgroundColor,u.style.color=this.FINAL_CONFIG.style.rows.even.olor):(u.style.background=this.FINAL_CONFIG.style.rows.odd.backgroundColor,u.style.color=this.FINAL_CONFIG.style.rows.odd.color)}),s.currentTarget.dataset.row==="even"?(s.currentTarget.style.background=this.FINAL_CONFIG.style.rows.even.backgroundColor,s.currentTarget.style.color=this.FINAL_CONFIG.style.rows.even.color):(s.currentTarget.style.background=this.FINAL_CONFIG.style.rows.odd.backgroundColor,s.currentTarget.style.color=this.FINAL_CONFIG.style.rows.odd.color)):(t.dataset.selected="true",this.currentSelectionSpan.rows.push({index:n,value:r}),Array.from(t.children).forEach((u,h)=>{u.dataset.row==="even"?(u.style.background=this.FINAL_CONFIG.style.rows.even.selectedNeighbors.backgroundColor,u.style.color=this.FINAL_CONFIG.style.rows.even.selectedNeighbors.color):(u.style.background=this.FINAL_CONFIG.style.rows.odd.selectedNeighbors.backgroundColor,u.style.color=this.FINAL_CONFIG.style.rows.odd.selectedNeighbors.color)}),s.currentTarget.dataset.row==="odd"?(s.currentTarget.style.background=this.FINAL_CONFIG.style.rows.odd.selectedCell.backgroundColor,s.currentTarget.style.color=this.FINAL_CONFIG.style.rows.odd.selectedCell.color):(s.currentTarget.style.background=this.FINAL_CONFIG.style.rows.even.selectedCell.backgroundColor,s.currentTarget.style.color=this.FINAL_CONFIG.style.rows.even.selectedCell.color)),this.currentSelectionSpan.rows=this.currentSelectionSpan.rows.sort((u,h)=>u.index-h.index),this.chart.type===this.constants.DONUT&&this.currentSelectionSpan.rows.length>0&&this.applyDonutOption()},setFilterDatesIndexes(r){this.filteredDatesIndexes[r]=!(this.getDatesRange(r).from===this.dates[r].from&&this.getDatesRange(r).to===this.dates[r].to)},sortBody(){this.resetSelection(),Object.keys(this.rangeFilters).forEach(r=>{this.filterByRange(this.bodyCopy,r)}),Object.keys(this.sorts).forEach(r=>{this.sortByNumber(this.bodyCopy,r)}),this.currentFilter!==void 0&&this.sortByNumber(this.bodyCopy,this.currentFilter),this.dataset.header.forEach((r,n)=>{if(r.isPercentage){const o=this.percentages[n].referenceIndex,i=this.bodyCopy.map(s=>s.td[o]).reduce((s,t)=>s+t,0);this.bodyCopy.forEach(s=>{s.td[n]=s.td[o]/i})}}),this.currentPage>this.pages.length-1&&(this.currentPage=this.pages.length-1),[-1].includes(this.currentPage)&&(this.currentPage=0),this.$forceUpdate()},filterByRange(r,n){this.bodyCopy=r.filter(o=>o.td[n]>=this.rangeFilters[n].min&&o[n]<=this.rangeFilters[n].max)},sortByNumber(r,n){if(this.sorts[n]===this.constants.ASC&&(r=r.sort((o,i)=>o[n]-i[n])),this.sorts[n]===this.constants.DESC)r=r.sort((o,i)=>i[n]-o[n]);else return 0},sortTh(r,n){this.currentFilter=r;const o=n.currentTarget;clearTimeout(this.buttonTimeout),o.classList.add("clicked"),this.buttonTimeout=setTimeout(()=>{o.classList.remove("clicked")},200),this.sorts[r]===1?this.sorts[r]=this.constants.DESC:this.sorts[r]=this.constants.ASC,this.sortBody()},stringToNumber(r){let n=0;for(let o=0;o<r.length;o+=1)n+=r.charCodeAt(o);return n},toggleMultiselect(r,n,o){const i=o.currentTarget;clearTimeout(this.buttonTimeout),i.classList.add("clicked"),this.buttonTimeout=setTimeout(()=>{i.classList.remove("clicked")},200);const s=document.getElementById(`th_dropdown_${r}`);s.dataset.isOpen==="false"?s.dataset.isOpen="true":s.dataset.isOpen="false"},updateCurrentPage(r){this.resetSelection(),!r||!r.target.value?this.currentPage=0:this.currentPage=Number(r.target.value)},calcDonutMarkerConnectorColor(r){return r.proportion*100>3?r.color:"transparent"},calcDonutMarkerLabelPositionX(r){return r.center.endX+this.calcMarkerOffset(r,50)},calcMarkerOffset(r,n){return r.center.endX-n>=0?3:-2},displayArcPercentage(r,n){return isNaN(r.value/this.sumValues(n))?0:(r.value/this.sumValues(n)*100).toFixed(0)+"%"},isArcBigEnough(r){return r.proportion*100>3},sumValues(r){return[...r].map(n=>n.value).reduce((n,o)=>n+o,0)},closeDragElement(){document.onmouseup=null,document.onmousemove=null},dragMouseDown(r){r=r||window.event,r.preventDefault();const o=this.$refs.chartModal.getBoundingClientRect();this.dragOffsetX=r.clientX-o.left,this.dragOffsetY=r.clientY-o.top,this.modalWidth=o.width,this.modalHeight=o.height,document.onmouseup=this.closeDragElement,document.onmousemove=this.elementDrag},elementDrag(r){if(this.rafId)return;const o=this.$refs.chartModal.getBoundingClientRect();this.clientX=r.clientX-this.dragOffsetX,this.clientY=r.clientY-this.dragOffsetY-40,this.clientX<0&&(this.clientX=0),this.clientX+o.width>window.innerWidth&&(this.clientX=window.innerWidth-o.width-48),this.clientY<0&&(this.clientY=0),this.clientY+o.height>window.innerHeight&&(this.clientY=window.innerHeight-o.height-24)}}},L={class:"vue-ui-table-export-hub"},E=["innerHTML"],D=["data-is-open"],B={class:"vue-ui-table-export-hub-options"},A={class:"vue-ui-table-export-hub-option-wrapper"},M={class:"label"},T=["innerHTML"],x={class:"vue-ui-table-export-hub-option-wrapper"},G={class:"label"},V=["innerHTML"],z={class:"vue-ui-table"},H={id:"tableHead"},P={key:0},R={key:0},U={key:1},X={key:0,style:{display:"flex","align-items":"center","justify-content":"flex-end"}},j=["innerHTML"],Y={key:0,style:{"margin-left":"3px"}},W={key:0},J={class:"th-filter"},K={key:0,class:"th-date"},q={class:"date-wrapper--inputs"},Z={class:"date-fieldset"},Q=["for"],$=["id","onUpdate:modelValue","onInput"],ee={class:"date-fieldset"},te=["for"],se=["id","onUpdate:modelValue","onInput"],ne={class:"date-wrapper--button"},re=["onClick"],oe=["innerHTML"],le=["innerHTML"],ae=["innerHTML"],ie=["onClick","disabled"],ce=["placeholder","onUpdate:modelValue","name"],ue=["onClick"],de=["innerHTML"],he=["innerHTML"],ge=["innerHTML"],me=["onClick","innerHTML"],ye=["innerHTML"],pe={key:5,class:"th-range-filter"},Ne=["for"],be=["id","max","min","onUpdate:modelValue"],Ce=["id","max","min","onUpdate:modelValue"],fe=["for"],ke=["onClick","disabled"],Fe=["id"],Ie=["onClick"],ve=["onClick","onKeyup"],Se=["innerHTML","onClick","onKeyup"],we=["data-row"],_e=["data-row"],Oe=["data-row","onClick","onKeyup","id"],Le=["innerHTML"],Ee={key:1},De={key:2},Be={key:5},Ae=["innerHTML"],Me={key:0},Te={style:{"margin-left":"12px"}},xe={class:"format-num"},Ge={style:{"margin-left":"12px"}},Ve={key:0,class:"format-num"},ze={key:1,class:"format-num"},He={key:2},Pe={style:{"margin-left":"12px"}},Re={key:0,class:"format-num"},Ue={key:1,class:"format-num"},Xe={key:2},je={key:0,class:"vue-ui-table-paginator format-num"},Ye={key:1,class:"vue-ui-table-size-warning"},We=["innerHTML"],Je={key:3,class:"vue-ui-table-pagination format-num"},Ke=["innerHTML","disabled"],qe=["disabled"],Ze={key:0,class:"vue-ui-table-page-scroller-wrapper"},Qe={for:"pageScroller",style:{"font-size":"14px"}},$e=["max","value"],et={key:1},tt=["disabled"],st=["innerHTML","disabled"],nt=["innerHTML"],rt={class:"chart-modal-options"},ot=["innerHTML"],lt=["innerHTML"],at=["innerHTML"],it={style:{width:"100%",height:"fit-content"},ref:"chartModal"},ct={class:"vue-ui-table-fieldset"},ut={class:"vue-ui-table-fieldset-wrapper"},dt=["name","id","checked","onInput"],ht=["for"],gt=["disabled"],mt=["innerHTML"],yt={style:{width:"100%","margin-bottom":"12px"}},pt={key:2,style:{width:"100%","margin-bottom":"32px"}};function Nt(r,n,o,i,s,t){const u=e.resolveComponent("VueUiXy"),h=e.resolveComponent("VueUiDonut");return e.openBlock(),e.createElementBlock("div",{class:"vue-ui-table-main",style:e.normalizeStyle(`font-family: ${t.FINAL_CONFIG.fontFamily}`)},[e.createElementVNode("div",L,[e.createElementVNode("button",{onClick:n[0]||(n[0]=a=>s.isExportRequest=!s.isExportRequest),innerHTML:t.icons.export,style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.exportMenu.backgroundColor};color:${t.FINAL_CONFIG.style.exportMenu.color}`)},null,12,E),e.createElementVNode("div",{class:"vue-ui-table-export-hub-dropdown","data-is-open":s.isExportRequest||"false",style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.exportMenu.backgroundColor};color:${t.FINAL_CONFIG.style.exportMenu.color}`)},[n[25]||(n[25]=e.createElementVNode("b",{class:"vue-ui-table-export-hub-title"}," Export ",-1)),e.createElementVNode("button",{class:"close-dropdown",onClick:n[1]||(n[1]=a=>s.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",B,[e.createElementVNode("div",A,[e.createElementVNode("div",M,e.toDisplayString(t.FINAL_CONFIG.translations.exportAllLabel)+" ("+e.toDisplayString(s.bodyCopy.length)+") ",1),e.createElementVNode("button",{id:"exportAll",onClick:n[2]||(n[2]=a=>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,T),e.createElementVNode("span",null,e.toDisplayString(t.FINAL_CONFIG.translations.exportAllButton),1)],4)]),e.createElementVNode("div",x,[e.createElementVNode("div",G,e.toDisplayString(t.FINAL_CONFIG.translations.exportPageLabel),1),e.createElementVNode("button",{id:"exportPage",onClick:n[3]||(n[3]=a=>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,V),e.createElementVNode("span",null,e.toDisplayString(t.FINAL_CONFIG.translations.exportPageButton),1)],4)])])],12,D)]),e.createElementVNode("div",{class:"vue-ui-table__wrapper",style:e.normalizeStyle(`max-height:${t.FINAL_CONFIG.maxHeight}px`),ref:"tableWrapper"},[e.createElementVNode("table",z,[e.createElementVNode("thead",H,[e.createElementVNode("tr",null,[n[26]||(n[26]=e.createElementVNode("th",{class:"invisible-cell"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.tableHead,(a,l)=>(e.openBlock(),e.createElementBlock("th",{key:`thead_${l}`,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":s.hasNaN[l]})},[t.hasNumericTypes&&([s.constants.TEXT,s.constants.DATE].includes(a.type)||a.isPercentage)?(e.openBlock(),e.createElementBlock("span",P,[e.createTextVNode(e.toDisplayString(a.name)+" ",1),a.isPercentage?(e.openBlock(),e.createElementBlock("span",R," / "+e.toDisplayString(a.percentageTo),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("span",U,e.toDisplayString(a.name),1))],6))),128))]),t.hasNumericTypes?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("tr",null,[n[27]||(n[27]=e.createElementVNode("th",{class:"invisible-cell"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.tableHead,(a,l)=>(e.openBlock(),e.createElementBlock("th",{key:`thead_${l}`,class:e.normalizeClass({"th-numeric":!0,"th-has-nan":s.hasNaN[l]}),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.th.backgroundColor};color:${t.FINAL_CONFIG.style.th.color};outline:${t.FINAL_CONFIG.style.th.outline}`)},[a.sum&&!s.hasNaN[l]?(e.openBlock(),e.createElementBlock("span",X,[e.createElementVNode("span",{innerHTML:t.icons.sum,style:{"margin-bottom":"-4px","margin-right":"3px"}},null,8,j),e.createTextVNode(" "+e.toDisplayString(t.dataLabel({p:a.prefix,v:Number(t.getSum(l)),s:a.suffix,r:a.decimals}))+" ",1),s.percentages[l]&&a.percentageTo&&!a.isPercentage?(e.openBlock(),e.createElementBlock("span",Y," ("+e.toDisplayString(isNaN(t.getSum(l)/t.getSum(s.percentages[l].referenceIndex))?"-":t.dataLabel({v:t.getSum(l)/t.getSum(s.percentages[l].referenceIndex)*100,s:"%",r:a.decimals}))+") ",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],6))),128))]),e.createElementVNode("tr",null,[n[28]||(n[28]=e.createElementVNode("th",{class:"invisible-cell"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.tableHead,(a,l)=>(e.openBlock(),e.createElementBlock("th",{key:`thead_${l}`,class:e.normalizeClass({"th-numeric":!0,"th-has-nan":s.hasNaN[l]}),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.th.backgroundColor};color:${t.FINAL_CONFIG.style.th.color};outline:${t.FINAL_CONFIG.style.th.outline}`)},[a.average&&!s.hasNaN[l]?(e.openBlock(),e.createElementBlock("span",W," ~ "+e.toDisplayString(isNaN(t.getAverage(l))?"":t.dataLabel({p:a.prefix,v:Number(t.getAverage(l)),s:a.suffix,r:a.decimals})),1)):e.createCommentVNode("",!0)],6))),128))]),e.createElementVNode("tr",null,[n[31]||(n[31]=e.createElementVNode("th",{class:"invisible-cell"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.tableHead,(a,l)=>(e.openBlock(),e.createElementBlock("th",{key:`thead_${l}`,class:e.normalizeClass({"th-has-nan":s.hasNaN[l]}),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",J,[a.type===s.constants.DATE&&s.dates[l]?(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",q,[e.createElementVNode("div",Z,[e.createElementVNode("label",{for:`from_${l}`},e.toDisplayString(t.FINAL_CONFIG.translations.from),9,Q),e.withDirectives(e.createElementVNode("input",{id:`from_${l}`,type:"date","onUpdate:modelValue":c=>s.dates[l].from=c,onInput:c=>{t.filterBody(),t.setFilterDatesIndexes(l)},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,$),[[e.vModelText,s.dates[l].from]])]),e.createElementVNode("div",ee,[e.createElementVNode("label",{for:`to_${l}`},e.toDisplayString(t.FINAL_CONFIG.translations.to),9,te),e.withDirectives(e.createElementVNode("input",{id:`to_${l}`,type:"date","onUpdate:modelValue":c=>s.dates[l].to=c,onInput:c=>{t.filterBody(),t.setFilterDatesIndexes(l)},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,se),[[e.vModelText,s.dates[l].to]])])]),e.createElementVNode("div",ne,[a.isSort?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:c=>t.sortTh(l,c),class:e.normalizeClass({"th-button-active":[s.constants.DESC,s.constants.ASC].includes(s.sorts[l])}),style:e.normalizeStyle(`background:${[s.constants.DESC,s.constants.ASC].includes(s.sorts[l])?"":t.FINAL_CONFIG.style.pagination.buttons.backgroundColor};color:${[s.constants.DESC,s.constants.ASC].includes(s.sorts[l])?"":t.FINAL_CONFIG.style.pagination.buttons.color}`)},[s.sorts[l]===s.constants.ASC?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:[s.constants.DATE].includes(a.type)?t.icons.sort09:t.icons.sortAZ},null,8,oe)):s.sorts[l]===s.constants.DESC?(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:[s.constants.DATE].includes(a.type)?t.icons.sort90:t.icons.sortZA},null,8,le)):(e.openBlock(),e.createElementBlock("span",{key:2,innerHTML:t.icons.arrowSort},null,8,ae))],14,re)):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:c=>{t.resetDates(l),t.resetFilter(l,a,c)},disabled:!s.filteredDatesIndexes[l]&&t.isResetDisabled(l,a),class:"th-reset"}," ✖ ",8,ie)])])):e.createCommentVNode("",!0),a.isSearch?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,placeholder:t.FINAL_CONFIG.translations.inputPlaceholder,"onUpdate:modelValue":c=>s.searches[l]=c,onInput:n[4]||(n[4]=c=>t.debounce(t.filterBody,400)),name:`search_${l}`,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,ce)),[[e.vModelText,s.searches[l]]]):e.createCommentVNode("",!0),!s.hasNaN[l]&&a.isSort&&a.type!==s.constants.DATE?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:c=>t.sortTh(l,c),class:e.normalizeClass({"th-button-active":[s.constants.DESC,s.constants.ASC].includes(s.sorts[l])}),style:e.normalizeStyle(`background:${[s.constants.DESC,s.constants.ASC].includes(s.sorts[l])?"":t.FINAL_CONFIG.style.pagination.buttons.backgroundColor};color:${[s.constants.DESC,s.constants.ASC].includes(s.sorts[l])?"":t.FINAL_CONFIG.style.pagination.buttons.color}`)},[s.sorts[l]===s.constants.ASC?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:[s.constants.NUMERIC].includes(a.type)?t.icons.sort09:t.icons.sortZA},null,8,de)):s.sorts[l]===s.constants.DESC?(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:[s.constants.NUMERIC].includes(a.type)?t.icons.sort90:t.icons.sortAZ},null,8,he)):(e.openBlock(),e.createElementBlock("span",{key:2,innerHTML:t.icons.arrowSort},null,8,ge))],14,ue)):e.createCommentVNode("",!0),a.isMultiselect?(e.openBlock(),e.createElementBlock("button",{key:3,onClick:c=>t.toggleMultiselect(l,a,c),innerHTML:t.icons.filter,class:e.normalizeClass({"th-button-active":s.multiselects[l]&&s.multiselects[l].length!==t.getDropdownOptions(l).length}),style:e.normalizeStyle(`background:${s.multiselects[l]&&s.multiselects[l].length!==t.getDropdownOptions(l).length?"":t.FINAL_CONFIG.style.pagination.buttons.backgroundColor};color:${s.multiselects[l]&&s.multiselects[l].length!==t.getDropdownOptions(l).length?"":t.FINAL_CONFIG.style.pagination.buttons.color}`)},null,14,me)):e.createCommentVNode("",!0),s.currentSelectionSpan.col===l&&t.canChart?(e.openBlock(),e.createElementBlock("button",{key:4,onClick:n[5]||(n[5]=c=>s.showChart=!s.showChart),innerHTML:t.icons.chart,class:e.normalizeClass({"th-button-active":s.showChart}),style:e.normalizeStyle(`background:${s.showChart?"":t.FINAL_CONFIG.style.pagination.buttons.backgroundColor};color:${s.showChart?"":t.FINAL_CONFIG.style.pagination.buttons.color}`)},null,14,ye)):e.createCommentVNode("",!0),a.rangeFilter&&s.rangeFilters[l]&&!s.hasNaN[l]?(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("label",{for:`rangeMin${l}`},n[29]||(n[29]=[e.createElementVNode("span",{style:{color:"grey"}},"ᒥ",-1),e.createTextVNode(" min "),e.createElementVNode("span",{style:{color:"grey"}},"ᒣ",-1)]),8,Ne),e.withDirectives(e.createElementVNode("input",{type:"number",id:`rangeMin${l}`,max:s.immutableRangeFilters[l].max,min:s.immutableRangeFilters[l].min,"onUpdate:modelValue":c=>s.rangeFilters[l].min=c,onInput:n[6]||(n[6]=c=>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,be),[[e.vModelText,s.rangeFilters[l].min,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"number",id:`rangeMax${l}`,max:s.immutableRangeFilters[l].max,min:s.immutableRangeFilters[l].min,"onUpdate:modelValue":c=>s.rangeFilters[l].max=c,onInput:n[7]||(n[7]=c=>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,Ce),[[e.vModelText,s.rangeFilters[l].max,void 0,{number:!0}]]),e.createElementVNode("label",{for:`rangeMax${l}`},n[30]||(n[30]=[e.createElementVNode("span",{style:{color:"grey"}},"ᒪ",-1),e.createTextVNode(" max "),e.createElementVNode("span",{style:{color:"grey"}},"ᒧ",-1)]),8,fe)])):e.createCommentVNode("",!0),t.canResetColumn(l,a)?(e.openBlock(),e.createElementBlock("button",{key:6,onClick:c=>t.resetFilter(l,a,c),disabled:t.isResetDisabled(l,a),class:"th-reset"}," ✖ ",8,ke)):e.createCommentVNode("",!0),a.isMultiselect?(e.openBlock(),e.createElementBlock("div",{key:7,class:"th-dropdown","data-is-open":"false",id:`th_dropdown_${l}`,style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.dropdowns.backgroundColor};color:${t.FINAL_CONFIG.style.dropdowns.color}`)},[e.createElementVNode("button",{class:"close-dropdown",onClick:c=>t.toggleMultiselect(l,a,c),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.closeButtons.backgroundColor};color:${t.FINAL_CONFIG.style.closeButtons.color}`)}," ✖ ",12,Ie),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.getDropdownOptions(l),(c,d)=>(e.openBlock(),e.createElementBlock("span",{class:"th-option",key:`th_option_${l}_${d}`,onClick:y=>t.selectDropdownOption(c,l),onKeyup:[e.withKeys(y=>t.selectDropdownOption(c,l),["enter"]),e.withKeys(y=>t.selectDropdownOption(c,l),["space"])],style:e.normalizeStyle(`opacity:${t.isDropdownOptionSelected(c,l)?1:.5}`),tabindex:"0"},[t.isDropdownOptionSelected(c,l)?(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(c),1)],44,ve))),128))],12,Fe)):e.createCommentVNode("",!0)])],6))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("tr",null,[n[32]||(n[32]=e.createElementVNode("th",{class:"invisible-cell"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.tableHead,(a,l)=>(e.openBlock(),e.createElementBlock("th",{key:`col_selector_${l}`,class:e.normalizeClass({"vue-ui-table-col-selector":!s.hasNaN[l],"th-has-nan":s.hasNaN[l]}),style:e.normalizeStyle(`background:${l===s.selectedColumn&&!s.hasNaN[l]?t.FINAL_CONFIG.style.th.selected.backgroundColor:t.FINAL_CONFIG.style.th.backgroundColor};color:${l===s.selectedColumn&&!s.hasNaN[l]?t.FINAL_CONFIG.style.th.selected.color:t.FINAL_CONFIG.style.th.color};outline:${t.FINAL_CONFIG.style.th.outline}`)},[s.hasNaN[l]?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:s.tableHead[l].type===s.constants.NUMERIC?t.icons.chevronDown:"",class:e.normalizeClass({"col-selector":s.tableHead[l].type===s.constants.NUMERIC}),tabindex:"0",onClick:e.withModifiers(c=>t.selectColumn(l),["stop"]),onKeyup:e.withKeys(c=>t.selectColumn(l),["enter"])},null,42,Se))],6))),128))])]),e.createElementVNode("tbody",{onClick:n[8]||(n[8]=(...a)=>t.closeAllDropdowns&&t.closeAllDropdowns(...a)),onKeydown:n[9]||(n[9]=a=>t.navigateCell(a))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.visibleRows,(a,l)=>(e.openBlock(),e.createElementBlock("tr",{key:`tbody_${l}`,"data-row":l%2===0?"odd":"even",class:e.normalizeClass(`tr_${s.uid}`),style:e.normalizeStyle(`${l%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":l%2===0?"odd":"even"},e.toDisplayString(a.absoluteIndex+1),9,_e),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.td,(c,d)=>(e.openBlock(),e.createElementBlock("td",{"data-row":l%2===0?"odd":"even",key:`td_${l}_${d}`,style:e.normalizeStyle(t.isNumeric(c)||o.dataset.header[d].type===s.constants.DATE?"text-align:right;font-variant-numeric: tabular-nums;":""),onClick:y=>t.selectTd({td:c,rowIndex:l,colIndex:d,headerType:o.dataset.header[d].type,event:y}),onKeyup:[e.withKeys(y=>t.selectTd({td:c,rowIndex:l,colIndex:d,headerType:o.dataset.header[d].type,event:y}),["enter"]),e.withKeys(y=>t.selectTd({td:c,rowIndex:l,colIndex:d,headerType:o.dataset.header[d].type,event:y}),["space"])],class:e.normalizeClass({"td-numeric":o.dataset.header[d].type===s.constants.NUMERIC,"td-focusable":!0,"td-has-nan":s.hasNaN[d]}),id:`cell_${l}_${d}_${s.uid}`,tabindex:"0"},[a.meta&&a.meta.markerIndices.includes(d)&&a.meta.unicodeIcon?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`color:${a.meta.color};margin-right:3px`),innerHTML:a.meta.unicodeIcon},null,12,Le)):e.createCommentVNode("",!0),o.dataset.header[d].type===s.constants.DATE?(e.openBlock(),e.createElementBlock("span",Ee,e.toDisplayString(o.dataset.header[d].prefix)+" "+e.toDisplayString(new Date(c).toLocaleString().slice(0,10))+" "+e.toDisplayString(o.dataset.header[d].suffix),1)):o.dataset.header[d].isPercentage?(e.openBlock(),e.createElementBlock("span",De,e.toDisplayString(t.dataLabel({v:Number(c*100),s:"%",r:o.dataset.header[d].decimals})),1)):s.percentages[d]&&o.dataset.header[d].percentageTo&&!o.dataset.header[d].isPercentage?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass({"td-nan":isNaN(Number(c))})},e.toDisplayString(isNaN(Number(c))?`${c} is not ${s.constants.NUMERIC}`:t.dataLabel({p:o.dataset.header[d].prefix,v:Number(c),s:o.dataset.header[d].suffix,r:o.dataset.header[d].decimals}))+" ("+e.toDisplayString(isNaN(Number(c))?"":t.dataLabel({v:Number(c/t.getSum(s.percentages[d].referenceIndex)*100),s:"%",r:o.dataset.header[d].decimals}))+") ",3)):o.dataset.header[d].type===s.constants.NUMERIC?(e.openBlock(),e.createElementBlock("span",{key:4,class:e.normalizeClass({"td-nan":isNaN(Number(c))})},e.toDisplayString(isNaN(Number(c))?`${c} is not ${s.constants.NUMERIC}`:t.dataLabel({p:o.dataset.header[d].prefix,v:Number(c.toFixed(o.dataset.header[d].decimals)),s:o.dataset.header[d].suffix,r:o.dataset.header[d].decimals})),3)):(e.openBlock(),e.createElementBlock("span",Be,e.toDisplayString(o.dataset.header[d].prefix)+" "+e.toDisplayString(c)+" "+e.toDisplayString(o.dataset.header[d].suffix),1))],46,Oe))),128))],14,we))),128))],32)])],4),e.createElementVNode("div",{class:e.normalizeClass({"td-selector-info":!0,"td-selector-info--active":s.currentSelectionSpan.col!==void 0&&s.currentSelectionSpan.rows.length}),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.infoBar.backgroundColor};color:${t.FINAL_CONFIG.style.infoBar.color}`)},[s.currentSelectionSpan.col!==void 0&&s.currentSelectionSpan.rows.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",{innerHTML:t.icons.table,class:"td-selector-icon"},null,8,Ae),e.createElementVNode("span",null,[e.createElementVNode("b",null,[e.createTextVNode(e.toDisplayString(o.dataset.header[s.currentSelectionSpan.col].name)+" ",1),o.dataset.header[s.currentSelectionSpan.col].isPercentage?(e.openBlock(),e.createElementBlock("span",Me," / "+e.toDisplayString(o.dataset.header[s.percentages[s.currentSelectionSpan.col].referenceIndex].name),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",Te,[e.createTextVNode(e.toDisplayString(t.FINAL_CONFIG.translations.nb)+" : ",1),e.createElementVNode("b",xe,e.toDisplayString(s.currentSelectionSpan.rows.length),1)]),e.createElementVNode("span",Ge,[e.createTextVNode(e.toDisplayString(t.FINAL_CONFIG.translations.sum)+" : ",1),o.dataset.header[s.currentSelectionSpan.col].isPercentage?(e.openBlock(),e.createElementBlock("b",Ve,e.toDisplayString(t.selectedCellsCalculations.sumPercentage),1)):(e.openBlock(),e.createElementBlock("b",ze,e.toDisplayString(o.dataset.header[s.currentSelectionSpan.col].prefix)+" "+e.toDisplayString(t.selectedCellsCalculations.sumRegular)+" "+e.toDisplayString(o.dataset.header[s.currentSelectionSpan.col].suffix),1)),o.dataset.header[s.currentSelectionSpan.col].isPercentage?(e.openBlock(),e.createElementBlock("b",He,"%")):e.createCommentVNode("",!0)]),e.createElementVNode("span",Pe,[e.createTextVNode(e.toDisplayString(t.FINAL_CONFIG.translations.average)+" : ",1),o.dataset.header[s.currentSelectionSpan.col].isPercentage?(e.openBlock(),e.createElementBlock("b",Re,e.toDisplayString(t.selectedCellsCalculations.averagePercentage),1)):(e.openBlock(),e.createElementBlock("b",Ue,e.toDisplayString(o.dataset.header[s.currentSelectionSpan.col].prefix)+" "+e.toDisplayString(t.selectedCellsCalculations.averageRegular)+" "+e.toDisplayString(o.dataset.header[s.currentSelectionSpan.col].suffix),1)),o.dataset.header[s.currentSelectionSpan.col].isPercentage?(e.openBlock(),e.createElementBlock("b",Xe,"%")):e.createCommentVNode("",!0)])]),e.createElementVNode("button",{onClick:n[10]||(n[10]=(...a)=>t.resetSelection&&t.resetSelection(...a)),class:"td-selector-info-reset",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)],64)):e.createCommentVNode("",!0)],6),s.bodyCopy.length>10?(e.openBlock(),e.createElementBlock("div",je,[e.createTextVNode(e.toDisplayString(t.FINAL_CONFIG.translations.totalRows)+" : "+e.toDisplayString(o.dataset.body.length)+" | "+e.toDisplayString(t.FINAL_CONFIG.translations.paginatorLabel)+" : ",1),s.bodyCopy.length>10?e.withDirectives((e.openBlock(),e.createElementBlock("select",{key:0,id:"paginatorSelector","onUpdate:modelValue":n[11]||(n[11]=a=>s.itemsPerPage=a),onChange:n[12]||(n[12]=(...a)=>t.resetSelection&&t.resetSelection(...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}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.paginatorOptions,(a,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[s.bodyCopy.length>a||o.dataset.body.length===a?(e.openBlock(),e.createElementBlock("option",{key:`paginator_option_${l}`},e.toDisplayString(a),1)):e.createCommentVNode("",!0)],64))),256))],36)),[[e.vModelSelect,s.itemsPerPage,void 0,{number:!0}]]):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.itemsPerPage>=250?(e.openBlock(),e.createElementBlock("div",Ye,[e.createElementVNode("span",{innerHTML:t.icons.warning},null,8,We),e.createTextVNode(e.toDisplayString(t.FINAL_CONFIG.translations.sizeWarning),1)])):e.createCommentVNode("",!0),t.pages.length>1&&t.pages.length<=10?(e.openBlock(),e.createElementBlock("div",{key:2,class:"vue-ui-table-navigation-indicator",style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.pagination.navigationIndicator.backgroundColor};width:calc(${s.currentPage/(t.pages.length-1)*100}%)`)},null,4)):e.createCommentVNode("",!0),t.pages.length>1?(e.openBlock(),e.createElementBlock("div",Je,[e.createElementVNode("button",{class:"vue-ui-table-navigation",onClick:n[13]||(n[13]=e.withModifiers(a=>t.navigate("previous"),["stop"])),innerHTML:t.icons.chevronLeft,disabled:s.currentPage===0,style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.pagination.buttons.backgroundColor};color:${t.FINAL_CONFIG.style.pagination.buttons.color};opacity:${s.currentPage===0?t.FINAL_CONFIG.style.pagination.buttons.opacityDisabled:1}`)},null,12,Ke),t.pages.length>3?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{class:"vue-ui-table-navigation",onClick:n[14]||(n[14]=e.withModifiers(a=>t.navigate(1),["stop"])),disabled:s.currentPage===0,style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.pagination.buttons.backgroundColor};color:${t.FINAL_CONFIG.style.pagination.buttons.color};opacity:${s.currentPage===0?t.FINAL_CONFIG.style.pagination.buttons.opacityDisabled:1}`)}," 1 ",12,qe),t.pages.length>10?(e.openBlock(),e.createElementBlock("div",Ze,[e.createElementVNode("label",Qe,e.toDisplayString(t.FINAL_CONFIG.translations.page)+" "+e.toDisplayString(s.currentPage+1)+" / "+e.toDisplayString(t.pages.length),1),e.createElementVNode("input",{class:"vue-ui-table-page-scroller",id:"pageScroller",type:"range",step:"1",min:0,max:t.pages.length-1,onInput:n[15]||(n[15]=a=>t.updateCurrentPage(a)),value:s.currentPage,style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.inputs.backgroundColor};color:${t.FINAL_CONFIG.style.inputs.color};border:${t.FINAL_CONFIG.style.inputs.border};accent-color:${t.FINAL_CONFIG.style.inputs.accentColor}`)},null,44,$e)])):(e.openBlock(),e.createElementBlock("span",et,e.toDisplayString(t.FINAL_CONFIG.translations.page)+" "+e.toDisplayString(s.currentPage+1)+" / "+e.toDisplayString(t.pages.length),1)),e.createElementVNode("button",{class:"vue-ui-table-navigation",onClick:n[16]||(n[16]=e.withModifiers(a=>t.navigate(t.pages.length),["stop"])),disabled:s.currentPage===t.pages.length-1,style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.pagination.buttons.backgroundColor};color:${t.FINAL_CONFIG.style.pagination.buttons.color};opacity:${s.currentPage===t.pages.length-1?t.FINAL_CONFIG.style.pagination.buttons.opacityDisabled:1}`)},e.toDisplayString(t.pages.length),13,tt)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.FINAL_CONFIG.translations.page)+" "+e.toDisplayString(s.currentPage+1)+" / "+e.toDisplayString(t.pages.length),1)],64)),e.createElementVNode("button",{class:"vue-ui-table-navigation",onClick:n[17]||(n[17]=e.withModifiers(a=>t.navigate("next"),["stop"])),innerHTML:t.icons.chevronRight,disabled:s.currentPage===t.pages.length-1,style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.pagination.buttons.backgroundColor};color:${t.FINAL_CONFIG.style.pagination.buttons.color};opacity:${s.currentPage===t.pages.length-1?t.FINAL_CONFIG.style.pagination.buttons.opacityDisabled:1}`)},null,12,st)])):e.createCommentVNode("",!0),s.showChart&&t.canChart?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-table-chart-modal",style:e.normalizeStyle(`width: ${s.modalWidth}px;top:${s.clientY}px; left:${s.clientX}px;background:${t.FINAL_CONFIG.style.chart.modal.backgroundColor};color:${t.FINAL_CONFIG.style.chart.modal.color}`)},[e.createElementVNode("div",{class:"modal-drag-handle",onMousedown:n[19]||(n[19]=(...a)=>t.dragMouseDown&&t.dragMouseDown(...a))},[e.createElementVNode("span",{innerHTML:t.icons.grip},null,8,nt),e.createElementVNode("button",{class:"close-chart-modal",onClick:n[18]||(n[18]=a=>s.showChart=!1)},"✖")],32),e.createElementVNode("button",{style:e.normalizeStyle([{"z-index":"1"},`background:${t.FINAL_CONFIG.style.closeButtons.backgroundColor};color:${t.FINAL_CONFIG.style.closeButtons.color};border-radius:${t.FINAL_CONFIG.style.closeButtons.borderRadius}`]),class:"close-chart-modal",onClick:n[20]||(n[20]=a=>s.showChart=!1)}," ✖ ",4),e.createElementVNode("div",rt,[t.availableDonutCategories.length?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:n[21]||(n[21]=a=>s.showDonutOptions=!0),innerHTML:t.icons.donut,class:e.normalizeClass({"is-active-chart":s.chart.type===s.constants.DONUT||s.showDonutOptions}),style:e.normalizeStyle(`background:${s.chart.type===s.constants.DONUT||s.showDonutOptions?t.FINAL_CONFIG.style.chart.modal.buttons.selected.backgroundColor:t.FINAL_CONFIG.style.chart.modal.buttons.unselected.backgroundColor};color:${s.chart.type===s.constants.DONUT||s.showDonutOptions?t.FINAL_CONFIG.style.chart.modal.buttons.selected.color:t.FINAL_CONFIG.style.chart.modal.buttons.unselected.color}`)},null,14,ot)):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:n[22]||(n[22]=a=>{s.chart.type=s.constants.LINE,s.showDonutOptions=!1}),innerHTML:t.icons.chart,class:e.normalizeClass({"is-active-chart":s.chart.type===s.constants.LINE&&!s.showDonutOptions}),style:e.normalizeStyle(`background:${s.chart.type===s.constants.LINE&&!s.showDonutOptions?t.FINAL_CONFIG.style.chart.modal.buttons.selected.backgroundColor:t.FINAL_CONFIG.style.chart.modal.buttons.unselected.backgroundColor};color:${s.chart.type===s.constants.LINE&&!s.showDonutOptions?t.FINAL_CONFIG.style.chart.modal.buttons.selected.color:t.FINAL_CONFIG.style.chart.modal.buttons.unselected.color}`)},null,14,lt),e.createElementVNode("button",{onClick:n[23]||(n[23]=a=>{s.chart.type=s.constants.BAR,s.showDonutOptions=!1}),innerHTML:t.icons.bar,class:e.normalizeClass({"is-active-chart":s.chart.type===s.constants.BAR&&!s.showDonutOptions}),style:e.normalizeStyle(`background:${s.chart.type===s.constants.BAR&&!s.showDonutOptions?t.FINAL_CONFIG.style.chart.modal.buttons.selected.backgroundColor:t.FINAL_CONFIG.style.chart.modal.buttons.unselected.backgroundColor};color:${s.chart.type===s.constants.BAR&&!s.showDonutOptions?t.FINAL_CONFIG.style.chart.modal.buttons.selected.color:t.FINAL_CONFIG.style.chart.modal.buttons.unselected.color}`)},null,14,at)]),e.createElementVNode("div",it,[s.showDonutOptions&&t.availableDonutCategories.length?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.chart.modal.backgroundColor};color:${t.FINAL_CONFIG.style.chart.modal.color}`)},[e.createElementVNode("fieldset",ct,[e.createElementVNode("legend",null,e.toDisplayString(t.FINAL_CONFIG.translations.chooseCategoryColumn),1),e.createElementVNode("div",ut,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.availableDonutCategories,(a,l)=>(e.openBlock(),e.createElementBlock("div",{key:`donut_radio_${l}`,class:"vue-ui-table-fieldset-option"},[e.createElementVNode("input",{type:"radio",name:a.name,id:a.name,checked:s.selectedDonutCategory&&a.name===s.selectedDonutCategory.name,onInput:c=>s.selectedDonutCategory=t.availableDonutCategories[l],style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.inputs.backgroundColor};color:${t.FINAL_CONFIG.style.inputs.color};border:${t.FINAL_CONFIG.style.inputs.border};accent-color:${t.FINAL_CONFIG.style.inputs.accentColor}`)},null,44,dt),e.createElementVNode("label",{for:a.name},e.toDisplayString(a.name),9,ht)]))),128))]),e.createElementVNode("button",{class:"vue-ui-table-generate-donut",disabled:!s.selectedDonutCategory,onClick:n[24]||(n[24]=(...a)=>t.applyDonutOption&&t.applyDonutOption(...a)),style:e.normalizeStyle(`background:${t.FINAL_CONFIG.style.chart.modal.buttons.selected.backgroundColor};color:${t.FINAL_CONFIG.style.chart.modal.buttons.selected.color}`)},[e.createElementVNode("div",{style:{"margin-bottom":"-3px"},innerHTML:t.icons.donut},null,8,mt),e.createTextVNode(" "+e.toDisplayString(t.FINAL_CONFIG.translations.makeDonut),1)],12,gt)])],4)):e.createCommentVNode("",!0),[s.constants.BAR,s.constants.LINE].includes(s.chart.type)&&!s.showDonutOptions?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",yt,[s.chart.type===s.constants.LINE?(e.openBlock(),e.createBlock(u,{key:0,dataset:t.chartData.xyDatasetLine,config:t.chartData.xyConfig},null,8,["dataset","config"])):e.createCommentVNode("",!0),s.chart.type===s.constants.BAR?(e.openBlock(),e.createBlock(u,{key:1,dataset:t.chartData.xyDatasetBar,config:t.chartData.xyConfig},null,8,["dataset","config"])):e.createCommentVNode("",!0)]),s.currentSelectionSpan.rows.length>=2?(e.openBlock(),e.createElementBlock("div",{key:0,class:"chart-trend",style:e.normalizeStyle(`color:${t.FINAL_CONFIG.style.chart.modal.color}`)},[n[33]||(n[33]=e.createElementVNode("span",null,"---",-1)),e.createTextVNode(" Trend: "+e.toDisplayString(t.dataLabel({v:t.chartData.progression.trend,s:"%",r:1})),1)],4)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),[s.constants.DONUT].includes(s.chart.type)&&!s.showDonutOptions?(e.openBlock(),e.createElementBlock("div",pt,[e.createVNode(h,{dataset:s.currentDonut,config:t.chartData.donutConfig},null,8,["dataset","config"])])):e.createCommentVNode("",!0)],512)],4)):e.createCommentVNode("",!0)],4)}const bt=_._export_sfc(O,[["render",Nt],["__scopeId","data-v-1713331c"]]);exports.default=bt;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-Cn2tUOoX.cjs"),$=require("./useNestedProp-C8955nsn.cjs"),w=require("./usePrinter-BrH80VBz.cjs"),q=require("./Shape-BQIcurpe.cjs"),G=require("./useUserOptionState-BgepsfED.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),L=["id"],A={role:"cell"},D={role:"row"},X=["data-cell"],W={key:0,style:{display:"flex","flex-direction":"row",gap:"2px","align-items":"center"}},J=["height","width"],K={key:0,role:"cell","data-cell":"sum"},Q={key:1,role:"cell","data-cell":"average"},Y={key:2,role:"cell","data-cell":"median"},Z={key:1,ref:"source",dir:"auto"},j={__name:"vue-ui-table-heatmap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(P,{expose:N}){e.useCssVars(t=>({"1e8210e3":T.value,"7fb93384":R.value}));const{vue_ui_table_heatmap:E}=a.useConfig(),d=P,p=e.ref(a.createUid()),s=e.ref(!1),c=e.ref(null),m=e.ref(!1),f=e.ref(0),V=e.useSlots();e.onMounted(()=>{V["chart-background"]&&console.warn("VueUiTableHeatmap does not support the #chart-background slot.")});const o=e.computed({get:()=>y(),set:t=>t}),{userOptionsVisible:v,setUserOptionsVisibility:g,keepUserOptionState:h}=G.useUserOptionState({config:o.value});function y(){const t=$.useNestedProp({userConfig:d.config,defaultConfig:E});return t.theme?{...$.useNestedProp({userConfig:a.themes.vue_ui_table_heatmap[t.theme]||d.config,defaultConfig:t})}:t}e.watch(()=>d.config,t=>{o.value=y(),v.value=!o.value.userOptions.showOnChartHover,C()},{deep:!0});const{isPrinting:O,isImaging:x,generatePdf:k,generateImage:b}=w.usePrinter({elementId:`table_heatmap_${p.value}`,fileName:"vue-ui-table-heatmap",options:o.value.userOptions.print}),F=e.computed(()=>o.value.table.responsiveBreakpoint),z=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(()=>{C()});function C(){a.objectIsEmpty(d.dataset)&&a.error({componentName:"VueUiTableHeatmap",type:"dataset"});const t=new ResizeObserver(r=>{r.forEach(n=>{s.value=n.contentRect.width<F.value})});c.value&&t.observe(c.value)}const _=e.computed(()=>d.dataset.map(t=>{const r=t.values.map(l=>isNaN(l)?0:l),n=r.reduce((l,i)=>l+i,0);return{...t,values:r,serieExtremes:{max:Math.max(...r),min:Math.min(...r)},sum:n,average:n/r.length,median:a.calcMedian(r),displayValues:[t.name,...t.values],id:a.createUid()}})),B=e.computed(()=>{const t=_.value.flatMap(r=>r.values);return{min:Math.min(...t),max:Math.max(...t)}});function M(t,r){const n=o.value.style.heatmapColors.useIndividualScale;return a.interpolateColorHex(o.value.style.heatmapColors.min,o.value.style.heatmapColors.max,n?r.min:B.value.min,n?r.max:B.value.max,t)}const I=e.computed(()=>_.value.map(t=>({...t,colors:t.displayValues.map(r=>isNaN(r)?o.value.style.backgroundColor:M(r,t.serieExtremes))}))),R=e.computed(()=>o.value.style.backgroundColor),T=e.computed(()=>`${o.value.table.borderWidth}px`);function S(){e.nextTick(()=>{const t=I.value.map(l=>[[l.name],l.displayValues,[l.sum],[l.average],[l.median]]),r=[[[""],o.value.table.head.values,["sum"],["average"],["median"]]].concat(t),n=a.createCsvContent(r);a.downloadCsv({csvContent:n,title:"vue-ui-table-heatmap"})})}function U(t){m.value=t,f.value+=1}return N({generatePdf:k,generateCsv:S,generateImage:b}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:c,style:e.normalizeStyle(`width:100%; overflow-x:auto; container-type: inline-size;padding-top:${o.value.userOptions.show?"36px":""}; ${m.value?"vue-data-ui-wrapper-fullscreen":""}; position:relative;`),class:e.normalizeClass({"vue-ui-responsive":s.value}),id:`table_heatmap_${p.value}`,onMouseenter:r[0]||(r[0]=()=>e.unref(g)(!0)),onMouseleave:r[1]||(r[1]=()=>e.unref(g)(!1))},[o.value.userOptions.show&&z.value&&(e.unref(h)||e.unref(v))?(e.openBlock(),e.createBlock(w.UserOptions,{ref:"details",key:`user_option_${f.value}`,backgroundColor:o.value.style.backgroundColor,color:o.value.style.color,isPrinting:e.unref(O),isImaging:e.unref(x),uid:p.value,hasPdf:o.value.userOptions.buttons.pdf,hasXls:o.value.userOptions.buttons.csv,hasImg:o.value.userOptions.buttons.img,hasFullscreen:o.value.userOptions.buttons.fullscreen,isFullscreen:m.value,titles:{...o.value.userOptions.buttonTitles},chartElement:c.value,position:o.value.userOptions.position,onToggleFullscreen:U,onGeneratePdf:e.unref(k),onGenerateCsv:S,onGenerateImage:e.unref(b),style:e.normalizeStyle({visibility:e.unref(h)?e.unref(v)?"visible":"hidden":"visible"})},e.createSlots({_:2},[t.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:n,color:l})=>[e.renderSlot(t.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:n,color:l})),void 0,!0)]),key:"0"}:void 0,t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:l})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:l})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass({"vue-ui-table-heatmap":!0}),style:e.normalizeStyle(`width:100%;font-family:${o.value.style.fontFamily};background:${o.value.style.backgroundColor};`)},[e.createElementVNode("caption",null,[e.renderSlot(t.$slots,"caption",{},void 0,!0)]),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${o.value.table.head.backgroundColor};color:${o.value.table.head.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value.table.head.values,(n,l)=>(e.openBlock(),e.createElementBlock("th",A,[e.renderSlot(t.$slots,"head",e.mergeProps({ref_for:!0},{value:n,rowIndex:l,type:typeof n,isResponsive:s.value}),void 0,!0)]))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(n,l)=>(e.openBlock(),e.createElementBlock("tr",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.displayValues,(i,u)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":o.value.table.head.values[u]},[n.color&&u===0?(e.openBlock(),e.createElementBlock("div",W,[n.color?(e.openBlock(),e.createElementBlock("svg",{key:0,height:o.value.style.shapeSize,width:o.value.style.shapeSize,viewBox:"0 0 20 20",style:{background:"none",overflow:"visible"}},[e.createVNode(q._sfc_main,{plot:{x:10,y:10},color:n.color,radius:9,shape:n.shape||"circle"},null,8,["color","shape"])],8,J)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"rowTitle",e.mergeProps({ref_for:!0},{value:i,rowIndex:l,colIndex:u,type:typeof i,isResponsive:s.value}),void 0,!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[u===0?e.renderSlot(t.$slots,"rowTitle",e.mergeProps({key:0,ref_for:!0},{value:i,rowIndex:l,colIndex:u,type:typeof i,isResponsive:s.value}),void 0,!0):e.createCommentVNode("",!0),u>0?e.renderSlot(t.$slots,"cell",e.mergeProps({key:1,ref_for:!0},{value:i,rowIndex:l,colIndex:u,type:typeof i,isResponsive:s.value,color:n.colors[u],textColor:e.unref(a.adaptColorToBackground)(n.colors[u])}),void 0,!0):e.createCommentVNode("",!0)],64))],8,X))),256)),o.value.table.showSum?(e.openBlock(),e.createElementBlock("td",K,[e.renderSlot(t.$slots,"sum",e.mergeProps({ref_for:!0},{value:n.sum,rowIndex:l,isResponsive:s.value}),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showAverage?(e.openBlock(),e.createElementBlock("td",Q,[e.renderSlot(t.$slots,"average",e.mergeProps({ref_for:!0},{value:n.average,rowIndex:l,isResponsive:s.value}),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showMedian?(e.openBlock(),e.createElementBlock("td",Y,[e.renderSlot(t.$slots,"median",e.mergeProps({ref_for:!0},{value:n.median,rowIndex:l,isResponsive:s.value}),void 0,!0)])):e.createCommentVNode("",!0)]))),256))])],4),t.$slots.source?(e.openBlock(),e.createElementBlock("div",Z,[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],46,L))}},ee=H._export_sfc(j,[["__scopeId","data-v-dd493d6a"]]);exports.default=ee;
|