vue-data-ui 3.0.0-next.6 → 3.0.0-next.61

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 (126) hide show
  1. package/dist/{Arrow-Ul64M9UV.js → Arrow-CTQyTL3_.js} +1 -1
  2. package/dist/{BaseDraggableDialog-Q2ajCztp.js → BaseDraggableDialog-BmcSbNWl.js} +2 -2
  3. package/dist/{BaseIcon-BKR7AGeP.js → BaseIcon-E-K7hXbm.js} +1 -1
  4. package/dist/{ColorPicker-BagIs8-K.js → ColorPicker-BZSE2TU-.js} +2 -2
  5. package/dist/{DataTable-CDwApkI_.js → DataTable-B5DjuhMR.js} +2 -2
  6. package/dist/{Legend-BSLj7tYc.js → Legend-zE2FGq08.js} +2 -2
  7. package/dist/{NonSvgPenAndPaper-DjJe5fXu.js → NonSvgPenAndPaper-DI_RgDTc.js} +3 -3
  8. package/dist/{PackageVersion-BsKpz6KS.js → PackageVersion-Bdp5L-7L.js} +1 -1
  9. package/dist/{PenAndPaper-BYRk8xrS.js → PenAndPaper-AGK10PP8.js} +3 -3
  10. package/dist/{Shape-DK7zYTKa.js → Shape-WLqGGUwB.js} +43 -37
  11. package/dist/Slicer-BztBbYcP.js +602 -0
  12. package/dist/{SparkTooltip-Dy2sVTb_.js → SparkTooltip-DJJKq5GE.js} +1 -1
  13. package/dist/{Title-Cednydse.js → Title-C6NLfPnz.js} +1 -1
  14. package/dist/{Tooltip-DJlwW-XP.js → Tooltip-p-yn5Kd2.js} +23 -19
  15. package/dist/{UserOptions-DxIzWere.js → UserOptions-DWW9T1IK.js} +2 -2
  16. package/dist/{dom-to-png-lZcM-YfK.js → dom-to-png-4P9Z65Z4.js} +1 -1
  17. package/dist/{img-DqlIAUF6.js → img-fg88maiR.js} +1 -1
  18. package/dist/{index-BQcLOx39.js → index-BRenDuve.js} +1732 -1135
  19. package/dist/{pdf-CjIXhsyg.js → pdf-BuhR1JTC.js} +1 -1
  20. package/dist/style.css +1 -1
  21. package/dist/types/vue-data-ui.d.cts +493 -21
  22. package/dist/types/vue-data-ui.d.ts +493 -21
  23. package/dist/useAutoSizeLabelsInsideViewbox-BkBqjBrr.js +41 -0
  24. package/dist/useNestedProp-iKx-oGDH.js +13 -0
  25. package/dist/usePanZoom-BVca3eMk.js +122 -0
  26. package/dist/{usePrinter-BRY5saEA.js → usePrinter-Co_j432s.js} +2 -2
  27. package/dist/useTimeLabelCollider-CIsgDrl9.js +78 -0
  28. package/dist/{useTimeLabels-Mrr0jrpL.js → useTimeLabels-DkzmKfZn.js} +211 -152
  29. package/dist/{vue-data-ui-CWRlSsiN.js → vue-data-ui-CUDfDclz.js} +105 -100
  30. package/dist/vue-data-ui.js +23 -22
  31. package/dist/vue-ui-3d-bar-DWL8tnZS.js +1323 -0
  32. package/dist/{vue-ui-accordion-Df-5BRRg.js → vue-ui-accordion-CYDiGhBw.js} +3 -3
  33. package/dist/vue-ui-age-pyramid-d31eHPpI.js +834 -0
  34. package/dist/{vue-ui-annotator-BxC5dcIv.js → vue-ui-annotator-dkOqfvKt.js} +2 -2
  35. package/dist/vue-ui-bullet-D4tBc3eh.js +571 -0
  36. package/dist/vue-ui-candlestick-GoQ4LBVC.js +999 -0
  37. package/dist/{vue-ui-carousel-table-NTDzafWQ.js → vue-ui-carousel-table-Bp3MJfzX.js} +29 -29
  38. package/dist/{vue-ui-chestnut-k21Qqjjq.js → vue-ui-chestnut-D3fzDYcV.js} +5 -5
  39. package/dist/{vue-ui-chord-BVoA6nfI.js → vue-ui-chord-CntRIJ55.js} +8 -8
  40. package/dist/{vue-ui-circle-pack-CEBgImRX.js → vue-ui-circle-pack-BMuynHUs.js} +24 -24
  41. package/dist/{vue-ui-cursor-BQcz8xw2.js → vue-ui-cursor-KR7TU5mQ.js} +2 -2
  42. package/dist/{vue-ui-dashboard-CyzEpJoI.js → vue-ui-dashboard-C6OQIu4w.js} +62 -62
  43. package/dist/{vue-ui-digits-Dafw1UsT.js → vue-ui-digits-6KV8lh1Q.js} +2 -2
  44. package/dist/{vue-ui-donut-DKfux8XT.js → vue-ui-donut-Dg0b9Sag.js} +320 -308
  45. package/dist/vue-ui-donut-evolution-BqDGpZwn.js +1075 -0
  46. package/dist/vue-ui-dumbbell-BvTH-vpa.js +1119 -0
  47. package/dist/vue-ui-flow-DY0brMkH.js +841 -0
  48. package/dist/{vue-ui-funnel-CuN8HWwP.js → vue-ui-funnel-Z2nxFAoy.js} +16 -16
  49. package/dist/{vue-ui-galaxy-BHCLFlmy.js → vue-ui-galaxy-Dho2szS3.js} +60 -58
  50. package/dist/vue-ui-gauge-0FV4JwS3.js +791 -0
  51. package/dist/{vue-ui-gizmo-DHEEfdp9.js → vue-ui-gizmo-CxuU2BQY.js} +3 -3
  52. package/dist/vue-ui-heatmap-FFmRSZ9u.js +1078 -0
  53. package/dist/vue-ui-history-plot-CUH155Yu.js +1073 -0
  54. package/dist/{vue-ui-kpi-C4i2w_Yd.js → vue-ui-kpi-Dmpm_ZZb.js} +7 -7
  55. package/dist/{vue-ui-mini-loader-BeetGv_m.js → vue-ui-mini-loader-DPsQQimr.js} +2 -2
  56. package/dist/{vue-ui-molecule-F_gDXjJr.js → vue-ui-molecule-BNSTyoBk.js} +53 -51
  57. package/dist/{vue-ui-mood-radar-BJMOEqlu.js → vue-ui-mood-radar-Db-qlLKm.js} +15 -15
  58. package/dist/vue-ui-nested-donuts-BMECUS7j.js +1286 -0
  59. package/dist/vue-ui-onion-CARHtDjI.js +776 -0
  60. package/dist/vue-ui-parallel-coordinate-plot-C7pL6x10.js +915 -0
  61. package/dist/{vue-ui-quadrant-DTyRC1_v.js → vue-ui-quadrant-BdtVr-y2.js} +59 -57
  62. package/dist/vue-ui-quick-chart-D7uobNWx.js +1761 -0
  63. package/dist/{vue-ui-radar-De2iznwo.js → vue-ui-radar-VoD-Lot7.js} +30 -28
  64. package/dist/{vue-ui-rating-CarXXyD-.js → vue-ui-rating-DZ89nAiD.js} +2 -2
  65. package/dist/{vue-ui-relation-circle-CKkK9D4E.js → vue-ui-relation-circle-B2z8YXgB.js} +6 -6
  66. package/dist/vue-ui-ridgeline-DfFSJ747.js +1153 -0
  67. package/dist/vue-ui-rings-Dyt5QafW.js +728 -0
  68. package/dist/vue-ui-scatter-BFFRDlp-.js +1178 -0
  69. package/dist/{vue-ui-skeleton-C7maR60-.js → vue-ui-skeleton-DU2RLC8J.js} +3 -3
  70. package/dist/{vue-ui-smiley-DzCCn5Oc.js → vue-ui-smiley-Bud0unLv.js} +26 -26
  71. package/dist/{vue-ui-spark-trend-Db-Fnp8C.js → vue-ui-spark-trend-BD6UWRMn.js} +3 -3
  72. package/dist/vue-ui-sparkbar-I4wpToMO.js +351 -0
  73. package/dist/{vue-ui-sparkgauge-DAQ4zozy.js → vue-ui-sparkgauge-Dih6jl_u.js} +3 -3
  74. package/dist/vue-ui-sparkhistogram-DBJcd-6V.js +444 -0
  75. package/dist/vue-ui-sparkline-B64MPZBB.js +489 -0
  76. package/dist/vue-ui-sparkstackbar-CtdHM2gY.js +421 -0
  77. package/dist/vue-ui-stackbar-Bee1NxIb.js +1370 -0
  78. package/dist/vue-ui-strip-plot-CmC5Byn1.js +915 -0
  79. package/dist/{vue-ui-table-Dck8Pyg9.js → vue-ui-table-DyScQo_p.js} +11 -11
  80. package/dist/{vue-ui-table-heatmap-DknIGf9_.js → vue-ui-table-heatmap-DLtEbgnG.js} +5 -5
  81. package/dist/{vue-ui-table-sparkline-G4HAzUt6.js → vue-ui-table-sparkline-CSOSu5lF.js} +14 -14
  82. package/dist/vue-ui-thermometer-DvWCyvgp.js +541 -0
  83. package/dist/{vue-ui-timer-Dmr-HCSc.js → vue-ui-timer-DIe7TbGV.js} +5 -5
  84. package/dist/vue-ui-tiremarks-DFAFKdig.js +406 -0
  85. package/dist/vue-ui-treemap-Car9RQI6.js +1035 -0
  86. package/dist/{vue-ui-vertical-bar--QFtoFje.js → vue-ui-vertical-bar-I05hhnAv.js} +318 -302
  87. package/dist/vue-ui-waffle-DyY-UYli.js +910 -0
  88. package/dist/vue-ui-wheel-Bb4GPN1q.js +379 -0
  89. package/dist/vue-ui-word-cloud-8Xl-ixz8.js +765 -0
  90. package/dist/{vue-ui-world-BcK_brDq.js → vue-ui-world-DpgHCDon.js} +11 -9
  91. package/dist/vue-ui-xy-B5GeHpC1.js +3760 -0
  92. package/dist/{vue-ui-xy-canvas--88oKdGN.js → vue-ui-xy-canvas-CJpbS5qD.js} +265 -264
  93. package/package.json +1 -1
  94. package/dist/Slicer-B_Hb6qSk.js +0 -577
  95. package/dist/useNestedProp-DefBVltl.js +0 -13
  96. package/dist/usePanZoom-BQMvRXEQ.js +0 -115
  97. package/dist/vue-ui-3d-bar-CJMZqDo1.js +0 -1227
  98. package/dist/vue-ui-age-pyramid-B6WAMtPk.js +0 -746
  99. package/dist/vue-ui-bullet-NmtltFbU.js +0 -513
  100. package/dist/vue-ui-candlestick-BzqQtynP.js +0 -873
  101. package/dist/vue-ui-donut-evolution-D7cNk_6l.js +0 -903
  102. package/dist/vue-ui-dumbbell--H80zebk.js +0 -753
  103. package/dist/vue-ui-flow-lk_HU5NB.js +0 -765
  104. package/dist/vue-ui-gauge-DWlCh2_B.js +0 -738
  105. package/dist/vue-ui-heatmap-BK6BNOY_.js +0 -877
  106. package/dist/vue-ui-history-plot-CGF6lE-7.js +0 -924
  107. package/dist/vue-ui-nested-donuts-BX0Z0rb1.js +0 -1177
  108. package/dist/vue-ui-onion-BhjUET_W.js +0 -701
  109. package/dist/vue-ui-parallel-coordinate-plot-n7QPVLrW.js +0 -807
  110. package/dist/vue-ui-quick-chart-5xX-yBIY.js +0 -1612
  111. package/dist/vue-ui-ridgeline-DQ8RQf3E.js +0 -969
  112. package/dist/vue-ui-rings-Cze6OsmO.js +0 -685
  113. package/dist/vue-ui-scatter-CwI3_Dn7.js +0 -1045
  114. package/dist/vue-ui-sparkbar-C6wsNMMO.js +0 -301
  115. package/dist/vue-ui-sparkhistogram-CMEaO0CW.js +0 -313
  116. package/dist/vue-ui-sparkline-R7pfxRWN.js +0 -459
  117. package/dist/vue-ui-sparkstackbar-DV_XqJQ2.js +0 -381
  118. package/dist/vue-ui-stackbar-gReSujA_.js +0 -1207
  119. package/dist/vue-ui-strip-plot-8fsm3nn2.js +0 -761
  120. package/dist/vue-ui-thermometer-BIkXa4hY.js +0 -495
  121. package/dist/vue-ui-tiremarks-YWbRk0dm.js +0 -358
  122. package/dist/vue-ui-treemap-D2OnG3Fh.js +0 -965
  123. package/dist/vue-ui-waffle-BdaCXuWc.js +0 -863
  124. package/dist/vue-ui-wheel-Bw3XSa8N.js +0 -352
  125. package/dist/vue-ui-word-cloud-BH8UZH_J.js +0 -659
  126. package/dist/vue-ui-xy-Be--zwe9.js +0 -2980
@@ -1,301 +0,0 @@
1
- import { defineAsyncComponent as V, useSlots as R, onMounted as z, computed as g, ref as k, watch as L, nextTick as Y, createElementBlock as c, openBlock as u, normalizeStyle as p, unref as o, renderSlot as _, createCommentVNode as v, createBlock as Z, normalizeProps as ee, mergeProps as O, createElementVNode as d, toDisplayString as f, Fragment as T, renderList as te, createVNode as le } from "vue";
2
- import { u as ae, c as oe, t as se, p as x, a as ne, b as ue, o as re, e as E, g as ie, d as ce, s as $, i as b, f as w, X as ve, w as de } from "./index-BQcLOx39.js";
3
- import { u as B } from "./useNestedProp-DefBVltl.js";
4
- const pe = ["onClick"], fe = { key: 1 }, ye = ["xmlns", "viewBox"], me = ["id"], ge = ["stop-color"], he = ["stop-color"], ke = ["height", "width", "fill", "rx"], xe = ["height", "width", "fill", "rx"], be = ["height", "width", "fill", "rx"], we = {
5
- key: 2,
6
- ref: "source",
7
- dir: "auto"
8
- }, Se = {
9
- __name: "vue-ui-sparkbar",
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
- * Used in VueUiRadar's tooltip exclusively
25
- */
26
- backgroundOpacity: {
27
- type: Number,
28
- default: null
29
- }
30
- },
31
- emits: ["selectDatapoint"],
32
- setup(C, { emit: M }) {
33
- const U = V(() => import("./PackageVersion-BsKpz6KS.js")), j = V(() => import("./vue-ui-skeleton-C7maR60-.js")), { vue_ui_sparkbar: G } = ae(), a = C, W = R();
34
- z(() => {
35
- W["chart-background"] && console.warn("VueUiSparkbar does not support the #chart-background slot.");
36
- });
37
- const S = g(() => !!a.dataset && a.dataset.length), A = k(oe()), e = g({
38
- get: () => N(),
39
- set: (t) => t
40
- });
41
- function N() {
42
- const t = B({
43
- userConfig: a.config,
44
- defaultConfig: G
45
- });
46
- return t.theme ? {
47
- ...B({
48
- userConfig: ne.vue_ui_sparkbar[t.theme] || a.config,
49
- defaultConfig: t
50
- }),
51
- customPalette: se[t.theme] || x
52
- } : t;
53
- }
54
- L(() => a.config, (t) => {
55
- e.value = N();
56
- }, { deep: !0 });
57
- const q = g(() => ue(e.value.customPalette)), y = k(a.dataset.map((t) => ({
58
- ...t,
59
- value: e.value.style.animation.show ? 0 : t.value || 0,
60
- formatter: t.formatter || null
61
- }))), D = k(null);
62
- z(async () => {
63
- re(a.dataset) && E({
64
- componentName: "VueUiSparkbar",
65
- type: "dataset"
66
- }), F();
67
- });
68
- function F() {
69
- if (e.value.style.animation.show) {
70
- let P = function() {
71
- i += l / t, i < l ? (y.value = y.value.map((n, h) => ({
72
- ...n,
73
- value: n.value += s[h]
74
- })), D.value = requestAnimationFrame(P)) : y.value = a.dataset.map((n) => ({
75
- ...n,
76
- value: n.value || 0,
77
- formatter: n.formatter || null
78
- }));
79
- };
80
- const t = e.value.style.animation.animationFrames, s = a.dataset.map((n, h) => n.value / t), l = a.dataset.map((n) => n.value || 0).reduce((n, h) => n + h, 0);
81
- let i = 0;
82
- P();
83
- }
84
- }
85
- L(() => a.dataset, async (t) => {
86
- cancelAnimationFrame(D.value), y.value = a.dataset.map((s) => ({
87
- ...s,
88
- value: e.value.style.animation.show ? 0 : s.value || 0,
89
- formatter: s.formatter || null
90
- })), Y(F);
91
- }, { deep: !0 });
92
- const r = k({
93
- width: 500,
94
- height: 16
95
- }), H = g(() => Math.max(...a.dataset.map((t) => t.value))), X = g(() => (a.dataset.forEach((t, s) => {
96
- ie({
97
- datasetObject: t,
98
- requiredAttributes: ["name", "value"]
99
- }).forEach((l) => {
100
- E({
101
- componentName: "VueUiSparkbar",
102
- type: "datasetSerieAttribute",
103
- property: l,
104
- index: s
105
- });
106
- });
107
- }), y.value.map((t, s) => ({
108
- ...t,
109
- value: t.value || 0,
110
- color: ce(t.color) || q.value[s] || x[s] || x[s % x.length]
111
- }))));
112
- function J(t) {
113
- return t / H.value;
114
- }
115
- function I(t) {
116
- 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 : J(t.value);
117
- }
118
- function m(t) {
119
- return e.value.style.layout.independant && t.target || e.value.style.layout.target;
120
- }
121
- const K = M;
122
- function Q(t, s) {
123
- K("selectDatapoint", { datapoint: t, index: s });
124
- }
125
- return (t, s) => (u(), c("div", {
126
- class: "vue-ui-sparkbar",
127
- style: p({
128
- width: "100%",
129
- fontFamily: e.value.style.fontFamily,
130
- background: a.backgroundOpacity !== null ? o($)(e.value.style.backgroundColor, a.backgroundOpacity) : e.value.style.backgroundColor
131
- })
132
- }, [
133
- t.$slots.title ? _(t.$slots, "title", ee(O({ key: 0 }, { title: { ...t.title, title: e.value.style.title.text, subtitle: e.value.style.title.subtitle.text } }))) : v("", !0),
134
- !t.$slots.title && e.value.style.title.text ? (u(), c("div", {
135
- key: 1,
136
- class: "vue-ui-sparkbar-title-container",
137
- style: p({
138
- background: e.value.style.title.backgroundColor,
139
- margin: e.value.style.title.margin,
140
- textAlign: e.value.style.title.textAlign
141
- })
142
- }, [
143
- d("div", {
144
- class: "vue-ui-sparkbar-title",
145
- style: p({
146
- fontSize: e.value.style.title.fontSize + "px",
147
- color: e.value.style.title.color,
148
- fontWeight: e.value.style.title.bold ? "bold" : "normal"
149
- })
150
- }, f(e.value.style.title.text), 5),
151
- e.value.style.title.subtitle.text ? (u(), c("div", {
152
- key: 0,
153
- class: "vue-ui-sparkbar-subtitle",
154
- style: p({
155
- fontSize: e.value.style.title.subtitle.fontSize + "px",
156
- color: e.value.style.title.subtitle.color,
157
- fontWeight: e.value.style.title.subtitle.bold ? "bold" : "normal"
158
- })
159
- }, f(e.value.style.title.subtitle.text), 5)) : v("", !0)
160
- ], 4)) : v("", !0),
161
- (u(!0), c(T, null, te(X.value, (l, i) => (u(), c(T, null, [
162
- S.value ? (u(), c("div", {
163
- key: 0,
164
- style: p(`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;${C.dataset.length > 0 && i !== C.dataset.length - 1 ? "margin-bottom:6px" : ""}`),
165
- onClick: () => Q(l, i)
166
- }, [
167
- _(t.$slots, "data-label", O({ ref_for: !0 }, { bar: {
168
- ...l,
169
- target: m(l),
170
- valueLabel: o(b)(
171
- l.formatter,
172
- l.value,
173
- o(w)({
174
- p: l.prefix || "",
175
- v: l.value,
176
- s: l.suffix || "",
177
- r: l.rounding || 0
178
- }),
179
- { datapoint: l, seriesIndex: i }
180
- ),
181
- targetLabel: o(b)(
182
- l.formatter,
183
- m(l),
184
- o(w)({
185
- p: l.prefix || "",
186
- v: m(l),
187
- s: l.suffix || "",
188
- r: l.rounding || 0
189
- }),
190
- { datapoint: l, seriesIndex: i }
191
- )
192
- } })),
193
- t.$slots["data-label"] ? v("", !0) : (u(), c("div", {
194
- key: 0,
195
- style: p({
196
- width: e.value.style.labels.name.width,
197
- color: e.value.style.labels.name.color,
198
- fontSize: e.value.style.labels.fontSize + "px",
199
- fontWeight: e.value.style.labels.name.bold ? "bold" : "normal",
200
- textAlign: ["left", "right"].includes(e.value.style.labels.name.position) || ["top", "top-left"].includes(e.value.style.labels.name.position) ? "left" : e.value.style.labels.name.position === "top-center" ? "center" : "right"
201
- })
202
- }, [
203
- d("span", null, f(l.name), 1),
204
- e.value.style.labels.value.show ? (u(), c("span", {
205
- key: 0,
206
- style: p(`font-weight:${e.value.style.labels.value.bold ? "bold" : "normal"}`)
207
- }, ": " + f(o(b)(
208
- l.formatter,
209
- l.value,
210
- o(w)({
211
- p: l.prefix || "",
212
- v: l.value,
213
- s: l.suffix || "",
214
- r: l.rounding || 0
215
- }),
216
- { datapoint: l, seriesIndex: i }
217
- )), 5)) : v("", !0),
218
- e.value.style.layout.showTargetValue ? (u(), c("span", fe, f(" " + e.value.style.layout.targetValueText) + " " + f(o(b)(
219
- l.formatter,
220
- m(l),
221
- o(w)({
222
- p: l.prefix || "",
223
- v: m(l),
224
- s: l.suffix || "",
225
- r: l.rounding || 0
226
- }),
227
- { datapoint: l, seriesIndex: i }
228
- )), 1)) : v("", !0)
229
- ], 4)),
230
- (u(), c("svg", {
231
- xmlns: o(ve),
232
- viewBox: `0 0 ${r.value.width} ${r.value.height}`,
233
- width: "100%"
234
- }, [
235
- le(o(U)),
236
- d("defs", null, [
237
- d("linearGradient", {
238
- x1: "0%",
239
- y1: "0%",
240
- x2: "100%",
241
- y2: "0%",
242
- id: `sparkbar_gradient_${i}_${A.value}`
243
- }, [
244
- d("stop", {
245
- offset: "0%",
246
- "stop-color": o($)(o(de)(l.color, 0.03), 100 - e.value.style.bar.gradient.intensity)
247
- }, null, 8, ge),
248
- d("stop", {
249
- offset: "100%",
250
- "stop-color": l.color
251
- }, null, 8, he)
252
- ], 8, me)
253
- ]),
254
- d("rect", {
255
- height: r.value.height,
256
- width: r.value.width,
257
- x: 0,
258
- y: 0,
259
- fill: o($)(e.value.style.gutter.backgroundColor, e.value.style.gutter.opacity),
260
- rx: r.value.height / 2
261
- }, null, 8, ke),
262
- d("rect", {
263
- height: r.value.height,
264
- width: r.value.width * I(l),
265
- x: 0,
266
- y: 0,
267
- fill: e.value.style.bar.gradient.underlayerColor,
268
- rx: r.value.height / 2
269
- }, null, 8, xe),
270
- d("rect", {
271
- height: r.value.height,
272
- width: r.value.width * I(l),
273
- x: 0,
274
- y: 0,
275
- fill: e.value.style.bar.gradient.show ? `url(#sparkbar_gradient_${i}_${A.value})` : l.color,
276
- rx: r.value.height / 2
277
- }, null, 8, be)
278
- ], 8, ye))
279
- ], 12, pe)) : v("", !0)
280
- ], 64))), 256)),
281
- t.$slots.source ? (u(), c("div", we, [
282
- _(t.$slots, "source")
283
- ], 512)) : v("", !0),
284
- S.value ? v("", !0) : (u(), Z(o(j), {
285
- key: 3,
286
- config: {
287
- type: "sparkbar",
288
- style: {
289
- backgroundColor: e.value.style.backgroundColor,
290
- sparkbar: {
291
- color: "#CCCCCC"
292
- }
293
- }
294
- }
295
- }, null, 8, ["config"]))
296
- ], 4));
297
- }
298
- };
299
- export {
300
- Se as default
301
- };
@@ -1,313 +0,0 @@
1
- import { useCssVars as le, computed as _, defineAsyncComponent as N, onMounted as ae, ref as D, watch as se, createElementBlock as s, openBlock as a, normalizeStyle as $, createCommentVNode as c, createBlock as V, createElementVNode as h, createTextVNode as oe, toDisplayString as p, unref as n, createVNode as ie, renderSlot as I, Fragment as f, renderList as g, normalizeClass as E } from "vue";
2
- import { u as ue, o as re, e as H, g as ne, c as ve, a as de, s as b, i as F, f as O, X as ce, w as z } from "./index-BQcLOx39.js";
3
- import { u as W } from "./useNestedProp-DefBVltl.js";
4
- import { u as ye } from "./useChartAccessibility-9icAAmYg.js";
5
- import { _ as he } from "./Shape-DK7zYTKa.js";
6
- import { _ as fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
- const ge = { key: 0 }, pe = { key: 1 }, be = ["xmlns", "viewBox"], me = ["width", "height"], _e = ["id"], xe = ["stop-color"], ke = ["stop-color"], we = ["id"], $e = ["stop-color"], Ce = ["stop-color"], Le = ["id"], ze = ["stop-color"], Se = ["stop-color"], Ae = { key: 1 }, Me = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], Ne = { key: 2 }, De = ["x", "y", "font-size", "font-weight", "fill"], Ve = ["x", "y", "font-size", "fill"], Ie = ["x", "y", "font-size", "fill"], Ee = ["height", "width", "x", "onMouseover", "stroke", "stroke-width", "rx", "stroke-dasharray", "onClick"], He = {
8
- key: 2,
9
- ref: "source",
10
- dir: "auto"
11
- }, Fe = {
12
- __name: "vue-ui-sparkhistogram",
13
- props: {
14
- config: {
15
- type: Object,
16
- default() {
17
- return {};
18
- }
19
- },
20
- dataset: {
21
- type: Array,
22
- default() {
23
- return [];
24
- }
25
- }
26
- },
27
- emits: ["selectDatapoint"],
28
- setup(B, { emit: U }) {
29
- le((l) => ({
30
- "2d6ebc7a": J.value
31
- }));
32
- const j = N(() => import("./PackageVersion-BsKpz6KS.js")), R = N(() => import("./vue-ui-skeleton-C7maR60-.js")), { vue_ui_sparkhistogram: X } = ue(), d = B, S = _(() => !!d.dataset && d.dataset.length);
33
- ae(() => {
34
- A();
35
- });
36
- function A() {
37
- re(d.dataset) ? H({
38
- componentName: "VueUiSparkHistogram",
39
- type: "dataset"
40
- }) : d.dataset.forEach((l, u) => {
41
- ne({
42
- datasetObject: l,
43
- requiredAttributes: ["value"]
44
- }).forEach((t) => {
45
- H({
46
- componentName: "VueUiSparkHistogram",
47
- type: "datasetSerieAttribute",
48
- property: t,
49
- index: u
50
- });
51
- });
52
- });
53
- }
54
- const m = D(ve()), e = _({
55
- get: () => M(),
56
- set: (l) => l
57
- }), { svgRef: G } = ye({ config: e.value.style.title });
58
- function M() {
59
- const l = W({
60
- userConfig: d.config,
61
- defaultConfig: X
62
- });
63
- return l.theme ? {
64
- ...W({
65
- userConfig: de.vue_ui_sparkhistogram[l.theme] || d.config,
66
- defaultConfig: l
67
- })
68
- } : l;
69
- }
70
- se(() => d.config, (l) => {
71
- e.value = M(), A();
72
- }, { deep: !0 });
73
- const v = _(() => {
74
- const l = e.value.style.layout.height, u = e.value.style.layout.width, t = e.value.style.layout.padding.top, o = l - e.value.style.layout.padding.bottom, y = e.value.style.layout.padding.left, x = u - e.value.style.layout.padding.right, k = t + (l - t - e.value.style.layout.padding.bottom) / 2, C = l - e.value.style.layout.padding.top - e.value.style.layout.padding.bottom, w = u - e.value.style.layout.padding.left - e.value.style.layout.padding.right;
75
- return {
76
- bottom: o,
77
- centerY: k,
78
- drawingHeight: C,
79
- drawingWidth: w,
80
- height: l,
81
- left: y,
82
- right: x,
83
- top: t,
84
- width: u
85
- };
86
- }), Y = _(() => Math.max(...d.dataset.map((l) => Math.abs(l.value || 0))));
87
- function q(l) {
88
- return Math.abs(l) / Y.value;
89
- }
90
- const r = _(() => d.dataset.map((l, u) => {
91
- const t = q(l.value || 0), o = v.value.drawingHeight * t, y = v.value.drawingWidth / d.dataset.length, x = y * (e.value.style.bars.gap / 100), k = y - x, C = v.value.centerY - o / 2, w = v.value.left + (x / 2 + u * y), K = v.value.left + u * y, L = typeof l.intensity > "u" ? 100 : Math.round(l.intensity * 100), Q = l.color ? l.color : l.value >= 0 ? b(e.value.style.bars.colors.positive, L) : b(e.value.style.bars.colors.negative, L), Z = l.color ? l.color : l.value >= 0 ? e.value.style.bars.colors.positive : e.value.style.bars.colors.negative, ee = l.color ? `url(#gradient_datapoint_${u}_${m.value})` : l.value >= 0 ? `url(#gradient_positive_${u}_${m.value})` : `url(#gradient_negative_${u}_${m.value})`, te = w + k / 2;
92
- return {
93
- ...l,
94
- color: Q,
95
- gradient: ee,
96
- height: o,
97
- intensity: L,
98
- proportion: t,
99
- stroke: Z,
100
- textAnchor: te,
101
- trapX: K,
102
- unitWidth: y,
103
- width: k,
104
- x: w,
105
- y: C
106
- };
107
- })), i = D(null), P = U;
108
- function T(l, u) {
109
- P("selectDatapoint", { datapoint: l, index: u });
110
- }
111
- const J = _(() => `${e.value.style.animation.speedMs}ms`);
112
- return (l, u) => (a(), s("div", {
113
- class: "vue-ui-spark-histogram",
114
- style: $(`width:100%;background:${e.value.style.backgroundColor};font-family:${e.value.style.fontFamily}`),
115
- onMouseleave: u[1] || (u[1] = (t) => i.value = null)
116
- }, [
117
- e.value.style.title.text ? (a(), s("div", {
118
- key: 0,
119
- style: $(`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}`)
120
- }, [
121
- h("div", {
122
- style: $(`font-size:${e.value.style.title.fontSize}px;color:${e.value.style.title.color};font-weight:${e.value.style.title.bold ? "bold" : "normal"}`)
123
- }, [
124
- oe(p(e.value.style.title.text) + " ", 1),
125
- i.value !== null ? (a(), s("span", ge, "- " + p(r.value[i.value].timeLabel || "") + " " + p(n(F)(
126
- e.value.style.labels.value.formatter,
127
- r.value[i.value].value,
128
- n(O)({
129
- p: e.value.style.labels.value.prefix,
130
- v: r.value[i.value].value,
131
- s: e.value.style.labels.value.suffix,
132
- r: e.value.style.labels.value.rounding
133
- }),
134
- { datapoint: r.value[i.value], seriesIndex: i.value }
135
- )), 1)) : c("", !0),
136
- ![void 0, null].includes(i.value) && ![null, void 0].includes(r.value[i.value].valueLabel) ? (a(), s("span", pe, "(" + p(r.value[i.value].valueLabel || 0) + ")", 1)) : c("", !0)
137
- ], 4),
138
- e.value.style.title.subtitle.text ? (a(), s("div", {
139
- key: 0,
140
- style: $(`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"}`)
141
- }, p(e.value.style.title.subtitle.text), 5)) : c("", !0)
142
- ], 4)) : c("", !0),
143
- S.value ? (a(), s("svg", {
144
- key: 1,
145
- ref_key: "svgRef",
146
- ref: G,
147
- xmlns: n(ce),
148
- viewBox: `0 0 ${v.value.width} ${v.value.height}`,
149
- style: { overflow: "visible" }
150
- }, [
151
- ie(n(j)),
152
- l.$slots["chart-background"] ? (a(), s("foreignObject", {
153
- key: 0,
154
- x: 0,
155
- y: 0,
156
- width: v.value.width,
157
- height: v.value.height,
158
- style: {
159
- pointerEvents: "none"
160
- }
161
- }, [
162
- I(l.$slots, "chart-background", {}, void 0, !0)
163
- ], 8, me)) : c("", !0),
164
- h("defs", null, [
165
- (a(!0), s(f, null, g(r.value, (t, o) => (a(), s("radialGradient", {
166
- id: `gradient_positive_${o}_${m.value}`,
167
- cy: "50%",
168
- cx: "50%",
169
- r: "50%",
170
- fx: "50%",
171
- fy: "50%"
172
- }, [
173
- h("stop", {
174
- offset: "0%",
175
- "stop-color": n(b)(n(z)(e.value.style.bars.colors.positive, 0.05), t.intensity)
176
- }, null, 8, xe),
177
- h("stop", {
178
- offset: "100%",
179
- "stop-color": n(b)(e.value.style.bars.colors.positive, t.intensity)
180
- }, null, 8, ke)
181
- ], 8, _e))), 256)),
182
- (a(!0), s(f, null, g(r.value, (t, o) => (a(), s("radialGradient", {
183
- id: `gradient_negative_${o}_${m.value}`,
184
- cy: "50%",
185
- cx: "50%",
186
- r: "50%",
187
- fx: "50%",
188
- fy: "50%"
189
- }, [
190
- h("stop", {
191
- offset: "0%",
192
- "stop-color": n(b)(n(z)(e.value.style.bars.colors.negative, 0.05), t.intensity)
193
- }, null, 8, $e),
194
- h("stop", {
195
- offset: "100%",
196
- "stop-color": n(b)(e.value.style.bars.colors.negative, t.intensity)
197
- }, null, 8, Ce)
198
- ], 8, we))), 256)),
199
- (a(!0), s(f, null, g(r.value, (t, o) => (a(), s("radialGradient", {
200
- id: `gradient_datapoint_${o}_${m.value}`,
201
- cy: "50%",
202
- cx: "50%",
203
- r: "50%",
204
- fx: "50%",
205
- fy: "50%"
206
- }, [
207
- h("stop", {
208
- offset: "0%",
209
- "stop-color": n(b)(n(z)(t.color, 0.05), t.intensity)
210
- }, null, 8, ze),
211
- h("stop", {
212
- offset: "100%",
213
- "stop-color": n(b)(t.color, t.intensity)
214
- }, null, 8, Se)
215
- ], 8, Le))), 256))
216
- ]),
217
- !e.value.style.bars.shape || e.value.style.bars.shape === "square" ? (a(), s("g", Ae, [
218
- (a(!0), s(f, null, g(r.value, (t, o) => (a(), s("rect", {
219
- x: t.x,
220
- y: t.y,
221
- height: t.height,
222
- width: t.width,
223
- fill: e.value.style.bars.colors.gradient.show ? t.gradient : t.color,
224
- stroke: t.stroke,
225
- "stroke-width": e.value.style.bars.strokeWidth,
226
- rx: `${e.value.style.bars.borderRadius * t.proportion / 12}%`,
227
- class: E({ "vue-ui-sparkhistogram-shape": e.value.style.animation.show })
228
- }, null, 10, Me))), 256))
229
- ])) : (a(), s("g", Ne, [
230
- (a(!0), s(f, null, g(r.value, (t, o) => (a(), V(he, {
231
- plot: { x: t.x + t.width / 2, y: t.y + t.height / 2 },
232
- color: e.value.style.bars.colors.gradient.show ? t.gradient : t.color,
233
- shape: e.value.style.bars.shape,
234
- radius: t.height * 0.4,
235
- class: E({ "vue-ui-sparkhistogram-shape": e.value.style.animation.show })
236
- }, null, 8, ["plot", "color", "shape", "radius", "class"]))), 256))
237
- ])),
238
- (a(!0), s(f, null, g(r.value, (t, o) => (a(), s("text", {
239
- "text-anchor": "middle",
240
- x: t.textAnchor,
241
- y: t.y - e.value.style.labels.value.fontSize / 3 + e.value.style.labels.value.offsetY,
242
- "font-size": e.value.style.labels.value.fontSize,
243
- "font-weight": e.value.style.labels.value.bold ? "bold" : "normal",
244
- fill: e.value.style.labels.value.color
245
- }, p(n(F)(
246
- e.value.style.labels.value.formatter,
247
- t.value,
248
- n(O)({
249
- p: e.value.style.labels.value.prefix,
250
- v: t.value,
251
- s: e.value.style.labels.value.suffix,
252
- r: e.value.style.labels.value.rounding
253
- }),
254
- { datapoint: r.value[i.value], seriesIndex: i.value }
255
- )), 9, De))), 256)),
256
- (a(!0), s(f, null, g(r.value, (t, o) => (a(), s("g", null, [
257
- t.valueLabel ? (a(), s("text", {
258
- key: 0,
259
- x: t.textAnchor,
260
- y: t.y + t.height + e.value.style.labels.valueLabel.fontSize,
261
- "font-size": e.value.style.labels.valueLabel.fontSize,
262
- "text-anchor": "middle",
263
- fill: e.value.style.labels.valueLabel.color
264
- }, p(t.valueLabel), 9, Ve)) : c("", !0)
265
- ]))), 256)),
266
- (a(!0), s(f, null, g(r.value, (t, o) => (a(), s("g", null, [
267
- t.timeLabel ? (a(), s("text", {
268
- key: 0,
269
- x: t.textAnchor,
270
- y: v.value.height - e.value.style.labels.timeLabel.fontSize / 2,
271
- "font-size": e.value.style.labels.timeLabel.fontSize,
272
- fill: e.value.style.labels.timeLabel.color,
273
- "text-anchor": "middle"
274
- }, p(t.timeLabel), 9, Ie)) : c("", !0)
275
- ]))), 256)),
276
- (a(!0), s(f, null, g(r.value, (t, o) => (a(), s("g", null, [
277
- h("rect", {
278
- height: v.value.height,
279
- width: t.unitWidth,
280
- fill: "transparent",
281
- x: t.trapX,
282
- y: 0,
283
- onMouseover: (y) => i.value = o,
284
- onMouseleave: u[0] || (u[0] = (y) => i.value = null),
285
- stroke: i.value !== null && i.value === o ? e.value.style.selector.stroke : "",
286
- "stroke-width": i.value !== null && i.value === o ? e.value.style.selector.strokeWidth : 0,
287
- rx: e.value.style.selector.borderRadius,
288
- "stroke-dasharray": e.value.style.selector.strokeDasharray,
289
- onClick: () => T(t, o)
290
- }, null, 40, Ee)
291
- ]))), 256))
292
- ], 8, be)) : c("", !0),
293
- l.$slots.source ? (a(), s("div", He, [
294
- I(l.$slots, "source", {}, void 0, !0)
295
- ], 512)) : c("", !0),
296
- S.value ? c("", !0) : (a(), V(n(R), {
297
- key: 3,
298
- config: {
299
- type: "sparkHistogram",
300
- style: {
301
- backgroundColor: e.value.style.backgroundColor,
302
- sparkHistogram: {
303
- color: "#CCCCCC"
304
- }
305
- }
306
- }
307
- }, null, 8, ["config"]))
308
- ], 36));
309
- }
310
- }, Xe = /* @__PURE__ */ fe(Fe, [["__scopeId", "data-v-4d2045fb"]]);
311
- export {
312
- Xe as default
313
- };