vue-data-ui 2.2.92 → 2.2.94
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.
- package/dist/index-DZlxUin4.js +57288 -0
- package/dist/{index.es-Dc9Fd4o6.js → index.es-Cgqo-FBk.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/vue-data-ui.js +61 -455
- package/package.json +1 -1
- package/dist/data-table-d-VcuH-r.js +0 -1488
- package/dist/legend-DJCYLsl_.js +0 -61
- package/dist/themes-lgjsYHsH.js +0 -4967
- package/dist/title-BF-9Qcni.js +0 -56
- package/dist/tooltip-D85WEOKi.js +0 -94
- package/dist/user-options-DZgCz8UA.js +0 -415
- package/dist/vue-ui-3d-bar-DW7kGJSz.js +0 -20360
- package/dist/vue-ui-age-pyramid-4hcuKpFY.js +0 -781
- package/dist/vue-ui-annotator-C83FVvl8.js +0 -2175
- package/dist/vue-ui-candlestick-diclGj95.js +0 -807
- package/dist/vue-ui-chestnut-ACetHLdG.js +0 -1049
- package/dist/vue-ui-cursor-Rx7UNaYT.js +0 -229
- package/dist/vue-ui-dashboard-B3PlN0ks.js +0 -231
- package/dist/vue-ui-digits-CxMXID42.js +0 -154
- package/dist/vue-ui-donut-DMiwVXNd.js +0 -1534
- package/dist/vue-ui-dumbbell-B_X1T8TR.js +0 -621
- package/dist/vue-ui-flow-B72wzQ6V.js +0 -451
- package/dist/vue-ui-galaxy-DXX5yivT.js +0 -482
- package/dist/vue-ui-gauge-Cs9PDurH.js +0 -466
- package/dist/vue-ui-heatmap-PcoNSLdN.js +0 -581
- package/dist/vue-ui-kpi-DchEmPtB.js +0 -55
- package/dist/vue-ui-mini-loader-DltJLkqy.js +0 -131
- package/dist/vue-ui-molecule-CWvukBzs.js +0 -746
- package/dist/vue-ui-mood-radar-DEfdtIi8.js +0 -544
- package/dist/vue-ui-nested-donuts-9URpqgXE.js +0 -768
- package/dist/vue-ui-onion-C0eowUT6.js +0 -551
- package/dist/vue-ui-parallel-coordinate-plot-Bc_pAaPJ.js +0 -647
- package/dist/vue-ui-quadrant-_ddVAm9V.js +0 -1174
- package/dist/vue-ui-quick-chart-Cio0hDYO.js +0 -1310
- package/dist/vue-ui-radar-Dyg38i33.js +0 -853
- package/dist/vue-ui-rating-CE1Lmwd2.js +0 -271
- package/dist/vue-ui-relation-circle-BMlB3k3d.js +0 -303
- package/dist/vue-ui-rings-BuXeijvb.js +0 -507
- package/dist/vue-ui-scatter-B1hZfOua.js +0 -870
- package/dist/vue-ui-screenshot-0QXgxzGs.js +0 -160
- package/dist/vue-ui-smiley-B7kR7exr.js +0 -763
- package/dist/vue-ui-spark-trend-BmL2KiYL.js +0 -245
- package/dist/vue-ui-sparkgauge-BMzFv14L.js +0 -158
- package/dist/vue-ui-sparkhistogram-DWpOXqHm.js +0 -243
- package/dist/vue-ui-sparkstackbar-DB9VQXlc.js +0 -244
- package/dist/vue-ui-strip-plot-DyN6P0JO.js +0 -614
- package/dist/vue-ui-table-DM3zL89q.js +0 -2180
- package/dist/vue-ui-table-heatmap-gWx0Nslu.js +0 -237
- package/dist/vue-ui-thermometer-Bcqv5kd_.js +0 -384
- package/dist/vue-ui-timer-BIFxjujK.js +0 -451
- package/dist/vue-ui-tiremarks-zBwHpED_.js +0 -248
- package/dist/vue-ui-treemap-BaplVc_z.js +0 -719
- package/dist/vue-ui-vertical-bar-CdK6ZJPM.js +0 -734
- package/dist/vue-ui-waffle-COOzH7M3.js +0 -635
- package/dist/vue-ui-wheel-BEpuVTBk.js +0 -226
- package/dist/vue-ui-word-cloud-DNqxAAiX.js +0 -344
- package/dist/vue-ui-xy-_mHq-czW.js +0 -2058
- package/dist/vue-ui-xy-canvas-DqX8Gee5.js +0 -1003
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import { computed as u, ref as p, onMounted as W, openBlock as n, createElementBlock as i, normalizeStyle as j, createBlock as w, unref as c, createElementVNode as g, createCommentVNode as v, toDisplayString as A } from "vue";
|
|
2
|
-
import { _ as X, e as Z, i as Q, j as R, Q as H, X as J, o as z, N as B, B as N, n as I } from "./data-table-d-VcuH-r.js";
|
|
3
|
-
import { t as K } from "./themes-lgjsYHsH.js";
|
|
4
|
-
import { u as E } from "./title-BF-9Qcni.js";
|
|
5
|
-
import { u as Y, S as ee } from "./vue-ui-3d-bar-DW7kGJSz.js";
|
|
6
|
-
const te = ["id"], le = ["xmlns", "viewBox"], ae = ["id"], ne = ["stop-color"], oe = ["stop-color"], se = { key: 0 }, ue = ["d", "fill"], re = ["d", "fill"], ie = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"], de = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"], ve = ["height", "width", "x"], ce = { style: { width: "100%" } }, he = ["x", "y", "fill", "font-size", "font-weight"], ye = ["stroke", "cx", "cy", "fill"], fe = ["x", "y", "font-size", "fill", "font-weight"], pe = {
|
|
7
|
-
__name: "vue-ui-spark-trend",
|
|
8
|
-
props: {
|
|
9
|
-
config: {
|
|
10
|
-
type: Object,
|
|
11
|
-
default() {
|
|
12
|
-
return {};
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
dataset: {
|
|
16
|
-
type: Array,
|
|
17
|
-
default() {
|
|
18
|
-
return [];
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
setup(V) {
|
|
23
|
-
const s = V, { vue_ui_spark_trend: D } = Y(), G = u(() => !!s.dataset && s.dataset.length), m = p(Z()), e = u(() => {
|
|
24
|
-
const t = E({
|
|
25
|
-
userConfig: s.config,
|
|
26
|
-
defaultConfig: D
|
|
27
|
-
});
|
|
28
|
-
return t.theme ? {
|
|
29
|
-
...E({
|
|
30
|
-
userConfig: K.vue_ui_spark_trend[t.theme] || s.config,
|
|
31
|
-
defaultConfig: t
|
|
32
|
-
})
|
|
33
|
-
} : t;
|
|
34
|
-
});
|
|
35
|
-
function C(t) {
|
|
36
|
-
return t.map((o) => [void 0].includes(o) ? null : o);
|
|
37
|
-
}
|
|
38
|
-
const k = p(s.dataset.map((t) => e.value.style.animation.show || [void 0].includes(t) ? null : t)), f = p(!1), L = p(null);
|
|
39
|
-
W(() => {
|
|
40
|
-
Q(s.dataset) && R({
|
|
41
|
-
componentName: "VueUiTrendPill",
|
|
42
|
-
type: "dataset"
|
|
43
|
-
});
|
|
44
|
-
let o = 1e3 / e.value.style.animation.animationFrames, d = performance.now();
|
|
45
|
-
if (e.value.style.animation.show && e.value.style.animation.animationFrames && s.dataset.length > 1) {
|
|
46
|
-
let T = function() {
|
|
47
|
-
f.value = !0;
|
|
48
|
-
let S = performance.now(), F = S - d;
|
|
49
|
-
F > o ? (d = S - F % o, y < s.dataset.length ? (k.value.push(s.dataset[y]), y += 1, L.value = requestAnimationFrame(T)) : (cancelAnimationFrame(L.value), k.value = C(s.dataset), f.value = !1)) : L.value = requestAnimationFrame(T);
|
|
50
|
-
};
|
|
51
|
-
k.value = [];
|
|
52
|
-
let y = 0;
|
|
53
|
-
T();
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
const a = p({
|
|
57
|
-
height: 80,
|
|
58
|
-
width: 300
|
|
59
|
-
}), h = u(() => ({
|
|
60
|
-
top: e.value.style.padding.top,
|
|
61
|
-
left: e.value.style.padding.left,
|
|
62
|
-
right: a.value.width - e.value.style.padding.right,
|
|
63
|
-
bottom: a.value.height - e.value.style.padding.bottom,
|
|
64
|
-
height: a.value.height - (e.value.style.padding.top + e.value.style.padding.bottom) - (e.value.style.dataLabel.show ? e.value.style.dataLabel.fontSize : 0),
|
|
65
|
-
width: a.value.width - (e.value.style.padding.left + e.value.style.padding.right)
|
|
66
|
-
})), $ = u(() => {
|
|
67
|
-
const t = C(s.dataset);
|
|
68
|
-
return {
|
|
69
|
-
max: Math.max(...t),
|
|
70
|
-
min: Math.min(...t)
|
|
71
|
-
};
|
|
72
|
-
}), _ = u(() => {
|
|
73
|
-
const t = $.value.min >= 0 ? 0 : $.value.min;
|
|
74
|
-
return Math.abs(t);
|
|
75
|
-
}), O = u(() => $.value.max + _.value);
|
|
76
|
-
function M(t) {
|
|
77
|
-
return t / O.value;
|
|
78
|
-
}
|
|
79
|
-
const U = u(() => s.dataset.length), l = u(() => k.value.map((t, o) => {
|
|
80
|
-
const d = isNaN(t) || [void 0, null, "NaN", NaN, 1 / 0, -1 / 0].includes(t) ? 0 : t || 0;
|
|
81
|
-
return {
|
|
82
|
-
value: t,
|
|
83
|
-
absoluteValue: d,
|
|
84
|
-
plotValue: d + _.value,
|
|
85
|
-
toMax: M(d + _.value),
|
|
86
|
-
x: h.value.left + o * (h.value.width / (U.value - 1)) - e.value.style.padding.right,
|
|
87
|
-
y: h.value.bottom - h.value.height * M(d + _.value)
|
|
88
|
-
};
|
|
89
|
-
})), b = u(() => {
|
|
90
|
-
const t = C(s.dataset);
|
|
91
|
-
return e.value.style.trendLabel.trendType === "global" ? H(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;
|
|
92
|
-
}), x = u(() => f.value || b.value === 0 ? "neutral" : b.value > 0 ? "positive" : "negative"), r = u(() => e.value.style.arrow.colors[x.value]), P = u(() => {
|
|
93
|
-
const t = { x: l.value[0].x, y: a.value.height - 6 }, o = { x: l.value[l.value.length - 1].x, y: a.value.height - 6 }, d = [];
|
|
94
|
-
return l.value.forEach((y) => {
|
|
95
|
-
d.push(`${y.x},${y.y} `);
|
|
96
|
-
}), [t.x, t.y, ...d, o.x, o.y].toString();
|
|
97
|
-
}), q = u(() => {
|
|
98
|
-
let t = [];
|
|
99
|
-
return l.value.forEach((o) => {
|
|
100
|
-
t.push(`${o.x},${o.y} `);
|
|
101
|
-
}), `M ${t.toString()}`;
|
|
102
|
-
});
|
|
103
|
-
return (t, o) => (n(), i("div", {
|
|
104
|
-
class: "vue-ui-spark-trend",
|
|
105
|
-
id: m.value,
|
|
106
|
-
style: j(`width:100%;font-family:${e.value.style.fontFamily};backgroundColor:${e.value.style.backgroundColor}`)
|
|
107
|
-
}, [
|
|
108
|
-
G.value ? (n(), i("svg", {
|
|
109
|
-
key: 1,
|
|
110
|
-
xmlns: c(J),
|
|
111
|
-
viewBox: `0 0 ${a.value.width} ${a.value.height}`,
|
|
112
|
-
style: j(`width:100%;background:${e.value.style.backgroundColor};overflow:visible`)
|
|
113
|
-
}, [
|
|
114
|
-
g("defs", null, [
|
|
115
|
-
g("linearGradient", {
|
|
116
|
-
x1: "0%",
|
|
117
|
-
y1: "0%",
|
|
118
|
-
x2: "0%",
|
|
119
|
-
y2: "100%",
|
|
120
|
-
id: `pill_gradient_${m.value}`
|
|
121
|
-
}, [
|
|
122
|
-
g("stop", {
|
|
123
|
-
offset: "0%",
|
|
124
|
-
"stop-color": (e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke) + c(z)[e.value.style.area.opacity]
|
|
125
|
-
}, null, 8, ne),
|
|
126
|
-
g("stop", {
|
|
127
|
-
offset: "100%",
|
|
128
|
-
"stop-color": e.value.style.backgroundColor
|
|
129
|
-
}, null, 8, oe)
|
|
130
|
-
], 8, ae)
|
|
131
|
-
]),
|
|
132
|
-
e.value.style.area.show && l.value[0] ? (n(), i("g", se, [
|
|
133
|
-
e.value.style.line.smooth ? (n(), i("path", {
|
|
134
|
-
key: 0,
|
|
135
|
-
d: `M ${l.value[0].x},${h.value.bottom} ${c(B)(l.value)} L ${l.value.at(-1).x},${h.value.bottom} Z`,
|
|
136
|
-
fill: e.value.style.area.useGradient ? `url(#pill_gradient_${m.value})` : `${e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke}${c(z)[e.value.style.area.opacity]}`,
|
|
137
|
-
stroke: "none"
|
|
138
|
-
}, null, 8, ue)) : (n(), i("path", {
|
|
139
|
-
key: 1,
|
|
140
|
-
d: `M${P.value}Z`,
|
|
141
|
-
fill: e.value.style.area.useGradient ? `url(#pill_gradient_${m.value})` : `${e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke}${c(z)[e.value.style.area.opacity]}`,
|
|
142
|
-
stroke: "none"
|
|
143
|
-
}, null, 8, re))
|
|
144
|
-
])) : v("", !0),
|
|
145
|
-
e.value.style.line.smooth && l.value.length ? (n(), i("path", {
|
|
146
|
-
key: 1,
|
|
147
|
-
d: `M ${c(B)(l.value)}`,
|
|
148
|
-
stroke: e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke,
|
|
149
|
-
fill: "none",
|
|
150
|
-
"stroke-width": e.value.style.line.strokeWidth,
|
|
151
|
-
"stroke-linecap": e.value.style.line.strokeLinecap,
|
|
152
|
-
"stroke-linejoin": e.value.style.line.strokeLinejoin
|
|
153
|
-
}, null, 8, ie)) : v("", !0),
|
|
154
|
-
!e.value.style.line.smooth && l.value.length ? (n(), i("path", {
|
|
155
|
-
key: 2,
|
|
156
|
-
d: q.value,
|
|
157
|
-
stroke: e.value.style.line.useColorTrend ? r.value : e.value.style.line.stroke,
|
|
158
|
-
fill: "none",
|
|
159
|
-
"stroke-width": e.value.style.line.strokeWidth,
|
|
160
|
-
"stroke-linecap": e.value.style.line.strokeLinecap,
|
|
161
|
-
"stroke-linejoin": e.value.style.line.strokeLinejoin
|
|
162
|
-
}, null, 8, de)) : v("", !0),
|
|
163
|
-
f.value ? v("", !0) : (n(), i("foreignObject", {
|
|
164
|
-
key: 3,
|
|
165
|
-
height: a.value.height / 2,
|
|
166
|
-
width: a.value.height / 2,
|
|
167
|
-
x: a.value.height / 5,
|
|
168
|
-
y: 8
|
|
169
|
-
}, [
|
|
170
|
-
g("div", ce, [
|
|
171
|
-
x.value === "positive" ? (n(), w(N, {
|
|
172
|
-
key: 0,
|
|
173
|
-
stroke: r.value,
|
|
174
|
-
name: "arrowTop",
|
|
175
|
-
size: a.value.height / 2
|
|
176
|
-
}, null, 8, ["stroke", "size"])) : v("", !0),
|
|
177
|
-
x.value === "negative" ? (n(), w(N, {
|
|
178
|
-
key: 1,
|
|
179
|
-
stroke: r.value,
|
|
180
|
-
name: "arrowBottom",
|
|
181
|
-
size: a.value.height / 2
|
|
182
|
-
}, null, 8, ["stroke", "size"])) : v("", !0),
|
|
183
|
-
x.value === "neutral" ? (n(), w(N, {
|
|
184
|
-
key: 2,
|
|
185
|
-
stroke: r.value,
|
|
186
|
-
name: "arrowRight",
|
|
187
|
-
size: a.value.height / 2
|
|
188
|
-
}, null, 8, ["stroke", "size"])) : v("", !0)
|
|
189
|
-
])
|
|
190
|
-
], 8, ve)),
|
|
191
|
-
f.value ? v("", !0) : (n(), i("text", {
|
|
192
|
-
key: 4,
|
|
193
|
-
x: a.value.height / 2 - a.value.height / 20,
|
|
194
|
-
y: h.value.bottom,
|
|
195
|
-
"text-anchor": "middle",
|
|
196
|
-
fill: e.value.style.trendLabel.useColorTrend ? r.value : e.value.style.trendLabel.color,
|
|
197
|
-
"font-size": e.value.style.trendLabel.fontSize,
|
|
198
|
-
"font-weight": e.value.style.trendLabel.bold ? "bold" : "normal"
|
|
199
|
-
}, A(c(I)({
|
|
200
|
-
p: b.value > 0 ? "+" : "",
|
|
201
|
-
v: b.value,
|
|
202
|
-
s: "%",
|
|
203
|
-
r: e.value.style.trendLabel.rounding
|
|
204
|
-
})), 9, he)),
|
|
205
|
-
l.value.length && l.value.at(-1).x !== void 0 ? (n(), i("circle", {
|
|
206
|
-
key: 5,
|
|
207
|
-
stroke: e.value.style.backgroundColor,
|
|
208
|
-
"stroke-width": 2,
|
|
209
|
-
cx: l.value.at(-1).x,
|
|
210
|
-
cy: l.value.at(-1).y,
|
|
211
|
-
r: 4,
|
|
212
|
-
fill: r.value
|
|
213
|
-
}, null, 8, ye)) : v("", !0),
|
|
214
|
-
l.value.length && l.value.at(-1).x !== void 0 && e.value.style.dataLabel.show ? (n(), i("text", {
|
|
215
|
-
key: 6,
|
|
216
|
-
"text-anchor": "middle",
|
|
217
|
-
x: l.value.at(-1).x,
|
|
218
|
-
y: l.value.at(-1).y - e.value.style.dataLabel.fontSize / 1.5,
|
|
219
|
-
"font-size": e.value.style.dataLabel.fontSize,
|
|
220
|
-
fill: e.value.style.dataLabel.useColorTrend ? r.value : e.value.style.dataLabel.color,
|
|
221
|
-
"font-weight": e.value.style.dataLabel.bold ? "bold" : "normal"
|
|
222
|
-
}, A(c(I)({
|
|
223
|
-
p: e.value.style.dataLabel.prefix,
|
|
224
|
-
v: l.value.at(-1).value,
|
|
225
|
-
s: e.value.style.dataLabel.suffix,
|
|
226
|
-
r: e.value.style.dataLabel.rounding
|
|
227
|
-
})), 9, fe)) : v("", !0)
|
|
228
|
-
], 12, le)) : (n(), w(ee, {
|
|
229
|
-
key: 0,
|
|
230
|
-
config: {
|
|
231
|
-
type: "sparkline",
|
|
232
|
-
style: {
|
|
233
|
-
backgroundColor: e.value.style.backgroundColor,
|
|
234
|
-
sparkline: {
|
|
235
|
-
color: "#CCCCCC"
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}, null, 8, ["config"]))
|
|
240
|
-
], 12, te));
|
|
241
|
-
}
|
|
242
|
-
}, xe = /* @__PURE__ */ X(pe, [["__scopeId", "data-v-456001fa"]]);
|
|
243
|
-
export {
|
|
244
|
-
xe as default
|
|
245
|
-
};
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { computed as s, onMounted as _, ref as m, watch as j, openBlock as n, createElementBlock as r, normalizeStyle as v, toDisplayString as y, createCommentVNode as c, unref as $, createElementVNode as i, normalizeClass as F, createBlock as O } from "vue";
|
|
2
|
-
import { t as B } from "./themes-lgjsYHsH.js";
|
|
3
|
-
import { u as w } from "./title-BF-9Qcni.js";
|
|
4
|
-
import { i as E, j as C, k as D, e as G, K as I, X as U, n as V } from "./data-table-d-VcuH-r.js";
|
|
5
|
-
import { u as q, S as P } from "./vue-ui-3d-bar-DW7kGJSz.js";
|
|
6
|
-
const T = ["xmlns", "viewBox"], X = ["id"], H = ["stop-color"], K = ["stop-color"], R = ["d", "stroke", "stroke-linecap"], Y = ["d", "stroke", "stroke-linecap", "stroke-dashoffset"], J = ["x", "y", "font-size", "fill", "font-weight"], ae = {
|
|
7
|
-
__name: "vue-ui-sparkgauge",
|
|
8
|
-
props: {
|
|
9
|
-
config: {
|
|
10
|
-
type: Object,
|
|
11
|
-
default() {
|
|
12
|
-
return {};
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
dataset: {
|
|
16
|
-
type: Object,
|
|
17
|
-
default() {
|
|
18
|
-
return {};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
setup(L) {
|
|
23
|
-
const t = L, { vue_ui_sparkgauge: S } = q(), g = s(() => !!t.dataset && Object.keys(t.dataset).length);
|
|
24
|
-
_(() => {
|
|
25
|
-
E(t.dataset) ? C({
|
|
26
|
-
componentName: "VueUiSparkgauge",
|
|
27
|
-
type: "dataset"
|
|
28
|
-
}) : D({
|
|
29
|
-
datasetObject: t.dataset,
|
|
30
|
-
requiredAttributes: ["value", "min", "max"]
|
|
31
|
-
}).forEach((l) => {
|
|
32
|
-
C({
|
|
33
|
-
componentName: "VueUiSparkgauge",
|
|
34
|
-
type: "datasetAttribute",
|
|
35
|
-
property: l
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
const p = m(G()), e = s(() => {
|
|
40
|
-
const l = w({
|
|
41
|
-
userConfig: t.config,
|
|
42
|
-
defaultConfig: S
|
|
43
|
-
});
|
|
44
|
-
return l.theme ? {
|
|
45
|
-
...w({
|
|
46
|
-
userConfig: B.vue_ui_sparkgauge[l.theme] || t.config,
|
|
47
|
-
defaultConfig: l
|
|
48
|
-
})
|
|
49
|
-
} : l;
|
|
50
|
-
}), u = s(() => ({
|
|
51
|
-
height: e.value.style.height,
|
|
52
|
-
width: 128,
|
|
53
|
-
base: e.value.style.basePosition
|
|
54
|
-
})), a = s(() => {
|
|
55
|
-
const l = t.dataset.min ?? 0, f = t.dataset.max ?? 0, N = f - l;
|
|
56
|
-
return {
|
|
57
|
-
min: l,
|
|
58
|
-
max: f,
|
|
59
|
-
diff: N
|
|
60
|
-
};
|
|
61
|
-
}), o = m(e.value.style.animation.show ? a.value.min : t.dataset.value);
|
|
62
|
-
j(() => t.dataset.value, () => {
|
|
63
|
-
o.value = m(e.value.style.animation.show ? a.value.min : t.dataset.value), b();
|
|
64
|
-
});
|
|
65
|
-
const h = s(() => o.value > a.value.max ? a.value.max : o.value < a.value.min ? a.value.min : o.value), A = s(() => a.value.diff / e.value.style.animation.speedMs);
|
|
66
|
-
_(() => {
|
|
67
|
-
b();
|
|
68
|
-
});
|
|
69
|
-
function b() {
|
|
70
|
-
function l() {
|
|
71
|
-
o.value += A.value, o.value < t.dataset.value ? requestAnimationFrame(l) : o.value = t.dataset.value;
|
|
72
|
-
}
|
|
73
|
-
e.value.style.animation.show && (o.value = a.value.min, l());
|
|
74
|
-
}
|
|
75
|
-
const d = s(() => t.dataset.title ?? ""), k = s(() => o.value >= 0 ? (h.value - a.value.min) / a.value.diff : (Math.abs(a.value.min) - Math.abs(h.value)) / a.value.diff), x = s(() => I(e.value.style.colors.min, e.value.style.colors.max, a.value.min, a.value.max, o.value)), z = s(() => e.value.style.dataLabel.autoColor ? x.value : e.value.style.dataLabel.color), M = s(() => e.value.style.track.autoColor ? x.value : e.value.style.track.color);
|
|
76
|
-
return (l, f) => (n(), r("div", {
|
|
77
|
-
style: v(`font-family:${e.value.style.fontFamily};width: 100%; background:${e.value.style.background}`)
|
|
78
|
-
}, [
|
|
79
|
-
e.value.style.title.show && d.value && e.value.style.title.position === "top" ? (n(), r("div", {
|
|
80
|
-
key: 0,
|
|
81
|
-
class: "vue-data-ui-sparkgauge-label",
|
|
82
|
-
style: v(`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}`)
|
|
83
|
-
}, y(d.value), 5)) : c("", !0),
|
|
84
|
-
g.value ? (n(), r("svg", {
|
|
85
|
-
key: 1,
|
|
86
|
-
xmlns: $(U),
|
|
87
|
-
viewBox: `0 0 ${u.value.width} ${u.value.height}`,
|
|
88
|
-
style: v(`overflow: visible; background:${e.value.style.background}; width:100%;`)
|
|
89
|
-
}, [
|
|
90
|
-
i("defs", null, [
|
|
91
|
-
i("linearGradient", {
|
|
92
|
-
id: `gradient_${p.value}`,
|
|
93
|
-
x1: "-10%",
|
|
94
|
-
y1: "100%",
|
|
95
|
-
x2: "110%",
|
|
96
|
-
y2: "100%"
|
|
97
|
-
}, [
|
|
98
|
-
i("stop", {
|
|
99
|
-
offset: "0%",
|
|
100
|
-
"stop-color": e.value.style.colors.min
|
|
101
|
-
}, null, 8, H),
|
|
102
|
-
i("stop", {
|
|
103
|
-
offset: "100%",
|
|
104
|
-
"stop-color": e.value.style.colors.max
|
|
105
|
-
}, null, 8, K)
|
|
106
|
-
], 8, X)
|
|
107
|
-
]),
|
|
108
|
-
i("path", {
|
|
109
|
-
d: `M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,
|
|
110
|
-
stroke: e.value.style.gutter.color,
|
|
111
|
-
"stroke-width": 8,
|
|
112
|
-
"stroke-linecap": e.value.style.gutter.strokeLinecap,
|
|
113
|
-
fill: "none"
|
|
114
|
-
}, null, 8, R),
|
|
115
|
-
k.value !== 0 ? (n(), r("path", {
|
|
116
|
-
key: 0,
|
|
117
|
-
d: `M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,
|
|
118
|
-
stroke: e.value.style.colors.showGradient ? `url(#gradient_${p.value})` : M.value,
|
|
119
|
-
"stroke-width": 8,
|
|
120
|
-
"stroke-linecap": e.value.style.track.strokeLinecap,
|
|
121
|
-
fill: "none",
|
|
122
|
-
"stroke-dasharray": 169.5,
|
|
123
|
-
"stroke-dashoffset": 169.5 - 169.5 * k.value,
|
|
124
|
-
class: F({ "vue-ui-sparkgauge-track": e.value.style.animation.show }),
|
|
125
|
-
style: v(e.value.style.animation.show ? `animation: vue-ui-sparkgauge-animation ${e.value.style.animation.speedMs}ms ease-in;` : "")
|
|
126
|
-
}, null, 14, Y)) : c("", !0),
|
|
127
|
-
i("text", {
|
|
128
|
-
"text-anchor": "middle",
|
|
129
|
-
x: u.value.width / 2,
|
|
130
|
-
y: u.value.base + 6 + e.value.style.dataLabel.offsetY,
|
|
131
|
-
"font-size": e.value.style.dataLabel.fontSize,
|
|
132
|
-
fill: z.value,
|
|
133
|
-
"font-weight": e.value.style.dataLabel.bold ? "bold" : "normal"
|
|
134
|
-
}, y($(V)({ p: e.value.style.dataLabel.prefix, v: o.value, s: e.value.style.dataLabel.suffix, r: e.value.style.dataLabel.rounding })), 9, J)
|
|
135
|
-
], 12, T)) : c("", !0),
|
|
136
|
-
g.value ? c("", !0) : (n(), O(P, {
|
|
137
|
-
key: 2,
|
|
138
|
-
config: {
|
|
139
|
-
type: "gauge",
|
|
140
|
-
style: {
|
|
141
|
-
backgroundColor: e.value.style.background,
|
|
142
|
-
gauge: {
|
|
143
|
-
color: "#CCCCCC"
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}, null, 8, ["config"])),
|
|
148
|
-
e.value.style.title.show && d.value && e.value.style.title.position === "bottom" ? (n(), r("div", {
|
|
149
|
-
key: 3,
|
|
150
|
-
class: "vue-data-ui-sparkgauge-label",
|
|
151
|
-
style: v(`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}`)
|
|
152
|
-
}, y(d.value), 5)) : c("", !0)
|
|
153
|
-
], 4));
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
export {
|
|
157
|
-
ae as default
|
|
158
|
-
};
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
import { useCssVars as R, computed as b, onMounted as T, ref as z, openBlock as a, createElementBlock as s, normalizeStyle as w, createElementVNode as f, createTextVNode as N, toDisplayString as r, createCommentVNode as c, unref as p, Fragment as h, renderList as g, normalizeClass as M, createBlock as A } from "vue";
|
|
2
|
-
import { _ as P, i as J, j as D, k as K, e as Q, o as m, X as Z, x as F, a as ee } from "./data-table-d-VcuH-r.js";
|
|
3
|
-
import { t as te } from "./themes-lgjsYHsH.js";
|
|
4
|
-
import { u as H } from "./title-BF-9Qcni.js";
|
|
5
|
-
import { u as le, S as ae } from "./vue-ui-3d-bar-DW7kGJSz.js";
|
|
6
|
-
const se = { key: 0 }, oe = { key: 1 }, ue = ["xmlns", "viewBox"], ie = ["id"], ne = ["stop-color"], re = ["stop-color"], ve = ["id"], de = ["stop-color"], ye = ["stop-color"], ce = { key: 0 }, he = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], ge = { key: 1 }, fe = ["x", "y", "font-size", "font-weight", "fill"], pe = ["x", "y", "font-size", "fill"], be = ["x", "y", "font-size", "fill"], me = ["height", "width", "x", "onMouseover", "stroke", "stroke-width", "rx", "stroke-dasharray", "onClick"], xe = {
|
|
7
|
-
__name: "vue-ui-sparkhistogram",
|
|
8
|
-
props: {
|
|
9
|
-
config: {
|
|
10
|
-
type: Object,
|
|
11
|
-
default() {
|
|
12
|
-
return {};
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
dataset: {
|
|
16
|
-
type: Array,
|
|
17
|
-
default() {
|
|
18
|
-
return [];
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
emits: ["selectDatapoint"],
|
|
23
|
-
setup(V, { emit: E }) {
|
|
24
|
-
const v = V;
|
|
25
|
-
R((l) => ({
|
|
26
|
-
"34a5ebe4": j.value
|
|
27
|
-
}));
|
|
28
|
-
const { vue_ui_sparkhistogram: I } = le(), S = b(() => !!v.dataset && v.dataset.length);
|
|
29
|
-
T(() => {
|
|
30
|
-
J(v.dataset) ? D({
|
|
31
|
-
componentName: "VueUiSparkHistogram",
|
|
32
|
-
type: "dataset"
|
|
33
|
-
}) : v.dataset.forEach((l, u) => {
|
|
34
|
-
K({
|
|
35
|
-
datasetObject: l,
|
|
36
|
-
requiredAttributes: ["value"]
|
|
37
|
-
}).forEach((t) => {
|
|
38
|
-
D({
|
|
39
|
-
componentName: "VueUiSparkHistogram",
|
|
40
|
-
type: "datasetSerieAttribute",
|
|
41
|
-
property: t,
|
|
42
|
-
index: u
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
const x = z(Q()), e = b(() => {
|
|
48
|
-
const l = H({
|
|
49
|
-
userConfig: v.config,
|
|
50
|
-
defaultConfig: I
|
|
51
|
-
});
|
|
52
|
-
return l.theme ? {
|
|
53
|
-
...H({
|
|
54
|
-
userConfig: te.vue_ui_sparkhistogram[l.theme] || v.config,
|
|
55
|
-
defaultConfig: l
|
|
56
|
-
})
|
|
57
|
-
} : l;
|
|
58
|
-
}), d = b(() => {
|
|
59
|
-
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, _ = 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, $ = u - e.value.style.layout.padding.left - e.value.style.layout.padding.right;
|
|
60
|
-
return {
|
|
61
|
-
bottom: o,
|
|
62
|
-
centerY: k,
|
|
63
|
-
drawingHeight: C,
|
|
64
|
-
drawingWidth: $,
|
|
65
|
-
height: l,
|
|
66
|
-
left: y,
|
|
67
|
-
right: _,
|
|
68
|
-
top: t,
|
|
69
|
-
width: u
|
|
70
|
-
};
|
|
71
|
-
}), W = b(() => Math.max(...v.dataset.map((l) => Math.abs(l.value || 0))));
|
|
72
|
-
function B(l) {
|
|
73
|
-
return Math.abs(l) / W.value;
|
|
74
|
-
}
|
|
75
|
-
const n = b(() => v.dataset.map((l, u) => {
|
|
76
|
-
const t = B(l.value || 0), o = d.value.drawingHeight * t, y = d.value.drawingWidth / v.dataset.length, _ = y * (e.value.style.bars.gap / 100), k = y - _, C = d.value.centerY - o / 2, $ = d.value.left + (_ / 2 + u * y), O = d.value.left + u * y, L = typeof l.intensity > "u" ? 100 : Math.round(l.intensity * 100), X = l.value >= 0 ? `${e.value.style.bars.colors.positive}${m[L]}` : `${e.value.style.bars.colors.negative}${m[L]}`, Y = l.value >= 0 ? e.value.style.bars.colors.positive : e.value.style.bars.colors.negative, q = l.value >= 0 ? `url(#gradient_positive_${u}_${x.value})` : `url(#gradient_negative_${u}_${x.value})`, G = $ + k / 2;
|
|
77
|
-
return {
|
|
78
|
-
...l,
|
|
79
|
-
color: X,
|
|
80
|
-
gradient: q,
|
|
81
|
-
height: o,
|
|
82
|
-
intensity: L,
|
|
83
|
-
proportion: t,
|
|
84
|
-
stroke: Y,
|
|
85
|
-
textAnchor: G,
|
|
86
|
-
trapX: O,
|
|
87
|
-
unitWidth: y,
|
|
88
|
-
width: k,
|
|
89
|
-
x: $,
|
|
90
|
-
y: C
|
|
91
|
-
};
|
|
92
|
-
})), i = z(null);
|
|
93
|
-
function U(l, u) {
|
|
94
|
-
E("selectDatapoint", { datapoint: l, index: u });
|
|
95
|
-
}
|
|
96
|
-
const j = b(() => `${e.value.style.animation.speedMs}ms`);
|
|
97
|
-
return (l, u) => (a(), s("div", {
|
|
98
|
-
style: w(`width:100%;background:${e.value.style.backgroundColor};font-family:${e.value.style.fontFamily}`),
|
|
99
|
-
onMouseleave: u[1] || (u[1] = (t) => i.value = null)
|
|
100
|
-
}, [
|
|
101
|
-
e.value.style.title.text ? (a(), s("div", {
|
|
102
|
-
key: 0,
|
|
103
|
-
style: w(`width:calc(100% - 12px);background:${e.value.style.backgroundColor};margin:0 auto;margin:${e.value.style.title.margin};padding: 0 6px;text-align:${e.value.style.title.textAlign}`)
|
|
104
|
-
}, [
|
|
105
|
-
f("div", {
|
|
106
|
-
style: w(`font-size:${e.value.style.title.fontSize}px;color:${e.value.style.title.color};font-weight:${e.value.style.title.bold ? "bold" : "normal"}`)
|
|
107
|
-
}, [
|
|
108
|
-
N(r(e.value.style.title.text) + " ", 1),
|
|
109
|
-
i.value !== null ? (a(), s("span", se, "- " + r(n.value[i.value].timeLabel || "") + " " + r(e.value.style.labels.value.prefix) + r(isNaN(n.value[i.value].value) ? "" : ": " + Number(n.value[i.value].value.toFixed(e.value.style.labels.value.rounding)).toLocaleString()) + r(e.value.style.labels.value.suffix), 1)) : c("", !0),
|
|
110
|
-
N(),
|
|
111
|
-
![void 0, null].includes(i.value) && ![null, void 0].includes(n.value[i.value].valueLabel) ? (a(), s("span", oe, "(" + r(n.value[i.value].valueLabel || 0) + ")", 1)) : c("", !0)
|
|
112
|
-
], 4),
|
|
113
|
-
e.value.style.title.subtitle.text ? (a(), s("div", {
|
|
114
|
-
key: 0,
|
|
115
|
-
style: w(`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"}`)
|
|
116
|
-
}, r(e.value.style.title.subtitle.text), 5)) : c("", !0)
|
|
117
|
-
], 4)) : c("", !0),
|
|
118
|
-
S.value ? (a(), s("svg", {
|
|
119
|
-
key: 1,
|
|
120
|
-
xmlns: p(Z),
|
|
121
|
-
viewBox: `0 0 ${d.value.width} ${d.value.height}`,
|
|
122
|
-
style: { overflow: "visible" }
|
|
123
|
-
}, [
|
|
124
|
-
f("defs", null, [
|
|
125
|
-
(a(!0), s(h, null, g(n.value, (t, o) => (a(), s("radialGradient", {
|
|
126
|
-
id: `gradient_positive_${o}_${x.value}`,
|
|
127
|
-
cy: "50%",
|
|
128
|
-
cx: "50%",
|
|
129
|
-
r: "50%",
|
|
130
|
-
fx: "50%",
|
|
131
|
-
fy: "50%"
|
|
132
|
-
}, [
|
|
133
|
-
f("stop", {
|
|
134
|
-
offset: "0%",
|
|
135
|
-
"stop-color": `${p(F)(e.value.style.bars.colors.positive, 0.05)}${p(m)[t.intensity]}`
|
|
136
|
-
}, null, 8, ne),
|
|
137
|
-
f("stop", {
|
|
138
|
-
offset: "100%",
|
|
139
|
-
"stop-color": `${e.value.style.bars.colors.positive}${p(m)[t.intensity]}`
|
|
140
|
-
}, null, 8, re)
|
|
141
|
-
], 8, ie))), 256)),
|
|
142
|
-
(a(!0), s(h, null, g(n.value, (t, o) => (a(), s("radialGradient", {
|
|
143
|
-
id: `gradient_negative_${o}_${x.value}`,
|
|
144
|
-
cy: "50%",
|
|
145
|
-
cx: "50%",
|
|
146
|
-
r: "50%",
|
|
147
|
-
fx: "50%",
|
|
148
|
-
fy: "50%"
|
|
149
|
-
}, [
|
|
150
|
-
f("stop", {
|
|
151
|
-
offset: "0%",
|
|
152
|
-
"stop-color": `${p(F)(e.value.style.bars.colors.negative, 0.05)}${p(m)[t.intensity]}`
|
|
153
|
-
}, null, 8, de),
|
|
154
|
-
f("stop", {
|
|
155
|
-
offset: "100%",
|
|
156
|
-
"stop-color": `${e.value.style.bars.colors.negative}${p(m)[t.intensity]}`
|
|
157
|
-
}, null, 8, ye)
|
|
158
|
-
], 8, ve))), 256))
|
|
159
|
-
]),
|
|
160
|
-
!e.value.style.bars.shape || e.value.style.bars.shape === "square" ? (a(), s("g", ce, [
|
|
161
|
-
(a(!0), s(h, null, g(n.value, (t, o) => (a(), s("rect", {
|
|
162
|
-
x: t.x,
|
|
163
|
-
y: t.y,
|
|
164
|
-
height: t.height,
|
|
165
|
-
width: t.width,
|
|
166
|
-
fill: e.value.style.bars.colors.gradient.show ? t.gradient : t.color,
|
|
167
|
-
stroke: t.stroke,
|
|
168
|
-
"stroke-width": e.value.style.bars.strokeWidth,
|
|
169
|
-
rx: `${e.value.style.bars.borderRadius * t.proportion / 12}%`,
|
|
170
|
-
class: M({ "vue-ui-sparkhistogram-shape": e.value.style.animation.show })
|
|
171
|
-
}, null, 10, he))), 256))
|
|
172
|
-
])) : (a(), s("g", ge, [
|
|
173
|
-
(a(!0), s(h, null, g(n.value, (t, o) => (a(), A(ee, {
|
|
174
|
-
plot: { x: t.x + t.width / 2, y: t.y + t.height / 2 },
|
|
175
|
-
color: e.value.style.bars.colors.gradient.show ? t.gradient : t.color,
|
|
176
|
-
shape: e.value.style.bars.shape,
|
|
177
|
-
radius: t.height * 0.4,
|
|
178
|
-
class: M({ "vue-ui-sparkhistogram-shape": e.value.style.animation.show })
|
|
179
|
-
}, null, 8, ["plot", "color", "shape", "radius", "class"]))), 256))
|
|
180
|
-
])),
|
|
181
|
-
(a(!0), s(h, null, g(n.value, (t, o) => (a(), s("text", {
|
|
182
|
-
"text-anchor": "middle",
|
|
183
|
-
x: t.textAnchor,
|
|
184
|
-
y: t.y - e.value.style.labels.value.fontSize / 3 + e.value.style.labels.value.offsetY,
|
|
185
|
-
"font-size": e.value.style.labels.value.fontSize,
|
|
186
|
-
"font-weight": e.value.style.labels.value.bold ? "bold" : "normal",
|
|
187
|
-
fill: e.value.style.labels.value.color
|
|
188
|
-
}, r(e.value.style.labels.value.prefix) + r(isNaN(t.value) ? "" : Number(t.value.toFixed(e.value.style.labels.value.rounding)).toLocaleString()) + r(e.value.style.labels.value.suffix), 9, fe))), 256)),
|
|
189
|
-
(a(!0), s(h, null, g(n.value, (t, o) => (a(), s("g", null, [
|
|
190
|
-
t.valueLabel ? (a(), s("text", {
|
|
191
|
-
key: 0,
|
|
192
|
-
x: t.textAnchor,
|
|
193
|
-
y: t.y + t.height + e.value.style.labels.valueLabel.fontSize,
|
|
194
|
-
"font-size": e.value.style.labels.valueLabel.fontSize,
|
|
195
|
-
"text-anchor": "middle",
|
|
196
|
-
fill: e.value.style.labels.valueLabel.color
|
|
197
|
-
}, r(t.valueLabel), 9, pe)) : c("", !0)
|
|
198
|
-
]))), 256)),
|
|
199
|
-
(a(!0), s(h, null, g(n.value, (t, o) => (a(), s("g", null, [
|
|
200
|
-
t.timeLabel ? (a(), s("text", {
|
|
201
|
-
key: 0,
|
|
202
|
-
x: t.textAnchor,
|
|
203
|
-
y: d.value.height - e.value.style.labels.timeLabel.fontSize / 2,
|
|
204
|
-
"font-size": e.value.style.labels.timeLabel.fontSize,
|
|
205
|
-
fill: e.value.style.labels.timeLabel.color,
|
|
206
|
-
"text-anchor": "middle"
|
|
207
|
-
}, r(t.timeLabel), 9, be)) : c("", !0)
|
|
208
|
-
]))), 256)),
|
|
209
|
-
(a(!0), s(h, null, g(n.value, (t, o) => (a(), s("g", null, [
|
|
210
|
-
f("rect", {
|
|
211
|
-
height: d.value.height,
|
|
212
|
-
width: t.unitWidth,
|
|
213
|
-
fill: "transparent",
|
|
214
|
-
x: t.trapX,
|
|
215
|
-
y: 0,
|
|
216
|
-
onMouseover: (y) => i.value = o,
|
|
217
|
-
onMouseleave: u[0] || (u[0] = (y) => i.value = null),
|
|
218
|
-
stroke: i.value !== null && i.value === o ? e.value.style.selector.stroke : "",
|
|
219
|
-
"stroke-width": i.value !== null && i.value === o ? e.value.style.selector.strokeWidth : 0,
|
|
220
|
-
rx: e.value.style.selector.borderRadius,
|
|
221
|
-
"stroke-dasharray": e.value.style.selector.strokeDasharray,
|
|
222
|
-
onClick: () => U(t, o)
|
|
223
|
-
}, null, 40, me)
|
|
224
|
-
]))), 256))
|
|
225
|
-
], 8, ue)) : c("", !0),
|
|
226
|
-
S.value ? c("", !0) : (a(), A(ae, {
|
|
227
|
-
key: 2,
|
|
228
|
-
config: {
|
|
229
|
-
type: "sparkHistogram",
|
|
230
|
-
style: {
|
|
231
|
-
backgroundColor: e.value.style.backgroundColor,
|
|
232
|
-
sparkHistogram: {
|
|
233
|
-
color: "#CCCCCC"
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}, null, 8, ["config"]))
|
|
238
|
-
], 36));
|
|
239
|
-
}
|
|
240
|
-
}, Le = /* @__PURE__ */ P(xe, [["__scopeId", "data-v-7aed7086"]]);
|
|
241
|
-
export {
|
|
242
|
-
Le as default
|
|
243
|
-
};
|