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