vlite3 1.4.19 → 1.4.21
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 +2 -2
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/Form/FormField.vue.js +91 -91
- 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/Stats/StatItem.vue.js +122 -122
- package/components/Stats/Stats.vue.js +47 -47
- package/components/Stats/components/StatIconBox.vue.js +1 -1
- package/components/Stats/components/StatTrend.vue.js +17 -17
- package/components/Stats/types.d.ts +1 -1
- package/package.json +1 -1
- /package/components/RichTextEditor/{RichTextLinkPopover.vue2.js → RichTextLinkPopover.vue.js} +0 -0
- /package/components/RichTextEditor/{RichTextToolbar.vue2.js → RichTextToolbar.vue.js} +0 -0
|
@@ -4,7 +4,7 @@ import k from "../Icon.vue.js";
|
|
|
4
4
|
import { $t as E } from "../../utils/i18n.js";
|
|
5
5
|
import { useCommandPaletteItems as Y } from "./useCommandPaletteItems.js";
|
|
6
6
|
import { useCommandPaletteNav as Z } from "./useCommandPaletteNav.js";
|
|
7
|
-
import ee from "./CommandPaletteItem.
|
|
7
|
+
import ee from "./CommandPaletteItem.vue2.js";
|
|
8
8
|
const te = { class: "command-palette-content flex flex-col w-full h-full max-h-[70vh]" }, oe = { class: "flex items-center gap-3 px-4 py-3 border-b border-border/80 shrink-0" }, se = ["placeholder"], ne = ["aria-label"], re = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "flex flex-col items-center justify-center py-14 px-6 text-center select-none",
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as E, computed as
|
|
2
|
-
import { resolveFieldType as
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as E, computed as f, markRaw as O, openBlock as c, createBlock as m, mergeProps as p, toHandlers as C, createSlots as M, unref as P, withCtx as u, createVNode as L, createTextVNode as y, toDisplayString as x, createCommentVNode as N, resolveDynamicComponent as q } from "vue";
|
|
2
|
+
import { resolveFieldType as G, isComponent as k, isAddonObject as B } from "./utils/form.utils.js";
|
|
3
|
+
import J from "../NumberInput.vue.js";
|
|
4
4
|
import z from "../Button.vue.js";
|
|
5
|
-
import { $t as
|
|
5
|
+
import { $t as K } from "../../utils/i18n.js";
|
|
6
6
|
import V from "../Input.vue.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
8
|
+
import Q from "../Switch.vue.js";
|
|
9
|
+
import W from "../CheckBox.vue.js";
|
|
10
|
+
import X from "../FilePicker/index.vue.js";
|
|
11
|
+
import Y from "../AvatarUploader/AvatarUploader.vue.js";
|
|
12
|
+
import Z from "../ThumbnailSelector/ThumbnailSelector.vue.js";
|
|
13
|
+
import _ from "../TagInput/TagInput.vue.js";
|
|
14
|
+
import R from "../Dropdown/Dropdown.vue.js";
|
|
15
|
+
import ee from "../MultiSelect/MultiSelect.vue.js";
|
|
16
|
+
import ae from "../DatePicker.vue.js";
|
|
17
|
+
import le from "../DateRangePicker.vue.js";
|
|
18
|
+
import ie from "../ColorPicker/ColorPicker.vue.js";
|
|
19
|
+
import te from "../IconPicker.vue.js";
|
|
20
|
+
import re from "./index.vue.js";
|
|
21
|
+
import ne from "../ChoiceBox/ChoiceBox.vue.js";
|
|
22
|
+
import de from "../RichTextEditor/RichTextEditor.vue.js";
|
|
23
23
|
/* empty css */
|
|
24
|
-
const
|
|
24
|
+
const Ne = /* @__PURE__ */ E({
|
|
25
25
|
__name: "FormField",
|
|
26
26
|
props: {
|
|
27
27
|
field: {},
|
|
@@ -45,16 +45,16 @@ const Be = /* @__PURE__ */ E({
|
|
|
45
45
|
v("change", { value: a, data: l });
|
|
46
46
|
}, S = (a) => {
|
|
47
47
|
v("change", { value: a });
|
|
48
|
-
},
|
|
48
|
+
}, o = f(() => G(e.field, {
|
|
49
49
|
values: e.values,
|
|
50
50
|
globalValues: e.values,
|
|
51
51
|
isUpdate: e.isUpdate
|
|
52
|
-
})),
|
|
53
|
-
() =>
|
|
54
|
-
), U =
|
|
55
|
-
const a =
|
|
56
|
-
if (
|
|
57
|
-
return
|
|
52
|
+
})), b = f(
|
|
53
|
+
() => o.value === "number" && e.field.isSensitiveField === !0
|
|
54
|
+
), U = f(() => {
|
|
55
|
+
const a = o.value;
|
|
56
|
+
if (k(a))
|
|
57
|
+
return O(a);
|
|
58
58
|
switch (a) {
|
|
59
59
|
case "text":
|
|
60
60
|
case "email":
|
|
@@ -65,57 +65,57 @@ const Be = /* @__PURE__ */ E({
|
|
|
65
65
|
case "textarea":
|
|
66
66
|
return V;
|
|
67
67
|
case "number":
|
|
68
|
-
return
|
|
68
|
+
return b.value ? V : J;
|
|
69
69
|
case "switch":
|
|
70
|
-
return
|
|
70
|
+
return Q;
|
|
71
71
|
case "check":
|
|
72
|
-
return
|
|
72
|
+
return W;
|
|
73
73
|
case "select":
|
|
74
|
-
return
|
|
74
|
+
return R;
|
|
75
75
|
case "multiSelect":
|
|
76
|
-
return
|
|
76
|
+
return ee;
|
|
77
77
|
case "choiceBox":
|
|
78
|
-
return
|
|
78
|
+
return ne;
|
|
79
79
|
case "date":
|
|
80
80
|
case "time":
|
|
81
|
-
return
|
|
81
|
+
return ae;
|
|
82
82
|
case "dateRangePicker":
|
|
83
|
-
return
|
|
83
|
+
return le;
|
|
84
84
|
case "file":
|
|
85
85
|
case "fileUploader":
|
|
86
|
-
return
|
|
86
|
+
return X;
|
|
87
87
|
case "avatarUpload":
|
|
88
|
-
return
|
|
88
|
+
return Y;
|
|
89
89
|
case "color":
|
|
90
|
-
return
|
|
90
|
+
return ie;
|
|
91
91
|
case "iconPicker":
|
|
92
|
-
return
|
|
92
|
+
return te;
|
|
93
93
|
case "customFields":
|
|
94
|
-
return
|
|
94
|
+
return re;
|
|
95
95
|
case "thumbnailSelector":
|
|
96
|
-
return
|
|
96
|
+
return Z;
|
|
97
97
|
case "tags":
|
|
98
|
-
return
|
|
98
|
+
return _;
|
|
99
99
|
case "richTextEditor":
|
|
100
|
-
return
|
|
100
|
+
return de;
|
|
101
101
|
default:
|
|
102
102
|
return V;
|
|
103
103
|
}
|
|
104
|
-
}),
|
|
105
|
-
const a =
|
|
104
|
+
}), w = f(() => {
|
|
105
|
+
const a = o.value, { disabled: l, readonly: r, ...g } = e.field, t = {
|
|
106
106
|
...g,
|
|
107
107
|
disabled: e.disabled || l === !0,
|
|
108
108
|
readonly: e.readonly || r === !0,
|
|
109
109
|
...e.field.props || {},
|
|
110
110
|
label: "",
|
|
111
111
|
labelI18n: ""
|
|
112
|
-
}, h = e.field.placeholderI18n ?
|
|
112
|
+
}, h = e.field.placeholderI18n ? K(e.field.placeholderI18n) : e.field.placeholder, I = e.variant === "floating" && e.label && !e.floatingActive, s = I ? "" : h;
|
|
113
113
|
if (a === "text" || a === "email" || a === "password" || a === "tel" || a === "url" || a === "search" || a === "textarea" || !a)
|
|
114
114
|
return {
|
|
115
115
|
...t,
|
|
116
116
|
modelValue: e.value ?? "",
|
|
117
117
|
type: a || "text",
|
|
118
|
-
placeholder:
|
|
118
|
+
placeholder: s,
|
|
119
119
|
label: e.label,
|
|
120
120
|
icon: e.field.icon,
|
|
121
121
|
iconRight: e.field.iconRight,
|
|
@@ -131,14 +131,14 @@ const Be = /* @__PURE__ */ E({
|
|
|
131
131
|
rows: a === "textarea" ? e.field.props?.rows || 3 : void 0,
|
|
132
132
|
class: `${e.field.className || ""}`
|
|
133
133
|
};
|
|
134
|
-
if (a === "number" &&
|
|
134
|
+
if (a === "number" && b.value)
|
|
135
135
|
return {
|
|
136
136
|
...t,
|
|
137
137
|
// Convert numeric value to string so Input.vue (string-based) displays it correctly
|
|
138
138
|
modelValue: e.value !== void 0 && e.value !== null ? String(e.value) : "",
|
|
139
139
|
// 'password' activates the eye-toggle inside Input.vue
|
|
140
140
|
type: "password",
|
|
141
|
-
placeholder:
|
|
141
|
+
placeholder: s,
|
|
142
142
|
label: e.label,
|
|
143
143
|
variant: e.variant,
|
|
144
144
|
size: e.size,
|
|
@@ -159,15 +159,15 @@ const Be = /* @__PURE__ */ E({
|
|
|
159
159
|
mode: e.field.props?.mode ?? (e.variant === "transparent" ? "ghost" : "outline"),
|
|
160
160
|
size: e.size,
|
|
161
161
|
rounded: e.rounded,
|
|
162
|
-
placeholder:
|
|
162
|
+
placeholder: s,
|
|
163
163
|
class: e.field.className
|
|
164
164
|
};
|
|
165
165
|
if (a === "switch") {
|
|
166
166
|
const {
|
|
167
167
|
variant: n,
|
|
168
|
-
rounded:
|
|
169
|
-
error:
|
|
170
|
-
switchVariant:
|
|
168
|
+
rounded: oe,
|
|
169
|
+
error: se,
|
|
170
|
+
switchVariant: ue,
|
|
171
171
|
...D
|
|
172
172
|
} = t;
|
|
173
173
|
return {
|
|
@@ -194,7 +194,7 @@ const Be = /* @__PURE__ */ E({
|
|
|
194
194
|
...t,
|
|
195
195
|
modelValue: e.value,
|
|
196
196
|
options: e.field.options || [],
|
|
197
|
-
placeholder:
|
|
197
|
+
placeholder: s,
|
|
198
198
|
selectable: !0,
|
|
199
199
|
closeOnSelect: !0,
|
|
200
200
|
triggerProps: {
|
|
@@ -243,7 +243,7 @@ const Be = /* @__PURE__ */ E({
|
|
|
243
243
|
...t,
|
|
244
244
|
modelValue: e.value,
|
|
245
245
|
mode: a === "time" ? "time" : "date",
|
|
246
|
-
placeholder:
|
|
246
|
+
placeholder: s,
|
|
247
247
|
btnProps: {
|
|
248
248
|
variant: e.variant === "floating" ? "outline-floating" : e.variant || "outline",
|
|
249
249
|
size: e.size,
|
|
@@ -267,7 +267,7 @@ const Be = /* @__PURE__ */ E({
|
|
|
267
267
|
fileTypes: e.field.props?.accept ? e.field.props.accept.split(",") : [],
|
|
268
268
|
returnFormat: "base64",
|
|
269
269
|
variant: e.field.props?.variant ?? (a === "file" ? "input" : "dropzone"),
|
|
270
|
-
placeholder:
|
|
270
|
+
placeholder: s,
|
|
271
271
|
size: e.size,
|
|
272
272
|
rounded: e.rounded,
|
|
273
273
|
maxSize: e.field.maxFileSize ? e.field.maxFileSize * 1024 * 1024 : void 0,
|
|
@@ -287,7 +287,7 @@ const Be = /* @__PURE__ */ E({
|
|
|
287
287
|
return {
|
|
288
288
|
...t,
|
|
289
289
|
modelValue: Array.isArray(e.value) ? e.value : [],
|
|
290
|
-
placeholder:
|
|
290
|
+
placeholder: s,
|
|
291
291
|
variant: e.variant,
|
|
292
292
|
size: e.size,
|
|
293
293
|
rounded: e.rounded,
|
|
@@ -298,7 +298,7 @@ const Be = /* @__PURE__ */ E({
|
|
|
298
298
|
return {
|
|
299
299
|
...t,
|
|
300
300
|
modelValue: e.value ?? "",
|
|
301
|
-
placeholder:
|
|
301
|
+
placeholder: s,
|
|
302
302
|
label: void 0,
|
|
303
303
|
error: e.error,
|
|
304
304
|
minHeight: e.field.props?.minHeight || "140px",
|
|
@@ -348,16 +348,16 @@ const Be = /* @__PURE__ */ E({
|
|
|
348
348
|
label: e.field.label
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
|
-
return
|
|
351
|
+
return k(a) ? {
|
|
352
352
|
...t,
|
|
353
353
|
value: e.field.props?.multiple && (e.value === null || e.value === void 0) ? [] : e.value,
|
|
354
354
|
values: e.values
|
|
355
355
|
} : t;
|
|
356
|
-
}), $ =
|
|
357
|
-
const a =
|
|
356
|
+
}), $ = f(() => {
|
|
357
|
+
const a = o.value;
|
|
358
358
|
return a === "text" || a === "email" || a === "password" || a === "tel" || a === "url" || a === "search" || a === "textarea" || a === "switch" || a === "check" || !a ? {
|
|
359
359
|
"update:modelValue": S
|
|
360
|
-
} : a === "number" &&
|
|
360
|
+
} : a === "number" && b.value ? {
|
|
361
361
|
"update:modelValue": (l) => {
|
|
362
362
|
const r = l === "" ? void 0 : Number(l);
|
|
363
363
|
v("change", { value: isNaN(r) ? void 0 : r });
|
|
@@ -417,37 +417,37 @@ const Be = /* @__PURE__ */ E({
|
|
|
417
417
|
const r = e.value && typeof e.value == "object" ? e.value : { images: [], thumbnail: null };
|
|
418
418
|
d({ ...r, thumbnail: l });
|
|
419
419
|
}
|
|
420
|
-
} :
|
|
420
|
+
} : k(a) ? {
|
|
421
421
|
onChange: (l) => {
|
|
422
422
|
d(l.value, l.data);
|
|
423
423
|
}
|
|
424
424
|
} : {};
|
|
425
|
-
}),
|
|
426
|
-
const a =
|
|
425
|
+
}), H = f(() => {
|
|
426
|
+
const a = o.value;
|
|
427
427
|
return a === "text" || a === "email" || a === "password" || a === "tel" || a === "url" || a === "search" || !a;
|
|
428
|
-
}),
|
|
428
|
+
}), j = f(() => H.value || o.value === "textarea" || b.value), A = (a, l) => {
|
|
429
429
|
v("addonChange", a.name, { value: l.value });
|
|
430
|
-
},
|
|
430
|
+
}, F = (a) => {
|
|
431
431
|
a.action && v("addonAction", a.action);
|
|
432
432
|
};
|
|
433
|
-
return (a, l) =>
|
|
434
|
-
...
|
|
433
|
+
return (a, l) => j.value ? (c(), m(V, p({ key: 0 }, {
|
|
434
|
+
...w.value,
|
|
435
435
|
...i.field?.props || {}
|
|
436
|
-
},
|
|
437
|
-
P(
|
|
436
|
+
}, C($.value)), M({ _: 2 }, [
|
|
437
|
+
P(B)(i.field.addonLeft) ? {
|
|
438
438
|
name: "addon-left",
|
|
439
439
|
fn: u(() => [
|
|
440
|
-
i.field.addonLeft.type === "select" ? (c(), m(
|
|
440
|
+
i.field.addonLeft.type === "select" ? (c(), m(R, p({
|
|
441
441
|
key: 0,
|
|
442
442
|
modelValue: i.field.addonLeft.name ? i.values[i.field.addonLeft.name] : void 0,
|
|
443
443
|
options: i.field.addonLeft.options || []
|
|
444
444
|
}, i.field.addonLeft.props || {}, {
|
|
445
|
-
onOnSelect: l[0] || (l[0] = (r) =>
|
|
445
|
+
onOnSelect: l[0] || (l[0] = (r) => A(i.field.addonLeft, r))
|
|
446
446
|
}), {
|
|
447
447
|
trigger: u(({ selectedLabel: r }) => [
|
|
448
|
-
|
|
448
|
+
L(z, { variant: "outline" }, {
|
|
449
449
|
default: u(() => [
|
|
450
|
-
|
|
450
|
+
y(x(r), 1)
|
|
451
451
|
]),
|
|
452
452
|
_: 2
|
|
453
453
|
}, 1024)
|
|
@@ -457,30 +457,30 @@ const Be = /* @__PURE__ */ E({
|
|
|
457
457
|
key: 1,
|
|
458
458
|
variant: "outline"
|
|
459
459
|
}, i.field.addonLeft.props || {}, {
|
|
460
|
-
onClick: l[1] || (l[1] = (r) =>
|
|
460
|
+
onClick: l[1] || (l[1] = (r) => F(i.field.addonLeft))
|
|
461
461
|
}), {
|
|
462
462
|
default: u(() => [
|
|
463
|
-
|
|
463
|
+
y(x(i.field.addonLeft.text), 1)
|
|
464
464
|
]),
|
|
465
465
|
_: 1
|
|
466
|
-
}, 16)) :
|
|
466
|
+
}, 16)) : N("", !0)
|
|
467
467
|
]),
|
|
468
468
|
key: "0"
|
|
469
469
|
} : void 0,
|
|
470
|
-
P(
|
|
470
|
+
P(B)(i.field.addonRight) ? {
|
|
471
471
|
name: "addon-right",
|
|
472
472
|
fn: u(() => [
|
|
473
|
-
i.field.addonRight.type === "select" ? (c(), m(
|
|
473
|
+
i.field.addonRight.type === "select" ? (c(), m(R, p({
|
|
474
474
|
key: 0,
|
|
475
475
|
modelValue: i.field.addonRight.name ? i.values[i.field.addonRight.name] : void 0,
|
|
476
476
|
options: i.field.addonRight.options || []
|
|
477
477
|
}, i.field.addonRight.props || {}, {
|
|
478
|
-
onOnSelect: l[2] || (l[2] = (r) =>
|
|
478
|
+
onOnSelect: l[2] || (l[2] = (r) => A(i.field.addonRight, r))
|
|
479
479
|
}), {
|
|
480
480
|
trigger: u(({ selectedLabel: r }) => [
|
|
481
|
-
|
|
481
|
+
L(z, { variant: "outline" }, {
|
|
482
482
|
default: u(() => [
|
|
483
|
-
|
|
483
|
+
y(x(r), 1)
|
|
484
484
|
]),
|
|
485
485
|
_: 2
|
|
486
486
|
}, 1024)
|
|
@@ -490,25 +490,25 @@ const Be = /* @__PURE__ */ E({
|
|
|
490
490
|
key: 1,
|
|
491
491
|
variant: "outline"
|
|
492
492
|
}, i.field.addonRight.props || {}, {
|
|
493
|
-
onClick: l[3] || (l[3] = (r) =>
|
|
493
|
+
onClick: l[3] || (l[3] = (r) => F(i.field.addonRight))
|
|
494
494
|
}), {
|
|
495
495
|
default: u(() => [
|
|
496
|
-
|
|
496
|
+
y(x(i.field.addonRight.text), 1)
|
|
497
497
|
]),
|
|
498
498
|
_: 1
|
|
499
|
-
}, 16)) :
|
|
499
|
+
}, 16)) : N("", !0)
|
|
500
500
|
]),
|
|
501
501
|
key: "1"
|
|
502
502
|
} : void 0
|
|
503
|
-
]), 1040)) : (c(), m(
|
|
503
|
+
]), 1040)) : (c(), m(q(U.value), p({
|
|
504
504
|
key: 1,
|
|
505
|
-
class:
|
|
505
|
+
class: o.value === "check" || o.value === "switch" && i.field.props?.switchVariant === "basic" ? "" : "w-full"
|
|
506
506
|
}, {
|
|
507
|
-
...
|
|
507
|
+
...w.value,
|
|
508
508
|
...i.field?.props || {}
|
|
509
|
-
},
|
|
509
|
+
}, C($.value)), null, 16, ["class"]));
|
|
510
510
|
}
|
|
511
511
|
});
|
|
512
512
|
export {
|
|
513
|
-
|
|
513
|
+
Ne as default
|
|
514
514
|
};
|
|
@@ -3,7 +3,7 @@ import L from "./Icon.vue.js";
|
|
|
3
3
|
import v from "./Modal.vue.js";
|
|
4
4
|
import N from "./CommandPalette/CommandPaletteContent.vue.js";
|
|
5
5
|
import { $t as U } from "../utils/i18n.js";
|
|
6
|
-
/* empty css
|
|
6
|
+
/* empty css */
|
|
7
7
|
const V = { class: "block truncate -text-fs-1.5" }, S = { class: "ml-auto inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-medium border border-border/80 bg-background text-muted-foreground ml-1" }, A = /* @__PURE__ */ x({
|
|
8
8
|
__name: "NavbarCommandPalette",
|
|
9
9
|
props: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as te, ref as v, shallowRef as ne, watch as oe, computed as h, onMounted as le, onUnmounted as ae, openBlock as C, createElementBlock as L, normalizeClass as re, toDisplayString as I, createCommentVNode as U, createElementVNode as w, createVNode as q, unref as a, normalizeStyle as ie } from "vue";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import se from "./RichTextToolbar.
|
|
4
|
-
/* empty css
|
|
5
|
-
import de from "./RichTextLinkPopover.
|
|
6
|
-
/* empty css
|
|
3
|
+
import se from "./RichTextToolbar.vue.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import de from "./RichTextLinkPopover.vue.js";
|
|
6
|
+
/* empty css */
|
|
7
7
|
import { useRichTextImageUpload as ue } from "./composables/useRichTextImageUpload.js";
|
|
8
8
|
import { useRichTextLinks as ce } from "./composables/useRichTextLinks.js";
|
|
9
9
|
const fe = ["aria-labelledby", "aria-describedby"], me = ["id", "for"], ve = { class: "rte-wrapper" }, ye = { class: "rte-body-wrap" }, ge = ["id", "contenteditable", "aria-label", "aria-readonly", "aria-disabled", "aria-invalid"], be = ["id"], Se = /* @__PURE__ */ te({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as T, computed as w, openBlock as
|
|
1
|
+
import { defineComponent as T, computed as w, openBlock as e, createElementBlock as o, normalizeStyle as $, normalizeClass as r, Fragment as k, createElementVNode as l, toDisplayString as c, unref as b, createBlock as i, withCtx as g, createCommentVNode as d } from "vue";
|
|
2
2
|
import { $t as x } from "../../utils/i18n.js";
|
|
3
3
|
import { formatCurrency as C, formatNumber as I } from "../../utils/functions.js";
|
|
4
4
|
import h from "./components/StatTrend.vue.js";
|
|
@@ -31,7 +31,7 @@ const V = { class: "flex items-center justify-between w-full mt-1" }, M = {
|
|
|
31
31
|
props: {
|
|
32
32
|
item: {},
|
|
33
33
|
variant: { default: "outline" },
|
|
34
|
-
layout: { default: "
|
|
34
|
+
layout: { default: "layout-1" },
|
|
35
35
|
attached: { type: Boolean, default: !1 },
|
|
36
36
|
loading: { type: Boolean, default: !1 },
|
|
37
37
|
titleSize: { default: "" },
|
|
@@ -40,38 +40,38 @@ const V = { class: "flex items-center justify-between w-full mt-1" }, M = {
|
|
|
40
40
|
iconBoxShape: { default: "rounded" },
|
|
41
41
|
iconBoxStyle: { default: "filled" }
|
|
42
42
|
},
|
|
43
|
-
setup(
|
|
44
|
-
const
|
|
43
|
+
setup(t) {
|
|
44
|
+
const n = t;
|
|
45
45
|
function s(a) {
|
|
46
46
|
const u = Number(a.value);
|
|
47
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;
|
|
48
48
|
}
|
|
49
49
|
const y = w(() => {
|
|
50
|
-
const a = Number(
|
|
51
|
-
if (!
|
|
52
|
-
const z =
|
|
50
|
+
const a = Number(n.item.value) || 0;
|
|
51
|
+
if (!n.item.isPrice && !n.item.numberFormat || (n.item.numberFormat || (n.item.isPrice ? "compact" : "standard")) !== "compact") return !1;
|
|
52
|
+
const z = n.item.compactThreshold ?? P?.components?.price?.compactThreshold ?? 1e3;
|
|
53
53
|
return Math.abs(a) >= z;
|
|
54
54
|
}), f = w(() => {
|
|
55
|
-
const a = Number(
|
|
56
|
-
return
|
|
55
|
+
const a = Number(n.item.value) || 0;
|
|
56
|
+
return n.item.isPrice ? C(a, { numberFormat: "standard" }) : n.item.numberFormat ? I(a, { numberFormat: "standard" }) : String(n.item.value);
|
|
57
57
|
}), F = w(() => {
|
|
58
|
-
const a =
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
}, z = u[
|
|
58
|
+
const a = n.layout === "layout-8" ? "flex px-3.5 py-3" : n.layout === "layout-5" ? "flex px-1 py-1" : "flex p-3", u = {
|
|
59
|
+
"layout-1": "flex-row items-center gap-3 text-left",
|
|
60
|
+
"layout-2": "flex-row items-center justify-between gap-3 text-left",
|
|
61
|
+
"layout-3": "flex-col items-start gap-1 px-5! pt-2! text-left",
|
|
62
|
+
"layout-4": "flex-col items-start gap-0 text-left px-5! py-4!",
|
|
63
|
+
"layout-5": "flex-col items-center justify-center text-center gap-0",
|
|
64
|
+
"layout-6": "flex-col items-start gap-1 text-left relative",
|
|
65
|
+
"layout-7": "flex-row items-center gap-3 text-left border-l-4",
|
|
66
|
+
"layout-8": "flex-row items-center gap-2.5 text-left"
|
|
67
|
+
}, z = u[n.layout] || u["layout-1"];
|
|
68
68
|
let m = "";
|
|
69
|
-
if (
|
|
70
|
-
|
|
69
|
+
if (n.attached)
|
|
70
|
+
n.variant === "transparent" ? m = "border-b border-r border-transparent bg-transparent hover:bg-muted/30 transition-colors" : n.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";
|
|
71
71
|
else {
|
|
72
|
-
switch (
|
|
72
|
+
switch (n.variant) {
|
|
73
73
|
case "solid": {
|
|
74
|
-
const N =
|
|
74
|
+
const N = n.item.color || "primary", B = {
|
|
75
75
|
primary: "bg-primary-light dark:ring-1 dark:ring-inset dark:ring-primary/20",
|
|
76
76
|
secondary: "bg-secondary dark:ring-1 dark:ring-inset dark:ring-secondary-foreground/20",
|
|
77
77
|
success: "bg-success-light dark:ring-1 dark:ring-inset dark:ring-success/20",
|
|
@@ -96,13 +96,13 @@ const V = { class: "flex items-center justify-between w-full mt-1" }, M = {
|
|
|
96
96
|
}
|
|
97
97
|
return [a, z, m].join(" ");
|
|
98
98
|
}), j = w(() => {
|
|
99
|
-
if (
|
|
100
|
-
const a =
|
|
99
|
+
if (n.variant === "solid" && !n.attached) {
|
|
100
|
+
const a = n.item.color;
|
|
101
101
|
if (a && !["primary", "secondary", "success", "warning", "danger", "info"].includes(a))
|
|
102
102
|
return { backgroundColor: `${a}15` };
|
|
103
103
|
}
|
|
104
|
-
if (
|
|
105
|
-
const a =
|
|
104
|
+
if (n.layout === "layout-7") {
|
|
105
|
+
const a = n.item.color, u = {
|
|
106
106
|
primary: "var(--color-primary)",
|
|
107
107
|
secondary: "var(--color-secondary)",
|
|
108
108
|
success: "var(--color-success)",
|
|
@@ -115,196 +115,196 @@ const V = { class: "flex items-center justify-between w-full mt-1" }, M = {
|
|
|
115
115
|
}
|
|
116
116
|
return {};
|
|
117
117
|
});
|
|
118
|
-
return (a, u) => (
|
|
118
|
+
return (a, u) => (e(), o("div", {
|
|
119
119
|
class: r(F.value),
|
|
120
120
|
style: $(j.value)
|
|
121
121
|
}, [
|
|
122
|
-
|
|
122
|
+
t.layout === "layout-4" ? (e(), o(k, { key: 0 }, [
|
|
123
123
|
l("h3", {
|
|
124
|
-
class: r(
|
|
125
|
-
}, c(
|
|
124
|
+
class: r(t.titleSize || "text-sm font-medium text-muted-foreground truncate w-full")
|
|
125
|
+
}, c(t.item.titleI18n ? b(x)(t.item.titleI18n) : t.item.title), 3),
|
|
126
126
|
l("div", V, [
|
|
127
127
|
l("div", null, [
|
|
128
|
-
|
|
128
|
+
t.loading ? (e(), o("div", M)) : (e(), i(v, {
|
|
129
129
|
key: 1,
|
|
130
130
|
content: f.value,
|
|
131
131
|
disabled: !y.value
|
|
132
132
|
}, {
|
|
133
133
|
default: g(() => [
|
|
134
134
|
l("p", {
|
|
135
|
-
class: r(
|
|
136
|
-
}, c(s(
|
|
135
|
+
class: r(t.valueSize || "text-2xl font-bold text-foreground truncate")
|
|
136
|
+
}, c(s(t.item)), 3)
|
|
137
137
|
]),
|
|
138
138
|
_: 1
|
|
139
139
|
}, 8, ["content", "disabled"])),
|
|
140
|
-
|
|
140
|
+
t.item.trend && !t.loading ? (e(), i(h, {
|
|
141
141
|
key: 2,
|
|
142
|
-
trend:
|
|
143
|
-
layout:
|
|
142
|
+
trend: t.item.trend,
|
|
143
|
+
layout: t.layout
|
|
144
144
|
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
145
145
|
]),
|
|
146
|
-
|
|
146
|
+
t.item.icon ? (e(), i(S, {
|
|
147
147
|
key: 0,
|
|
148
|
-
item:
|
|
149
|
-
variant:
|
|
150
|
-
layout:
|
|
151
|
-
attached:
|
|
152
|
-
"icon-box-shape":
|
|
153
|
-
"icon-box-style":
|
|
154
|
-
"icon-size":
|
|
148
|
+
item: t.item,
|
|
149
|
+
variant: t.variant,
|
|
150
|
+
layout: t.layout,
|
|
151
|
+
attached: t.attached,
|
|
152
|
+
"icon-box-shape": t.iconBoxShape,
|
|
153
|
+
"icon-box-style": t.iconBoxStyle,
|
|
154
|
+
"icon-size": t.iconSize
|
|
155
155
|
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0)
|
|
156
156
|
])
|
|
157
|
-
], 64)) :
|
|
158
|
-
|
|
157
|
+
], 64)) : t.layout === "layout-5" ? (e(), o(k, { key: 1 }, [
|
|
158
|
+
t.loading ? (e(), o("div", E)) : (e(), i(v, {
|
|
159
159
|
key: 1,
|
|
160
160
|
content: f.value,
|
|
161
161
|
disabled: !y.value
|
|
162
162
|
}, {
|
|
163
163
|
default: g(() => [
|
|
164
164
|
l("p", {
|
|
165
|
-
class: r(
|
|
166
|
-
}, c(s(
|
|
165
|
+
class: r(t.valueSize || "text-3xl font-bold text-foreground")
|
|
166
|
+
}, c(s(t.item)), 3)
|
|
167
167
|
]),
|
|
168
168
|
_: 1
|
|
169
169
|
}, 8, ["content", "disabled"])),
|
|
170
170
|
l("h3", {
|
|
171
|
-
class: r(
|
|
172
|
-
}, c(
|
|
173
|
-
|
|
171
|
+
class: r(t.titleSize || "text-sm font-medium text-muted-foreground")
|
|
172
|
+
}, c(t.item.titleI18n ? b(x)(t.item.titleI18n) : t.item.title), 3),
|
|
173
|
+
t.item.trend && !t.loading ? (e(), i(h, {
|
|
174
174
|
key: 2,
|
|
175
|
-
trend:
|
|
176
|
-
layout:
|
|
175
|
+
trend: t.item.trend,
|
|
176
|
+
layout: t.layout
|
|
177
177
|
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
178
|
-
], 64)) :
|
|
179
|
-
|
|
178
|
+
], 64)) : t.layout === "layout-6" ? (e(), o(k, { key: 2 }, [
|
|
179
|
+
t.item.icon ? (e(), i(S, {
|
|
180
180
|
key: 0,
|
|
181
|
-
item:
|
|
182
|
-
variant:
|
|
183
|
-
layout:
|
|
184
|
-
attached:
|
|
185
|
-
"icon-box-shape":
|
|
186
|
-
"icon-box-style":
|
|
187
|
-
"icon-size":
|
|
181
|
+
item: t.item,
|
|
182
|
+
variant: t.variant,
|
|
183
|
+
layout: t.layout,
|
|
184
|
+
attached: t.attached,
|
|
185
|
+
"icon-box-shape": t.iconBoxShape,
|
|
186
|
+
"icon-box-style": t.iconBoxStyle,
|
|
187
|
+
"icon-size": t.iconSize,
|
|
188
188
|
class: "absolute top-4 right-4"
|
|
189
189
|
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
|
|
190
190
|
l("h3", {
|
|
191
|
-
class: r(
|
|
192
|
-
}, c(
|
|
193
|
-
|
|
191
|
+
class: r(t.titleSize || "text-sm font-medium text-muted-foreground truncate pr-12")
|
|
192
|
+
}, c(t.item.titleI18n ? b(x)(t.item.titleI18n) : t.item.title), 3),
|
|
193
|
+
t.loading ? (e(), o("div", D)) : (e(), i(v, {
|
|
194
194
|
key: 2,
|
|
195
195
|
content: f.value,
|
|
196
196
|
disabled: !y.value
|
|
197
197
|
}, {
|
|
198
198
|
default: g(() => [
|
|
199
199
|
l("p", {
|
|
200
|
-
class: r(
|
|
201
|
-
}, c(s(
|
|
200
|
+
class: r(t.valueSize || "text-2xl font-bold text-foreground truncate mt-1")
|
|
201
|
+
}, c(s(t.item)), 3)
|
|
202
202
|
]),
|
|
203
203
|
_: 1
|
|
204
204
|
}, 8, ["content", "disabled"])),
|
|
205
|
-
|
|
205
|
+
t.item.trend && !t.loading ? (e(), i(h, {
|
|
206
206
|
key: 3,
|
|
207
|
-
trend:
|
|
208
|
-
layout:
|
|
207
|
+
trend: t.item.trend,
|
|
208
|
+
layout: t.layout
|
|
209
209
|
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
210
|
-
], 64)) :
|
|
210
|
+
], 64)) : t.layout === "layout-7" ? (e(), o("div", L, [
|
|
211
211
|
l("h3", {
|
|
212
212
|
class: r(
|
|
213
|
-
|
|
213
|
+
t.titleSize || "text-xs font-semibold uppercase tracking-widest text-muted-foreground truncate"
|
|
214
214
|
)
|
|
215
|
-
}, c(
|
|
216
|
-
|
|
215
|
+
}, c(t.item.titleI18n ? b(x)(t.item.titleI18n) : t.item.title), 3),
|
|
216
|
+
t.loading ? (e(), o("div", q)) : (e(), i(v, {
|
|
217
217
|
key: 1,
|
|
218
218
|
content: f.value,
|
|
219
219
|
disabled: !y.value
|
|
220
220
|
}, {
|
|
221
221
|
default: g(() => [
|
|
222
222
|
l("p", {
|
|
223
|
-
class: r(
|
|
224
|
-
}, c(s(
|
|
223
|
+
class: r(t.valueSize || "text-3xl font-black text-foreground truncate mt-0.5")
|
|
224
|
+
}, c(s(t.item)), 3)
|
|
225
225
|
]),
|
|
226
226
|
_: 1
|
|
227
227
|
}, 8, ["content", "disabled"])),
|
|
228
|
-
|
|
228
|
+
t.item.trend && !t.loading ? (e(), i(h, {
|
|
229
229
|
key: 2,
|
|
230
|
-
trend:
|
|
231
|
-
layout:
|
|
230
|
+
trend: t.item.trend,
|
|
231
|
+
layout: t.layout
|
|
232
232
|
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
233
|
-
])) :
|
|
234
|
-
|
|
233
|
+
])) : t.layout === "layout-8" ? (e(), o(k, { key: 4 }, [
|
|
234
|
+
t.item.icon ? (e(), i(S, {
|
|
235
235
|
key: 0,
|
|
236
|
-
item:
|
|
237
|
-
variant:
|
|
238
|
-
layout:
|
|
239
|
-
attached:
|
|
240
|
-
"icon-box-shape":
|
|
241
|
-
"icon-box-style":
|
|
242
|
-
"icon-size":
|
|
236
|
+
item: t.item,
|
|
237
|
+
variant: t.variant,
|
|
238
|
+
layout: t.layout,
|
|
239
|
+
attached: t.attached,
|
|
240
|
+
"icon-box-shape": t.iconBoxShape,
|
|
241
|
+
"icon-box-style": t.iconBoxStyle,
|
|
242
|
+
"icon-size": t.iconSize
|
|
243
243
|
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
|
|
244
244
|
l("span", {
|
|
245
|
-
class: r([
|
|
246
|
-
}, c(
|
|
247
|
-
|
|
245
|
+
class: r([t.titleSize || "-text-fs-2 font-medium text-muted-foreground truncate", "flex-1 min-w-0"])
|
|
246
|
+
}, c(t.item.titleI18n ? b(x)(t.item.titleI18n) : t.item.title), 3),
|
|
247
|
+
t.loading ? (e(), o("div", A)) : (e(), i(v, {
|
|
248
248
|
key: 2,
|
|
249
249
|
content: f.value,
|
|
250
250
|
disabled: !y.value
|
|
251
251
|
}, {
|
|
252
252
|
default: g(() => [
|
|
253
253
|
l("span", {
|
|
254
|
-
class: r(
|
|
255
|
-
}, c(s(
|
|
254
|
+
class: r(t.valueSize || "-text-fs-1 font-semibold text-foreground tabular-nums shrink-0")
|
|
255
|
+
}, c(s(t.item)), 3)
|
|
256
256
|
]),
|
|
257
257
|
_: 1
|
|
258
258
|
}, 8, ["content", "disabled"])),
|
|
259
|
-
|
|
259
|
+
t.item.trend && !t.loading ? (e(), i(h, {
|
|
260
260
|
key: 3,
|
|
261
|
-
trend:
|
|
262
|
-
layout:
|
|
261
|
+
trend: t.item.trend,
|
|
262
|
+
layout: t.layout
|
|
263
263
|
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
264
|
-
], 64)) : (
|
|
265
|
-
|
|
264
|
+
], 64)) : (e(), o(k, { key: 5 }, [
|
|
265
|
+
t.item.icon && t.layout !== "layout-2" ? (e(), i(S, {
|
|
266
266
|
key: 0,
|
|
267
|
-
item:
|
|
268
|
-
variant:
|
|
269
|
-
layout:
|
|
270
|
-
attached:
|
|
271
|
-
"icon-box-shape":
|
|
272
|
-
"icon-box-style":
|
|
273
|
-
"icon-size":
|
|
267
|
+
item: t.item,
|
|
268
|
+
variant: t.variant,
|
|
269
|
+
layout: t.layout,
|
|
270
|
+
attached: t.attached,
|
|
271
|
+
"icon-box-shape": t.iconBoxShape,
|
|
272
|
+
"icon-box-style": t.iconBoxStyle,
|
|
273
|
+
"icon-size": t.iconSize
|
|
274
274
|
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
|
|
275
275
|
l("div", G, [
|
|
276
276
|
l("h3", {
|
|
277
|
-
class: r(
|
|
278
|
-
}, c(
|
|
277
|
+
class: r(t.titleSize || "text-sm font-medium text-muted-foreground truncate")
|
|
278
|
+
}, c(t.item.titleI18n ? b(x)(t.item.titleI18n) : t.item.title), 3),
|
|
279
279
|
l("div", H, [
|
|
280
|
-
|
|
280
|
+
t.loading ? (e(), o("div", J)) : (e(), i(v, {
|
|
281
281
|
key: 1,
|
|
282
282
|
content: f.value,
|
|
283
283
|
disabled: !y.value
|
|
284
284
|
}, {
|
|
285
285
|
default: g(() => [
|
|
286
286
|
l("p", {
|
|
287
|
-
class: r(
|
|
288
|
-
}, c(s(
|
|
287
|
+
class: r(t.valueSize || "text-2xl font-bold text-foreground truncate")
|
|
288
|
+
}, c(s(t.item)), 3)
|
|
289
289
|
]),
|
|
290
290
|
_: 1
|
|
291
291
|
}, 8, ["content", "disabled"]))
|
|
292
292
|
]),
|
|
293
|
-
|
|
293
|
+
t.item.trend && !t.loading ? (e(), i(h, {
|
|
294
294
|
key: 0,
|
|
295
|
-
trend:
|
|
296
|
-
layout:
|
|
295
|
+
trend: t.item.trend,
|
|
296
|
+
layout: t.layout
|
|
297
297
|
}, null, 8, ["trend", "layout"])) : d("", !0)
|
|
298
298
|
]),
|
|
299
|
-
|
|
299
|
+
t.item.icon && t.layout === "layout-2" ? (e(), i(S, {
|
|
300
300
|
key: 1,
|
|
301
|
-
item:
|
|
302
|
-
variant:
|
|
303
|
-
layout:
|
|
304
|
-
attached:
|
|
305
|
-
"icon-box-shape":
|
|
306
|
-
"icon-box-style":
|
|
307
|
-
"icon-size":
|
|
301
|
+
item: t.item,
|
|
302
|
+
variant: t.variant,
|
|
303
|
+
layout: t.layout,
|
|
304
|
+
attached: t.attached,
|
|
305
|
+
"icon-box-shape": t.iconBoxShape,
|
|
306
|
+
"icon-box-style": t.iconBoxStyle,
|
|
307
|
+
"icon-size": t.iconSize
|
|
308
308
|
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0)
|
|
309
309
|
], 64))
|
|
310
310
|
], 6));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as y, computed as l, openBlock as i, createElementBlock as r, normalizeClass as d, createElementVNode as h, Fragment as u, renderList as s, createBlock as g } from "vue";
|
|
2
|
+
import S from "./StatItem.vue.js";
|
|
3
|
+
const C = /* @__PURE__ */ y({
|
|
4
4
|
__name: "Stats",
|
|
5
5
|
props: {
|
|
6
6
|
items: {},
|
|
7
7
|
variant: { default: "outline" },
|
|
8
|
-
layout: { default: "
|
|
8
|
+
layout: { default: "layout-1" },
|
|
9
9
|
columns: { default: 4 },
|
|
10
10
|
attached: { type: Boolean, default: !1 },
|
|
11
11
|
loading: { type: Boolean, default: !1 },
|
|
@@ -16,68 +16,68 @@ const b = /* @__PURE__ */ h({
|
|
|
16
16
|
iconBoxStyle: { default: "filled" },
|
|
17
17
|
class: { default: "" }
|
|
18
18
|
},
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
}),
|
|
19
|
+
setup(a) {
|
|
20
|
+
const t = a, c = l(() => {
|
|
21
|
+
const e = Number(t.columns) || 4;
|
|
22
|
+
return e === 1 ? "grid-cols-1" : e === 2 ? "grid-cols-1 sm:grid-cols-2" : e === 3 ? "grid-cols-1 sm:grid-cols-3" : e === 4 ? "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4" : e === 5 ? "grid-cols-1 sm:grid-cols-3 lg:grid-cols-5" : e === 6 ? "grid-cols-1 sm:grid-cols-3 lg:grid-cols-6" : "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4";
|
|
23
|
+
}), m = l(() => [
|
|
24
24
|
"grid",
|
|
25
25
|
c.value,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
].join(" ")),
|
|
30
|
-
|
|
26
|
+
t.variant === "transparent-header" ? "gap-2 md:gap-3.5" : "gap-3 sm:gap-4.5",
|
|
27
|
+
t?.layout === "layout-8" ? "rounded-sm" : "",
|
|
28
|
+
t.class
|
|
29
|
+
].join(" ")), v = l(() => [
|
|
30
|
+
t.layout === "layout-8" ? "rounded-sm" : "rounded-lg",
|
|
31
31
|
"overflow-hidden",
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
].join(" ")), f =
|
|
32
|
+
t.variant !== "transparent" ? "border border-border" : "",
|
|
33
|
+
t.variant === "shadow" ? "shadow-md bg-card" : "",
|
|
34
|
+
t.class
|
|
35
|
+
].join(" ")), f = l(() => [
|
|
36
36
|
"grid",
|
|
37
37
|
c.value,
|
|
38
38
|
"w-[calc(100%+1px)] -mb-px -mr-px gap-0"
|
|
39
39
|
].join(" "));
|
|
40
|
-
return (
|
|
40
|
+
return (e, x) => a.attached ? (i(), r("div", {
|
|
41
41
|
key: 0,
|
|
42
|
-
class: d(
|
|
42
|
+
class: d(v.value)
|
|
43
43
|
}, [
|
|
44
|
-
|
|
44
|
+
h("div", {
|
|
45
45
|
class: d(f.value)
|
|
46
46
|
}, [
|
|
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:
|
|
47
|
+
(i(!0), r(u, null, s(a.items, (n, o) => (i(), g(S, {
|
|
48
|
+
key: n.id || o,
|
|
49
|
+
item: n,
|
|
50
|
+
variant: a.variant.startsWith("transparent") ? "transparent" : a.variant,
|
|
51
|
+
layout: a.variant === "transparent-header" ? "layout-5" : a.layout,
|
|
52
|
+
attached: a.attached,
|
|
53
|
+
loading: a.loading,
|
|
54
|
+
titleSize: a.variant === "transparent-header" && !a.titleSize ? "text-sm font-normal! text-gray-900" : a.titleSize,
|
|
55
|
+
valueSize: a.variant === "transparent-header" && !a.valueSize ? "text-lg font-bold text-gray-900" : a.valueSize,
|
|
56
|
+
iconSize: a.iconSize,
|
|
57
|
+
iconBoxShape: a.iconBoxShape,
|
|
58
|
+
iconBoxStyle: a.iconBoxStyle
|
|
59
59
|
}, null, 8, ["item", "variant", "layout", "attached", "loading", "titleSize", "valueSize", "iconSize", "iconBoxShape", "iconBoxStyle"]))), 128))
|
|
60
60
|
], 2)
|
|
61
61
|
], 2)) : (i(), r("div", {
|
|
62
62
|
key: 1,
|
|
63
|
-
class: d(
|
|
63
|
+
class: d(m.value)
|
|
64
64
|
}, [
|
|
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:
|
|
65
|
+
(i(!0), r(u, null, s(a.items, (n, o) => (i(), g(S, {
|
|
66
|
+
key: n.id || o,
|
|
67
|
+
item: n,
|
|
68
|
+
variant: a.variant.startsWith("transparent") ? "transparent" : a.variant,
|
|
69
|
+
layout: a.variant === "transparent-header" ? "layout-5" : a.layout,
|
|
70
|
+
attached: a.attached,
|
|
71
|
+
loading: a.loading,
|
|
72
|
+
titleSize: a.variant === "transparent-header" && !a.titleSize ? "text-sm font-normal! text-gray-900" : a.titleSize,
|
|
73
|
+
valueSize: a.variant === "transparent-header" && !a.valueSize ? "text-lg font-bold text-gray-900" : a.valueSize,
|
|
74
|
+
iconSize: a.iconSize,
|
|
75
|
+
iconBoxShape: a.iconBoxShape,
|
|
76
|
+
iconBoxStyle: a.iconBoxStyle
|
|
77
77
|
}, null, 8, ["item", "variant", "layout", "attached", "loading", "titleSize", "valueSize", "iconSize", "iconBoxShape", "iconBoxStyle"]))), 128))
|
|
78
78
|
], 2));
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
export {
|
|
82
|
-
|
|
82
|
+
C as default
|
|
83
83
|
};
|
|
@@ -13,7 +13,7 @@ const S = /* @__PURE__ */ y({
|
|
|
13
13
|
class: {}
|
|
14
14
|
},
|
|
15
15
|
setup(r) {
|
|
16
|
-
const e = r, o = s(() => e.layout === "
|
|
16
|
+
const e = r, o = s(() => e.layout === "layout-8"), d = s(() => e.iconBoxShape === "full-rounded" ? "rounded-full" : e.iconBoxShape === "none" ? "rounded-none" : "rounded-lg"), i = s(() => {
|
|
17
17
|
if (o.value) {
|
|
18
18
|
const t = e.item.color || "primary";
|
|
19
19
|
return `shrink-0 ${{
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { defineComponent as f, computed as s, openBlock as
|
|
1
|
+
import { defineComponent as f, computed as s, openBlock as l, createElementBlock as i, normalizeClass as a, createVNode as d, createTextVNode as g, toDisplayString as o, createElementVNode as y, createCommentVNode as x } from "vue";
|
|
2
2
|
import m from "../../Icon.vue.js";
|
|
3
|
-
const
|
|
3
|
+
const v = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "text-muted-foreground truncate"
|
|
6
|
-
},
|
|
6
|
+
}, p = /* @__PURE__ */ f({
|
|
7
7
|
__name: "StatTrend",
|
|
8
8
|
props: {
|
|
9
9
|
trend: {},
|
|
10
10
|
layout: {}
|
|
11
11
|
},
|
|
12
12
|
setup(e) {
|
|
13
|
-
const t = e,
|
|
14
|
-
if (
|
|
13
|
+
const t = e, u = s(() => t.layout === "layout-8"), r = s(() => t.layout === "layout-5"), c = s(() => {
|
|
14
|
+
if (u.value)
|
|
15
15
|
return [
|
|
16
16
|
"shrink-0 flex items-center gap-0.5 text-xs font-medium",
|
|
17
17
|
t.trend.isPositive ? "text-success-subtle-fg" : "text-danger-subtle-fg"
|
|
18
18
|
].join(" ");
|
|
19
19
|
const n = "flex items-center text-sm";
|
|
20
|
-
return r.value ? `${n} gap-1` : t.layout === "
|
|
20
|
+
return r.value ? `${n} gap-1` : t.layout === "layout-6" || t.layout === "layout-1" || t.layout === "layout-2" || t.layout === "layout-3" ? `${n} mt-2 gap-1.5` : `${n} mt-1 gap-1`;
|
|
21
21
|
});
|
|
22
|
-
return (n, b) =>
|
|
22
|
+
return (n, b) => u.value ? (l(), i("span", {
|
|
23
23
|
key: 0,
|
|
24
|
-
class:
|
|
24
|
+
class: a(c.value)
|
|
25
25
|
}, [
|
|
26
26
|
d(m, {
|
|
27
27
|
icon: e.trend.isPositive ? "lucide:trending-up" : "lucide:trending-down",
|
|
28
28
|
class: "w-3 h-3"
|
|
29
29
|
}, null, 8, ["icon"]),
|
|
30
|
-
g(" " +
|
|
31
|
-
], 2)) : (
|
|
30
|
+
g(" " + o(e.trend.value), 1)
|
|
31
|
+
], 2)) : (l(), i("div", {
|
|
32
32
|
key: 1,
|
|
33
|
-
class:
|
|
33
|
+
class: a(c.value)
|
|
34
34
|
}, [
|
|
35
35
|
d(m, {
|
|
36
36
|
icon: e.trend.isPositive ? "lucide:trending-up" : "lucide:trending-down",
|
|
37
|
-
class:
|
|
37
|
+
class: a([e.trend.isPositive ? "text-success" : "text-danger", "w-4 h-4 shrink-0"])
|
|
38
38
|
}, null, 8, ["icon", "class"]),
|
|
39
|
-
|
|
40
|
-
class:
|
|
41
|
-
},
|
|
42
|
-
e.trend.label && !r.value ? (
|
|
39
|
+
y("span", {
|
|
40
|
+
class: a([e.trend.isPositive ? "text-success-subtle-fg" : "text-danger-subtle-fg", "font-medium whitespace-nowrap"])
|
|
41
|
+
}, o(e.trend.value), 3),
|
|
42
|
+
e.trend.label && !r.value ? (l(), i("span", v, o(e.trend.label), 1)) : x("", !0)
|
|
43
43
|
], 2));
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
export {
|
|
47
|
-
|
|
47
|
+
p as default
|
|
48
48
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type StatsVariant = 'solid' | 'outline' | 'shadow' | 'transparent' | 'transparent-header';
|
|
2
|
-
export type StatsLayout = '
|
|
2
|
+
export type StatsLayout = 'layout-1' | 'layout-2' | 'layout-3' | 'layout-4' | 'layout-5' | 'layout-6' | 'layout-7' | 'layout-8';
|
|
3
3
|
export type IconBoxShape = 'rounded' | 'full-rounded' | 'none';
|
|
4
4
|
export type IconBoxStyle = 'filled' | 'transparent';
|
|
5
5
|
export interface StatTrend {
|
package/package.json
CHANGED
/package/components/RichTextEditor/{RichTextLinkPopover.vue2.js → RichTextLinkPopover.vue.js}
RENAMED
|
File without changes
|
|
File without changes
|