vlite3 1.4.25 → 1.4.27
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/CategoryManager/CategoryManager.vue2.js +3 -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/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 +25 -0
- package/components/ColorPicker/ColorPicker.vue.d.ts +20 -1
- package/components/ColorPicker/ColorPicker.vue.js +72 -59
- package/components/DateRangePicker.vue.js +5 -239
- package/components/DateRangePicker.vue2.js +239 -2
- package/components/Form/FormField.vue.js +10 -10
- package/components/Heatmap/Heatmap.vue.d.ts +1 -1
- package/components/Screen/ScreenFilter.vue.js +3 -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 +2 -2
- package/style.css +1 -1
|
@@ -15,6 +15,7 @@ import "v-tooltip-lite/style.css";
|
|
|
15
15
|
/* empty css */
|
|
16
16
|
import "v-datepicker-lite";
|
|
17
17
|
import "v-datepicker-lite/style.css";
|
|
18
|
+
/* empty css */
|
|
18
19
|
import "@jaames/iro";
|
|
19
20
|
import "@vueuse/core";
|
|
20
21
|
/* empty css */
|
|
@@ -45,7 +46,7 @@ const Ue = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
45
46
|
}, Le = {
|
|
46
47
|
key: 0,
|
|
47
48
|
class: "absolute inset-0 z-10 flex items-center justify-center rounded-xl bg-background/60 backdrop-blur-[1px] transition-opacity"
|
|
48
|
-
}, We = { class: "flex items-center gap-2 text-sm text-muted-foreground" },
|
|
49
|
+
}, We = { class: "flex items-center gap-2 text-sm text-muted-foreground" }, kt = /* @__PURE__ */ Me({
|
|
49
50
|
__name: "CategoryManager",
|
|
50
51
|
props: {
|
|
51
52
|
modelValue: { default: () => [] },
|
|
@@ -494,5 +495,5 @@ const Ue = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
494
495
|
}
|
|
495
496
|
});
|
|
496
497
|
export {
|
|
497
|
-
|
|
498
|
+
kt as default
|
|
498
499
|
};
|
|
@@ -33,9 +33,9 @@ declare const _default: import('vue').DefineComponent<BarChartProps, {}, {}, {},
|
|
|
33
33
|
height: number;
|
|
34
34
|
orientation: "vertical" | "horizontal";
|
|
35
35
|
colors: string[];
|
|
36
|
+
showGrid: boolean;
|
|
36
37
|
showLegend: boolean;
|
|
37
38
|
showTooltip: boolean;
|
|
38
|
-
showGrid: boolean;
|
|
39
39
|
showXAxis: boolean;
|
|
40
40
|
showYAxis: boolean;
|
|
41
41
|
showXLabels: boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ChartDataPoint } from './types';
|
|
2
|
+
export type ChartLegendsVariant = 'default' | 'variant1' | 'variant2';
|
|
3
|
+
export type ChartLegendPosition = 'right' | 'bottom';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
data: ChartDataPoint[];
|
|
6
|
+
total: number;
|
|
7
|
+
colors?: string[];
|
|
8
|
+
legendsVariant?: ChartLegendsVariant;
|
|
9
|
+
legendPosition?: ChartLegendPosition;
|
|
10
|
+
hoveredIndex?: number | null;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
hover: (index: number) => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
onHover?: (index: number) => any;
|
|
16
|
+
}>, {
|
|
17
|
+
colors: string[];
|
|
18
|
+
legendsVariant: ChartLegendsVariant;
|
|
19
|
+
legendPosition: ChartLegendPosition;
|
|
20
|
+
hoveredIndex: number | null;
|
|
21
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { defineComponent as b, computed as m, openBlock as a, createElementBlock as u, normalizeClass as c, Fragment as f, renderList as p, createElementVNode as t, normalizeStyle as v, toDisplayString as r, unref as h, createTextVNode as k } from "vue";
|
|
2
|
+
import { getColor as M, formatNumber as g } from "./utils.js";
|
|
3
|
+
const _ = ["onMouseenter"], C = { class: "text-xs text-foreground whitespace-nowrap" }, I = { class: "font-medium" }, V = { class: "text-muted-foreground" }, $ = ["onMouseenter"], N = { class: "inline-flex items-center gap-2 min-w-0" }, j = { class: "text-xs font-medium text-foreground truncate" }, z = { class: "text-xs text-muted-foreground tabular-nums shrink-0 text-right" }, B = { class: "text-foreground/70" }, E = ["onMouseenter"], L = { class: "min-w-0" }, P = { class: "text-xs font-medium text-foreground truncate" }, S = { class: "text-[10px] text-muted-foreground" }, T = /* @__PURE__ */ b({
|
|
4
|
+
__name: "ChartLegend",
|
|
5
|
+
props: {
|
|
6
|
+
data: {},
|
|
7
|
+
total: {},
|
|
8
|
+
colors: { default: () => [] },
|
|
9
|
+
legendsVariant: { default: "default" },
|
|
10
|
+
legendPosition: { default: "right" },
|
|
11
|
+
hoveredIndex: { default: null }
|
|
12
|
+
},
|
|
13
|
+
emits: ["hover"],
|
|
14
|
+
setup(o, { emit: y }) {
|
|
15
|
+
const i = o, d = y, x = m(
|
|
16
|
+
() => i.data.map((l, n) => {
|
|
17
|
+
const e = Number(l.value) || 0, s = i.total ? Math.round(e / i.total * 100) : 0;
|
|
18
|
+
return {
|
|
19
|
+
...l,
|
|
20
|
+
index: n,
|
|
21
|
+
color: l.color ?? M(i.colors, n),
|
|
22
|
+
value: e,
|
|
23
|
+
pct: s
|
|
24
|
+
};
|
|
25
|
+
})
|
|
26
|
+
), w = m(() => {
|
|
27
|
+
const l = i.legendsVariant, n = i.legendPosition;
|
|
28
|
+
return l === "variant1" ? "flex flex-row flex-wrap items-center justify-center gap-x-4 gap-y-2 min-w-0 w-full" : l === "variant2" ? n === "bottom" ? "flex flex-col gap-2.5 w-full min-w-0" : "flex flex-col gap-2.5 min-w-[160px]" : n === "bottom" ? "flex flex-row flex-wrap justify-center gap-x-5 gap-y-3 min-w-0" : "flex flex-col gap-2 min-w-[120px]";
|
|
29
|
+
});
|
|
30
|
+
return (l, n) => (a(), u("div", {
|
|
31
|
+
class: c(w.value),
|
|
32
|
+
role: "list"
|
|
33
|
+
}, [
|
|
34
|
+
o.legendsVariant === "variant1" ? (a(!0), u(f, { key: 0 }, p(x.value, (e) => (a(), u("button", {
|
|
35
|
+
key: e.index,
|
|
36
|
+
type: "button",
|
|
37
|
+
role: "listitem",
|
|
38
|
+
class: c(["inline-flex items-center gap-2 text-left cursor-pointer transition-opacity duration-150", o.hoveredIndex !== null && o.hoveredIndex !== e.index ? "opacity-45" : "opacity-100"]),
|
|
39
|
+
onMouseenter: (s) => d("hover", e.index),
|
|
40
|
+
onMouseleave: n[0] || (n[0] = (s) => d("hover", null))
|
|
41
|
+
}, [
|
|
42
|
+
t("span", {
|
|
43
|
+
class: "w-2 h-2 rounded-full shrink-0",
|
|
44
|
+
style: v({ backgroundColor: e.color })
|
|
45
|
+
}, null, 4),
|
|
46
|
+
t("span", C, [
|
|
47
|
+
t("span", I, r(e.label), 1),
|
|
48
|
+
t("span", V, " (" + r(h(g)(e.value)) + ", " + r(e.pct) + "%) ", 1)
|
|
49
|
+
])
|
|
50
|
+
], 42, _))), 128)) : o.legendsVariant === "variant2" ? (a(!0), u(f, { key: 1 }, p(x.value, (e) => (a(), u("button", {
|
|
51
|
+
key: e.index,
|
|
52
|
+
type: "button",
|
|
53
|
+
role: "listitem",
|
|
54
|
+
class: c(["flex w-full items-center justify-between gap-4 text-left cursor-pointer transition-opacity duration-150", o.hoveredIndex !== null && o.hoveredIndex !== e.index ? "opacity-45" : "opacity-100"]),
|
|
55
|
+
onMouseenter: (s) => d("hover", e.index),
|
|
56
|
+
onMouseleave: n[1] || (n[1] = (s) => d("hover", null))
|
|
57
|
+
}, [
|
|
58
|
+
t("span", N, [
|
|
59
|
+
t("span", {
|
|
60
|
+
class: "w-2.5 h-2.5 rounded-sm shrink-0",
|
|
61
|
+
style: v({ backgroundColor: e.color })
|
|
62
|
+
}, null, 4),
|
|
63
|
+
t("span", j, r(e.label), 1)
|
|
64
|
+
]),
|
|
65
|
+
t("span", z, [
|
|
66
|
+
k(r(h(g)(e.value)) + " ", 1),
|
|
67
|
+
t("span", B, "(" + r(e.pct) + "%)", 1)
|
|
68
|
+
])
|
|
69
|
+
], 42, $))), 128)) : (a(!0), u(f, { key: 2 }, p(x.value, (e) => (a(), u("button", {
|
|
70
|
+
key: e.index,
|
|
71
|
+
type: "button",
|
|
72
|
+
role: "listitem",
|
|
73
|
+
class: c(["flex items-center gap-2 cursor-pointer text-left transition-opacity duration-150", o.hoveredIndex !== null && o.hoveredIndex !== e.index ? "opacity-45" : "opacity-100"]),
|
|
74
|
+
onMouseenter: (s) => d("hover", e.index),
|
|
75
|
+
onMouseleave: n[2] || (n[2] = (s) => d("hover", null))
|
|
76
|
+
}, [
|
|
77
|
+
t("span", {
|
|
78
|
+
class: "w-2.5 h-2.5 rounded-sm shrink-0",
|
|
79
|
+
style: v({ backgroundColor: e.color })
|
|
80
|
+
}, null, 4),
|
|
81
|
+
t("div", L, [
|
|
82
|
+
t("div", P, r(e.label), 1),
|
|
83
|
+
t("div", S, r(h(g)(e.value)) + " (" + r(e.pct) + "%) ", 1)
|
|
84
|
+
])
|
|
85
|
+
], 42, E))), 128))
|
|
86
|
+
], 2));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
export {
|
|
90
|
+
T as default
|
|
91
|
+
};
|
|
@@ -43,9 +43,9 @@ declare const _default: import('vue').DefineComponent<GanttChartProps, {}, {}, {
|
|
|
43
43
|
draggable: boolean;
|
|
44
44
|
showHeader: boolean;
|
|
45
45
|
colors: string[];
|
|
46
|
-
showLabels: boolean;
|
|
47
|
-
showTooltip: boolean;
|
|
48
46
|
showGrid: boolean;
|
|
47
|
+
showTooltip: boolean;
|
|
48
|
+
showLabels: boolean;
|
|
49
49
|
barRadius: number;
|
|
50
50
|
rowHeight: number;
|
|
51
51
|
barHeight: number;
|
|
@@ -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"]>;
|