vlite3 0.6.1 → 0.6.4
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/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/CommandPaletteContent.vue.js +1 -1
- package/components/CommandPaletteContent.vue2.js +2 -2
- package/components/Dropdown/Dropdown.vue.js +123 -106
- 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/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +66 -63
- 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/Screen/ScreenFilter.vue.js +1 -1
- package/components/SidePanel.vue.js +61 -59
- 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/components/Tooltip.vue.js +5 -4
- package/package.json +2 -2
- package/style.css +8 -8
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
package/components/Modal.vue2.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useKeyStroke as
|
|
4
|
-
import { $t as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as M, ref as f, inject as N, watch as x, provide as P, nextTick as V, onMounted as K, onUnmounted as R, computed as C, openBlock as n, createElementBlock as d, Fragment as W, createElementVNode as c, mergeProps as w, withModifiers as T, renderSlot as m, createCommentVNode as u, createBlock as $, Teleport as A, createVNode as B, Transition as F, withCtx as U, normalizeClass as a, toDisplayString as I, resolveDynamicComponent as q } from "vue";
|
|
2
|
+
import G from "./Button.vue.js";
|
|
3
|
+
import { useKeyStroke as H } from "../composables/useKeyStroke.js";
|
|
4
|
+
import { $t as S } from "../utils/i18n.js";
|
|
5
|
+
const J = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "flex-none flex flex-col space-y-1.5 pb-0 border-b border-border/90"
|
|
8
|
-
},
|
|
8
|
+
}, L = { class: "text-lg font-semibold leading-none tracking-tight" }, Q = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "text-sm text-muted-foreground mb-6.5"
|
|
11
|
-
},
|
|
11
|
+
}, ee = /* @__PURE__ */ M({
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
__name: "Modal",
|
|
14
14
|
props: {
|
|
@@ -28,51 +28,54 @@ const q = {
|
|
|
28
28
|
bodyProps: {}
|
|
29
29
|
},
|
|
30
30
|
emits: ["close", "update:show", "onOpen"],
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
31
|
+
setup(o, { emit: O }) {
|
|
32
|
+
const t = o, y = O, l = f(t.show), p = f(!1), b = f(!1), v = f(null);
|
|
33
33
|
let i = null;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const r = N("dropdown-context", null);
|
|
35
|
+
x(
|
|
36
|
+
() => t.show,
|
|
36
37
|
(e) => {
|
|
37
|
-
|
|
38
|
+
l.value = e, e && (y("onOpen"), r?.close());
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
|
-
const
|
|
41
|
-
|
|
41
|
+
const j = () => {
|
|
42
|
+
l.value = !0, r?.close();
|
|
42
43
|
}, z = (e) => {
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
p.value = e;
|
|
45
|
+
}, s = () => {
|
|
46
|
+
if (p.value) {
|
|
47
|
+
b.value = !0, i && clearTimeout(i), i = setTimeout(() => {
|
|
48
|
+
b.value = !1;
|
|
48
49
|
}, 1e3);
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
+
l.value = !1, y("update:show", !1), y("close");
|
|
52
53
|
};
|
|
53
|
-
P("modal-context", { close:
|
|
54
|
+
P("modal-context", { close: s, setSubmitting: z });
|
|
54
55
|
const D = () => {
|
|
55
|
-
|
|
56
|
-
}, { onKeyStroke: E } =
|
|
57
|
-
E("Escape",
|
|
58
|
-
e ? (document.body.style.overflow = "hidden", await V(),
|
|
59
|
-
}),
|
|
60
|
-
|
|
56
|
+
t.closeOutside && s();
|
|
57
|
+
}, { onKeyStroke: E } = H();
|
|
58
|
+
E("Escape", s), x(l, async (e) => {
|
|
59
|
+
r?.onChildToggle?.(e), e ? (document.body.style.overflow = "hidden", await V(), v.value?.focus()) : document.body.style.overflow = "";
|
|
60
|
+
}), K(() => {
|
|
61
|
+
l.value && r?.onChildToggle?.(!0);
|
|
62
|
+
}), R(() => {
|
|
63
|
+
l.value && r?.onChildToggle?.(!1), document.body.style.overflow = "", i && clearTimeout(i);
|
|
61
64
|
});
|
|
62
|
-
const
|
|
63
|
-
() =>
|
|
65
|
+
const h = C(() => t.titleI18n ? S(t.titleI18n) : t.title), g = C(
|
|
66
|
+
() => t.descriptionI18n ? S(t.descriptionI18n) : t.description
|
|
64
67
|
);
|
|
65
|
-
return (e, k) => (
|
|
66
|
-
|
|
67
|
-
onClick:
|
|
68
|
-
class: `${
|
|
68
|
+
return (e, k) => (n(), d(W, null, [
|
|
69
|
+
c("span", w({
|
|
70
|
+
onClick: T(j, ["stop"]),
|
|
71
|
+
class: `${o.triggerClass}`
|
|
69
72
|
}, e.$attrs), [
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
m(e.$slots, "trigger", {}, () => [
|
|
74
|
+
o.body ? m(e.$slots, "default", { key: 0 }, void 0, !0) : u("", !0)
|
|
72
75
|
], !0)
|
|
73
76
|
], 16),
|
|
74
|
-
(
|
|
75
|
-
B(
|
|
77
|
+
(n(), $(A, { to: "body" }, [
|
|
78
|
+
B(F, {
|
|
76
79
|
"enter-active-class": "transition duration-200 ease-out",
|
|
77
80
|
"enter-from-class": "opacity-0",
|
|
78
81
|
"enter-to-class": "opacity-100",
|
|
@@ -80,52 +83,52 @@ const q = {
|
|
|
80
83
|
"leave-from-class": "opacity-100",
|
|
81
84
|
"leave-to-class": "opacity-0"
|
|
82
85
|
}, {
|
|
83
|
-
default:
|
|
84
|
-
|
|
86
|
+
default: U(() => [
|
|
87
|
+
l.value ? (n(), d("div", {
|
|
85
88
|
key: 0,
|
|
86
|
-
class: a(["fixed inset-0 z-50 flex items-center justify-center bg-[#00000051] p-4",
|
|
89
|
+
class: a(["fixed inset-0 z-50 flex items-center justify-center bg-[#00000051] p-4 v-modal-overlay", o.backdrop && "backdrop-blur-[2px]"]),
|
|
87
90
|
onClick: D
|
|
88
91
|
}, [
|
|
89
|
-
|
|
92
|
+
c("div", {
|
|
90
93
|
ref_key: "modalRef",
|
|
91
|
-
ref:
|
|
94
|
+
ref: v,
|
|
92
95
|
tabindex: "-1",
|
|
93
|
-
class: a(["modal-body relative w-full rounded border border-border/60 bg-body shadow-lg text-foreground flex flex-col max-h-[85vh] sm:max-h-[90vh] focus:outline-none", [
|
|
94
|
-
onClick: k[0] || (k[0] =
|
|
96
|
+
class: a(["modal-body relative w-full rounded border border-border/60 bg-body shadow-lg text-foreground flex flex-col max-h-[85vh] sm:max-h-[90vh] focus:outline-none", [o.maxWidth]]),
|
|
97
|
+
onClick: k[0] || (k[0] = T(() => {
|
|
95
98
|
}, ["stop"]))
|
|
96
99
|
}, [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
class: a(["flex items-center justify-between py-2 px-4 rounded-t-md",
|
|
100
|
+
h.value ? (n(), d("div", J, [
|
|
101
|
+
c("div", {
|
|
102
|
+
class: a(["flex items-center justify-between py-2 px-4 rounded-t-md", o.headerClass])
|
|
100
103
|
}, [
|
|
101
|
-
|
|
102
|
-
B(
|
|
104
|
+
c("h3", L, I(h.value), 1),
|
|
105
|
+
B(G, {
|
|
103
106
|
rounded: "full",
|
|
104
107
|
size: "sm",
|
|
105
108
|
icon: "lucide:x",
|
|
106
109
|
variant: "ghost",
|
|
107
|
-
class: a(["hover:bg-gray-250/25! transition-all", { "blink-bg":
|
|
108
|
-
onClick:
|
|
110
|
+
class: a(["hover:bg-gray-250/25! transition-all", { "blink-bg": b.value }]),
|
|
111
|
+
onClick: s
|
|
109
112
|
}, null, 8, ["class"])
|
|
110
113
|
], 2)
|
|
111
|
-
])) :
|
|
112
|
-
|
|
113
|
-
class: a(["flex-1 overflow-y-auto px-4 pt-4 pb-3.5 min-h-0",
|
|
114
|
+
])) : u("", !0),
|
|
115
|
+
c("div", {
|
|
116
|
+
class: a(["flex-1 overflow-y-auto px-4 pt-4 pb-3.5 min-h-0", o.bodyClass])
|
|
114
117
|
}, [
|
|
115
|
-
|
|
116
|
-
|
|
118
|
+
g.value ? (n(), d("p", Q, I(g.value), 1)) : u("", !0),
|
|
119
|
+
o.body ? (n(), $(q(o.body), w({ key: 1 }, { ...o.bodyProps, ...e.$attrs }, { close: s }), null, 16)) : m(e.$slots, "default", {
|
|
117
120
|
key: 2,
|
|
118
|
-
close:
|
|
121
|
+
close: s
|
|
119
122
|
}, void 0, !0)
|
|
120
123
|
], 2),
|
|
121
|
-
e.$slots.footer ? (
|
|
124
|
+
e.$slots.footer ? (n(), d("div", {
|
|
122
125
|
key: 1,
|
|
123
|
-
class: a([
|
|
126
|
+
class: a([o.footerClass, "flex-none flex items-center px-4 py-3 border-t border-border/75 rounded-b-xl bg-body"])
|
|
124
127
|
}, [
|
|
125
|
-
|
|
126
|
-
], 2)) :
|
|
128
|
+
m(e.$slots, "footer", { close: s }, void 0, !0)
|
|
129
|
+
], 2)) : u("", !0)
|
|
127
130
|
], 2)
|
|
128
|
-
], 2)) :
|
|
131
|
+
], 2)) : u("", !0)
|
|
129
132
|
]),
|
|
130
133
|
_: 3
|
|
131
134
|
})
|
|
@@ -134,5 +137,5 @@ const q = {
|
|
|
134
137
|
}
|
|
135
138
|
});
|
|
136
139
|
export {
|
|
137
|
-
|
|
140
|
+
ee as default
|
|
138
141
|
};
|
|
@@ -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
|
}
|