vue-data-ui 2.4.3 → 2.4.4

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 (181) hide show
  1. package/README.md +3 -1
  2. package/dist/{Arrow-C7lNL7sY.js → Arrow-AxsI-FAh.js} +1 -1
  3. package/dist/{Arrow-Dz6AomGr.cjs → Arrow-W6XO2WVI.cjs} +1 -1
  4. package/dist/{BaseIcon-uALK38Ov.cjs → BaseIcon-BTn_oML7.cjs} +1 -1
  5. package/dist/{BaseIcon-BbvG1AlW.js → BaseIcon-BX3x6oa7.js} +1 -1
  6. package/dist/{DataTable-DYqC2pqu.js → DataTable-BI1tjiA_.js} +2 -2
  7. package/dist/{DataTable-DTzynbND.cjs → DataTable-RUQ1G_6L.cjs} +1 -1
  8. package/dist/{Legend-Cgw4lO2O.cjs → Legend-B86sMXn7.cjs} +1 -1
  9. package/dist/{Legend-DNgTCgEK.js → Legend-CRMHjbGw.js} +1 -1
  10. package/dist/{PackageVersion-VkaUzgmt.js → PackageVersion-Clrfvyd8.js} +1 -1
  11. package/dist/{PackageVersion-DwI-KhXH.cjs → PackageVersion-CowXQ4IM.cjs} +1 -1
  12. package/dist/{PenAndPaper-DAZYA8Ew.js → PenAndPaper-BQzgk5kO.js} +2 -2
  13. package/dist/{PenAndPaper-CDFVOo7X.cjs → PenAndPaper-DBSxk9Xk.cjs} +1 -1
  14. package/dist/{Shape-Bwon0l0g.js → Shape-DYNtRer6.js} +1 -1
  15. package/dist/{Shape-D2Dpshg1.cjs → Shape-qK3MNdTg.cjs} +1 -1
  16. package/dist/{Slicer-TfpN2Cr4.js → Slicer-DFPDip5U.js} +3 -3
  17. package/dist/{Slicer-uSjfNJjG.cjs → Slicer-NlxLkUso.cjs} +1 -1
  18. package/dist/{Title-C5pIfQAz.js → Title-710895ks.js} +1 -1
  19. package/dist/{Title-0Tp4hZ4u.cjs → Title-CUN1T6KC.cjs} +1 -1
  20. package/dist/{Tooltip-9Tp2Yrd1.cjs → Tooltip-BapDtYOM.cjs} +1 -1
  21. package/dist/{Tooltip-Cz24YLfw.js → Tooltip-CPlG_yQU.js} +1 -1
  22. package/dist/{index-eFox7weK.cjs → index-CcykRspI.cjs} +1 -1
  23. package/dist/{index-Bya_q1J-.js → index-DCsPHn9C.js} +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/{useNestedProp-B33hazbH.js → useNestedProp-DdSlLeTW.js} +1 -1
  26. package/dist/{useNestedProp-BkgEhTQY.cjs → useNestedProp-XtPlFP9O.cjs} +1 -1
  27. package/dist/{usePrinter-CSRFnDBU.cjs → usePrinter-BcE45wW6.cjs} +1 -1
  28. package/dist/{usePrinter-CiHd1FwD.js → usePrinter-siG3sKWo.js} +1 -1
  29. package/dist/useResponsive-BJ7DTGpm.cjs +1 -0
  30. package/dist/{useResponsive-BY8tgM1n.js → useResponsive-CoxXLe23.js} +8 -7
  31. package/dist/{vue-data-ui-BTtxyUc3.cjs → vue-data-ui-C0o1kZzC.cjs} +1 -1
  32. package/dist/{vue-data-ui-Bduq4f2p.js → vue-data-ui-D_MTGc8j.js} +58 -58
  33. package/dist/vue-data-ui.cjs +1 -1
  34. package/dist/vue-data-ui.js +1 -1
  35. package/dist/{vue-ui-3d-bar-BUEq_VdY.js → vue-ui-3d-bar-BdzWvy4d.js} +9 -9
  36. package/dist/{vue-ui-3d-bar-B-P7PMHs.cjs → vue-ui-3d-bar-C298Bf3V.cjs} +1 -1
  37. package/dist/{vue-ui-accordion-TEMpM1hO.cjs → vue-ui-accordion-B7PTyFVk.cjs} +1 -1
  38. package/dist/{vue-ui-accordion-DfUfL2dI.js → vue-ui-accordion-D4Er5Dy5.js} +3 -3
  39. package/dist/vue-ui-age-pyramid-BIcB5vtU.cjs +1 -0
  40. package/dist/{vue-ui-age-pyramid-CH72tAMb.js → vue-ui-age-pyramid-CHEdFQb7.js} +145 -137
  41. package/dist/{vue-ui-annotator-DPeJ2its.js → vue-ui-annotator-CqM_1HlB.js} +1 -1
  42. package/dist/{vue-ui-annotator-DU_DJKCw.cjs → vue-ui-annotator-eGtZcHeb.cjs} +1 -1
  43. package/dist/{vue-ui-bullet-CtP3MlUT.js → vue-ui-bullet-DBk50kIe.js} +75 -69
  44. package/dist/vue-ui-bullet-DURgZGgp.cjs +34 -0
  45. package/dist/{vue-ui-candlestick-DDil13a0.js → vue-ui-candlestick-Bo41qkGe.js} +240 -232
  46. package/dist/vue-ui-candlestick-CP4Z-29b.cjs +2 -0
  47. package/dist/{vue-ui-carousel-table-BaeIxyc0.js → vue-ui-carousel-table-CkNOqa9q.js} +4 -4
  48. package/dist/{vue-ui-carousel-table-C7SJIOG-.cjs → vue-ui-carousel-table-lMqx64wd.cjs} +1 -1
  49. package/dist/{vue-ui-chestnut-BczSJF6S.js → vue-ui-chestnut-CNWq-epB.js} +262 -256
  50. package/dist/vue-ui-chestnut-qxzF2ND7.cjs +6 -0
  51. package/dist/{vue-ui-cursor-Dg_Dmww-.js → vue-ui-cursor-B4m30Gqz.js} +2 -2
  52. package/dist/{vue-ui-cursor-C2Pj_CI_.cjs → vue-ui-cursor-BEv39HVY.cjs} +1 -1
  53. package/dist/{vue-ui-dashboard-Bul9dqx1.js → vue-ui-dashboard-BL9IgDDx.js} +2 -2
  54. package/dist/{vue-ui-dashboard-Cg020NiT.cjs → vue-ui-dashboard-DnoXstlp.cjs} +1 -1
  55. package/dist/{vue-ui-digits-B8iAa4YZ.js → vue-ui-digits-CVPDJ6tl.js} +2 -2
  56. package/dist/{vue-ui-digits-Ctgd84JR.cjs → vue-ui-digits-D1RaU4V-.cjs} +1 -1
  57. package/dist/{vue-ui-donut-DUcp-fat.js → vue-ui-donut-C65SAJKb.js} +338 -330
  58. package/dist/vue-ui-donut-CMC92CXL.cjs +1 -0
  59. package/dist/vue-ui-donut-evolution-7gIM4bVk.cjs +1 -0
  60. package/dist/{vue-ui-donut-evolution-C_YMbTwq.js → vue-ui-donut-evolution-BFbBlmBx.js} +163 -156
  61. package/dist/{vue-ui-dumbbell-Buwngz_V.js → vue-ui-dumbbell-BnxRfvv0.js} +208 -200
  62. package/dist/vue-ui-dumbbell-OCo67ZKp.cjs +9 -0
  63. package/dist/vue-ui-flow-BPnpYrzb.cjs +1 -0
  64. package/dist/{vue-ui-flow-Bz3c0K5P.js → vue-ui-flow-Cra_F-tK.js} +130 -124
  65. package/dist/vue-ui-galaxy-3zTk9Pr1.cjs +1 -0
  66. package/dist/{vue-ui-galaxy-Cjh0XGTX.js → vue-ui-galaxy-DlJ7v0aD.js} +125 -119
  67. package/dist/{vue-ui-gauge-B1UvGkQa.js → vue-ui-gauge-CsqVvNxE.js} +167 -159
  68. package/dist/vue-ui-gauge-DcUNJZI1.cjs +1 -0
  69. package/dist/{vue-ui-gizmo-DFW6HnHp.cjs → vue-ui-gizmo-BkkLoCyx.cjs} +1 -1
  70. package/dist/{vue-ui-gizmo-DUQ4t-At.js → vue-ui-gizmo-Peyy8li7.js} +3 -3
  71. package/dist/vue-ui-heatmap-DYb831An.cjs +1 -0
  72. package/dist/{vue-ui-heatmap-C-poazUw.js → vue-ui-heatmap-i4HFM04D.js} +156 -149
  73. package/dist/{vue-ui-kpi-Z4Oi4raz.cjs → vue-ui-kpi-CCrdcv3r.cjs} +1 -1
  74. package/dist/{vue-ui-kpi-DXe-vxAk.js → vue-ui-kpi-gSKVVqZg.js} +3 -3
  75. package/dist/{vue-ui-mini-loader-MMvpm9pz.cjs → vue-ui-mini-loader-CqutMcQI.cjs} +1 -1
  76. package/dist/{vue-ui-mini-loader-BVtHTqxS.js → vue-ui-mini-loader-D7Jk1LJb.js} +2 -2
  77. package/dist/{vue-ui-molecule-BaJpDZND.js → vue-ui-molecule-CgdepnhM.js} +109 -103
  78. package/dist/vue-ui-molecule-CwUObXAx.cjs +1 -0
  79. package/dist/{vue-ui-mood-radar-BUNDwsEI.js → vue-ui-mood-radar-Bxro4962.js} +173 -166
  80. package/dist/vue-ui-mood-radar-RQFKS7Br.cjs +1 -0
  81. package/dist/{vue-ui-nested-donuts-mDy2hXa6.js → vue-ui-nested-donuts-B7dXBejH.js} +311 -303
  82. package/dist/vue-ui-nested-donuts-D8ZGqIGC.cjs +17 -0
  83. package/dist/vue-ui-onion-Dtt0kw8E.cjs +5 -0
  84. package/dist/{vue-ui-onion-DwFG3HAI.js → vue-ui-onion-i52wztm0.js} +149 -141
  85. package/dist/vue-ui-parallel-coordinate-plot-DNK0BrBy.cjs +8 -0
  86. package/dist/{vue-ui-parallel-coordinate-plot-ImET_zeo.js → vue-ui-parallel-coordinate-plot-DUssrm08.js} +186 -178
  87. package/dist/{vue-ui-quadrant-BeveRihK.js → vue-ui-quadrant-BORPtgQO.js} +225 -217
  88. package/dist/vue-ui-quadrant-a_I5E71f.cjs +1 -0
  89. package/dist/vue-ui-quick-chart-BpPDfK78.cjs +15 -0
  90. package/dist/{vue-ui-quick-chart-DAhllTfa.js → vue-ui-quick-chart-yb1FzVdt.js} +386 -378
  91. package/dist/{vue-ui-radar-BllatzRa.js → vue-ui-radar-CoCbl19A.js} +172 -164
  92. package/dist/vue-ui-radar-DZMngiqq.cjs +1 -0
  93. package/dist/{vue-ui-rating-D1ykV4xO.js → vue-ui-rating-D-zwuvLK.js} +2 -2
  94. package/dist/{vue-ui-rating-BoZo7caL.cjs → vue-ui-rating-nTJ8DDhG.cjs} +1 -1
  95. package/dist/vue-ui-relation-circle-CW9qozhJ.js +366 -0
  96. package/dist/vue-ui-relation-circle-Wj_yrVJc.cjs +1 -0
  97. package/dist/vue-ui-rings-BZaZIGEz.cjs +2 -0
  98. package/dist/{vue-ui-rings-B-ZcX6y1.js → vue-ui-rings-Bx2GEh6d.js} +196 -188
  99. package/dist/{vue-ui-scatter-DG43ck1g.js → vue-ui-scatter-BARiPzro.js} +288 -280
  100. package/dist/vue-ui-scatter-C-i1NZgz.cjs +1 -0
  101. package/dist/{vue-ui-screenshot-p3ca8cAl.js → vue-ui-screenshot-CuiJqlfo.js} +1 -1
  102. package/dist/{vue-ui-screenshot-C1JBP_N0.cjs → vue-ui-screenshot-CwOoftGV.cjs} +1 -1
  103. package/dist/{vue-ui-skeleton-BYssP0K4.js → vue-ui-skeleton-DNuwx6_y.js} +3 -3
  104. package/dist/{vue-ui-skeleton-BqKzuhkB.cjs → vue-ui-skeleton-DpfJbsNA.cjs} +1 -1
  105. package/dist/{vue-ui-smiley-D7dDCdpq.js → vue-ui-smiley-BnX27B0k.js} +2 -2
  106. package/dist/{vue-ui-smiley-BXKVpHl2.cjs → vue-ui-smiley-DGE9NFBY.cjs} +1 -1
  107. package/dist/{vue-ui-spark-trend-GWFrO_0z.js → vue-ui-spark-trend-CgCLrMox.js} +5 -5
  108. package/dist/{vue-ui-spark-trend-9V60hM3Z.cjs → vue-ui-spark-trend-aW-de-rX.cjs} +1 -1
  109. package/dist/{vue-ui-sparkbar-Bgn6AY0q.cjs → vue-ui-sparkbar-BLUXUlTY.cjs} +1 -1
  110. package/dist/{vue-ui-sparkbar-CwqlyAyv.js → vue-ui-sparkbar-BXku33sq.js} +4 -4
  111. package/dist/{vue-ui-sparkgauge-F2XbiXyA.js → vue-ui-sparkgauge-Doi0iu0L.js} +4 -4
  112. package/dist/{vue-ui-sparkgauge-Dqntz2Zv.cjs → vue-ui-sparkgauge-RTiKvSMp.cjs} +1 -1
  113. package/dist/{vue-ui-sparkhistogram-DRIKK6Ym.js → vue-ui-sparkhistogram-BnMvXlAP.js} +5 -5
  114. package/dist/{vue-ui-sparkhistogram-DnY4-Sdn.cjs → vue-ui-sparkhistogram-C6AgJH1C.cjs} +1 -1
  115. package/dist/{vue-ui-sparkline-Cxtzdlhi.js → vue-ui-sparkline-DI7fq_MR.js} +5 -5
  116. package/dist/{vue-ui-sparkline-CAEs-gtK.cjs → vue-ui-sparkline-DpVCQ6W9.cjs} +1 -1
  117. package/dist/{vue-ui-sparkstackbar-D37ms1rx.cjs → vue-ui-sparkstackbar-Bvuq2sLW.cjs} +1 -1
  118. package/dist/{vue-ui-sparkstackbar-0A1klq9s.js → vue-ui-sparkstackbar-oNnE5z1C.js} +4 -4
  119. package/dist/{vue-ui-stackbar-ByOuJSdM.js → vue-ui-stackbar-6g7b3yyu.js} +13 -13
  120. package/dist/{vue-ui-stackbar-wun4S3C0.cjs → vue-ui-stackbar-aWJDGIKV.cjs} +1 -1
  121. package/dist/{vue-ui-strip-plot-CMD0MSqY.js → vue-ui-strip-plot-BFM8HIM8.js} +204 -196
  122. package/dist/vue-ui-strip-plot-GdjjVxMN.cjs +1 -0
  123. package/dist/{vue-ui-table-B75DJ39t.js → vue-ui-table-Cw4Yz-IE.js} +1 -1
  124. package/dist/{vue-ui-table-aj0XZ7T5.cjs → vue-ui-table-XOPmDCOB.cjs} +1 -1
  125. package/dist/{vue-ui-table-heatmap-Ce93TyBF.cjs → vue-ui-table-heatmap-Bh48bMuU.cjs} +1 -1
  126. package/dist/{vue-ui-table-heatmap-BO2ugWqD.js → vue-ui-table-heatmap-DeRCR8l6.js} +4 -4
  127. package/dist/{vue-ui-table-sparkline-D6KJjDnU.cjs → vue-ui-table-sparkline-C25qj1w_.cjs} +1 -1
  128. package/dist/{vue-ui-table-sparkline-CbjfAaj2.js → vue-ui-table-sparkline-w3H-od91.js} +5 -5
  129. package/dist/{vue-ui-thermometer-Pq4PvSIP.js → vue-ui-thermometer-BySEVhT8.js} +171 -165
  130. package/dist/vue-ui-thermometer-DZrusaGY.cjs +1 -0
  131. package/dist/{vue-ui-timer-B6IB6yS6.cjs → vue-ui-timer-1p6J6hTn.cjs} +1 -1
  132. package/dist/{vue-ui-timer-Bk3BvB-B.js → vue-ui-timer-BN-9a2lj.js} +6 -6
  133. package/dist/vue-ui-tiremarks-CvIJeWKE.cjs +1 -0
  134. package/dist/{vue-ui-tiremarks-CU9HJIqf.js → vue-ui-tiremarks-EzYdOMyf.js} +119 -112
  135. package/dist/vue-ui-treemap-CzNOr1iR.cjs +1 -0
  136. package/dist/{vue-ui-treemap-DY-lRAhC.js → vue-ui-treemap-Da0f6vaF.js} +266 -258
  137. package/dist/vue-ui-vertical-bar-B9shdfqo.cjs +4 -0
  138. package/dist/{vue-ui-vertical-bar-CtnIKsM1.js → vue-ui-vertical-bar-D1cBfu5p.js} +245 -237
  139. package/dist/vue-ui-waffle-Cg-7Fazv.cjs +1 -0
  140. package/dist/{vue-ui-waffle-reOsx-gJ.js → vue-ui-waffle-DM2LsEP7.js} +224 -216
  141. package/dist/{vue-ui-wheel-kYxny3vn.js → vue-ui-wheel-B9cmixxi.js} +125 -117
  142. package/dist/vue-ui-wheel-C-JukdTy.cjs +1 -0
  143. package/dist/{vue-ui-word-cloud-DwLY4QdB.cjs → vue-ui-word-cloud-BLMWYOPy.cjs} +1 -1
  144. package/dist/{vue-ui-word-cloud-DbMqrHAf.js → vue-ui-word-cloud-Baz7RXN2.js} +11 -11
  145. package/dist/vue-ui-xy-BHeSkJQ3.cjs +3 -0
  146. package/dist/{vue-ui-xy-rbACig0h.js → vue-ui-xy-DVnzVSqE.js} +302 -291
  147. package/dist/{vue-ui-xy-canvas-B0HTR7OV.js → vue-ui-xy-canvas-A7PKnWBs.js} +12 -12
  148. package/dist/{vue-ui-xy-canvas-CgJd5FiT.cjs → vue-ui-xy-canvas-DAd-B98z.cjs} +1 -1
  149. package/package.json +1 -1
  150. package/dist/useResponsive-CodiGUOE.cjs +0 -1
  151. package/dist/vue-ui-age-pyramid-DsbZ1qcQ.cjs +0 -1
  152. package/dist/vue-ui-bullet-D8ks_rKr.cjs +0 -34
  153. package/dist/vue-ui-candlestick-D1jdr0bv.cjs +0 -2
  154. package/dist/vue-ui-chestnut-ih5r0Bj9.cjs +0 -6
  155. package/dist/vue-ui-donut-D7KT9EAp.cjs +0 -1
  156. package/dist/vue-ui-donut-evolution-CHtJ8iOK.cjs +0 -1
  157. package/dist/vue-ui-dumbbell-B0dikuqO.cjs +0 -9
  158. package/dist/vue-ui-flow-D6rc8J-8.cjs +0 -1
  159. package/dist/vue-ui-galaxy-CmTt0vBf.cjs +0 -1
  160. package/dist/vue-ui-gauge-B_TKuyM7.cjs +0 -1
  161. package/dist/vue-ui-heatmap-C2HlnqzO.cjs +0 -1
  162. package/dist/vue-ui-molecule-BiYIcOKN.cjs +0 -1
  163. package/dist/vue-ui-mood-radar-C6jMyFkb.cjs +0 -1
  164. package/dist/vue-ui-nested-donuts-DKO2dFKo.cjs +0 -17
  165. package/dist/vue-ui-onion-GWNoZRhw.cjs +0 -5
  166. package/dist/vue-ui-parallel-coordinate-plot-DODn4Ohf.cjs +0 -8
  167. package/dist/vue-ui-quadrant-yuFAxV-5.cjs +0 -1
  168. package/dist/vue-ui-quick-chart-DgFDBzjS.cjs +0 -15
  169. package/dist/vue-ui-radar-BJH5SE6-.cjs +0 -1
  170. package/dist/vue-ui-relation-circle-CKmjOle7.cjs +0 -1
  171. package/dist/vue-ui-relation-circle-xv2l5Be9.js +0 -358
  172. package/dist/vue-ui-rings-DjH3CK23.cjs +0 -2
  173. package/dist/vue-ui-scatter-SBCXAl7q.cjs +0 -1
  174. package/dist/vue-ui-strip-plot-IQrypGvz.cjs +0 -1
  175. package/dist/vue-ui-thermometer-swmi4FmH.cjs +0 -1
  176. package/dist/vue-ui-tiremarks-Cn79uQH2.cjs +0 -1
  177. package/dist/vue-ui-treemap-BEMuKV7x.cjs +0 -1
  178. package/dist/vue-ui-vertical-bar-B1e2RxTv.cjs +0 -4
  179. package/dist/vue-ui-waffle-BqP7Okgu.cjs +0 -1
  180. package/dist/vue-ui-wheel-BuWUGnkC.cjs +0 -1
  181. package/dist/vue-ui-xy-CGWzriYn.cjs +0 -3
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-eFox7weK.cjs"),b=require("./useNestedProp-BkgEhTQY.cjs"),$=require("./vue-ui-skeleton-BqKzuhkB.cjs"),w=require("./PackageVersion-DwI-KhXH.cjs"),S=["xmlns","viewBox"],L=["id"],B=["stop-color"],E=["stop-color"],M=["d","stroke","stroke-linecap"],z=["d","stroke","stroke-linecap","stroke-dashoffset"],V=["x","y","font-size","fill","font-weight"],A={key:4,ref:"source",dir:"auto"},q={__name:"vue-ui-sparkgauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(C){const o=C,{vue_ui_sparkgauge:_}=s.useConfig(),c=e.computed(()=>!!o.dataset&&Object.keys(o.dataset).length);e.onMounted(()=>{d()});function d(){s.objectIsEmpty(o.dataset)?s.error({componentName:"VueUiSparkgauge",type:"dataset"}):s.getMissingDatasetAttributes({datasetObject:o.dataset,requiredAttributes:["value","min","max"]}).forEach(a=>{s.error({componentName:"VueUiSparkgauge",type:"datasetAttribute",property:a})})}const v=e.ref(s.createUid()),t=e.computed({get:()=>m(),set:a=>a});function m(){const a=b.useNestedProp({userConfig:o.config,defaultConfig:_});return a.theme?{...b.useNestedProp({userConfig:s.themes.vue_ui_sparkgauge[a.theme]||o.config,defaultConfig:a})}:a}e.watch(()=>o.config,a=>{t.value=m(),d()},{deep:!0});const u=e.computed(()=>({height:t.value.style.height,width:128,base:t.value.style.basePosition})),n=e.computed(()=>{const a=o.dataset.min??0,r=o.dataset.max??0,N=r-a;return{min:a,max:r,diff:N}}),l=e.ref(t.value.style.animation.show?n.value.min:o.dataset.value);e.watch(()=>o.dataset.value,()=>{y(o.dataset.value||0)});const f=e.computed(()=>l.value>n.value.max?n.value.max:l.value<n.value.min?n.value.min:l.value),p=e.computed(()=>n.value.diff/t.value.style.animation.speedMs);e.onMounted(()=>{y(o.dataset.value||0)});function y(a){function r(){l.value<a?l.value=Math.min(l.value+p.value,a):l.value>a&&(l.value=Math.max(l.value-p.value,a)),l.value!==a&&requestAnimationFrame(r)}r()}const i=e.computed(()=>o.dataset.title??""),g=e.computed(()=>l.value>=0?(f.value-n.value.min)/n.value.diff:(Math.abs(n.value.min)-Math.abs(f.value))/n.value.diff),k=e.computed(()=>s.interpolateColorHex(t.value.style.colors.min,t.value.style.colors.max,n.value.min,n.value.max,l.value)),h=e.computed(()=>t.value.style.dataLabel.autoColor?k.value:t.value.style.dataLabel.color),x=e.computed(()=>t.value.style.track.autoColor?k.value:t.value.style.track.color);return(a,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width: 100%; background:${t.value.style.background}`)},[t.value.style.title.show&&i.value&&t.value.style.title.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(i.value),5)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${u.value.width} ${u.value.height}`,style:"overflow: visible; background:transparent; width:100%;"},[e.createVNode(w._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`gradient_${v.value}`,x1:"-10%",y1:"100%",x2:"110%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.colors.min},null,8,B),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.max},null,8,E)],8,L)]),e.createElementVNode("path",{d:`M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,stroke:t.value.style.gutter.color,"stroke-width":8,"stroke-linecap":t.value.style.gutter.strokeLinecap,fill:"none"},null,8,M),g.value!==0?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,stroke:t.value.style.colors.showGradient?`url(#gradient_${v.value})`:x.value,"stroke-width":8,"stroke-linecap":t.value.style.track.strokeLinecap,fill:"none","stroke-dasharray":169.5,"stroke-dashoffset":169.5-169.5*g.value,class:e.normalizeClass({"vue-ui-sparkgauge-track":t.value.style.animation.show}),style:e.normalizeStyle(t.value.style.animation.show?`animation: vue-ui-sparkgauge-animation ${t.value.style.animation.speedMs}ms ease-in;`:"")},null,14,z)):e.createCommentVNode("",!0),e.createElementVNode("text",{"text-anchor":"middle",x:u.value.width/2,y:u.value.base+6+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,fill:h.value,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.dataLabel.formatter,e.unref(s.checkNaN)(l.value),e.unref(s.dataLabel)({p:t.value.style.dataLabel.prefix,v:e.unref(s.checkNaN)(l.value),s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding}),{datapoint:e.unref(s.checkNaN)(l.value),color:h.value})),9,V)],8,S)):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($.default,{key:2,config:{type:"gauge",style:{backgroundColor:t.value.style.background,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.title.show&&i.value&&t.value.style.title.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:3,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(i.value),5)):e.createCommentVNode("",!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",A,[e.renderSlot(a.$slots,"source")],512)):e.createCommentVNode("",!0)],4))}};exports.default=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-CcykRspI.cjs"),b=require("./useNestedProp-XtPlFP9O.cjs"),$=require("./vue-ui-skeleton-DpfJbsNA.cjs"),w=require("./PackageVersion-CowXQ4IM.cjs"),S=["xmlns","viewBox"],L=["id"],B=["stop-color"],E=["stop-color"],M=["d","stroke","stroke-linecap"],z=["d","stroke","stroke-linecap","stroke-dashoffset"],V=["x","y","font-size","fill","font-weight"],A={key:4,ref:"source",dir:"auto"},q={__name:"vue-ui-sparkgauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(C){const o=C,{vue_ui_sparkgauge:_}=s.useConfig(),c=e.computed(()=>!!o.dataset&&Object.keys(o.dataset).length);e.onMounted(()=>{d()});function d(){s.objectIsEmpty(o.dataset)?s.error({componentName:"VueUiSparkgauge",type:"dataset"}):s.getMissingDatasetAttributes({datasetObject:o.dataset,requiredAttributes:["value","min","max"]}).forEach(a=>{s.error({componentName:"VueUiSparkgauge",type:"datasetAttribute",property:a})})}const v=e.ref(s.createUid()),t=e.computed({get:()=>m(),set:a=>a});function m(){const a=b.useNestedProp({userConfig:o.config,defaultConfig:_});return a.theme?{...b.useNestedProp({userConfig:s.themes.vue_ui_sparkgauge[a.theme]||o.config,defaultConfig:a})}:a}e.watch(()=>o.config,a=>{t.value=m(),d()},{deep:!0});const u=e.computed(()=>({height:t.value.style.height,width:128,base:t.value.style.basePosition})),n=e.computed(()=>{const a=o.dataset.min??0,r=o.dataset.max??0,N=r-a;return{min:a,max:r,diff:N}}),l=e.ref(t.value.style.animation.show?n.value.min:o.dataset.value);e.watch(()=>o.dataset.value,()=>{y(o.dataset.value||0)});const f=e.computed(()=>l.value>n.value.max?n.value.max:l.value<n.value.min?n.value.min:l.value),p=e.computed(()=>n.value.diff/t.value.style.animation.speedMs);e.onMounted(()=>{y(o.dataset.value||0)});function y(a){function r(){l.value<a?l.value=Math.min(l.value+p.value,a):l.value>a&&(l.value=Math.max(l.value-p.value,a)),l.value!==a&&requestAnimationFrame(r)}r()}const i=e.computed(()=>o.dataset.title??""),g=e.computed(()=>l.value>=0?(f.value-n.value.min)/n.value.diff:(Math.abs(n.value.min)-Math.abs(f.value))/n.value.diff),k=e.computed(()=>s.interpolateColorHex(t.value.style.colors.min,t.value.style.colors.max,n.value.min,n.value.max,l.value)),h=e.computed(()=>t.value.style.dataLabel.autoColor?k.value:t.value.style.dataLabel.color),x=e.computed(()=>t.value.style.track.autoColor?k.value:t.value.style.track.color);return(a,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width: 100%; background:${t.value.style.background}`)},[t.value.style.title.show&&i.value&&t.value.style.title.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(i.value),5)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${u.value.width} ${u.value.height}`,style:"overflow: visible; background:transparent; width:100%;"},[e.createVNode(w._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`gradient_${v.value}`,x1:"-10%",y1:"100%",x2:"110%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.colors.min},null,8,B),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.max},null,8,E)],8,L)]),e.createElementVNode("path",{d:`M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,stroke:t.value.style.gutter.color,"stroke-width":8,"stroke-linecap":t.value.style.gutter.strokeLinecap,fill:"none"},null,8,M),g.value!==0?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,stroke:t.value.style.colors.showGradient?`url(#gradient_${v.value})`:x.value,"stroke-width":8,"stroke-linecap":t.value.style.track.strokeLinecap,fill:"none","stroke-dasharray":169.5,"stroke-dashoffset":169.5-169.5*g.value,class:e.normalizeClass({"vue-ui-sparkgauge-track":t.value.style.animation.show}),style:e.normalizeStyle(t.value.style.animation.show?`animation: vue-ui-sparkgauge-animation ${t.value.style.animation.speedMs}ms ease-in;`:"")},null,14,z)):e.createCommentVNode("",!0),e.createElementVNode("text",{"text-anchor":"middle",x:u.value.width/2,y:u.value.base+6+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,fill:h.value,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.dataLabel.formatter,e.unref(s.checkNaN)(l.value),e.unref(s.dataLabel)({p:t.value.style.dataLabel.prefix,v:e.unref(s.checkNaN)(l.value),s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding}),{datapoint:e.unref(s.checkNaN)(l.value),color:h.value})),9,V)],8,S)):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($.default,{key:2,config:{type:"gauge",style:{backgroundColor:t.value.style.background,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.title.show&&i.value&&t.value.style.title.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:3,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(i.value),5)):e.createCommentVNode("",!0),a.$slots.source?(e.openBlock(),e.createElementBlock("div",A,[e.renderSlot(a.$slots,"source")],512)):e.createCommentVNode("",!0)],4))}};exports.default=q;
@@ -1,9 +1,9 @@
1
1
  import { useCssVars as J, computed as _, onMounted as K, ref as N, watch as Q, openBlock as a, createElementBlock as s, normalizeStyle as $, createElementVNode as y, createTextVNode as Z, toDisplayString as g, unref as n, createCommentVNode as h, createVNode as ee, Fragment as f, renderList as p, normalizeClass as D, createBlock as I, renderSlot as te } from "vue";
2
- import { u as le, o as ae, e as V, g as se, c as oe, t as ue, s as m, i as H, f as E, X as re, w as z } from "./index-Bya_q1J-.js";
3
- import { u as F } from "./useNestedProp-B33hazbH.js";
4
- import { _ as ie } from "./Shape-Bwon0l0g.js";
5
- import ne from "./vue-ui-skeleton-BYssP0K4.js";
6
- import { _ as ve } from "./PackageVersion-VkaUzgmt.js";
2
+ import { u as le, o as ae, e as V, g as se, c as oe, t as ue, s as m, i as H, f as E, X as re, w as z } from "./index-DCsPHn9C.js";
3
+ import { u as F } from "./useNestedProp-DdSlLeTW.js";
4
+ import { _ as ie } from "./Shape-DYNtRer6.js";
5
+ import ne from "./vue-ui-skeleton-DNuwx6_y.js";
6
+ import { _ as ve } from "./PackageVersion-Clrfvyd8.js";
7
7
  import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const ce = { key: 0 }, ye = { key: 1 }, he = ["xmlns", "viewBox"], fe = ["id"], pe = ["stop-color"], ge = ["stop-color"], me = ["id"], be = ["stop-color"], _e = ["stop-color"], xe = ["id"], ke = ["stop-color"], we = ["stop-color"], $e = { key: 0 }, Ce = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], Le = { key: 1 }, ze = ["x", "y", "font-size", "font-weight", "fill"], Se = ["x", "y", "font-size", "fill"], Me = ["x", "y", "font-size", "fill"], Ae = ["height", "width", "x", "onMouseover", "stroke", "stroke-width", "rx", "stroke-dasharray", "onClick"], Ne = {
9
9
  key: 2,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-eFox7weK.cjs"),_=require("./useNestedProp-BkgEhTQY.cjs"),F=require("./Shape-D2Dpshg1.cjs"),M=require("./vue-ui-skeleton-BqKzuhkB.cjs"),O=require("./PackageVersion-DwI-KhXH.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H={key:0},q={key:1},I=["xmlns","viewBox"],U=["id"],W=["stop-color"],P=["stop-color"],j=["id"],G=["stop-color"],T=["stop-color"],X=["id"],Y=["stop-color"],R=["stop-color"],J={key:0},K=["x","y","height","width","fill","stroke","stroke-width","rx"],Q={key:1},Z=["x","y","font-size","font-weight","fill"],ee=["x","y","font-size","fill"],te=["x","y","font-size","fill"],le=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],oe={key:2,ref:"source",dir:"auto"},ae={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(x,{emit:B}){const i=x;e.useCssVars(o=>({"3d57fabd":S.value}));const{vue_ui_sparkhistogram:E}=a.useConfig(),h=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{k()});function k(){a.objectIsEmpty(i.dataset)?a.error({componentName:"VueUiSparkHistogram",type:"dataset"}):i.dataset.forEach((o,r)=>{a.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["value"]}).forEach(l=>{a.error({componentName:"VueUiSparkHistogram",type:"datasetSerieAttribute",property:l,index:r})})})}const v=e.ref(a.createUid()),t=e.computed({get:()=>b(),set:o=>o});function b(){const o=_.useNestedProp({userConfig:i.config,defaultConfig:E});return o.theme?{..._.useNestedProp({userConfig:a.themes.vue_ui_sparkhistogram[o.theme]||i.config,defaultConfig:o})}:o}e.watch(()=>i.config,o=>{t.value=b(),k()},{deep:!0});const c=e.computed(()=>{const o=t.value.style.layout.height,r=t.value.style.layout.width,l=t.value.style.layout.padding.top,s=o-t.value.style.layout.padding.bottom,d=t.value.style.layout.padding.left,y=r-t.value.style.layout.padding.right,p=l+(o-l-t.value.style.layout.padding.bottom)/2,f=o-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,m=r-t.value.style.layout.padding.left-t.value.style.layout.padding.right;return{bottom:s,centerY:p,drawingHeight:f,drawingWidth:m,height:o,left:d,right:y,top:l,width:r}}),w=e.computed(()=>Math.max(...i.dataset.map(o=>Math.abs(o.value||0))));function C(o){return Math.abs(o)/w.value}const u=e.computed(()=>i.dataset.map((o,r)=>{const l=C(o.value||0),s=c.value.drawingHeight*l,d=c.value.drawingWidth/i.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,f=c.value.centerY-s/2,m=c.value.left+(y/2+r*d),L=c.value.left+r*d,g=typeof o.intensity>"u"?100:Math.round(o.intensity*100),N=o.color?o.color:o.value>=0?a.setOpacity(t.value.style.bars.colors.positive,g):a.setOpacity(t.value.style.bars.colors.negative,g),V=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,z=o.color?`url(#gradient_datapoint_${r}_${v.value})`:o.value>=0?`url(#gradient_positive_${r}_${v.value})`:`url(#gradient_negative_${r}_${v.value})`,D=m+p/2;return{...o,color:N,gradient:z,height:s,intensity:g,proportion:l,stroke:V,textAnchor:D,trapX:L,unitWidth:d,width:p,x:m,y:f}})),n=e.ref(null);function $(o,r){B("selectDatapoint",{datapoint:o,index:r})}const S=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily}`),onMouseleave:r[1]||(r[1]=l=>n.value=null)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},[e.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),n.value!==null?(e.openBlock(),e.createElementBlock("span",H,"- "+e.toDisplayString(u.value[n.value].timeLabel||"")+" "+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,u.value[n.value].value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:u.value[n.value].value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:u.value[n.value],seriesIndex:n.value})),1)):e.createCommentVNode("",!0),![void 0,null].includes(n.value)&&![null,void 0].includes(u.value[n.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",q,"("+e.toDisplayString(u.value[n.value].valueLabel||0)+")",1)):e.createCommentVNode("",!0)],4),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:{overflow:"visible"}},[e.createVNode(O._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.positive,.05),l.intensity)},null,8,W),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.positive,l.intensity)},null,8,P)],8,U))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.negative,.05),l.intensity)},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.negative,l.intensity)},null,8,T)],8,j))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_datapoint_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(l.color,.05),l.intensity)},null,8,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(l.color,l.intensity)},null,8,R)],8,X))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("rect",{x:l.x,y:l.y,height:l.height,width:l.width,fill:t.value.style.bars.colors.gradient.show?l.gradient:l.color,stroke:l.stroke,"stroke-width":t.value.style.bars.strokeWidth,rx:`${t.value.style.bars.borderRadius*l.proportion/12}%`,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,10,K))),256))])):(e.openBlock(),e.createElementBlock("g",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createBlock(F._sfc_main,{plot:{x:l.x+l.width/2,y:l.y+l.height/2},color:t.value.style.bars.colors.gradient.show?l.gradient:l.color,shape:t.value.style.bars.shape,radius:l.height*.4,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,8,["plot","color","shape","radius","class"]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"middle",x:l.textAnchor,y:l.y-t.value.style.labels.value.fontSize/3+t.value.style.labels.value.offsetY,"font-size":t.value.style.labels.value.fontSize,"font-weight":t.value.style.labels.value.bold?"bold":"normal",fill:t.value.style.labels.value.color},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,l.value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:l.value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:u.value[n.value],seriesIndex:n.value})),9,Z))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.valueLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:l.y+l.height+t.value.style.labels.valueLabel.fontSize,"font-size":t.value.style.labels.valueLabel.fontSize,"text-anchor":"middle",fill:t.value.style.labels.valueLabel.color},e.toDisplayString(l.valueLabel),9,ee)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:c.value.height-t.value.style.labels.timeLabel.fontSize/2,"font-size":t.value.style.labels.timeLabel.fontSize,fill:t.value.style.labels.timeLabel.color,"text-anchor":"middle"},e.toDisplayString(l.timeLabel),9,te)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:c.value.height,width:l.unitWidth,fill:"transparent",x:l.trapX,y:0,onMouseover:d=>n.value=s,onMouseleave:r[0]||(r[0]=d=>n.value=null),stroke:n.value!==null&&n.value===s?t.value.style.selector.stroke:"","stroke-width":n.value!==null&&n.value===s?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>$(l,s)},null,40,le)]))),256))],8,I)):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(M.default,{key:3,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},se=A._export_sfc(ae,[["__scopeId","data-v-4e962555"]]);exports.default=se;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-CcykRspI.cjs"),_=require("./useNestedProp-XtPlFP9O.cjs"),F=require("./Shape-qK3MNdTg.cjs"),M=require("./vue-ui-skeleton-DpfJbsNA.cjs"),O=require("./PackageVersion-CowXQ4IM.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H={key:0},q={key:1},I=["xmlns","viewBox"],U=["id"],W=["stop-color"],P=["stop-color"],j=["id"],G=["stop-color"],T=["stop-color"],X=["id"],Y=["stop-color"],R=["stop-color"],J={key:0},K=["x","y","height","width","fill","stroke","stroke-width","rx"],Q={key:1},Z=["x","y","font-size","font-weight","fill"],ee=["x","y","font-size","fill"],te=["x","y","font-size","fill"],le=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],oe={key:2,ref:"source",dir:"auto"},ae={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(x,{emit:B}){const i=x;e.useCssVars(o=>({"3d57fabd":S.value}));const{vue_ui_sparkhistogram:E}=a.useConfig(),h=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{k()});function k(){a.objectIsEmpty(i.dataset)?a.error({componentName:"VueUiSparkHistogram",type:"dataset"}):i.dataset.forEach((o,r)=>{a.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["value"]}).forEach(l=>{a.error({componentName:"VueUiSparkHistogram",type:"datasetSerieAttribute",property:l,index:r})})})}const v=e.ref(a.createUid()),t=e.computed({get:()=>b(),set:o=>o});function b(){const o=_.useNestedProp({userConfig:i.config,defaultConfig:E});return o.theme?{..._.useNestedProp({userConfig:a.themes.vue_ui_sparkhistogram[o.theme]||i.config,defaultConfig:o})}:o}e.watch(()=>i.config,o=>{t.value=b(),k()},{deep:!0});const c=e.computed(()=>{const o=t.value.style.layout.height,r=t.value.style.layout.width,l=t.value.style.layout.padding.top,s=o-t.value.style.layout.padding.bottom,d=t.value.style.layout.padding.left,y=r-t.value.style.layout.padding.right,p=l+(o-l-t.value.style.layout.padding.bottom)/2,f=o-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,m=r-t.value.style.layout.padding.left-t.value.style.layout.padding.right;return{bottom:s,centerY:p,drawingHeight:f,drawingWidth:m,height:o,left:d,right:y,top:l,width:r}}),w=e.computed(()=>Math.max(...i.dataset.map(o=>Math.abs(o.value||0))));function C(o){return Math.abs(o)/w.value}const u=e.computed(()=>i.dataset.map((o,r)=>{const l=C(o.value||0),s=c.value.drawingHeight*l,d=c.value.drawingWidth/i.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,f=c.value.centerY-s/2,m=c.value.left+(y/2+r*d),L=c.value.left+r*d,g=typeof o.intensity>"u"?100:Math.round(o.intensity*100),N=o.color?o.color:o.value>=0?a.setOpacity(t.value.style.bars.colors.positive,g):a.setOpacity(t.value.style.bars.colors.negative,g),V=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,z=o.color?`url(#gradient_datapoint_${r}_${v.value})`:o.value>=0?`url(#gradient_positive_${r}_${v.value})`:`url(#gradient_negative_${r}_${v.value})`,D=m+p/2;return{...o,color:N,gradient:z,height:s,intensity:g,proportion:l,stroke:V,textAnchor:D,trapX:L,unitWidth:d,width:p,x:m,y:f}})),n=e.ref(null);function $(o,r){B("selectDatapoint",{datapoint:o,index:r})}const S=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily}`),onMouseleave:r[1]||(r[1]=l=>n.value=null)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},[e.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),n.value!==null?(e.openBlock(),e.createElementBlock("span",H,"- "+e.toDisplayString(u.value[n.value].timeLabel||"")+" "+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,u.value[n.value].value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:u.value[n.value].value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:u.value[n.value],seriesIndex:n.value})),1)):e.createCommentVNode("",!0),![void 0,null].includes(n.value)&&![null,void 0].includes(u.value[n.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",q,"("+e.toDisplayString(u.value[n.value].valueLabel||0)+")",1)):e.createCommentVNode("",!0)],4),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:{overflow:"visible"}},[e.createVNode(O._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.positive,.05),l.intensity)},null,8,W),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.positive,l.intensity)},null,8,P)],8,U))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(t.value.style.bars.colors.negative,.05),l.intensity)},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(t.value.style.bars.colors.negative,l.intensity)},null,8,T)],8,j))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_datapoint_${s}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(l.color,.05),l.intensity)},null,8,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(a.setOpacity)(l.color,l.intensity)},null,8,R)],8,X))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("rect",{x:l.x,y:l.y,height:l.height,width:l.width,fill:t.value.style.bars.colors.gradient.show?l.gradient:l.color,stroke:l.stroke,"stroke-width":t.value.style.bars.strokeWidth,rx:`${t.value.style.bars.borderRadius*l.proportion/12}%`,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,10,K))),256))])):(e.openBlock(),e.createElementBlock("g",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createBlock(F._sfc_main,{plot:{x:l.x+l.width/2,y:l.y+l.height/2},color:t.value.style.bars.colors.gradient.show?l.gradient:l.color,shape:t.value.style.bars.shape,radius:l.height*.4,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,8,["plot","color","shape","radius","class"]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"middle",x:l.textAnchor,y:l.y-t.value.style.labels.value.fontSize/3+t.value.style.labels.value.offsetY,"font-size":t.value.style.labels.value.fontSize,"font-weight":t.value.style.labels.value.bold?"bold":"normal",fill:t.value.style.labels.value.color},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,l.value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:l.value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:u.value[n.value],seriesIndex:n.value})),9,Z))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.valueLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:l.y+l.height+t.value.style.labels.valueLabel.fontSize,"font-size":t.value.style.labels.valueLabel.fontSize,"text-anchor":"middle",fill:t.value.style.labels.valueLabel.color},e.toDisplayString(l.valueLabel),9,ee)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:c.value.height-t.value.style.labels.timeLabel.fontSize/2,"font-size":t.value.style.labels.timeLabel.fontSize,fill:t.value.style.labels.timeLabel.color,"text-anchor":"middle"},e.toDisplayString(l.timeLabel),9,te)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:c.value.height,width:l.unitWidth,fill:"transparent",x:l.trapX,y:0,onMouseover:d=>n.value=s,onMouseleave:r[0]||(r[0]=d=>n.value=null),stroke:n.value!==null&&n.value===s?t.value.style.selector.stroke:"","stroke-width":n.value!==null&&n.value===s?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>$(l,s)},null,40,le)]))),256))],8,I)):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(M.default,{key:3,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},se=A._export_sfc(ae,[["__scopeId","data-v-4e962555"]]);exports.default=se;
@@ -1,9 +1,9 @@
1
1
  import { computed as v, ref as m, watch as R, onMounted as se, openBlock as o, createElementBlock as n, normalizeStyle as N, renderSlot as W, normalizeProps as oe, guardReactiveProps as re, createElementVNode as f, toDisplayString as j, createCommentVNode as y, unref as c, createVNode as ne, Fragment as P, renderList as A, createBlock as ie } from "vue";
2
- import { u as de, c as ve, t as ce, o as he, e as U, g as ye, w as C, Y as fe, Z as pe, X as ge, s as I, R as X, i as Z, f as q } from "./index-Bya_q1J-.js";
3
- import { u as Y } from "./useNestedProp-B33hazbH.js";
4
- import me from "./vue-ui-skeleton-BYssP0K4.js";
5
- import { t as ke, u as be } from "./useResponsive-BY8tgM1n.js";
6
- import { _ as _e } from "./PackageVersion-VkaUzgmt.js";
2
+ import { u as de, c as ve, t as ce, o as he, e as U, g as ye, w as C, Y as fe, Z as pe, X as ge, s as I, R as X, i as Z, f as q } from "./index-DCsPHn9C.js";
3
+ import { u as Y } from "./useNestedProp-DdSlLeTW.js";
4
+ import me from "./vue-ui-skeleton-DNuwx6_y.js";
5
+ import { t as ke, u as be } from "./useResponsive-CoxXLe23.js";
6
+ import { _ as _e } from "./PackageVersion-Clrfvyd8.js";
7
7
  import { _ as xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const we = ["id"], Le = ["xmlns", "viewBox"], $e = ["id"], Ne = ["stop-color"], Ce = ["stop-color"], Ie = ["id"], Me = ["stop-color"], Ve = ["stop-color"], ze = ["id"], Se = ["stop-color"], We = ["stop-color"], Pe = { key: 0 }, Ae = ["d", "fill"], De = ["d", "fill"], Fe = ["d", "stroke", "stroke-width"], Ge = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Te = ["x", "y", "width", "height", "fill", "rx"], Be = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ee = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], Oe = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Re = ["x", "y", "font-size", "font-weight", "fill"], je = ["x", "y", "height", "width", "onMouseenter", "onClick"], Ue = {
9
9
  __name: "vue-ui-sparkline",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-eFox7weK.cjs"),S=require("./useNestedProp-BkgEhTQY.cjs"),G=require("./vue-ui-skeleton-BqKzuhkB.cjs"),M=require("./useResponsive-CodiGUOE.cjs"),j=require("./PackageVersion-DwI-KhXH.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H=["id"],U=["xmlns","viewBox"],X=["id"],Z=["stop-color"],Y=["stop-color"],J=["id"],K=["stop-color"],Q=["stop-color"],ee=["id"],te=["stop-color"],le=["stop-color"],ae={key:0},oe=["d","fill"],ne=["d","fill"],ue=["d","stroke","stroke-width"],re=["x1","x2","y1","y2","stroke","stroke-width"],se=["x","y","width","height","fill","rx"],ie=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],de=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ce=["cx","cy","r","fill","stroke","stroke-width"],ve=["x","y","font-size","font-weight","fill"],he=["x","y","height","width","onMouseenter","onClick"],ye={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:_}){const i=f,{vue_ui_sparkline:z}=u.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(u.createUid()),x=e.ref(null),B=e.ref(null),L=e.ref(null),t=e.computed({get:()=>C(),set:l=>l});function C(){const l=S.useNestedProp({userConfig:i.config,defaultConfig:z});return l.theme?{...S.useNestedProp({userConfig:u.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}e.watch(()=>i.config,l=>{t.value=C(),E(),o.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>i.dataset,l=>{p.value=i.dataset.map(n=>({...n,value:[void 0].includes(n.value)?null:n.value}))},{deep:!0});const p=e.ref(P());function P(){return i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value})}const V=e.ref(null);e.onMounted(()=>{if(E(),t.value.style.animation.show&&i.dataset.length>1){let a=function(){n<i.dataset.length?(p.value.push(i.dataset[n]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=i.dataset,n+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let n=0;a()}});function E(){if(u.objectIsEmpty(i.dataset)?u.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,n)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{u.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:n})})}),t.value.responsive){const l=M.throttle(()=>{const{width:n,height:a}=M.useResponsive({chart:x.value,title:t.value.style.title.show&&i.showInfo?B.value:null,source:L.value});o.value.width=n,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*n,o.value.padding=.06*n});V.value=new ResizeObserver(l),V.value.observe(x.value.parentNode)}}const o=e.ref({height:80,width:500,chartWidth:t.value.style.chartWidth,padding:30}),D=e.ref(6),r=e.computed(()=>({top:12,left:0,right:o.value.width,bottom:o.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?o.value.width-o.value.chartWidth:o.value.padding,width:i.showInfo&&t.value.style.dataLabel.show?o.value.chartWidth:o.value.width-o.value.padding,height:o.value.height-12})),w=e.computed(()=>Math.min(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),W=e.computed(()=>Math.max(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),m=e.computed(()=>{const l=w.value>=0?0:w.value;return Math.abs(l)}),A=e.computed(()=>W.value+m.value+D.value),b=e.computed(()=>r.value.bottom-r.value.height*N(m.value));function N(l){return l/A.value}const h=e.computed(()=>i.dataset.length-1),s=e.computed(()=>p.value.map((l,n)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+m.value,toMax:N(a+m.value),x:r.value.start+n*(r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)),y:r.value.bottom-r.value.height*N(a+m.value),id:`plot_${v.value}_${n}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?u.shiftHue(t.value.style.line.color,.05*(1-n/h.value)):t.value.style.line.color,width:r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)}})),O=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},n={x:s.value[s.value.length-1].x,y:o.value.height-6},a=[];return s.value.forEach(d=>{a.push(`${d.x},${d.y} `)}),[l.x,l.y,...a,n.x,n.y].toString()}),c=e.ref(void 0);function F(l,n){c.value=l,_("hoverIndex",{index:n})}function q(){c.value=void 0,_("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(g.value){const l=s.value.map(a=>a.absoluteValue),n=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:n,average:n/s.value.length,median:u.calcMedian(l),trend:u.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:I})=>({x:a,y:d,value:I}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),$=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?y.value.latest:t.value.style.dataLabel.valueType==="sum"?y.value.sum:t.value.style.dataLabel.valueType==="average"?y.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function T(l,n){_("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:x,class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily}`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:y.value.latest,sum:y.value.sum,average:y.value.average,median:y.value.median,trend:y.value.trend})),void 0,!0),t.value.style.title.show&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:B,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createVNode(j._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,Z),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,Y)],8,X),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,K),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,Q)],8,J),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,te),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,le)],8,ee)]),t.value.style.area.show&&!k.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",ae,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${r.value.bottom} ${e.unref(u.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${r.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,oe)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${O.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,ne))])):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,ue)):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,re)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:b.value,width:a.width,height:Math.abs(a.y-b.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${v.value})`:`url(#sparkline_bar_gradient_neg_${v.value})`,rx:t.value.style.bar.borderRadius},null,8,se)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||f.selectedIndex===d)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:r.value.top-6,y2:r.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,ie)):e.createCommentVNode("",!0)]))),256)),w.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.start,x2:r.value.start+r.value.width-16,y1:b.value,y2:b.value,stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,de)):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,ce)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:r.value.width+12+t.value.style.dataLabel.offsetX,y:o.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(c.value?e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:c.value}):e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,$.value,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:$.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,ve)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1))/2,y:r.value.top-6,height:r.value.height+6,width:r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1),fill:"transparent",onMouseenter:I=>F(a,d),onMouseleave:q,onClick:()=>T(a,d)},null,40,he))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,U)):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),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,H))}},pe=R._export_sfc(ye,[["__scopeId","data-v-afa97ea1"]]);exports.default=pe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-CcykRspI.cjs"),S=require("./useNestedProp-XtPlFP9O.cjs"),G=require("./vue-ui-skeleton-DpfJbsNA.cjs"),M=require("./useResponsive-BJ7DTGpm.cjs"),j=require("./PackageVersion-CowXQ4IM.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),H=["id"],U=["xmlns","viewBox"],X=["id"],Z=["stop-color"],Y=["stop-color"],J=["id"],K=["stop-color"],Q=["stop-color"],ee=["id"],te=["stop-color"],le=["stop-color"],ae={key:0},oe=["d","fill"],ne=["d","fill"],ue=["d","stroke","stroke-width"],re=["x1","x2","y1","y2","stroke","stroke-width"],se=["x","y","width","height","fill","rx"],ie=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],de=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ce=["cx","cy","r","fill","stroke","stroke-width"],ve=["x","y","font-size","font-weight","fill"],he=["x","y","height","width","onMouseenter","onClick"],ye={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:_}){const i=f,{vue_ui_sparkline:z}=u.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(u.createUid()),x=e.ref(null),B=e.ref(null),L=e.ref(null),t=e.computed({get:()=>C(),set:l=>l});function C(){const l=S.useNestedProp({userConfig:i.config,defaultConfig:z});return l.theme?{...S.useNestedProp({userConfig:u.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}e.watch(()=>i.config,l=>{t.value=C(),E(),o.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>i.dataset,l=>{p.value=i.dataset.map(n=>({...n,value:[void 0].includes(n.value)?null:n.value}))},{deep:!0});const p=e.ref(P());function P(){return i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value})}const V=e.ref(null);e.onMounted(()=>{if(E(),t.value.style.animation.show&&i.dataset.length>1){let a=function(){n<i.dataset.length?(p.value.push(i.dataset[n]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=i.dataset,n+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let n=0;a()}});function E(){if(u.objectIsEmpty(i.dataset)?u.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,n)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{u.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:n})})}),t.value.responsive){const l=M.throttle(()=>{const{width:n,height:a}=M.useResponsive({chart:x.value,title:t.value.style.title.show&&i.showInfo?B.value:null,source:L.value});o.value.width=n,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*n,o.value.padding=.06*n});V.value=new ResizeObserver(l),V.value.observe(x.value.parentNode)}}const o=e.ref({height:80,width:500,chartWidth:t.value.style.chartWidth,padding:30}),D=e.ref(6),r=e.computed(()=>({top:12,left:0,right:o.value.width,bottom:o.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?o.value.width-o.value.chartWidth:o.value.padding,width:i.showInfo&&t.value.style.dataLabel.show?o.value.chartWidth:o.value.width-o.value.padding,height:o.value.height-12})),w=e.computed(()=>Math.min(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),W=e.computed(()=>Math.max(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),m=e.computed(()=>{const l=w.value>=0?0:w.value;return Math.abs(l)}),A=e.computed(()=>W.value+m.value+D.value),b=e.computed(()=>r.value.bottom-r.value.height*N(m.value));function N(l){return l/A.value}const h=e.computed(()=>i.dataset.length-1),s=e.computed(()=>p.value.map((l,n)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+m.value,toMax:N(a+m.value),x:r.value.start+n*(r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)),y:r.value.bottom-r.value.height*N(a+m.value),id:`plot_${v.value}_${n}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?u.shiftHue(t.value.style.line.color,.05*(1-n/h.value)):t.value.style.line.color,width:r.value.width/(h.value+1)>o.padding?o.padding:r.value.width/(h.value+1)}})),O=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},n={x:s.value[s.value.length-1].x,y:o.value.height-6},a=[];return s.value.forEach(d=>{a.push(`${d.x},${d.y} `)}),[l.x,l.y,...a,n.x,n.y].toString()}),c=e.ref(void 0);function F(l,n){c.value=l,_("hoverIndex",{index:n})}function q(){c.value=void 0,_("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(g.value){const l=s.value.map(a=>a.absoluteValue),n=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:n,average:n/s.value.length,median:u.calcMedian(l),trend:u.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:I})=>({x:a,y:d,value:I}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),$=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?y.value.latest:t.value.style.dataLabel.valueType==="sum"?y.value.sum:t.value.style.dataLabel.valueType==="average"?y.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function T(l,n){_("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:x,class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily}`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:y.value.latest,sum:y.value.sum,average:y.value.average,median:y.value.median,trend:y.value.trend})),void 0,!0),t.value.style.title.show&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:B,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createVNode(j._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,Z),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,Y)],8,X),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,K),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,Q)],8,J),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,te),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,le)],8,ee)]),t.value.style.area.show&&!k.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",ae,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${r.value.bottom} ${e.unref(u.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${r.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,oe)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${O.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,ne))])):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,ue)):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,re)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:b.value,width:a.width,height:Math.abs(a.y-b.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${v.value})`:`url(#sparkline_bar_gradient_neg_${v.value})`,rx:t.value.style.bar.borderRadius},null,8,se)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||f.selectedIndex===d)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:r.value.top-6,y2:r.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,ie)):e.createCommentVNode("",!0)]))),256)),w.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.start,x2:r.value.start+r.value.width-16,y1:b.value,y2:b.value,stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,de)):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,ce)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:r.value.width+12+t.value.style.dataLabel.offsetX,y:o.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(c.value?e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:c.value}):e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,$.value,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:$.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,ve)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1))/2,y:r.value.top-6,height:r.value.height+6,width:r.value.width/(h.value+1)>o.value.padding?o.value.padding:r.value.width/(h.value+1),fill:"transparent",onMouseenter:I=>F(a,d),onMouseleave:q,onClick:()=>T(a,d)},null,40,he))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,U)):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),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,H))}},pe=R._export_sfc(ye,[["__scopeId","data-v-afa97ea1"]]);exports.default=pe;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-eFox7weK.cjs"),w=require("./useNestedProp-BkgEhTQY.cjs"),V=require("./vue-ui-skeleton-BqKzuhkB.cjs"),z=require("./PackageVersion-DwI-KhXH.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),P=["xmlns","viewBox"],L=["id"],A=["stop-color"],F=["stop-color"],q=["stop-color"],U={id:"stackPill",clipPathUnits:"objectBoundingBox"},j=["fill"],T={key:0,"clip-path":"url(#stackPill)"},H=["height","width","fill"],I=["onClick","x","width","height","fill","stroke"],O=["width","height","rx"],M=["onClick"],G={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},W=["height","width"],X=["fill"],J={key:4,ref:"source",dir:"auto"},K={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(S,{emit:E}){const u=S,{vue_ui_sparkstackbar:N}=o.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length),k=e.ref(o.createUid()),t=e.computed({get:()=>_(),set:l=>l});function _(){const l=w.useNestedProp({userConfig:u.config,defaultConfig:N});return l.theme?{...w.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>u.config,l=>{t.value=_(),b()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map((n,a)=>({...n,color:n.color?o.convertColorToHex(n.color):m.value[a]||o.palette[a]||o.palette[a%o.palette.length]}))},{deep:!0});const m=e.computed(()=>o.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?o.convertColorToHex(l.color):m.value[n]||o.palette[n]||o.palette[n%o.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(b(),t.value.style.animation.show){let p=function(){r+=a/l,r<a?(v.value=v.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length]})),requestAnimationFrame(p)):(g.value=!1,v.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length],id:o.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),a=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,p()}});function b(){o.objectIsEmpty(u.dataset)?o.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:a,index:n})})})}const d=e.ref({width:500,height:16}),c=e.ref([]),C=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!c.value.includes(n)).reduce((l,n)=>l+n,0)),x=e.computed(()=>v.value.map((l,n)=>{const a=l.value||0,r=a/C.value,p=isNaN(r)?0:r,s=p*d.value.width;return{...l,value:a,proportion:p,width:s,proportionLabel:o.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),h=e.computed(()=>x.value.filter((l,n)=>!c.value.includes(n)));function $(l){c.value.includes(l)?c.value=c.value.filter(n=>n!==l):c.value.length<v.value.length-1&&c.value.push(l)}const y=e.computed(()=>{let l=0;const n=[];for(let a=0;a<h.value.length;a+=1)n.push({...h.value[a],start:l}),l+=h.value[a].width;return n});function B(l,n){E("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background: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),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),width:"100%",viewBox:`0 0 ${d.value.width} ${d.value.height}`},[e.createVNode(z._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${k.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,A),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,F),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,q)],8,L))),128)),e.createElementVNode("clipPath",U,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,j)])]),C.value>0?(e.openBlock(),e.createElementBlock("g",T,[e.createElementVNode("rect",{x:0,y:0,height:d.value.height,width:y.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value})},null,10,H),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,onClick:()=>B(a,r),x:a.start,y:0,width:a.width,height:d.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${k.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value})},null,10,I))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:d.value.width-4,height:d.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(d.value.height-4)/2},null,8,O))],8,P)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background: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(x.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":c.value.includes(r)}),onClick:p=>{$(r),B(a,r)}},[e.createElementVNode("div",G,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:a.color},null,8,X)],8,W)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(a.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(c.value.includes(r)?" - ":a.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.legend.value.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.legend.value.prefix,v:a.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:a,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,M))),256))],4)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},Q=D._export_sfc(K,[["__scopeId","data-v-bda2b20a"]]);exports.default=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CcykRspI.cjs"),w=require("./useNestedProp-XtPlFP9O.cjs"),V=require("./vue-ui-skeleton-DpfJbsNA.cjs"),z=require("./PackageVersion-CowXQ4IM.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),P=["xmlns","viewBox"],L=["id"],A=["stop-color"],F=["stop-color"],q=["stop-color"],U={id:"stackPill",clipPathUnits:"objectBoundingBox"},j=["fill"],T={key:0,"clip-path":"url(#stackPill)"},H=["height","width","fill"],I=["onClick","x","width","height","fill","stroke"],O=["width","height","rx"],M=["onClick"],G={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},W=["height","width"],X=["fill"],J={key:4,ref:"source",dir:"auto"},K={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(S,{emit:E}){const u=S,{vue_ui_sparkstackbar:N}=o.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length),k=e.ref(o.createUid()),t=e.computed({get:()=>_(),set:l=>l});function _(){const l=w.useNestedProp({userConfig:u.config,defaultConfig:N});return l.theme?{...w.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>u.config,l=>{t.value=_(),b()},{deep:!0}),e.watch(()=>u.dataset,l=>{v.value=u.dataset.map((n,a)=>({...n,color:n.color?o.convertColorToHex(n.color):m.value[a]||o.palette[a]||o.palette[a%o.palette.length]}))},{deep:!0});const m=e.computed(()=>o.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?o.convertColorToHex(l.color):m.value[n]||o.palette[n]||o.palette[n%o.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(b(),t.value.style.animation.show){let p=function(){r+=a/l,r<a?(v.value=v.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length]})),requestAnimationFrame(p)):(g.value=!1,v.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length],id:o.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),a=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,p()}});function b(){o.objectIsEmpty(u.dataset)?o.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:a,index:n})})})}const d=e.ref({width:500,height:16}),c=e.ref([]),C=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!c.value.includes(n)).reduce((l,n)=>l+n,0)),x=e.computed(()=>v.value.map((l,n)=>{const a=l.value||0,r=a/C.value,p=isNaN(r)?0:r,s=p*d.value.width;return{...l,value:a,proportion:p,width:s,proportionLabel:o.dataLabel({v:p*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),h=e.computed(()=>x.value.filter((l,n)=>!c.value.includes(n)));function $(l){c.value.includes(l)?c.value=c.value.filter(n=>n!==l):c.value.length<v.value.length-1&&c.value.push(l)}const y=e.computed(()=>{let l=0;const n=[];for(let a=0;a<h.value.length;a+=1)n.push({...h.value[a],start:l}),l+=h.value[a].width;return n});function B(l,n){E("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background: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),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),width:"100%",viewBox:`0 0 ${d.value.width} ${d.value.height}`},[e.createVNode(z._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${k.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,A),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,F),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,q)],8,L))),128)),e.createElementVNode("clipPath",U,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,j)])]),C.value>0?(e.openBlock(),e.createElementBlock("g",T,[e.createElementVNode("rect",{x:0,y:0,height:d.value.height,width:y.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value})},null,10,H),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,onClick:()=>B(a,r),x:a.start,y:0,width:a.width,height:d.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${k.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value})},null,10,I))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:d.value.width-4,height:d.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(d.value.height-4)/2},null,8,O))],8,P)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background: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(x.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":c.value.includes(r)}),onClick:p=>{$(r),B(a,r)}},[e.createElementVNode("div",G,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:a.color},null,8,X)],8,W)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(a.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(c.value.includes(r)?" - ":a.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.legend.value.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.legend.value.prefix,v:a.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:a,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,M))),256))],4)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},Q=D._export_sfc(K,[["__scopeId","data-v-bda2b20a"]]);exports.default=Q;
@@ -1,8 +1,8 @@
1
1
  import { computed as y, ref as k, watch as I, onMounted as X, openBlock as s, createElementBlock as r, normalizeStyle as g, createElementVNode as d, toDisplayString as _, createCommentVNode as h, unref as b, createVNode as W, Fragment as D, renderList as N, normalizeClass as P, createBlock as J, renderSlot as K } from "vue";
2
- import { u as Q, c as U, t as R, a as Y, p as i, d as C, b as Z, o as ee, e as V, g as te, f as O, X as le, s as ae, w as oe, i as se } from "./index-Bya_q1J-.js";
3
- import { u as G } from "./useNestedProp-B33hazbH.js";
4
- import ne from "./vue-ui-skeleton-BYssP0K4.js";
5
- import { _ as re } from "./PackageVersion-VkaUzgmt.js";
2
+ import { u as Q, c as U, t as R, a as Y, p as i, d as C, b as Z, o as ee, e as V, g as te, f as O, X as le, s as ae, w as oe, i as se } from "./index-DCsPHn9C.js";
3
+ import { u as G } from "./useNestedProp-DdSlLeTW.js";
4
+ import ne from "./vue-ui-skeleton-DNuwx6_y.js";
5
+ import { _ as re } from "./PackageVersion-Clrfvyd8.js";
6
6
  import { _ as ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
7
  const ie = ["xmlns", "viewBox"], ce = ["id"], de = ["stop-color"], ve = ["stop-color"], ge = ["stop-color"], pe = {
8
8
  id: "stackPill",
@@ -1,17 +1,17 @@
1
1
  import { computed as p, ref as g, onMounted as Xe, watch as Ue, openBlock as s, createElementBlock as n, normalizeClass as ye, normalizeStyle as U, createBlock as Y, createCommentVNode as v, renderSlot as k, createVNode as se, unref as z, createSlots as xt, withCtx as C, normalizeProps as D, guardReactiveProps as E, Fragment as h, renderList as f, createElementVNode as H, toDisplayString as S, createTextVNode as kt } from "vue";
2
- import { u as wt, c as Ye, t as Ct, a as _t, p as ie, M as Ge, b as zt, o as Lt, e as Je, g as St, d as $t, a4 as ne, a0 as qe, C as Ze, X as Mt, l as Tt, F as Ke, f as B, x as Qe, i as je, y as Nt, q as Ot, r as Pt } from "./index-Bya_q1J-.js";
3
- import { u as et } from "./useNestedProp-B33hazbH.js";
4
- import { t as At, u as Rt } from "./useResponsive-BY8tgM1n.js";
5
- import { u as It, U as Ft } from "./usePrinter-CiHd1FwD.js";
6
- import { S as Vt } from "./Slicer-TfpN2Cr4.js";
7
- import { _ as Dt } from "./Tooltip-Cz24YLfw.js";
8
- import { _ as Et } from "./Title-C5pIfQAz.js";
9
- import { L as Ht } from "./Legend-DNgTCgEK.js";
10
- import Bt from "./vue-ui-accordion-DfUfL2dI.js";
11
- import { D as Wt } from "./DataTable-DYqC2pqu.js";
12
- import Xt from "./vue-ui-skeleton-BYssP0K4.js";
13
- import { _ as Ut } from "./PackageVersion-VkaUzgmt.js";
14
- import { P as Yt } from "./PenAndPaper-DAZYA8Ew.js";
2
+ import { u as wt, c as Ye, t as Ct, a as _t, p as ie, M as Ge, b as zt, o as Lt, e as Je, g as St, d as $t, a4 as ne, a0 as qe, C as Ze, X as Mt, l as Tt, F as Ke, f as B, x as Qe, i as je, y as Nt, q as Ot, r as Pt } from "./index-DCsPHn9C.js";
3
+ import { u as et } from "./useNestedProp-DdSlLeTW.js";
4
+ import { t as At, u as Rt } from "./useResponsive-CoxXLe23.js";
5
+ import { u as It, U as Ft } from "./usePrinter-siG3sKWo.js";
6
+ import { S as Vt } from "./Slicer-DFPDip5U.js";
7
+ import { _ as Dt } from "./Tooltip-CPlG_yQU.js";
8
+ import { _ as Et } from "./Title-710895ks.js";
9
+ import { L as Ht } from "./Legend-CRMHjbGw.js";
10
+ import Bt from "./vue-ui-accordion-D4Er5Dy5.js";
11
+ import { D as Wt } from "./DataTable-BI1tjiA_.js";
12
+ import Xt from "./vue-ui-skeleton-DNuwx6_y.js";
13
+ import { _ as Ut } from "./PackageVersion-Clrfvyd8.js";
14
+ import { P as Yt } from "./PenAndPaper-BQzgk5kO.js";
15
15
  import { _ as Gt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
16
16
  const Jt = ["id"], qt = ["xmlns", "viewBox"], Zt = { key: 0 }, Kt = ["id"], Qt = ["stop-color"], jt = ["stop-color"], ea = ["stop-color"], ta = ["x1", "x2", "y1", "y2", "stroke"], aa = ["x1", "x2", "y1", "y2", "stroke"], la = ["x1", "x2", "y1", "y2", "stroke"], oa = ["x1", "x2", "y1", "y2", "stroke"], ra = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], sa = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], ia = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], na = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ua = ["x", "y", "font-size", "fill", "font-weight"], ca = ["transform", "font-size", "fill", "font-weight"], va = ["x", "y", "font-size", "fill", "font-weight"], ha = { key: 0 }, da = ["x", "y", "font-size", "font-weight", "fill"], ya = ["x", "y", "font-size", "fill", "font-weight"], ga = { key: 0 }, ba = ["x", "y", "font-size", "font-weight", "fill"], fa = ["x1", "x2", "y1", "y2", "stroke"], ma = ["x", "y", "font-size", "font-weight", "fill"], pa = ["x1", "x2", "y1", "y2", "stroke"], xa = ["font-size", "font-weight", "fill", "text-anchor", "transform"], ka = ["text-anchor", "font-size", "font-weight", "fill", "transform"], wa = ["font-size", "font-weight", "fill", "x", "y"], Ca = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], _a = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], za = {
17
17
  key: 4,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-eFox7weK.cjs"),Le=require("./useNestedProp-BkgEhTQY.cjs"),Se=require("./useResponsive-CodiGUOE.cjs"),ze=require("./usePrinter-CSRFnDBU.cjs"),Ye=require("./Slicer-uSjfNJjG.cjs"),Ge=require("./Tooltip-9Tp2Yrd1.cjs"),Je=require("./Title-0Tp4hZ4u.cjs"),Ze=require("./Legend-Cgw4lO2O.cjs"),Ke=require("./vue-ui-accordion-TEMpM1hO.cjs"),Qe=require("./DataTable-DTzynbND.cjs"),je=require("./vue-ui-skeleton-BqKzuhkB.cjs"),et=require("./PackageVersion-DwI-KhXH.cjs"),tt=require("./PenAndPaper-CDFVOo7X.cjs"),at=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),lt=["id"],ot=["xmlns","viewBox"],rt={key:0},st=["id"],nt=["stop-color"],it=["stop-color"],ut=["stop-color"],ct=["x1","x2","y1","y2","stroke"],dt=["x1","x2","y1","y2","stroke"],vt=["x1","x2","y1","y2","stroke"],ht=["x1","x2","y1","y2","stroke"],gt=["x","y","height","rx","width","fill","stroke","stroke-width"],yt=["x","y","width","rx","height","fill","stroke","stroke-width"],mt=["x1","x2","y1","y2","stroke","stroke-width"],bt=["x1","x2","y1","y2","stroke","stroke-width"],pt=["x","y","font-size","fill","font-weight"],ft=["transform","font-size","fill","font-weight"],kt=["x","y","font-size","fill","font-weight"],xt={key:0},wt=["x","y","font-size","font-weight","fill"],Ct=["x","y","font-size","fill","font-weight"],Bt={key:0},Lt=["x","y","font-size","font-weight","fill"],St=["x1","x2","y1","y2","stroke"],zt=["x","y","font-size","font-weight","fill"],_t=["x1","x2","y1","y2","stroke"],Nt=["font-size","font-weight","fill","text-anchor","transform"],Et=["text-anchor","font-size","font-weight","fill","transform"],Mt=["font-size","font-weight","fill","x","y"],$t=["x","y","width","height","onClick","onMouseenter","fill"],Tt=["x","y","width","height","onClick","onMouseenter","fill"],Vt={key:4,class:"vue-data-ui-watermark"},Pt=["onClick"],Ft=["innerHTML"],Rt={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(Z,{expose:_e,emit:K}){const y=Z,{vue_ui_stackbar:Ne}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),U=e.ref(c.createUid()),O=e.ref(!1),Q=e.ref(null),X=e.ref(""),p=e.ref([]),j=e.ref(0),ee=e.ref(null),te=e.ref(null),ae=e.ref(null),le=e.ref(null),oe=e.ref(0),Y=e.ref(!1),$=e.ref(null),T=e.ref(!1),Ee=e.ref(0),Me=e.ref(0),$e=e.ref(0);e.onMounted(()=>{G()});const t=e.computed({get:()=>re(),set:l=>l});function re(){const l=Le.useNestedProp({userConfig:y.config,defaultConfig:Ne});let r={};return l.theme?r={...Le.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||y.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=y.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=y.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,r}e.watch(()=>y.config,l=>{t.value=re(),G(),Ee.value+=1,Me.value+=1,$e.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{ve()},{deep:!0});const b=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:se,isImaging:ne,generatePdf:ie,generateImage:ue}=ze.usePrinter({elementId:`stackbar_${U.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),D=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),Te=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),ce=e.ref(null),de=e.ref(null);e.onMounted(()=>{G()});function G(){if(c.objectIsEmpty(y.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):y.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{E.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{T.value=!0},10),t.value.responsive){const l=Se.throttle(()=>{T.value=!1;const{width:r,height:a}=Se.useResponsive({chart:M.value,title:t.value.style.chart.title.text?ee.value:null,legend:t.value.style.chart.legend.show?te.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?ae.value:null,source:le.value});D.value.width=r,D.value.height=a,clearTimeout(de.value),de.value=setTimeout(()=>{T.value=!0},10)});ce.value=new ResizeObserver(l),ce.value.observe(M.value.parentNode)}}const s=e.computed(()=>{const{height:l,width:r}=D.value,{right:a}=D.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,m=t.value.style.chart.padding.left,S=r-m-r*a,z=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:m,width:S,height:z<0?0:z}}),B=e.computed(()=>y.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Te.value[r]||c.palette[r]||c.palette[r%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:c.createUid(),color:a}})),L=e.computed(()=>Math.max(...B.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...y.dataset.map(l=>l.series.length))});function ve(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},oe.value+=1}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),V=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id))).slice(u.value.start,u.value.end)),Ve=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),A=e.computed(()=>{const l=B.value.filter(r=>!p.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...A.value.positive),r=Math.min(...A.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),P=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)),g=e.computed(()=>{if(!E.value)return[];let l=Array(L.value).fill(0),r=Array(L.value).fill(0),a=Array(L.value).fill(0),o=Array(L.value).fill(0);const n=Math.max(...A.value.positive)||0,i=Math.min(...A.value.negative),m=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,S=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:z,max:F}=S,_=F+(z>=0?0:Math.abs(z))||1,f=s.value.height,W=s.value.width,Ce=w.value[0]?w.value[0].zero:s.value.bottom,Be=w.value[0]?w.value[0].horizontal_zero:s.value.left;return B.value.filter(R=>!p.value.includes(R.id)).map(R=>{const C=R.series.slice(u.value.start,u.value.end),De=R.signedSeries.slice(u.value.start,u.value.end),Ae=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Ie=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),qe=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=f*k,N=Ce-x-l[h],l[h]+=x):(x=f*k,N=Ce+a[h],a[h]+=Math.abs(x)),N}),He=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=W*k,N=Be+r[h],r[h]+=x):(x=W*k,N=Be-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),We=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?f*k:f*Math.abs(k)}),Ue=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?W*k:W*Math.abs(k)}),Xe=C.map(v=>Math.abs(v)).reduce((v,h)=>v+h,0);return{...R,proportions:C.map((v,h)=>t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/Xe),series:C,signedSeries:De,x:Ae,y:qe,height:We,horizontal_width:Ue,horizontal_y:Ie,horizontal_x:He}})}),he=e.computed(()=>Ve.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function I(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ge(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ye(l){const r=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));K("selectDatapoint",{datapoint:r,period:P.value[l]})}function me(l){$.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))X.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:m,roundingValue:S,roundingPercentage:z}=t.value.style.chart.tooltip;let F="";P.value[l]&&(F+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${P.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{F+=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-CcykRspI.cjs"),Le=require("./useNestedProp-XtPlFP9O.cjs"),Se=require("./useResponsive-BJ7DTGpm.cjs"),ze=require("./usePrinter-BcE45wW6.cjs"),Ye=require("./Slicer-NlxLkUso.cjs"),Ge=require("./Tooltip-BapDtYOM.cjs"),Je=require("./Title-CUN1T6KC.cjs"),Ze=require("./Legend-B86sMXn7.cjs"),Ke=require("./vue-ui-accordion-B7PTyFVk.cjs"),Qe=require("./DataTable-RUQ1G_6L.cjs"),je=require("./vue-ui-skeleton-DpfJbsNA.cjs"),et=require("./PackageVersion-CowXQ4IM.cjs"),tt=require("./PenAndPaper-DBSxk9Xk.cjs"),at=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),lt=["id"],ot=["xmlns","viewBox"],rt={key:0},st=["id"],nt=["stop-color"],it=["stop-color"],ut=["stop-color"],ct=["x1","x2","y1","y2","stroke"],dt=["x1","x2","y1","y2","stroke"],vt=["x1","x2","y1","y2","stroke"],ht=["x1","x2","y1","y2","stroke"],gt=["x","y","height","rx","width","fill","stroke","stroke-width"],yt=["x","y","width","rx","height","fill","stroke","stroke-width"],mt=["x1","x2","y1","y2","stroke","stroke-width"],bt=["x1","x2","y1","y2","stroke","stroke-width"],pt=["x","y","font-size","fill","font-weight"],ft=["transform","font-size","fill","font-weight"],kt=["x","y","font-size","fill","font-weight"],xt={key:0},wt=["x","y","font-size","font-weight","fill"],Ct=["x","y","font-size","fill","font-weight"],Bt={key:0},Lt=["x","y","font-size","font-weight","fill"],St=["x1","x2","y1","y2","stroke"],zt=["x","y","font-size","font-weight","fill"],_t=["x1","x2","y1","y2","stroke"],Nt=["font-size","font-weight","fill","text-anchor","transform"],Et=["text-anchor","font-size","font-weight","fill","transform"],Mt=["font-size","font-weight","fill","x","y"],$t=["x","y","width","height","onClick","onMouseenter","fill"],Tt=["x","y","width","height","onClick","onMouseenter","fill"],Vt={key:4,class:"vue-data-ui-watermark"},Pt=["onClick"],Ft=["innerHTML"],Rt={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(Z,{expose:_e,emit:K}){const y=Z,{vue_ui_stackbar:Ne}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),U=e.ref(c.createUid()),O=e.ref(!1),Q=e.ref(null),X=e.ref(""),p=e.ref([]),j=e.ref(0),ee=e.ref(null),te=e.ref(null),ae=e.ref(null),le=e.ref(null),oe=e.ref(0),Y=e.ref(!1),$=e.ref(null),T=e.ref(!1),Ee=e.ref(0),Me=e.ref(0),$e=e.ref(0);e.onMounted(()=>{G()});const t=e.computed({get:()=>re(),set:l=>l});function re(){const l=Le.useNestedProp({userConfig:y.config,defaultConfig:Ne});let r={};return l.theme?r={...Le.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||y.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=y.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=y.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,r}e.watch(()=>y.config,l=>{t.value=re(),G(),Ee.value+=1,Me.value+=1,$e.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{ve()},{deep:!0});const b=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:se,isImaging:ne,generatePdf:ie,generateImage:ue}=ze.usePrinter({elementId:`stackbar_${U.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),D=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),Te=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),ce=e.ref(null),de=e.ref(null);e.onMounted(()=>{G()});function G(){if(c.objectIsEmpty(y.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):y.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{E.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{T.value=!0},10),t.value.responsive){const l=Se.throttle(()=>{T.value=!1;const{width:r,height:a}=Se.useResponsive({chart:M.value,title:t.value.style.chart.title.text?ee.value:null,legend:t.value.style.chart.legend.show?te.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?ae.value:null,source:le.value});D.value.width=r,D.value.height=a,clearTimeout(de.value),de.value=setTimeout(()=>{T.value=!0},10)});ce.value=new ResizeObserver(l),ce.value.observe(M.value.parentNode)}}const s=e.computed(()=>{const{height:l,width:r}=D.value,{right:a}=D.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,m=t.value.style.chart.padding.left,S=r-m-r*a,z=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:m,width:S,height:z<0?0:z}}),B=e.computed(()=>y.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Te.value[r]||c.palette[r]||c.palette[r%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:c.createUid(),color:a}})),L=e.computed(()=>Math.max(...B.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...y.dataset.map(l=>l.series.length))});function ve(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},oe.value+=1}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),V=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id))).slice(u.value.start,u.value.end)),Ve=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),A=e.computed(()=>{const l=B.value.filter(r=>!p.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...A.value.positive),r=Math.min(...A.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),P=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)),g=e.computed(()=>{if(!E.value)return[];let l=Array(L.value).fill(0),r=Array(L.value).fill(0),a=Array(L.value).fill(0),o=Array(L.value).fill(0);const n=Math.max(...A.value.positive)||0,i=Math.min(...A.value.negative),m=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,S=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:z,max:F}=S,_=F+(z>=0?0:Math.abs(z))||1,f=s.value.height,W=s.value.width,Ce=w.value[0]?w.value[0].zero:s.value.bottom,Be=w.value[0]?w.value[0].horizontal_zero:s.value.left;return B.value.filter(R=>!p.value.includes(R.id)).map(R=>{const C=R.series.slice(u.value.start,u.value.end),De=R.signedSeries.slice(u.value.start,u.value.end),Ae=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Ie=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),qe=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=f*k,N=Ce-x-l[h],l[h]+=x):(x=f*k,N=Ce+a[h],a[h]+=Math.abs(x)),N}),He=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=W*k,N=Be+r[h],r[h]+=x):(x=W*k,N=Be-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),We=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?f*k:f*Math.abs(k)}),Ue=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?W*k:W*Math.abs(k)}),Xe=C.map(v=>Math.abs(v)).reduce((v,h)=>v+h,0);return{...R,proportions:C.map((v,h)=>t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/Xe),series:C,signedSeries:De,x:Ae,y:qe,height:We,horizontal_width:Ue,horizontal_y:Ie,horizontal_x:He}})}),he=e.computed(()=>Ve.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function I(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ge(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ye(l){const r=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));K("selectDatapoint",{datapoint:r,period:P.value[l]})}function me(l){$.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))X.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:m,roundingValue:S,roundingPercentage:z}=t.value.style.chart.tooltip;let F="";P.value[l]&&(F+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${P.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{F+=`
2
2
  <div style="display:flex;flex-direction:row;align-items:center;gap:4px">
3
3
  <svg viewBox="0 0 12 12" height="14" width="14"><rect rx="1" x="0" y="0" height="12" width="12" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${f.id})`:f.color}"/></svg>
4
4
  ${f.name}${n||i?":":""} ${n?c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:f.value,s:t.value.style.chart.bars.dataLabels.suffix,r:S}):""} ${_[0]}${i?c.dataLabel({v:isNaN(f.value/o)?0:Math.abs(f.value)/o*100,s:"%",r:z}):""}${_[1]}