vue-data-ui 2.4.59 → 2.4.61

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 (155) hide show
  1. package/dist/{Arrow-Dudbi6k5.cjs → Arrow-C4JCfYUu.cjs} +1 -1
  2. package/dist/{Arrow-DzS4HIXj.js → Arrow-NyYxjtAV.js} +1 -1
  3. package/dist/{BaseIcon-DD3GLrhS.cjs → BaseIcon-B1zKYJGk.cjs} +1 -1
  4. package/dist/{BaseIcon-BbU81zOd.js → BaseIcon-a81b_5b0.js} +1 -1
  5. package/dist/{DataTable-BHCbVv8x.cjs → DataTable-BVwnM0tQ.cjs} +1 -1
  6. package/dist/{DataTable-CFUKU8PU.js → DataTable-CcW8SHH2.js} +2 -2
  7. package/dist/{Legend-f52bnttJ.js → Legend-Cq1rcFzv.js} +1 -1
  8. package/dist/{Legend-BYngLoV6.cjs → Legend-fpW6iFgA.cjs} +1 -1
  9. package/dist/{PackageVersion-nr7f_VNw.cjs → PackageVersion-B7-YDa6h.cjs} +1 -1
  10. package/dist/{PackageVersion-C_FFs0BP.js → PackageVersion-LRbiiLp0.js} +1 -1
  11. package/dist/{PenAndPaper-Dx24BtRW.js → PenAndPaper-BCjJ-td_.js} +3 -3
  12. package/dist/{PenAndPaper-C9v0NXEg.cjs → PenAndPaper-JkRknDt7.cjs} +1 -1
  13. package/dist/{Shape-Dkt-vkTl.cjs → Shape-QZcWXoYb.cjs} +1 -1
  14. package/dist/{Shape-Ct2x6qZx.js → Shape-hFNcMth4.js} +1 -1
  15. package/dist/{Slicer-Duke9qno.js → Slicer-DGn72_0M.js} +2 -2
  16. package/dist/{Slicer-C0cvEMOy.cjs → Slicer-DMYxCNLb.cjs} +1 -1
  17. package/dist/{Title-CpfNWbUc.cjs → Title-CQVviDIQ.cjs} +1 -1
  18. package/dist/{Title-zZtEcB9F.js → Title-Zm0LCGPS.js} +1 -1
  19. package/dist/{Tooltip-DDJ2Wvjy.js → Tooltip-CoahRzyE.js} +1 -1
  20. package/dist/{Tooltip-DZuVxmLc.cjs → Tooltip-DZ1uTqBW.cjs} +1 -1
  21. package/dist/{index-B9RAElpI.js → index-CG_OTzik.js} +3 -1
  22. package/dist/index-V6tl1xgQ.cjs +9 -0
  23. package/dist/style.css +1 -1
  24. package/dist/types/vue-data-ui.d.cts +2 -0
  25. package/dist/types/vue-data-ui.d.ts +2 -0
  26. package/dist/{useNestedProp-DkpuL8Iv.cjs → useNestedProp--db71Vbu.cjs} +1 -1
  27. package/dist/{useNestedProp-DuruL3Nt.js → useNestedProp-BZZvruew.js} +1 -1
  28. package/dist/{usePrinter-CwTAwqtF.js → usePrinter-CxBwzZkb.js} +1 -1
  29. package/dist/{usePrinter-BIHu0O5X.cjs → usePrinter-D0LQ1CyY.cjs} +1 -1
  30. package/dist/{vue-data-ui-yknmkfFy.js → vue-data-ui-C4A5zIHI.js} +60 -60
  31. package/dist/{vue-data-ui-BXCJgMfu.cjs → vue-data-ui-CUyuYhwT.cjs} +1 -1
  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-BkbLoUhP.js → vue-ui-3d-bar-DAh8koX4.js} +9 -9
  35. package/dist/{vue-ui-3d-bar-CHnh8ZH_.cjs → vue-ui-3d-bar-DKiYqw0u.cjs} +1 -1
  36. package/dist/{vue-ui-accordion-6Clt339w.cjs → vue-ui-accordion-B7VpkrPR.cjs} +1 -1
  37. package/dist/{vue-ui-accordion-rNA598L6.js → vue-ui-accordion-C2IbGLRv.js} +3 -3
  38. package/dist/{vue-ui-age-pyramid-CKDDaRj_.cjs → vue-ui-age-pyramid-BmqvzA-d.cjs} +1 -1
  39. package/dist/{vue-ui-age-pyramid-C3o5HfRK.js → vue-ui-age-pyramid-me4GgQNb.js} +10 -10
  40. package/dist/{vue-ui-annotator-BLilhXfT.cjs → vue-ui-annotator-Bg9Juc1l.cjs} +1 -1
  41. package/dist/{vue-ui-annotator-huMOA-QF.js → vue-ui-annotator-XOzj9Bpg.js} +1 -1
  42. package/dist/{vue-ui-bullet-yTpejKsw.cjs → vue-ui-bullet-BsHk8Y0E.cjs} +1 -1
  43. package/dist/{vue-ui-bullet-DxYdog9c.js → vue-ui-bullet-D1ElgM95.js} +8 -8
  44. package/dist/{vue-ui-candlestick-CmD40PpS.cjs → vue-ui-candlestick-Ba4yv9ZM.cjs} +1 -1
  45. package/dist/{vue-ui-candlestick-3lCgRxr0.js → vue-ui-candlestick-DLhwvS6l.js} +11 -11
  46. package/dist/{vue-ui-carousel-table-BU8oAq6b.cjs → vue-ui-carousel-table-DSoV6GBf.cjs} +1 -1
  47. package/dist/{vue-ui-carousel-table-D3JIrHMF.js → vue-ui-carousel-table-cEaGm232.js} +4 -4
  48. package/dist/{vue-ui-chestnut-BWRUxwWm.cjs → vue-ui-chestnut-D6D5Zr4r.cjs} +1 -1
  49. package/dist/{vue-ui-chestnut-cWFqbqSU.js → vue-ui-chestnut-DCURZY6w.js} +8 -8
  50. package/dist/{vue-ui-cursor-DjWkFQEI.js → vue-ui-cursor-B9eASI3M.js} +2 -2
  51. package/dist/{vue-ui-cursor-DzJmB5h9.cjs → vue-ui-cursor-CqDpaKei.cjs} +1 -1
  52. package/dist/{vue-ui-dashboard-1dycrMNM.js → vue-ui-dashboard-B2rw-G-R.js} +2 -2
  53. package/dist/{vue-ui-dashboard-BOjdgUEm.cjs → vue-ui-dashboard-Q-ILTgqP.cjs} +1 -1
  54. package/dist/{vue-ui-digits-C4NWhIjg.js → vue-ui-digits-BAG_spWA.js} +2 -2
  55. package/dist/{vue-ui-digits-B8TVsqsB.cjs → vue-ui-digits-CagcmtFs.cjs} +1 -1
  56. package/dist/{vue-ui-donut-BPz8gXi5.cjs → vue-ui-donut-5jgX6ZLE.cjs} +1 -1
  57. package/dist/{vue-ui-donut-CXBxDUoh.js → vue-ui-donut-BJl5Isgy.js} +15 -15
  58. package/dist/{vue-ui-donut-evolution-h3ZgYI48.cjs → vue-ui-donut-evolution-CnqdY8LW.cjs} +1 -1
  59. package/dist/{vue-ui-donut-evolution-BgD7rCFk.js → vue-ui-donut-evolution-DMhkt7mf.js} +11 -11
  60. package/dist/{vue-ui-dumbbell-BCyFd1Lf.cjs → vue-ui-dumbbell-Be0B-LgS.cjs} +1 -1
  61. package/dist/{vue-ui-dumbbell-DMp-Waih.js → vue-ui-dumbbell-Dg3mYtw3.js} +10 -10
  62. package/dist/{vue-ui-flow-DB3_5wEr.cjs → vue-ui-flow-BKyhoEjt.cjs} +1 -1
  63. package/dist/{vue-ui-flow-D-XBMcpC.js → vue-ui-flow-Cq8-bQr_.js} +9 -9
  64. package/dist/{vue-ui-funnel-DJVmn_pN.cjs → vue-ui-funnel-DFk4PKvj.cjs} +1 -1
  65. package/dist/{vue-ui-funnel-Dxb6o97C.js → vue-ui-funnel-DHFbd45-.js} +9 -9
  66. package/dist/{vue-ui-galaxy-CIBBO623.cjs → vue-ui-galaxy-Y1gaT5UE.cjs} +1 -1
  67. package/dist/{vue-ui-galaxy-C2eHqbLw.js → vue-ui-galaxy-rYHDLCt9.js} +11 -11
  68. package/dist/{vue-ui-gauge-B9M8ICMX.js → vue-ui-gauge-Ba14Ybvo.js} +7 -7
  69. package/dist/{vue-ui-gauge-C_JArbcd.cjs → vue-ui-gauge-Bmuasq4t.cjs} +1 -1
  70. package/dist/{vue-ui-gizmo-ETKRu3P5.cjs → vue-ui-gizmo-CF11m0cq.cjs} +1 -1
  71. package/dist/{vue-ui-gizmo-OGIvFCA4.js → vue-ui-gizmo-CuMablqV.js} +3 -3
  72. package/dist/{vue-ui-heatmap-C2BobYAF.js → vue-ui-heatmap-B0Ry1OTW.js} +10 -10
  73. package/dist/{vue-ui-heatmap-mPZepJ4V.cjs → vue-ui-heatmap-BekQJ_O8.cjs} +1 -1
  74. package/dist/{vue-ui-history-plot-DgEFbRv3.cjs → vue-ui-history-plot-BTVojhgQ.cjs} +1 -1
  75. package/dist/{vue-ui-history-plot-BtBDW5ha.js → vue-ui-history-plot-DkJdYX5N.js} +11 -11
  76. package/dist/{vue-ui-kpi-DZGoUp6y.cjs → vue-ui-kpi-BLreWPBQ.cjs} +1 -1
  77. package/dist/{vue-ui-kpi-BCwmp6i5.js → vue-ui-kpi-BQwuGH5_.js} +3 -3
  78. package/dist/{vue-ui-mini-loader-B_I1k10C.cjs → vue-ui-mini-loader-C-61eqcR.cjs} +1 -1
  79. package/dist/{vue-ui-mini-loader-DWQfo-Ey.js → vue-ui-mini-loader-DOGNwMhX.js} +2 -2
  80. package/dist/{vue-ui-molecule-CqHsa4N7.cjs → vue-ui-molecule-BRM8s9SD.cjs} +1 -1
  81. package/dist/{vue-ui-molecule-CpWWvLlc.js → vue-ui-molecule-DHBRDC8t.js} +11 -11
  82. package/dist/{vue-ui-mood-radar-Dx6ICJkv.cjs → vue-ui-mood-radar-MXQgj0yp.cjs} +1 -1
  83. package/dist/{vue-ui-mood-radar-B4-AQAyE.js → vue-ui-mood-radar-dfN44AZx.js} +11 -11
  84. package/dist/{vue-ui-nested-donuts-C8LG5ony.cjs → vue-ui-nested-donuts-BAtJgYOg.cjs} +1 -1
  85. package/dist/{vue-ui-nested-donuts-C-afzEvx.js → vue-ui-nested-donuts-C-nDnw6v.js} +11 -11
  86. package/dist/{vue-ui-onion-wBz5dln6.js → vue-ui-onion-D8OvxeHr.js} +11 -11
  87. package/dist/{vue-ui-onion-KC_zqQyz.cjs → vue-ui-onion-EO8dPufp.cjs} +1 -1
  88. package/dist/{vue-ui-parallel-coordinate-plot-BoiKoaod.js → vue-ui-parallel-coordinate-plot-3BNXcNsy.js} +12 -12
  89. package/dist/{vue-ui-parallel-coordinate-plot-BK1sUOyd.cjs → vue-ui-parallel-coordinate-plot-Cxl3bY0H.cjs} +1 -1
  90. package/dist/{vue-ui-quadrant-DY6yUyOl.js → vue-ui-quadrant-BOReLkSm.js} +12 -12
  91. package/dist/{vue-ui-quadrant-BJ3gSVgF.cjs → vue-ui-quadrant-DiU08Q5X.cjs} +1 -1
  92. package/dist/{vue-ui-quick-chart-OHwPApk1.cjs → vue-ui-quick-chart-BRERkFkI.cjs} +1 -1
  93. package/dist/{vue-ui-quick-chart-DBH9CgBI.js → vue-ui-quick-chart-D4UZCrzj.js} +9 -9
  94. package/dist/{vue-ui-radar-DYnmlHtt.js → vue-ui-radar-C2ePOuIW.js} +12 -12
  95. package/dist/{vue-ui-radar-nhy4Pqtc.cjs → vue-ui-radar-DduWN5dL.cjs} +1 -1
  96. package/dist/{vue-ui-rating-3LUgui--.js → vue-ui-rating-BYfD1N57.js} +2 -2
  97. package/dist/{vue-ui-rating-wl5jkxb5.cjs → vue-ui-rating-BtzMW1EB.cjs} +1 -1
  98. package/dist/{vue-ui-relation-circle-Da09K_Ce.js → vue-ui-relation-circle-BKjs6DR1.js} +7 -7
  99. package/dist/{vue-ui-relation-circle-CGkAsJl8.cjs → vue-ui-relation-circle-DhLvWetz.cjs} +1 -1
  100. package/dist/{vue-ui-rings-BuVPBXNc.js → vue-ui-rings-BNwvxf2K.js} +11 -11
  101. package/dist/{vue-ui-rings-DZfhibc4.cjs → vue-ui-rings-CzZyxYeS.cjs} +1 -1
  102. package/dist/{vue-ui-scatter-ChYAlXb_.cjs → vue-ui-scatter-D3Cl-rFL.cjs} +1 -1
  103. package/dist/{vue-ui-scatter-Bee79rib.js → vue-ui-scatter-thYwTZhC.js} +12 -12
  104. package/dist/{vue-ui-screenshot-CCnAaGB3.js → vue-ui-screenshot-9y8wYnc3.js} +1 -1
  105. package/dist/{vue-ui-screenshot-Blz4fiO2.cjs → vue-ui-screenshot-DFHP0ThC.cjs} +1 -1
  106. package/dist/{vue-ui-skeleton-DVYD_VSe.js → vue-ui-skeleton-B6hyEcxy.js} +3 -3
  107. package/dist/{vue-ui-skeleton-B24XJJ2p.cjs → vue-ui-skeleton-D56sSIBO.cjs} +1 -1
  108. package/dist/{vue-ui-smiley-CdrTI5Rh.js → vue-ui-smiley-B-4Fqh2J.js} +2 -2
  109. package/dist/{vue-ui-smiley-CXOuAdIj.cjs → vue-ui-smiley-BsWAahKv.cjs} +1 -1
  110. package/dist/{vue-ui-spark-trend-Pd3JNy4G.js → vue-ui-spark-trend-DJcpI-ZY.js} +5 -5
  111. package/dist/{vue-ui-spark-trend-B08HYMm5.cjs → vue-ui-spark-trend-MAq0VlUq.cjs} +1 -1
  112. package/dist/{vue-ui-sparkbar-Dq1hwL7i.cjs → vue-ui-sparkbar-DMlzP8ZM.cjs} +1 -1
  113. package/dist/{vue-ui-sparkbar-CTDWiUid.js → vue-ui-sparkbar-DZqE8qN3.js} +4 -4
  114. package/dist/{vue-ui-sparkgauge-g0C7wuIH.js → vue-ui-sparkgauge-B-kRhMYK.js} +4 -4
  115. package/dist/{vue-ui-sparkgauge-il4rmDdv.cjs → vue-ui-sparkgauge-CvOP9U7-.cjs} +1 -1
  116. package/dist/{vue-ui-sparkhistogram-CoRPiLpB.cjs → vue-ui-sparkhistogram-DjUvwlYU.cjs} +1 -1
  117. package/dist/{vue-ui-sparkhistogram-Dk8IYZGB.js → vue-ui-sparkhistogram-EOeboT7_.js} +5 -5
  118. package/dist/vue-ui-sparkline-BS_ZXXei.cjs +1 -0
  119. package/dist/vue-ui-sparkline-BgB5km-f.js +420 -0
  120. package/dist/{vue-ui-sparkstackbar-CRGrf5y2.js → vue-ui-sparkstackbar-DGihKtGC.js} +5 -5
  121. package/dist/{vue-ui-sparkstackbar-tkiKbZHo.cjs → vue-ui-sparkstackbar-DSTz24kS.cjs} +1 -1
  122. package/dist/{vue-ui-stackbar-QaavE5-F.js → vue-ui-stackbar-DrJ3au6w.js} +12 -12
  123. package/dist/{vue-ui-stackbar-zk1K5gP3.cjs → vue-ui-stackbar-m-5t4Otk.cjs} +1 -1
  124. package/dist/{vue-ui-strip-plot-gm_lr5A9.js → vue-ui-strip-plot-4uC5MD3e.js} +11 -11
  125. package/dist/{vue-ui-strip-plot-8Ksp5AzD.cjs → vue-ui-strip-plot-Yy2DIoMg.cjs} +1 -1
  126. package/dist/{vue-ui-table-CPLd7hXM.cjs → vue-ui-table-DCe_BTaV.cjs} +1 -1
  127. package/dist/{vue-ui-table-ceYZ6Wzd.js → vue-ui-table-DN498EB2.js} +1 -1
  128. package/dist/{vue-ui-table-heatmap-CWQIOR58.js → vue-ui-table-heatmap-CMVmFTPi.js} +4 -4
  129. package/dist/{vue-ui-table-heatmap-CSsYOFf7.cjs → vue-ui-table-heatmap-PvopeKyW.cjs} +1 -1
  130. package/dist/{vue-ui-table-sparkline-hyL_92AC.cjs → vue-ui-table-sparkline-BtUV0t4I.cjs} +1 -1
  131. package/dist/{vue-ui-table-sparkline-BHkqm0Sf.js → vue-ui-table-sparkline-DpXxi6al.js} +5 -5
  132. package/dist/{vue-ui-thermometer-CKiohIHn.cjs → vue-ui-thermometer-B9YyPrvt.cjs} +1 -1
  133. package/dist/{vue-ui-thermometer-Dvk3S7jR.js → vue-ui-thermometer-CB38vNj3.js} +7 -7
  134. package/dist/{vue-ui-timer-D0tGj6hK.js → vue-ui-timer-BmFFjMb9.js} +5 -5
  135. package/dist/{vue-ui-timer-BUuk2p4C.cjs → vue-ui-timer-D6GsFvTy.cjs} +1 -1
  136. package/dist/{vue-ui-tiremarks-Csng3xWI.cjs → vue-ui-tiremarks--CrAFWU2.cjs} +1 -1
  137. package/dist/{vue-ui-tiremarks-C2G0Sem6.js → vue-ui-tiremarks-CJ2y_2T1.js} +7 -7
  138. package/dist/{vue-ui-treemap-CJjATl47.cjs → vue-ui-treemap-HpoEGWKV.cjs} +1 -1
  139. package/dist/{vue-ui-treemap-3iutCx61.js → vue-ui-treemap-Z3t2YGoE.js} +11 -11
  140. package/dist/{vue-ui-vertical-bar-DZz_tUTV.js → vue-ui-vertical-bar-B_x2w4L8.js} +11 -11
  141. package/dist/{vue-ui-vertical-bar-DtuEIajX.cjs → vue-ui-vertical-bar-LdxXCg3W.cjs} +1 -1
  142. package/dist/{vue-ui-waffle-B-Uf38ml.cjs → vue-ui-waffle-BDkOv8M4.cjs} +1 -1
  143. package/dist/{vue-ui-waffle-Cr4FGNwb.js → vue-ui-waffle-BKrNIOiM.js} +11 -11
  144. package/dist/{vue-ui-wheel-Da4DH062.js → vue-ui-wheel-BCs1b_hk.js} +7 -7
  145. package/dist/{vue-ui-wheel-Bijmdum9.cjs → vue-ui-wheel-DgzJQSl_.cjs} +1 -1
  146. package/dist/{vue-ui-word-cloud-Cjyh1I0J.cjs → vue-ui-word-cloud-BHm3q6eZ.cjs} +1 -1
  147. package/dist/{vue-ui-word-cloud-C3o4JBD2.js → vue-ui-word-cloud-CO47t4OJ.js} +10 -10
  148. package/dist/{vue-ui-xy-BX_3ddck.js → vue-ui-xy-RDecyidx.js} +14 -14
  149. package/dist/{vue-ui-xy-gClSSwyU.cjs → vue-ui-xy-c7YLqedj.cjs} +1 -1
  150. package/dist/{vue-ui-xy-canvas-ObtOgMlV.cjs → vue-ui-xy-canvas-CY1JxJvm.cjs} +1 -1
  151. package/dist/{vue-ui-xy-canvas-DqzVCtbZ.js → vue-ui-xy-canvas-Q6mKl1B-.js} +11 -11
  152. package/package.json +1 -1
  153. package/dist/index-DaDv7p0W.cjs +0 -9
  154. package/dist/vue-ui-sparkline-B_1J2ft2.cjs +0 -1
  155. package/dist/vue-ui-sparkline-Ca1ai-Mq.js +0 -419
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-V6tl1xgQ.cjs"),S=require("./useNestedProp--db71Vbu.cjs"),G=require("./vue-ui-skeleton-D56sSIBO.cjs"),P=require("./useResponsive-BJ7DTGpm.cjs"),R=require("./PackageVersion-B7-YDa6h.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=["id"],X=["xmlns","viewBox"],Z=["width","height"],Y=["id"],J=["stop-color"],K=["stop-color"],Q=["id"],ee=["stop-color"],te=["stop-color"],le=["id"],ae=["stop-color"],oe=["stop-color"],ne={key:1},re=["d","fill"],ue=["d","fill"],se=["d","stroke","stroke-width"],ie=["x1","x2","y1","y2","stroke","stroke-width"],de=["x","y","width","height","fill","rx"],ce=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ve=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],he=["cx","cy","r","fill","stroke","stroke-width"],ye=["x","y","font-size","font-weight","fill"],fe=["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(p,{emit:_}){const u=p,{vue_ui_sparkline:z}=r.useConfig(),k=e.computed(()=>!!u.dataset&&u.dataset.length),v=e.ref(r.createUid()),w=e.ref(null),C=e.ref(null),L=e.ref(null),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=S.useNestedProp({userConfig:u.config,defaultConfig:z});let o={};return l.theme?o={...S.useNestedProp({userConfig:r.themes.vue_ui_sparkline[l.theme]||u.config,defaultConfig:l})}:o=l,u.config&&r.hasDeepProperty(u.config,"style.scaleMin")?o.style.scaleMin=u.config.style.scaleMin:o.style.scaleMin=null,u.config&&r.hasDeepProperty(u.config,"style.scaleMax")?o.style.scaleMax=u.config.style.scaleMax:o.style.scaleMax=null,o}const b=e.computed(()=>r.largestTriangleThreeBucketsArrayObjects({data:u.dataset,threshold:t.value.downsample.threshold}));e.watch(()=>u.config,l=>{t.value=V(),$(),n.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>u.dataset,l=>{f.value=r.largestTriangleThreeBucketsArrayObjects({data:u.dataset.map(o=>({...o,value:[void 0].includes(o.value)?null:o.value})),threshold:t.value.downsample.threshold})},{deep:!0});const f=e.ref(D());function D(){return r.largestTriangleThreeBucketsArrayObjects({data:u.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&&u.dataset.length>1){let a=function(){o<b.value.length?(f.value.push(b.value[o]),setTimeout(()=>{requestAnimationFrame(a)},l)):f.value=b.value,o+=1};f.value=[];const l=t.value.style.animation.animationFrames/u.dataset.length;let o=0;a()}});function $(){if(r.objectIsEmpty(u.dataset)?r.error({componentName:"VueUiSparkline",type:"dataset"}):u.dataset.forEach((l,o)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{r.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),t.value.responsive){const l=P.throttle(()=>{const{width:o,height:a}=P.useResponsive({chart:w.value,title:t.value.style.title.show&&u.showInfo?C.value:null,source:L.value});n.value.width=o,n.value.height=a,n.value.chartWidth=t.value.style.chartWidth/500*o,n.value.padding=u.forcedPadding/500*o});E.value=new ResizeObserver(l),E.value.observe(w.value.parentNode)}}const n=e.ref({height:80*u.heightRatio,width:500,chartWidth:t.value.style.chartWidth,padding:u.forcedPadding}),A=e.ref(6),s=e.computed(()=>({top:12,left:0,right:n.value.width,bottom:n.value.height-3,start:u.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?n.value.width-n.value.chartWidth:n.value.padding,width:u.showInfo&&t.value.style.dataLabel.show?n.value.chartWidth:n.value.width-n.value.padding,height:n.value.height-12})),N=e.computed(()=>[null,void 0].includes(t.value.style.scaleMin)?Math.min(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0)):t.value.style.scaleMin),O=e.computed(()=>[null,void 0].includes(t.value.style.scaleMax)?Math.max(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0)):t.value.style.scaleMax),m=e.computed(()=>{const l=N.value>=0?0:N.value;return Math.abs(l)}),T=e.computed(()=>O.value+m.value+A.value),x=e.computed(()=>s.value.bottom-s.value.height*B(m.value));function B(l){return l/T.value}const h=e.computed(()=>b.value.length-1),i=e.computed(()=>f.value.map((l,o)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+m.value,toMax:B(a+m.value),x:s.value.start+o*(s.value.width/(h.value+1)>n.padding?n.padding:s.value.width/(h.value+1)),y:s.value.bottom-s.value.height*B(a+m.value),id:`plot_${v.value}_${o}`,color:g.value?t.value.style.bar.color:t.value.style.area.useGradient?r.shiftHue(t.value.style.line.color,.05*(1-o/h.value)):t.value.style.line.color,width:s.value.width/(h.value+1)>n.padding?n.padding:s.value.width/(h.value+1)}})),W=e.computed(()=>{const l={x:i.value[0].x,y:n.value.height-6},o={x:i.value[i.value.length-1].x,y:n.value.height-6},a=[];return i.value.forEach(d=>{a.push(`${d.x},${d.y} `)}),[l.x,l.y,...a,o.x,o.y].toString()}),c=e.ref(void 0);function j(l,o){c.value=l,_("hoverIndex",{index:o})}function F(){c.value=void 0,_("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(k.value){const l=i.value.map(a=>a.absoluteValue),o=l.reduce((a,d)=>a+d,0);return{latest:i.value[i.value.length-1].absoluteValue,sum:o,average:o/i.value.length,median:r.calcMedian(l),trend:r.calcLinearProgression(i.value.map(({x:a,y:d,absoluteValue:I})=>({x:a,y:d,value:I}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),M=e.computed(()=>k.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),g=e.computed(()=>t.value.type&&t.value.type==="bar");function q(l,o){_("selectDatapoint",{datapoint:l,index:o})}return(l,o)=>(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&&p.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:C,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),k.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${n.value.width} ${n.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:hidden`)},[e.createVNode(R._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:n.value.width<=0?10:n.value.width,height:n.value.height<=0?10:n.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Z)):e.createCommentVNode("",!0),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(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,J),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,K)],8,Y),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,ee),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.shiftHue)(t.value.style.bar.color,.05)},null,8,te)],8,Q),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.shiftHue)(t.value.style.bar.color,.05)},null,8,ae),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,oe)],8,le)]),t.value.style.area.show&&!g.value&&i.value[0]?(e.openBlock(),e.createElementBlock("g",ne,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${i.value[0].x},${s.value.bottom} ${e.unref(r.createSmoothPath)(i.value)} L ${i.value.at(-1).x},${s.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(r.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(r.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ue))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!g.value?(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${e.unref(r.createSmoothPath)(i.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,se)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[d<i.value.length-1&&!t.value.style.line.smooth&&!g.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:i.value[d+1].x,y1:a.y,y2:i.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,ie)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:x.value,width:a.width,height:Math.abs(a.y-x.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,de)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||p.selectedIndex===d)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:s.value.top-6,y2:s.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,ce)):e.createCommentVNode("",!0)]))),256)),N.value<0?(e.openBlock(),e.createElementBlock("line",{key:3,x1:s.value.start,x2:s.value.start+s.value.width-16,y1:x.value,y2:x.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,ve)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:4},e.renderList(i.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||p.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,he)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),p.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:5,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:s.value.width+12+t.value.style.dataLabel.offsetX,y:n.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(c.value?e.unref(r.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(r.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(r.applyDataLabel)(t.value.style.dataLabel.formatter,M.value,e.unref(r.dataLabel)({p:t.value.style.dataLabel.prefix,v:M.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,ye)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(a,d)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(s.value.width/(h.value+1)>n.value.padding?n.value.padding:s.value.width/(h.value+1))/2,y:s.value.top-6,height:s.value.height+6,width:s.value.width/(h.value+1)>n.value.padding?n.value.padding:s.value.width/(h.value+1),fill:"transparent",onMouseenter:I=>j(a,d),onMouseleave:F,onClick:()=>q(a,d)},null,40,fe))),256)),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],12,X)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"source",ref:L,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),k.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))}},me=H._export_sfc(pe,[["__scopeId","data-v-16e41da8"]]);exports.default=me;
@@ -0,0 +1,420 @@
1
+ import { computed as v, ref as m, watch as U, onMounted as re, openBlock as n, createElementBlock as r, normalizeStyle as C, renderSlot as M, normalizeProps as ie, guardReactiveProps as de, createElementVNode as f, toDisplayString as X, createCommentVNode as c, unref as h, createVNode as ve, Fragment as A, renderList as D, createBlock as ce } from "vue";
2
+ import { u as he, c as ye, t as fe, C as Z, _ as T, o as pe, e as q, g as ge, w as I, $ as me, a0 as ke, X as be, s as P, R as H, i as Y, f as J } from "./index-CG_OTzik.js";
3
+ import { u as K } from "./useNestedProp-BZZvruew.js";
4
+ import _e from "./vue-ui-skeleton-B6hyEcxy.js";
5
+ import { t as xe, u as we } from "./useResponsive-CoxXLe23.js";
6
+ import { _ as $e } from "./PackageVersion-LRbiiLp0.js";
7
+ import { _ as Le } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
+ const Ne = ["id"], Ce = ["xmlns", "viewBox"], Me = ["width", "height"], Ie = ["id"], Pe = ["stop-color"], Ve = ["stop-color"], ze = ["id"], Se = ["stop-color"], We = ["stop-color"], Ae = ["id"], De = ["stop-color"], Te = ["stop-color"], Oe = { key: 1 }, Be = ["d", "fill"], Ee = ["d", "fill"], Fe = ["d", "stroke", "stroke-width"], Ge = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Re = ["x", "y", "width", "height", "fill", "rx"], je = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ue = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], Xe = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Ze = ["x", "y", "font-size", "font-weight", "fill"], qe = ["x", "y", "height", "width", "onMouseenter", "onClick"], He = {
9
+ __name: "vue-ui-sparkline",
10
+ props: {
11
+ config: {
12
+ type: Object,
13
+ default() {
14
+ return {};
15
+ }
16
+ },
17
+ dataset: {
18
+ type: Array,
19
+ default() {
20
+ return [];
21
+ }
22
+ },
23
+ showInfo: {
24
+ type: Boolean,
25
+ default: !0
26
+ },
27
+ selectedIndex: {
28
+ type: Number,
29
+ default: void 0
30
+ },
31
+ heightRatio: {
32
+ type: Number,
33
+ default: 1
34
+ },
35
+ forcedPadding: {
36
+ type: Number,
37
+ default: 30
38
+ }
39
+ },
40
+ emits: ["hoverIndex", "selectDatapoint"],
41
+ setup(_, { emit: V }) {
42
+ const s = _, { vue_ui_sparkline: Q } = he(), $ = v(() => !!s.dataset && s.dataset.length), p = m(ye()), z = m(null), O = m(null), B = m(null), e = v({
43
+ get: () => E(),
44
+ set: (t) => t
45
+ });
46
+ function E() {
47
+ const t = K({
48
+ userConfig: s.config,
49
+ defaultConfig: Q
50
+ });
51
+ let l = {};
52
+ return t.theme ? l = {
53
+ ...K({
54
+ userConfig: fe.vue_ui_sparkline[t.theme] || s.config,
55
+ defaultConfig: t
56
+ })
57
+ } : l = t, s.config && Z(s.config, "style.scaleMin") ? l.style.scaleMin = s.config.style.scaleMin : l.style.scaleMin = null, s.config && Z(s.config, "style.scaleMax") ? l.style.scaleMax = s.config.style.scaleMax : l.style.scaleMax = null, l;
58
+ }
59
+ const L = v(() => T({
60
+ data: s.dataset,
61
+ threshold: e.value.downsample.threshold
62
+ }));
63
+ U(() => s.config, (t) => {
64
+ e.value = E(), G(), u.value.chartWidth = e.value.style.chartWidth;
65
+ }, { deep: !0 }), U(() => s.dataset, (t) => {
66
+ b.value = T({
67
+ data: s.dataset.map((l) => ({
68
+ ...l,
69
+ value: [void 0].includes(l.value) ? null : l.value
70
+ })),
71
+ threshold: e.value.downsample.threshold
72
+ });
73
+ }, { deep: !0 });
74
+ const b = m(ee());
75
+ function ee() {
76
+ return T({
77
+ data: s.dataset.map((t) => e.value.style.animation.show ? {
78
+ ...t,
79
+ value: null
80
+ } : {
81
+ ...t,
82
+ value: [void 0].includes(t.value) ? null : t.value
83
+ }),
84
+ threshold: e.value.downsample.threshold
85
+ });
86
+ }
87
+ const F = m(null);
88
+ re(() => {
89
+ if (G(), e.value.style.animation.show && s.dataset.length > 1) {
90
+ let a = function() {
91
+ l < L.value.length ? (b.value.push(L.value[l]), setTimeout(() => {
92
+ requestAnimationFrame(a);
93
+ }, t)) : b.value = L.value, l += 1;
94
+ };
95
+ b.value = [];
96
+ const t = e.value.style.animation.animationFrames / s.dataset.length;
97
+ let l = 0;
98
+ a();
99
+ }
100
+ });
101
+ function G() {
102
+ if (pe(s.dataset) ? q({
103
+ componentName: "VueUiSparkline",
104
+ type: "dataset"
105
+ }) : s.dataset.forEach((t, l) => {
106
+ ge({
107
+ datasetObject: t,
108
+ requiredAttributes: ["period", "value"]
109
+ }).forEach((a) => {
110
+ q({
111
+ componentName: "VueUiSparkline",
112
+ type: "datasetSerieAttribute",
113
+ property: a,
114
+ index: l
115
+ });
116
+ });
117
+ }), e.value.responsive) {
118
+ const t = xe(() => {
119
+ const { width: l, height: a } = we({
120
+ chart: z.value,
121
+ title: e.value.style.title.show && s.showInfo ? O.value : null,
122
+ source: B.value
123
+ });
124
+ u.value.width = l, u.value.height = a, u.value.chartWidth = e.value.style.chartWidth / 500 * l, u.value.padding = s.forcedPadding / 500 * l;
125
+ });
126
+ F.value = new ResizeObserver(t), F.value.observe(z.value.parentNode);
127
+ }
128
+ }
129
+ const u = m({
130
+ height: 80 * s.heightRatio,
131
+ width: 500,
132
+ chartWidth: e.value.style.chartWidth,
133
+ padding: s.forcedPadding
134
+ }), te = m(6), o = v(() => ({
135
+ top: 12,
136
+ left: 0,
137
+ right: u.value.width,
138
+ bottom: u.value.height - 3,
139
+ start: s.showInfo && e.value.style.dataLabel.show && e.value.style.dataLabel.position === "left" ? u.value.width - u.value.chartWidth : u.value.padding,
140
+ width: s.showInfo && e.value.style.dataLabel.show ? u.value.chartWidth : u.value.width - u.value.padding,
141
+ height: u.value.height - 12
142
+ })), S = v(() => [null, void 0].includes(e.value.style.scaleMin) ? Math.min(...b.value.map((t) => isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0)) : e.value.style.scaleMin), ae = v(() => [null, void 0].includes(e.value.style.scaleMax) ? Math.max(...b.value.map((t) => isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0)) : e.value.style.scaleMax), x = v(() => {
143
+ const t = S.value >= 0 ? 0 : S.value;
144
+ return Math.abs(t);
145
+ }), le = v(() => ae.value + x.value + te.value), N = v(() => o.value.bottom - o.value.height * W(x.value));
146
+ function W(t) {
147
+ return t / le.value;
148
+ }
149
+ const g = v(() => L.value.length - 1), i = v(() => b.value.map((t, l) => {
150
+ const a = isNaN(t.value) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t.value) ? 0 : t.value || 0;
151
+ return {
152
+ absoluteValue: a,
153
+ period: t.period,
154
+ plotValue: a + x.value,
155
+ toMax: W(a + x.value),
156
+ x: o.value.start + l * (o.value.width / (g.value + 1) > u.padding ? u.padding : o.value.width / (g.value + 1)),
157
+ y: o.value.bottom - o.value.height * W(a + x.value),
158
+ id: `plot_${p.value}_${l}`,
159
+ color: w.value ? e.value.style.bar.color : e.value.style.area.useGradient ? I(e.value.style.line.color, 0.05 * (1 - l / g.value)) : e.value.style.line.color,
160
+ width: o.value.width / (g.value + 1) > u.padding ? u.padding : o.value.width / (g.value + 1)
161
+ };
162
+ })), ue = v(() => {
163
+ const t = { x: i.value[0].x, y: u.value.height - 6 }, l = { x: i.value[i.value.length - 1].x, y: u.value.height - 6 }, a = [];
164
+ return i.value.forEach((d) => {
165
+ a.push(`${d.x},${d.y} `);
166
+ }), [t.x, t.y, ...a, l.x, l.y].toString();
167
+ }), y = m(void 0);
168
+ function se(t, l) {
169
+ y.value = t, V("hoverIndex", { index: l });
170
+ }
171
+ function oe() {
172
+ y.value = void 0, V("hoverIndex", { index: void 0 });
173
+ }
174
+ const k = v(() => {
175
+ if ($.value) {
176
+ const t = i.value.map((a) => a.absoluteValue), l = t.reduce((a, d) => a + d, 0);
177
+ return {
178
+ latest: i.value[i.value.length - 1].absoluteValue,
179
+ sum: l,
180
+ average: l / i.value.length,
181
+ median: me(t),
182
+ trend: ke(i.value.map(({ x: a, y: d, absoluteValue: j }) => ({
183
+ x: a,
184
+ y: d,
185
+ value: j
186
+ }))).trend
187
+ };
188
+ } else
189
+ return {
190
+ latest: null,
191
+ sum: null,
192
+ average: null,
193
+ median: null,
194
+ trend: null
195
+ };
196
+ }), R = v(() => $.value ? e.value.style.dataLabel.valueType === "latest" ? k.value.latest : e.value.style.dataLabel.valueType === "sum" ? k.value.sum : e.value.style.dataLabel.valueType === "average" ? k.value.average : 0 : 0), w = v(() => e.value.type && e.value.type === "bar");
197
+ function ne(t, l) {
198
+ V("selectDatapoint", { datapoint: t, index: l });
199
+ }
200
+ return (t, l) => (n(), r("div", {
201
+ ref_key: "sparklineChart",
202
+ ref: z,
203
+ class: "vue-ui-sparkline",
204
+ id: p.value,
205
+ style: C(`width:100%;font-family:${e.value.style.fontFamily};`)
206
+ }, [
207
+ M(t.$slots, "before", ie(de({
208
+ selected: y.value,
209
+ latest: k.value.latest,
210
+ sum: k.value.sum,
211
+ average: k.value.average,
212
+ median: k.value.median,
213
+ trend: k.value.trend
214
+ })), void 0, !0),
215
+ e.value.style.title.show && _.showInfo ? (n(), r("div", {
216
+ key: 0,
217
+ ref_key: "chartTitle",
218
+ ref: O,
219
+ class: "vue-ui-sparkline-title",
220
+ style: C(`display:flex;align-items:center;width:100%;color:${e.value.style.title.color};background:${e.value.style.backgroundColor};justify-content:${e.value.style.title.textAlign === "left" ? "flex-start" : e.value.style.title.textAlign === "right" ? "flex-end" : "center"};height:${e.value.style.title.fontSize * 2}px;font-size:${e.value.style.title.fontSize}px;font-weight:${e.value.style.title.bold ? "bold" : "normal"};`)
221
+ }, [
222
+ f("span", {
223
+ style: C(`padding:${e.value.style.title.textAlign === "left" ? "0 0 0 12px" : e.value.style.title.textAlign === "right" ? "0 12px 0 0" : "0"}`)
224
+ }, X(y.value ? y.value.period : e.value.style.title.text), 5)
225
+ ], 4)) : c("", !0),
226
+ $.value ? (n(), r("svg", {
227
+ key: 1,
228
+ xmlns: h(be),
229
+ viewBox: `0 0 ${u.value.width} ${u.value.height}`,
230
+ style: C(`background:${e.value.style.backgroundColor};overflow:hidden`)
231
+ }, [
232
+ ve($e),
233
+ t.$slots["chart-background"] ? (n(), r("foreignObject", {
234
+ key: 0,
235
+ x: 0,
236
+ y: 0,
237
+ width: u.value.width <= 0 ? 10 : u.value.width,
238
+ height: u.value.height <= 0 ? 10 : u.value.height,
239
+ style: {
240
+ pointerEvents: "none"
241
+ }
242
+ }, [
243
+ M(t.$slots, "chart-background", {}, void 0, !0)
244
+ ], 8, Me)) : c("", !0),
245
+ f("defs", null, [
246
+ f("linearGradient", {
247
+ x1: "0%",
248
+ y1: "0%",
249
+ x2: "100%",
250
+ y2: "0%",
251
+ id: `sparkline_gradient_${p.value}`
252
+ }, [
253
+ f("stop", {
254
+ offset: "0%",
255
+ "stop-color": h(P)(h(I)(e.value.style.area.color, 0.05), e.value.style.area.opacity)
256
+ }, null, 8, Pe),
257
+ f("stop", {
258
+ offset: "100%",
259
+ "stop-color": h(P)(e.value.style.area.color, e.value.style.area.opacity)
260
+ }, null, 8, Ve)
261
+ ], 8, Ie),
262
+ f("linearGradient", {
263
+ x2: "0%",
264
+ y2: "100%",
265
+ id: `sparkline_bar_gradient_pos_${p.value}`
266
+ }, [
267
+ f("stop", {
268
+ offset: "0%",
269
+ "stop-color": e.value.style.bar.color
270
+ }, null, 8, Se),
271
+ f("stop", {
272
+ offset: "100%",
273
+ "stop-color": h(I)(e.value.style.bar.color, 0.05)
274
+ }, null, 8, We)
275
+ ], 8, ze),
276
+ f("linearGradient", {
277
+ x2: "0%",
278
+ y2: "100%",
279
+ id: `sparkline_bar_gradient_neg_${p.value}`
280
+ }, [
281
+ f("stop", {
282
+ offset: "0%",
283
+ "stop-color": h(I)(e.value.style.bar.color, 0.05)
284
+ }, null, 8, De),
285
+ f("stop", {
286
+ offset: "100%",
287
+ "stop-color": e.value.style.bar.color
288
+ }, null, 8, Te)
289
+ ], 8, Ae)
290
+ ]),
291
+ e.value.style.area.show && !w.value && i.value[0] ? (n(), r("g", Oe, [
292
+ e.value.style.line.smooth ? (n(), r("path", {
293
+ key: 0,
294
+ d: `M ${i.value[0].x},${o.value.bottom} ${h(H)(i.value)} L ${i.value.at(-1).x},${o.value.bottom} Z`,
295
+ fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : h(P)(e.value.style.area.color, e.value.style.area.opacity)
296
+ }, null, 8, Be)) : (n(), r("path", {
297
+ key: 1,
298
+ d: `M${ue.value}Z`,
299
+ fill: e.value.style.area.useGradient ? `url(#sparkline_gradient_${p.value})` : h(P)(e.value.style.area.color, e.value.style.area.opacity)
300
+ }, null, 8, Ee))
301
+ ])) : c("", !0),
302
+ e.value.style.line.smooth && !w.value ? (n(), r("path", {
303
+ key: 2,
304
+ d: `M ${h(H)(i.value)}`,
305
+ stroke: e.value.style.line.color,
306
+ fill: "none",
307
+ "stroke-width": e.value.style.line.strokeWidth,
308
+ "stroke-linecap": "round"
309
+ }, null, 8, Fe)) : c("", !0),
310
+ (n(!0), r(A, null, D(i.value, (a, d) => (n(), r("g", null, [
311
+ d < i.value.length - 1 && !e.value.style.line.smooth && !w.value ? (n(), r("line", {
312
+ key: 0,
313
+ x1: a.x,
314
+ x2: i.value[d + 1].x,
315
+ y1: a.y,
316
+ y2: i.value[d + 1].y,
317
+ stroke: a.color,
318
+ "stroke-width": e.value.style.line.strokeWidth,
319
+ "stroke-linecap": "round",
320
+ "stroke-linejoin": "round",
321
+ "shape-rendering": "geometricPrecision"
322
+ }, null, 8, Ge)) : c("", !0),
323
+ w.value ? (n(), r("rect", {
324
+ key: 1,
325
+ x: a.x - a.width / 2,
326
+ y: a.absoluteValue > 0 ? a.y : N.value,
327
+ width: a.width,
328
+ height: Math.abs(a.y - N.value),
329
+ fill: a.absoluteValue > 0 ? `url(#sparkline_bar_gradient_pos_${p.value})` : `url(#sparkline_bar_gradient_neg_${p.value})`,
330
+ rx: e.value.style.bar.borderRadius
331
+ }, null, 8, Re)) : c("", !0),
332
+ e.value.style.verticalIndicator.show && (y.value && a.id === y.value.id || _.selectedIndex === d) ? (n(), r("line", {
333
+ key: 2,
334
+ x1: a.x,
335
+ x2: a.x,
336
+ y1: o.value.top - 6,
337
+ y2: o.value.bottom,
338
+ stroke: e.value.style.verticalIndicator.color || a.color,
339
+ "stroke-width": e.value.style.verticalIndicator.strokeWidth,
340
+ "stroke-linecap": "round",
341
+ "stroke-dasharray": e.value.style.verticalIndicator.strokeDasharray || 0
342
+ }, null, 8, je)) : c("", !0)
343
+ ]))), 256)),
344
+ S.value < 0 ? (n(), r("line", {
345
+ key: 3,
346
+ x1: o.value.start,
347
+ x2: o.value.start + o.value.width - 16,
348
+ y1: N.value,
349
+ y2: N.value,
350
+ stroke: e.value.style.zeroLine.color,
351
+ "stroke-dasharray": e.value.style.zeroLine.strokeWidth * 2,
352
+ "stroke-width": e.value.style.zeroLine.strokeWidth,
353
+ "stroke-linecap": "round"
354
+ }, null, 8, Ue)) : c("", !0),
355
+ e.value.style.plot.show ? (n(!0), r(A, { key: 4 }, D(i.value, (a, d) => (n(), r("g", null, [
356
+ y.value && a.id === y.value.id || _.selectedIndex === d ? (n(), r("circle", {
357
+ key: 0,
358
+ cx: a.x,
359
+ cy: a.y,
360
+ r: e.value.style.plot.radius,
361
+ fill: a.color,
362
+ stroke: e.value.style.plot.stroke,
363
+ "stroke-width": e.value.style.plot.strokeWidth
364
+ }, null, 8, Xe)) : c("", !0)
365
+ ]))), 256)) : c("", !0),
366
+ _.showInfo && e.value.style.dataLabel.show ? (n(), r("text", {
367
+ key: 5,
368
+ x: e.value.style.dataLabel.position === "left" ? 12 + e.value.style.dataLabel.offsetX : o.value.width + 12 + e.value.style.dataLabel.offsetX,
369
+ y: u.value.height / 2 + e.value.style.dataLabel.fontSize / 2.5 + e.value.style.dataLabel.offsetY,
370
+ "font-size": e.value.style.dataLabel.fontSize,
371
+ "font-weight": e.value.style.dataLabel.bold ? "bold" : "normal",
372
+ fill: e.value.style.dataLabel.color
373
+ }, X(y.value ? h(Y)(
374
+ e.value.style.dataLabel.formatter,
375
+ y.value.absoluteValue,
376
+ h(J)({ p: e.value.style.dataLabel.prefix, v: y.value.absoluteValue, s: e.value.style.dataLabel.suffix, r: e.value.style.dataLabel.roundingValue }),
377
+ { datapoint: y.value }
378
+ ) : h(Y)(
379
+ e.value.style.dataLabel.formatter,
380
+ R.value,
381
+ h(J)({ p: e.value.style.dataLabel.prefix, v: R.value, s: e.value.style.dataLabel.suffix, r: e.value.style.dataLabel.roundingValue })
382
+ )), 9, Ze)) : c("", !0),
383
+ (n(!0), r(A, null, D(i.value, (a, d) => (n(), r("rect", {
384
+ x: a.x - (o.value.width / (g.value + 1) > u.value.padding ? u.value.padding : o.value.width / (g.value + 1)) / 2,
385
+ y: o.value.top - 6,
386
+ height: o.value.height + 6,
387
+ width: o.value.width / (g.value + 1) > u.value.padding ? u.value.padding : o.value.width / (g.value + 1),
388
+ fill: "transparent",
389
+ onMouseenter: (j) => se(a, d),
390
+ onMouseleave: oe,
391
+ onClick: () => ne(a, d)
392
+ }, null, 40, qe))), 256)),
393
+ M(t.$slots, "svg", { svg: u.value }, void 0, !0)
394
+ ], 12, Ce)) : c("", !0),
395
+ t.$slots.source ? (n(), r("div", {
396
+ key: 2,
397
+ ref_key: "source",
398
+ ref: B,
399
+ dir: "auto"
400
+ }, [
401
+ M(t.$slots, "source", {}, void 0, !0)
402
+ ], 512)) : c("", !0),
403
+ $.value ? c("", !0) : (n(), ce(_e, {
404
+ key: 3,
405
+ config: {
406
+ type: "sparkline",
407
+ style: {
408
+ backgroundColor: e.value.style.backgroundColor,
409
+ sparkline: {
410
+ color: "#CCCCCC"
411
+ }
412
+ }
413
+ }
414
+ }, null, 8, ["config"]))
415
+ ], 12, Ne));
416
+ }
417
+ }, lt = /* @__PURE__ */ Le(He, [["__scopeId", "data-v-16e41da8"]]);
418
+ export {
419
+ lt as default
420
+ };
@@ -1,9 +1,9 @@
1
1
  import { useSlots as ne, onMounted as Y, computed as m, ref as d, watch as G, openBlock as s, createElementBlock as r, normalizeStyle as v, createElementVNode as p, toDisplayString as w, createCommentVNode as y, unref as C, createVNode as q, Fragment as x, renderList as $, normalizeClass as F, createBlock as ue, withCtx as H, renderSlot as U, normalizeProps as X, guardReactiveProps as J } from "vue";
2
- import { u as ie, c as K, t as ce, a as de, p as i, d as N, b as ve, o as pe, e as Q, g as ge, f as V, X as fe, s as he, w as ye, i as Z, x as me } from "./index-B9RAElpI.js";
3
- import { u as ee } from "./useNestedProp-DuruL3Nt.js";
4
- import ke from "./vue-ui-skeleton-DVYD_VSe.js";
5
- import { _ as be } from "./PackageVersion-C_FFs0BP.js";
6
- import { _ as _e } from "./Tooltip-DDJ2Wvjy.js";
2
+ import { u as ie, c as K, t as ce, a as de, p as i, d as N, b as ve, o as pe, e as Q, g as ge, f as V, X as fe, s as he, w as ye, i as Z, x as me } from "./index-CG_OTzik.js";
3
+ import { u as ee } from "./useNestedProp-BZZvruew.js";
4
+ import ke from "./vue-ui-skeleton-B6hyEcxy.js";
5
+ import { _ as be } from "./PackageVersion-LRbiiLp0.js";
6
+ import { _ as _e } from "./Tooltip-CoahRzyE.js";
7
7
  import { _ as we } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const Ce = ["xmlns", "viewBox"], xe = ["id"], $e = ["stop-color"], Se = ["stop-color"], ze = ["stop-color"], Pe = {
9
9
  id: "stackPill",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-DaDv7p0W.cjs"),V=require("./useNestedProp-DkpuL8Iv.cjs"),q=require("./vue-ui-skeleton-B24XJJ2p.cjs"),O=require("./PackageVersion-nr7f_VNw.cjs"),U=require("./Tooltip-DZuVxmLc.cjs"),M=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["xmlns","viewBox"],H=["id"],I=["stop-color"],R=["stop-color"],W=["stop-color"],Y={id:"stackPill",clipPathUnits:"objectBoundingBox"},G=["fill"],X={key:0,"clip-path":"url(#stackPill)"},J=["x","width","height","fill"],K=["x","width","height","fill","stroke"],Q=["onClick","x","width","height","onMouseenter"],Z=["width","height","rx"],ee=["onClick"],te={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},le=["height","width"],oe=["fill"],ae={key:4,ref:"source",dir:"auto"},re={__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(),F=e.useSlots();e.onMounted(()=>{F["chart-background"]&&console.warn("VueUiSparkStackbar does not support the #chart-background slot.")});const x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),_=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=>{v.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)),v=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 p=function(){r+=o/l,r<o?(v.value=v.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(p)):(g.value=!1,v.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,p()}});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(()=>v.value.map((l,n)=>{const o=l.value||0,r=o/N.value,p=isNaN(r)?0:r,s=p*c.value.width;return{...l,value:o,proportion:p,width:s,proportionLabel:a.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),C=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function T(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<v.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 A({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(O._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,I),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,R),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,W)],8,H))),128)),e.createElementVNode("clipPath",Y,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,G)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",X,[(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,J))),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,K))),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:()=>A({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=p=>{b.value=!1,m.value=null})},null,42,Q))),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,Z))],8,j)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(q.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:p=>{T(r),z(o,r)}},[e.createElementVNode("div",te,[(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,oe)],8,le)),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,ee))),256))],4)):e.createCommentVNode("",!0),e.createVNode(U._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",ae,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},ne=M._export_sfc(re,[["__scopeId","data-v-72244c73"]]);exports.default=ne;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-V6tl1xgQ.cjs"),V=require("./useNestedProp--db71Vbu.cjs"),q=require("./vue-ui-skeleton-D56sSIBO.cjs"),O=require("./PackageVersion-B7-YDa6h.cjs"),U=require("./Tooltip-DZ1uTqBW.cjs"),M=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["xmlns","viewBox"],H=["id"],I=["stop-color"],R=["stop-color"],W=["stop-color"],Y={id:"stackPill",clipPathUnits:"objectBoundingBox"},G=["fill"],X={key:0,"clip-path":"url(#stackPill)"},J=["x","width","height","fill"],K=["x","width","height","fill","stroke"],Q=["onClick","x","width","height","onMouseenter"],Z=["width","height","rx"],ee=["onClick"],te={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},le=["height","width"],oe=["fill"],ae={key:4,ref:"source",dir:"auto"},re={__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(),F=e.useSlots();e.onMounted(()=>{F["chart-background"]&&console.warn("VueUiSparkStackbar does not support the #chart-background slot.")});const x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),_=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=>{v.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)),v=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 p=function(){r+=o/l,r<o?(v.value=v.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(p)):(g.value=!1,v.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,p()}});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(()=>v.value.map((l,n)=>{const o=l.value||0,r=o/N.value,p=isNaN(r)?0:r,s=p*c.value.width;return{...l,value:o,proportion:p,width:s,proportionLabel:a.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),C=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function T(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<v.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 A({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(O._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,I),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,R),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,W)],8,H))),128)),e.createElementVNode("clipPath",Y,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,G)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",X,[(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,J))),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,K))),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:()=>A({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=p=>{b.value=!1,m.value=null})},null,42,Q))),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,Z))],8,j)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(q.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:p=>{T(r),z(o,r)}},[e.createElementVNode("div",te,[(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,oe)],8,le)),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,ee))),256))],4)):e.createCommentVNode("",!0),e.createVNode(U._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",ae,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},ne=M._export_sfc(re,[["__scopeId","data-v-72244c73"]]);exports.default=ne;
@@ -1,17 +1,17 @@
1
1
  import { computed as w, ref as y, onMounted as je, watch as et, nextTick as ne, openBlock as s, createElementBlock as i, normalizeClass as xe, normalizeStyle as B, unref as p, createBlock as J, createCommentVNode as h, renderSlot as k, createVNode as ue, createSlots as Mt, withCtx as C, normalizeProps as O, guardReactiveProps as P, Fragment as v, renderList as f, createElementVNode as U, toDisplayString as S, createTextVNode as Tt } from "vue";
2
- import { u as Nt, c as tt, t as It, a as Ot, p as ce, C as ve, b as Pt, o as At, e as at, g as Vt, d as Rt, a7 as he, a3 as lt, D as rt, X as Et, l as Ft, G as ot, f as W, x as st, i as it, y as Dt, q as Ht, r as Bt } from "./index-B9RAElpI.js";
3
- import { u as nt } from "./useNestedProp-DuruL3Nt.js";
2
+ import { u as Nt, c as tt, t as It, a as Ot, p as ce, C as ve, b as Pt, o as At, e as at, g as Vt, d as Rt, a7 as he, a3 as lt, D as rt, X as Et, l as Ft, G as ot, f as W, x as st, i as it, y as Dt, q as Ht, r as Bt } from "./index-CG_OTzik.js";
3
+ import { u as nt } from "./useNestedProp-BZZvruew.js";
4
4
  import { t as Ut, u as Wt } from "./useResponsive-CoxXLe23.js";
5
- import { u as Yt, U as Xt } from "./usePrinter-CwTAwqtF.js";
6
- import { S as Gt } from "./Slicer-Duke9qno.js";
7
- import { _ as Jt } from "./Tooltip-DDJ2Wvjy.js";
8
- import { _ as qt } from "./Title-zZtEcB9F.js";
9
- import { L as Zt } from "./Legend-f52bnttJ.js";
10
- import Kt from "./vue-ui-accordion-rNA598L6.js";
11
- import { D as Qt } from "./DataTable-CFUKU8PU.js";
12
- import jt from "./vue-ui-skeleton-DVYD_VSe.js";
13
- import { _ as ea } from "./PackageVersion-C_FFs0BP.js";
14
- import { P as ta } from "./PenAndPaper-Dx24BtRW.js";
5
+ import { u as Yt, U as Xt } from "./usePrinter-CxBwzZkb.js";
6
+ import { S as Gt } from "./Slicer-DGn72_0M.js";
7
+ import { _ as Jt } from "./Tooltip-CoahRzyE.js";
8
+ import { _ as qt } from "./Title-Zm0LCGPS.js";
9
+ import { L as Zt } from "./Legend-Cq1rcFzv.js";
10
+ import Kt from "./vue-ui-accordion-C2IbGLRv.js";
11
+ import { D as Qt } from "./DataTable-CcW8SHH2.js";
12
+ import jt from "./vue-ui-skeleton-B6hyEcxy.js";
13
+ import { _ as ea } from "./PackageVersion-LRbiiLp0.js";
14
+ import { P as ta } from "./PenAndPaper-BCjJ-td_.js";
15
15
  import { u as aa } from "./useUserOptionState-BIvW1Kz7.js";
16
16
  import { _ as la } from "./_plugin-vue_export-helper-CHgC5LLL.js";
17
17
  const ra = ["id"], oa = ["xmlns", "viewBox"], sa = ["x", "y", "width", "height"], ia = { key: 1 }, na = ["id"], ua = ["stop-color"], ca = ["stop-color"], va = ["stop-color"], ha = ["x1", "x2", "y1", "y2", "stroke"], da = ["x1", "x2", "y1", "y2", "stroke"], ya = ["x1", "x2", "y1", "y2", "stroke"], ga = ["x1", "x2", "y1", "y2", "stroke"], ba = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], fa = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], ma = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], pa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], xa = ["x", "y", "font-size", "fill", "font-weight"], ka = ["transform", "font-size", "fill", "font-weight"], wa = ["x", "y", "font-size", "fill", "font-weight"], za = { key: 0 }, Ca = ["x", "y", "font-size", "font-weight", "fill"], La = ["x", "y", "font-size", "fill", "font-weight"], _a = { key: 0 }, Sa = ["x", "y", "font-size", "font-weight", "fill"], $a = ["x1", "x2", "y1", "y2", "stroke"], Ma = ["x", "y", "font-size", "font-weight", "fill"], Ta = ["x1", "x2", "y1", "y2", "stroke"], Na = ["font-size", "font-weight", "fill", "text-anchor", "transform"], Ia = { key: 0 }, Oa = { key: 1 }, Pa = ["text-anchor", "font-size", "font-weight", "fill", "transform", "onClick"], Aa = { key: 0 }, Va = { key: 1 }, Ra = ["font-size", "font-weight", "fill", "x", "y", "onClick"], Ea = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Fa = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Da = {