vlite3 1.0.10 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/README.md +4 -1
  2. package/components/AttachmentsList/AttachmentsList.vue.d.ts +1 -16
  3. package/components/AttachmentsList/AttachmentsList.vue.js +191 -167
  4. package/components/AvatarGroup/AvatarGroup.vue.d.ts +24 -0
  5. package/components/AvatarGroup/AvatarGroup.vue.js +91 -0
  6. package/components/AvatarGroup/AvatarGroup.vue2.js +4 -0
  7. package/components/AvatarGroup/index.d.ts +2 -0
  8. package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
  9. package/components/Barcode/Barcode.vue.js +6 -5
  10. package/components/Button.vue.d.ts +1 -1
  11. package/components/Calendar/Calendar.vue.d.ts +229 -0
  12. package/components/Calendar/Calendar.vue.js +7 -0
  13. package/components/Calendar/Calendar.vue2.js +186 -0
  14. package/components/Calendar/CalendarEventItem.vue.d.ts +17 -0
  15. package/components/Calendar/CalendarEventItem.vue.js +111 -0
  16. package/components/Calendar/CalendarEventItem.vue2.js +4 -0
  17. package/components/Calendar/index.d.ts +2 -0
  18. package/components/Carousel/Carousel.vue.d.ts +2 -2
  19. package/components/CategoryManager/CategoryManager.vue.d.ts +2 -1
  20. package/components/CategoryManager/CategoryManager.vue.js +322 -0
  21. package/components/CategoryManager/CategoryManager.vue2.js +4 -0
  22. package/components/CategoryManager/CategoryNode.vue.js +224 -0
  23. package/components/CategoryManager/CategoryNode.vue2.js +4 -0
  24. package/components/CategoryManager/types.d.ts +14 -0
  25. package/components/Chip/Chip.vue.d.ts +2 -2
  26. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  27. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  28. package/components/CommandPalette/CommandPaletteContent.vue.js +1 -1
  29. package/components/CommandPalette/CommandPaletteContent.vue2.js +7 -7
  30. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  31. package/components/ConfirmationModal.vue.d.ts +2 -2
  32. package/components/CustomFieldsDisplay/CustomFieldsDisplay.vue.d.ts +48 -0
  33. package/components/CustomFieldsDisplay/CustomFieldsDisplay.vue.js +97 -0
  34. package/components/CustomFieldsDisplay/CustomFieldsDisplay.vue2.js +4 -0
  35. package/components/CustomFieldsDisplay/index.d.ts +2 -0
  36. package/components/CustomFieldsDisplay/types.d.ts +18 -0
  37. package/components/DataTable/DataTable.vue.d.ts +3 -3
  38. package/components/DateTime/DateTime.vue.d.ts +2 -0
  39. package/components/DateTime/DateTime.vue.js +9 -23
  40. package/components/Dropdown/Dropdown.vue.d.ts +3 -3
  41. package/components/Dropdown/DropdownGroupedLayout.vue.d.ts +1 -1
  42. package/components/Dropdown/DropdownMenu.vue.d.ts +2 -2
  43. package/components/Dropdown/DropdownTrigger.vue.d.ts +1 -1
  44. package/components/FilePicker/FilePicker.vue.d.ts +1 -1
  45. package/components/Form/CustomFields.vue.d.ts +1 -1
  46. package/components/Form/Form.vue.js +2 -2
  47. package/components/Form/Form.vue2.js +230 -241
  48. package/components/Form/FormField.vue.d.ts +1 -1
  49. package/components/Form/composables/useForm.d.ts +2 -0
  50. package/components/Form/composables/useForm.js +76 -69
  51. package/components/Form/utils/form.utils.js +66 -66
  52. package/components/ImportData/ImportData.vue.js +48 -48
  53. package/components/ImportData/ImportStep2.vue.js +116 -5
  54. package/components/ImportData/ImportStep2.vue2.js +2 -105
  55. package/components/Input.vue.d.ts +3 -3
  56. package/components/Invoice/Invoice.vue.d.ts +3 -0
  57. package/components/Invoice/Invoice.vue.js +38 -0
  58. package/components/Invoice/Invoice.vue2.js +4 -0
  59. package/components/Invoice/InvoiceVariant1.vue.d.ts +13 -0
  60. package/components/Invoice/InvoiceVariant1.vue.js +360 -0
  61. package/components/Invoice/InvoiceVariant1.vue2.js +4 -0
  62. package/components/Invoice/InvoiceVariant2.vue.d.ts +13 -0
  63. package/components/Invoice/InvoiceVariant2.vue.js +226 -0
  64. package/components/Invoice/InvoiceVariant2.vue2.js +4 -0
  65. package/components/Invoice/InvoiceVariant3.vue.d.ts +13 -0
  66. package/components/Invoice/InvoiceVariant3.vue.js +292 -0
  67. package/components/Invoice/InvoiceVariant3.vue2.js +4 -0
  68. package/components/Invoice/InvoiceVariant4.vue.d.ts +13 -0
  69. package/components/Invoice/InvoiceVariant4.vue.js +343 -0
  70. package/components/Invoice/InvoiceVariant4.vue2.js +4 -0
  71. package/components/Invoice/index.d.ts +2 -0
  72. package/components/Invoice/types.d.ts +97 -0
  73. package/components/List/List.vue.d.ts +1 -9
  74. package/components/List/List.vue.js +166 -165
  75. package/components/List/ListFieldRow.vue.d.ts +10 -2
  76. package/components/List/ListFieldRow.vue.js +80 -78
  77. package/components/List/utils.d.ts +2 -1
  78. package/components/List/utils.js +8 -39
  79. package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
  80. package/components/Navbar/NavbarItem.vue.d.ts +1 -1
  81. package/components/Navbar/NavbarTabs.vue.js +2 -2
  82. package/components/NavbarCommandPalette.vue.js +1 -1
  83. package/components/NumberInput.vue.d.ts +2 -2
  84. package/components/NumberInput.vue.js +2 -2
  85. package/components/NumberInput.vue2.js +38 -38
  86. package/components/OTPInput/OTPInput.vue.d.ts +1 -1
  87. package/components/PricingPlan/PricingPlan.vue.d.ts +1 -1
  88. package/components/Screen/ScreenFilter.vue.js +22 -21
  89. package/components/Screen/components/ScreenQuickFilters.vue.js +6 -5
  90. package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
  91. package/components/Stats/Stats.vue.d.ts +1 -1
  92. package/components/StatusChip/status-map.js +27 -7
  93. package/components/Tabes/Tabes.vue.d.ts +1 -0
  94. package/components/Tabes/Tabes.vue.js +2 -2
  95. package/components/Tabes/Tabes.vue2.js +33 -32
  96. package/components/ThumbnailSelector/ThumbnailSelector.vue.d.ts +2 -2
  97. package/components/ThumbnailSelector/ThumbnailSelector.vue.js +2 -2
  98. package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +141 -115
  99. package/components/Workbook/Workbook.vue.d.ts +3 -3
  100. package/core/config.d.ts +76 -0
  101. package/core/index.js +17 -5
  102. package/index.d.ts +6 -1
  103. package/index.js +271 -256
  104. package/package.json +2 -1
  105. package/style.css +5 -3
  106. package/types/config.type.d.ts +6 -0
  107. package/types/list.type.d.ts +6 -0
  108. package/utils/configUtils.d.ts +9 -0
  109. package/utils/configUtils.js +7 -0
  110. package/utils/index.d.ts +1 -0
  111. package/utils/status.d.ts +5 -0
  112. package/utils/status.js +33 -0
  113. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
@@ -30,10 +30,10 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
30
30
  variant: InputVariant;
31
31
  size: InputSize;
32
32
  rounded: InputRounded;
33
+ loading: boolean;
33
34
  readonly: boolean;
34
35
  error: string;
35
36
  disabled: boolean;
36
- loading: boolean;
37
37
  isUpdate: boolean;
38
38
  floatingActive: boolean;
39
39
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -45,6 +45,8 @@ export interface UseFormReturn {
45
45
  handleSubmit: () => Promise<void>;
46
46
  /** Flattened schema for iteration */
47
47
  flatSchema: ComputedRef<IForm[]>;
48
+ /** Re-initialize form with new schema/values (useful for async data loading) */
49
+ reinitialize: (newSchema?: IForm[] | IForm[][], newValues?: Record<string, any>) => Promise<void>;
48
50
  }
49
51
  /**
50
52
  * Main form composable for managing form state, validation, and submission
@@ -1,37 +1,41 @@
1
- import { ref as S, shallowRef as Z, computed as _, watch as ee } from "vue";
2
- import { deepClone as g, initializeFormValues as ae, cleanSubmitValues as le, getNestedValue as H, evaluateConditional as $, setNestedValue as j, collectFileFields as te, filterNullCustomFields as se } from "../utils/form.utils.js";
3
- import { useFileUpload as ie } from "./useFileUpload.js";
4
- import { $t as oe } from "../../../utils/i18n.js";
5
- function me(B) {
6
- const { schema: h, values: w, isUpdate: b = !1, folderId: U, onSubmit: q } = B, { handleUploadFile: E } = ie(), n = S(w ? g(w) : {}), y = S({}), I = S(!1), A = S(!1), m = S({}), C = Z(
7
- w ? g(w) : {}
8
- ), x = _(() => h ? Array.isArray(h[0]) ? h.flat() : h : []), L = async (e) => {
1
+ import { ref as z, shallowRef as H, computed as ee, watch as ae } from "vue";
2
+ import { deepClone as V, initializeFormValues as le, cleanSubmitValues as te, getNestedValue as J, evaluateConditional as S, setNestedValue as j, collectFileFields as se, filterNullCustomFields as ie } from "../utils/form.utils.js";
3
+ import { useFileUpload as oe } from "./useFileUpload.js";
4
+ import { $t as re } from "../../../utils/i18n.js";
5
+ function Fe(q) {
6
+ let { schema: K, values: b, isUpdate: F = !1, folderId: U, onSubmit: L } = q;
7
+ const { handleUploadFile: E } = oe(), n = z(b ? V(b) : {}), y = z({}), I = z(!1), g = z(!1), m = z({}), A = H(K), C = H(
8
+ b ? V(b) : {}
9
+ ), $ = ee(() => {
10
+ const e = A.value;
11
+ return e ? Array.isArray(e[0]) ? e.flat() : e : [];
12
+ }), D = async (e) => {
9
13
  try {
10
- const a = await ae(h, e, n.value, b);
11
- n.value = a, C.value = g(a), A.value = !1;
14
+ const a = await le(A.value, e, n.value, F);
15
+ n.value = a, C.value = V(a), g.value = !1;
12
16
  } catch (a) {
13
17
  console.error("[useForm] Initialization error:", a);
14
18
  }
15
19
  };
16
- L(w), ee(
17
- () => w,
20
+ D(b), ae(
21
+ () => b,
18
22
  (e) => {
19
- e && L(e);
23
+ e && D(e);
20
24
  },
21
25
  { deep: !0 }
22
26
  );
23
- const D = () => ({
27
+ const N = () => ({
24
28
  values: n.value,
25
29
  globalValues: n.value,
26
- isUpdate: b
27
- }), M = (e) => H(n.value, e), J = (e) => y.value[e] || "", R = (e, a) => {
30
+ isUpdate: F
31
+ }), M = (e) => J(n.value, e), Q = (e) => y.value[e] || "", R = (e, a) => {
28
32
  a ? y.value[e] = a : delete y.value[e];
29
- }, N = () => {
33
+ }, O = () => {
30
34
  y.value = {};
31
- }, z = (e) => e.when ? $(e.when, D()) : !0, O = (e) => $(e.disabled, D()), W = (e) => $(e.readonly, D()), P = async (e, a = "") => {
35
+ }, x = (e) => e.when ? S(e.when, N()) : !0, P = (e) => S(e.disabled, N()), W = (e) => S(e.readonly, N()), T = async (e, a = "") => {
32
36
  const o = a ? `${a}.${e.name}` : e.name, t = M(o);
33
37
  let s = "";
34
- const i = e.labelI18n ? oe(e.labelI18n) : typeof e.label == "string" ? e.label : e.name;
38
+ const i = e.labelI18n ? re(e.labelI18n) : typeof e.label == "string" ? e.label : e.name;
35
39
  if (e.required && (t == null || t === "" || Array.isArray(t) && t.length === 0) && (s = `${i} is required`), !s && e.maxFileSize) {
36
40
  const r = e.maxFileSize * 1024 * 1024;
37
41
  if (t != null && t !== "") {
@@ -56,7 +60,7 @@ function me(B) {
56
60
  value: t,
57
61
  values: n.value,
58
62
  globalValues: n.value,
59
- isUpdate: b
63
+ isUpdate: F
60
64
  });
61
65
  } catch (r) {
62
66
  console.error(`[useForm] Validation error in field ${o}:`, r), s = "Validation failed";
@@ -68,30 +72,30 @@ function me(B) {
68
72
  const r = e.props.schema, l = Array.isArray(t) ? t : [];
69
73
  let f = !1;
70
74
  for (let v = 0; v < l.length; v++) {
71
- const d = { values: l[v] || {}, globalValues: n.value, isUpdate: b };
75
+ const d = { values: l[v] || {}, globalValues: n.value, isUpdate: F };
72
76
  for (const u of r) {
73
- const c = !u.when || $(u.when, d), V = $(u.disabled, d);
74
- c && !V ? await P(u, `${o}.${v}`) && (f = !0) : delete y.value[`${o}.${v}.${u.name}`];
77
+ const c = !u.when || S(u.when, d), w = S(u.disabled, d);
78
+ c && !w ? await T(u, `${o}.${v}`) && (f = !0) : delete y.value[`${o}.${v}.${u.name}`];
75
79
  }
76
80
  }
77
81
  f && !s && (s = "Please fix errors in the list.", y.value[o] = s);
78
82
  }
79
83
  return s;
80
84
  }, G = async () => {
81
- N();
85
+ O();
82
86
  let e = !0;
83
- for (const a of x.value) {
84
- if (!z(a) || O(a)) continue;
85
- await P(a) && (e = !1);
87
+ for (const a of $.value) {
88
+ if (!x(a) || P(a)) continue;
89
+ await T(a) && (e = !1);
86
90
  }
87
91
  return e;
88
- }, K = async (e, a, o) => {
89
- const t = x.value.find((s) => s.name === e);
90
- if (t && (!z(t) || O(t) || W(t))) {
92
+ }, X = async (e, a, o) => {
93
+ const t = $.value.find((s) => s.name === e);
94
+ if (t && (!x(t) || P(t) || W(t))) {
91
95
  console.warn(`[vlite3/useForm] Blocked attempted update to disabled/readonly/hidden field: ${e}`);
92
96
  return;
93
97
  }
94
- if (n.value = j(n.value, e, a), A.value = !0, delete y.value[e], t?.updateValues) {
98
+ if (n.value = j(n.value, e, a), g.value = !0, delete y.value[e], t?.updateValues) {
95
99
  m.value[e] = !0;
96
100
  try {
97
101
  const s = await t.updateValues({
@@ -100,7 +104,7 @@ function me(B) {
100
104
  values: n.value,
101
105
  globalValues: n.value,
102
106
  data: o,
103
- isUpdate: b,
107
+ isUpdate: F,
104
108
  updateError: R
105
109
  });
106
110
  s && typeof s == "object" && (n.value = { ...n.value, ...s });
@@ -110,8 +114,8 @@ function me(B) {
110
114
  m.value[e] = !1;
111
115
  }
112
116
  }
113
- }, Q = async () => {
114
- const e = g(n.value), a = te(h, e, n.value, b), o = (i, r) => {
117
+ }, Y = async () => {
118
+ const e = V(n.value), a = se(A.value, e, n.value, F), o = (i, r) => {
115
119
  let l = null;
116
120
  i instanceof File ? l = i : i && typeof i == "object" && i.file instanceof File && (l = i.file);
117
121
  const f = {
@@ -128,29 +132,29 @@ function me(B) {
128
132
  const d = l, u = Array.isArray(d.images) ? d.images : [], c = d.thumbnail;
129
133
  m.value[r] = !0;
130
134
  try {
131
- const V = await Promise.all(
132
- u.map(async (F) => {
133
- if (F.startsWith("data:image/")) {
134
- const k = await (await fetch(F)).blob(), Y = new File([k], `thumbnail-${Date.now()}.${k.type.split("/")[1] || "jpg"}`, { type: k.type });
135
- return await E(Y, U) || F;
135
+ const w = await Promise.all(
136
+ u.map(async (h) => {
137
+ if (h.startsWith("data:image/")) {
138
+ const B = await (await fetch(h)).blob(), _ = new File([B], `thumbnail-${Date.now()}.${B.type.split("/")[1] || "jpg"}`, { type: B.type });
139
+ return await E(_, U) || h;
136
140
  }
137
- return F;
141
+ return h;
138
142
  })
139
143
  );
140
144
  let p = c;
141
145
  if (c && c.startsWith("data:image/")) {
142
- const F = u.indexOf(c);
143
- F !== -1 && V[F] && (p = V[F]);
146
+ const h = u.indexOf(c);
147
+ h !== -1 && w[h] && (p = w[h]);
144
148
  }
145
- return { name: r, value: { images: V, thumbnail: p } };
149
+ return { name: r, value: { images: w, thumbnail: p } };
146
150
  } finally {
147
151
  m.value[r] = !1;
148
152
  }
149
153
  }
150
- const v = f.returnFileObject === !0, T = Array.isArray(l) ? l.some(
154
+ const v = f.returnFileObject === !0, k = Array.isArray(l) ? l.some(
151
155
  (d) => d instanceof File || d && typeof d == "object" && d.file instanceof File
152
156
  ) : l instanceof File || l && typeof l == "object" && l.file instanceof File;
153
- T && (m.value[r] = !0);
157
+ k && (m.value[r] = !0);
154
158
  try {
155
159
  if (Array.isArray(l)) {
156
160
  const d = l.map(async (c) => {
@@ -177,19 +181,19 @@ function me(B) {
177
181
  return null;
178
182
  }
179
183
  } finally {
180
- T && (m.value[r] = !1);
184
+ k && (m.value[r] = !1);
181
185
  }
182
186
  });
183
187
  return (await Promise.all(t)).forEach((i) => {
184
188
  i && (Object.assign(e, j(e, i.name, i.value)), n.value = j(n.value, i.name, i.value));
185
189
  }), e;
186
- }, X = (e) => {
190
+ }, Z = (e) => {
187
191
  const a = { ...e };
188
- for (const o of x.value)
189
- if (z(o) && o.type === "customFields" && o.props?.schema) {
190
- const t = H(a, o.name);
192
+ for (const o of $.value)
193
+ if (x(o) && o.type === "customFields" && o.props?.schema) {
194
+ const t = J(a, o.name);
191
195
  if (Array.isArray(t)) {
192
- const s = se(t, o.props.schema);
196
+ const s = ie(t, o.props.schema);
193
197
  Object.assign(a, j(a, o.name, s));
194
198
  }
195
199
  }
@@ -199,37 +203,37 @@ function me(B) {
199
203
  formValues: n,
200
204
  errors: y,
201
205
  isSubmitting: I,
202
- isDirty: A,
206
+ isDirty: g,
203
207
  fieldLoading: m,
204
- handleFieldChange: K,
205
- validateField: P,
208
+ handleFieldChange: X,
209
+ validateField: T,
206
210
  validateAll: G,
207
- isFieldVisible: z,
208
- isFieldDisabled: O,
211
+ isFieldVisible: x,
212
+ isFieldDisabled: P,
209
213
  isFieldReadonly: W,
210
214
  getFieldValue: M,
211
- getFieldError: J,
215
+ getFieldError: Q,
212
216
  setFieldError: R,
213
- clearErrors: N,
217
+ clearErrors: O,
214
218
  resetForm: () => {
215
- n.value = g(C.value), N(), A.value = !1;
219
+ n.value = V(C.value), O(), g.value = !1;
216
220
  },
217
221
  handleSubmit: async () => {
218
222
  if (await G()) {
219
223
  I.value = !0;
220
224
  try {
221
- let a = await Q();
222
- a = X(a), a = await le(
225
+ let a = await Y();
226
+ a = Z(a), a = await te(
223
227
  a,
224
- h,
225
- B.emitFields,
228
+ A.value,
229
+ q.emitFields,
226
230
  void 0,
227
231
  n.value,
228
- b
229
- ), q && await q({
232
+ F
233
+ ), L && await L({
230
234
  values: a,
231
- isUpdate: b
232
- }), A.value = !1, C.value = g(a);
235
+ isUpdate: F
236
+ }), g.value = !1, C.value = V(a);
233
237
  } catch (a) {
234
238
  throw console.error("[useForm] Submit error:", a), a;
235
239
  } finally {
@@ -237,9 +241,12 @@ function me(B) {
237
241
  }
238
242
  }
239
243
  },
240
- flatSchema: x
244
+ flatSchema: $,
245
+ reinitialize: async (e, a) => {
246
+ e !== void 0 && (A.value = e), a !== void 0 && (b = a), await D(a !== void 0 ? a : b);
247
+ }
241
248
  };
242
249
  }
243
250
  export {
244
- me as useForm
251
+ Fe as useForm
245
252
  };
@@ -1,11 +1,11 @@
1
- function T(e) {
1
+ function x(e) {
2
2
  return !!e && typeof e == "object";
3
3
  }
4
- function E(e) {
4
+ function U(e) {
5
5
  return e ? typeof e == "object" && (typeof e.render == "function" || typeof e.setup == "function" || e.__name !== void 0 || e.name !== void 0) : !1;
6
6
  }
7
- function V(e, n) {
8
- if (typeof e.type == "function" && !E(e.type))
7
+ function b(e, n) {
8
+ if (typeof e.type == "function" && !U(e.type))
9
9
  try {
10
10
  return e.type(n);
11
11
  } catch (i) {
@@ -23,7 +23,7 @@ function p(e, n) {
23
23
  }
24
24
  return f;
25
25
  }
26
- function g(e, n, i) {
26
+ function A(e, n, i) {
27
27
  if (!n) return e;
28
28
  const f = n.split("."), o = { ...e };
29
29
  let a = o;
@@ -34,50 +34,50 @@ function g(e, n, i) {
34
34
  return a[f[f.length - 1]] = i, o;
35
35
  }
36
36
  function k(e, n) {
37
- return !T(n) || !n.name ? e : p(e, n.name) === void 0 && n.value !== void 0 ? g(e, n.name, n.value) : e;
37
+ return !x(n) || !n.name ? e : p(e, n.name) === void 0 && n.value !== void 0 ? A(e, n.name, n.value) : e;
38
38
  }
39
- async function U(e, n, i, f) {
39
+ async function T(e, n, i, f) {
40
40
  let o = n ? S(n) : {};
41
41
  const a = i || o, c = Array.isArray(e[0]) ? e.flat() : e;
42
42
  for (const t of c) {
43
43
  if (!t.name) continue;
44
- const d = { values: o, globalValues: a, isUpdate: f };
45
- if (t.when && !b(t.when, d))
44
+ const h = { values: o, globalValues: a, isUpdate: f };
45
+ if (t.when && !v(t.when, h))
46
46
  continue;
47
47
  const m = t.mapFrom || t.name;
48
48
  let s = n ? p(n, m) : void 0;
49
49
  if (s != null) {
50
- const l = t.valueKey || t.key;
51
- l && (Array.isArray(s) ? s = s.map(
52
- (r) => r && typeof r == "object" ? p(r, l) : r
53
- ) : typeof s == "object" && (s = p(s, l))), t.format && (s = await t.format(s, n || {}));
50
+ const u = t.valueKey || t.key;
51
+ u && (Array.isArray(s) ? s = s.map(
52
+ (r) => r && typeof r == "object" ? p(r, u) : r
53
+ ) : typeof s == "object" && (s = p(s, u))), t.format && (s = await t.format(s, n || {}));
54
54
  }
55
55
  if (s === void 0) {
56
56
  if (t.mapFrom && n) {
57
- const l = p(n, t.name);
58
- l !== void 0 && (s = l);
57
+ const u = p(n, t.name);
58
+ u !== void 0 && (s = u);
59
59
  }
60
60
  if (s === void 0) {
61
- const l = typeof t.value == "function" ? t.value() : t.value;
62
- l !== void 0 && Object.assign(o, g(o, t.name, l));
61
+ const u = typeof t.value == "function" ? t.value() : t.value;
62
+ u !== void 0 && Object.assign(o, A(o, t.name, u));
63
63
  } else
64
- Object.assign(o, g(o, t.name, s));
64
+ Object.assign(o, A(o, t.name, s));
65
65
  } else
66
- Object.assign(o, g(o, t.name, s));
67
- if (o = k(o, t.addonLeft), o = k(o, t.addonRight), V(t, d) === "customFields" && t.props?.schema) {
68
- const l = t.props.schema;
66
+ Object.assign(o, A(o, t.name, s));
67
+ if (o = k(o, t.addonLeft), o = k(o, t.addonRight), b(t, h) === "customFields" && t.props?.schema) {
68
+ const u = t.props.schema;
69
69
  let r = p(o, t.name);
70
70
  if (Array.isArray(r) && r.length > 0) {
71
71
  const y = await Promise.all(
72
- r.map((u) => U(l, u, a, f))
72
+ r.map((l) => T(u, l, a, f))
73
73
  );
74
- Object.assign(o, g(o, t.name, y));
74
+ Object.assign(o, A(o, t.name, y));
75
75
  }
76
76
  }
77
77
  }
78
78
  return o;
79
79
  }
80
- function b(e, n) {
80
+ function v(e, n) {
81
81
  return e === void 0 ? !1 : typeof e == "boolean" ? e : typeof e == "function" ? e(n) : !1;
82
82
  }
83
83
  function $(e, n) {
@@ -93,10 +93,10 @@ function B(e, n, i, f) {
93
93
  const o = [], a = i || n, c = Array.isArray(e[0]) ? e.flat() : e;
94
94
  for (const t of c) {
95
95
  if (!t.name) continue;
96
- const d = { values: n, globalValues: a, isUpdate: f };
97
- if (t.when && !b(t.when, d))
96
+ const h = { values: n, globalValues: a, isUpdate: f };
97
+ if (t.when && !v(t.when, h))
98
98
  continue;
99
- const m = V(t, d);
99
+ const m = b(t, h);
100
100
  if (m === "file" || m === "avatarUpload" || m === "fileUploader") {
101
101
  const s = p(n, t.name);
102
102
  s && o.push({
@@ -118,20 +118,20 @@ function B(e, n, i, f) {
118
118
  if (m === "customFields" && t.props?.schema) {
119
119
  const s = p(n, t.name);
120
120
  if (Array.isArray(s)) {
121
- const r = t.props.schema.filter((y) => !E(y.type));
122
- r.length > 0 && s.forEach((y, u) => {
123
- r.forEach((h) => {
124
- const v = { values: y || {}, globalValues: a, isUpdate: f };
125
- if (h.when && !b(h.when, v))
121
+ const r = t.props.schema.filter((y) => !U(y.type));
122
+ r.length > 0 && s.forEach((y, l) => {
123
+ r.forEach((g) => {
124
+ const F = { values: y || {}, globalValues: a, isUpdate: f };
125
+ if (g.when && !v(g.when, F))
126
126
  return;
127
- const A = V(h, v);
128
- if (A === "file" || A === "avatarUpload" || A === "fileUploader") {
129
- const w = y?.[h.name];
127
+ const d = b(g, F);
128
+ if (d === "file" || d === "avatarUpload" || d === "fileUploader") {
129
+ const w = y?.[g.name];
130
130
  w && o.push({
131
- name: `${t.name}.${u}.${h.name}`,
131
+ name: `${t.name}.${l}.${g.name}`,
132
132
  value: w,
133
- type: A,
134
- field: h
133
+ type: d,
134
+ field: g
135
135
  });
136
136
  }
137
137
  });
@@ -152,67 +152,67 @@ function S(e) {
152
152
  return n;
153
153
  }
154
154
  function I(e, n) {
155
- const i = V(e, n);
156
- return i === "multiSelect" ? [] : i === "thumbnailSelector" ? { images: [], thumbnail: null } : i === "switch" || i === "check" ? !1 : null;
155
+ const i = b(e, n);
156
+ return i === "multiSelect" ? [] : i === "thumbnailSelector" ? { images: [], thumbnail: null } : i === "switch" || i === "check" ? !1 : (i === "fileUploader" || i === "file" || i === "avatarUpload") && e.props?.multiple ? [] : null;
157
157
  }
158
158
  function K(e) {
159
159
  return !!(e == null || e === "" || Array.isArray(e) && e.length === 0);
160
160
  }
161
- function F(e, n) {
161
+ function O(e, n) {
162
162
  if (!(!e || typeof e != "object"))
163
163
  if (Array.isArray(e))
164
- e.forEach((i) => F(i, n));
164
+ e.forEach((i) => O(i, n));
165
165
  else {
166
166
  for (const i of n)
167
167
  delete e[i];
168
168
  for (const i in e)
169
- F(e[i], n);
169
+ O(e[i], n);
170
170
  }
171
171
  }
172
172
  async function P(e, n, i, f, o, a) {
173
- const c = S(e), t = o || e, d = Array.isArray(n[0]) ? n.flat() : n, m = /* @__PURE__ */ new Set();
174
- for (const r of d) {
173
+ const c = S(e), t = o || e, h = Array.isArray(n[0]) ? n.flat() : n, m = /* @__PURE__ */ new Set();
174
+ for (const r of h) {
175
175
  if (!r.name) continue;
176
176
  const y = { values: e, globalValues: t, isUpdate: a };
177
- (!r.when || b(r.when, y)) && m.add(r.name);
177
+ (!r.when || v(r.when, y)) && m.add(r.name);
178
178
  }
179
- const s = i || [], l = [];
180
- for (const r of d) {
179
+ const s = i || [], u = [];
180
+ for (const r of h) {
181
181
  if (!r.name) continue;
182
182
  const y = { values: e, globalValues: t, isUpdate: a };
183
- if (r.when && !b(r.when, y)) {
183
+ if (r.when && !v(r.when, y)) {
184
184
  m.has(r.name) || delete c[r.name];
185
185
  continue;
186
186
  }
187
- let u = p(e, r.name);
188
- const h = r.name.split(".")[0], v = Object.prototype.hasOwnProperty.call(e, h), A = V(r, y);
189
- if (K(u)) {
190
- if (!v) {
187
+ let l = p(e, r.name);
188
+ const g = r.name.split(".")[0], F = Object.prototype.hasOwnProperty.call(e, g), d = b(r, y);
189
+ if (Array.isArray(l) && (d === "fileUploader" || d === "file" || d === "avatarUpload") && (l = l.filter((V) => V != null && V !== "")), K(l)) {
190
+ if (!F) {
191
191
  m.has(r.name) || delete c[r.name];
192
192
  continue;
193
193
  }
194
- u = I(r, y);
194
+ l = I(r, y);
195
195
  }
196
- if (u = S(u), A === "customFields" && r.props?.schema && Array.isArray(u)) {
197
- const O = r.props.schema;
198
- u = await Promise.all(u.map((x) => P(x, O, i, f, t, a)));
196
+ if (l = S(l), d === "customFields" && r.props?.schema && Array.isArray(l)) {
197
+ const V = r.props.schema;
198
+ l = await Promise.all(l.map((E) => P(E, V, i, f, t, a)));
199
199
  }
200
- r.transform && (u = await r.transform(u, e));
200
+ r.transform && (l = await r.transform(l, e));
201
201
  const w = r.mapTo || r.name;
202
- w !== r.name ? (delete c[r.name], Object.assign(c, g(c, w, u))) : Object.assign(c, g(c, r.name, u));
202
+ w !== r.name ? (delete c[r.name], Object.assign(c, A(c, w, l))) : Object.assign(c, A(c, r.name, l));
203
203
  }
204
- return s.length > 0 && F(c, s), l.length > 0 && F(c, l), c;
204
+ return s.length > 0 && O(c, s), u.length > 0 && O(c, u), c;
205
205
  }
206
206
  export {
207
207
  P as cleanSubmitValues,
208
208
  B as collectFileFields,
209
209
  S as deepClone,
210
- b as evaluateConditional,
210
+ v as evaluateConditional,
211
211
  $ as filterNullCustomFields,
212
212
  p as getNestedValue,
213
- U as initializeFormValues,
214
- T as isAddonObject,
215
- E as isComponent,
216
- V as resolveFieldType,
217
- g as setNestedValue
213
+ T as initializeFormValues,
214
+ x as isAddonObject,
215
+ U as isComponent,
216
+ b as resolveFieldType,
217
+ A as setNestedValue
218
218
  };