vlite3 0.4.4 → 0.4.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/Accordion/AccordionItem.vue.js +33 -32
- package/components/Accordion/types.d.ts +2 -0
- package/components/Alert.vue.d.ts +2 -0
- package/components/Alert.vue.js +38 -36
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.js +25 -24
- package/components/Button.vue.d.ts +1 -1
- package/components/Button.vue.js +37 -35
- package/components/CheckBox.vue.d.ts +1 -0
- package/components/CheckBox.vue.js +40 -40
- package/components/Chip/Chip.vue.js +55 -55
- package/components/Chip/types.d.ts +1 -0
- package/components/ChoiceBox/ChoiceBox.vue.d.ts +5 -0
- package/components/ChoiceBox/ChoiceBox.vue.js +61 -58
- package/components/ColorPicker/ColorPicker.vue.js +3 -2
- package/components/ConfirmationModal.vue.d.ts +4 -2
- package/components/ConfirmationModal.vue.js +48 -33
- package/components/DataList/DataList.vue.d.ts +0 -2
- package/components/DataList/DataList.vue.js +39 -35
- package/components/DataList/types.d.ts +2 -0
- package/components/DataTable/DataTable.vue.d.ts +0 -5
- package/components/DataTable/DataTable.vue.js +177 -158
- package/components/DataTable/DataTableHeader.vue.js +15 -14
- package/components/DataTable/DataTableToolbar.vue.d.ts +1 -1
- package/components/DataTable/DataTableToolbar.vue.js +30 -23
- package/components/DataTable/types.d.ts +4 -0
- package/components/DatePicker.vue.d.ts +1 -0
- package/components/DatePicker.vue.js +32 -25
- package/components/Dropdown/DropdownBooleanItem.vue.js +18 -17
- package/components/Dropdown/DropdownGroupedLayout.vue.js +28 -27
- package/components/Dropdown/DropdownItem.vue.js +24 -23
- package/components/Dropdown/DropdownMenu.vue.js +100 -91
- package/components/Dropdown/composables/useDropdownNavigation.js +24 -23
- package/components/Dropdown/composables/useDropdownSelection.js +19 -17
- package/components/Empty/Empty.vue.d.ts +2 -2
- package/components/Empty/Empty.vue.js +32 -18
- package/components/FilePicker/FilePicker.vue.d.ts +3 -1
- package/components/FilePicker/FilePicker.vue.js +140 -127
- package/components/FileTree/FileTree.vue.js +68 -58
- package/components/FileTree/FileTreeNode.vue.js +35 -34
- package/components/FileTree/types.d.ts +3 -0
- package/components/Form/CustomFields.vue.d.ts +3 -1
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +92 -80
- package/components/Form/Form.vue.d.ts +1 -1
- package/components/Form/FormField.vue.d.ts +1 -1
- package/components/Form/FormField.vue.js +60 -59
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +58 -57
- package/components/Form/composables/useForm.js +91 -88
- package/components/Form/types.d.ts +4 -0
- package/components/Form/utils/form.utils.js +104 -98
- package/components/GoogleLogin.vue.d.ts +1 -1
- package/components/GoogleLogin.vue.js +39 -32
- package/components/Heatmap/Heatmap.vue2.js +3 -2
- package/components/IconPicker.vue.d.ts +2 -0
- package/components/IconPicker.vue.js +37 -29
- package/components/Input.vue.d.ts +1 -1
- package/components/Input.vue.js +96 -98
- package/components/Kanban/KanbanBoard.vue.js +1 -1
- package/components/Kanban/KanbanBoard.vue2.js +55 -54
- package/components/Kanban/types.d.ts +1 -0
- package/components/Masonry/Masonry.vue2.js +3 -2
- package/components/Modal.vue.d.ts +2 -0
- package/components/Modal.vue.js +62 -57
- package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
- package/components/MultiSelect/MultiSelect.vue.js +61 -54
- package/components/Navbar/Navbar.vue.js +46 -46
- package/components/Pagination/Pagination.vue.js +116 -97
- package/components/PricingPlan/PricingPlanItem.vue.js +60 -47
- package/components/PricingPlan/types.d.ts +5 -0
- package/components/Screen/Screen.vue.d.ts +0 -4
- package/components/Screen/Screen.vue.js +231 -189
- package/components/Screen/ScreenFilter.vue.js +73 -63
- package/components/Screen/types.d.ts +5 -0
- package/components/SidePanel.vue.d.ts +2 -0
- package/components/SidePanel.vue.js +140 -5
- package/components/SidePanel.vue2.js +2 -135
- package/components/SidebarMenu/SidebarMenuItem.vue.js +131 -130
- package/components/SidebarMenu/types.d.ts +1 -0
- package/components/Slider.vue.d.ts +1 -0
- package/components/Slider.vue.js +71 -69
- package/components/Switch.vue.d.ts +1 -0
- package/components/Switch.vue.js +23 -18
- package/components/Tabes/Tabes.vue.js +20 -19
- package/components/Tabes/types.d.ts +1 -0
- package/components/Textarea.vue.d.ts +1 -0
- package/components/Textarea.vue.js +18 -16
- package/components/ThemeToggle.vue.js +24 -14
- package/components/Timeline.vue.js +68 -82
- package/components/ToastNotification.vue.js +2 -2
- package/components/Tooltip.vue.d.ts +4 -3
- package/components/Tooltip.vue.js +17 -15
- package/components/Workbook/Sheet.vue.js +80 -71
- package/components/Workbook/WorkbookAddButton.vue.js +14 -10
- package/components/Workbook/types.d.ts +1 -0
- package/core/config.d.ts +2 -0
- package/index.d.ts +1 -0
- package/index.js +28 -26
- package/package.json +1 -1
- package/style.css +1 -2
- package/types/button.d.ts +1 -0
- package/types/config.type.d.ts +10 -0
- package/types/form.type.d.ts +2 -0
- package/types/styles.d.ts +3 -0
- package/types/timeline.type.d.ts +2 -0
- package/utils/i18n.d.ts +8 -0
- package/utils/i18n.js +5 -0
- package/utils/index.d.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as R, ref as g, useSlots as V, onMounted as L, onUnmounted as N, computed as p, provide as
|
|
1
|
+
import { defineComponent as R, ref as g, useSlots as V, onMounted as L, onUnmounted as N, computed as p, provide as E, watch as C, openBlock as t, createElementBlock as n, normalizeClass as i, Fragment as x, createElementVNode as r, renderSlot as o, createVNode as B, createBlock as y, resolveDynamicComponent as P, withCtx as k, createCommentVNode as d, toDisplayString as A, createTextVNode as D } from "vue";
|
|
2
2
|
import { useRoute as H } from "vue-router";
|
|
3
3
|
import { onClickOutside as U, useBreakpoints as F, breakpointsTailwind as Y } from "@vueuse/core";
|
|
4
4
|
import T from "../Icon.vue.js";
|
|
@@ -37,7 +37,7 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
37
37
|
mobileMenuVariant: { default: "sidepanel" }
|
|
38
38
|
},
|
|
39
39
|
emits: ["toggle-mobile"],
|
|
40
|
-
setup(m, { emit:
|
|
40
|
+
setup(m, { emit: se }) {
|
|
41
41
|
const l = m, a = g(!1), b = g(!1);
|
|
42
42
|
V();
|
|
43
43
|
const w = g(null), h = g(null);
|
|
@@ -57,7 +57,7 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
57
57
|
window.removeEventListener("scroll", $);
|
|
58
58
|
});
|
|
59
59
|
const z = p(() => {
|
|
60
|
-
const e = l.variant === "sidebar",
|
|
60
|
+
const e = l.variant === "sidebar", s = {
|
|
61
61
|
fixed: "fixed top-0 left-0 z-40",
|
|
62
62
|
sticky: "sticky top-0 z-40",
|
|
63
63
|
relative: "relative z-10",
|
|
@@ -69,9 +69,9 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
69
69
|
b.value && !l.floating && !e && l.position === "sticky" ? "shadow-sm" : ""
|
|
70
70
|
];
|
|
71
71
|
let c = "";
|
|
72
|
-
return e ? c = u.value.sidebarLayout : c = `flex items-center gap-4 w-full px-4 sm:px-6 lg:px-8 ${l.height}`, [f,
|
|
72
|
+
return e ? c = u.value.sidebarLayout : c = `flex items-center gap-4 w-full px-4 sm:px-6 lg:px-8 ${l.height}`, [f, s[l.position], ...v, c, l.class].join(" ");
|
|
73
73
|
}), u = p(() => {
|
|
74
|
-
const e = l.mobileBreakpoint || "md",
|
|
74
|
+
const e = l.mobileBreakpoint || "md", s = {
|
|
75
75
|
sm: "sm:hidden",
|
|
76
76
|
md: "md:hidden",
|
|
77
77
|
lg: "lg:hidden",
|
|
@@ -98,13 +98,13 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
98
98
|
xl: "hidden xl:flex flex-col h-full w-full overflow-hidden"
|
|
99
99
|
};
|
|
100
100
|
return {
|
|
101
|
-
mobileTrigger:
|
|
101
|
+
mobileTrigger: s[e],
|
|
102
102
|
desktopContent: f[e],
|
|
103
103
|
sidebarLayout: v[e],
|
|
104
104
|
mobileHeader: c[e],
|
|
105
105
|
desktopSidebar: O[e]
|
|
106
106
|
};
|
|
107
|
-
}),
|
|
107
|
+
}), M = p(() => {
|
|
108
108
|
if (l.variant === "sidebar") return "flex-1 py-4 overflow-y-auto";
|
|
109
109
|
switch (l.centerPosition) {
|
|
110
110
|
case "left":
|
|
@@ -115,12 +115,12 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
115
115
|
return `${u.value.desktopContent} items-center justify-center mx-auto`;
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
|
-
|
|
118
|
+
E("navbar-context", {
|
|
119
119
|
compact: p(() => l.compact)
|
|
120
120
|
});
|
|
121
|
-
const
|
|
121
|
+
const S = H();
|
|
122
122
|
C(
|
|
123
|
-
() =>
|
|
123
|
+
() => S.path,
|
|
124
124
|
() => {
|
|
125
125
|
a.value = !1;
|
|
126
126
|
}
|
|
@@ -128,13 +128,13 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
128
128
|
const j = F(Y).greater(l.mobileBreakpoint);
|
|
129
129
|
return C(j, (e) => {
|
|
130
130
|
e && (a.value = !1);
|
|
131
|
-
}), (e,
|
|
131
|
+
}), (e, s) => (t(), n("nav", {
|
|
132
132
|
class: i(z.value),
|
|
133
133
|
role: "navigation"
|
|
134
134
|
}, [
|
|
135
135
|
m.variant === "header" ? (t(), n(x, { key: 0 }, [
|
|
136
136
|
r("div", I, [
|
|
137
|
-
|
|
137
|
+
o(e.$slots, "mobile-trigger", {
|
|
138
138
|
isOpen: a.value,
|
|
139
139
|
toggle: () => a.value = !a.value
|
|
140
140
|
}, () => [
|
|
@@ -143,21 +143,21 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
143
143
|
ref_key: "mobileTriggerRef",
|
|
144
144
|
ref: h,
|
|
145
145
|
class: i(["p-2 -ml-2 text-muted-foreground hover:bg-accent rounded-md shrink-0", [u.value.mobileTrigger, l.mobileTriggerClass]]),
|
|
146
|
-
onClick:
|
|
146
|
+
onClick: s[0] || (s[0] = (f) => a.value = !a.value)
|
|
147
147
|
}, [
|
|
148
148
|
B(T, {
|
|
149
149
|
icon: "lucide:menu",
|
|
150
150
|
class: "w-5 h-5"
|
|
151
151
|
}),
|
|
152
|
-
|
|
152
|
+
s[3] || (s[3] = r("span", { class: "sr-only" }, "Open Menu", -1))
|
|
153
153
|
], 2)
|
|
154
154
|
]),
|
|
155
155
|
e.$slots?.logo ? (t(), n("div", {
|
|
156
156
|
key: 0,
|
|
157
157
|
class: i(["shrink-0", l.logoClass])
|
|
158
158
|
}, [
|
|
159
|
-
|
|
160
|
-
(t(), y(
|
|
159
|
+
o(e.$slots, "logo", {}, () => [
|
|
160
|
+
(t(), y(P(l.logo ? "img" : "div"), {
|
|
161
161
|
src: l.logo,
|
|
162
162
|
class: "h-8 w-auto font-bold text-xl flex items-center gap-2"
|
|
163
163
|
}, {
|
|
@@ -176,19 +176,19 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
176
176
|
key: 1,
|
|
177
177
|
class: i(["items-center gap-1 overflow-x-auto no-scrollbar mask-gradient", u.value.desktopContent])
|
|
178
178
|
}, [
|
|
179
|
-
|
|
179
|
+
o(e.$slots, "left")
|
|
180
180
|
], 2)) : d("", !0)
|
|
181
181
|
]),
|
|
182
182
|
e.$slots?.center ? (t(), n("div", {
|
|
183
183
|
key: 0,
|
|
184
184
|
class: i([
|
|
185
|
-
|
|
185
|
+
M.value,
|
|
186
186
|
// Width constraint to ensure it doesn't crush others, but allows simple resizing
|
|
187
187
|
"max-w-full",
|
|
188
188
|
l.contentClass
|
|
189
189
|
])
|
|
190
190
|
}, [
|
|
191
|
-
|
|
191
|
+
o(e.$slots, "center")
|
|
192
192
|
], 2)) : d("", !0),
|
|
193
193
|
r("div", {
|
|
194
194
|
class: i(["flex items-center gap-2 shrink-0 max-w-[40%] z-10", [
|
|
@@ -203,16 +203,16 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
203
203
|
l.rightClass
|
|
204
204
|
]])
|
|
205
205
|
}, [
|
|
206
|
-
|
|
206
|
+
o(e.$slots, "right")
|
|
207
207
|
], 2)
|
|
208
208
|
], 64)) : (t(), n(x, { key: 1 }, [
|
|
209
209
|
r("div", {
|
|
210
210
|
class: i(u.value.mobileHeader)
|
|
211
211
|
}, [
|
|
212
|
-
e.$slots?.logo ?
|
|
213
|
-
|
|
212
|
+
e.$slots?.logo ? o(e.$slots, "logo", { key: 0 }, () => [
|
|
213
|
+
s[4] || (s[4] = r("div", { class: "font-bold text-xl truncate" }, "Brand", -1))
|
|
214
214
|
]) : d("", !0),
|
|
215
|
-
|
|
215
|
+
o(e.$slots, "mobile-trigger", {
|
|
216
216
|
isOpen: a.value,
|
|
217
217
|
toggle: () => a.value = !a.value
|
|
218
218
|
}, () => [
|
|
@@ -221,13 +221,13 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
221
221
|
ref_key: "mobileTriggerRef",
|
|
222
222
|
ref: h,
|
|
223
223
|
class: i(["p-2 -mr-2 text-muted-foreground hover:bg-accent rounded-md", l.mobileTriggerClass]),
|
|
224
|
-
onClick:
|
|
224
|
+
onClick: s[1] || (s[1] = (f) => a.value = !a.value)
|
|
225
225
|
}, [
|
|
226
226
|
B(T, {
|
|
227
227
|
icon: "lucide:menu",
|
|
228
228
|
class: "w-5 h-5"
|
|
229
229
|
}),
|
|
230
|
-
|
|
230
|
+
s[5] || (s[5] = r("span", { class: "sr-only" }, "Open Menu", -1))
|
|
231
231
|
], 2)
|
|
232
232
|
])
|
|
233
233
|
], 2),
|
|
@@ -238,22 +238,22 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
238
238
|
key: 0,
|
|
239
239
|
class: i(["py-4.5 flex items-center px-4.5 z-10", l.logoClass])
|
|
240
240
|
}, [
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
o(e.$slots, "logo", {}, () => [
|
|
242
|
+
s[6] || (s[6] = r("div", { class: "font-bold text-xl truncate" }, "Brand", -1))
|
|
243
243
|
])
|
|
244
244
|
], 2)) : d("", !0),
|
|
245
245
|
r("div", {
|
|
246
246
|
class: i(["flex-1 px-2.5 pt-0 pb-4 overflow-y-auto space-y-4 scrollbar-thin", l.contentClass])
|
|
247
247
|
}, [
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
o(e.$slots, "left"),
|
|
249
|
+
o(e.$slots, "default"),
|
|
250
|
+
o(e.$slots, "center")
|
|
251
251
|
], 2),
|
|
252
252
|
e.$slots?.right ? (t(), n("div", {
|
|
253
253
|
key: 1,
|
|
254
254
|
class: i(["p-2 border-t border-border shrink-0 bg-background mt-auto", l.rightClass])
|
|
255
255
|
}, [
|
|
256
|
-
|
|
256
|
+
o(e.$slots, "right")
|
|
257
257
|
], 2)) : d("", !0)
|
|
258
258
|
], 2)
|
|
259
259
|
], 64)),
|
|
@@ -265,13 +265,13 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
265
265
|
class: i(["absolute top-[calc(100%_+_1px)] left-0 w-full bg-body border border-border/50 shadow-xl z-50 flex flex-col transition-all duration-300 origin-top overflow-hidden will-change-transform", l.menuClass])
|
|
266
266
|
}, [
|
|
267
267
|
r("div", Q, [
|
|
268
|
-
|
|
268
|
+
o(e.$slots, "mobile-menu", {}, () => [
|
|
269
269
|
r("div", W, [
|
|
270
|
-
|
|
270
|
+
o(e.$slots, "left")
|
|
271
271
|
]),
|
|
272
|
-
|
|
272
|
+
s[7] || (s[7] = r("div", { class: "h-px bg-border/50 my-1 mx-2" }, null, -1)),
|
|
273
273
|
r("div", X, [
|
|
274
|
-
|
|
274
|
+
o(e.$slots, "center")
|
|
275
275
|
])
|
|
276
276
|
])
|
|
277
277
|
])
|
|
@@ -279,7 +279,7 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
279
279
|
], 64)) : (t(), y(q, {
|
|
280
280
|
key: 3,
|
|
281
281
|
show: a.value,
|
|
282
|
-
"onUpdate:show":
|
|
282
|
+
"onUpdate:show": s[2] || (s[2] = (f) => a.value = f),
|
|
283
283
|
position: "left",
|
|
284
284
|
size: "sm",
|
|
285
285
|
triggerClass: u.value.mobileTrigger,
|
|
@@ -288,25 +288,25 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
288
288
|
bodyClass: "p-0!"
|
|
289
289
|
}, {
|
|
290
290
|
header: k(() => [
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
o(e.$slots, "logo", {}, () => [
|
|
292
|
+
s[8] || (s[8] = D("Brand", -1))
|
|
293
293
|
])
|
|
294
294
|
]),
|
|
295
295
|
default: k(() => [
|
|
296
296
|
r("div", Z, [
|
|
297
297
|
m.variant === "header" ? (t(), n("div", _, [
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
298
|
+
o(e.$slots, "mobile-menu", {}, () => [
|
|
299
|
+
o(e.$slots, "left"),
|
|
300
|
+
s[9] || (s[9] = r("div", { class: "h-px bg-border my-2" }, null, -1)),
|
|
301
|
+
o(e.$slots, "center")
|
|
302
302
|
])
|
|
303
303
|
])) : (t(), n("div", ee, [
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
304
|
+
o(e.$slots, "left"),
|
|
305
|
+
o(e.$slots, "default"),
|
|
306
|
+
o(e.$slots, "center")
|
|
307
307
|
])),
|
|
308
308
|
e.$slots?.right ? (t(), n("div", le, [
|
|
309
|
-
|
|
309
|
+
o(e.$slots, "right")
|
|
310
310
|
])) : d("", !0)
|
|
311
311
|
])
|
|
312
312
|
]),
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as A, computed as u, openBlock as i, createElementBlock as r, normalizeClass as z, createElementVNode as g, toDisplayString as l, Fragment as b, renderList as j, createVNode as x, createCommentVNode as f, createTextVNode as y, createBlock as w, withCtx as I } from "vue";
|
|
2
|
+
import F from "../Icon.vue.js";
|
|
3
|
+
import d from "../Button.vue.js";
|
|
4
|
+
import { $t as h } from "../../utils/i18n.js";
|
|
5
|
+
const q = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "flex flex-wrap items-center justify-center md:justify-start gap-4 order-2 md:order-1"
|
|
7
|
-
},
|
|
8
|
+
}, G = {
|
|
8
9
|
key: 0,
|
|
9
10
|
class: "flex items-center gap-2 text-sm text-muted-foreground"
|
|
10
|
-
},
|
|
11
|
+
}, H = { class: "whitespace-nowrap" }, J = { class: "relative" }, K = ["value", "disabled"], Q = ["value"], U = { class: "whitespace-nowrap" }, W = {
|
|
11
12
|
key: 1,
|
|
12
13
|
class: "hidden md:block w-px h-4 bg-border"
|
|
13
|
-
},
|
|
14
|
+
}, X = {
|
|
14
15
|
key: 2,
|
|
15
16
|
class: "text-sm text-muted-foreground whitespace-nowrap"
|
|
16
|
-
},
|
|
17
|
+
}, Y = { class: "font-medium text-foreground" }, Z = { class: "font-medium text-foreground" }, p = {
|
|
17
18
|
class: "flex items-center justify-center gap-1 order-1 md:order-2",
|
|
18
19
|
"aria-label": "Pagination"
|
|
19
|
-
},
|
|
20
|
+
}, _ = {
|
|
20
21
|
key: 0,
|
|
21
22
|
class: "px-2 text-gray-400 select-none"
|
|
22
|
-
},
|
|
23
|
+
}, se = /* @__PURE__ */ A({
|
|
23
24
|
__name: "Pagination",
|
|
24
25
|
props: {
|
|
25
26
|
currentPage: { default: 1 },
|
|
@@ -35,35 +36,35 @@ const R = {
|
|
|
35
36
|
alignment: {}
|
|
36
37
|
},
|
|
37
38
|
emits: ["update:currentPage", "change", "update:itemsPerPage", "change:itemsPerPage"],
|
|
38
|
-
setup(e, { emit:
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
if (
|
|
46
|
-
return
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
49
|
-
let
|
|
50
|
-
return [...
|
|
39
|
+
setup(e, { emit: T }) {
|
|
40
|
+
const s = e, c = T, o = (t) => {
|
|
41
|
+
s.disabled || t < 1 || t > s.totalPages || t !== s.currentPage && (c("update:currentPage", t), c("change", t));
|
|
42
|
+
}, D = (t) => {
|
|
43
|
+
const n = t.target, a = parseInt(n.value);
|
|
44
|
+
c("update:itemsPerPage", a), c("change:itemsPerPage", a), c("update:currentPage", 1), c("change", 1);
|
|
45
|
+
}, N = u(() => {
|
|
46
|
+
if (s.totalItems * 2 + 5 >= s.totalPages)
|
|
47
|
+
return k(1, s.totalPages);
|
|
48
|
+
const n = Math.max(s.currentPage - s.totalItems, 1), a = Math.min(s.currentPage + s.totalItems, s.totalPages), m = n > 2, P = a < s.totalPages - 2, C = 1, S = s.totalPages;
|
|
49
|
+
if (!m && P) {
|
|
50
|
+
let v = 3 + 2 * s.totalItems;
|
|
51
|
+
return [...k(1, v), "DOTS", S];
|
|
51
52
|
}
|
|
52
|
-
if (
|
|
53
|
-
let
|
|
54
|
-
return [
|
|
53
|
+
if (m && !P) {
|
|
54
|
+
let v = 3 + 2 * s.totalItems, $ = k(s.totalPages - v + 1, s.totalPages);
|
|
55
|
+
return [C, "DOTS", ...$];
|
|
55
56
|
}
|
|
56
|
-
if (
|
|
57
|
-
let
|
|
58
|
-
return [
|
|
57
|
+
if (m && P) {
|
|
58
|
+
let v = k(n, a);
|
|
59
|
+
return [C, "DOTS", ...v, "DOTS", S];
|
|
59
60
|
}
|
|
60
61
|
return [];
|
|
61
|
-
}),
|
|
62
|
-
let
|
|
63
|
-
return Array.from({ length:
|
|
64
|
-
},
|
|
65
|
-
if (
|
|
66
|
-
switch (
|
|
62
|
+
}), k = (t, n) => {
|
|
63
|
+
let a = n - t + 1;
|
|
64
|
+
return Array.from({ length: a }, (m, P) => P + t);
|
|
65
|
+
}, O = u(() => {
|
|
66
|
+
if (s.alignment)
|
|
67
|
+
switch (s.alignment) {
|
|
67
68
|
case "start":
|
|
68
69
|
return "justify-start";
|
|
69
70
|
case "end":
|
|
@@ -73,138 +74,156 @@ const R = {
|
|
|
73
74
|
default:
|
|
74
75
|
return "justify-center";
|
|
75
76
|
}
|
|
76
|
-
return
|
|
77
|
+
return s.showPageInfo || s.showItemsPerPage ? "justify-between" : "justify-center";
|
|
78
|
+
}), B = u(() => {
|
|
79
|
+
const t = h("vlite.pagination.show");
|
|
80
|
+
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
|
+
}), E = u(() => {
|
|
85
|
+
const t = h("vlite.pagination.page");
|
|
86
|
+
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
|
+
}), L = u(() => {
|
|
91
|
+
const t = h("vlite.pagination.previous");
|
|
92
|
+
return t !== "vlite.pagination.previous" ? t : "Previous";
|
|
93
|
+
}), M = u(() => {
|
|
94
|
+
const t = h("vlite.pagination.next");
|
|
95
|
+
return t !== "vlite.pagination.next" ? t : "Next";
|
|
77
96
|
});
|
|
78
|
-
return (
|
|
79
|
-
class:
|
|
97
|
+
return (t, n) => (i(), r("div", {
|
|
98
|
+
class: z(["flex flex-col md:flex-row items-center gap-4 w-full", [O.value]])
|
|
80
99
|
}, [
|
|
81
|
-
e.showPageInfo || e.showItemsPerPage ? (
|
|
82
|
-
e.showItemsPerPage ? (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
100
|
+
e.showPageInfo || e.showItemsPerPage ? (i(), r("div", q, [
|
|
101
|
+
e.showItemsPerPage ? (i(), r("div", G, [
|
|
102
|
+
g("span", H, l(B.value), 1),
|
|
103
|
+
g("div", J, [
|
|
104
|
+
g("select", {
|
|
86
105
|
value: e.itemsPerPage,
|
|
87
106
|
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",
|
|
88
107
|
disabled: e.disabled,
|
|
89
|
-
onChange:
|
|
108
|
+
onChange: D
|
|
90
109
|
}, [
|
|
91
|
-
(
|
|
92
|
-
key:
|
|
93
|
-
value:
|
|
94
|
-
},
|
|
95
|
-
], 40,
|
|
96
|
-
|
|
110
|
+
(i(!0), r(b, null, j(e.itemsPerPageOptions, (a) => (i(), r("option", {
|
|
111
|
+
key: a,
|
|
112
|
+
value: a
|
|
113
|
+
}, l(a), 9, Q))), 128))
|
|
114
|
+
], 40, K),
|
|
115
|
+
x(F, {
|
|
97
116
|
icon: "lucide:chevron-down",
|
|
98
117
|
class: "absolute right-1.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground pointer-events-none"
|
|
99
118
|
})
|
|
100
119
|
]),
|
|
101
|
-
|
|
102
|
-
])) :
|
|
103
|
-
e.showItemsPerPage && e.showPageInfo ? (
|
|
104
|
-
e.showPageInfo ? (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
])) :
|
|
110
|
-
])) :
|
|
111
|
-
|
|
112
|
-
e.showEdges ? (
|
|
120
|
+
g("span", U, l(R.value), 1)
|
|
121
|
+
])) : f("", !0),
|
|
122
|
+
e.showItemsPerPage && e.showPageInfo ? (i(), r("div", W)) : f("", !0),
|
|
123
|
+
e.showPageInfo ? (i(), r("span", X, [
|
|
124
|
+
y(l(E.value) + " ", 1),
|
|
125
|
+
g("span", Y, l(e.currentPage), 1),
|
|
126
|
+
y(" " + l(V.value) + " ", 1),
|
|
127
|
+
g("span", Z, l(e.totalPages), 1)
|
|
128
|
+
])) : f("", !0)
|
|
129
|
+
])) : f("", !0),
|
|
130
|
+
g("nav", p, [
|
|
131
|
+
e.showEdges ? (i(), w(d, {
|
|
113
132
|
key: 0,
|
|
114
133
|
variant: "ghost",
|
|
115
134
|
size: "sm",
|
|
116
135
|
icon: "lucide:chevrons-left",
|
|
117
136
|
disabled: e.disabled || e.currentPage === 1,
|
|
118
|
-
onClick:
|
|
119
|
-
}, null, 8, ["disabled"])) :
|
|
120
|
-
e.navType === "icon" ? (
|
|
137
|
+
onClick: n[0] || (n[0] = (a) => o(1))
|
|
138
|
+
}, null, 8, ["disabled"])) : f("", !0),
|
|
139
|
+
e.navType === "icon" ? (i(), w(d, {
|
|
121
140
|
key: 1,
|
|
122
141
|
variant: "ghost",
|
|
123
142
|
size: "sm",
|
|
124
143
|
icon: "lucide:chevron-left",
|
|
125
144
|
disabled: e.disabled || e.currentPage === 1,
|
|
126
|
-
onClick:
|
|
127
|
-
}, null, 8, ["disabled"])) : (
|
|
128
|
-
|
|
145
|
+
onClick: n[1] || (n[1] = (a) => o(e.currentPage - 1))
|
|
146
|
+
}, null, 8, ["disabled"])) : (i(), r(b, { key: 2 }, [
|
|
147
|
+
x(d, {
|
|
129
148
|
variant: "ghost",
|
|
130
149
|
size: "sm",
|
|
131
150
|
class: "hidden sm:flex",
|
|
132
151
|
disabled: e.disabled || e.currentPage === 1,
|
|
133
|
-
onClick:
|
|
152
|
+
onClick: n[2] || (n[2] = (a) => o(e.currentPage - 1))
|
|
134
153
|
}, {
|
|
135
|
-
default:
|
|
136
|
-
|
|
137
|
-
])
|
|
154
|
+
default: I(() => [
|
|
155
|
+
y(l(L.value), 1)
|
|
156
|
+
]),
|
|
138
157
|
_: 1
|
|
139
158
|
}, 8, ["disabled"]),
|
|
140
|
-
|
|
159
|
+
x(d, {
|
|
141
160
|
variant: "ghost",
|
|
142
161
|
size: "sm",
|
|
143
162
|
icon: "lucide:chevron-left",
|
|
144
163
|
class: "flex sm:hidden",
|
|
145
164
|
disabled: e.disabled || e.currentPage === 1,
|
|
146
|
-
onClick:
|
|
165
|
+
onClick: n[3] || (n[3] = (a) => o(e.currentPage - 1))
|
|
147
166
|
}, null, 8, ["disabled"])
|
|
148
167
|
], 64)),
|
|
149
|
-
(
|
|
150
|
-
|
|
168
|
+
(i(!0), r(b, null, j(N.value, (a, m) => (i(), r(b, { key: m }, [
|
|
169
|
+
a === "DOTS" ? (i(), r("div", _, "...")) : (i(), w(d, {
|
|
151
170
|
key: 1,
|
|
152
171
|
size: "sm",
|
|
153
|
-
variant:
|
|
154
|
-
class:
|
|
155
|
-
"bg-white text-primary border-primary ring-1 ring-primary pointer-events-none z-10":
|
|
156
|
-
"text-gray-600 hover:bg-gray-100":
|
|
172
|
+
variant: a === e.currentPage ? "outline" : "ghost",
|
|
173
|
+
class: z({
|
|
174
|
+
"bg-white text-primary border-primary ring-1 ring-primary pointer-events-none z-10": a === e.currentPage,
|
|
175
|
+
"text-gray-600 hover:bg-gray-100": a !== e.currentPage
|
|
157
176
|
}),
|
|
158
177
|
disabled: e.disabled,
|
|
159
|
-
onClick: (
|
|
178
|
+
onClick: (P) => o(a)
|
|
160
179
|
}, {
|
|
161
|
-
default:
|
|
162
|
-
|
|
180
|
+
default: I(() => [
|
|
181
|
+
y(l(a), 1)
|
|
163
182
|
]),
|
|
164
183
|
_: 2
|
|
165
184
|
}, 1032, ["variant", "class", "disabled", "onClick"]))
|
|
166
185
|
], 64))), 128)),
|
|
167
|
-
e.navType === "icon" ? (
|
|
186
|
+
e.navType === "icon" ? (i(), w(d, {
|
|
168
187
|
key: 3,
|
|
169
188
|
variant: "ghost",
|
|
170
189
|
size: "sm",
|
|
171
190
|
icon: "lucide:chevron-right",
|
|
172
191
|
disabled: e.disabled || e.currentPage === e.totalPages,
|
|
173
|
-
onClick:
|
|
174
|
-
}, null, 8, ["disabled"])) : (
|
|
175
|
-
|
|
192
|
+
onClick: n[4] || (n[4] = (a) => o(e.currentPage + 1))
|
|
193
|
+
}, null, 8, ["disabled"])) : (i(), r(b, { key: 4 }, [
|
|
194
|
+
x(d, {
|
|
176
195
|
variant: "ghost",
|
|
177
196
|
size: "sm",
|
|
178
197
|
class: "hidden sm:flex",
|
|
179
198
|
disabled: e.disabled || e.currentPage === e.totalPages,
|
|
180
|
-
onClick:
|
|
199
|
+
onClick: n[5] || (n[5] = (a) => o(e.currentPage + 1))
|
|
181
200
|
}, {
|
|
182
|
-
default:
|
|
183
|
-
|
|
184
|
-
])
|
|
201
|
+
default: I(() => [
|
|
202
|
+
y(l(M.value), 1)
|
|
203
|
+
]),
|
|
185
204
|
_: 1
|
|
186
205
|
}, 8, ["disabled"]),
|
|
187
|
-
|
|
206
|
+
x(d, {
|
|
188
207
|
variant: "ghost",
|
|
189
208
|
size: "sm",
|
|
190
209
|
icon: "lucide:chevron-right",
|
|
191
210
|
class: "flex sm:hidden",
|
|
192
211
|
disabled: e.disabled || e.currentPage === e.totalPages,
|
|
193
|
-
onClick:
|
|
212
|
+
onClick: n[6] || (n[6] = (a) => o(e.currentPage + 1))
|
|
194
213
|
}, null, 8, ["disabled"])
|
|
195
214
|
], 64)),
|
|
196
|
-
e.showEdges ? (
|
|
215
|
+
e.showEdges ? (i(), w(d, {
|
|
197
216
|
key: 5,
|
|
198
217
|
variant: "ghost",
|
|
199
218
|
size: "sm",
|
|
200
219
|
icon: "lucide:chevrons-right",
|
|
201
220
|
disabled: e.disabled || e.currentPage === e.totalPages,
|
|
202
|
-
onClick:
|
|
203
|
-
}, null, 8, ["disabled"])) :
|
|
221
|
+
onClick: n[7] || (n[7] = (a) => o(e.totalPages))
|
|
222
|
+
}, null, 8, ["disabled"])) : f("", !0)
|
|
204
223
|
])
|
|
205
224
|
], 2));
|
|
206
225
|
}
|
|
207
226
|
});
|
|
208
227
|
export {
|
|
209
|
-
|
|
228
|
+
se as default
|
|
210
229
|
};
|