vue-data-ui 2.4.55 → 2.4.57

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 (156) hide show
  1. package/dist/{Arrow-Lu-rJXGl.cjs → Arrow-BhwhLRcU.cjs} +1 -1
  2. package/dist/{Arrow-D9oPJhO0.js → Arrow-DelnKkT1.js} +1 -1
  3. package/dist/{BaseIcon-mHeKnX4-.js → BaseIcon-9gdEHMWK.js} +1 -1
  4. package/dist/{BaseIcon-DxRKjbz1.cjs → BaseIcon-DujPvdJ_.cjs} +1 -1
  5. package/dist/{DataTable-rMMvio1U.cjs → DataTable-BUflha5V.cjs} +1 -1
  6. package/dist/{DataTable-D8MTezlM.js → DataTable-DgbrnD__.js} +2 -2
  7. package/dist/{Legend-wr5XLSfL.js → Legend-HooNAKB_.js} +1 -1
  8. package/dist/{Legend-Ba34oTdO.cjs → Legend-V3K-4ipN.cjs} +1 -1
  9. package/dist/{PackageVersion-xnKIqody.js → PackageVersion-S3SzpuwC.js} +1 -1
  10. package/dist/{PackageVersion-BJi2ywG9.cjs → PackageVersion-dQYEsTLp.cjs} +1 -1
  11. package/dist/{PenAndPaper-CX6N7FR7.cjs → PenAndPaper-1h87IVla.cjs} +1 -1
  12. package/dist/{PenAndPaper-iek0aH4r.js → PenAndPaper-v846FwcH.js} +3 -3
  13. package/dist/{Shape-B_lWjwmP.js → Shape-D7aacHaz.js} +1 -1
  14. package/dist/{Shape-9v-w5i6N.cjs → Shape-DV5sH0dX.cjs} +1 -1
  15. package/dist/{Slicer--m1nOwbO.cjs → Slicer-BRxR5OYL.cjs} +1 -1
  16. package/dist/{Slicer-Bwg4WzZf.js → Slicer-BXCORSCz.js} +2 -2
  17. package/dist/{Title-BWhYDGb-.cjs → Title-B-EsW0Q2.cjs} +1 -1
  18. package/dist/{Title-BecmraNn.js → Title-DLjHHdyq.js} +1 -1
  19. package/dist/{Tooltip-cPxZzSgr.cjs → Tooltip-B7gYRLGN.cjs} +1 -1
  20. package/dist/{Tooltip-BZYApG0d.js → Tooltip-BDaa-67h.js} +1 -1
  21. package/dist/{index-Dhlyke5j.js → index-CI-N9klv.js} +5 -1
  22. package/dist/index-o6tXRhOr.cjs +9 -0
  23. package/dist/style.css +1 -1
  24. package/dist/types/vue-data-ui.d.cts +3 -0
  25. package/dist/types/vue-data-ui.d.ts +3 -0
  26. package/dist/{useNestedProp-C9KmUVBy.cjs → useNestedProp-D-zaZbSR.cjs} +1 -1
  27. package/dist/{useNestedProp-D9eTQKze.js → useNestedProp-D1eJ0dvv.js} +1 -1
  28. package/dist/{usePrinter-BnBk8gnl.js → usePrinter-CXc8xCKk.js} +1 -1
  29. package/dist/{usePrinter-DpEuGyLP.cjs → usePrinter-H2UFIe6n.cjs} +1 -1
  30. package/dist/{vue-data-ui-CGGZHtx3.cjs → vue-data-ui-CvfX2D1d.cjs} +1 -1
  31. package/dist/{vue-data-ui-aSR5-7gp.js → vue-data-ui-DuXblXhF.js} +60 -60
  32. package/dist/vue-data-ui.cjs +1 -1
  33. package/dist/vue-data-ui.js +1 -1
  34. package/dist/{vue-ui-3d-bar-D9pXx9fJ.js → vue-ui-3d-bar-fvTVGk8O.js} +9 -9
  35. package/dist/{vue-ui-3d-bar-Dm2wnS6e.cjs → vue-ui-3d-bar-zKUnnMOY.cjs} +1 -1
  36. package/dist/{vue-ui-accordion-CGpOsWNN.js → vue-ui-accordion-CYLks1fW.js} +3 -3
  37. package/dist/{vue-ui-accordion-mtZIFAv9.cjs → vue-ui-accordion-paZXh-GD.cjs} +1 -1
  38. package/dist/{vue-ui-age-pyramid-BcMERmA5.cjs → vue-ui-age-pyramid-Bg8Bexac.cjs} +1 -1
  39. package/dist/{vue-ui-age-pyramid-dbX4WaaY.js → vue-ui-age-pyramid-Ch3nY1Dx.js} +10 -10
  40. package/dist/{vue-ui-annotator-CY-rCEDB.cjs → vue-ui-annotator-BXbLcJ1L.cjs} +1 -1
  41. package/dist/{vue-ui-annotator-DfRkh1D_.js → vue-ui-annotator-DGupSF-o.js} +1 -1
  42. package/dist/{vue-ui-bullet-CUoiQcb5.js → vue-ui-bullet-BSRXabBe.js} +8 -8
  43. package/dist/{vue-ui-bullet-jsXAmYsX.cjs → vue-ui-bullet-DqM9h81O.cjs} +1 -1
  44. package/dist/{vue-ui-candlestick-BD58hsql.cjs → vue-ui-candlestick-C0PkovyK.cjs} +1 -1
  45. package/dist/{vue-ui-candlestick-BLIICgdz.js → vue-ui-candlestick-Dww4XHwQ.js} +11 -11
  46. package/dist/vue-ui-carousel-table-BZs-sxxu.js +396 -0
  47. package/dist/vue-ui-carousel-table-DbXCpYUm.cjs +1 -0
  48. package/dist/{vue-ui-chestnut-vivMozHy.cjs → vue-ui-chestnut-Be4Lagdr.cjs} +1 -1
  49. package/dist/{vue-ui-chestnut-DIPBJ5D2.js → vue-ui-chestnut-CnupXXAM.js} +8 -8
  50. package/dist/{vue-ui-cursor-CzLtzn7N.js → vue-ui-cursor-oqfOA98Q.js} +2 -2
  51. package/dist/{vue-ui-cursor-Cgv_2p2T.cjs → vue-ui-cursor-smlBNiGG.cjs} +1 -1
  52. package/dist/{vue-ui-dashboard-DqZVcLlQ.js → vue-ui-dashboard-BNu7yNYm.js} +2 -2
  53. package/dist/{vue-ui-dashboard-CtlrjFxl.cjs → vue-ui-dashboard-Dw_90R29.cjs} +1 -1
  54. package/dist/{vue-ui-digits-e1HQVXb9.cjs → vue-ui-digits-_8FbgFrI.cjs} +1 -1
  55. package/dist/{vue-ui-digits-CGFznMkY.js → vue-ui-digits-qztPrOEN.js} +2 -2
  56. package/dist/{vue-ui-donut-z2eOcEI5.cjs → vue-ui-donut-B7orj3vV.cjs} +1 -1
  57. package/dist/{vue-ui-donut-DmLq2iWK.js → vue-ui-donut-CK9dINFS.js} +11 -11
  58. package/dist/{vue-ui-donut-evolution-4odFZbUM.cjs → vue-ui-donut-evolution-BmTzjKlH.cjs} +1 -1
  59. package/dist/{vue-ui-donut-evolution-DpollzkH.js → vue-ui-donut-evolution-DpDpYw3f.js} +11 -11
  60. package/dist/{vue-ui-dumbbell-i7E-B6zN.cjs → vue-ui-dumbbell-5yfcA-Of.cjs} +1 -1
  61. package/dist/{vue-ui-dumbbell-DLr4Lh3u.js → vue-ui-dumbbell-Dx1I89N9.js} +10 -10
  62. package/dist/{vue-ui-flow-BuYhmRed.cjs → vue-ui-flow-Bar7LG9t.cjs} +1 -1
  63. package/dist/{vue-ui-flow-CosxAYPJ.js → vue-ui-flow-DJNqydD1.js} +9 -9
  64. package/dist/{vue-ui-funnel-BNPISgC0.cjs → vue-ui-funnel-lxHehCUr.cjs} +1 -1
  65. package/dist/{vue-ui-funnel-C_2YAtFj.js → vue-ui-funnel-mP8ftcS5.js} +8 -8
  66. package/dist/{vue-ui-galaxy-D1cWyHG9.js → vue-ui-galaxy-3cOLS6lh.js} +11 -11
  67. package/dist/{vue-ui-galaxy-DMOx2Le7.cjs → vue-ui-galaxy-B8zbGikp.cjs} +1 -1
  68. package/dist/{vue-ui-gauge-Dw7QvZei.cjs → vue-ui-gauge-Bz1nzveF.cjs} +1 -1
  69. package/dist/{vue-ui-gauge-Dnq0t_eH.js → vue-ui-gauge-CN_zo833.js} +7 -7
  70. package/dist/{vue-ui-gizmo-DcT9tTS-.cjs → vue-ui-gizmo-C9XQ-7Sj.cjs} +1 -1
  71. package/dist/{vue-ui-gizmo-vHQVGdpR.js → vue-ui-gizmo-akkNcCWf.js} +3 -3
  72. package/dist/{vue-ui-heatmap-CtxQI5Mq.js → vue-ui-heatmap-B3ClLioV.js} +10 -10
  73. package/dist/{vue-ui-heatmap-D-r7qdj0.cjs → vue-ui-heatmap-BW6dmp8j.cjs} +1 -1
  74. package/dist/{vue-ui-history-plot-BjcPvcaK.js → vue-ui-history-plot-C-EqVFW-.js} +11 -11
  75. package/dist/{vue-ui-history-plot-B8pP20QN.cjs → vue-ui-history-plot-Mp0zDeR-.cjs} +1 -1
  76. package/dist/{vue-ui-kpi-BjuKXuQM.js → vue-ui-kpi-C-axCKZx.js} +3 -3
  77. package/dist/{vue-ui-kpi-BPwU5pay.cjs → vue-ui-kpi-D8hh3p8f.cjs} +1 -1
  78. package/dist/{vue-ui-mini-loader-DE2NXywp.cjs → vue-ui-mini-loader-Cal5W_q6.cjs} +1 -1
  79. package/dist/{vue-ui-mini-loader-DZYw7bD6.js → vue-ui-mini-loader-CsZ1zxJz.js} +2 -2
  80. package/dist/{vue-ui-molecule-A3yHt8cl.js → vue-ui-molecule-BvNh7REY.js} +11 -11
  81. package/dist/{vue-ui-molecule-B8I4iuBQ.cjs → vue-ui-molecule-RkdIX-iW.cjs} +1 -1
  82. package/dist/{vue-ui-mood-radar-Dh1qbcXz.js → vue-ui-mood-radar-C7v4dBNw.js} +11 -11
  83. package/dist/{vue-ui-mood-radar-BKtVVOZz.cjs → vue-ui-mood-radar-DLpDoq0G.cjs} +1 -1
  84. package/dist/{vue-ui-nested-donuts-B5ixdGsx.cjs → vue-ui-nested-donuts-BO249_PV.cjs} +1 -1
  85. package/dist/{vue-ui-nested-donuts-DPuIU4IX.js → vue-ui-nested-donuts-C08kpvMd.js} +11 -11
  86. package/dist/{vue-ui-onion-BTMaTU2a.cjs → vue-ui-onion-BjNQgHPX.cjs} +1 -1
  87. package/dist/{vue-ui-onion-BgcJBzxI.js → vue-ui-onion-CTLBemDj.js} +11 -11
  88. package/dist/{vue-ui-parallel-coordinate-plot-Cye2V8MQ.cjs → vue-ui-parallel-coordinate-plot-CoeVi-98.cjs} +1 -1
  89. package/dist/{vue-ui-parallel-coordinate-plot-Ksh3Tuvx.js → vue-ui-parallel-coordinate-plot-H1FdP6AE.js} +12 -12
  90. package/dist/{vue-ui-quadrant-DOet5Q47.cjs → vue-ui-quadrant-D701bdNz.cjs} +1 -1
  91. package/dist/{vue-ui-quadrant-DGBXeeOe.js → vue-ui-quadrant-Dd-LDy4T.js} +12 -12
  92. package/dist/{vue-ui-quick-chart-DQcck_x6.js → vue-ui-quick-chart-BeNivWrg.js} +9 -9
  93. package/dist/{vue-ui-quick-chart-DhCA-7B5.cjs → vue-ui-quick-chart-CRNEkxoM.cjs} +1 -1
  94. package/dist/{vue-ui-radar-qk20LKHr.cjs → vue-ui-radar-3W9NRklj.cjs} +1 -1
  95. package/dist/{vue-ui-radar-CI5egNer.js → vue-ui-radar-D9U_vOad.js} +12 -12
  96. package/dist/{vue-ui-rating-Ch2PSMeW.js → vue-ui-rating-B7AlAqCY.js} +2 -2
  97. package/dist/{vue-ui-rating-CYhvKLSi.cjs → vue-ui-rating-DeuaL_cU.cjs} +1 -1
  98. package/dist/{vue-ui-relation-circle-t-WDgqtA.cjs → vue-ui-relation-circle-B8JtK-JM.cjs} +1 -1
  99. package/dist/{vue-ui-relation-circle-G6KC4zs0.js → vue-ui-relation-circle-CT23BNcW.js} +7 -7
  100. package/dist/{vue-ui-rings-NIIfGve4.js → vue-ui-rings-BZ7FYYxr.js} +11 -11
  101. package/dist/{vue-ui-rings-DxpkXXwJ.cjs → vue-ui-rings-CZCTLghE.cjs} +1 -1
  102. package/dist/{vue-ui-scatter-BqxcKjb2.js → vue-ui-scatter-DMr8OrC3.js} +12 -12
  103. package/dist/{vue-ui-scatter-DynxMn7l.cjs → vue-ui-scatter-DlA0xU5U.cjs} +1 -1
  104. package/dist/{vue-ui-screenshot-BUP9G_uK.cjs → vue-ui-screenshot-BFV1qEsF.cjs} +1 -1
  105. package/dist/{vue-ui-screenshot-DreZMmrO.js → vue-ui-screenshot-DHiX35pR.js} +1 -1
  106. package/dist/{vue-ui-skeleton-D_lU-hWK.cjs → vue-ui-skeleton-BIWgLDDf.cjs} +1 -1
  107. package/dist/{vue-ui-skeleton-DQqwDUqP.js → vue-ui-skeleton-owIhXtQF.js} +3 -3
  108. package/dist/{vue-ui-smiley-AGwF1X7u.cjs → vue-ui-smiley-BISneB7t.cjs} +1 -1
  109. package/dist/{vue-ui-smiley-CdmO39JE.js → vue-ui-smiley-CCOQ6zjo.js} +2 -2
  110. package/dist/{vue-ui-spark-trend-BUx5YwEZ.js → vue-ui-spark-trend-B56DI3Mc.js} +5 -5
  111. package/dist/{vue-ui-spark-trend-DD1s6Thz.cjs → vue-ui-spark-trend-lMzod-5S.cjs} +1 -1
  112. package/dist/{vue-ui-sparkbar-KZd6YQwQ.js → vue-ui-sparkbar-CMkozDkx.js} +4 -4
  113. package/dist/{vue-ui-sparkbar-mlrF_QEO.cjs → vue-ui-sparkbar-DcdDLl8l.cjs} +1 -1
  114. package/dist/{vue-ui-sparkgauge-B4J8ZYzs.cjs → vue-ui-sparkgauge-BhwNRzrD.cjs} +1 -1
  115. package/dist/{vue-ui-sparkgauge-Db-d9x9r.js → vue-ui-sparkgauge-De06LRPj.js} +4 -4
  116. package/dist/{vue-ui-sparkhistogram-B61JDza9.js → vue-ui-sparkhistogram-CBDd7jIn.js} +5 -5
  117. package/dist/{vue-ui-sparkhistogram-DzJ5NNi9.cjs → vue-ui-sparkhistogram-D00ahrgs.cjs} +1 -1
  118. package/dist/{vue-ui-sparkline-P6ubVgp0.js → vue-ui-sparkline-BJejWvTN.js} +4 -4
  119. package/dist/{vue-ui-sparkline-S6HehQ0a.cjs → vue-ui-sparkline-CY92qVz0.cjs} +1 -1
  120. package/dist/{vue-ui-sparkstackbar-BDBqoeJQ.cjs → vue-ui-sparkstackbar-BjKL_6dq.cjs} +1 -1
  121. package/dist/{vue-ui-sparkstackbar-DKtOqh-Y.js → vue-ui-sparkstackbar-DlnmPom2.js} +5 -5
  122. package/dist/{vue-ui-stackbar-WShCS9A1.js → vue-ui-stackbar-19XdLQXB.js} +306 -291
  123. package/dist/vue-ui-stackbar-T4VBFpDo.cjs +6 -0
  124. package/dist/{vue-ui-strip-plot-Bq3u8k2l.js → vue-ui-strip-plot-Bly8GoNP.js} +11 -11
  125. package/dist/{vue-ui-strip-plot-DH4LQTfB.cjs → vue-ui-strip-plot-CtjbMamo.cjs} +1 -1
  126. package/dist/{vue-ui-table-sJN2rS51.js → vue-ui-table-BUF6Pyfp.js} +1 -1
  127. package/dist/{vue-ui-table-aV4pHrWD.cjs → vue-ui-table-BisPh85-.cjs} +1 -1
  128. package/dist/{vue-ui-table-heatmap-DsdyE14x.js → vue-ui-table-heatmap-By-MmFiq.js} +4 -4
  129. package/dist/{vue-ui-table-heatmap-CruECEYA.cjs → vue-ui-table-heatmap-CPn-jC0n.cjs} +1 -1
  130. package/dist/{vue-ui-table-sparkline-CcsNg6th.cjs → vue-ui-table-sparkline-CIDuWZZs.cjs} +1 -1
  131. package/dist/{vue-ui-table-sparkline-BlUe2QFV.js → vue-ui-table-sparkline-DG70UNkU.js} +5 -5
  132. package/dist/{vue-ui-thermometer-ButIh820.cjs → vue-ui-thermometer-CMvk1D7J.cjs} +1 -1
  133. package/dist/{vue-ui-thermometer-80aa72_6.js → vue-ui-thermometer-Vr2IP_p0.js} +7 -7
  134. package/dist/{vue-ui-timer-CuUSpISM.js → vue-ui-timer-CD7gFOjN.js} +5 -5
  135. package/dist/{vue-ui-timer-Dk4I7cRn.cjs → vue-ui-timer-CUHgN89f.cjs} +1 -1
  136. package/dist/{vue-ui-tiremarks-CQ98xHZ5.js → vue-ui-tiremarks-44pO3jx1.js} +7 -7
  137. package/dist/{vue-ui-tiremarks-BsYfeNCN.cjs → vue-ui-tiremarks-w_gxHFeB.cjs} +1 -1
  138. package/dist/{vue-ui-treemap-CHXb8mBG.cjs → vue-ui-treemap-CFhTEaxa.cjs} +1 -1
  139. package/dist/{vue-ui-treemap-s1nZAhAS.js → vue-ui-treemap-CyOUM3-P.js} +11 -11
  140. package/dist/{vue-ui-vertical-bar-iZWowEik.cjs → vue-ui-vertical-bar-C51RKLB8.cjs} +1 -1
  141. package/dist/{vue-ui-vertical-bar-Dd306Z10.js → vue-ui-vertical-bar-wngOp0Zc.js} +11 -11
  142. package/dist/{vue-ui-waffle-BJgSuNVY.cjs → vue-ui-waffle-CXZc4t27.cjs} +1 -1
  143. package/dist/{vue-ui-waffle-CQfOCZjf.js → vue-ui-waffle-CuN7i0ci.js} +11 -11
  144. package/dist/{vue-ui-wheel-DB-4Rn84.js → vue-ui-wheel-B_gLugLx.js} +7 -7
  145. package/dist/{vue-ui-wheel-s8UTbo9G.cjs → vue-ui-wheel-u9Vc7ZTZ.cjs} +1 -1
  146. package/dist/{vue-ui-word-cloud-C-l2Z3Dd.js → vue-ui-word-cloud-DKHGS0my.js} +10 -10
  147. package/dist/{vue-ui-word-cloud-DvfOJe4M.cjs → vue-ui-word-cloud-tSXyXvd6.cjs} +1 -1
  148. package/dist/{vue-ui-xy-P_VLOaMg.js → vue-ui-xy-BK9R8MrJ.js} +14 -14
  149. package/dist/{vue-ui-xy-D1Nkk2Gp.cjs → vue-ui-xy-bX3g4COC.cjs} +1 -1
  150. package/dist/{vue-ui-xy-canvas-BwNEs-cY.js → vue-ui-xy-canvas-DaT4HoWD.js} +11 -11
  151. package/dist/{vue-ui-xy-canvas-CIKl9AXf.cjs → vue-ui-xy-canvas-gDaRsnBI.cjs} +1 -1
  152. package/package.json +1 -1
  153. package/dist/index-DGcOW0vL.cjs +0 -9
  154. package/dist/vue-ui-carousel-table-CCmB_BJ7.cjs +0 -1
  155. package/dist/vue-ui-carousel-table-NUliqwxA.js +0 -379
  156. package/dist/vue-ui-stackbar-DCCcEgQZ.cjs +0 -6
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DGcOW0vL.cjs"),P=require("./useNestedProp-C9KmUVBy.cjs"),G=require("./vue-ui-skeleton-D_lU-hWK.cjs"),M=require("./useResponsive-BJ7DTGpm.cjs"),R=require("./PackageVersion-BJi2ywG9.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=["id"],X=["xmlns","viewBox"],Z=["id"],Y=["stop-color"],J=["stop-color"],K=["id"],Q=["stop-color"],ee=["stop-color"],te=["id"],le=["stop-color"],ae=["stop-color"],oe={key:0},re=["d","fill"],ue=["d","fill"],ne=["d","stroke","stroke-width"],se=["x1","x2","y1","y2","stroke","stroke-width"],ie=["x","y","width","height","fill","rx"],de=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ce=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ve=["cx","cy","r","fill","stroke","stroke-width"],he=["x","y","font-size","font-weight","fill"],ye=["x","y","height","width","onMouseenter","onClick"],pe={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0},heightRatio:{type:Number,default:1},forcedPadding:{type:Number,default:30}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:x}){const i=f,{vue_ui_sparkline:z}=u.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(u.createUid()),w=e.ref(null),L=e.ref(null),C=e.ref(null),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=P.useNestedProp({userConfig:i.config,defaultConfig:z});return l.theme?{...P.useNestedProp({userConfig:u.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}const b=e.computed(()=>u.largestTriangleThreeBucketsArrayObjects({data:i.dataset,threshold:t.value.downsample.threshold}));e.watch(()=>i.config,l=>{t.value=V(),$(),o.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>i.dataset,l=>{p.value=u.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(r=>({...r,value:[void 0].includes(r.value)?null:r.value})),threshold:t.value.downsample.threshold})},{deep:!0});const p=e.ref(A());function A(){return u.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}),threshold:t.value.downsample.threshold})}const E=e.ref(null);e.onMounted(()=>{if($(),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<b.value.length?(p.value.push(b.value[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=b.value,r+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});function $(){if(u.objectIsEmpty(i.dataset)?u.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{u.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=M.throttle(()=>{const{width:r,height:a}=M.useResponsive({chart:w.value,title:t.value.style.title.show&&i.showInfo?L.value:null,source:C.value});o.value.width=r,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*r,o.value.padding=i.forcedPadding/500*r});E.value=new ResizeObserver(l),E.value.observe(w.value.parentNode)}}const o=e.ref({height:80*i.heightRatio,width:500,chartWidth:t.value.style.chartWidth,padding:i.forcedPadding}),T=e.ref(6),n=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})),N=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=N.value>=0?0:N.value;return Math.abs(l)}),O=e.computed(()=>D.value+m.value+T.value),_=e.computed(()=>n.value.bottom-n.value.height*B(m.value));function B(l){return l/O.value}const h=e.computed(()=>b.value.length-1),s=e.computed(()=>p.value.map((l,r)=>{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:B(a+m.value),x:n.value.start+r*(n.value.width/(h.value+1)>o.padding?o.padding:n.value.width/(h.value+1)),y:n.value.bottom-n.value.height*B(a+m.value),id:`plot_${v.value}_${r}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?u.shiftHue(t.value.style.line.color,.05*(1-r/h.value)):t.value.style.line.color,width:n.value.width/(h.value+1)>o.padding?o.padding:n.value.width/(h.value+1)}})),W=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},r={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,r.x,r.y].toString()}),c=e.ref(void 0);function F(l,r){c.value=l,x("hoverIndex",{index:r})}function j(){c.value=void 0,x("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(g.value){const l=s.value.map(a=>a.absoluteValue),r=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:r,average:r/s.value.length,median:u.calcMedian(l),trend:u.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:S})=>({x:a,y:d,value:S}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),I=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 q(l,r){x("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:w,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:L,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.createVNode(R._sfc_main),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,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,J)],8,Z),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,Q),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,ee)],8,K),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,le),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,ae)],8,te)]),t.value.style.area.show&&!k.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",oe,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${n.value.bottom} ${e.unref(u.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${n.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,re)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${W.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,ue))])):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,ne)):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,se)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:_.value,width:a.width,height:Math.abs(a.y-_.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,ie)):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:n.value.top-6,y2:n.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,de)):e.createCommentVNode("",!0)]))),256)),N.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.value.start,x2:n.value.start+n.value.width-16,y1:_.value,y2:_.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,ce)):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,ve)):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:n.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,I.value,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:I.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,he)):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-(n.value.width/(h.value+1)>o.value.padding?o.value.padding:n.value.width/(h.value+1))/2,y:n.value.top-6,height:n.value.height+6,width:n.value.width/(h.value+1)>o.value.padding?o.value.padding:n.value.width/(h.value+1),fill:"transparent",onMouseenter:S=>F(a,d),onMouseleave:j,onClick:()=>q(a,d)},null,40,ye))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,X)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"source",ref:C,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(G.default,{key:3,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,U))}},fe=H._export_sfc(pe,[["__scopeId","data-v-f4a182c7"]]);exports.default=fe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-o6tXRhOr.cjs"),P=require("./useNestedProp-D-zaZbSR.cjs"),G=require("./vue-ui-skeleton-BIWgLDDf.cjs"),M=require("./useResponsive-BJ7DTGpm.cjs"),R=require("./PackageVersion-dQYEsTLp.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=["id"],X=["xmlns","viewBox"],Z=["id"],Y=["stop-color"],J=["stop-color"],K=["id"],Q=["stop-color"],ee=["stop-color"],te=["id"],le=["stop-color"],ae=["stop-color"],oe={key:0},re=["d","fill"],ue=["d","fill"],ne=["d","stroke","stroke-width"],se=["x1","x2","y1","y2","stroke","stroke-width"],ie=["x","y","width","height","fill","rx"],de=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ce=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ve=["cx","cy","r","fill","stroke","stroke-width"],he=["x","y","font-size","font-weight","fill"],ye=["x","y","height","width","onMouseenter","onClick"],pe={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0},heightRatio:{type:Number,default:1},forcedPadding:{type:Number,default:30}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:x}){const i=f,{vue_ui_sparkline:z}=u.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(u.createUid()),w=e.ref(null),L=e.ref(null),C=e.ref(null),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=P.useNestedProp({userConfig:i.config,defaultConfig:z});return l.theme?{...P.useNestedProp({userConfig:u.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}const b=e.computed(()=>u.largestTriangleThreeBucketsArrayObjects({data:i.dataset,threshold:t.value.downsample.threshold}));e.watch(()=>i.config,l=>{t.value=V(),$(),o.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>i.dataset,l=>{p.value=u.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(r=>({...r,value:[void 0].includes(r.value)?null:r.value})),threshold:t.value.downsample.threshold})},{deep:!0});const p=e.ref(A());function A(){return u.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}),threshold:t.value.downsample.threshold})}const E=e.ref(null);e.onMounted(()=>{if($(),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<b.value.length?(p.value.push(b.value[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=b.value,r+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});function $(){if(u.objectIsEmpty(i.dataset)?u.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{u.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=M.throttle(()=>{const{width:r,height:a}=M.useResponsive({chart:w.value,title:t.value.style.title.show&&i.showInfo?L.value:null,source:C.value});o.value.width=r,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*r,o.value.padding=i.forcedPadding/500*r});E.value=new ResizeObserver(l),E.value.observe(w.value.parentNode)}}const o=e.ref({height:80*i.heightRatio,width:500,chartWidth:t.value.style.chartWidth,padding:i.forcedPadding}),T=e.ref(6),n=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})),N=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=N.value>=0?0:N.value;return Math.abs(l)}),O=e.computed(()=>D.value+m.value+T.value),_=e.computed(()=>n.value.bottom-n.value.height*B(m.value));function B(l){return l/O.value}const h=e.computed(()=>b.value.length-1),s=e.computed(()=>p.value.map((l,r)=>{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:B(a+m.value),x:n.value.start+r*(n.value.width/(h.value+1)>o.padding?o.padding:n.value.width/(h.value+1)),y:n.value.bottom-n.value.height*B(a+m.value),id:`plot_${v.value}_${r}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?u.shiftHue(t.value.style.line.color,.05*(1-r/h.value)):t.value.style.line.color,width:n.value.width/(h.value+1)>o.padding?o.padding:n.value.width/(h.value+1)}})),W=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},r={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,r.x,r.y].toString()}),c=e.ref(void 0);function F(l,r){c.value=l,x("hoverIndex",{index:r})}function j(){c.value=void 0,x("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(g.value){const l=s.value.map(a=>a.absoluteValue),r=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:r,average:r/s.value.length,median:u.calcMedian(l),trend:u.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:S})=>({x:a,y:d,value:S}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),I=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 q(l,r){x("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:w,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:L,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.createVNode(R._sfc_main),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,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,J)],8,Z),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,Q),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,ee)],8,K),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,le),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,ae)],8,te)]),t.value.style.area.show&&!k.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",oe,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${n.value.bottom} ${e.unref(u.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${n.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,re)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${W.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,ue))])):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,ne)):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,se)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:_.value,width:a.width,height:Math.abs(a.y-_.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,ie)):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:n.value.top-6,y2:n.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,de)):e.createCommentVNode("",!0)]))),256)),N.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.value.start,x2:n.value.start+n.value.width-16,y1:_.value,y2:_.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,ce)):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,ve)):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:n.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,I.value,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:I.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,he)):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-(n.value.width/(h.value+1)>o.value.padding?o.value.padding:n.value.width/(h.value+1))/2,y:n.value.top-6,height:n.value.height+6,width:n.value.width/(h.value+1)>o.value.padding?o.value.padding:n.value.width/(h.value+1),fill:"transparent",onMouseenter:S=>F(a,d),onMouseleave:j,onClick:()=>q(a,d)},null,40,ye))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,X)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"source",ref:C,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(G.default,{key:3,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,U))}},fe=H._export_sfc(pe,[["__scopeId","data-v-f4a182c7"]]);exports.default=fe;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-DGcOW0vL.cjs"),V=require("./useNestedProp-C9KmUVBy.cjs"),A=require("./vue-ui-skeleton-D_lU-hWK.cjs"),q=require("./PackageVersion-BJi2ywG9.cjs"),O=require("./Tooltip-cPxZzSgr.cjs"),U=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["xmlns","viewBox"],M=["id"],H=["stop-color"],I=["stop-color"],R=["stop-color"],W={id:"stackPill",clipPathUnits:"objectBoundingBox"},Y=["fill"],G={key:0,"clip-path":"url(#stackPill)"},X=["x","width","height","fill"],J=["x","width","height","fill","stroke"],K=["onClick","x","width","height","onMouseenter"],Q=["width","height","rx"],Z=["onClick"],ee={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},te=["height","width"],le=["fill"],oe={key:4,ref:"source",dir:"auto"},ae={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const u=P,{vue_ui_sparkstackbar:L}=a.useConfig(),x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),_=e.ref(""),t=e.computed({get:()=>$(),set:l=>l});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{p.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),p=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let v=function(){r+=o/l,r<o?(p.value=p.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(v)):(g.value=!1,p.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,v()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>p.value.map((l,n)=>{const o=l.value||0,r=o/N.value,v=isNaN(r)?0:r,s=v*c.value.width;return{...l,value:o,proportion:v,width:s,proportionLabel:a.dataLabel({v:v*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),C=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function F(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<p.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<C.value.length;o+=1)n.push({...C.value[o],start:l}),l+=C.value[o].width;return n});function z(l,n){D("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function T({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(_.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,_.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{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),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(q._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,H),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,I),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,R)],8,M))),128)),e.createElementVNode("clipPath",W,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,Y)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",G,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,X))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,J))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>T({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=v=>{b.value=!1,m.value=null})},null,42,K))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,Q))],8,j)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(A.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":d.value.includes(r)}),onClick:v=>{F(r),z(o,r)}},[e.createElementVNode("div",ee,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:o.color},null,8,le)],8,te)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(o.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(d.value.includes(r)?" - ":o.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,Z))),256))],4)):e.createCommentVNode("",!0),e.createVNode(O._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:_.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},re=U._export_sfc(ae,[["__scopeId","data-v-233900f7"]]);exports.default=re;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-o6tXRhOr.cjs"),V=require("./useNestedProp-D-zaZbSR.cjs"),A=require("./vue-ui-skeleton-BIWgLDDf.cjs"),q=require("./PackageVersion-dQYEsTLp.cjs"),O=require("./Tooltip-B7gYRLGN.cjs"),U=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["xmlns","viewBox"],M=["id"],H=["stop-color"],I=["stop-color"],R=["stop-color"],W={id:"stackPill",clipPathUnits:"objectBoundingBox"},Y=["fill"],G={key:0,"clip-path":"url(#stackPill)"},X=["x","width","height","fill"],J=["x","width","height","fill","stroke"],K=["onClick","x","width","height","onMouseenter"],Q=["width","height","rx"],Z=["onClick"],ee={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},te=["height","width"],le=["fill"],oe={key:4,ref:"source",dir:"auto"},ae={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const u=P,{vue_ui_sparkstackbar:L}=a.useConfig(),x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),_=e.ref(""),t=e.computed({get:()=>$(),set:l=>l});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{p.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),p=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let v=function(){r+=o/l,r<o?(p.value=p.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(v)):(g.value=!1,p.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,v()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>p.value.map((l,n)=>{const o=l.value||0,r=o/N.value,v=isNaN(r)?0:r,s=v*c.value.width;return{...l,value:o,proportion:v,width:s,proportionLabel:a.dataLabel({v:v*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),C=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function F(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<p.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<C.value.length;o+=1)n.push({...C.value[o],start:l}),l+=C.value[o].width;return n});function z(l,n){D("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function T({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(_.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,_.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{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),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(q._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,H),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,I),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,R)],8,M))),128)),e.createElementVNode("clipPath",W,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,Y)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",G,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,X))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,J))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>T({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=v=>{b.value=!1,m.value=null})},null,42,K))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,Q))],8,j)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(A.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":d.value.includes(r)}),onClick:v=>{F(r),z(o,r)}},[e.createElementVNode("div",ee,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:o.color},null,8,le)],8,te)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(o.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(d.value.includes(r)?" - ":o.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,Z))),256))],4)):e.createCommentVNode("",!0),e.createVNode(O._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:_.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},re=U._export_sfc(ae,[["__scopeId","data-v-233900f7"]]);exports.default=re;
@@ -1,9 +1,9 @@
1
1
  import { computed as m, ref as d, watch as Y, onMounted as se, openBlock as s, createElementBlock as r, normalizeStyle as v, createElementVNode as p, toDisplayString as w, createCommentVNode as y, unref as C, createVNode as G, Fragment as x, renderList as $, normalizeClass as F, createBlock as re, withCtx as q, renderSlot as j, normalizeProps as H, guardReactiveProps as X } from "vue";
2
- import { u as ne, c as J, t as ue, a as ie, p as i, d as N, b as ce, o as de, e as K, g as ve, f as E, X as pe, s as ge, w as fe, i as Q, x as he } from "./index-Dhlyke5j.js";
3
- import { u as Z } from "./useNestedProp-D9eTQKze.js";
4
- import ye from "./vue-ui-skeleton-DQqwDUqP.js";
5
- import { _ as me } from "./PackageVersion-xnKIqody.js";
6
- import { _ as be } from "./Tooltip-BZYApG0d.js";
2
+ import { u as ne, c as J, t as ue, a as ie, p as i, d as N, b as ce, o as de, e as K, g as ve, f as E, X as pe, s as ge, w as fe, i as Q, x as he } from "./index-CI-N9klv.js";
3
+ import { u as Z } from "./useNestedProp-D1eJ0dvv.js";
4
+ import ye from "./vue-ui-skeleton-owIhXtQF.js";
5
+ import { _ as me } from "./PackageVersion-S3SzpuwC.js";
6
+ import { _ as be } from "./Tooltip-BDaa-67h.js";
7
7
  import { _ as ke } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const _e = ["xmlns", "viewBox"], we = ["id"], Ce = ["stop-color"], xe = ["stop-color"], $e = ["stop-color"], Se = {
9
9
  id: "stackPill",