vue-data-ui 2.3.78 → 2.3.79

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.
Files changed (141) hide show
  1. package/dist/{Arrow-DWkvIpW8.cjs → Arrow-7KSHNtE9.cjs} +1 -1
  2. package/dist/{Arrow-BCYtOwX7.js → Arrow-CMz9sUNE.js} +1 -1
  3. package/dist/{BaseIcon-BIQXWVMS.js → BaseIcon--epRsx3h.js} +1 -1
  4. package/dist/{BaseIcon-Bcpzfk34.cjs → BaseIcon-Dk7dYD2V.cjs} +1 -1
  5. package/dist/{DataTable-C5TOiC61.cjs → DataTable-BtdSUfo8.cjs} +1 -1
  6. package/dist/{DataTable-y1lX5jVj.js → DataTable-CegPJkZh.js} +2 -2
  7. package/dist/{Legend-BLXcdrri.js → Legend-DHn7PpRX.js} +1 -1
  8. package/dist/{Legend-CGGD8NhP.cjs → Legend-kh9PzvjQ.cjs} +1 -1
  9. package/dist/{Shape-CsoTtJx6.js → Shape-BYzJgXyX.js} +1 -1
  10. package/dist/{Shape-qJYTY2BC.cjs → Shape-C_bea-fx.cjs} +1 -1
  11. package/dist/{Slicer-DzJZ4axa.js → Slicer-BCPRbaD9.js} +2 -2
  12. package/dist/{Slicer-CZJXKSeE.cjs → Slicer-BY2HfvXm.cjs} +1 -1
  13. package/dist/{Title-BSpa3uge.cjs → Title-CWjHjkKS.cjs} +1 -1
  14. package/dist/{Title-Bx-VO3md.js → Title-CZGFVTAL.js} +1 -1
  15. package/dist/{Tooltip-Dk-cimhQ.js → Tooltip-BHnf4YJR.js} +1 -1
  16. package/dist/{Tooltip-rmhZhv96.cjs → Tooltip-C1sNTQ1g.cjs} +1 -1
  17. package/dist/{index-CzjC8LfY.cjs → index-CPFtA_2a.cjs} +1 -1
  18. package/dist/{index-DP8dqFNd.js → index-Dzi9DWc6.js} +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/{useNestedProp-B-oZxD4x.js → useNestedProp-BSY0Tspx.js} +1 -1
  21. package/dist/{useNestedProp-CY7DebVH.cjs → useNestedProp-BUMZMzjx.cjs} +1 -1
  22. package/dist/{usePrinter-DiLM6jav.cjs → usePrinter-Ctl6AURH.cjs} +1 -1
  23. package/dist/{usePrinter-DiuHo4LO.js → usePrinter-DGeHPbZW.js} +1 -1
  24. package/dist/{vue-data-ui-Ce5IFSYA.cjs → vue-data-ui-BrskASaU.cjs} +1 -1
  25. package/dist/{vue-data-ui-Ct7n5wkM.js → vue-data-ui-CBAHwmL6.js} +57 -57
  26. package/dist/vue-data-ui.cjs +1 -1
  27. package/dist/vue-data-ui.js +1 -1
  28. package/dist/{vue-ui-3d-bar-B_i2EoFu.cjs → vue-ui-3d-bar-G_O_Ncrd.cjs} +1 -1
  29. package/dist/{vue-ui-3d-bar-O3fB5J7V.js → vue-ui-3d-bar-aPQlBNHD.js} +7 -7
  30. package/dist/{vue-ui-accordion-Dl8zkZPk.js → vue-ui-accordion-C4FB0Uy9.js} +3 -3
  31. package/dist/{vue-ui-accordion-DpI7fTKZ.cjs → vue-ui-accordion-DfUmD2e0.cjs} +1 -1
  32. package/dist/{vue-ui-age-pyramid-BsAfxkN4.cjs → vue-ui-age-pyramid-0bU5epKz.cjs} +1 -1
  33. package/dist/{vue-ui-age-pyramid-BeiREI6d.js → vue-ui-age-pyramid-tXH9_6Cl.js} +8 -8
  34. package/dist/{vue-ui-annotator-DpN-6IwB.cjs → vue-ui-annotator-CHv_oFC5.cjs} +1 -1
  35. package/dist/{vue-ui-annotator-0yje27Qq.js → vue-ui-annotator-DoqAR1AJ.js} +1 -1
  36. package/dist/{vue-ui-candlestick-D9UteVvx.js → vue-ui-candlestick-Bow8ysHR.js} +9 -9
  37. package/dist/{vue-ui-candlestick-lv78wnpS.cjs → vue-ui-candlestick-C9hmAjO4.cjs} +1 -1
  38. package/dist/{vue-ui-carousel-table-jxZ3h5pq.js → vue-ui-carousel-table-CFyHgs2G.js} +4 -4
  39. package/dist/{vue-ui-carousel-table-Br6FwMKM.cjs → vue-ui-carousel-table-DIpy9OcA.cjs} +1 -1
  40. package/dist/{vue-ui-chestnut-DbYHeNaL.cjs → vue-ui-chestnut-Bhorci6g.cjs} +1 -1
  41. package/dist/{vue-ui-chestnut-DXuHRJy4.js → vue-ui-chestnut-yUQIrA49.js} +6 -6
  42. package/dist/{vue-ui-cursor-iss6SJ1Y.cjs → vue-ui-cursor-C_XibJ7N.cjs} +1 -1
  43. package/dist/{vue-ui-cursor-BzPbdVRJ.js → vue-ui-cursor-lOvrBueD.js} +2 -2
  44. package/dist/{vue-ui-dashboard-CGjWuFrI.js → vue-ui-dashboard-C83saYpB.js} +2 -2
  45. package/dist/{vue-ui-dashboard-DKT82yQ4.cjs → vue-ui-dashboard-sd5Y5-e-.cjs} +1 -1
  46. package/dist/{vue-ui-digits-BfwDCfYp.cjs → vue-ui-digits-BebeS9K1.cjs} +1 -1
  47. package/dist/{vue-ui-digits-BCguvLxB.js → vue-ui-digits-BlYPdDPr.js} +2 -2
  48. package/dist/vue-ui-donut-b6ltmnHo.cjs +1 -0
  49. package/dist/{vue-ui-donut-DJTeGLVG.js → vue-ui-donut-cu0lTO-k.js} +144 -144
  50. package/dist/{vue-ui-donut-evolution-BaLDZNDG.js → vue-ui-donut-evolution-BtLFqMTk.js} +9 -9
  51. package/dist/{vue-ui-donut-evolution-Bil1AIhX.cjs → vue-ui-donut-evolution-DBtR0KB1.cjs} +1 -1
  52. package/dist/{vue-ui-dumbbell-DiL3xhKY.cjs → vue-ui-dumbbell-CD7Q04B4.cjs} +1 -1
  53. package/dist/{vue-ui-dumbbell-BqtDdV5w.js → vue-ui-dumbbell-C_tCEHzH.js} +8 -8
  54. package/dist/{vue-ui-flow-BVTbbsCK.cjs → vue-ui-flow-CFAqxg-s.cjs} +1 -1
  55. package/dist/{vue-ui-flow-zfTGon4s.js → vue-ui-flow-Cv8PLTaj.js} +7 -7
  56. package/dist/{vue-ui-galaxy-5iRb5sQ-.js → vue-ui-galaxy-BZYKkgAb.js} +9 -9
  57. package/dist/{vue-ui-galaxy-GSO_6KIe.cjs → vue-ui-galaxy-DWX8Ncj4.cjs} +1 -1
  58. package/dist/{vue-ui-gauge-DljHYdCS.js → vue-ui-gauge-BhOvSbGz.js} +5 -5
  59. package/dist/{vue-ui-gauge-Bz7oLa51.cjs → vue-ui-gauge-CKGYpTFB.cjs} +1 -1
  60. package/dist/{vue-ui-gizmo-KL0OJY2K.cjs → vue-ui-gizmo-07TDXIaB.cjs} +1 -1
  61. package/dist/{vue-ui-gizmo-B-fxFOZy.js → vue-ui-gizmo-37rGvXCR.js} +2 -2
  62. package/dist/{vue-ui-heatmap-thMJPCfo.cjs → vue-ui-heatmap-CTob1F6o.cjs} +1 -1
  63. package/dist/{vue-ui-heatmap-ketn_NV3.js → vue-ui-heatmap-Dm-MMJ4o.js} +8 -8
  64. package/dist/{vue-ui-kpi-e1QWa8D4.cjs → vue-ui-kpi-CHkOikkJ.cjs} +1 -1
  65. package/dist/{vue-ui-kpi-Bxu8uZ21.js → vue-ui-kpi-oh0aHGO-.js} +3 -3
  66. package/dist/{vue-ui-mini-loader-BZ_2aV8O.js → vue-ui-mini-loader-BxtLbcPD.js} +2 -2
  67. package/dist/{vue-ui-mini-loader-paRZQU8H.cjs → vue-ui-mini-loader-CnXWvlLw.cjs} +1 -1
  68. package/dist/{vue-ui-molecule-Bpp5unvI.js → vue-ui-molecule-fywn7YiK.js} +9 -9
  69. package/dist/{vue-ui-molecule-VOBL4Osc.cjs → vue-ui-molecule-xiiQZhzI.cjs} +1 -1
  70. package/dist/{vue-ui-mood-radar-BY8XP_Q5.js → vue-ui-mood-radar-D2ZSuRkr.js} +9 -9
  71. package/dist/{vue-ui-mood-radar-CwtMLwP8.cjs → vue-ui-mood-radar-_H-MKxxl.cjs} +1 -1
  72. package/dist/{vue-ui-nested-donuts-5uuLi3If.js → vue-ui-nested-donuts-BH3Acqfp.js} +9 -9
  73. package/dist/{vue-ui-nested-donuts-CLnVnAiD.cjs → vue-ui-nested-donuts-C4-O_KFr.cjs} +1 -1
  74. package/dist/{vue-ui-onion-CMSPSSSG.cjs → vue-ui-onion-CLZRFpAv.cjs} +1 -1
  75. package/dist/{vue-ui-onion-zDy4ecPl.js → vue-ui-onion-DTsCMyrd.js} +9 -9
  76. package/dist/{vue-ui-parallel-coordinate-plot-1PFxiI__.cjs → vue-ui-parallel-coordinate-plot-DQ8C3HyY.cjs} +1 -1
  77. package/dist/{vue-ui-parallel-coordinate-plot-BeEkL7Dq.js → vue-ui-parallel-coordinate-plot-Pg0ZZqcp.js} +10 -10
  78. package/dist/{vue-ui-quadrant-Cx5z_c90.cjs → vue-ui-quadrant-BElvdrp_.cjs} +1 -1
  79. package/dist/{vue-ui-quadrant-MCIlbbsW.js → vue-ui-quadrant-BPC_3kPL.js} +10 -10
  80. package/dist/{vue-ui-quick-chart-r6Qa7qg_.js → vue-ui-quick-chart-BAkaZJ4p.js} +7 -7
  81. package/dist/{vue-ui-quick-chart-Xn-47NQG.cjs → vue-ui-quick-chart-bIEVTS1U.cjs} +1 -1
  82. package/dist/{vue-ui-radar-DFV5cFkl.js → vue-ui-radar-CgqDVKuK.js} +10 -10
  83. package/dist/{vue-ui-radar-ANQ1wXFc.cjs → vue-ui-radar-CvTIj-lO.cjs} +1 -1
  84. package/dist/{vue-ui-rating-DYu1EuJF.js → vue-ui-rating-BZLIXnyB.js} +2 -2
  85. package/dist/{vue-ui-rating-BVzCbQbv.cjs → vue-ui-rating-DpCRpJ4m.cjs} +1 -1
  86. package/dist/{vue-ui-relation-circle-BAcmDQB_.js → vue-ui-relation-circle-CSAABiZY.js} +5 -5
  87. package/dist/{vue-ui-relation-circle-DEM6C6Or.cjs → vue-ui-relation-circle-DkXrdiiR.cjs} +1 -1
  88. package/dist/{vue-ui-rings-Ce4G4hat.cjs → vue-ui-rings-CJtNdYeX.cjs} +1 -1
  89. package/dist/{vue-ui-rings-BiLlYpgu.js → vue-ui-rings-Dw1BJGXu.js} +9 -9
  90. package/dist/{vue-ui-scatter-OtlcTCUF.cjs → vue-ui-scatter-Cn4qQBmG.cjs} +1 -1
  91. package/dist/{vue-ui-scatter-D2ndYfkQ.js → vue-ui-scatter-kefea2pe.js} +10 -10
  92. package/dist/{vue-ui-screenshot-CKCNPn-e.js → vue-ui-screenshot-5LvueVyD.js} +1 -1
  93. package/dist/{vue-ui-screenshot-DTQx4VsM.cjs → vue-ui-screenshot-DzrSUfRb.cjs} +1 -1
  94. package/dist/{vue-ui-skeleton-B30ZhUV7.js → vue-ui-skeleton-BRcmM6et.js} +2 -2
  95. package/dist/{vue-ui-skeleton-CwqzJlQf.cjs → vue-ui-skeleton-C9gsw9XJ.cjs} +1 -1
  96. package/dist/{vue-ui-smiley-DzLvZR1k.js → vue-ui-smiley-BEaQ1ebG.js} +2 -2
  97. package/dist/{vue-ui-smiley-L6o24M6h.cjs → vue-ui-smiley-BZ9sEYKl.cjs} +1 -1
  98. package/dist/{vue-ui-spark-trend-BKsmENbH.js → vue-ui-spark-trend-DWbduAlI.js} +4 -4
  99. package/dist/{vue-ui-spark-trend-BoWeviHk.cjs → vue-ui-spark-trend-WGCL6qRe.cjs} +1 -1
  100. package/dist/{vue-ui-sparkbar-DNzZkp8z.js → vue-ui-sparkbar-BwXBIgap.js} +3 -3
  101. package/dist/{vue-ui-sparkbar-DY3iOLo4.cjs → vue-ui-sparkbar-C19NQbzy.cjs} +1 -1
  102. package/dist/{vue-ui-sparkgauge-B2DngjVP.js → vue-ui-sparkgauge-CJzICBM7.js} +3 -3
  103. package/dist/{vue-ui-sparkgauge-BlZ-lJm4.cjs → vue-ui-sparkgauge-F5uNohHA.cjs} +1 -1
  104. package/dist/{vue-ui-sparkhistogram-Co9N3BeQ.js → vue-ui-sparkhistogram-Brxx3lPt.js} +4 -4
  105. package/dist/{vue-ui-sparkhistogram-BUBewgdH.cjs → vue-ui-sparkhistogram-CEhbAYJu.cjs} +1 -1
  106. package/dist/{vue-ui-sparkline-Dpqo4aRJ.js → vue-ui-sparkline-BWpO00g3.js} +3 -3
  107. package/dist/{vue-ui-sparkline-BhL0mxXD.cjs → vue-ui-sparkline-BnMFB2Ei.cjs} +1 -1
  108. package/dist/{vue-ui-sparkstackbar-DtNbx3EV.cjs → vue-ui-sparkstackbar-BO9q_oMm.cjs} +1 -1
  109. package/dist/{vue-ui-sparkstackbar-_JwfRxF8.js → vue-ui-sparkstackbar-CDDrOr-n.js} +3 -3
  110. package/dist/{vue-ui-stackbar-BtN7ZM7-.js → vue-ui-stackbar-Bwrbh9it.js} +10 -10
  111. package/dist/{vue-ui-stackbar-C7AWHP6m.cjs → vue-ui-stackbar-DfZJRngt.cjs} +1 -1
  112. package/dist/{vue-ui-strip-plot-6L9a7BSw.js → vue-ui-strip-plot-Bp-S1Wf9.js} +9 -9
  113. package/dist/{vue-ui-strip-plot-cgOFTunJ.cjs → vue-ui-strip-plot-BpDR-dkQ.cjs} +1 -1
  114. package/dist/{vue-ui-table-BFYHRMCS.js → vue-ui-table-CJDKUKOS.js} +1 -1
  115. package/dist/{vue-ui-table-4Pf9tmFg.cjs → vue-ui-table-Cw6e5yDj.cjs} +1 -1
  116. package/dist/{vue-ui-table-heatmap--kPCu8mA.js → vue-ui-table-heatmap-C0xoBGEZ.js} +4 -4
  117. package/dist/{vue-ui-table-heatmap-CltKb2V9.cjs → vue-ui-table-heatmap-_tuoaziA.cjs} +1 -1
  118. package/dist/{vue-ui-table-sparkline-B5OjJud8.cjs → vue-ui-table-sparkline-BMVMoE-m.cjs} +1 -1
  119. package/dist/{vue-ui-table-sparkline-CsWx1Ksy.js → vue-ui-table-sparkline-CKfBnRuq.js} +5 -5
  120. package/dist/{vue-ui-thermometer-nTD7sp8r.js → vue-ui-thermometer-DJnGfyb3.js} +5 -5
  121. package/dist/{vue-ui-thermometer-62_4QovL.cjs → vue-ui-thermometer-mIYyVxtH.cjs} +1 -1
  122. package/dist/{vue-ui-timer-BU0s7Vt9.cjs → vue-ui-timer-CPImsfNt.cjs} +1 -1
  123. package/dist/{vue-ui-timer-DMFHjnzA.js → vue-ui-timer-D3-ehmrd.js} +4 -4
  124. package/dist/{vue-ui-tiremarks-mwBeBMJY.cjs → vue-ui-tiremarks-CCw-ctjv.cjs} +1 -1
  125. package/dist/{vue-ui-tiremarks-1X9B1VKM.js → vue-ui-tiremarks-Dyt3JsZe.js} +5 -5
  126. package/dist/{vue-ui-treemap-DQmBbm7e.cjs → vue-ui-treemap-DbyZr-O6.cjs} +1 -1
  127. package/dist/{vue-ui-treemap-CVTwqPFA.js → vue-ui-treemap-Q4DN6aY7.js} +9 -9
  128. package/dist/{vue-ui-vertical-bar-Br6Z0A3F.js → vue-ui-vertical-bar-BPkh53kA.js} +9 -9
  129. package/dist/{vue-ui-vertical-bar-BXiy8KRC.cjs → vue-ui-vertical-bar-CZoUU9_l.cjs} +1 -1
  130. package/dist/{vue-ui-waffle-CLCsHw9j.cjs → vue-ui-waffle-BmQnqY4H.cjs} +1 -1
  131. package/dist/{vue-ui-waffle-DEXMh07q.js → vue-ui-waffle-BwmVk6Po.js} +9 -9
  132. package/dist/{vue-ui-wheel-CwjuVi6U.js → vue-ui-wheel-BKXwCIGg.js} +5 -5
  133. package/dist/{vue-ui-wheel-DSFKKX65.cjs → vue-ui-wheel-IXkBhBLM.cjs} +1 -1
  134. package/dist/{vue-ui-word-cloud-BKeD3fHb.js → vue-ui-word-cloud-CqOVJLJt.js} +7 -7
  135. package/dist/{vue-ui-word-cloud-DZS4hCeR.cjs → vue-ui-word-cloud-Y2uokguh.cjs} +1 -1
  136. package/dist/{vue-ui-xy-B5aCogSL.cjs → vue-ui-xy-DaQ4muCU.cjs} +1 -1
  137. package/dist/{vue-ui-xy-DA3qqL8u.js → vue-ui-xy-DcjUmm61.js} +12 -12
  138. package/dist/{vue-ui-xy-canvas-B7DH4RK5.js → vue-ui-xy-canvas-CCDRUUy-.js} +10 -10
  139. package/dist/{vue-ui-xy-canvas-heCdqh5X.cjs → vue-ui-xy-canvas-DCm4MdGE.cjs} +1 -1
  140. package/package.json +1 -1
  141. package/dist/vue-ui-donut-uVPdO4UH.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CzjC8LfY.cjs"),V=require("./useNestedProp-CY7DebVH.cjs"),N=require("./BaseIcon-Bcpzfk34.cjs"),F=require("./vue-ui-skeleton-CwqzJlQf.cjs"),j=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),q=["id"],A=["xmlns","viewBox"],O=["id"],D=["stop-color"],P=["stop-color"],G={key:0},U=["d","fill"],W=["d","fill"],Z=["d","stroke","stroke-width","stroke-linecap","stroke-linejoin"],H=["d","stroke","stroke-width","stroke-linecap","stroke-linejoin"],R=["height","width","x"],X={style:{width:"100%"}},J=["x","y","fill","font-size","font-weight"],K=["stroke","cx","cy","fill"],Q=["x","y","font-size","fill","font-weight"],Y={__name:"vue-ui-spark-trend",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(E){const u=E,{vue_ui_spark_trend:$}=o.useConfig(),S=e.computed(()=>!!u.dataset&&u.dataset.length),y=e.ref(o.createUid()),t=e.computed({get:()=>x(),set:l=>l});function x(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:$});return l.theme?{...V.useNestedProp({userConfig:o.themes.vue_ui_spark_trend[l.theme]||u.config,defaultConfig:l})}:l}e.watch(()=>u.config,l=>{t.value=x(),C()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map(n=>[void 0,1/0,-1/0,null,NaN].includes(n)?null:n)},{deep:!0});function k(l){return l.map(n=>o.checkNaN(n))}const v=e.ref(u.dataset.map(l=>t.value.style.animation.show||[void 0,1/0,-1/0,null,NaN].includes(l)?null:l)),h=e.ref(!1),g=e.ref(null);e.onMounted(()=>{C();let n=1e3/t.value.style.animation.animationFrames,i=performance.now();if(t.value.style.animation.show&&t.value.style.animation.animationFrames&&u.dataset.length>1){let b=function(){h.value=!0;let B=performance.now(),L=B-i;L>n?(i=B-L%n,d<u.dataset.length?(v.value.push(u.dataset[d]),d+=1,g.value=requestAnimationFrame(b)):(cancelAnimationFrame(g.value),v.value=k(u.dataset),h.value=!1)):g.value=requestAnimationFrame(b)};v.value=[];let d=0;b()}});function C(){o.objectIsEmpty(u.dataset)&&o.error({componentName:"VueUiSparkTrend",type:"dataset"})}const r=e.ref({height:80,width:300}),c=e.computed(()=>({top:t.value.style.padding.top,left:t.value.style.padding.left,right:r.value.width-t.value.style.padding.right,bottom:r.value.height-t.value.style.padding.bottom,height:r.value.height-(t.value.style.padding.top+t.value.style.padding.bottom)-(t.value.style.dataLabel.show?t.value.style.dataLabel.fontSize:0),width:r.value.width-(t.value.style.padding.left+t.value.style.padding.right)})),_=e.computed(()=>{const l=k(u.dataset);return{max:Math.max(...l.map(n=>o.checkNaN(n))),min:Math.min(...l.map(n=>o.checkNaN(n)))}}),p=e.computed(()=>{const l=_.value.min>=0?0:_.value.min;return Math.abs(l)}),T=e.computed(()=>_.value.max+p.value);function w(l){return l/T.value}const z=e.computed(()=>u.dataset.length),a=e.computed(()=>v.value.map((l,n)=>{const i=isNaN(l)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l)?0:l||0;return{value:o.checkNaN(l),absoluteValue:o.checkNaN(i),plotValue:o.checkNaN(i+p.value),toMax:w(i+p.value),x:c.value.left+o.checkNaN(n*(c.value.width/(z.value-1)))-t.value.style.padding.right,y:c.value.bottom-o.checkNaN(c.value.height*w(i+p.value))}})),f=e.computed(()=>{const l=k(u.dataset);return t.value.style.trendLabel.trendType==="global"?o.calcTrend(l):t.value.style.trendLabel.trendType==="n-1"&&l.length>1?(l.at(-1)/l.at(-2)-1)*100:t.value.style.trendLabel.trendType==="lastToFirst"?(l.at(-1)/l[0]-1)*100:0}),m=e.computed(()=>h.value||f.value===0?"neutral":f.value>0?"positive":"negative"),s=e.computed(()=>t.value.style.arrow.colors[m.value]),M=e.computed(()=>{const l={x:a.value[0].x,y:r.value.height-6},n={x:a.value[a.value.length-1].x,y:r.value.height-6},i=[];return a.value.forEach(d=>{i.push(`${d.x},${d.y} `)}),[l.x,l.y,...i,n.x,n.y].toString()}),I=e.computed(()=>{let l=[];return a.value.forEach(n=>{l.push(`${n.x},${n.y} `)}),`M ${l.toString()}`});return(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-spark-trend",id:y.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily};backgroundColor:${t.value.style.backgroundColor}`)},[S.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};overflow:visible`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"0%",y2:"100%",id:`pill_gradient_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,t.value.style.area.opacity)},null,8,D),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.backgroundColor},null,8,P)],8,O)]),t.value.style.area.show&&a.value[0]?(e.openBlock(),e.createElementBlock("g",G,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${a.value[0].x},${c.value.bottom} ${e.unref(o.createSmoothPath)(a.value)} L ${a.value.at(-1).x},${c.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#pill_gradient_${y.value})`:e.unref(o.setOpacity)(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,t.value.style.area.opacity),stroke:"none"},null,8,U)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${M.value}Z`,fill:t.value.style.area.useGradient?`url(#pill_gradient_${y.value})`:e.unref(o.setOpacity)(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,t.value.style.area.opacity),stroke:"none"},null,8,W))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&a.value.length?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(o.createSmoothPath)(a.value)}`,stroke:t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":t.value.style.line.strokeLinecap,"stroke-linejoin":t.value.style.line.strokeLinejoin},null,8,Z)):e.createCommentVNode("",!0),!t.value.style.line.smooth&&a.value.length?(e.openBlock(),e.createElementBlock("path",{key:2,d:I.value,stroke:t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":t.value.style.line.strokeLinecap,"stroke-linejoin":t.value.style.line.strokeLinejoin},null,8,H)):e.createCommentVNode("",!0),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("foreignObject",{key:3,height:r.value.height/2,width:r.value.height/2,x:r.value.height/5,y:8},[e.createElementVNode("div",X,[m.value==="positive"?(e.openBlock(),e.createBlock(N.default,{key:0,stroke:s.value,name:"arrowTop",size:r.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0),m.value==="negative"?(e.openBlock(),e.createBlock(N.default,{key:1,stroke:s.value,name:"arrowBottom",size:r.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0),m.value==="neutral"?(e.openBlock(),e.createBlock(N.default,{key:2,stroke:s.value,name:"arrowRight",size:r.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0)])],8,R)),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("text",{key:4,x:r.value.height/2-r.value.height/20,y:c.value.bottom,"text-anchor":"middle",fill:t.value.style.trendLabel.useColorTrend?s.value:t.value.style.trendLabel.color,"font-size":t.value.style.trendLabel.fontSize,"font-weight":t.value.style.trendLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(o.dataLabel)({p:f.value>0?"+":"",v:f.value,s:"%",r:t.value.style.trendLabel.rounding})),9,J)),a.value.length&&a.value.at(-1).x!==void 0?(e.openBlock(),e.createElementBlock("circle",{key:5,stroke:t.value.style.backgroundColor,"stroke-width":2,cx:a.value.at(-1).x,cy:a.value.at(-1).y,r:4,fill:s.value},null,8,K)):e.createCommentVNode("",!0),a.value.length&&a.value.at(-1).x!==void 0&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:6,"text-anchor":"middle",x:a.value.at(-1).x,y:a.value.at(-1).y-t.value.style.dataLabel.fontSize/1.5,"font-size":t.value.style.dataLabel.fontSize,fill:t.value.style.dataLabel.useColorTrend?s.value:t.value.style.dataLabel.color,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.dataLabel.formatter,a.value.at(-1).value,e.unref(o.dataLabel)({p:t.value.style.dataLabel.prefix,v:a.value.at(-1).value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding}),{datapoint:a.value.at(-1)})),9,Q)):e.createCommentVNode("",!0)],12,A)):(e.openBlock(),e.createBlock(F.default,{key:0,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,q))}},ee=j._export_sfc(Y,[["__scopeId","data-v-632417de"]]);exports.default=ee;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CPFtA_2a.cjs"),V=require("./useNestedProp-BUMZMzjx.cjs"),N=require("./BaseIcon-Dk7dYD2V.cjs"),F=require("./vue-ui-skeleton-C9gsw9XJ.cjs"),j=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),q=["id"],A=["xmlns","viewBox"],O=["id"],D=["stop-color"],P=["stop-color"],G={key:0},U=["d","fill"],W=["d","fill"],Z=["d","stroke","stroke-width","stroke-linecap","stroke-linejoin"],H=["d","stroke","stroke-width","stroke-linecap","stroke-linejoin"],R=["height","width","x"],X={style:{width:"100%"}},J=["x","y","fill","font-size","font-weight"],K=["stroke","cx","cy","fill"],Q=["x","y","font-size","fill","font-weight"],Y={__name:"vue-ui-spark-trend",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(E){const u=E,{vue_ui_spark_trend:$}=o.useConfig(),S=e.computed(()=>!!u.dataset&&u.dataset.length),y=e.ref(o.createUid()),t=e.computed({get:()=>x(),set:l=>l});function x(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:$});return l.theme?{...V.useNestedProp({userConfig:o.themes.vue_ui_spark_trend[l.theme]||u.config,defaultConfig:l})}:l}e.watch(()=>u.config,l=>{t.value=x(),C()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map(n=>[void 0,1/0,-1/0,null,NaN].includes(n)?null:n)},{deep:!0});function k(l){return l.map(n=>o.checkNaN(n))}const v=e.ref(u.dataset.map(l=>t.value.style.animation.show||[void 0,1/0,-1/0,null,NaN].includes(l)?null:l)),h=e.ref(!1),g=e.ref(null);e.onMounted(()=>{C();let n=1e3/t.value.style.animation.animationFrames,i=performance.now();if(t.value.style.animation.show&&t.value.style.animation.animationFrames&&u.dataset.length>1){let b=function(){h.value=!0;let B=performance.now(),L=B-i;L>n?(i=B-L%n,d<u.dataset.length?(v.value.push(u.dataset[d]),d+=1,g.value=requestAnimationFrame(b)):(cancelAnimationFrame(g.value),v.value=k(u.dataset),h.value=!1)):g.value=requestAnimationFrame(b)};v.value=[];let d=0;b()}});function C(){o.objectIsEmpty(u.dataset)&&o.error({componentName:"VueUiSparkTrend",type:"dataset"})}const r=e.ref({height:80,width:300}),c=e.computed(()=>({top:t.value.style.padding.top,left:t.value.style.padding.left,right:r.value.width-t.value.style.padding.right,bottom:r.value.height-t.value.style.padding.bottom,height:r.value.height-(t.value.style.padding.top+t.value.style.padding.bottom)-(t.value.style.dataLabel.show?t.value.style.dataLabel.fontSize:0),width:r.value.width-(t.value.style.padding.left+t.value.style.padding.right)})),_=e.computed(()=>{const l=k(u.dataset);return{max:Math.max(...l.map(n=>o.checkNaN(n))),min:Math.min(...l.map(n=>o.checkNaN(n)))}}),p=e.computed(()=>{const l=_.value.min>=0?0:_.value.min;return Math.abs(l)}),T=e.computed(()=>_.value.max+p.value);function w(l){return l/T.value}const z=e.computed(()=>u.dataset.length),a=e.computed(()=>v.value.map((l,n)=>{const i=isNaN(l)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l)?0:l||0;return{value:o.checkNaN(l),absoluteValue:o.checkNaN(i),plotValue:o.checkNaN(i+p.value),toMax:w(i+p.value),x:c.value.left+o.checkNaN(n*(c.value.width/(z.value-1)))-t.value.style.padding.right,y:c.value.bottom-o.checkNaN(c.value.height*w(i+p.value))}})),f=e.computed(()=>{const l=k(u.dataset);return t.value.style.trendLabel.trendType==="global"?o.calcTrend(l):t.value.style.trendLabel.trendType==="n-1"&&l.length>1?(l.at(-1)/l.at(-2)-1)*100:t.value.style.trendLabel.trendType==="lastToFirst"?(l.at(-1)/l[0]-1)*100:0}),m=e.computed(()=>h.value||f.value===0?"neutral":f.value>0?"positive":"negative"),s=e.computed(()=>t.value.style.arrow.colors[m.value]),M=e.computed(()=>{const l={x:a.value[0].x,y:r.value.height-6},n={x:a.value[a.value.length-1].x,y:r.value.height-6},i=[];return a.value.forEach(d=>{i.push(`${d.x},${d.y} `)}),[l.x,l.y,...i,n.x,n.y].toString()}),I=e.computed(()=>{let l=[];return a.value.forEach(n=>{l.push(`${n.x},${n.y} `)}),`M ${l.toString()}`});return(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-spark-trend",id:y.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily};backgroundColor:${t.value.style.backgroundColor}`)},[S.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};overflow:visible`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"0%",y2:"100%",id:`pill_gradient_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,t.value.style.area.opacity)},null,8,D),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.backgroundColor},null,8,P)],8,O)]),t.value.style.area.show&&a.value[0]?(e.openBlock(),e.createElementBlock("g",G,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${a.value[0].x},${c.value.bottom} ${e.unref(o.createSmoothPath)(a.value)} L ${a.value.at(-1).x},${c.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#pill_gradient_${y.value})`:e.unref(o.setOpacity)(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,t.value.style.area.opacity),stroke:"none"},null,8,U)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${M.value}Z`,fill:t.value.style.area.useGradient?`url(#pill_gradient_${y.value})`:e.unref(o.setOpacity)(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,t.value.style.area.opacity),stroke:"none"},null,8,W))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&a.value.length?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(o.createSmoothPath)(a.value)}`,stroke:t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":t.value.style.line.strokeLinecap,"stroke-linejoin":t.value.style.line.strokeLinejoin},null,8,Z)):e.createCommentVNode("",!0),!t.value.style.line.smooth&&a.value.length?(e.openBlock(),e.createElementBlock("path",{key:2,d:I.value,stroke:t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":t.value.style.line.strokeLinecap,"stroke-linejoin":t.value.style.line.strokeLinejoin},null,8,H)):e.createCommentVNode("",!0),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("foreignObject",{key:3,height:r.value.height/2,width:r.value.height/2,x:r.value.height/5,y:8},[e.createElementVNode("div",X,[m.value==="positive"?(e.openBlock(),e.createBlock(N.default,{key:0,stroke:s.value,name:"arrowTop",size:r.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0),m.value==="negative"?(e.openBlock(),e.createBlock(N.default,{key:1,stroke:s.value,name:"arrowBottom",size:r.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0),m.value==="neutral"?(e.openBlock(),e.createBlock(N.default,{key:2,stroke:s.value,name:"arrowRight",size:r.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0)])],8,R)),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("text",{key:4,x:r.value.height/2-r.value.height/20,y:c.value.bottom,"text-anchor":"middle",fill:t.value.style.trendLabel.useColorTrend?s.value:t.value.style.trendLabel.color,"font-size":t.value.style.trendLabel.fontSize,"font-weight":t.value.style.trendLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(o.dataLabel)({p:f.value>0?"+":"",v:f.value,s:"%",r:t.value.style.trendLabel.rounding})),9,J)),a.value.length&&a.value.at(-1).x!==void 0?(e.openBlock(),e.createElementBlock("circle",{key:5,stroke:t.value.style.backgroundColor,"stroke-width":2,cx:a.value.at(-1).x,cy:a.value.at(-1).y,r:4,fill:s.value},null,8,K)):e.createCommentVNode("",!0),a.value.length&&a.value.at(-1).x!==void 0&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:6,"text-anchor":"middle",x:a.value.at(-1).x,y:a.value.at(-1).y-t.value.style.dataLabel.fontSize/1.5,"font-size":t.value.style.dataLabel.fontSize,fill:t.value.style.dataLabel.useColorTrend?s.value:t.value.style.dataLabel.color,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.dataLabel.formatter,a.value.at(-1).value,e.unref(o.dataLabel)({p:t.value.style.dataLabel.prefix,v:a.value.at(-1).value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding}),{datapoint:a.value.at(-1)})),9,Q)):e.createCommentVNode("",!0)],12,A)):(e.openBlock(),e.createBlock(F.default,{key:0,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,q))}},ee=j._export_sfc(Y,[["__scopeId","data-v-632417de"]]);exports.default=ee;
@@ -1,7 +1,7 @@
1
1
  import { computed as g, ref as x, watch as P, onMounted as q, nextTick as H, openBlock as r, createElementBlock as v, normalizeStyle as p, unref as s, renderSlot as z, normalizeProps as L, mergeProps as X, createCommentVNode as d, createElementVNode as c, toDisplayString as f, Fragment as T, renderList as R, guardReactiveProps as J, createBlock as K } from "vue";
2
- import { u as Q, c as Y, t as Z, a as ee, p as k, b as te, o as le, e as O, g as ae, d as oe, s as b, i as w, f as C, X as se, w as ue } from "./index-DP8dqFNd.js";
3
- import { u as E } from "./useNestedProp-B-oZxD4x.js";
4
- import ne from "./vue-ui-skeleton-B30ZhUV7.js";
2
+ import { u as Q, c as Y, t as Z, a as ee, p as k, b as te, o as le, e as O, g as ae, d as oe, s as b, i as w, f as C, X as se, w as ue } from "./index-Dzi9DWc6.js";
3
+ import { u as E } from "./useNestedProp-BSY0Tspx.js";
4
+ import ne from "./vue-ui-skeleton-BRcmM6et.js";
5
5
  const ie = ["onClick"], re = { key: 1 }, ve = ["xmlns", "viewBox"], ce = ["id"], de = ["stop-color"], pe = ["stop-color"], fe = ["height", "width", "fill", "rx"], ye = ["height", "width", "fill", "rx"], me = ["height", "width", "fill", "rx"], we = {
6
6
  __name: "vue-ui-sparkbar",
7
7
  props: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CzjC8LfY.cjs"),C=require("./useNestedProp-CY7DebVH.cjs"),V=require("./vue-ui-skeleton-CwqzJlQf.cjs"),D=["onClick"],$={key:1},z=["xmlns","viewBox"],L=["id"],P=["stop-color"],A=["stop-color"],F=["height","width","fill","rx"],O=["height","width","fill","rx"],I=["height","width","fill","rx"],T={__name:"vue-ui-sparkbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:100}},emits:["selectDatapoint"],setup(p,{emit:b}){const n=p,{vue_ui_sparkbar:w}=o.useConfig(),v=e.computed(()=>!!n.dataset&&n.dataset.length),y=e.ref(o.createUid()),t=e.computed({get:()=>f(),set:l=>l});function f(){const l=C.useNestedProp({userConfig:n.config,defaultConfig:w});return l.theme?{...C.useNestedProp({userConfig:o.themes.vue_ui_sparkbar[l.theme]||n.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>n.config,l=>{t.value=f()},{deep:!0});const S=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),c=e.ref(n.dataset.map(l=>({...l,value:t.value.style.animation.show?0:l.value||0,formatter:l.formatter||null}))),g=e.ref(null);e.onMounted(async()=>{o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiSparkbar",type:"dataset"}),h()});function h(){if(t.value.style.animation.show){let x=function(){s+=a/l,s<a?(c.value=c.value.map((u,m)=>({...u,value:u.value+=r[m]})),g.value=requestAnimationFrame(x)):c.value=n.dataset.map(u=>({...u,value:u.value||0,formatter:u.formatter||null}))};const l=t.value.style.animation.animationFrames,r=n.dataset.map((u,m)=>u.value/l),a=n.dataset.map(u=>u.value||0).reduce((u,m)=>u+m,0);let s=0;x()}}e.watch(()=>n.dataset,async l=>{cancelAnimationFrame(g.value),c.value=n.dataset.map(r=>({...r,value:t.value.style.animation.show?0:r.value||0,formatter:r.formatter||null})),e.nextTick(h)},{deep:!0});const i=e.ref({width:500,height:16}),N=e.computed(()=>Math.max(...n.dataset.map(l=>l.value))),_=e.computed(()=>(n.dataset.forEach((l,r)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkbar",type:"datasetSerieAttribute",property:a,index:r})})}),c.value.map((l,r)=>({...l,value:l.value||0,color:o.convertColorToHex(l.color)||S.value[r]||o.palette[r]||o.palette[r%o.palette.length]}))));function B(l){return l/N.value}function k(l){return t.value.style.layout.independant?l.target?l.value/l.target:t.value.style.layout.percentage?l.value>100?1:l.value/100:t.value.style.layout.target===0?1:l.value/t.value.style.layout.target:B(l.value)}function d(l){return t.value.style.layout.independant&&l.target||t.value.style.layout.target}function E(l,r){b("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({width:"100%",fontFamily:t.value.style.fontFamily,background:e.unref(o.setOpacity)(t.value.style.backgroundColor,n.backgroundOpacity)})},[l.$slots.title?e.renderSlot(l.$slots,"title",e.normalizeProps(e.mergeProps({key:0},{title:{...l.title,title:t.value.style.title.text,subtitle:t.value.style.title.subtitle.text}}))):e.createCommentVNode("",!0),!l.$slots.title&&t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,class:"vue-ui-sparkbar-title-container",style:e.normalizeStyle({background:t.value.style.title.backgroundColor,margin:t.value.style.title.margin,textAlign:t.value.style.title.textAlign})},[e.createElementVNode("div",{class:"vue-ui-sparkbar-title",style:e.normalizeStyle({fontSize:t.value.style.title.fontSize+"px",color:t.value.style.title.color,fontWeight: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:"vue-ui-sparkbar-subtitle",style:e.normalizeStyle({fontSize:t.value.style.title.subtitle.fontSize+"px",color:t.value.style.title.subtitle.color,fontWeight:t.value.style.title.subtitle.bold?"bold":"normal"})},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`display:flex !important;${["left","right"].includes(t.value.style.labels.name.position)?`flex-direction: ${t.value.style.labels.name.position==="right"?"row-reverse":"row"} !important`:"flex-direction:column !important"};gap:${t.value.style.gap}px !important;align-items:center;${p.dataset.length>0&&s!==p.dataset.length-1?"margin-bottom:6px":""}`),onClick:()=>E(a,s)},[e.renderSlot(l.$slots,"data-label",e.normalizeProps(e.guardReactiveProps({bar:{...a,target:d(a),valueLabel:e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:s}),targetLabel:e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:s})}}))),l.$slots["data-label"]?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:t.value.style.labels.name.width,color:t.value.style.labels.name.color,fontSize:t.value.style.labels.fontSize+"px",fontWeight:t.value.style.labels.name.bold?"bold":"normal",textAlign:["left","right"].includes(t.value.style.labels.name.position)||["top","top-left"].includes(t.value.style.labels.name.position)?"left":t.value.style.labels.name.position==="top-center"?"center":"right"})},[e.createElementVNode("span",null,e.toDisplayString(a.name),1),t.value.style.labels.value.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.labels.value.bold?"bold":"normal"}`)},": "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:s})),5)):e.createCommentVNode("",!0),t.value.style.layout.showTargetValue?(e.openBlock(),e.createElementBlock("span",$,e.toDisplayString(" "+t.value.style.layout.targetValueText)+" "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:s})),1)):e.createCommentVNode("",!0)],4)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${i.value.width} ${i.value.height}`,width:"100%"},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkbar_gradient_${s}_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.03),100-t.value.style.bar.gradient.intensity)},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,A)],8,L)]),e.createElementVNode("rect",{height:i.value.height,width:i.value.width,x:0,y:0,fill:e.unref(o.setOpacity)(t.value.style.gutter.backgroundColor,t.value.style.gutter.opacity),rx:i.value.height/2},null,8,F),e.createElementVNode("rect",{height:i.value.height,width:i.value.width*k(a),x:0,y:0,fill:t.value.style.bar.gradient.underlayerColor,rx:i.value.height/2},null,8,O),e.createElementVNode("rect",{height:i.value.height,width:i.value.width*k(a),x:0,y:0,fill:t.value.style.bar.gradient.show?`url(#sparkbar_gradient_${s}_${y.value})`:a.color,rx:i.value.height/2},null,8,I)],8,z))],12,D)):e.createCommentVNode("",!0)],64))),256)),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:2,config:{type:"sparkbar",style:{backgroundColor:t.value.style.backgroundColor,sparkbar:{color:"#CCCCCC"}}}},null,8,["config"]))],4))}};exports.default=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CPFtA_2a.cjs"),C=require("./useNestedProp-BUMZMzjx.cjs"),V=require("./vue-ui-skeleton-C9gsw9XJ.cjs"),D=["onClick"],$={key:1},z=["xmlns","viewBox"],L=["id"],P=["stop-color"],A=["stop-color"],F=["height","width","fill","rx"],O=["height","width","fill","rx"],I=["height","width","fill","rx"],T={__name:"vue-ui-sparkbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:100}},emits:["selectDatapoint"],setup(p,{emit:b}){const n=p,{vue_ui_sparkbar:w}=o.useConfig(),v=e.computed(()=>!!n.dataset&&n.dataset.length),y=e.ref(o.createUid()),t=e.computed({get:()=>f(),set:l=>l});function f(){const l=C.useNestedProp({userConfig:n.config,defaultConfig:w});return l.theme?{...C.useNestedProp({userConfig:o.themes.vue_ui_sparkbar[l.theme]||n.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>n.config,l=>{t.value=f()},{deep:!0});const S=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),c=e.ref(n.dataset.map(l=>({...l,value:t.value.style.animation.show?0:l.value||0,formatter:l.formatter||null}))),g=e.ref(null);e.onMounted(async()=>{o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiSparkbar",type:"dataset"}),h()});function h(){if(t.value.style.animation.show){let x=function(){s+=a/l,s<a?(c.value=c.value.map((u,m)=>({...u,value:u.value+=r[m]})),g.value=requestAnimationFrame(x)):c.value=n.dataset.map(u=>({...u,value:u.value||0,formatter:u.formatter||null}))};const l=t.value.style.animation.animationFrames,r=n.dataset.map((u,m)=>u.value/l),a=n.dataset.map(u=>u.value||0).reduce((u,m)=>u+m,0);let s=0;x()}}e.watch(()=>n.dataset,async l=>{cancelAnimationFrame(g.value),c.value=n.dataset.map(r=>({...r,value:t.value.style.animation.show?0:r.value||0,formatter:r.formatter||null})),e.nextTick(h)},{deep:!0});const i=e.ref({width:500,height:16}),N=e.computed(()=>Math.max(...n.dataset.map(l=>l.value))),_=e.computed(()=>(n.dataset.forEach((l,r)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkbar",type:"datasetSerieAttribute",property:a,index:r})})}),c.value.map((l,r)=>({...l,value:l.value||0,color:o.convertColorToHex(l.color)||S.value[r]||o.palette[r]||o.palette[r%o.palette.length]}))));function B(l){return l/N.value}function k(l){return t.value.style.layout.independant?l.target?l.value/l.target:t.value.style.layout.percentage?l.value>100?1:l.value/100:t.value.style.layout.target===0?1:l.value/t.value.style.layout.target:B(l.value)}function d(l){return t.value.style.layout.independant&&l.target||t.value.style.layout.target}function E(l,r){b("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({width:"100%",fontFamily:t.value.style.fontFamily,background:e.unref(o.setOpacity)(t.value.style.backgroundColor,n.backgroundOpacity)})},[l.$slots.title?e.renderSlot(l.$slots,"title",e.normalizeProps(e.mergeProps({key:0},{title:{...l.title,title:t.value.style.title.text,subtitle:t.value.style.title.subtitle.text}}))):e.createCommentVNode("",!0),!l.$slots.title&&t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,class:"vue-ui-sparkbar-title-container",style:e.normalizeStyle({background:t.value.style.title.backgroundColor,margin:t.value.style.title.margin,textAlign:t.value.style.title.textAlign})},[e.createElementVNode("div",{class:"vue-ui-sparkbar-title",style:e.normalizeStyle({fontSize:t.value.style.title.fontSize+"px",color:t.value.style.title.color,fontWeight: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:"vue-ui-sparkbar-subtitle",style:e.normalizeStyle({fontSize:t.value.style.title.subtitle.fontSize+"px",color:t.value.style.title.subtitle.color,fontWeight:t.value.style.title.subtitle.bold?"bold":"normal"})},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`display:flex !important;${["left","right"].includes(t.value.style.labels.name.position)?`flex-direction: ${t.value.style.labels.name.position==="right"?"row-reverse":"row"} !important`:"flex-direction:column !important"};gap:${t.value.style.gap}px !important;align-items:center;${p.dataset.length>0&&s!==p.dataset.length-1?"margin-bottom:6px":""}`),onClick:()=>E(a,s)},[e.renderSlot(l.$slots,"data-label",e.normalizeProps(e.guardReactiveProps({bar:{...a,target:d(a),valueLabel:e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:s}),targetLabel:e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:s})}}))),l.$slots["data-label"]?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:t.value.style.labels.name.width,color:t.value.style.labels.name.color,fontSize:t.value.style.labels.fontSize+"px",fontWeight:t.value.style.labels.name.bold?"bold":"normal",textAlign:["left","right"].includes(t.value.style.labels.name.position)||["top","top-left"].includes(t.value.style.labels.name.position)?"left":t.value.style.labels.name.position==="top-center"?"center":"right"})},[e.createElementVNode("span",null,e.toDisplayString(a.name),1),t.value.style.labels.value.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.labels.value.bold?"bold":"normal"}`)},": "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:s})),5)):e.createCommentVNode("",!0),t.value.style.layout.showTargetValue?(e.openBlock(),e.createElementBlock("span",$,e.toDisplayString(" "+t.value.style.layout.targetValueText)+" "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:s})),1)):e.createCommentVNode("",!0)],4)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${i.value.width} ${i.value.height}`,width:"100%"},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkbar_gradient_${s}_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.03),100-t.value.style.bar.gradient.intensity)},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,A)],8,L)]),e.createElementVNode("rect",{height:i.value.height,width:i.value.width,x:0,y:0,fill:e.unref(o.setOpacity)(t.value.style.gutter.backgroundColor,t.value.style.gutter.opacity),rx:i.value.height/2},null,8,F),e.createElementVNode("rect",{height:i.value.height,width:i.value.width*k(a),x:0,y:0,fill:t.value.style.bar.gradient.underlayerColor,rx:i.value.height/2},null,8,O),e.createElementVNode("rect",{height:i.value.height,width:i.value.width*k(a),x:0,y:0,fill:t.value.style.bar.gradient.show?`url(#sparkbar_gradient_${s}_${y.value})`:a.color,rx:i.value.height/2},null,8,I)],8,z))],12,D)):e.createCommentVNode("",!0)],64))),256)),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:2,config:{type:"sparkbar",style:{backgroundColor:t.value.style.backgroundColor,sparkbar:{color:"#CCCCCC"}}}},null,8,["config"]))],4))}};exports.default=T;
@@ -1,7 +1,7 @@
1
1
  import { computed as s, onMounted as M, ref as A, watch as N, openBlock as i, createElementBlock as c, normalizeStyle as d, toDisplayString as y, createCommentVNode as f, unref as r, createElementVNode as v, normalizeClass as D, createBlock as E } from "vue";
2
- import { u as G, o as I, e as S, g as U, c as q, t as P, M as R, X as T, i as X, v as g, f as H } from "./index-DP8dqFNd.js";
3
- import { u as z } from "./useNestedProp-B-oZxD4x.js";
4
- import Y from "./vue-ui-skeleton-B30ZhUV7.js";
2
+ import { u as G, o as I, e as S, g as U, c as q, t as P, M as R, X as T, i as X, v as g, f as H } from "./index-Dzi9DWc6.js";
3
+ import { u as z } from "./useNestedProp-BSY0Tspx.js";
4
+ import Y from "./vue-ui-skeleton-BRcmM6et.js";
5
5
  const J = ["xmlns", "viewBox"], K = ["id"], Q = ["stop-color"], V = ["stop-color"], W = ["d", "stroke", "stroke-linecap"], Z = ["d", "stroke", "stroke-linecap", "stroke-dashoffset"], ee = ["x", "y", "font-size", "fill", "font-weight"], se = {
6
6
  __name: "vue-ui-sparkgauge",
7
7
  props: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-CzjC8LfY.cjs"),b=require("./useNestedProp-CY7DebVH.cjs"),$=require("./vue-ui-skeleton-CwqzJlQf.cjs"),w=["xmlns","viewBox"],S=["id"],L=["stop-color"],B=["stop-color"],E=["d","stroke","stroke-linecap"],z=["d","stroke","stroke-linecap","stroke-dashoffset"],M=["x","y","font-size","fill","font-weight"],A={__name:"vue-ui-sparkgauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(x){const o=x,{vue_ui_sparkgauge:C}=u.useConfig(),c=e.computed(()=>!!o.dataset&&Object.keys(o.dataset).length);e.onMounted(()=>{v()});function v(){u.objectIsEmpty(o.dataset)?u.error({componentName:"VueUiSparkgauge",type:"dataset"}):u.getMissingDatasetAttributes({datasetObject:o.dataset,requiredAttributes:["value","min","max"]}).forEach(a=>{u.error({componentName:"VueUiSparkgauge",type:"datasetAttribute",property:a})})}const d=e.ref(u.createUid()),t=e.computed({get:()=>m(),set:a=>a});function m(){const a=b.useNestedProp({userConfig:o.config,defaultConfig:C});return a.theme?{...b.useNestedProp({userConfig:u.themes.vue_ui_sparkgauge[a.theme]||o.config,defaultConfig:a})}:a}e.watch(()=>o.config,a=>{t.value=m(),v()},{deep:!0});const s=e.computed(()=>({height:t.value.style.height,width:128,base:t.value.style.basePosition})),n=e.computed(()=>{const a=o.dataset.min??0,r=o.dataset.max??0,N=r-a;return{min:a,max:r,diff:N}}),l=e.ref(t.value.style.animation.show?n.value.min:o.dataset.value);e.watch(()=>o.dataset.value,()=>{y(o.dataset.value||0)});const f=e.computed(()=>l.value>n.value.max?n.value.max:l.value<n.value.min?n.value.min:l.value),p=e.computed(()=>n.value.diff/t.value.style.animation.speedMs);e.onMounted(()=>{y(o.dataset.value||0)});function y(a){function r(){l.value<a?l.value=Math.min(l.value+p.value,a):l.value>a&&(l.value=Math.max(l.value-p.value,a)),l.value!==a&&requestAnimationFrame(r)}r()}const i=e.computed(()=>o.dataset.title??""),g=e.computed(()=>l.value>=0?(f.value-n.value.min)/n.value.diff:(Math.abs(n.value.min)-Math.abs(f.value))/n.value.diff),k=e.computed(()=>u.interpolateColorHex(t.value.style.colors.min,t.value.style.colors.max,n.value.min,n.value.max,l.value)),h=e.computed(()=>t.value.style.dataLabel.autoColor?k.value:t.value.style.dataLabel.color),_=e.computed(()=>t.value.style.track.autoColor?k.value:t.value.style.track.color);return(a,r)=>(e.openBlock(),e.createElementBlock("div",{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,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${s.value.width} ${s.value.height}`,style:e.normalizeStyle(`overflow: visible; background:${t.value.style.background}; width:100%;`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`gradient_${d.value}`,x1:"-10%",y1:"100%",x2:"110%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.colors.min},null,8,L),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.max},null,8,B)],8,S)]),e.createElementVNode("path",{d:`M10 ${s.value.base} A 1 1 0 1 1 118 ${s.value.base}`,stroke:t.value.style.gutter.color,"stroke-width":8,"stroke-linecap":t.value.style.gutter.strokeLinecap,fill:"none"},null,8,E),g.value!==0?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M10 ${s.value.base} A 1 1 0 1 1 118 ${s.value.base}`,stroke:t.value.style.colors.showGradient?`url(#gradient_${d.value})`:_.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,z)):e.createCommentVNode("",!0),e.createElementVNode("text",{"text-anchor":"middle",x:s.value.width/2,y:s.value.base+6+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,fill:h.value,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,e.unref(u.checkNaN)(l.value),e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:e.unref(u.checkNaN)(l.value),s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding}),{datapoint:e.unref(u.checkNaN)(l.value),color:h.value})),9,M)],12,w)):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($.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)],4))}};exports.default=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-CPFtA_2a.cjs"),b=require("./useNestedProp-BUMZMzjx.cjs"),$=require("./vue-ui-skeleton-C9gsw9XJ.cjs"),w=["xmlns","viewBox"],S=["id"],L=["stop-color"],B=["stop-color"],E=["d","stroke","stroke-linecap"],z=["d","stroke","stroke-linecap","stroke-dashoffset"],M=["x","y","font-size","fill","font-weight"],A={__name:"vue-ui-sparkgauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(x){const o=x,{vue_ui_sparkgauge:C}=u.useConfig(),c=e.computed(()=>!!o.dataset&&Object.keys(o.dataset).length);e.onMounted(()=>{v()});function v(){u.objectIsEmpty(o.dataset)?u.error({componentName:"VueUiSparkgauge",type:"dataset"}):u.getMissingDatasetAttributes({datasetObject:o.dataset,requiredAttributes:["value","min","max"]}).forEach(a=>{u.error({componentName:"VueUiSparkgauge",type:"datasetAttribute",property:a})})}const d=e.ref(u.createUid()),t=e.computed({get:()=>m(),set:a=>a});function m(){const a=b.useNestedProp({userConfig:o.config,defaultConfig:C});return a.theme?{...b.useNestedProp({userConfig:u.themes.vue_ui_sparkgauge[a.theme]||o.config,defaultConfig:a})}:a}e.watch(()=>o.config,a=>{t.value=m(),v()},{deep:!0});const s=e.computed(()=>({height:t.value.style.height,width:128,base:t.value.style.basePosition})),n=e.computed(()=>{const a=o.dataset.min??0,r=o.dataset.max??0,N=r-a;return{min:a,max:r,diff:N}}),l=e.ref(t.value.style.animation.show?n.value.min:o.dataset.value);e.watch(()=>o.dataset.value,()=>{y(o.dataset.value||0)});const f=e.computed(()=>l.value>n.value.max?n.value.max:l.value<n.value.min?n.value.min:l.value),p=e.computed(()=>n.value.diff/t.value.style.animation.speedMs);e.onMounted(()=>{y(o.dataset.value||0)});function y(a){function r(){l.value<a?l.value=Math.min(l.value+p.value,a):l.value>a&&(l.value=Math.max(l.value-p.value,a)),l.value!==a&&requestAnimationFrame(r)}r()}const i=e.computed(()=>o.dataset.title??""),g=e.computed(()=>l.value>=0?(f.value-n.value.min)/n.value.diff:(Math.abs(n.value.min)-Math.abs(f.value))/n.value.diff),k=e.computed(()=>u.interpolateColorHex(t.value.style.colors.min,t.value.style.colors.max,n.value.min,n.value.max,l.value)),h=e.computed(()=>t.value.style.dataLabel.autoColor?k.value:t.value.style.dataLabel.color),_=e.computed(()=>t.value.style.track.autoColor?k.value:t.value.style.track.color);return(a,r)=>(e.openBlock(),e.createElementBlock("div",{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,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${s.value.width} ${s.value.height}`,style:e.normalizeStyle(`overflow: visible; background:${t.value.style.background}; width:100%;`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`gradient_${d.value}`,x1:"-10%",y1:"100%",x2:"110%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.colors.min},null,8,L),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.max},null,8,B)],8,S)]),e.createElementVNode("path",{d:`M10 ${s.value.base} A 1 1 0 1 1 118 ${s.value.base}`,stroke:t.value.style.gutter.color,"stroke-width":8,"stroke-linecap":t.value.style.gutter.strokeLinecap,fill:"none"},null,8,E),g.value!==0?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M10 ${s.value.base} A 1 1 0 1 1 118 ${s.value.base}`,stroke:t.value.style.colors.showGradient?`url(#gradient_${d.value})`:_.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,z)):e.createCommentVNode("",!0),e.createElementVNode("text",{"text-anchor":"middle",x:s.value.width/2,y:s.value.base+6+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,fill:h.value,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,e.unref(u.checkNaN)(l.value),e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:e.unref(u.checkNaN)(l.value),s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding}),{datapoint:e.unref(u.checkNaN)(l.value),color:h.value})),9,M)],12,w)):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($.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)],4))}};exports.default=A;
@@ -1,8 +1,8 @@
1
1
  import { useCssVars as J, computed as _, onMounted as K, ref as D, watch as Q, openBlock as a, createElementBlock as o, normalizeStyle as $, createElementVNode as y, createTextVNode as Z, toDisplayString as g, unref as r, createCommentVNode as p, Fragment as h, renderList as f, normalizeClass as N, createBlock as I } from "vue";
2
- import { u as ee, o as te, e as H, g as le, c as ae, t as oe, s as b, i as V, f as E, X as se, w as z } from "./index-DP8dqFNd.js";
3
- import { u as F } from "./useNestedProp-B-oZxD4x.js";
4
- import { _ as ue } from "./Shape-CsoTtJx6.js";
5
- import ie from "./vue-ui-skeleton-B30ZhUV7.js";
2
+ import { u as ee, o as te, e as H, g as le, c as ae, t as oe, s as b, i as V, f as E, X as se, w as z } from "./index-Dzi9DWc6.js";
3
+ import { u as F } from "./useNestedProp-BSY0Tspx.js";
4
+ import { _ as ue } from "./Shape-BYzJgXyX.js";
5
+ import ie from "./vue-ui-skeleton-BRcmM6et.js";
6
6
  import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
7
  const re = { key: 0 }, ve = { key: 1 }, de = ["xmlns", "viewBox"], ce = ["id"], ye = ["stop-color"], he = ["stop-color"], fe = ["id"], ge = ["stop-color"], pe = ["stop-color"], be = ["id"], me = ["stop-color"], _e = ["stop-color"], xe = { key: 0 }, ke = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], we = { key: 1 }, $e = ["x", "y", "font-size", "font-weight", "fill"], Ce = ["x", "y", "font-size", "fill"], Le = ["x", "y", "font-size", "fill"], ze = ["height", "width", "x", "onMouseover", "stroke", "stroke-width", "rx", "stroke-dasharray", "onClick"], Se = {
8
8
  __name: "vue-ui-sparkhistogram",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-CzjC8LfY.cjs"),_=require("./useNestedProp-CY7DebVH.cjs"),F=require("./Shape-qJYTY2BC.cjs"),M=require("./vue-ui-skeleton-CwqzJlQf.cjs"),O=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A={key:0},H={key:1},q=["xmlns","viewBox"],I=["id"],U=["stop-color"],W=["stop-color"],j=["id"],P=["stop-color"],G=["stop-color"],T=["id"],X=["stop-color"],Y=["stop-color"],R={key:0},J=["x","y","height","width","fill","stroke","stroke-width","rx"],K={key:1},Q=["x","y","font-size","font-weight","fill"],Z=["x","y","font-size","fill"],ee=["x","y","font-size","fill"],te=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],le={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(x,{emit:B}){const i=x;e.useCssVars(o=>({"7d1c0c30":L.value}));const{vue_ui_sparkhistogram:E}=a.useConfig(),h=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{k()});function k(){a.objectIsEmpty(i.dataset)?a.error({componentName:"VueUiSparkHistogram",type:"dataset"}):i.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});function b(){const o=_.useNestedProp({userConfig:i.config,defaultConfig:E});return o.theme?{..._.useNestedProp({userConfig:a.themes.vue_ui_sparkhistogram[o.theme]||i.config,defaultConfig:o})}:o}e.watch(()=>i.config,o=>{t.value=b(),k()},{deep:!0});const c=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}}),w=e.computed(()=>Math.max(...i.dataset.map(o=>Math.abs(o.value||0))));function C(o){return Math.abs(o)/w.value}const u=e.computed(()=>i.dataset.map((o,r)=>{const l=C(o.value||0),s=c.value.drawingHeight*l,d=c.value.drawingWidth/i.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,g=c.value.centerY-s/2,m=c.value.left+(y/2+r*d),S=c.value.left+r*d,f=typeof o.intensity>"u"?100:Math.round(o.intensity*100),N=o.color?o.color:o.value>=0?a.setOpacity(t.value.style.bars.colors.positive,f):a.setOpacity(t.value.style.bars.colors.negative,f),V=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,z=o.color?`url(#gradient_datapoint_${r}_${v.value})`:o.value>=0?`url(#gradient_positive_${r}_${v.value})`:`url(#gradient_negative_${r}_${v.value})`,D=m+p/2;return{...o,color:N,gradient:z,height:s,intensity:f,proportion:l,stroke:V,textAnchor:D,trapX:S,unitWidth:d,width:p,x:m,y:g}})),n=e.ref(null);function $(o,r){B("selectDatapoint",{datapoint:o,index:r})}const L=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,r)=>(e.openBlock(),e.createElementBlock("div",{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:${t.value.style.backgroundColor};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",A,"- "+e.toDisplayString(u.value[n.value].timeLabel||"")+" "+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,u.value[n.value].value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:u.value[n.value].value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:u.value[n.value],seriesIndex:n.value})),1)):e.createCommentVNode("",!0),![void 0,null].includes(n.value)&&![null,void 0].includes(u.value[n.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",H,"("+e.toDisplayString(u.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),h.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:{overflow:"visible"}},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.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,U),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.positive,l.intensity)},null,8,W)],8,I))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.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,P),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.negative,l.intensity)},null,8,G)],8,j))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.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,X),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(l.color,l.intensity)},null,8,Y)],8,T))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.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,J))),256))])):(e.openBlock(),e.createElementBlock("g",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createBlock(F._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(u.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:u.value[n.value],seriesIndex:n.value})),9,Q))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.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,Z)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:c.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,ee)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:c.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:()=>$(l,s)},null,40,te)]))),256))],8,q)):e.createCommentVNode("",!0),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(M.default,{key:2,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},oe=O._export_sfc(le,[["__scopeId","data-v-7e016c13"]]);exports.default=oe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-CPFtA_2a.cjs"),_=require("./useNestedProp-BUMZMzjx.cjs"),F=require("./Shape-C_bea-fx.cjs"),M=require("./vue-ui-skeleton-C9gsw9XJ.cjs"),O=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A={key:0},H={key:1},q=["xmlns","viewBox"],I=["id"],U=["stop-color"],W=["stop-color"],j=["id"],P=["stop-color"],G=["stop-color"],T=["id"],X=["stop-color"],Y=["stop-color"],R={key:0},J=["x","y","height","width","fill","stroke","stroke-width","rx"],K={key:1},Q=["x","y","font-size","font-weight","fill"],Z=["x","y","font-size","fill"],ee=["x","y","font-size","fill"],te=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],le={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(x,{emit:B}){const i=x;e.useCssVars(o=>({"7d1c0c30":L.value}));const{vue_ui_sparkhistogram:E}=a.useConfig(),h=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{k()});function k(){a.objectIsEmpty(i.dataset)?a.error({componentName:"VueUiSparkHistogram",type:"dataset"}):i.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});function b(){const o=_.useNestedProp({userConfig:i.config,defaultConfig:E});return o.theme?{..._.useNestedProp({userConfig:a.themes.vue_ui_sparkhistogram[o.theme]||i.config,defaultConfig:o})}:o}e.watch(()=>i.config,o=>{t.value=b(),k()},{deep:!0});const c=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}}),w=e.computed(()=>Math.max(...i.dataset.map(o=>Math.abs(o.value||0))));function C(o){return Math.abs(o)/w.value}const u=e.computed(()=>i.dataset.map((o,r)=>{const l=C(o.value||0),s=c.value.drawingHeight*l,d=c.value.drawingWidth/i.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,g=c.value.centerY-s/2,m=c.value.left+(y/2+r*d),S=c.value.left+r*d,f=typeof o.intensity>"u"?100:Math.round(o.intensity*100),N=o.color?o.color:o.value>=0?a.setOpacity(t.value.style.bars.colors.positive,f):a.setOpacity(t.value.style.bars.colors.negative,f),V=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,z=o.color?`url(#gradient_datapoint_${r}_${v.value})`:o.value>=0?`url(#gradient_positive_${r}_${v.value})`:`url(#gradient_negative_${r}_${v.value})`,D=m+p/2;return{...o,color:N,gradient:z,height:s,intensity:f,proportion:l,stroke:V,textAnchor:D,trapX:S,unitWidth:d,width:p,x:m,y:g}})),n=e.ref(null);function $(o,r){B("selectDatapoint",{datapoint:o,index:r})}const L=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,r)=>(e.openBlock(),e.createElementBlock("div",{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:${t.value.style.backgroundColor};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",A,"- "+e.toDisplayString(u.value[n.value].timeLabel||"")+" "+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,u.value[n.value].value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:u.value[n.value].value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:u.value[n.value],seriesIndex:n.value})),1)):e.createCommentVNode("",!0),![void 0,null].includes(n.value)&&![null,void 0].includes(u.value[n.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",H,"("+e.toDisplayString(u.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),h.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:{overflow:"visible"}},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.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,U),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.positive,l.intensity)},null,8,W)],8,I))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.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,P),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.negative,l.intensity)},null,8,G)],8,j))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.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,X),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(l.color,l.intensity)},null,8,Y)],8,T))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.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,J))),256))])):(e.openBlock(),e.createElementBlock("g",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createBlock(F._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(u.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:u.value[n.value],seriesIndex:n.value})),9,Q))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.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,Z)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:c.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,ee)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:c.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:()=>$(l,s)},null,40,te)]))),256))],8,q)):e.createCommentVNode("",!0),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(M.default,{key:2,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},oe=O._export_sfc(le,[["__scopeId","data-v-7e016c13"]]);exports.default=oe;
@@ -1,7 +1,7 @@
1
1
  import { computed as v, ref as m, watch as E, onMounted as ue, openBlock as n, createElementBlock as i, normalizeStyle as N, renderSlot as O, normalizeProps as se, guardReactiveProps as oe, createElementVNode as f, toDisplayString as j, createCommentVNode as y, unref as c, Fragment as W, renderList as P, createBlock as ne } from "vue";
2
- import { u as re, c as ie, t as de, o as ve, e as R, g as ce, w as C, V as he, W as ye, X as fe, s as I, Q as U, i as X, f as Z } from "./index-DP8dqFNd.js";
3
- import { u as q } from "./useNestedProp-B-oZxD4x.js";
4
- import pe from "./vue-ui-skeleton-B30ZhUV7.js";
2
+ import { u as re, c as ie, t as de, o as ve, e as R, g as ce, w as C, V as he, W as ye, X as fe, s as I, Q as U, i as X, f as Z } from "./index-Dzi9DWc6.js";
3
+ import { u as q } from "./useNestedProp-BSY0Tspx.js";
4
+ import pe from "./vue-ui-skeleton-BRcmM6et.js";
5
5
  import { t as ge, u as ke } from "./useResponsive-NZB-WLRF.js";
6
6
  import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
7
  const be = ["id"], _e = ["xmlns", "viewBox"], xe = ["id"], we = ["stop-color"], Le = ["stop-color"], $e = ["id"], Ne = ["stop-color"], Ce = ["stop-color"], Ie = ["id"], Me = ["stop-color"], Ve = ["stop-color"], ze = { key: 0 }, Se = ["d", "fill"], We = ["d", "fill"], Pe = ["d", "stroke", "stroke-width"], Ae = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], De = ["x", "y", "width", "height", "fill", "rx"], Fe = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ge = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], Te = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Be = ["x", "y", "font-size", "font-weight", "fill"], Ee = ["x", "y", "height", "width", "onMouseenter", "onClick"], Oe = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-CzjC8LfY.cjs"),I=require("./useNestedProp-CY7DebVH.cjs"),q=require("./vue-ui-skeleton-CwqzJlQf.cjs"),S=require("./useResponsive-B3TrDDIG.cjs"),G=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["id"],R=["xmlns","viewBox"],H=["id"],U=["stop-color"],X=["stop-color"],Z=["id"],Y=["stop-color"],J=["stop-color"],K=["id"],Q=["stop-color"],ee=["stop-color"],te={key:0},le=["d","fill"],ae=["d","fill"],oe=["d","stroke","stroke-width"],ne=["x1","x2","y1","y2","stroke","stroke-width"],ue=["x","y","width","height","fill","rx"],re=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],se=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ie=["cx","cy","r","fill","stroke","stroke-width"],de=["x","y","font-size","font-weight","fill"],ce=["x","y","height","width","onMouseenter","onClick"],ve={__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}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:_}){const i=f,{vue_ui_sparkline:M}=u.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(u.createUid()),x=e.ref(null),B=e.ref(null),t=e.computed({get:()=>L(),set:l=>l});function L(){const l=I.useNestedProp({userConfig:i.config,defaultConfig:M});return l.theme?{...I.useNestedProp({userConfig:u.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}e.watch(()=>i.config,l=>{t.value=L(),V(),o.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>i.dataset,l=>{p.value=i.dataset.map(n=>({...n,value:[void 0].includes(n.value)?null:n.value}))},{deep:!0});const p=e.ref(z());function z(){return i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value})}const C=e.ref(null);e.onMounted(()=>{if(V(),t.value.style.animation.show&&i.dataset.length>1){let a=function(){n<i.dataset.length?(p.value.push(i.dataset[n]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=i.dataset,n+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let n=0;a()}});function V(){if(u.objectIsEmpty(i.dataset)?u.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,n)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{u.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:n})})}),t.value.responsive){const l=S.throttle(()=>{const{width:n,height:a}=S.useResponsive({chart:x.value,title:t.value.style.title.show&&i.showInfo?B.value:null});o.value.width=n,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*n,o.value.padding=.06*n});C.value=new ResizeObserver(l),C.value.observe(x.value.parentNode)}}const o=e.ref({height:80,width:500,chartWidth:t.value.style.chartWidth,padding:30}),P=e.ref(6),r=e.computed(()=>({top:12,left:0,right:o.value.width,bottom:o.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?o.value.width-o.value.chartWidth:o.value.padding,width:i.showInfo&&t.value.style.dataLabel.show?o.value.chartWidth:o.value.width-o.value.padding,height:o.value.height-12})),w=e.computed(()=>Math.min(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),D=e.computed(()=>Math.max(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),m=e.computed(()=>{const l=w.value>=0?0:w.value;return Math.abs(l)}),W=e.computed(()=>D.value+m.value+P.value),b=e.computed(()=>r.value.bottom-r.value.height*N(m.value));function N(l){return l/W.value}const h=e.computed(()=>i.dataset.length-1),s=e.computed(()=>p.value.map((l,n)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+m.value,toMax:N(a+m.value),x:r.value.start+n*(r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)),y:r.value.bottom-r.value.height*N(a+m.value),id:`plot_${v.value}_${n}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?u.shiftHue(t.value.style.line.color,.05*(1-n/h.value)):t.value.style.line.color,width:r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)}})),A=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},n={x:s.value[s.value.length-1].x,y:o.value.height-6},a=[];return s.value.forEach(d=>{a.push(`${d.x},${d.y} `)}),[l.x,l.y,...a,n.x,n.y].toString()}),c=e.ref(void 0);function O(l,n){c.value=l,_("hoverIndex",{index:n})}function F(){c.value=void 0,_("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(g.value){const l=s.value.map(a=>a.absoluteValue),n=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:n,average:n/s.value.length,median:u.calcMedian(l),trend:u.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:$})=>({x:a,y:d,value:$}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),E=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?y.value.latest:t.value.style.dataLabel.valueType==="sum"?y.value.sum:t.value.style.dataLabel.valueType==="average"?y.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function T(l,n){_("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:x,class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily}`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:y.value.latest,sum:y.value.sum,average:y.value.average,median:y.value.median,trend:y.value.trend})),void 0,!0),t.value.style.title.show&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:B,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(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.setOpacity)(e.unref(u.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,U),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,X)],8,H),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,J)],8,Z),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,Q),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,ee)],8,K)]),t.value.style.area.show&&!k.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",te,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${r.value.bottom} ${e.unref(u.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${r.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,le)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${A.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ae))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(u.createSmoothPath)(s.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,oe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[d<s.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:s.value[d+1].x,y1:a.y,y2:s.value[d+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,ne)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:b.value,width:a.width,height:Math.abs(a.y-b.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${v.value})`:`url(#sparkline_bar_gradient_neg_${v.value})`,rx:t.value.style.bar.borderRadius},null,8,ue)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||f.selectedIndex===d)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:r.value.top-6,y2:r.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,re)):e.createCommentVNode("",!0)]))),256)),w.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.start,x2:r.value.start+r.value.width-16,y1:b.value,y2:b.value,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,se)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||f.selectedIndex===d?(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,ie)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:r.value.width+12+t.value.style.dataLabel.offsetX,y:o.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(c.value?e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:c.value}):e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,E.value,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:E.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,de)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1))/2,y:r.value.top-6,height:r.value.height+6,width:r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1),fill:"transparent",onMouseenter:$=>O(a,d),onMouseleave:F,onClick:()=>T(a,d)},null,40,ce))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,R)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(q.default,{key:2,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,j))}},he=G._export_sfc(ve,[["__scopeId","data-v-27d92a0d"]]);exports.default=he;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-CPFtA_2a.cjs"),I=require("./useNestedProp-BUMZMzjx.cjs"),q=require("./vue-ui-skeleton-C9gsw9XJ.cjs"),S=require("./useResponsive-B3TrDDIG.cjs"),G=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["id"],R=["xmlns","viewBox"],H=["id"],U=["stop-color"],X=["stop-color"],Z=["id"],Y=["stop-color"],J=["stop-color"],K=["id"],Q=["stop-color"],ee=["stop-color"],te={key:0},le=["d","fill"],ae=["d","fill"],oe=["d","stroke","stroke-width"],ne=["x1","x2","y1","y2","stroke","stroke-width"],ue=["x","y","width","height","fill","rx"],re=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],se=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ie=["cx","cy","r","fill","stroke","stroke-width"],de=["x","y","font-size","font-weight","fill"],ce=["x","y","height","width","onMouseenter","onClick"],ve={__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}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:_}){const i=f,{vue_ui_sparkline:M}=u.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(u.createUid()),x=e.ref(null),B=e.ref(null),t=e.computed({get:()=>L(),set:l=>l});function L(){const l=I.useNestedProp({userConfig:i.config,defaultConfig:M});return l.theme?{...I.useNestedProp({userConfig:u.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}e.watch(()=>i.config,l=>{t.value=L(),V(),o.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>i.dataset,l=>{p.value=i.dataset.map(n=>({...n,value:[void 0].includes(n.value)?null:n.value}))},{deep:!0});const p=e.ref(z());function z(){return i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value})}const C=e.ref(null);e.onMounted(()=>{if(V(),t.value.style.animation.show&&i.dataset.length>1){let a=function(){n<i.dataset.length?(p.value.push(i.dataset[n]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=i.dataset,n+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let n=0;a()}});function V(){if(u.objectIsEmpty(i.dataset)?u.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,n)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{u.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:n})})}),t.value.responsive){const l=S.throttle(()=>{const{width:n,height:a}=S.useResponsive({chart:x.value,title:t.value.style.title.show&&i.showInfo?B.value:null});o.value.width=n,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*n,o.value.padding=.06*n});C.value=new ResizeObserver(l),C.value.observe(x.value.parentNode)}}const o=e.ref({height:80,width:500,chartWidth:t.value.style.chartWidth,padding:30}),P=e.ref(6),r=e.computed(()=>({top:12,left:0,right:o.value.width,bottom:o.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?o.value.width-o.value.chartWidth:o.value.padding,width:i.showInfo&&t.value.style.dataLabel.show?o.value.chartWidth:o.value.width-o.value.padding,height:o.value.height-12})),w=e.computed(()=>Math.min(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),D=e.computed(()=>Math.max(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),m=e.computed(()=>{const l=w.value>=0?0:w.value;return Math.abs(l)}),W=e.computed(()=>D.value+m.value+P.value),b=e.computed(()=>r.value.bottom-r.value.height*N(m.value));function N(l){return l/W.value}const h=e.computed(()=>i.dataset.length-1),s=e.computed(()=>p.value.map((l,n)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+m.value,toMax:N(a+m.value),x:r.value.start+n*(r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)),y:r.value.bottom-r.value.height*N(a+m.value),id:`plot_${v.value}_${n}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?u.shiftHue(t.value.style.line.color,.05*(1-n/h.value)):t.value.style.line.color,width:r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)}})),A=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},n={x:s.value[s.value.length-1].x,y:o.value.height-6},a=[];return s.value.forEach(d=>{a.push(`${d.x},${d.y} `)}),[l.x,l.y,...a,n.x,n.y].toString()}),c=e.ref(void 0);function O(l,n){c.value=l,_("hoverIndex",{index:n})}function F(){c.value=void 0,_("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(g.value){const l=s.value.map(a=>a.absoluteValue),n=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:n,average:n/s.value.length,median:u.calcMedian(l),trend:u.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:$})=>({x:a,y:d,value:$}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),E=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?y.value.latest:t.value.style.dataLabel.valueType==="sum"?y.value.sum:t.value.style.dataLabel.valueType==="average"?y.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function T(l,n){_("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:x,class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily}`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:y.value.latest,sum:y.value.sum,average:y.value.average,median:y.value.median,trend:y.value.trend})),void 0,!0),t.value.style.title.show&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:B,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(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.setOpacity)(e.unref(u.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,U),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,X)],8,H),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,J)],8,Z),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,Q),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,ee)],8,K)]),t.value.style.area.show&&!k.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",te,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${r.value.bottom} ${e.unref(u.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${r.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,le)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${A.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ae))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(u.createSmoothPath)(s.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,oe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[d<s.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:s.value[d+1].x,y1:a.y,y2:s.value[d+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,ne)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:b.value,width:a.width,height:Math.abs(a.y-b.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${v.value})`:`url(#sparkline_bar_gradient_neg_${v.value})`,rx:t.value.style.bar.borderRadius},null,8,ue)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||f.selectedIndex===d)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:r.value.top-6,y2:r.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,re)):e.createCommentVNode("",!0)]))),256)),w.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.start,x2:r.value.start+r.value.width-16,y1:b.value,y2:b.value,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,se)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||f.selectedIndex===d?(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,ie)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:r.value.width+12+t.value.style.dataLabel.offsetX,y:o.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(c.value?e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:c.value}):e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,E.value,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:E.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,de)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1))/2,y:r.value.top-6,height:r.value.height+6,width:r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1),fill:"transparent",onMouseenter:$=>O(a,d),onMouseleave:F,onClick:()=>T(a,d)},null,40,ce))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,R)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(q.default,{key:2,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,j))}},he=G._export_sfc(ve,[["__scopeId","data-v-27d92a0d"]]);exports.default=he;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CzjC8LfY.cjs"),B=require("./useNestedProp-CY7DebVH.cjs"),V=require("./vue-ui-skeleton-CwqzJlQf.cjs"),z=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),D=["xmlns","viewBox"],P=["id"],L=["stop-color"],A=["stop-color"],F=["stop-color"],U={id:"stackPill",clipPathUnits:"objectBoundingBox"},j=["fill"],q={"clip-path":"url(#stackPill)"},T=["height","width","fill"],H=["onClick","x","width","height","fill","stroke"],I=["onClick"],O={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},M=["height","width"],G=["fill"],X={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(S,{emit:$}){const u=S,{vue_ui_sparkstackbar:E}=o.useConfig(),k=e.computed(()=>!!u.dataset&&u.dataset.length),_=e.ref(o.createUid()),t=e.computed({get:()=>b(),set:l=>l});function b(){const l=B.useNestedProp({userConfig:u.config,defaultConfig:E});return l.theme?{...B.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>u.config,l=>{t.value=b(),C()},{deep:!0}),e.watch(()=>u.dataset,l=>{d.value=u.dataset.map((n,a)=>({...n,color:n.color?o.convertColorToHex(n.color):p.value[a]||o.palette[a]||o.palette[a%o.palette.length]}))},{deep:!0});const p=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),d=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?o.convertColorToHex(l.color):p.value[n]||o.palette[n]||o.palette[n%o.palette.length]}))),m=e.ref(!0);e.onMounted(()=>{if(C(),t.value.style.animation.show){let h=function(){r+=a/l,r<a?(d.value=d.value.map((s,c)=>({...s,value:s.value+=n[c],color:s.color?o.convertColorToHex(s.color):p.value[c]||o.palette[c]||o.palette[c%o.palette.length]})),requestAnimationFrame(h)):(m.value=!1,d.value=u.dataset.map((s,c)=>({...s,value:s.value||0,color:s.color?o.convertColorToHex(s.color):p.value[c]||o.palette[c]||o.palette[c%o.palette.length],id:o.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,c)=>s.value/l),a=u.dataset.map(s=>s.value||0).reduce((s,c)=>s+c,0);let r=0;m.value=!0,h()}});function C(){o.objectIsEmpty(u.dataset)?o.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:a,index:n})})})}const v=e.ref({width:500,height:16}),i=e.ref([]),g=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!i.value.includes(n)).reduce((l,n)=>l+n,0)),x=e.computed(()=>d.value.map((l,n)=>({...l,value:l.value||0,proportion:(l.value||0)/g.value,width:(l.value||0)/g.value*v.value.width,proportionLabel:o.dataLabel({v:(l.value||0)/g.value*100,s:"%",r:t.value.style.legend.percentage.rounding})}))),y=e.computed(()=>x.value.filter((l,n)=>!i.value.includes(n)));function N(l){i.value.includes(l)?i.value=i.value.filter(n=>n!==l):i.value.length<d.value.length-1&&i.value.push(l)}const f=e.computed(()=>{let l=0;const n=[];for(let a=0;a<y.value.length;a+=1)n.push({...y.value[a],start:l}),l+=y.value[a].width;return n});function w(l,n){$("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{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:${t.value.style.backgroundColor};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.toDisplayString(t.value.style.title.text),5),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),k.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),width:"100%",viewBox:`0 0 ${v.value.width} ${v.value.height}`},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${_.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,L),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,A),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,F)],8,P))),128)),e.createElementVNode("clipPath",U,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,j)])]),e.createElementVNode("g",q,[e.createElementVNode("rect",{x:0,y:0,height:v.value.height,width:f.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!m.value})},null,10,T),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,onClick:()=>w(a,r),x:a.start,y:0,width:a.width,height:v.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${_.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!m.value})},null,10,H))),128))])],8,D)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.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:${t.value.style.backgroundColor};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(x.value,(a,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":i.value.includes(r)}),onClick:h=>{N(r),w(a,r)}},[e.createElementVNode("div",O,[(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:a.color},null,8,G)],8,M)),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(a.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(i.value.includes(r)?" - ":a.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(o.applyDataLabel)(t.value.style.legend.value.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.legend.value.prefix,v:a.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:a,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,I))),256))],4)):e.createCommentVNode("",!0)],4))}},J=z._export_sfc(X,[["__scopeId","data-v-9ddcca97"]]);exports.default=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CPFtA_2a.cjs"),B=require("./useNestedProp-BUMZMzjx.cjs"),V=require("./vue-ui-skeleton-C9gsw9XJ.cjs"),z=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),D=["xmlns","viewBox"],P=["id"],L=["stop-color"],A=["stop-color"],F=["stop-color"],U={id:"stackPill",clipPathUnits:"objectBoundingBox"},j=["fill"],q={"clip-path":"url(#stackPill)"},T=["height","width","fill"],H=["onClick","x","width","height","fill","stroke"],I=["onClick"],O={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},M=["height","width"],G=["fill"],X={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(S,{emit:$}){const u=S,{vue_ui_sparkstackbar:E}=o.useConfig(),k=e.computed(()=>!!u.dataset&&u.dataset.length),_=e.ref(o.createUid()),t=e.computed({get:()=>b(),set:l=>l});function b(){const l=B.useNestedProp({userConfig:u.config,defaultConfig:E});return l.theme?{...B.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>u.config,l=>{t.value=b(),C()},{deep:!0}),e.watch(()=>u.dataset,l=>{d.value=u.dataset.map((n,a)=>({...n,color:n.color?o.convertColorToHex(n.color):p.value[a]||o.palette[a]||o.palette[a%o.palette.length]}))},{deep:!0});const p=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),d=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?o.convertColorToHex(l.color):p.value[n]||o.palette[n]||o.palette[n%o.palette.length]}))),m=e.ref(!0);e.onMounted(()=>{if(C(),t.value.style.animation.show){let h=function(){r+=a/l,r<a?(d.value=d.value.map((s,c)=>({...s,value:s.value+=n[c],color:s.color?o.convertColorToHex(s.color):p.value[c]||o.palette[c]||o.palette[c%o.palette.length]})),requestAnimationFrame(h)):(m.value=!1,d.value=u.dataset.map((s,c)=>({...s,value:s.value||0,color:s.color?o.convertColorToHex(s.color):p.value[c]||o.palette[c]||o.palette[c%o.palette.length],id:o.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,c)=>s.value/l),a=u.dataset.map(s=>s.value||0).reduce((s,c)=>s+c,0);let r=0;m.value=!0,h()}});function C(){o.objectIsEmpty(u.dataset)?o.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:a,index:n})})})}const v=e.ref({width:500,height:16}),i=e.ref([]),g=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!i.value.includes(n)).reduce((l,n)=>l+n,0)),x=e.computed(()=>d.value.map((l,n)=>({...l,value:l.value||0,proportion:(l.value||0)/g.value,width:(l.value||0)/g.value*v.value.width,proportionLabel:o.dataLabel({v:(l.value||0)/g.value*100,s:"%",r:t.value.style.legend.percentage.rounding})}))),y=e.computed(()=>x.value.filter((l,n)=>!i.value.includes(n)));function N(l){i.value.includes(l)?i.value=i.value.filter(n=>n!==l):i.value.length<d.value.length-1&&i.value.push(l)}const f=e.computed(()=>{let l=0;const n=[];for(let a=0;a<y.value.length;a+=1)n.push({...y.value[a],start:l}),l+=y.value[a].width;return n});function w(l,n){$("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{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:${t.value.style.backgroundColor};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.toDisplayString(t.value.style.title.text),5),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),k.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),width:"100%",viewBox:`0 0 ${v.value.width} ${v.value.height}`},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${_.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,L),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,A),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,F)],8,P))),128)),e.createElementVNode("clipPath",U,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,j)])]),e.createElementVNode("g",q,[e.createElementVNode("rect",{x:0,y:0,height:v.value.height,width:f.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!m.value})},null,10,T),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,onClick:()=>w(a,r),x:a.start,y:0,width:a.width,height:v.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${_.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!m.value})},null,10,H))),128))])],8,D)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.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:${t.value.style.backgroundColor};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(x.value,(a,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":i.value.includes(r)}),onClick:h=>{N(r),w(a,r)}},[e.createElementVNode("div",O,[(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:a.color},null,8,G)],8,M)),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(a.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(i.value.includes(r)?" - ":a.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(o.applyDataLabel)(t.value.style.legend.value.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.legend.value.prefix,v:a.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:a,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,I))),256))],4)):e.createCommentVNode("",!0)],4))}},J=z._export_sfc(X,[["__scopeId","data-v-9ddcca97"]]);exports.default=J;
@@ -1,7 +1,7 @@
1
1
  import { computed as p, ref as m, watch as I, onMounted as X, openBlock as n, createElementBlock as u, normalizeStyle as g, createElementVNode as c, toDisplayString as k, createCommentVNode as h, unref as _, Fragment as z, renderList as A, normalizeClass as P, createBlock as J } from "vue";
2
- import { u as K, c as U, t as Q, a as R, p as i, d as w, b as W, o as Y, e as O, g as Z, f as V, X as ee, s as te, w as le, i as ae } from "./index-DP8dqFNd.js";
3
- import { u as G } from "./useNestedProp-B-oZxD4x.js";
4
- import oe from "./vue-ui-skeleton-B30ZhUV7.js";
2
+ import { u as K, c as U, t as Q, a as R, p as i, d as w, b as W, o as Y, e as O, g as Z, f as V, X as ee, s as te, w as le, i as ae } from "./index-Dzi9DWc6.js";
3
+ import { u as G } from "./useNestedProp-BSY0Tspx.js";
4
+ import oe from "./vue-ui-skeleton-BRcmM6et.js";
5
5
  import { _ as se } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  const ne = ["xmlns", "viewBox"], re = ["id"], ue = ["stop-color"], ie = ["stop-color"], ce = ["stop-color"], de = {
7
7
  id: "stackPill",
@@ -1,15 +1,15 @@
1
1
  import { computed as p, ref as b, onMounted as He, watch as Be, openBlock as s, createElementBlock as u, normalizeClass as ve, normalizeStyle as D, renderSlot as C, createVNode as he, createCommentVNode as v, createBlock as Q, unref as _, createSlots as ft, withCtx as z, normalizeProps as W, guardReactiveProps as X, Fragment as h, renderList as f, createElementVNode as E, toDisplayString as S, createTextVNode as mt } from "vue";
2
- import { u as pt, c as We, t as xt, a as kt, p as oe, L as Xe, b as wt, o as Ct, e as Ue, g as _t, d as zt, a2 as se, _ as Ye, C as Ge, X as Lt, l as St, F as Je, f as H, x as qe, i as Ze, y as $t, q as Mt, r as Tt } from "./index-DP8dqFNd.js";
3
- import { u as Ke } from "./useNestedProp-B-oZxD4x.js";
2
+ import { u as pt, c as We, t as xt, a as kt, p as oe, L as Xe, b as wt, o as Ct, e as Ue, g as _t, d as zt, a2 as se, _ as Ye, C as Ge, X as Lt, l as St, F as Je, f as H, x as qe, i as Ze, y as $t, q as Mt, r as Tt } from "./index-Dzi9DWc6.js";
3
+ import { u as Ke } from "./useNestedProp-BSY0Tspx.js";
4
4
  import { t as Nt, u as Ot } from "./useResponsive-NZB-WLRF.js";
5
- import { u as Pt, U as Rt } from "./usePrinter-DiuHo4LO.js";
6
- import { S as It } from "./Slicer-DzJZ4axa.js";
7
- import { _ as Ft } from "./Tooltip-Dk-cimhQ.js";
8
- import { _ as Vt } from "./Title-Bx-VO3md.js";
9
- import { L as At } from "./Legend-BLXcdrri.js";
10
- import Dt from "./vue-ui-accordion-Dl8zkZPk.js";
11
- import { D as Et } from "./DataTable-y1lX5jVj.js";
12
- import Ht from "./vue-ui-skeleton-B30ZhUV7.js";
5
+ import { u as Pt, U as Rt } from "./usePrinter-DGeHPbZW.js";
6
+ import { S as It } from "./Slicer-BCPRbaD9.js";
7
+ import { _ as Ft } from "./Tooltip-BHnf4YJR.js";
8
+ import { _ as Vt } from "./Title-CZGFVTAL.js";
9
+ import { L as At } from "./Legend-DHn7PpRX.js";
10
+ import Dt from "./vue-ui-accordion-C4FB0Uy9.js";
11
+ import { D as Et } from "./DataTable-CegPJkZh.js";
12
+ import Ht from "./vue-ui-skeleton-BRcmM6et.js";
13
13
  import { _ as Bt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
14
  const Wt = ["id"], Xt = ["xmlns", "viewBox"], Ut = { key: 0 }, Yt = ["id"], Gt = ["stop-color"], Jt = ["stop-color"], qt = ["stop-color"], Zt = ["x1", "x2", "y1", "y2", "stroke"], Kt = ["x1", "x2", "y1", "y2", "stroke"], Qt = ["x1", "x2", "y1", "y2", "stroke"], jt = ["x1", "x2", "y1", "y2", "stroke"], ea = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], ta = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], aa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], la = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ra = ["x", "y", "font-size", "fill", "font-weight"], oa = ["transform", "font-size", "fill", "font-weight"], sa = ["x", "y", "font-size", "fill", "font-weight"], ia = { key: 0 }, ua = ["x", "y", "font-size", "font-weight", "fill"], na = ["x", "y", "font-size", "fill", "font-weight"], ca = { key: 0 }, va = ["x", "y", "font-size", "font-weight", "fill"], ha = ["x1", "x2", "y1", "y2", "stroke"], da = ["x", "y", "font-size", "font-weight", "fill"], ya = ["x1", "x2", "y1", "y2", "stroke"], ga = ["font-size", "font-weight", "fill", "text-anchor", "transform"], ba = ["text-anchor", "font-size", "font-weight", "fill", "transform"], fa = ["font-size", "font-weight", "fill", "x", "y"], ma = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], pa = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], xa = {
15
15
  key: 3,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-CzjC8LfY.cjs"),we=require("./useNestedProp-CY7DebVH.cjs"),Ce=require("./useResponsive-B3TrDDIG.cjs"),Be=require("./usePrinter-DiLM6jav.cjs"),We=require("./Slicer-CZJXKSeE.cjs"),Ue=require("./Tooltip-rmhZhv96.cjs"),Xe=require("./Title-BSpa3uge.cjs"),Ye=require("./Legend-CGGD8NhP.cjs"),Ge=require("./vue-ui-accordion-DpI7fTKZ.cjs"),Je=require("./DataTable-C5TOiC61.cjs"),Ze=require("./vue-ui-skeleton-CwqzJlQf.cjs"),Ke=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Qe=["id"],je=["xmlns","viewBox"],et={key:0},tt=["id"],at=["stop-color"],lt=["stop-color"],ot=["stop-color"],rt=["x1","x2","y1","y2","stroke"],st=["x1","x2","y1","y2","stroke"],nt=["x1","x2","y1","y2","stroke"],it=["x1","x2","y1","y2","stroke"],ut=["x","y","height","rx","width","fill","stroke","stroke-width"],ct=["x","y","width","rx","height","fill","stroke","stroke-width"],dt=["x1","x2","y1","y2","stroke","stroke-width"],vt=["x1","x2","y1","y2","stroke","stroke-width"],ht=["x","y","font-size","fill","font-weight"],gt=["transform","font-size","fill","font-weight"],yt=["x","y","font-size","fill","font-weight"],mt={key:0},bt=["x","y","font-size","font-weight","fill"],pt=["x","y","font-size","fill","font-weight"],ft={key:0},kt=["x","y","font-size","font-weight","fill"],xt=["x1","x2","y1","y2","stroke"],wt=["x","y","font-size","font-weight","fill"],Ct=["x1","x2","y1","y2","stroke"],Bt=["font-size","font-weight","fill","text-anchor","transform"],Lt=["text-anchor","font-size","font-weight","fill","transform"],St=["font-size","font-weight","fill","x","y"],zt=["x","y","width","height","onClick","onMouseenter","fill"],_t=["x","y","width","height","onClick","onMouseenter","fill"],Nt={key:3,class:"vue-data-ui-watermark"},Et=["onClick"],Mt=["innerHTML"],$t={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(G,{expose:Le,emit:J}){const y=G,{vue_ui_stackbar:Se}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),W=e.ref(c.createUid()),O=e.ref(!1),Z=e.ref(null),U=e.ref(""),p=e.ref([]),K=e.ref(0),Q=e.ref(null),j=e.ref(null),ee=e.ref(null),te=e.ref(0),X=e.ref(!1),$=e.ref(null),T=e.ref(!1),ze=e.ref(0),_e=e.ref(0),Ne=e.ref(0);e.onMounted(()=>{Y()});const t=e.computed({get:()=>ae(),set:l=>l});function ae(){const l=we.useNestedProp({userConfig:y.config,defaultConfig:Se});let r={};return l.theme?r={...we.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||y.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=y.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=y.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,r}e.watch(()=>y.config,l=>{t.value=ae(),Y(),ze.value+=1,_e.value+=1,Ne.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{ue()},{deep:!0});const b=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:le,isImaging:oe,generatePdf:re,generateImage:se}=Be.usePrinter({elementId:`stackbar_${W.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),D=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}}),Ee=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),ne=e.ref(null),ie=e.ref(null);e.onMounted(()=>{Y()});function Y(){if(c.objectIsEmpty(y.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):y.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{E.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{T.value=!0},10),t.value.responsive){const l=Ce.throttle(()=>{T.value=!1;const{width:r,height:a}=Ce.useResponsive({chart:M.value,title:t.value.style.chart.title.text?Q.value:null,legend:t.value.style.chart.legend.show?j.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?ee.value:null});D.value.width=r,D.value.height=a,clearTimeout(ie.value),ie.value=setTimeout(()=>{T.value=!0},10)});ne.value=new ResizeObserver(l),ne.value.observe(M.value.parentNode)}}const s=e.computed(()=>{const{height:l,width:r}=D.value,{right:a}=D.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,m=t.value.style.chart.padding.left,S=r-m-r*a,z=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:m,width:S,height:z<0?0:z}}),B=e.computed(()=>y.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Ee.value[r]||c.palette[r]||c.palette[r%c.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:c.createUid(),color:a}})),L=e.computed(()=>Math.max(...B.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...y.dataset.map(l=>l.series.length))});function ue(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},te.value+=1}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),V=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id))).slice(u.value.start,u.value.end)),Me=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),I=e.computed(()=>{const l=B.value.filter(r=>!p.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.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(...I.value.positive),r=Math.min(...I.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)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+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*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),F=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)),g=e.computed(()=>{if(!E.value)return[];let l=Array(L.value).fill(0),r=Array(L.value).fill(0),a=Array(L.value).fill(0),o=Array(L.value).fill(0);const n=Math.max(...I.value.positive)||0,i=Math.min(...I.value.negative),m=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,S=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:z,max:P}=S,_=P+(z>=0?0:Math.abs(z))||1,f=s.value.height,q=s.value.width,ke=w.value[0]?w.value[0].zero:s.value.bottom,xe=w.value[0]?w.value[0].horizontal_zero:s.value.left;return B.value.filter(R=>!p.value.includes(R.id)).map(R=>{const C=R.series.slice(u.value.start,u.value.end),Pe=R.signedSeries.slice(u.value.start,u.value.end),Re=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Oe=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),De=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=f*k,N=ke-x-l[h],l[h]+=x):(x=f*k,N=ke+a[h],a[h]+=Math.abs(x)),N}),Ie=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=q*k,N=xe+r[h],r[h]+=x):(x=q*k,N=xe-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),Ae=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?f*k:f*Math.abs(k)}),He=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?q*k:q*Math.abs(k)}),qe=C.map(v=>Math.abs(v)).reduce((v,h)=>v+h,0);return{...R,proportions:C.map((v,h)=>t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/qe),series:C,signedSeries:Pe,x:Re,y:De,height:Ae,horizontal_width:He,horizontal_y:Oe,horizontal_x:Ie}})}),ce=e.computed(()=>Me.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function A(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function de(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ve(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:F.value[l]})}function he(l){$.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))U.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:m,roundingValue:S,roundingPercentage:z}=t.value.style.chart.tooltip;let P="";F.value[l]&&(P+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${F.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{P+=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-CPFtA_2a.cjs"),we=require("./useNestedProp-BUMZMzjx.cjs"),Ce=require("./useResponsive-B3TrDDIG.cjs"),Be=require("./usePrinter-Ctl6AURH.cjs"),We=require("./Slicer-BY2HfvXm.cjs"),Ue=require("./Tooltip-C1sNTQ1g.cjs"),Xe=require("./Title-CWjHjkKS.cjs"),Ye=require("./Legend-kh9PzvjQ.cjs"),Ge=require("./vue-ui-accordion-DfUmD2e0.cjs"),Je=require("./DataTable-BtdSUfo8.cjs"),Ze=require("./vue-ui-skeleton-C9gsw9XJ.cjs"),Ke=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Qe=["id"],je=["xmlns","viewBox"],et={key:0},tt=["id"],at=["stop-color"],lt=["stop-color"],ot=["stop-color"],rt=["x1","x2","y1","y2","stroke"],st=["x1","x2","y1","y2","stroke"],nt=["x1","x2","y1","y2","stroke"],it=["x1","x2","y1","y2","stroke"],ut=["x","y","height","rx","width","fill","stroke","stroke-width"],ct=["x","y","width","rx","height","fill","stroke","stroke-width"],dt=["x1","x2","y1","y2","stroke","stroke-width"],vt=["x1","x2","y1","y2","stroke","stroke-width"],ht=["x","y","font-size","fill","font-weight"],gt=["transform","font-size","fill","font-weight"],yt=["x","y","font-size","fill","font-weight"],mt={key:0},bt=["x","y","font-size","font-weight","fill"],pt=["x","y","font-size","fill","font-weight"],ft={key:0},kt=["x","y","font-size","font-weight","fill"],xt=["x1","x2","y1","y2","stroke"],wt=["x","y","font-size","font-weight","fill"],Ct=["x1","x2","y1","y2","stroke"],Bt=["font-size","font-weight","fill","text-anchor","transform"],Lt=["text-anchor","font-size","font-weight","fill","transform"],St=["font-size","font-weight","fill","x","y"],zt=["x","y","width","height","onClick","onMouseenter","fill"],_t=["x","y","width","height","onClick","onMouseenter","fill"],Nt={key:3,class:"vue-data-ui-watermark"},Et=["onClick"],Mt=["innerHTML"],$t={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(G,{expose:Le,emit:J}){const y=G,{vue_ui_stackbar:Se}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),W=e.ref(c.createUid()),O=e.ref(!1),Z=e.ref(null),U=e.ref(""),p=e.ref([]),K=e.ref(0),Q=e.ref(null),j=e.ref(null),ee=e.ref(null),te=e.ref(0),X=e.ref(!1),$=e.ref(null),T=e.ref(!1),ze=e.ref(0),_e=e.ref(0),Ne=e.ref(0);e.onMounted(()=>{Y()});const t=e.computed({get:()=>ae(),set:l=>l});function ae(){const l=we.useNestedProp({userConfig:y.config,defaultConfig:Se});let r={};return l.theme?r={...we.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||y.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=y.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=y.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,r}e.watch(()=>y.config,l=>{t.value=ae(),Y(),ze.value+=1,_e.value+=1,Ne.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{ue()},{deep:!0});const b=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:le,isImaging:oe,generatePdf:re,generateImage:se}=Be.usePrinter({elementId:`stackbar_${W.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),D=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}}),Ee=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),ne=e.ref(null),ie=e.ref(null);e.onMounted(()=>{Y()});function Y(){if(c.objectIsEmpty(y.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):y.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{E.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{T.value=!0},10),t.value.responsive){const l=Ce.throttle(()=>{T.value=!1;const{width:r,height:a}=Ce.useResponsive({chart:M.value,title:t.value.style.chart.title.text?Q.value:null,legend:t.value.style.chart.legend.show?j.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?ee.value:null});D.value.width=r,D.value.height=a,clearTimeout(ie.value),ie.value=setTimeout(()=>{T.value=!0},10)});ne.value=new ResizeObserver(l),ne.value.observe(M.value.parentNode)}}const s=e.computed(()=>{const{height:l,width:r}=D.value,{right:a}=D.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,m=t.value.style.chart.padding.left,S=r-m-r*a,z=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:m,width:S,height:z<0?0:z}}),B=e.computed(()=>y.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Ee.value[r]||c.palette[r]||c.palette[r%c.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:c.createUid(),color:a}})),L=e.computed(()=>Math.max(...B.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...y.dataset.map(l=>l.series.length))});function ue(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},te.value+=1}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),V=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id))).slice(u.value.start,u.value.end)),Me=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),I=e.computed(()=>{const l=B.value.filter(r=>!p.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.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(...I.value.positive),r=Math.min(...I.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)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+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*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),F=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)),g=e.computed(()=>{if(!E.value)return[];let l=Array(L.value).fill(0),r=Array(L.value).fill(0),a=Array(L.value).fill(0),o=Array(L.value).fill(0);const n=Math.max(...I.value.positive)||0,i=Math.min(...I.value.negative),m=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,S=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:z,max:P}=S,_=P+(z>=0?0:Math.abs(z))||1,f=s.value.height,q=s.value.width,ke=w.value[0]?w.value[0].zero:s.value.bottom,xe=w.value[0]?w.value[0].horizontal_zero:s.value.left;return B.value.filter(R=>!p.value.includes(R.id)).map(R=>{const C=R.series.slice(u.value.start,u.value.end),Pe=R.signedSeries.slice(u.value.start,u.value.end),Re=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Oe=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),De=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=f*k,N=ke-x-l[h],l[h]+=x):(x=f*k,N=ke+a[h],a[h]+=Math.abs(x)),N}),Ie=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=q*k,N=xe+r[h],r[h]+=x):(x=q*k,N=xe-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),Ae=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?f*k:f*Math.abs(k)}),He=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?q*k:q*Math.abs(k)}),qe=C.map(v=>Math.abs(v)).reduce((v,h)=>v+h,0);return{...R,proportions:C.map((v,h)=>t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/qe),series:C,signedSeries:Pe,x:Re,y:De,height:Ae,horizontal_width:He,horizontal_y:Oe,horizontal_x:Ie}})}),ce=e.computed(()=>Me.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function A(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function de(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ve(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:F.value[l]})}function he(l){$.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))U.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:m,roundingValue:S,roundingPercentage:z}=t.value.style.chart.tooltip;let P="";F.value[l]&&(P+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${F.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{P+=`
2
2
  <div style="display:flex;flex-direction:row;align-items:center;gap:4px">
3
3
  <svg viewBox="0 0 12 12" height="14" width="14"><rect rx="1" x="0" y="0" height="12" width="12" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${f.id})`:f.color}"/></svg>
4
4
  ${f.name}${n||i?":":""} ${n?c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:f.value,s:t.value.style.chart.bars.dataLabels.suffix,r:S}):""} ${_[0]}${i?c.dataLabel({v:isNaN(f.value/o)?0:Math.abs(f.value)/o*100,s:"%",r:z}):""}${_[1]}
@@ -1,14 +1,14 @@
1
1
  import { computed as p, ref as n, watch as ze, onMounted as Ne, onBeforeUnmount as Ae, openBlock as s, createElementBlock as i, normalizeClass as F, normalizeStyle as H, createBlock as P, createCommentVNode as v, unref as h, createSlots as Oe, withCtx as b, renderSlot as m, normalizeProps as R, guardReactiveProps as U, Fragment as g, renderList as C, createElementVNode as x, toDisplayString as T, mergeProps as Fe, createVNode as We, createTextVNode as Ie, nextTick as Me } from "vue";
2
- import { u as De, c as K, t as Ge, a as Ee, p as L, o as Ve, e as Q, g as be, b as He, d as me, v as Re, C as Ue, f as B, X as Be, i as Z, l as Xe, h as je, x as ge, y as Ye, q as Je, r as qe, E as Ke } from "./index-DP8dqFNd.js";
2
+ import { u as De, c as K, t as Ge, a as Ee, p as L, o as Ve, e as Q, g as be, b as He, d as me, v as Re, C as Ue, f as B, X as Be, i as Z, l as Xe, h as je, x as ge, y as Ye, q as Je, r as qe, E as Ke } from "./index-Dzi9DWc6.js";
3
3
  import { t as Qe, u as Ze } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as et } from "./Title-Bx-VO3md.js";
5
- import { u as tt, U as lt } from "./usePrinter-DiuHo4LO.js";
6
- import { _ as at } from "./Tooltip-Dk-cimhQ.js";
7
- import { D as ot } from "./DataTable-y1lX5jVj.js";
8
- import st from "./vue-ui-skeleton-B30ZhUV7.js";
9
- import { _ as rt } from "./Shape-CsoTtJx6.js";
10
- import ut from "./vue-ui-accordion-Dl8zkZPk.js";
11
- import { u as xe } from "./useNestedProp-B-oZxD4x.js";
4
+ import { _ as et } from "./Title-CZGFVTAL.js";
5
+ import { u as tt, U as lt } from "./usePrinter-DGeHPbZW.js";
6
+ import { _ as at } from "./Tooltip-BHnf4YJR.js";
7
+ import { D as ot } from "./DataTable-CegPJkZh.js";
8
+ import st from "./vue-ui-skeleton-BRcmM6et.js";
9
+ import { _ as rt } from "./Shape-BYzJgXyX.js";
10
+ import ut from "./vue-ui-accordion-C4FB0Uy9.js";
11
+ import { u as xe } from "./useNestedProp-BSY0Tspx.js";
12
12
  import { _ as it } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  const nt = ["id"], ct = ["xmlns", "viewBox"], vt = { key: 0 }, ht = { key: 0 }, dt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], pt = { key: 1 }, yt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], ft = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], bt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], mt = ["x", "y", "fill", "font-size"], gt = ["x", "y", "font-size", "fill"], xt = ["fill", "font-size", "transform"], kt = ["fill", "font-size", "x", "y"], Ct = ["x1", "x2", "y1", "y2", "stroke"], wt = ["cx", "cy", "fill"], _t = ["cx", "cy", "fill"], $t = ["id"], Tt = ["stop-color"], Lt = ["stop-color"], St = ["stop-color"], Pt = { key: 0 }, zt = ["x", "y", "font-size", "fill"], Nt = {
14
14
  key: 3,