vlite3 0.8.11 → 0.9.2

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/components/AttachmentsList/AttachmentsList.vue.d.ts +6 -0
  2. package/components/AttachmentsList/AttachmentsList.vue.js +82 -0
  3. package/components/AttachmentsList/AttachmentsList.vue2.js +4 -0
  4. package/components/AttachmentsList/index.d.ts +2 -0
  5. package/components/AttachmentsList/types.d.ts +11 -0
  6. package/components/Button.vue.js +6 -6
  7. package/components/Chat/ChatBubble.vue.d.ts +18 -0
  8. package/components/Chat/ChatInterface.vue.d.ts +45 -0
  9. package/components/Chat/index.d.ts +2 -0
  10. package/components/DataList/DataList.vue.d.ts +1 -1
  11. package/components/DataTable/DataTable.vue.d.ts +3 -3
  12. package/components/DataTable/DataTable.vue.js +22 -22
  13. package/components/DataTable/types.d.ts +1 -1
  14. package/components/DatePicker.vue.d.ts +3 -2
  15. package/components/DatePicker.vue.js +1 -1
  16. package/components/Dropdown/Dropdown.vue.d.ts +2 -0
  17. package/components/Dropdown/Dropdown.vue.js +106 -90
  18. package/components/Dropdown/DropdownItem.vue.js +8 -8
  19. package/components/Dropdown/DropdownMenu.vue.js +2 -2
  20. package/components/Dropdown/DropdownMenu.vue2.js +1 -1
  21. package/components/ExportData/ExportData.vue.d.ts +1 -1
  22. package/components/FilePicker/FilePicker.vue.d.ts +4 -1
  23. package/components/FilePicker/FilePicker.vue.js +189 -139
  24. package/components/FilePreview/FilePreview.vue.d.ts +5 -0
  25. package/components/FilePreview/FilePreview.vue.js +27 -0
  26. package/components/FilePreview/FilePreview.vue2.js +4 -0
  27. package/components/FilePreview/index.d.ts +2 -0
  28. package/components/FilePreview/types.d.ts +5 -0
  29. package/components/Form/FormField.vue.js +3 -1
  30. package/components/Form/composables/useForm.js +50 -47
  31. package/components/Input.vue.d.ts +1 -0
  32. package/components/Input.vue.js +18 -15
  33. package/components/Modal.vue.js +2 -2
  34. package/components/Modal.vue2.js +31 -31
  35. package/components/MultiSelect/MultiSelect.vue.js +92 -84
  36. package/components/Navbar/Navbar.vue.js +61 -60
  37. package/components/Screen/Screen.vue.d.ts +200 -7
  38. package/components/Screen/Screen.vue.js +306 -502
  39. package/components/Screen/ScreenFilter.vue.js +45 -42
  40. package/components/Screen/components/ScreenAddAction.vue.d.ts +15 -0
  41. package/components/Screen/components/ScreenAddAction.vue.js +107 -0
  42. package/components/Screen/components/ScreenAddAction.vue2.js +4 -0
  43. package/components/Screen/components/ScreenEmptyState.vue.d.ts +14 -0
  44. package/components/Screen/components/ScreenEmptyState.vue.js +105 -0
  45. package/components/Screen/components/ScreenEmptyState.vue2.js +4 -0
  46. package/components/Screen/components/ScreenExportModal.vue.d.ts +49 -0
  47. package/components/Screen/components/ScreenExportModal.vue.js +83 -0
  48. package/components/Screen/components/ScreenExportModal.vue2.js +4 -0
  49. package/components/Screen/components/ScreenHeaderTitle.vue.d.ts +28 -0
  50. package/components/Screen/components/ScreenHeaderTitle.vue.js +57 -0
  51. package/components/Screen/components/ScreenHeaderTitle.vue2.js +4 -0
  52. package/components/Screen/components/ScreenOptionsDropdown.vue.d.ts +10 -0
  53. package/components/Screen/components/ScreenOptionsDropdown.vue.js +43 -0
  54. package/components/Screen/components/ScreenOptionsDropdown.vue2.js +4 -0
  55. package/components/Screen/components/ScreenQuickFilters.vue.d.ts +15 -0
  56. package/components/Screen/components/ScreenQuickFilters.vue.js +36 -0
  57. package/components/Screen/components/ScreenQuickFilters.vue2.js +4 -0
  58. package/components/Screen/components/ScreenViewToggle.vue.d.ts +9 -0
  59. package/components/Screen/components/ScreenViewToggle.vue.js +48 -0
  60. package/components/Screen/components/ScreenViewToggle.vue2.js +4 -0
  61. package/components/Screen/index.d.ts +1 -0
  62. package/components/Screen/types.d.ts +41 -2
  63. package/components/SidePanel.vue.js +1 -1
  64. package/components/SidePanel.vue2.js +7 -7
  65. package/components/SidebarMenu/SidebarMenu.vue.js +1 -1
  66. package/components/Stats/Stats.vue.js +50 -49
  67. package/components/StatusChip/StatusChip.vue.d.ts +2 -2
  68. package/components/StatusChip/StatusChip.vue.js +15 -14
  69. package/components/StatusChip/status-map.d.ts +2 -1
  70. package/components/StatusChip/status-map.js +16 -6
  71. package/components/Tabes/Tabes.vue.d.ts +1 -1
  72. package/components/Tabes/Tabes.vue.js +5 -143
  73. package/components/Tabes/Tabes.vue2.js +144 -2
  74. package/components/Timeline/TimelineIndicator.vue.js +6 -6
  75. package/components/Workbook/Sheet.vue.d.ts +1 -1
  76. package/core/config.d.ts +8 -0
  77. package/core/config.js +10 -6
  78. package/core/index.js +28 -20
  79. package/index.d.ts +2 -0
  80. package/index.js +209 -203
  81. package/package.json +3 -2
  82. package/style.css +80 -6
  83. package/types/config.type.d.ts +10 -0
  84. package/types/form.type.d.ts +1 -0
@@ -1,40 +1,32 @@
1
- import { defineComponent as Re, useSlots as Ee, computed as n, ref as h, markRaw as H, provide as K, watch as J, resolveComponent as je, openBlock as a, createElementBlock as s, normalizeClass as N, createElementVNode as g, renderSlot as y, toDisplayString as p, createBlock as f, withCtx as u, createVNode as c, createCommentVNode as d, unref as x, resolveDynamicComponent as Q, Fragment as C, mergeProps as v, createTextVNode as S, renderList as Ae } from "vue";
2
- import Oe from "../Input.vue.js";
1
+ import { defineComponent as ge, useSlots as ye, computed as n, ref as s, markRaw as we, provide as F, watch as R, openBlock as o, createElementBlock as m, normalizeClass as q, createVNode as w, createSlots as ke, withCtx as Q, renderSlot as d, createElementVNode as I, createBlock as p, createCommentVNode as c, isRef as be, unref as D, Fragment as M, resolveDynamicComponent as xe, mergeProps as A, toDisplayString as Ce } from "vue";
2
+ import De from "../Input.vue.js";
3
3
  /* empty css */
4
- import w from "../Button.vue.js";
5
- import F from "../Icon.vue.js";
6
- import Ne from "../Tooltip.vue.js";
7
- import X from "../Modal.vue.js";
8
- import Fe from "../ConfirmationModal.vue.js";
9
- import Me from "../Pagination/Pagination.vue.js";
10
- import Le from "../Empty/Empty.vue.js";
11
- import Ue from "./ScreenFilter.vue.js";
12
- import qe from "../Dropdown/Dropdown.vue.js";
13
- import ze from "../ExportData/ExportData.vue.js";
14
- import He from "../ImportData/ImportData.vue.js";
15
- import { usePersistentState as Ke } from "../../utils/usePersistentState.js";
16
- import { useVLiteConfig as Je } from "../../core/config.js";
17
- import { $t as r } from "../../utils/i18n.js";
18
- import { SCREEN_CONTEXT_KEY as Qe } from "../DataTable/types.js";
19
- const Xe = { class: "flex flex-col w-full space-y-8" }, Ye = { class: "flex flex-col shrink-0" }, Ge = {
20
- key: 0,
21
- class: "flex items-center! gap-2"
22
- }, We = { class: "text-fs-7.5 font-bold text-foreground" }, Ze = {
23
- key: 0,
24
- class: "text-sm text-gray-700 mt-1 md:max-w-[450px]"
25
- }, _e = { class: "flex flex-col sm:flex-row items-start sm:items-center gap-2.5 w-full justify-end" }, et = { class: "flex items-center gap-2 w-full sm:w-auto flex-1 md:flex-none justify-start sm:justify-end" }, tt = {
26
- key: 1,
27
- class: "flex items-center p-1 rounded-md border border-border shrink-0"
28
- }, lt = ["title"], at = ["title"], nt = {
4
+ import O from "../Button.vue.js";
5
+ import Pe from "../ConfirmationModal.vue.js";
6
+ import Se from "../Pagination/Pagination.vue.js";
7
+ import $e from "./ScreenFilter.vue.js";
8
+ import Ie from "../ImportData/ImportData.vue.js";
9
+ import { usePersistentState as Be } from "../../utils/usePersistentState.js";
10
+ import { useVLiteConfig as Ve } from "../../core/config.js";
11
+ import { $t as f } from "../../utils/i18n.js";
12
+ import { SCREEN_CONTEXT_KEY as Te } from "../DataTable/types.js";
13
+ import Fe from "./components/ScreenHeaderTitle.vue.js";
14
+ import Re from "./components/ScreenViewToggle.vue.js";
15
+ import qe from "./components/ScreenOptionsDropdown.vue.js";
16
+ import Ae from "./components/ScreenAddAction.vue.js";
17
+ import Ee from "./components/ScreenEmptyState.vue.js";
18
+ import je from "./components/ScreenExportModal.vue.js";
19
+ import Ue from "./components/ScreenQuickFilters.vue.js";
20
+ const Ne = { class: "flex flex-col w-full space-y-8" }, Qe = { class: "flex flex-col sm:flex-row items-start sm:items-center gap-2.5 w-full justify-end" }, Me = { class: "flex items-center gap-2 w-full sm:w-auto flex-1 md:flex-none justify-start sm:justify-end" }, Oe = {
29
21
  key: 4,
30
22
  class: "w-full md:w-60! max-sm:order-last"
31
- }, ot = { class: "flex items-center gap-3 max-sm:w-full sm:w-auto max-sm:order-last" }, it = ["href", "target"], rt = ["href", "target"], st = {
23
+ }, Ke = { class: "flex items-center gap-3 max-sm:w-full sm:w-auto max-sm:order-last" }, Le = {
32
24
  key: 4,
33
25
  class: "p-8 text-center text-muted-foreground border border-dashed border-border rounded-lg"
34
- }, dt = {
35
- key: 2,
26
+ }, ze = {
27
+ key: 3,
36
28
  class: "-mt-2"
37
- }, ct = { class: "px-1 py-1 text-sm" }, ut = { class: "font-medium mb-3 text-muted-foreground" }, ft = { class: "space-y-3" }, mt = { key: 4 }, Et = /* @__PURE__ */ Re({
29
+ }, He = { key: 5 }, mt = /* @__PURE__ */ ge({
38
30
  __name: "Screen",
39
31
  props: {
40
32
  name: { default: "" },
@@ -79,128 +71,118 @@ const Xe = { class: "flex flex-col w-full space-y-8" }, Ye = { class: "flex flex
79
71
  showRefresh: { type: Boolean, default: !1 },
80
72
  containerClass: {},
81
73
  headerClass: {},
74
+ titleClass: {},
75
+ descriptionClass: {},
82
76
  viewProps: { default: () => ({}) },
83
- canSelectRows: { type: Boolean, default: !0 }
77
+ hideSelectable: { type: Boolean, default: !1 },
78
+ hideDeleteBtn: { type: Boolean, default: !1 },
79
+ quickFilters: { default: () => [] },
80
+ quickFilterKey: { default: "status" },
81
+ defaultQuickFilter: {},
82
+ quickFilterVariant: { default: "line" }
84
83
  },
85
84
  emits: ["add", "delete"],
86
- setup(t, { emit: ne }) {
87
- const l = t, $ = Je(), Y = ne, R = Ee(), oe = n(() => l.name || l.title || "default-screen"), B = Ke(
88
- `view-mode-${oe.value}`,
89
- l.table || R.table ? "table" : "list"
90
- ), k = h(""), b = h({}), G = h({ field: "", order: "" }), T = h(l.pageInfo?.currentPage || 1), M = h(l.pageInfo?.itemsPerPage || l.paginationProps?.itemsPerPage || 10), m = h([]), E = h([]), V = h(!1), j = n(
91
- () => l.addComponent ? H(l.addComponent) : void 0
92
- ), W = n(
93
- () => l.addBtn?.modal ? H(l.addBtn.modal) : void 0
94
- ), Z = n(() => {
85
+ setup(t, { emit: K }) {
86
+ const l = t, x = Ve(), E = K, P = ye(), L = n(() => l.name || l.title || "default-screen"), h = Be(
87
+ `view-mode-${L.value}`,
88
+ l.table || P.table ? "table" : "list"
89
+ ), g = s(""), u = s({}), j = s({ field: "", order: "" }), k = s(l.pageInfo?.currentPage || 1), B = s(l.pageInfo?.itemsPerPage || l.paginationProps?.itemsPerPage || 10), r = s([]), S = s([]), C = s(!1), y = s(
90
+ l.defaultQuickFilter !== void 0 ? l.defaultQuickFilter : l.quickFilters && l.quickFilters.length > 0 ? l.quickFilters[0].value : ""
91
+ ), z = n(() => l.quickFilters && l.quickFilters.length > 0), H = (e) => {
92
+ y.value = e, k.value = 1, v();
93
+ }, U = n(() => {
95
94
  let e;
96
- return B.value === "table" ? e = l.table || !!R.table : e = l.list || !!R.list || !!R.grid, typeof e == "object" && e !== null ? H(e) : e;
97
- }), ie = n(() => k.value && k.value.trim() !== "" ? !0 : b.value ? Object.keys(b.value).some(
98
- (e) => b.value[e] !== "" && b.value[e] !== null && b.value[e] !== void 0
99
- ) : !1), re = {
95
+ return h.value === "table" ? e = l.table || !!P.table : e = l.list || !!P.list || !!P.grid, typeof e == "object" && e !== null ? we(e) : e;
96
+ }), X = n(() => g.value && g.value.trim() !== "" ? !0 : u.value ? Object.keys(u.value).some(
97
+ (e) => u.value[e] !== "" && u.value[e] !== null && u.value[e] !== void 0
98
+ ) : !1), Y = {
100
99
  disableSearch: !0,
101
- forceSelectable: l.canSelectRows,
100
+ forceSelectable: !l.hideSelectable,
102
101
  onTableChange: (e) => {
103
- G.value = { field: e.sort.field, order: e.sort.order }, D();
102
+ j.value = { field: e.sort.field, order: e.sort.order }, v();
104
103
  }
105
104
  };
106
- K(Qe, re), K("screen-selected-rows", m), K("screen-request-delete", (e) => I(e));
107
- const I = (e) => {
108
- E.value = e, V.value = !0;
109
- }, se = () => {
110
- Y("delete", E.value), V.value = !1, m.value = [];
111
- }, de = (e) => {
112
- Y("delete", e), m.value = [];
105
+ F(Te, Y), F("screen-selected-rows", r), F("screen-request-delete", (e) => b(e));
106
+ const b = (e) => {
107
+ S.value = e, C.value = !0;
108
+ }, G = () => {
109
+ E("delete", S.value), C.value = !1, r.value = [];
110
+ }, J = (e) => {
111
+ E("delete", e), r.value = [];
113
112
  };
114
- J(
113
+ R(
115
114
  () => l.pageInfo?.currentPage,
116
115
  (e) => {
117
- e && (T.value = e);
116
+ e && (k.value = e);
118
117
  }
119
- ), J(
118
+ ), R(
120
119
  () => l.pageInfo?.itemsPerPage,
121
120
  (e) => {
122
- e && (M.value = e);
121
+ e && (B.value = e);
123
122
  }
124
123
  );
125
- let L = null;
126
- J(k, () => {
127
- L && clearTimeout(L), L = setTimeout(() => {
128
- T.value = 1, D();
124
+ let V = null;
125
+ R(g, () => {
126
+ V && clearTimeout(V), V = setTimeout(() => {
127
+ k.value = 1, v();
129
128
  }, 300);
130
129
  });
131
- const ce = (e) => {
132
- T.value = e, D();
133
- }, ue = (e) => {
134
- M.value = e, T.value = 1, D();
135
- }, D = () => {
136
- l.refetch && l.refetch({
137
- pagination: { page: T.value, limit: M.value },
138
- search: k.value,
139
- sort: { ...G.value },
140
- filter: { ...b.value }
130
+ const W = (e) => {
131
+ k.value = e, v();
132
+ }, Z = (e) => {
133
+ B.value = e, k.value = 1, v();
134
+ }, v = () => {
135
+ if (!l.refetch) return;
136
+ const e = { ...u.value };
137
+ y.value !== "" && y.value !== null && y.value !== void 0 && (e[l.quickFilterKey] = y.value), l.refetch({
138
+ pagination: { page: k.value, limit: B.value },
139
+ search: g.value,
140
+ sort: { ...j.value },
141
+ filter: e
141
142
  });
142
- }, fe = n(() => l.data && l.data.length > 0), _ = n(() => l.titleI18n ? r(l.titleI18n) : l.title), ee = n(
143
- () => l.descriptionI18n ? r(l.descriptionI18n) : l.description
144
- ), me = n(() => {
145
- const e = r("vlite.screen.deleteSelected");
143
+ }, _ = n(() => l.data && l.data.length > 0), ee = n(() => {
144
+ const e = f("vlite.screen.deleteSelected");
146
145
  return e !== "vlite.screen.deleteSelected" ? e : "Delete Selected";
147
- }), ve = n(() => {
148
- const e = r("vlite.screen.listView");
149
- return e !== "vlite.screen.listView" ? e : "List View";
150
- }), he = n(() => {
151
- const e = r("vlite.screen.tableView");
152
- return e !== "vlite.screen.tableView" ? e : "Table View";
153
- }), ge = n(() => {
154
- const e = r("vlite.screen.refresh");
146
+ }), te = n(() => {
147
+ const e = f("vlite.screen.refresh");
155
148
  return e !== "vlite.screen.refresh" ? e : "Refresh";
156
- }), pe = n(() => {
157
- const e = r("vlite.screen.searchPlaceholder");
149
+ }), le = n(() => {
150
+ const e = f("vlite.screen.searchPlaceholder");
158
151
  return e !== "vlite.screen.searchPlaceholder" ? e : "Search...";
159
- }), ye = n(() => {
160
- const e = r("vlite.screen.confirmDeleteTitle");
152
+ }), ae = n(() => {
153
+ const e = f("vlite.screen.confirmDeleteTitle");
161
154
  return e !== "vlite.screen.confirmDeleteTitle" ? e : "Confirm Deletion";
162
- }), xe = n(() => {
163
- const e = r("vlite.screen.confirmDeleteDesc", { count: E.value.length });
164
- return e !== "vlite.screen.confirmDeleteDesc" ? e : `Are you sure you want to delete the selected ${E.value.length > 1 ? "items" : "item"}?`;
165
- }), we = n(() => {
166
- const e = r("vlite.screen.confirmDeleteBtn");
155
+ }), ie = n(() => {
156
+ const e = f("vlite.screen.confirmDeleteDesc", { count: S.value.length });
157
+ return e !== "vlite.screen.confirmDeleteDesc" ? e : `Are you sure you want to delete the selected ${S.value.length > 1 ? "items" : "item"}?`;
158
+ }), ne = n(() => {
159
+ const e = f("vlite.screen.confirmDeleteBtn");
167
160
  return e !== "vlite.screen.confirmDeleteBtn" ? e : "Delete";
168
- }), be = n(() => {
169
- const e = r("vlite.screen.cancelBtn");
161
+ }), oe = n(() => {
162
+ const e = f("vlite.screen.cancelBtn");
170
163
  return e !== "vlite.screen.cancelBtn" ? e : "Cancel";
171
- }), Be = n(() => {
172
- const e = r("vlite.screen.missingView");
164
+ }), re = n(() => {
165
+ const e = f("vlite.screen.missingView");
173
166
  return e !== "vlite.screen.missingView" ? e : "Please provide a `:list` or `:table` component or slot.";
174
- }), P = n(() => {
175
- if (l.addBtn?.labelI18n) return r(l.addBtn.labelI18n);
176
- if (l.addBtn?.label) return l.addBtn.label;
177
- const e = r("vlite.screen.addNew");
178
- return e !== "vlite.screen.addNew" ? e : "Add New";
179
- }), te = n(
167
+ }), N = n(
180
168
  () => l.exportSchema && l.exportSchema.length > 0 && l.exportProps !== !1 || l.importSchema && l.importSchema.length > 0 && l.importProps !== !1
181
- ), U = n(() => {
182
- const e = r("vlite.screen.exportData");
183
- return e !== "vlite.screen.exportData" ? e : "Export Data";
184
- }), le = n(() => {
185
- const e = r("vlite.screen.importData");
169
+ ), se = n(() => {
170
+ const e = f("vlite.screen.importData");
186
171
  return e !== "vlite.screen.importData" ? e : "Import Data";
187
- }), ke = n(() => {
188
- const e = [];
189
- return l.exportProps !== !1 && e.push({ value: "export", label: U.value, icon: "lucide:download" }), l.importProps !== !1 && e.push({ value: "import", label: le.value, icon: "lucide:upload" }), e;
190
- }), q = h(null), De = h(null), A = h(!1), z = h(!1), Pe = (e) => {
191
- e.value === "export" ? A.value = !0 : e.value === "import" && (z.value = !0);
192
- }, Ce = n(
172
+ }), de = s(null), $ = s(!1), T = s(!1), ce = (e) => {
173
+ e.value === "export" ? $.value = !0 : e.value === "import" && (T.value = !0);
174
+ }, ue = n(
193
175
  () => (l.exportSchema || []).map((e) => ({
194
176
  field: e.name || e.field,
195
177
  title: e.label || e.title || e.name || e.field
196
178
  }))
197
- ), Se = n(
179
+ ), me = n(
198
180
  () => (l.importSchema || []).map((e) => ({
199
181
  field: e.name || e.field,
200
182
  title: e.label || e.title || e.name || e.field,
201
183
  required: e.required || !1
202
184
  }))
203
- ), Ie = async (e) => $?.services?.importApi && l.importType ? await $.services.importApi(l.importType, e) : (console.warn(
185
+ ), fe = async (e) => x?.services?.importApi && l.importType ? await x.services.importApi(l.importType, e) : (console.warn(
204
186
  "VLite Screen: No importApi configured or no importType provided for generic import."
205
187
  ), {
206
188
  processed: e.data.length,
@@ -209,405 +191,227 @@ const Xe = { class: "flex flex-col w-full space-y-8" }, Ye = { class: "flex flex
209
191
  skipped: 0,
210
192
  failed: 0,
211
193
  errors: []
212
- }), $e = () => D(), Te = n(
213
- () => l.exportMode || $?.exportData?.mode || "frontend"
214
- ), Ve = async (e) => {
215
- $?.services?.exportApi && l.exportType ? await $.services.exportApi(l.exportType, {
194
+ }), ve = () => v(), pe = n(
195
+ () => l.exportMode || x?.exportData?.mode || "frontend"
196
+ ), he = async (e) => {
197
+ x?.services?.exportApi && l.exportType ? await x.services.exportApi(l.exportType, {
216
198
  format: e,
217
- search: k.value,
218
- filter: b.value
199
+ search: g.value,
200
+ filter: u.value
219
201
  }) : console.warn(
220
202
  "VLite Screen: No exportApi configured or no exportType provided for generic backend export."
221
203
  );
222
204
  };
223
- return (e, i) => {
224
- const ae = je("router-link");
225
- return a(), s("div", Xe, [
226
- t.customHeader ? y(e.$slots, "custom-header", { key: 1 }) : (a(), s("div", {
227
- key: 0,
228
- class: N([t.headerClass, "flex flex-col md:flex-row sm:items-start md:items-center justify-between gap-4"])
229
- }, [
230
- g("div", Ye, [
231
- y(e.$slots, "title", {}, () => [
232
- _.value ? (a(), s("div", Ge, [
233
- g("h1", We, p(_.value), 1),
234
- t.info || t.infoI18n ? (a(), f(Ne, {
235
- key: 0,
236
- content: t.info,
237
- "content-i18n": t.infoI18n,
238
- placement: "right"
239
- }, {
240
- default: u(() => [
241
- c(F, {
242
- icon: "lucide:info",
243
- class: "w-[18px] h-[18px] mt-3! text-muted-foreground hover:text-foreground cursor-pointer transition-colors outline-none"
244
- })
245
- ]),
246
- _: 1
247
- }, 8, ["content", "content-i18n"])) : d("", !0)
248
- ])) : d("", !0)
205
+ return (e, i) => (o(), m("div", Ne, [
206
+ t.customHeader ? d(e.$slots, "custom-header", { key: 1 }) : (o(), m("div", {
207
+ key: 0,
208
+ class: q([t.headerClass, "flex flex-col md:flex-row sm:items-start md:items-center justify-between gap-4"])
209
+ }, [
210
+ w(Fe, {
211
+ title: t.title,
212
+ "title-i18n": t.titleI18n,
213
+ "title-class": t.titleClass,
214
+ description: t.description,
215
+ "description-i18n": t.descriptionI18n,
216
+ "description-class": t.descriptionClass,
217
+ info: t.info,
218
+ "info-i18n": t.infoI18n
219
+ }, ke({ _: 2 }, [
220
+ e.$slots.title ? {
221
+ name: "title",
222
+ fn: Q(() => [
223
+ d(e.$slots, "title")
249
224
  ]),
250
- y(e.$slots, "description", {}, () => [
251
- ee.value ? (a(), s("p", Ze, p(ee.value), 1)) : d("", !0)
252
- ])
253
- ]),
254
- g("div", _e, [
255
- g("div", et, [
256
- m.value.length > 0 && t.canSelectRows ? (a(), f(w, {
257
- key: 0,
258
- variant: "outline",
259
- class: "hover:bg-destructive/10 shrink-0 h-9! w-9!",
260
- icon: "lucide:trash-2",
261
- title: me.value,
262
- onClick: i[0] || (i[0] = (o) => I(m.value))
263
- }, null, 8, ["title"])) : d("", !0),
264
- (t.table || e.$slots.table) && (t.list || e.$slots.list || e.$slots.grid) ? (a(), s("div", tt, [
265
- g("button", {
266
- onClick: i[1] || (i[1] = (o) => B.value = "list"),
267
- class: N(["p-1.5 rounded", [
268
- x(B) === "list" ? "bg-secondary/85 dark:bg-secondary shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
269
- ]]),
270
- title: ve.value
271
- }, [
272
- c(F, {
273
- icon: "lucide:layout-grid",
274
- class: "w-4 h-4"
275
- })
276
- ], 10, lt),
277
- g("button", {
278
- onClick: i[2] || (i[2] = (o) => B.value = "table"),
279
- class: N(["p-1.5 rounded", [
280
- x(B) === "table" ? "bg-secondary/85 dark:bg-secondary shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
281
- ]]),
282
- title: he.value
283
- }, [
284
- c(F, {
285
- icon: "lucide:list",
286
- class: "w-4 h-4"
287
- })
288
- ], 10, at)
289
- ])) : d("", !0),
290
- y(e.$slots, "before-search"),
291
- t.showRefresh ? (a(), f(w, {
292
- key: 2,
293
- variant: "outline",
294
- icon: "lucide:refresh-cw",
295
- size: "lg",
296
- class: "shrink-0 h-9! w-9!",
297
- title: ge.value,
298
- disabled: t.loading,
299
- onClick: D
300
- }, null, 8, ["title", "disabled"])) : d("", !0),
301
- t.filterSchema && t.filterSchema.length > 0 ? (a(), f(Ue, {
302
- key: 3,
303
- schema: t.filterSchema,
304
- type: t.filterType,
305
- modelValue: b.value,
306
- "onUpdate:modelValue": i[3] || (i[3] = (o) => b.value = o),
307
- onChange: D
308
- }, null, 8, ["schema", "type", "modelValue"])) : d("", !0),
309
- t.canSearch ? (a(), s("div", nt, [
310
- c(Oe, {
311
- lazy: "",
312
- modelValue: k.value,
313
- "onUpdate:modelValue": i[4] || (i[4] = (o) => k.value = o),
314
- icon: "lucide:search",
315
- placeholder: pe.value,
316
- variant: "outline",
317
- class: "bg-background w-full",
318
- "show-clear-button": !0
319
- }, null, 8, ["modelValue", "placeholder"])
320
- ])) : d("", !0)
225
+ key: "0"
226
+ } : void 0,
227
+ e.$slots.description ? {
228
+ name: "description",
229
+ fn: Q(() => [
230
+ d(e.$slots, "description")
321
231
  ]),
322
- g("div", ot, [
323
- y(e.$slots, "actions", {}, () => [
324
- j.value ? (a(), f(Q(j.value), { key: 0 })) : t.canAdd ? (a(), s(C, { key: 1 }, [
325
- t.addBtn ? (a(), s(C, { key: 0 }, [
326
- t.addBtn.modal ? (a(), f(X, v({
327
- key: 0,
328
- body: W.value
329
- }, t.addBtn.modalProps, {
330
- refetch: t.refetch,
331
- data: t.data,
332
- triggerClass: "w-full",
333
- loading: t.loading
334
- }), {
335
- trigger: u(() => [
336
- c(w, v({
337
- class: "w-full",
338
- icon: t.addBtn.icon || "fluent:add-16-filled",
339
- variant: t.addBtn.variant || "primary"
340
- }, t.addBtn.buttonProps), {
341
- default: u(() => [
342
- S(p(P.value), 1)
343
- ]),
344
- _: 1
345
- }, 16, ["icon", "variant"])
346
- ]),
347
- _: 1
348
- }, 16, ["body", "refetch", "data", "loading"])) : t.addBtn.to ? (a(), f(ae, {
349
- key: 1,
350
- to: t.addBtn.to,
351
- class: "inline-flex w-full sm:w-auto"
352
- }, {
353
- default: u(() => [
354
- c(w, v({
355
- class: "w-full",
356
- icon: t.addBtn.icon || "fluent:add-16-filled",
357
- variant: t.addBtn.variant || "primary"
358
- }, t.addBtn.buttonProps), {
359
- default: u(() => [
360
- S(p(P.value), 1)
361
- ]),
362
- _: 1
363
- }, 16, ["icon", "variant"])
364
- ]),
365
- _: 1
366
- }, 8, ["to"])) : t.addBtn.href ? (a(), s("a", {
367
- key: 2,
368
- href: t.addBtn.href,
369
- target: t.addBtn.target,
370
- class: "inline-flex w-full sm:w-auto"
371
- }, [
372
- c(w, v({
373
- class: "w-full",
374
- icon: t.addBtn.icon || "fluent:add-16-filled",
375
- variant: t.addBtn.variant || "primary"
376
- }, t.addBtn.buttonProps), {
377
- default: u(() => [
378
- S(p(P.value), 1)
379
- ]),
380
- _: 1
381
- }, 16, ["icon", "variant"])
382
- ], 8, it)) : (a(), f(w, v({
383
- key: 3,
384
- class: "w-full sm:w-auto",
385
- icon: t.addBtn.icon || "fluent:add-16-filled",
386
- variant: t.addBtn.variant || "primary"
387
- }, t.addBtn.buttonProps, {
388
- onClick: i[5] || (i[5] = (o) => t.addBtn.onClick ? t.addBtn.onClick() : e.$emit("add"))
389
- }), {
390
- default: u(() => [
391
- S(p(P.value), 1)
392
- ]),
393
- _: 1
394
- }, 16, ["icon", "variant"]))
395
- ], 64)) : d("", !0)
396
- ], 64)) : d("", !0)
397
- ]),
398
- te.value ? (a(), f(qe, {
399
- key: 0,
400
- closeOnSelect: "",
401
- position: "bottom-end",
402
- options: ke.value,
403
- onOnSelect: Pe
404
- }, {
405
- trigger: u(() => [
406
- c(w, {
407
- variant: "outline",
408
- icon: "lucide:more-vertical",
409
- class: "px-2!",
410
- title: x(r)("vlite.screen.moreOptions") !== "vlite.screen.moreOptions" ? x(r)("vlite.screen.moreOptions") : "More Options"
411
- }, null, 8, ["title"])
412
- ]),
413
- _: 1
414
- }, 8, ["options"])) : d("", !0),
415
- y(e.$slots, "after-add")
416
- ])
417
- ])
418
- ], 2)),
419
- y(e.$slots, "sub-header"),
420
- g("div", {
421
- class: N(["flex-1 w-full relative", t.containerClass])
422
- }, [
423
- !fe.value && !t.loading ? y(e.$slots, "empty", { key: 0 }, () => [
424
- c(x(Le), {
425
- title: t.emptyTitle,
426
- titleI18n: t.emptyTitleI18n,
427
- description: t.emptyDescription,
428
- descriptionI18n: t.emptyDescriptionI18n,
429
- icon: t.emptyIcon
430
- }, {
431
- action: u(() => [
432
- ie.value ? d("", !0) : (a(), s(C, { key: 0 }, [
433
- j.value ? (a(), f(Q(j.value), { key: 0 })) : t.canAdd ? (a(), s(C, { key: 1 }, [
434
- t.addBtn ? (a(), s(C, { key: 0 }, [
435
- t.addBtn.modal ? (a(), f(X, v({
436
- key: 0,
437
- body: W.value
438
- }, t.addBtn.modalProps), {
439
- trigger: u(() => [
440
- c(w, v({
441
- icon: t.addBtn.icon || "fluent:add-16-filled",
442
- variant: "secondary",
443
- rounded: "full",
444
- class: "px-6!"
445
- }, t.addBtn.buttonProps), {
446
- default: u(() => [
447
- S(p(P.value), 1)
448
- ]),
449
- _: 1
450
- }, 16, ["icon"])
451
- ]),
452
- _: 1
453
- }, 16, ["body"])) : t.addBtn.to ? (a(), f(ae, {
454
- key: 1,
455
- to: t.addBtn.to,
456
- class: "inline-flex"
457
- }, {
458
- default: u(() => [
459
- c(w, v({
460
- icon: t.addBtn.icon || "fluent:add-16-filled",
461
- variant: "secondary"
462
- }, t.addBtn.buttonProps), {
463
- default: u(() => [
464
- S(p(P.value), 1)
465
- ]),
466
- _: 1
467
- }, 16, ["icon"])
468
- ]),
469
- _: 1
470
- }, 8, ["to"])) : t.addBtn.href ? (a(), s("a", {
471
- key: 2,
472
- href: t.addBtn.href,
473
- target: t.addBtn.target,
474
- class: "inline-flex"
475
- }, [
476
- c(w, v({
477
- icon: t.addBtn.icon || "lucide:plus",
478
- variant: "secondary"
479
- }, t.addBtn.buttonProps), {
480
- default: u(() => [
481
- S(p(P.value), 1)
482
- ]),
483
- _: 1
484
- }, 16, ["icon"])
485
- ], 8, rt)) : d("", !0)
486
- ], 64)) : d("", !0)
487
- ], 64)) : d("", !0)
488
- ], 64))
489
- ]),
490
- _: 1
491
- }, 8, ["title", "titleI18n", "description", "descriptionI18n", "icon"])
492
- ]) : (a(), s(C, { key: 1 }, [
493
- x(B) === "table" && e.$slots.table ? y(e.$slots, "table", {
232
+ key: "1"
233
+ } : void 0
234
+ ]), 1032, ["title", "title-i18n", "title-class", "description", "description-i18n", "description-class", "info", "info-i18n"]),
235
+ I("div", Qe, [
236
+ I("div", Me, [
237
+ r.value.length > 0 && !t.hideSelectable && !t.hideDeleteBtn ? (o(), p(O, {
494
238
  key: 0,
495
- data: t.data,
496
- loading: t.loading,
497
- selectedRows: m.value,
498
- delete: I,
499
- updateSelectedRows: (o) => m.value = o
500
- }) : x(B) === "list" && e.$slots.list ? y(e.$slots, "list", {
239
+ variant: "outline",
240
+ class: "hover:bg-destructive/10 shrink-0 h-9! w-9!",
241
+ icon: "lucide:trash-2",
242
+ title: ee.value,
243
+ onClick: i[0] || (i[0] = (a) => b(r.value))
244
+ }, null, 8, ["title"])) : c("", !0),
245
+ (t.table || e.$slots.table) && (t.list || e.$slots.list || e.$slots.grid) ? (o(), p(Re, {
501
246
  key: 1,
502
- data: t.data,
503
- loading: t.loading,
504
- selectedRows: m.value,
505
- delete: I,
506
- updateSelectedRows: (o) => m.value = o
507
- }) : x(B) === "list" && e.$slots.grid ? y(e.$slots, "grid", {
247
+ modelValue: D(h),
248
+ "onUpdate:modelValue": i[1] || (i[1] = (a) => be(h) ? h.value = a : null)
249
+ }, null, 8, ["modelValue"])) : c("", !0),
250
+ d(e.$slots, "before-search"),
251
+ t.showRefresh ? (o(), p(O, {
508
252
  key: 2,
509
- data: t.data,
510
- loading: t.loading,
511
- selectedRows: m.value,
512
- delete: I,
513
- updateSelectedRows: (o) => m.value = o
514
- }) : Z.value ? (a(), f(Q(Z.value), v({
253
+ variant: "outline",
254
+ icon: "lucide:refresh-cw",
255
+ size: "lg",
256
+ class: "shrink-0 h-9! w-9!",
257
+ title: te.value,
258
+ disabled: t.loading,
259
+ onClick: v
260
+ }, null, 8, ["title", "disabled"])) : c("", !0),
261
+ t.filterSchema && t.filterSchema.length > 0 ? (o(), p($e, {
515
262
  key: 3,
516
- data: t.data,
517
- loading: t.loading,
518
- refetch: t.refetch,
519
- selectedRows: m.value,
520
- "onUpdate:selectedRows": i[6] || (i[6] = (o) => m.value = o),
521
- delete: I,
522
- onDelete: de
523
- }, t.viewProps), null, 16, ["data", "loading", "refetch", "selectedRows"])) : (a(), s("div", st, p(Be.value), 1))
524
- ], 64))
525
- ], 2),
526
- t.pagination && t.pageInfo && t.pageInfo.totalPages > 1 ? (a(), s("div", dt, [
527
- c(x(Me), v({
528
- "current-page": t.pageInfo.currentPage,
529
- "total-pages": t.pageInfo.totalPages,
530
- "total-items": t.pageInfo.totalItems
531
- }, t.paginationProps, {
532
- onChange: ce,
533
- "onUpdate:itemsPerPage": ue
534
- }), null, 16, ["current-page", "total-pages", "total-items"])
535
- ])) : d("", !0),
536
- c(Fe, {
537
- show: V.value,
538
- "onUpdate:show": i[7] || (i[7] = (o) => V.value = o),
539
- title: ye.value,
540
- description: xe.value,
541
- "confirm-text": we.value,
542
- "cancel-text": be.value,
543
- variant: "danger",
544
- onConfirm: se,
545
- onCancel: i[8] || (i[8] = (o) => V.value = !1)
546
- }, null, 8, ["show", "title", "description", "confirm-text", "cancel-text"]),
547
- A.value ? (a(), f(X, {
548
- key: 3,
549
- show: A.value,
550
- "onUpdate:show": i[9] || (i[9] = (o) => A.value = o),
551
- title: U.value,
552
- "max-width": "sm:max-w-[400px]"
553
- }, {
554
- default: u(({ close: o }) => [
555
- c(ze, v({
556
- ref_key: "exportDataRef",
557
- ref: q,
558
- data: t.data || [],
559
- fields: Ce.value,
560
- mode: Te.value,
561
- "on-export": Ve
562
- }, typeof t.exportProps == "object" ? t.exportProps : {}, {
563
- title: U.value,
564
- class: "hidden!"
565
- }), null, 16, ["data", "fields", "mode", "title"]),
566
- g("div", ct, [
567
- g("h6", ut, p(x(r)("vlite.exportData.selectFormat") !== "vlite.exportData.selectFormat" ? x(r)("vlite.exportData.selectFormat") : "Select Export Format"), 1),
568
- g("div", ft, [
569
- (a(!0), s(C, null, Ae(q.value?.availableFormats || [
570
- { value: "excel", label: "Excel (.xlsx)", icon: "lucide:file-spreadsheet" },
571
- { value: "csv", label: "CSV (.csv)", icon: "lucide:file-text" },
572
- { value: "json", label: "JSON (.json)", icon: "lucide:file-json" }
573
- ], (O) => (a(), f(w, {
574
- key: O.value,
575
- variant: "outline",
576
- class: "w-full flex items-center justify-start gap-3 h-12",
577
- onClick: (vt) => q.value?.exportData(O.value, o)
578
- }, {
579
- default: u(() => [
580
- c(F, {
581
- icon: O.icon,
582
- class: "text-muted-foreground h-5 w-5"
583
- }, null, 8, ["icon"]),
584
- g("span", null, p(O.label), 1)
585
- ]),
586
- _: 2
587
- }, 1032, ["onClick"]))), 128))
588
- ])
589
- ])
263
+ schema: t.filterSchema,
264
+ type: t.filterType,
265
+ modelValue: u.value,
266
+ "onUpdate:modelValue": i[2] || (i[2] = (a) => u.value = a),
267
+ onChange: v
268
+ }, null, 8, ["schema", "type", "modelValue"])) : c("", !0),
269
+ t.canSearch ? (o(), m("div", Oe, [
270
+ w(De, {
271
+ lazy: "",
272
+ modelValue: g.value,
273
+ "onUpdate:modelValue": i[3] || (i[3] = (a) => g.value = a),
274
+ icon: "lucide:search",
275
+ placeholder: le.value,
276
+ variant: "outline",
277
+ class: "bg-background w-full",
278
+ "show-clear-button": !0
279
+ }, null, 8, ["modelValue", "placeholder"])
280
+ ])) : c("", !0)
590
281
  ]),
591
- _: 1
592
- }, 8, ["show", "title"])) : d("", !0),
593
- te.value ? (a(), s("div", mt, [
594
- c(He, v({
595
- show: z.value,
596
- "onUpdate:show": i[10] || (i[10] = (o) => z.value = o),
597
- ref_key: "importDataRef",
598
- ref: De,
599
- fields: Se.value,
600
- processBatch: Ie,
601
- onComplete: $e
602
- }, typeof t.importProps == "object" ? t.importProps : {}, {
603
- title: le.value,
604
- class: "hidden!"
605
- }), null, 16, ["show", "fields", "title"])
606
- ])) : d("", !0)
607
- ]);
608
- };
282
+ I("div", Ke, [
283
+ d(e.$slots, "actions", {}, () => [
284
+ w(Ae, {
285
+ "can-add": t.canAdd,
286
+ "add-component": t.addComponent,
287
+ "add-btn": t.addBtn,
288
+ loading: t.loading,
289
+ data: t.data,
290
+ refetch: t.refetch,
291
+ onAdd: i[4] || (i[4] = (a) => e.$emit("add"))
292
+ }, null, 8, ["can-add", "add-component", "add-btn", "loading", "data", "refetch"])
293
+ ]),
294
+ N.value ? (o(), p(qe, {
295
+ key: 0,
296
+ "export-props": t.exportProps,
297
+ "import-props": t.importProps,
298
+ onSelect: ce
299
+ }, null, 8, ["export-props", "import-props"])) : c("", !0),
300
+ d(e.$slots, "after-add")
301
+ ])
302
+ ])
303
+ ], 2)),
304
+ d(e.$slots, "sub-header"),
305
+ z.value ? (o(), m("div", {
306
+ key: 2,
307
+ class: q(["-mt-1", t.quickFilterVariant == "line" ? "mb-1.5 sm:mb-1" : "mb-2"])
308
+ }, [
309
+ w(Ue, {
310
+ modelValue: y.value,
311
+ "onUpdate:modelValue": i[5] || (i[5] = (a) => y.value = a),
312
+ options: t.quickFilters,
313
+ variant: t.quickFilterVariant,
314
+ onChange: H
315
+ }, null, 8, ["modelValue", "options", "variant"])
316
+ ], 2)) : c("", !0),
317
+ I("div", {
318
+ class: q(["flex-1 w-full relative", t.containerClass])
319
+ }, [
320
+ !_.value && !t.loading ? (o(), m(M, { key: 0 }, [
321
+ e.$slots.empty ? d(e.$slots, "empty", { key: 0 }) : (o(), p(Ee, {
322
+ key: 1,
323
+ "empty-title": t.emptyTitle,
324
+ "empty-title-i18n": t.emptyTitleI18n,
325
+ "empty-description": t.emptyDescription,
326
+ "empty-description-i18n": t.emptyDescriptionI18n,
327
+ "empty-icon": t.emptyIcon,
328
+ "is-filtered": X.value,
329
+ "can-add": t.canAdd,
330
+ "add-component": t.addComponent,
331
+ "add-btn": t.addBtn
332
+ }, null, 8, ["empty-title", "empty-title-i18n", "empty-description", "empty-description-i18n", "empty-icon", "is-filtered", "can-add", "add-component", "add-btn"]))
333
+ ], 64)) : (o(), m(M, { key: 1 }, [
334
+ D(h) === "table" && e.$slots.table ? d(e.$slots, "table", {
335
+ key: 0,
336
+ data: t.data,
337
+ loading: t.loading,
338
+ selectedRows: r.value,
339
+ delete: b,
340
+ updateSelectedRows: (a) => r.value = a
341
+ }) : D(h) === "list" && e.$slots.list ? d(e.$slots, "list", {
342
+ key: 1,
343
+ data: t.data,
344
+ loading: t.loading,
345
+ selectedRows: r.value,
346
+ delete: b,
347
+ updateSelectedRows: (a) => r.value = a
348
+ }) : D(h) === "list" && e.$slots.grid ? d(e.$slots, "grid", {
349
+ key: 2,
350
+ data: t.data,
351
+ loading: t.loading,
352
+ selectedRows: r.value,
353
+ delete: b,
354
+ updateSelectedRows: (a) => r.value = a
355
+ }) : U.value ? (o(), p(xe(U.value), A({
356
+ key: 3,
357
+ data: t.data,
358
+ loading: t.loading,
359
+ refetch: t.refetch,
360
+ selectedRows: r.value,
361
+ "onUpdate:selectedRows": i[6] || (i[6] = (a) => r.value = a),
362
+ delete: b,
363
+ onDelete: J
364
+ }, t.viewProps), null, 16, ["data", "loading", "refetch", "selectedRows"])) : (o(), m("div", Le, Ce(re.value), 1))
365
+ ], 64))
366
+ ], 2),
367
+ t.pagination && t.pageInfo && t.pageInfo.totalPages > 1 ? (o(), m("div", ze, [
368
+ w(D(Se), A({
369
+ "current-page": t.pageInfo.currentPage,
370
+ "total-pages": t.pageInfo.totalPages,
371
+ "total-items": t.pageInfo.totalItems
372
+ }, t.paginationProps, {
373
+ onChange: W,
374
+ "onUpdate:itemsPerPage": Z
375
+ }), null, 16, ["current-page", "total-pages", "total-items"])
376
+ ])) : c("", !0),
377
+ w(Pe, {
378
+ show: C.value,
379
+ "onUpdate:show": i[7] || (i[7] = (a) => C.value = a),
380
+ title: ae.value,
381
+ description: ie.value,
382
+ "confirm-text": ne.value,
383
+ "cancel-text": oe.value,
384
+ variant: "danger",
385
+ onConfirm: G,
386
+ onCancel: i[8] || (i[8] = (a) => C.value = !1)
387
+ }, null, 8, ["show", "title", "description", "confirm-text", "cancel-text"]),
388
+ $.value ? (o(), p(je, {
389
+ key: 4,
390
+ show: $.value,
391
+ "onUpdate:show": i[9] || (i[9] = (a) => $.value = a),
392
+ data: t.data || [],
393
+ fields: ue.value,
394
+ mode: pe.value,
395
+ "export-props": t.exportProps,
396
+ "on-export": he
397
+ }, null, 8, ["show", "data", "fields", "mode", "export-props"])) : c("", !0),
398
+ N.value ? (o(), m("div", He, [
399
+ w(Ie, A({
400
+ show: T.value,
401
+ "onUpdate:show": i[10] || (i[10] = (a) => T.value = a),
402
+ ref_key: "importDataRef",
403
+ ref: de,
404
+ fields: me.value,
405
+ processBatch: fe,
406
+ onComplete: ve
407
+ }, typeof t.importProps == "object" ? t.importProps : {}, {
408
+ title: se.value,
409
+ class: "hidden!"
410
+ }), null, 16, ["show", "fields", "title"])
411
+ ])) : c("", !0)
412
+ ]));
609
413
  }
610
414
  });
611
415
  export {
612
- Et as default
416
+ mt as default
613
417
  };