vlite3 1.4.25 → 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/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/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Heatmap/Heatmap.vue.d.ts +1 -1
- 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/components/Dropdown/{DropdownMenu.vue3.js → DropdownMenu.vue2.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as y, computed as
|
|
1
|
+
import { defineComponent as y, computed as n, openBlock as i, createElementBlock as r, normalizeClass as d, createElementVNode as f, Fragment as u, renderList as s, createBlock as g } from "vue";
|
|
2
2
|
import S from "./StatItem.vue.js";
|
|
3
|
-
const
|
|
3
|
+
const k = /* @__PURE__ */ y({
|
|
4
4
|
__name: "Stats",
|
|
5
5
|
props: {
|
|
6
6
|
items: {},
|
|
@@ -14,70 +14,74 @@ const C = /* @__PURE__ */ y({
|
|
|
14
14
|
iconSize: { default: "" },
|
|
15
15
|
iconBoxShape: { default: "rounded" },
|
|
16
16
|
iconBoxStyle: { default: "filled" },
|
|
17
|
+
sparklineHeight: { default: 56 },
|
|
17
18
|
class: { default: "" }
|
|
18
19
|
},
|
|
19
|
-
setup(
|
|
20
|
-
const t =
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
}),
|
|
20
|
+
setup(e) {
|
|
21
|
+
const t = e, c = n(() => {
|
|
22
|
+
const a = Number(t.columns) || 4;
|
|
23
|
+
return a === 1 ? "grid-cols-1" : a === 2 ? "grid-cols-1 sm:grid-cols-2" : a === 3 ? "grid-cols-1 sm:grid-cols-3" : a === 4 ? "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4" : a === 5 ? "grid-cols-1 sm:grid-cols-3 lg:grid-cols-5" : a === 6 ? "grid-cols-1 sm:grid-cols-3 lg:grid-cols-6" : "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4";
|
|
24
|
+
}), h = n(() => [
|
|
24
25
|
"grid",
|
|
25
26
|
c.value,
|
|
27
|
+
t.layout === "layout-9" ? "items-stretch" : "",
|
|
26
28
|
t.variant === "transparent-header" ? "gap-2 md:gap-3.5" : "gap-3 sm:gap-4.5",
|
|
27
29
|
t?.layout === "layout-8" ? "rounded-sm" : "",
|
|
28
30
|
t.class
|
|
29
|
-
].join(" ")),
|
|
31
|
+
].join(" ")), m = n(() => [
|
|
30
32
|
t.layout === "layout-8" ? "rounded-sm" : "rounded-lg",
|
|
31
33
|
"overflow-hidden",
|
|
32
34
|
t.variant !== "transparent" ? "border border-border" : "",
|
|
33
35
|
t.variant === "shadow" ? "shadow-md bg-card" : "",
|
|
34
36
|
t.class
|
|
35
|
-
].join(" ")),
|
|
37
|
+
].join(" ")), v = n(() => [
|
|
36
38
|
"grid",
|
|
37
39
|
c.value,
|
|
38
40
|
"w-[calc(100%+1px)] -mb-px -mr-px gap-0"
|
|
39
41
|
].join(" "));
|
|
40
|
-
return (
|
|
42
|
+
return (a, x) => e.attached ? (i(), r("div", {
|
|
41
43
|
key: 0,
|
|
42
|
-
class: d(
|
|
44
|
+
class: d(m.value)
|
|
43
45
|
}, [
|
|
44
|
-
|
|
45
|
-
class: d(
|
|
46
|
+
f("div", {
|
|
47
|
+
class: d(v.value)
|
|
46
48
|
}, [
|
|
47
|
-
(i(!0), r(u, null, s(
|
|
48
|
-
key:
|
|
49
|
-
item:
|
|
50
|
-
variant:
|
|
51
|
-
layout:
|
|
52
|
-
attached:
|
|
53
|
-
loading:
|
|
54
|
-
titleSize:
|
|
55
|
-
valueSize:
|
|
56
|
-
iconSize:
|
|
57
|
-
iconBoxShape:
|
|
58
|
-
iconBoxStyle:
|
|
59
|
-
|
|
49
|
+
(i(!0), r(u, null, s(e.items, (l, o) => (i(), g(S, {
|
|
50
|
+
key: l.id || o,
|
|
51
|
+
item: l,
|
|
52
|
+
variant: e.variant.startsWith("transparent") ? "transparent" : e.variant,
|
|
53
|
+
layout: e.variant === "transparent-header" ? "layout-5" : e.layout,
|
|
54
|
+
attached: e.attached,
|
|
55
|
+
loading: e.loading,
|
|
56
|
+
titleSize: e.variant === "transparent-header" && !e.titleSize ? "text-sm font-normal! text-gray-900" : e.titleSize,
|
|
57
|
+
valueSize: e.variant === "transparent-header" && !e.valueSize ? "text-lg font-bold text-gray-900" : e.valueSize,
|
|
58
|
+
iconSize: e.iconSize,
|
|
59
|
+
iconBoxShape: e.iconBoxShape,
|
|
60
|
+
iconBoxStyle: e.iconBoxStyle,
|
|
61
|
+
sparklineHeight: e.sparklineHeight
|
|
62
|
+
}, null, 8, ["item", "variant", "layout", "attached", "loading", "titleSize", "valueSize", "iconSize", "iconBoxShape", "iconBoxStyle", "sparklineHeight"]))), 128))
|
|
60
63
|
], 2)
|
|
61
64
|
], 2)) : (i(), r("div", {
|
|
62
65
|
key: 1,
|
|
63
|
-
class: d(
|
|
66
|
+
class: d(h.value)
|
|
64
67
|
}, [
|
|
65
|
-
(i(!0), r(u, null, s(
|
|
66
|
-
key:
|
|
67
|
-
item:
|
|
68
|
-
variant:
|
|
69
|
-
layout:
|
|
70
|
-
attached:
|
|
71
|
-
loading:
|
|
72
|
-
titleSize:
|
|
73
|
-
valueSize:
|
|
74
|
-
iconSize:
|
|
75
|
-
iconBoxShape:
|
|
76
|
-
iconBoxStyle:
|
|
77
|
-
|
|
68
|
+
(i(!0), r(u, null, s(e.items, (l, o) => (i(), g(S, {
|
|
69
|
+
key: l.id || o,
|
|
70
|
+
item: l,
|
|
71
|
+
variant: e.variant.startsWith("transparent") ? "transparent" : e.variant,
|
|
72
|
+
layout: e.variant === "transparent-header" ? "layout-5" : e.layout,
|
|
73
|
+
attached: e.attached,
|
|
74
|
+
loading: e.loading,
|
|
75
|
+
titleSize: e.variant === "transparent-header" && !e.titleSize ? "text-sm font-normal! text-gray-900" : e.titleSize,
|
|
76
|
+
valueSize: e.variant === "transparent-header" && !e.valueSize ? "text-lg font-bold text-gray-900" : e.valueSize,
|
|
77
|
+
iconSize: e.iconSize,
|
|
78
|
+
iconBoxShape: e.iconBoxShape,
|
|
79
|
+
iconBoxStyle: e.iconBoxStyle,
|
|
80
|
+
sparklineHeight: e.sparklineHeight
|
|
81
|
+
}, null, 8, ["item", "variant", "layout", "attached", "loading", "titleSize", "valueSize", "iconSize", "iconBoxShape", "iconBoxStyle", "sparklineHeight"]))), 128))
|
|
78
82
|
], 2));
|
|
79
83
|
}
|
|
80
84
|
});
|
|
81
85
|
export {
|
|
82
|
-
|
|
86
|
+
k as default
|
|
83
87
|
};
|
|
@@ -1,48 +1,51 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
key:
|
|
5
|
-
class: "text-muted-foreground truncate"
|
|
6
|
-
},
|
|
1
|
+
import { defineComponent as k, computed as t, openBlock as u, createElementBlock as s, normalizeClass as l, createBlock as g, createCommentVNode as i, createTextVNode as h, toDisplayString as c, createElementVNode as C } from "vue";
|
|
2
|
+
import x from "../../Icon.vue.js";
|
|
3
|
+
const w = {
|
|
4
|
+
key: 1,
|
|
5
|
+
class: "text-muted-foreground truncate font-normal"
|
|
6
|
+
}, B = /* @__PURE__ */ k({
|
|
7
7
|
__name: "StatTrend",
|
|
8
8
|
props: {
|
|
9
9
|
trend: {},
|
|
10
10
|
layout: {}
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
return [
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
setup(n) {
|
|
13
|
+
const e = n, d = t(() => e.layout === "layout-8"), f = t(() => e.layout === "layout-5"), m = t(() => e.layout === "layout-9"), a = t(() => e.trend.neutral || e.trend.isPositive === null ? "neutral" : e.trend.isPositive === !1 ? "negative" : "positive"), o = t(() => a.value === "neutral" ? "text-muted-foreground" : a.value === "negative" ? "text-danger-subtle-fg" : "text-success-subtle-fg"), p = t(() => a.value === "neutral" ? "text-muted-foreground" : a.value === "negative" ? "text-danger" : "text-success"), v = t(() => a.value === "neutral" ? "lucide:minus" : a.value === "negative" ? "lucide:trending-down" : "lucide:trending-up"), y = t(() => {
|
|
14
|
+
if (d.value)
|
|
15
|
+
return ["shrink-0 flex items-center gap-0.5 text-xs font-medium", o.value].join(
|
|
16
|
+
" "
|
|
17
|
+
);
|
|
18
|
+
if (m.value)
|
|
19
|
+
return ["flex items-center gap-1 mt-1.5 text-xs", o.value].join(" ");
|
|
20
|
+
const r = "flex items-center text-sm";
|
|
21
|
+
return f.value ? `${r} gap-1` : e.layout === "layout-6" || e.layout === "layout-1" || e.layout === "layout-2" || e.layout === "layout-3" ? `${r} mt-2 gap-1.5` : `${r} mt-1 gap-1`;
|
|
21
22
|
});
|
|
22
|
-
return (
|
|
23
|
+
return (r, b) => d.value ? (u(), s("span", {
|
|
23
24
|
key: 0,
|
|
24
|
-
class:
|
|
25
|
+
class: l(y.value)
|
|
25
26
|
}, [
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
n.trend.hideIcon ? i("", !0) : (u(), g(x, {
|
|
28
|
+
key: 0,
|
|
29
|
+
icon: v.value,
|
|
28
30
|
class: "w-3 h-3"
|
|
29
|
-
}, null, 8, ["icon"]),
|
|
30
|
-
|
|
31
|
-
], 2)) : (
|
|
31
|
+
}, null, 8, ["icon"])),
|
|
32
|
+
h(" " + c(n.trend.value), 1)
|
|
33
|
+
], 2)) : (u(), s("div", {
|
|
32
34
|
key: 1,
|
|
33
|
-
class:
|
|
35
|
+
class: l(y.value)
|
|
34
36
|
}, [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
n.trend.hideIcon ? i("", !0) : (u(), g(x, {
|
|
38
|
+
key: 0,
|
|
39
|
+
icon: v.value,
|
|
40
|
+
class: l([p.value, m.value ? "w-3.5 h-3.5" : "w-4 h-4", "shrink-0"])
|
|
41
|
+
}, null, 8, ["icon", "class"])),
|
|
42
|
+
C("span", {
|
|
43
|
+
class: l([o.value, "font-medium whitespace-nowrap"])
|
|
44
|
+
}, c(n.trend.value), 3),
|
|
45
|
+
n.trend.label && !f.value ? (u(), s("span", w, c(n.trend.label), 1)) : i("", !0)
|
|
43
46
|
], 2));
|
|
44
47
|
}
|
|
45
48
|
});
|
|
46
49
|
export {
|
|
47
|
-
|
|
50
|
+
B as default
|
|
48
51
|
};
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
export type StatsVariant = 'solid' | 'outline' | 'shadow' | 'transparent' | 'transparent-header';
|
|
2
|
-
export type StatsLayout = 'layout-1' | 'layout-2' | 'layout-3' | 'layout-4' | 'layout-5' | 'layout-6' | 'layout-7' | 'layout-8'
|
|
2
|
+
export type StatsLayout = 'layout-1' | 'layout-2' | 'layout-3' | 'layout-4' | 'layout-5' | 'layout-6' | 'layout-7' | 'layout-8'
|
|
3
|
+
/** Executive / sparkline card: icon → title → value → trend → sparkline */
|
|
4
|
+
| 'layout-9';
|
|
3
5
|
export type IconBoxShape = 'rounded' | 'full-rounded' | 'none';
|
|
4
6
|
export type IconBoxStyle = 'filled' | 'transparent';
|
|
5
7
|
export interface StatTrend {
|
|
6
8
|
value: string | number;
|
|
7
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Trend direction. `true` = positive/up, `false` = negative/down,
|
|
11
|
+
* `null`/`undefined` with no explicit flag falls back to positive styling
|
|
12
|
+
* unless `neutral` is set.
|
|
13
|
+
*/
|
|
14
|
+
isPositive?: boolean | null;
|
|
15
|
+
/** Force neutral (muted) trend styling */
|
|
16
|
+
neutral?: boolean;
|
|
17
|
+
/** Comparison text, e.g. "vs last period" */
|
|
8
18
|
label?: string;
|
|
19
|
+
/** Hide the trending arrow icon */
|
|
20
|
+
hideIcon?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface StatSparklinePoint {
|
|
23
|
+
label?: string;
|
|
24
|
+
value: number;
|
|
25
|
+
color?: string;
|
|
9
26
|
}
|
|
10
27
|
export interface StatItemSchema {
|
|
11
28
|
id: string | number;
|
|
@@ -18,6 +35,17 @@ export interface StatItemSchema {
|
|
|
18
35
|
icon?: string;
|
|
19
36
|
color?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | string;
|
|
20
37
|
trend?: StatTrend;
|
|
38
|
+
/**
|
|
39
|
+
* Optional sparkline data for `layout-9`.
|
|
40
|
+
* Accepts chart points or a plain number series.
|
|
41
|
+
*/
|
|
42
|
+
sparkline?: StatSparklinePoint[] | number[];
|
|
43
|
+
/** Override sparkline stroke/fill color (defaults to item.color) */
|
|
44
|
+
sparklineColor?: string;
|
|
45
|
+
/** Fill area under the sparkline (default: true for layout-9) */
|
|
46
|
+
sparklineFill?: boolean;
|
|
47
|
+
/** Per-item sparkline height override */
|
|
48
|
+
sparklineHeight?: number;
|
|
21
49
|
[key: string]: any;
|
|
22
50
|
}
|
|
23
51
|
export interface StatsProps {
|
|
@@ -32,5 +60,7 @@ export interface StatsProps {
|
|
|
32
60
|
iconSize?: string;
|
|
33
61
|
iconBoxShape?: IconBoxShape;
|
|
34
62
|
iconBoxStyle?: IconBoxStyle;
|
|
63
|
+
/** Default sparkline height for layout-9 (px) */
|
|
64
|
+
sparklineHeight?: number;
|
|
35
65
|
class?: string;
|
|
36
66
|
}
|