vue-data-ui 2.3.74 → 2.3.76

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 (193) hide show
  1. package/dist/{Arrow-DK6F5Fq3.cjs → Arrow-D7M4-bW7.cjs} +1 -1
  2. package/dist/{Arrow-CYCrAySW.js → Arrow-DY9RKUmG.js} +1 -1
  3. package/dist/{BaseIcon-DBHVtm3A.cjs → BaseIcon-DB7Apwv_.cjs} +1 -1
  4. package/dist/{BaseIcon-kBIAYqUO.js → BaseIcon-rwm-10Hu.js} +1 -1
  5. package/dist/{DataTable-BNFSPjhv.cjs → DataTable-CsNozyz7.cjs} +1 -1
  6. package/dist/{DataTable-CKdV-L0e.js → DataTable-e2fnfjXV.js} +2 -2
  7. package/dist/{Legend-Cj7T-DqJ.js → Legend-5cQ0xZjK.js} +1 -1
  8. package/dist/{Legend-Do2kcWFT.cjs → Legend-DgFd-O0m.cjs} +1 -1
  9. package/dist/{Shape-Bo8ZjViG.js → Shape-CiTElr_0.js} +1 -1
  10. package/dist/{Shape-DRDUAe_o.cjs → Shape-yPECDLiP.cjs} +1 -1
  11. package/dist/{Slicer-D8jHSP7U.cjs → Slicer-DaZgCKV7.cjs} +1 -1
  12. package/dist/{Slicer-4nGKvUYF.js → Slicer-DwBBu3kB.js} +2 -2
  13. package/dist/{Title-D5cATWsL.cjs → Title-3EduyW4p.cjs} +1 -1
  14. package/dist/{Title-DZjnxQdN.js → Title-gUz6GDA3.js} +1 -1
  15. package/dist/{Tooltip-B8yLaegk.cjs → Tooltip-DScSrYXJ.cjs} +1 -1
  16. package/dist/{Tooltip--kgFEVZs.js → Tooltip-DfSM1mNP.js} +1 -1
  17. package/dist/{index-D_32ZGWd.cjs → index-BTgtr0F8.cjs} +1 -1
  18. package/dist/{index-C8SH0f2u.js → index-CaV1s-yZ.js} +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/{useNestedProp-BvvH633N.cjs → useNestedProp-CisbRRo_.cjs} +1 -1
  21. package/dist/{useNestedProp-lS_T5lM3.js → useNestedProp-tWCzZrLx.js} +1 -1
  22. package/dist/{usePrinter-BouFNHWR.cjs → usePrinter-DzTaA1eh.cjs} +1 -1
  23. package/dist/{usePrinter-Dj50NAxo.js → usePrinter-rvJyT65A.js} +1 -1
  24. package/dist/{vue-data-ui-v_BbbLtJ.cjs → vue-data-ui-BGkWRPUY.cjs} +1 -1
  25. package/dist/{vue-data-ui-DoXqU7xC.js → vue-data-ui-BO89gTtq.js} +57 -57
  26. package/dist/vue-data-ui.cjs +1 -1
  27. package/dist/vue-data-ui.js +1 -1
  28. package/dist/{vue-ui-3d-bar-CnoPOJHm.js → vue-ui-3d-bar-CcTMIHiB.js} +499 -486
  29. package/dist/vue-ui-3d-bar-DzmcGuqh.cjs +19 -0
  30. package/dist/{vue-ui-accordion-Cka6b_Up.cjs → vue-ui-accordion-7e4Myhcg.cjs} +1 -1
  31. package/dist/{vue-ui-accordion-YHleIgkV.js → vue-ui-accordion-CpzGQ63y.js} +3 -3
  32. package/dist/vue-ui-age-pyramid-C7qr9EwB.cjs +1 -0
  33. package/dist/{vue-ui-age-pyramid-CENg8fDg.js → vue-ui-age-pyramid-D71ZLkVV.js} +182 -169
  34. package/dist/{vue-ui-annotator-VJOLUkqJ.js → vue-ui-annotator-B8Iu6cYt.js} +1 -1
  35. package/dist/{vue-ui-annotator-ByYg6QMs.cjs → vue-ui-annotator-BKQrweqm.cjs} +1 -1
  36. package/dist/{vue-ui-candlestick-CHsGD3bx.js → vue-ui-candlestick-Bx4QVkY0.js} +295 -279
  37. package/dist/vue-ui-candlestick-DAc1FQ-i.cjs +2 -0
  38. package/dist/vue-ui-carousel-table-uFRqkghO.cjs +1 -0
  39. package/dist/{vue-ui-carousel-table-RAtX3VBu.js → vue-ui-carousel-table-xuQG6bcH.js} +146 -129
  40. package/dist/{vue-ui-chestnut-B5GQX0J_.js → vue-ui-chestnut-Bo6rDcU7.js} +215 -204
  41. package/dist/vue-ui-chestnut-DJkm72oD.cjs +6 -0
  42. package/dist/{vue-ui-cursor-DnZqLj21.cjs → vue-ui-cursor-BQbeuW-k.cjs} +1 -1
  43. package/dist/{vue-ui-cursor-CMm7XSSG.js → vue-ui-cursor-C0KOqEOq.js} +2 -2
  44. package/dist/{vue-ui-dashboard-DgEQJnLr.cjs → vue-ui-dashboard-0Hsjx-bO.cjs} +1 -1
  45. package/dist/{vue-ui-dashboard-Ck_5L3eu.js → vue-ui-dashboard-BT71xS7P.js} +2 -2
  46. package/dist/{vue-ui-digits--ULH35um.js → vue-ui-digits-BRqpKYvD.js} +2 -2
  47. package/dist/{vue-ui-digits-UvwUdi6U.cjs → vue-ui-digits-C2ReH6w0.cjs} +1 -1
  48. package/dist/{vue-ui-donut-QQ1fWWvc.js → vue-ui-donut-NQW-3prf.js} +376 -362
  49. package/dist/vue-ui-donut-evolution-DOe-cwLi.cjs +1 -0
  50. package/dist/{vue-ui-donut-evolution-Cx8kBB_7.js → vue-ui-donut-evolution-jbXQQGTc.js} +270 -255
  51. package/dist/vue-ui-donut-v81suIOX.cjs +1 -0
  52. package/dist/vue-ui-dumbbell-DXQSg6wa.cjs +9 -0
  53. package/dist/{vue-ui-dumbbell-BYvwHpU8.js → vue-ui-dumbbell-Dyz8xdtC.js} +232 -213
  54. package/dist/vue-ui-flow-BL3JWW1m.js +481 -0
  55. package/dist/vue-ui-flow-UqSNwH9d.cjs +1 -0
  56. package/dist/vue-ui-galaxy-DTQWGvRH.cjs +1 -0
  57. package/dist/{vue-ui-galaxy-B0L57aec.js → vue-ui-galaxy-Dx9nsOuM.js} +175 -162
  58. package/dist/vue-ui-gauge-BUB7H0qA.cjs +1 -0
  59. package/dist/vue-ui-gauge-CLaKGi0-.js +500 -0
  60. package/dist/vue-ui-gizmo-Kitfqu0J.cjs +1 -0
  61. package/dist/{vue-ui-gizmo-D2RfM55X.js → vue-ui-gizmo-of-4s5HG.js} +66 -53
  62. package/dist/{vue-ui-heatmap-DKM0DH41.js → vue-ui-heatmap-BIzjOMXO.js} +157 -143
  63. package/dist/vue-ui-heatmap-DUw2350O.cjs +1 -0
  64. package/dist/vue-ui-kpi-By3YPwgo.js +98 -0
  65. package/dist/vue-ui-kpi-DyL2Hcz-.cjs +1 -0
  66. package/dist/{vue-ui-mini-loader-CLP19Txv.cjs → vue-ui-mini-loader-C048-8Kd.cjs} +1 -1
  67. package/dist/{vue-ui-mini-loader-MywnWlYI.js → vue-ui-mini-loader-DnK3V2z2.js} +2 -2
  68. package/dist/{vue-ui-molecule-CLI9iTRE.js → vue-ui-molecule-BfhbIqa5.js} +177 -167
  69. package/dist/vue-ui-molecule-D-ahly6R.cjs +1 -0
  70. package/dist/vue-ui-mood-radar-DD8R9BpJ.cjs +1 -0
  71. package/dist/{vue-ui-mood-radar-O30wZo9a.js → vue-ui-mood-radar-DXxEKr3x.js} +172 -161
  72. package/dist/{vue-ui-nested-donuts-D8o4TqTt.js → vue-ui-nested-donuts-BdUdHFd-.js} +377 -364
  73. package/dist/vue-ui-nested-donuts-C7qM_FRw.cjs +17 -0
  74. package/dist/{vue-ui-onion-Hmcke6xB.js → vue-ui-onion-D0vF5jBt.js} +191 -177
  75. package/dist/vue-ui-onion-DX3gofXZ.cjs +5 -0
  76. package/dist/{vue-ui-parallel-coordinate-plot-CyChE3NP.js → vue-ui-parallel-coordinate-plot-CTZY-pY8.js} +298 -284
  77. package/dist/vue-ui-parallel-coordinate-plot-DEx5kFYd.cjs +8 -0
  78. package/dist/{vue-ui-quadrant-DimTQdAj.js → vue-ui-quadrant-ByY8GP3y.js} +347 -334
  79. package/dist/vue-ui-quadrant-CgApzie6.cjs +1 -0
  80. package/dist/{vue-ui-quick-chart-DxJvENid.js → vue-ui-quick-chart-DTxJ__7j.js} +483 -469
  81. package/dist/vue-ui-quick-chart-DWZEgUJF.cjs +15 -0
  82. package/dist/{vue-ui-radar-D_FieunT.js → vue-ui-radar-5UBmAU6W.js} +202 -189
  83. package/dist/vue-ui-radar-DEED0rTz.cjs +1 -0
  84. package/dist/{vue-ui-rating-BHW2Onru.cjs → vue-ui-rating-Ce_Ewqtl.cjs} +1 -1
  85. package/dist/{vue-ui-rating-DF1BpH4E.js → vue-ui-rating-Dr6jquxh.js} +2 -2
  86. package/dist/vue-ui-relation-circle-BU8i2miI.js +322 -0
  87. package/dist/vue-ui-relation-circle-CRcQ6Zcy.cjs +1 -0
  88. package/dist/{vue-ui-rings-BqS-iece.js → vue-ui-rings-Ctl3Jywh.js} +203 -189
  89. package/dist/vue-ui-rings-OQ8a1Ruw.cjs +2 -0
  90. package/dist/vue-ui-scatter-B8StSjt8.cjs +1 -0
  91. package/dist/{vue-ui-scatter-Dns49Nht.js → vue-ui-scatter-BwJ_koWT.js} +284 -270
  92. package/dist/{vue-ui-screenshot-5Gsnd0Wr.js → vue-ui-screenshot-BS3L5vhN.js} +1 -1
  93. package/dist/{vue-ui-screenshot---q062Kd.cjs → vue-ui-screenshot-bAVk3EPl.cjs} +1 -1
  94. package/dist/{vue-ui-skeleton-fVPw-oIR.cjs → vue-ui-skeleton-CMQzFTs9.cjs} +1 -1
  95. package/dist/{vue-ui-skeleton-B4eWLjH3.js → vue-ui-skeleton-CvFX_ExX.js} +2 -2
  96. package/dist/{vue-ui-smiley-B8Tyunn3.js → vue-ui-smiley-CGYZpNt9.js} +2 -2
  97. package/dist/{vue-ui-smiley-YfHmv0rQ.cjs → vue-ui-smiley-sF8QIso1.cjs} +1 -1
  98. package/dist/vue-ui-spark-trend-B4XSSKl9.js +263 -0
  99. package/dist/vue-ui-spark-trend-CdIoxaqb.cjs +1 -0
  100. package/dist/{vue-ui-sparkbar-9DBvdYn7.js → vue-ui-sparkbar-BbsJGDMZ.js} +95 -87
  101. package/dist/vue-ui-sparkbar-C3i1K7hi.cjs +1 -0
  102. package/dist/vue-ui-sparkgauge-BKyQoI7C.cjs +1 -0
  103. package/dist/vue-ui-sparkgauge-D4w_i_QJ.js +178 -0
  104. package/dist/{vue-ui-sparkhistogram-BBUVmco4.js → vue-ui-sparkhistogram-CYybrW-6.js} +79 -68
  105. package/dist/vue-ui-sparkhistogram-CvTYEmbz.cjs +1 -0
  106. package/dist/vue-ui-sparkline-CDowaDRS.cjs +1 -0
  107. package/dist/{vue-ui-sparkline-CeqNV6Re.js → vue-ui-sparkline-DjN1SVdO.js} +142 -123
  108. package/dist/{vue-ui-sparkstackbar-C3GMC1eW.js → vue-ui-sparkstackbar-BLMhJxaN.js} +120 -104
  109. package/dist/vue-ui-sparkstackbar-BZ2bESBi.cjs +1 -0
  110. package/dist/{vue-ui-stackbar-DyGPrFxi.js → vue-ui-stackbar-BTKOHUYc.js} +235 -222
  111. package/dist/vue-ui-stackbar-DRHaJFR8.cjs +6 -0
  112. package/dist/vue-ui-strip-plot-DxQxFbWg.cjs +1 -0
  113. package/dist/{vue-ui-strip-plot-y1AnVJmq.js → vue-ui-strip-plot-o6GTsGAT.js} +246 -232
  114. package/dist/{vue-ui-table-xWvAQS-s.cjs → vue-ui-table-BFIj1Rgh.cjs} +1 -1
  115. package/dist/{vue-ui-table-B4kfykAO.js → vue-ui-table-CnquiTpr.js} +1 -1
  116. package/dist/vue-ui-table-heatmap-CCGK12Fa.cjs +1 -0
  117. package/dist/{vue-ui-table-heatmap-YZRSzwRM.js → vue-ui-table-heatmap-CZRIwv-Q.js} +106 -95
  118. package/dist/{vue-ui-table-sparkline-C0v2r4Kf.js → vue-ui-table-sparkline-B3zEeq6Z.js} +151 -138
  119. package/dist/vue-ui-table-sparkline-DYmgfHz4.cjs +1 -0
  120. package/dist/{vue-ui-thermometer-D5qurIy7.js → vue-ui-thermometer-BopiohUh.js} +116 -104
  121. package/dist/vue-ui-thermometer-CzPRBt6c.cjs +1 -0
  122. package/dist/vue-ui-timer-Bonw69Lt.cjs +64 -0
  123. package/dist/{vue-ui-timer-VWjovnKL.js → vue-ui-timer-C7WkW8hK.js} +191 -176
  124. package/dist/{vue-ui-tiremarks-jH6cdQOJ.js → vue-ui-tiremarks-BurRtFv4.js} +115 -103
  125. package/dist/vue-ui-tiremarks-DkIGfq8t.cjs +1 -0
  126. package/dist/vue-ui-treemap-CalhJmnp.cjs +1 -0
  127. package/dist/{vue-ui-treemap-BCc5sQLB.js → vue-ui-treemap-DWy4voIr.js} +251 -237
  128. package/dist/{vue-ui-vertical-bar-2In_g5iC.js → vue-ui-vertical-bar-CJW1YhtY.js} +314 -299
  129. package/dist/vue-ui-vertical-bar-rwWp-sai.cjs +4 -0
  130. package/dist/{vue-ui-waffle-OzU830VX.js → vue-ui-waffle-DB7X6nTS.js} +285 -265
  131. package/dist/vue-ui-waffle-faQMBYNx.cjs +1 -0
  132. package/dist/vue-ui-wheel-BzjbGP6a.cjs +1 -0
  133. package/dist/vue-ui-wheel-CryKap2E.js +255 -0
  134. package/dist/vue-ui-word-cloud-COqUkvei.js +512 -0
  135. package/dist/vue-ui-word-cloud-DJN9I4q4.cjs +1 -0
  136. package/dist/vue-ui-xy-BmA0tspd.cjs +3 -0
  137. package/dist/{vue-ui-xy-DuJtYXKl.js → vue-ui-xy-b1Z_HPsx.js} +300 -274
  138. package/dist/{vue-ui-xy-canvas-CKibMJHh.js → vue-ui-xy-canvas-BgbLnY5B.js} +345 -327
  139. package/dist/vue-ui-xy-canvas-DOM2Kq_s.cjs +9 -0
  140. package/package.json +1 -1
  141. package/dist/vue-ui-3d-bar-CwCEoPX-.cjs +0 -19
  142. package/dist/vue-ui-age-pyramid-GqCNpd_h.cjs +0 -1
  143. package/dist/vue-ui-candlestick-TdNVq_FX.cjs +0 -2
  144. package/dist/vue-ui-carousel-table-yXUSFk2u.cjs +0 -1
  145. package/dist/vue-ui-chestnut-EJj-dQSY.cjs +0 -6
  146. package/dist/vue-ui-donut-BqUBysA_.cjs +0 -1
  147. package/dist/vue-ui-donut-evolution-BXtEnop4.cjs +0 -1
  148. package/dist/vue-ui-dumbbell-CjIh7KTm.cjs +0 -9
  149. package/dist/vue-ui-flow-hp0Hpuhn.js +0 -469
  150. package/dist/vue-ui-flow-u29zqSQj.cjs +0 -1
  151. package/dist/vue-ui-galaxy-DE1HbBi-.cjs +0 -1
  152. package/dist/vue-ui-gauge-B_IZrsfj.cjs +0 -1
  153. package/dist/vue-ui-gauge-CPyyn7cL.js +0 -488
  154. package/dist/vue-ui-gizmo-DR4gacOL.cjs +0 -1
  155. package/dist/vue-ui-heatmap-DMB_eUpA.cjs +0 -1
  156. package/dist/vue-ui-kpi-BAxAY13T.js +0 -84
  157. package/dist/vue-ui-kpi-BD21xshi.cjs +0 -1
  158. package/dist/vue-ui-molecule-BNsWckH-.cjs +0 -1
  159. package/dist/vue-ui-mood-radar-BsWE1f8R.cjs +0 -1
  160. package/dist/vue-ui-nested-donuts-CYyUtXs2.cjs +0 -17
  161. package/dist/vue-ui-onion-D7TXJu5w.cjs +0 -5
  162. package/dist/vue-ui-parallel-coordinate-plot-BqZB7xKn.cjs +0 -8
  163. package/dist/vue-ui-quadrant-BPDTvxlT.cjs +0 -1
  164. package/dist/vue-ui-quick-chart-C_-ut0if.cjs +0 -15
  165. package/dist/vue-ui-radar-C5Kq19hg.cjs +0 -1
  166. package/dist/vue-ui-relation-circle-4kIYttRI.js +0 -310
  167. package/dist/vue-ui-relation-circle-DHMHHsqY.cjs +0 -1
  168. package/dist/vue-ui-rings-BqPS8NKl.cjs +0 -2
  169. package/dist/vue-ui-scatter-BLVcdf3d.cjs +0 -1
  170. package/dist/vue-ui-spark-trend-Dpv6am0Z.cjs +0 -1
  171. package/dist/vue-ui-spark-trend-Em9OqYyG.js +0 -251
  172. package/dist/vue-ui-sparkbar-BuSuwQYl.cjs +0 -1
  173. package/dist/vue-ui-sparkgauge-BN5feBzp.js +0 -167
  174. package/dist/vue-ui-sparkgauge-DKtUZMv1.cjs +0 -1
  175. package/dist/vue-ui-sparkhistogram-BmuusW02.cjs +0 -1
  176. package/dist/vue-ui-sparkline-Blzv-tIQ.cjs +0 -1
  177. package/dist/vue-ui-sparkstackbar-D__WDEMv.cjs +0 -1
  178. package/dist/vue-ui-stackbar-DFqJ5K_q.cjs +0 -6
  179. package/dist/vue-ui-strip-plot-z9fjJ6Dj.cjs +0 -1
  180. package/dist/vue-ui-table-heatmap-CGKecjtm.cjs +0 -1
  181. package/dist/vue-ui-table-sparkline-CHFZG3Tg.cjs +0 -1
  182. package/dist/vue-ui-thermometer-DoOxxVW1.cjs +0 -1
  183. package/dist/vue-ui-timer-D63zHe-I.cjs +0 -64
  184. package/dist/vue-ui-tiremarks-Cp8YEmXh.cjs +0 -1
  185. package/dist/vue-ui-treemap-DJrdEFW5.cjs +0 -1
  186. package/dist/vue-ui-vertical-bar-BfJJqN_z.cjs +0 -4
  187. package/dist/vue-ui-waffle-A2gmRbq0.cjs +0 -1
  188. package/dist/vue-ui-wheel-C9QXzWu1.js +0 -242
  189. package/dist/vue-ui-wheel-DGSh9VKq.cjs +0 -1
  190. package/dist/vue-ui-word-cloud-C2ZaVlfO.js +0 -498
  191. package/dist/vue-ui-word-cloud-DPFB1MYk.cjs +0 -1
  192. package/dist/vue-ui-xy-C-2-aijE.cjs +0 -3
  193. package/dist/vue-ui-xy-canvas-D7wf3xab.cjs +0 -9
@@ -1,251 +0,0 @@
1
- import { computed as u, ref as g, onMounted as X, openBlock as n, createElementBlock as i, normalizeStyle as A, createBlock as C, unref as c, createElementVNode as m, createCommentVNode as d, toDisplayString as I } from "vue";
2
- import { u as Z, c as R, t as H, o as J, e as K, s as y, T as Q, X as Y, w as N, P as B, f as V, i as ee } from "./index-C8SH0f2u.js";
3
- import { u as D } from "./useNestedProp-lS_T5lM3.js";
4
- import M from "./BaseIcon-kBIAYqUO.js";
5
- import te from "./vue-ui-skeleton-B4eWLjH3.js";
6
- import { _ as ae } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
- const le = ["id"], oe = ["xmlns", "viewBox"], ne = ["id"], se = ["stop-color"], ue = ["stop-color"], re = { key: 0 }, ie = ["d", "fill"], ve = ["d", "fill"], de = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"], ce = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"], ye = ["height", "width", "x"], he = { style: { width: "100%" } }, fe = ["x", "y", "fill", "font-size", "font-weight"], pe = ["stroke", "cx", "cy", "fill"], ge = ["x", "y", "font-size", "fill", "font-weight"], me = {
8
- __name: "vue-ui-spark-trend",
9
- props: {
10
- config: {
11
- type: Object,
12
- default() {
13
- return {};
14
- }
15
- },
16
- dataset: {
17
- type: Array,
18
- default() {
19
- return [];
20
- }
21
- }
22
- },
23
- setup(E) {
24
- const s = E, { vue_ui_spark_trend: G } = Z(), O = u(() => !!s.dataset && s.dataset.length), k = g(R()), e = u(() => {
25
- const t = D({
26
- userConfig: s.config,
27
- defaultConfig: G
28
- });
29
- return t.theme ? {
30
- ...D({
31
- userConfig: H.vue_ui_spark_trend[t.theme] || s.config,
32
- defaultConfig: t
33
- })
34
- } : t;
35
- });
36
- function L(t) {
37
- return t.map((l) => y(l));
38
- }
39
- const _ = g(s.dataset.map((t) => e.value.style.animation.show || [void 0].includes(t) ? null : t)), p = g(!1), $ = g(null);
40
- X(() => {
41
- J(s.dataset) && K({
42
- componentName: "VueUiSparkTrend",
43
- type: "dataset"
44
- });
45
- let l = 1e3 / e.value.style.animation.animationFrames, v = performance.now();
46
- if (e.value.style.animation.show && e.value.style.animation.animationFrames && s.dataset.length > 1) {
47
- let z = function() {
48
- p.value = !0;
49
- let F = performance.now(), j = F - v;
50
- j > l ? (v = F - j % l, f < s.dataset.length ? (_.value.push(s.dataset[f]), f += 1, $.value = requestAnimationFrame(z)) : (cancelAnimationFrame($.value), _.value = L(s.dataset), p.value = !1)) : $.value = requestAnimationFrame(z);
51
- };
52
- _.value = [];
53
- let f = 0;
54
- z();
55
- }
56
- });
57
- const o = g({
58
- height: 80,
59
- width: 300
60
- }), h = u(() => ({
61
- top: e.value.style.padding.top,
62
- left: e.value.style.padding.left,
63
- right: o.value.width - e.value.style.padding.right,
64
- bottom: o.value.height - e.value.style.padding.bottom,
65
- height: o.value.height - (e.value.style.padding.top + e.value.style.padding.bottom) - (e.value.style.dataLabel.show ? e.value.style.dataLabel.fontSize : 0),
66
- width: o.value.width - (e.value.style.padding.left + e.value.style.padding.right)
67
- })), T = u(() => {
68
- const t = L(s.dataset);
69
- return {
70
- max: Math.max(...t.map((l) => y(l))),
71
- min: Math.min(...t.map((l) => y(l)))
72
- };
73
- }), b = u(() => {
74
- const t = T.value.min >= 0 ? 0 : T.value.min;
75
- return Math.abs(t);
76
- }), U = u(() => T.value.max + b.value);
77
- function S(t) {
78
- return t / U.value;
79
- }
80
- const P = u(() => s.dataset.length), a = u(() => _.value.map((t, l) => {
81
- const v = isNaN(t) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t) ? 0 : t || 0;
82
- return {
83
- value: y(t),
84
- absoluteValue: y(v),
85
- plotValue: y(v + b.value),
86
- toMax: S(v + b.value),
87
- x: h.value.left + y(l * (h.value.width / (P.value - 1))) - e.value.style.padding.right,
88
- y: h.value.bottom - y(h.value.height * S(v + b.value))
89
- };
90
- })), x = u(() => {
91
- const t = L(s.dataset);
92
- return e.value.style.trendLabel.trendType === "global" ? Q(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;
93
- }), w = u(() => p.value || x.value === 0 ? "neutral" : x.value > 0 ? "positive" : "negative"), r = u(() => e.value.style.arrow.colors[w.value]), q = u(() => {
94
- const t = { x: a.value[0].x, y: o.value.height - 6 }, l = { x: a.value[a.value.length - 1].x, y: o.value.height - 6 }, v = [];
95
- return a.value.forEach((f) => {
96
- v.push(`${f.x},${f.y} `);
97
- }), [t.x, t.y, ...v, l.x, l.y].toString();
98
- }), W = u(() => {
99
- let t = [];
100
- return a.value.forEach((l) => {
101
- t.push(`${l.x},${l.y} `);
102
- }), `M ${t.toString()}`;
103
- });
104
- return (t, l) => (n(), i("div", {
105
- class: "vue-ui-spark-trend",
106
- id: k.value,
107
- style: A(`width:100%;font-family:${e.value.style.fontFamily};backgroundColor:${e.value.style.backgroundColor}`)
108
- }, [
109
- O.value ? (n(), i("svg", {
110
- key: 1,
111
- xmlns: c(Y),
112
- viewBox: `0 0 ${o.value.width} ${o.value.height}`,
113
- style: A(`width:100%;background:${e.value.style.backgroundColor};overflow:visible`)
114
- }, [
115
- m("defs", null, [
116
- m("linearGradient", {
117
- x1: "0%",
118
- y1: "0%",
119
- x2: "0%",
120
- y2: "100%",
121
- id: `pill_gradient_${k.value}`
122
- }, [
123
- m("stop", {
124
- offset: "0%",
125
- "stop-color": (e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke) + c(N)[e.value.style.area.opacity]
126
- }, null, 8, se),
127
- m("stop", {
128
- offset: "100%",
129
- "stop-color": e.value.style.backgroundColor
130
- }, null, 8, ue)
131
- ], 8, ne)
132
- ]),
133
- e.value.style.area.show && a.value[0] ? (n(), i("g", re, [
134
- e.value.style.line.smooth ? (n(), i("path", {
135
- key: 0,
136
- d: `M ${a.value[0].x},${h.value.bottom} ${c(B)(a.value)} L ${a.value.at(-1).x},${h.value.bottom} Z`,
137
- fill: e.value.style.area.useGradient ? `url(#pill_gradient_${k.value})` : `${e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke}${c(N)[e.value.style.area.opacity]}`,
138
- stroke: "none"
139
- }, null, 8, ie)) : (n(), i("path", {
140
- key: 1,
141
- d: `M${q.value}Z`,
142
- fill: e.value.style.area.useGradient ? `url(#pill_gradient_${k.value})` : `${e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke}${c(N)[e.value.style.area.opacity]}`,
143
- stroke: "none"
144
- }, null, 8, ve))
145
- ])) : d("", !0),
146
- e.value.style.line.smooth && a.value.length ? (n(), i("path", {
147
- key: 1,
148
- d: `M ${c(B)(a.value)}`,
149
- stroke: e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke,
150
- fill: "none",
151
- "stroke-width": e.value.style.line.strokeWidth,
152
- "stroke-linecap": e.value.style.line.strokeLinecap,
153
- "stroke-linejoin": e.value.style.line.strokeLinejoin
154
- }, null, 8, de)) : d("", !0),
155
- !e.value.style.line.smooth && a.value.length ? (n(), i("path", {
156
- key: 2,
157
- d: W.value,
158
- stroke: e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke,
159
- fill: "none",
160
- "stroke-width": e.value.style.line.strokeWidth,
161
- "stroke-linecap": e.value.style.line.strokeLinecap,
162
- "stroke-linejoin": e.value.style.line.strokeLinejoin
163
- }, null, 8, ce)) : d("", !0),
164
- p.value ? d("", !0) : (n(), i("foreignObject", {
165
- key: 3,
166
- height: o.value.height / 2,
167
- width: o.value.height / 2,
168
- x: o.value.height / 5,
169
- y: 8
170
- }, [
171
- m("div", he, [
172
- w.value === "positive" ? (n(), C(M, {
173
- key: 0,
174
- stroke: r.value,
175
- name: "arrowTop",
176
- size: o.value.height / 2
177
- }, null, 8, ["stroke", "size"])) : d("", !0),
178
- w.value === "negative" ? (n(), C(M, {
179
- key: 1,
180
- stroke: r.value,
181
- name: "arrowBottom",
182
- size: o.value.height / 2
183
- }, null, 8, ["stroke", "size"])) : d("", !0),
184
- w.value === "neutral" ? (n(), C(M, {
185
- key: 2,
186
- stroke: r.value,
187
- name: "arrowRight",
188
- size: o.value.height / 2
189
- }, null, 8, ["stroke", "size"])) : d("", !0)
190
- ])
191
- ], 8, ye)),
192
- p.value ? d("", !0) : (n(), i("text", {
193
- key: 4,
194
- x: o.value.height / 2 - o.value.height / 20,
195
- y: h.value.bottom,
196
- "text-anchor": "middle",
197
- fill: e.value.style.trendLabel.useColorTrend ? r.value : e.value.style.trendLabel.color,
198
- "font-size": e.value.style.trendLabel.fontSize,
199
- "font-weight": e.value.style.trendLabel.bold ? "bold" : "normal"
200
- }, I(c(V)({
201
- p: x.value > 0 ? "+" : "",
202
- v: x.value,
203
- s: "%",
204
- r: e.value.style.trendLabel.rounding
205
- })), 9, fe)),
206
- a.value.length && a.value.at(-1).x !== void 0 ? (n(), i("circle", {
207
- key: 5,
208
- stroke: e.value.style.backgroundColor,
209
- "stroke-width": 2,
210
- cx: a.value.at(-1).x,
211
- cy: a.value.at(-1).y,
212
- r: 4,
213
- fill: r.value
214
- }, null, 8, pe)) : d("", !0),
215
- a.value.length && a.value.at(-1).x !== void 0 && e.value.style.dataLabel.show ? (n(), i("text", {
216
- key: 6,
217
- "text-anchor": "middle",
218
- x: a.value.at(-1).x,
219
- y: a.value.at(-1).y - e.value.style.dataLabel.fontSize / 1.5,
220
- "font-size": e.value.style.dataLabel.fontSize,
221
- fill: e.value.style.dataLabel.useColorTrend ? r.value : e.value.style.dataLabel.color,
222
- "font-weight": e.value.style.dataLabel.bold ? "bold" : "normal"
223
- }, I(c(ee)(
224
- e.value.style.dataLabel.formatter,
225
- a.value.at(-1).value,
226
- c(V)({
227
- p: e.value.style.dataLabel.prefix,
228
- v: a.value.at(-1).value,
229
- s: e.value.style.dataLabel.suffix,
230
- r: e.value.style.dataLabel.rounding
231
- }),
232
- { datapoint: a.value.at(-1) }
233
- )), 9, ge)) : d("", !0)
234
- ], 12, oe)) : (n(), C(te, {
235
- key: 0,
236
- config: {
237
- type: "sparkline",
238
- style: {
239
- backgroundColor: e.value.style.backgroundColor,
240
- sparkline: {
241
- color: "#CCCCCC"
242
- }
243
- }
244
- }
245
- }, null, 8, ["config"]))
246
- ], 12, le));
247
- }
248
- }, Le = /* @__PURE__ */ ae(me, [["__scopeId", "data-v-fa45a70f"]]);
249
- export {
250
- Le as default
251
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-D_32ZGWd.cjs"),x=require("./useNestedProp-BvvH633N.cjs"),E=require("./vue-ui-skeleton-fVPw-oIR.cjs"),V=["onClick"],$={key:1},D=["xmlns","viewBox"],z=["id"],L=["stop-color"],P=["stop-color"],A=["height","width","fill","rx"],F=["height","width","fill","rx"],I=["height","width","fill","rx"],T={__name:"vue-ui-sparkbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:100}},emits:["selectDatapoint"],setup(p,{emit:b}){const n=p,{vue_ui_sparkbar:C}=o.useConfig(),v=e.computed(()=>!!n.dataset&&n.dataset.length),y=e.ref(o.createUid()),t=e.computed(()=>{const l=x.useNestedProp({userConfig:n.config,defaultConfig:C});return l.theme?{...x.useNestedProp({userConfig:o.themes.vue_ui_sparkbar[l.theme]||n.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),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}))),f=e.ref(null);e.onMounted(async()=>{o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiSparkbar",type:"dataset"}),g()});function g(){if(t.value.style.animation.show){let k=function(){s+=a/l,s<a?(c.value=c.value.map((u,m)=>({...u,value:u.value+=r[m]})),f.value=requestAnimationFrame(k)):c.value=n.dataset.map(u=>({...u,value:u.value||0,formatter:u.formatter||null}))};const l=t.value.style.animation.animationFrames,r=n.dataset.map((u,m)=>u.value/l),a=n.dataset.map(u=>u.value||0).reduce((u,m)=>u+m,0);let s=0;k()}}e.watch(()=>n.dataset,async l=>{cancelAnimationFrame(f.value),c.value=n.dataset.map(r=>({...r,value:t.value.style.animation.show?0:r.value||0,formatter:r.formatter||null})),e.nextTick(g)},{deep:!0});const i=e.ref({width:500,height:16}),w=e.computed(()=>Math.max(...n.dataset.map(l=>l.value))),N=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 _(l){return l/w.value}function h(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:_(l.value)}function d(l){return t.value.style.layout.independant&&l.target||t.value.style.layout.target}function B(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:t.value.style.backgroundColor+e.unref(o.opacity)[n.backgroundOpacity]})},[l.$slots.title?e.renderSlot(l.$slots,"title",e.normalizeProps(e.mergeProps({key:0},{title:{...l.title,title:t.value.style.title.text,subtitle:t.value.style.title.subtitle.text}}))):e.createCommentVNode("",!0),!l.$slots.title&&t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,class:"vue-ui-sparkbar-title-container",style:e.normalizeStyle({background:t.value.style.title.backgroundColor,margin:t.value.style.title.margin,textAlign:t.value.style.title.textAlign})},[e.createElementVNode("div",{class:"vue-ui-sparkbar-title",style:e.normalizeStyle({fontSize:t.value.style.title.fontSize+"px",color:t.value.style.title.color,fontWeight:t.value.style.title.bold?"bold":"normal"})},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-sparkbar-subtitle",style:e.normalizeStyle({fontSize:t.value.style.title.subtitle.fontSize+"px",color:t.value.style.title.subtitle.color,fontWeight:t.value.style.title.subtitle.bold?"bold":"normal"})},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`display:flex !important;${["left","right"].includes(t.value.style.labels.name.position)?`flex-direction: ${t.value.style.labels.name.position==="right"?"row-reverse":"row"} !important`:"flex-direction:column !important"};gap:${t.value.style.gap}px !important;align-items:center;${p.dataset.length>0&&s!==p.dataset.length-1?"margin-bottom:6px":""}`),onClick:()=>B(a,s)},[e.renderSlot(l.$slots,"data-label",e.normalizeProps(e.guardReactiveProps({bar:{...a,target:d(a),valueLabel:e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:s}),targetLabel:e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:s})}}))),l.$slots["data-label"]?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:t.value.style.labels.name.width,color:t.value.style.labels.name.color,fontSize:t.value.style.labels.fontSize+"px",fontWeight:t.value.style.labels.name.bold?"bold":"normal",textAlign:["left","right"].includes(t.value.style.labels.name.position)||["top","top-left"].includes(t.value.style.labels.name.position)?"left":t.value.style.labels.name.position==="top-center"?"center":"right"})},[e.createElementVNode("span",null,e.toDisplayString(a.name),1),t.value.style.labels.value.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.labels.value.bold?"bold":"normal"}`)},": "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,a.value,e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:s})),5)):e.createCommentVNode("",!0),t.value.style.layout.showTargetValue?(e.openBlock(),e.createElementBlock("span",$,e.toDisplayString(" "+t.value.style.layout.targetValueText)+" "+e.toDisplayString(e.unref(o.applyDataLabel)(a.formatter,d(a),e.unref(o.dataLabel)({p:a.prefix||"",v:d(a),s:a.suffix||"",r:a.rounding||0}),{datapoint:a,seriesIndex:s})),1)):e.createCommentVNode("",!0)],4)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${i.value.width} ${i.value.height}`,width:"100%"},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkbar_gradient_${s}_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(a.color,.03)}${e.unref(o.opacity)[100-t.value.style.bar.gradient.intensity]}`},null,8,L),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,P)],8,z)]),e.createElementVNode("rect",{height:i.value.height,width:i.value.width,x:0,y:0,fill:`${t.value.style.gutter.backgroundColor}${e.unref(o.opacity)[t.value.style.gutter.opacity]}`,rx:i.value.height/2},null,8,A),e.createElementVNode("rect",{height:i.value.height,width:i.value.width*h(a),x:0,y:0,fill:t.value.style.bar.gradient.underlayerColor,rx:i.value.height/2},null,8,F),e.createElementVNode("rect",{height:i.value.height,width:i.value.width*h(a),x:0,y:0,fill:t.value.style.bar.gradient.show?`url(#sparkbar_gradient_${s}_${y.value})`:a.color,rx:i.value.height/2},null,8,I)],8,D))],12,V)):e.createCommentVNode("",!0)],64))),256)),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E.default,{key:2,config:{type:"sparkbar",style:{backgroundColor:t.value.style.backgroundColor,sparkbar:{color:"#CCCCCC"}}}},null,8,["config"]))],4))}};exports.default=T;
@@ -1,167 +0,0 @@
1
- import { computed as s, onMounted as C, ref as y, watch as O, openBlock as n, createElementBlock as v, normalizeStyle as c, toDisplayString as g, createCommentVNode as d, unref as i, createElementVNode as r, normalizeClass as j, createBlock as B } from "vue";
2
- import { u as D, o as E, e as L, g as G, c as I, t as U, L as V, X as q, i as P, s as p, f as T } from "./index-C8SH0f2u.js";
3
- import { u as A } from "./useNestedProp-lS_T5lM3.js";
4
- import X from "./vue-ui-skeleton-B4eWLjH3.js";
5
- const H = ["xmlns", "viewBox"], R = ["id"], Y = ["stop-color"], J = ["stop-color"], K = ["d", "stroke", "stroke-linecap"], Q = ["d", "stroke", "stroke-linecap", "stroke-dashoffset"], W = ["x", "y", "font-size", "fill", "font-weight"], le = {
6
- __name: "vue-ui-sparkgauge",
7
- props: {
8
- config: {
9
- type: Object,
10
- default() {
11
- return {};
12
- }
13
- },
14
- dataset: {
15
- type: Object,
16
- default() {
17
- return {};
18
- }
19
- }
20
- },
21
- setup(N) {
22
- const t = N, { vue_ui_sparkgauge: S } = D(), b = s(() => !!t.dataset && Object.keys(t.dataset).length);
23
- C(() => {
24
- E(t.dataset) ? L({
25
- componentName: "VueUiSparkgauge",
26
- type: "dataset"
27
- }) : G({
28
- datasetObject: t.dataset,
29
- requiredAttributes: ["value", "min", "max"]
30
- }).forEach((o) => {
31
- L({
32
- componentName: "VueUiSparkgauge",
33
- type: "datasetAttribute",
34
- property: o
35
- });
36
- });
37
- });
38
- const h = y(I()), e = s(() => {
39
- const o = A({
40
- userConfig: t.config,
41
- defaultConfig: S
42
- });
43
- return o.theme ? {
44
- ...A({
45
- userConfig: U.vue_ui_sparkgauge[o.theme] || t.config,
46
- defaultConfig: o
47
- })
48
- } : o;
49
- }), u = s(() => ({
50
- height: e.value.style.height,
51
- width: 128,
52
- base: e.value.style.basePosition
53
- })), a = s(() => {
54
- const o = t.dataset.min ?? 0, m = t.dataset.max ?? 0, F = m - o;
55
- return {
56
- min: o,
57
- max: m,
58
- diff: F
59
- };
60
- }), l = y(e.value.style.animation.show ? a.value.min : t.dataset.value);
61
- O(() => t.dataset.value, () => {
62
- l.value = y(e.value.style.animation.show ? a.value.min : t.dataset.value), x();
63
- });
64
- const k = s(() => l.value > a.value.max ? a.value.max : l.value < a.value.min ? a.value.min : l.value), z = s(() => a.value.diff / e.value.style.animation.speedMs);
65
- C(() => {
66
- x();
67
- });
68
- function x() {
69
- function o() {
70
- l.value += z.value, l.value < t.dataset.value ? requestAnimationFrame(o) : l.value = t.dataset.value;
71
- }
72
- e.value.style.animation.show && (l.value = a.value.min, o());
73
- }
74
- const f = s(() => t.dataset.title ?? ""), _ = s(() => l.value >= 0 ? (k.value - a.value.min) / a.value.diff : (Math.abs(a.value.min) - Math.abs(k.value)) / a.value.diff), $ = s(() => V(e.value.style.colors.min, e.value.style.colors.max, a.value.min, a.value.max, l.value)), w = s(() => e.value.style.dataLabel.autoColor ? $.value : e.value.style.dataLabel.color), M = s(() => e.value.style.track.autoColor ? $.value : e.value.style.track.color);
75
- return (o, m) => (n(), v("div", {
76
- style: c(`font-family:${e.value.style.fontFamily};width: 100%; background:${e.value.style.background}`)
77
- }, [
78
- e.value.style.title.show && f.value && e.value.style.title.position === "top" ? (n(), v("div", {
79
- key: 0,
80
- class: "vue-data-ui-sparkgauge-label",
81
- style: c(`font-size:${e.value.style.title.fontSize}px;text-align:${e.value.style.title.textAlign};font-weight:${e.value.style.title.bold ? "bold" : "normal"};color:${e.value.style.title.color}`)
82
- }, g(f.value), 5)) : d("", !0),
83
- b.value ? (n(), v("svg", {
84
- key: 1,
85
- xmlns: i(q),
86
- viewBox: `0 0 ${u.value.width} ${u.value.height}`,
87
- style: c(`overflow: visible; background:${e.value.style.background}; width:100%;`)
88
- }, [
89
- r("defs", null, [
90
- r("linearGradient", {
91
- id: `gradient_${h.value}`,
92
- x1: "-10%",
93
- y1: "100%",
94
- x2: "110%",
95
- y2: "100%"
96
- }, [
97
- r("stop", {
98
- offset: "0%",
99
- "stop-color": e.value.style.colors.min
100
- }, null, 8, Y),
101
- r("stop", {
102
- offset: "100%",
103
- "stop-color": e.value.style.colors.max
104
- }, null, 8, J)
105
- ], 8, R)
106
- ]),
107
- r("path", {
108
- d: `M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,
109
- stroke: e.value.style.gutter.color,
110
- "stroke-width": 8,
111
- "stroke-linecap": e.value.style.gutter.strokeLinecap,
112
- fill: "none"
113
- }, null, 8, K),
114
- _.value !== 0 ? (n(), v("path", {
115
- key: 0,
116
- d: `M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,
117
- stroke: e.value.style.colors.showGradient ? `url(#gradient_${h.value})` : M.value,
118
- "stroke-width": 8,
119
- "stroke-linecap": e.value.style.track.strokeLinecap,
120
- fill: "none",
121
- "stroke-dasharray": 169.5,
122
- "stroke-dashoffset": 169.5 - 169.5 * _.value,
123
- class: j({ "vue-ui-sparkgauge-track": e.value.style.animation.show }),
124
- style: c(e.value.style.animation.show ? `animation: vue-ui-sparkgauge-animation ${e.value.style.animation.speedMs}ms ease-in;` : "")
125
- }, null, 14, Q)) : d("", !0),
126
- r("text", {
127
- "text-anchor": "middle",
128
- x: u.value.width / 2,
129
- y: u.value.base + 6 + e.value.style.dataLabel.offsetY,
130
- "font-size": e.value.style.dataLabel.fontSize,
131
- fill: w.value,
132
- "font-weight": e.value.style.dataLabel.bold ? "bold" : "normal"
133
- }, g(i(P)(
134
- e.value.style.dataLabel.formatter,
135
- i(p)(l.value),
136
- i(T)({
137
- p: e.value.style.dataLabel.prefix,
138
- v: i(p)(l.value),
139
- s: e.value.style.dataLabel.suffix,
140
- r: e.value.style.dataLabel.rounding
141
- }),
142
- { datapoint: i(p)(l.value), color: w.value }
143
- )), 9, W)
144
- ], 12, H)) : d("", !0),
145
- b.value ? d("", !0) : (n(), B(X, {
146
- key: 2,
147
- config: {
148
- type: "gauge",
149
- style: {
150
- backgroundColor: e.value.style.background,
151
- gauge: {
152
- color: "#CCCCCC"
153
- }
154
- }
155
- }
156
- }, null, 8, ["config"])),
157
- e.value.style.title.show && f.value && e.value.style.title.position === "bottom" ? (n(), v("div", {
158
- key: 3,
159
- class: "vue-data-ui-sparkgauge-label",
160
- style: c(`font-size:${e.value.style.title.fontSize}px;text-align:${e.value.style.title.textAlign};font-weight:${e.value.style.title.bold ? "bold" : "normal"};font-weight:${e.value.style.title.bold ? "bold" : "normal"};color:${e.value.style.title.color}`)
161
- }, g(f.value), 5)) : d("", !0)
162
- ], 4));
163
- }
164
- };
165
- export {
166
- le as default
167
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-D_32ZGWd.cjs"),g=require("./useNestedProp-BvvH633N.cjs"),C=require("./vue-ui-skeleton-fVPw-oIR.cjs"),N=["xmlns","viewBox"],$=["id"],w=["stop-color"],S=["stop-color"],L=["d","stroke","stroke-linecap"],B=["d","stroke","stroke-linecap","stroke-dashoffset"],E=["x","y","font-size","fill","font-weight"],z={__name:"vue-ui-sparkgauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(k){const a=k,{vue_ui_sparkgauge:b}=o.useConfig(),c=e.computed(()=>!!a.dataset&&Object.keys(a.dataset).length);e.onMounted(()=>{o.objectIsEmpty(a.dataset)?o.error({componentName:"VueUiSparkgauge",type:"dataset"}):o.getMissingDatasetAttributes({datasetObject:a.dataset,requiredAttributes:["value","min","max"]}).forEach(u=>{o.error({componentName:"VueUiSparkgauge",type:"datasetAttribute",property:u})})});const v=e.ref(o.createUid()),t=e.computed(()=>{const u=g.useNestedProp({userConfig:a.config,defaultConfig:b});return u.theme?{...g.useNestedProp({userConfig:o.themes.vue_ui_sparkgauge[u.theme]||a.config,defaultConfig:u})}:u}),n=e.computed(()=>({height:t.value.style.height,width:128,base:t.value.style.basePosition})),l=e.computed(()=>{const u=a.dataset.min??0,i=a.dataset.max??0,_=i-u;return{min:u,max:i,diff:_}}),s=e.ref(t.value.style.animation.show?l.value.min:a.dataset.value);e.watch(()=>a.dataset.value,()=>{s.value=e.ref(t.value.style.animation.show?l.value.min:a.dataset.value),m()});const d=e.computed(()=>s.value>l.value.max?l.value.max:s.value<l.value.min?l.value.min:s.value),h=e.computed(()=>l.value.diff/t.value.style.animation.speedMs);e.onMounted(()=>{m()});function m(){function u(){s.value+=h.value,s.value<a.dataset.value?requestAnimationFrame(u):s.value=a.dataset.value}t.value.style.animation.show&&(s.value=l.value.min,u())}const r=e.computed(()=>a.dataset.title??""),f=e.computed(()=>s.value>=0?(d.value-l.value.min)/l.value.diff:(Math.abs(l.value.min)-Math.abs(d.value))/l.value.diff),y=e.computed(()=>o.interpolateColorHex(t.value.style.colors.min,t.value.style.colors.max,l.value.min,l.value.max,s.value)),p=e.computed(()=>t.value.style.dataLabel.autoColor?y.value:t.value.style.dataLabel.color),x=e.computed(()=>t.value.style.track.autoColor?y.value:t.value.style.track.color);return(u,i)=>(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&&r.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(r.value),5)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${n.value.width} ${n.value.height}`,style:e.normalizeStyle(`overflow: visible; background:${t.value.style.background}; width:100%;`)},[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,w),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.max},null,8,S)],8,$)]),e.createElementVNode("path",{d:`M10 ${n.value.base} A 1 1 0 1 1 118 ${n.value.base}`,stroke:t.value.style.gutter.color,"stroke-width":8,"stroke-linecap":t.value.style.gutter.strokeLinecap,fill:"none"},null,8,L),f.value!==0?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M10 ${n.value.base} A 1 1 0 1 1 118 ${n.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*f.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,B)):e.createCommentVNode("",!0),e.createElementVNode("text",{"text-anchor":"middle",x:n.value.width/2,y:n.value.base+6+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,fill:p.value,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.dataLabel.formatter,e.unref(o.checkNaN)(s.value),e.unref(o.dataLabel)({p:t.value.style.dataLabel.prefix,v:e.unref(o.checkNaN)(s.value),s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding}),{datapoint:e.unref(o.checkNaN)(s.value),color:p.value})),9,E)],12,N)):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(C.default,{key:2,config:{type:"gauge",style:{backgroundColor:t.value.style.background,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.title.show&&r.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(r.value),5)):e.createCommentVNode("",!0)],4))}};exports.default=z;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-D_32ZGWd.cjs"),k=require("./useNestedProp-BvvH633N.cjs"),z=require("./Shape-DRDUAe_o.cjs"),D=require("./vue-ui-skeleton-fVPw-oIR.cjs"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0},A={key:1},H=["xmlns","viewBox"],q=["id"],I=["stop-color"],U=["stop-color"],W=["id"],O=["stop-color"],j=["stop-color"],P=["id"],G=["stop-color"],T=["stop-color"],X={key:0},Y=["x","y","height","width","fill","stroke","stroke-width","rx"],R={key:1},J=["x","y","font-size","font-weight","fill"],K=["x","y","font-size","fill"],Q=["x","y","font-size","fill"],Z=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],ee={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(b,{emit:_}){const u=b;e.useCssVars(o=>({"07c89730":w.value}));const{vue_ui_sparkhistogram:x}=a.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length);e.onMounted(()=>{a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkHistogram",type:"dataset"}):u.dataset.forEach((o,n)=>{a.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["value"]}).forEach(l=>{a.error({componentName:"VueUiSparkHistogram",type:"datasetSerieAttribute",property:l,index:n})})})});const v=e.ref(a.createUid()),t=e.computed(()=>{const o=k.useNestedProp({userConfig:u.config,defaultConfig:x});return o.theme?{...k.useNestedProp({userConfig:a.themes.vue_ui_sparkhistogram[o.theme]||u.config,defaultConfig:o})}:o}),c=e.computed(()=>{const o=t.value.style.layout.height,n=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=n-t.value.style.layout.padding.right,p=l+(o-l-t.value.style.layout.padding.bottom)/2,g=o-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,m=n-t.value.style.layout.padding.left-t.value.style.layout.padding.right;return{bottom:s,centerY:p,drawingHeight:g,drawingWidth:m,height:o,left:d,right:y,top:l,width:n}}),B=e.computed(()=>Math.max(...u.dataset.map(o=>Math.abs(o.value||0))));function $(o){return Math.abs(o)/B.value}const i=e.computed(()=>u.dataset.map((o,n)=>{const l=$(o.value||0),s=c.value.drawingHeight*l,d=c.value.drawingWidth/u.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,g=c.value.centerY-s/2,m=c.value.left+(y/2+n*d),S=c.value.left+n*d,h=typeof o.intensity>"u"?100:Math.round(o.intensity*100),C=o.color?o.color:o.value>=0?`${t.value.style.bars.colors.positive}${a.opacity[h]}`:`${t.value.style.bars.colors.negative}${a.opacity[h]}`,N=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,L=o.color?`url(#gradient_datapoint_${n}_${v.value})`:o.value>=0?`url(#gradient_positive_${n}_${v.value})`:`url(#gradient_negative_${n}_${v.value})`,V=m+p/2;return{...o,color:C,gradient:L,height:s,intensity:h,proportion:l,stroke:N,textAnchor:V,trapX:S,unitWidth:d,width:p,x:m,y:g}})),r=e.ref(null);function E(o,n){_("selectDatapoint",{datapoint:o,index:n})}const w=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily}`),onMouseleave:n[1]||(n[1]=l=>r.value=null)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:${t.value.style.backgroundColor};margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},[e.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),r.value!==null?(e.openBlock(),e.createElementBlock("span",M,"- "+e.toDisplayString(i.value[r.value].timeLabel||"")+" "+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.labels.value.formatter,i.value[r.value].value,e.unref(a.dataLabel)({p:t.value.style.labels.value.prefix,v:i.value[r.value].value,s:t.value.style.labels.value.suffix,r:t.value.style.labels.value.rounding}),{datapoint:i.value[r.value],seriesIndex:r.value})),1)):e.createCommentVNode("",!0),![void 0,null].includes(r.value)&&![null,void 0].includes(i.value[r.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",A,"("+e.toDisplayString(i.value[r.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),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:{overflow:"visible"}},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.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.shiftHue)(t.value.style.bars.colors.positive,.05)}${e.unref(a.opacity)[l.intensity]}`},null,8,I),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.bars.colors.positive}${e.unref(a.opacity)[l.intensity]}`},null,8,U)],8,q))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.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.shiftHue)(t.value.style.bars.colors.negative,.05)}${e.unref(a.opacity)[l.intensity]}`},null,8,O),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.bars.colors.negative}${e.unref(a.opacity)[l.intensity]}`},null,8,j)],8,W))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.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.shiftHue)(l.color,.05)}${e.unref(a.opacity)[l.intensity]}`},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":`${l.color}${e.unref(a.opacity)[l.intensity]}`},null,8,T)],8,P))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.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,Y))),256))])):(e.openBlock(),e.createElementBlock("g",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,s)=>(e.openBlock(),e.createBlock(z._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(i.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(t.value.style.labels.value.prefix)+e.toDisplayString(isNaN(l.value)?"":Number(l.value.toFixed(t.value.style.labels.value.rounding)).toLocaleString())+e.toDisplayString(t.value.style.labels.value.suffix),9,J))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.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,K)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.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,Q)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.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=>r.value=s,onMouseleave:n[0]||(n[0]=d=>r.value=null),stroke:r.value!==null&&r.value===s?t.value.style.selector.stroke:"","stroke-width":r.value!==null&&r.value===s?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>E(l,s)},null,40,Z)]))),256))],8,H)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.default,{key:2,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},te=F._export_sfc(ee,[["__scopeId","data-v-27ede5f8"]]);exports.default=te;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-D_32ZGWd.cjs"),C=require("./useNestedProp-BvvH633N.cjs"),F=require("./vue-ui-skeleton-fVPw-oIR.cjs"),E=require("./useResponsive-B3TrDDIG.cjs"),T=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),q=["id"],G=["xmlns","viewBox"],O=["id"],j=["stop-color"],R=["stop-color"],H=["id"],U=["stop-color"],X=["stop-color"],Z=["id"],Y=["stop-color"],J=["stop-color"],K={key:0},Q=["d","fill"],ee=["d","fill"],te=["d","stroke","stroke-width"],le=["x1","x2","y1","y2","stroke","stroke-width"],ae=["x","y","width","height","fill","rx"],oe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ne=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ue=["cx","cy","r","fill","stroke","stroke-width"],re=["x","y","font-size","font-weight","fill"],se=["x","y","height","width","onMouseenter","onClick"],ie={__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:I}=u.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(u.createUid()),_=e.ref(null),B=e.ref(null),t=e.computed(()=>{const l=C.useNestedProp({userConfig:i.config,defaultConfig:I});return l.theme?{...C.useNestedProp({userConfig:u.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}),p=e.ref(i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value})),L=e.ref(null);e.onMounted(()=>{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.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()}if(t.value.responsive){const l=E.throttle(()=>{const{width:n,height:a}=E.useResponsive({chart:_.value,title:t.value.style.title.show&&i.showInfo?B.value:null});o.value.width=n,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*n,o.value.padding=.06*n});L.value=new ResizeObserver(l),L.value.observe(_.value.parentNode)}});const o=e.ref({height:80,width:500,chartWidth:t.value.style.chartWidth,padding:30}),S=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))),M=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)}),z=e.computed(()=>M.value+m.value+S.value),b=e.computed(()=>r.value.bottom-r.value.height*N(m.value));function N(l){return l/z.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)}})),P=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 D(l,n){c.value=l,x("hoverIndex",{index:n})}function A(){c.value=void 0,x("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:V})=>({x:a,y:d,value:V}))).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 W(l,n){x("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:_,class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily}`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:y.value.latest,sum:y.value.sum,average:y.value.average,median:y.value.median,trend:y.value.trend})),void 0,!0),t.value.style.title.show&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:B,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(u.shiftHue)(t.value.style.area.color,.05)}${e.unref(u.opacity)[t.value.style.area.opacity]}`},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.area.color+e.unref(u.opacity)[t.value.style.area.opacity]},null,8,R)],8,O),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,U),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(u.shiftHue)(t.value.style.bar.color,.05)}`},null,8,X)],8,H),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,Y),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,J)],8,Z)]),t.value.style.area.show&&!k.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",K,[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})`:`${t.value.style.area.color}${e.unref(u.opacity)[t.value.style.area.opacity]}`},null,8,Q)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${P.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(u.opacity)[t.value.style.area.opacity]}`},null,8,ee))])):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,te)):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,le)):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,ae)):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,oe)):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,ne)):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,ue)):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,re)):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:V=>D(a,d),onMouseleave:A,onClick:()=>W(a,d)},null,40,se))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,G)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(F.default,{key:2,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,q))}},de=T._export_sfc(ie,[["__scopeId","data-v-a8f8425a"]]);exports.default=de;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-D_32ZGWd.cjs"),C=require("./useNestedProp-BvvH633N.cjs"),E=require("./vue-ui-skeleton-fVPw-oIR.cjs"),N=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=["xmlns","viewBox"],z=["id"],D=["stop-color"],P=["stop-color"],L=["stop-color"],A={id:"stackPill",clipPathUnits:"objectBoundingBox"},F=["fill"],U={"clip-path":"url(#stackPill)"},j=["height","width","fill"],q=["onClick","x","width","height","fill","stroke"],I=["onClick"],T={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},H=["height","width"],O=["fill"],M={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(B,{emit:w}){const u=B,{vue_ui_sparkstackbar:$}=o.useConfig(),k=e.computed(()=>!!u.dataset&&u.dataset.length),b=e.ref(o.createUid()),t=e.computed(()=>{const l=C.useNestedProp({userConfig:u.config,defaultConfig:$});return l.theme?{...C.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),m=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),d=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?o.convertColorToHex(l.color):m.value[n]||o.palette[n]||o.palette[n%o.palette.length]}))),p=e.ref(!0);e.onMounted(()=>{if(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})})}),t.value.style.animation.show){let h=function(){r+=a/l,r<a?(d.value=d.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(h)):(p.value=!1,d.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;p.value=!0,h()}});const v=e.ref({width:500,height:16}),c=e.ref([]),g=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!c.value.includes(n)).reduce((l,n)=>l+n,0)),_=e.computed(()=>d.value.map((l,n)=>({...l,value:l.value||0,proportion:(l.value||0)/g.value,width:(l.value||0)/g.value*v.value.width,proportionLabel:o.dataLabel({v:(l.value||0)/g.value*100,s:"%",r:t.value.style.legend.percentage.rounding})}))),y=e.computed(()=>_.value.filter((l,n)=>!c.value.includes(n)));function S(l){c.value.includes(l)?c.value=c.value.filter(n=>n!==l):c.value.length<d.value.length-1&&c.value.push(l)}const f=e.computed(()=>{let l=0;const n=[];for(let a=0;a<y.value.length;a+=1)n.push({...y.value[a],start:l}),l+=y.value[a].width;return n});function x(l,n){w("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:${t.value.style.backgroundColor};margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),width:"100%",viewBox:`0 0 ${v.value.width} ${v.value.height}`},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${b.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,D),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(o.shiftHue)(a.color,.05)}${e.unref(o.opacity)[100-t.value.style.bar.gradient.intensity]}`},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,L)],8,z))),128)),e.createElementVNode("clipPath",A,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,F)])]),e.createElementVNode("g",U,[e.createElementVNode("rect",{x:0,y:0,height:v.value.height,width:f.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!p.value})},null,10,j),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,onClick:()=>x(a,r),x:a.start,y:0,width:a.width,height:v.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${b.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!p.value})},null,10,q))),128))])],8,V)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.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:h=>{S(r),x(a,r)}},[e.createElementVNode("div",T,[(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,O)],8,H)),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,I))),256))],4)):e.createCommentVNode("",!0)],4))}},G=N._export_sfc(M,[["__scopeId","data-v-86f11bbc"]]);exports.default=G;