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