vlite3 1.4.40 → 1.5.0

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 (137) hide show
  1. package/components/AppShell/AppShellLayoutClassic.vue.js +27 -28
  2. package/components/AppShell/AppShellLayoutDashboard.vue.js +48 -48
  3. package/components/AppShell/AppShellLayoutDock.vue.js +51 -51
  4. package/components/AppShell/AppShellLayoutHeaderShell.vue.js +69 -69
  5. package/components/AppShell/AppShellLayoutSidebarFirst.vue.d.ts +2 -2
  6. package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +78 -78
  7. package/components/AppShell/AppShellLayoutStorefront.vue.js +14 -15
  8. package/components/AppShell/useAppShell.d.ts +4 -0
  9. package/components/AppShell/useAppShell.js +45 -40
  10. package/components/AsyncSelect/createAsyncSelect.js +10 -10
  11. package/components/AttachmentsList/AttachmentsList.vue.d.ts +50 -2
  12. package/components/AttachmentsList/AttachmentsList.vue.js +289 -272
  13. package/components/AttachmentsList/types.d.ts +37 -0
  14. package/components/BackButton.vue.js +2 -2
  15. package/components/Button.vue.d.ts +1 -0
  16. package/components/Button.vue.js +5 -241
  17. package/components/Button.vue2.js +245 -2
  18. package/components/ButtonGroup.vue.js +2 -2
  19. package/components/ButtonGroup.vue2.js +4 -1
  20. package/components/Calendar/Calendar.vue2.js +16 -16
  21. package/components/Cart/CartCouponInput.vue.js +24 -24
  22. package/components/Cart/CartEmptyState.vue.js +4 -4
  23. package/components/Cart/CartLineItem.vue.js +33 -33
  24. package/components/Cart/CartVariant1.vue.js +3 -3
  25. package/components/Cart/CartVariant2.vue.js +5 -5
  26. package/components/Cart/CartVariant3.vue.js +25 -25
  27. package/components/Cart/CartVariant4.vue.js +9 -9
  28. package/components/CategoryManager/CategoryManager.vue.d.ts +2 -2
  29. package/components/CategoryManager/CategoryManager.vue2.js +18 -18
  30. package/components/CategoryManager/CategoryNode.vue.js +4 -4
  31. package/components/CategoryMenu/CategoryMenu.vue.js +3 -2
  32. package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +3 -2
  33. package/components/Chat/ChatInterface.vue.js +23 -23
  34. package/components/Clipboard.vue.d.ts +7 -1
  35. package/components/Clipboard.vue.js +19 -17
  36. package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +22 -22
  37. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  38. package/components/ColorPicker/ColorPicker.vue.js +8 -8
  39. package/components/Comment/CommentEditor.vue.js +14 -14
  40. package/components/Comment/CommentItem.vue2.js +6 -6
  41. package/components/Comment/CommentThread.vue.js +4 -4
  42. package/components/DataList/DataList.vue.js +7 -7
  43. package/components/DataTable/DataTable.vue.d.ts +9 -1
  44. package/components/DataTable/DataTable.vue.js +374 -263
  45. package/components/DataTable/DataTableRow.vue.d.ts +23 -2
  46. package/components/DataTable/DataTableRow.vue.js +5 -198
  47. package/components/DataTable/DataTableRow.vue2.js +360 -2
  48. package/components/DataTable/dataTableHeaders.d.ts +18 -0
  49. package/components/DataTable/dataTableHeaders.js +9 -0
  50. package/components/DataTable/types.d.ts +6 -0
  51. package/components/DatePicker.vue.js +8 -9
  52. package/components/DateRangePicker.vue2.js +34 -34
  53. package/components/Dropdown/Dropdown.vue.d.ts +7 -2
  54. package/components/Dropdown/Dropdown.vue.js +146 -139
  55. package/components/Dropdown/DropdownTrigger.vue.js +6 -6
  56. package/components/ExportData/ExportData.vue.js +15 -15
  57. package/components/FilePicker/FilePickerDropzone.vue.js +16 -16
  58. package/components/FilePicker/FilePickerInput.vue.js +3 -2
  59. package/components/FilePicker/FilePreview.vue.js +3 -3
  60. package/components/FileTree/FileTree.vue.js +4 -4
  61. package/components/FileTree/FileTree.vue2.js +9 -9
  62. package/components/FileTree/FileTreeNode.vue.js +76 -72
  63. package/components/Footer/Variant1.vue.js +48 -48
  64. package/components/Footer/Variant2.vue.js +42 -42
  65. package/components/Form/AccordionView.vue.d.ts +1 -1
  66. package/components/Form/AccordionView.vue.js +2 -2
  67. package/components/Form/AccordionView.vue3.js +61 -57
  68. package/components/Form/Form.vue2.js +41 -41
  69. package/components/Form/TableRow.vue.d.ts +7 -0
  70. package/components/Form/TableRow.vue.js +187 -41
  71. package/components/Form/TableView.vue.d.ts +11 -1
  72. package/components/Form/TableView.vue.js +71 -49
  73. package/components/Form/composables/useForm.js +146 -142
  74. package/components/Form/index.vue.d.ts +5 -1
  75. package/components/Form/index.vue.js +2 -2
  76. package/components/Form/index.vue2.js +44 -37
  77. package/components/Form/rowHelpers.d.ts +20 -0
  78. package/components/Form/rowHelpers.js +76 -28
  79. package/components/Form/types.d.ts +11 -0
  80. package/components/GoogleLogin.vue.js +4 -4
  81. package/components/IconPicker.vue.js +9 -9
  82. package/components/ImportData/ImportData.vue.js +11 -11
  83. package/components/ImportData/ImportStep1.vue.js +10 -10
  84. package/components/ImportData/ImportStep2.vue.js +15 -14
  85. package/components/Input.vue.js +133 -129
  86. package/components/Kanban/KanbanBoard.vue.js +1 -1
  87. package/components/Kanban/KanbanBoard.vue2.js +9 -9
  88. package/components/MultiSelect/MultiSelect.vue.js +3 -2
  89. package/components/Navbar/Navbar.vue.js +17 -17
  90. package/components/Navbar/NavbarGroup.vue.js +8 -7
  91. package/components/Navbar/NavbarItem.vue.js +40 -39
  92. package/components/Navbar/NavbarTabs.vue.js +6 -184
  93. package/components/Navbar/NavbarTabs.vue2.js +204 -0
  94. package/components/Navbar/useNavbar.js +3 -3
  95. package/components/NavbarCommandPalette.vue.js +1 -1
  96. package/components/NumberInput.vue.js +2 -2
  97. package/components/NumberInput.vue2.js +81 -77
  98. package/components/OTPInput/OTPInput.vue.js +24 -23
  99. package/components/Pagination/Pagination.vue.d.ts +1 -1
  100. package/components/Pagination/Pagination.vue.js +5 -274
  101. package/components/Pagination/Pagination.vue2.js +283 -2
  102. package/components/PermissionMatrix/PermissionTopBar.vue.js +19 -18
  103. package/components/PricingPlan/PricingPlanItem.vue.js +7 -7
  104. package/components/Screen/Screen.vue.d.ts +1 -1
  105. package/components/Screen/Screen.vue.js +21 -21
  106. package/components/Screen/ScreenFilter.vue.js +5 -5
  107. package/components/Screen/components/ScreenAddAction.vue.js +3 -3
  108. package/components/Screen/components/ScreenEmptyState.vue.js +10 -10
  109. package/components/Screen/components/ScreenExportModal.vue.js +12 -12
  110. package/components/Screen/components/ScreenOptionsDropdown.vue.js +5 -5
  111. package/components/Screen/components/ScreenToolbar.vue.js +15 -15
  112. package/components/SidePanel.vue.js +2 -2
  113. package/components/SidePanel.vue2.js +6 -6
  114. package/components/SidebarMenu/SidebarMenu.vue.js +77 -72
  115. package/components/SidebarMenu/SidebarMenuItem.vue.js +172 -168
  116. package/components/Slider.vue.js +123 -108
  117. package/components/Tabes/Tabes.vue.d.ts +25 -4
  118. package/components/Tabes/Tabes.vue.js +3 -3
  119. package/components/Tabes/Tabes.vue2.js +274 -211
  120. package/components/Tabes/tabes.utils.d.ts +30 -0
  121. package/components/Tabes/tabes.utils.js +49 -18
  122. package/components/Tabes/types.d.ts +7 -0
  123. package/components/Textarea.vue.d.ts +2 -0
  124. package/components/Textarea.vue.js +19 -16
  125. package/components/ThemeToggle.vue.js +8 -8
  126. package/components/ToastNotification.vue2.js +10 -10
  127. package/components/TreeConnectors/TreeConnectors.vue.d.ts +1 -1
  128. package/components/TreeConnectors/TreeConnectors.vue.js +13 -8
  129. package/components/TreeConnectors/geometry.js +77 -69
  130. package/components/Workbook/WorkbookAddButton.vue.js +2 -2
  131. package/composables/useRtl.d.ts +14 -0
  132. package/composables/useRtl.js +33 -0
  133. package/index.js +470 -471
  134. package/package.json +5 -4
  135. package/style.css +86 -1
  136. package/types/button.d.ts +8 -0
  137. package/components/Navbar/NavbarTabs.vue3.js +0 -5
@@ -1,19 +1,17 @@
1
- import { defineComponent as y, computed as f, openBlock as o, createElementBlock as t, normalizeStyle as v, createCommentVNode as n, Fragment as u, renderList as b, normalizeClass as R, toDisplayString as s, createVNode as x, unref as k, withCtx as B, isMemoSame as F, createBlock as N, createElementVNode as g } from "vue";
2
- import { VueDraggable as C } from "vue-draggable-plus";
3
- import S from "./TableRow.vue.js";
4
- const U = { class: "custom-fields-table border border-border rounded overflow-hidden bg-background min-w-0 max-w-full w-full" }, V = {
1
+ import { defineComponent as k, computed as R, openBlock as d, createElementBlock as a, normalizeClass as u, unref as t, normalizeStyle as x, createCommentVNode as s, Fragment as g, renderList as y, toDisplayString as c, createVNode as B, withCtx as T, isMemoSame as N, createBlock as S, createElementVNode as h } from "vue";
2
+ import { useBreakpoints as z, breakpointsTailwind as C } from "@vueuse/core";
3
+ import { VueDraggable as F } from "vue-draggable-plus";
4
+ import U from "./TableRow.vue.js";
5
+ const V = {
5
6
  key: 0,
6
7
  class: "w-10 flex-none p-3 border-r border-border"
7
8
  }, D = {
8
9
  key: 1,
9
10
  class: "w-10 flex-none p-3 text-center border-r border-border"
10
- }, T = {
11
+ }, H = {
11
12
  key: 2,
12
13
  class: "p-3 border-l border-border"
13
- }, H = {
14
- key: 1,
15
- class: "flex flex-col items-center justify-center py-6 text-center bg-muted/5"
16
- }, E = { class: "text-sm font-medium text-foreground" }, j = { class: "text-xs text-muted-foreground mt-1" }, M = /* @__PURE__ */ y({
14
+ }, E = { class: "text-sm font-medium text-foreground" }, K = { class: "text-xs text-muted-foreground mt-1" }, q = /* @__PURE__ */ k({
17
15
  __name: "TableView",
18
16
  props: {
19
17
  rows: {},
@@ -30,80 +28,104 @@ const U = { class: "custom-fields-table border border-border rounded overflow-hi
30
28
  helpers: {},
31
29
  emptyTitle: {},
32
30
  emptyDescription: {},
33
- onFieldChange: { type: Function },
34
- onRemoveRow: { type: Function },
35
- onDragUpdate: { type: Function }
31
+ variant: { default: "outline" },
32
+ size: { default: "md" },
33
+ rounded: { default: "md" },
34
+ rowTitleKey: { default: void 0 },
35
+ onFieldChange: {},
36
+ onRemoveRow: {},
37
+ onDragUpdate: {}
36
38
  },
37
39
  setup(e) {
38
- const d = e, w = f(() => {
39
- const a = [];
40
- return d.draggable && !d.disabled && !d.readonly && a.push("2.5rem"), d.showRowNumbers && a.push("2.5rem"), a.push(...d.visibleSchemaFields.map(() => "minmax(0, 1fr)")), d.canRemoveRow && a.push("2.5rem"), a.join(" ");
40
+ const o = e, r = z(C).smaller("md"), f = R(() => {
41
+ const l = [];
42
+ return o.draggable && !o.disabled && !o.readonly && l.push("2.5rem"), o.showRowNumbers && l.push("2.5rem"), l.push(...o.visibleSchemaFields.map(() => "minmax(0, 1fr)")), o.canRemoveRow && l.push("2.5rem"), l.join(" ");
41
43
  });
42
- return (a, h) => (o(), t("div", U, [
43
- e.columnHeaders.length > 1 ? (o(), t("div", {
44
+ return (l, v) => (d(), a("div", {
45
+ class: u([
46
+ "custom-fields-table min-w-0 max-w-full w-full",
47
+ t(r) ? "is-stacked bg-transparent" : "border border-border rounded overflow-hidden bg-background"
48
+ ])
49
+ }, [
50
+ !t(r) && e.columnHeaders.length > 1 ? (d(), a("div", {
44
51
  key: 0,
45
52
  class: "grid border-b border-border bg-muted/50 text-gray-800 text-xs font-semibold uppercase tracking-wider min-w-0",
46
- style: v({ gridTemplateColumns: w.value })
53
+ style: x({ gridTemplateColumns: f.value })
47
54
  }, [
48
- e.draggable && !e.disabled && !e.readonly ? (o(), t("div", V)) : n("", !0),
49
- e.showRowNumbers ? (o(), t("div", D, " # ")) : n("", !0),
50
- (o(!0), t(u, null, b(e.columnHeaders, (r, l) => (o(), t("div", {
51
- key: l,
52
- class: R(["p-3 min-w-0 truncate", { "border-l border-border": l > 0 }])
53
- }, s(r), 3))), 128)),
54
- e.canRemoveRow ? (o(), t("div", T)) : n("", !0)
55
- ], 4)) : n("", !0),
56
- x(k(C), {
55
+ e.draggable && !e.disabled && !e.readonly ? (d(), a("div", V)) : s("", !0),
56
+ e.showRowNumbers ? (d(), a("div", D, " # ")) : s("", !0),
57
+ (d(!0), a(g, null, y(e.columnHeaders, (n, i) => (d(), a("div", {
58
+ key: i,
59
+ class: u(["p-3 min-w-0 truncate", { "border-l border-border": i > 0 }])
60
+ }, c(n), 3))), 128)),
61
+ e.canRemoveRow ? (d(), a("div", H)) : s("", !0)
62
+ ], 4)) : s("", !0),
63
+ B(t(F), {
57
64
  "model-value": e.rows,
58
65
  "onUpdate:modelValue": e.onDragUpdate,
59
66
  disabled: !e.draggable || e.disabled || e.readonly,
60
67
  animation: 150,
61
68
  handle: ".drag-handle",
62
69
  "ghost-class": "opacity-50",
63
- class: "divide-y divide-border min-w-0"
70
+ class: u(["min-w-0", t(r) ? "space-y-3" : "divide-y divide-border"])
64
71
  }, {
65
- default: B(() => [
66
- (o(!0), t(u, null, b(e.rows, (r, l, z, i) => {
67
- const m = [
68
- r,
69
- l,
72
+ default: T(() => [
73
+ (d(!0), a(g, null, y(e.rows, (n, i, A, m) => {
74
+ const b = [
75
+ n,
76
+ i,
70
77
  e.visibleSchemaFields,
78
+ e.columnHeaders,
71
79
  e.disabled,
72
80
  e.readonly,
73
81
  e.isUpdate,
74
82
  e.showRowNumbers,
75
83
  e.canRemoveRow,
76
84
  e.draggable,
77
- e.helpers.getRowErrorsHash(l)
85
+ t(r),
86
+ e.variant,
87
+ e.size,
88
+ e.rounded,
89
+ e.rowTitleKey,
90
+ e.helpers.getRowErrorsHash(i)
78
91
  ];
79
- if (i && i.key === r._id && F(i, m)) return i;
80
- const c = (o(), N(S, {
81
- key: r._id,
82
- row: r,
83
- "row-index": l,
92
+ if (m && m.key === n._id && N(m, b)) return m;
93
+ const w = (d(), S(U, {
94
+ key: n._id,
95
+ row: n,
96
+ "row-index": i,
84
97
  fields: e.visibleSchemaFields,
98
+ "column-headers": e.columnHeaders,
85
99
  draggable: e.draggable,
86
100
  disabled: e.disabled,
87
101
  readonly: e.readonly,
88
102
  "is-update": e.isUpdate,
89
103
  "show-row-numbers": e.showRowNumbers,
90
104
  "can-remove-row": e.canRemoveRow,
105
+ "is-stacked": t(r),
106
+ variant: e.variant,
107
+ size: e.size,
108
+ rounded: e.rounded,
109
+ "row-title-key": e.rowTitleKey,
91
110
  helpers: e.helpers,
92
111
  "on-field-change": e.onFieldChange,
93
112
  "on-remove-row": e.onRemoveRow
94
- }, null, 8, ["row", "row-index", "fields", "draggable", "disabled", "readonly", "is-update", "show-row-numbers", "can-remove-row", "helpers", "on-field-change", "on-remove-row"]));
95
- return c.memo = m, c;
96
- }, h, 0), 128))
113
+ }, null, 8, ["row", "row-index", "fields", "column-headers", "draggable", "disabled", "readonly", "is-update", "show-row-numbers", "can-remove-row", "is-stacked", "variant", "size", "rounded", "row-title-key", "helpers", "on-field-change", "on-remove-row"]));
114
+ return w.memo = b, w;
115
+ }, v, 0), 128))
97
116
  ]),
98
117
  _: 1
99
- }, 8, ["model-value", "onUpdate:modelValue", "disabled"]),
100
- e.rows.length === 0 ? (o(), t("div", H, [
101
- g("p", E, s(e.emptyTitle), 1),
102
- g("p", j, s(e.emptyDescription), 1)
103
- ])) : n("", !0)
104
- ]));
118
+ }, 8, ["model-value", "onUpdate:modelValue", "disabled", "class"]),
119
+ e.rows.length === 0 ? (d(), a("div", {
120
+ key: 1,
121
+ class: u(["flex flex-col items-center justify-center py-6 text-center bg-muted/5", t(r) ? "border border-border rounded" : ""])
122
+ }, [
123
+ h("p", E, c(e.emptyTitle), 1),
124
+ h("p", K, c(e.emptyDescription), 1)
125
+ ], 2)) : s("", !0)
126
+ ], 2));
105
127
  }
106
128
  });
107
129
  export {
108
- M as default
130
+ q as default
109
131
  };
@@ -1,101 +1,105 @@
1
- import { shallowRef as g, computed as ae, watch as le } from "vue";
2
- import { deepClone as A, initializeFormValues as se, cleanSubmitValues as ie, getNestedValue as K, evaluateConditional as j, setNestedValue as I, collectFileFields as re, filterNullCustomFields as oe } from "../utils/form.utils.js";
1
+ import { shallowRef as V, computed as ae, watch as le } from "vue";
2
+ import { deepClone as A, initializeFormValues as se, cleanSubmitValues as ie, getNestedValue as Q, evaluateConditional as j, setNestedValue as I, collectFileFields as re, filterNullCustomFields as oe } from "../utils/form.utils.js";
3
3
  import { useFileUpload as ne } from "./useFileUpload.js";
4
4
  import { resolveI18nText as ue } from "../../../utils/i18n.js";
5
5
  function he(M) {
6
- let { schema: Q, values: b, isUpdate: F = !1, folderId: C, onSubmit: R } = M;
7
- const { handleUploadFile: O } = ne(), o = g(b ? A(b) : {}), m = g({}), D = g(!1), z = g(!1), E = g({}), x = g(Q), N = g(
8
- b ? A(b) : {}
6
+ let { schema: X, values: F, isUpdate: h = !1, folderId: C, onSubmit: R } = M;
7
+ const { handleUploadFile: O } = ne(), i = V(F ? A(F) : {}), y = V({}), D = V(!1), z = V(!1), E = V({}), x = V(X), N = V(
8
+ F ? A(F) : {}
9
9
  ), S = (e, t) => {
10
10
  if (t) {
11
- if (m.value[e] === t) return;
12
- m.value = { ...m.value, [e]: t };
11
+ if (y.value[e] === t) return;
12
+ y.value = { ...y.value, [e]: t };
13
13
  return;
14
14
  }
15
- if (!(e in m.value)) return;
16
- const r = { ...m.value };
17
- delete r[e], m.value = r;
18
- }, h = (e, t) => {
15
+ if (!(e in y.value)) return;
16
+ const n = { ...y.value };
17
+ delete n[e], y.value = n;
18
+ }, w = (e, t) => {
19
19
  E.value[e] !== t && (E.value = { ...E.value, [e]: t });
20
20
  }, U = ae(() => {
21
21
  const e = x.value;
22
22
  return e ? Array.isArray(e[0]) ? e.flat() : e : [];
23
23
  }), P = async (e) => {
24
24
  try {
25
- const t = await se(x.value, e, o.value, F);
26
- o.value = t, N.value = A(t), z.value = !1;
25
+ const t = await se(x.value, e, i.value, h);
26
+ i.value = t, N.value = A(t), z.value = !1;
27
27
  } catch (t) {
28
28
  console.error("[useForm] Initialization error:", t);
29
29
  }
30
30
  };
31
- P(b), le(
32
- () => b,
31
+ P(F), le(
32
+ () => F,
33
33
  (e) => {
34
34
  e && P(e);
35
35
  },
36
36
  { deep: !0 }
37
37
  );
38
38
  const T = () => ({
39
- values: o.value,
40
- globalValues: o.value,
41
- isUpdate: F
42
- }), W = (e) => K(o.value, e), X = (e) => m.value[e] || "", H = (e, t) => {
39
+ values: i.value,
40
+ globalValues: i.value,
41
+ isUpdate: h
42
+ }), W = (e) => Q(i.value, e), Y = (e) => y.value[e] || "", H = (e, t) => {
43
43
  S(e, t);
44
44
  }, k = () => {
45
- Object.keys(m.value).length !== 0 && (m.value = {});
46
- }, $ = (e) => e.when ? j(e.when, T()) : !0, L = (e) => j(e.disabled, T()), G = (e) => j(e.readonly, T()), B = async (e, t = "") => {
47
- const r = t ? `${t}.${e.name}` : e.name, s = W(r);
48
- let i = "";
49
- const l = typeof e.label == "string" ? e.label : e.name, c = ue(e.labelI18n, l) ?? l;
45
+ Object.keys(y.value).length !== 0 && (y.value = {});
46
+ }, $ = (e) => e.when ? j(e.when, T()) : !0, L = (e) => j(e.disabled, T()), G = (e) => j(e.readonly, T()), B = async (e, t = "", n = i.value) => {
47
+ const u = t ? `${t}.${e.name}` : e.name, l = W(u);
48
+ let a = "";
49
+ const d = typeof e.label == "string" ? e.label : e.name, s = ue(e.labelI18n, d) ?? d;
50
50
  if (e.required) {
51
- const a = typeof s == "string" && /<\/?[a-z][^>]*>/i.test(s) && s.replace(/<[^>]*>/g, "").replace(/&nbsp;/gi, " ").trim() === "";
52
- (s == null || s === "" || Array.isArray(s) && s.length === 0 || a) && (i = `${c} is required`);
51
+ const c = typeof l == "string" && /<\/?[a-z][^>]*>/i.test(l) && l.replace(/<[^>]*>/g, "").replace(/&nbsp;/gi, " ").trim() === "";
52
+ (l == null || l === "" || Array.isArray(l) && l.length === 0 || c) && (a = `${s} is required`);
53
53
  }
54
- if (!i && e.maxFileSize) {
55
- const a = e.maxFileSize * 1024 * 1024;
56
- if (s != null && s !== "") {
57
- const v = Array.isArray(s) ? s : [s];
58
- for (const p of v) {
59
- const y = p instanceof File ? p.size : p?.fileSize || p?.file?.size || p?.size;
60
- if (y !== void 0 && y > a) {
61
- i = `${c} size must be less than ${e.maxFileSize}MB`;
54
+ if (!a && e.maxFileSize) {
55
+ const c = e.maxFileSize * 1024 * 1024;
56
+ if (l != null && l !== "") {
57
+ const g = Array.isArray(l) ? l : [l];
58
+ for (const p of g) {
59
+ const r = p instanceof File ? p.size : p?.fileSize || p?.file?.size || p?.size;
60
+ if (r !== void 0 && r > c) {
61
+ a = `${s} size must be less than ${e.maxFileSize}MB`;
62
62
  break;
63
63
  }
64
64
  }
65
65
  }
66
66
  }
67
- if (!i && (e.type === "file" || e.type === "fileUploader") && (e.props?.multiple || e.maxFiles)) {
68
- const a = e.maxFiles || e.props?.maxFiles;
69
- a && Array.isArray(s) && s.length > a && (i = `Maximum ${a} files allowed`);
67
+ if (!a && (e.type === "file" || e.type === "fileUploader") && (e.props?.multiple || e.maxFiles)) {
68
+ const c = e.maxFiles || e.props?.maxFiles;
69
+ c && Array.isArray(l) && l.length > c && (a = `Maximum ${c} files allowed`);
70
70
  }
71
- if (!i && e.validation) {
72
- h(r, !0);
71
+ if (!a && e.validation) {
72
+ w(u, !0);
73
73
  try {
74
- i = await e.validation({
75
- value: s,
76
- values: o.value,
77
- globalValues: o.value,
78
- isUpdate: F
74
+ a = await e.validation({
75
+ value: l,
76
+ values: n,
77
+ globalValues: i.value,
78
+ isUpdate: h
79
79
  });
80
- } catch (a) {
81
- console.error(`[useForm] Validation error in field ${r}:`, a), i = "Validation failed";
80
+ } catch (c) {
81
+ console.error(`[useForm] Validation error in field ${u}:`, c), a = "Validation failed";
82
82
  } finally {
83
- h(r, !1);
83
+ w(u, !1);
84
84
  }
85
85
  }
86
- if (S(r, i), e.type === "customFields" && e.props?.schema) {
87
- const a = e.props.schema, v = Array.isArray(s) ? s : [];
86
+ if (S(u, a), e.type === "customFields" && e.props?.schema) {
87
+ const c = e.props.schema, g = Array.isArray(l) ? l : [];
88
88
  let p = !1;
89
- for (let y = 0; y < v.length; y++) {
90
- const u = { values: v[y] || {}, globalValues: o.value, isUpdate: F };
91
- for (const n of a) {
92
- const V = !n.when || j(n.when, u), d = j(n.disabled, u);
93
- V && !d ? await B(n, `${r}.${y}`) && (p = !0) : S(`${r}.${y}.${n.name}`, "");
89
+ for (let r = 0; r < g.length; r++) {
90
+ const f = g[r] || {}, o = { values: f, globalValues: i.value, isUpdate: h };
91
+ for (const m of c) {
92
+ const v = !m.when || j(m.when, o), K = j(m.disabled, o);
93
+ v && !K ? await B(
94
+ m,
95
+ `${u}.${r}`,
96
+ f
97
+ ) && (p = !0) : S(`${u}.${r}.${m.name}`, "");
94
98
  }
95
99
  }
96
- p && !i && (i = "Please fix errors in the list.", S(r, i));
100
+ p && !a && (a = "Please fix errors in the list.", S(u, a));
97
101
  }
98
- return i;
102
+ return a;
99
103
  }, J = async () => {
100
104
  k();
101
105
  let e = !0;
@@ -104,151 +108,151 @@ function he(M) {
104
108
  await B(t) && (e = !1);
105
109
  }
106
110
  return e;
107
- }, Y = async (e, t, r) => {
108
- const s = U.value.filter((l) => l.name === e);
109
- let i = s.find((l) => $(l));
110
- if (!i && s.length > 0 && (i = s[0]), i && (!$(i) || L(i) || G(i))) {
111
+ }, Z = async (e, t, n) => {
112
+ const u = U.value.filter((a) => a.name === e);
113
+ let l = u.find((a) => $(a));
114
+ if (!l && u.length > 0 && (l = u[0]), l && (!$(l) || L(l) || G(l))) {
111
115
  console.warn(`[vlite3/useForm] Blocked attempted update to disabled/readonly/hidden field: ${e}`);
112
116
  return;
113
117
  }
114
- if (o.value = I(o.value, e, t), z.value = !0, S(e, ""), i?.updateValues) {
115
- h(e, !0);
118
+ if (i.value = I(i.value, e, t), z.value = !0, S(e, ""), l?.updateValues) {
119
+ w(e, !0);
116
120
  try {
117
- const l = await i.updateValues({
121
+ const a = await l.updateValues({
118
122
  value: t,
119
123
  // Exposing the explicitly requested value
120
- values: o.value,
121
- globalValues: o.value,
122
- data: r,
123
- isUpdate: F,
124
+ values: i.value,
125
+ globalValues: i.value,
126
+ data: n,
127
+ isUpdate: h,
124
128
  updateError: H
125
129
  });
126
- l && typeof l == "object" && (o.value = { ...o.value, ...l });
127
- } catch (l) {
128
- console.error(`[useForm] Error in updateValues for ${e}:`, l);
130
+ a && typeof a == "object" && (i.value = { ...i.value, ...a });
131
+ } catch (a) {
132
+ console.error(`[useForm] Error in updateValues for ${e}:`, a);
129
133
  } finally {
130
- h(e, !1);
134
+ w(e, !1);
131
135
  }
132
136
  }
133
- }, Z = async () => {
134
- const e = A(o.value), t = re(x.value, e, o.value, F), r = (l, c) => {
135
- let a = null;
136
- l instanceof File ? a = l : l && typeof l == "object" && l.file instanceof File && (a = l.file);
137
- const v = {
138
- ...typeof l == "object" ? l : {},
139
- fileName: l?.fileName || a?.name || c.split("/").pop() || "unknown",
140
- fileUrl: c,
141
- fileType: l?.fileType || a?.type || "application/octet-stream",
142
- fileSize: l?.fileSize || a?.size || 0
137
+ }, _ = async () => {
138
+ const e = A(i.value), t = re(x.value, e, i.value, h), n = (a, d) => {
139
+ let s = null;
140
+ a instanceof File ? s = a : a && typeof a == "object" && a.file instanceof File && (s = a.file);
141
+ const c = {
142
+ ...typeof a == "object" ? a : {},
143
+ fileName: a?.fileName || s?.name || d.split("/").pop() || "unknown",
144
+ fileUrl: d,
145
+ fileType: a?.fileType || s?.type || "application/octet-stream",
146
+ fileSize: a?.fileSize || s?.size || 0
143
147
  };
144
- return delete v.file, delete v.base64, v;
145
- }, s = t.map(async (l) => {
146
- const { name: c, value: a, field: v } = l;
147
- if (l.type === "thumbnailSelector") {
148
- const f = a, u = Array.isArray(f.images) ? f.images : [], n = f.thumbnail;
149
- h(c, !0);
148
+ return delete c.file, delete c.base64, c;
149
+ }, u = t.map(async (a) => {
150
+ const { name: d, value: s, field: c } = a;
151
+ if (a.type === "thumbnailSelector") {
152
+ const r = s, f = Array.isArray(r.images) ? r.images : [], o = r.thumbnail;
153
+ w(d, !0);
150
154
  try {
151
- const V = await Promise.all(
152
- u.map(async (w) => {
153
- if (w.startsWith("data:image/")) {
154
- const q = await (await fetch(w)).blob(), te = new File([q], `thumbnail-${Date.now()}.${q.type.split("/")[1] || "jpg"}`, { type: q.type });
155
- return await O(te, C) || w;
155
+ const m = await Promise.all(
156
+ f.map(async (b) => {
157
+ if (b.startsWith("data:image/")) {
158
+ const q = await (await fetch(b)).blob(), te = new File([q], `thumbnail-${Date.now()}.${q.type.split("/")[1] || "jpg"}`, { type: q.type });
159
+ return await O(te, C) || b;
156
160
  }
157
- return w;
161
+ return b;
158
162
  })
159
163
  );
160
- let d = n;
161
- if (n && n.startsWith("data:image/")) {
162
- const w = u.indexOf(n);
163
- w !== -1 && V[w] && (d = V[w]);
164
+ let v = o;
165
+ if (o && o.startsWith("data:image/")) {
166
+ const b = f.indexOf(o);
167
+ b !== -1 && m[b] && (v = m[b]);
164
168
  }
165
- return { name: c, value: { images: V, thumbnail: d } };
169
+ return { name: d, value: { images: m, thumbnail: v } };
166
170
  } finally {
167
- h(c, !1);
171
+ w(d, !1);
168
172
  }
169
173
  }
170
- const p = v.returnFileObject === !0, y = Array.isArray(a) ? a.some(
171
- (f) => f instanceof File || f && typeof f == "object" && f.file instanceof File
172
- ) : a instanceof File || a && typeof a == "object" && a.file instanceof File;
173
- y && h(c, !0);
174
+ const g = c.returnFileObject === !0, p = Array.isArray(s) ? s.some(
175
+ (r) => r instanceof File || r && typeof r == "object" && r.file instanceof File
176
+ ) : s instanceof File || s && typeof s == "object" && s.file instanceof File;
177
+ p && w(d, !0);
174
178
  try {
175
- if (Array.isArray(a)) {
176
- const f = a.map(async (n) => {
177
- if (n instanceof File || n && typeof n == "object" && n.file instanceof File) {
178
- const d = await O(n, C);
179
- return d ? p ? r(n, d) : d : null;
179
+ if (Array.isArray(s)) {
180
+ const r = s.map(async (o) => {
181
+ if (o instanceof File || o && typeof o == "object" && o.file instanceof File) {
182
+ const v = await O(o, C);
183
+ return v ? g ? n(o, v) : v : null;
180
184
  }
181
- if (n && typeof n == "object") {
182
- const d = { ...n };
183
- return delete d.file, delete d.base64, d;
185
+ if (o && typeof o == "object") {
186
+ const v = { ...o };
187
+ return delete v.file, delete v.base64, v;
184
188
  }
185
- return n;
186
- }), u = await Promise.all(f);
187
- return { name: c, value: u };
189
+ return o;
190
+ }), f = await Promise.all(r);
191
+ return { name: d, value: f };
188
192
  } else {
189
- if (a instanceof File || a && typeof a == "object" && a.file instanceof File) {
190
- const u = await O(a, C);
191
- if (u)
192
- return { name: c, value: p ? r(a, u) : u };
193
- } else if (a && typeof a == "object") {
194
- const u = { ...a };
195
- return delete u.file, delete u.base64, { name: c, value: u };
193
+ if (s instanceof File || s && typeof s == "object" && s.file instanceof File) {
194
+ const f = await O(s, C);
195
+ if (f)
196
+ return { name: d, value: g ? n(s, f) : f };
197
+ } else if (s && typeof s == "object") {
198
+ const f = { ...s };
199
+ return delete f.file, delete f.base64, { name: d, value: f };
196
200
  }
197
201
  return null;
198
202
  }
199
203
  } finally {
200
- y && h(c, !1);
204
+ p && w(d, !1);
201
205
  }
202
206
  });
203
- return (await Promise.all(s)).forEach((l) => {
204
- l && (Object.assign(e, I(e, l.name, l.value)), o.value = I(o.value, l.name, l.value));
207
+ return (await Promise.all(u)).forEach((a) => {
208
+ a && (Object.assign(e, I(e, a.name, a.value)), i.value = I(i.value, a.name, a.value));
205
209
  }), e;
206
- }, _ = (e) => {
210
+ }, ee = (e) => {
207
211
  const t = { ...e };
208
- for (const r of U.value)
209
- if ($(r) && r.type === "customFields" && r.props?.schema) {
210
- const s = K(t, r.name);
211
- if (Array.isArray(s)) {
212
- const i = oe(s, r.props.schema);
213
- Object.assign(t, I(t, r.name, i));
212
+ for (const n of U.value)
213
+ if ($(n) && n.type === "customFields" && n.props?.schema) {
214
+ const u = Q(t, n.name);
215
+ if (Array.isArray(u)) {
216
+ const l = oe(u, n.props.schema);
217
+ Object.assign(t, I(t, n.name, l));
214
218
  }
215
219
  }
216
220
  return t;
217
221
  };
218
222
  return {
219
- formValues: o,
220
- errors: m,
223
+ formValues: i,
224
+ errors: y,
221
225
  isSubmitting: D,
222
226
  isDirty: z,
223
227
  fieldLoading: E,
224
- handleFieldChange: Y,
228
+ handleFieldChange: Z,
225
229
  validateField: B,
226
230
  validateAll: J,
227
231
  isFieldVisible: $,
228
232
  isFieldDisabled: L,
229
233
  isFieldReadonly: G,
230
234
  getFieldValue: W,
231
- getFieldError: X,
235
+ getFieldError: Y,
232
236
  setFieldError: H,
233
237
  clearErrors: k,
234
238
  resetForm: () => {
235
- o.value = A(N.value), k(), z.value = !1;
239
+ i.value = A(N.value), k(), z.value = !1;
236
240
  },
237
241
  handleSubmit: async () => {
238
242
  if (await J()) {
239
243
  D.value = !0;
240
244
  try {
241
- let t = await Z();
242
- t = _(t), t = await ie(
245
+ let t = await _();
246
+ t = ee(t), t = await ie(
243
247
  t,
244
248
  x.value,
245
249
  M.emitFields,
246
250
  void 0,
247
- o.value,
248
- F
251
+ i.value,
252
+ h
249
253
  ), R && await R({
250
254
  values: t,
251
- isUpdate: F
255
+ isUpdate: h
252
256
  }), z.value = !1, N.value = A(t);
253
257
  } catch (t) {
254
258
  throw console.error("[useForm] Submit error:", t), t;
@@ -259,7 +263,7 @@ function he(M) {
259
263
  },
260
264
  flatSchema: U,
261
265
  reinitialize: async (e, t) => {
262
- e !== void 0 && (x.value = e), t !== void 0 && (b = t), await P(t !== void 0 ? t : b);
266
+ e !== void 0 && (x.value = e), t !== void 0 && (F = t), await P(t !== void 0 ? t : F);
263
267
  }
264
268
  };
265
269
  }
@@ -22,6 +22,9 @@ interface Props {
22
22
  errors?: Record<string, string>;
23
23
  isUpdate?: boolean;
24
24
  layout?: 'table' | 'accordion';
25
+ /** Row key for accordion + stacked-mobile card titles (e.g. `'label'`). */
26
+ rowTitleKey?: string;
27
+ /** @deprecated Use `rowTitleKey`. Alias kept for backward compatibility. */
25
28
  accordionTitleKey?: string;
26
29
  }
27
30
  declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
@@ -42,10 +45,11 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
42
45
  modelValue: Record<string, any>[];
43
46
  errors: Record<string, string>;
44
47
  showRowNumbers: boolean;
45
- accordionTitleKey: string;
48
+ rowTitleKey: string;
46
49
  headers: string[];
47
50
  minRows: number;
48
51
  maxRows: number;
49
52
  addButtonText: string;
53
+ accordionTitleKey: string;
50
54
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
51
55
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import o from "./index.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0138ffcc"]]);
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-63b24d19"]]);
5
5
  export {
6
- r as default
6
+ s as default
7
7
  };