vlite3 0.3.4 → 0.3.6
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/DataList/DataList.vue.d.ts +9 -7
- package/components/DataList/DataList.vue.js +77 -55
- package/components/DataList/types.d.ts +4 -10
- package/components/DataTable/DataTable.vue.d.ts +1 -3
- package/components/DataTable/DataTable.vue.js +142 -133
- package/components/DataTable/types.d.ts +3 -10
- package/components/Form/types.d.ts +0 -3
- 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 +68 -0
- package/components/Screen/Screen.vue.js +370 -0
- package/components/Screen/Screen.vue2.js +4 -0
- package/components/Screen/ScreenFilter.vue.d.ts +15 -0
- package/components/Screen/ScreenFilter.vue.js +147 -0
- package/components/Screen/ScreenFilter.vue2.js +4 -0
- package/components/Screen/index.d.ts +3 -0
- package/components/Screen/types.d.ts +52 -0
- package/index.d.ts +1 -0
- package/index.js +39 -35
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as le, ref as b, computed as p, watch as h, openBlock as n, createElementBlock as i, createBlock as R, normalizeClass as S, createSlots as V, withCtx as B, renderSlot as x, createCommentVNode as k, createElementVNode as r, createVNode as F, Fragment as T, renderList as I, normalizeStyle as M, mergeProps as U, toDisplayString as O, createTextVNode as ae, unref as se } from "vue";
|
|
2
2
|
import oe from "../Icon.vue.js";
|
|
3
3
|
import ne from "../CheckBox.vue.js";
|
|
4
4
|
import re from "../Button.vue.js";
|
|
@@ -6,20 +6,20 @@ import ie from "../ConfirmationModal.vue.js";
|
|
|
6
6
|
import de from "../Pagination/Pagination.vue.js";
|
|
7
7
|
import ce from "./DataTableHeader.vue.js";
|
|
8
8
|
import ue from "./DataTableRow.vue.js";
|
|
9
|
-
import
|
|
10
|
-
const
|
|
9
|
+
import fe from "./DataTableToolbar.vue.js";
|
|
10
|
+
const me = { class: "space-y-6.5" }, he = { class: "overflow-x-auto w-full" }, ve = { class: "hover:bg-transparent" }, ge = {
|
|
11
11
|
key: 0,
|
|
12
12
|
scope: "col",
|
|
13
13
|
class: "w-[48px] px-0 text-center font-medium text-muted-foreground",
|
|
14
14
|
style: { width: "48px" }
|
|
15
|
-
},
|
|
15
|
+
}, be = { class: "flex items-center justify-center" }, ye = { class: "[&_tr:last-child]:border-0" }, we = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "w-[48px] px-0 py-4 align-middle text-center",
|
|
18
18
|
style: { width: "48px" }
|
|
19
|
-
},
|
|
19
|
+
}, pe = { key: 2 }, ke = ["colspan"], Pe = { class: "flex flex-col items-center justify-center gap-2 text-muted-foreground p-8" }, Ce = { class: "flex h-12 w-12 items-center justify-center rounded-full bg-muted" }, Se = { class: "mt-1 text-base font-semibold text-foreground" }, xe = { class: "text-sm max-w-sm mx-auto" }, Ie = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "mt-4"
|
|
22
|
-
}, $e = { key:
|
|
22
|
+
}, $e = { key: 1 }, Ae = /* @__PURE__ */ le({
|
|
23
23
|
__name: "DataTable",
|
|
24
24
|
props: {
|
|
25
25
|
rows: { default: () => [] },
|
|
@@ -37,11 +37,14 @@ const fe = { class: "space-y-6.5" }, he = { class: "overflow-x-auto w-full" }, g
|
|
|
37
37
|
emptyDescription: { default: "No results found. Try adjusting your filters or search terms." },
|
|
38
38
|
emptyIcon: { default: "lucide:inbox" },
|
|
39
39
|
showPagination: { type: Boolean, default: !0 },
|
|
40
|
-
|
|
40
|
+
paginationProps: { default: () => ({
|
|
41
|
+
alignment: "between",
|
|
42
|
+
navType: "icon",
|
|
43
|
+
showItemsPerPage: !0,
|
|
44
|
+
itemsPerPageOptions: [10, 25, 50, 100],
|
|
45
|
+
showPageInfo: !1
|
|
46
|
+
}) },
|
|
41
47
|
pageInfo: {},
|
|
42
|
-
itemsPerPage: { default: 10 },
|
|
43
|
-
itemsPerPageOptions: { default: () => [10, 25, 50, 100] },
|
|
44
|
-
showItemsPerPage: { type: Boolean, default: !0 },
|
|
45
48
|
striped: { type: Boolean, default: !1 },
|
|
46
49
|
hoverable: { type: Boolean, default: !0 },
|
|
47
50
|
bordered: { type: Boolean, default: !0 },
|
|
@@ -52,40 +55,47 @@ const fe = { class: "space-y-6.5" }, he = { class: "overflow-x-auto w-full" }, g
|
|
|
52
55
|
variant: { default: "default" }
|
|
53
56
|
},
|
|
54
57
|
emits: ["change", "select", "rowClick", "update:itemsPerPage", "update:selectedRows", "delete"],
|
|
55
|
-
setup(l, { emit:
|
|
56
|
-
const
|
|
58
|
+
setup(l, { emit: L }) {
|
|
59
|
+
const W = (e, t) => {
|
|
57
60
|
if (!(!e || !t))
|
|
58
61
|
return t.includes(".") ? t.split(".").reduce((s, u) => s?.[u], e) : e[t];
|
|
59
|
-
}, c = (e, t) =>
|
|
60
|
-
|
|
62
|
+
}, c = (e, t) => W(e, t), a = l, y = L, d = b({ field: "", order: "" }), P = b(
|
|
63
|
+
a.pageInfo?.itemsPerPage || a.paginationProps?.itemsPerPage || 10
|
|
64
|
+
), v = b(a.pageInfo?.currentPage || 1), w = b(a.search || ""), C = b(!1), g = b("initial"), q = p(() => a.loading && (g.value === "initial" || g.value === "page"));
|
|
65
|
+
h(
|
|
61
66
|
() => a.loading,
|
|
62
67
|
(e, t) => {
|
|
63
68
|
!e && t && (g.value = "idle");
|
|
64
69
|
}
|
|
65
|
-
),
|
|
70
|
+
), h(
|
|
66
71
|
() => a.search,
|
|
67
72
|
(e) => {
|
|
68
|
-
e !== void 0 && e !==
|
|
73
|
+
e !== void 0 && e !== w.value && (w.value = e);
|
|
69
74
|
}
|
|
70
75
|
);
|
|
71
76
|
let z = null;
|
|
72
|
-
|
|
77
|
+
h(w, (e) => {
|
|
73
78
|
z && clearTimeout(z), z = setTimeout(() => {
|
|
74
|
-
|
|
79
|
+
v.value = 1, g.value = "search", $();
|
|
75
80
|
}, 300);
|
|
76
|
-
}),
|
|
77
|
-
() => a.itemsPerPage,
|
|
81
|
+
}), h(
|
|
82
|
+
() => a.pageInfo?.itemsPerPage,
|
|
78
83
|
(e) => {
|
|
79
|
-
|
|
84
|
+
e !== void 0 && (P.value = e);
|
|
80
85
|
}
|
|
81
|
-
),
|
|
86
|
+
), h(
|
|
87
|
+
() => a.paginationProps?.itemsPerPage,
|
|
88
|
+
(e) => {
|
|
89
|
+
e !== void 0 && (P.value = e);
|
|
90
|
+
}
|
|
91
|
+
), h(
|
|
82
92
|
() => a.pageInfo?.currentPage,
|
|
83
93
|
(e) => {
|
|
84
|
-
e && (
|
|
94
|
+
e && (v.value = e);
|
|
85
95
|
}
|
|
86
96
|
);
|
|
87
|
-
const
|
|
88
|
-
|
|
97
|
+
const N = (e) => c(e, a.keyField), o = b(/* @__PURE__ */ new Set());
|
|
98
|
+
h(
|
|
89
99
|
() => a.selectedRows,
|
|
90
100
|
(e) => {
|
|
91
101
|
const t = new Set((e || []).map((s) => c(s, a.keyField)));
|
|
@@ -93,107 +103,110 @@ const fe = { class: "space-y-6.5" }, he = { class: "overflow-x-auto w-full" }, g
|
|
|
93
103
|
},
|
|
94
104
|
{ immediate: !0, deep: !0 }
|
|
95
105
|
);
|
|
96
|
-
const
|
|
106
|
+
const D = p(() => a.rows.length === 0 ? !1 : a.rows.every((e) => o.value.has(c(e, a.keyField)))), j = p(() => o.value.size > 0 && !D.value), G = p(() => {
|
|
97
107
|
const e = [...a.selectedRows || [], ...a.rows], t = /* @__PURE__ */ new Map();
|
|
98
108
|
return e.forEach((s) => t.set(c(s, a.keyField), s)), Array.from(o.value).map((s) => t.get(s)).filter(Boolean);
|
|
99
|
-
}),
|
|
100
|
-
e ? a.rows.forEach((t) => o.value.add(c(t, a.keyField))) : o.value.size > 0 && a.rows.forEach((t) => o.value.delete(c(t, a.keyField))),
|
|
101
|
-
},
|
|
102
|
-
o.value.has(e) ? o.value.delete(e) : o.value.add(e),
|
|
103
|
-
},
|
|
109
|
+
}), H = (e) => {
|
|
110
|
+
e ? a.rows.forEach((t) => o.value.add(c(t, a.keyField))) : o.value.size > 0 && a.rows.forEach((t) => o.value.delete(c(t, a.keyField))), A();
|
|
111
|
+
}, J = (e) => {
|
|
112
|
+
o.value.has(e) ? o.value.delete(e) : o.value.add(e), A();
|
|
113
|
+
}, A = () => {
|
|
104
114
|
const e = a.selectedRows || [], t = /* @__PURE__ */ new Set(), s = [];
|
|
105
|
-
a.rows.forEach((
|
|
106
|
-
const
|
|
107
|
-
o.value.has(
|
|
108
|
-
}), e.forEach((
|
|
109
|
-
const
|
|
110
|
-
!t.has(
|
|
115
|
+
a.rows.forEach((f) => {
|
|
116
|
+
const m = c(f, a.keyField);
|
|
117
|
+
o.value.has(m) && (s.push(f), t.add(m));
|
|
118
|
+
}), e.forEach((f) => {
|
|
119
|
+
const m = c(f, a.keyField);
|
|
120
|
+
!t.has(m) && o.value.has(m) && (s.push(f), t.add(m));
|
|
111
121
|
});
|
|
112
122
|
const u = {
|
|
113
123
|
selected: s,
|
|
114
|
-
all:
|
|
115
|
-
indeterminate:
|
|
124
|
+
all: D.value,
|
|
125
|
+
indeterminate: j.value
|
|
116
126
|
};
|
|
117
|
-
|
|
118
|
-
}, H = (e) => {
|
|
119
|
-
d.value.field === e ? d.value.order === "asc" ? d.value.order = "desc" : d.value.order === "desc" ? (d.value.order = "", d.value.field = "") : d.value.order = "asc" : (d.value.field = e, d.value.order = "asc"), h.value = 1, g.value = "sort", C();
|
|
120
|
-
}, J = (e) => {
|
|
121
|
-
h.value = e, g.value = "page", C();
|
|
127
|
+
y("select", u), y("update:selectedRows", s);
|
|
122
128
|
}, K = (e) => {
|
|
123
|
-
|
|
129
|
+
d.value.field === e ? d.value.order === "asc" ? d.value.order = "desc" : d.value.order === "desc" ? (d.value.order = "", d.value.field = "") : d.value.order = "asc" : (d.value.field = e, d.value.order = "asc"), v.value = 1, g.value = "sort", $();
|
|
124
130
|
}, Q = (e) => {
|
|
125
|
-
|
|
126
|
-
}, X = () => {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
131
|
+
v.value = e, g.value = "page", $();
|
|
132
|
+
}, X = (e) => {
|
|
133
|
+
P.value = e, v.value = 1, g.value = "limit", y("update:itemsPerPage", e), $();
|
|
134
|
+
}, Y = (e) => {
|
|
135
|
+
y("rowClick", e);
|
|
136
|
+
}, Z = () => {
|
|
137
|
+
const e = G.value;
|
|
138
|
+
y("delete", e), C.value = !1;
|
|
139
|
+
};
|
|
140
|
+
let E = null;
|
|
141
|
+
const $ = () => {
|
|
142
|
+
E && clearTimeout(E), E = setTimeout(() => {
|
|
143
|
+
y("change", {
|
|
144
|
+
pagination: {
|
|
145
|
+
page: v.value,
|
|
146
|
+
limit: P.value
|
|
147
|
+
},
|
|
148
|
+
sorting: { ...d.value },
|
|
149
|
+
search: w.value
|
|
150
|
+
});
|
|
151
|
+
}, 10);
|
|
152
|
+
}, _ = p(() => [
|
|
139
153
|
"w-full flex flex-col",
|
|
140
154
|
a.variant === "raised" ? "bg-background shadow-sm p-2 rounded-lg" : "bg-background rounded",
|
|
141
155
|
"overflow-hidden",
|
|
142
156
|
a.bordered ? "border border-border" : "",
|
|
143
157
|
a.class
|
|
144
|
-
].join(" ")),
|
|
145
|
-
return
|
|
158
|
+
].join(" ")), ee = p(() => ["w-full caption-bottom -text-fs-1", a.tableClass].join(" ")), te = (e) => e.width ? e.width : "auto";
|
|
159
|
+
return h(
|
|
146
160
|
() => a.rows,
|
|
147
161
|
() => {
|
|
148
162
|
const e = new Set(a.rows.map((t) => c(t, a.keyField)));
|
|
149
163
|
o.value = new Set([...o.value].filter((t) => e.has(t)));
|
|
150
164
|
}
|
|
151
|
-
),
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
modelValue:
|
|
156
|
-
"onUpdate:modelValue": t[1] || (t[1] = (s) => p.value = s),
|
|
165
|
+
), (e, t) => (n(), i("div", me, [
|
|
166
|
+
l.showSearch || e.$slots?.["toolbar-left"] || e.$slots?.["toolbar-right"] ? (n(), R(fe, {
|
|
167
|
+
key: 0,
|
|
168
|
+
modelValue: w.value,
|
|
169
|
+
"onUpdate:modelValue": t[1] || (t[1] = (s) => w.value = s),
|
|
157
170
|
"show-search": l.showSearch,
|
|
158
171
|
placeholder: l.searchPlaceholder,
|
|
159
172
|
class: S(l.toolbarClass),
|
|
160
173
|
"search-class": l.toolbarSearchClass
|
|
161
|
-
},
|
|
174
|
+
}, V({ _: 2 }, [
|
|
162
175
|
e.$slots?.["toolbar-left"] ? {
|
|
163
176
|
name: "left",
|
|
164
|
-
fn:
|
|
165
|
-
|
|
177
|
+
fn: B(() => [
|
|
178
|
+
x(e.$slots, "toolbar-left")
|
|
166
179
|
]),
|
|
167
180
|
key: "0"
|
|
168
181
|
} : void 0,
|
|
169
182
|
o.value.size > 0 ? {
|
|
170
183
|
name: "delete",
|
|
171
|
-
fn:
|
|
172
|
-
o.value.size > 0 ? (n(),
|
|
184
|
+
fn: B(() => [
|
|
185
|
+
o.value.size > 0 ? (n(), R(re, {
|
|
173
186
|
key: 0,
|
|
174
187
|
rounded: "full",
|
|
175
188
|
variant: "outline",
|
|
176
189
|
size: "lg",
|
|
177
190
|
icon: "lucide:trash-2",
|
|
178
|
-
onClick: t[0] || (t[0] = (s) =>
|
|
179
|
-
})) :
|
|
191
|
+
onClick: t[0] || (t[0] = (s) => C.value = !0)
|
|
192
|
+
})) : k("", !0)
|
|
180
193
|
]),
|
|
181
194
|
key: "1"
|
|
182
195
|
} : void 0,
|
|
183
196
|
e.$slots?.["toolbar-right"] ? {
|
|
184
197
|
name: "right",
|
|
185
|
-
fn:
|
|
186
|
-
|
|
198
|
+
fn: B(() => [
|
|
199
|
+
x(e.$slots, "toolbar-right")
|
|
187
200
|
]),
|
|
188
201
|
key: "2"
|
|
189
202
|
} : void 0
|
|
190
|
-
]), 1032, ["modelValue", "show-search", "placeholder", "class", "search-class"]),
|
|
203
|
+
]), 1032, ["modelValue", "show-search", "placeholder", "class", "search-class"])) : k("", !0),
|
|
191
204
|
r("div", {
|
|
192
|
-
class: S(
|
|
205
|
+
class: S(_.value)
|
|
193
206
|
}, [
|
|
194
207
|
r("div", he, [
|
|
195
208
|
r("table", {
|
|
196
|
-
class: S([
|
|
209
|
+
class: S([ee.value, "data-table"])
|
|
197
210
|
}, [
|
|
198
211
|
r("thead", {
|
|
199
212
|
class: S([
|
|
@@ -201,94 +214,94 @@ const fe = { class: "space-y-6.5" }, he = { class: "overflow-x-auto w-full" }, g
|
|
|
201
214
|
l.variant === "raised" ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
|
|
202
215
|
])
|
|
203
216
|
}, [
|
|
204
|
-
r("tr",
|
|
205
|
-
l.selectable ? (n(), i("th",
|
|
206
|
-
r("div",
|
|
207
|
-
|
|
208
|
-
"model-value":
|
|
209
|
-
indeterminate:
|
|
217
|
+
r("tr", ve, [
|
|
218
|
+
l.selectable ? (n(), i("th", ge, [
|
|
219
|
+
r("div", be, [
|
|
220
|
+
F(ne, {
|
|
221
|
+
"model-value": D.value,
|
|
222
|
+
indeterminate: j.value,
|
|
210
223
|
size: "xs",
|
|
211
|
-
"onUpdate:modelValue":
|
|
224
|
+
"onUpdate:modelValue": H
|
|
212
225
|
}, null, 8, ["model-value", "indeterminate"])
|
|
213
226
|
])
|
|
214
|
-
])) :
|
|
215
|
-
(n(!0), i(
|
|
227
|
+
])) : k("", !0),
|
|
228
|
+
(n(!0), i(T, null, I(l.headers, (s) => (n(), R(ce, {
|
|
216
229
|
key: s.field,
|
|
217
230
|
header: s,
|
|
218
231
|
"sort-config": d.value,
|
|
219
232
|
compact: l.compact,
|
|
220
233
|
"table-sortable": l.sortable,
|
|
221
|
-
onSort:
|
|
234
|
+
onSort: K,
|
|
222
235
|
class: "last:pr-5!",
|
|
223
|
-
style:
|
|
224
|
-
width:
|
|
236
|
+
style: M({
|
|
237
|
+
width: te(s)
|
|
225
238
|
})
|
|
226
239
|
}, null, 8, ["header", "sort-config", "compact", "table-sortable", "style"]))), 128))
|
|
227
240
|
])
|
|
228
241
|
], 2),
|
|
229
|
-
r("tbody",
|
|
230
|
-
|
|
242
|
+
r("tbody", ye, [
|
|
243
|
+
q.value ? (n(!0), i(T, { key: 0 }, I(Math.min(P.value, 15), (s) => (n(), i("tr", {
|
|
231
244
|
key: "skeleton-" + s,
|
|
232
245
|
class: "border-b border-border/70 bg-background transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
|
|
233
246
|
}, [
|
|
234
|
-
l.selectable ? (n(), i("td",
|
|
247
|
+
l.selectable ? (n(), i("td", we, [...t[4] || (t[4] = [
|
|
235
248
|
r("div", { class: "flex items-center justify-center" }, [
|
|
236
249
|
r("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
|
|
237
250
|
], -1)
|
|
238
|
-
])])) :
|
|
239
|
-
(n(!0), i(
|
|
251
|
+
])])) : k("", !0),
|
|
252
|
+
(n(!0), i(T, null, I(l.headers, (u) => (n(), i("td", {
|
|
240
253
|
key: u.field,
|
|
241
254
|
class: S(["p-5! align-middle last:pr-6!", [u.hideOnMobile ? "hidden md:table-cell" : ""]])
|
|
242
255
|
}, [
|
|
243
256
|
r("div", {
|
|
244
257
|
class: "rounded-md bg-muted/50 animate-pulse h-4 w-full",
|
|
245
|
-
style:
|
|
258
|
+
style: M({
|
|
246
259
|
width: `${50 + Math.random() * 40}%`
|
|
247
260
|
})
|
|
248
261
|
}, null, 4)
|
|
249
262
|
], 2))), 128))
|
|
250
|
-
]))), 128)) : l.rows.length > 0 ? (n(!0), i(
|
|
251
|
-
key:
|
|
263
|
+
]))), 128)) : l.rows.length > 0 ? (n(!0), i(T, { key: 1 }, I(l.rows, (s, u) => (n(), R(ue, {
|
|
264
|
+
key: N(s),
|
|
252
265
|
row: s,
|
|
253
266
|
headers: l.headers,
|
|
254
267
|
index: u,
|
|
255
268
|
"key-field": l.keyField,
|
|
256
269
|
selectable: l.selectable,
|
|
257
|
-
"is-selected": o.value.has(
|
|
270
|
+
"is-selected": o.value.has(N(s)),
|
|
258
271
|
hoverable: l.hoverable,
|
|
259
272
|
striped: l.striped,
|
|
260
273
|
compact: l.compact,
|
|
261
|
-
onSelect:
|
|
262
|
-
onRowClick:
|
|
274
|
+
onSelect: J,
|
|
275
|
+
onRowClick: Y,
|
|
263
276
|
class: "[&_td:last-child]:pr-3.5!"
|
|
264
|
-
},
|
|
265
|
-
|
|
266
|
-
name:
|
|
267
|
-
fn:
|
|
268
|
-
|
|
277
|
+
}, V({ _: 2 }, [
|
|
278
|
+
I(l.headers, (f) => ({
|
|
279
|
+
name: f.field,
|
|
280
|
+
fn: B((m) => [
|
|
281
|
+
x(e.$slots, f.field, U({ ref_for: !0 }, m))
|
|
269
282
|
])
|
|
270
283
|
}))
|
|
271
|
-
]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]))), 128)) : (n(), i("tr",
|
|
284
|
+
]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]))), 128)) : (n(), i("tr", pe, [
|
|
272
285
|
r("td", {
|
|
273
286
|
colspan: l.selectable ? l.headers.length + 1 : l.headers.length,
|
|
274
287
|
class: "h-96 text-center align-middle hover:bg-transparent"
|
|
275
288
|
}, [
|
|
276
289
|
r("div", Pe, [
|
|
277
290
|
r("div", Ce, [
|
|
278
|
-
|
|
291
|
+
F(oe, {
|
|
279
292
|
icon: l.emptyIcon,
|
|
280
293
|
class: "h-6 w-6 text-muted-foreground/80"
|
|
281
294
|
}, null, 8, ["icon"])
|
|
282
295
|
]),
|
|
283
|
-
r("h3",
|
|
284
|
-
r("p",
|
|
285
|
-
|
|
286
|
-
ae(
|
|
296
|
+
r("h3", Se, O(l.emptyTitle), 1),
|
|
297
|
+
r("p", xe, [
|
|
298
|
+
x(e.$slots, "empty-description", {}, () => [
|
|
299
|
+
ae(O(l.emptyDescription), 1)
|
|
287
300
|
])
|
|
288
301
|
]),
|
|
289
302
|
e.$slots["empty-action"] ? (n(), i("div", Ie, [
|
|
290
|
-
|
|
291
|
-
])) :
|
|
303
|
+
x(e.$slots, "empty-action")
|
|
304
|
+
])) : k("", !0)
|
|
292
305
|
])
|
|
293
306
|
], 8, ke)
|
|
294
307
|
]))
|
|
@@ -297,33 +310,29 @@ const fe = { class: "space-y-6.5" }, he = { class: "overflow-x-auto w-full" }, g
|
|
|
297
310
|
])
|
|
298
311
|
], 2),
|
|
299
312
|
l.showPagination && l.pageInfo && l.pageInfo.totalPages > 1 ? (n(), i("div", $e, [
|
|
300
|
-
|
|
301
|
-
"current-page":
|
|
313
|
+
F(se(de), U({
|
|
314
|
+
"current-page": v.value,
|
|
302
315
|
"total-pages": l.pageInfo.totalPages,
|
|
303
|
-
"
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
"
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
])) : $("", !0),
|
|
313
|
-
x(ie, {
|
|
314
|
-
show: P.value,
|
|
315
|
-
"onUpdate:show": t[2] || (t[2] = (s) => P.value = s),
|
|
316
|
+
"total-items": l.pageInfo.totalItems
|
|
317
|
+
}, l.paginationProps, {
|
|
318
|
+
onChange: Q,
|
|
319
|
+
"onUpdate:itemsPerPage": X
|
|
320
|
+
}), null, 16, ["current-page", "total-pages", "total-items"])
|
|
321
|
+
])) : k("", !0),
|
|
322
|
+
F(ie, {
|
|
323
|
+
show: C.value,
|
|
324
|
+
"onUpdate:show": t[2] || (t[2] = (s) => C.value = s),
|
|
316
325
|
title: "Confirm Deletion",
|
|
317
326
|
description: "Are you sure you want to delete the selected items?",
|
|
318
327
|
"confirm-text": "Delete",
|
|
319
328
|
"cancel-text": "Cancel",
|
|
320
329
|
variant: "danger",
|
|
321
|
-
onConfirm:
|
|
322
|
-
onCancel: t[3] || (t[3] = (s) =>
|
|
330
|
+
onConfirm: Z,
|
|
331
|
+
onCancel: t[3] || (t[3] = (s) => C.value = !1)
|
|
323
332
|
}, null, 8, ["show"])
|
|
324
333
|
]));
|
|
325
334
|
}
|
|
326
335
|
});
|
|
327
336
|
export {
|
|
328
|
-
|
|
337
|
+
Ae as default
|
|
329
338
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PageInfo, PaginationProps } from '../Pagination';
|
|
2
|
+
export type DataTablePaginationProps = Omit<PaginationProps, 'currentPage' | 'totalPages'>;
|
|
1
3
|
export interface PaginationConfig {
|
|
2
4
|
page: number;
|
|
3
5
|
limit: number;
|
|
@@ -34,12 +36,6 @@ export interface TableHeader {
|
|
|
34
36
|
addStatusColor?: boolean;
|
|
35
37
|
type?: 'text' | 'price' | 'date' | 'number';
|
|
36
38
|
}
|
|
37
|
-
export interface PageInfo {
|
|
38
|
-
currentPage: number;
|
|
39
|
-
totalPages: number;
|
|
40
|
-
totalItems: number;
|
|
41
|
-
itemsPerPage?: number;
|
|
42
|
-
}
|
|
43
39
|
export interface DataTableProps {
|
|
44
40
|
rows: any[];
|
|
45
41
|
selectedRows?: any[];
|
|
@@ -56,11 +52,8 @@ export interface DataTableProps {
|
|
|
56
52
|
emptyDescription?: string;
|
|
57
53
|
emptyIcon?: string;
|
|
58
54
|
showPagination?: boolean;
|
|
59
|
-
|
|
55
|
+
paginationProps?: DataTablePaginationProps;
|
|
60
56
|
pageInfo?: PageInfo;
|
|
61
|
-
itemsPerPage?: number;
|
|
62
|
-
itemsPerPageOptions?: number[];
|
|
63
|
-
showItemsPerPage?: boolean;
|
|
64
57
|
striped?: boolean;
|
|
65
58
|
hoverable?: boolean;
|
|
66
59
|
bordered?: boolean;
|
|
@@ -117,9 +117,6 @@ export interface IForm {
|
|
|
117
117
|
maxFileSize?: number;
|
|
118
118
|
/** Maximum number of files allowed when multiple is true */
|
|
119
119
|
maxFiles?: number;
|
|
120
|
-
/** i18n keys */
|
|
121
|
-
labelI8n?: string;
|
|
122
|
-
placeholderI8n?: string;
|
|
123
120
|
}
|
|
124
121
|
/**
|
|
125
122
|
* Timeline step for multi-step forms
|
|
@@ -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;
|