vlite3 1.1.4 → 1.1.5

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 (84) hide show
  1. package/README.md +5 -0
  2. package/components/CategoryManager/CategoryManager.vue.js +1 -1
  3. package/components/Chart/BarChart.vue.d.ts +48 -0
  4. package/components/Chart/CircleChart.vue.d.ts +47 -0
  5. package/components/Chart/LineChart.vue.d.ts +55 -0
  6. package/components/Chart/PieChart.vue.d.ts +49 -0
  7. package/components/Chart/index.d.ts +5 -0
  8. package/components/Chart/types.d.ts +135 -0
  9. package/components/Chart/utils.d.ts +40 -0
  10. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  11. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  12. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  13. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  14. package/components/Comment/CommentEditor.vue.d.ts +41 -0
  15. package/components/Comment/CommentEditor.vue.js +221 -0
  16. package/components/Comment/CommentEditor.vue2.js +4 -0
  17. package/components/Comment/CommentItem.vue.d.ts +70 -0
  18. package/components/Comment/CommentItem.vue.js +7 -0
  19. package/components/Comment/CommentItem.vue2.js +322 -0
  20. package/components/Comment/CommentThread.vue.d.ts +64 -0
  21. package/components/Comment/CommentThread.vue.js +185 -0
  22. package/components/Comment/CommentThread.vue2.js +4 -0
  23. package/components/Comment/index.d.ts +4 -0
  24. package/components/Comment/types.d.ts +34 -0
  25. package/components/DataTable/DataTable.vue.d.ts +2 -4
  26. package/components/DataTable/DataTable.vue.js +175 -226
  27. package/components/DataTable/DataTableHeader.vue.d.ts +2 -0
  28. package/components/DataTable/DataTableHeader.vue.js +24 -23
  29. package/components/DataTable/DataTableRow.vue.d.ts +2 -0
  30. package/components/DataTable/DataTableRow.vue.js +32 -31
  31. package/components/DataTable/types.d.ts +2 -9
  32. package/components/Dropdown/Dropdown.vue.d.ts +2 -0
  33. package/components/Dropdown/Dropdown.vue.js +60 -58
  34. package/components/Dropdown/DropdownTrigger.vue.d.ts +2 -0
  35. package/components/Dropdown/DropdownTrigger.vue.js +7 -6
  36. package/components/Empty/Empty.vue.js +7 -5
  37. package/components/Empty/index.d.ts +1 -1
  38. package/components/Empty/variants/Variant12.vue.d.ts +22 -0
  39. package/components/Empty/variants/Variant12.vue.js +35 -0
  40. package/components/Empty/variants/Variant12.vue2.js +4 -0
  41. package/components/Footer/Footer.vue.d.ts +3 -0
  42. package/components/Footer/Variant1.vue.d.ts +20 -0
  43. package/components/Footer/Variant2.vue.d.ts +20 -0
  44. package/components/Footer/Variant3.vue.d.ts +12 -0
  45. package/components/Footer/index.d.ts +2 -0
  46. package/components/Footer/types.d.ts +73 -0
  47. package/components/Form/CustomFields.vue.d.ts +2 -0
  48. package/components/Form/CustomFields.vue.js +2 -2
  49. package/components/Form/CustomFields.vue2.js +125 -122
  50. package/components/Form/FormField.vue.js +1 -1
  51. package/components/MultiSelect/MultiSelect.vue.d.ts +2 -0
  52. package/components/MultiSelect/MultiSelect.vue.js +95 -94
  53. package/components/NavbarCommandPalette.vue.js +1 -1
  54. package/components/NumberInput.vue.js +1 -1
  55. package/components/NumberInput.vue2.js +39 -38
  56. package/components/RichTextEditor/RichTextLinkPopover.vue.d.ts +26 -0
  57. package/components/RichTextEditor/RichTextReader.vue.d.ts +7 -0
  58. package/components/RichTextEditor/RichTextToolbar.vue.d.ts +24 -0
  59. package/components/RichTextEditor/composables/useRichTextImageUpload.d.ts +14 -0
  60. package/components/RichTextEditor/composables/useRichTextLinks.d.ts +32 -0
  61. package/components/RichTextEditor/index.d.ts +2 -0
  62. package/components/Screen/Screen.vue.js +45 -46
  63. package/components/Screen/ScreenFilter.vue.js +1 -1
  64. package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
  65. package/components/SidebarMenu/SidebarMenu.vue.js +192 -91
  66. package/components/SidebarMenu/SidebarMenu.vue3.js +5 -0
  67. package/components/SidebarMenu/SidebarMenuItem.vue.js +170 -157
  68. package/components/SidebarMenu/types.d.ts +12 -3
  69. package/components/{DataTable/DataTableToolbar.vue.d.ts → Splitter/Splitter.vue.d.ts} +18 -15
  70. package/components/Splitter/Splitter.vue.js +64 -0
  71. package/components/Splitter/Splitter.vue2.js +4 -0
  72. package/components/Splitter/index.d.ts +1 -0
  73. package/components/StatusChip/status-map.js +34 -2
  74. package/components/index.d.ts +4 -0
  75. package/core/config.d.ts +18 -0
  76. package/index.d.ts +2 -0
  77. package/index.js +316 -307
  78. package/package.json +1 -1
  79. package/style.css +42 -6
  80. package/types/config.type.d.ts +2 -0
  81. package/components/DataTable/DataTableToolbar.vue.js +0 -60
  82. package/components/DataTable/DataTableToolbar.vue2.js +0 -4
  83. package/components/SidebarMenu/SidebarMenu.vue2.js +0 -4
  84. /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
@@ -1,34 +1,26 @@
1
- import { defineComponent as ye, inject as we, computed as i, ref as y, watch as g, openBlock as r, createElementBlock as u, createBlock as U, normalizeClass as w, createSlots as j, withCtx as x, renderSlot as $, createVNode as B, createCommentVNode as W, createElementVNode as m, Fragment as A, renderList as E, normalizeStyle as L, isMemoSame as Y, mergeProps as X, unref as q } from "vue";
2
- import Pe from "../CheckBox.vue.js";
3
- import Ce from "../Button.vue.js";
4
- import Se from "../ConfirmationModal.vue.js";
5
- import ke from "../Pagination/Pagination.vue.js";
6
- import Ie from "../Empty/Empty.vue.js";
7
- import Te from "./DataTableHeader.vue.js";
8
- import De from "./DataTableRow.vue.js";
9
- import xe from "./DataTableToolbar.vue.js";
10
- import { $t as P } from "../../utils/i18n.js";
11
- import { SCREEN_CONTEXT_KEY as $e } from "./types.js";
12
- const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, Re = { class: "hover:bg-transparent" }, ze = {
1
+ import { defineComponent as he, inject as pe, computed as i, ref as k, watch as S, openBlock as d, createElementBlock as u, createElementVNode as m, normalizeClass as x, createVNode as D, createCommentVNode as V, Fragment as B, renderList as I, 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 be from "../CheckBox.vue.js";
3
+ import we from "../ConfirmationModal.vue.js";
4
+ import ye 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 p } from "../../utils/i18n.js";
9
+ import { SCREEN_CONTEXT_KEY as Se } from "./types.js";
10
+ const xe = { class: "space-y-6.5" }, Ie = { class: "overflow-x-auto w-full" }, Te = { class: "hover:bg-transparent" }, De = {
13
11
  key: 0,
14
12
  scope: "col",
15
13
  class: "w-[40px] px-0 text-center font-medium text-muted-foreground",
16
14
  style: { width: "40px" }
17
- }, We = { class: "flex items-center justify-center" }, Ae = { class: "[&_tr:last-child]:border-0" }, Ne = {
15
+ }, Be = { class: "flex items-center justify-center" }, Ee = { class: "[&_tr:last-child]:border-0" }, ze = {
18
16
  key: 0,
19
17
  class: "w-[48px] px-0 py-4 align-middle text-center",
20
18
  style: { width: "48px" }
21
- }, Ve = { key: 2 }, Me = ["colspan"], Ue = { key: 1 }, Qe = /* @__PURE__ */ ye({
19
+ }, Re = { key: 2 }, $e = ["colspan"], Ve = { key: 0 }, Le = /* @__PURE__ */ he({
22
20
  __name: "DataTable",
23
21
  props: {
24
22
  rows: { default: () => [] },
25
23
  selectedRows: { default: () => [] },
26
- search: { default: "" },
27
- showSearch: { type: Boolean, default: !1 },
28
- searchPlaceholder: {},
29
- searchPlaceholderI18n: {},
30
- toolbarClass: {},
31
- toolbarSearchClass: {},
32
24
  headers: { default: () => [] },
33
25
  keyField: { default: "auto" },
34
26
  loading: { type: Boolean, default: !1 },
@@ -54,325 +46,282 @@ const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, R
54
46
  tableClass: {},
55
47
  class: {},
56
48
  sortable: { type: Boolean, default: !1 },
57
- variant: { default: "default" }
49
+ variant: { default: "default" },
50
+ headerVariant: { default: "default" },
51
+ size: { default: "md" }
58
52
  },
59
53
  emits: ["change", "select", "rowClick", "update:itemsPerPage", "update:selectedRows", "delete"],
60
- setup(o, { emit: G }) {
61
- const H = (e, t) => {
54
+ setup(n, { emit: Y }) {
55
+ const X = (e, t) => {
62
56
  if (!(!e || !t))
63
- return t.includes(".") ? t.split(".").reduce((l, n) => l?.[n], e) : e[t];
64
- }, d = (e, t) => H(e, t), J = (e, t) => {
57
+ return t.includes(".") ? t.split(".").reduce((l, o) => l?.[o], e) : e[t];
58
+ }, c = (e, t) => X(e, t), q = (e, t) => {
65
59
  const l = ["id", "_id"];
66
60
  if (t && t !== "auto") return t;
67
61
  if (e && e.length > 0) {
68
- for (const n of l)
69
- if (n in e[0]) return n;
62
+ for (const o of l)
63
+ if (o in e[0]) return o;
70
64
  }
71
65
  return "_id";
72
- }, Q = (e) => e.sortKey || e.field, a = o, b = G, R = we($e, null), F = i(() => R?.disableSearch ? !1 : a.showSearch), C = i(() => a.hideSelectable ? !1 : R ? R.forceSelectable : !0), c = i(() => J(a.rows, a.keyField)), v = y({ field: "", order: "" }), S = y(
66
+ }, G = (e) => e.sortKey || e.field, a = n, g = Y, E = pe(Se, null), b = i(() => a.hideSelectable ? !1 : E ? E.forceSelectable : !0), r = i(() => q(a.rows, a.keyField)), v = k({ field: "", order: "" }), w = k(
73
67
  a.pageInfo?.itemsPerPage || a.paginationProps?.itemsPerPage || 10
74
- ), h = y(a.pageInfo?.currentPage || 1), p = y(a.search || ""), k = y(!1), Z = i(() => a.loading);
75
- g(
76
- () => a.search,
77
- (e) => {
78
- e !== void 0 && e !== p.value && (p.value = e);
79
- }
80
- );
81
- let N = null;
82
- g(p, () => {
83
- N && clearTimeout(N), N = setTimeout(() => {
84
- h.value = 1, z();
85
- }, 300);
86
- }), g(
68
+ ), h = k(a.pageInfo?.currentPage || 1), T = k(!1), H = i(() => a.loading);
69
+ S(
87
70
  () => a.pageInfo?.itemsPerPage,
88
71
  (e) => {
89
- e !== void 0 && (S.value = e);
72
+ e !== void 0 && (w.value = e);
90
73
  }
91
- ), g(
74
+ ), S(
92
75
  () => a.paginationProps?.itemsPerPage,
93
76
  (e) => {
94
- e !== void 0 && (S.value = e);
77
+ e !== void 0 && (w.value = e);
95
78
  }
96
- ), g(
79
+ ), S(
97
80
  () => a.pageInfo?.currentPage,
98
81
  (e) => {
99
82
  e && (h.value = e);
100
83
  }
101
84
  );
102
- const s = y(/* @__PURE__ */ new Set());
103
- g(
85
+ const s = k(/* @__PURE__ */ new Set());
86
+ S(
104
87
  () => a.selectedRows,
105
88
  (e) => {
106
- const t = new Set((e || []).map((l) => d(l, c.value)));
89
+ const t = new Set((e || []).map((l) => c(l, r.value)));
107
90
  (t.size !== s.value.size || [...t].some((l) => !s.value.has(l))) && (s.value = t);
108
91
  },
109
92
  { immediate: !0, deep: !0 }
110
93
  );
111
- const V = i(
112
- () => a.rows.length > 0 && a.rows.every((e) => s.value.has(d(e, c.value)))
113
- ), K = i(() => s.value.size > 0 && !V.value), _ = i(() => {
94
+ const z = i(
95
+ () => a.rows.length > 0 && a.rows.every((e) => s.value.has(c(e, r.value)))
96
+ ), A = i(() => s.value.size > 0 && !z.value), J = i(() => {
114
97
  const e = [...a.selectedRows || [], ...a.rows], t = /* @__PURE__ */ new Map();
115
- return e.forEach((l) => t.set(d(l, c.value), l)), Array.from(s.value).map((l) => t.get(l)).filter(Boolean);
116
- }), ee = (e) => {
98
+ return e.forEach((l) => t.set(c(l, r.value), l)), Array.from(s.value).map((l) => t.get(l)).filter(Boolean);
99
+ }), Q = (e) => {
117
100
  const t = new Set(s.value);
118
- e ? a.rows.forEach((l) => t.add(d(l, c.value))) : a.rows.forEach((l) => t.delete(d(l, c.value))), s.value = t, O();
119
- }, te = (e) => {
101
+ e ? a.rows.forEach((l) => t.add(c(l, r.value))) : a.rows.forEach((l) => t.delete(c(l, r.value))), s.value = t, N();
102
+ }, Z = (e) => {
120
103
  const t = new Set(s.value);
121
- t.has(e) ? t.delete(e) : t.add(e), s.value = t, O();
122
- }, O = () => {
104
+ t.has(e) ? t.delete(e) : t.add(e), s.value = t, N();
105
+ }, N = () => {
123
106
  const e = /* @__PURE__ */ new Set(), t = [];
124
107
  a.rows.forEach((l) => {
125
- const n = d(l, c.value);
126
- s.value.has(n) && (t.push(l), e.add(n));
108
+ const o = c(l, r.value);
109
+ s.value.has(o) && (t.push(l), e.add(o));
127
110
  }), (a.selectedRows || []).forEach((l) => {
128
- const n = d(l, c.value);
129
- !e.has(n) && s.value.has(n) && (t.push(l), e.add(n));
130
- }), b("select", {
111
+ const o = c(l, r.value);
112
+ !e.has(o) && s.value.has(o) && (t.push(l), e.add(o));
113
+ }), g("select", {
131
114
  selected: t,
132
- all: V.value,
133
- indeterminate: K.value
134
- }), b("update:selectedRows", t);
135
- }, le = (e) => {
136
- const t = a.headers.find((n) => n.field === e), l = t ? Q(t) : e;
137
- v.value.field === l ? v.value.order = v.value.order === "asc" ? "desc" : "asc" : (v.value.field = l, v.value.order = "asc"), h.value = 1, z();
138
- }, ae = (e) => {
139
- h.value = e, z();
140
- }, oe = (e) => {
141
- S.value = e, h.value = 1, b("update:itemsPerPage", e), z();
142
- }, se = (e) => b("rowClick", e), ne = () => {
143
- b("delete", _.value), k.value = !1;
115
+ all: z.value,
116
+ indeterminate: A.value
117
+ }), g("update:selectedRows", t);
118
+ }, _ = (e) => {
119
+ const t = a.headers.find((o) => o.field === e), l = t ? G(t) : e;
120
+ v.value.field === l ? v.value.order = v.value.order === "asc" ? "desc" : "asc" : (v.value.field = l, v.value.order = "asc"), h.value = 1, $();
121
+ }, ee = (e) => {
122
+ h.value = e, $();
123
+ }, te = (e) => {
124
+ w.value = e, h.value = 1, g("update:itemsPerPage", e), $();
125
+ }, le = (e) => g("rowClick", e), ae = () => {
126
+ g("delete", J.value), T.value = !1;
144
127
  };
145
- let M = null;
146
- const z = () => {
147
- M && clearTimeout(M), M = setTimeout(() => {
128
+ let R = null;
129
+ const $ = () => {
130
+ R && clearTimeout(R), R = setTimeout(() => {
148
131
  const e = {
149
- pagination: { page: h.value, limit: S.value },
132
+ pagination: { page: h.value, limit: w.value },
150
133
  sort: { ...v.value },
151
- search: p.value,
152
134
  filter: {}
153
135
  };
154
- b("change", e), R?.onTableChange?.(e);
136
+ g("change", e), E?.onTableChange?.(e);
155
137
  }, 10);
156
138
  };
157
- g(
139
+ S(
158
140
  () => a.rows,
159
141
  () => {
160
- const e = new Set(a.rows.map((t) => d(t, c.value)));
142
+ const e = new Set(a.rows.map((t) => c(t, r.value)));
161
143
  s.value = new Set([...s.value].filter((t) => e.has(t)));
162
144
  }
163
145
  );
164
- const ie = i(() => [
146
+ const ne = i(() => [
165
147
  "w-full flex flex-col",
166
148
  a.variant === "raised" ? "bg-background shadow-sm p-2 rounded-lg" : "bg-background rounded",
167
149
  "overflow-hidden",
168
150
  a.bordered ? "border border-border" : "",
169
151
  a.class
170
- ].join(" ")), re = i(() => ["w-full caption-bottom -text-fs-1", a.tableClass].join(" ")), ce = (e) => {
152
+ ].join(" ")), se = i(() => ["w-full caption-bottom -text-fs-1", a.tableClass].join(" ")), oe = (e) => {
171
153
  const t = {};
172
154
  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;
173
- }, de = (e) => {
155
+ }, ie = (e) => {
174
156
  const t = [];
175
157
  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(" ");
176
- }, ue = i(
177
- () => a.emptyTitleI18n ? P(a.emptyTitleI18n) : a.emptyTitle
178
- ), me = i(
179
- () => a.emptyDescriptionI18n ? P(a.emptyDescriptionI18n) : a.emptyDescription
180
- ), fe = i(() => {
181
- const e = P("vlite.dataTable.confirmDeleteTitle");
158
+ }, re = i(
159
+ () => a.emptyTitleI18n ? p(a.emptyTitleI18n) : a.emptyTitle
160
+ ), de = i(
161
+ () => a.emptyDescriptionI18n ? p(a.emptyDescriptionI18n) : a.emptyDescription
162
+ ), ce = i(() => {
163
+ const e = p("vlite.dataTable.confirmDeleteTitle");
182
164
  return e !== "vlite.dataTable.confirmDeleteTitle" ? e : "Confirm Deletion";
183
- }), ve = i(() => {
184
- const e = P("vlite.dataTable.confirmDeleteDesc");
165
+ }), ue = i(() => {
166
+ const e = p("vlite.dataTable.confirmDeleteDesc");
185
167
  return e !== "vlite.dataTable.confirmDeleteDesc" ? e : "Are you sure you want to delete the selected items?";
186
- }), he = i(() => {
187
- const e = P("vlite.dataTable.deleteBtn");
168
+ }), me = i(() => {
169
+ const e = p("vlite.dataTable.deleteBtn");
188
170
  return e !== "vlite.dataTable.deleteBtn" ? e : "Delete";
189
- }), ge = i(() => {
190
- const e = P("vlite.dataTable.cancelBtn");
171
+ }), fe = i(() => {
172
+ const e = p("vlite.dataTable.cancelBtn");
191
173
  return e !== "vlite.dataTable.cancelBtn" ? e : "Cancel";
192
174
  });
193
- return (e, t) => (r(), u("div", Be, [
194
- F.value || e.$slots?.["toolbar-left"] || e.$slots?.["toolbar-right"] ? (r(), U(xe, {
195
- key: 0,
196
- modelValue: p.value,
197
- "onUpdate:modelValue": t[1] || (t[1] = (l) => p.value = l),
198
- "show-search": F.value,
199
- placeholder: o.searchPlaceholder,
200
- placeholderI18n: o.searchPlaceholderI18n,
201
- class: w(o.toolbarClass),
202
- "search-class": o.toolbarSearchClass
203
- }, j({ _: 2 }, [
204
- e.$slots?.["toolbar-left"] ? {
205
- name: "left",
206
- fn: x(() => [
207
- $(e.$slots, "toolbar-left")
208
- ]),
209
- key: "0"
210
- } : void 0,
211
- s.value.size > 0 ? {
212
- name: "delete",
213
- fn: x(() => [
214
- B(Ce, {
215
- rounded: "full",
216
- variant: "outline",
217
- size: "lg",
218
- icon: "lucide:trash-2",
219
- onClick: t[0] || (t[0] = (l) => k.value = !0)
220
- })
221
- ]),
222
- key: "1"
223
- } : void 0,
224
- e.$slots?.["toolbar-right"] ? {
225
- name: "right",
226
- fn: x(() => [
227
- $(e.$slots, "toolbar-right")
228
- ]),
229
- key: "2"
230
- } : void 0
231
- ]), 1032, ["modelValue", "show-search", "placeholder", "placeholderI18n", "class", "search-class"])) : W("", !0),
175
+ return (e, t) => (d(), u("div", xe, [
232
176
  m("div", {
233
- class: w(ie.value)
177
+ class: x(ne.value)
234
178
  }, [
235
- m("div", Ee, [
179
+ m("div", Ie, [
236
180
  m("table", {
237
- class: w([re.value, "data-table"])
181
+ class: x([se.value, "data-table"])
238
182
  }, [
239
183
  m("thead", {
240
- class: w([
241
- "[&_tr]:border-b [&_tr]:border-border bg-muted",
242
- o.variant === "raised" ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
184
+ class: x([
185
+ "[&_tr]:border-b [&_tr]:border-border",
186
+ n.headerVariant === "minimal" ? "bg-transparent" : "bg-muted",
187
+ n.variant === "raised" ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
243
188
  ])
244
189
  }, [
245
- m("tr", Re, [
246
- C.value ? (r(), u("th", ze, [
247
- m("div", We, [
248
- B(Pe, {
249
- "model-value": V.value,
250
- indeterminate: K.value,
190
+ m("tr", Te, [
191
+ b.value ? (d(), u("th", De, [
192
+ m("div", Be, [
193
+ D(be, {
194
+ "model-value": z.value,
195
+ indeterminate: A.value,
251
196
  size: "xs",
252
- "onUpdate:modelValue": ee
197
+ "onUpdate:modelValue": Q
253
198
  }, null, 8, ["model-value", "indeterminate"])
254
199
  ])
255
- ])) : W("", !0),
256
- (r(!0), u(A, null, E(o.headers, (l) => (r(), U(Te, {
200
+ ])) : V("", !0),
201
+ (d(!0), u(B, null, I(n.headers, (l) => (d(), M(Ce, {
257
202
  key: l.field,
258
203
  header: l,
259
204
  "sort-config": v.value,
260
- compact: o.compact,
261
- "table-sortable": o.sortable,
262
- onSort: le,
263
- class: w(["last:pr-5!", de(l)]),
264
- style: L(ce(l))
265
- }, null, 8, ["header", "sort-config", "compact", "table-sortable", "class", "style"]))), 128))
205
+ compact: n.compact,
206
+ size: n.size,
207
+ "table-sortable": n.sortable,
208
+ onSort: _,
209
+ class: x(["last:pr-5!", ie(l)]),
210
+ style: j(oe(l))
211
+ }, null, 8, ["header", "sort-config", "compact", "size", "table-sortable", "class", "style"]))), 128))
266
212
  ])
267
213
  ], 2),
268
- m("tbody", Ae, [
269
- Z.value ? (r(!0), u(A, { key: 0 }, E(Math.min(S.value, 15), (l, n, be, f) => {
270
- const I = [];
271
- if (f && f.key === "skeleton-" + l && Y(f, I)) return f;
272
- const T = (r(), u("tr", {
214
+ m("tbody", Ee, [
215
+ H.value ? (d(!0), u(B, { key: 0 }, I(Math.min(w.value, 15), (l, o, ve, f) => {
216
+ const y = [];
217
+ if (f && f.key === "skeleton-" + l && F(f, y)) return f;
218
+ const P = (d(), u("tr", {
273
219
  key: "skeleton-" + l,
274
220
  class: "border-b border-border/70 bg-background transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
275
221
  }, [
276
- C.value ? (r(), u("td", Ne, [...t[8] || (t[8] = [
222
+ b.value ? (d(), u("td", ze, [...t[6] || (t[6] = [
277
223
  m("div", { class: "flex items-center justify-center" }, [
278
224
  m("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
279
225
  ], -1)
280
- ])])) : W("", !0),
281
- (r(!0), u(A, null, E(o.headers, (D) => (r(), u("td", {
282
- key: D.field,
283
- class: w(["p-5! align-middle last:pr-6!", [D.hideOnMobile ? "hidden md:table-cell" : ""]])
226
+ ])])) : V("", !0),
227
+ (d(!0), u(B, null, I(n.headers, (C) => (d(), u("td", {
228
+ key: C.field,
229
+ class: x(["p-5! align-middle last:pr-6!", [C.hideOnMobile ? "hidden md:table-cell" : ""]])
284
230
  }, [
285
231
  m("div", {
286
232
  class: "rounded-md bg-muted/50 animate-pulse h-4",
287
- style: L({ width: `${50 + Math.random() * 40}%` })
233
+ style: j({ width: `${50 + Math.random() * 40}%` })
288
234
  }, null, 4)
289
235
  ], 2))), 128))
290
236
  ]));
291
- return T.memo = I, T;
292
- }, t, 2), 128)) : o.rows.length > 0 ? (r(!0), u(A, { key: 1 }, E(o.rows, (l, n, be, f) => {
293
- const I = [
237
+ return P.memo = y, P;
238
+ }, t, 0), 128)) : n.rows.length > 0 ? (d(!0), u(B, { key: 1 }, I(n.rows, (l, o, ve, f) => {
239
+ const y = [
294
240
  l,
295
- s.value.has(d(l, c.value)),
296
- C.value,
297
- o.compact,
298
- o.striped,
299
- o.hoverable
241
+ s.value.has(c(l, r.value)),
242
+ b.value,
243
+ n.compact,
244
+ n.size,
245
+ n.striped,
246
+ n.hoverable
300
247
  ];
301
- if (f && f.key === d(l, c.value) && Y(f, I)) return f;
302
- const T = (r(), U(De, {
303
- key: d(l, c.value),
248
+ if (f && f.key === c(l, r.value) && F(f, y)) return f;
249
+ const P = (d(), M(ke, {
250
+ key: c(l, r.value),
304
251
  row: l,
305
- headers: o.headers,
306
- index: n,
307
- "key-field": c.value,
308
- selectable: C.value,
309
- "is-selected": s.value.has(d(l, c.value)),
310
- hoverable: o.hoverable,
311
- striped: o.striped,
312
- compact: o.compact,
313
- onSelect: te,
314
- onRowClick: se,
252
+ headers: n.headers,
253
+ index: o,
254
+ "key-field": r.value,
255
+ selectable: b.value,
256
+ "is-selected": s.value.has(c(l, r.value)),
257
+ hoverable: n.hoverable,
258
+ striped: n.striped,
259
+ compact: n.compact,
260
+ size: n.size,
261
+ onSelect: Z,
262
+ onRowClick: le,
315
263
  class: "[&_td:last-child]:pr-3.5!"
316
- }, j({ _: 2 }, [
317
- E(o.headers, (D) => ({
318
- name: D.field,
319
- fn: x((pe) => [
320
- $(e.$slots, D.field, X({ ref_for: !0 }, pe))
264
+ }, K({ _: 2 }, [
265
+ I(n.headers, (C) => ({
266
+ name: C.field,
267
+ fn: U((ge) => [
268
+ W(e.$slots, C.field, O({ ref_for: !0 }, ge))
321
269
  ])
322
270
  }))
323
- ]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]));
324
- return T.memo = I, T;
325
- }, t, 4), 128)) : (r(), u("tr", Ve, [
271
+ ]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact", "size"]));
272
+ return P.memo = y, P;
273
+ }, t, 2), 128)) : (d(), u("tr", Re, [
326
274
  m("td", {
327
- colspan: C.value ? o.headers.length + 1 : o.headers.length,
275
+ colspan: b.value ? n.headers.length + 1 : n.headers.length,
328
276
  class: "align-middle hover:bg-transparent"
329
277
  }, [
330
- $(e.$slots, "empty", {}, () => [
331
- B(q(Ie), {
332
- title: ue.value,
333
- description: me.value,
334
- icon: o.emptyIcon,
335
- class: "border-none! bg-transparent! py-16!"
336
- }, j({ _: 2 }, [
278
+ W(e.$slots, "empty", {}, () => [
279
+ D(L(Pe), {
280
+ title: re.value,
281
+ description: de.value,
282
+ icon: n.emptyIcon,
283
+ variant: "variant12",
284
+ class: "bg-transparent! py-8!"
285
+ }, K({ _: 2 }, [
337
286
  e.$slots["empty-action"] ? {
338
287
  name: "action",
339
- fn: x(() => [
340
- $(e.$slots, "empty-action")
288
+ fn: U(() => [
289
+ W(e.$slots, "empty-action")
341
290
  ]),
342
291
  key: "0"
343
292
  } : void 0
344
293
  ]), 1032, ["title", "description", "icon"])
345
294
  ])
346
- ], 8, Me)
295
+ ], 8, $e)
347
296
  ]))
348
297
  ])
349
298
  ], 2)
350
299
  ])
351
300
  ], 2),
352
- o.showPagination && o.pageInfo && o.pageInfo.totalPages > 1 ? (r(), u("div", Ue, [
353
- B(q(ke), X({
301
+ n.showPagination && n.pageInfo && n.pageInfo.totalPages > 1 ? (d(), u("div", Ve, [
302
+ D(L(ye), O({
354
303
  "current-page": h.value,
355
- "total-pages": o.pageInfo.totalPages,
356
- "total-items": o.pageInfo.totalItems
357
- }, o.paginationProps, {
358
- onChange: ae,
359
- "onUpdate:itemsPerPage": oe
304
+ "total-pages": n.pageInfo.totalPages,
305
+ "total-items": n.pageInfo.totalItems
306
+ }, n.paginationProps, {
307
+ onChange: ee,
308
+ "onUpdate:itemsPerPage": te
360
309
  }), null, 16, ["current-page", "total-pages", "total-items"])
361
- ])) : W("", !0),
362
- B(Se, {
363
- show: k.value,
364
- "onUpdate:show": t[6] || (t[6] = (l) => k.value = l),
365
- title: fe.value,
366
- description: ve.value,
367
- "confirm-text": he.value,
368
- "cancel-text": ge.value,
310
+ ])) : V("", !0),
311
+ D(we, {
312
+ show: T.value,
313
+ "onUpdate:show": t[4] || (t[4] = (l) => T.value = l),
314
+ title: ce.value,
315
+ description: ue.value,
316
+ "confirm-text": me.value,
317
+ "cancel-text": fe.value,
369
318
  variant: "danger",
370
- onConfirm: ne,
371
- onCancel: t[7] || (t[7] = (l) => k.value = !1)
319
+ onConfirm: ae,
320
+ onCancel: t[5] || (t[5] = (l) => T.value = !1)
372
321
  }, null, 8, ["show", "title", "description", "confirm-text", "cancel-text"])
373
322
  ]));
374
323
  }
375
324
  });
376
325
  export {
377
- Qe as default
326
+ Le as default
378
327
  };
@@ -3,6 +3,7 @@ interface Props {
3
3
  header: TableHeader;
4
4
  sortConfig?: SortConfig;
5
5
  compact?: boolean;
6
+ size?: 'xs' | 'sm' | 'md' | 'lg';
6
7
  tableSortable?: boolean;
7
8
  }
8
9
  declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
@@ -10,6 +11,7 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
10
11
  }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
11
12
  onSort?: (field: string) => any;
12
13
  }>, {
14
+ size: "xs" | "sm" | "md" | "lg";
13
15
  compact: boolean;
14
16
  tableSortable: boolean;
15
17
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLTableCellElement>;
@@ -1,51 +1,52 @@
1
- import { defineComponent as g, computed as o, openBlock as n, createElementBlock as l, normalizeClass as r, createElementVNode as s, toDisplayString as x, createVNode as b, createCommentVNode as y } from "vue";
2
- import v from "../Icon.vue.js";
3
- import { $t as C } from "../../utils/i18n.js";
4
- const w = { class: "text-xs font-bold! uppercase tracking-wider text-gray-900 truncate" }, S = {
1
+ import { defineComponent as x, computed as r, openBlock as n, createElementBlock as l, normalizeClass as o, createElementVNode as s, toDisplayString as y, createVNode as b, createCommentVNode as v } from "vue";
2
+ import C from "../Icon.vue.js";
3
+ import { $t as w } from "../../utils/i18n.js";
4
+ const S = { class: "text-xs font-bold! uppercase tracking-wider text-gray-900 truncate" }, k = {
5
5
  key: 0,
6
6
  class: "w-4 h-4 shrink-0"
7
- }, M = /* @__PURE__ */ g({
7
+ }, M = /* @__PURE__ */ x({
8
8
  __name: "DataTableHeader",
9
9
  props: {
10
10
  header: {},
11
11
  sortConfig: {},
12
12
  compact: { type: Boolean, default: !1 },
13
+ size: { default: "md" },
13
14
  tableSortable: { type: Boolean, default: !0 }
14
15
  },
15
16
  emits: ["sort"],
16
17
  setup(t, { emit: i }) {
17
- const e = t, c = i, a = o(() => e.header.sortKey || e.header.field), d = o(
18
+ const e = t, c = i, a = r(() => e.header.sortKey || e.header.field), d = r(
18
19
  () => e.sortConfig?.field === a.value && e.sortConfig?.order
19
- ), f = o(() => !e.sortConfig || e.sortConfig.field !== a.value ? "lucide:chevrons-up-down" : e.sortConfig.order === "asc" ? "lucide:arrow-up" : e.sortConfig.order === "desc" ? "lucide:arrow-down" : "lucide:chevrons-up-down"), u = () => {
20
+ ), u = r(() => !e.sortConfig || e.sortConfig.field !== a.value ? "lucide:chevrons-up-down" : e.sortConfig.order === "asc" ? "lucide:arrow-up" : e.sortConfig.order === "desc" ? "lucide:arrow-down" : "lucide:chevrons-up-down"), f = () => {
20
21
  e.tableSortable && e.header.sortable !== !1 && c("sort", e.header.field);
21
- }, h = o(() => ({
22
+ }, h = r(() => ({
22
23
  left: "justify-start text-left",
23
24
  center: "justify-center text-center",
24
25
  right: "justify-end text-right"
25
- })[e.header.align || "left"]), m = o(
26
- () => e.header.titleI18n ? C(e.header.titleI18n) : e.header.title
27
- );
28
- return (p, k) => (n(), l("th", {
26
+ })[e.header.align || "left"]), m = r(
27
+ () => e.header.titleI18n ? w(e.header.titleI18n) : e.header.title
28
+ ), p = r(() => e.size === "xs" || e.compact ? "py-1.5!" : e.size === "sm" ? "py-2!" : e.size === "lg" ? "py-4!" : "py-3!");
29
+ return (g, z) => (n(), l("th", {
29
30
  scope: "col",
30
- class: r(["px-3 text-left align-middle font-medium text-muted-foreground transition-colors [&:has([role=checkbox])]:pr-0 overflow-hidden max-w-[400px]", [
31
- t.compact ? "py-2.5!" : "py-3!",
31
+ class: o(["group/th px-3 text-left align-middle font-medium text-muted-foreground transition-colors [&:has([role=checkbox])]:pr-0 overflow-hidden max-w-[400px]", [
32
+ p.value,
32
33
  t.header.sortable !== !1 && t.tableSortable ? "cursor-pointer hover:bg-muted/50" : "",
33
34
  t.header.hideOnMobile ? "hidden md:table-cell" : ""
34
35
  ]]),
35
- onClick: u
36
+ onClick: f
36
37
  }, [
37
38
  s("div", {
38
- class: r(["flex items-center gap-2 space-x-2", h.value])
39
+ class: o(["flex items-center gap-2 space-x-2", h.value])
39
40
  }, [
40
- s("span", w, x(m.value), 1),
41
- t.tableSortable && t.header.sortable !== !1 ? (n(), l("span", S, [
42
- b(v, {
43
- icon: f.value,
44
- class: r(["w-3.5 h-3.5 transition-all text-muted-foreground mt-0.5", [
45
- d.value ? "opacity-100 text-foreground" : "opacity-0 group-hover:opacity-100"
41
+ s("span", S, y(m.value), 1),
42
+ t.tableSortable && t.header.sortable !== !1 ? (n(), l("span", k, [
43
+ b(C, {
44
+ icon: u.value,
45
+ class: o(["w-3.5 h-3.5 transition-all text-muted-foreground mt-0.5", [
46
+ d.value ? "opacity-100 text-foreground" : "opacity-0 group-hover/th:opacity-100"
46
47
  ]])
47
48
  }, null, 8, ["icon", "class"])
48
- ])) : y("", !0)
49
+ ])) : v("", !0)
49
50
  ], 2)
50
51
  ], 2));
51
52
  }