vlite3 0.3.7 → 0.4.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/Button.vue.js +35 -29
- package/components/ConfirmationModal.vue.js +30 -24
- package/components/DataList/DataList.vue.js +44 -52
- package/components/DataTable/DataTable.vue.d.ts +1 -1
- package/components/DataTable/DataTable.vue.js +155 -159
- package/components/Empty/Empty.vue.d.ts +27 -0
- package/components/Empty/Empty.vue.js +33 -0
- package/components/Empty/Empty.vue2.js +4 -0
- package/components/Empty/index.d.ts +1 -0
- package/components/Form/composables/useForm.js +107 -93
- package/components/Form/types.d.ts +2 -0
- package/components/Form/utils/form.utils.d.ts +1 -0
- package/components/Form/utils/form.utils.js +17 -15
- package/components/Screen/Screen.vue.js +147 -143
- package/components/Screen/types.d.ts +2 -0
- package/package.json +1 -1
- package/style.css +6 -3
- package/types/button.d.ts +3 -3
package/components/Button.vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as B, useSlots as I, computed as r, inject as R, withDirectives as S, openBlock as s, createElementBlock as g, normalizeClass as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as B, useSlots as I, computed as r, inject as R, withDirectives as S, openBlock as s, createElementBlock as g, normalizeClass as i, createBlock as d, createCommentVNode as h, renderSlot as m, createTextVNode as f, toDisplayString as b, unref as G } from "vue";
|
|
2
|
+
import u from "./Icon.vue.js";
|
|
3
3
|
import { vRipple as j } from "../directives/vRipple.js";
|
|
4
|
-
const V = ["type", "disabled"],
|
|
4
|
+
const V = ["type", "disabled"], E = /* @__PURE__ */ B({
|
|
5
5
|
__name: "Button",
|
|
6
6
|
props: {
|
|
7
7
|
variant: { default: "primary" },
|
|
@@ -15,13 +15,13 @@ const V = ["type", "disabled"], N = /* @__PURE__ */ B({
|
|
|
15
15
|
text: {},
|
|
16
16
|
rounded: { default: "md" },
|
|
17
17
|
textClass: {},
|
|
18
|
-
|
|
18
|
+
iconClass: {},
|
|
19
19
|
iconRightClass: {},
|
|
20
20
|
asIcon: { type: Boolean }
|
|
21
21
|
},
|
|
22
22
|
setup(e) {
|
|
23
|
-
const
|
|
24
|
-
const
|
|
23
|
+
const n = e, x = I(), l = r(() => n?.asIcon || n.icon && !n.text && !x.default), v = R("buttonGroup", null), w = r(() => !!v?.isInGroup), p = r(() => {
|
|
24
|
+
const t = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer gap-2", o = {
|
|
25
25
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
26
26
|
"primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/20",
|
|
27
27
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
@@ -41,27 +41,31 @@ const V = ["type", "disabled"], N = /* @__PURE__ */ B({
|
|
|
41
41
|
"outline-success": "border border-success text-success hover:bg-success/10",
|
|
42
42
|
ghost: "hover:bg-accent hover:text-accent-foreground text-foreground",
|
|
43
43
|
link: "text-primary underline-offset-4 hover:underline"
|
|
44
|
-
},
|
|
44
|
+
}, y = {
|
|
45
45
|
xs: "h-6.5 px-2",
|
|
46
46
|
sm: "h-7.5 px-3",
|
|
47
|
+
sm2: "h-8 px-3",
|
|
47
48
|
md: "h-9 px-4 py-2",
|
|
48
49
|
lg: "h-10 px-6",
|
|
49
50
|
xl: "h-12 px-10"
|
|
50
51
|
}, z = {
|
|
51
52
|
xs: "h-6.5 w-6.5 min-h-6.5 min-w-6.5",
|
|
52
53
|
sm: "h-7 w-7 min-h-7 min-w-7",
|
|
54
|
+
sm2: "h-7 w-7 min-h-7 min-w-7",
|
|
53
55
|
md: "h-7.5 w-7.5 min-h-7.5 min-w-7.5",
|
|
54
56
|
lg: "h-8 w-8 min-h-8 min-w-8",
|
|
55
57
|
xl: "h-8.5 w-8.5 min-h-8.5 min-w-8.5"
|
|
56
58
|
}, C = {
|
|
57
59
|
xs: "px-2",
|
|
58
60
|
sm: "px-3",
|
|
61
|
+
sm2: "px-3",
|
|
59
62
|
md: "px-4",
|
|
60
63
|
lg: "px-6",
|
|
61
64
|
xl: "px-10"
|
|
62
65
|
}, k = {
|
|
63
66
|
none: "rounded-none",
|
|
64
67
|
sm: "rounded-sm",
|
|
68
|
+
sm2: "rounded-sm",
|
|
65
69
|
md: "rounded",
|
|
66
70
|
lg: "rounded-lg",
|
|
67
71
|
xl: "rounded-xl",
|
|
@@ -69,57 +73,59 @@ const V = ["type", "disabled"], N = /* @__PURE__ */ B({
|
|
|
69
73
|
full: "rounded-full"
|
|
70
74
|
};
|
|
71
75
|
let c;
|
|
72
|
-
return l.value ? c = w.value ? C[
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
k[
|
|
76
|
+
return l.value ? c = w.value ? C[n.size] : z[n.size] : c = y[n.size], [
|
|
77
|
+
t,
|
|
78
|
+
o[n.variant],
|
|
79
|
+
k[n.rounded],
|
|
76
80
|
c,
|
|
77
|
-
|
|
81
|
+
n.class
|
|
78
82
|
].join(" ");
|
|
79
83
|
}), a = r(() => {
|
|
80
|
-
const
|
|
84
|
+
const t = {
|
|
81
85
|
xs: "w-3 h-3",
|
|
82
86
|
sm: "w-4 h-4",
|
|
87
|
+
sm2: "w-4 h-4",
|
|
83
88
|
md: "w-4 h-4",
|
|
84
89
|
lg: "w-4 h-4",
|
|
85
90
|
xl: "w-4 h-4"
|
|
86
|
-
},
|
|
91
|
+
}, o = {
|
|
87
92
|
xs: "w-3 h-3",
|
|
88
93
|
sm: "w-3.5 h-3.5",
|
|
94
|
+
sm2: "w-3.5 h-3.5",
|
|
89
95
|
md: "w-3.5 h-3.5",
|
|
90
96
|
lg: "w-4 h-4",
|
|
91
97
|
xl: "w-4 h-4"
|
|
92
98
|
};
|
|
93
|
-
return l.value ?
|
|
99
|
+
return l.value ? o[n.size] : t[n.size];
|
|
94
100
|
});
|
|
95
|
-
return (
|
|
101
|
+
return (t, o) => S((s(), g("button", {
|
|
96
102
|
type: e.type,
|
|
97
|
-
class:
|
|
103
|
+
class: i(p.value),
|
|
98
104
|
disabled: e.disabled || e.loading
|
|
99
105
|
}, [
|
|
100
|
-
e.loading ? (s(), u
|
|
106
|
+
e.loading ? (s(), d(u, {
|
|
101
107
|
key: 0,
|
|
102
108
|
icon: "lucide:loader-2",
|
|
103
|
-
class:
|
|
104
|
-
}, null, 8, ["class"])) : e.icon ? (s(), u
|
|
109
|
+
class: i(["animate-spin pointer-events-none", a.value])
|
|
110
|
+
}, null, 8, ["class"])) : e.icon ? (s(), d(u, {
|
|
105
111
|
key: 1,
|
|
106
112
|
icon: e.icon,
|
|
107
|
-
class:
|
|
113
|
+
class: i(["pointer-events-none", [e.iconClass, a.value, l.value ? "mx-auto" : ""]])
|
|
108
114
|
}, null, 8, ["icon", "class"])) : h("", !0),
|
|
109
115
|
e.textClass ? (s(), g("span", {
|
|
110
116
|
key: 2,
|
|
111
|
-
class:
|
|
117
|
+
class: i(e.textClass)
|
|
112
118
|
}, [
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
m(t.$slots, "default", {}, () => [
|
|
120
|
+
f(b(e.text), 1)
|
|
115
121
|
])
|
|
116
|
-
], 2)) :
|
|
117
|
-
|
|
122
|
+
], 2)) : m(t.$slots, "default", { key: 3 }, () => [
|
|
123
|
+
f(b(e.text), 1)
|
|
118
124
|
]),
|
|
119
|
-
e.iconRight && !e.loading ? (s(), u
|
|
125
|
+
e.iconRight && !e.loading ? (s(), d(u, {
|
|
120
126
|
key: 4,
|
|
121
127
|
icon: e.iconRight,
|
|
122
|
-
class:
|
|
128
|
+
class: i([[e.iconRightClass, a.value], "h-4 w-4 pointer-events-none"])
|
|
123
129
|
}, null, 8, ["icon", "class"])) : h("", !0)
|
|
124
130
|
], 10, V)), [
|
|
125
131
|
[G(j)]
|
|
@@ -127,5 +133,5 @@ const V = ["type", "disabled"], N = /* @__PURE__ */ B({
|
|
|
127
133
|
}
|
|
128
134
|
});
|
|
129
135
|
export {
|
|
130
|
-
|
|
136
|
+
E as default
|
|
131
137
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const w = { class: "flex w-full items-center justify-end space-x-2" },
|
|
1
|
+
import { defineComponent as x, openBlock as u, createBlock as g, withCtx as i, createElementVNode as n, toDisplayString as d, createVNode as c, renderSlot as r } from "vue";
|
|
2
|
+
import p from "./Modal.vue.js";
|
|
3
|
+
import m from "./Button.vue.js";
|
|
4
|
+
const h = { class: "py-2 px-[2px]" }, w = { class: "mb-1.5" }, C = { class: "text-sm text-muted" }, v = { class: "flex w-full items-center justify-end space-x-2 px-[2px]" }, B = /* @__PURE__ */ x({
|
|
5
5
|
__name: "ConfirmationModal",
|
|
6
6
|
props: {
|
|
7
7
|
show: { type: Boolean, default: !1 },
|
|
@@ -13,46 +13,52 @@ const w = { class: "flex w-full items-center justify-end space-x-2" }, k = /* @_
|
|
|
13
13
|
variant: { default: "danger" }
|
|
14
14
|
},
|
|
15
15
|
emits: ["cancel", "confirm"],
|
|
16
|
-
setup(e, { emit:
|
|
17
|
-
const
|
|
18
|
-
|
|
16
|
+
setup(e, { emit: f }) {
|
|
17
|
+
const l = f, o = () => {
|
|
18
|
+
l("cancel");
|
|
19
19
|
};
|
|
20
|
-
return (
|
|
20
|
+
return (s, t) => (u(), g(p, {
|
|
21
21
|
show: e.show,
|
|
22
|
-
title: e.title,
|
|
23
|
-
description: e.description,
|
|
24
22
|
footerClass: "border-t-0! pt-0! pb-3.5!",
|
|
25
23
|
"max-width": "max-w-[400px]",
|
|
26
|
-
onClose:
|
|
27
|
-
"onUpdate:show": t[1] || (t[1] = (
|
|
24
|
+
onClose: o,
|
|
25
|
+
"onUpdate:show": t[1] || (t[1] = (a) => !a && o())
|
|
28
26
|
}, {
|
|
29
|
-
trigger:
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
trigger: i(() => [
|
|
28
|
+
r(s.$slots, "trigger", {}, () => [
|
|
29
|
+
r(s.$slots, "default")
|
|
32
30
|
])
|
|
33
31
|
]),
|
|
34
|
-
footer:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
variant: "
|
|
32
|
+
footer: i(({ close: a }) => [
|
|
33
|
+
n("div", v, [
|
|
34
|
+
c(m, {
|
|
35
|
+
variant: "secondary",
|
|
38
36
|
text: e.cancelText,
|
|
39
37
|
disabled: e.loading,
|
|
38
|
+
size: "sm2",
|
|
40
39
|
onClick: () => {
|
|
41
|
-
|
|
40
|
+
a?.(), o?.();
|
|
42
41
|
}
|
|
43
42
|
}, null, 8, ["text", "disabled", "onClick"]),
|
|
44
|
-
|
|
43
|
+
c(m, {
|
|
44
|
+
size: "sm2",
|
|
45
45
|
variant: e.variant,
|
|
46
46
|
text: e.confirmText,
|
|
47
47
|
loading: e.loading,
|
|
48
|
-
onClick: t[0] || (t[0] = (
|
|
48
|
+
onClick: t[0] || (t[0] = (y) => l("confirm"))
|
|
49
49
|
}, null, 8, ["variant", "text", "loading"])
|
|
50
50
|
])
|
|
51
51
|
]),
|
|
52
|
+
default: i(() => [
|
|
53
|
+
n("div", h, [
|
|
54
|
+
n("h3", w, d(e.title), 1),
|
|
55
|
+
n("p", C, d(e.description), 1)
|
|
56
|
+
])
|
|
57
|
+
]),
|
|
52
58
|
_: 3
|
|
53
|
-
}, 8, ["show"
|
|
59
|
+
}, 8, ["show"]));
|
|
54
60
|
}
|
|
55
61
|
});
|
|
56
62
|
export {
|
|
57
|
-
|
|
63
|
+
B as default
|
|
58
64
|
};
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as b, ref as D, watch as r, computed as u, openBlock as a, createElementBlock as o, normalizeClass as f, Fragment as P, renderList as y, renderSlot as s, createBlock as k, resolveDynamicComponent as h, createVNode as I, unref as v, mergeProps as p, createCommentVNode as C } from "vue";
|
|
2
|
+
import L from "../Pagination/Pagination.vue.js";
|
|
3
|
+
import x from "../Empty/Empty.vue.js";
|
|
4
|
+
const z = { class: "flex flex-col w-full" }, E = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "h-48 rounded-lg bg-gray-200 animate-pulse w-full"
|
|
7
7
|
}, F = {
|
|
8
|
-
key: 1,
|
|
9
|
-
class: "flex flex-col items-center justify-center p-12 text-center bg-gray-50 border border-gray-200 rounded-lg"
|
|
10
|
-
}, O = { class: "flex h-12 w-12 items-center justify-center rounded-full bg-gray-100 mb-4" }, U = { class: "text-lg font-semibold text-gray-900" }, V = { class: "mt-2 text-sm text-gray-500" }, W = {
|
|
11
8
|
key: 3,
|
|
12
9
|
class: "mt-8 w-full"
|
|
13
|
-
},
|
|
10
|
+
}, W = /* @__PURE__ */ b({
|
|
14
11
|
__name: "DataList",
|
|
15
12
|
props: {
|
|
16
13
|
data: { default: () => [] },
|
|
@@ -35,87 +32,82 @@ const S = { class: "flex flex-col w-full" }, z = {
|
|
|
35
32
|
delete: {}
|
|
36
33
|
},
|
|
37
34
|
emits: ["change"],
|
|
38
|
-
setup(e, { emit:
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
() =>
|
|
35
|
+
setup(e, { emit: T }) {
|
|
36
|
+
const n = e, w = T, i = D(n.pageInfo?.itemsPerPage || n.paginationProps?.itemsPerPage || 10);
|
|
37
|
+
r(
|
|
38
|
+
() => n.pageInfo?.itemsPerPage,
|
|
42
39
|
(t) => {
|
|
43
|
-
t !== void 0 && (
|
|
40
|
+
t !== void 0 && (i.value = t);
|
|
44
41
|
}
|
|
45
|
-
),
|
|
46
|
-
() =>
|
|
42
|
+
), r(
|
|
43
|
+
() => n.paginationProps?.itemsPerPage,
|
|
47
44
|
(t) => {
|
|
48
|
-
t !== void 0 && (
|
|
45
|
+
t !== void 0 && (i.value = t);
|
|
49
46
|
}
|
|
50
47
|
);
|
|
51
|
-
let
|
|
52
|
-
const g = (t,
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
let m = null;
|
|
49
|
+
const g = (t, c) => {
|
|
50
|
+
m && clearTimeout(m), m = setTimeout(() => {
|
|
51
|
+
w("change", { page: t, limit: c });
|
|
55
52
|
}, 10);
|
|
56
53
|
}, N = (t) => {
|
|
57
|
-
g(t,
|
|
58
|
-
},
|
|
59
|
-
|
|
54
|
+
g(t, i.value);
|
|
55
|
+
}, $ = (t) => {
|
|
56
|
+
i.value = t, g(n.pageInfo?.currentPage || 1, t);
|
|
60
57
|
};
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
return (t,
|
|
64
|
-
e.loading ? (a(),
|
|
58
|
+
u(() => n.pageInfo?.currentPage || 1);
|
|
59
|
+
const B = u(() => n.pageInfo?.totalPages || 1);
|
|
60
|
+
return (t, c) => (a(), o("div", z, [
|
|
61
|
+
e.loading ? (a(), o("div", {
|
|
65
62
|
key: 0,
|
|
66
|
-
class:
|
|
63
|
+
class: f(e.className)
|
|
67
64
|
}, [
|
|
68
|
-
(a(),
|
|
65
|
+
(a(), o(P, null, y(8, (l) => s(t.$slots, "skeleton", {
|
|
69
66
|
key: "skeleton-" + l,
|
|
70
67
|
index: l
|
|
71
68
|
}, () => [
|
|
72
|
-
|
|
73
|
-
e.skeleton || e.skelton ? (a(), k(
|
|
69
|
+
s(t.$slots, "skelton", { index: l }, () => [
|
|
70
|
+
e.skeleton || e.skelton ? (a(), k(h(e.skeleton || e.skelton), { key: 0 })) : (a(), o("div", E))
|
|
74
71
|
])
|
|
75
72
|
])), 64))
|
|
76
|
-
], 2)) : !e.data || e.data.length === 0 ? (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
]),
|
|
84
|
-
c("h3", U, p(e.emptyTitle), 1),
|
|
85
|
-
c("p", V, p(e.emptyDescription), 1)
|
|
86
|
-
])
|
|
87
|
-
])) : (a(), n("div", {
|
|
73
|
+
], 2)) : !e.data || e.data.length === 0 ? s(t.$slots, "empty", { key: 1 }, () => [
|
|
74
|
+
I(v(x), {
|
|
75
|
+
title: e.emptyTitle,
|
|
76
|
+
description: e.emptyDescription,
|
|
77
|
+
icon: e.emptyIcon
|
|
78
|
+
}, null, 8, ["title", "description", "icon"])
|
|
79
|
+
]) : (a(), o("div", {
|
|
88
80
|
key: 2,
|
|
89
|
-
class:
|
|
81
|
+
class: f(e.className)
|
|
90
82
|
}, [
|
|
91
|
-
(a(!0),
|
|
83
|
+
(a(!0), o(P, null, y(e.data, (l, d) => s(t.$slots, "item", {
|
|
92
84
|
key: d,
|
|
93
85
|
item: l,
|
|
94
86
|
data: e.data,
|
|
95
87
|
index: d
|
|
96
88
|
}, () => [
|
|
97
|
-
e.item ? (a(), k(
|
|
89
|
+
e.item ? (a(), k(h(e.item), p({
|
|
98
90
|
key: 0,
|
|
99
91
|
item: l,
|
|
100
92
|
data: e.data,
|
|
101
93
|
index: d
|
|
102
|
-
}, { ref_for: !0 }, e.itemProps), null, 16, ["item", "data", "index"])) :
|
|
94
|
+
}, { ref_for: !0 }, e.itemProps), null, 16, ["item", "data", "index"])) : C("", !0)
|
|
103
95
|
])), 128))
|
|
104
96
|
], 2)),
|
|
105
|
-
e.showPagination && e.pageInfo &&
|
|
106
|
-
I(L
|
|
97
|
+
e.showPagination && e.pageInfo && B.value > 1 ? (a(), o("div", F, [
|
|
98
|
+
I(v(L), p({
|
|
107
99
|
"current-page": e.pageInfo?.currentPage,
|
|
108
100
|
"total-pages": e.pageInfo?.totalPages,
|
|
109
101
|
"total-items": e.pageInfo?.totalItems,
|
|
110
102
|
navType: "icon"
|
|
111
103
|
}, e.paginationProps, {
|
|
112
104
|
onChange: N,
|
|
113
|
-
"onUpdate:itemsPerPage":
|
|
105
|
+
"onUpdate:itemsPerPage": $
|
|
114
106
|
}), null, 16, ["current-page", "total-pages", "total-items"])
|
|
115
|
-
])) :
|
|
107
|
+
])) : C("", !0)
|
|
116
108
|
]));
|
|
117
109
|
}
|
|
118
110
|
});
|
|
119
111
|
export {
|
|
120
|
-
|
|
112
|
+
W as default
|
|
121
113
|
};
|