vlite3 0.6.1 → 0.6.3
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/CheckBox.vue.js +13 -12
- package/components/CommandPaletteContent.vue.js +1 -1
- package/components/CommandPaletteContent.vue2.js +2 -2
- package/components/Form/Form.vue.d.ts +0 -23
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +146 -141
- package/components/Form/FormField.vue.js +6 -5
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +8 -8
- package/components/Input.vue.js +13 -13
- package/components/Navbar/NavbarTabs.vue.js +3 -3
- package/components/Pagination/Pagination.vue.d.ts +2 -0
- package/components/Pagination/Pagination.vue.js +163 -118
- package/components/Pagination/index.d.ts +6 -0
- package/components/SidebarMenu/SidebarMenu.vue.js +89 -87
- package/components/SidebarMenu/SidebarMenuItem.vue.js +161 -139
- package/components/Switch.vue.js +2 -2
- package/components/Textarea.vue.js +4 -2
- package/package.json +1 -1
- package/style.css +8 -8
|
@@ -33,17 +33,17 @@ const W = {
|
|
|
33
33
|
},
|
|
34
34
|
emits: ["change", "addonAction"],
|
|
35
35
|
setup(c, { emit: N }) {
|
|
36
|
-
const a = c,
|
|
36
|
+
const a = c, h = N, L = O(() => {
|
|
37
37
|
if (a.className) return a.className;
|
|
38
|
-
}), k = (t) => M(a.values, t.name),
|
|
38
|
+
}), k = (t) => M(a.values, t.name), y = (t) => a.errors[t.name] || "", z = (t) => a.isFieldVisible ? a.isFieldVisible(t) : !0, D = (t) => a.isFieldDisabled ? a.isFieldDisabled(t) : t.disabled === !0, R = (t) => a.isFieldReadonly ? a.isFieldReadonly(t) : t.readonly === !0, o = (t) => t.labelI18n ? Q(t.labelI18n) : t.label, x = (t) => {
|
|
39
39
|
if (t)
|
|
40
40
|
return p(t), t;
|
|
41
41
|
}, $ = (t, n) => {
|
|
42
|
-
|
|
42
|
+
h("change", t.name, n);
|
|
43
43
|
}, q = (t) => t.itemClass || "", B = (t, n) => {
|
|
44
|
-
|
|
44
|
+
h("change", t, n);
|
|
45
45
|
}, I = (t) => {
|
|
46
|
-
|
|
46
|
+
h("addonAction", t);
|
|
47
47
|
}, v = j({}), U = (t) => {
|
|
48
48
|
v.value[t] = !0;
|
|
49
49
|
}, E = (t) => {
|
|
@@ -96,7 +96,7 @@ const W = {
|
|
|
96
96
|
for: e.name,
|
|
97
97
|
class: i([
|
|
98
98
|
"absolute transition-all duration-200 ease-in-out pointer-events-none z-20",
|
|
99
|
-
f(e) ? "-top-2.5 left-3 text-xs bg-background px-1 text-
|
|
99
|
+
f(e) ? "-top-2.5 left-3 text-xs bg-background px-1 text-black shadow-[0_4px_4px_-4px_bg-background]" : `top-2.5 text-sm text-muted-foreground/70 ${S(e)}`
|
|
100
100
|
])
|
|
101
101
|
}, [
|
|
102
102
|
_(p)(o(e)) ? (s(), d(w(x(o(e))), { key: 0 })) : (s(), r(l, { key: 1 }, [
|
|
@@ -119,7 +119,7 @@ const W = {
|
|
|
119
119
|
rounded: c.rounded,
|
|
120
120
|
disabled: D(e),
|
|
121
121
|
readonly: R(e),
|
|
122
|
-
error:
|
|
122
|
+
error: y(e),
|
|
123
123
|
isUpdate: c.isUpdate,
|
|
124
124
|
onChange: (F) => $(e, F),
|
|
125
125
|
onAddonChange: B,
|
|
@@ -137,7 +137,7 @@ const W = {
|
|
|
137
137
|
]),
|
|
138
138
|
_: 2
|
|
139
139
|
}, 1032, ["for"])) : u("", !0),
|
|
140
|
-
|
|
140
|
+
y(e) ? (s(), r("p", te, m(y(e)), 1)) : u("", !0)
|
|
141
141
|
], 2)) : u("", !0)
|
|
142
142
|
], 64))), 128))
|
|
143
143
|
], 2));
|
package/components/Input.vue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Y, computed as a, useSlots as Z, ref as b, onMounted as _, nextTick as z, openBlock as d, createElementBlock as u, normalizeClass as r, createBlock as R, withCtx as ee, createTextVNode as $, toDisplayString as w, createCommentVNode as i, createElementVNode as A, renderSlot as T, createVNode as
|
|
1
|
+
import { defineComponent as Y, computed as a, useSlots as Z, ref as b, onMounted as _, nextTick as z, openBlock as d, createElementBlock as u, normalizeClass as r, createBlock as R, withCtx as ee, createTextVNode as $, toDisplayString as w, createCommentVNode as i, createElementVNode as A, renderSlot as T, createVNode as k } from "vue";
|
|
2
2
|
import v from "./Icon.vue.js";
|
|
3
3
|
import te from "./Label.vue.js";
|
|
4
4
|
import le from "./Textarea.vue.js";
|
|
@@ -40,7 +40,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
40
40
|
setup(t, { emit: D }) {
|
|
41
41
|
const e = t, c = D, s = a(() => e.labelI18n ? E(e.labelI18n) : e.label), I = a(
|
|
42
42
|
() => e.placeholderI18n ? E(e.placeholderI18n) : e.placeholder
|
|
43
|
-
), g = Z(), m = b(null), x = b(!1), y = b(!1), H = a(() => e.type === "password" && x.value ? "text" : e.type),
|
|
43
|
+
), g = Z(), m = b(null), x = b(!1), y = b(!1), H = a(() => e.type === "password" && x.value ? "text" : e.type), C = a(() => e.modelValue !== "" && e.modelValue !== null && e.modelValue !== void 0), V = a(() => h.value || C.value || y.value), p = a(() => !!e.addonLeft || !!g["addon-left"]), B = a(() => !!e.addonRight || !!g["addon-right"]), U = a(() => [
|
|
44
44
|
"relative w-full",
|
|
45
45
|
e.class,
|
|
46
46
|
e.labelPosition === "left" ? "flex items-center gap-4" : "",
|
|
@@ -49,11 +49,11 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
49
49
|
" "
|
|
50
50
|
)), S = a(() => {
|
|
51
51
|
const l = "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/70 disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none relative focus:z-10", n = {
|
|
52
|
-
solid: "bg-muted border-transparent focus-visible:border-
|
|
53
|
-
outline: "border border-input focus-visible:border-
|
|
54
|
-
"outline-b": "border-b border-input bg-transparent rounded-none focus-visible:border-
|
|
52
|
+
solid: "bg-muted border-transparent focus-visible:border-black",
|
|
53
|
+
outline: "border border-input focus-visible:border-black",
|
|
54
|
+
"outline-b": "border-b border-input bg-transparent rounded-none focus-visible:border-black",
|
|
55
55
|
transparent: "border-none bg-transparent shadow-none",
|
|
56
|
-
floating: "border border-input focus-visible:border-
|
|
56
|
+
floating: "border border-input focus-visible:border-black"
|
|
57
57
|
}, f = {
|
|
58
58
|
sm: "h-7.5 text-xs",
|
|
59
59
|
md: "h-9 text-sm",
|
|
@@ -77,7 +77,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
77
77
|
o,
|
|
78
78
|
e.error ? "border-destructive focus-visible:ring-destructive" : "",
|
|
79
79
|
e.icon ? "pl-9" : M && !p.value ? "pl-0" : "",
|
|
80
|
-
e.showClearButton &&
|
|
80
|
+
e.showClearButton && C.value || e.type === "password" || e.loading || e.iconRight ? "pr-9" : M && !B.value ? "pr-0" : "",
|
|
81
81
|
// Keyframe name used to detect browser autofill via animationstart event
|
|
82
82
|
e.variant === "floating" ? "autofill-detect" : "",
|
|
83
83
|
e.inputClass
|
|
@@ -188,7 +188,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
188
188
|
for: s.value,
|
|
189
189
|
class: r([
|
|
190
190
|
"absolute transition-all duration-200 ease-in-out pointer-events-none z-20",
|
|
191
|
-
V.value ? "-top-2.5 left-3 text-xs bg-background px-1 text-
|
|
191
|
+
V.value ? "-top-2.5 left-3 text-xs bg-background px-1 text-black shadow-[0_4px_4px_-4px_bg-background] translate-y-0" : t.type === "textarea" ? `top-2 text-sm text-muted-foreground/70 ${t.icon ? "left-9" : "left-3"} translate-y-0` : `top-1/2 -translate-y-1/2 text-sm text-muted-foreground/70 ${t.icon ? "left-9" : "left-3"}`
|
|
192
192
|
])
|
|
193
193
|
}, w(s.value), 11, ne)) : i("", !0),
|
|
194
194
|
t.type === "textarea" ? (d(), R(le, {
|
|
@@ -226,7 +226,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
226
226
|
t.disabled ? "opacity-50" : ""
|
|
227
227
|
])
|
|
228
228
|
}, [
|
|
229
|
-
|
|
229
|
+
k(v, {
|
|
230
230
|
icon: t.icon,
|
|
231
231
|
class: r(["h-4 w-4", t.iconClass])
|
|
232
232
|
}, null, 8, ["icon", "class"])
|
|
@@ -245,7 +245,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
245
245
|
]),
|
|
246
246
|
onClick: n[1] || (n[1] = (f) => !t.disabled && c("click:icon-right", f))
|
|
247
247
|
}, [
|
|
248
|
-
|
|
248
|
+
k(v, {
|
|
249
249
|
icon: t.iconRight,
|
|
250
250
|
class: r(["h-4 w-4", t.iconRightClass])
|
|
251
251
|
}, null, 8, ["icon", "class"])
|
|
@@ -257,19 +257,19 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "min", "ma
|
|
|
257
257
|
class: "flex items-center justify-center text-muted-foreground hover:text-foreground focus:outline-none",
|
|
258
258
|
onClick: O
|
|
259
259
|
}, [
|
|
260
|
-
|
|
260
|
+
k(v, {
|
|
261
261
|
icon: x.value ? "lucide:eye-off" : "lucide:eye",
|
|
262
262
|
class: "h-4 w-4"
|
|
263
263
|
}, null, 8, ["icon"])
|
|
264
264
|
])) : i("", !0),
|
|
265
|
-
t.showClearButton &&
|
|
265
|
+
t.showClearButton && C.value && !t.disabled && !t.loading && t.type !== "textarea" && t.type !== "password" && (h.value || j.value) ? (d(), u("button", {
|
|
266
266
|
key: 3,
|
|
267
267
|
type: "button",
|
|
268
268
|
tabindex: "-1",
|
|
269
269
|
class: "flex items-center justify-center text-muted-foreground hover:text-foreground focus:outline-none transition-opacity duration-200",
|
|
270
270
|
onClick: Q
|
|
271
271
|
}, [
|
|
272
|
-
|
|
272
|
+
k(v, {
|
|
273
273
|
icon: "lucide:x-circle",
|
|
274
274
|
class: "h-4 w-4"
|
|
275
275
|
})
|
|
@@ -70,9 +70,9 @@ const U = {
|
|
|
70
70
|
ghost: "bg-accent text-accent-foreground"
|
|
71
71
|
}, V = {
|
|
72
72
|
line: "text-muted-foreground border-b-2 border-transparent hover:text-foreground hover:border-border",
|
|
73
|
-
pill: "text-muted-foreground hover:text-foreground hover:bg-accent/
|
|
74
|
-
solid: "text-muted-foreground hover:text-foreground hover:bg-accent",
|
|
75
|
-
ghost: "text-muted-foreground hover:text-foreground hover:bg-accent/
|
|
73
|
+
pill: "text-muted-foreground hover:text-foreground hover:bg-accent/50",
|
|
74
|
+
solid: "text-muted-foreground hover:text-foreground hover:bg-accent/50",
|
|
75
|
+
ghost: "text-muted-foreground hover:text-foreground hover:bg-accent/50"
|
|
76
76
|
}, x = (o) => {
|
|
77
77
|
const t = h.path;
|
|
78
78
|
if (!o.to) return !1;
|
|
@@ -10,6 +10,7 @@ declare const _default: import('vue').DefineComponent<PaginationProps, {}, {}, {
|
|
|
10
10
|
"onUpdate:itemsPerPage"?: (value: number) => any;
|
|
11
11
|
"onChange:itemsPerPage"?: (value: number) => any;
|
|
12
12
|
}>, {
|
|
13
|
+
rounded: import('.').PaginationRounded;
|
|
13
14
|
disabled: boolean;
|
|
14
15
|
itemsPerPage: number;
|
|
15
16
|
currentPage: number;
|
|
@@ -19,5 +20,6 @@ declare const _default: import('vue').DefineComponent<PaginationProps, {}, {}, {
|
|
|
19
20
|
showItemsPerPage: boolean;
|
|
20
21
|
itemsPerPageOptions: number[];
|
|
21
22
|
navType: "text" | "icon";
|
|
23
|
+
activeVariant: import('.').PaginationVariant;
|
|
22
24
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
23
25
|
export default _default;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { $t as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as q, computed as u, openBlock as r, createElementBlock as l, normalizeClass as i, createElementVNode as m, toDisplayString as o, Fragment as k, renderList as D, createVNode as C, createCommentVNode as h, createTextVNode as b, createBlock as x, withCtx as z } from "vue";
|
|
2
|
+
import G from "../Icon.vue.js";
|
|
3
|
+
import c from "../Button.vue.js";
|
|
4
|
+
import { $t as y } from "../../utils/i18n.js";
|
|
5
|
+
const H = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "flex flex-wrap items-center justify-center md:justify-start gap-4 order-2 md:order-1"
|
|
8
|
-
},
|
|
8
|
+
}, J = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "flex items-center gap-2 text-sm text-muted-foreground"
|
|
11
|
-
},
|
|
11
|
+
}, K = { class: "whitespace-nowrap" }, Q = { class: "relative" }, U = ["value", "disabled"], W = ["value"], X = { class: "whitespace-nowrap" }, Y = {
|
|
12
12
|
key: 1,
|
|
13
13
|
class: "hidden md:block w-px h-4 bg-border"
|
|
14
|
-
},
|
|
14
|
+
}, Z = {
|
|
15
15
|
key: 2,
|
|
16
16
|
class: "text-sm text-muted-foreground whitespace-nowrap"
|
|
17
|
-
},
|
|
17
|
+
}, p = { class: "font-medium text-foreground" }, _ = { class: "font-medium text-foreground" }, ee = {
|
|
18
18
|
class: "flex items-center justify-center gap-1 order-1 md:order-2",
|
|
19
19
|
"aria-label": "Pagination"
|
|
20
|
-
},
|
|
20
|
+
}, te = {
|
|
21
21
|
key: 0,
|
|
22
|
-
class: "px-2 text-
|
|
23
|
-
},
|
|
22
|
+
class: "px-2 text-muted-foreground select-none"
|
|
23
|
+
}, le = /* @__PURE__ */ q({
|
|
24
24
|
__name: "Pagination",
|
|
25
25
|
props: {
|
|
26
26
|
currentPage: { default: 1 },
|
|
@@ -33,38 +33,40 @@ const q = {
|
|
|
33
33
|
itemsPerPage: { default: 10 },
|
|
34
34
|
itemsPerPageOptions: { default: () => [10, 25, 50, 100] },
|
|
35
35
|
navType: { default: "text" },
|
|
36
|
-
alignment: {}
|
|
36
|
+
alignment: {},
|
|
37
|
+
activeVariant: { default: "solid" },
|
|
38
|
+
rounded: { default: "full" }
|
|
37
39
|
},
|
|
38
40
|
emits: ["update:currentPage", "change", "update:itemsPerPage", "change:itemsPerPage"],
|
|
39
|
-
setup(e, { emit:
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
if (
|
|
47
|
-
return
|
|
48
|
-
const
|
|
49
|
-
if (!
|
|
50
|
-
|
|
51
|
-
return [...
|
|
41
|
+
setup(e, { emit: N }) {
|
|
42
|
+
const n = e, f = N, g = (t) => {
|
|
43
|
+
n.disabled || t < 1 || t > n.totalPages || t !== n.currentPage && (f("update:currentPage", t), f("change", t));
|
|
44
|
+
}, O = (t) => {
|
|
45
|
+
const s = t.target, a = parseInt(s.value);
|
|
46
|
+
f("update:itemsPerPage", a), f("change:itemsPerPage", a), f("update:currentPage", 1), f("change", 1);
|
|
47
|
+
}, B = u(() => {
|
|
48
|
+
if (n.totalItems * 2 + 5 >= n.totalPages)
|
|
49
|
+
return I(1, n.totalPages);
|
|
50
|
+
const s = Math.max(n.currentPage - n.totalItems, 1), a = Math.min(n.currentPage + n.totalItems, n.totalPages), v = s > 2, P = a < n.totalPages - 2, $ = 1, j = n.totalPages;
|
|
51
|
+
if (!v && P) {
|
|
52
|
+
const w = 3 + 2 * n.totalItems;
|
|
53
|
+
return [...I(1, w), "DOTS", j];
|
|
52
54
|
}
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
return [
|
|
55
|
+
if (v && !P) {
|
|
56
|
+
const w = 3 + 2 * n.totalItems, T = I(n.totalPages - w + 1, n.totalPages);
|
|
57
|
+
return [$, "DOTS", ...T];
|
|
56
58
|
}
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
return [
|
|
59
|
+
if (v && P) {
|
|
60
|
+
const w = I(s, a);
|
|
61
|
+
return [$, "DOTS", ...w, "DOTS", j];
|
|
60
62
|
}
|
|
61
63
|
return [];
|
|
62
|
-
}),
|
|
63
|
-
|
|
64
|
-
return Array.from({ length: a }, (
|
|
65
|
-
},
|
|
66
|
-
if (
|
|
67
|
-
switch (
|
|
64
|
+
}), I = (t, s) => {
|
|
65
|
+
const a = s - t + 1;
|
|
66
|
+
return Array.from({ length: a }, (v, P) => P + t);
|
|
67
|
+
}, R = u(() => {
|
|
68
|
+
if (n.alignment)
|
|
69
|
+
switch (n.alignment) {
|
|
68
70
|
case "start":
|
|
69
71
|
return "justify-start";
|
|
70
72
|
case "end":
|
|
@@ -74,156 +76,199 @@ const q = {
|
|
|
74
76
|
default:
|
|
75
77
|
return "justify-center";
|
|
76
78
|
}
|
|
77
|
-
return
|
|
78
|
-
}),
|
|
79
|
-
|
|
79
|
+
return n.showPageInfo || n.showItemsPerPage ? "justify-between" : "justify-center";
|
|
80
|
+
}), d = u(() => {
|
|
81
|
+
switch (n.rounded) {
|
|
82
|
+
case "none":
|
|
83
|
+
return "rounded-none";
|
|
84
|
+
case "sm":
|
|
85
|
+
return "rounded-sm";
|
|
86
|
+
case "lg":
|
|
87
|
+
return "rounded-lg";
|
|
88
|
+
case "full":
|
|
89
|
+
return "rounded-full";
|
|
90
|
+
default:
|
|
91
|
+
return "rounded-md";
|
|
92
|
+
}
|
|
93
|
+
}), S = u(() => {
|
|
94
|
+
switch (n.activeVariant) {
|
|
95
|
+
case "solid":
|
|
96
|
+
return {
|
|
97
|
+
variant: "primary",
|
|
98
|
+
extraClass: "pointer-events-none z-10"
|
|
99
|
+
};
|
|
100
|
+
case "ghost":
|
|
101
|
+
return {
|
|
102
|
+
variant: "ghost",
|
|
103
|
+
extraClass: "bg-accent text-accent-foreground pointer-events-none z-10 font-semibold"
|
|
104
|
+
};
|
|
105
|
+
default:
|
|
106
|
+
return {
|
|
107
|
+
variant: "outline",
|
|
108
|
+
extraClass: "bg-white text-primary border-primary ring-1 ring-primary pointer-events-none z-10"
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}), V = u(() => {
|
|
112
|
+
const t = y("vlite.pagination.show");
|
|
80
113
|
return t !== "vlite.pagination.show" ? t : "Show";
|
|
81
|
-
}), R = u(() => {
|
|
82
|
-
const t = h("vlite.pagination.perPage");
|
|
83
|
-
return t !== "vlite.pagination.perPage" ? t : "per page";
|
|
84
114
|
}), E = u(() => {
|
|
85
|
-
const t =
|
|
115
|
+
const t = y("vlite.pagination.perPage");
|
|
116
|
+
return t !== "vlite.pagination.perPage" ? t : "per page";
|
|
117
|
+
}), A = u(() => {
|
|
118
|
+
const t = y("vlite.pagination.page");
|
|
86
119
|
return t !== "vlite.pagination.page" ? t : "Page";
|
|
87
|
-
}), V = u(() => {
|
|
88
|
-
const t = h("vlite.pagination.of");
|
|
89
|
-
return t !== "vlite.pagination.of" ? t : "of";
|
|
90
120
|
}), L = u(() => {
|
|
91
|
-
const t =
|
|
92
|
-
return t !== "vlite.pagination.
|
|
121
|
+
const t = y("vlite.pagination.of");
|
|
122
|
+
return t !== "vlite.pagination.of" ? t : "of";
|
|
93
123
|
}), M = u(() => {
|
|
94
|
-
const t =
|
|
124
|
+
const t = y("vlite.pagination.previous");
|
|
125
|
+
return t !== "vlite.pagination.previous" ? t : "Previous";
|
|
126
|
+
}), F = u(() => {
|
|
127
|
+
const t = y("vlite.pagination.next");
|
|
95
128
|
return t !== "vlite.pagination.next" ? t : "Next";
|
|
96
129
|
});
|
|
97
|
-
return (t,
|
|
98
|
-
class:
|
|
130
|
+
return (t, s) => (r(), l("div", {
|
|
131
|
+
class: i(["flex flex-col md:flex-row items-center gap-4 w-full", [R.value]])
|
|
99
132
|
}, [
|
|
100
|
-
e.showPageInfo || e.showItemsPerPage ? (
|
|
101
|
-
e.showItemsPerPage ? (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
133
|
+
e.showPageInfo || e.showItemsPerPage ? (r(), l("div", H, [
|
|
134
|
+
e.showItemsPerPage ? (r(), l("div", J, [
|
|
135
|
+
m("span", K, o(V.value), 1),
|
|
136
|
+
m("div", Q, [
|
|
137
|
+
m("select", {
|
|
105
138
|
value: e.itemsPerPage,
|
|
106
139
|
class: "appearance-none bg-background border border-border hover:border-accent text-foreground py-1 pl-2 pr-6 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary text-sm cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
107
140
|
disabled: e.disabled,
|
|
108
|
-
onChange:
|
|
141
|
+
onChange: O
|
|
109
142
|
}, [
|
|
110
|
-
(
|
|
143
|
+
(r(!0), l(k, null, D(e.itemsPerPageOptions, (a) => (r(), l("option", {
|
|
111
144
|
key: a,
|
|
112
145
|
value: a
|
|
113
|
-
},
|
|
114
|
-
], 40,
|
|
115
|
-
|
|
146
|
+
}, o(a), 9, W))), 128))
|
|
147
|
+
], 40, U),
|
|
148
|
+
C(G, {
|
|
116
149
|
icon: "lucide:chevron-down",
|
|
117
150
|
class: "absolute right-1.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground pointer-events-none"
|
|
118
151
|
})
|
|
119
152
|
]),
|
|
120
|
-
|
|
121
|
-
])) :
|
|
122
|
-
e.showItemsPerPage && e.showPageInfo ? (
|
|
123
|
-
e.showPageInfo ? (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
])) :
|
|
129
|
-
])) :
|
|
130
|
-
|
|
131
|
-
e.showEdges ? (
|
|
153
|
+
m("span", X, o(E.value), 1)
|
|
154
|
+
])) : h("", !0),
|
|
155
|
+
e.showItemsPerPage && e.showPageInfo ? (r(), l("div", Y)) : h("", !0),
|
|
156
|
+
e.showPageInfo ? (r(), l("span", Z, [
|
|
157
|
+
b(o(A.value) + " ", 1),
|
|
158
|
+
m("span", p, o(e.currentPage), 1),
|
|
159
|
+
b(" " + o(L.value) + " ", 1),
|
|
160
|
+
m("span", _, o(e.totalPages), 1)
|
|
161
|
+
])) : h("", !0)
|
|
162
|
+
])) : h("", !0),
|
|
163
|
+
m("nav", ee, [
|
|
164
|
+
e.showEdges ? (r(), x(c, {
|
|
132
165
|
key: 0,
|
|
133
166
|
variant: "ghost",
|
|
134
167
|
size: "sm",
|
|
135
168
|
icon: "lucide:chevrons-left",
|
|
169
|
+
class: i(d.value),
|
|
136
170
|
disabled: e.disabled || e.currentPage === 1,
|
|
137
|
-
onClick:
|
|
138
|
-
}, null, 8, ["disabled"])) :
|
|
139
|
-
e.navType === "icon" ? (
|
|
171
|
+
onClick: s[0] || (s[0] = (a) => g(1))
|
|
172
|
+
}, null, 8, ["class", "disabled"])) : h("", !0),
|
|
173
|
+
e.navType === "icon" ? (r(), x(c, {
|
|
140
174
|
key: 1,
|
|
141
175
|
variant: "ghost",
|
|
142
176
|
size: "sm",
|
|
143
177
|
icon: "lucide:chevron-left",
|
|
178
|
+
class: i(d.value),
|
|
144
179
|
disabled: e.disabled || e.currentPage === 1,
|
|
145
|
-
onClick:
|
|
146
|
-
}, null, 8, ["disabled"])) : (
|
|
147
|
-
|
|
180
|
+
onClick: s[1] || (s[1] = (a) => g(e.currentPage - 1))
|
|
181
|
+
}, null, 8, ["class", "disabled"])) : (r(), l(k, { key: 2 }, [
|
|
182
|
+
C(c, {
|
|
148
183
|
variant: "ghost",
|
|
149
184
|
size: "sm",
|
|
150
|
-
class: "hidden sm:flex",
|
|
185
|
+
class: i(["hidden sm:flex", d.value]),
|
|
151
186
|
disabled: e.disabled || e.currentPage === 1,
|
|
152
|
-
onClick:
|
|
187
|
+
onClick: s[2] || (s[2] = (a) => g(e.currentPage - 1))
|
|
153
188
|
}, {
|
|
154
|
-
default:
|
|
155
|
-
|
|
189
|
+
default: z(() => [
|
|
190
|
+
b(o(M.value), 1)
|
|
156
191
|
]),
|
|
157
192
|
_: 1
|
|
158
|
-
}, 8, ["disabled"]),
|
|
159
|
-
|
|
193
|
+
}, 8, ["class", "disabled"]),
|
|
194
|
+
C(c, {
|
|
160
195
|
variant: "ghost",
|
|
161
196
|
size: "sm",
|
|
162
197
|
icon: "lucide:chevron-left",
|
|
163
|
-
class: "flex sm:hidden",
|
|
198
|
+
class: i(["flex sm:hidden", d.value]),
|
|
164
199
|
disabled: e.disabled || e.currentPage === 1,
|
|
165
|
-
onClick:
|
|
166
|
-
}, null, 8, ["disabled"])
|
|
200
|
+
onClick: s[3] || (s[3] = (a) => g(e.currentPage - 1))
|
|
201
|
+
}, null, 8, ["class", "disabled"])
|
|
167
202
|
], 64)),
|
|
168
|
-
(
|
|
169
|
-
a === "DOTS" ? (
|
|
203
|
+
(r(!0), l(k, null, D(B.value, (a, v) => (r(), l(k, { key: v }, [
|
|
204
|
+
a === "DOTS" ? (r(), l("div", te, "...")) : a === e.currentPage ? (r(), x(c, {
|
|
170
205
|
key: 1,
|
|
171
206
|
size: "sm",
|
|
172
|
-
variant:
|
|
173
|
-
class:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
207
|
+
variant: S.value.variant,
|
|
208
|
+
class: i([S.value.extraClass, d.value]),
|
|
209
|
+
disabled: e.disabled
|
|
210
|
+
}, {
|
|
211
|
+
default: z(() => [
|
|
212
|
+
b(o(a), 1)
|
|
213
|
+
]),
|
|
214
|
+
_: 2
|
|
215
|
+
}, 1032, ["variant", "class", "disabled"])) : (r(), x(c, {
|
|
216
|
+
key: 2,
|
|
217
|
+
size: "sm",
|
|
218
|
+
variant: "ghost",
|
|
219
|
+
class: i(["text-gray-600 hover:bg-gray-100", d.value]),
|
|
177
220
|
disabled: e.disabled,
|
|
178
|
-
onClick: (P) =>
|
|
221
|
+
onClick: (P) => g(a)
|
|
179
222
|
}, {
|
|
180
|
-
default:
|
|
181
|
-
|
|
223
|
+
default: z(() => [
|
|
224
|
+
b(o(a), 1)
|
|
182
225
|
]),
|
|
183
226
|
_: 2
|
|
184
|
-
}, 1032, ["
|
|
227
|
+
}, 1032, ["class", "disabled", "onClick"]))
|
|
185
228
|
], 64))), 128)),
|
|
186
|
-
e.navType === "icon" ? (
|
|
229
|
+
e.navType === "icon" ? (r(), x(c, {
|
|
187
230
|
key: 3,
|
|
188
231
|
variant: "ghost",
|
|
189
232
|
size: "sm",
|
|
190
233
|
icon: "lucide:chevron-right",
|
|
234
|
+
class: i(d.value),
|
|
191
235
|
disabled: e.disabled || e.currentPage === e.totalPages,
|
|
192
|
-
onClick:
|
|
193
|
-
}, null, 8, ["disabled"])) : (
|
|
194
|
-
|
|
236
|
+
onClick: s[4] || (s[4] = (a) => g(e.currentPage + 1))
|
|
237
|
+
}, null, 8, ["class", "disabled"])) : (r(), l(k, { key: 4 }, [
|
|
238
|
+
C(c, {
|
|
195
239
|
variant: "ghost",
|
|
196
240
|
size: "sm",
|
|
197
|
-
class: "hidden sm:flex",
|
|
241
|
+
class: i(["hidden sm:flex", d.value]),
|
|
198
242
|
disabled: e.disabled || e.currentPage === e.totalPages,
|
|
199
|
-
onClick:
|
|
243
|
+
onClick: s[5] || (s[5] = (a) => g(e.currentPage + 1))
|
|
200
244
|
}, {
|
|
201
|
-
default:
|
|
202
|
-
|
|
245
|
+
default: z(() => [
|
|
246
|
+
b(o(F.value), 1)
|
|
203
247
|
]),
|
|
204
248
|
_: 1
|
|
205
|
-
}, 8, ["disabled"]),
|
|
206
|
-
|
|
249
|
+
}, 8, ["class", "disabled"]),
|
|
250
|
+
C(c, {
|
|
207
251
|
variant: "ghost",
|
|
208
252
|
size: "sm",
|
|
209
253
|
icon: "lucide:chevron-right",
|
|
210
|
-
class: "flex sm:hidden",
|
|
254
|
+
class: i(["flex sm:hidden", d.value]),
|
|
211
255
|
disabled: e.disabled || e.currentPage === e.totalPages,
|
|
212
|
-
onClick:
|
|
213
|
-
}, null, 8, ["disabled"])
|
|
256
|
+
onClick: s[6] || (s[6] = (a) => g(e.currentPage + 1))
|
|
257
|
+
}, null, 8, ["class", "disabled"])
|
|
214
258
|
], 64)),
|
|
215
|
-
e.showEdges ? (
|
|
259
|
+
e.showEdges ? (r(), x(c, {
|
|
216
260
|
key: 5,
|
|
217
261
|
variant: "ghost",
|
|
218
262
|
size: "sm",
|
|
219
263
|
icon: "lucide:chevrons-right",
|
|
264
|
+
class: i(d.value),
|
|
220
265
|
disabled: e.disabled || e.currentPage === e.totalPages,
|
|
221
|
-
onClick:
|
|
222
|
-
}, null, 8, ["disabled"])) :
|
|
266
|
+
onClick: s[7] || (s[7] = (a) => g(e.totalPages))
|
|
267
|
+
}, null, 8, ["class", "disabled"])) : h("", !0)
|
|
223
268
|
])
|
|
224
269
|
], 2));
|
|
225
270
|
}
|
|
226
271
|
});
|
|
227
272
|
export {
|
|
228
|
-
|
|
273
|
+
le as default
|
|
229
274
|
};
|
|
@@ -5,6 +5,8 @@ export interface PageInfo {
|
|
|
5
5
|
totalItems?: number;
|
|
6
6
|
itemsPerPage?: number;
|
|
7
7
|
}
|
|
8
|
+
export type PaginationVariant = 'outline' | 'solid' | 'ghost';
|
|
9
|
+
export type PaginationRounded = 'none' | 'sm' | 'md' | 'lg' | 'full';
|
|
8
10
|
export interface PaginationProps {
|
|
9
11
|
currentPage?: number;
|
|
10
12
|
totalPages: number;
|
|
@@ -17,4 +19,8 @@ export interface PaginationProps {
|
|
|
17
19
|
itemsPerPageOptions?: number[];
|
|
18
20
|
navType?: 'text' | 'icon';
|
|
19
21
|
alignment?: 'start' | 'center' | 'end' | 'between';
|
|
22
|
+
/** Visual style for the active page button. @default 'outline' */
|
|
23
|
+
activeVariant?: PaginationVariant;
|
|
24
|
+
/** Border radius for page buttons. @default 'md' */
|
|
25
|
+
rounded?: PaginationRounded;
|
|
20
26
|
}
|