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

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-DQoWnUfD.js} +1 -1
  3. package/dist/{BaseDraggableDialog-CA8QOk7L.js → BaseDraggableDialog-DEw6oieL.js} +4 -4
  4. package/dist/{BaseIcon-DxUUKVlt.js → BaseIcon-DEl03NUZ.js} +1 -1
  5. package/dist/{ColorPicker-Bh1dfgXt.js → ColorPicker-CrivFZqC.js} +2 -2
  6. package/dist/{DataTable--paavNqF.js → DataTable-ClgCsiJA.js} +2 -2
  7. package/dist/{Legend-BZ06qU55.js → Legend-CMvJ6X5j.js} +2 -2
  8. package/dist/{NonSvgPenAndPaper-DN9XjEHv.js → NonSvgPenAndPaper-B2Wvbl3p.js} +3 -3
  9. package/dist/{PackageVersion-2QvaZf9_.js → PackageVersion-CD5VH_Al.js} +3 -3
  10. package/dist/{PenAndPaper-hGgW0EHz.js → PenAndPaper-D3WRn-G2.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-Adi9i_-f.js} +43 -37
  15. package/dist/Slicer-t6e1t2iM.js +602 -0
  16. package/dist/{SparkTooltip-Czhz446b.js → SparkTooltip-B8OnBSvk.js} +7 -7
  17. package/dist/{Title-B2dA6-uH.js → Title-xTWR-Vil.js} +1 -1
  18. package/dist/{Tooltip-O_hCvqgF.js → Tooltip-BH3CiANh.js} +23 -19
  19. package/dist/{UserOptions-Bk03FRqW.js → UserOptions-CKKPgDLV.js} +2 -2
  20. package/dist/{dom-to-png-Bt5F9TXw.js → dom-to-png-C4hj491O.js} +1 -1
  21. package/dist/{img-C_9wps3s.js → img-Vb4QHAHI.js} +1 -1
  22. package/dist/{index-CgShIRes.js → index-Dzc2Gi60.js} +2885 -2010
  23. package/dist/{pdf-CXdbjyRJ.js → pdf-ddpqw-dt.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-CN_Jh8Hr.js +81 -0
  28. package/dist/useFitSvgText-2crs6Fv5.js +69 -0
  29. package/dist/useLoading-D7YHNtLX.js +29 -0
  30. package/dist/useNestedProp-CjnS13nF.js +13 -0
  31. package/dist/usePanZoom-BVca3eMk.js +122 -0
  32. package/dist/{usePrinter-rIrqBbbm.js → usePrinter-DBRh8ZvS.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-B7ztqj9-.js} +105 -100
  36. package/dist/vue-data-ui.js +26 -25
  37. package/dist/vue-ui-3d-bar-DUmYPtHl.js +1323 -0
  38. package/dist/{vue-ui-accordion-hlzscmAS.js → vue-ui-accordion-CPk8wAuj.js} +3 -3
  39. package/dist/vue-ui-age-pyramid-Bv5HmeXj.js +835 -0
  40. package/dist/{vue-ui-annotator-BHwBUNRO.js → vue-ui-annotator-KXWlIhtd.js} +12 -12
  41. package/dist/vue-ui-bullet-B4N4mBk9.js +571 -0
  42. package/dist/vue-ui-candlestick-DENvPnUO.js +1000 -0
  43. package/dist/{vue-ui-carousel-table-6MTDYf-H.js → vue-ui-carousel-table-vC2bHBaY.js} +29 -29
  44. package/dist/{vue-ui-chestnut-Cr6dK21e.js → vue-ui-chestnut-2nS0StrY.js} +664 -536
  45. package/dist/vue-ui-chord-CyfS6vNM.js +1038 -0
  46. package/dist/vue-ui-circle-pack-C4JR-0fx.js +709 -0
  47. package/dist/{vue-ui-cursor-Ch5yUxNn.js → vue-ui-cursor-BgeSDtQh.js} +2 -2
  48. package/dist/{vue-ui-dashboard-tVZ9aEHo.js → vue-ui-dashboard-9DWUBJ-I.js} +64 -64
  49. package/dist/{vue-ui-digits-BOlYLluF.js → vue-ui-digits-BQO7IBFA.js} +2 -2
  50. package/dist/{vue-ui-donut-BKwAnTKA.js → vue-ui-donut-C-ZJXJ74.js} +431 -422
  51. package/dist/vue-ui-donut-evolution-B870IrQA.js +1076 -0
  52. package/dist/vue-ui-dumbbell-Cfs2Uotx.js +1120 -0
  53. package/dist/vue-ui-flow-DnaUVVAD.js +841 -0
  54. package/dist/{vue-ui-funnel-CAV6A--C.js → vue-ui-funnel-B9s-H5ZG.js} +16 -16
  55. package/dist/vue-ui-galaxy-BoJOczdh.js +680 -0
  56. package/dist/vue-ui-gauge-qjm4BqZR.js +791 -0
  57. package/dist/vue-ui-gizmo-fn7ZaMTI.js +210 -0
  58. package/dist/vue-ui-heatmap-CIBDKhh8.js +1078 -0
  59. package/dist/vue-ui-history-plot-bbNxldYG.js +1074 -0
  60. package/dist/{vue-ui-kpi-DjHXc1Z9.js → vue-ui-kpi-BX-2jhLx.js} +26 -26
  61. package/dist/{vue-ui-mini-loader-C68r9wbr.js → vue-ui-mini-loader-Bn1Bb8-J.js} +2 -2
  62. package/dist/vue-ui-molecule-DQ3qFtBq.js +656 -0
  63. package/dist/vue-ui-mood-radar-Cf-ehIo1.js +785 -0
  64. package/dist/vue-ui-nested-donuts-CWg5BEi-.js +1284 -0
  65. package/dist/vue-ui-onion-sHgQTYfa.js +776 -0
  66. package/dist/vue-ui-parallel-coordinate-plot-Ki3ITp_s.js +916 -0
  67. package/dist/{vue-ui-quadrant-ULvVhjjq.js → vue-ui-quadrant-BIVqW7U7.js} +512 -459
  68. package/dist/vue-ui-quick-chart-C_hvHc1b.js +1762 -0
  69. package/dist/vue-ui-radar-RZUPyPwB.js +796 -0
  70. package/dist/{vue-ui-rating-CkdVnYpj.js → vue-ui-rating-BI8Vk7dO.js} +2 -2
  71. package/dist/vue-ui-relation-circle-TVMUEtxK.js +598 -0
  72. package/dist/vue-ui-ridgeline-DQeXHQG4.js +1157 -0
  73. package/dist/vue-ui-rings-BH81WmMS.js +728 -0
  74. package/dist/vue-ui-scatter-Cy7Tz_An.js +1178 -0
  75. package/dist/{vue-ui-skeleton-BsBaCvoE.js → vue-ui-skeleton-CF50qQxr.js} +13 -13
  76. package/dist/{vue-ui-smiley-B2sBY2Q-.js → vue-ui-smiley-CrFXEbJs.js} +46 -46
  77. package/dist/vue-ui-spark-trend-DtHArnot.js +315 -0
  78. package/dist/vue-ui-sparkbar-CIOwFFgA.js +351 -0
  79. package/dist/vue-ui-sparkgauge-E0DdGotz.js +232 -0
  80. package/dist/vue-ui-sparkhistogram-Dm7WoyjY.js +380 -0
  81. package/dist/vue-ui-sparkline-DoW6DDKT.js +513 -0
  82. package/dist/vue-ui-sparkstackbar-BJnPUWY4.js +421 -0
  83. package/dist/vue-ui-stackbar-Du42smPs.js +1371 -0
  84. package/dist/vue-ui-strip-plot-DnenGI-d.js +916 -0
  85. package/dist/{vue-ui-table-DaE8lQuo.js → vue-ui-table-BQOQVlHr.js} +17 -17
  86. package/dist/{vue-ui-table-heatmap--dSEG8cU.js → vue-ui-table-heatmap-BzK4_gsP.js} +5 -5
  87. package/dist/{vue-ui-table-sparkline-D4DkGvDP.js → vue-ui-table-sparkline-B-IwcT8I.js} +19 -16
  88. package/dist/vue-ui-thermometer-06ao_Pj5.js +541 -0
  89. package/dist/{vue-ui-timer-CYXTAh6x.js → vue-ui-timer-CxQq4roK.js} +5 -5
  90. package/dist/vue-ui-tiremarks-CuTxkByj.js +406 -0
  91. package/dist/vue-ui-treemap-BgHhRpiV.js +1035 -0
  92. package/dist/{vue-ui-vertical-bar-CO9eR1ty.js → vue-ui-vertical-bar-CAcsUUCo.js} +104 -102
  93. package/dist/vue-ui-waffle-Ct3Upw3m.js +910 -0
  94. package/dist/vue-ui-wheel-oz06Kt-p.js +379 -0
  95. package/dist/vue-ui-word-cloud-BRy7fg4S.js +765 -0
  96. package/dist/{vue-ui-world-P45Plcqw.js → vue-ui-world-CTV-YfFN.js} +364 -327
  97. package/dist/vue-ui-xy-DqCy9dpa.js +3808 -0
  98. package/dist/{vue-ui-xy-canvas-DgNBgUak.js → vue-ui-xy-canvas-BZdhKUIp.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,232 @@
1
+ import { defineAsyncComponent as P, ref as b, toRefs as T, onMounted as N, computed as s, watch as M, createElementBlock as r, openBlock as u, normalizeStyle as g, createCommentVNode as d, createBlock as U, toDisplayString as k, unref as i, createVNode as q, createElementVNode as y, renderSlot as F, normalizeClass as V } from "vue";
2
+ import { u as B } from "./useNestedProp-CjnS13nF.js";
3
+ import { u as X, c as Y, t as H, b as J, o as K, f as E, g as Q, P as W, X as Z, k as ee, h as x, i as te } from "./index-Dzc2Gi60.js";
4
+ import { u as ae, B as le } from "./useLoading-D7YHNtLX.js";
5
+ import { u as oe } from "./useChartAccessibility-9icAAmYg.js";
6
+ const se = ["xmlns", "viewBox"], ue = ["width", "height"], ie = ["id"], ne = ["stop-color"], re = ["stop-color"], ve = ["d", "stroke", "stroke-linecap"], ce = ["d", "stroke", "stroke-linecap", "stroke-dashoffset"], de = ["x", "y", "width", "height"], fe = ["x", "y", "font-size", "fill", "font-weight"], ye = {
7
+ key: 2,
8
+ ref: "source",
9
+ dir: "auto"
10
+ }, ke = {
11
+ __name: "vue-ui-sparkgauge",
12
+ props: {
13
+ config: {
14
+ type: Object,
15
+ default() {
16
+ return {};
17
+ }
18
+ },
19
+ dataset: {
20
+ type: Object,
21
+ default() {
22
+ return {};
23
+ }
24
+ }
25
+ },
26
+ setup(D) {
27
+ const O = P(() => import("./PackageVersion-CD5VH_Al.js")), { vue_ui_sparkgauge: j } = X(), c = D, _ = b(Y()), e = b(p()), { loading: h, FINAL_DATASET: v } = ae({
28
+ ...T(c),
29
+ FINAL_CONFIG: e,
30
+ prepareConfig: p,
31
+ skeletonDataset: {
32
+ value: 0,
33
+ min: -1,
34
+ max: 1,
35
+ title: ""
36
+ },
37
+ skeletonConfig: H({
38
+ defaultConfig: e.value,
39
+ userConfig: {
40
+ style: {
41
+ animation: { show: !1 },
42
+ background: "#99999930",
43
+ colors: {
44
+ min: "#CACACA",
45
+ max: "#6A6A6A"
46
+ },
47
+ track: {
48
+ autoColor: !0
49
+ },
50
+ gutter: {
51
+ color: "#6A6A6A80"
52
+ }
53
+ }
54
+ }
55
+ })
56
+ }), { svgRef: I } = oe({ config: { text: c.dataset.title } });
57
+ function p() {
58
+ const t = B({
59
+ userConfig: c.config,
60
+ defaultConfig: j
61
+ });
62
+ return t.theme ? {
63
+ ...B({
64
+ userConfig: J.vue_ui_sparkgauge[t.theme] || c.config,
65
+ defaultConfig: t
66
+ })
67
+ } : t;
68
+ }
69
+ N(() => {
70
+ A();
71
+ });
72
+ const w = s(() => e.value.debug);
73
+ function A() {
74
+ K(c.dataset) ? E({
75
+ componentName: "VueUiSparkgauge",
76
+ type: "dataset",
77
+ debug: w.value
78
+ }) : Q({
79
+ datasetObject: c.dataset,
80
+ requiredAttributes: ["value", "min", "max"]
81
+ }).forEach((t) => {
82
+ E({
83
+ componentName: "VueUiSparkgauge",
84
+ type: "datasetAttribute",
85
+ property: t,
86
+ debug: w.value
87
+ });
88
+ });
89
+ }
90
+ M(() => c.config, (t) => {
91
+ e.value = p(), a.value = e.value.style.animation.show ? o.value.min : v.value.value, A();
92
+ }, { deep: !0 });
93
+ const l = s(() => ({
94
+ height: e.value.style.height,
95
+ width: 128,
96
+ base: e.value.style.basePosition
97
+ })), o = s(() => {
98
+ const t = v.value.min ?? 0, n = v.value.max ?? 0, f = n - t;
99
+ return {
100
+ min: t,
101
+ max: n,
102
+ diff: f
103
+ };
104
+ }), a = b(e.value.style.animation.show ? o.value.min : v.value.value);
105
+ M(() => v.value.value, () => {
106
+ $(v.value.value || 0);
107
+ });
108
+ const R = s(() => a.value > o.value.max ? o.value.max : a.value < o.value.min ? o.value.min : a.value), C = s(() => o.value.diff / e.value.style.animation.speedMs);
109
+ N(() => {
110
+ $(v.value.value || 0);
111
+ });
112
+ function $(t) {
113
+ function n() {
114
+ a.value < t ? a.value = Math.min(a.value + C.value, t) : a.value > t && (a.value = Math.max(a.value - C.value, t)), a.value !== t && requestAnimationFrame(n);
115
+ }
116
+ n();
117
+ }
118
+ const m = s(() => v.value.title ?? ""), L = s(() => {
119
+ const t = o.value.diff;
120
+ if (!isFinite(t) || t === 0) return 0;
121
+ const n = o.value.min, f = R.value;
122
+ return f >= 0 ? (f - n) / t : (Math.abs(n) - Math.abs(f)) / t;
123
+ }), S = s(() => W(e.value.style.colors.min, e.value.style.colors.max, o.value.min, o.value.max, a.value)), z = s(() => e.value.style.dataLabel.autoColor ? S.value : e.value.style.dataLabel.color), G = s(() => e.value.style.track.autoColor ? S.value : e.value.style.track.color);
124
+ return (t, n) => (u(), r("div", {
125
+ class: "vue-ui-sparkgauge",
126
+ style: g(`font-family:${e.value.style.fontFamily};width: 100%; background:${e.value.style.background}`)
127
+ }, [
128
+ e.value.style.title.show && m.value && e.value.style.title.position === "top" ? (u(), r("div", {
129
+ key: 0,
130
+ class: "vue-data-ui-sparkgauge-label",
131
+ style: g(`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}`)
132
+ }, k(m.value), 5)) : d("", !0),
133
+ (u(), r("svg", {
134
+ ref_key: "svgRef",
135
+ ref: I,
136
+ xmlns: i(Z),
137
+ viewBox: `0 0 ${l.value.width} ${l.value.height}`,
138
+ style: "overflow: visible; background:transparent; width:100%;"
139
+ }, [
140
+ q(i(O)),
141
+ t.$slots["chart-background"] && !i(h) ? (u(), r("foreignObject", {
142
+ key: 0,
143
+ x: 0,
144
+ y: 0,
145
+ width: l.value.width,
146
+ height: l.value.height,
147
+ style: {
148
+ pointerEvents: "none"
149
+ }
150
+ }, [
151
+ F(t.$slots, "chart-background")
152
+ ], 8, ue)) : d("", !0),
153
+ y("defs", null, [
154
+ y("linearGradient", {
155
+ id: `gradient_${_.value}`,
156
+ x1: "-10%",
157
+ y1: "100%",
158
+ x2: "110%",
159
+ y2: "100%"
160
+ }, [
161
+ y("stop", {
162
+ offset: "0%",
163
+ "stop-color": e.value.style.colors.min
164
+ }, null, 8, ne),
165
+ y("stop", {
166
+ offset: "100%",
167
+ "stop-color": e.value.style.colors.max
168
+ }, null, 8, re)
169
+ ], 8, ie)
170
+ ]),
171
+ y("path", {
172
+ d: `M10 ${l.value.base} A 1 1 0 1 1 118 ${l.value.base}`,
173
+ stroke: e.value.style.gutter.color,
174
+ "stroke-width": 8,
175
+ "stroke-linecap": e.value.style.gutter.strokeLinecap,
176
+ fill: "none"
177
+ }, null, 8, ve),
178
+ L.value !== 0 ? (u(), r("path", {
179
+ key: 1,
180
+ d: `M10 ${l.value.base} A 1 1 0 1 1 118 ${l.value.base}`,
181
+ stroke: e.value.style.colors.showGradient ? `url(#gradient_${_.value})` : G.value,
182
+ "stroke-width": 8,
183
+ "stroke-linecap": e.value.style.track.strokeLinecap,
184
+ fill: "none",
185
+ "stroke-dasharray": 169.5,
186
+ "stroke-dashoffset": 169.5 - 169.5 * L.value,
187
+ class: V({ "vue-ui-sparkgauge-track": e.value.style.animation.show }),
188
+ style: g(e.value.style.animation.show ? `animation: vue-ui-sparkgauge-animation ${e.value.style.animation.speedMs}ms ease-in;` : "")
189
+ }, null, 14, ce)) : d("", !0),
190
+ i(h) ? (u(), r("rect", {
191
+ key: 2,
192
+ x: l.value.width / 2 - e.value.style.dataLabel.fontSize / 2,
193
+ y: l.value.base + 6 + e.value.style.dataLabel.offsetY - e.value.style.dataLabel.fontSize,
194
+ width: e.value.style.dataLabel.fontSize,
195
+ height: e.value.style.dataLabel.fontSize,
196
+ fill: "#6A6A6A50",
197
+ rx: 3
198
+ }, null, 8, de)) : (u(), r("text", {
199
+ key: 3,
200
+ "text-anchor": "middle",
201
+ x: l.value.width / 2,
202
+ y: l.value.base + 6 + e.value.style.dataLabel.offsetY,
203
+ "font-size": e.value.style.dataLabel.fontSize,
204
+ fill: z.value,
205
+ "font-weight": e.value.style.dataLabel.bold ? "bold" : "normal"
206
+ }, k(i(ee)(
207
+ e.value.style.dataLabel.formatter,
208
+ i(x)(a.value),
209
+ i(te)({
210
+ p: e.value.style.dataLabel.prefix,
211
+ v: i(x)(a.value),
212
+ s: e.value.style.dataLabel.suffix,
213
+ r: e.value.style.dataLabel.rounding
214
+ }),
215
+ { datapoint: i(x)(a.value), color: z.value }
216
+ )), 9, fe))
217
+ ], 8, se)),
218
+ e.value.style.title.show && m.value && e.value.style.title.position === "bottom" ? (u(), r("div", {
219
+ key: 1,
220
+ class: "vue-data-ui-sparkgauge-label",
221
+ style: g(`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}`)
222
+ }, k(m.value), 5)) : d("", !0),
223
+ t.$slots.source ? (u(), r("div", ye, [
224
+ F(t.$slots, "source")
225
+ ], 512)) : d("", !0),
226
+ i(h) ? (u(), U(le, { key: 3 })) : d("", !0)
227
+ ], 4));
228
+ }
229
+ };
230
+ export {
231
+ ke as default
232
+ };
@@ -0,0 +1,380 @@
1
+ import { useCssVars as pe, computed as k, defineAsyncComponent as me, ref as y, toRefs as be, onMounted as U, watch as X, nextTick as j, createElementBlock as s, openBlock as a, normalizeStyle as S, createCommentVNode as c, createBlock as G, createElementVNode as g, createTextVNode as _e, toDisplayString as p, unref as n, createVNode as xe, renderSlot as q, Fragment as d, renderList as h, normalizeClass as Y } from "vue";
2
+ import { u as ke, c as Ce, t as Ae, b as we, o as $e, f as P, g as Le, s as m, k as J, i as K, X as ze, x as D } from "./index-Dzc2Gi60.js";
3
+ import { t as Se, u as Me } from "./useResponsive-DfdjqQps.js";
4
+ import { u as Fe, B as Ie } from "./useLoading-D7YHNtLX.js";
5
+ import { u as Te } from "./useFitSvgText-2crs6Fv5.js";
6
+ import { u as Q } from "./useNestedProp-CjnS13nF.js";
7
+ import { u as Ee } from "./useChartAccessibility-9icAAmYg.js";
8
+ import { _ as Ne } from "./Shape-Adi9i_-f.js";
9
+ import { _ as De } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
+ const We = { key: 0 }, Ve = { key: 1 }, He = ["xmlns", "viewBox"], Oe = ["width", "height"], Re = ["id"], Be = ["stop-color"], Ue = ["stop-color"], Xe = ["id"], je = ["stop-color"], Ge = ["stop-color"], qe = ["id"], Ye = ["stop-color"], Pe = ["stop-color"], Je = ["height", "width", "fill", "x", "stroke", "stroke-width", "rx", "stroke-dasharray"], Ke = { key: 1 }, Qe = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], Ze = { key: 2 }, et = ["x", "y", "font-size", "font-weight", "fill"], tt = ["x", "y", "font-size", "fill"], lt = ["x", "y", "font-size", "fill"], at = ["height", "width", "x", "onMouseover", "onMouseleave", "onClick"], st = {
11
+ __name: "vue-ui-sparkhistogram",
12
+ props: {
13
+ config: {
14
+ type: Object,
15
+ default() {
16
+ return {};
17
+ }
18
+ },
19
+ dataset: {
20
+ type: Array,
21
+ default() {
22
+ return [];
23
+ }
24
+ }
25
+ },
26
+ emits: ["selectDatapoint"],
27
+ setup(Z, { emit: ee }) {
28
+ pe((l) => ({
29
+ c8e2d1ee: ve.value
30
+ }));
31
+ const te = me(() => import("./PackageVersion-CD5VH_Al.js")), { vue_ui_sparkhistogram: le } = ke(), b = Z, _ = y(Ce()), W = y(null), V = y(null), M = y(null), C = y(null), w = y(null), e = y(T()), { loading: H, FINAL_DATASET: A } = Fe({
32
+ ...be(b),
33
+ FINAL_CONFIG: e,
34
+ prepareConfig: T,
35
+ skeletonDataset: [
36
+ { value: 1, intensity: 0.2, color: "#CACACA" },
37
+ { value: 2, intensity: 0.3, color: "#CACACA" },
38
+ { value: 3, intensity: 0.5, color: "#CACACA" },
39
+ { value: 5, intensity: 0.7, color: "#CACACA" },
40
+ { value: 8, intensity: 0.9, color: "#CACACA" },
41
+ { value: 13, intensity: 0.95, color: "#CACACA" },
42
+ { value: 21, intensity: 1, color: "#CACACA" },
43
+ { value: 13, intensity: 0.95, color: "#CACACA" },
44
+ { value: 8, intensity: 0.9, color: "#CACACA" },
45
+ { value: 5, intensity: 0.7, color: "#CACACA" },
46
+ { value: 3, intensity: 0.5, color: "#CACACA" },
47
+ { value: 2, intensity: 0.3, color: "#CACACA" },
48
+ { value: 1, intensity: 0.2, color: "#CACACA" }
49
+ ],
50
+ skeletonConfig: Ae({
51
+ defaultConfig: e.value,
52
+ userConfig: {
53
+ style: {
54
+ animation: { show: !1 },
55
+ backgroundColor: "#99999930"
56
+ }
57
+ }
58
+ })
59
+ }), F = y(e.value.style.layout.width), I = y(e.value.style.layout.height), { svgRef: O } = Ee({ config: e.value.style.title });
60
+ function T() {
61
+ const l = Q({
62
+ userConfig: b.config,
63
+ defaultConfig: le
64
+ });
65
+ return l.theme ? {
66
+ ...Q({
67
+ userConfig: we.vue_ui_sparkhistogram[l.theme] || b.config,
68
+ defaultConfig: l
69
+ })
70
+ } : l;
71
+ }
72
+ U(() => {
73
+ B();
74
+ });
75
+ const R = k(() => !!e.value.debug);
76
+ function B() {
77
+ if ($e(b.dataset) ? P({
78
+ componentName: "VueUiSparkHistogram",
79
+ type: "dataset",
80
+ debug: R.value
81
+ }) : b.dataset.forEach((l, o) => {
82
+ Le({
83
+ datasetObject: l,
84
+ requiredAttributes: ["value"]
85
+ }).forEach((t) => {
86
+ P({
87
+ componentName: "VueUiSparkHistogram",
88
+ type: "datasetSerieAttribute",
89
+ property: t,
90
+ index: o,
91
+ debug: R.value
92
+ });
93
+ });
94
+ }), e.value.responsive) {
95
+ const l = Se(() => {
96
+ const { width: o, height: t } = Me({
97
+ chart: M.value,
98
+ title: e.value.style.title.text ? V.value : null,
99
+ source: W.value
100
+ });
101
+ requestAnimationFrame(() => {
102
+ F.value = Math.max(10, o), I.value = Math.max(10, t - 12);
103
+ });
104
+ });
105
+ C.value && (w.value && C.value.unobserve(w.value), C.value.disconnect()), C.value = new ResizeObserver(l), w.value = M.value.parentNode, C.value.observe(w.value);
106
+ }
107
+ }
108
+ X(() => b.config, (l) => {
109
+ e.value = T(), B();
110
+ }, { deep: !0 });
111
+ const v = k(() => {
112
+ const l = I.value, o = F.value, t = e.value.style.layout.padding.top, i = l - e.value.style.layout.padding.bottom, f = e.value.style.layout.padding.left, $ = o - e.value.style.layout.padding.right, L = t + (l - t - e.value.style.layout.padding.bottom) / 2, E = l - e.value.style.layout.padding.top - e.value.style.layout.padding.bottom, z = o - e.value.style.layout.padding.left - e.value.style.layout.padding.right;
113
+ return {
114
+ bottom: i,
115
+ centerY: L,
116
+ drawingHeight: E,
117
+ drawingWidth: z,
118
+ height: l,
119
+ left: f,
120
+ right: $,
121
+ top: t,
122
+ width: o
123
+ };
124
+ }), ae = k(() => Math.max(...A.value.map((l) => Math.abs(l.value || 0))));
125
+ function se(l) {
126
+ return Math.abs(l) / ae.value;
127
+ }
128
+ const u = k(() => A.value.map((l, o) => {
129
+ const t = se(l.value || 0), i = v.value.drawingHeight * t, f = v.value.drawingWidth / A.value.length, $ = f * (e.value.style.bars.gap / 100), L = f - $, E = v.value.centerY - i / 2, z = v.value.left + ($ / 2 + o * f), de = v.value.left + o * f, N = typeof l.intensity > "u" ? 100 : Math.round(l.intensity * 100), ye = l.color ? l.color : l.value >= 0 ? m(e.value.style.bars.colors.positive, N) : m(e.value.style.bars.colors.negative, N), he = l.color ? l.color : l.value >= 0 ? e.value.style.bars.colors.positive : e.value.style.bars.colors.negative, fe = l.color ? `url(#gradient_datapoint_${o}_${_.value})` : l.value >= 0 ? `url(#gradient_positive_${o}_${_.value})` : `url(#gradient_negative_${o}_${_.value})`, ge = z + L / 2;
130
+ return {
131
+ ...l,
132
+ color: ye,
133
+ gradient: fe,
134
+ height: i,
135
+ intensity: N,
136
+ proportion: t,
137
+ stroke: he,
138
+ textAnchor: ge,
139
+ trapX: de,
140
+ unitWidth: f,
141
+ width: L,
142
+ x: z,
143
+ y: E
144
+ };
145
+ }));
146
+ function oe(l, o) {
147
+ return J(
148
+ e.value.style.labels.value.formatter,
149
+ l.value,
150
+ K({
151
+ p: e.value.style.labels.value.prefix,
152
+ v: l.value,
153
+ s: e.value.style.labels.value.suffix,
154
+ r: e.value.style.labels.value.rounding
155
+ }),
156
+ { datapoint: l, seriesIndex: o }
157
+ );
158
+ }
159
+ const r = y(null), ie = ee;
160
+ function ue(l, o) {
161
+ ie("selectDatapoint", { datapoint: l, index: o }), e.value.events.datapointClick && e.value.events.datapointClick({ datapoint: l, seriesIndex: o });
162
+ }
163
+ function ne(l, o) {
164
+ r.value = o, e.value.events.datapointEnter && e.value.events.datapointEnter({ datapoint: l, seriesIndex: o });
165
+ }
166
+ function re(l, o) {
167
+ r.value = null, e.value.events.datapointLeave && e.value.events.datapointLeave({ datapoint: l, seriesIndex: o });
168
+ }
169
+ const ve = k(() => `${e.value.style.animation.speedMs}ms`), ce = k(() => v.value.drawingWidth / A.value.length * 0.9), { fitText: x } = Te({
170
+ svgRef: O,
171
+ unitWidth: ce
172
+ });
173
+ return U(async () => {
174
+ await j(), x(".vue-ui-sparkhistogram-top-label", e.value.style.labels.value.minFontSize), x(".vue-ui-sparkhistogram-bottom-label", e.value.style.labels.valueLabel.minFontSize), x(".vue-ui-sparkhistogram-time-label", e.value.style.labels.timeLabel.minFontSize);
175
+ }), X([F, I, () => A.value], async () => {
176
+ await j(), x(".vue-ui-sparkhistogram-top-label", e.value.style.labels.value.minFontSize), x(".vue-ui-sparkhistogram-bottom-label", e.value.style.labels.valueLabel.minFontSize), x(".vue-ui-sparkhistogram-time-label", e.value.style.labels.timeLabel.minFontSize);
177
+ }), (l, o) => (a(), s("div", {
178
+ class: "vue-ui-spark-histogram",
179
+ ref_key: "histogramChart",
180
+ ref: M,
181
+ style: S(`width:100%;background:${e.value.style.backgroundColor};font-family:${e.value.style.fontFamily}`),
182
+ onMouseleave: o[0] || (o[0] = (t) => r.value = null)
183
+ }, [
184
+ e.value.style.title.text ? (a(), s("div", {
185
+ key: 0,
186
+ ref_key: "chartTitle",
187
+ ref: V,
188
+ style: S(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${e.value.style.title.margin};padding: 0 6px;text-align:${e.value.style.title.textAlign}`)
189
+ }, [
190
+ g("div", {
191
+ style: S(`font-size:${e.value.style.title.fontSize}px;color:${e.value.style.title.color};font-weight:${e.value.style.title.bold ? "bold" : "normal"}`)
192
+ }, [
193
+ _e(p(e.value.style.title.text) + " ", 1),
194
+ r.value !== null ? (a(), s("span", We, "- " + p(u.value[r.value].timeLabel || "") + " " + p(n(J)(
195
+ e.value.style.labels.value.formatter,
196
+ u.value[r.value].value,
197
+ n(K)({
198
+ p: e.value.style.labels.value.prefix,
199
+ v: u.value[r.value].value,
200
+ s: e.value.style.labels.value.suffix,
201
+ r: e.value.style.labels.value.rounding
202
+ }),
203
+ { datapoint: u.value[r.value], seriesIndex: r.value }
204
+ )), 1)) : c("", !0),
205
+ ![void 0, null].includes(r.value) && ![null, void 0].includes(u.value[r.value].valueLabel) ? (a(), s("span", Ve, "(" + p(u.value[r.value].valueLabel || 0) + ")", 1)) : c("", !0)
206
+ ], 4),
207
+ e.value.style.title.subtitle.text ? (a(), s("div", {
208
+ key: 0,
209
+ style: S(`font-size:${e.value.style.title.subtitle.fontSize}px;color:${e.value.style.title.subtitle.color};font-weight:${e.value.style.title.subtitle.bold ? "bold" : "normal"}`)
210
+ }, p(e.value.style.title.subtitle.text), 5)) : c("", !0)
211
+ ], 4)) : c("", !0),
212
+ (a(), s("svg", {
213
+ ref_key: "svgRef",
214
+ ref: O,
215
+ xmlns: n(ze),
216
+ viewBox: `0 0 ${v.value.width} ${v.value.height}`,
217
+ style: { overflow: "visible" }
218
+ }, [
219
+ xe(n(te)),
220
+ l.$slots["chart-background"] ? (a(), s("foreignObject", {
221
+ key: 0,
222
+ x: 0,
223
+ y: 0,
224
+ width: v.value.width,
225
+ height: v.value.height,
226
+ style: {
227
+ pointerEvents: "none"
228
+ }
229
+ }, [
230
+ q(l.$slots, "chart-background", {}, void 0, !0)
231
+ ], 8, Oe)) : c("", !0),
232
+ g("defs", null, [
233
+ (a(!0), s(d, null, h(u.value, (t, i) => (a(), s("radialGradient", {
234
+ id: `gradient_positive_${i}_${_.value}`,
235
+ cy: "50%",
236
+ cx: "50%",
237
+ r: "50%",
238
+ fx: "50%",
239
+ fy: "50%"
240
+ }, [
241
+ g("stop", {
242
+ offset: "0%",
243
+ "stop-color": n(m)(n(D)(e.value.style.bars.colors.positive, 0.05), t.intensity)
244
+ }, null, 8, Be),
245
+ g("stop", {
246
+ offset: "100%",
247
+ "stop-color": n(m)(e.value.style.bars.colors.positive, t.intensity)
248
+ }, null, 8, Ue)
249
+ ], 8, Re))), 256)),
250
+ (a(!0), s(d, null, h(u.value, (t, i) => (a(), s("radialGradient", {
251
+ id: `gradient_negative_${i}_${_.value}`,
252
+ cy: "50%",
253
+ cx: "50%",
254
+ r: "50%",
255
+ fx: "50%",
256
+ fy: "50%"
257
+ }, [
258
+ g("stop", {
259
+ offset: "0%",
260
+ "stop-color": n(m)(n(D)(e.value.style.bars.colors.negative, 0.05), t.intensity)
261
+ }, null, 8, je),
262
+ g("stop", {
263
+ offset: "100%",
264
+ "stop-color": n(m)(e.value.style.bars.colors.negative, t.intensity)
265
+ }, null, 8, Ge)
266
+ ], 8, Xe))), 256)),
267
+ (a(!0), s(d, null, h(u.value, (t, i) => (a(), s("radialGradient", {
268
+ id: `gradient_datapoint_${i}_${_.value}`,
269
+ cy: "50%",
270
+ cx: "50%",
271
+ r: "50%",
272
+ fx: "50%",
273
+ fy: "50%"
274
+ }, [
275
+ g("stop", {
276
+ offset: "0%",
277
+ "stop-color": n(m)(n(D)(t.color, 0.05), t.intensity)
278
+ }, null, 8, Ye),
279
+ g("stop", {
280
+ offset: "100%",
281
+ "stop-color": n(m)(t.color, t.intensity)
282
+ }, null, 8, Pe)
283
+ ], 8, qe))), 256))
284
+ ]),
285
+ (a(!0), s(d, null, h(u.value, (t, i) => (a(), s("g", null, [
286
+ r.value !== null && r.value === i ? (a(), s("rect", {
287
+ key: 0,
288
+ height: v.value.height,
289
+ width: t.unitWidth,
290
+ fill: e.value.style.selector.fill,
291
+ x: t.trapX,
292
+ y: 0,
293
+ stroke: e.value.style.selector.stroke,
294
+ "stroke-width": e.value.style.selector.strokeWidth,
295
+ rx: e.value.style.selector.borderRadius,
296
+ "stroke-dasharray": e.value.style.selector.strokeDasharray
297
+ }, null, 8, Je)) : c("", !0)
298
+ ]))), 256)),
299
+ !e.value.style.bars.shape || e.value.style.bars.shape === "square" ? (a(), s("g", Ke, [
300
+ (a(!0), s(d, null, h(u.value, (t, i) => (a(), s("rect", {
301
+ x: t.x,
302
+ y: t.y,
303
+ height: t.height,
304
+ width: t.width,
305
+ fill: e.value.style.bars.colors.gradient.show ? t.gradient : t.color,
306
+ stroke: t.stroke,
307
+ "stroke-width": e.value.style.bars.strokeWidth,
308
+ rx: `${e.value.style.bars.borderRadius * t.proportion / 12}%`,
309
+ class: Y({ "vue-ui-sparkhistogram-shape": e.value.style.animation.show })
310
+ }, null, 10, Qe))), 256))
311
+ ])) : (a(), s("g", Ze, [
312
+ (a(!0), s(d, null, h(u.value, (t, i) => (a(), G(Ne, {
313
+ plot: { x: t.x + t.width / 2, y: t.y + t.height / 2 },
314
+ color: e.value.style.bars.colors.gradient.show ? t.gradient : t.color,
315
+ shape: e.value.style.bars.shape,
316
+ radius: Math.min(t.height * 0.4, t.width * 0.4),
317
+ class: Y({ "vue-ui-sparkhistogram-shape": e.value.style.animation.show })
318
+ }, null, 8, ["plot", "color", "shape", "radius", "class"]))), 256))
319
+ ])),
320
+ n(H) ? c("", !0) : (a(), s(d, { key: 3 }, [
321
+ (a(!0), s(d, null, h(u.value, (t, i) => (a(), s("text", {
322
+ class: "vue-ui-sparkhistogram-top-label",
323
+ "text-anchor": "middle",
324
+ x: t.textAnchor,
325
+ y: t.y - e.value.style.labels.value.fontSize / 3 + e.value.style.labels.value.offsetY,
326
+ "font-size": e.value.style.labels.value.fontSize,
327
+ "font-weight": e.value.style.labels.value.bold ? "bold" : "normal",
328
+ fill: e.value.style.labels.value.color
329
+ }, p(oe(t, i)), 9, et))), 256)),
330
+ (a(!0), s(d, null, h(u.value, (t, i) => (a(), s("g", null, [
331
+ t.valueLabel ? (a(), s("text", {
332
+ key: 0,
333
+ class: "vue-ui-sparkhistogram-bottom-label",
334
+ x: t.textAnchor,
335
+ y: t.y + t.height + e.value.style.labels.valueLabel.fontSize,
336
+ "font-size": e.value.style.labels.valueLabel.fontSize,
337
+ "text-anchor": "middle",
338
+ fill: e.value.style.labels.valueLabel.color
339
+ }, p(t.valueLabel), 9, tt)) : c("", !0)
340
+ ]))), 256)),
341
+ (a(!0), s(d, null, h(u.value, (t, i) => (a(), s("g", null, [
342
+ t.timeLabel ? (a(), s("text", {
343
+ key: 0,
344
+ class: "vue-ui-sparkhistogram-time-label",
345
+ x: t.textAnchor,
346
+ y: v.value.height - e.value.style.labels.timeLabel.fontSize / 2,
347
+ "font-size": e.value.style.labels.timeLabel.fontSize,
348
+ fill: e.value.style.labels.timeLabel.color,
349
+ "text-anchor": "middle"
350
+ }, p(t.timeLabel), 9, lt)) : c("", !0)
351
+ ]))), 256))
352
+ ], 64)),
353
+ (a(!0), s(d, null, h(u.value, (t, i) => (a(), s("g", null, [
354
+ g("rect", {
355
+ height: v.value.height,
356
+ width: t.unitWidth,
357
+ fill: "transparent",
358
+ x: t.trapX,
359
+ y: 0,
360
+ onMouseover: (f) => ne(t, i),
361
+ onMouseleave: (f) => re(t, i),
362
+ onClick: () => ue(t, i)
363
+ }, null, 40, at)
364
+ ]))), 256))
365
+ ], 8, He)),
366
+ l.$slots.source ? (a(), s("div", {
367
+ key: 1,
368
+ ref_key: "source",
369
+ ref: W,
370
+ dir: "auto"
371
+ }, [
372
+ q(l.$slots, "source", {}, void 0, !0)
373
+ ], 512)) : c("", !0),
374
+ n(H) ? (a(), G(Ie, { key: 2 })) : c("", !0)
375
+ ], 36));
376
+ }
377
+ }, ht = /* @__PURE__ */ De(st, [["__scopeId", "data-v-f8e879db"]]);
378
+ export {
379
+ ht as default
380
+ };