vue-data-ui 3.0.0-next.7 → 3.0.0-next.71
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/{Arrow-Bl8urcli.js → Arrow-BZNpld6u.js} +1 -1
- package/dist/{BaseDraggableDialog-CyhpaZU5.js → BaseDraggableDialog-kg-eVvXZ.js} +2 -2
- package/dist/{BaseIcon-BCZfTCeM.js → BaseIcon-BdOEhJar.js} +1 -1
- package/dist/{ColorPicker-CSJf42vx.js → ColorPicker-CWvXlPxS.js} +2 -2
- package/dist/{DataTable-mQ6Wd-rR.js → DataTable-B3yakHEM.js} +2 -2
- package/dist/{Legend-B2hrDh4G.js → Legend-DiGLrlzP.js} +2 -2
- package/dist/{NonSvgPenAndPaper-DQ8KsK4W.js → NonSvgPenAndPaper-C-ZjpJQd.js} +3 -3
- package/dist/{PackageVersion-CeEYZfaH.js → PackageVersion-6s4eI8W7.js} +1 -1
- package/dist/{PenAndPaper-DhSxfUrQ.js → PenAndPaper-JoUN7Ink.js} +3 -3
- package/dist/{Shape-C2qH26wh.js → Shape-CWIa2nta.js} +43 -37
- package/dist/Slicer-DYuvPkEM.js +602 -0
- package/dist/{SparkTooltip-BcHgW6YX.js → SparkTooltip-C_fUmbP7.js} +1 -1
- package/dist/{Title-B7Xb3YuE.js → Title-VLWyIYrj.js} +1 -1
- package/dist/{Tooltip-BidRoM5E.js → Tooltip-BS5naLS2.js} +23 -19
- package/dist/{UserOptions-0tvMM8PF.js → UserOptions-BV_xM-sB.js} +2 -2
- package/dist/{dom-to-png-CTrlbKHr.js → dom-to-png-PUk0ukSG.js} +1 -1
- package/dist/{img-D72yZNUg.js → img-DD_2wgY3.js} +1 -1
- package/dist/{index-Cg-RjxqH.js → index-DKpp7RIH.js} +2236 -1505
- package/dist/{pdf-DgX01_wu.js → pdf-0TQQyXWM.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +610 -22
- package/dist/types/vue-data-ui.d.ts +610 -22
- package/dist/useAutoSizeLabelsInsideViewbox-Qhry5WvH.js +81 -0
- package/dist/useFitSvgText-2crs6Fv5.js +69 -0
- package/dist/useLoading-D7YHNtLX.js +29 -0
- package/dist/useNestedProp-D-8c0o4p.js +13 -0
- package/dist/usePanZoom-BVca3eMk.js +122 -0
- package/dist/{usePrinter-BUzmyQf9.js → usePrinter-NUeckmCX.js} +2 -2
- package/dist/useTimeLabelCollider-CIsgDrl9.js +78 -0
- package/dist/{useTimeLabels-Mrr0jrpL.js → useTimeLabels-DkzmKfZn.js} +211 -152
- package/dist/{vue-data-ui-DpO93ey5.js → vue-data-ui-BIXXEsFZ.js} +105 -100
- package/dist/vue-data-ui.js +23 -22
- package/dist/vue-ui-3d-bar-CVUfj12F.js +1323 -0
- package/dist/{vue-ui-accordion-CRomxzaL.js → vue-ui-accordion-Cpovz3RE.js} +3 -3
- package/dist/vue-ui-age-pyramid-CQWFaHLV.js +834 -0
- package/dist/{vue-ui-annotator-BAOxPiFx.js → vue-ui-annotator-C49Xw5Mh.js} +2 -2
- package/dist/vue-ui-bullet-DED2SuIa.js +571 -0
- package/dist/vue-ui-candlestick-DGgbevy6.js +999 -0
- package/dist/{vue-ui-carousel-table-DVGlPZIa.js → vue-ui-carousel-table-DKIgSB1T.js} +29 -29
- package/dist/{vue-ui-chestnut-P1v4ffD0.js → vue-ui-chestnut-D1bEM91d.js} +5 -5
- package/dist/vue-ui-chord-CBLSqtEP.js +1038 -0
- package/dist/{vue-ui-circle-pack-FXmemXgl.js → vue-ui-circle-pack-g2ts9NTG.js} +24 -24
- package/dist/{vue-ui-cursor-CdvMgIrP.js → vue-ui-cursor-DSxmPUD8.js} +2 -2
- package/dist/{vue-ui-dashboard-Vke0452J.js → vue-ui-dashboard-B6FfoNjQ.js} +62 -62
- package/dist/{vue-ui-digits-BVhyYqCs.js → vue-ui-digits-DKffQVgr.js} +2 -2
- package/dist/{vue-ui-donut-BpIivKcf.js → vue-ui-donut-CJrWc4-g.js} +320 -308
- package/dist/vue-ui-donut-evolution-Bys6cs-D.js +1075 -0
- package/dist/vue-ui-dumbbell-Cb_I__qC.js +1119 -0
- package/dist/vue-ui-flow-BzuT3ij5.js +841 -0
- package/dist/{vue-ui-funnel-BbFmbsft.js → vue-ui-funnel-Ctp7GDiN.js} +16 -16
- package/dist/vue-ui-galaxy-CRBy0aio.js +680 -0
- package/dist/vue-ui-gauge-NcQq5UFr.js +791 -0
- package/dist/vue-ui-gizmo-Cwfb8c-0.js +210 -0
- package/dist/vue-ui-heatmap-DElqpFVY.js +1078 -0
- package/dist/vue-ui-history-plot-De1Dvnhw.js +1073 -0
- package/dist/{vue-ui-kpi-jN_yMnLj.js → vue-ui-kpi-_bLScmgO.js} +26 -26
- package/dist/{vue-ui-mini-loader-rYr76x8g.js → vue-ui-mini-loader-PsHE_2Wy.js} +2 -2
- package/dist/{vue-ui-molecule-BWZHOQLi.js → vue-ui-molecule-CgiahnC6.js} +53 -51
- package/dist/vue-ui-mood-radar-dXVOOrhl.js +785 -0
- package/dist/vue-ui-nested-donuts-C0X6BetT.js +1286 -0
- package/dist/vue-ui-onion-C7sxQzk_.js +776 -0
- package/dist/vue-ui-parallel-coordinate-plot-jwtnNX59.js +915 -0
- package/dist/{vue-ui-quadrant-BFFzfDw3.js → vue-ui-quadrant-DguDE91h.js} +512 -459
- package/dist/vue-ui-quick-chart-BpEDS08U.js +1761 -0
- package/dist/vue-ui-radar-lFrqTRqo.js +796 -0
- package/dist/{vue-ui-rating-BAauyqTn.js → vue-ui-rating-BHghXziv.js} +2 -2
- package/dist/vue-ui-relation-circle-C5W6NFOb.js +598 -0
- package/dist/vue-ui-ridgeline-A2DuFEDS.js +1153 -0
- package/dist/vue-ui-rings-BgJAm9_b.js +728 -0
- package/dist/vue-ui-scatter-COfpLChz.js +1178 -0
- package/dist/{vue-ui-skeleton-CUOhCY4p.js → vue-ui-skeleton-DMLCBUtZ.js} +3 -3
- package/dist/{vue-ui-smiley-B6SqWMov.js → vue-ui-smiley-ZopESYc_.js} +26 -26
- package/dist/vue-ui-spark-trend-CuSQ03fQ.js +315 -0
- package/dist/vue-ui-sparkbar-BCsX9M4q.js +351 -0
- package/dist/vue-ui-sparkgauge-DdyZLA0T.js +232 -0
- package/dist/vue-ui-sparkhistogram-CUxFgIcE.js +380 -0
- package/dist/vue-ui-sparkline-DOkofsLL.js +489 -0
- package/dist/vue-ui-sparkstackbar-Bq9PZzmH.js +421 -0
- package/dist/vue-ui-stackbar-B7ceoT0V.js +1370 -0
- package/dist/vue-ui-strip-plot-DYh-NGQN.js +915 -0
- package/dist/{vue-ui-table-heatmap-DazTE3fa.js → vue-ui-table-heatmap-BVTb1xuA.js} +5 -5
- package/dist/{vue-ui-table-Dwjl3L0p.js → vue-ui-table-pESH5KAJ.js} +11 -11
- package/dist/{vue-ui-table-sparkline-BXMPUEpN.js → vue-ui-table-sparkline-Bw-6l9lA.js} +14 -14
- package/dist/vue-ui-thermometer-BqqfmS-B.js +541 -0
- package/dist/{vue-ui-timer-yLvNAZL_.js → vue-ui-timer-CVisMxLS.js} +5 -5
- package/dist/vue-ui-tiremarks-K1dcCdpj.js +406 -0
- package/dist/vue-ui-treemap-Bz3c68s4.js +1035 -0
- package/dist/{vue-ui-vertical-bar-BrYCoVym.js → vue-ui-vertical-bar-BvtXpCjw.js} +71 -69
- package/dist/vue-ui-waffle-CYO7bIf1.js +910 -0
- package/dist/vue-ui-wheel-De1spwLh.js +379 -0
- package/dist/vue-ui-word-cloud-BMmVrx_T.js +765 -0
- package/dist/{vue-ui-world-B4Dqrk4l.js → vue-ui-world-Ccpr00nJ.js} +11 -9
- package/dist/vue-ui-xy-D4jaRKe3.js +3771 -0
- package/dist/{vue-ui-xy-canvas-D7fL36kT.js → vue-ui-xy-canvas-DE-Uu5oq.js} +265 -264
- package/package.json +1 -1
- package/dist/Slicer-BD8Z8VCW.js +0 -577
- package/dist/useLoading-Bt5Doa8m.js +0 -28
- package/dist/useNestedProp-C_G5E08Y.js +0 -13
- package/dist/usePanZoom-BQMvRXEQ.js +0 -115
- package/dist/vue-ui-3d-bar-D8imUwEz.js +0 -1227
- package/dist/vue-ui-age-pyramid-CV7gtFOC.js +0 -746
- package/dist/vue-ui-bullet-BtuMMBF7.js +0 -513
- package/dist/vue-ui-candlestick-BsRtXKrv.js +0 -873
- package/dist/vue-ui-chord-CIuzYmpM.js +0 -949
- package/dist/vue-ui-donut-evolution-BRlsCA4U.js +0 -903
- package/dist/vue-ui-dumbbell-D87Dumjh.js +0 -753
- package/dist/vue-ui-flow-D_L_xssL.js +0 -765
- package/dist/vue-ui-galaxy-Cn6vHbaw.js +0 -617
- package/dist/vue-ui-gauge-Ds4terqY.js +0 -738
- package/dist/vue-ui-gizmo-BTncpI62.js +0 -192
- package/dist/vue-ui-heatmap-B6GpjeWC.js +0 -877
- package/dist/vue-ui-history-plot-DTDzEeGq.js +0 -924
- package/dist/vue-ui-mood-radar-CPfS6f1L.js +0 -670
- package/dist/vue-ui-nested-donuts-Bsd2kGoJ.js +0 -1177
- package/dist/vue-ui-onion-BQ4nISXW.js +0 -701
- package/dist/vue-ui-parallel-coordinate-plot-BoHgVgbn.js +0 -807
- package/dist/vue-ui-quick-chart-oNMTeOAL.js +0 -1612
- package/dist/vue-ui-radar-98mXFZe-.js +0 -741
- package/dist/vue-ui-relation-circle-6oDCSxkO.js +0 -542
- package/dist/vue-ui-ridgeline-CugMGjOU.js +0 -969
- package/dist/vue-ui-rings-bsGXaD2m.js +0 -685
- package/dist/vue-ui-scatter-7ssLliGg.js +0 -1045
- package/dist/vue-ui-spark-trend-jauInkkN.js +0 -291
- package/dist/vue-ui-sparkbar-DXByIxQH.js +0 -301
- package/dist/vue-ui-sparkgauge-BMrV2gDi.js +0 -201
- package/dist/vue-ui-sparkhistogram-CoNM4G7o.js +0 -313
- package/dist/vue-ui-sparkline-DrN3_wS0.js +0 -459
- package/dist/vue-ui-sparkstackbar-W1a0JQi9.js +0 -381
- package/dist/vue-ui-stackbar-D1-gbUgE.js +0 -1207
- package/dist/vue-ui-strip-plot-KhfvrVuN.js +0 -761
- package/dist/vue-ui-thermometer-Cn6lJRs3.js +0 -495
- package/dist/vue-ui-tiremarks-BYsWePfK.js +0 -358
- package/dist/vue-ui-treemap-Ce7RVFG3.js +0 -965
- package/dist/vue-ui-waffle-CCrR2T1G.js +0 -863
- package/dist/vue-ui-wheel-BuxjnrDN.js +0 -352
- package/dist/vue-ui-word-cloud-C6fawHJE.js +0 -659
- package/dist/vue-ui-xy-ubRnv9iJ.js +0 -2980
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { defineAsyncComponent as Z, useSlots as ee, onMounted as B, ref as x, toRefs as te, computed as w, watch as E, nextTick as le, createElementBlock as i, openBlock as n, normalizeStyle as d, unref as o, renderSlot as D, createCommentVNode as c, createBlock as ae, normalizeProps as oe, mergeProps as M, createElementVNode as v, toDisplayString as y, Fragment as P, renderList as se, createVNode as ne } from "vue";
|
|
2
|
+
import { u as ue, c as ie, t as re, a as ve, p as C, b as de, d as ce, o as pe, f as V, g as fe, e as ye, s as I, k as _, i as A, X as ge, x as me } from "./index-DKpp7RIH.js";
|
|
3
|
+
import { u as O } from "./useNestedProp-D-8c0o4p.js";
|
|
4
|
+
import { u as he, B as xe } from "./useLoading-D7YHNtLX.js";
|
|
5
|
+
const ke = ["onClick", "onMouseenter", "onMouseleave"], be = { key: 1 }, we = ["xmlns", "viewBox"], Ce = ["id"], _e = ["stop-color"], Ae = ["stop-color"], Se = ["height", "width", "fill", "rx"], $e = ["height", "width", "fill", "rx"], De = ["height", "width", "fill", "rx"], Ie = {
|
|
6
|
+
key: 2,
|
|
7
|
+
ref: "source",
|
|
8
|
+
dir: "auto"
|
|
9
|
+
}, Fe = {
|
|
10
|
+
__name: "vue-ui-sparkbar",
|
|
11
|
+
props: {
|
|
12
|
+
config: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default() {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
dataset: {
|
|
19
|
+
type: Array,
|
|
20
|
+
default() {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* Used in VueUiRadar's tooltip exclusively
|
|
26
|
+
*/
|
|
27
|
+
backgroundOpacity: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: null
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
emits: ["selectDatapoint"],
|
|
33
|
+
setup(S, { emit: j }) {
|
|
34
|
+
const U = Z(() => import("./PackageVersion-6s4eI8W7.js")), { vue_ui_sparkbar: R } = ue(), f = S, W = ee();
|
|
35
|
+
B(() => {
|
|
36
|
+
W["chart-background"] && console.warn("VueUiSparkbar does not support the #chart-background slot.");
|
|
37
|
+
});
|
|
38
|
+
const L = x(ie()), e = x($()), { loading: k, FINAL_DATASET: p } = he({
|
|
39
|
+
...te(f),
|
|
40
|
+
FINAL_CONFIG: e,
|
|
41
|
+
prepareConfig: $,
|
|
42
|
+
skeletonDataset: [
|
|
43
|
+
{ name: "_", value: 21, target: 25, color: "#808080" },
|
|
44
|
+
{ name: "_", value: 13, target: 25, color: "#ADADAD" },
|
|
45
|
+
{ name: "_", value: 8, target: 25, color: "#DBDBDB" }
|
|
46
|
+
],
|
|
47
|
+
skeletonConfig: re({
|
|
48
|
+
defaultConfig: e.value,
|
|
49
|
+
userConfig: {
|
|
50
|
+
style: {
|
|
51
|
+
backgroundColor: "#99999930",
|
|
52
|
+
animation: { show: !1 },
|
|
53
|
+
layout: { independant: !0 },
|
|
54
|
+
gutter: {
|
|
55
|
+
backgroundColor: "#6A6A6A",
|
|
56
|
+
opacity: 50
|
|
57
|
+
},
|
|
58
|
+
bar: {
|
|
59
|
+
gradient: {
|
|
60
|
+
underlayerColor: "#6A6A6A"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
}), T = w(() => !!e.value.debug);
|
|
67
|
+
function $() {
|
|
68
|
+
const t = O({
|
|
69
|
+
userConfig: f.config,
|
|
70
|
+
defaultConfig: R
|
|
71
|
+
});
|
|
72
|
+
return t.theme ? {
|
|
73
|
+
...O({
|
|
74
|
+
userConfig: de.vue_ui_sparkbar[t.theme] || f.config,
|
|
75
|
+
defaultConfig: t
|
|
76
|
+
}),
|
|
77
|
+
customPalette: ve[t.theme] || C
|
|
78
|
+
} : t;
|
|
79
|
+
}
|
|
80
|
+
E(() => f.config, (t) => {
|
|
81
|
+
e.value = $();
|
|
82
|
+
}, { deep: !0 });
|
|
83
|
+
const G = w(() => ce(e.value.customPalette)), g = x(p.value.map((t) => ({
|
|
84
|
+
...t,
|
|
85
|
+
value: e.value.style.animation.show ? 0 : t.value || 0,
|
|
86
|
+
formatter: t.formatter || null
|
|
87
|
+
}))), z = x(null);
|
|
88
|
+
B(async () => {
|
|
89
|
+
pe(f.dataset) && V({
|
|
90
|
+
componentName: "VueUiSparkbar",
|
|
91
|
+
type: "dataset",
|
|
92
|
+
debug: T.value
|
|
93
|
+
}), N();
|
|
94
|
+
});
|
|
95
|
+
function N() {
|
|
96
|
+
if (e.value.style.animation.show) {
|
|
97
|
+
let h = function() {
|
|
98
|
+
s += l / t, s < l ? (g.value = g.value.map((u, b) => ({
|
|
99
|
+
...u,
|
|
100
|
+
value: u.value += a[b]
|
|
101
|
+
})), z.value = requestAnimationFrame(h)) : g.value = p.value.map((u) => ({
|
|
102
|
+
...u,
|
|
103
|
+
value: u.value || 0,
|
|
104
|
+
formatter: u.formatter || null
|
|
105
|
+
}));
|
|
106
|
+
};
|
|
107
|
+
const t = e.value.style.animation.animationFrames, a = p.value.map((u, b) => u.value / t), l = p.value.map((u) => u.value || 0).reduce((u, b) => u + b, 0);
|
|
108
|
+
let s = 0;
|
|
109
|
+
h();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
E(() => p.value, async (t) => {
|
|
113
|
+
cancelAnimationFrame(z.value), g.value = p.value.map((a) => ({
|
|
114
|
+
...a,
|
|
115
|
+
value: e.value.style.animation.show ? 0 : a.value || 0,
|
|
116
|
+
formatter: a.formatter || null
|
|
117
|
+
})), le(N);
|
|
118
|
+
}, { deep: !0 });
|
|
119
|
+
const r = x({
|
|
120
|
+
width: 500,
|
|
121
|
+
height: 16
|
|
122
|
+
}), q = w(() => Math.max(...p.value.map((t) => t.value))), H = w(() => (p.value.forEach((t, a) => {
|
|
123
|
+
fe({
|
|
124
|
+
datasetObject: t,
|
|
125
|
+
requiredAttributes: ["name", "value"]
|
|
126
|
+
}).forEach((l) => {
|
|
127
|
+
V({
|
|
128
|
+
componentName: "VueUiSparkbar",
|
|
129
|
+
type: "datasetSerieAttribute",
|
|
130
|
+
property: l,
|
|
131
|
+
index: a,
|
|
132
|
+
debug: T.value
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}), g.value.map((t, a) => ({
|
|
136
|
+
...t,
|
|
137
|
+
value: t.value || 0,
|
|
138
|
+
color: ye(t.color) || G.value[a] || C[a] || C[a % C.length]
|
|
139
|
+
}))));
|
|
140
|
+
function X(t) {
|
|
141
|
+
return t / q.value;
|
|
142
|
+
}
|
|
143
|
+
function F(t) {
|
|
144
|
+
return e.value.style.layout.independant ? t.target ? t.value / t.target : e.value.style.layout.percentage ? t.value > 100 ? 1 : t.value / 100 : e.value.style.layout.target === 0 ? 1 : t.value / e.value.style.layout.target : X(t.value);
|
|
145
|
+
}
|
|
146
|
+
function m(t) {
|
|
147
|
+
return e.value.style.layout.independant && t.target || e.value.style.layout.target;
|
|
148
|
+
}
|
|
149
|
+
const J = j;
|
|
150
|
+
function K(t, a) {
|
|
151
|
+
J("selectDatapoint", { datapoint: t, index: a }), e.value.events.datapointClick && e.value.events.datapointClick({ datapoint: t, seriesIndex: a });
|
|
152
|
+
}
|
|
153
|
+
function Q(t, a) {
|
|
154
|
+
e.value.events.datapointEnter && e.value.events.datapointEnter({ datapoint: t, seriesIndex: a });
|
|
155
|
+
}
|
|
156
|
+
function Y(t, a) {
|
|
157
|
+
e.value.events.datapointLeave && e.value.events.datapointLeave({ datapoint: t, seriesIndex: a });
|
|
158
|
+
}
|
|
159
|
+
return (t, a) => (n(), i("div", {
|
|
160
|
+
class: "vue-ui-sparkbar",
|
|
161
|
+
style: d({
|
|
162
|
+
width: "100%",
|
|
163
|
+
position: "relative",
|
|
164
|
+
fontFamily: e.value.style.fontFamily,
|
|
165
|
+
background: f.backgroundOpacity !== null ? o(I)(e.value.style.backgroundColor, f.backgroundOpacity) : e.value.style.backgroundColor
|
|
166
|
+
})
|
|
167
|
+
}, [
|
|
168
|
+
t.$slots.title ? D(t.$slots, "title", oe(M({ key: 0 }, { title: { ...t.title, title: e.value.style.title.text, subtitle: e.value.style.title.subtitle.text } }))) : c("", !0),
|
|
169
|
+
!t.$slots.title && e.value.style.title.text ? (n(), i("div", {
|
|
170
|
+
key: 1,
|
|
171
|
+
class: "vue-ui-sparkbar-title-container",
|
|
172
|
+
style: d({
|
|
173
|
+
background: e.value.style.title.backgroundColor,
|
|
174
|
+
margin: e.value.style.title.margin,
|
|
175
|
+
textAlign: e.value.style.title.textAlign
|
|
176
|
+
})
|
|
177
|
+
}, [
|
|
178
|
+
v("div", {
|
|
179
|
+
class: "vue-ui-sparkbar-title",
|
|
180
|
+
style: d({
|
|
181
|
+
fontSize: e.value.style.title.fontSize + "px",
|
|
182
|
+
color: e.value.style.title.color,
|
|
183
|
+
fontWeight: e.value.style.title.bold ? "bold" : "normal"
|
|
184
|
+
})
|
|
185
|
+
}, y(e.value.style.title.text), 5),
|
|
186
|
+
e.value.style.title.subtitle.text ? (n(), i("div", {
|
|
187
|
+
key: 0,
|
|
188
|
+
class: "vue-ui-sparkbar-subtitle",
|
|
189
|
+
style: d({
|
|
190
|
+
fontSize: e.value.style.title.subtitle.fontSize + "px",
|
|
191
|
+
color: e.value.style.title.subtitle.color,
|
|
192
|
+
fontWeight: e.value.style.title.subtitle.bold ? "bold" : "normal"
|
|
193
|
+
})
|
|
194
|
+
}, y(e.value.style.title.subtitle.text), 5)) : c("", !0)
|
|
195
|
+
], 4)) : c("", !0),
|
|
196
|
+
(n(!0), i(P, null, se(H.value, (l, s) => (n(), i("div", {
|
|
197
|
+
style: d(`display:flex !important;${["left", "right"].includes(e.value.style.labels.name.position) ? `flex-direction: ${e.value.style.labels.name.position === "right" ? "row-reverse" : "row"} !important` : "flex-direction:column !important"};gap:${e.value.style.gap}px !important;align-items:center;${S.dataset.length > 0 && s !== S.dataset.length - 1 ? "margin-bottom:6px" : ""}`),
|
|
198
|
+
onClick: (h) => K(l, s),
|
|
199
|
+
onMouseenter: (h) => Q(l, s),
|
|
200
|
+
onMouseleave: (h) => Y(l, s)
|
|
201
|
+
}, [
|
|
202
|
+
o(k) ? c("", !0) : D(t.$slots, "data-label", M({
|
|
203
|
+
key: 0,
|
|
204
|
+
ref_for: !0
|
|
205
|
+
}, { bar: {
|
|
206
|
+
...l,
|
|
207
|
+
target: m(l),
|
|
208
|
+
valueLabel: o(_)(
|
|
209
|
+
l.formatter,
|
|
210
|
+
l.value,
|
|
211
|
+
o(A)({
|
|
212
|
+
p: l.prefix || "",
|
|
213
|
+
v: l.value,
|
|
214
|
+
s: l.suffix || "",
|
|
215
|
+
r: l.rounding || 0
|
|
216
|
+
}),
|
|
217
|
+
{ datapoint: l, seriesIndex: s }
|
|
218
|
+
),
|
|
219
|
+
targetLabel: o(_)(
|
|
220
|
+
l.formatter,
|
|
221
|
+
m(l),
|
|
222
|
+
o(A)({
|
|
223
|
+
p: l.prefix || "",
|
|
224
|
+
v: m(l),
|
|
225
|
+
s: l.suffix || "",
|
|
226
|
+
r: l.rounding || 0
|
|
227
|
+
}),
|
|
228
|
+
{ datapoint: l, seriesIndex: s }
|
|
229
|
+
)
|
|
230
|
+
} })),
|
|
231
|
+
!t.$slots["data-label"] || o(k) ? (n(), i("div", {
|
|
232
|
+
key: 1,
|
|
233
|
+
style: d({
|
|
234
|
+
display: "flex",
|
|
235
|
+
justifyContent: ["right", "top-right"].includes(e.value.style.labels.name.position) ? "flex-end" : ["top-center"].includes(e.value.style.labels.name.position) ? "center" : "flex-start",
|
|
236
|
+
alignItems: "center",
|
|
237
|
+
width: e.value.style.labels.name.width,
|
|
238
|
+
color: e.value.style.labels.name.color,
|
|
239
|
+
fontSize: e.value.style.labels.fontSize + "px",
|
|
240
|
+
fontWeight: e.value.style.labels.name.bold ? "bold" : "normal",
|
|
241
|
+
flexWrap: "wrap"
|
|
242
|
+
})
|
|
243
|
+
}, [
|
|
244
|
+
o(k) ? (n(), i("div", {
|
|
245
|
+
key: 0,
|
|
246
|
+
class: "vue-ui-sparkbar-skeleton-name",
|
|
247
|
+
style: d({
|
|
248
|
+
width: "60px",
|
|
249
|
+
height: e.value.style.labels.fontSize + "px",
|
|
250
|
+
borderRadius: e.value.style.labels.fontSize / 4 + "px",
|
|
251
|
+
display: "flex",
|
|
252
|
+
alignItems: "center",
|
|
253
|
+
justifyContent: "space-between",
|
|
254
|
+
marginTop: "5px"
|
|
255
|
+
})
|
|
256
|
+
}, [
|
|
257
|
+
v("div", {
|
|
258
|
+
style: d({ height: "100%", width: "40px", borderRadius: e.value.style.labels.fontSize / 4 + "px", backgroundColor: "#6A6A6A80" })
|
|
259
|
+
}, null, 4),
|
|
260
|
+
v("div", {
|
|
261
|
+
style: d({ height: "100%", width: "15px", borderRadius: e.value.style.labels.fontSize / 4 + "px", backgroundColor: "#6A6A6A80" })
|
|
262
|
+
}, null, 4)
|
|
263
|
+
], 4)) : (n(), i(P, { key: 1 }, [
|
|
264
|
+
v("span", null, y(l.name), 1),
|
|
265
|
+
e.value.style.labels.value.show ? (n(), i("span", {
|
|
266
|
+
key: 0,
|
|
267
|
+
style: d(`font-weight:${e.value.style.labels.value.bold ? "bold" : "normal"}`)
|
|
268
|
+
}, ": " + y(o(_)(
|
|
269
|
+
l.formatter,
|
|
270
|
+
l.value,
|
|
271
|
+
o(A)({
|
|
272
|
+
p: l.prefix || "",
|
|
273
|
+
v: l.value,
|
|
274
|
+
s: l.suffix || "",
|
|
275
|
+
r: l.rounding || 0
|
|
276
|
+
}),
|
|
277
|
+
{ datapoint: l, seriesIndex: s }
|
|
278
|
+
)), 5)) : c("", !0),
|
|
279
|
+
e.value.style.layout.showTargetValue ? (n(), i("span", be, y(" " + e.value.style.layout.targetValueText) + " " + y(o(_)(
|
|
280
|
+
l.formatter,
|
|
281
|
+
m(l),
|
|
282
|
+
o(A)({
|
|
283
|
+
p: l.prefix || "",
|
|
284
|
+
v: m(l),
|
|
285
|
+
s: l.suffix || "",
|
|
286
|
+
r: l.rounding || 0
|
|
287
|
+
}),
|
|
288
|
+
{ datapoint: l, seriesIndex: s }
|
|
289
|
+
)), 1)) : c("", !0)
|
|
290
|
+
], 64))
|
|
291
|
+
], 4)) : c("", !0),
|
|
292
|
+
(n(), i("svg", {
|
|
293
|
+
xmlns: o(ge),
|
|
294
|
+
viewBox: `0 0 ${r.value.width} ${r.value.height}`,
|
|
295
|
+
width: "100%"
|
|
296
|
+
}, [
|
|
297
|
+
ne(o(U)),
|
|
298
|
+
v("defs", null, [
|
|
299
|
+
v("linearGradient", {
|
|
300
|
+
x1: "0%",
|
|
301
|
+
y1: "0%",
|
|
302
|
+
x2: "100%",
|
|
303
|
+
y2: "0%",
|
|
304
|
+
id: `sparkbar_gradient_${s}_${L.value}`
|
|
305
|
+
}, [
|
|
306
|
+
v("stop", {
|
|
307
|
+
offset: "0%",
|
|
308
|
+
"stop-color": o(I)(o(me)(l.color, 0.03), 100 - e.value.style.bar.gradient.intensity)
|
|
309
|
+
}, null, 8, _e),
|
|
310
|
+
v("stop", {
|
|
311
|
+
offset: "100%",
|
|
312
|
+
"stop-color": l.color
|
|
313
|
+
}, null, 8, Ae)
|
|
314
|
+
], 8, Ce)
|
|
315
|
+
]),
|
|
316
|
+
v("rect", {
|
|
317
|
+
height: r.value.height,
|
|
318
|
+
width: r.value.width,
|
|
319
|
+
x: 0,
|
|
320
|
+
y: 0,
|
|
321
|
+
fill: o(I)(e.value.style.gutter.backgroundColor, e.value.style.gutter.opacity),
|
|
322
|
+
rx: r.value.height / 2
|
|
323
|
+
}, null, 8, Se),
|
|
324
|
+
v("rect", {
|
|
325
|
+
height: r.value.height,
|
|
326
|
+
width: r.value.width * F(l),
|
|
327
|
+
x: 0,
|
|
328
|
+
y: 0,
|
|
329
|
+
fill: e.value.style.bar.gradient.underlayerColor,
|
|
330
|
+
rx: r.value.height / 2
|
|
331
|
+
}, null, 8, $e),
|
|
332
|
+
v("rect", {
|
|
333
|
+
height: r.value.height,
|
|
334
|
+
width: r.value.width * F(l),
|
|
335
|
+
x: 0,
|
|
336
|
+
y: 0,
|
|
337
|
+
fill: e.value.style.bar.gradient.show ? `url(#sparkbar_gradient_${s}_${L.value})` : l.color,
|
|
338
|
+
rx: r.value.height / 2
|
|
339
|
+
}, null, 8, De)
|
|
340
|
+
], 8, we))
|
|
341
|
+
], 44, ke))), 256)),
|
|
342
|
+
t.$slots.source ? (n(), i("div", Ie, [
|
|
343
|
+
D(t.$slots, "source")
|
|
344
|
+
], 512)) : c("", !0),
|
|
345
|
+
o(k) ? (n(), ae(xe, { key: 3 })) : c("", !0)
|
|
346
|
+
], 4));
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
export {
|
|
350
|
+
Fe as default
|
|
351
|
+
};
|
|
@@ -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-D-8c0o4p.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-DKpp7RIH.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-6s4eI8W7.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
|
+
};
|