vlite3 1.0.4 → 1.0.6

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 (49) hide show
  1. package/components/AttachmentsList/AttachmentsList.vue.d.ts +19 -3
  2. package/components/AttachmentsList/AttachmentsList.vue.js +274 -111
  3. package/components/AttachmentsList/fileTypeIcon.d.ts +16 -0
  4. package/components/AttachmentsList/fileTypeIcon.js +127 -0
  5. package/components/AttachmentsList/index.d.ts +1 -0
  6. package/components/AttachmentsList/types.d.ts +74 -2
  7. package/components/Avatar.vue.js +2 -2
  8. package/components/Badge.vue.js +7 -7
  9. package/components/Button.vue.js +36 -43
  10. package/components/ButtonGroup.vue.js +2 -2
  11. package/components/ButtonGroup.vue2.js +8 -8
  12. package/components/CategoryManager/CategoryManager.vue.d.ts +36 -0
  13. package/components/CategoryManager/CategoryNode.vue.d.ts +15 -0
  14. package/components/CategoryManager/index.d.ts +2 -0
  15. package/components/CategoryManager/types.d.ts +43 -0
  16. package/components/Chat/ChatBubble.vue.js +70 -56
  17. package/components/Chat/ChatInterface.vue.js +182 -142
  18. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  19. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  20. package/components/Dropdown/DropdownMenu.vue.js +2 -2
  21. package/components/Dropdown/DropdownMenu.vue2.js +1 -0
  22. package/components/FilePicker/FilePicker.vue.js +117 -122
  23. package/components/Input.vue.js +28 -26
  24. package/components/Kanban/Kanban.vue.d.ts +7 -16
  25. package/components/Kanban/Kanban.vue.js +1 -1
  26. package/components/Kanban/Kanban.vue2.js +79 -47
  27. package/components/Kanban/KanbanBoard.vue.js +2 -2
  28. package/components/Kanban/KanbanBoard.vue2.js +21 -21
  29. package/components/Kanban/types.d.ts +3 -0
  30. package/components/List/List.vue.js +89 -85
  31. package/components/Navbar/Navbar.vue.d.ts +4 -0
  32. package/components/Navbar/Navbar.vue.js +196 -173
  33. package/components/Navbar/NavbarTabs.vue.js +72 -66
  34. package/components/NavbarCommandPalette.vue.js +11 -11
  35. package/components/NumberInput.vue.js +2 -2
  36. package/components/NumberInput.vue2.js +144 -104
  37. package/components/Screen/Screen.vue.d.ts +12 -29
  38. package/components/Screen/Screen.vue.js +228 -195
  39. package/components/Screen/components/ScreenViewToggle.vue.d.ts +6 -3
  40. package/components/Screen/components/ScreenViewToggle.vue.js +29 -34
  41. package/components/Screen/types.d.ts +59 -7
  42. package/components/Stats/Stats.vue.d.ts +1 -0
  43. package/components/Stats/Stats.vue.js +184 -156
  44. package/components/Stats/types.d.ts +1 -0
  45. package/components/Workbook/Sheet.vue.d.ts +1 -1
  46. package/directives/vRipple.js +28 -9
  47. package/index.js +87 -85
  48. package/package.json +1 -1
  49. package/style.css +1 -1
@@ -1,32 +1,32 @@
1
- import { defineComponent as ge, useSlots as ye, computed as o, ref as s, markRaw as we, provide as R, watch as q, openBlock as n, createElementBlock as f, normalizeClass as A, createVNode as w, createSlots as ke, withCtx as Q, renderSlot as d, createElementVNode as B, createBlock as h, createCommentVNode as u, isRef as be, unref as P, Fragment as M, resolveDynamicComponent as xe, mergeProps as E, toDisplayString as Ce } from "vue";
2
- import De from "../Input.vue.js";
1
+ import { defineComponent as Pe, useSlots as Ve, computed as n, markRaw as Q, ref as s, provide as U, watch as N, openBlock as o, createElementBlock as h, normalizeClass as M, createVNode as S, createSlots as $e, withCtx as X, renderSlot as c, normalizeProps as k, guardReactiveProps as V, createElementVNode as R, createBlock as b, createCommentVNode as v, isRef as Ie, unref as Y, mergeProps as x, Fragment as G, resolveDynamicComponent as Fe, toDisplayString as Be } from "vue";
2
+ import Te from "../Input.vue.js";
3
3
  /* empty css */
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 v } 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 = {
4
+ import J from "../Button.vue.js";
5
+ import Re from "../ConfirmationModal.vue.js";
6
+ import qe from "../Pagination/Pagination.vue.js";
7
+ import Ee from "./ScreenFilter.vue.js";
8
+ import Ae from "../ImportData/ImportData.vue.js";
9
+ import { usePersistentState as je } from "../../utils/usePersistentState.js";
10
+ import { useVLiteConfig as Qe } from "../../core/config.js";
11
+ import { $t as g } from "../../utils/i18n.js";
12
+ import { SCREEN_CONTEXT_KEY as Ue } from "../DataTable/types.js";
13
+ import Ne from "./components/ScreenHeaderTitle.vue.js";
14
+ import Me from "./components/ScreenViewToggle.vue.js";
15
+ import Oe from "./components/ScreenOptionsDropdown.vue.js";
16
+ import Le from "./components/ScreenAddAction.vue.js";
17
+ import ze from "./components/ScreenEmptyState.vue.js";
18
+ import Ke from "./components/ScreenExportModal.vue.js";
19
+ import He from "./components/ScreenQuickFilters.vue.js";
20
+ const Xe = { class: "flex flex-col w-full space-y-8" }, Ye = { class: "flex flex-col sm:flex-row items-start sm:items-center gap-2.5 w-full justify-end" }, Ge = { class: "flex items-center gap-2 w-full sm:w-auto flex-1 md:flex-none justify-start sm:justify-end" }, Je = {
21
21
  key: 4,
22
22
  class: "w-full md:w-60! max-sm:order-last"
23
- }, Ke = { class: "flex items-center gap-3 max-sm:w-full sm:w-auto max-sm:order-last" }, Le = {
23
+ }, We = { class: "flex items-center gap-3 max-sm:w-full sm:w-auto max-sm:order-last" }, Ze = {
24
24
  key: 4,
25
25
  class: "p-8 text-center text-muted-foreground border border-dashed border-border rounded-lg"
26
- }, ze = {
26
+ }, _e = {
27
27
  key: 3,
28
28
  class: "-mt-2"
29
- }, He = { key: 5 }, mt = /* @__PURE__ */ ge({
29
+ }, et = { key: 5 }, kt = /* @__PURE__ */ Pe({
30
30
  __name: "Screen",
31
31
  props: {
32
32
  name: { default: "" },
@@ -62,6 +62,7 @@ const Ne = { class: "flex flex-col w-full space-y-8" }, Qe = { class: "flex flex
62
62
  exportType: {},
63
63
  list: {},
64
64
  table: {},
65
+ views: {},
65
66
  customHeader: { type: Boolean, default: !1 },
66
67
  canSearch: { type: Boolean, default: !0 },
67
68
  canAdd: { type: Boolean, default: !0 },
@@ -77,113 +78,144 @@ const Ne = { class: "flex flex-col w-full space-y-8" }, Qe = { class: "flex flex
77
78
  hideSelectable: { type: Boolean, default: !1 },
78
79
  hideDeleteBtn: { type: Boolean, default: !1 },
79
80
  quickFilters: { default: () => [] },
81
+ quickFilterViews: {},
80
82
  quickFilterKey: { default: "status" },
81
83
  defaultQuickFilter: {},
82
- quickFilterVariant: { default: "line" }
84
+ quickFilterVariant: { default: "line" },
85
+ skipEmptyViews: { default: () => [] }
83
86
  },
84
87
  emits: ["add", "delete"],
85
- setup(t, { emit: K }) {
86
- const l = t, x = Ve(), j = K, S = ye(), L = o(() => l.name || l.title || "default-screen"), g = Be(
87
- `view-mode-${L.value}`,
88
- l.table || S.table ? "table" : "list"
89
- ), y = s(""), m = s({}), C = s({ field: "", order: "" }), k = s(l.pageInfo?.currentPage || 1), V = s(l.pageInfo?.itemsPerPage || l.paginationProps?.itemsPerPage || 10), r = s([]), $ = s([]), D = s(!1), c = s(
88
+ setup(t, { emit: W }) {
89
+ const l = t, $ = Qe(), O = W, p = Ve(), Z = n(() => l.name || l.title || "default-screen"), q = n(() => {
90
+ if (l.views && l.views.length > 0)
91
+ return l.views.map((a) => ({
92
+ ...a,
93
+ component: typeof a.component == "object" && a.component !== null ? Q(a.component) : a.component
94
+ }));
95
+ const e = [];
96
+ return l.table && e.push({
97
+ key: "table",
98
+ component: Q(l.table),
99
+ icon: "lucide:list",
100
+ label: "Table View"
101
+ }), l.list && e.push({
102
+ key: "list",
103
+ component: Q(l.list),
104
+ icon: "lucide:layout-grid",
105
+ label: "List View"
106
+ }), e;
107
+ });
108
+ n(() => q.value.map((e) => e.key));
109
+ const _ = n(() => {
110
+ const e = q.value.length, a = [p.table, p.list, p.grid].filter(Boolean).length;
111
+ return e + a > 1;
112
+ }), ee = n(() => l.views && l.views.length > 0 ? l.views[0].key : l.table || p.table ? "table" : l.list || p.list || p.grid ? "list" : "table"), m = je(`view-mode-${Z.value}`, ee.value), L = n(() => q.value.find((a) => a.key === m.value)?.component ?? null), E = n(() => m.value === "table" && p.table ? "table" : m.value === "list" && p.list ? "list" : m.value === "list" && p.grid ? "grid" : null), y = s(""), f = s({}), D = s({ field: "", order: "" }), C = s(l.pageInfo?.currentPage || 1), F = s(l.pageInfo?.itemsPerPage || l.paginationProps?.itemsPerPage || 10), r = s([]), B = s([]), I = s(!1), d = s(
90
113
  l.defaultQuickFilter !== void 0 ? l.defaultQuickFilter : l.quickFilters && l.quickFilters.length > 0 ? l.quickFilters[0].value : ""
91
- ), z = o(() => l.quickFilters && l.quickFilters.length > 0), H = (e) => {
92
- c.value = e, k.value = 1, p();
93
- }, U = o(() => {
94
- let e;
95
- return g.value === "table" ? e = l.table || !!S.table : e = l.list || !!S.list || !!S.grid, typeof e == "object" && e !== null ? we(e) : e;
96
- }), X = o(() => y.value && y.value.trim() !== "" || c.value !== "" && c.value !== null && c.value !== void 0 ? !0 : m.value ? Object.keys(m.value).some(
97
- (e) => m.value[e] !== "" && m.value[e] !== null && m.value[e] !== void 0
98
- ) : !1), Y = {
114
+ ), te = n(() => !l.quickFilters || l.quickFilters.length === 0 ? !1 : l.quickFilterViews && l.quickFilterViews.length > 0 ? l.quickFilterViews.includes(m.value) : !0), le = (e) => {
115
+ d.value = e, C.value = 1, w();
116
+ }, z = n(() => y.value && y.value.trim() !== "" || d.value !== "" && d.value !== null && d.value !== void 0 ? !0 : f.value ? Object.keys(f.value).some(
117
+ (e) => f.value[e] !== "" && f.value[e] !== null && f.value[e] !== void 0
118
+ ) : !1), K = n(() => l.data && l.data.length > 0), ae = n(() => !l.skipEmptyViews || l.skipEmptyViews.length === 0 ? !1 : l.skipEmptyViews.includes(m.value)), u = n(() => ({
119
+ activeView: m.value,
120
+ searchQuery: y.value,
121
+ activeFilters: f.value,
122
+ activeQuickFilter: d.value,
123
+ activeSort: D.value,
124
+ page: C.value,
125
+ limit: F.value,
126
+ selectedRows: r.value,
127
+ isFiltered: z.value,
128
+ hasData: K.value,
129
+ loading: l.loading
130
+ })), ie = {
99
131
  disableSearch: !0,
100
132
  forceSelectable: !l.hideSelectable,
101
133
  onTableChange: (e) => {
102
- C.value = { field: e.sort.field, order: e.sort.order }, p();
134
+ D.value = { field: e.sort.field, order: e.sort.order }, w();
103
135
  }
104
136
  };
105
- R(Te, Y), R("screen-selected-rows", r), R("screen-request-delete", (e) => b(e));
106
- const b = (e) => {
107
- $.value = e, D.value = !0;
108
- }, G = () => {
109
- j("delete", $.value), D.value = !1, r.value = [];
110
- }, J = (e) => {
111
- j("delete", e), r.value = [];
137
+ U(Ue, ie), U("screen-selected-rows", r), U("screen-request-delete", (e) => P(e));
138
+ const P = (e) => {
139
+ B.value = e, I.value = !0;
140
+ }, ne = () => {
141
+ O("delete", B.value), I.value = !1, r.value = [];
142
+ }, oe = (e) => {
143
+ O("delete", e), r.value = [];
112
144
  };
113
- q(
145
+ N(
114
146
  () => l.pageInfo?.currentPage,
115
147
  (e) => {
116
- e && (k.value = e);
148
+ e && (C.value = e);
117
149
  }
118
- ), q(
150
+ ), N(
119
151
  () => l.pageInfo?.itemsPerPage,
120
152
  (e) => {
121
- e && (V.value = e);
153
+ e && (F.value = e);
122
154
  }
123
155
  );
124
- let T = null;
125
- q(y, () => {
126
- T && clearTimeout(T), T = setTimeout(() => {
127
- k.value = 1, p();
156
+ let A = null;
157
+ N(y, () => {
158
+ A && clearTimeout(A), A = setTimeout(() => {
159
+ C.value = 1, w();
128
160
  }, 300);
129
161
  });
130
- const W = (e) => {
131
- k.value = e, p();
132
- }, Z = (e) => {
133
- V.value = e, k.value = 1, p();
134
- }, p = () => {
162
+ const re = (e) => {
163
+ C.value = e, w();
164
+ }, se = (e) => {
165
+ F.value = e, C.value = 1, w();
166
+ }, w = () => {
135
167
  if (!l.refetch) return;
136
- const e = { ...m.value };
137
- c.value !== "" && c.value !== null && c.value !== void 0 && (e[l.quickFilterKey] = c.value);
138
- const i = C.value.field && C.value.order ? { field: C.value.field, order: C.value.order } : void 0, a = {
139
- pagination: { page: k.value, limit: V.value },
168
+ const e = { ...f.value };
169
+ d.value !== "" && d.value !== null && d.value !== void 0 && (e[l.quickFilterKey] = d.value);
170
+ const a = D.value.field && D.value.order ? { field: D.value.field, order: D.value.order } : void 0, i = {
171
+ pagination: { page: C.value, limit: F.value },
140
172
  search: y.value,
141
173
  filter: e
142
174
  };
143
- i && (a.sort = i), l.refetch(a);
144
- }, _ = o(() => l.data && l.data.length > 0), ee = o(() => {
145
- const e = v("vlite.screen.deleteSelected");
175
+ a && (i.sort = a), l.refetch(i);
176
+ }, de = n(() => {
177
+ const e = g("vlite.screen.deleteSelected");
146
178
  return e !== "vlite.screen.deleteSelected" ? e : "Delete Selected";
147
- }), te = o(() => {
148
- const e = v("vlite.screen.refresh");
179
+ }), ue = n(() => {
180
+ const e = g("vlite.screen.refresh");
149
181
  return e !== "vlite.screen.refresh" ? e : "Refresh";
150
- }), le = o(() => {
151
- const e = v("vlite.screen.searchPlaceholder");
182
+ }), ce = n(() => {
183
+ const e = g("vlite.screen.searchPlaceholder");
152
184
  return e !== "vlite.screen.searchPlaceholder" ? e : "Search...";
153
- }), ae = o(() => {
154
- const e = v("vlite.screen.confirmDeleteTitle");
185
+ }), me = n(() => {
186
+ const e = g("vlite.screen.confirmDeleteTitle");
155
187
  return e !== "vlite.screen.confirmDeleteTitle" ? e : "Confirm Deletion";
156
- }), ie = o(() => {
157
- const e = v("vlite.screen.confirmDeleteDesc", { count: $.value.length });
158
- return e !== "vlite.screen.confirmDeleteDesc" ? e : `Are you sure you want to delete the selected ${$.value.length > 1 ? "items" : "item"}?`;
159
- }), oe = o(() => {
160
- const e = v("vlite.screen.confirmDeleteBtn");
188
+ }), fe = n(() => {
189
+ const e = g("vlite.screen.confirmDeleteDesc", { count: B.value.length });
190
+ return e !== "vlite.screen.confirmDeleteDesc" ? e : `Are you sure you want to delete the selected ${B.value.length > 1 ? "items" : "item"}?`;
191
+ }), ve = n(() => {
192
+ const e = g("vlite.screen.confirmDeleteBtn");
161
193
  return e !== "vlite.screen.confirmDeleteBtn" ? e : "Delete";
162
- }), ne = o(() => {
163
- const e = v("vlite.screen.cancelBtn");
194
+ }), pe = n(() => {
195
+ const e = g("vlite.screen.cancelBtn");
164
196
  return e !== "vlite.screen.cancelBtn" ? e : "Cancel";
165
- }), re = o(() => {
166
- const e = v("vlite.screen.missingView");
167
- return e !== "vlite.screen.missingView" ? e : "Please provide a `:list` or `:table` component or slot.";
168
- }), N = o(
197
+ }), he = n(() => {
198
+ const e = g("vlite.screen.missingView");
199
+ return e !== "vlite.screen.missingView" ? e : "Please provide a `:list`, `:table`, or `:views` component/slot.";
200
+ }), H = n(
169
201
  () => l.exportSchema && l.exportSchema.length > 0 && l.exportProps !== !1 || l.importSchema && l.importSchema.length > 0 && l.importProps !== !1
170
- ), se = o(() => {
171
- const e = v("vlite.screen.importData");
202
+ ), ge = n(() => {
203
+ const e = g("vlite.screen.importData");
172
204
  return e !== "vlite.screen.importData" ? e : "Import Data";
173
- }), de = s(null), I = s(!1), F = s(!1), ce = (e) => {
174
- e.value === "export" ? I.value = !0 : e.value === "import" && (F.value = !0);
175
- }, ue = o(
205
+ }), ye = s(null), T = s(!1), j = s(!1), we = (e) => {
206
+ e.value === "export" ? T.value = !0 : e.value === "import" && (j.value = !0);
207
+ }, ke = n(
176
208
  () => (l.exportSchema || []).map((e) => ({
177
209
  field: e.name || e.field,
178
210
  title: e.label || e.title || e.name || e.field
179
211
  }))
180
- ), me = o(
212
+ ), be = n(
181
213
  () => (l.importSchema || []).map((e) => ({
182
214
  field: e.name || e.field,
183
215
  title: e.label || e.title || e.name || e.field,
184
216
  required: e.required || !1
185
217
  }))
186
- ), fe = async (e) => x?.services?.importApi && l.importType ? await x.services.importApi(l.importType, e) : (console.warn(
218
+ ), xe = async (e) => $?.services?.importApi && l.importType ? await $.services.importApi(l.importType, e) : (console.warn(
187
219
  "VLite Screen: No importApi configured or no importType provided for generic import."
188
220
  ), {
189
221
  processed: e.data.length,
@@ -192,23 +224,23 @@ const Ne = { class: "flex flex-col w-full space-y-8" }, Qe = { class: "flex flex
192
224
  skipped: 0,
193
225
  failed: 0,
194
226
  errors: []
195
- }), ve = () => p(), pe = o(
196
- () => l.exportMode || x?.exportData?.mode || "frontend"
197
- ), he = async (e) => {
198
- x?.services?.exportApi && l.exportType ? await x.services.exportApi(l.exportType, {
227
+ }), Ce = () => w(), Se = n(
228
+ () => l.exportMode || $?.exportData?.mode || "frontend"
229
+ ), De = async (e) => {
230
+ $?.services?.exportApi && l.exportType ? await $.services.exportApi(l.exportType, {
199
231
  format: e,
200
232
  search: y.value,
201
- filter: m.value
233
+ filter: f.value
202
234
  }) : console.warn(
203
235
  "VLite Screen: No exportApi configured or no exportType provided for generic backend export."
204
236
  );
205
237
  };
206
- return (e, i) => (n(), f("div", Ne, [
207
- t.customHeader ? d(e.$slots, "custom-header", { key: 1 }) : (n(), f("div", {
238
+ return (e, a) => (o(), h("div", Xe, [
239
+ t.customHeader ? c(e.$slots, "custom-header", k(x({ key: 1 }, u.value))) : (o(), h("div", {
208
240
  key: 0,
209
- class: A([t.headerClass, "flex flex-col md:flex-row sm:items-start md:items-center justify-between gap-4"])
241
+ class: M([t.headerClass, "flex flex-col md:flex-row sm:items-start md:items-center justify-between gap-4"])
210
242
  }, [
211
- w(Fe, {
243
+ S(Ne, {
212
244
  title: t.title,
213
245
  "title-i18n": t.titleI18n,
214
246
  "title-class": t.titleClass,
@@ -217,202 +249,203 @@ const Ne = { class: "flex flex-col w-full space-y-8" }, Qe = { class: "flex flex
217
249
  "description-class": t.descriptionClass,
218
250
  info: t.info,
219
251
  "info-i18n": t.infoI18n
220
- }, ke({ _: 2 }, [
252
+ }, $e({ _: 2 }, [
221
253
  e.$slots.title ? {
222
254
  name: "title",
223
- fn: Q(() => [
224
- d(e.$slots, "title")
255
+ fn: X(() => [
256
+ c(e.$slots, "title", k(V(u.value)))
225
257
  ]),
226
258
  key: "0"
227
259
  } : void 0,
228
260
  e.$slots.description ? {
229
261
  name: "description",
230
- fn: Q(() => [
231
- d(e.$slots, "description")
262
+ fn: X(() => [
263
+ c(e.$slots, "description", k(V(u.value)))
232
264
  ]),
233
265
  key: "1"
234
266
  } : void 0
235
267
  ]), 1032, ["title", "title-i18n", "title-class", "description", "description-i18n", "description-class", "info", "info-i18n"]),
236
- B("div", Qe, [
237
- B("div", Me, [
238
- r.value.length > 0 && !t.hideSelectable && !t.hideDeleteBtn ? (n(), h(O, {
268
+ R("div", Ye, [
269
+ R("div", Ge, [
270
+ r.value.length > 0 && !t.hideSelectable && !t.hideDeleteBtn ? (o(), b(J, {
239
271
  key: 0,
240
272
  variant: "outline",
241
273
  class: "hover:bg-destructive/10 shrink-0 h-9! w-9!",
242
274
  icon: "lucide:trash-2",
243
- title: ee.value,
244
- onClick: i[0] || (i[0] = (a) => b(r.value))
245
- }, null, 8, ["title"])) : u("", !0),
246
- (t.table || e.$slots.table) && (t.list || e.$slots.list || e.$slots.grid) ? (n(), h(Re, {
275
+ title: de.value,
276
+ onClick: a[0] || (a[0] = (i) => P(r.value))
277
+ }, null, 8, ["title"])) : v("", !0),
278
+ _.value ? (o(), b(Me, {
247
279
  key: 1,
248
- modelValue: P(g),
249
- "onUpdate:modelValue": i[1] || (i[1] = (a) => be(g) ? g.value = a : null)
250
- }, null, 8, ["modelValue"])) : u("", !0),
251
- d(e.$slots, "before-search"),
252
- t.showRefresh ? (n(), h(O, {
280
+ modelValue: Y(m),
281
+ "onUpdate:modelValue": a[1] || (a[1] = (i) => Ie(m) ? m.value = i : null),
282
+ views: t.views && t.views.length > 0 ? t.views : void 0
283
+ }, null, 8, ["modelValue", "views"])) : v("", !0),
284
+ c(e.$slots, "before-search", k(V(u.value))),
285
+ t.showRefresh ? (o(), b(J, {
253
286
  key: 2,
254
287
  variant: "outline",
255
288
  icon: "lucide:refresh-cw",
256
289
  size: "lg",
257
290
  class: "shrink-0 h-9! w-9!",
258
- title: te.value,
291
+ title: ue.value,
259
292
  disabled: t.loading,
260
- onClick: p
261
- }, null, 8, ["title", "disabled"])) : u("", !0),
262
- t.filterSchema && t.filterSchema.length > 0 ? (n(), h($e, {
293
+ onClick: w
294
+ }, null, 8, ["title", "disabled"])) : v("", !0),
295
+ t.filterSchema && t.filterSchema.length > 0 ? (o(), b(Ee, {
263
296
  key: 3,
264
297
  schema: t.filterSchema,
265
298
  type: t.filterType,
266
- modelValue: m.value,
267
- "onUpdate:modelValue": i[2] || (i[2] = (a) => m.value = a),
268
- onChange: p
269
- }, null, 8, ["schema", "type", "modelValue"])) : u("", !0),
270
- t.canSearch ? (n(), f("div", Oe, [
271
- w(De, {
299
+ modelValue: f.value,
300
+ "onUpdate:modelValue": a[2] || (a[2] = (i) => f.value = i),
301
+ onChange: w
302
+ }, null, 8, ["schema", "type", "modelValue"])) : v("", !0),
303
+ t.canSearch ? (o(), h("div", Je, [
304
+ S(Te, {
272
305
  lazy: "",
273
306
  modelValue: y.value,
274
- "onUpdate:modelValue": i[3] || (i[3] = (a) => y.value = a),
307
+ "onUpdate:modelValue": a[3] || (a[3] = (i) => y.value = i),
275
308
  icon: "lucide:search",
276
- placeholder: le.value,
309
+ placeholder: ce.value,
277
310
  variant: "outline",
278
311
  class: "bg-background w-full",
279
312
  "show-clear-button": !0
280
313
  }, null, 8, ["modelValue", "placeholder"])
281
- ])) : u("", !0)
314
+ ])) : v("", !0)
282
315
  ]),
283
- B("div", Ke, [
284
- d(e.$slots, "actions", {}, () => [
285
- w(Ae, {
316
+ R("div", We, [
317
+ c(e.$slots, "actions", k(V(u.value)), () => [
318
+ S(Le, {
286
319
  "can-add": t.canAdd,
287
320
  "add-component": t.addComponent,
288
321
  "add-btn": t.addBtn,
289
322
  loading: t.loading,
290
323
  data: t.data,
291
324
  refetch: t.refetch,
292
- onAdd: i[4] || (i[4] = (a) => e.$emit("add"))
325
+ onAdd: a[4] || (a[4] = (i) => e.$emit("add"))
293
326
  }, null, 8, ["can-add", "add-component", "add-btn", "loading", "data", "refetch"])
294
327
  ]),
295
- N.value ? (n(), h(qe, {
328
+ H.value ? (o(), b(Oe, {
296
329
  key: 0,
297
330
  "export-props": t.exportProps,
298
331
  "import-props": t.importProps,
299
- onSelect: ce
300
- }, null, 8, ["export-props", "import-props"])) : u("", !0),
301
- d(e.$slots, "after-add")
332
+ onSelect: we
333
+ }, null, 8, ["export-props", "import-props"])) : v("", !0),
334
+ c(e.$slots, "after-add", k(V(u.value)))
302
335
  ])
303
336
  ])
304
337
  ], 2)),
305
- d(e.$slots, "sub-header"),
306
- z.value ? (n(), f("div", {
338
+ c(e.$slots, "sub-header", k(V(u.value))),
339
+ te.value ? (o(), h("div", {
307
340
  key: 2,
308
- class: A(["-mt-1 max-sm:hidden!", t.quickFilterVariant == "line" ? "mb-1.5 sm:mb-1" : "mb-2"])
341
+ class: M(["-mt-1.5 max-sm:hidden!", t.quickFilterVariant == "line" ? "mb-1.5 sm:mb-3" : "mb-3.5"])
309
342
  }, [
310
- w(Ue, {
311
- modelValue: c.value,
312
- "onUpdate:modelValue": i[5] || (i[5] = (a) => c.value = a),
343
+ S(He, {
344
+ modelValue: d.value,
345
+ "onUpdate:modelValue": a[5] || (a[5] = (i) => d.value = i),
313
346
  options: t.quickFilters,
314
347
  variant: t.quickFilterVariant,
315
- onChange: H
348
+ onChange: le
316
349
  }, null, 8, ["modelValue", "options", "variant"])
317
- ], 2)) : u("", !0),
318
- B("div", {
319
- class: A(["flex-1 w-full relative", t.containerClass])
350
+ ], 2)) : v("", !0),
351
+ R("div", {
352
+ class: M(["flex-1 w-full relative", t.containerClass])
320
353
  }, [
321
- !_.value && !t.loading ? (n(), f(M, { key: 0 }, [
322
- e.$slots.empty ? d(e.$slots, "empty", { key: 0 }) : (n(), h(Ee, {
354
+ !K.value && !t.loading && !ae.value ? (o(), h(G, { key: 0 }, [
355
+ e.$slots.empty ? c(e.$slots, "empty", k(x({ key: 0 }, u.value))) : (o(), b(ze, {
323
356
  key: 1,
324
357
  "empty-title": t.emptyTitle,
325
358
  "empty-title-i18n": t.emptyTitleI18n,
326
359
  "empty-description": t.emptyDescription,
327
360
  "empty-description-i18n": t.emptyDescriptionI18n,
328
361
  "empty-icon": t.emptyIcon,
329
- "is-filtered": X.value,
362
+ "is-filtered": z.value,
330
363
  "can-add": t.canAdd,
331
364
  "add-component": t.addComponent,
332
365
  "add-btn": t.addBtn
333
366
  }, null, 8, ["empty-title", "empty-title-i18n", "empty-description", "empty-description-i18n", "empty-icon", "is-filtered", "can-add", "add-component", "add-btn"]))
334
- ], 64)) : (n(), f(M, { key: 1 }, [
335
- P(g) === "table" && e.$slots.table ? d(e.$slots, "table", {
367
+ ], 64)) : (o(), h(G, { key: 1 }, [
368
+ E.value === "table" ? c(e.$slots, "table", x({
336
369
  key: 0,
337
370
  data: t.data,
338
371
  loading: t.loading,
339
372
  selectedRows: r.value,
340
- delete: b,
341
- updateSelectedRows: (a) => r.value = a
342
- }) : P(g) === "list" && e.$slots.list ? d(e.$slots, "list", {
373
+ delete: P,
374
+ updateSelectedRows: (i) => r.value = i
375
+ }, u.value)) : E.value === "list" ? c(e.$slots, "list", x({
343
376
  key: 1,
344
377
  data: t.data,
345
378
  loading: t.loading,
346
379
  selectedRows: r.value,
347
- delete: b,
348
- updateSelectedRows: (a) => r.value = a
349
- }) : P(g) === "list" && e.$slots.grid ? d(e.$slots, "grid", {
380
+ delete: P,
381
+ updateSelectedRows: (i) => r.value = i
382
+ }, u.value)) : E.value === "grid" ? c(e.$slots, "grid", x({
350
383
  key: 2,
351
384
  data: t.data,
352
385
  loading: t.loading,
353
386
  selectedRows: r.value,
354
- delete: b,
355
- updateSelectedRows: (a) => r.value = a
356
- }) : U.value ? (n(), h(xe(U.value), E({
387
+ delete: P,
388
+ updateSelectedRows: (i) => r.value = i
389
+ }, u.value)) : L.value ? (o(), b(Fe(L.value), x({
357
390
  key: 3,
358
391
  data: t.data,
359
392
  loading: t.loading,
360
393
  refetch: t.refetch,
361
394
  selectedRows: r.value,
362
- "onUpdate:selectedRows": i[6] || (i[6] = (a) => r.value = a),
363
- delete: b,
364
- onDelete: J
365
- }, t.viewProps), null, 16, ["data", "loading", "refetch", "selectedRows"])) : (n(), f("div", Le, Ce(re.value), 1))
395
+ "onUpdate:selectedRows": a[6] || (a[6] = (i) => r.value = i),
396
+ delete: P,
397
+ onDelete: oe
398
+ }, t.viewProps), null, 16, ["data", "loading", "refetch", "selectedRows"])) : (o(), h("div", Ze, Be(he.value), 1))
366
399
  ], 64))
367
400
  ], 2),
368
- t.pagination && t.pageInfo && t.pageInfo.totalPages > 1 ? (n(), f("div", ze, [
369
- w(P(Se), E({
401
+ t.pagination && t.pageInfo && t.pageInfo.totalPages > 1 ? (o(), h("div", _e, [
402
+ S(Y(qe), x({
370
403
  "current-page": t.pageInfo.currentPage,
371
404
  "total-pages": t.pageInfo.totalPages,
372
405
  "total-items": t.pageInfo.totalItems
373
406
  }, t.paginationProps, {
374
- onChange: W,
375
- "onUpdate:itemsPerPage": Z
407
+ onChange: re,
408
+ "onUpdate:itemsPerPage": se
376
409
  }), null, 16, ["current-page", "total-pages", "total-items"])
377
- ])) : u("", !0),
378
- w(Pe, {
379
- show: D.value,
380
- "onUpdate:show": i[7] || (i[7] = (a) => D.value = a),
381
- title: ae.value,
382
- description: ie.value,
383
- "confirm-text": oe.value,
384
- "cancel-text": ne.value,
410
+ ])) : v("", !0),
411
+ S(Re, {
412
+ show: I.value,
413
+ "onUpdate:show": a[7] || (a[7] = (i) => I.value = i),
414
+ title: me.value,
415
+ description: fe.value,
416
+ "confirm-text": ve.value,
417
+ "cancel-text": pe.value,
385
418
  variant: "danger",
386
- onConfirm: G,
387
- onCancel: i[8] || (i[8] = (a) => D.value = !1)
419
+ onConfirm: ne,
420
+ onCancel: a[8] || (a[8] = (i) => I.value = !1)
388
421
  }, null, 8, ["show", "title", "description", "confirm-text", "cancel-text"]),
389
- I.value ? (n(), h(je, {
422
+ T.value ? (o(), b(Ke, {
390
423
  key: 4,
391
- show: I.value,
392
- "onUpdate:show": i[9] || (i[9] = (a) => I.value = a),
424
+ show: T.value,
425
+ "onUpdate:show": a[9] || (a[9] = (i) => T.value = i),
393
426
  data: t.data || [],
394
- fields: ue.value,
395
- mode: pe.value,
427
+ fields: ke.value,
428
+ mode: Se.value,
396
429
  "export-props": t.exportProps,
397
- "on-export": he
398
- }, null, 8, ["show", "data", "fields", "mode", "export-props"])) : u("", !0),
399
- N.value ? (n(), f("div", He, [
400
- w(Ie, E({
401
- show: F.value,
402
- "onUpdate:show": i[10] || (i[10] = (a) => F.value = a),
430
+ "on-export": De
431
+ }, null, 8, ["show", "data", "fields", "mode", "export-props"])) : v("", !0),
432
+ H.value ? (o(), h("div", et, [
433
+ S(Ae, x({
434
+ show: j.value,
435
+ "onUpdate:show": a[10] || (a[10] = (i) => j.value = i),
403
436
  ref_key: "importDataRef",
404
- ref: de,
405
- fields: me.value,
406
- processBatch: fe,
407
- onComplete: ve
437
+ ref: ye,
438
+ fields: be.value,
439
+ processBatch: xe,
440
+ onComplete: Ce
408
441
  }, typeof t.importProps == "object" ? t.importProps : {}, {
409
- title: se.value,
442
+ title: ge.value,
410
443
  class: "hidden!"
411
444
  }), null, 16, ["show", "fields", "title"])
412
- ])) : u("", !0)
445
+ ])) : v("", !0)
413
446
  ]));
414
447
  }
415
448
  });
416
449
  export {
417
- mt as default
450
+ kt as default
418
451
  };
@@ -1,9 +1,12 @@
1
+ import { ScreenView } from '../types';
1
2
  type __VLS_Props = {
2
- modelValue: 'table' | 'list';
3
+ modelValue: string;
4
+ /** Dynamic views array. When provided, renders one button per entry. */
5
+ views?: ScreenView[];
3
6
  };
4
7
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
5
- "update:modelValue": (val: "table" | "list") => any;
8
+ "update:modelValue": (val: string) => any;
6
9
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
7
- "onUpdate:modelValue"?: (val: "table" | "list") => any;
10
+ "onUpdate:modelValue"?: (val: string) => any;
8
11
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
9
12
  export default _default;