vlite3 1.4.35 → 1.4.37
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/CategoryManager/CategoryManager.vue2.js +4 -4
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/DataTable/DataTable.vue.d.ts +4 -1
- package/components/DataTable/DataTable.vue.js +322 -205
- package/components/DataTable/DataTableRow.vue.d.ts +21 -0
- package/components/DataTable/DataTableRow.vue.js +137 -73
- package/components/DataTable/types.d.ts +30 -0
- package/components/DataTable/useDataTableTree.d.ts +24 -0
- package/components/DataTable/useDataTableTree.js +137 -0
- package/components/FileTree/FileTree.vue.js +1 -1
- package/components/FileTree/FileTree.vue2.js +59 -57
- package/components/FileTree/FileTreeNode.vue.d.ts +6 -0
- package/components/FileTree/FileTreeNode.vue.js +112 -103
- package/components/Form/{AccordionView.vue.js → AccordionView.vue2.js} +1 -1
- package/components/Form/index.vue2.js +1 -1
- package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
- package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
- package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
- package/components/Screen/ScreenFilter.vue.js +4 -4
- package/components/TreeConnectors/TreeConnectors.vue.d.ts +27 -0
- package/components/TreeConnectors/TreeConnectors.vue.js +44 -0
- package/components/TreeConnectors/TreeConnectors.vue2.js +4 -0
- package/components/TreeConnectors/geometry.d.ts +64 -0
- package/components/TreeConnectors/geometry.js +55 -0
- package/components/TreeConnectors/index.d.ts +3 -0
- package/components/index.d.ts +1 -0
- package/package.json +1 -1
- package/style.css +1 -1
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
- /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
- /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { defineComponent as ze, inject as $e, computed as u, toRef as _, ref as B, watch as D, openBlock as r, createElementBlock as m, createElementVNode as h, normalizeClass as p, unref as d, createCommentVNode as E, Fragment as R, renderList as I, normalizeStyle as K, createVNode as W, createBlock as ee, isMemoSame as te, createSlots as le, withCtx as ne, renderSlot as U, mergeProps as ae } from "vue";
|
|
2
|
+
import We from "../CheckBox.vue.js";
|
|
3
|
+
import Le from "../ConfirmationModal.vue.js";
|
|
4
|
+
import Ve from "../Pagination/Pagination.vue.js";
|
|
5
|
+
import Fe from "../Empty/Empty.vue.js";
|
|
6
|
+
import Ae from "./DataTableHeader.vue.js";
|
|
7
|
+
import Me from "./DataTableRow.vue.js";
|
|
8
|
+
import { useDataTableTree as Ne } from "./useDataTableTree.js";
|
|
9
|
+
import { $t as P } from "../../utils/i18n.js";
|
|
10
|
+
import { SCREEN_CONTEXT_KEY as je } from "./types.js";
|
|
11
|
+
const Ke = { class: "space-y-6.5" }, Ue = { key: 0 }, Oe = {
|
|
12
|
+
key: 0,
|
|
13
|
+
style: { width: "40px" }
|
|
14
|
+
}, Ye = { class: "hover:bg-transparent" }, Xe = {
|
|
11
15
|
key: 0,
|
|
12
16
|
scope: "col",
|
|
13
17
|
class: "w-[40px] px-0 text-center font-medium text-muted-foreground",
|
|
14
18
|
style: { width: "40px" }
|
|
15
|
-
},
|
|
19
|
+
}, qe = { class: "flex items-center justify-center" }, Ge = { class: "[&_tr:last-child]:border-0" }, He = {
|
|
16
20
|
key: 0,
|
|
17
21
|
class: "w-[48px] px-0 py-4 align-middle text-center",
|
|
18
22
|
style: { width: "48px" }
|
|
19
|
-
},
|
|
23
|
+
}, Je = { key: 2 }, Qe = ["colspan"], Ze = { key: 0 }, dt = /* @__PURE__ */ ze({
|
|
20
24
|
__name: "DataTable",
|
|
21
25
|
props: {
|
|
22
26
|
rows: { default: () => [] },
|
|
@@ -49,286 +53,399 @@ const xe = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, I
|
|
|
49
53
|
sortable: { type: Boolean, default: !1 },
|
|
50
54
|
variant: { default: "default" },
|
|
51
55
|
headerVariant: { default: "default" },
|
|
52
|
-
size: { default: "md" }
|
|
56
|
+
size: { default: "md" },
|
|
57
|
+
loadChildren: {},
|
|
58
|
+
treeIndent: { default: 20 }
|
|
53
59
|
},
|
|
54
|
-
emits: ["change", "select", "rowClick", "update:itemsPerPage", "update:selectedRows", "delete"],
|
|
55
|
-
setup(
|
|
56
|
-
const
|
|
60
|
+
emits: ["change", "select", "rowClick", "update:itemsPerPage", "update:selectedRows", "delete", "expand"],
|
|
61
|
+
setup(n, { emit: oe }) {
|
|
62
|
+
const se = (e, t) => {
|
|
57
63
|
if (!(!e || !t))
|
|
58
|
-
return t.includes(".") ? t.split(".").reduce((l,
|
|
59
|
-
},
|
|
64
|
+
return t.includes(".") ? t.split(".").reduce((l, o) => l?.[o], e) : e[t];
|
|
65
|
+
}, g = (e, t) => se(e, t), ie = (e, t) => {
|
|
60
66
|
const l = ["id", "_id"];
|
|
61
67
|
if (t && t !== "auto") return t;
|
|
62
68
|
if (e && e.length > 0) {
|
|
63
|
-
for (const
|
|
64
|
-
if (
|
|
69
|
+
for (const o of l)
|
|
70
|
+
if (o in e[0]) return o;
|
|
65
71
|
}
|
|
66
72
|
return "_id";
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
}, re = (e) => e.sortKey || e.field, a = n, y = oe, L = $e(je, null), S = u(() => a.hideSelectable ? !1 : L ? L.forceSelectable : !0), v = u(() => ie(a.rows, a.keyField)), {
|
|
74
|
+
isTreeMode: b,
|
|
75
|
+
flattenVisibleRows: O,
|
|
76
|
+
allLoadedRows: z,
|
|
77
|
+
isExpandable: Y,
|
|
78
|
+
isExpanded: X,
|
|
79
|
+
isLoading: q,
|
|
80
|
+
collectDescendantIds: G,
|
|
81
|
+
toggleExpand: de,
|
|
82
|
+
pruneStaleTreeState: ce,
|
|
83
|
+
getChildren: V
|
|
84
|
+
} = Ne({
|
|
85
|
+
rows: _(a, "rows"),
|
|
86
|
+
keyField: v,
|
|
87
|
+
loadChildren: _(a, "loadChildren"),
|
|
88
|
+
getRowId: g,
|
|
89
|
+
onExpand: (e) => y("expand", e)
|
|
90
|
+
}), x = B({ field: "", order: "" }), T = B(
|
|
91
|
+
a.pageInfo?.itemsPerPage || a.paginationProps?.itemsPerPage || 10
|
|
92
|
+
), C = B(a.pageInfo?.currentPage || 1), $ = B(!1), ue = u(() => a.loading);
|
|
93
|
+
D(
|
|
94
|
+
() => a.pageInfo?.itemsPerPage,
|
|
72
95
|
(e) => {
|
|
73
|
-
e !== void 0 && (
|
|
96
|
+
e !== void 0 && (T.value = e);
|
|
74
97
|
}
|
|
75
|
-
),
|
|
76
|
-
() =>
|
|
98
|
+
), D(
|
|
99
|
+
() => a.paginationProps?.itemsPerPage,
|
|
77
100
|
(e) => {
|
|
78
|
-
e !== void 0 && (
|
|
101
|
+
e !== void 0 && (T.value = e);
|
|
79
102
|
}
|
|
80
|
-
),
|
|
81
|
-
() =>
|
|
103
|
+
), D(
|
|
104
|
+
() => a.pageInfo?.currentPage,
|
|
82
105
|
(e) => {
|
|
83
|
-
e && (
|
|
106
|
+
e && (C.value = e);
|
|
84
107
|
}
|
|
85
108
|
);
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
() =>
|
|
109
|
+
const i = B(/* @__PURE__ */ new Set());
|
|
110
|
+
D(
|
|
111
|
+
() => a.selectedRows,
|
|
89
112
|
(e) => {
|
|
90
|
-
const t = new Set((e || []).map((l) =>
|
|
91
|
-
(t.size !==
|
|
113
|
+
const t = new Set((e || []).map((l) => g(l, v.value)));
|
|
114
|
+
(t.size !== i.value.size || [...t].some((l) => !i.value.has(l))) && (i.value = t);
|
|
92
115
|
},
|
|
93
116
|
{ immediate: !0, deep: !0 }
|
|
94
117
|
);
|
|
95
|
-
const
|
|
96
|
-
()
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const s
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
const F = u(() => {
|
|
119
|
+
if (!b.value) return a.rows;
|
|
120
|
+
const e = [], t = (l) => {
|
|
121
|
+
for (const o of l) {
|
|
122
|
+
e.push(o);
|
|
123
|
+
for (const c of V(o)) t([c]);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
return t(a.rows), e;
|
|
127
|
+
}), A = u(() => {
|
|
128
|
+
const e = F.value;
|
|
129
|
+
return e.length > 0 && e.every((t) => i.value.has(g(t, v.value)));
|
|
130
|
+
}), H = u(() => i.value.size > 0 && !A.value), me = u(() => {
|
|
131
|
+
const e = new Map(z.value);
|
|
132
|
+
return (a.selectedRows || []).forEach((t) => e.set(g(t, v.value), t)), a.rows.forEach((t) => e.set(g(t, v.value), t)), Array.from(i.value).map((t) => e.get(t)).filter(Boolean);
|
|
133
|
+
}), J = (e) => {
|
|
134
|
+
const t = (o, c) => {
|
|
135
|
+
for (const s of o) {
|
|
136
|
+
const f = g(s, v.value);
|
|
137
|
+
if (f === e) return { found: !0, parentId: c };
|
|
138
|
+
const w = t(V(s), f);
|
|
139
|
+
if (w.found) return w;
|
|
140
|
+
}
|
|
141
|
+
return { found: !1, parentId: null };
|
|
142
|
+
}, l = t(a.rows, null);
|
|
143
|
+
return l.found ? l.parentId : null;
|
|
144
|
+
}, Q = (e) => {
|
|
145
|
+
if (!b.value) return !1;
|
|
146
|
+
const t = G(e);
|
|
147
|
+
if (!t.length) return !1;
|
|
148
|
+
let l = 0;
|
|
149
|
+
for (const o of t)
|
|
150
|
+
i.value.has(o) && l++;
|
|
151
|
+
return l > 0 && l < t.length;
|
|
152
|
+
}, fe = (e, t) => {
|
|
153
|
+
let l = J(e);
|
|
154
|
+
for (; l != null; ) {
|
|
155
|
+
const o = z.value.get(l);
|
|
156
|
+
if (!o) break;
|
|
157
|
+
const c = V(o).map((f) => g(f, v.value));
|
|
158
|
+
c.length > 0 && c.every((f) => t.has(f)) ? t.add(l) : t.delete(l), l = J(l);
|
|
159
|
+
}
|
|
160
|
+
}, ve = (e) => {
|
|
161
|
+
const t = new Set(i.value);
|
|
162
|
+
F.value.forEach((l) => {
|
|
163
|
+
const o = g(l, v.value);
|
|
164
|
+
e ? t.add(o) : t.delete(o);
|
|
165
|
+
}), i.value = t, M();
|
|
166
|
+
}, he = (e) => {
|
|
167
|
+
const t = new Set(i.value), l = !t.has(e);
|
|
168
|
+
if (b.value) {
|
|
169
|
+
const o = z.value.get(e);
|
|
170
|
+
if (o) {
|
|
171
|
+
const c = (s, f) => {
|
|
172
|
+
f ? t.add(s) : t.delete(s);
|
|
173
|
+
};
|
|
174
|
+
c(e, l), G(o).forEach((s) => c(s, l)), fe(e, t), i.value = t, M();
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
t.has(e) ? t.delete(e) : t.add(e), i.value = t, M();
|
|
179
|
+
}, M = () => {
|
|
180
|
+
const e = /* @__PURE__ */ new Set(), t = [], l = (o) => {
|
|
181
|
+
const c = g(o, v.value);
|
|
182
|
+
i.value.has(c) && !e.has(c) && (t.push(o), e.add(c));
|
|
183
|
+
};
|
|
184
|
+
F.value.forEach(l), (a.selectedRows || []).forEach(l), y("select", {
|
|
115
185
|
selected: t,
|
|
116
|
-
all:
|
|
117
|
-
indeterminate:
|
|
118
|
-
}),
|
|
119
|
-
},
|
|
120
|
-
const t =
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
|
|
186
|
+
all: A.value,
|
|
187
|
+
indeterminate: H.value
|
|
188
|
+
}), y("update:selectedRows", t);
|
|
189
|
+
}, ge = (e) => {
|
|
190
|
+
const t = a.headers.find((o) => o.field === e), l = t ? re(t) : e;
|
|
191
|
+
x.value.field === l ? x.value.order = x.value.order === "asc" ? "desc" : "asc" : (x.value.field = l, x.value.order = "asc"), C.value = 1, j();
|
|
192
|
+
}, be = (e) => {
|
|
193
|
+
C.value = e, j();
|
|
194
|
+
}, we = (e) => {
|
|
195
|
+
T.value = e, C.value = 1, y("update:itemsPerPage", e), j();
|
|
196
|
+
}, pe = (e) => y("rowClick", e), ye = () => {
|
|
197
|
+
y("delete", me.value), $.value = !1;
|
|
128
198
|
};
|
|
129
|
-
let
|
|
130
|
-
const
|
|
131
|
-
|
|
199
|
+
let N = null;
|
|
200
|
+
const j = () => {
|
|
201
|
+
N && clearTimeout(N), N = setTimeout(() => {
|
|
132
202
|
const e = {
|
|
133
|
-
pagination: { page:
|
|
134
|
-
sort: { ...
|
|
203
|
+
pagination: { page: C.value, limit: T.value },
|
|
204
|
+
sort: { ...x.value },
|
|
135
205
|
filter: {}
|
|
136
206
|
};
|
|
137
|
-
|
|
207
|
+
y("change", e), L?.onTableChange?.(e);
|
|
138
208
|
}, 10);
|
|
139
209
|
};
|
|
140
|
-
|
|
141
|
-
() =>
|
|
210
|
+
D(
|
|
211
|
+
() => a.rows,
|
|
142
212
|
() => {
|
|
143
|
-
|
|
144
|
-
|
|
213
|
+
ce();
|
|
214
|
+
const e = new Set(z.value.keys());
|
|
215
|
+
(a.selectedRows || []).forEach((t) => {
|
|
216
|
+
e.add(g(t, v.value));
|
|
217
|
+
}), i.value = new Set([...i.value].filter((t) => e.has(t)));
|
|
145
218
|
}
|
|
146
219
|
);
|
|
147
|
-
const
|
|
220
|
+
const xe = u(() => [
|
|
148
221
|
"w-full flex flex-col",
|
|
149
|
-
|
|
222
|
+
a.variant === "raised" ? "bg-background shadow-sm p-2 rounded-lg" : "bg-background rounded",
|
|
150
223
|
"overflow-hidden",
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
].join(" ")),
|
|
224
|
+
a.bordered ? "border border-border" : "",
|
|
225
|
+
a.class
|
|
226
|
+
].join(" ")), Se = u(() => {
|
|
227
|
+
const e = a.cellBordered ? "[&>thead>tr>th:not(:last-child)]:border-r [&>thead>tr>th]:border-border [&>tbody>tr>td:not(:last-child)]:border-r [&>tbody>tr>td]:border-border [&>tbody>tr>th:not(:last-child)]:border-r [&>tbody>tr>th]:border-border" : "";
|
|
228
|
+
return [
|
|
229
|
+
"w-full caption-bottom -text-fs-1",
|
|
230
|
+
b.value ? "table-fixed" : "",
|
|
231
|
+
e,
|
|
232
|
+
a.tableClass
|
|
233
|
+
].join(" ");
|
|
234
|
+
}), Ce = (e) => {
|
|
235
|
+
const t = {};
|
|
236
|
+
return e.width && !/(?:^|\s|:)w-/.test(e.width) && (t.width = e.width), e.minWidth && !/(?:^|\s|:)min-w-/.test(e.minWidth) && (b.value && !t.width ? t.width = e.minWidth : t.minWidth = e.minWidth), t;
|
|
237
|
+
}, ke = (e) => {
|
|
154
238
|
const t = {};
|
|
155
|
-
return e.width && !/(?:^|\s|:)w-/.test(e.width)
|
|
156
|
-
},
|
|
239
|
+
return e.width && !/(?:^|\s|:)w-/.test(e.width) ? t.width = e.width : e.minWidth && !/(?:^|\s|:)min-w-/.test(e.minWidth) && (t.width = e.minWidth), t;
|
|
240
|
+
}, Z = (e) => {
|
|
157
241
|
const t = [];
|
|
158
242
|
return e.width && /(?:^|\s|:)w-/.test(e.width) && t.push(e.width), e.minWidth && /(?:^|\s|:)min-w-/.test(e.minWidth) && t.push(e.minWidth), t.join(" ");
|
|
159
|
-
},
|
|
160
|
-
() =>
|
|
161
|
-
),
|
|
162
|
-
() =>
|
|
163
|
-
),
|
|
164
|
-
const e =
|
|
243
|
+
}, Ie = u(
|
|
244
|
+
() => a.emptyTitleI18n ? P(a.emptyTitleI18n) : a.emptyTitle
|
|
245
|
+
), Pe = u(
|
|
246
|
+
() => a.emptyDescriptionI18n ? P(a.emptyDescriptionI18n) : a.emptyDescription
|
|
247
|
+
), Te = u(() => {
|
|
248
|
+
const e = P("vlite.dataTable.confirmDeleteTitle");
|
|
165
249
|
return e !== "vlite.dataTable.confirmDeleteTitle" ? e : "Confirm Deletion";
|
|
166
|
-
}),
|
|
167
|
-
const e =
|
|
250
|
+
}), Be = u(() => {
|
|
251
|
+
const e = P("vlite.dataTable.confirmDeleteDesc");
|
|
168
252
|
return e !== "vlite.dataTable.confirmDeleteDesc" ? e : "Are you sure you want to delete the selected items?";
|
|
169
|
-
}),
|
|
170
|
-
const e =
|
|
253
|
+
}), De = u(() => {
|
|
254
|
+
const e = P("vlite.dataTable.deleteBtn");
|
|
171
255
|
return e !== "vlite.dataTable.deleteBtn" ? e : "Delete";
|
|
172
|
-
}),
|
|
173
|
-
const e =
|
|
256
|
+
}), Ee = u(() => {
|
|
257
|
+
const e = P("vlite.dataTable.cancelBtn");
|
|
174
258
|
return e !== "vlite.dataTable.cancelBtn" ? e : "Cancel";
|
|
175
259
|
});
|
|
176
|
-
return (e, t) => (
|
|
177
|
-
|
|
178
|
-
class:
|
|
260
|
+
return (e, t) => (r(), m("div", Ke, [
|
|
261
|
+
h("div", {
|
|
262
|
+
class: p(xe.value)
|
|
179
263
|
}, [
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
264
|
+
h("div", {
|
|
265
|
+
class: p(["overflow-x-auto w-full", d(b) ? "[scrollbar-gutter:stable]" : ""])
|
|
266
|
+
}, [
|
|
267
|
+
h("table", {
|
|
268
|
+
class: p([Se.value, "data-table"])
|
|
183
269
|
}, [
|
|
184
|
-
m("
|
|
185
|
-
|
|
270
|
+
d(b) ? (r(), m("colgroup", Ue, [
|
|
271
|
+
S.value ? (r(), m("col", Oe)) : E("", !0),
|
|
272
|
+
(r(!0), m(R, null, I(n.headers, (l) => (r(), m("col", {
|
|
273
|
+
key: "col-" + l.field,
|
|
274
|
+
class: p(Z(l)),
|
|
275
|
+
style: K(ke(l))
|
|
276
|
+
}, null, 6))), 128))
|
|
277
|
+
])) : E("", !0),
|
|
278
|
+
h("thead", {
|
|
279
|
+
class: p([
|
|
186
280
|
"[&_tr]:border-b [&_tr]:border-border",
|
|
187
|
-
|
|
188
|
-
|
|
281
|
+
n.headerVariant === "minimal" ? "bg-transparent" : "bg-accent",
|
|
282
|
+
n.variant === "raised" ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
|
|
189
283
|
])
|
|
190
284
|
}, [
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
"model-value":
|
|
196
|
-
indeterminate:
|
|
285
|
+
h("tr", Ye, [
|
|
286
|
+
S.value ? (r(), m("th", Xe, [
|
|
287
|
+
h("div", qe, [
|
|
288
|
+
W(We, {
|
|
289
|
+
"model-value": A.value,
|
|
290
|
+
indeterminate: H.value,
|
|
197
291
|
size: "xs",
|
|
198
|
-
"onUpdate:modelValue":
|
|
292
|
+
"onUpdate:modelValue": ve
|
|
199
293
|
}, null, 8, ["model-value", "indeterminate"])
|
|
200
294
|
])
|
|
201
|
-
])) :
|
|
202
|
-
(
|
|
295
|
+
])) : E("", !0),
|
|
296
|
+
(r(!0), m(R, null, I(n.headers, (l) => (r(), ee(Ae, {
|
|
203
297
|
key: l.field,
|
|
204
298
|
header: l,
|
|
205
|
-
"sort-config":
|
|
206
|
-
compact:
|
|
207
|
-
size:
|
|
208
|
-
"table-sortable":
|
|
209
|
-
"cell-bordered":
|
|
210
|
-
onSort:
|
|
211
|
-
class:
|
|
212
|
-
|
|
299
|
+
"sort-config": x.value,
|
|
300
|
+
compact: n.compact,
|
|
301
|
+
size: n.size,
|
|
302
|
+
"table-sortable": n.sortable,
|
|
303
|
+
"cell-bordered": n.cellBordered,
|
|
304
|
+
onSort: ge,
|
|
305
|
+
class: p([
|
|
306
|
+
n.cellBordered ? "" : "last:pr-5!",
|
|
307
|
+
Z(l),
|
|
308
|
+
d(b) ? "min-w-0! max-w-none!" : ""
|
|
309
|
+
]),
|
|
310
|
+
style: K(Ce(l))
|
|
213
311
|
}, null, 8, ["header", "sort-config", "compact", "size", "table-sortable", "cell-bordered", "class", "style"]))), 128))
|
|
214
312
|
])
|
|
215
313
|
], 2),
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const
|
|
219
|
-
if (
|
|
220
|
-
const
|
|
314
|
+
h("tbody", Ge, [
|
|
315
|
+
ue.value ? (r(!0), m(R, { key: 0 }, I(Math.min(T.value, 15), (l, o, c, s) => {
|
|
316
|
+
const f = [];
|
|
317
|
+
if (s && s.key === "skeleton-" + l && te(s, f)) return s;
|
|
318
|
+
const w = (r(), m("tr", {
|
|
221
319
|
key: "skeleton-" + l,
|
|
222
320
|
class: "border-b border-border/70 bg-background transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
|
|
223
321
|
}, [
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
322
|
+
S.value ? (r(), m("td", He, [...t[6] || (t[6] = [
|
|
323
|
+
h("div", { class: "flex items-center justify-center" }, [
|
|
324
|
+
h("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
|
|
227
325
|
], -1)
|
|
228
|
-
])])) :
|
|
229
|
-
(
|
|
326
|
+
])])) : E("", !0),
|
|
327
|
+
(r(!0), m(R, null, I(n.headers, (k) => (r(), m("td", {
|
|
230
328
|
key: k.field,
|
|
231
|
-
class:
|
|
329
|
+
class: p(["align-middle", [
|
|
232
330
|
k.hideOnMobile ? "hidden md:table-cell" : "",
|
|
233
|
-
|
|
331
|
+
n.cellBordered ? "px-5! py-3!" : "p-5! last:pr-6!"
|
|
234
332
|
]])
|
|
235
333
|
}, [
|
|
236
|
-
|
|
334
|
+
h("div", {
|
|
237
335
|
class: "rounded-md bg-muted/50 animate-pulse h-4",
|
|
238
|
-
style:
|
|
336
|
+
style: K({ width: `${50 + Math.random() * 40}%` })
|
|
239
337
|
}, null, 4)
|
|
240
338
|
], 2))), 128))
|
|
241
339
|
]));
|
|
242
|
-
return
|
|
243
|
-
}, t, 0), 128)) :
|
|
244
|
-
const
|
|
245
|
-
l,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
340
|
+
return w.memo = f, w;
|
|
341
|
+
}, t, 0), 128)) : d(O).length > 0 ? (r(!0), m(R, { key: 1 }, I(d(O), (l, o, c, s) => {
|
|
342
|
+
const f = [
|
|
343
|
+
l.row,
|
|
344
|
+
i.value.has(l.id),
|
|
345
|
+
Q(l.row),
|
|
346
|
+
S.value,
|
|
347
|
+
n.compact,
|
|
348
|
+
n.size,
|
|
349
|
+
n.striped,
|
|
350
|
+
n.hoverable,
|
|
351
|
+
n.cellBordered,
|
|
352
|
+
d(b),
|
|
353
|
+
l.depth,
|
|
354
|
+
l.isLastSibling,
|
|
355
|
+
l.ancestorLastFlags,
|
|
356
|
+
d(X)(l.id),
|
|
357
|
+
d(q)(l.id),
|
|
358
|
+
d(Y)(l.row),
|
|
359
|
+
n.treeIndent
|
|
253
360
|
];
|
|
254
|
-
if (
|
|
255
|
-
const
|
|
256
|
-
key:
|
|
257
|
-
row: l,
|
|
258
|
-
headers:
|
|
259
|
-
index:
|
|
260
|
-
"key-field":
|
|
261
|
-
selectable:
|
|
262
|
-
"is-selected":
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
361
|
+
if (s && s.key === l.id && te(s, f)) return s;
|
|
362
|
+
const w = (r(), ee(Me, {
|
|
363
|
+
key: l.id,
|
|
364
|
+
row: l.row,
|
|
365
|
+
headers: n.headers,
|
|
366
|
+
index: l.index,
|
|
367
|
+
"key-field": v.value,
|
|
368
|
+
selectable: S.value,
|
|
369
|
+
"is-selected": i.value.has(l.id),
|
|
370
|
+
"is-indeterminate": Q(l.row),
|
|
371
|
+
hoverable: n.hoverable,
|
|
372
|
+
striped: n.striped,
|
|
373
|
+
compact: n.compact,
|
|
374
|
+
size: n.size,
|
|
375
|
+
"cell-bordered": n.cellBordered,
|
|
376
|
+
"tree-mode": d(b),
|
|
377
|
+
depth: l.depth,
|
|
378
|
+
"tree-indent": n.treeIndent,
|
|
379
|
+
expandable: d(Y)(l.row),
|
|
380
|
+
expanded: d(X)(l.id),
|
|
381
|
+
"tree-loading": d(q)(l.id),
|
|
382
|
+
"is-last-sibling": l.isLastSibling,
|
|
383
|
+
"ancestor-last-flags": l.ancestorLastFlags,
|
|
384
|
+
onSelect: he,
|
|
385
|
+
onRowClick: pe,
|
|
386
|
+
onToggleExpand: (k) => d(de)(l.row, l.depth),
|
|
387
|
+
class: p(n.cellBordered ? "" : "[&_td:last-child]:pr-5!")
|
|
388
|
+
}, le({ _: 2 }, [
|
|
389
|
+
I(n.headers, (k) => ({
|
|
273
390
|
name: k.field,
|
|
274
|
-
fn:
|
|
275
|
-
|
|
391
|
+
fn: ne((Re) => [
|
|
392
|
+
U(e.$slots, k.field, ae({ ref_for: !0 }, Re))
|
|
276
393
|
])
|
|
277
394
|
}))
|
|
278
|
-
]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact", "size", "cell-bordered", "class"]));
|
|
279
|
-
return
|
|
280
|
-
}, t, 2), 128)) : (
|
|
281
|
-
|
|
282
|
-
colspan:
|
|
395
|
+
]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "is-indeterminate", "hoverable", "striped", "compact", "size", "cell-bordered", "tree-mode", "depth", "tree-indent", "expandable", "expanded", "tree-loading", "is-last-sibling", "ancestor-last-flags", "onToggleExpand", "class"]));
|
|
396
|
+
return w.memo = f, w;
|
|
397
|
+
}, t, 2), 128)) : (r(), m("tr", Je, [
|
|
398
|
+
h("td", {
|
|
399
|
+
colspan: S.value ? n.headers.length + 1 : n.headers.length,
|
|
283
400
|
class: "align-middle hover:bg-transparent"
|
|
284
401
|
}, [
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
title:
|
|
288
|
-
description:
|
|
289
|
-
icon:
|
|
402
|
+
U(e.$slots, "empty", {}, () => [
|
|
403
|
+
W(d(Fe), {
|
|
404
|
+
title: Ie.value,
|
|
405
|
+
description: Pe.value,
|
|
406
|
+
icon: n.emptyIcon,
|
|
290
407
|
variant: "variant12",
|
|
291
408
|
class: "bg-transparent! py-8!"
|
|
292
|
-
},
|
|
409
|
+
}, le({ _: 2 }, [
|
|
293
410
|
e.$slots["empty-action"] ? {
|
|
294
411
|
name: "action",
|
|
295
|
-
fn:
|
|
296
|
-
|
|
412
|
+
fn: ne(() => [
|
|
413
|
+
U(e.$slots, "empty-action")
|
|
297
414
|
]),
|
|
298
415
|
key: "0"
|
|
299
416
|
} : void 0
|
|
300
417
|
]), 1032, ["title", "description", "icon"])
|
|
301
418
|
])
|
|
302
|
-
], 8,
|
|
419
|
+
], 8, Qe)
|
|
303
420
|
]))
|
|
304
421
|
])
|
|
305
422
|
], 2)
|
|
306
|
-
])
|
|
423
|
+
], 2)
|
|
307
424
|
], 2),
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
"current-page":
|
|
311
|
-
"total-pages":
|
|
312
|
-
"total-items":
|
|
313
|
-
},
|
|
314
|
-
onChange:
|
|
315
|
-
"onUpdate:itemsPerPage":
|
|
425
|
+
n.showPagination && n.pageInfo && n.pageInfo.totalPages > 1 ? (r(), m("div", Ze, [
|
|
426
|
+
W(d(Ve), ae({
|
|
427
|
+
"current-page": C.value,
|
|
428
|
+
"total-pages": n.pageInfo.totalPages,
|
|
429
|
+
"total-items": n.pageInfo.totalItems
|
|
430
|
+
}, n.paginationProps, {
|
|
431
|
+
onChange: be,
|
|
432
|
+
"onUpdate:itemsPerPage": we
|
|
316
433
|
}), null, 16, ["current-page", "total-pages", "total-items"])
|
|
317
|
-
])) :
|
|
318
|
-
|
|
319
|
-
show:
|
|
320
|
-
"onUpdate:show": t[4] || (t[4] = (l) =>
|
|
321
|
-
title:
|
|
322
|
-
description:
|
|
323
|
-
"confirm-text":
|
|
324
|
-
"cancel-text":
|
|
434
|
+
])) : E("", !0),
|
|
435
|
+
W(Le, {
|
|
436
|
+
show: $.value,
|
|
437
|
+
"onUpdate:show": t[4] || (t[4] = (l) => $.value = l),
|
|
438
|
+
title: Te.value,
|
|
439
|
+
description: Be.value,
|
|
440
|
+
"confirm-text": De.value,
|
|
441
|
+
"cancel-text": Ee.value,
|
|
325
442
|
variant: "danger",
|
|
326
|
-
onConfirm:
|
|
327
|
-
onCancel: t[5] || (t[5] = (l) =>
|
|
443
|
+
onConfirm: ye,
|
|
444
|
+
onCancel: t[5] || (t[5] = (l) => $.value = !1)
|
|
328
445
|
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text"])
|
|
329
446
|
]));
|
|
330
447
|
}
|
|
331
448
|
});
|
|
332
449
|
export {
|
|
333
|
-
|
|
450
|
+
dt as default
|
|
334
451
|
};
|