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