vlite3 1.5.6 → 1.5.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/ButtonGroup.vue.js +2 -2
- package/components/CategoryManager/CategoryManager.vue2.js +3 -3
- package/components/Chip/Chip.vue.d.ts +1 -0
- package/components/Chip/Chip.vue.js +67 -36
- package/components/Chip/types.d.ts +5 -1
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
- package/components/DataTable/DataTable.vue.d.ts +12 -3
- package/components/DataTable/DataTable.vue.js +5 -586
- package/components/DataTable/DataTable.vue2.js +711 -2
- package/components/DataTable/DataTableHeader.vue.d.ts +22 -0
- package/components/DataTable/DataTableHeader.vue.js +5 -58
- package/components/DataTable/DataTableHeader.vue2.js +106 -2
- package/components/DataTable/DataTableRow.vue.d.ts +13 -0
- package/components/DataTable/DataTableRow.vue.js +2 -2
- package/components/DataTable/DataTableRow.vue2.js +133 -123
- package/components/DataTable/dataTableColumnWidths.d.ts +91 -0
- package/components/DataTable/dataTableColumnWidths.js +82 -0
- package/components/DataTable/types.d.ts +48 -0
- package/components/DataTable/useDataTableColumnResize.d.ts +52 -0
- package/components/DataTable/useDataTableColumnResize.js +328 -0
- package/components/Form/{AccordionView.vue.js → AccordionView.vue2.js} +1 -1
- package/components/Form/index.vue2.js +1 -1
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +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 +3 -3
- package/components/StatusChip/StatusChip.vue.d.ts +6 -0
- package/components/StatusChip/StatusChip.vue.js +12 -10
- package/components/Tabes/Tabes.vue.js +3 -3
- package/components/Tabes/Tabes.vue2.js +241 -220
- package/components/Tabes/types.d.ts +3 -1
- package/package.json +1 -1
- package/style.css +17 -3
- package/utils/usePersistentState.d.ts +4 -1
- package/utils/usePersistentState.js +4 -3
- /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
- /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
|
@@ -1,588 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import Je from "../Pagination/Pagination.vue.js";
|
|
6
|
-
import ge from "../Empty/Empty.vue.js";
|
|
7
|
-
import Qe from "./DataTableHeader.vue.js";
|
|
8
|
-
import he from "./DataTableRow.vue.js";
|
|
9
|
-
import { useDataTableTree as Ze } from "./useDataTableTree.js";
|
|
10
|
-
import { getStackedVisibleHeaders as _e } from "./dataTableHeaders.js";
|
|
11
|
-
import { $t as z } from "../../utils/i18n.js";
|
|
12
|
-
import { SCREEN_CONTEXT_KEY as et } from "./types.js";
|
|
13
|
-
const tt = { class: "space-y-6.5" }, lt = {
|
|
14
|
-
key: 0,
|
|
15
|
-
class: "w-full min-w-0 space-y-3"
|
|
16
|
-
}, nt = { class: "flex items-center gap-2 px-3 py-3 border-b" }, st = {
|
|
17
|
-
key: 0,
|
|
18
|
-
class: "h-4 w-4 rounded-[4px] bg-muted animate-pulse"
|
|
19
|
-
}, at = { class: "flex flex-col gap-2.5 px-3 py-3" }, ot = {
|
|
20
|
-
key: 2,
|
|
21
|
-
class: "border rounded-lg bg-background"
|
|
22
|
-
}, it = { key: 0 }, dt = {
|
|
23
|
-
key: 0,
|
|
24
|
-
style: { width: "40px" }
|
|
25
|
-
}, rt = { class: "hover:bg-transparent" }, ct = {
|
|
26
|
-
key: 0,
|
|
27
|
-
scope: "col",
|
|
28
|
-
class: "w-[40px] px-0 text-center font-medium text-muted-foreground",
|
|
29
|
-
style: { width: "40px" }
|
|
30
|
-
}, ut = { class: "flex items-center justify-center" }, mt = { class: "[&_tr:last-child]:border-0" }, vt = {
|
|
31
|
-
key: 0,
|
|
32
|
-
class: "w-[48px] px-0 py-4 align-middle text-center",
|
|
33
|
-
style: { width: "48px" }
|
|
34
|
-
}, ft = { key: 2 }, gt = ["colspan"], ht = { key: 0 }, Dt = /* @__PURE__ */ Ue({
|
|
35
|
-
__name: "DataTable",
|
|
36
|
-
props: {
|
|
37
|
-
rows: { default: () => [] },
|
|
38
|
-
selectedRows: { default: () => [] },
|
|
39
|
-
headers: { default: () => [] },
|
|
40
|
-
keyField: { default: "auto" },
|
|
41
|
-
loading: { type: Boolean, default: !1 },
|
|
42
|
-
hideSelectable: { type: Boolean, default: !1 },
|
|
43
|
-
isRowSelectable: {},
|
|
44
|
-
emptyTitle: {},
|
|
45
|
-
emptyTitleI18n: {},
|
|
46
|
-
emptyDescription: {},
|
|
47
|
-
emptyDescriptionI18n: {},
|
|
48
|
-
emptyIcon: { default: "lucide:inbox" },
|
|
49
|
-
showPagination: { type: Boolean, default: !0 },
|
|
50
|
-
paginationProps: { default: () => ({
|
|
51
|
-
alignment: "between",
|
|
52
|
-
navType: "icon",
|
|
53
|
-
showItemsPerPage: !0,
|
|
54
|
-
itemsPerPageOptions: [10, 25, 50, 100],
|
|
55
|
-
showPageInfo: !1
|
|
56
|
-
}) },
|
|
57
|
-
pageInfo: {},
|
|
58
|
-
striped: { type: Boolean, default: !1 },
|
|
59
|
-
hoverable: { type: Boolean, default: !0 },
|
|
60
|
-
bordered: { type: Boolean, default: !0 },
|
|
61
|
-
cellBordered: { type: Boolean, default: !1 },
|
|
62
|
-
compact: { type: Boolean, default: !1 },
|
|
63
|
-
rounded: { type: Boolean, default: !0 },
|
|
64
|
-
tableClass: {},
|
|
65
|
-
class: {},
|
|
66
|
-
sortable: { type: Boolean, default: !1 },
|
|
67
|
-
variant: { default: "default" },
|
|
68
|
-
headerVariant: { default: "default" },
|
|
69
|
-
size: { default: "md" },
|
|
70
|
-
loadChildren: {},
|
|
71
|
-
treeIndent: { default: 20 },
|
|
72
|
-
responsive: { type: Boolean, default: !0 }
|
|
73
|
-
},
|
|
74
|
-
emits: ["change", "select", "rowClick", "update:itemsPerPage", "update:selectedRows", "delete", "expand"],
|
|
75
|
-
setup(n, { emit: be }) {
|
|
76
|
-
const we = (e, l) => {
|
|
77
|
-
if (!(!e || !l))
|
|
78
|
-
return l.includes(".") ? l.split(".").reduce((t, a) => t?.[a], e) : e[l];
|
|
79
|
-
}, w = (e, l) => we(e, l), ye = (e, l) => {
|
|
80
|
-
const t = ["id", "_id"];
|
|
81
|
-
if (l && l !== "auto") return l;
|
|
82
|
-
if (e && e.length > 0) {
|
|
83
|
-
for (const a of t)
|
|
84
|
-
if (a in e[0]) return a;
|
|
85
|
-
}
|
|
86
|
-
return "_id";
|
|
87
|
-
}, pe = (e) => e.sortKey || e.field, s = n, ke = Ye(Xe).smaller("md"), X = r(() => s.responsive && ke.value), xe = r(() => _e(s.headers)), P = be, q = Ke(et, null), p = r(() => s.hideSelectable ? !1 : q ? q.forceSelectable : !0), g = r(() => ye(s.rows, s.keyField)), y = (e) => s.isRowSelectable?.(e) !== !1, M = (e) => p.value && y(e), {
|
|
88
|
-
isTreeMode: h,
|
|
89
|
-
flattenVisibleRows: L,
|
|
90
|
-
allLoadedRows: S,
|
|
91
|
-
findParentId: ne,
|
|
92
|
-
isExpandable: A,
|
|
93
|
-
isExpanded: N,
|
|
94
|
-
isLoading: j,
|
|
95
|
-
collectDescendantIds: se,
|
|
96
|
-
toggleExpand: ae,
|
|
97
|
-
pruneStaleTreeState: Se,
|
|
98
|
-
getChildren: oe
|
|
99
|
-
} = Ze({
|
|
100
|
-
rows: fe(s, "rows"),
|
|
101
|
-
keyField: g,
|
|
102
|
-
loadChildren: fe(s, "loadChildren"),
|
|
103
|
-
getRowId: w,
|
|
104
|
-
onExpand: (e) => P("expand", e)
|
|
105
|
-
}), T = O({ field: "", order: "" }), R = O(
|
|
106
|
-
s.pageInfo?.itemsPerPage || s.paginationProps?.itemsPerPage || 10
|
|
107
|
-
), D = O(s.pageInfo?.currentPage || 1), U = O(!1), ie = r(() => s.loading);
|
|
108
|
-
V(
|
|
109
|
-
() => s.pageInfo?.itemsPerPage,
|
|
110
|
-
(e) => {
|
|
111
|
-
e !== void 0 && (R.value = e);
|
|
112
|
-
}
|
|
113
|
-
), V(
|
|
114
|
-
() => s.paginationProps?.itemsPerPage,
|
|
115
|
-
(e) => {
|
|
116
|
-
e !== void 0 && (R.value = e);
|
|
117
|
-
}
|
|
118
|
-
), V(
|
|
119
|
-
() => s.pageInfo?.currentPage,
|
|
120
|
-
(e) => {
|
|
121
|
-
e && (D.value = e);
|
|
122
|
-
}
|
|
123
|
-
);
|
|
124
|
-
const c = Oe(/* @__PURE__ */ new Set());
|
|
125
|
-
V(
|
|
126
|
-
() => s.selectedRows,
|
|
127
|
-
(e) => {
|
|
128
|
-
const l = new Set(
|
|
129
|
-
(e || []).filter(y).map((t) => w(t, g.value))
|
|
130
|
-
);
|
|
131
|
-
(l.size !== c.value.size || [...l].some((t) => !c.value.has(t))) && (c.value = l);
|
|
132
|
-
},
|
|
133
|
-
{ immediate: !0 }
|
|
134
|
-
);
|
|
135
|
-
const W = r(() => {
|
|
136
|
-
if (!h.value) return s.rows.filter(y);
|
|
137
|
-
const e = [], l = (t) => {
|
|
138
|
-
for (const a of t) {
|
|
139
|
-
y(a) && e.push(a);
|
|
140
|
-
for (const u of oe(a)) l([u]);
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
return l(s.rows), e;
|
|
144
|
-
}), G = r(() => {
|
|
145
|
-
const e = W.value;
|
|
146
|
-
return e.length > 0 && e.every((l) => c.value.has(w(l, g.value)));
|
|
147
|
-
}), Ce = r(() => W.value.length > 0), Ie = r(
|
|
148
|
-
() => W.value.filter(
|
|
149
|
-
(e) => c.value.has(w(e, g.value))
|
|
150
|
-
).length
|
|
151
|
-
), de = r(
|
|
152
|
-
() => Ie.value > 0 && !G.value
|
|
153
|
-
), Pe = r(() => {
|
|
154
|
-
const e = new Map(S.value);
|
|
155
|
-
return (s.selectedRows || []).forEach((l) => e.set(w(l, g.value), l)), s.rows.forEach((l) => e.set(w(l, g.value), l)), Array.from(c.value).map((l) => e.get(l)).filter(Boolean);
|
|
156
|
-
}), Te = (e) => {
|
|
157
|
-
if (!h.value) return !1;
|
|
158
|
-
const l = se(e).filter((a) => {
|
|
159
|
-
const u = S.value.get(a);
|
|
160
|
-
return u && y(u);
|
|
161
|
-
});
|
|
162
|
-
if (!l.length) return !1;
|
|
163
|
-
let t = 0;
|
|
164
|
-
for (const a of l)
|
|
165
|
-
c.value.has(a) && t++;
|
|
166
|
-
return t > 0 && t < l.length;
|
|
167
|
-
}, K = r(() => {
|
|
168
|
-
const e = /* @__PURE__ */ new Set();
|
|
169
|
-
if (!h.value) return e;
|
|
170
|
-
for (const l of L.value)
|
|
171
|
-
Te(l.row) && e.add(l.id);
|
|
172
|
-
return e;
|
|
173
|
-
}), Be = (e, l) => {
|
|
174
|
-
let t = ne(e);
|
|
175
|
-
for (; t != null; ) {
|
|
176
|
-
const a = S.value.get(t);
|
|
177
|
-
if (!a) break;
|
|
178
|
-
const u = oe(a).filter(y).map((v) => w(v, g.value)), m = u.length > 0 && u.every((v) => l.has(v));
|
|
179
|
-
y(a) && m ? l.add(t) : l.delete(t), t = ne(t);
|
|
180
|
-
}
|
|
181
|
-
}, Re = (e) => {
|
|
182
|
-
const l = new Set(c.value);
|
|
183
|
-
W.value.forEach((t) => {
|
|
184
|
-
const a = w(t, g.value);
|
|
185
|
-
e ? l.add(a) : l.delete(a);
|
|
186
|
-
}), c.value = l, J();
|
|
187
|
-
}, re = (e) => {
|
|
188
|
-
const l = S.value.get(e) || s.rows.find((u) => w(u, g.value) === e);
|
|
189
|
-
if (!l || !y(l)) return;
|
|
190
|
-
const t = new Set(c.value), a = !t.has(e);
|
|
191
|
-
if (h.value) {
|
|
192
|
-
const u = S.value.get(e);
|
|
193
|
-
if (u) {
|
|
194
|
-
const m = (v, k) => {
|
|
195
|
-
const b = S.value.get(v);
|
|
196
|
-
!b || !y(b) || (k ? t.add(v) : t.delete(v));
|
|
197
|
-
};
|
|
198
|
-
m(e, a), se(u).forEach((v) => m(v, a)), Be(e, t), c.value = t, J();
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
t.has(e) ? t.delete(e) : t.add(e), c.value = t, J();
|
|
203
|
-
}, J = () => {
|
|
204
|
-
const e = /* @__PURE__ */ new Set(), l = [], t = (a) => {
|
|
205
|
-
const u = w(a, g.value);
|
|
206
|
-
c.value.has(u) && !e.has(u) && (l.push(a), e.add(u));
|
|
207
|
-
};
|
|
208
|
-
W.value.forEach(t), (s.selectedRows || []).forEach(t), P("select", {
|
|
209
|
-
selected: l,
|
|
210
|
-
all: G.value,
|
|
211
|
-
indeterminate: de.value
|
|
212
|
-
}), P("update:selectedRows", l);
|
|
213
|
-
}, De = (e) => {
|
|
214
|
-
const l = s.headers.find((a) => a.field === e), t = l ? pe(l) : e;
|
|
215
|
-
T.value.field === t ? T.value.order = T.value.order === "asc" ? "desc" : "asc" : (T.value.field = t, T.value.order = "asc"), D.value = 1, Q();
|
|
216
|
-
}, Ee = (e) => {
|
|
217
|
-
D.value = e, Q();
|
|
218
|
-
}, $e = (e) => {
|
|
219
|
-
R.value = e, D.value = 1, P("update:itemsPerPage", e), Q();
|
|
220
|
-
}, ce = (e) => P("rowClick", e), ze = () => {
|
|
221
|
-
P("delete", Pe.value), U.value = !1;
|
|
222
|
-
};
|
|
223
|
-
let B = null;
|
|
224
|
-
const Q = () => {
|
|
225
|
-
B && clearTimeout(B), B = setTimeout(() => {
|
|
226
|
-
B = null;
|
|
227
|
-
const e = {
|
|
228
|
-
pagination: { page: D.value, limit: R.value },
|
|
229
|
-
sort: { ...T.value },
|
|
230
|
-
filter: {}
|
|
231
|
-
};
|
|
232
|
-
P("change", e), q?.onTableChange?.(e);
|
|
233
|
-
}, 10);
|
|
234
|
-
};
|
|
235
|
-
He(() => {
|
|
236
|
-
B && (clearTimeout(B), B = null);
|
|
237
|
-
}), V(
|
|
238
|
-
() => s.rows,
|
|
239
|
-
() => {
|
|
240
|
-
Se();
|
|
241
|
-
const e = new Set(S.value.keys());
|
|
242
|
-
(s.selectedRows || []).forEach((l) => {
|
|
243
|
-
y(l) && e.add(w(l, g.value));
|
|
244
|
-
}), c.value = new Set(
|
|
245
|
-
[...c.value].filter((l) => {
|
|
246
|
-
const t = S.value.get(l);
|
|
247
|
-
return e.has(l) && (!t || y(t));
|
|
248
|
-
})
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
);
|
|
252
|
-
const Le = r(() => {
|
|
253
|
-
const e = s.variant === "raised", l = s.rounded ? e ? "rounded-lg" : "rounded" : "rounded-none";
|
|
254
|
-
return [
|
|
255
|
-
"w-full flex flex-col",
|
|
256
|
-
e ? `bg-background shadow-sm p-2 ${l}` : `bg-background ${l}`,
|
|
257
|
-
X.value ? "overflow-visible" : "overflow-hidden",
|
|
258
|
-
// Outer border stays on desktop table; stacked cards carry their own borders.
|
|
259
|
-
s.bordered && !X.value ? "border border-border" : "",
|
|
260
|
-
s.class
|
|
261
|
-
].join(" ");
|
|
262
|
-
}), We = r(() => {
|
|
263
|
-
const e = s.cellBordered ? "[&_thead_th]:border-border [&_tbody_td]:border-border [&_tbody_th]:border-border [&_thead_th:not(:last-child)]:border-r [&_tbody_td:not(:last-child)]:border-r [&_tbody_th:not(:last-child)]:border-r [&_tbody_tr:not(:last-child)>td]:border-b [&_tbody_tr:not(:last-child)>th]:border-b" : "";
|
|
264
|
-
return [
|
|
265
|
-
"w-full caption-bottom -text-fs-1",
|
|
266
|
-
h.value ? "table-fixed" : "",
|
|
267
|
-
e,
|
|
268
|
-
s.tableClass
|
|
269
|
-
].join(" ");
|
|
270
|
-
}), Ve = (e) => {
|
|
271
|
-
const l = {};
|
|
272
|
-
return e.width && !/(?:^|\s|:)w-/.test(e.width) && (l.width = e.width), e.minWidth && !/(?:^|\s|:)min-w-/.test(e.minWidth) && (h.value && !l.width ? l.width = e.minWidth : l.minWidth = e.minWidth), l;
|
|
273
|
-
}, Fe = (e) => {
|
|
274
|
-
const l = {};
|
|
275
|
-
return e.width && !/(?:^|\s|:)w-/.test(e.width) ? l.width = e.width : e.minWidth && !/(?:^|\s|:)min-w-/.test(e.minWidth) && (l.width = e.minWidth), l;
|
|
276
|
-
}, ue = (e) => {
|
|
277
|
-
const l = [];
|
|
278
|
-
return e.width && /(?:^|\s|:)w-/.test(e.width) && l.push(e.width), e.minWidth && /(?:^|\s|:)min-w-/.test(e.minWidth) && l.push(e.minWidth), l.join(" ");
|
|
279
|
-
}, me = r(
|
|
280
|
-
() => s.emptyTitleI18n ? z(s.emptyTitleI18n) : s.emptyTitle
|
|
281
|
-
), ve = r(
|
|
282
|
-
() => s.emptyDescriptionI18n ? z(s.emptyDescriptionI18n) : s.emptyDescription
|
|
283
|
-
), Me = r(() => {
|
|
284
|
-
const e = z("vlite.dataTable.confirmDeleteTitle");
|
|
285
|
-
return e !== "vlite.dataTable.confirmDeleteTitle" ? e : "Confirm Deletion";
|
|
286
|
-
}), Ae = r(() => {
|
|
287
|
-
const e = z("vlite.dataTable.confirmDeleteDesc");
|
|
288
|
-
return e !== "vlite.dataTable.confirmDeleteDesc" ? e : "Are you sure you want to delete the selected items?";
|
|
289
|
-
}), Ne = r(() => {
|
|
290
|
-
const e = z("vlite.dataTable.deleteBtn");
|
|
291
|
-
return e !== "vlite.dataTable.deleteBtn" ? e : "Delete";
|
|
292
|
-
}), je = r(() => {
|
|
293
|
-
const e = z("vlite.dataTable.cancelBtn");
|
|
294
|
-
return e !== "vlite.dataTable.cancelBtn" ? e : "Cancel";
|
|
295
|
-
});
|
|
296
|
-
return (e, l) => (i(), d("div", tt, [
|
|
297
|
-
f("div", {
|
|
298
|
-
class: C(Le.value)
|
|
299
|
-
}, [
|
|
300
|
-
X.value ? (i(), d("div", lt, [
|
|
301
|
-
ie.value ? (i(!0), d(I, { key: 0 }, x(Math.min(R.value, 15), (t) => (i(), d("div", {
|
|
302
|
-
key: "skeleton-card-" + t,
|
|
303
|
-
class: "border rounded-lg overflow-hidden bg-background"
|
|
304
|
-
}, [
|
|
305
|
-
f("div", nt, [
|
|
306
|
-
p.value ? (i(), d("div", st)) : E("", !0),
|
|
307
|
-
l[8] || (l[8] = f("div", { class: "h-4 flex-1 rounded-md bg-muted animate-pulse" }, null, -1))
|
|
308
|
-
]),
|
|
309
|
-
f("div", at, [
|
|
310
|
-
(i(!0), d(I, null, x(xe.value.slice(1, 4), (a) => (i(), d("div", {
|
|
311
|
-
key: a.field,
|
|
312
|
-
class: "flex items-center justify-between gap-3"
|
|
313
|
-
}, [...l[9] || (l[9] = [
|
|
314
|
-
f("div", { class: "h-2.5 w-14 rounded bg-muted animate-pulse" }, null, -1),
|
|
315
|
-
f("div", { class: "h-4 w-20 rounded-md bg-muted animate-pulse" }, null, -1)
|
|
316
|
-
])]))), 128))
|
|
317
|
-
])
|
|
318
|
-
]))), 128)) : o(L).length > 0 ? (i(!0), d(I, { key: 1 }, x(o(L), (t, a, u, m) => {
|
|
319
|
-
const v = [
|
|
320
|
-
t.row,
|
|
321
|
-
c.value.has(t.id),
|
|
322
|
-
K.value.has(t.id),
|
|
323
|
-
p.value,
|
|
324
|
-
M(t.row),
|
|
325
|
-
n.compact,
|
|
326
|
-
n.size,
|
|
327
|
-
n.striped,
|
|
328
|
-
n.hoverable,
|
|
329
|
-
n.cellBordered,
|
|
330
|
-
o(h),
|
|
331
|
-
t.depth,
|
|
332
|
-
t.isLastSibling,
|
|
333
|
-
t.ancestorLastFlags,
|
|
334
|
-
o(N)(t.id),
|
|
335
|
-
o(j)(t.id),
|
|
336
|
-
o(A)(t.row),
|
|
337
|
-
n.treeIndent,
|
|
338
|
-
!0
|
|
339
|
-
];
|
|
340
|
-
if (m && m.key === t.id && _(m, v)) return m;
|
|
341
|
-
const k = (i(), ee(he, {
|
|
342
|
-
key: t.id,
|
|
343
|
-
stacked: "",
|
|
344
|
-
row: t.row,
|
|
345
|
-
headers: n.headers,
|
|
346
|
-
index: t.index,
|
|
347
|
-
"key-field": g.value,
|
|
348
|
-
selectable: p.value,
|
|
349
|
-
"selection-disabled": !M(t.row),
|
|
350
|
-
"is-selected": c.value.has(t.id),
|
|
351
|
-
"is-indeterminate": K.value.has(t.id),
|
|
352
|
-
hoverable: n.hoverable,
|
|
353
|
-
striped: n.striped,
|
|
354
|
-
compact: n.compact,
|
|
355
|
-
size: n.size,
|
|
356
|
-
"cell-bordered": n.cellBordered,
|
|
357
|
-
"tree-mode": o(h),
|
|
358
|
-
depth: t.depth,
|
|
359
|
-
"tree-indent": n.treeIndent,
|
|
360
|
-
expandable: o(A)(t.row),
|
|
361
|
-
expanded: o(N)(t.id),
|
|
362
|
-
"tree-loading": o(j)(t.id),
|
|
363
|
-
"is-last-sibling": t.isLastSibling,
|
|
364
|
-
"ancestor-last-flags": t.ancestorLastFlags,
|
|
365
|
-
onSelect: re,
|
|
366
|
-
onRowClick: ce,
|
|
367
|
-
onToggleExpand: (b) => o(ae)(t.row, t.depth)
|
|
368
|
-
}, H({ _: 2 }, [
|
|
369
|
-
x(n.headers, (b) => ({
|
|
370
|
-
name: b.field,
|
|
371
|
-
fn: Y((Z) => [
|
|
372
|
-
$(e.$slots, b.field, te({ ref_for: !0 }, Z))
|
|
373
|
-
])
|
|
374
|
-
}))
|
|
375
|
-
]), 1032, ["row", "headers", "index", "key-field", "selectable", "selection-disabled", "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"]));
|
|
376
|
-
return k.memo = v, k;
|
|
377
|
-
}, l, 0), 128)) : (i(), d("div", ot, [
|
|
378
|
-
$(e.$slots, "empty", {}, () => [
|
|
379
|
-
F(o(ge), {
|
|
380
|
-
title: me.value,
|
|
381
|
-
description: ve.value,
|
|
382
|
-
icon: n.emptyIcon,
|
|
383
|
-
variant: "variant12",
|
|
384
|
-
class: "bg-transparent! py-8!"
|
|
385
|
-
}, H({ _: 2 }, [
|
|
386
|
-
e.$slots["empty-action"] ? {
|
|
387
|
-
name: "action",
|
|
388
|
-
fn: Y(() => [
|
|
389
|
-
$(e.$slots, "empty-action")
|
|
390
|
-
]),
|
|
391
|
-
key: "0"
|
|
392
|
-
} : void 0
|
|
393
|
-
]), 1032, ["title", "description", "icon"])
|
|
394
|
-
])
|
|
395
|
-
]))
|
|
396
|
-
])) : (i(), d("div", {
|
|
397
|
-
key: 1,
|
|
398
|
-
class: C(["w-full overflow-x-auto", o(h) ? "overflow-y-visible" : "overflow-y-hidden"])
|
|
399
|
-
}, [
|
|
400
|
-
f("table", {
|
|
401
|
-
class: C([We.value, "data-table"])
|
|
402
|
-
}, [
|
|
403
|
-
o(h) ? (i(), d("colgroup", it, [
|
|
404
|
-
p.value ? (i(), d("col", dt)) : E("", !0),
|
|
405
|
-
(i(!0), d(I, null, x(n.headers, (t) => (i(), d("col", {
|
|
406
|
-
key: "col-" + t.field,
|
|
407
|
-
class: C(ue(t)),
|
|
408
|
-
style: le(Fe(t))
|
|
409
|
-
}, null, 6))), 128))
|
|
410
|
-
])) : E("", !0),
|
|
411
|
-
f("thead", {
|
|
412
|
-
class: C([
|
|
413
|
-
"[&_tr]:border-b [&_tr]:border-border",
|
|
414
|
-
n.headerVariant === "minimal" ? "bg-transparent" : "bg-accent",
|
|
415
|
-
n.variant === "raised" && n.rounded ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
|
|
416
|
-
])
|
|
417
|
-
}, [
|
|
418
|
-
f("tr", rt, [
|
|
419
|
-
p.value ? (i(), d("th", ct, [
|
|
420
|
-
f("div", ut, [
|
|
421
|
-
F(qe, {
|
|
422
|
-
"model-value": G.value,
|
|
423
|
-
indeterminate: de.value,
|
|
424
|
-
disabled: !Ce.value,
|
|
425
|
-
size: "xs",
|
|
426
|
-
"onUpdate:modelValue": Re
|
|
427
|
-
}, null, 8, ["model-value", "indeterminate", "disabled"])
|
|
428
|
-
])
|
|
429
|
-
])) : E("", !0),
|
|
430
|
-
(i(!0), d(I, null, x(n.headers, (t) => (i(), ee(Qe, {
|
|
431
|
-
key: t.field,
|
|
432
|
-
header: t,
|
|
433
|
-
"sort-config": T.value,
|
|
434
|
-
compact: n.compact,
|
|
435
|
-
size: n.size,
|
|
436
|
-
"table-sortable": n.sortable,
|
|
437
|
-
"cell-bordered": n.cellBordered,
|
|
438
|
-
onSort: De,
|
|
439
|
-
class: C([
|
|
440
|
-
n.cellBordered ? "" : "last:pr-5!",
|
|
441
|
-
ue(t),
|
|
442
|
-
o(h) ? "min-w-0! max-w-none!" : ""
|
|
443
|
-
]),
|
|
444
|
-
style: le(Ve(t))
|
|
445
|
-
}, null, 8, ["header", "sort-config", "compact", "size", "table-sortable", "cell-bordered", "class", "style"]))), 128))
|
|
446
|
-
])
|
|
447
|
-
], 2),
|
|
448
|
-
f("tbody", mt, [
|
|
449
|
-
ie.value ? (i(!0), d(I, { key: 0 }, x(Math.min(R.value, 15), (t, a, u, m) => {
|
|
450
|
-
const v = [];
|
|
451
|
-
if (m && m.key === "skeleton-" + t && _(m, v)) return m;
|
|
452
|
-
const k = (i(), d("tr", {
|
|
453
|
-
key: "skeleton-" + t,
|
|
454
|
-
class: "border-b border-border/70 bg-background transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
|
|
455
|
-
}, [
|
|
456
|
-
p.value ? (i(), d("td", vt, [...l[10] || (l[10] = [
|
|
457
|
-
f("div", { class: "flex items-center justify-center" }, [
|
|
458
|
-
f("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
|
|
459
|
-
], -1)
|
|
460
|
-
])])) : E("", !0),
|
|
461
|
-
(i(!0), d(I, null, x(n.headers, (b) => (i(), d("td", {
|
|
462
|
-
key: b.field,
|
|
463
|
-
class: C(["align-middle", [
|
|
464
|
-
b.hideOnMobile ? "hidden md:table-cell" : "",
|
|
465
|
-
n.cellBordered ? "px-5! py-3!" : "p-5! last:pr-6!"
|
|
466
|
-
]])
|
|
467
|
-
}, [
|
|
468
|
-
f("div", {
|
|
469
|
-
class: "rounded-md bg-muted/50 animate-pulse h-4",
|
|
470
|
-
style: le({ width: `${50 + Math.random() * 40}%` })
|
|
471
|
-
}, null, 4)
|
|
472
|
-
], 2))), 128))
|
|
473
|
-
]));
|
|
474
|
-
return k.memo = v, k;
|
|
475
|
-
}, l, 2), 128)) : o(L).length > 0 ? (i(!0), d(I, { key: 1 }, x(o(L), (t, a, u, m) => {
|
|
476
|
-
const v = [
|
|
477
|
-
t.row,
|
|
478
|
-
c.value.has(t.id),
|
|
479
|
-
K.value.has(t.id),
|
|
480
|
-
p.value,
|
|
481
|
-
M(t.row),
|
|
482
|
-
n.compact,
|
|
483
|
-
n.size,
|
|
484
|
-
n.striped,
|
|
485
|
-
n.hoverable,
|
|
486
|
-
n.cellBordered,
|
|
487
|
-
o(h),
|
|
488
|
-
t.depth,
|
|
489
|
-
t.isLastSibling,
|
|
490
|
-
t.ancestorLastFlags,
|
|
491
|
-
o(N)(t.id),
|
|
492
|
-
o(j)(t.id),
|
|
493
|
-
o(A)(t.row),
|
|
494
|
-
n.treeIndent,
|
|
495
|
-
!1
|
|
496
|
-
];
|
|
497
|
-
if (m && m.key === t.id && _(m, v)) return m;
|
|
498
|
-
const k = (i(), ee(he, {
|
|
499
|
-
key: t.id,
|
|
500
|
-
row: t.row,
|
|
501
|
-
headers: n.headers,
|
|
502
|
-
index: t.index,
|
|
503
|
-
"key-field": g.value,
|
|
504
|
-
selectable: p.value,
|
|
505
|
-
"selection-disabled": !M(t.row),
|
|
506
|
-
"is-selected": c.value.has(t.id),
|
|
507
|
-
"is-indeterminate": K.value.has(t.id),
|
|
508
|
-
hoverable: n.hoverable,
|
|
509
|
-
striped: n.striped,
|
|
510
|
-
compact: n.compact,
|
|
511
|
-
size: n.size,
|
|
512
|
-
"cell-bordered": n.cellBordered,
|
|
513
|
-
"tree-mode": o(h),
|
|
514
|
-
depth: t.depth,
|
|
515
|
-
"tree-indent": n.treeIndent,
|
|
516
|
-
expandable: o(A)(t.row),
|
|
517
|
-
expanded: o(N)(t.id),
|
|
518
|
-
"tree-loading": o(j)(t.id),
|
|
519
|
-
"is-last-sibling": t.isLastSibling,
|
|
520
|
-
"ancestor-last-flags": t.ancestorLastFlags,
|
|
521
|
-
onSelect: re,
|
|
522
|
-
onRowClick: ce,
|
|
523
|
-
onToggleExpand: (b) => o(ae)(t.row, t.depth),
|
|
524
|
-
class: C(n.cellBordered ? "" : "[&_td:last-child]:pr-5!")
|
|
525
|
-
}, H({ _: 2 }, [
|
|
526
|
-
x(n.headers, (b) => ({
|
|
527
|
-
name: b.field,
|
|
528
|
-
fn: Y((Z) => [
|
|
529
|
-
$(e.$slots, b.field, te({ ref_for: !0 }, Z))
|
|
530
|
-
])
|
|
531
|
-
}))
|
|
532
|
-
]), 1032, ["row", "headers", "index", "key-field", "selectable", "selection-disabled", "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"]));
|
|
533
|
-
return k.memo = v, k;
|
|
534
|
-
}, l, 4), 128)) : (i(), d("tr", ft, [
|
|
535
|
-
f("td", {
|
|
536
|
-
colspan: p.value ? n.headers.length + 1 : n.headers.length,
|
|
537
|
-
class: "align-middle hover:bg-transparent"
|
|
538
|
-
}, [
|
|
539
|
-
$(e.$slots, "empty", {}, () => [
|
|
540
|
-
F(o(ge), {
|
|
541
|
-
title: me.value,
|
|
542
|
-
description: ve.value,
|
|
543
|
-
icon: n.emptyIcon,
|
|
544
|
-
variant: "variant12",
|
|
545
|
-
class: "bg-transparent! py-8!"
|
|
546
|
-
}, H({ _: 2 }, [
|
|
547
|
-
e.$slots["empty-action"] ? {
|
|
548
|
-
name: "action",
|
|
549
|
-
fn: Y(() => [
|
|
550
|
-
$(e.$slots, "empty-action")
|
|
551
|
-
]),
|
|
552
|
-
key: "0"
|
|
553
|
-
} : void 0
|
|
554
|
-
]), 1032, ["title", "description", "icon"])
|
|
555
|
-
])
|
|
556
|
-
], 8, gt)
|
|
557
|
-
]))
|
|
558
|
-
])
|
|
559
|
-
], 2)
|
|
560
|
-
], 2))
|
|
561
|
-
], 2),
|
|
562
|
-
n.showPagination && n.pageInfo && n.pageInfo.totalPages > 1 ? (i(), d("div", ht, [
|
|
563
|
-
F(o(Je), te({
|
|
564
|
-
"current-page": D.value,
|
|
565
|
-
"total-pages": n.pageInfo.totalPages,
|
|
566
|
-
"total-items": n.pageInfo.totalItems
|
|
567
|
-
}, n.paginationProps, {
|
|
568
|
-
onChange: Ee,
|
|
569
|
-
"onUpdate:itemsPerPage": $e
|
|
570
|
-
}), null, 16, ["current-page", "total-pages", "total-items"])
|
|
571
|
-
])) : E("", !0),
|
|
572
|
-
F(Ge, {
|
|
573
|
-
show: U.value,
|
|
574
|
-
"onUpdate:show": l[6] || (l[6] = (t) => U.value = t),
|
|
575
|
-
title: Me.value,
|
|
576
|
-
description: Ae.value,
|
|
577
|
-
"confirm-text": Ne.value,
|
|
578
|
-
"cancel-text": je.value,
|
|
579
|
-
variant: "danger",
|
|
580
|
-
onConfirm: ze,
|
|
581
|
-
onCancel: l[7] || (l[7] = (t) => U.value = !1)
|
|
582
|
-
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text"])
|
|
583
|
-
]));
|
|
584
|
-
}
|
|
585
|
-
});
|
|
1
|
+
import o from "./DataTable.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b2b208b4"]]);
|
|
586
5
|
export {
|
|
587
|
-
|
|
6
|
+
p as default
|
|
588
7
|
};
|