vlite3 1.2.2 → 1.2.5
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/README.md +18 -7
- package/components/AppShell/AppShellLayoutDashboard.vue.js +1 -1
- package/components/AppShell/AppShellLayoutHeaderShell.vue.js +1 -1
- package/components/AsyncSelect/createAsyncSelect.d.ts +88 -0
- package/components/AsyncSelect/createAsyncSelect.js +156 -0
- package/components/AsyncSelect/index.d.ts +1 -0
- package/components/AvatarGroup/AvatarGroup.vue.js +10 -9
- package/components/Beacon.vue.d.ts +13 -0
- package/components/CategoryManager/CategoryManager.vue.js +1 -1
- package/components/ChoiceBox/ChoiceBox.vue.js +4 -2
- package/components/{CopyButton.vue.d.ts → Clipboard.vue.d.ts} +4 -3
- package/components/{CopyButton.vue.js → Clipboard.vue.js} +19 -19
- package/components/Clipboard.vue2.js +4 -0
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/DataTable/types.d.ts +1 -1
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +1 -1
- package/components/List/ListFieldRow.vue.js +221 -144
- package/components/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +92 -86
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/Persona.vue.d.ts +25 -0
- package/components/Price/Price.vue.d.ts +1 -1
- package/components/Price/Price.vue.js +35 -13
- package/components/Rating/Rating.vue.d.ts +43 -0
- package/components/Rating/Rating.vue.js +7 -0
- package/components/Rating/Rating.vue2.js +92 -0
- package/components/Rating/ReviewSummary.vue.d.ts +5 -0
- package/components/Rating/ReviewSummary.vue.js +67 -0
- package/components/Rating/ReviewSummary.vue2.js +4 -0
- package/components/Rating/index.d.ts +3 -0
- package/components/Rating/types.d.ts +28 -0
- package/components/Screen/Screen.vue.d.ts +2 -2
- package/components/Screen/Screen.vue.js +3 -1
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/SidePanel.vue.js +3 -3
- package/components/SidePanel.vue2.js +44 -56
- package/components/SidebarMenu/SidebarMenu.vue.js +1 -1
- package/components/SidebarMenu/SidebarMenuItem.vue.d.ts +3 -1
- package/components/SidebarMenu/SidebarMenuItem.vue.js +197 -178
- package/components/Stats/StatItem.vue.js +222 -164
- package/components/Stats/components/StatIconBox.vue.js +42 -42
- package/components/Stats/components/StatTrend.vue.js +20 -20
- package/components/ThemeToggle.vue.js +10 -10
- package/components/Timeline/Timeline.vue.js +21 -11
- package/components/Timeline/TimelineItem.vue.js +1 -1
- package/components/index.d.ts +2 -0
- package/index.d.ts +3 -1
- package/index.js +113 -107
- package/package.json +2 -1
- package/style.css +47 -32
- package/utils/status.js +16 -16
- package/components/CopyButton.vue2.js +0 -4
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { $t as
|
|
3
|
-
import { formatCurrency as C, formatNumber as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as T, computed as w, openBlock as t, createElementBlock as o, normalizeStyle as $, normalizeClass as r, Fragment as k, createElementVNode as l, toDisplayString as c, unref as b, createBlock as n, withCtx as g, createCommentVNode as d } from "vue";
|
|
2
|
+
import { $t as x } from "../../utils/i18n.js";
|
|
3
|
+
import { formatCurrency as C, formatNumber as I } from "../../utils/functions.js";
|
|
4
|
+
import h from "./components/StatTrend.vue.js";
|
|
5
|
+
import S from "./components/StatIconBox.vue.js";
|
|
6
|
+
import v from "../Tooltip.vue.js";
|
|
7
|
+
import { configState as P } from "../../core/config.js";
|
|
8
|
+
const V = { class: "flex items-center justify-between w-full mt-1" }, M = {
|
|
7
9
|
key: 0,
|
|
8
10
|
class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
|
|
9
|
-
},
|
|
11
|
+
}, E = {
|
|
10
12
|
key: 0,
|
|
11
13
|
class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md"
|
|
12
|
-
},
|
|
14
|
+
}, D = {
|
|
13
15
|
key: 1,
|
|
14
16
|
class: "h-8 w-20 bg-gray-50 animate-pulse rounded-md mt-1"
|
|
15
|
-
},
|
|
17
|
+
}, L = {
|
|
16
18
|
key: 3,
|
|
17
19
|
class: "flex-1 flex flex-col justify-center min-w-0"
|
|
18
|
-
},
|
|
20
|
+
}, q = {
|
|
19
21
|
key: 0,
|
|
20
22
|
class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md mt-0.5"
|
|
21
|
-
},
|
|
23
|
+
}, A = {
|
|
22
24
|
key: 1,
|
|
23
25
|
class: "h-6 w-5 bg-gray-50 animate-pulse rounded-sm shrink-0"
|
|
24
|
-
},
|
|
26
|
+
}, G = { class: "flex-1 flex flex-col justify-center min-w-0" }, H = { class: "flex items-baseline gap-2 mt-1" }, J = {
|
|
25
27
|
key: 0,
|
|
26
28
|
class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
|
|
27
|
-
},
|
|
29
|
+
}, Y = /* @__PURE__ */ T({
|
|
28
30
|
__name: "StatItem",
|
|
29
31
|
props: {
|
|
30
32
|
item: {},
|
|
@@ -38,14 +40,22 @@ const F = { class: "flex items-center justify-between w-full mt-1" }, $ = {
|
|
|
38
40
|
iconBoxShape: { default: "rounded" },
|
|
39
41
|
iconBoxStyle: { default: "filled" }
|
|
40
42
|
},
|
|
41
|
-
setup(
|
|
42
|
-
const
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
return a.isPrice ? C(
|
|
43
|
+
setup(e) {
|
|
44
|
+
const i = e;
|
|
45
|
+
function s(a) {
|
|
46
|
+
const u = Number(a.value);
|
|
47
|
+
return a.isPrice ? C(u, { numberFormat: a.numberFormat || "compact", compactThreshold: a.compactThreshold }) : a.numberFormat ? I(u, { numberFormat: a.numberFormat, compactThreshold: a.compactThreshold }) : a.value;
|
|
46
48
|
}
|
|
47
|
-
const
|
|
48
|
-
const a =
|
|
49
|
+
const y = w(() => {
|
|
50
|
+
const a = Number(i.item.value) || 0;
|
|
51
|
+
if (!i.item.isPrice && !i.item.numberFormat || (i.item.numberFormat || (i.item.isPrice ? "compact" : "standard")) !== "compact") return !1;
|
|
52
|
+
const z = i.item.compactThreshold ?? P?.components?.price?.compactThreshold ?? 1e3;
|
|
53
|
+
return Math.abs(a) >= z;
|
|
54
|
+
}), f = w(() => {
|
|
55
|
+
const a = Number(i.item.value) || 0;
|
|
56
|
+
return i.item.isPrice ? C(a, { numberFormat: "standard" }) : i.item.numberFormat ? I(a, { numberFormat: "standard" }) : String(i.item.value);
|
|
57
|
+
}), F = w(() => {
|
|
58
|
+
const a = i.layout === "inline-label-value" ? "flex px-3.5 py-3" : i.layout === "centered-value-title" ? "flex px-1 py-1" : "flex p-3", u = {
|
|
49
59
|
"icon-left": "flex-row items-center gap-3 text-left",
|
|
50
60
|
"icon-right": "flex-row items-center justify-between gap-3 text-left",
|
|
51
61
|
"icon-top": "flex-col items-start gap-1 px-5! pt-2! text-left",
|
|
@@ -54,45 +64,45 @@ const F = { class: "flex items-center justify-between w-full mt-1" }, $ = {
|
|
|
54
64
|
"floating-icon": "flex-col items-start gap-1 text-left relative",
|
|
55
65
|
"split-bar": "flex-row items-center gap-3 text-left border-l-4",
|
|
56
66
|
"inline-label-value": "flex-row items-center gap-2.5 text-left"
|
|
57
|
-
},
|
|
58
|
-
let
|
|
59
|
-
if (
|
|
60
|
-
|
|
67
|
+
}, z = u[i.layout] || u["icon-left"];
|
|
68
|
+
let m = "";
|
|
69
|
+
if (i.attached)
|
|
70
|
+
i.variant === "transparent" ? m = "border-b border-r border-transparent bg-transparent hover:bg-muted/30 transition-colors" : i.variant === "outline" ? m = "border-b border-r border-border bg-transparent hover:bg-muted/30 transition-colors" : m = "border-b border-r border-border bg-card hover:bg-muted/30 transition-colors";
|
|
61
71
|
else {
|
|
62
|
-
switch (
|
|
72
|
+
switch (i.variant) {
|
|
63
73
|
case "solid": {
|
|
64
|
-
const
|
|
65
|
-
primary: "bg-primary-light",
|
|
66
|
-
secondary: "bg-secondary",
|
|
67
|
-
success: "bg-success-light",
|
|
68
|
-
warning: "bg-warning-light",
|
|
69
|
-
danger: "bg-danger-light",
|
|
70
|
-
info: "bg-info-light"
|
|
74
|
+
const N = i.item.color || "primary", B = {
|
|
75
|
+
primary: "bg-primary-light dark:ring-1 dark:ring-inset dark:ring-primary/20",
|
|
76
|
+
secondary: "bg-secondary dark:ring-1 dark:ring-inset dark:ring-secondary-foreground/20",
|
|
77
|
+
success: "bg-success-light dark:ring-1 dark:ring-inset dark:ring-success/20",
|
|
78
|
+
warning: "bg-warning-light dark:ring-1 dark:ring-inset dark:ring-warning/20",
|
|
79
|
+
danger: "bg-danger-light dark:ring-1 dark:ring-inset dark:ring-danger/20",
|
|
80
|
+
info: "bg-info-light dark:ring-1 dark:ring-inset dark:ring-info/20"
|
|
71
81
|
};
|
|
72
|
-
|
|
82
|
+
m = `${B[N] || B.primary}`;
|
|
73
83
|
break;
|
|
74
84
|
}
|
|
75
85
|
case "outline":
|
|
76
|
-
|
|
86
|
+
m = "border border-border";
|
|
77
87
|
break;
|
|
78
88
|
case "shadow":
|
|
79
|
-
|
|
89
|
+
m = "bg-card shadow-md border border-border/50";
|
|
80
90
|
break;
|
|
81
91
|
case "transparent":
|
|
82
|
-
|
|
92
|
+
m = "bg-transparent";
|
|
83
93
|
break;
|
|
84
94
|
}
|
|
85
|
-
|
|
95
|
+
m += " rounded-lg";
|
|
86
96
|
}
|
|
87
|
-
return [a,
|
|
88
|
-
}),
|
|
89
|
-
if (
|
|
90
|
-
const a =
|
|
97
|
+
return [a, z, m].join(" ");
|
|
98
|
+
}), j = w(() => {
|
|
99
|
+
if (i.variant === "solid" && !i.attached) {
|
|
100
|
+
const a = i.item.color;
|
|
91
101
|
if (a && !["primary", "secondary", "success", "warning", "danger", "info"].includes(a))
|
|
92
102
|
return { backgroundColor: `${a}15` };
|
|
93
103
|
}
|
|
94
|
-
if (
|
|
95
|
-
const a =
|
|
104
|
+
if (i.layout === "split-bar") {
|
|
105
|
+
const a = i.item.color, u = {
|
|
96
106
|
primary: "var(--color-primary)",
|
|
97
107
|
secondary: "var(--color-secondary)",
|
|
98
108
|
success: "var(--color-success)",
|
|
@@ -101,157 +111,205 @@ const F = { class: "flex items-center justify-between w-full mt-1" }, $ = {
|
|
|
101
111
|
info: "var(--color-info)"
|
|
102
112
|
};
|
|
103
113
|
if (a)
|
|
104
|
-
return { borderLeftColor:
|
|
114
|
+
return { borderLeftColor: u[a] || a };
|
|
105
115
|
}
|
|
106
116
|
return {};
|
|
107
117
|
});
|
|
108
|
-
return (a,
|
|
109
|
-
class:
|
|
110
|
-
style:
|
|
118
|
+
return (a, u) => (t(), o("div", {
|
|
119
|
+
class: r(F.value),
|
|
120
|
+
style: $(j.value)
|
|
111
121
|
}, [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
class:
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
e.layout === "title-top-icon-bottom-right" ? (t(), o(k, { key: 0 }, [
|
|
123
|
+
l("h3", {
|
|
124
|
+
class: r(e.titleSize || "text-sm font-medium text-muted-foreground truncate w-full")
|
|
125
|
+
}, c(e.item.titleI18n ? b(x)(e.item.titleI18n) : e.item.title), 3),
|
|
126
|
+
l("div", V, [
|
|
127
|
+
l("div", null, [
|
|
128
|
+
e.loading ? (t(), o("div", M)) : (t(), n(v, {
|
|
119
129
|
key: 1,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
130
|
+
content: f.value,
|
|
131
|
+
disabled: !y.value
|
|
132
|
+
}, {
|
|
133
|
+
default: g(() => [
|
|
134
|
+
l("p", {
|
|
135
|
+
class: r(e.valueSize || "text-2xl font-bold text-foreground truncate")
|
|
136
|
+
}, c(s(e.item)), 3)
|
|
137
|
+
]),
|
|
138
|
+
_: 1
|
|
139
|
+
}, 8, ["content", "disabled"])),
|
|
140
|
+
e.item.trend && !e.loading ? (t(), n(h, {
|
|
123
141
|
key: 2,
|
|
124
|
-
trend:
|
|
125
|
-
layout:
|
|
126
|
-
}, null, 8, ["trend", "layout"])) :
|
|
142
|
+
trend: e.item.trend,
|
|
143
|
+
layout: e.layout
|
|
144
|
+
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
127
145
|
]),
|
|
128
|
-
|
|
146
|
+
e.item.icon ? (t(), n(S, {
|
|
129
147
|
key: 0,
|
|
130
|
-
item:
|
|
131
|
-
variant:
|
|
132
|
-
layout:
|
|
133
|
-
attached:
|
|
134
|
-
"icon-box-shape":
|
|
135
|
-
"icon-box-style":
|
|
136
|
-
"icon-size":
|
|
137
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
148
|
+
item: e.item,
|
|
149
|
+
variant: e.variant,
|
|
150
|
+
layout: e.layout,
|
|
151
|
+
attached: e.attached,
|
|
152
|
+
"icon-box-shape": e.iconBoxShape,
|
|
153
|
+
"icon-box-style": e.iconBoxStyle,
|
|
154
|
+
"icon-size": e.iconSize
|
|
155
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0)
|
|
138
156
|
])
|
|
139
|
-
], 64)) :
|
|
140
|
-
|
|
157
|
+
], 64)) : e.layout === "centered-value-title" ? (t(), o(k, { key: 1 }, [
|
|
158
|
+
e.loading ? (t(), o("div", E)) : (t(), n(v, {
|
|
141
159
|
key: 1,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
160
|
+
content: f.value,
|
|
161
|
+
disabled: !y.value
|
|
162
|
+
}, {
|
|
163
|
+
default: g(() => [
|
|
164
|
+
l("p", {
|
|
165
|
+
class: r(e.valueSize || "text-3xl font-bold text-foreground")
|
|
166
|
+
}, c(s(e.item)), 3)
|
|
167
|
+
]),
|
|
168
|
+
_: 1
|
|
169
|
+
}, 8, ["content", "disabled"])),
|
|
170
|
+
l("h3", {
|
|
171
|
+
class: r(e.titleSize || "text-sm font-medium text-muted-foreground")
|
|
172
|
+
}, c(e.item.titleI18n ? b(x)(e.item.titleI18n) : e.item.title), 3),
|
|
173
|
+
e.item.trend && !e.loading ? (t(), n(h, {
|
|
148
174
|
key: 2,
|
|
149
|
-
trend:
|
|
150
|
-
layout:
|
|
151
|
-
}, null, 8, ["trend", "layout"])) :
|
|
152
|
-
], 64)) :
|
|
153
|
-
|
|
175
|
+
trend: e.item.trend,
|
|
176
|
+
layout: e.layout
|
|
177
|
+
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
178
|
+
], 64)) : e.layout === "floating-icon" ? (t(), o(k, { key: 2 }, [
|
|
179
|
+
e.item.icon ? (t(), n(S, {
|
|
154
180
|
key: 0,
|
|
155
|
-
item:
|
|
156
|
-
variant:
|
|
157
|
-
layout:
|
|
158
|
-
attached:
|
|
159
|
-
"icon-box-shape":
|
|
160
|
-
"icon-box-style":
|
|
161
|
-
"icon-size":
|
|
181
|
+
item: e.item,
|
|
182
|
+
variant: e.variant,
|
|
183
|
+
layout: e.layout,
|
|
184
|
+
attached: e.attached,
|
|
185
|
+
"icon-box-shape": e.iconBoxShape,
|
|
186
|
+
"icon-box-style": e.iconBoxStyle,
|
|
187
|
+
"icon-size": e.iconSize,
|
|
162
188
|
class: "absolute top-4 right-4"
|
|
163
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
164
|
-
|
|
165
|
-
class:
|
|
166
|
-
},
|
|
167
|
-
|
|
189
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
|
|
190
|
+
l("h3", {
|
|
191
|
+
class: r(e.titleSize || "text-sm font-medium text-muted-foreground truncate pr-12")
|
|
192
|
+
}, c(e.item.titleI18n ? b(x)(e.item.titleI18n) : e.item.title), 3),
|
|
193
|
+
e.loading ? (t(), o("div", D)) : (t(), n(v, {
|
|
168
194
|
key: 2,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
195
|
+
content: f.value,
|
|
196
|
+
disabled: !y.value
|
|
197
|
+
}, {
|
|
198
|
+
default: g(() => [
|
|
199
|
+
l("p", {
|
|
200
|
+
class: r(e.valueSize || "text-2xl font-bold text-foreground truncate mt-1")
|
|
201
|
+
}, c(s(e.item)), 3)
|
|
202
|
+
]),
|
|
203
|
+
_: 1
|
|
204
|
+
}, 8, ["content", "disabled"])),
|
|
205
|
+
e.item.trend && !e.loading ? (t(), n(h, {
|
|
172
206
|
key: 3,
|
|
173
|
-
trend:
|
|
174
|
-
layout:
|
|
175
|
-
}, null, 8, ["trend", "layout"])) :
|
|
176
|
-
], 64)) :
|
|
177
|
-
|
|
178
|
-
class:
|
|
179
|
-
|
|
207
|
+
trend: e.item.trend,
|
|
208
|
+
layout: e.layout
|
|
209
|
+
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
210
|
+
], 64)) : e.layout === "split-bar" ? (t(), o("div", L, [
|
|
211
|
+
l("h3", {
|
|
212
|
+
class: r(
|
|
213
|
+
e.titleSize || "text-xs font-semibold uppercase tracking-widest text-muted-foreground truncate"
|
|
180
214
|
)
|
|
181
|
-
},
|
|
182
|
-
|
|
215
|
+
}, c(e.item.titleI18n ? b(x)(e.item.titleI18n) : e.item.title), 3),
|
|
216
|
+
e.loading ? (t(), o("div", q)) : (t(), n(v, {
|
|
183
217
|
key: 1,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
218
|
+
content: f.value,
|
|
219
|
+
disabled: !y.value
|
|
220
|
+
}, {
|
|
221
|
+
default: g(() => [
|
|
222
|
+
l("p", {
|
|
223
|
+
class: r(e.valueSize || "text-3xl font-black text-foreground truncate mt-0.5")
|
|
224
|
+
}, c(s(e.item)), 3)
|
|
225
|
+
]),
|
|
226
|
+
_: 1
|
|
227
|
+
}, 8, ["content", "disabled"])),
|
|
228
|
+
e.item.trend && !e.loading ? (t(), n(h, {
|
|
187
229
|
key: 2,
|
|
188
|
-
trend:
|
|
189
|
-
layout:
|
|
190
|
-
}, null, 8, ["trend", "layout"])) :
|
|
191
|
-
])) :
|
|
192
|
-
|
|
230
|
+
trend: e.item.trend,
|
|
231
|
+
layout: e.layout
|
|
232
|
+
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
233
|
+
])) : e.layout === "inline-label-value" ? (t(), o(k, { key: 4 }, [
|
|
234
|
+
e.item.icon ? (t(), n(S, {
|
|
193
235
|
key: 0,
|
|
194
|
-
item:
|
|
195
|
-
variant:
|
|
196
|
-
layout:
|
|
197
|
-
attached:
|
|
198
|
-
"icon-box-shape":
|
|
199
|
-
"icon-box-style":
|
|
200
|
-
"icon-size":
|
|
201
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
202
|
-
|
|
203
|
-
class:
|
|
204
|
-
},
|
|
205
|
-
|
|
236
|
+
item: e.item,
|
|
237
|
+
variant: e.variant,
|
|
238
|
+
layout: e.layout,
|
|
239
|
+
attached: e.attached,
|
|
240
|
+
"icon-box-shape": e.iconBoxShape,
|
|
241
|
+
"icon-box-style": e.iconBoxStyle,
|
|
242
|
+
"icon-size": e.iconSize
|
|
243
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
|
|
244
|
+
l("span", {
|
|
245
|
+
class: r([e.titleSize || "-text-fs-2 font-medium text-muted-foreground truncate", "flex-1 min-w-0"])
|
|
246
|
+
}, c(e.item.titleI18n ? b(x)(e.item.titleI18n) : e.item.title), 3),
|
|
247
|
+
e.loading ? (t(), o("div", A)) : (t(), n(v, {
|
|
206
248
|
key: 2,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
249
|
+
content: f.value,
|
|
250
|
+
disabled: !y.value
|
|
251
|
+
}, {
|
|
252
|
+
default: g(() => [
|
|
253
|
+
l("span", {
|
|
254
|
+
class: r(e.valueSize || "-text-fs-1 font-semibold text-foreground tabular-nums shrink-0")
|
|
255
|
+
}, c(s(e.item)), 3)
|
|
256
|
+
]),
|
|
257
|
+
_: 1
|
|
258
|
+
}, 8, ["content", "disabled"])),
|
|
259
|
+
e.item.trend && !e.loading ? (t(), n(h, {
|
|
210
260
|
key: 3,
|
|
211
|
-
trend:
|
|
212
|
-
layout:
|
|
213
|
-
}, null, 8, ["trend", "layout"])) :
|
|
214
|
-
], 64)) : (
|
|
215
|
-
|
|
261
|
+
trend: e.item.trend,
|
|
262
|
+
layout: e.layout
|
|
263
|
+
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
264
|
+
], 64)) : (t(), o(k, { key: 5 }, [
|
|
265
|
+
e.item.icon && e.layout !== "icon-right" ? (t(), n(S, {
|
|
216
266
|
key: 0,
|
|
217
|
-
item:
|
|
218
|
-
variant:
|
|
219
|
-
layout:
|
|
220
|
-
attached:
|
|
221
|
-
"icon-box-shape":
|
|
222
|
-
"icon-box-style":
|
|
223
|
-
"icon-size":
|
|
224
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
class:
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
|
|
267
|
+
item: e.item,
|
|
268
|
+
variant: e.variant,
|
|
269
|
+
layout: e.layout,
|
|
270
|
+
attached: e.attached,
|
|
271
|
+
"icon-box-shape": e.iconBoxShape,
|
|
272
|
+
"icon-box-style": e.iconBoxStyle,
|
|
273
|
+
"icon-size": e.iconSize
|
|
274
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
|
|
275
|
+
l("div", G, [
|
|
276
|
+
l("h3", {
|
|
277
|
+
class: r(e.titleSize || "text-sm font-medium text-muted-foreground truncate")
|
|
278
|
+
}, c(e.item.titleI18n ? b(x)(e.item.titleI18n) : e.item.title), 3),
|
|
279
|
+
l("div", H, [
|
|
280
|
+
e.loading ? (t(), o("div", J)) : (t(), n(v, {
|
|
231
281
|
key: 1,
|
|
232
|
-
|
|
233
|
-
|
|
282
|
+
content: f.value,
|
|
283
|
+
disabled: !y.value
|
|
284
|
+
}, {
|
|
285
|
+
default: g(() => [
|
|
286
|
+
l("p", {
|
|
287
|
+
class: r(e.valueSize || "text-2xl font-bold text-foreground truncate")
|
|
288
|
+
}, c(s(e.item)), 3)
|
|
289
|
+
]),
|
|
290
|
+
_: 1
|
|
291
|
+
}, 8, ["content", "disabled"]))
|
|
234
292
|
]),
|
|
235
|
-
|
|
293
|
+
e.item.trend && !e.loading ? (t(), n(h, {
|
|
236
294
|
key: 0,
|
|
237
|
-
trend:
|
|
238
|
-
layout:
|
|
239
|
-
}, null, 8, ["trend", "layout"])) :
|
|
295
|
+
trend: e.item.trend,
|
|
296
|
+
layout: e.layout
|
|
297
|
+
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
240
298
|
]),
|
|
241
|
-
|
|
299
|
+
e.item.icon && e.layout === "icon-right" ? (t(), n(S, {
|
|
242
300
|
key: 1,
|
|
243
|
-
item:
|
|
244
|
-
variant:
|
|
245
|
-
layout:
|
|
246
|
-
attached:
|
|
247
|
-
"icon-box-shape":
|
|
248
|
-
"icon-box-style":
|
|
249
|
-
"icon-size":
|
|
250
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
301
|
+
item: e.item,
|
|
302
|
+
variant: e.variant,
|
|
303
|
+
layout: e.layout,
|
|
304
|
+
attached: e.attached,
|
|
305
|
+
"icon-box-shape": e.iconBoxShape,
|
|
306
|
+
"icon-box-style": e.iconBoxStyle,
|
|
307
|
+
"icon-size": e.iconSize
|
|
308
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0)
|
|
251
309
|
], 64))
|
|
252
310
|
], 6));
|
|
253
311
|
}
|
|
254
312
|
});
|
|
255
313
|
export {
|
|
256
|
-
|
|
314
|
+
Y as default
|
|
257
315
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as y, computed as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as y, computed as s, openBlock as u, createElementBlock as m, normalizeStyle as g, normalizeClass as c, createVNode as x, createBlock as b, createCommentVNode as p } from "vue";
|
|
2
|
+
import f from "../../Icon.vue.js";
|
|
3
|
+
const S = /* @__PURE__ */ y({
|
|
4
4
|
__name: "StatIconBox",
|
|
5
5
|
props: {
|
|
6
6
|
item: {},
|
|
@@ -12,31 +12,31 @@ const w = /* @__PURE__ */ y({
|
|
|
12
12
|
iconSize: {},
|
|
13
13
|
class: {}
|
|
14
14
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const e =
|
|
17
|
-
if (
|
|
18
|
-
const
|
|
15
|
+
setup(r) {
|
|
16
|
+
const e = r, o = s(() => e.layout === "inline-label-value"), d = s(() => e.iconBoxShape === "full-rounded" ? "rounded-full" : e.iconBoxShape === "none" ? "rounded-none" : "rounded-lg"), i = s(() => {
|
|
17
|
+
if (o.value) {
|
|
18
|
+
const t = e.item.color || "primary";
|
|
19
19
|
return `shrink-0 ${{
|
|
20
20
|
primary: "text-primary",
|
|
21
21
|
secondary: "text-secondary-foreground",
|
|
22
|
-
success: "text-success-
|
|
23
|
-
warning: "text-warning-
|
|
24
|
-
danger: "text-danger-
|
|
25
|
-
info: "text-info-
|
|
26
|
-
}[
|
|
22
|
+
success: "text-success-subtle-fg",
|
|
23
|
+
warning: "text-warning-subtle-fg",
|
|
24
|
+
danger: "text-danger-subtle-fg",
|
|
25
|
+
info: "text-info-subtle-fg"
|
|
26
|
+
}[t] || "text-primary"} ${e.class || ""}`;
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const n = `flex items-center justify-center shrink-0 ${d.value} p-3 ${e.class || ""}`, a = e.item.color || "primary";
|
|
29
29
|
if (e.iconBoxStyle === "transparent")
|
|
30
|
-
return `${
|
|
30
|
+
return `${n} bg-transparent ${{
|
|
31
31
|
primary: "text-primary",
|
|
32
32
|
secondary: "text-secondary-foreground",
|
|
33
|
-
success: "text-success-
|
|
34
|
-
warning: "text-warning-
|
|
35
|
-
danger: "text-danger-
|
|
36
|
-
info: "text-info-
|
|
37
|
-
}[
|
|
33
|
+
success: "text-success-subtle-fg",
|
|
34
|
+
warning: "text-warning-subtle-fg",
|
|
35
|
+
danger: "text-danger-subtle-fg",
|
|
36
|
+
info: "text-info-subtle-fg"
|
|
37
|
+
}[a] || "text-primary"}`;
|
|
38
38
|
if (e.variant === "solid" && !e.attached) {
|
|
39
|
-
const
|
|
39
|
+
const t = {
|
|
40
40
|
primary: "bg-primary text-primary-fg",
|
|
41
41
|
secondary: "bg-foreground text-background",
|
|
42
42
|
success: "bg-success text-success-fg",
|
|
@@ -44,39 +44,39 @@ const w = /* @__PURE__ */ y({
|
|
|
44
44
|
danger: "bg-danger text-danger-fg",
|
|
45
45
|
info: "bg-info text-info-fg"
|
|
46
46
|
};
|
|
47
|
-
return `${
|
|
47
|
+
return `${n} ${t[a] || t.primary}`;
|
|
48
48
|
} else {
|
|
49
|
-
const
|
|
49
|
+
const t = {
|
|
50
50
|
primary: "bg-primary-light text-primary",
|
|
51
51
|
secondary: "bg-secondary text-secondary-foreground",
|
|
52
|
-
success: "bg-success-
|
|
53
|
-
warning: "bg-warning-
|
|
54
|
-
danger: "bg-danger-
|
|
55
|
-
info: "bg-info-
|
|
52
|
+
success: "bg-success-subtle text-success-subtle-fg",
|
|
53
|
+
warning: "bg-warning-subtle text-warning-subtle-fg",
|
|
54
|
+
danger: "bg-danger-subtle text-danger-subtle-fg",
|
|
55
|
+
info: "bg-info-subtle text-info-subtle-fg"
|
|
56
56
|
};
|
|
57
|
-
return `${
|
|
57
|
+
return `${n} ${t[a] || t.primary}`;
|
|
58
58
|
}
|
|
59
|
-
}), l =
|
|
60
|
-
const
|
|
61
|
-
return
|
|
59
|
+
}), l = s(() => {
|
|
60
|
+
const n = e.item.color;
|
|
61
|
+
return o.value ? n && !["primary", "secondary", "success", "warning", "danger", "info"].includes(n) ? { color: n } : {} : n && !["primary", "secondary", "success", "warning", "danger", "info"].includes(n) ? e.iconBoxStyle === "transparent" ? { color: n } : e.variant === "solid" && !e.attached ? { backgroundColor: n, color: "#fff" } : { color: n, backgroundColor: `${n}20` } : {};
|
|
62
62
|
});
|
|
63
|
-
return (
|
|
63
|
+
return (n, a) => !o.value && r.item.icon ? (u(), m("div", {
|
|
64
64
|
key: 0,
|
|
65
|
-
class: i
|
|
66
|
-
style:
|
|
65
|
+
class: c(i.value),
|
|
66
|
+
style: g(l.value)
|
|
67
67
|
}, [
|
|
68
|
-
x(
|
|
69
|
-
icon:
|
|
70
|
-
class:
|
|
68
|
+
x(f, {
|
|
69
|
+
icon: r.item.icon,
|
|
70
|
+
class: c(r.iconSize || "w-6 h-6")
|
|
71
71
|
}, null, 8, ["icon", "class"])
|
|
72
|
-
], 6)) :
|
|
72
|
+
], 6)) : o.value && r.item.icon ? (u(), b(f, {
|
|
73
73
|
key: 1,
|
|
74
|
-
icon:
|
|
75
|
-
class:
|
|
76
|
-
style:
|
|
77
|
-
}, null, 8, ["icon", "class", "style"])) :
|
|
74
|
+
icon: r.item.icon,
|
|
75
|
+
class: c([i.value, r.iconSize || "w-4.5 h-4.5"]),
|
|
76
|
+
style: g(l.value)
|
|
77
|
+
}, null, 8, ["icon", "class", "style"])) : p("", !0);
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
export {
|
|
81
|
-
|
|
81
|
+
S as default
|
|
82
82
|
};
|