vlite3 0.8.2 → 0.8.4

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