vlite3 1.1.9 → 1.1.10
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/components/Chart/BarChart.vue.js +202 -187
- package/components/Chart/LineChart.vue.js +2 -2
- package/components/Chart/LineChart.vue2.js +169 -156
- package/components/Chart/utils.js +41 -40
- package/components/ColorPicker/ColorIro.vue.js +41 -40
- package/components/Dropdown/Dropdown.vue.d.ts +1 -1
- package/components/Dropdown/Dropdown.vue.js +69 -69
- package/components/Dropdown/DropdownMenu.vue.d.ts +2 -0
- package/components/Dropdown/DropdownMenu.vue.js +2 -2
- package/components/Dropdown/DropdownMenu.vue2.js +21 -20
- package/components/Kanban/KanbanBoard.vue.js +1 -1
- package/components/Kanban/KanbanBoard.vue2.js +50 -49
- package/components/Navbar/Navbar.vue.d.ts +4 -90
- package/components/Navbar/Navbar.vue.js +37 -625
- package/components/Navbar/NavbarLayoutClassic.vue.d.ts +61 -0
- package/components/Navbar/NavbarLayoutClassic.vue.js +268 -0
- package/components/Navbar/NavbarLayoutClassic.vue2.js +4 -0
- package/components/Navbar/NavbarLayoutDashboard.vue.d.ts +37 -0
- package/components/Navbar/NavbarLayoutDashboard.vue.js +157 -0
- package/components/Navbar/NavbarLayoutDashboard.vue2.js +4 -0
- package/components/Navbar/NavbarLayoutDock.vue.d.ts +37 -0
- package/components/Navbar/NavbarLayoutDock.vue.js +156 -0
- package/components/Navbar/NavbarLayoutDock.vue2.js +4 -0
- package/components/Navbar/NavbarLayoutSidebarFirst.vue.d.ts +36 -0
- package/components/Navbar/NavbarLayoutSidebarFirst.vue.js +151 -0
- package/components/Navbar/NavbarLayoutSidebarFirst.vue2.js +4 -0
- package/components/Navbar/NavbarStandalone.vue.d.ts +48 -0
- package/components/Navbar/NavbarStandalone.vue.js +183 -0
- package/components/Navbar/NavbarStandalone.vue2.js +4 -0
- package/components/Navbar/useNavbar.d.ts +36 -0
- package/components/Navbar/useNavbar.js +134 -0
- package/components/Splitter/Splitter.vue.js +3 -3
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/navbar.type.d.ts +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { CHART_COLORS as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as se, ref as G, computed as f, onMounted as ie, watch as ce, onUnmounted as ve, openBlock as n, createElementBlock as u, Fragment as d, renderList as h, createElementVNode as w, normalizeStyle as _, createTextVNode as de, toDisplayString as p, createCommentVNode as m, unref as k, withDirectives as he, vShow as fe, createBlock as me, Teleport as ye } from "vue";
|
|
2
|
+
import { CHART_COLORS as xe, getColor as J, formatNumber as R, niceYTicks as ge, animateProgress as $e } from "./utils.js";
|
|
3
|
+
const be = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "flex flex-wrap gap-x-4 gap-y-1 mb-3 pl-14"
|
|
6
|
-
},
|
|
6
|
+
}, pe = ["width", "height"], ke = ["id"], we = ["stop-color"], Le = ["stop-color"], Me = ["id"], Ve = ["stop-color"], Ce = ["stop-color"], Be = ["transform"], Ye = ["y1", "x2", "y2", "stroke-opacity"], Re = ["y"], Xe = ["d", "fill", "opacity"], Oe = ["x", "y"], ze = ["x", "y", "text-anchor", "transform"], Se = ["y1", "x2", "y2", "stroke-opacity"], Ae = ["y2", "stroke-opacity"], Ge = ["transform"], Te = ["x1", "x2", "y2", "stroke-opacity"], We = ["x"], Pe = ["y"], He = ["d", "fill", "opacity"], Ne = ["x", "y"], Qe = ["y2", "stroke-opacity"], Ze = ["y1", "x2", "y2", "stroke-opacity"], De = { class: "font-medium text-xs mb-1.5" }, Ee = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "text-muted-foreground"
|
|
9
|
-
},
|
|
9
|
+
}, Fe = { class: "font-semibold" }, _e = /* @__PURE__ */ se({
|
|
10
10
|
__name: "BarChart",
|
|
11
11
|
props: {
|
|
12
12
|
data: {},
|
|
@@ -19,7 +19,7 @@ const ye = {
|
|
|
19
19
|
showLegend: { type: Boolean, default: !0 },
|
|
20
20
|
showTooltip: { type: Boolean, default: !0 },
|
|
21
21
|
showValues: { type: Boolean, default: !1 },
|
|
22
|
-
colors: { default: () =>
|
|
22
|
+
colors: { default: () => xe },
|
|
23
23
|
animate: { type: Boolean, default: !0 },
|
|
24
24
|
formatValue: {},
|
|
25
25
|
showXAxis: { type: Boolean, default: !0 },
|
|
@@ -30,240 +30,255 @@ const ye = {
|
|
|
30
30
|
axisOpacity: { default: 0.1 }
|
|
31
31
|
},
|
|
32
32
|
setup(i) {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
const s = i, T = G(), z = G(600), g = f(() => s.datasets?.length ? s.datasets.map((l, e) => ({
|
|
34
|
+
label: l.label,
|
|
35
|
+
color: l.color ?? J(s.colors, e),
|
|
36
|
+
values: l.data
|
|
37
|
+
})) : [
|
|
38
|
+
{
|
|
39
|
+
label: "",
|
|
40
|
+
color: "",
|
|
41
|
+
// will use per-bar color from data
|
|
42
|
+
values: (s.data ?? []).map((l) => l.value)
|
|
43
|
+
}
|
|
44
|
+
]), $ = f(() => g.value.length > 1 || !!s.datasets?.length), v = f(() => s.labels?.length ? s.labels : s.datasets?.length ? g.value[0]?.values.map((t, l) => String(l + 1)) ?? [] : (s.data ?? []).map((t) => t.label)), S = f(() => {
|
|
45
|
+
if (s.orientation !== "vertical" || !s.showXLabels || v.value.length === 0) return !1;
|
|
46
|
+
const t = Math.max(2, Math.floor(z.value / 65));
|
|
47
|
+
return v.value.length > t;
|
|
48
|
+
}), b = f(() => {
|
|
49
|
+
const t = (o) => String(o).length;
|
|
50
|
+
if (s.orientation === "horizontal") {
|
|
51
|
+
const o = s.showYLabels ? Math.max(2, ...v.value.map((y) => t(y))) * 6.5 : 0, r = s.showYLabels ? Math.max(24, o + 12) : 8;
|
|
52
|
+
let M = 16;
|
|
53
|
+
if (s.showValues) {
|
|
54
|
+
const y = g.value.flatMap((C) => C.values), V = Math.max(2, ...y.map((C) => t(s.formatValue ? s.formatValue(C) : R(C)))) * 6.5;
|
|
55
|
+
M = Math.max(16, V + 8);
|
|
41
56
|
}
|
|
42
57
|
return {
|
|
43
58
|
// top holds the value-tick labels that float above; collapse when hidden
|
|
44
|
-
top:
|
|
45
|
-
right:
|
|
59
|
+
top: s.showXLabels ? 16 : 4,
|
|
60
|
+
right: M,
|
|
46
61
|
bottom: 0,
|
|
47
|
-
left:
|
|
62
|
+
left: r
|
|
48
63
|
};
|
|
49
64
|
}
|
|
50
|
-
const l =
|
|
51
|
-
|
|
65
|
+
const l = s.showYLabels ? Math.max(2, ...B.value.map((o) => t(s.formatValue ? s.formatValue(o) : R(o)))) * 6.5 : 0, e = s.showYLabels ? Math.max(24, l + 12) : 8;
|
|
66
|
+
let a = s.showXLabels ? 24 : 6;
|
|
67
|
+
return s.showXLabels && S.value && (a = Math.max(2, ...v.value.map((r) => String(r).length)) * 6.5 * 0.7 + 16), {
|
|
52
68
|
top: 24,
|
|
53
69
|
right: 0,
|
|
54
|
-
|
|
55
|
-
bottom: r.showXLabels ? 24 : 6,
|
|
70
|
+
bottom: a,
|
|
56
71
|
left: e
|
|
57
72
|
};
|
|
58
|
-
}),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}))
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
let N = null;
|
|
73
|
-
function _() {
|
|
74
|
-
N?.(), S.value = 0, N = he(800, (t) => S.value = t);
|
|
73
|
+
}), x = f(() => Math.max(0, z.value - b.value.left - b.value.right)), c = f(() => Math.max(0, s.height - b.value.top - b.value.bottom)), Z = f(() => {
|
|
74
|
+
if (s.orientation !== "vertical") return 1;
|
|
75
|
+
const t = S.value ? 25 : 65, l = Math.max(2, Math.floor(x.value / t));
|
|
76
|
+
return Math.ceil(v.value.length / l);
|
|
77
|
+
}), K = (t) => {
|
|
78
|
+
if (s.orientation !== "vertical") return !0;
|
|
79
|
+
const l = v.value.length;
|
|
80
|
+
return Z.value <= 1 || t === 0 || t === l - 1 ? !0 : l - 1 - t < Z.value * 0.7 ? !1 : t % Z.value === 0;
|
|
81
|
+
}, W = f(
|
|
82
|
+
() => (s.data ?? []).map((t, l) => t.color ?? J(s.colors, l))
|
|
83
|
+
), ee = f(() => g.value.flatMap((t) => t.values)), j = f(() => Math.max(...ee.value) || 1), B = f(() => ge(0, j.value, 5)), L = f(() => B.value[B.value.length - 1] || j.value), P = G(s.animate ? 0 : 1);
|
|
84
|
+
let D = null;
|
|
85
|
+
function q() {
|
|
86
|
+
D?.(), P.value = 0, D = $e(800, (t) => P.value = t);
|
|
75
87
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}),
|
|
79
|
-
|
|
80
|
-
}, { deep: !0 }),
|
|
81
|
-
|
|
88
|
+
ie(() => {
|
|
89
|
+
te(), s.animate && q();
|
|
90
|
+
}), ce(() => [s.data, s.datasets], () => {
|
|
91
|
+
s.animate && q();
|
|
92
|
+
}, { deep: !0 }), ve(() => {
|
|
93
|
+
D?.(), E?.disconnect();
|
|
82
94
|
});
|
|
83
|
-
let
|
|
84
|
-
function
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}),
|
|
95
|
+
let E = null;
|
|
96
|
+
function te() {
|
|
97
|
+
T.value && (E = new ResizeObserver((t) => {
|
|
98
|
+
z.value = t[0].contentRect.width || 600;
|
|
99
|
+
}), E.observe(T.value), z.value = T.value.clientWidth || 600);
|
|
88
100
|
}
|
|
89
|
-
const
|
|
90
|
-
const t =
|
|
101
|
+
const le = f(() => {
|
|
102
|
+
const t = v.value.length;
|
|
91
103
|
if (t === 0) return [];
|
|
92
|
-
const l =
|
|
93
|
-
return
|
|
94
|
-
const
|
|
95
|
-
const
|
|
96
|
-
return { val:
|
|
104
|
+
const l = x.value / t, e = g.value.length, a = l * 0.2, o = l - a * 2, r = $.value ? o / e : o;
|
|
105
|
+
return v.value.map((M, y) => {
|
|
106
|
+
const V = y * l + a, C = g.value.map((H, N) => {
|
|
107
|
+
const Q = H.values[y] ?? 0, A = Q / L.value * c.value * P.value, F = V + N * r, I = c.value - A, U = $.value ? H.color : W.value[y];
|
|
108
|
+
return { val: Q, bh: A, x: F, y: I, w: r - ($.value ? 2 : 0), color: U };
|
|
97
109
|
});
|
|
98
|
-
return { label:
|
|
110
|
+
return { label: M, bars: C };
|
|
99
111
|
});
|
|
100
|
-
}),
|
|
101
|
-
const t =
|
|
112
|
+
}), ae = f(() => {
|
|
113
|
+
const t = v.value.length;
|
|
102
114
|
if (t === 0) return [];
|
|
103
|
-
const l = c.value / t, e =
|
|
104
|
-
return
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
return { val:
|
|
115
|
+
const l = c.value / t, e = g.value.length, a = l * 0.2, o = l - a * 2, r = $.value ? o / e : o, M = L.value;
|
|
116
|
+
return v.value.map((y, V) => {
|
|
117
|
+
const C = V * l + a, H = g.value.map((N, Q) => {
|
|
118
|
+
const A = N.values[V] ?? 0, F = A / M * x.value * P.value, I = C + Q * r, U = $.value ? N.color : W.value[V];
|
|
119
|
+
return { val: A, bw: F, x: 0, y: I, h: r - ($.value ? 2 : 0), color: U };
|
|
108
120
|
});
|
|
109
|
-
return { label: y, bars:
|
|
121
|
+
return { label: y, bars: H };
|
|
110
122
|
});
|
|
111
|
-
}),
|
|
112
|
-
function
|
|
113
|
-
if (!
|
|
114
|
-
const l = t.currentTarget.getBoundingClientRect(), e = t.clientX - l.left -
|
|
115
|
-
if (
|
|
116
|
-
let
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
color:
|
|
123
|
+
}), Y = G(null), X = G(null);
|
|
124
|
+
function oe(t) {
|
|
125
|
+
if (!s.showTooltip) return;
|
|
126
|
+
const l = t.currentTarget.getBoundingClientRect(), e = t.clientX - l.left - b.value.left, a = t.clientY - l.top - b.value.top, o = v.value.length;
|
|
127
|
+
if (o === 0) return;
|
|
128
|
+
let r;
|
|
129
|
+
s.orientation === "vertical" ? r = Math.floor(e / x.value * o) : r = Math.floor(a / c.value * o), r = Math.max(0, Math.min(o - 1, r)), X.value = r;
|
|
130
|
+
const M = g.value.map((y, V) => ({
|
|
131
|
+
color: $.value ? y.color : W.value[r],
|
|
120
132
|
label: y.label,
|
|
121
|
-
value:
|
|
133
|
+
value: s.formatValue ? s.formatValue(y.values[r]) : R(y.values[r])
|
|
122
134
|
}));
|
|
123
|
-
|
|
135
|
+
Y.value = {
|
|
124
136
|
x: t.clientX,
|
|
125
137
|
y: t.clientY,
|
|
126
|
-
label:
|
|
127
|
-
items:
|
|
138
|
+
label: v.value[r],
|
|
139
|
+
items: M
|
|
128
140
|
};
|
|
129
141
|
}
|
|
130
|
-
function
|
|
131
|
-
|
|
142
|
+
function ne() {
|
|
143
|
+
Y.value = null, X.value = null;
|
|
132
144
|
}
|
|
133
|
-
function
|
|
134
|
-
const
|
|
135
|
-
return
|
|
145
|
+
function ue(t, l, e, a, o) {
|
|
146
|
+
const r = Math.min(o, e / 2, a / 2);
|
|
147
|
+
return r <= 0 || a <= 0 ? `M${t},${l + a} L${t},${l} L${t + e},${l} L${t + e},${l + a} Z` : `M${t},${l + a} L${t},${l + r} Q${t},${l} ${t + r},${l} L${t + e - r},${l} Q${t + e},${l} ${t + e},${l + r} L${t + e},${l + a} Z`;
|
|
136
148
|
}
|
|
137
|
-
function
|
|
138
|
-
const
|
|
139
|
-
return
|
|
149
|
+
function re(t, l, e, a, o) {
|
|
150
|
+
const r = Math.min(o, e / 2, a / 2);
|
|
151
|
+
return r <= 0 || e <= 0 ? `M${t},${l} L${t + e},${l} L${t + e},${l + a} L${t},${l + a} Z` : `M${t},${l} L${t + e - r},${l} Q${t + e},${l} ${t + e},${l + r} L${t + e},${l + a - r} Q${t + e},${l + a} ${t + e - r},${l + a} L${t},${l + a} Z`;
|
|
140
152
|
}
|
|
141
153
|
const O = Math.random().toString(36).slice(2, 7);
|
|
142
|
-
return (t, l) => (
|
|
154
|
+
return (t, l) => (n(), u("div", {
|
|
143
155
|
ref_key: "containerRef",
|
|
144
|
-
ref:
|
|
156
|
+
ref: T,
|
|
145
157
|
class: "vlite-bar-chart w-full select-none"
|
|
146
158
|
}, [
|
|
147
|
-
i.showLegend &&
|
|
148
|
-
(
|
|
159
|
+
i.showLegend && $.value ? (n(), u("div", be, [
|
|
160
|
+
(n(!0), u(d, null, h(g.value, (e) => (n(), u("div", {
|
|
149
161
|
key: e.label,
|
|
150
162
|
class: "flex items-center gap-1.5 text-xs text-muted-foreground"
|
|
151
163
|
}, [
|
|
152
|
-
|
|
164
|
+
w("span", {
|
|
153
165
|
class: "w-2.5 h-2.5 rounded-sm inline-block",
|
|
154
|
-
style:
|
|
166
|
+
style: _({ backgroundColor: e.color })
|
|
155
167
|
}, null, 4),
|
|
156
|
-
|
|
168
|
+
de(" " + p(e.label), 1)
|
|
157
169
|
]))), 128))
|
|
158
|
-
])) :
|
|
159
|
-
(
|
|
160
|
-
width:
|
|
170
|
+
])) : m("", !0),
|
|
171
|
+
(n(), u("svg", {
|
|
172
|
+
width: z.value,
|
|
161
173
|
height: i.height,
|
|
162
174
|
role: "img",
|
|
163
175
|
"aria-label": "Bar chart",
|
|
164
176
|
class: "overflow-visible",
|
|
165
|
-
onMousemove:
|
|
166
|
-
onMouseleave:
|
|
177
|
+
onMousemove: oe,
|
|
178
|
+
onMouseleave: ne
|
|
167
179
|
}, [
|
|
168
|
-
|
|
169
|
-
(
|
|
180
|
+
w("defs", null, [
|
|
181
|
+
(n(!0), u(d, null, h(g.value, (e, a) => (n(), u("linearGradient", {
|
|
170
182
|
key: a,
|
|
171
|
-
id: `bgrad-${
|
|
183
|
+
id: `bgrad-${k(O)}-${a}`,
|
|
172
184
|
x1: "0",
|
|
173
185
|
y1: "0",
|
|
174
186
|
x2: "0",
|
|
175
187
|
y2: "1"
|
|
176
188
|
}, [
|
|
177
|
-
|
|
189
|
+
w("stop", {
|
|
178
190
|
offset: "0%",
|
|
179
191
|
"stop-color": e.color,
|
|
180
192
|
"stop-opacity": "1"
|
|
181
|
-
}, null, 8,
|
|
182
|
-
|
|
193
|
+
}, null, 8, we),
|
|
194
|
+
w("stop", {
|
|
183
195
|
offset: "100%",
|
|
184
196
|
"stop-color": e.color,
|
|
185
197
|
"stop-opacity": "0.7"
|
|
186
|
-
}, null, 8,
|
|
187
|
-
], 8,
|
|
188
|
-
(
|
|
198
|
+
}, null, 8, Le)
|
|
199
|
+
], 8, ke))), 128)),
|
|
200
|
+
(n(!0), u(d, null, h(W.value, (e, a) => (n(), u("linearGradient", {
|
|
189
201
|
key: `sc-${a}`,
|
|
190
|
-
id: `bgrad-single-${
|
|
202
|
+
id: `bgrad-single-${k(O)}-${a}`,
|
|
191
203
|
x1: "0",
|
|
192
204
|
y1: "0",
|
|
193
205
|
x2: "0",
|
|
194
206
|
y2: "1"
|
|
195
207
|
}, [
|
|
196
|
-
|
|
208
|
+
w("stop", {
|
|
197
209
|
offset: "0%",
|
|
198
210
|
"stop-color": e,
|
|
199
211
|
"stop-opacity": "1"
|
|
200
|
-
}, null, 8,
|
|
201
|
-
|
|
212
|
+
}, null, 8, Ve),
|
|
213
|
+
w("stop", {
|
|
202
214
|
offset: "100%",
|
|
203
215
|
"stop-color": e,
|
|
204
216
|
"stop-opacity": "0.7"
|
|
205
|
-
}, null, 8,
|
|
206
|
-
], 8,
|
|
217
|
+
}, null, 8, Ce)
|
|
218
|
+
], 8, Me))), 128))
|
|
207
219
|
]),
|
|
208
|
-
i.orientation === "vertical" ? (
|
|
220
|
+
i.orientation === "vertical" ? (n(), u("g", {
|
|
209
221
|
key: 0,
|
|
210
|
-
transform: `translate(${
|
|
222
|
+
transform: `translate(${b.value.left},${b.value.top})`
|
|
211
223
|
}, [
|
|
212
|
-
i.showGrid ? (
|
|
224
|
+
i.showGrid ? (n(!0), u(d, { key: 0 }, h(B.value, (e) => (n(), u("line", {
|
|
213
225
|
key: e,
|
|
214
226
|
x1: 0,
|
|
215
|
-
y1: c.value - e /
|
|
216
|
-
x2:
|
|
217
|
-
y2: c.value - e /
|
|
227
|
+
y1: c.value - e / L.value * c.value,
|
|
228
|
+
x2: x.value,
|
|
229
|
+
y2: c.value - e / L.value * c.value,
|
|
218
230
|
stroke: "currentColor",
|
|
219
231
|
"stroke-opacity": i.gridOpacity,
|
|
220
232
|
"stroke-width": "1"
|
|
221
|
-
}, null, 8,
|
|
222
|
-
i.showYLabels ? (
|
|
233
|
+
}, null, 8, Ye))), 128)) : m("", !0),
|
|
234
|
+
i.showYLabels ? (n(!0), u(d, { key: 1 }, h(B.value, (e) => (n(), u("text", {
|
|
223
235
|
key: `yt-${e}`,
|
|
224
236
|
x: -10,
|
|
225
|
-
y: c.value - e /
|
|
237
|
+
y: c.value - e / L.value * c.value,
|
|
226
238
|
"text-anchor": "end",
|
|
227
239
|
"dominant-baseline": "middle",
|
|
228
240
|
"font-size": "11",
|
|
229
241
|
class: "fill-muted-foreground"
|
|
230
|
-
},
|
|
231
|
-
(
|
|
232
|
-
(
|
|
233
|
-
key:
|
|
234
|
-
d:
|
|
235
|
-
fill:
|
|
236
|
-
opacity:
|
|
242
|
+
}, p(i.formatValue ? i.formatValue(e) : k(R)(e)), 9, Re))), 128)) : m("", !0),
|
|
243
|
+
(n(!0), u(d, null, h(le.value, (e, a) => (n(), u("g", { key: a }, [
|
|
244
|
+
(n(!0), u(d, null, h(e.bars, (o, r) => (n(), u("path", {
|
|
245
|
+
key: r,
|
|
246
|
+
d: ue(o.x, o.y, o.w, o.bh, i.barRadius),
|
|
247
|
+
fill: $.value ? `url(#bgrad-${k(O)}-${r})` : `url(#bgrad-single-${k(O)}-${a})`,
|
|
248
|
+
opacity: X.value !== null && X.value !== a ? 0.5 : 1,
|
|
237
249
|
class: "transition-opacity duration-150"
|
|
238
|
-
}, null, 8,
|
|
239
|
-
i.showValues ? (
|
|
240
|
-
key: `vl-${
|
|
241
|
-
x:
|
|
242
|
-
y:
|
|
250
|
+
}, null, 8, Xe))), 128)),
|
|
251
|
+
i.showValues ? (n(!0), u(d, { key: 0 }, h(e.bars, (o, r) => (n(), u("text", {
|
|
252
|
+
key: `vl-${r}`,
|
|
253
|
+
x: o.x + o.w / 2,
|
|
254
|
+
y: o.y - 6,
|
|
243
255
|
"text-anchor": "middle",
|
|
244
256
|
"font-size": "10",
|
|
245
257
|
"font-weight": "600",
|
|
246
258
|
class: "fill-foreground"
|
|
247
|
-
},
|
|
259
|
+
}, p(i.formatValue ? i.formatValue(o.val) : k(R)(o.val)), 9, Oe))), 128)) : m("", !0)
|
|
248
260
|
]))), 128)),
|
|
249
|
-
i.showXLabels ? (
|
|
261
|
+
i.showXLabels ? (n(!0), u(d, { key: 2 }, h(v.value, (e, a) => he((n(), u("text", {
|
|
250
262
|
key: `xl-${a}`,
|
|
251
|
-
x: (a + 0.5) * (
|
|
252
|
-
y: c.value + 16,
|
|
253
|
-
"text-anchor": "middle",
|
|
263
|
+
x: (a + 0.5) * (x.value / v.value.length),
|
|
264
|
+
y: c.value + (S.value ? 12 : 16),
|
|
265
|
+
"text-anchor": S.value ? "end" : "middle",
|
|
266
|
+
transform: S.value ? `rotate(-45, ${(a + 0.5) * (x.value / v.value.length)}, ${c.value + 12})` : void 0,
|
|
254
267
|
"font-size": "11",
|
|
255
268
|
class: "fill-muted-foreground"
|
|
256
|
-
},
|
|
257
|
-
|
|
269
|
+
}, p(e), 9, ze)), [
|
|
270
|
+
[fe, K(a)]
|
|
271
|
+
])), 128)) : m("", !0),
|
|
272
|
+
i.showXAxis ? (n(), u("line", {
|
|
258
273
|
key: 3,
|
|
259
274
|
x1: 0,
|
|
260
275
|
y1: c.value,
|
|
261
|
-
x2:
|
|
276
|
+
x2: x.value,
|
|
262
277
|
y2: c.value,
|
|
263
278
|
stroke: "currentColor",
|
|
264
279
|
"stroke-opacity": i.axisOpacity
|
|
265
|
-
}, null, 8,
|
|
266
|
-
i.showYAxis ? (
|
|
280
|
+
}, null, 8, Se)) : m("", !0),
|
|
281
|
+
i.showYAxis ? (n(), u("line", {
|
|
267
282
|
key: 4,
|
|
268
283
|
x1: 0,
|
|
269
284
|
y1: 0,
|
|
@@ -271,57 +286,57 @@ const ye = {
|
|
|
271
286
|
y2: c.value,
|
|
272
287
|
stroke: "currentColor",
|
|
273
288
|
"stroke-opacity": i.axisOpacity
|
|
274
|
-
}, null, 8,
|
|
275
|
-
], 8,
|
|
289
|
+
}, null, 8, Ae)) : m("", !0)
|
|
290
|
+
], 8, Be)) : (n(), u("g", {
|
|
276
291
|
key: 1,
|
|
277
|
-
transform: `translate(${
|
|
292
|
+
transform: `translate(${b.value.left},${b.value.top})`
|
|
278
293
|
}, [
|
|
279
|
-
i.showGrid ? (
|
|
294
|
+
i.showGrid ? (n(!0), u(d, { key: 0 }, h(B.value, (e) => (n(), u("line", {
|
|
280
295
|
key: e,
|
|
281
|
-
x1: e /
|
|
296
|
+
x1: e / L.value * x.value,
|
|
282
297
|
y1: 0,
|
|
283
|
-
x2: e /
|
|
298
|
+
x2: e / L.value * x.value,
|
|
284
299
|
y2: c.value,
|
|
285
300
|
stroke: "currentColor",
|
|
286
301
|
"stroke-opacity": i.gridOpacity,
|
|
287
302
|
"stroke-width": "1"
|
|
288
|
-
}, null, 8,
|
|
289
|
-
i.showXLabels ? (
|
|
303
|
+
}, null, 8, Te))), 128)) : m("", !0),
|
|
304
|
+
i.showXLabels ? (n(!0), u(d, { key: 1 }, h(B.value, (e) => (n(), u("text", {
|
|
290
305
|
key: `xt-${e}`,
|
|
291
|
-
x: e /
|
|
306
|
+
x: e / L.value * x.value,
|
|
292
307
|
y: -8,
|
|
293
308
|
"text-anchor": "middle",
|
|
294
309
|
"font-size": "11",
|
|
295
310
|
class: "fill-muted-foreground"
|
|
296
|
-
},
|
|
297
|
-
i.showYLabels ? (
|
|
311
|
+
}, p(i.formatValue ? i.formatValue(e) : k(R)(e)), 9, We))), 128)) : m("", !0),
|
|
312
|
+
i.showYLabels ? (n(!0), u(d, { key: 2 }, h(v.value, (e, a) => (n(), u("text", {
|
|
298
313
|
key: `yl-${a}`,
|
|
299
314
|
x: -12,
|
|
300
|
-
y: (a + 0.5) * (c.value /
|
|
315
|
+
y: (a + 0.5) * (c.value / v.value.length),
|
|
301
316
|
"text-anchor": "end",
|
|
302
317
|
"dominant-baseline": "middle",
|
|
303
318
|
"font-size": "11",
|
|
304
319
|
class: "fill-muted-foreground"
|
|
305
|
-
},
|
|
306
|
-
(
|
|
307
|
-
(
|
|
308
|
-
key:
|
|
309
|
-
d:
|
|
310
|
-
fill:
|
|
311
|
-
opacity:
|
|
320
|
+
}, p(e), 9, Pe))), 128)) : m("", !0),
|
|
321
|
+
(n(!0), u(d, null, h(ae.value, (e, a) => (n(), u("g", { key: a }, [
|
|
322
|
+
(n(!0), u(d, null, h(e.bars, (o, r) => (n(), u("path", {
|
|
323
|
+
key: r,
|
|
324
|
+
d: re(o.x, o.y, o.bw, o.h, i.barRadius),
|
|
325
|
+
fill: $.value ? `url(#bgrad-${k(O)}-${r})` : `url(#bgrad-single-${k(O)}-${a})`,
|
|
326
|
+
opacity: X.value !== null && X.value !== a ? 0.5 : 1,
|
|
312
327
|
class: "transition-opacity duration-150"
|
|
313
|
-
}, null, 8,
|
|
314
|
-
i.showValues ? (
|
|
315
|
-
key: `hvl-${
|
|
316
|
-
x:
|
|
317
|
-
y:
|
|
328
|
+
}, null, 8, He))), 128)),
|
|
329
|
+
i.showValues ? (n(!0), u(d, { key: 0 }, h(e.bars, (o, r) => (n(), u("text", {
|
|
330
|
+
key: `hvl-${r}`,
|
|
331
|
+
x: o.bw + 6,
|
|
332
|
+
y: o.y + o.h / 2,
|
|
318
333
|
"dominant-baseline": "middle",
|
|
319
334
|
"font-size": "10",
|
|
320
335
|
"font-weight": "600",
|
|
321
336
|
class: "fill-foreground"
|
|
322
|
-
},
|
|
337
|
+
}, p(i.formatValue ? i.formatValue(o.val) : k(R)(o.val)), 9, Ne))), 128)) : m("", !0)
|
|
323
338
|
]))), 128)),
|
|
324
|
-
i.showYAxis ? (
|
|
339
|
+
i.showYAxis ? (n(), u("line", {
|
|
325
340
|
key: 3,
|
|
326
341
|
x1: 0,
|
|
327
342
|
y1: 0,
|
|
@@ -329,41 +344,41 @@ const ye = {
|
|
|
329
344
|
y2: c.value,
|
|
330
345
|
stroke: "currentColor",
|
|
331
346
|
"stroke-opacity": i.axisOpacity
|
|
332
|
-
}, null, 8,
|
|
333
|
-
i.showXAxis ? (
|
|
347
|
+
}, null, 8, Qe)) : m("", !0),
|
|
348
|
+
i.showXAxis ? (n(), u("line", {
|
|
334
349
|
key: 4,
|
|
335
350
|
x1: 0,
|
|
336
351
|
y1: c.value,
|
|
337
|
-
x2:
|
|
352
|
+
x2: x.value,
|
|
338
353
|
y2: c.value,
|
|
339
354
|
stroke: "currentColor",
|
|
340
355
|
"stroke-opacity": i.axisOpacity
|
|
341
|
-
}, null, 8,
|
|
342
|
-
], 8,
|
|
343
|
-
], 40,
|
|
344
|
-
(
|
|
345
|
-
|
|
356
|
+
}, null, 8, Ze)) : m("", !0)
|
|
357
|
+
], 8, Ge))
|
|
358
|
+
], 40, pe)),
|
|
359
|
+
(n(), me(ye, { to: "body" }, [
|
|
360
|
+
Y.value ? (n(), u("div", {
|
|
346
361
|
key: 0,
|
|
347
362
|
class: "vlite-chart-tooltip",
|
|
348
|
-
style:
|
|
363
|
+
style: _({ left: `${Y.value.x + 12}px`, top: `${Y.value.y - 10}px` })
|
|
349
364
|
}, [
|
|
350
|
-
|
|
351
|
-
(
|
|
365
|
+
w("div", De, p(Y.value.label), 1),
|
|
366
|
+
(n(!0), u(d, null, h(Y.value.items, (e) => (n(), u("div", {
|
|
352
367
|
key: e.label,
|
|
353
368
|
class: "flex items-center gap-1.5 text-xs"
|
|
354
369
|
}, [
|
|
355
|
-
|
|
370
|
+
w("span", {
|
|
356
371
|
class: "w-2 h-2 rounded-sm shrink-0",
|
|
357
|
-
style:
|
|
372
|
+
style: _({ backgroundColor: e.color })
|
|
358
373
|
}, null, 4),
|
|
359
|
-
e.label ? (
|
|
360
|
-
|
|
374
|
+
e.label ? (n(), u("span", Ee, p(e.label) + ":", 1)) : m("", !0),
|
|
375
|
+
w("span", Fe, p(e.value), 1)
|
|
361
376
|
]))), 128))
|
|
362
|
-
], 4)) :
|
|
377
|
+
], 4)) : m("", !0)
|
|
363
378
|
]))
|
|
364
379
|
], 512));
|
|
365
380
|
}
|
|
366
381
|
});
|
|
367
382
|
export {
|
|
368
|
-
|
|
383
|
+
_e as default
|
|
369
384
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./LineChart.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-07c9fb47"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|