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.
Files changed (32) hide show
  1. package/components/CategoryManager/CategoryManager.vue2.js +4 -4
  2. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  3. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  4. package/components/DataTable/DataTable.vue.d.ts +4 -1
  5. package/components/DataTable/DataTable.vue.js +322 -205
  6. package/components/DataTable/DataTableRow.vue.d.ts +21 -0
  7. package/components/DataTable/DataTableRow.vue.js +137 -73
  8. package/components/DataTable/types.d.ts +30 -0
  9. package/components/DataTable/useDataTableTree.d.ts +24 -0
  10. package/components/DataTable/useDataTableTree.js +137 -0
  11. package/components/FileTree/FileTree.vue.js +1 -1
  12. package/components/FileTree/FileTree.vue2.js +59 -57
  13. package/components/FileTree/FileTreeNode.vue.d.ts +6 -0
  14. package/components/FileTree/FileTreeNode.vue.js +112 -103
  15. package/components/Form/{AccordionView.vue.js → AccordionView.vue2.js} +1 -1
  16. package/components/Form/index.vue2.js +1 -1
  17. package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
  18. package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
  19. package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
  20. package/components/Screen/ScreenFilter.vue.js +4 -4
  21. package/components/TreeConnectors/TreeConnectors.vue.d.ts +27 -0
  22. package/components/TreeConnectors/TreeConnectors.vue.js +44 -0
  23. package/components/TreeConnectors/TreeConnectors.vue2.js +4 -0
  24. package/components/TreeConnectors/geometry.d.ts +64 -0
  25. package/components/TreeConnectors/geometry.js +55 -0
  26. package/components/TreeConnectors/index.d.ts +3 -0
  27. package/components/index.d.ts +1 -0
  28. package/package.json +1 -1
  29. package/style.css +1 -1
  30. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
  31. /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
  32. /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
@@ -1,22 +1,26 @@
1
- import { defineComponent as he, inject as be, computed as r, ref as S, watch as x, openBlock as d, createElementBlock as u, createElementVNode as m, normalizeClass as b, createVNode as T, createCommentVNode as V, Fragment as D, renderList as B, createBlock as M, normalizeStyle as j, isMemoSame as F, createSlots as K, withCtx as U, renderSlot as W, mergeProps as O, unref as L } from "vue";
2
- import ye from "../CheckBox.vue.js";
3
- import we from "../ConfirmationModal.vue.js";
4
- import pe from "../Pagination/Pagination.vue.js";
5
- import Pe from "../Empty/Empty.vue.js";
6
- import Ce from "./DataTableHeader.vue.js";
7
- import ke from "./DataTableRow.vue.js";
8
- import { $t as y } from "../../utils/i18n.js";
9
- import { SCREEN_CONTEXT_KEY as Se } from "./types.js";
10
- const xe = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, Ie = { class: "hover:bg-transparent" }, Te = {
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
- }, De = { class: "flex items-center justify-center" }, Ee = { class: "[&_tr:last-child]:border-0" }, ze = {
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
- }, Re = { key: 2 }, $e = ["colspan"], Ve = { key: 0 }, Le = /* @__PURE__ */ he({
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(a, { emit: Y }) {
56
- const X = (e, t) => {
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, s) => l?.[s], e) : e[t];
59
- }, c = (e, t) => X(e, t), q = (e, t) => {
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 s of l)
64
- if (s in e[0]) return s;
69
+ for (const o of l)
70
+ if (o in e[0]) return o;
65
71
  }
66
72
  return "_id";
67
- }, G = (e) => e.sortKey || e.field, n = a, g = Y, E = be(Se, null), w = r(() => n.hideSelectable ? !1 : E ? E.forceSelectable : !0), i = r(() => q(n.rows, n.keyField)), v = S({ field: "", order: "" }), p = S(
68
- n.pageInfo?.itemsPerPage || n.paginationProps?.itemsPerPage || 10
69
- ), h = S(n.pageInfo?.currentPage || 1), I = S(!1), H = r(() => n.loading);
70
- x(
71
- () => n.pageInfo?.itemsPerPage,
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 && (p.value = e);
96
+ e !== void 0 && (T.value = e);
74
97
  }
75
- ), x(
76
- () => n.paginationProps?.itemsPerPage,
98
+ ), D(
99
+ () => a.paginationProps?.itemsPerPage,
77
100
  (e) => {
78
- e !== void 0 && (p.value = e);
101
+ e !== void 0 && (T.value = e);
79
102
  }
80
- ), x(
81
- () => n.pageInfo?.currentPage,
103
+ ), D(
104
+ () => a.pageInfo?.currentPage,
82
105
  (e) => {
83
- e && (h.value = e);
106
+ e && (C.value = e);
84
107
  }
85
108
  );
86
- const o = S(/* @__PURE__ */ new Set());
87
- x(
88
- () => n.selectedRows,
109
+ const i = B(/* @__PURE__ */ new Set());
110
+ D(
111
+ () => a.selectedRows,
89
112
  (e) => {
90
- const t = new Set((e || []).map((l) => c(l, i.value)));
91
- (t.size !== o.value.size || [...t].some((l) => !o.value.has(l))) && (o.value = t);
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 z = r(
96
- () => n.rows.length > 0 && n.rows.every((e) => o.value.has(c(e, i.value)))
97
- ), A = r(() => o.value.size > 0 && !z.value), J = r(() => {
98
- const e = [...n.selectedRows || [], ...n.rows], t = /* @__PURE__ */ new Map();
99
- return e.forEach((l) => t.set(c(l, i.value), l)), Array.from(o.value).map((l) => t.get(l)).filter(Boolean);
100
- }), Q = (e) => {
101
- const t = new Set(o.value);
102
- e ? n.rows.forEach((l) => t.add(c(l, i.value))) : n.rows.forEach((l) => t.delete(c(l, i.value))), o.value = t, N();
103
- }, Z = (e) => {
104
- const t = new Set(o.value);
105
- t.has(e) ? t.delete(e) : t.add(e), o.value = t, N();
106
- }, N = () => {
107
- const e = /* @__PURE__ */ new Set(), t = [];
108
- n.rows.forEach((l) => {
109
- const s = c(l, i.value);
110
- o.value.has(s) && (t.push(l), e.add(s));
111
- }), (n.selectedRows || []).forEach((l) => {
112
- const s = c(l, i.value);
113
- !e.has(s) && o.value.has(s) && (t.push(l), e.add(s));
114
- }), g("select", {
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: z.value,
117
- indeterminate: A.value
118
- }), g("update:selectedRows", t);
119
- }, _ = (e) => {
120
- const t = n.headers.find((s) => s.field === e), l = t ? G(t) : e;
121
- v.value.field === l ? v.value.order = v.value.order === "asc" ? "desc" : "asc" : (v.value.field = l, v.value.order = "asc"), h.value = 1, $();
122
- }, ee = (e) => {
123
- h.value = e, $();
124
- }, te = (e) => {
125
- p.value = e, h.value = 1, g("update:itemsPerPage", e), $();
126
- }, le = (e) => g("rowClick", e), ae = () => {
127
- g("delete", J.value), I.value = !1;
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 R = null;
130
- const $ = () => {
131
- R && clearTimeout(R), R = setTimeout(() => {
199
+ let N = null;
200
+ const j = () => {
201
+ N && clearTimeout(N), N = setTimeout(() => {
132
202
  const e = {
133
- pagination: { page: h.value, limit: p.value },
134
- sort: { ...v.value },
203
+ pagination: { page: C.value, limit: T.value },
204
+ sort: { ...x.value },
135
205
  filter: {}
136
206
  };
137
- g("change", e), E?.onTableChange?.(e);
207
+ y("change", e), L?.onTableChange?.(e);
138
208
  }, 10);
139
209
  };
140
- x(
141
- () => n.rows,
210
+ D(
211
+ () => a.rows,
142
212
  () => {
143
- const e = new Set(n.rows.map((t) => c(t, i.value)));
144
- o.value = new Set([...o.value].filter((t) => e.has(t)));
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 ne = r(() => [
220
+ const xe = u(() => [
148
221
  "w-full flex flex-col",
149
- n.variant === "raised" ? "bg-background shadow-sm p-2 rounded-lg" : "bg-background rounded",
222
+ a.variant === "raised" ? "bg-background shadow-sm p-2 rounded-lg" : "bg-background rounded",
150
223
  "overflow-hidden",
151
- n.bordered ? "border border-border" : "",
152
- n.class
153
- ].join(" ")), oe = r(() => ["w-full caption-bottom -text-fs-1", n.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" : "", n.tableClass].join(" ")), se = (e) => {
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) && (t.width = e.width), e.minWidth && !/(?:^|\s|:)min-w-/.test(e.minWidth) && (t.minWidth = e.minWidth), t;
156
- }, re = (e) => {
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
- }, ie = r(
160
- () => n.emptyTitleI18n ? y(n.emptyTitleI18n) : n.emptyTitle
161
- ), de = r(
162
- () => n.emptyDescriptionI18n ? y(n.emptyDescriptionI18n) : n.emptyDescription
163
- ), ce = r(() => {
164
- const e = y("vlite.dataTable.confirmDeleteTitle");
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
- }), ue = r(() => {
167
- const e = y("vlite.dataTable.confirmDeleteDesc");
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
- }), me = r(() => {
170
- const e = y("vlite.dataTable.deleteBtn");
253
+ }), De = u(() => {
254
+ const e = P("vlite.dataTable.deleteBtn");
171
255
  return e !== "vlite.dataTable.deleteBtn" ? e : "Delete";
172
- }), fe = r(() => {
173
- const e = y("vlite.dataTable.cancelBtn");
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) => (d(), u("div", xe, [
177
- m("div", {
178
- class: b(ne.value)
260
+ return (e, t) => (r(), m("div", Ke, [
261
+ h("div", {
262
+ class: p(xe.value)
179
263
  }, [
180
- m("div", Be, [
181
- m("table", {
182
- class: b([oe.value, "data-table"])
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("thead", {
185
- class: b([
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
- a.headerVariant === "minimal" ? "bg-transparent" : "bg-accent",
188
- a.variant === "raised" ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
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
- m("tr", Ie, [
192
- w.value ? (d(), u("th", Te, [
193
- m("div", De, [
194
- T(ye, {
195
- "model-value": z.value,
196
- indeterminate: A.value,
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": Q
292
+ "onUpdate:modelValue": ve
199
293
  }, null, 8, ["model-value", "indeterminate"])
200
294
  ])
201
- ])) : V("", !0),
202
- (d(!0), u(D, null, B(a.headers, (l) => (d(), M(Ce, {
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": v.value,
206
- compact: a.compact,
207
- size: a.size,
208
- "table-sortable": a.sortable,
209
- "cell-bordered": a.cellBordered,
210
- onSort: _,
211
- class: b([a.cellBordered ? "" : "last:pr-5!", re(l)]),
212
- style: j(se(l))
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
- m("tbody", Ee, [
217
- H.value ? (d(!0), u(D, { key: 0 }, B(Math.min(p.value, 15), (l, s, ve, f) => {
218
- const P = [];
219
- if (f && f.key === "skeleton-" + l && F(f, P)) return f;
220
- const C = (d(), u("tr", {
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
- w.value ? (d(), u("td", ze, [...t[6] || (t[6] = [
225
- m("div", { class: "flex items-center justify-center" }, [
226
- m("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
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
- ])])) : V("", !0),
229
- (d(!0), u(D, null, B(a.headers, (k) => (d(), u("td", {
326
+ ])])) : E("", !0),
327
+ (r(!0), m(R, null, I(n.headers, (k) => (r(), m("td", {
230
328
  key: k.field,
231
- class: b(["align-middle", [
329
+ class: p(["align-middle", [
232
330
  k.hideOnMobile ? "hidden md:table-cell" : "",
233
- a.cellBordered ? "px-5! py-3!" : "p-5! last:pr-6!"
331
+ n.cellBordered ? "px-5! py-3!" : "p-5! last:pr-6!"
234
332
  ]])
235
333
  }, [
236
- m("div", {
334
+ h("div", {
237
335
  class: "rounded-md bg-muted/50 animate-pulse h-4",
238
- style: j({ width: `${50 + Math.random() * 40}%` })
336
+ style: K({ width: `${50 + Math.random() * 40}%` })
239
337
  }, null, 4)
240
338
  ], 2))), 128))
241
339
  ]));
242
- return C.memo = P, C;
243
- }, t, 0), 128)) : a.rows.length > 0 ? (d(!0), u(D, { key: 1 }, B(a.rows, (l, s, ve, f) => {
244
- const P = [
245
- l,
246
- o.value.has(c(l, i.value)),
247
- w.value,
248
- a.compact,
249
- a.size,
250
- a.striped,
251
- a.hoverable,
252
- a.cellBordered
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 (f && f.key === c(l, i.value) && F(f, P)) return f;
255
- const C = (d(), M(ke, {
256
- key: c(l, i.value),
257
- row: l,
258
- headers: a.headers,
259
- index: s,
260
- "key-field": i.value,
261
- selectable: w.value,
262
- "is-selected": o.value.has(c(l, i.value)),
263
- hoverable: a.hoverable,
264
- striped: a.striped,
265
- compact: a.compact,
266
- size: a.size,
267
- "cell-bordered": a.cellBordered,
268
- onSelect: Z,
269
- onRowClick: le,
270
- class: b(a.cellBordered ? "" : "[&_td:last-child]:pr-3.5!")
271
- }, K({ _: 2 }, [
272
- B(a.headers, (k) => ({
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: U((ge) => [
275
- W(e.$slots, k.field, O({ ref_for: !0 }, ge))
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 C.memo = P, C;
280
- }, t, 2), 128)) : (d(), u("tr", Re, [
281
- m("td", {
282
- colspan: w.value ? a.headers.length + 1 : a.headers.length,
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
- W(e.$slots, "empty", {}, () => [
286
- T(L(Pe), {
287
- title: ie.value,
288
- description: de.value,
289
- icon: a.emptyIcon,
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
- }, K({ _: 2 }, [
409
+ }, le({ _: 2 }, [
293
410
  e.$slots["empty-action"] ? {
294
411
  name: "action",
295
- fn: U(() => [
296
- W(e.$slots, "empty-action")
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, $e)
419
+ ], 8, Qe)
303
420
  ]))
304
421
  ])
305
422
  ], 2)
306
- ])
423
+ ], 2)
307
424
  ], 2),
308
- a.showPagination && a.pageInfo && a.pageInfo.totalPages > 1 ? (d(), u("div", Ve, [
309
- T(L(pe), O({
310
- "current-page": h.value,
311
- "total-pages": a.pageInfo.totalPages,
312
- "total-items": a.pageInfo.totalItems
313
- }, a.paginationProps, {
314
- onChange: ee,
315
- "onUpdate:itemsPerPage": te
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
- ])) : V("", !0),
318
- T(we, {
319
- show: I.value,
320
- "onUpdate:show": t[4] || (t[4] = (l) => I.value = l),
321
- title: ce.value,
322
- description: ue.value,
323
- "confirm-text": me.value,
324
- "cancel-text": fe.value,
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: ae,
327
- onCancel: t[5] || (t[5] = (l) => I.value = !1)
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
- Le as default
450
+ dt as default
334
451
  };