vue-data-ui 3.0.0-next.9 → 3.0.0

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 (144) hide show
  1. package/README.md +32 -30
  2. package/dist/{Arrow-B6OlqyCG.js → Arrow-r2f8Bpd-.js} +1 -1
  3. package/dist/{BaseDraggableDialog-CA8QOk7L.js → BaseDraggableDialog-CGGcf8d8.js} +4 -4
  4. package/dist/{BaseIcon-DxUUKVlt.js → BaseIcon-CXtL10fo.js} +1 -1
  5. package/dist/{ColorPicker-Bh1dfgXt.js → ColorPicker-H91bBsqM.js} +2 -2
  6. package/dist/{DataTable--paavNqF.js → DataTable-BSSXpM7w.js} +2 -2
  7. package/dist/{Legend-BZ06qU55.js → Legend-BUk0WvWJ.js} +2 -2
  8. package/dist/{NonSvgPenAndPaper-DN9XjEHv.js → NonSvgPenAndPaper-DQDgPoW8.js} +3 -3
  9. package/dist/{PackageVersion-2QvaZf9_.js → PackageVersion-CJ6Vd7V5.js} +3 -3
  10. package/dist/{PenAndPaper-hGgW0EHz.js → PenAndPaper-D3zudcNI.js} +32 -32
  11. package/dist/{RecursiveCircles-Dn3TGoL6.js → RecursiveCircles-BcLb1aRS.js} +15 -13
  12. package/dist/RecursiveLabels-Bgcv0pzu.js +50 -0
  13. package/dist/{RecursiveLinks-ld_gDZH4.js → RecursiveLinks-00zGWPf9.js} +20 -18
  14. package/dist/{Shape-Mr1eIp_G.js → Shape-BRzOzubn.js} +43 -37
  15. package/dist/Slicer-MID8pgT3.js +602 -0
  16. package/dist/{SparkTooltip-Czhz446b.js → SparkTooltip-DATI1fGZ.js} +7 -7
  17. package/dist/{Title-B2dA6-uH.js → Title-BGu6gEd2.js} +1 -1
  18. package/dist/{Tooltip-O_hCvqgF.js → Tooltip-Bh2zYSoM.js} +23 -19
  19. package/dist/{UserOptions-Bk03FRqW.js → UserOptions-Ck8fz9f4.js} +2 -2
  20. package/dist/{dom-to-png-Bt5F9TXw.js → dom-to-png-DhIh24Ti.js} +1 -1
  21. package/dist/{img-C_9wps3s.js → img-DrR839Ot.js} +1 -1
  22. package/dist/{index-CgShIRes.js → index-BtNwOUja.js} +2885 -2010
  23. package/dist/{pdf-CXdbjyRJ.js → pdf-DoShrdT5.js} +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/types/vue-data-ui.d.cts +753 -65
  26. package/dist/types/vue-data-ui.d.ts +753 -65
  27. package/dist/useAutoSizeLabelsInsideViewbox-FmDQyX4z.js +81 -0
  28. package/dist/useFitSvgText-2crs6Fv5.js +69 -0
  29. package/dist/useLoading-D7YHNtLX.js +29 -0
  30. package/dist/useNestedProp-f2H3m6Yj.js +13 -0
  31. package/dist/usePanZoom-BVca3eMk.js +122 -0
  32. package/dist/{usePrinter-rIrqBbbm.js → usePrinter-DUNjpQNe.js} +2 -2
  33. package/dist/useTimeLabelCollider-CIsgDrl9.js +78 -0
  34. package/dist/{useTimeLabels-DG97x2hL.js → useTimeLabels-DkzmKfZn.js} +208 -156
  35. package/dist/{vue-data-ui-DiwfJSwC.js → vue-data-ui-D7QVxNhO.js} +105 -100
  36. package/dist/vue-data-ui.js +26 -25
  37. package/dist/vue-ui-3d-bar-ITaF-6Kn.js +1323 -0
  38. package/dist/{vue-ui-accordion-hlzscmAS.js → vue-ui-accordion-BKUrAowe.js} +3 -3
  39. package/dist/vue-ui-age-pyramid-DxsuDr6o.js +835 -0
  40. package/dist/{vue-ui-annotator-BHwBUNRO.js → vue-ui-annotator-B06QtxgJ.js} +12 -12
  41. package/dist/vue-ui-bullet-B7Fy45tA.js +571 -0
  42. package/dist/vue-ui-candlestick-Dw0U4uIQ.js +1000 -0
  43. package/dist/{vue-ui-carousel-table-6MTDYf-H.js → vue-ui-carousel-table-DGz0nw28.js} +29 -29
  44. package/dist/{vue-ui-chestnut-Cr6dK21e.js → vue-ui-chestnut-CFfKYm9i.js} +664 -536
  45. package/dist/vue-ui-chord-EhlQhMSs.js +1038 -0
  46. package/dist/vue-ui-circle-pack-BHrrEUUd.js +709 -0
  47. package/dist/{vue-ui-cursor-Ch5yUxNn.js → vue-ui-cursor-Dd-HtWzG.js} +2 -2
  48. package/dist/{vue-ui-dashboard-tVZ9aEHo.js → vue-ui-dashboard-6R8udDY3.js} +64 -64
  49. package/dist/{vue-ui-digits-BOlYLluF.js → vue-ui-digits-zKn3uhGN.js} +2 -2
  50. package/dist/{vue-ui-donut-BKwAnTKA.js → vue-ui-donut-BtnIwS_E.js} +431 -422
  51. package/dist/vue-ui-donut-evolution-DHo1MuMM.js +1076 -0
  52. package/dist/vue-ui-dumbbell-Czi9r9Na.js +1120 -0
  53. package/dist/vue-ui-flow-jOfM0RZY.js +841 -0
  54. package/dist/{vue-ui-funnel-CAV6A--C.js → vue-ui-funnel-tBvVpdhy.js} +16 -16
  55. package/dist/vue-ui-galaxy-IdoY2oqG.js +680 -0
  56. package/dist/vue-ui-gauge-DR6Xm_Hz.js +791 -0
  57. package/dist/vue-ui-gizmo-Dto73UsB.js +210 -0
  58. package/dist/vue-ui-heatmap-zmFv-0z1.js +1078 -0
  59. package/dist/vue-ui-history-plot-ILemyyYw.js +1074 -0
  60. package/dist/{vue-ui-kpi-DjHXc1Z9.js → vue-ui-kpi-hmqSCvxr.js} +26 -26
  61. package/dist/{vue-ui-mini-loader-C68r9wbr.js → vue-ui-mini-loader-CbD-E8ci.js} +2 -2
  62. package/dist/vue-ui-molecule-mTy6YIm6.js +656 -0
  63. package/dist/vue-ui-mood-radar-BEnSYV3Q.js +785 -0
  64. package/dist/vue-ui-nested-donuts-CGE9dmJK.js +1284 -0
  65. package/dist/vue-ui-onion-Dh2J9GV0.js +776 -0
  66. package/dist/vue-ui-parallel-coordinate-plot-xsgmMIJK.js +916 -0
  67. package/dist/{vue-ui-quadrant-ULvVhjjq.js → vue-ui-quadrant-DA0Kw6eq.js} +512 -459
  68. package/dist/vue-ui-quick-chart-DKbxF5Yt.js +1762 -0
  69. package/dist/vue-ui-radar-BFY9bN_h.js +796 -0
  70. package/dist/{vue-ui-rating-CkdVnYpj.js → vue-ui-rating-Bh35aujf.js} +2 -2
  71. package/dist/vue-ui-relation-circle-B-05kQ_l.js +598 -0
  72. package/dist/vue-ui-ridgeline-CuGfF83t.js +1157 -0
  73. package/dist/vue-ui-rings-DrQXXzAM.js +728 -0
  74. package/dist/vue-ui-scatter-CWn9c7e9.js +1178 -0
  75. package/dist/{vue-ui-skeleton-BsBaCvoE.js → vue-ui-skeleton-oG4Bm5nL.js} +13 -13
  76. package/dist/{vue-ui-smiley-B2sBY2Q-.js → vue-ui-smiley-Cnwba_gV.js} +46 -46
  77. package/dist/vue-ui-spark-trend-D9iNCf4o.js +315 -0
  78. package/dist/vue-ui-sparkbar-iJkiubZC.js +351 -0
  79. package/dist/vue-ui-sparkgauge-BH3uA5rh.js +232 -0
  80. package/dist/vue-ui-sparkhistogram-B3kR62pf.js +380 -0
  81. package/dist/vue-ui-sparkline-DczR2ZAf.js +513 -0
  82. package/dist/vue-ui-sparkstackbar-Cg0ItRGH.js +421 -0
  83. package/dist/vue-ui-stackbar-d4PrzcGS.js +1371 -0
  84. package/dist/vue-ui-strip-plot-BXBpN5rl.js +916 -0
  85. package/dist/{vue-ui-table-DaE8lQuo.js → vue-ui-table-BXOLZXuz.js} +17 -17
  86. package/dist/{vue-ui-table-heatmap--dSEG8cU.js → vue-ui-table-heatmap-7YT7VF2H.js} +5 -5
  87. package/dist/{vue-ui-table-sparkline-D4DkGvDP.js → vue-ui-table-sparkline-BfgqajJ2.js} +19 -16
  88. package/dist/vue-ui-thermometer-C7Tg6HLz.js +541 -0
  89. package/dist/{vue-ui-timer-CYXTAh6x.js → vue-ui-timer-Ch5JP1pQ.js} +5 -5
  90. package/dist/vue-ui-tiremarks-fY-4pWAK.js +406 -0
  91. package/dist/vue-ui-treemap-DTSX6suB.js +1035 -0
  92. package/dist/{vue-ui-vertical-bar-CO9eR1ty.js → vue-ui-vertical-bar-C-i2dRnU.js} +104 -102
  93. package/dist/vue-ui-waffle-BbgLlhGH.js +910 -0
  94. package/dist/vue-ui-wheel-waZf462K.js +379 -0
  95. package/dist/vue-ui-word-cloud-DtLK91Dk.js +765 -0
  96. package/dist/{vue-ui-world-P45Plcqw.js → vue-ui-world-Cx4uuwTY.js} +364 -327
  97. package/dist/vue-ui-xy-DDOT8cyx.js +3808 -0
  98. package/dist/{vue-ui-xy-canvas-DgNBgUak.js → vue-ui-xy-canvas-CUCsC8vD.js} +265 -264
  99. package/package.json +4 -4
  100. package/dist/RecursiveLabels-NTMB9w5C.js +0 -49
  101. package/dist/Slicer-3t0HimeE.js +0 -577
  102. package/dist/useLoading-Bt5Doa8m.js +0 -28
  103. package/dist/useNestedProp-BC4Ciblw.js +0 -13
  104. package/dist/usePanZoom-BQMvRXEQ.js +0 -115
  105. package/dist/vue-ui-3d-bar-BqmzX9u4.js +0 -1227
  106. package/dist/vue-ui-age-pyramid-eRPt0BJb.js +0 -746
  107. package/dist/vue-ui-bullet-BSnF2gql.js +0 -513
  108. package/dist/vue-ui-candlestick-kMbNnoYe.js +0 -873
  109. package/dist/vue-ui-chord-Dxy_bfIE.js +0 -949
  110. package/dist/vue-ui-circle-pack-I_p4FPiW.js +0 -673
  111. package/dist/vue-ui-donut-evolution-DQhZJ4Sa.js +0 -903
  112. package/dist/vue-ui-dumbbell-DdN-7b3g.js +0 -753
  113. package/dist/vue-ui-flow-MvORTthN.js +0 -765
  114. package/dist/vue-ui-galaxy-B0PLMAn8.js +0 -617
  115. package/dist/vue-ui-gauge-C4FTzDFt.js +0 -738
  116. package/dist/vue-ui-gizmo-Dl5FHFb4.js +0 -192
  117. package/dist/vue-ui-heatmap-C3dee43W.js +0 -877
  118. package/dist/vue-ui-history-plot-dqv4u1Oa.js +0 -924
  119. package/dist/vue-ui-molecule-DtRAlfhC.js +0 -597
  120. package/dist/vue-ui-mood-radar-BZj2G0zE.js +0 -670
  121. package/dist/vue-ui-nested-donuts-OqJTwMb2.js +0 -1212
  122. package/dist/vue-ui-onion-DXLokGec.js +0 -701
  123. package/dist/vue-ui-parallel-coordinate-plot-tg7QhtIE.js +0 -807
  124. package/dist/vue-ui-quick-chart-4EODniQ3.js +0 -1612
  125. package/dist/vue-ui-radar-Dt5p5oSy.js +0 -741
  126. package/dist/vue-ui-relation-circle-_SysXj9T.js +0 -542
  127. package/dist/vue-ui-ridgeline-Cs5UihNN.js +0 -969
  128. package/dist/vue-ui-rings-Duay-EmS.js +0 -685
  129. package/dist/vue-ui-scatter-C6oGQcbL.js +0 -1045
  130. package/dist/vue-ui-spark-trend-CEAqGu3d.js +0 -291
  131. package/dist/vue-ui-sparkbar-ByPUDc6x.js +0 -301
  132. package/dist/vue-ui-sparkgauge-C-GKwevJ.js +0 -201
  133. package/dist/vue-ui-sparkhistogram-Dz0DdaVW.js +0 -313
  134. package/dist/vue-ui-sparkline-BULntz_U.js +0 -459
  135. package/dist/vue-ui-sparkstackbar-DXjHOeeU.js +0 -381
  136. package/dist/vue-ui-stackbar-CeP9n7zy.js +0 -1207
  137. package/dist/vue-ui-strip-plot-CaFQkWV8.js +0 -761
  138. package/dist/vue-ui-thermometer-BXf14CYH.js +0 -495
  139. package/dist/vue-ui-tiremarks-D6hJ1cd4.js +0 -358
  140. package/dist/vue-ui-treemap-tBurCrdn.js +0 -965
  141. package/dist/vue-ui-waffle-BNzs_BxY.js +0 -863
  142. package/dist/vue-ui-wheel-tydUATi8.js +0 -352
  143. package/dist/vue-ui-word-cloud-DUUc_tj6.js +0 -659
  144. package/dist/vue-ui-xy--HToGdle.js +0 -2982
@@ -0,0 +1,315 @@
1
+ import { defineAsyncComponent as de, ref as f, toRefs as fe, computed as u, watch as X, onMounted as ce, createElementBlock as o, openBlock as s, normalizeStyle as he, createCommentVNode as c, createBlock as ye, unref as r, createVNode as pe, createElementVNode as S, renderSlot as J, toDisplayString as K } from "vue";
2
+ import { u as ge, c as me, t as ke, b as be, a4 as D, o as Q, f as _e, h as y, a5 as we, X as $e, s as O, V as Y, i as ee, k as xe } from "./index-BtNwOUja.js";
3
+ import { t as Le, u as Ce } from "./useResponsive-DfdjqQps.js";
4
+ import { u as Ae, B as Te } from "./useLoading-D7YHNtLX.js";
5
+ import { u as Se } from "./useFitSvgText-2crs6Fv5.js";
6
+ import { u as te } from "./useNestedProp-f2H3m6Yj.js";
7
+ import { _ as Ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
+ const ze = ["id"], Me = ["xmlns", "viewBox"], Fe = ["width", "height"], Ie = ["id"], Ee = ["stop-color"], Ve = ["stop-color"], je = { key: 1 }, Be = ["d", "fill"], De = ["d", "fill"], Oe = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"], Ge = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"], Re = ["d"], Ze = ["fill", "d"], We = ["x", "y", "width", "height"], He = ["x", "y", "fill", "font-size", "font-weight"], Ue = ["stroke", "cx", "cy", "fill"], qe = ["x", "y", "font-size", "fill", "font-weight"], Pe = {
9
+ __name: "vue-ui-spark-trend",
10
+ props: {
11
+ config: {
12
+ type: Object,
13
+ default() {
14
+ return {};
15
+ }
16
+ },
17
+ dataset: {
18
+ type: Array,
19
+ default() {
20
+ return [];
21
+ }
22
+ }
23
+ },
24
+ setup(le) {
25
+ const ae = de(() => import("./PackageVersion-CJ6Vd7V5.js")), { vue_ui_spark_trend: ne } = ge(), p = le, N = f(null), G = f(null), R = f(null), _ = f(null), x = f(null), L = f(me()), e = f(z()), { loading: g, FINAL_DATASET: w, manualLoading: Z } = Ae({
26
+ ...fe(p),
27
+ FINAL_CONFIG: e,
28
+ prepareConfig: z,
29
+ skeletonDataset: [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233],
30
+ skeletonConfig: ke({
31
+ defaultConfig: e.value,
32
+ userConfig: {
33
+ style: {
34
+ animation: { show: !1 },
35
+ backgroundColor: "#99999930",
36
+ line: {
37
+ stroke: "#6A6A6A",
38
+ useColorTrend: !1
39
+ },
40
+ dataLabel: { show: !1, useColorTrend: !1, color: "#6A6A6A" }
41
+ }
42
+ }
43
+ })
44
+ });
45
+ function z() {
46
+ const t = te({
47
+ userConfig: p.config,
48
+ defaultConfig: ne
49
+ });
50
+ return t.theme ? {
51
+ ...te({
52
+ userConfig: be.vue_ui_spark_trend[t.theme] || p.config,
53
+ defaultConfig: t
54
+ })
55
+ } : t;
56
+ }
57
+ const m = u(() => D({
58
+ data: w.value,
59
+ threshold: e.value.downsample.threshold
60
+ }));
61
+ X(() => p.config, (t) => {
62
+ e.value = z(), I.value = e.value.style.width, k.value = e.value.style.height, H();
63
+ }, { deep: !0 }), X(() => w.value, (t) => {
64
+ $.value = D({
65
+ data: w.value,
66
+ threshold: e.value.downsample.threshold
67
+ }).map((a) => [void 0, 1 / 0, -1 / 0, null, NaN].includes(a) ? null : a), W(), j(".vue-ui-sparktrend-progress-label", 6);
68
+ }, { deep: !0 });
69
+ function M(t) {
70
+ return t.map((a) => y(a));
71
+ }
72
+ const $ = f(D({
73
+ data: w.value,
74
+ threshold: e.value.downsample.threshold
75
+ }).map((t) => e.value.style.animation.show || [void 0, 1 / 0, -1 / 0, null, NaN].includes(t) ? null : t)), C = f(!1), F = f(null);
76
+ function W() {
77
+ let a = 1e3 / e.value.style.animation.animationFrames, d = performance.now();
78
+ if (!g.value && e.value.style.animation.show && e.value.style.animation.animationFrames && w.value.length > 1) {
79
+ let B = function() {
80
+ C.value = !0;
81
+ let q = performance.now(), P = q - d;
82
+ P > a ? (d = q - P % a, b < m.value.length ? ($.value.push(m.value[b]), b += 1, F.value = requestAnimationFrame(B)) : (cancelAnimationFrame(F.value), $.value = M(m.value), C.value = !1, j(".vue-ui-sparktrend-progress-label", 6))) : F.value = requestAnimationFrame(B);
83
+ };
84
+ $.value = [];
85
+ let b = 0;
86
+ B();
87
+ }
88
+ }
89
+ ce(() => {
90
+ H();
91
+ });
92
+ const ue = u(() => e.value.debug);
93
+ function H() {
94
+ if (Q(p.dataset) && (_e({
95
+ componentName: "VueUiSparkTrend",
96
+ type: "dataset",
97
+ debug: ue.value
98
+ }), Z.value = !0), Q(p.dataset) || (Z.value = !1), e.value.responsive) {
99
+ const t = Le(() => {
100
+ const { width: a, height: d } = Ce({
101
+ chart: N.value,
102
+ source: R.value
103
+ });
104
+ requestAnimationFrame(() => {
105
+ I.value = a, k.value = d;
106
+ });
107
+ });
108
+ _.value && (x.value && _.value.unobserve(x.value), _.value.disconnect()), _.value = new ResizeObserver(t), x.value = N.value.parentNode, _.value.observe(x.value);
109
+ }
110
+ W(), j(".vue-ui-sparktrend-progress-label", 6);
111
+ }
112
+ const I = f(e.value.style.width), k = f(e.value.style.height), i = u(() => ({
113
+ height: k.value,
114
+ width: I.value
115
+ })), n = u(() => ({
116
+ top: e.value.style.padding.top,
117
+ left: e.value.style.padding.left,
118
+ right: i.value.width - e.value.style.padding.right,
119
+ bottom: i.value.height - e.value.style.padding.bottom,
120
+ height: i.value.height - (e.value.style.padding.top + e.value.style.padding.bottom) - (e.value.style.dataLabel.show ? e.value.style.dataLabel.fontSize : 0),
121
+ width: i.value.width - (e.value.style.padding.left + e.value.style.padding.right)
122
+ })), E = u(() => {
123
+ const t = M(m.value);
124
+ return {
125
+ max: Math.max(...t.map((a) => y(a))),
126
+ min: Math.min(...t.map((a) => y(a)))
127
+ };
128
+ }), A = u(() => {
129
+ const t = E.value.min >= 0 ? 0 : E.value.min;
130
+ return Math.abs(t);
131
+ }), se = u(() => E.value.max + A.value);
132
+ function U(t) {
133
+ return t / se.value;
134
+ }
135
+ const oe = u(() => m.value.length), l = u(() => $.value.map((t, a) => {
136
+ const d = isNaN(t) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t) ? 0 : t || 0;
137
+ return {
138
+ value: y(t),
139
+ absoluteValue: y(d),
140
+ plotValue: y(d + A.value),
141
+ toMax: U(d + A.value),
142
+ x: n.value.left + y(a * (n.value.width / (oe.value - 1))) - e.value.style.padding.right,
143
+ y: n.value.bottom - y(n.value.height * U(d + A.value))
144
+ };
145
+ })), T = u(() => {
146
+ const t = M(m.value);
147
+ return e.value.style.trendLabel.trendType === "global" ? we(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;
148
+ }), V = u(() => C.value || T.value === 0 ? "neutral" : T.value > 0 ? "positive" : "negative"), h = u(() => e.value.style.arrow.colors[V.value]), re = u(() => {
149
+ const t = { x: l.value[0].x, y: i.value.height - 6 }, a = { x: l.value[l.value.length - 1].x, y: i.value.height - 6 }, d = [];
150
+ return l.value.forEach((b) => {
151
+ d.push(`${b.x},${b.y} `);
152
+ }), [t.x, t.y, ...d, a.x, a.y].toString();
153
+ }), ie = u(() => {
154
+ let t = [];
155
+ return l.value.forEach((a) => {
156
+ t.push(`${a.x},${a.y} `);
157
+ }), `M ${t.toString()}`;
158
+ }), v = u(() => k.value / 2 - e.value.style.trendLabel.fontSize), ve = u(() => n.value.left * 0.8), { fitText: j } = Se({
159
+ svgRef: G,
160
+ unitWidth: ve,
161
+ fontSize: e.value.style.trendLabel.fontSize
162
+ });
163
+ return (t, a) => (s(), o("div", {
164
+ ref_key: "sparkTrendChart",
165
+ ref: N,
166
+ class: "vue-ui-spark-trend",
167
+ id: L.value,
168
+ style: he(`width:100%;font-family:${e.value.style.fontFamily};background:${e.value.style.backgroundColor}`)
169
+ }, [
170
+ (s(), o("svg", {
171
+ ref_key: "svgRef",
172
+ ref: G,
173
+ xmlns: r($e),
174
+ viewBox: `0 0 ${i.value.width} ${i.value.height}`,
175
+ style: "width:100%;background:transparent;overflow:visible"
176
+ }, [
177
+ pe(r(ae)),
178
+ t.$slots["chart-background"] ? (s(), o("foreignObject", {
179
+ key: 0,
180
+ x: 0,
181
+ y: 0,
182
+ width: i.value.width <= 0 ? 10 : i.value.width,
183
+ height: i.value.height <= 0 ? 10 : i.value.height,
184
+ style: {
185
+ pointerEvents: "none"
186
+ }
187
+ }, [
188
+ J(t.$slots, "chart-background", {}, void 0, !0)
189
+ ], 8, Fe)) : c("", !0),
190
+ S("defs", null, [
191
+ S("linearGradient", {
192
+ x1: "0%",
193
+ y1: "0%",
194
+ x2: "0%",
195
+ y2: "100%",
196
+ id: `pill_gradient_${L.value}`
197
+ }, [
198
+ S("stop", {
199
+ offset: "0%",
200
+ "stop-color": r(O)(e.value.style.line.useColorTrend ? h.value : e.value.style.line.stroke, e.value.style.area.opacity)
201
+ }, null, 8, Ee),
202
+ S("stop", {
203
+ offset: "100%",
204
+ "stop-color": e.value.style.backgroundColor
205
+ }, null, 8, Ve)
206
+ ], 8, Ie)
207
+ ]),
208
+ e.value.style.area.show && l.value[0] ? (s(), o("g", je, [
209
+ e.value.style.line.smooth ? (s(), o("path", {
210
+ key: 0,
211
+ d: `M ${l.value[0].x},${n.value.bottom} ${r(Y)(l.value)} L ${l.value.at(-1).x},${n.value.bottom} Z`,
212
+ fill: e.value.style.area.useGradient ? `url(#pill_gradient_${L.value})` : r(O)(e.value.style.line.useColorTrend ? h.value : e.value.style.line.stroke, e.value.style.area.opacity),
213
+ stroke: "none"
214
+ }, null, 8, Be)) : (s(), o("path", {
215
+ key: 1,
216
+ d: `M${re.value}Z`,
217
+ fill: e.value.style.area.useGradient ? `url(#pill_gradient_${L.value})` : r(O)(e.value.style.line.useColorTrend ? h.value : e.value.style.line.stroke, e.value.style.area.opacity),
218
+ stroke: "none"
219
+ }, null, 8, De))
220
+ ])) : c("", !0),
221
+ e.value.style.line.smooth && l.value.length ? (s(), o("path", {
222
+ key: 2,
223
+ d: `M ${r(Y)(l.value)}`,
224
+ stroke: e.value.style.line.useColorTrend ? h.value : e.value.style.line.stroke,
225
+ fill: "none",
226
+ "stroke-width": e.value.style.line.strokeWidth,
227
+ "stroke-linecap": e.value.style.line.strokeLinecap,
228
+ "stroke-linejoin": e.value.style.line.strokeLinejoin
229
+ }, null, 8, Oe)) : c("", !0),
230
+ !e.value.style.line.smooth && l.value.length ? (s(), o("path", {
231
+ key: 3,
232
+ d: ie.value,
233
+ stroke: e.value.style.line.useColorTrend ? h.value : e.value.style.line.stroke,
234
+ fill: "none",
235
+ "stroke-width": e.value.style.line.strokeWidth,
236
+ "stroke-linecap": e.value.style.line.strokeLinecap,
237
+ "stroke-linejoin": e.value.style.line.strokeLinejoin
238
+ }, null, 8, Ge)) : c("", !0),
239
+ r(g) ? (s(), o("path", {
240
+ key: 4,
241
+ fill: "#6A6A6A",
242
+ d: `M ${n.value.left / 2 + 6}, ${v.value + 7} ${n.value.left / 2 - 7}, ${v.value} ${n.value.left / 2 - 7}, ${v.value + 14} Z`
243
+ }, null, 8, Re)) : (s(), o("path", {
244
+ key: 5,
245
+ fill: h.value,
246
+ d: V.value === "positive" ? `M ${n.value.left / 2}, ${v.value} ${n.value.left / 2 - 7}, ${v.value + 12} ${n.value.left / 2 + 7}, ${v.value + 12} Z` : V.value === "negative" ? `M ${n.value.left / 2}, ${v.value + 12} ${n.value.left / 2 - 7}, ${v.value} ${n.value.left / 2 + 7}, ${v.value} Z` : `M ${n.value.left / 2 + 6}, ${v.value + 7} ${n.value.left / 2 - 7}, ${v.value} ${n.value.left / 2 - 7}, ${v.value + 14} Z`
247
+ }, null, 8, Ze)),
248
+ r(g) ? (s(), o("rect", {
249
+ key: 6,
250
+ x: n.value.left / 2 - e.value.style.trendLabel.fontSize - 2,
251
+ y: k.value / 2 + e.value.style.trendLabel.fontSize - 2,
252
+ width: e.value.style.trendLabel.fontSize * 2,
253
+ height: e.value.style.trendLabel.fontSize,
254
+ fill: "#6A6A6A80",
255
+ rx: "3"
256
+ }, null, 8, We)) : c("", !0),
257
+ !C.value && !r(g) ? (s(), o("text", {
258
+ key: 7,
259
+ class: "vue-ui-sparktrend-progress-label",
260
+ x: n.value.left / 2,
261
+ y: k.value / 2 + e.value.style.trendLabel.fontSize * 2,
262
+ "text-anchor": "middle",
263
+ fill: e.value.style.trendLabel.useColorTrend ? h.value : e.value.style.trendLabel.color,
264
+ "font-size": e.value.style.trendLabel.fontSize,
265
+ "font-weight": e.value.style.trendLabel.bold ? "bold" : "normal"
266
+ }, K(r(ee)({
267
+ p: T.value > 0 ? "+" : "",
268
+ v: T.value,
269
+ s: "%",
270
+ r: e.value.style.trendLabel.rounding
271
+ })), 9, He)) : c("", !0),
272
+ l.value.length && l.value.at(-1).x !== void 0 ? (s(), o("circle", {
273
+ key: 8,
274
+ stroke: e.value.style.backgroundColor,
275
+ "stroke-width": 2,
276
+ cx: l.value.at(-1).x,
277
+ cy: l.value.at(-1).y,
278
+ r: 4,
279
+ fill: r(g) ? "#6A6A6A" : h.value
280
+ }, null, 8, Ue)) : c("", !0),
281
+ l.value.length && l.value.at(-1).x !== void 0 && e.value.style.dataLabel.show ? (s(), o("text", {
282
+ key: 9,
283
+ "text-anchor": "middle",
284
+ x: l.value.at(-1).x,
285
+ y: l.value.at(-1).y - e.value.style.dataLabel.fontSize / 1.5,
286
+ "font-size": e.value.style.dataLabel.fontSize,
287
+ fill: e.value.style.dataLabel.useColorTrend ? h.value : e.value.style.dataLabel.color,
288
+ "font-weight": e.value.style.dataLabel.bold ? "bold" : "normal"
289
+ }, K(r(xe)(
290
+ e.value.style.dataLabel.formatter,
291
+ l.value.at(-1).value,
292
+ r(ee)({
293
+ p: e.value.style.dataLabel.prefix,
294
+ v: l.value.at(-1).value,
295
+ s: e.value.style.dataLabel.suffix,
296
+ r: e.value.style.dataLabel.rounding
297
+ }),
298
+ { datapoint: l.value.at(-1) }
299
+ )), 9, qe)) : c("", !0)
300
+ ], 8, Me)),
301
+ t.$slots.source ? (s(), o("div", {
302
+ key: 0,
303
+ ref_key: "source",
304
+ ref: R,
305
+ dir: "auto"
306
+ }, [
307
+ J(t.$slots, "source", {}, void 0, !0)
308
+ ], 512)) : c("", !0),
309
+ r(g) ? (s(), ye(Te, { key: 1 })) : c("", !0)
310
+ ], 12, ze));
311
+ }
312
+ }, lt = /* @__PURE__ */ Ne(Pe, [["__scopeId", "data-v-7034e800"]]);
313
+ export {
314
+ lt as default
315
+ };
@@ -0,0 +1,351 @@
1
+ import { defineAsyncComponent as Z, useSlots as ee, onMounted as B, ref as x, toRefs as te, computed as w, watch as E, nextTick as le, createElementBlock as i, openBlock as n, normalizeStyle as d, unref as o, renderSlot as D, createCommentVNode as c, createBlock as ae, normalizeProps as oe, mergeProps as M, createElementVNode as v, toDisplayString as y, Fragment as P, renderList as se, createVNode as ne } from "vue";
2
+ import { u as ue, c as ie, t as re, a as ve, p as C, b as de, d as ce, o as pe, f as V, g as fe, e as ye, s as I, k as _, i as A, X as ge, x as me } from "./index-BtNwOUja.js";
3
+ import { u as O } from "./useNestedProp-f2H3m6Yj.js";
4
+ import { u as he, B as xe } from "./useLoading-D7YHNtLX.js";
5
+ const ke = ["onClick", "onMouseenter", "onMouseleave"], be = { key: 1 }, we = ["xmlns", "viewBox"], Ce = ["id"], _e = ["stop-color"], Ae = ["stop-color"], Se = ["height", "width", "fill", "rx"], $e = ["height", "width", "fill", "rx"], De = ["height", "width", "fill", "rx"], Ie = {
6
+ key: 2,
7
+ ref: "source",
8
+ dir: "auto"
9
+ }, Fe = {
10
+ __name: "vue-ui-sparkbar",
11
+ props: {
12
+ config: {
13
+ type: Object,
14
+ default() {
15
+ return {};
16
+ }
17
+ },
18
+ dataset: {
19
+ type: Array,
20
+ default() {
21
+ return [];
22
+ }
23
+ },
24
+ /**
25
+ * Used in VueUiRadar's tooltip exclusively
26
+ */
27
+ backgroundOpacity: {
28
+ type: Number,
29
+ default: null
30
+ }
31
+ },
32
+ emits: ["selectDatapoint"],
33
+ setup(S, { emit: j }) {
34
+ const U = Z(() => import("./PackageVersion-CJ6Vd7V5.js")), { vue_ui_sparkbar: R } = ue(), f = S, W = ee();
35
+ B(() => {
36
+ W["chart-background"] && console.warn("VueUiSparkbar does not support the #chart-background slot.");
37
+ });
38
+ const L = x(ie()), e = x($()), { loading: k, FINAL_DATASET: p } = he({
39
+ ...te(f),
40
+ FINAL_CONFIG: e,
41
+ prepareConfig: $,
42
+ skeletonDataset: [
43
+ { name: "_", value: 21, target: 25, color: "#808080" },
44
+ { name: "_", value: 13, target: 25, color: "#ADADAD" },
45
+ { name: "_", value: 8, target: 25, color: "#DBDBDB" }
46
+ ],
47
+ skeletonConfig: re({
48
+ defaultConfig: e.value,
49
+ userConfig: {
50
+ style: {
51
+ backgroundColor: "#99999930",
52
+ animation: { show: !1 },
53
+ layout: { independant: !0 },
54
+ gutter: {
55
+ backgroundColor: "#6A6A6A",
56
+ opacity: 50
57
+ },
58
+ bar: {
59
+ gradient: {
60
+ underlayerColor: "#6A6A6A"
61
+ }
62
+ }
63
+ }
64
+ }
65
+ })
66
+ }), T = w(() => !!e.value.debug);
67
+ function $() {
68
+ const t = O({
69
+ userConfig: f.config,
70
+ defaultConfig: R
71
+ });
72
+ return t.theme ? {
73
+ ...O({
74
+ userConfig: de.vue_ui_sparkbar[t.theme] || f.config,
75
+ defaultConfig: t
76
+ }),
77
+ customPalette: ve[t.theme] || C
78
+ } : t;
79
+ }
80
+ E(() => f.config, (t) => {
81
+ e.value = $();
82
+ }, { deep: !0 });
83
+ const G = w(() => ce(e.value.customPalette)), g = x(p.value.map((t) => ({
84
+ ...t,
85
+ value: e.value.style.animation.show ? 0 : t.value || 0,
86
+ formatter: t.formatter || null
87
+ }))), z = x(null);
88
+ B(async () => {
89
+ pe(f.dataset) && V({
90
+ componentName: "VueUiSparkbar",
91
+ type: "dataset",
92
+ debug: T.value
93
+ }), N();
94
+ });
95
+ function N() {
96
+ if (e.value.style.animation.show) {
97
+ let h = function() {
98
+ s += l / t, s < l ? (g.value = g.value.map((u, b) => ({
99
+ ...u,
100
+ value: u.value += a[b]
101
+ })), z.value = requestAnimationFrame(h)) : g.value = p.value.map((u) => ({
102
+ ...u,
103
+ value: u.value || 0,
104
+ formatter: u.formatter || null
105
+ }));
106
+ };
107
+ const t = e.value.style.animation.animationFrames, a = p.value.map((u, b) => u.value / t), l = p.value.map((u) => u.value || 0).reduce((u, b) => u + b, 0);
108
+ let s = 0;
109
+ h();
110
+ }
111
+ }
112
+ E(() => p.value, async (t) => {
113
+ cancelAnimationFrame(z.value), g.value = p.value.map((a) => ({
114
+ ...a,
115
+ value: e.value.style.animation.show ? 0 : a.value || 0,
116
+ formatter: a.formatter || null
117
+ })), le(N);
118
+ }, { deep: !0 });
119
+ const r = x({
120
+ width: 500,
121
+ height: 16
122
+ }), q = w(() => Math.max(...p.value.map((t) => t.value))), H = w(() => (p.value.forEach((t, a) => {
123
+ fe({
124
+ datasetObject: t,
125
+ requiredAttributes: ["name", "value"]
126
+ }).forEach((l) => {
127
+ V({
128
+ componentName: "VueUiSparkbar",
129
+ type: "datasetSerieAttribute",
130
+ property: l,
131
+ index: a,
132
+ debug: T.value
133
+ });
134
+ });
135
+ }), g.value.map((t, a) => ({
136
+ ...t,
137
+ value: t.value || 0,
138
+ color: ye(t.color) || G.value[a] || C[a] || C[a % C.length]
139
+ }))));
140
+ function X(t) {
141
+ return t / q.value;
142
+ }
143
+ function F(t) {
144
+ return e.value.style.layout.independant ? t.target ? t.value / t.target : e.value.style.layout.percentage ? t.value > 100 ? 1 : t.value / 100 : e.value.style.layout.target === 0 ? 1 : t.value / e.value.style.layout.target : X(t.value);
145
+ }
146
+ function m(t) {
147
+ return e.value.style.layout.independant && t.target || e.value.style.layout.target;
148
+ }
149
+ const J = j;
150
+ function K(t, a) {
151
+ J("selectDatapoint", { datapoint: t, index: a }), e.value.events.datapointClick && e.value.events.datapointClick({ datapoint: t, seriesIndex: a });
152
+ }
153
+ function Q(t, a) {
154
+ e.value.events.datapointEnter && e.value.events.datapointEnter({ datapoint: t, seriesIndex: a });
155
+ }
156
+ function Y(t, a) {
157
+ e.value.events.datapointLeave && e.value.events.datapointLeave({ datapoint: t, seriesIndex: a });
158
+ }
159
+ return (t, a) => (n(), i("div", {
160
+ class: "vue-ui-sparkbar",
161
+ style: d({
162
+ width: "100%",
163
+ position: "relative",
164
+ fontFamily: e.value.style.fontFamily,
165
+ background: f.backgroundOpacity !== null ? o(I)(e.value.style.backgroundColor, f.backgroundOpacity) : e.value.style.backgroundColor
166
+ })
167
+ }, [
168
+ t.$slots.title ? D(t.$slots, "title", oe(M({ key: 0 }, { title: { ...t.title, title: e.value.style.title.text, subtitle: e.value.style.title.subtitle.text } }))) : c("", !0),
169
+ !t.$slots.title && e.value.style.title.text ? (n(), i("div", {
170
+ key: 1,
171
+ class: "vue-ui-sparkbar-title-container",
172
+ style: d({
173
+ background: e.value.style.title.backgroundColor,
174
+ margin: e.value.style.title.margin,
175
+ textAlign: e.value.style.title.textAlign
176
+ })
177
+ }, [
178
+ v("div", {
179
+ class: "vue-ui-sparkbar-title",
180
+ style: d({
181
+ fontSize: e.value.style.title.fontSize + "px",
182
+ color: e.value.style.title.color,
183
+ fontWeight: e.value.style.title.bold ? "bold" : "normal"
184
+ })
185
+ }, y(e.value.style.title.text), 5),
186
+ e.value.style.title.subtitle.text ? (n(), i("div", {
187
+ key: 0,
188
+ class: "vue-ui-sparkbar-subtitle",
189
+ style: d({
190
+ fontSize: e.value.style.title.subtitle.fontSize + "px",
191
+ color: e.value.style.title.subtitle.color,
192
+ fontWeight: e.value.style.title.subtitle.bold ? "bold" : "normal"
193
+ })
194
+ }, y(e.value.style.title.subtitle.text), 5)) : c("", !0)
195
+ ], 4)) : c("", !0),
196
+ (n(!0), i(P, null, se(H.value, (l, s) => (n(), i("div", {
197
+ style: d(`display:flex !important;${["left", "right"].includes(e.value.style.labels.name.position) ? `flex-direction: ${e.value.style.labels.name.position === "right" ? "row-reverse" : "row"} !important` : "flex-direction:column !important"};gap:${e.value.style.gap}px !important;align-items:center;${S.dataset.length > 0 && s !== S.dataset.length - 1 ? "margin-bottom:6px" : ""}`),
198
+ onClick: (h) => K(l, s),
199
+ onMouseenter: (h) => Q(l, s),
200
+ onMouseleave: (h) => Y(l, s)
201
+ }, [
202
+ o(k) ? c("", !0) : D(t.$slots, "data-label", M({
203
+ key: 0,
204
+ ref_for: !0
205
+ }, { bar: {
206
+ ...l,
207
+ target: m(l),
208
+ valueLabel: o(_)(
209
+ l.formatter,
210
+ l.value,
211
+ o(A)({
212
+ p: l.prefix || "",
213
+ v: l.value,
214
+ s: l.suffix || "",
215
+ r: l.rounding || 0
216
+ }),
217
+ { datapoint: l, seriesIndex: s }
218
+ ),
219
+ targetLabel: o(_)(
220
+ l.formatter,
221
+ m(l),
222
+ o(A)({
223
+ p: l.prefix || "",
224
+ v: m(l),
225
+ s: l.suffix || "",
226
+ r: l.rounding || 0
227
+ }),
228
+ { datapoint: l, seriesIndex: s }
229
+ )
230
+ } })),
231
+ !t.$slots["data-label"] || o(k) ? (n(), i("div", {
232
+ key: 1,
233
+ style: d({
234
+ display: "flex",
235
+ justifyContent: ["right", "top-right"].includes(e.value.style.labels.name.position) ? "flex-end" : ["top-center"].includes(e.value.style.labels.name.position) ? "center" : "flex-start",
236
+ alignItems: "center",
237
+ width: e.value.style.labels.name.width,
238
+ color: e.value.style.labels.name.color,
239
+ fontSize: e.value.style.labels.fontSize + "px",
240
+ fontWeight: e.value.style.labels.name.bold ? "bold" : "normal",
241
+ flexWrap: "wrap"
242
+ })
243
+ }, [
244
+ o(k) ? (n(), i("div", {
245
+ key: 0,
246
+ class: "vue-ui-sparkbar-skeleton-name",
247
+ style: d({
248
+ width: "60px",
249
+ height: e.value.style.labels.fontSize + "px",
250
+ borderRadius: e.value.style.labels.fontSize / 4 + "px",
251
+ display: "flex",
252
+ alignItems: "center",
253
+ justifyContent: "space-between",
254
+ marginTop: "5px"
255
+ })
256
+ }, [
257
+ v("div", {
258
+ style: d({ height: "100%", width: "40px", borderRadius: e.value.style.labels.fontSize / 4 + "px", backgroundColor: "#6A6A6A80" })
259
+ }, null, 4),
260
+ v("div", {
261
+ style: d({ height: "100%", width: "15px", borderRadius: e.value.style.labels.fontSize / 4 + "px", backgroundColor: "#6A6A6A80" })
262
+ }, null, 4)
263
+ ], 4)) : (n(), i(P, { key: 1 }, [
264
+ v("span", null, y(l.name), 1),
265
+ e.value.style.labels.value.show ? (n(), i("span", {
266
+ key: 0,
267
+ style: d(`font-weight:${e.value.style.labels.value.bold ? "bold" : "normal"}`)
268
+ }, ": " + y(o(_)(
269
+ l.formatter,
270
+ l.value,
271
+ o(A)({
272
+ p: l.prefix || "",
273
+ v: l.value,
274
+ s: l.suffix || "",
275
+ r: l.rounding || 0
276
+ }),
277
+ { datapoint: l, seriesIndex: s }
278
+ )), 5)) : c("", !0),
279
+ e.value.style.layout.showTargetValue ? (n(), i("span", be, y(" " + e.value.style.layout.targetValueText) + " " + y(o(_)(
280
+ l.formatter,
281
+ m(l),
282
+ o(A)({
283
+ p: l.prefix || "",
284
+ v: m(l),
285
+ s: l.suffix || "",
286
+ r: l.rounding || 0
287
+ }),
288
+ { datapoint: l, seriesIndex: s }
289
+ )), 1)) : c("", !0)
290
+ ], 64))
291
+ ], 4)) : c("", !0),
292
+ (n(), i("svg", {
293
+ xmlns: o(ge),
294
+ viewBox: `0 0 ${r.value.width} ${r.value.height}`,
295
+ width: "100%"
296
+ }, [
297
+ ne(o(U)),
298
+ v("defs", null, [
299
+ v("linearGradient", {
300
+ x1: "0%",
301
+ y1: "0%",
302
+ x2: "100%",
303
+ y2: "0%",
304
+ id: `sparkbar_gradient_${s}_${L.value}`
305
+ }, [
306
+ v("stop", {
307
+ offset: "0%",
308
+ "stop-color": o(I)(o(me)(l.color, 0.03), 100 - e.value.style.bar.gradient.intensity)
309
+ }, null, 8, _e),
310
+ v("stop", {
311
+ offset: "100%",
312
+ "stop-color": l.color
313
+ }, null, 8, Ae)
314
+ ], 8, Ce)
315
+ ]),
316
+ v("rect", {
317
+ height: r.value.height,
318
+ width: r.value.width,
319
+ x: 0,
320
+ y: 0,
321
+ fill: o(I)(e.value.style.gutter.backgroundColor, e.value.style.gutter.opacity),
322
+ rx: r.value.height / 2
323
+ }, null, 8, Se),
324
+ v("rect", {
325
+ height: r.value.height,
326
+ width: r.value.width * F(l),
327
+ x: 0,
328
+ y: 0,
329
+ fill: e.value.style.bar.gradient.underlayerColor,
330
+ rx: r.value.height / 2
331
+ }, null, 8, $e),
332
+ v("rect", {
333
+ height: r.value.height,
334
+ width: r.value.width * F(l),
335
+ x: 0,
336
+ y: 0,
337
+ fill: e.value.style.bar.gradient.show ? `url(#sparkbar_gradient_${s}_${L.value})` : l.color,
338
+ rx: r.value.height / 2
339
+ }, null, 8, De)
340
+ ], 8, we))
341
+ ], 44, ke))), 256)),
342
+ t.$slots.source ? (n(), i("div", Ie, [
343
+ D(t.$slots, "source")
344
+ ], 512)) : c("", !0),
345
+ o(k) ? (n(), ae(xe, { key: 3 })) : c("", !0)
346
+ ], 4));
347
+ }
348
+ };
349
+ export {
350
+ Fe as default
351
+ };