vue-data-ui 2.4.9 → 2.4.11

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 (158) hide show
  1. package/README.md +25 -0
  2. package/dist/{Arrow-BGrY1ydc.cjs → Arrow-B2lMAc1C.cjs} +1 -1
  3. package/dist/{Arrow-Fke-ybVE.js → Arrow-DTcpIx4P.js} +1 -1
  4. package/dist/{BaseIcon-BFZiytmY.js → BaseIcon-CNl_wwAN.js} +1 -1
  5. package/dist/{BaseIcon-P668oVRL.cjs → BaseIcon-Cci48l_M.cjs} +1 -1
  6. package/dist/{DataTable-8vTlt4e4.cjs → DataTable-BoMFIudG.cjs} +1 -1
  7. package/dist/{DataTable-Bqouzjik.js → DataTable-DD2NjgWr.js} +2 -2
  8. package/dist/{Legend-DiLvq4vW.cjs → Legend-BEBhnrMH.cjs} +1 -1
  9. package/dist/{Legend-BN2BcDVi.js → Legend-rLopjauc.js} +1 -1
  10. package/dist/PackageVersion-BPbxd_rU.cjs +1 -0
  11. package/dist/{PackageVersion-CTpPwNFg.js → PackageVersion-DjRRmHKg.js} +1 -1
  12. package/dist/{PenAndPaper-DLwiH2Np.js → PenAndPaper-BkFQN_fq.js} +2 -2
  13. package/dist/{PenAndPaper-bKJD5B9n.cjs → PenAndPaper-CLAyC1BP.cjs} +1 -1
  14. package/dist/{Shape-IDJlHO6G.js → Shape-Bc8lWk7D.js} +1 -1
  15. package/dist/{Shape-CLIJMoFo.cjs → Shape-DFrKEycb.cjs} +1 -1
  16. package/dist/{Slicer-CQsrB1vr.js → Slicer-CfPeFpUJ.js} +2 -2
  17. package/dist/{Slicer-BkionZj4.cjs → Slicer-DnddhuPD.cjs} +1 -1
  18. package/dist/{Title-RGaMCxMM.cjs → Title-BWAmAhTl.cjs} +1 -1
  19. package/dist/{Title-eBZtf9JC.js → Title-NE47pLld.js} +1 -1
  20. package/dist/{Tooltip-wUAIAM2C.js → Tooltip-1RIjj9Cf.js} +1 -1
  21. package/dist/{Tooltip-DfxV57uu.cjs → Tooltip-CopGUpZs.cjs} +1 -1
  22. package/dist/{index-CRiXU5u4.js → index-9EusFpSb.js} +1265 -1195
  23. package/dist/index-D3H-ye-i.cjs +9 -0
  24. package/dist/style.css +1 -1
  25. package/dist/types/vue-data-ui.d.cts +18 -0
  26. package/dist/types/vue-data-ui.d.ts +18 -0
  27. package/dist/{useNestedProp-DxRaQ3VM.cjs → useNestedProp-BkL_BRGP.cjs} +1 -1
  28. package/dist/{useNestedProp-CJpdmtwu.js → useNestedProp-DLOArwu0.js} +1 -1
  29. package/dist/{usePrinter-1WhDjgbn.cjs → usePrinter-Bp96LusR.cjs} +1 -1
  30. package/dist/{usePrinter-uc7d9V3q.js → usePrinter-Q5_oK30J.js} +1 -1
  31. package/dist/{vue-data-ui-MkOQ0Nle.cjs → vue-data-ui-HoFeCyRO.cjs} +1 -1
  32. package/dist/{vue-data-ui-CIm7VqEX.js → vue-data-ui-mDZeKnLu.js} +58 -58
  33. package/dist/vue-data-ui.cjs +1 -1
  34. package/dist/vue-data-ui.js +11 -11
  35. package/dist/{vue-ui-3d-bar-C1Me6SaI.cjs → vue-ui-3d-bar-CUChTQDT.cjs} +1 -1
  36. package/dist/{vue-ui-3d-bar-BJ3zWmrS.js → vue-ui-3d-bar-e8ooZusZ.js} +9 -9
  37. package/dist/{vue-ui-accordion-Bwp3om8n.cjs → vue-ui-accordion-BmZSXtWn.cjs} +1 -1
  38. package/dist/{vue-ui-accordion-UcagglMR.js → vue-ui-accordion-DE04OBLu.js} +3 -3
  39. package/dist/{vue-ui-age-pyramid-DFBnbj8i.cjs → vue-ui-age-pyramid-R8-ov8YO.cjs} +1 -1
  40. package/dist/{vue-ui-age-pyramid-CVziTeLg.js → vue-ui-age-pyramid-rBF6FLI0.js} +10 -10
  41. package/dist/{vue-ui-annotator-X2GVxnvT.js → vue-ui-annotator-C6w7-GB3.js} +1 -1
  42. package/dist/{vue-ui-annotator-DtntPrcs.cjs → vue-ui-annotator-C_ePw9hm.cjs} +1 -1
  43. package/dist/{vue-ui-bullet-Dgbg2x2i.cjs → vue-ui-bullet-CBMK8LjV.cjs} +1 -1
  44. package/dist/{vue-ui-bullet-gkQMIEIY.js → vue-ui-bullet-CrrpYnF-.js} +8 -8
  45. package/dist/{vue-ui-candlestick-a8DCa9QA.cjs → vue-ui-candlestick-DxzQ2_Xw.cjs} +1 -1
  46. package/dist/{vue-ui-candlestick-DlrvnR9W.js → vue-ui-candlestick-pRGkapAM.js} +11 -11
  47. package/dist/{vue-ui-carousel-table-Dv7Y4mPd.cjs → vue-ui-carousel-table-DEyQbJoc.cjs} +1 -1
  48. package/dist/{vue-ui-carousel-table-DqDoR5Ke.js → vue-ui-carousel-table-XQAJxsSd.js} +4 -4
  49. package/dist/{vue-ui-chestnut-B8O8csWz.cjs → vue-ui-chestnut-B0SB93Um.cjs} +1 -1
  50. package/dist/{vue-ui-chestnut-B01FJ4C4.js → vue-ui-chestnut-CqkJL5mj.js} +8 -8
  51. package/dist/{vue-ui-cursor-BViP1aeI.cjs → vue-ui-cursor-8F-TYD5m.cjs} +1 -1
  52. package/dist/{vue-ui-cursor-Ba_H8Ncs.js → vue-ui-cursor-i9FdNF85.js} +2 -2
  53. package/dist/{vue-ui-dashboard-gP-6lXnW.cjs → vue-ui-dashboard-B-uIDy9E.cjs} +1 -1
  54. package/dist/{vue-ui-dashboard-14KBNioW.js → vue-ui-dashboard-BVNC1LLY.js} +2 -2
  55. package/dist/{vue-ui-digits-BsR96Ev2.js → vue-ui-digits-2kFZOssj.js} +2 -2
  56. package/dist/{vue-ui-digits-D2YQwzS9.cjs → vue-ui-digits-DE2wuVjS.cjs} +1 -1
  57. package/dist/{vue-ui-donut-CRfeBum_.js → vue-ui-donut-BBPED91N.js} +11 -11
  58. package/dist/{vue-ui-donut-BBgDxAnA.cjs → vue-ui-donut-Dj37tKw3.cjs} +1 -1
  59. package/dist/{vue-ui-donut-evolution-B8HXkrQY.js → vue-ui-donut-evolution-BUfkTz0e.js} +11 -11
  60. package/dist/{vue-ui-donut-evolution-BJv9WfCY.cjs → vue-ui-donut-evolution-i1mnDbEF.cjs} +1 -1
  61. package/dist/{vue-ui-dumbbell-W6qsJcrI.cjs → vue-ui-dumbbell-BRUIB_6C.cjs} +1 -1
  62. package/dist/{vue-ui-dumbbell-B8JLe4Rx.js → vue-ui-dumbbell-DhJADY6g.js} +10 -10
  63. package/dist/{vue-ui-flow-BaGjUUsp.cjs → vue-ui-flow-Blm_8Qvt.cjs} +1 -1
  64. package/dist/{vue-ui-flow-XQRrGPwP.js → vue-ui-flow-kshJA6fg.js} +9 -9
  65. package/dist/{vue-ui-galaxy-Dll7-xmx.cjs → vue-ui-galaxy-BD4b4UPK.cjs} +1 -1
  66. package/dist/{vue-ui-galaxy-C860KoXR.js → vue-ui-galaxy-CRympGmo.js} +11 -11
  67. package/dist/{vue-ui-gauge-Cw6HxC9W.cjs → vue-ui-gauge-CctxHIyM.cjs} +1 -1
  68. package/dist/{vue-ui-gauge-CaM7KOxs.js → vue-ui-gauge-GhVHQWB5.js} +7 -7
  69. package/dist/{vue-ui-gizmo-CUsTgs2Y.js → vue-ui-gizmo-BmxuTH7g.js} +3 -3
  70. package/dist/{vue-ui-gizmo-9S26lSOK.cjs → vue-ui-gizmo-DtizFyAK.cjs} +1 -1
  71. package/dist/{vue-ui-heatmap-BDBRTOtW.cjs → vue-ui-heatmap-C-sjrmzc.cjs} +1 -1
  72. package/dist/{vue-ui-heatmap-C_2gDpgT.js → vue-ui-heatmap-DxRULRVw.js} +10 -10
  73. package/dist/{vue-ui-kpi-8TItSsJI.js → vue-ui-kpi-9gsCJSlL.js} +3 -3
  74. package/dist/{vue-ui-kpi-x5RLnUtN.cjs → vue-ui-kpi-ByeLCYYp.cjs} +1 -1
  75. package/dist/{vue-ui-mini-loader-AZUp82dL.cjs → vue-ui-mini-loader--9CTs5gd.cjs} +1 -1
  76. package/dist/{vue-ui-mini-loader-BeWlFItj.js → vue-ui-mini-loader-BoUDfasO.js} +2 -2
  77. package/dist/{vue-ui-molecule-tkmH5BKP.cjs → vue-ui-molecule-GiHkJdKW.cjs} +1 -1
  78. package/dist/{vue-ui-molecule-CJ_9xqd9.js → vue-ui-molecule-kL3t5Yhh.js} +11 -11
  79. package/dist/{vue-ui-mood-radar-Ck53yZA6.js → vue-ui-mood-radar-Btlxem3-.js} +11 -11
  80. package/dist/{vue-ui-mood-radar-C75OoHKh.cjs → vue-ui-mood-radar-hasGnJHW.cjs} +1 -1
  81. package/dist/{vue-ui-nested-donuts-Bpyw1aFZ.cjs → vue-ui-nested-donuts-A8iBv-cs.cjs} +1 -1
  82. package/dist/{vue-ui-nested-donuts-B_S0s6fo.js → vue-ui-nested-donuts-BNHhURZB.js} +11 -11
  83. package/dist/{vue-ui-onion-DnLZsLDV.js → vue-ui-onion-BjT6FXBW.js} +11 -11
  84. package/dist/{vue-ui-onion-lMCndwqx.cjs → vue-ui-onion-CfvgXR20.cjs} +1 -1
  85. package/dist/{vue-ui-parallel-coordinate-plot-Cjr4ER1g.js → vue-ui-parallel-coordinate-plot-1gJHwi-G.js} +12 -12
  86. package/dist/{vue-ui-parallel-coordinate-plot-CiuKqlpx.cjs → vue-ui-parallel-coordinate-plot-72ULVOQs.cjs} +1 -1
  87. package/dist/vue-ui-quadrant-BIReuPm7.cjs +1 -0
  88. package/dist/{vue-ui-quadrant-7ayR33KM.js → vue-ui-quadrant-sfyO2CyO.js} +130 -123
  89. package/dist/{vue-ui-quick-chart-CF5lJluJ.cjs → vue-ui-quick-chart-C-Z1DYoT.cjs} +1 -1
  90. package/dist/{vue-ui-quick-chart-C0jzFqV_.js → vue-ui-quick-chart-C-srQH9J.js} +9 -9
  91. package/dist/{vue-ui-radar-_wv53dRp.js → vue-ui-radar-BzC0VQbN.js} +12 -12
  92. package/dist/{vue-ui-radar-Dpfn4aPE.cjs → vue-ui-radar-MiFm7SRw.cjs} +1 -1
  93. package/dist/{vue-ui-rating-DW2tgPIX.cjs → vue-ui-rating-BuD7W04t.cjs} +1 -1
  94. package/dist/{vue-ui-rating-DQHUlrFb.js → vue-ui-rating-ki_gfG3m.js} +11 -11
  95. package/dist/{vue-ui-relation-circle-BMq4fJ88.cjs → vue-ui-relation-circle-B67IFMK8.cjs} +1 -1
  96. package/dist/{vue-ui-relation-circle-79WZpSrS.js → vue-ui-relation-circle-BZMISq3F.js} +7 -7
  97. package/dist/{vue-ui-rings-BoTgy6Fr.cjs → vue-ui-rings-BUyJgRUc.cjs} +1 -1
  98. package/dist/{vue-ui-rings-BrCjSI5Z.js → vue-ui-rings-CfpBmZkF.js} +11 -11
  99. package/dist/{vue-ui-scatter-CBmiFQT9.js → vue-ui-scatter-BFs-7dvK.js} +131 -127
  100. package/dist/vue-ui-scatter-DMNVRT91.cjs +1 -0
  101. package/dist/{vue-ui-screenshot-Bq3qvacn.cjs → vue-ui-screenshot-BMSEKDz2.cjs} +1 -1
  102. package/dist/{vue-ui-screenshot-BKOcxDB2.js → vue-ui-screenshot-Cauo4x1P.js} +1 -1
  103. package/dist/{vue-ui-skeleton-xn62L2MO.cjs → vue-ui-skeleton-BWO9iit6.cjs} +1 -1
  104. package/dist/{vue-ui-skeleton-CjpLaxv-.js → vue-ui-skeleton-DptJx8-6.js} +20 -20
  105. package/dist/{vue-ui-smiley-D6aLE71R.js → vue-ui-smiley-Cg1vDE5p.js} +2 -2
  106. package/dist/{vue-ui-smiley-9H9LUASi.cjs → vue-ui-smiley-DEV_dsFD.cjs} +1 -1
  107. package/dist/vue-ui-spark-trend-DFwmZlab.cjs +1 -0
  108. package/dist/vue-ui-spark-trend-DmponpJr.js +282 -0
  109. package/dist/{vue-ui-sparkbar-BzN6k1x-.js → vue-ui-sparkbar-D4dlelWC.js} +4 -4
  110. package/dist/{vue-ui-sparkbar-CyNsfVim.cjs → vue-ui-sparkbar-DvVvbi80.cjs} +1 -1
  111. package/dist/{vue-ui-sparkgauge-Cze6RBhD.js → vue-ui-sparkgauge-C2VZgwK6.js} +4 -4
  112. package/dist/{vue-ui-sparkgauge-m2_6j81L.cjs → vue-ui-sparkgauge-CRydFcHZ.cjs} +1 -1
  113. package/dist/{vue-ui-sparkhistogram-CLsOngeA.cjs → vue-ui-sparkhistogram-C8R8LNDx.cjs} +1 -1
  114. package/dist/{vue-ui-sparkhistogram-B-v4hU6_.js → vue-ui-sparkhistogram-DsMLAwhW.js} +5 -5
  115. package/dist/vue-ui-sparkline-CjRhD9aT.cjs +1 -0
  116. package/dist/{vue-ui-sparkline-DLnP9odc.js → vue-ui-sparkline-D0tbUqaT.js} +134 -124
  117. package/dist/{vue-ui-sparkstackbar-BXP6IEtT.cjs → vue-ui-sparkstackbar-Mcu-MB5q.cjs} +1 -1
  118. package/dist/{vue-ui-sparkstackbar-cDy_FCNx.js → vue-ui-sparkstackbar-oXLKSeVe.js} +5 -5
  119. package/dist/{vue-ui-stackbar-DrpNm-6r.cjs → vue-ui-stackbar-CLejMfqE.cjs} +1 -1
  120. package/dist/{vue-ui-stackbar-CiqiPCPX.js → vue-ui-stackbar-JD5iEkUX.js} +12 -12
  121. package/dist/{vue-ui-strip-plot-DNo9nipS.cjs → vue-ui-strip-plot-DT_HJhrK.cjs} +1 -1
  122. package/dist/{vue-ui-strip-plot-C-zS7o1M.js → vue-ui-strip-plot-ZLb1XbOJ.js} +11 -11
  123. package/dist/{vue-ui-table-D9aY6eJT.cjs → vue-ui-table-CATIqeAZ.cjs} +1 -1
  124. package/dist/{vue-ui-table-heatmap-KxsHw3d3.cjs → vue-ui-table-heatmap-2xNfY1n-.cjs} +1 -1
  125. package/dist/{vue-ui-table-heatmap-zs6Z470G.js → vue-ui-table-heatmap-Bx0wx_p5.js} +21 -21
  126. package/dist/{vue-ui-table-EATZiVw7.js → vue-ui-table-i2KKmKxr.js} +10 -10
  127. package/dist/{vue-ui-table-sparkline-BNI0g8vI.js → vue-ui-table-sparkline-BJ1p4Emo.js} +16 -16
  128. package/dist/{vue-ui-table-sparkline-CKXBmV2x.cjs → vue-ui-table-sparkline-lIhP_jpT.cjs} +1 -1
  129. package/dist/{vue-ui-thermometer-B70IlU6G.cjs → vue-ui-thermometer-C5HlafWP.cjs} +1 -1
  130. package/dist/{vue-ui-thermometer-DWYtuYTq.js → vue-ui-thermometer-Cpw1HsJj.js} +7 -7
  131. package/dist/{vue-ui-timer-DLobjqLZ.js → vue-ui-timer-BqlatBRs.js} +5 -5
  132. package/dist/{vue-ui-timer-Dimpnhrr.cjs → vue-ui-timer-DJ6Z60f7.cjs} +1 -1
  133. package/dist/{vue-ui-tiremarks-CehKPt9l.cjs → vue-ui-tiremarks-COUOuw47.cjs} +1 -1
  134. package/dist/{vue-ui-tiremarks-DHosMEnc.js → vue-ui-tiremarks-D-X3Nci7.js} +7 -7
  135. package/dist/{vue-ui-treemap-3zwGXPWM.js → vue-ui-treemap-Bt24Hk6i.js} +11 -11
  136. package/dist/{vue-ui-treemap-uxUzrgJw.cjs → vue-ui-treemap-x7BAU-Mj.cjs} +1 -1
  137. package/dist/{vue-ui-vertical-bar-UXCZ5jyu.js → vue-ui-vertical-bar-BwLl08U5.js} +11 -11
  138. package/dist/{vue-ui-vertical-bar-tljvI8ZD.cjs → vue-ui-vertical-bar-DLarr8xJ.cjs} +1 -1
  139. package/dist/{vue-ui-waffle-B5YJ2-qg.js → vue-ui-waffle-CL53rtX8.js} +11 -11
  140. package/dist/{vue-ui-waffle-BB0nwq8k.cjs → vue-ui-waffle-CUgTo43L.cjs} +1 -1
  141. package/dist/{vue-ui-wheel-Doj339q6.cjs → vue-ui-wheel-BNcFNmnp.cjs} +1 -1
  142. package/dist/{vue-ui-wheel-BNV-kvRK.js → vue-ui-wheel-Cnktsvs_.js} +7 -7
  143. package/dist/{vue-ui-word-cloud-DzlAcim2.js → vue-ui-word-cloud-CNq7Fs2o.js} +10 -10
  144. package/dist/{vue-ui-word-cloud-vEgW75C-.cjs → vue-ui-word-cloud-DMQf_Jlw.cjs} +1 -1
  145. package/dist/{vue-ui-xy-DcinX3ix.js → vue-ui-xy-D0CYaEFW.js} +269 -255
  146. package/dist/{vue-ui-xy-canvas-C5oFgOEO.js → vue-ui-xy-canvas-CBkXw173.js} +63 -60
  147. package/dist/vue-ui-xy-canvas-CzEUFhi7.cjs +9 -0
  148. package/dist/vue-ui-xy-dwJ4ji_y.cjs +3 -0
  149. package/package.json +1 -1
  150. package/dist/PackageVersion-DPna32U7.cjs +0 -1
  151. package/dist/index-CxfVE-zl.cjs +0 -9
  152. package/dist/vue-ui-quadrant-DDbKIPVl.cjs +0 -1
  153. package/dist/vue-ui-scatter-AgWOR5nX.cjs +0 -1
  154. package/dist/vue-ui-spark-trend-DhUNW1YZ.js +0 -272
  155. package/dist/vue-ui-spark-trend-KO9LcvA9.cjs +0 -1
  156. package/dist/vue-ui-sparkline--mWL3SLf.cjs +0 -1
  157. package/dist/vue-ui-xy-CpuHnuJR.cjs +0 -3
  158. package/dist/vue-ui-xy-canvas-D665Zxts.cjs +0 -9
@@ -0,0 +1,282 @@
1
+ import { computed as s, ref as k, watch as D, onMounted as H, openBlock as o, createElementBlock as u, normalizeStyle as J, createBlock as L, unref as h, createVNode as K, createElementVNode as _, createCommentVNode as d, toDisplayString as E, renderSlot as Q } from "vue";
2
+ import { u as ee, c as te, t as ae, Y as S, o as le, e as ne, v as c, Z as oe, X as se, s as M, R as G, f as O, i as ue } from "./index-9EusFpSb.js";
3
+ import { u as U } from "./useNestedProp-DLOArwu0.js";
4
+ import I from "./BaseIcon-CNl_wwAN.js";
5
+ import re from "./vue-ui-skeleton-DptJx8-6.js";
6
+ import { _ as ie } from "./PackageVersion-DjRRmHKg.js";
7
+ import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
+ const ve = ["id"], he = ["xmlns", "viewBox"], ce = ["id"], ye = ["stop-color"], fe = ["stop-color"], pe = { key: 0 }, me = ["d", "fill"], ge = ["d", "fill"], ke = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"], _e = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"], be = ["height", "width", "x"], xe = { style: { width: "100%" } }, we = ["x", "y", "fill", "font-size", "font-weight"], Ce = ["stroke", "cx", "cy", "fill"], Le = ["x", "y", "font-size", "fill", "font-weight"], $e = {
9
+ key: 2,
10
+ ref: "source",
11
+ dir: "auto"
12
+ }, Ne = {
13
+ __name: "vue-ui-spark-trend",
14
+ props: {
15
+ config: {
16
+ type: Object,
17
+ default() {
18
+ return {};
19
+ }
20
+ },
21
+ dataset: {
22
+ type: Array,
23
+ default() {
24
+ return [];
25
+ }
26
+ }
27
+ },
28
+ setup(Z) {
29
+ const r = Z, { vue_ui_spark_trend: q } = ee(), P = s(() => !!r.dataset && r.dataset.length), b = k(te()), e = s({
30
+ get: () => F(),
31
+ set: (t) => t
32
+ });
33
+ function F() {
34
+ const t = U({
35
+ userConfig: r.config,
36
+ defaultConfig: q
37
+ });
38
+ return t.theme ? {
39
+ ...U({
40
+ userConfig: ae.vue_ui_spark_trend[t.theme] || r.config,
41
+ defaultConfig: t
42
+ })
43
+ } : t;
44
+ }
45
+ const f = s(() => S({
46
+ data: r.dataset,
47
+ threshold: e.value.downsample.threshold
48
+ }));
49
+ D(() => r.config, (t) => {
50
+ e.value = F(), j();
51
+ }, { deep: !0 }), D(() => r.dataset, (t) => {
52
+ m.value = S({
53
+ data: r.dataset,
54
+ threshold: e.value.downsample.threshold
55
+ }).map((l) => [void 0, 1 / 0, -1 / 0, null, NaN].includes(l) ? null : l);
56
+ }, { deep: !0 });
57
+ function $(t) {
58
+ return t.map((l) => c(l));
59
+ }
60
+ const m = k(S({
61
+ data: r.dataset,
62
+ threshold: e.value.downsample.threshold
63
+ }).map((t) => e.value.style.animation.show || [void 0, 1 / 0, -1 / 0, null, NaN].includes(t) ? null : t)), g = k(!1), N = k(null);
64
+ H(() => {
65
+ j();
66
+ let l = 1e3 / e.value.style.animation.animationFrames, v = performance.now();
67
+ if (e.value.style.animation.show && e.value.style.animation.animationFrames && r.dataset.length > 1) {
68
+ let z = function() {
69
+ g.value = !0;
70
+ let B = performance.now(), V = B - v;
71
+ V > l ? (v = B - V % l, p < f.value.length ? (m.value.push(f.value[p]), p += 1, N.value = requestAnimationFrame(z)) : (cancelAnimationFrame(N.value), m.value = $(f.value), g.value = !1)) : N.value = requestAnimationFrame(z);
72
+ };
73
+ m.value = [];
74
+ let p = 0;
75
+ z();
76
+ }
77
+ });
78
+ function j() {
79
+ le(r.dataset) && ne({
80
+ componentName: "VueUiSparkTrend",
81
+ type: "dataset"
82
+ });
83
+ }
84
+ const n = k({
85
+ height: 80,
86
+ width: 300
87
+ }), y = s(() => ({
88
+ top: e.value.style.padding.top,
89
+ left: e.value.style.padding.left,
90
+ right: n.value.width - e.value.style.padding.right,
91
+ bottom: n.value.height - e.value.style.padding.bottom,
92
+ height: n.value.height - (e.value.style.padding.top + e.value.style.padding.bottom) - (e.value.style.dataLabel.show ? e.value.style.dataLabel.fontSize : 0),
93
+ width: n.value.width - (e.value.style.padding.left + e.value.style.padding.right)
94
+ })), T = s(() => {
95
+ const t = $(f.value);
96
+ return {
97
+ max: Math.max(...t.map((l) => c(l))),
98
+ min: Math.min(...t.map((l) => c(l)))
99
+ };
100
+ }), x = s(() => {
101
+ const t = T.value.min >= 0 ? 0 : T.value.min;
102
+ return Math.abs(t);
103
+ }), R = s(() => T.value.max + x.value);
104
+ function A(t) {
105
+ return t / R.value;
106
+ }
107
+ const W = s(() => f.value.length), a = s(() => m.value.map((t, l) => {
108
+ const v = isNaN(t) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t) ? 0 : t || 0;
109
+ return {
110
+ value: c(t),
111
+ absoluteValue: c(v),
112
+ plotValue: c(v + x.value),
113
+ toMax: A(v + x.value),
114
+ x: y.value.left + c(l * (y.value.width / (W.value - 1))) - e.value.style.padding.right,
115
+ y: y.value.bottom - c(y.value.height * A(v + x.value))
116
+ };
117
+ })), w = s(() => {
118
+ const t = $(f.value);
119
+ return e.value.style.trendLabel.trendType === "global" ? oe(t) : e.value.style.trendLabel.trendType === "n-1" && t.length > 1 ? (t.at(-1) / t.at(-2) - 1) * 100 : e.value.style.trendLabel.trendType === "lastToFirst" ? (t.at(-1) / t[0] - 1) * 100 : 0;
120
+ }), C = s(() => g.value || w.value === 0 ? "neutral" : w.value > 0 ? "positive" : "negative"), i = s(() => e.value.style.arrow.colors[C.value]), X = s(() => {
121
+ const t = { x: a.value[0].x, y: n.value.height - 6 }, l = { x: a.value[a.value.length - 1].x, y: n.value.height - 6 }, v = [];
122
+ return a.value.forEach((p) => {
123
+ v.push(`${p.x},${p.y} `);
124
+ }), [t.x, t.y, ...v, l.x, l.y].toString();
125
+ }), Y = s(() => {
126
+ let t = [];
127
+ return a.value.forEach((l) => {
128
+ t.push(`${l.x},${l.y} `);
129
+ }), `M ${t.toString()}`;
130
+ });
131
+ return (t, l) => (o(), u("div", {
132
+ class: "vue-ui-spark-trend",
133
+ id: b.value,
134
+ style: J(`width:100%;font-family:${e.value.style.fontFamily};background:${e.value.style.backgroundColor}`)
135
+ }, [
136
+ P.value ? (o(), u("svg", {
137
+ key: 1,
138
+ xmlns: h(se),
139
+ viewBox: `0 0 ${n.value.width} ${n.value.height}`,
140
+ style: "width:100%;background:transparent;overflow:visible"
141
+ }, [
142
+ K(ie),
143
+ _("defs", null, [
144
+ _("linearGradient", {
145
+ x1: "0%",
146
+ y1: "0%",
147
+ x2: "0%",
148
+ y2: "100%",
149
+ id: `pill_gradient_${b.value}`
150
+ }, [
151
+ _("stop", {
152
+ offset: "0%",
153
+ "stop-color": h(M)(e.value.style.line.useColorTrend ? i.value : e.value.style.line.stroke, e.value.style.area.opacity)
154
+ }, null, 8, ye),
155
+ _("stop", {
156
+ offset: "100%",
157
+ "stop-color": e.value.style.backgroundColor
158
+ }, null, 8, fe)
159
+ ], 8, ce)
160
+ ]),
161
+ e.value.style.area.show && a.value[0] ? (o(), u("g", pe, [
162
+ e.value.style.line.smooth ? (o(), u("path", {
163
+ key: 0,
164
+ d: `M ${a.value[0].x},${y.value.bottom} ${h(G)(a.value)} L ${a.value.at(-1).x},${y.value.bottom} Z`,
165
+ fill: e.value.style.area.useGradient ? `url(#pill_gradient_${b.value})` : h(M)(e.value.style.line.useColorTrend ? i.value : e.value.style.line.stroke, e.value.style.area.opacity),
166
+ stroke: "none"
167
+ }, null, 8, me)) : (o(), u("path", {
168
+ key: 1,
169
+ d: `M${X.value}Z`,
170
+ fill: e.value.style.area.useGradient ? `url(#pill_gradient_${b.value})` : h(M)(e.value.style.line.useColorTrend ? i.value : e.value.style.line.stroke, e.value.style.area.opacity),
171
+ stroke: "none"
172
+ }, null, 8, ge))
173
+ ])) : d("", !0),
174
+ e.value.style.line.smooth && a.value.length ? (o(), u("path", {
175
+ key: 1,
176
+ d: `M ${h(G)(a.value)}`,
177
+ stroke: e.value.style.line.useColorTrend ? i.value : e.value.style.line.stroke,
178
+ fill: "none",
179
+ "stroke-width": e.value.style.line.strokeWidth,
180
+ "stroke-linecap": e.value.style.line.strokeLinecap,
181
+ "stroke-linejoin": e.value.style.line.strokeLinejoin
182
+ }, null, 8, ke)) : d("", !0),
183
+ !e.value.style.line.smooth && a.value.length ? (o(), u("path", {
184
+ key: 2,
185
+ d: Y.value,
186
+ stroke: e.value.style.line.useColorTrend ? i.value : e.value.style.line.stroke,
187
+ fill: "none",
188
+ "stroke-width": e.value.style.line.strokeWidth,
189
+ "stroke-linecap": e.value.style.line.strokeLinecap,
190
+ "stroke-linejoin": e.value.style.line.strokeLinejoin
191
+ }, null, 8, _e)) : d("", !0),
192
+ g.value ? d("", !0) : (o(), u("foreignObject", {
193
+ key: 3,
194
+ height: n.value.height / 2,
195
+ width: n.value.height / 2,
196
+ x: n.value.height / 5,
197
+ y: 8
198
+ }, [
199
+ _("div", xe, [
200
+ C.value === "positive" ? (o(), L(I, {
201
+ key: 0,
202
+ stroke: i.value,
203
+ name: "arrowTop",
204
+ size: n.value.height / 2
205
+ }, null, 8, ["stroke", "size"])) : d("", !0),
206
+ C.value === "negative" ? (o(), L(I, {
207
+ key: 1,
208
+ stroke: i.value,
209
+ name: "arrowBottom",
210
+ size: n.value.height / 2
211
+ }, null, 8, ["stroke", "size"])) : d("", !0),
212
+ C.value === "neutral" ? (o(), L(I, {
213
+ key: 2,
214
+ stroke: i.value,
215
+ name: "arrowRight",
216
+ size: n.value.height / 2
217
+ }, null, 8, ["stroke", "size"])) : d("", !0)
218
+ ])
219
+ ], 8, be)),
220
+ g.value ? d("", !0) : (o(), u("text", {
221
+ key: 4,
222
+ x: n.value.height / 2 - n.value.height / 20,
223
+ y: y.value.bottom,
224
+ "text-anchor": "middle",
225
+ fill: e.value.style.trendLabel.useColorTrend ? i.value : e.value.style.trendLabel.color,
226
+ "font-size": e.value.style.trendLabel.fontSize,
227
+ "font-weight": e.value.style.trendLabel.bold ? "bold" : "normal"
228
+ }, E(h(O)({
229
+ p: w.value > 0 ? "+" : "",
230
+ v: w.value,
231
+ s: "%",
232
+ r: e.value.style.trendLabel.rounding
233
+ })), 9, we)),
234
+ a.value.length && a.value.at(-1).x !== void 0 ? (o(), u("circle", {
235
+ key: 5,
236
+ stroke: e.value.style.backgroundColor,
237
+ "stroke-width": 2,
238
+ cx: a.value.at(-1).x,
239
+ cy: a.value.at(-1).y,
240
+ r: 4,
241
+ fill: i.value
242
+ }, null, 8, Ce)) : d("", !0),
243
+ a.value.length && a.value.at(-1).x !== void 0 && e.value.style.dataLabel.show ? (o(), u("text", {
244
+ key: 6,
245
+ "text-anchor": "middle",
246
+ x: a.value.at(-1).x,
247
+ y: a.value.at(-1).y - e.value.style.dataLabel.fontSize / 1.5,
248
+ "font-size": e.value.style.dataLabel.fontSize,
249
+ fill: e.value.style.dataLabel.useColorTrend ? i.value : e.value.style.dataLabel.color,
250
+ "font-weight": e.value.style.dataLabel.bold ? "bold" : "normal"
251
+ }, E(h(ue)(
252
+ e.value.style.dataLabel.formatter,
253
+ a.value.at(-1).value,
254
+ h(O)({
255
+ p: e.value.style.dataLabel.prefix,
256
+ v: a.value.at(-1).value,
257
+ s: e.value.style.dataLabel.suffix,
258
+ r: e.value.style.dataLabel.rounding
259
+ }),
260
+ { datapoint: a.value.at(-1) }
261
+ )), 9, Le)) : d("", !0)
262
+ ], 8, he)) : (o(), L(re, {
263
+ key: 0,
264
+ config: {
265
+ type: "sparkline",
266
+ style: {
267
+ backgroundColor: e.value.style.backgroundColor,
268
+ sparkline: {
269
+ color: "#CCCCCC"
270
+ }
271
+ }
272
+ }
273
+ }, null, 8, ["config"])),
274
+ t.$slots.source ? (o(), u("div", $e, [
275
+ Q(t.$slots, "source", {}, void 0, !0)
276
+ ], 512)) : d("", !0)
277
+ ], 12, ve));
278
+ }
279
+ }, Ae = /* @__PURE__ */ de(Ne, [["__scopeId", "data-v-30936343"]]);
280
+ export {
281
+ Ae as default
282
+ };
@@ -1,8 +1,8 @@
1
1
  import { computed as g, ref as x, watch as z, onMounted as q, nextTick as H, openBlock as n, createElementBlock as v, normalizeStyle as f, unref as s, renderSlot as b, normalizeProps as L, mergeProps as X, createCommentVNode as c, createElementVNode as d, toDisplayString as p, Fragment as O, renderList as R, guardReactiveProps as J, createVNode as K, createBlock as Q } from "vue";
2
- import { u as Y, c as Z, t as ee, a as te, p as k, b as le, o as ae, e as T, g as oe, d as se, s as $, i as w, f as _, X as ue, w as ne } from "./index-CRiXU5u4.js";
3
- import { u as V } from "./useNestedProp-CJpdmtwu.js";
4
- import ie from "./vue-ui-skeleton-CjpLaxv-.js";
5
- import { _ as re } from "./PackageVersion-CTpPwNFg.js";
2
+ import { u as Y, c as Z, t as ee, a as te, p as k, b as le, o as ae, e as T, g as oe, d as se, s as $, i as w, f as _, X as ue, w as ne } from "./index-9EusFpSb.js";
3
+ import { u as V } from "./useNestedProp-DLOArwu0.js";
4
+ import ie from "./vue-ui-skeleton-DptJx8-6.js";
5
+ import { _ as re } from "./PackageVersion-DjRRmHKg.js";
6
6
  const ve = ["onClick"], ce = { key: 1 }, de = ["xmlns", "viewBox"], fe = ["id"], pe = ["stop-color"], ye = ["stop-color"], me = ["height", "width", "fill", "rx"], ge = ["height", "width", "fill", "rx"], he = ["height", "width", "fill", "rx"], xe = {
7
7
  key: 2,
8
8
  ref: "source",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CxfVE-zl.cjs"),C=require("./useNestedProp-DxRaQ3VM.cjs"),V=require("./vue-ui-skeleton-xn62L2MO.cjs"),D=require("./PackageVersion-DPna32U7.cjs"),$=["onClick"],z={key:1},L=["xmlns","viewBox"],P=["id"],A=["stop-color"],F=["stop-color"],O=["height","width","fill","rx"],I=["height","width","fill","rx"],T=["height","width","fill","rx"],q={key:2,ref:"source",dir:"auto"},M={__name:"vue-ui-sparkbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:null}},emits:["selectDatapoint"],setup(p,{emit:b}){const n=p,{vue_ui_sparkbar:w}=o.useConfig(),v=e.computed(()=>!!n.dataset&&n.dataset.length),y=e.ref(o.createUid()),t=e.computed({get:()=>f(),set:l=>l});function f(){const l=C.useNestedProp({userConfig:n.config,defaultConfig:w});return l.theme?{...C.useNestedProp({userConfig:o.themes.vue_ui_sparkbar[l.theme]||n.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>n.config,l=>{t.value=f()},{deep:!0});const S=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),c=e.ref(n.dataset.map(l=>({...l,value:t.value.style.animation.show?0:l.value||0,formatter:l.formatter||null}))),g=e.ref(null);e.onMounted(async()=>{o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiSparkbar",type:"dataset"}),h()});function h(){if(t.value.style.animation.show){let x=function(){i+=a/l,i<a?(c.value=c.value.map((u,m)=>({...u,value:u.value+=r[m]})),g.value=requestAnimationFrame(x)):c.value=n.dataset.map(u=>({...u,value:u.value||0,formatter:u.formatter||null}))};const l=t.value.style.animation.animationFrames,r=n.dataset.map((u,m)=>u.value/l),a=n.dataset.map(u=>u.value||0).reduce((u,m)=>u+m,0);let i=0;x()}}e.watch(()=>n.dataset,async l=>{cancelAnimationFrame(g.value),c.value=n.dataset.map(r=>({...r,value:t.value.style.animation.show?0:r.value||0,formatter:r.formatter||null})),e.nextTick(h)},{deep:!0});const s=e.ref({width:500,height:16}),N=e.computed(()=>Math.max(...n.dataset.map(l=>l.value))),_=e.computed(()=>(n.dataset.forEach((l,r)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkbar",type:"datasetSerieAttribute",property:a,index:r})})}),c.value.map((l,r)=>({...l,value:l.value||0,color:o.convertColorToHex(l.color)||S.value[r]||o.palette[r]||o.palette[r%o.palette.length]}))));function B(l){return l/N.value}function k(l){return t.value.style.layout.independant?l.target?l.value/l.target:t.value.style.layout.percentage?l.value>100?1:l.value/100:t.value.style.layout.target===0?1:l.value/t.value.style.layout.target:B(l.value)}function d(l){return t.value.style.layout.independant&&l.target||t.value.style.layout.target}function E(l,r){b("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({width:"100%",fontFamily:t.value.style.fontFamily,background:n.backgroundOpacity!==null?e.unref(o.setOpacity)(t.value.style.backgroundColor,n.backgroundOpacity):t.value.style.backgroundColor})},[l.$slots.title?e.renderSlot(l.$slots,"title",e.normalizeProps(e.mergeProps({key:0},{title:{...l.title,title:t.value.style.title.text,subtitle:t.value.style.title.subtitle.text}}))):e.createCommentVNode("",!0),!l.$slots.title&&t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,class:"vue-ui-sparkbar-title-container",style:e.normalizeStyle({background:t.value.style.title.backgroundColor,margin:t.value.style.title.margin,textAlign:t.value.style.title.textAlign})},[e.createElementVNode("div",{class:"vue-ui-sparkbar-title",style:e.normalizeStyle({fontSize:t.value.style.title.fontSize+"px",color:t.value.style.title.color,fontWeight:t.value.style.title.bold?"bold":"normal"})},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-sparkbar-subtitle",style:e.normalizeStyle({fontSize:t.value.style.title.subtitle.fontSize+"px",color:t.value.style.title.subtitle.color,fontWeight:t.value.style.title.subtitle.bold?"bold":"normal"})},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`display:flex !important;${["left","right"].includes(t.value.style.labels.name.position)?`flex-direction: ${t.value.style.labels.name.position==="right"?"row-reverse":"row"} !important`:"flex-direction:column !important"};gap:${t.value.style.gap}px !important;align-items:center;${p.dataset.length>0&&i!==p.dataset.length-1?"margin-bottom:6px":""}`),onClick:()=>E(a,i)},[e.renderSlot(l.$slots,"data-label",e.normalizeProps(e.guardReactiveProps({bar:{...a,target:d(a),valueLabel:e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i}),targetLabel:e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i})}}))),l.$slots["data-label"]?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:t.value.style.labels.name.width,color:t.value.style.labels.name.color,fontSize:t.value.style.labels.fontSize+"px",fontWeight:t.value.style.labels.name.bold?"bold":"normal",textAlign:["left","right"].includes(t.value.style.labels.name.position)||["top","top-left"].includes(t.value.style.labels.name.position)?"left":t.value.style.labels.name.position==="top-center"?"center":"right"})},[e.createElementVNode("span",null,e.toDisplayString(a.name),1),t.value.style.labels.value.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.labels.value.bold?"bold":"normal"}`)},": "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i})),5)):e.createCommentVNode("",!0),t.value.style.layout.showTargetValue?(e.openBlock(),e.createElementBlock("span",z,e.toDisplayString(" "+t.value.style.layout.targetValueText)+" "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i})),1)):e.createCommentVNode("",!0)],4)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${s.value.width} ${s.value.height}`,width:"100%"},[e.createVNode(D._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkbar_gradient_${i}_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.03),100-t.value.style.bar.gradient.intensity)},null,8,A),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,F)],8,P)]),e.createElementVNode("rect",{height:s.value.height,width:s.value.width,x:0,y:0,fill:e.unref(o.setOpacity)(t.value.style.gutter.backgroundColor,t.value.style.gutter.opacity),rx:s.value.height/2},null,8,O),e.createElementVNode("rect",{height:s.value.height,width:s.value.width*k(a),x:0,y:0,fill:t.value.style.bar.gradient.underlayerColor,rx:s.value.height/2},null,8,I),e.createElementVNode("rect",{height:s.value.height,width:s.value.width*k(a),x:0,y:0,fill:t.value.style.bar.gradient.show?`url(#sparkbar_gradient_${i}_${y.value})`:a.color,rx:s.value.height/2},null,8,T)],8,L))],12,$)):e.createCommentVNode("",!0)],64))),256)),l.$slots.source?(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(l.$slots,"source")],512)):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:3,config:{type:"sparkbar",style:{backgroundColor:t.value.style.backgroundColor,sparkbar:{color:"#CCCCCC"}}}},null,8,["config"]))],4))}};exports.default=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-D3H-ye-i.cjs"),C=require("./useNestedProp-BkL_BRGP.cjs"),V=require("./vue-ui-skeleton-BWO9iit6.cjs"),D=require("./PackageVersion-BPbxd_rU.cjs"),$=["onClick"],z={key:1},L=["xmlns","viewBox"],P=["id"],A=["stop-color"],F=["stop-color"],O=["height","width","fill","rx"],I=["height","width","fill","rx"],T=["height","width","fill","rx"],q={key:2,ref:"source",dir:"auto"},M={__name:"vue-ui-sparkbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:null}},emits:["selectDatapoint"],setup(p,{emit:b}){const n=p,{vue_ui_sparkbar:w}=o.useConfig(),v=e.computed(()=>!!n.dataset&&n.dataset.length),y=e.ref(o.createUid()),t=e.computed({get:()=>f(),set:l=>l});function f(){const l=C.useNestedProp({userConfig:n.config,defaultConfig:w});return l.theme?{...C.useNestedProp({userConfig:o.themes.vue_ui_sparkbar[l.theme]||n.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>n.config,l=>{t.value=f()},{deep:!0});const S=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),c=e.ref(n.dataset.map(l=>({...l,value:t.value.style.animation.show?0:l.value||0,formatter:l.formatter||null}))),g=e.ref(null);e.onMounted(async()=>{o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiSparkbar",type:"dataset"}),h()});function h(){if(t.value.style.animation.show){let x=function(){i+=a/l,i<a?(c.value=c.value.map((u,m)=>({...u,value:u.value+=r[m]})),g.value=requestAnimationFrame(x)):c.value=n.dataset.map(u=>({...u,value:u.value||0,formatter:u.formatter||null}))};const l=t.value.style.animation.animationFrames,r=n.dataset.map((u,m)=>u.value/l),a=n.dataset.map(u=>u.value||0).reduce((u,m)=>u+m,0);let i=0;x()}}e.watch(()=>n.dataset,async l=>{cancelAnimationFrame(g.value),c.value=n.dataset.map(r=>({...r,value:t.value.style.animation.show?0:r.value||0,formatter:r.formatter||null})),e.nextTick(h)},{deep:!0});const s=e.ref({width:500,height:16}),N=e.computed(()=>Math.max(...n.dataset.map(l=>l.value))),_=e.computed(()=>(n.dataset.forEach((l,r)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkbar",type:"datasetSerieAttribute",property:a,index:r})})}),c.value.map((l,r)=>({...l,value:l.value||0,color:o.convertColorToHex(l.color)||S.value[r]||o.palette[r]||o.palette[r%o.palette.length]}))));function B(l){return l/N.value}function k(l){return t.value.style.layout.independant?l.target?l.value/l.target:t.value.style.layout.percentage?l.value>100?1:l.value/100:t.value.style.layout.target===0?1:l.value/t.value.style.layout.target:B(l.value)}function d(l){return t.value.style.layout.independant&&l.target||t.value.style.layout.target}function E(l,r){b("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({width:"100%",fontFamily:t.value.style.fontFamily,background:n.backgroundOpacity!==null?e.unref(o.setOpacity)(t.value.style.backgroundColor,n.backgroundOpacity):t.value.style.backgroundColor})},[l.$slots.title?e.renderSlot(l.$slots,"title",e.normalizeProps(e.mergeProps({key:0},{title:{...l.title,title:t.value.style.title.text,subtitle:t.value.style.title.subtitle.text}}))):e.createCommentVNode("",!0),!l.$slots.title&&t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,class:"vue-ui-sparkbar-title-container",style:e.normalizeStyle({background:t.value.style.title.backgroundColor,margin:t.value.style.title.margin,textAlign:t.value.style.title.textAlign})},[e.createElementVNode("div",{class:"vue-ui-sparkbar-title",style:e.normalizeStyle({fontSize:t.value.style.title.fontSize+"px",color:t.value.style.title.color,fontWeight:t.value.style.title.bold?"bold":"normal"})},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-sparkbar-subtitle",style:e.normalizeStyle({fontSize:t.value.style.title.subtitle.fontSize+"px",color:t.value.style.title.subtitle.color,fontWeight:t.value.style.title.subtitle.bold?"bold":"normal"})},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`display:flex !important;${["left","right"].includes(t.value.style.labels.name.position)?`flex-direction: ${t.value.style.labels.name.position==="right"?"row-reverse":"row"} !important`:"flex-direction:column !important"};gap:${t.value.style.gap}px !important;align-items:center;${p.dataset.length>0&&i!==p.dataset.length-1?"margin-bottom:6px":""}`),onClick:()=>E(a,i)},[e.renderSlot(l.$slots,"data-label",e.normalizeProps(e.guardReactiveProps({bar:{...a,target:d(a),valueLabel:e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i}),targetLabel:e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i})}}))),l.$slots["data-label"]?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:t.value.style.labels.name.width,color:t.value.style.labels.name.color,fontSize:t.value.style.labels.fontSize+"px",fontWeight:t.value.style.labels.name.bold?"bold":"normal",textAlign:["left","right"].includes(t.value.style.labels.name.position)||["top","top-left"].includes(t.value.style.labels.name.position)?"left":t.value.style.labels.name.position==="top-center"?"center":"right"})},[e.createElementVNode("span",null,e.toDisplayString(a.name),1),t.value.style.labels.value.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.labels.value.bold?"bold":"normal"}`)},": "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i})),5)):e.createCommentVNode("",!0),t.value.style.layout.showTargetValue?(e.openBlock(),e.createElementBlock("span",z,e.toDisplayString(" "+t.value.style.layout.targetValueText)+" "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:i})),1)):e.createCommentVNode("",!0)],4)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${s.value.width} ${s.value.height}`,width:"100%"},[e.createVNode(D._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkbar_gradient_${i}_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(a.color,.03),100-t.value.style.bar.gradient.intensity)},null,8,A),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,F)],8,P)]),e.createElementVNode("rect",{height:s.value.height,width:s.value.width,x:0,y:0,fill:e.unref(o.setOpacity)(t.value.style.gutter.backgroundColor,t.value.style.gutter.opacity),rx:s.value.height/2},null,8,O),e.createElementVNode("rect",{height:s.value.height,width:s.value.width*k(a),x:0,y:0,fill:t.value.style.bar.gradient.underlayerColor,rx:s.value.height/2},null,8,I),e.createElementVNode("rect",{height:s.value.height,width:s.value.width*k(a),x:0,y:0,fill:t.value.style.bar.gradient.show?`url(#sparkbar_gradient_${i}_${y.value})`:a.color,rx:s.value.height/2},null,8,T)],8,L))],12,$)):e.createCommentVNode("",!0)],64))),256)),l.$slots.source?(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(l.$slots,"source")],512)):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:3,config:{type:"sparkbar",style:{backgroundColor:t.value.style.backgroundColor,sparkbar:{color:"#CCCCCC"}}}},null,8,["config"]))],4))}};exports.default=M;
@@ -1,8 +1,8 @@
1
1
  import { computed as s, onMounted as N, ref as A, watch as M, openBlock as n, createElementBlock as i, normalizeStyle as m, toDisplayString as y, createCommentVNode as v, unref as c, createVNode as D, createElementVNode as d, normalizeClass as E, createBlock as G, renderSlot as I } from "vue";
2
- import { u as U, o as q, e as S, g as P, c as R, t as T, N as X, X as H, i as V, v as p, f as Y } from "./index-CRiXU5u4.js";
3
- import { u as z } from "./useNestedProp-CJpdmtwu.js";
4
- import J from "./vue-ui-skeleton-CjpLaxv-.js";
5
- import { _ as K } from "./PackageVersion-CTpPwNFg.js";
2
+ import { u as U, o as q, e as S, g as P, c as R, t as T, N as X, X as H, i as V, v as p, f as Y } from "./index-9EusFpSb.js";
3
+ import { u as z } from "./useNestedProp-DLOArwu0.js";
4
+ import J from "./vue-ui-skeleton-DptJx8-6.js";
5
+ import { _ as K } from "./PackageVersion-DjRRmHKg.js";
6
6
  const Q = ["xmlns", "viewBox"], W = ["id"], Z = ["stop-color"], ee = ["stop-color"], te = ["d", "stroke", "stroke-linecap"], ae = ["d", "stroke", "stroke-linecap", "stroke-dashoffset"], le = ["x", "y", "font-size", "fill", "font-weight"], oe = {
7
7
  key: 4,
8
8
  ref: "source",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-CxfVE-zl.cjs"),b=require("./useNestedProp-DxRaQ3VM.cjs"),$=require("./vue-ui-skeleton-xn62L2MO.cjs"),w=require("./PackageVersion-DPna32U7.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-D3H-ye-i.cjs"),b=require("./useNestedProp-BkL_BRGP.cjs"),$=require("./vue-ui-skeleton-BWO9iit6.cjs"),w=require("./PackageVersion-BPbxd_rU.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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-CxfVE-zl.cjs"),_=require("./useNestedProp-DxRaQ3VM.cjs"),F=require("./Shape-CLIJMoFo.cjs"),M=require("./vue-ui-skeleton-xn62L2MO.cjs"),O=require("./PackageVersion-DPna32U7.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-D3H-ye-i.cjs"),_=require("./useNestedProp-BkL_BRGP.cjs"),F=require("./Shape-DFrKEycb.cjs"),M=require("./vue-ui-skeleton-BWO9iit6.cjs"),O=require("./PackageVersion-BPbxd_rU.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 { 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-CRiXU5u4.js";
3
- import { u as F } from "./useNestedProp-CJpdmtwu.js";
4
- import { _ as ie } from "./Shape-IDJlHO6G.js";
5
- import ne from "./vue-ui-skeleton-CjpLaxv-.js";
6
- import { _ as ve } from "./PackageVersion-CTpPwNFg.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-9EusFpSb.js";
3
+ import { u as F } from "./useNestedProp-DLOArwu0.js";
4
+ import { _ as ie } from "./Shape-Bc8lWk7D.js";
5
+ import ne from "./vue-ui-skeleton-DptJx8-6.js";
6
+ import { _ as ve } from "./PackageVersion-DjRRmHKg.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,
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-D3H-ye-i.cjs"),M=require("./useNestedProp-BkL_BRGP.cjs"),G=require("./vue-ui-skeleton-BWO9iit6.cjs"),z=require("./useResponsive-BJ7DTGpm.cjs"),R=require("./PackageVersion-BPbxd_rU.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=["id"],X=["xmlns","viewBox"],Z=["id"],Y=["stop-color"],J=["stop-color"],K=["id"],Q=["stop-color"],ee=["stop-color"],te=["id"],le=["stop-color"],ae=["stop-color"],oe={key:0},re=["d","fill"],ue=["d","fill"],ne=["d","stroke","stroke-width"],se=["x1","x2","y1","y2","stroke","stroke-width"],ie=["x","y","width","height","fill","rx"],de=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ce=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ve=["cx","cy","r","fill","stroke","stroke-width"],he=["x","y","font-size","font-weight","fill"],ye=["x","y","height","width","onMouseenter","onClick"],pe={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:x}){const i=f,{vue_ui_sparkline:P}=u.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(u.createUid()),w=e.ref(null),L=e.ref(null),C=e.ref(null),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=M.useNestedProp({userConfig:i.config,defaultConfig:P});return l.theme?{...M.useNestedProp({userConfig:u.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}const b=e.computed(()=>u.largestTriangleThreeBucketsArrayObjects({data:i.dataset,threshold:t.value.downsample.threshold}));e.watch(()=>i.config,l=>{t.value=V(),$(),o.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>i.dataset,l=>{p.value=u.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(r=>({...r,value:[void 0].includes(r.value)?null:r.value})),threshold:t.value.downsample.threshold})},{deep:!0});const p=e.ref(A());function A(){return u.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}),threshold:t.value.downsample.threshold})}const E=e.ref(null);e.onMounted(()=>{if($(),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<b.value.length?(p.value.push(b.value[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=b.value,r+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});function $(){if(u.objectIsEmpty(i.dataset)?u.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{u.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=z.throttle(()=>{const{width:r,height:a}=z.useResponsive({chart:w.value,title:t.value.style.title.show&&i.showInfo?L.value:null,source:C.value});o.value.width=r,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*r,o.value.padding=.06*r});E.value=new ResizeObserver(l),E.value.observe(w.value.parentNode)}}const o=e.ref({height:80,width:500,chartWidth:t.value.style.chartWidth,padding:30}),T=e.ref(6),n=e.computed(()=>({top:12,left:0,right:o.value.width,bottom:o.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?o.value.width-o.value.chartWidth:o.value.padding,width:i.showInfo&&t.value.style.dataLabel.show?o.value.chartWidth:o.value.width-o.value.padding,height:o.value.height-12})),N=e.computed(()=>Math.min(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),D=e.computed(()=>Math.max(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),m=e.computed(()=>{const l=N.value>=0?0:N.value;return Math.abs(l)}),O=e.computed(()=>D.value+m.value+T.value),_=e.computed(()=>n.value.bottom-n.value.height*B(m.value));function B(l){return l/O.value}const h=e.computed(()=>b.value.length-1),s=e.computed(()=>p.value.map((l,r)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+m.value,toMax:B(a+m.value),x:n.value.start+r*(n.value.width/(h.value+1)>o.padding?o.padding:n.value.width/(h.value+1)),y:n.value.bottom-n.value.height*B(a+m.value),id:`plot_${v.value}_${r}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?u.shiftHue(t.value.style.line.color,.05*(1-r/h.value)):t.value.style.line.color,width:n.value.width/(h.value+1)>o.padding?o.padding:n.value.width/(h.value+1)}})),W=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},r={x:s.value[s.value.length-1].x,y:o.value.height-6},a=[];return s.value.forEach(d=>{a.push(`${d.x},${d.y} `)}),[l.x,l.y,...a,r.x,r.y].toString()}),c=e.ref(void 0);function F(l,r){c.value=l,x("hoverIndex",{index:r})}function j(){c.value=void 0,x("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(g.value){const l=s.value.map(a=>a.absoluteValue),r=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:r,average:r/s.value.length,median:u.calcMedian(l),trend:u.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:S})=>({x:a,y:d,value:S}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),I=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?y.value.latest:t.value.style.dataLabel.valueType==="sum"?y.value.sum:t.value.style.dataLabel.valueType==="average"?y.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function q(l,r){x("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:w,class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily}`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:y.value.latest,sum:y.value.sum,average:y.value.average,median:y.value.median,trend:y.value.trend})),void 0,!0),t.value.style.title.show&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:L,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createVNode(R._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.setOpacity)(e.unref(u.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,J)],8,Z),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,Q),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,ee)],8,K),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,le),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,ae)],8,te)]),t.value.style.area.show&&!k.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",oe,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${n.value.bottom} ${e.unref(u.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${n.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,re)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${W.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ue))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(u.createSmoothPath)(s.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,ne)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[d<s.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:s.value[d+1].x,y1:a.y,y2:s.value[d+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,se)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:_.value,width:a.width,height:Math.abs(a.y-_.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${v.value})`:`url(#sparkline_bar_gradient_neg_${v.value})`,rx:t.value.style.bar.borderRadius},null,8,ie)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||f.selectedIndex===d)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:n.value.top-6,y2:n.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,de)):e.createCommentVNode("",!0)]))),256)),N.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.value.start,x2:n.value.start+n.value.width-16,y1:_.value,y2:_.value,stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,ce)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||f.selectedIndex===d?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:a.x,cy:a.y,r:t.value.style.plot.radius,fill:a.color,stroke:t.value.style.plot.stroke,"stroke-width":t.value.style.plot.strokeWidth},null,8,ve)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:n.value.width+12+t.value.style.dataLabel.offsetX,y:o.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(c.value?e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:c.value}):e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,I.value,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:I.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,he)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(n.value.width/(h.value+1)>o.value.padding?o.value.padding:n.value.width/(h.value+1))/2,y:n.value.top-6,height:n.value.height+6,width:n.value.width/(h.value+1)>o.value.padding?o.value.padding:n.value.width/(h.value+1),fill:"transparent",onMouseenter:S=>F(a,d),onMouseleave:j,onClick:()=>q(a,d)},null,40,ye))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,X)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"source",ref:C,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(G.default,{key:3,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,U))}},fe=H._export_sfc(pe,[["__scopeId","data-v-9467697c"]]);exports.default=fe;