vlite3 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AppShell/AppShellLayoutClassic.vue.js +67 -64
- package/components/AppShell/AppShellLayoutDashboard.vue.js +75 -70
- package/components/AppShell/AppShellLayoutDock.vue.js +27 -27
- package/components/AppShell/AppShellLayoutHeaderShell.vue.js +80 -75
- package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +56 -56
- package/components/DataTable/DataTable.vue.d.ts +3 -3
- package/components/DataTable/DataTableRow.vue.d.ts +1 -1
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +15 -2
- package/components/Invoice/InvoiceVariant1.vue.js +225 -176
- package/components/Invoice/InvoiceVariant2.vue.js +174 -125
- package/components/Invoice/InvoiceVariant3.vue.js +186 -157
- package/components/Invoice/InvoiceVariant4.vue.js +200 -156
- package/components/Invoice/types.d.ts +10 -1
- package/components/List/ListFieldRow.vue.js +16 -16
- package/components/List/utils.d.ts +2 -2
- package/components/List/utils.js +6 -9
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/Price/Price.vue.d.ts +2 -0
- package/components/Price/Price.vue.js +15 -12
- package/components/Screen/Screen.vue.d.ts +36 -10
- package/components/Screen/Screen.vue.js +398 -304
- package/components/Screen/components/ScreenToolbar.vue.d.ts +62 -0
- package/components/Screen/components/ScreenToolbar.vue.js +116 -0
- package/components/Screen/components/ScreenToolbar.vue2.js +4 -0
- package/components/Screen/types.d.ts +9 -0
- package/components/Stats/StatItem.vue.js +88 -87
- package/components/Stats/Stats.vue.js +20 -20
- package/components/Stats/types.d.ts +3 -1
- package/core/config.d.ts +10 -0
- package/core/config.js +11 -9
- package/index.js +131 -131
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/config.type.d.ts +2 -0
- package/types/list.type.d.ts +4 -0
- package/utils/functions.d.ts +9 -10
- package/utils/functions.js +78 -63
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
selectedRows: any[];
|
|
3
|
+
hideSelectable?: boolean;
|
|
4
|
+
hideDeleteBtn?: boolean;
|
|
5
|
+
txtDeleteSelected: string;
|
|
6
|
+
hasMultipleViews: boolean;
|
|
7
|
+
activeView: string;
|
|
8
|
+
resolvedViews: any[];
|
|
9
|
+
showRefresh?: boolean;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
txtRefresh: string;
|
|
12
|
+
filterSchema?: any[];
|
|
13
|
+
filterType?: string;
|
|
14
|
+
activeFilters: any;
|
|
15
|
+
canSearch?: boolean;
|
|
16
|
+
searchQuery: string;
|
|
17
|
+
txtSearch: string;
|
|
18
|
+
canAdd?: boolean;
|
|
19
|
+
addComponent?: any;
|
|
20
|
+
addBtn?: any;
|
|
21
|
+
data?: any[];
|
|
22
|
+
refetch?: any;
|
|
23
|
+
hasExportOrImport?: boolean;
|
|
24
|
+
exportProps?: any;
|
|
25
|
+
importProps?: any;
|
|
26
|
+
screenState: any;
|
|
27
|
+
};
|
|
28
|
+
declare function __VLS_template(): {
|
|
29
|
+
attrs: Partial<{}>;
|
|
30
|
+
slots: {
|
|
31
|
+
'before-search'?(_: any): any;
|
|
32
|
+
actions?(_: any): any;
|
|
33
|
+
'after-add'?(_: any): any;
|
|
34
|
+
};
|
|
35
|
+
refs: {};
|
|
36
|
+
rootEl: HTMLDivElement;
|
|
37
|
+
};
|
|
38
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
39
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
40
|
+
delete: (items: any[]) => any;
|
|
41
|
+
add: () => any;
|
|
42
|
+
"update:activeView": (val: string) => any;
|
|
43
|
+
"update:activeFilters": (val: any) => any;
|
|
44
|
+
"update:searchQuery": (val: string) => any;
|
|
45
|
+
refresh: () => any;
|
|
46
|
+
"select-dropdown": (opt: any) => any;
|
|
47
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
48
|
+
onDelete?: (items: any[]) => any;
|
|
49
|
+
onAdd?: () => any;
|
|
50
|
+
"onUpdate:activeView"?: (val: string) => any;
|
|
51
|
+
"onUpdate:activeFilters"?: (val: any) => any;
|
|
52
|
+
"onUpdate:searchQuery"?: (val: string) => any;
|
|
53
|
+
onRefresh?: () => any;
|
|
54
|
+
"onSelect-dropdown"?: (opt: any) => any;
|
|
55
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
56
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
57
|
+
export default _default;
|
|
58
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
59
|
+
new (): {
|
|
60
|
+
$slots: S;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { defineComponent as h, openBlock as o, createElementBlock as m, createElementVNode as u, createBlock as d, createCommentVNode as i, renderSlot as n, normalizeProps as r, guardReactiveProps as s, createVNode as c } from "vue";
|
|
2
|
+
import f from "../../Button.vue.js";
|
|
3
|
+
import v from "../../Input.vue.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import w from "./ScreenViewToggle.vue.js";
|
|
6
|
+
import y from "../ScreenFilter.vue.js";
|
|
7
|
+
import $ from "./ScreenAddAction.vue.js";
|
|
8
|
+
import S from "./ScreenOptionsDropdown.vue.js";
|
|
9
|
+
const g = { class: "flex items-center gap-2 w-full sm:w-auto flex-1 md:flex-none justify-start sm:justify-end" }, B = {
|
|
10
|
+
key: 4,
|
|
11
|
+
class: "w-full md:w-60! max-sm:order-last"
|
|
12
|
+
}, k = { class: "flex items-center gap-3 max-sm:w-full sm:w-auto max-sm:order-last" }, E = /* @__PURE__ */ h({
|
|
13
|
+
__name: "ScreenToolbar",
|
|
14
|
+
props: {
|
|
15
|
+
selectedRows: {},
|
|
16
|
+
hideSelectable: { type: Boolean },
|
|
17
|
+
hideDeleteBtn: { type: Boolean },
|
|
18
|
+
txtDeleteSelected: {},
|
|
19
|
+
hasMultipleViews: { type: Boolean },
|
|
20
|
+
activeView: {},
|
|
21
|
+
resolvedViews: {},
|
|
22
|
+
showRefresh: { type: Boolean },
|
|
23
|
+
loading: { type: Boolean },
|
|
24
|
+
txtRefresh: {},
|
|
25
|
+
filterSchema: {},
|
|
26
|
+
filterType: {},
|
|
27
|
+
activeFilters: {},
|
|
28
|
+
canSearch: { type: Boolean },
|
|
29
|
+
searchQuery: {},
|
|
30
|
+
txtSearch: {},
|
|
31
|
+
canAdd: { type: Boolean },
|
|
32
|
+
addComponent: {},
|
|
33
|
+
addBtn: {},
|
|
34
|
+
data: {},
|
|
35
|
+
refetch: {},
|
|
36
|
+
hasExportOrImport: { type: Boolean },
|
|
37
|
+
exportProps: {},
|
|
38
|
+
importProps: {},
|
|
39
|
+
screenState: {}
|
|
40
|
+
},
|
|
41
|
+
emits: ["update:activeView", "update:activeFilters", "update:searchQuery", "delete", "refresh", "add", "select-dropdown"],
|
|
42
|
+
setup(e) {
|
|
43
|
+
return (l, t) => (o(), m("div", null, [
|
|
44
|
+
u("div", g, [
|
|
45
|
+
e.selectedRows.length > 0 && !e.hideSelectable && !e.hideDeleteBtn ? (o(), d(f, {
|
|
46
|
+
key: 0,
|
|
47
|
+
variant: "outline",
|
|
48
|
+
class: "hover:bg-destructive/10 shrink-0 h-9! w-9!",
|
|
49
|
+
icon: "lucide:trash-2",
|
|
50
|
+
title: e.txtDeleteSelected,
|
|
51
|
+
onClick: t[0] || (t[0] = (a) => l.$emit("delete", e.selectedRows))
|
|
52
|
+
}, null, 8, ["title"])) : i("", !0),
|
|
53
|
+
e.hasMultipleViews ? (o(), d(w, {
|
|
54
|
+
key: 1,
|
|
55
|
+
"model-value": e.activeView,
|
|
56
|
+
"onUpdate:modelValue": t[1] || (t[1] = (a) => l.$emit("update:activeView", a)),
|
|
57
|
+
views: e.resolvedViews
|
|
58
|
+
}, null, 8, ["model-value", "views"])) : i("", !0),
|
|
59
|
+
n(l.$slots, "before-search", r(s(e.screenState))),
|
|
60
|
+
e.showRefresh ? (o(), d(f, {
|
|
61
|
+
key: 2,
|
|
62
|
+
variant: "outline",
|
|
63
|
+
icon: "lucide:refresh-cw",
|
|
64
|
+
size: "lg",
|
|
65
|
+
class: "shrink-0 h-9! w-9!",
|
|
66
|
+
title: e.txtRefresh,
|
|
67
|
+
disabled: e.loading,
|
|
68
|
+
onClick: t[2] || (t[2] = (a) => l.$emit("refresh"))
|
|
69
|
+
}, null, 8, ["title", "disabled"])) : i("", !0),
|
|
70
|
+
e.filterSchema && e.filterSchema.length > 0 ? (o(), d(y, {
|
|
71
|
+
key: 3,
|
|
72
|
+
schema: e.filterSchema,
|
|
73
|
+
type: e.filterType,
|
|
74
|
+
"model-value": e.activeFilters,
|
|
75
|
+
"onUpdate:modelValue": t[3] || (t[3] = (a) => l.$emit("update:activeFilters", a)),
|
|
76
|
+
onChange: t[4] || (t[4] = (a) => l.$emit("refresh"))
|
|
77
|
+
}, null, 8, ["schema", "type", "model-value"])) : i("", !0),
|
|
78
|
+
e.canSearch ? (o(), m("div", B, [
|
|
79
|
+
c(v, {
|
|
80
|
+
lazy: "",
|
|
81
|
+
"model-value": e.searchQuery,
|
|
82
|
+
"onUpdate:modelValue": t[5] || (t[5] = (a) => l.$emit("update:searchQuery", String(a))),
|
|
83
|
+
icon: "lucide:search",
|
|
84
|
+
placeholder: e.txtSearch,
|
|
85
|
+
variant: "outline",
|
|
86
|
+
class: "bg-background w-full",
|
|
87
|
+
"show-clear-button": !0
|
|
88
|
+
}, null, 8, ["model-value", "placeholder"])
|
|
89
|
+
])) : i("", !0)
|
|
90
|
+
]),
|
|
91
|
+
u("div", k, [
|
|
92
|
+
n(l.$slots, "actions", r(s(e.screenState)), () => [
|
|
93
|
+
c($, {
|
|
94
|
+
"can-add": e.canAdd,
|
|
95
|
+
"add-component": e.addComponent,
|
|
96
|
+
"add-btn": e.addBtn,
|
|
97
|
+
loading: e.loading,
|
|
98
|
+
data: e.data,
|
|
99
|
+
refetch: e.refetch,
|
|
100
|
+
onAdd: t[6] || (t[6] = (a) => l.$emit("add"))
|
|
101
|
+
}, null, 8, ["can-add", "add-component", "add-btn", "loading", "data", "refetch"])
|
|
102
|
+
]),
|
|
103
|
+
e.hasExportOrImport ? (o(), d(S, {
|
|
104
|
+
key: 0,
|
|
105
|
+
"export-props": e.exportProps,
|
|
106
|
+
"import-props": e.importProps,
|
|
107
|
+
onSelect: t[7] || (t[7] = (a) => l.$emit("select-dropdown", a))
|
|
108
|
+
}, null, 8, ["export-props", "import-props"])) : i("", !0),
|
|
109
|
+
n(l.$slots, "after-add", r(s(e.screenState)))
|
|
110
|
+
])
|
|
111
|
+
]));
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
export {
|
|
115
|
+
E as default
|
|
116
|
+
};
|
|
@@ -5,6 +5,7 @@ import { IForm } from '../Form';
|
|
|
5
5
|
import { ExportField } from '../ExportData/types';
|
|
6
6
|
import { ImportField } from '../ImportData/types';
|
|
7
7
|
import { TabesVariant } from '../Tabes';
|
|
8
|
+
import { StatItemSchema, StatsProps } from '../Stats/types';
|
|
8
9
|
export interface ScreenPaginationProps extends Omit<PaginationProps, 'currentPage' | 'totalPages'> {
|
|
9
10
|
}
|
|
10
11
|
export interface AddBtnConfig {
|
|
@@ -69,6 +70,9 @@ export interface ScreenProps {
|
|
|
69
70
|
pageInfo?: PageInfo;
|
|
70
71
|
data?: any[];
|
|
71
72
|
loading?: boolean;
|
|
73
|
+
variant?: 'one' | 'two';
|
|
74
|
+
stats?: StatItemSchema[] | any[];
|
|
75
|
+
statsProps?: Partial<StatsProps>;
|
|
72
76
|
/**
|
|
73
77
|
* Called on every search, filter, pagination, sort, or quick-filter change.
|
|
74
78
|
* Standard payload shape: { pagination, search, sort, filter }
|
|
@@ -139,7 +143,12 @@ export interface ScreenProps {
|
|
|
139
143
|
filterType?: 'modal' | 'dropdown';
|
|
140
144
|
showRefresh?: boolean;
|
|
141
145
|
containerClass?: string;
|
|
146
|
+
mainContainerClass?: string;
|
|
142
147
|
headerClass?: string;
|
|
148
|
+
topHeaderClass?: string;
|
|
149
|
+
bottomHeaderClass?: string;
|
|
150
|
+
filtersContainerClass?: string;
|
|
151
|
+
actionsContainerClass?: string;
|
|
143
152
|
titleClass?: string;
|
|
144
153
|
descriptionClass?: string;
|
|
145
154
|
viewProps?: Record<string, any>;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as B, computed as k, openBlock as e, createElementBlock as i, normalizeStyle as I, normalizeClass as
|
|
2
|
-
import { $t as
|
|
3
|
-
import { formatCurrency as C } from "../../utils/functions.js";
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as B, computed as k, openBlock as e, createElementBlock as i, normalizeStyle as I, normalizeClass as l, Fragment as x, createElementVNode as d, toDisplayString as o, unref as s, createBlock as c, createCommentVNode as r } from "vue";
|
|
2
|
+
import { $t as f } from "../../utils/i18n.js";
|
|
3
|
+
import { formatCurrency as C, formatNumber as j } from "../../utils/functions.js";
|
|
4
|
+
import b from "./components/StatTrend.vue.js";
|
|
5
5
|
import g from "./components/StatIconBox.vue.js";
|
|
6
|
-
const
|
|
6
|
+
const F = { class: "flex items-center justify-between w-full mt-1" }, $ = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
|
|
9
9
|
}, N = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md"
|
|
12
|
-
},
|
|
12
|
+
}, T = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "h-8 w-20 bg-gray-50 animate-pulse rounded-md mt-1"
|
|
15
|
-
},
|
|
15
|
+
}, V = {
|
|
16
16
|
key: 3,
|
|
17
17
|
class: "flex-1 flex flex-col justify-center min-w-0"
|
|
18
|
-
},
|
|
18
|
+
}, E = {
|
|
19
19
|
key: 0,
|
|
20
20
|
class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md mt-0.5"
|
|
21
|
-
},
|
|
21
|
+
}, M = {
|
|
22
22
|
key: 1,
|
|
23
23
|
class: "h-6 w-5 bg-gray-50 animate-pulse rounded-sm shrink-0"
|
|
24
|
-
},
|
|
24
|
+
}, D = { class: "flex-1 flex flex-col justify-center min-w-0" }, L = { class: "flex items-baseline gap-2 mt-1" }, P = {
|
|
25
25
|
key: 0,
|
|
26
26
|
class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
|
|
27
27
|
}, K = /* @__PURE__ */ B({
|
|
@@ -39,28 +39,29 @@ const j = { class: "flex items-center justify-between w-full mt-1" }, $ = {
|
|
|
39
39
|
iconBoxStyle: { default: "filled" }
|
|
40
40
|
},
|
|
41
41
|
setup(t) {
|
|
42
|
-
const
|
|
43
|
-
function
|
|
44
|
-
|
|
42
|
+
const n = t;
|
|
43
|
+
function y(a) {
|
|
44
|
+
const m = Number(a.value);
|
|
45
|
+
return a.isPrice ? C(m, { numberFormat: a.numberFormat || "compact", compactThreshold: a.compactThreshold }) : a.numberFormat ? j(m, { numberFormat: a.numberFormat, compactThreshold: a.compactThreshold }) : a.value;
|
|
45
46
|
}
|
|
46
47
|
const S = k(() => {
|
|
47
|
-
const a =
|
|
48
|
+
const a = n.layout === "inline-label-value" ? "flex px-3.5 py-3" : n.layout === "centered-value-title" ? "flex px-1 py-1" : "flex p-3", m = {
|
|
48
49
|
"icon-left": "flex-row items-center gap-3 text-left",
|
|
49
50
|
"icon-right": "flex-row items-center justify-between gap-3 text-left",
|
|
50
51
|
"icon-top": "flex-col items-start gap-1 px-5! pt-2! text-left",
|
|
51
52
|
"title-top-icon-bottom-right": "flex-col items-start gap-0 text-left px-5! py-4!",
|
|
52
|
-
"centered-value-title": "flex-col items-center justify-center text-center gap-
|
|
53
|
+
"centered-value-title": "flex-col items-center justify-center text-center gap-0",
|
|
53
54
|
"floating-icon": "flex-col items-start gap-1 text-left relative",
|
|
54
55
|
"split-bar": "flex-row items-center gap-3 text-left border-l-4",
|
|
55
56
|
"inline-label-value": "flex-row items-center gap-2.5 text-left"
|
|
56
|
-
}, h =
|
|
57
|
+
}, h = m[n.layout] || m["icon-left"];
|
|
57
58
|
let u = "";
|
|
58
|
-
if (
|
|
59
|
-
|
|
59
|
+
if (n.attached)
|
|
60
|
+
n.variant === "transparent" ? u = "border-b border-r border-transparent bg-transparent hover:bg-muted/30 transition-colors" : n.variant === "outline" ? u = "border-b border-r border-border bg-transparent hover:bg-muted/30 transition-colors" : u = "border-b border-r border-border bg-card hover:bg-muted/30 transition-colors";
|
|
60
61
|
else {
|
|
61
|
-
switch (
|
|
62
|
+
switch (n.variant) {
|
|
62
63
|
case "solid": {
|
|
63
|
-
const w =
|
|
64
|
+
const w = n.item.color || "primary", v = {
|
|
64
65
|
primary: "bg-primary-light",
|
|
65
66
|
secondary: "bg-secondary",
|
|
66
67
|
success: "bg-success-light",
|
|
@@ -85,13 +86,13 @@ const j = { class: "flex items-center justify-between w-full mt-1" }, $ = {
|
|
|
85
86
|
}
|
|
86
87
|
return [a, h, u].join(" ");
|
|
87
88
|
}), z = k(() => {
|
|
88
|
-
if (
|
|
89
|
-
const a =
|
|
89
|
+
if (n.variant === "solid" && !n.attached) {
|
|
90
|
+
const a = n.item.color;
|
|
90
91
|
if (a && !["primary", "secondary", "success", "warning", "danger", "info"].includes(a))
|
|
91
92
|
return { backgroundColor: `${a}15` };
|
|
92
93
|
}
|
|
93
|
-
if (
|
|
94
|
-
const a =
|
|
94
|
+
if (n.layout === "split-bar") {
|
|
95
|
+
const a = n.item.color, m = {
|
|
95
96
|
primary: "var(--color-primary)",
|
|
96
97
|
secondary: "var(--color-secondary)",
|
|
97
98
|
success: "var(--color-success)",
|
|
@@ -100,29 +101,29 @@ const j = { class: "flex items-center justify-between w-full mt-1" }, $ = {
|
|
|
100
101
|
info: "var(--color-info)"
|
|
101
102
|
};
|
|
102
103
|
if (a)
|
|
103
|
-
return { borderLeftColor:
|
|
104
|
+
return { borderLeftColor: m[a] || a };
|
|
104
105
|
}
|
|
105
106
|
return {};
|
|
106
107
|
});
|
|
107
|
-
return (a,
|
|
108
|
-
class:
|
|
108
|
+
return (a, m) => (e(), i("div", {
|
|
109
|
+
class: l(S.value),
|
|
109
110
|
style: I(z.value)
|
|
110
111
|
}, [
|
|
111
|
-
t.layout === "title-top-icon-bottom-right" ? (e(), i(
|
|
112
|
-
|
|
113
|
-
class:
|
|
114
|
-
}, o(t.item.titleI18n ?
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
t.layout === "title-top-icon-bottom-right" ? (e(), i(x, { key: 0 }, [
|
|
113
|
+
d("h3", {
|
|
114
|
+
class: l(t.titleSize || "text-sm font-medium text-muted-foreground truncate w-full")
|
|
115
|
+
}, o(t.item.titleI18n ? s(f)(t.item.titleI18n) : t.item.title), 3),
|
|
116
|
+
d("div", F, [
|
|
117
|
+
d("div", null, [
|
|
117
118
|
t.loading ? (e(), i("div", $)) : (e(), i("p", {
|
|
118
119
|
key: 1,
|
|
119
|
-
class:
|
|
120
|
-
}, o(
|
|
121
|
-
t.item.trend && !t.loading ? (e(), c(
|
|
120
|
+
class: l(t.valueSize || "text-2xl font-bold text-foreground truncate")
|
|
121
|
+
}, o(y(t.item)), 3)),
|
|
122
|
+
t.item.trend && !t.loading ? (e(), c(b, {
|
|
122
123
|
key: 2,
|
|
123
124
|
trend: t.item.trend,
|
|
124
125
|
layout: t.layout
|
|
125
|
-
}, null, 8, ["trend", "layout"])) :
|
|
126
|
+
}, null, 8, ["trend", "layout"])) : r("", !0)
|
|
126
127
|
]),
|
|
127
128
|
t.item.icon ? (e(), c(g, {
|
|
128
129
|
key: 0,
|
|
@@ -133,22 +134,22 @@ const j = { class: "flex items-center justify-between w-full mt-1" }, $ = {
|
|
|
133
134
|
"icon-box-shape": t.iconBoxShape,
|
|
134
135
|
"icon-box-style": t.iconBoxStyle,
|
|
135
136
|
"icon-size": t.iconSize
|
|
136
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
137
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : r("", !0)
|
|
137
138
|
])
|
|
138
|
-
], 64)) : t.layout === "centered-value-title" ? (e(), i(
|
|
139
|
+
], 64)) : t.layout === "centered-value-title" ? (e(), i(x, { key: 1 }, [
|
|
139
140
|
t.loading ? (e(), i("div", N)) : (e(), i("p", {
|
|
140
141
|
key: 1,
|
|
141
|
-
class:
|
|
142
|
-
}, o(
|
|
143
|
-
|
|
144
|
-
class:
|
|
145
|
-
}, o(t.item.titleI18n ?
|
|
146
|
-
t.item.trend && !t.loading ? (e(), c(
|
|
142
|
+
class: l(t.valueSize || "text-3xl font-bold text-foreground")
|
|
143
|
+
}, o(y(t.item)), 3)),
|
|
144
|
+
d("h3", {
|
|
145
|
+
class: l(t.titleSize || "text-sm font-medium text-muted-foreground")
|
|
146
|
+
}, o(t.item.titleI18n ? s(f)(t.item.titleI18n) : t.item.title), 3),
|
|
147
|
+
t.item.trend && !t.loading ? (e(), c(b, {
|
|
147
148
|
key: 2,
|
|
148
149
|
trend: t.item.trend,
|
|
149
150
|
layout: t.layout
|
|
150
|
-
}, null, 8, ["trend", "layout"])) :
|
|
151
|
-
], 64)) : t.layout === "floating-icon" ? (e(), i(
|
|
151
|
+
}, null, 8, ["trend", "layout"])) : r("", !0)
|
|
152
|
+
], 64)) : t.layout === "floating-icon" ? (e(), i(x, { key: 2 }, [
|
|
152
153
|
t.item.icon ? (e(), c(g, {
|
|
153
154
|
key: 0,
|
|
154
155
|
item: t.item,
|
|
@@ -159,35 +160,35 @@ const j = { class: "flex items-center justify-between w-full mt-1" }, $ = {
|
|
|
159
160
|
"icon-box-style": t.iconBoxStyle,
|
|
160
161
|
"icon-size": t.iconSize,
|
|
161
162
|
class: "absolute top-4 right-4"
|
|
162
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
163
|
-
|
|
164
|
-
class:
|
|
165
|
-
}, o(t.item.titleI18n ?
|
|
166
|
-
t.loading ? (e(), i("div",
|
|
163
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : r("", !0),
|
|
164
|
+
d("h3", {
|
|
165
|
+
class: l(t.titleSize || "text-sm font-medium text-muted-foreground truncate pr-12")
|
|
166
|
+
}, o(t.item.titleI18n ? s(f)(t.item.titleI18n) : t.item.title), 3),
|
|
167
|
+
t.loading ? (e(), i("div", T)) : (e(), i("p", {
|
|
167
168
|
key: 2,
|
|
168
|
-
class:
|
|
169
|
-
}, o(
|
|
170
|
-
t.item.trend && !t.loading ? (e(), c(
|
|
169
|
+
class: l(t.valueSize || "text-2xl font-bold text-foreground truncate mt-1")
|
|
170
|
+
}, o(y(t.item)), 3)),
|
|
171
|
+
t.item.trend && !t.loading ? (e(), c(b, {
|
|
171
172
|
key: 3,
|
|
172
173
|
trend: t.item.trend,
|
|
173
174
|
layout: t.layout
|
|
174
|
-
}, null, 8, ["trend", "layout"])) :
|
|
175
|
-
], 64)) : t.layout === "split-bar" ? (e(), i("div",
|
|
176
|
-
|
|
177
|
-
class:
|
|
175
|
+
}, null, 8, ["trend", "layout"])) : r("", !0)
|
|
176
|
+
], 64)) : t.layout === "split-bar" ? (e(), i("div", V, [
|
|
177
|
+
d("h3", {
|
|
178
|
+
class: l(
|
|
178
179
|
t.titleSize || "text-xs font-semibold uppercase tracking-widest text-muted-foreground truncate"
|
|
179
180
|
)
|
|
180
|
-
}, o(t.item.titleI18n ?
|
|
181
|
-
t.loading ? (e(), i("div",
|
|
181
|
+
}, o(t.item.titleI18n ? s(f)(t.item.titleI18n) : t.item.title), 3),
|
|
182
|
+
t.loading ? (e(), i("div", E)) : (e(), i("p", {
|
|
182
183
|
key: 1,
|
|
183
|
-
class:
|
|
184
|
-
}, o(
|
|
185
|
-
t.item.trend && !t.loading ? (e(), c(
|
|
184
|
+
class: l(t.valueSize || "text-3xl font-black text-foreground truncate mt-0.5")
|
|
185
|
+
}, o(y(t.item)), 3)),
|
|
186
|
+
t.item.trend && !t.loading ? (e(), c(b, {
|
|
186
187
|
key: 2,
|
|
187
188
|
trend: t.item.trend,
|
|
188
189
|
layout: t.layout
|
|
189
|
-
}, null, 8, ["trend", "layout"])) :
|
|
190
|
-
])) : t.layout === "inline-label-value" ? (e(), i(
|
|
190
|
+
}, null, 8, ["trend", "layout"])) : r("", !0)
|
|
191
|
+
])) : t.layout === "inline-label-value" ? (e(), i(x, { key: 4 }, [
|
|
191
192
|
t.item.icon ? (e(), c(g, {
|
|
192
193
|
key: 0,
|
|
193
194
|
item: t.item,
|
|
@@ -197,20 +198,20 @@ const j = { class: "flex items-center justify-between w-full mt-1" }, $ = {
|
|
|
197
198
|
"icon-box-shape": t.iconBoxShape,
|
|
198
199
|
"icon-box-style": t.iconBoxStyle,
|
|
199
200
|
"icon-size": t.iconSize
|
|
200
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
201
|
-
|
|
202
|
-
class:
|
|
203
|
-
}, o(t.item.titleI18n ?
|
|
204
|
-
t.loading ? (e(), i("div",
|
|
201
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : r("", !0),
|
|
202
|
+
d("span", {
|
|
203
|
+
class: l([t.titleSize || "-text-fs-2 font-medium text-muted-foreground truncate", "flex-1 min-w-0"])
|
|
204
|
+
}, o(t.item.titleI18n ? s(f)(t.item.titleI18n) : t.item.title), 3),
|
|
205
|
+
t.loading ? (e(), i("div", M)) : (e(), i("span", {
|
|
205
206
|
key: 2,
|
|
206
|
-
class:
|
|
207
|
-
}, o(
|
|
208
|
-
t.item.trend && !t.loading ? (e(), c(
|
|
207
|
+
class: l(t.valueSize || "-text-fs-1 font-semibold text-foreground tabular-nums shrink-0")
|
|
208
|
+
}, o(y(t.item)), 3)),
|
|
209
|
+
t.item.trend && !t.loading ? (e(), c(b, {
|
|
209
210
|
key: 3,
|
|
210
211
|
trend: t.item.trend,
|
|
211
212
|
layout: t.layout
|
|
212
|
-
}, null, 8, ["trend", "layout"])) :
|
|
213
|
-
], 64)) : (e(), i(
|
|
213
|
+
}, null, 8, ["trend", "layout"])) : r("", !0)
|
|
214
|
+
], 64)) : (e(), i(x, { key: 5 }, [
|
|
214
215
|
t.item.icon && t.layout !== "icon-right" ? (e(), c(g, {
|
|
215
216
|
key: 0,
|
|
216
217
|
item: t.item,
|
|
@@ -220,22 +221,22 @@ const j = { class: "flex items-center justify-between w-full mt-1" }, $ = {
|
|
|
220
221
|
"icon-box-shape": t.iconBoxShape,
|
|
221
222
|
"icon-box-style": t.iconBoxStyle,
|
|
222
223
|
"icon-size": t.iconSize
|
|
223
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
class:
|
|
227
|
-
}, o(t.item.titleI18n ?
|
|
228
|
-
|
|
224
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : r("", !0),
|
|
225
|
+
d("div", D, [
|
|
226
|
+
d("h3", {
|
|
227
|
+
class: l(t.titleSize || "text-sm font-medium text-muted-foreground truncate")
|
|
228
|
+
}, o(t.item.titleI18n ? s(f)(t.item.titleI18n) : t.item.title), 3),
|
|
229
|
+
d("div", L, [
|
|
229
230
|
t.loading ? (e(), i("div", P)) : (e(), i("p", {
|
|
230
231
|
key: 1,
|
|
231
|
-
class:
|
|
232
|
-
}, o(
|
|
232
|
+
class: l(t.valueSize || "text-2xl font-bold text-foreground truncate")
|
|
233
|
+
}, o(y(t.item)), 3))
|
|
233
234
|
]),
|
|
234
|
-
t.item.trend && !t.loading ? (e(), c(
|
|
235
|
+
t.item.trend && !t.loading ? (e(), c(b, {
|
|
235
236
|
key: 0,
|
|
236
237
|
trend: t.item.trend,
|
|
237
238
|
layout: t.layout
|
|
238
|
-
}, null, 8, ["trend", "layout"])) :
|
|
239
|
+
}, null, 8, ["trend", "layout"])) : r("", !0)
|
|
239
240
|
]),
|
|
240
241
|
t.item.icon && t.layout === "icon-right" ? (e(), c(g, {
|
|
241
242
|
key: 1,
|
|
@@ -246,7 +247,7 @@ const j = { class: "flex items-center justify-between w-full mt-1" }, $ = {
|
|
|
246
247
|
"icon-box-shape": t.iconBoxShape,
|
|
247
248
|
"icon-box-style": t.iconBoxStyle,
|
|
248
249
|
"icon-size": t.iconSize
|
|
249
|
-
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) :
|
|
250
|
+
}, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : r("", !0)
|
|
250
251
|
], 64))
|
|
251
252
|
], 6));
|
|
252
253
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as s, computed as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as s, computed as n, openBlock as l, createElementBlock as r, normalizeClass as u, Fragment as g, renderList as f, createBlock as m } from "vue";
|
|
2
|
+
import v from "./StatItem.vue.js";
|
|
3
|
+
const x = /* @__PURE__ */ s({
|
|
4
4
|
__name: "Stats",
|
|
5
5
|
props: {
|
|
6
6
|
items: {},
|
|
@@ -17,32 +17,32 @@ const z = /* @__PURE__ */ s({
|
|
|
17
17
|
class: { default: "" }
|
|
18
18
|
},
|
|
19
19
|
setup(e) {
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
}), d =
|
|
24
|
-
const
|
|
20
|
+
const t = e, o = n(() => {
|
|
21
|
+
const a = Number(t.columns) || 4;
|
|
22
|
+
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";
|
|
23
|
+
}), d = n(() => {
|
|
24
|
+
const a = t.attached && t.variant !== "transparent" ? "border-t border-l border-border overflow-hidden" : "overflow-hidden";
|
|
25
25
|
return [
|
|
26
26
|
"grid",
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
o.value,
|
|
28
|
+
t.attached ? `gap-0 ${a}` : t.variant === "transparent-header" ? "gap-2 md:gap-3.5" : "gap-3 sm:gap-4.5",
|
|
29
|
+
t.variant === "shadow" && t.attached ? "shadow-md" : "",
|
|
30
|
+
t?.layout === "inline-label-value" ? "rounded-sm" : "",
|
|
31
|
+
t.class
|
|
32
32
|
].join(" ");
|
|
33
33
|
});
|
|
34
|
-
return (
|
|
34
|
+
return (a, S) => (l(), r("div", {
|
|
35
35
|
class: u(d.value)
|
|
36
36
|
}, [
|
|
37
|
-
(l(!0),
|
|
37
|
+
(l(!0), r(g, null, f(e.items, (i, c) => (l(), m(v, {
|
|
38
38
|
key: i.id || c,
|
|
39
39
|
item: i,
|
|
40
|
-
variant: e.variant,
|
|
41
|
-
layout: e.layout,
|
|
40
|
+
variant: e.variant.startsWith("transparent") ? "transparent" : e.variant,
|
|
41
|
+
layout: e.variant === "transparent-header" ? "centered-value-title" : e.layout,
|
|
42
42
|
attached: e.attached,
|
|
43
43
|
loading: e.loading,
|
|
44
|
-
titleSize: e.titleSize,
|
|
45
|
-
valueSize: e.valueSize,
|
|
44
|
+
titleSize: e.variant === "transparent-header" && !e.titleSize ? "text-sm font-normal! text-gray-900" : e.titleSize,
|
|
45
|
+
valueSize: e.variant === "transparent-header" && !e.valueSize ? "text-lg font-bold text-gray-900" : e.valueSize,
|
|
46
46
|
iconSize: e.iconSize,
|
|
47
47
|
iconBoxShape: e.iconBoxShape,
|
|
48
48
|
iconBoxStyle: e.iconBoxStyle
|
|
@@ -51,5 +51,5 @@ const z = /* @__PURE__ */ s({
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
export {
|
|
54
|
-
|
|
54
|
+
x as default
|
|
55
55
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type StatsVariant = 'solid' | 'outline' | 'shadow' | 'transparent';
|
|
1
|
+
export type StatsVariant = 'solid' | 'outline' | 'shadow' | 'transparent' | 'transparent-header';
|
|
2
2
|
export type StatsLayout = 'icon-left' | 'icon-right' | 'icon-top' | 'title-top-icon-bottom-right' | 'centered-value-title' | 'floating-icon' | 'split-bar' | 'inline-label-value';
|
|
3
3
|
export type IconBoxShape = 'rounded' | 'full-rounded' | 'none';
|
|
4
4
|
export type IconBoxStyle = 'filled' | 'transparent';
|
|
@@ -13,6 +13,8 @@ export interface StatItemSchema {
|
|
|
13
13
|
titleI18n?: string;
|
|
14
14
|
value: string | number;
|
|
15
15
|
isPrice?: boolean;
|
|
16
|
+
numberFormat?: 'standard' | 'compact';
|
|
17
|
+
compactThreshold?: number;
|
|
16
18
|
icon?: string;
|
|
17
19
|
color?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | string;
|
|
18
20
|
trend?: StatTrend;
|
package/core/config.d.ts
CHANGED
|
@@ -32,6 +32,8 @@ export declare const configState: {
|
|
|
32
32
|
};
|
|
33
33
|
price?: {
|
|
34
34
|
currency?: string;
|
|
35
|
+
numberFormat?: "standard" | "compact";
|
|
36
|
+
compactThreshold?: number;
|
|
35
37
|
};
|
|
36
38
|
datetime?: {
|
|
37
39
|
format?: string;
|
|
@@ -87,6 +89,7 @@ export declare const configState: {
|
|
|
87
89
|
due?: string;
|
|
88
90
|
from?: string;
|
|
89
91
|
billedTo?: string;
|
|
92
|
+
shipTo?: string;
|
|
90
93
|
status?: string;
|
|
91
94
|
item?: string;
|
|
92
95
|
price?: string;
|
|
@@ -97,6 +100,8 @@ export declare const configState: {
|
|
|
97
100
|
notes?: string;
|
|
98
101
|
sku?: string;
|
|
99
102
|
taxId?: string;
|
|
103
|
+
paymentMethod?: string;
|
|
104
|
+
shippingMethod?: string;
|
|
100
105
|
};
|
|
101
106
|
};
|
|
102
107
|
footer?: {
|
|
@@ -142,6 +147,8 @@ export declare function useVLiteConfig(): {
|
|
|
142
147
|
};
|
|
143
148
|
price?: {
|
|
144
149
|
currency?: string;
|
|
150
|
+
numberFormat?: "standard" | "compact";
|
|
151
|
+
compactThreshold?: number;
|
|
145
152
|
};
|
|
146
153
|
datetime?: {
|
|
147
154
|
format?: string;
|
|
@@ -197,6 +204,7 @@ export declare function useVLiteConfig(): {
|
|
|
197
204
|
due?: string;
|
|
198
205
|
from?: string;
|
|
199
206
|
billedTo?: string;
|
|
207
|
+
shipTo?: string;
|
|
200
208
|
status?: string;
|
|
201
209
|
item?: string;
|
|
202
210
|
price?: string;
|
|
@@ -207,6 +215,8 @@ export declare function useVLiteConfig(): {
|
|
|
207
215
|
notes?: string;
|
|
208
216
|
sku?: string;
|
|
209
217
|
taxId?: string;
|
|
218
|
+
paymentMethod?: string;
|
|
219
|
+
shippingMethod?: string;
|
|
210
220
|
};
|
|
211
221
|
};
|
|
212
222
|
footer?: {
|