vlite3 1.4.24 → 1.4.26
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/AppShell/AppShell.vue.d.ts +2 -0
- package/components/AppShell/AppShell.vue.js +11 -9
- package/components/AppShell/AppShellLayoutClassic.vue.js +34 -32
- package/components/AppShell/AppShellLayoutDashboard.vue.js +51 -49
- package/components/AppShell/AppShellLayoutDock.vue.js +52 -50
- package/components/AppShell/AppShellLayoutHeaderShell.vue.js +56 -54
- package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +51 -49
- package/components/AppShell/AppShellLayoutStorefront.vue.js +40 -38
- package/components/AppShell/useAppShell.js +1 -1
- package/components/CategoryManager/CategoryManager.vue2.js +2 -2
- package/components/Chart/BarChart.vue.d.ts +1 -1
- package/components/Chart/ChartLegend.vue.d.ts +22 -0
- package/components/Chart/ChartLegend.vue.js +91 -0
- package/components/Chart/ChartLegend.vue2.js +4 -0
- package/components/Chart/GanttChart.vue.d.ts +2 -2
- package/components/Chart/GanttChart.vue.js +1 -1
- package/components/Chart/GanttChart.vue2.js +367 -364
- package/components/Chart/LineChart.vue.d.ts +5 -2
- package/components/Chart/LineChart.vue.js +1 -1
- package/components/Chart/LineChart.vue2.js +40 -39
- package/components/Chart/PieChart.vue.d.ts +11 -4
- package/components/Chart/PieChart.vue.js +118 -114
- package/components/Chart/SegmentBarChart.vue.d.ts +1 -1
- package/components/Chart/TimelineChart.vue.d.ts +2 -2
- package/components/Chart/index.d.ts +2 -1
- package/components/Chart/types.d.ts +27 -0
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +131 -127
- package/components/Heatmap/Heatmap.vue.d.ts +1 -1
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
- package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
- package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
- package/components/Screen/ScreenFilter.vue.js +2 -2
- package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
- package/components/Stats/StatItem.vue.d.ts +2 -0
- package/components/Stats/StatItem.vue.js +234 -134
- package/components/Stats/Stats.vue.d.ts +1 -0
- package/components/Stats/Stats.vue.js +45 -41
- package/components/Stats/components/StatTrend.vue.js +35 -32
- package/components/Stats/types.d.ts +32 -2
- package/index.js +138 -136
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/appshell.type.d.ts +2 -0
- /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
- /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
|
@@ -31,6 +31,8 @@ export interface LineChartProps {
|
|
|
31
31
|
axisOpacity?: number;
|
|
32
32
|
/** Stroke width of the chart lines */
|
|
33
33
|
lineWidth?: number;
|
|
34
|
+
/** Top stop opacity for the area fill gradient (0–1) */
|
|
35
|
+
fillOpacity?: number;
|
|
34
36
|
}
|
|
35
37
|
declare const _default: import('vue').DefineComponent<LineChartProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<LineChartProps> & Readonly<{}>, {
|
|
36
38
|
fill: boolean;
|
|
@@ -38,10 +40,10 @@ declare const _default: import('vue').DefineComponent<LineChartProps, {}, {}, {}
|
|
|
38
40
|
height: number;
|
|
39
41
|
colors: string[];
|
|
40
42
|
smooth: boolean;
|
|
41
|
-
showLegend: boolean;
|
|
42
|
-
showTooltip: boolean;
|
|
43
43
|
showDots: boolean;
|
|
44
44
|
showGrid: boolean;
|
|
45
|
+
showLegend: boolean;
|
|
46
|
+
showTooltip: boolean;
|
|
45
47
|
showXAxis: boolean;
|
|
46
48
|
showYAxis: boolean;
|
|
47
49
|
showXLabels: boolean;
|
|
@@ -49,6 +51,7 @@ declare const _default: import('vue').DefineComponent<LineChartProps, {}, {}, {}
|
|
|
49
51
|
gridOpacity: number;
|
|
50
52
|
axisOpacity: number;
|
|
51
53
|
lineWidth: number;
|
|
54
|
+
fillOpacity: number;
|
|
52
55
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
53
56
|
containerRef: HTMLDivElement;
|
|
54
57
|
}, HTMLDivElement>;
|
|
@@ -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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-044e962d"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as ae, ref as
|
|
1
|
+
import { defineComponent as ae, ref as R, computed as r, onMounted as oe, watch as ne, onUnmounted as ue, openBlock as o, createElementBlock as n, Fragment as p, renderList as g, createElementVNode as h, normalizeStyle as W, createTextVNode as se, toDisplayString as b, createCommentVNode as i, unref as M, withDirectives as re, vShow as ie, createBlock as ce, Teleport as de } from "vue";
|
|
2
2
|
import { CHART_COLORS as he, formatNumber as D, getColor as E, niceYTicks as ve, smoothPath as fe, linearPath as ye, animateProgress as me } from "./utils.js";
|
|
3
3
|
const xe = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "flex flex-wrap gap-x-4 gap-y-1 mb-3 pl-14"
|
|
6
|
-
}, pe = ["width", "height"], ge = ["id"], be = ["width", "height"], ke = ["id"], we = ["stop-color"], Me = ["stop-color"], Le = ["transform"], $e = ["y1", "x2", "y2", "stroke-opacity"], Be = ["y"], Ce = ["x", "y", "text-anchor", "transform"],
|
|
6
|
+
}, pe = ["width", "height"], ge = ["id"], be = ["width", "height"], ke = ["id"], we = ["stop-color", "stop-opacity"], Me = ["stop-color"], Le = ["transform"], $e = ["y1", "x2", "y2", "stroke-opacity"], Be = ["y"], Ce = ["x", "y", "text-anchor", "transform"], Ve = ["y1", "x2", "y2", "stroke-opacity"], _e = ["y2", "stroke-opacity"], Xe = ["x1", "x2", "y2"], Oe = ["d", "fill", "clip-path"], Re = ["d", "stroke", "stroke-width", "clip-path"], Se = ["cx", "cy", "r", "fill", "opacity", "clip-path"], Ye = ["x", "y"], Pe = ["x", "y"], ze = { class: "font-medium text-xs mb-1.5" }, Ae = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "text-muted-foreground"
|
|
9
9
|
}, Te = { class: "font-semibold" }, Ne = /* @__PURE__ */ ae({
|
|
@@ -32,17 +32,18 @@ const xe = {
|
|
|
32
32
|
showYLabels: { type: Boolean, default: !0 },
|
|
33
33
|
gridOpacity: { default: 0.07 },
|
|
34
34
|
axisOpacity: { default: 0.1 },
|
|
35
|
-
lineWidth: { default: 2.5 }
|
|
35
|
+
lineWidth: { default: 2.5 },
|
|
36
|
+
fillOpacity: { default: 0.25 }
|
|
36
37
|
},
|
|
37
38
|
setup(u) {
|
|
38
|
-
const l = u, L =
|
|
39
|
+
const l = u, L = R(), X = R(600), y = r(() => l.labels?.length ? l.labels : l.datasets?.length ? l.datasets[0].data.map((t, a) => String(a + 1)) : (l.data ?? []).map((t) => t.label)), O = r(() => {
|
|
39
40
|
if (!l.showXLabels || y.value.length === 0) return !1;
|
|
40
41
|
const t = Math.max(2, Math.floor(X.value / 65));
|
|
41
42
|
return y.value.length > t;
|
|
42
43
|
}), v = r(() => {
|
|
43
44
|
const t = (c) => String(c).length, a = l.showYLabels ? Math.max(2, ...$.value.map((c) => t(l.formatValue ? l.formatValue(c) : D(c)))) * 6.5 : 0, e = l.showYLabels ? Math.max(24, a + 12) : 8;
|
|
44
45
|
let s = l.showXLabels ? 24 : 6;
|
|
45
|
-
return l.showXLabels &&
|
|
46
|
+
return l.showXLabels && O.value && (s = Math.max(2, ...y.value.map((m) => String(m).length)) * 6.5 * 0.7 + 16), {
|
|
46
47
|
top: 16,
|
|
47
48
|
right: 16,
|
|
48
49
|
bottom: s,
|
|
@@ -64,7 +65,7 @@ const xe = {
|
|
|
64
65
|
}
|
|
65
66
|
];
|
|
66
67
|
}), P = r(() => {
|
|
67
|
-
const t =
|
|
68
|
+
const t = O.value ? 25 : 65, a = Math.max(2, Math.floor(f.value / t));
|
|
68
69
|
return Math.ceil(y.value.length / a);
|
|
69
70
|
}), F = (t) => {
|
|
70
71
|
const a = y.value.length;
|
|
@@ -77,7 +78,7 @@ const xe = {
|
|
|
77
78
|
const a = y.value.length;
|
|
78
79
|
return a < 2 ? f.value / 2 : t / (a - 1) * f.value;
|
|
79
80
|
}
|
|
80
|
-
const
|
|
81
|
+
const S = R(l.animate ? 0 : 1);
|
|
81
82
|
let A = null;
|
|
82
83
|
function Z(t) {
|
|
83
84
|
return t.map((a, e) => [C(e), B(a)]);
|
|
@@ -89,8 +90,8 @@ const xe = {
|
|
|
89
90
|
})
|
|
90
91
|
);
|
|
91
92
|
function G() {
|
|
92
|
-
A?.(),
|
|
93
|
-
|
|
93
|
+
A?.(), S.value = 0, A = me(900, (t) => {
|
|
94
|
+
S.value = t;
|
|
94
95
|
});
|
|
95
96
|
}
|
|
96
97
|
oe(() => {
|
|
@@ -110,17 +111,17 @@ const xe = {
|
|
|
110
111
|
X.value = t[0].contentRect.width || 600;
|
|
111
112
|
}), T.observe(L.value), X.value = L.value.clientWidth || 600);
|
|
112
113
|
}
|
|
113
|
-
const w =
|
|
114
|
+
const w = R(null), V = R(null);
|
|
114
115
|
function K(t) {
|
|
115
116
|
if (!l.showTooltip) return;
|
|
116
117
|
const a = t.currentTarget.getBoundingClientRect(), e = t.clientX - a.left - v.value.left, s = y.value.length;
|
|
117
118
|
if (s === 0) return;
|
|
118
119
|
const c = s < 2 ? f.value : f.value / (s - 1), m = Math.round(e / c), x = Math.max(0, Math.min(s - 1, m));
|
|
119
|
-
|
|
120
|
-
const ee = k.value.map((
|
|
121
|
-
color:
|
|
122
|
-
label:
|
|
123
|
-
value: l.formatValue ? l.formatValue(
|
|
120
|
+
V.value = x;
|
|
121
|
+
const ee = k.value.map((Y) => ({
|
|
122
|
+
color: Y.color,
|
|
123
|
+
label: Y.label,
|
|
124
|
+
value: l.formatValue ? l.formatValue(Y.values[x]) : D(Y.values[x])
|
|
124
125
|
})), te = C(x) + v.value.left, le = B(k.value[0].values[x]) + v.value.top;
|
|
125
126
|
w.value = {
|
|
126
127
|
x: te,
|
|
@@ -130,9 +131,9 @@ const xe = {
|
|
|
130
131
|
};
|
|
131
132
|
}
|
|
132
133
|
function Q() {
|
|
133
|
-
w.value = null,
|
|
134
|
+
w.value = null, V.value = null;
|
|
134
135
|
}
|
|
135
|
-
const
|
|
136
|
+
const _ = Math.random().toString(36).slice(2, 7);
|
|
136
137
|
return (t, a) => (o(), n("div", {
|
|
137
138
|
ref_key: "containerRef",
|
|
138
139
|
ref: L,
|
|
@@ -161,18 +162,18 @@ const xe = {
|
|
|
161
162
|
}, [
|
|
162
163
|
h("defs", null, [
|
|
163
164
|
h("clipPath", {
|
|
164
|
-
id: `clip-${M(
|
|
165
|
+
id: `clip-${M(_)}`
|
|
165
166
|
}, [
|
|
166
167
|
h("rect", {
|
|
167
168
|
x: 0,
|
|
168
169
|
y: -10,
|
|
169
|
-
width: f.value *
|
|
170
|
+
width: f.value * S.value,
|
|
170
171
|
height: d.value + 20
|
|
171
172
|
}, null, 8, be)
|
|
172
173
|
], 8, ge),
|
|
173
174
|
(o(!0), n(p, null, g(k.value, (e, s) => (o(), n("linearGradient", {
|
|
174
175
|
key: s,
|
|
175
|
-
id: `grad-${M(
|
|
176
|
+
id: `grad-${M(_)}-${s}`,
|
|
176
177
|
x1: "0",
|
|
177
178
|
y1: "0",
|
|
178
179
|
x2: "0",
|
|
@@ -181,7 +182,7 @@ const xe = {
|
|
|
181
182
|
h("stop", {
|
|
182
183
|
offset: "0%",
|
|
183
184
|
"stop-color": e.color,
|
|
184
|
-
"stop-opacity":
|
|
185
|
+
"stop-opacity": u.fillOpacity
|
|
185
186
|
}, null, 8, we),
|
|
186
187
|
h("stop", {
|
|
187
188
|
offset: "100%",
|
|
@@ -215,9 +216,9 @@ const xe = {
|
|
|
215
216
|
u.showXLabels ? (o(!0), n(p, { key: 2 }, g(y.value, (e, s) => re((o(), n("text", {
|
|
216
217
|
key: `xl-${s}`,
|
|
217
218
|
x: C(s),
|
|
218
|
-
y: d.value + (
|
|
219
|
-
"text-anchor":
|
|
220
|
-
transform:
|
|
219
|
+
y: d.value + (O.value ? 12 : 16),
|
|
220
|
+
"text-anchor": O.value ? "end" : "middle",
|
|
221
|
+
transform: O.value ? `rotate(-45, ${C(s)}, ${d.value + 12})` : void 0,
|
|
221
222
|
class: "fill-muted-foreground",
|
|
222
223
|
"font-size": "11"
|
|
223
224
|
}, b(e), 9, Ce)), [
|
|
@@ -231,7 +232,7 @@ const xe = {
|
|
|
231
232
|
y2: d.value,
|
|
232
233
|
stroke: "currentColor",
|
|
233
234
|
"stroke-opacity": u.axisOpacity
|
|
234
|
-
}, null, 8,
|
|
235
|
+
}, null, 8, Ve)) : i("", !0),
|
|
235
236
|
u.showYAxis ? (o(), n("line", {
|
|
236
237
|
key: 4,
|
|
237
238
|
x1: 0,
|
|
@@ -240,12 +241,12 @@ const xe = {
|
|
|
240
241
|
y2: d.value,
|
|
241
242
|
stroke: "currentColor",
|
|
242
243
|
"stroke-opacity": u.axisOpacity
|
|
243
|
-
}, null, 8,
|
|
244
|
-
|
|
244
|
+
}, null, 8, _e)) : i("", !0),
|
|
245
|
+
V.value !== null ? (o(), n("line", {
|
|
245
246
|
key: 5,
|
|
246
|
-
x1: C(
|
|
247
|
+
x1: C(V.value),
|
|
247
248
|
y1: 0,
|
|
248
|
-
x2: C(
|
|
249
|
+
x2: C(V.value),
|
|
249
250
|
y2: d.value,
|
|
250
251
|
stroke: "currentColor",
|
|
251
252
|
"stroke-opacity": "0.12",
|
|
@@ -256,9 +257,9 @@ const xe = {
|
|
|
256
257
|
u.fill ? (o(), n("path", {
|
|
257
258
|
key: 0,
|
|
258
259
|
d: e.fillPath,
|
|
259
|
-
fill: `url(#grad-${M(
|
|
260
|
-
"clip-path": `url(#clip-${M(
|
|
261
|
-
}, null, 8,
|
|
260
|
+
fill: `url(#grad-${M(_)}-${s})`,
|
|
261
|
+
"clip-path": `url(#clip-${M(_)})`
|
|
262
|
+
}, null, 8, Oe)) : i("", !0),
|
|
262
263
|
h("path", {
|
|
263
264
|
d: e.line,
|
|
264
265
|
fill: "none",
|
|
@@ -266,18 +267,18 @@ const xe = {
|
|
|
266
267
|
"stroke-width": u.lineWidth,
|
|
267
268
|
"stroke-linejoin": "round",
|
|
268
269
|
"stroke-linecap": "round",
|
|
269
|
-
"clip-path": `url(#clip-${M(
|
|
270
|
-
}, null, 8,
|
|
270
|
+
"clip-path": `url(#clip-${M(_)})`
|
|
271
|
+
}, null, 8, Re),
|
|
271
272
|
u.showDots ? (o(!0), n(p, { key: 1 }, g(e.pts, (c, m) => (o(), n("circle", {
|
|
272
273
|
key: m,
|
|
273
274
|
cx: c[0],
|
|
274
275
|
cy: c[1],
|
|
275
|
-
r:
|
|
276
|
+
r: V.value === m ? 5 : 3.5,
|
|
276
277
|
fill: e.color,
|
|
277
278
|
class: "transition-[r] duration-150",
|
|
278
|
-
opacity:
|
|
279
|
-
"clip-path": `url(#clip-${M(
|
|
280
|
-
}, null, 8,
|
|
279
|
+
opacity: S.value > 0 ? 1 : 0,
|
|
280
|
+
"clip-path": `url(#clip-${M(_)})`
|
|
281
|
+
}, null, 8, Se))), 128)) : i("", !0)
|
|
281
282
|
]))), 128)),
|
|
282
283
|
u.yLabel ? (o(), n("text", {
|
|
283
284
|
key: 6,
|
|
@@ -287,7 +288,7 @@ const xe = {
|
|
|
287
288
|
transform: "rotate(-90)",
|
|
288
289
|
"font-size": "11",
|
|
289
290
|
class: "fill-muted-foreground font-medium"
|
|
290
|
-
}, b(u.yLabel), 9,
|
|
291
|
+
}, b(u.yLabel), 9, Ye)) : i("", !0),
|
|
291
292
|
u.xLabel ? (o(), n("text", {
|
|
292
293
|
key: 7,
|
|
293
294
|
x: f.value / 2,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ChartDataPoint } from './types';
|
|
2
|
-
export type PieLabelMode
|
|
3
|
-
export type LegendPosition = 'right' | 'bottom';
|
|
1
|
+
import { ChartDataPoint, ChartLegendsVariant, LegendPosition, PieLabelMode } from './types';
|
|
2
|
+
export type { PieLabelMode, LegendPosition, ChartLegendsVariant };
|
|
4
3
|
export interface PieChartProps {
|
|
5
4
|
data: ChartDataPoint[];
|
|
6
5
|
donut?: boolean;
|
|
@@ -9,6 +8,13 @@ export interface PieChartProps {
|
|
|
9
8
|
startAngle?: number;
|
|
10
9
|
showLegend?: boolean;
|
|
11
10
|
legendPosition?: LegendPosition;
|
|
11
|
+
/**
|
|
12
|
+
* Legend layout preset.
|
|
13
|
+
* - `default` — original two-line items (label + value)
|
|
14
|
+
* - `variant1` — compact horizontal wrap: "Label (value, pct%)"
|
|
15
|
+
* - `variant2` — vertical rows with value/pct aligned right
|
|
16
|
+
*/
|
|
17
|
+
legendsVariant?: ChartLegendsVariant;
|
|
12
18
|
labelMode?: PieLabelMode;
|
|
13
19
|
colors?: string[];
|
|
14
20
|
animate?: boolean;
|
|
@@ -34,10 +40,11 @@ declare const __VLS_component: import('vue').DefineComponent<PieChartProps, {},
|
|
|
34
40
|
colors: string[];
|
|
35
41
|
showLegend: boolean;
|
|
36
42
|
showTooltip: boolean;
|
|
43
|
+
legendsVariant: ChartLegendsVariant;
|
|
44
|
+
legendPosition: LegendPosition;
|
|
37
45
|
donut: boolean;
|
|
38
46
|
innerRadius: number;
|
|
39
47
|
startAngle: number;
|
|
40
|
-
legendPosition: LegendPosition;
|
|
41
48
|
labelMode: PieLabelMode;
|
|
42
49
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
43
50
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { CHART_COLORS as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as re, ref as B, onMounted as ue, watch as de, onUnmounted as ce, computed as d, openBlock as i, createElementBlock as s, normalizeClass as W, createElementVNode as u, unref as T, Fragment as D, renderList as N, createCommentVNode as f, toDisplayString as x, renderSlot as ve, createBlock as Z, Teleport as fe, normalizeStyle as _, createTextVNode as he } from "vue";
|
|
2
|
+
import { CHART_COLORS as me, getColor as ge, arcPath as xe, formatNumber as E, animateProgress as ye } from "./utils.js";
|
|
3
|
+
import be from "./ChartLegend.vue.js";
|
|
4
|
+
const Me = ["width", "height"], ke = ["id"], we = ["filter"], pe = ["d", "fill", "transform", "opacity", "onMouseenter"], $e = {
|
|
4
5
|
key: 0,
|
|
5
6
|
style: { "pointer-events": "none" }
|
|
6
|
-
},
|
|
7
|
+
}, Le = ["d", "opacity"], ze = ["x", "y", "text-anchor", "font-size", "font-weight", "fill", "opacity"], Pe = { key: 2 }, Ae = ["x", "y"], Ve = ["x", "y"], Ce = { class: "flex items-center gap-1.5 mb-1" }, Re = { class: "text-xs font-semibold" }, Se = { class: "text-xs text-muted-foreground" }, Be = { class: "font-medium text-foreground ml-1" }, He = /* @__PURE__ */ re({
|
|
7
8
|
__name: "PieChart",
|
|
8
9
|
props: {
|
|
9
10
|
data: {},
|
|
@@ -13,59 +14,72 @@ const ye = { class: "shrink-0" }, ge = ["width", "height"], be = ["id"], Me = ["
|
|
|
13
14
|
startAngle: { default: -90 },
|
|
14
15
|
showLegend: { type: Boolean, default: !0 },
|
|
15
16
|
legendPosition: { default: "right" },
|
|
17
|
+
legendsVariant: { default: "default" },
|
|
16
18
|
labelMode: { default: "percent" },
|
|
17
|
-
colors: { default: () =>
|
|
19
|
+
colors: { default: () => me },
|
|
18
20
|
animate: { type: Boolean, default: !0 },
|
|
19
21
|
showTooltip: { type: Boolean, default: !0 },
|
|
20
22
|
centerLabel: {},
|
|
21
23
|
centerValue: {}
|
|
22
24
|
},
|
|
23
25
|
setup(e) {
|
|
24
|
-
const
|
|
25
|
-
let
|
|
26
|
-
function
|
|
27
|
-
|
|
26
|
+
const t = e, H = Math.random().toString(36).slice(2, 7), w = B(t.animate ? 0 : 1);
|
|
27
|
+
let p = null;
|
|
28
|
+
function I() {
|
|
29
|
+
p?.(), w.value = 0, p = ye(1e3, (l) => w.value = l);
|
|
28
30
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
ue(() => {
|
|
32
|
+
t.animate && I();
|
|
33
|
+
}), de(
|
|
34
|
+
() => t.data,
|
|
35
|
+
() => {
|
|
36
|
+
t.animate && I();
|
|
37
|
+
},
|
|
38
|
+
{ deep: !0 }
|
|
39
|
+
), ce(() => p?.());
|
|
40
|
+
const O = d(() => t.labelMode === "outside"), h = d(() => t.size / 2), c = d(() => t.size / 2), m = d(() => t.size / 2 - (O.value ? 36 : 4)), X = d(() => t.donut ? m.value * (t.innerRadius / 100) : 0), $ = d(() => t.data.reduce((l, a) => l + a.value, 0) || 1), ee = d(() => t.legendPosition === "bottom" ? t.legendsVariant === "variant2" ? "flex flex-col items-stretch gap-5 w-full" : "inline-flex flex-col items-center gap-4" : "inline-flex flex-row items-center gap-6"), M = d(() => {
|
|
41
|
+
let l = t.startAngle;
|
|
42
|
+
return t.data.map((a, o) => {
|
|
43
|
+
const n = a.value / $.value, g = n * 360 * w.value, L = a.color ?? ge(t.colors, o), y = l, z = l + g;
|
|
44
|
+
l += n * 360;
|
|
45
|
+
const Y = (y + z) / 2 * (Math.PI / 180), k = Math.cos(Y), P = Math.sin(Y), A = k >= 0, j = m.value * 0.65 + X.value * 0.35;
|
|
46
|
+
let F = h.value + j * k, U = c.value + j * P, q = "middle", G = 0, J = 0, V = 0, C = 0, R = 0, S = 0, K = "";
|
|
47
|
+
if (O.value) {
|
|
48
|
+
const Q = m.value + 20, se = 14;
|
|
49
|
+
G = h.value + m.value * k, J = c.value + m.value * P, V = h.value + Q * k, C = c.value + Q * P, R = V + se * (A ? 1 : -1), S = C, K = `M ${G},${J} L ${V},${C} L ${R},${S}`, F = R + 5 * (A ? 1 : -1), U = S, q = A ? "start" : "end";
|
|
44
50
|
}
|
|
45
|
-
const
|
|
51
|
+
const ie = xe(h.value, c.value, m.value, y, z, X.value);
|
|
46
52
|
let b = "";
|
|
47
|
-
return
|
|
53
|
+
return t.labelMode === "percent" ? b = `${Math.round(n * 100)}%` : t.labelMode === "value" ? b = E(a.value) : t.labelMode === "label" ? b = a.label : t.labelMode === "outside" && (b = `${E(a.value)} (${Math.round(n * 100)}%)`), { d: a, path: ie, color: L, lx: F, ly: U, label: b, pct: n, startA: y, endA: z, leaderPath: K, textAnchor: q };
|
|
48
54
|
});
|
|
49
|
-
}),
|
|
50
|
-
function
|
|
51
|
-
|
|
55
|
+
}), v = B(null), r = B(null);
|
|
56
|
+
function te(l, a) {
|
|
57
|
+
v.value = a, t.showTooltip && (r.value = { x: l.clientX, y: l.clientY, item: M.value[a] });
|
|
52
58
|
}
|
|
53
|
-
function
|
|
54
|
-
r.value && (r.value = { ...r.value, x:
|
|
59
|
+
function le(l) {
|
|
60
|
+
r.value && (r.value = { ...r.value, x: l.clientX, y: l.clientY });
|
|
55
61
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
62
|
+
function oe() {
|
|
63
|
+
v.value = null, r.value = null;
|
|
58
64
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
const l = (n + t) / 2 * (Math.PI / 180), c = 8, C = Math.cos(l) * c, g = Math.sin(l) * c;
|
|
62
|
-
return `translate(${C}, ${g})`;
|
|
65
|
+
function ne(l) {
|
|
66
|
+
v.value = l;
|
|
63
67
|
}
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
function ae(l, a, o) {
|
|
69
|
+
if (v.value !== l) return "";
|
|
70
|
+
const n = (a + o) / 2 * (Math.PI / 180), g = 8, L = Math.cos(n) * g, y = Math.sin(n) * g;
|
|
71
|
+
return `translate(${L}, ${y})`;
|
|
72
|
+
}
|
|
73
|
+
return (l, a) => (i(), s("div", {
|
|
74
|
+
class: W(["vlite-pie-chart select-none", ee.value])
|
|
66
75
|
}, [
|
|
67
|
-
u("div",
|
|
68
|
-
|
|
76
|
+
u("div", {
|
|
77
|
+
class: W([
|
|
78
|
+
"shrink-0",
|
|
79
|
+
e.legendPosition === "bottom" && e.legendsVariant === "variant2" ? "self-center" : ""
|
|
80
|
+
])
|
|
81
|
+
}, [
|
|
82
|
+
(i(), s("svg", {
|
|
69
83
|
width: e.size,
|
|
70
84
|
height: e.size,
|
|
71
85
|
role: "img",
|
|
@@ -74,130 +88,120 @@ const ye = { class: "shrink-0" }, ge = ["width", "height"], be = ["id"], Me = ["
|
|
|
74
88
|
}, [
|
|
75
89
|
u("defs", null, [
|
|
76
90
|
u("filter", {
|
|
77
|
-
id: `shadow-${
|
|
91
|
+
id: `shadow-${T(H)}`,
|
|
78
92
|
x: "-20%",
|
|
79
93
|
y: "-20%",
|
|
80
94
|
width: "140%",
|
|
81
95
|
height: "140%"
|
|
82
|
-
}, [...
|
|
96
|
+
}, [...a[0] || (a[0] = [
|
|
83
97
|
u("feDropShadow", {
|
|
84
98
|
dx: "0",
|
|
85
99
|
dy: "2",
|
|
86
100
|
stdDeviation: "3",
|
|
87
101
|
"flood-opacity": "0.12"
|
|
88
102
|
}, null, -1)
|
|
89
|
-
])], 8,
|
|
103
|
+
])], 8, ke)
|
|
90
104
|
]),
|
|
91
105
|
u("g", {
|
|
92
|
-
filter: `url(#shadow-${
|
|
106
|
+
filter: `url(#shadow-${T(H)})`
|
|
93
107
|
}, [
|
|
94
|
-
(
|
|
95
|
-
key:
|
|
96
|
-
d:
|
|
97
|
-
fill:
|
|
98
|
-
transform:
|
|
108
|
+
(i(!0), s(D, null, N(M.value, (o, n) => (i(), s("path", {
|
|
109
|
+
key: n,
|
|
110
|
+
d: o.path,
|
|
111
|
+
fill: o.color,
|
|
112
|
+
transform: ae(n, o.startA, o.endA),
|
|
99
113
|
class: "cursor-pointer transition-transform duration-200",
|
|
114
|
+
opacity: v.value !== null && v.value !== n ? 0.55 : 1,
|
|
100
115
|
stroke: "var(--color-background)",
|
|
101
116
|
"stroke-width": "2",
|
|
102
|
-
onMouseenter: (
|
|
103
|
-
onMousemove:
|
|
104
|
-
onMouseleave:
|
|
105
|
-
}, null, 40,
|
|
106
|
-
], 8,
|
|
107
|
-
e.labelMode === "outside" ? (
|
|
108
|
-
(
|
|
109
|
-
key: `leader-${
|
|
110
|
-
d:
|
|
117
|
+
onMouseenter: (g) => te(g, n),
|
|
118
|
+
onMousemove: le,
|
|
119
|
+
onMouseleave: oe
|
|
120
|
+
}, null, 40, pe))), 128))
|
|
121
|
+
], 8, we),
|
|
122
|
+
e.labelMode === "outside" ? (i(), s("g", $e, [
|
|
123
|
+
(i(!0), s(D, null, N(M.value, (o, n) => (i(), s("path", {
|
|
124
|
+
key: `leader-${n}`,
|
|
125
|
+
d: o.leaderPath,
|
|
111
126
|
fill: "none",
|
|
112
127
|
stroke: "var(--color-muted-foreground)",
|
|
113
128
|
"stroke-width": "1",
|
|
114
129
|
"stroke-linecap": "round",
|
|
115
130
|
"stroke-linejoin": "round",
|
|
116
|
-
opacity:
|
|
117
|
-
}, null, 8,
|
|
118
|
-
])) :
|
|
119
|
-
e.labelMode !== "none" ? (
|
|
120
|
-
key: `lbl-${
|
|
121
|
-
x:
|
|
122
|
-
y:
|
|
123
|
-
"text-anchor": e.labelMode === "outside" ?
|
|
131
|
+
opacity: o.pct > 0.02 ? 0.5 : 0
|
|
132
|
+
}, null, 8, Le))), 128))
|
|
133
|
+
])) : f("", !0),
|
|
134
|
+
e.labelMode !== "none" ? (i(!0), s(D, { key: 1 }, N(M.value, (o, n) => (i(), s("text", {
|
|
135
|
+
key: `lbl-${n}`,
|
|
136
|
+
x: o.lx,
|
|
137
|
+
y: o.ly,
|
|
138
|
+
"text-anchor": e.labelMode === "outside" ? o.textAnchor : "middle",
|
|
124
139
|
"dominant-baseline": "middle",
|
|
125
140
|
"font-size": e.labelMode === "outside" ? 11.5 : 11,
|
|
126
141
|
"font-weight": e.labelMode === "outside" ? "500" : "600",
|
|
127
142
|
fill: e.labelMode === "outside" ? "var(--color-foreground)" : "white",
|
|
128
|
-
opacity:
|
|
129
|
-
},
|
|
130
|
-
e.donut ? (
|
|
131
|
-
|
|
132
|
-
total:
|
|
143
|
+
opacity: o.pct > 0.04 ? 1 : 0
|
|
144
|
+
}, x(o.label), 9, ze))), 128)) : f("", !0),
|
|
145
|
+
e.donut ? (i(), s("g", Pe, [
|
|
146
|
+
ve(l.$slots, "center", {
|
|
147
|
+
total: $.value,
|
|
133
148
|
data: e.data
|
|
134
149
|
}, () => [
|
|
135
|
-
e.centerValue ? (
|
|
150
|
+
e.centerValue ? (i(), s("text", {
|
|
136
151
|
key: 0,
|
|
137
|
-
x:
|
|
138
|
-
y: e.centerLabel ?
|
|
152
|
+
x: h.value,
|
|
153
|
+
y: e.centerLabel ? c.value - 8 : c.value,
|
|
139
154
|
"text-anchor": "middle",
|
|
140
155
|
"dominant-baseline": "central",
|
|
141
156
|
"font-size": "22",
|
|
142
157
|
"font-weight": "700",
|
|
143
158
|
class: "fill-foreground"
|
|
144
|
-
},
|
|
145
|
-
e.centerLabel ? (
|
|
159
|
+
}, x(e.centerValue), 9, Ae)) : f("", !0),
|
|
160
|
+
e.centerLabel ? (i(), s("text", {
|
|
146
161
|
key: 1,
|
|
147
|
-
x:
|
|
148
|
-
y:
|
|
162
|
+
x: h.value,
|
|
163
|
+
y: c.value + (e.centerValue ? 14 : 0),
|
|
149
164
|
"text-anchor": "middle",
|
|
150
165
|
"dominant-baseline": "middle",
|
|
151
166
|
"font-size": "12",
|
|
152
167
|
class: "fill-muted-foreground"
|
|
153
|
-
},
|
|
168
|
+
}, x(e.centerLabel), 9, Ve)) : f("", !0)
|
|
154
169
|
])
|
|
155
|
-
])) :
|
|
156
|
-
], 8,
|
|
157
|
-
]),
|
|
158
|
-
e.showLegend ? (
|
|
170
|
+
])) : f("", !0)
|
|
171
|
+
], 8, Me))
|
|
172
|
+
], 2),
|
|
173
|
+
e.showLegend ? (i(), Z(be, {
|
|
159
174
|
key: 0,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
class: "w-2.5 h-2.5 rounded-sm shrink-0",
|
|
171
|
-
style: I({ backgroundColor: t.color ?? M(_)(e.colors, l) })
|
|
172
|
-
}, null, 4),
|
|
173
|
-
u("div", Ce, [
|
|
174
|
-
u("div", Re, d(t.label), 1),
|
|
175
|
-
u("div", Se, d(M(z)(t.value)) + " (" + d(Math.round(t.value / P.value * 100)) + "%) ", 1)
|
|
176
|
-
])
|
|
177
|
-
], 40, Pe))), 128))
|
|
178
|
-
], 2)) : h("", !0),
|
|
179
|
-
(s(), ce(ve, { to: "body" }, [
|
|
180
|
-
r.value ? (s(), i("div", {
|
|
175
|
+
data: e.data,
|
|
176
|
+
total: $.value,
|
|
177
|
+
colors: e.colors,
|
|
178
|
+
"legends-variant": e.legendsVariant,
|
|
179
|
+
"legend-position": e.legendPosition,
|
|
180
|
+
"hovered-index": v.value,
|
|
181
|
+
onHover: ne
|
|
182
|
+
}, null, 8, ["data", "total", "colors", "legends-variant", "legend-position", "hovered-index"])) : f("", !0),
|
|
183
|
+
(i(), Z(fe, { to: "body" }, [
|
|
184
|
+
r.value ? (i(), s("div", {
|
|
181
185
|
key: 0,
|
|
182
186
|
class: "vlite-chart-tooltip",
|
|
183
|
-
style:
|
|
187
|
+
style: _({ left: `${r.value.x + 12}px`, top: `${r.value.y - 10}px` })
|
|
184
188
|
}, [
|
|
185
|
-
u("div",
|
|
189
|
+
u("div", Ce, [
|
|
186
190
|
u("span", {
|
|
187
191
|
class: "w-2.5 h-2.5 rounded-sm shrink-0",
|
|
188
|
-
style:
|
|
192
|
+
style: _({ backgroundColor: r.value.item.color })
|
|
189
193
|
}, null, 4),
|
|
190
|
-
u("span",
|
|
194
|
+
u("span", Re, x(r.value.item.d.label), 1)
|
|
191
195
|
]),
|
|
192
|
-
u("div",
|
|
193
|
-
|
|
194
|
-
u("span",
|
|
196
|
+
u("div", Se, [
|
|
197
|
+
he(x(T(E)(r.value.item.d.value)) + " ", 1),
|
|
198
|
+
u("span", Be, " (" + x(Math.round(r.value.item.pct * 100)) + "%) ", 1)
|
|
195
199
|
])
|
|
196
|
-
], 4)) :
|
|
200
|
+
], 4)) : f("", !0)
|
|
197
201
|
]))
|
|
198
202
|
], 2));
|
|
199
203
|
}
|
|
200
204
|
});
|
|
201
205
|
export {
|
|
202
|
-
|
|
206
|
+
He as default
|
|
203
207
|
};
|
|
@@ -13,8 +13,8 @@ export interface SegmentBarChartProps {
|
|
|
13
13
|
declare const _default: import('vue').DefineComponent<SegmentBarChartProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SegmentBarChartProps> & Readonly<{}>, {
|
|
14
14
|
animate: boolean;
|
|
15
15
|
colors: string[];
|
|
16
|
-
showLabels: boolean;
|
|
17
16
|
showTooltip: boolean;
|
|
17
|
+
showLabels: boolean;
|
|
18
18
|
barRadius: number;
|
|
19
19
|
showValues: boolean;
|
|
20
20
|
barHeight: number;
|
|
@@ -14,9 +14,9 @@ declare const _default: import('vue').DefineComponent<TimelineChartProps, {}, {}
|
|
|
14
14
|
animate: boolean;
|
|
15
15
|
height: number;
|
|
16
16
|
colors: string[];
|
|
17
|
-
showLabels: boolean;
|
|
18
|
-
showTooltip: boolean;
|
|
19
17
|
showGrid: boolean;
|
|
18
|
+
showTooltip: boolean;
|
|
19
|
+
showLabels: boolean;
|
|
20
20
|
barRadius: number;
|
|
21
21
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
22
22
|
containerRef: HTMLDivElement;
|