vlite3 0.3.4 → 0.3.7
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/Badge.vue.js +4 -4
- package/components/Button.vue.d.ts +1 -0
- package/components/Button.vue.js +46 -35
- package/components/DataList/DataList.vue.d.ts +9 -7
- package/components/DataList/DataList.vue.js +78 -55
- package/components/DataList/types.d.ts +5 -10
- package/components/DataTable/DataTable.vue.d.ts +1 -3
- package/components/DataTable/DataTable.vue.js +136 -127
- package/components/DataTable/DataTableRow.vue.js +1 -1
- package/components/DataTable/types.d.ts +3 -10
- package/components/Form/types.d.ts +0 -3
- package/components/Input.vue.js +24 -25
- package/components/Pagination/Pagination.vue.d.ts +4 -16
- package/components/Pagination/Pagination.vue.js +36 -36
- package/components/Pagination/index.d.ts +19 -0
- package/components/Screen/Screen.vue.d.ts +47 -0
- package/components/Screen/Screen.vue.js +411 -0
- package/components/Screen/Screen.vue2.js +4 -0
- package/components/Screen/ScreenFilter.vue.d.ts +15 -0
- package/components/Screen/ScreenFilter.vue.js +169 -0
- package/components/Screen/ScreenFilter.vue2.js +4 -0
- package/components/Screen/index.d.ts +3 -0
- package/components/Screen/types.d.ts +53 -0
- package/index.d.ts +1 -0
- package/index.js +39 -35
- package/package.json +1 -1
- package/style.css +4 -1
- package/types/button.d.ts +4 -0
- package/utils/usePersistentState.d.ts +8 -0
- package/utils/usePersistentState.js +7 -0
package/components/Input.vue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as G, useSlots as J, ref as v, computed as r, onMounted as K, nextTick as A, openBlock as d, createElementBlock as
|
|
1
|
+
import { defineComponent as G, useSlots as J, ref as v, computed as r, onMounted as K, nextTick as A, openBlock as d, createElementBlock as u, normalizeClass as a, createBlock as C, withCtx as O, createTextVNode as k, toDisplayString as V, createCommentVNode as c, createElementVNode as B, renderSlot as F, createVNode as x } from "vue";
|
|
2
2
|
import f from "./Icon.vue.js";
|
|
3
3
|
import Q from "./Label.vue.js";
|
|
4
4
|
import X from "./Textarea.vue.js";
|
|
@@ -33,14 +33,14 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
33
33
|
},
|
|
34
34
|
emits: ["update:modelValue", "focus", "blur", "change", "click:icon", "click:icon-right"],
|
|
35
35
|
setup(n, { emit: I }) {
|
|
36
|
-
const e = n,
|
|
36
|
+
const e = n, s = I, m = J(), y = v(null), b = v(!1), M = r(() => e.type === "password" && b.value ? "text" : e.type), j = r(() => e.modelValue !== "" && e.modelValue !== null && e.modelValue !== void 0), g = r(() => !!e.addonLeft || !!m["addon-left"]), p = r(() => !!e.addonRight || !!m["addon-right"]), N = r(() => [
|
|
37
37
|
"relative w-full",
|
|
38
38
|
e.class,
|
|
39
39
|
e.labelPosition === "left" ? "flex items-center gap-4" : "",
|
|
40
40
|
e.labelPosition === "right" ? "flex flex-row-reverse items-center gap-4" : "space-y-2"
|
|
41
41
|
].join(" ")), T = r(() => ["relative flex w-full items-stretch", e.labelPosition !== "top" ? "flex-1" : ""].join(
|
|
42
42
|
" "
|
|
43
|
-
)),
|
|
43
|
+
)), z = r(() => {
|
|
44
44
|
const t = "block w-full bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/50 disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none relative focus:z-10", o = {
|
|
45
45
|
solid: "bg-muted border-transparent focus-visible:border-primary",
|
|
46
46
|
outline: "border border-input focus-visible:border-primary",
|
|
@@ -69,7 +69,7 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
69
69
|
l,
|
|
70
70
|
e.error ? "border-destructive focus-visible:ring-destructive" : "",
|
|
71
71
|
e.icon ? "pl-9" : P && !g.value ? "pl-0" : "",
|
|
72
|
-
e.showClearButton &&
|
|
72
|
+
e.showClearButton && j.value || e.type === "password" || e.loading || e.iconRight ? "pr-9" : P && !p.value ? "pr-0" : "",
|
|
73
73
|
e.inputClass
|
|
74
74
|
].join(" ");
|
|
75
75
|
}), R = {
|
|
@@ -125,28 +125,27 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
125
125
|
e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
126
126
|
].join(" ");
|
|
127
127
|
}), H = (t) => {
|
|
128
|
-
if (e.lazy) return;
|
|
129
128
|
const o = t.target;
|
|
130
|
-
|
|
129
|
+
s("update:modelValue", o.value);
|
|
131
130
|
}, U = (t) => {
|
|
132
131
|
const o = t.target;
|
|
133
|
-
|
|
132
|
+
s("change", o.value);
|
|
134
133
|
}, W = () => {
|
|
135
134
|
b.value = !b.value;
|
|
136
135
|
}, q = () => {
|
|
137
|
-
|
|
136
|
+
s("update:modelValue", ""), A(() => {
|
|
138
137
|
y.value?.focus();
|
|
139
138
|
});
|
|
140
139
|
}, h = v(!1), w = v(!1), S = (t) => {
|
|
141
|
-
h.value = !0,
|
|
140
|
+
h.value = !0, s("focus", t);
|
|
142
141
|
}, L = (t) => {
|
|
143
|
-
h.value = !1,
|
|
142
|
+
h.value = !1, s("blur", t);
|
|
144
143
|
};
|
|
145
144
|
return K(() => {
|
|
146
145
|
e.autofocus && A(() => {
|
|
147
146
|
y.value?.focus();
|
|
148
147
|
});
|
|
149
|
-
}), (t, o) => (d(),
|
|
148
|
+
}), (t, o) => (d(), u("div", {
|
|
150
149
|
class: a(N.value)
|
|
151
150
|
}, [
|
|
152
151
|
n.label ? (d(), C(Q, {
|
|
@@ -159,10 +158,10 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
159
158
|
]),
|
|
160
159
|
_: 1
|
|
161
160
|
}, 8, ["for", "class"])) : c("", !0),
|
|
162
|
-
|
|
161
|
+
B("div", {
|
|
163
162
|
class: a(T.value)
|
|
164
163
|
}, [
|
|
165
|
-
g.value ? (d(),
|
|
164
|
+
g.value ? (d(), u("div", {
|
|
166
165
|
key: 0,
|
|
167
166
|
class: a(E.value)
|
|
168
167
|
}, [
|
|
@@ -170,7 +169,7 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
170
169
|
k(V(n.addonLeft), 1)
|
|
171
170
|
])
|
|
172
171
|
], 2)) : c("", !0),
|
|
173
|
-
|
|
172
|
+
B("div", {
|
|
174
173
|
class: "relative w-full",
|
|
175
174
|
onMouseenter: o[2] || (o[2] = (i) => w.value = !0),
|
|
176
175
|
onMouseleave: o[3] || (o[3] = (i) => w.value = !1)
|
|
@@ -181,11 +180,11 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
181
180
|
placeholder: n.placeholder,
|
|
182
181
|
disabled: n.disabled,
|
|
183
182
|
rows: n.rows,
|
|
184
|
-
class: a(
|
|
185
|
-
"onUpdate:modelValue": o[0] || (o[0] = (i) =>
|
|
183
|
+
class: a(z.value),
|
|
184
|
+
"onUpdate:modelValue": o[0] || (o[0] = (i) => s("update:modelValue", i)),
|
|
186
185
|
onBlur: L,
|
|
187
186
|
onFocus: S
|
|
188
|
-
}, null, 8, ["model-value", "placeholder", "disabled", "rows", "class"])) : (d(),
|
|
187
|
+
}, null, 8, ["model-value", "placeholder", "disabled", "rows", "class"])) : (d(), u("input", {
|
|
189
188
|
key: 1,
|
|
190
189
|
ref_key: "inputRef",
|
|
191
190
|
ref: y,
|
|
@@ -195,13 +194,13 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
195
194
|
disabled: n.disabled,
|
|
196
195
|
min: n.min,
|
|
197
196
|
max: n.max,
|
|
198
|
-
class: a(
|
|
197
|
+
class: a(z.value),
|
|
199
198
|
onInput: H,
|
|
200
199
|
onChange: U,
|
|
201
200
|
onBlur: L,
|
|
202
201
|
onFocus: S
|
|
203
202
|
}, null, 42, Y)),
|
|
204
|
-
n.icon ? (d(),
|
|
203
|
+
n.icon ? (d(), u("div", {
|
|
205
204
|
key: 2,
|
|
206
205
|
tabindex: "-1",
|
|
207
206
|
class: a([
|
|
@@ -214,26 +213,26 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
214
213
|
class: "h-4 w-4"
|
|
215
214
|
}, null, 8, ["icon"])
|
|
216
215
|
], 2)) : c("", !0),
|
|
217
|
-
|
|
216
|
+
B("div", Z, [
|
|
218
217
|
n.loading ? (d(), C(f, {
|
|
219
218
|
key: 0,
|
|
220
219
|
icon: "lucide:loader-2",
|
|
221
220
|
class: "h-4 w-4 animate-spin text-muted-foreground"
|
|
222
|
-
})) : n.iconRight ? (d(),
|
|
221
|
+
})) : n.iconRight ? (d(), u("div", {
|
|
223
222
|
key: 1,
|
|
224
223
|
tabindex: "-1",
|
|
225
224
|
class: a([
|
|
226
225
|
"flex items-center justify-center text-muted-foreground",
|
|
227
226
|
n.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:text-foreground"
|
|
228
227
|
]),
|
|
229
|
-
onClick: o[1] || (o[1] = (i) => !n.disabled &&
|
|
228
|
+
onClick: o[1] || (o[1] = (i) => !n.disabled && s("click:icon-right", i))
|
|
230
229
|
}, [
|
|
231
230
|
x(f, {
|
|
232
231
|
icon: n.iconRight,
|
|
233
232
|
class: "h-4 w-4"
|
|
234
233
|
}, null, 8, ["icon"])
|
|
235
234
|
], 2)) : c("", !0),
|
|
236
|
-
n.type === "password" && !n.disabled ? (d(),
|
|
235
|
+
n.type === "password" && !n.disabled ? (d(), u("button", {
|
|
237
236
|
key: 2,
|
|
238
237
|
type: "button",
|
|
239
238
|
tabindex: "-1",
|
|
@@ -245,7 +244,7 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
245
244
|
class: "h-4 w-4"
|
|
246
245
|
}, null, 8, ["icon"])
|
|
247
246
|
])) : c("", !0),
|
|
248
|
-
n.showClearButton &&
|
|
247
|
+
n.showClearButton && j.value && !n.disabled && !n.loading && n.type !== "textarea" && n.type !== "password" && (h.value || w.value) ? (d(), u("button", {
|
|
249
248
|
key: 3,
|
|
250
249
|
type: "button",
|
|
251
250
|
tabindex: "-1",
|
|
@@ -259,7 +258,7 @@ const Y = ["type", "value", "placeholder", "disabled", "min", "max"], Z = { clas
|
|
|
259
258
|
])) : c("", !0)
|
|
260
259
|
])
|
|
261
260
|
], 32),
|
|
262
|
-
p.value ? (d(),
|
|
261
|
+
p.value ? (d(), u("div", {
|
|
263
262
|
key: 1,
|
|
264
263
|
class: a(D.value)
|
|
265
264
|
}, [
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
totalPages: number;
|
|
4
|
-
siblingCount?: number;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
showEdges?: boolean;
|
|
7
|
-
showPageInfo?: boolean;
|
|
8
|
-
showItemsPerPage?: boolean;
|
|
9
|
-
itemsPerPage?: number;
|
|
10
|
-
itemsPerPageOptions?: number[];
|
|
11
|
-
navType?: 'text' | 'icon';
|
|
12
|
-
alignment?: 'start' | 'center' | 'end' | 'between';
|
|
13
|
-
}
|
|
14
|
-
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
1
|
+
import { PaginationProps } from '.';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<PaginationProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
15
3
|
change: (value: number) => any;
|
|
16
4
|
"update:currentPage": (value: number) => any;
|
|
17
5
|
"update:itemsPerPage": (value: number) => any;
|
|
18
6
|
"change:itemsPerPage": (value: number) => any;
|
|
19
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
7
|
+
}, string, import('vue').PublicProps, Readonly<PaginationProps> & Readonly<{
|
|
20
8
|
onChange?: (value: number) => any;
|
|
21
9
|
"onUpdate:currentPage"?: (value: number) => any;
|
|
22
10
|
"onUpdate:itemsPerPage"?: (value: number) => any;
|
|
@@ -24,7 +12,7 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
24
12
|
}>, {
|
|
25
13
|
disabled: boolean;
|
|
26
14
|
currentPage: number;
|
|
27
|
-
|
|
15
|
+
totalItems: number;
|
|
28
16
|
showEdges: boolean;
|
|
29
17
|
showPageInfo: boolean;
|
|
30
18
|
showItemsPerPage: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as N, computed as z, openBlock as s, createElementBlock as
|
|
1
|
+
import { defineComponent as N, computed as z, openBlock as s, createElementBlock as r, normalizeClass as S, createElementVNode as d, Fragment as P, renderList as $, toDisplayString as x, createVNode as b, createCommentVNode as m, createTextVNode as h, createBlock as v, withCtx as w } from "vue";
|
|
2
2
|
import O from "../Icon.vue.js";
|
|
3
3
|
import o from "../Button.vue.js";
|
|
4
4
|
const R = {
|
|
@@ -24,7 +24,7 @@ const R = {
|
|
|
24
24
|
props: {
|
|
25
25
|
currentPage: { default: 1 },
|
|
26
26
|
totalPages: {},
|
|
27
|
-
|
|
27
|
+
totalItems: { default: 1 },
|
|
28
28
|
disabled: { type: Boolean, default: !1 },
|
|
29
29
|
showEdges: { type: Boolean, default: !1 },
|
|
30
30
|
showPageInfo: { type: Boolean, default: !1 },
|
|
@@ -36,31 +36,31 @@ const R = {
|
|
|
36
36
|
},
|
|
37
37
|
emits: ["update:currentPage", "change", "update:itemsPerPage", "change:itemsPerPage"],
|
|
38
38
|
setup(e, { emit: j }) {
|
|
39
|
-
const a = e, u = j,
|
|
40
|
-
a.disabled ||
|
|
41
|
-
}, T = (
|
|
42
|
-
const t =
|
|
39
|
+
const a = e, u = j, i = (l) => {
|
|
40
|
+
a.disabled || l < 1 || l > a.totalPages || l !== a.currentPage && (u("update:currentPage", l), u("change", l));
|
|
41
|
+
}, T = (l) => {
|
|
42
|
+
const t = l.target, n = parseInt(t.value);
|
|
43
43
|
u("update:itemsPerPage", n), u("change:itemsPerPage", n), u("update:currentPage", 1), u("change", 1);
|
|
44
44
|
}, D = z(() => {
|
|
45
|
-
if (a.
|
|
45
|
+
if (a.totalItems * 2 + 5 >= a.totalPages)
|
|
46
46
|
return y(1, a.totalPages);
|
|
47
|
-
const t = Math.max(a.currentPage - a.
|
|
47
|
+
const t = Math.max(a.currentPage - a.totalItems, 1), n = Math.min(a.currentPage + a.totalItems, a.totalPages), g = t > 2, c = n < a.totalPages - 2, k = 1, I = a.totalPages;
|
|
48
48
|
if (!g && c) {
|
|
49
|
-
let f = 3 + 2 * a.
|
|
50
|
-
return [...y(1, f), "DOTS",
|
|
49
|
+
let f = 3 + 2 * a.totalItems;
|
|
50
|
+
return [...y(1, f), "DOTS", I];
|
|
51
51
|
}
|
|
52
52
|
if (g && !c) {
|
|
53
|
-
let f = 3 + 2 * a.
|
|
54
|
-
return [k, "DOTS", ...
|
|
53
|
+
let f = 3 + 2 * a.totalItems, C = y(a.totalPages - f + 1, a.totalPages);
|
|
54
|
+
return [k, "DOTS", ...C];
|
|
55
55
|
}
|
|
56
56
|
if (g && c) {
|
|
57
57
|
let f = y(t, n);
|
|
58
|
-
return [k, "DOTS", ...f, "DOTS",
|
|
58
|
+
return [k, "DOTS", ...f, "DOTS", I];
|
|
59
59
|
}
|
|
60
60
|
return [];
|
|
61
|
-
}), y = (
|
|
62
|
-
let n = t -
|
|
63
|
-
return Array.from({ length: n }, (g, c) => c +
|
|
61
|
+
}), y = (l, t) => {
|
|
62
|
+
let n = t - l + 1;
|
|
63
|
+
return Array.from({ length: n }, (g, c) => c + l);
|
|
64
64
|
}, B = z(() => {
|
|
65
65
|
if (a.alignment)
|
|
66
66
|
switch (a.alignment) {
|
|
@@ -69,17 +69,17 @@ const R = {
|
|
|
69
69
|
case "end":
|
|
70
70
|
return "justify-end";
|
|
71
71
|
case "between":
|
|
72
|
-
return "justify-between";
|
|
72
|
+
return "justify-between!";
|
|
73
73
|
default:
|
|
74
74
|
return "justify-center";
|
|
75
75
|
}
|
|
76
76
|
return a.showPageInfo || a.showItemsPerPage ? "justify-between" : "justify-center";
|
|
77
77
|
});
|
|
78
|
-
return (
|
|
78
|
+
return (l, t) => (s(), r("div", {
|
|
79
79
|
class: S(["flex flex-col md:flex-row items-center gap-4 w-full", [B.value]])
|
|
80
80
|
}, [
|
|
81
|
-
e.showPageInfo || e.showItemsPerPage ? (s(),
|
|
82
|
-
e.showItemsPerPage ? (s(),
|
|
81
|
+
e.showPageInfo || e.showItemsPerPage ? (s(), r("div", R, [
|
|
82
|
+
e.showItemsPerPage ? (s(), r("div", E, [
|
|
83
83
|
t[8] || (t[8] = d("span", { class: "whitespace-nowrap" }, "Show", -1)),
|
|
84
84
|
d("div", V, [
|
|
85
85
|
d("select", {
|
|
@@ -88,7 +88,7 @@ const R = {
|
|
|
88
88
|
disabled: e.disabled,
|
|
89
89
|
onChange: T
|
|
90
90
|
}, [
|
|
91
|
-
(s(!0),
|
|
91
|
+
(s(!0), r(P, null, $(e.itemsPerPageOptions, (n) => (s(), r("option", {
|
|
92
92
|
key: n,
|
|
93
93
|
value: n
|
|
94
94
|
}, x(n), 9, M))), 128))
|
|
@@ -100,8 +100,8 @@ const R = {
|
|
|
100
100
|
]),
|
|
101
101
|
t[9] || (t[9] = d("span", { class: "whitespace-nowrap" }, "per page", -1))
|
|
102
102
|
])) : m("", !0),
|
|
103
|
-
e.showItemsPerPage && e.showPageInfo ? (s(),
|
|
104
|
-
e.showPageInfo ? (s(),
|
|
103
|
+
e.showItemsPerPage && e.showPageInfo ? (s(), r("div", A)) : m("", !0),
|
|
104
|
+
e.showPageInfo ? (s(), r("span", F, [
|
|
105
105
|
t[10] || (t[10] = h(" Page ", -1)),
|
|
106
106
|
d("span", q, x(e.currentPage), 1),
|
|
107
107
|
t[11] || (t[11] = h(" of ", -1)),
|
|
@@ -115,7 +115,7 @@ const R = {
|
|
|
115
115
|
size: "sm",
|
|
116
116
|
icon: "lucide:chevrons-left",
|
|
117
117
|
disabled: e.disabled || e.currentPage === 1,
|
|
118
|
-
onClick: t[0] || (t[0] = (n) =>
|
|
118
|
+
onClick: t[0] || (t[0] = (n) => i(1))
|
|
119
119
|
}, null, 8, ["disabled"])) : m("", !0),
|
|
120
120
|
e.navType === "icon" ? (s(), v(o, {
|
|
121
121
|
key: 1,
|
|
@@ -123,14 +123,14 @@ const R = {
|
|
|
123
123
|
size: "sm",
|
|
124
124
|
icon: "lucide:chevron-left",
|
|
125
125
|
disabled: e.disabled || e.currentPage === 1,
|
|
126
|
-
onClick: t[1] || (t[1] = (n) =>
|
|
127
|
-
}, null, 8, ["disabled"])) : (s(),
|
|
126
|
+
onClick: t[1] || (t[1] = (n) => i(e.currentPage - 1))
|
|
127
|
+
}, null, 8, ["disabled"])) : (s(), r(P, { key: 2 }, [
|
|
128
128
|
b(o, {
|
|
129
129
|
variant: "ghost",
|
|
130
130
|
size: "sm",
|
|
131
131
|
class: "hidden sm:flex",
|
|
132
132
|
disabled: e.disabled || e.currentPage === 1,
|
|
133
|
-
onClick: t[2] || (t[2] = (n) =>
|
|
133
|
+
onClick: t[2] || (t[2] = (n) => i(e.currentPage - 1))
|
|
134
134
|
}, {
|
|
135
135
|
default: w(() => [...t[12] || (t[12] = [
|
|
136
136
|
h(" Previous ", -1)
|
|
@@ -143,11 +143,11 @@ const R = {
|
|
|
143
143
|
icon: "lucide:chevron-left",
|
|
144
144
|
class: "flex sm:hidden",
|
|
145
145
|
disabled: e.disabled || e.currentPage === 1,
|
|
146
|
-
onClick: t[3] || (t[3] = (n) =>
|
|
146
|
+
onClick: t[3] || (t[3] = (n) => i(e.currentPage - 1))
|
|
147
147
|
}, null, 8, ["disabled"])
|
|
148
148
|
], 64)),
|
|
149
|
-
(s(!0),
|
|
150
|
-
n === "DOTS" ? (s(),
|
|
149
|
+
(s(!0), r(P, null, $(D.value, (n, g) => (s(), r(P, { key: g }, [
|
|
150
|
+
n === "DOTS" ? (s(), r("div", J, "...")) : (s(), v(o, {
|
|
151
151
|
key: 1,
|
|
152
152
|
size: "sm",
|
|
153
153
|
variant: n === e.currentPage ? "outline" : "ghost",
|
|
@@ -156,7 +156,7 @@ const R = {
|
|
|
156
156
|
"text-gray-600 hover:bg-gray-100": n !== e.currentPage
|
|
157
157
|
}),
|
|
158
158
|
disabled: e.disabled,
|
|
159
|
-
onClick: (c) =>
|
|
159
|
+
onClick: (c) => i(n)
|
|
160
160
|
}, {
|
|
161
161
|
default: w(() => [
|
|
162
162
|
h(x(n), 1)
|
|
@@ -170,14 +170,14 @@ const R = {
|
|
|
170
170
|
size: "sm",
|
|
171
171
|
icon: "lucide:chevron-right",
|
|
172
172
|
disabled: e.disabled || e.currentPage === e.totalPages,
|
|
173
|
-
onClick: t[4] || (t[4] = (n) =>
|
|
174
|
-
}, null, 8, ["disabled"])) : (s(),
|
|
173
|
+
onClick: t[4] || (t[4] = (n) => i(e.currentPage + 1))
|
|
174
|
+
}, null, 8, ["disabled"])) : (s(), r(P, { key: 4 }, [
|
|
175
175
|
b(o, {
|
|
176
176
|
variant: "ghost",
|
|
177
177
|
size: "sm",
|
|
178
178
|
class: "hidden sm:flex",
|
|
179
179
|
disabled: e.disabled || e.currentPage === e.totalPages,
|
|
180
|
-
onClick: t[5] || (t[5] = (n) =>
|
|
180
|
+
onClick: t[5] || (t[5] = (n) => i(e.currentPage + 1))
|
|
181
181
|
}, {
|
|
182
182
|
default: w(() => [...t[13] || (t[13] = [
|
|
183
183
|
h(" Next ", -1)
|
|
@@ -190,7 +190,7 @@ const R = {
|
|
|
190
190
|
icon: "lucide:chevron-right",
|
|
191
191
|
class: "flex sm:hidden",
|
|
192
192
|
disabled: e.disabled || e.currentPage === e.totalPages,
|
|
193
|
-
onClick: t[6] || (t[6] = (n) =>
|
|
193
|
+
onClick: t[6] || (t[6] = (n) => i(e.currentPage + 1))
|
|
194
194
|
}, null, 8, ["disabled"])
|
|
195
195
|
], 64)),
|
|
196
196
|
e.showEdges ? (s(), v(o, {
|
|
@@ -199,7 +199,7 @@ const R = {
|
|
|
199
199
|
size: "sm",
|
|
200
200
|
icon: "lucide:chevrons-right",
|
|
201
201
|
disabled: e.disabled || e.currentPage === e.totalPages,
|
|
202
|
-
onClick: t[7] || (t[7] = (n) =>
|
|
202
|
+
onClick: t[7] || (t[7] = (n) => i(e.totalPages))
|
|
203
203
|
}, null, 8, ["disabled"])) : m("", !0)
|
|
204
204
|
])
|
|
205
205
|
], 2));
|
|
@@ -1 +1,20 @@
|
|
|
1
1
|
export { default as Pagination } from './Pagination.vue';
|
|
2
|
+
export interface PageInfo {
|
|
3
|
+
currentPage: number;
|
|
4
|
+
totalPages: number;
|
|
5
|
+
totalItems?: number;
|
|
6
|
+
itemsPerPage?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface PaginationProps {
|
|
9
|
+
currentPage?: number;
|
|
10
|
+
totalPages: number;
|
|
11
|
+
totalItems?: number;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
showEdges?: boolean;
|
|
14
|
+
showPageInfo?: boolean;
|
|
15
|
+
showItemsPerPage?: boolean;
|
|
16
|
+
itemsPerPage?: number;
|
|
17
|
+
itemsPerPageOptions?: number[];
|
|
18
|
+
navType?: 'text' | 'icon';
|
|
19
|
+
alignment?: 'start' | 'center' | 'end' | 'between';
|
|
20
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ScreenProps } from './types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
title?(_: {}): any;
|
|
6
|
+
description?(_: {}): any;
|
|
7
|
+
'before-search'?(_: {}): any;
|
|
8
|
+
actions?(_: {}): any;
|
|
9
|
+
'after-add'?(_: {}): any;
|
|
10
|
+
'custom-header'?(_: {}): any;
|
|
11
|
+
empty?(_: {}): any;
|
|
12
|
+
};
|
|
13
|
+
refs: {};
|
|
14
|
+
rootEl: HTMLDivElement;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
|
+
declare const __VLS_component: import('vue').DefineComponent<ScreenProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
18
|
+
delete: (items: any[]) => any;
|
|
19
|
+
add: () => any;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<ScreenProps> & Readonly<{
|
|
21
|
+
onDelete?: (items: any[]) => any;
|
|
22
|
+
onAdd?: () => any;
|
|
23
|
+
}>, {
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
name: string;
|
|
27
|
+
data: any[];
|
|
28
|
+
loading: boolean;
|
|
29
|
+
pagination: boolean;
|
|
30
|
+
emptyTitle: string;
|
|
31
|
+
emptyDescription: string;
|
|
32
|
+
emptyIcon: string;
|
|
33
|
+
paginationProps: import('./types').ScreenPaginationProps;
|
|
34
|
+
customHeader: boolean;
|
|
35
|
+
canSearch: boolean;
|
|
36
|
+
canAdd: boolean;
|
|
37
|
+
filterSchema: import('../Form').IForm[];
|
|
38
|
+
filterType: "modal" | "dropdown";
|
|
39
|
+
showRefresh: boolean;
|
|
40
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
41
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
42
|
+
export default _default;
|
|
43
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
44
|
+
new (): {
|
|
45
|
+
$slots: S;
|
|
46
|
+
};
|
|
47
|
+
};
|