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