@volverjs/form-vue 1.0.0-beta.32 → 1.0.0-beta.34

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.
package/dist/index.es.js CHANGED
@@ -1,92 +1,92 @@
1
- import { ref as C, computed as I, readonly as _, defineComponent as q, toRaw as U, watch as W, isProxy as ce, onMounted as j, provide as F, h as R, withModifiers as ue, toRefs as te, useId as ie, inject as N, onBeforeUnmount as J, unref as K, resolveComponent as L, defineAsyncComponent as ye, getCurrentInstance as he } from "vue";
1
+ import { ref as C, computed as I, readonly as L, defineComponent as W, h as $, withModifiers as ae, toRaw as _, watch as U, isProxy as ce, onMounted as j, provide as F, toRefs as te, useId as ie, inject as P, onBeforeUnmount as J, unref as K, resolveComponent as N, defineAsyncComponent as ye, getCurrentInstance as he } from "vue";
2
2
  import { watchIgnorable as me, throttleFilter as be } from "@vueuse/core";
3
- import { ZodObject as H, ZodDefault as pe, ZodNullable as Ve, ZodSchema as ge, ZodArray as Oe, ZodRecord as we, ZodEffects as le, ZodOptional as ne, ZodError as xe } from "zod";
3
+ import { ZodObject as H, ZodDefault as pe, ZodNullable as Ve, ZodSchema as ge, ZodArray as we, ZodRecord as Oe, ZodEffects as le, ZodOptional as ne, ZodError as xe } from "zod";
4
4
  var p = /* @__PURE__ */ ((r) => (r.text = "text", r.number = "number", r.email = "email", r.password = "password", r.tel = "tel", r.url = "url", r.search = "search", r.date = "date", r.time = "time", r.datetimeLocal = "datetime-local", r.month = "month", r.week = "week", r.color = "color", r.select = "select", r.checkbox = "checkbox", r.radio = "radio", r.textarea = "textarea", r.radioGroup = "radioGroup", r.checkboxGroup = "checkboxGroup", r.combobox = "combobox", r.custom = "custom", r))(p || {}), G = /* @__PURE__ */ ((r) => (r.invalid = "invalid", r.valid = "valid", r.submitting = "submitting", r.reset = "reset", r.updated = "updated", r.unknown = "unknown", r))(G || {});
5
5
  function X(r, i = {}) {
6
6
  const e = (d) => {
7
- let o = d;
8
- for (; o instanceof le; )
9
- o = o.innerType();
10
- return o instanceof ne && (o = o._def.innerType), o;
7
+ let f = d;
8
+ for (; f instanceof le; )
9
+ f = f.innerType();
10
+ return f instanceof ne && (f = f._def.innerType), f;
11
11
  }, c = (d) => {
12
- let o = d;
13
- for (; o instanceof le; )
14
- o = o.innerType();
15
- return o instanceof ne;
16
- }, a = e(r);
12
+ let f = d;
13
+ for (; f instanceof le; )
14
+ f = f.innerType();
15
+ return f instanceof ne;
16
+ }, t = e(r);
17
17
  return {
18
- ...(a instanceof H ? a._def.unknownKeys === "passthrough" : !1) ? i : {},
18
+ ...(t instanceof H ? t._def.unknownKeys === "passthrough" : !1) ? i : {},
19
19
  ...Object.fromEntries(
20
- Object.entries(a.shape).map(
21
- ([d, o]) => {
22
- const f = i[d], V = c(o);
23
- let v = e(o), s;
24
- if (v instanceof pe && (s = v._def.defaultValue(), v = v._def.innerType), f === null && v instanceof Ve)
25
- return [d, f];
26
- if (f == null && V)
27
- return [d, s];
20
+ Object.entries(t.shape).map(
21
+ ([d, f]) => {
22
+ const o = i[d], w = c(f);
23
+ let v = e(f), n;
24
+ if (v instanceof pe && (n = v._def.defaultValue(), v = v._def.innerType), o === null && v instanceof Ve)
25
+ return [d, o];
26
+ if (o == null && w)
27
+ return [d, n];
28
28
  if (v instanceof ge) {
29
- const h = o.safeParse(f);
29
+ const h = f.safeParse(o);
30
30
  if (h.success)
31
- return [d, h.data ?? s];
31
+ return [d, h.data ?? n];
32
32
  }
33
- if (v instanceof Oe && Array.isArray(f) && f.length) {
33
+ if (v instanceof we && Array.isArray(o) && o.length) {
34
34
  const h = e(v._def.type);
35
35
  if (h instanceof H)
36
36
  return [
37
37
  d,
38
- f.map(
39
- (m) => X(
38
+ o.map(
39
+ (V) => X(
40
40
  h,
41
- m && typeof m == "object" ? m : void 0
41
+ V && typeof V == "object" ? V : void 0
42
42
  )
43
43
  )
44
44
  ];
45
45
  }
46
- if (v instanceof we && f) {
46
+ if (v instanceof Oe && o) {
47
47
  const h = e(v._def.valueType);
48
48
  if (h instanceof H)
49
- return [d, Object.keys(f).reduce((m, b) => (m[b] = X(h, f[b]), m), {})];
49
+ return [d, Object.keys(o).reduce((V, m) => (V[m] = X(h, o[m]), V), {})];
50
50
  }
51
51
  return v instanceof H ? [
52
52
  d,
53
53
  X(
54
54
  v,
55
- f && typeof f == "object" ? f : s
55
+ o && typeof o == "object" ? o : n
56
56
  )
57
- ] : [d, s];
57
+ ] : [d, n];
58
58
  }
59
59
  )
60
60
  )
61
61
  };
62
62
  }
63
- function Ie(r, i, e, c, a) {
64
- const t = C(), d = C(), o = I(() => d.value === G.invalid), f = C(), V = C(!1);
63
+ function Ie(r, i, e, c, t) {
64
+ const u = C(), d = C(), f = I(() => d.value === G.invalid), o = C(), w = C(!1);
65
65
  let v;
66
- const s = (k) => {
67
- const O = X(r, k);
66
+ const n = (S) => {
67
+ const O = X(r, S);
68
68
  if (e != null && e.class) {
69
- const n = e.class;
70
- return new n(O);
69
+ const l = e.class;
70
+ return new l(O);
71
71
  }
72
72
  return O;
73
- }, h = async (k = f.value, O) => {
74
- if (v = O, V.value)
73
+ }, h = async (S = o.value, O) => {
74
+ if (v = O, w.value)
75
75
  return !0;
76
- const n = await r.safeParseAsync(k);
77
- if (!n.success) {
76
+ const l = await r.safeParseAsync(S);
77
+ if (!l.success) {
78
78
  if (d.value = G.invalid, !O)
79
- return t.value = n.error.format(), !1;
80
- const w = n.error.issues.filter(($) => O.has($.path.join(".")));
81
- return w.length ? (t.value = new xe(w).format(), !1) : (t.value = void 0, !0);
79
+ return u.value = l.error.format(), !1;
80
+ const x = l.error.issues.filter((R) => O.has(R.path.join(".")));
81
+ return x.length ? (u.value = new xe(x).format(), !1) : (u.value = void 0, !0);
82
82
  }
83
- return t.value = void 0, d.value = G.valid, f.value = s(n.data), !0;
83
+ return u.value = void 0, d.value = G.valid, o.value = n(l.data), !0;
84
+ }, V = () => {
85
+ u.value = void 0, d.value = void 0, v = void 0;
84
86
  }, m = () => {
85
- t.value = void 0, d.value = void 0, v = void 0;
86
- }, b = () => {
87
- f.value = s(), m(), d.value = G.reset;
88
- }, l = async () => V.value || !await h() ? !1 : (d.value = G.submitting, !0), { ignoreUpdates: x, stop: g } = me(
89
- f,
87
+ o.value = n(), V(), d.value = G.reset;
88
+ }, s = async () => w.value || !await h() ? !1 : (d.value = G.submitting, !0), { ignoreUpdates: g, stop: b } = me(
89
+ o,
90
90
  () => {
91
91
  d.value = G.updated;
92
92
  },
@@ -94,7 +94,7 @@ function Ie(r, i, e, c, a) {
94
94
  deep: !0,
95
95
  eventFilter: be((e == null ? void 0 : e.updateThrottle) ?? 500)
96
96
  }
97
- ), E = _(t), A = _(d), B = q({
97
+ ), E = L(u), A = L(d), B = W({
98
98
  name: "VvForm",
99
99
  props: {
100
100
  continuousValidation: {
@@ -140,139 +140,139 @@ function Ie(r, i, e, c, a) {
140
140
  "reset"
141
141
  ],
142
142
  slots: Object,
143
- setup(k, { emit: O }) {
144
- return f.value = s(U(k.modelValue)), W(
145
- () => k.modelValue,
146
- (n) => {
147
- if (n) {
148
- const w = ce(n) ? U(n) : n;
149
- if (JSON.stringify(w) === JSON.stringify(U(f.value)))
143
+ setup(S, { emit: O }) {
144
+ return o.value = n(_(S.modelValue)), U(
145
+ () => S.modelValue,
146
+ (l) => {
147
+ if (l) {
148
+ const x = ce(l) ? _(l) : l;
149
+ if (JSON.stringify(x) === JSON.stringify(_(o.value)))
150
150
  return;
151
- f.value = typeof (w == null ? void 0 : w.clone) == "function" ? w.clone() : JSON.parse(JSON.stringify(w));
151
+ o.value = typeof (x == null ? void 0 : x.clone) == "function" ? x.clone() : JSON.parse(JSON.stringify(x));
152
152
  }
153
153
  },
154
154
  { deep: !0 }
155
- ), W(d, async (n) => {
156
- var w, $, M, T, P, ee;
157
- if (n === G.invalid) {
158
- const u = U(t.value);
159
- O("invalid", u), (w = e == null ? void 0 : e.onInvalid) == null || w.call(
155
+ ), U(d, async (l) => {
156
+ var x, R, Z, q, T, ee;
157
+ if (l === G.invalid) {
158
+ const a = _(u.value);
159
+ O("invalid", a), (x = e == null ? void 0 : e.onInvalid) == null || x.call(
160
160
  e,
161
- u
161
+ a
162
162
  );
163
163
  return;
164
164
  }
165
- if (n === G.valid) {
166
- const u = U(f.value);
167
- O("valid", u), ($ = e == null ? void 0 : e.onValid) == null || $.call(e, u), O("update:modelValue", u), (M = e == null ? void 0 : e.onUpdate) == null || M.call(e, u);
165
+ if (l === G.valid) {
166
+ const a = _(o.value);
167
+ O("valid", a), (R = e == null ? void 0 : e.onValid) == null || R.call(e, a), O("update:modelValue", a), (Z = e == null ? void 0 : e.onUpdate) == null || Z.call(e, a);
168
168
  return;
169
169
  }
170
- if (n === G.submitting) {
171
- const u = U(f.value);
172
- O("submit", u), (T = e == null ? void 0 : e.onSubmit) == null || T.call(e, u);
170
+ if (l === G.submitting) {
171
+ const a = _(o.value);
172
+ O("submit", a), (q = e == null ? void 0 : e.onSubmit) == null || q.call(e, a);
173
173
  return;
174
174
  }
175
- if (n === G.reset) {
176
- const u = U(f.value);
177
- O("reset", u), (P = e == null ? void 0 : e.onReset) == null || P.call(e, u);
175
+ if (l === G.reset) {
176
+ const a = _(o.value);
177
+ O("reset", a), (T = e == null ? void 0 : e.onReset) == null || T.call(e, a);
178
178
  return;
179
179
  }
180
- if (n === G.updated) {
181
- if ((t.value || e != null && e.continuousValidation || k.continuousValidation) && await h(void 0, v), !f.value || !k.modelValue || JSON.stringify(f.value) !== JSON.stringify(k.modelValue)) {
182
- const u = U(f.value);
183
- O("update:modelValue", u), (ee = e == null ? void 0 : e.onUpdate) == null || ee.call(e, u);
180
+ if (l === G.updated) {
181
+ if ((u.value || e != null && e.continuousValidation || S.continuousValidation) && await h(void 0, v), !o.value || !S.modelValue || JSON.stringify(o.value) !== JSON.stringify(S.modelValue)) {
182
+ const a = _(o.value);
183
+ O("update:modelValue", a), (ee = e == null ? void 0 : e.onUpdate) == null || ee.call(e, a);
184
184
  }
185
185
  d.value === G.updated && (d.value = G.unknown);
186
186
  }
187
187
  }), j(() => {
188
- V.value = k.readonly;
189
- }), W(
190
- () => k.readonly,
191
- (n) => {
192
- V.value = n;
188
+ w.value = S.readonly;
189
+ }), U(
190
+ () => S.readonly,
191
+ (l) => {
192
+ w.value = l;
193
193
  }
194
- ), W(V, (n) => {
195
- n !== k.readonly && O("update:readonly", V.value);
194
+ ), U(w, (l) => {
195
+ l !== S.readonly && O("update:readonly", w.value);
196
196
  }), F(i, {
197
- clear: m,
197
+ clear: V,
198
198
  errors: E,
199
- formData: f,
200
- ignoreUpdates: x,
201
- invalid: o,
202
- readonly: V,
203
- reset: b,
199
+ formData: o,
200
+ ignoreUpdates: g,
201
+ invalid: f,
202
+ readonly: w,
203
+ reset: m,
204
204
  status: A,
205
- stopUpdatesWatch: g,
206
- submit: l,
205
+ stopUpdatesWatch: b,
206
+ submit: s,
207
207
  validate: h,
208
- wrappers: a
208
+ wrappers: t
209
209
  }), {
210
- clear: m,
210
+ clear: V,
211
211
  errors: E,
212
- formData: f,
213
- ignoreUpdates: x,
214
- invalid: o,
215
- isReadonly: V,
216
- reset: b,
212
+ formData: o,
213
+ ignoreUpdates: g,
214
+ invalid: f,
215
+ isReadonly: w,
216
+ reset: m,
217
217
  status: A,
218
- stopUpdatesWatch: g,
219
- submit: l,
218
+ stopUpdatesWatch: b,
219
+ submit: s,
220
220
  validate: h,
221
- wrappers: a
221
+ wrappers: t
222
222
  };
223
223
  },
224
224
  render() {
225
- const k = () => {
226
- var O, n;
227
- return ((n = (O = this.$slots) == null ? void 0 : O.default) == null ? void 0 : n.call(O, {
225
+ const S = () => {
226
+ var O, l;
227
+ return ((l = (O = this.$slots) == null ? void 0 : O.default) == null ? void 0 : l.call(O, {
228
228
  errors: E.value,
229
- formData: f.value,
230
- invalid: o.value,
231
- readonly: V.value,
229
+ formData: o.value,
230
+ invalid: f.value,
231
+ readonly: w.value,
232
232
  status: A.value,
233
- wrappers: a,
234
- clear: m,
235
- ignoreUpdates: x,
236
- reset: b,
237
- stopUpdatesWatch: g,
238
- submit: l,
233
+ wrappers: t,
234
+ clear: V,
235
+ ignoreUpdates: g,
236
+ reset: m,
237
+ stopUpdatesWatch: b,
238
+ submit: s,
239
239
  validate: h
240
240
  })) ?? this.$slots.default;
241
241
  };
242
- return R(
242
+ return $(
243
243
  this.tag,
244
244
  {
245
- onSubmit: ue(this.submit, ["prevent"]),
246
- onReset: ue(this.reset, ["prevent"])
245
+ onSubmit: ae(this.submit, ["prevent"]),
246
+ onReset: ae(this.reset, ["prevent"])
247
247
  },
248
248
  (this.template ?? (e == null ? void 0 : e.template)) && c ? [
249
- R(
249
+ $(
250
250
  c,
251
251
  {
252
252
  schema: this.template ?? (e == null ? void 0 : e.template)
253
253
  },
254
254
  {
255
- default: k
255
+ default: S
256
256
  }
257
257
  )
258
258
  ] : {
259
- default: k
259
+ default: S
260
260
  }
261
261
  );
262
262
  }
263
263
  });
264
264
  return {
265
- clear: m,
266
- errors: t,
267
- formData: f,
268
- ignoreUpdates: x,
269
- invalid: o,
270
- readonly: V,
271
- reset: b,
265
+ clear: V,
266
+ errors: u,
267
+ formData: o,
268
+ ignoreUpdates: g,
269
+ invalid: f,
270
+ readonly: w,
271
+ reset: m,
272
272
  status: d,
273
- wrappers: a,
274
- stopUpdatesWatch: g,
275
- submit: l,
273
+ wrappers: t,
274
+ stopUpdatesWatch: b,
275
+ submit: s,
276
276
  validate: h,
277
277
  VvForm: B
278
278
  };
@@ -280,57 +280,57 @@ function Ie(r, i, e, c, a) {
280
280
  function re(r) {
281
281
  return Array.isArray(r);
282
282
  }
283
- function ke(r) {
284
- return typeof r < "u";
283
+ function Se(r) {
284
+ return !1;
285
285
  }
286
286
  function se(r) {
287
287
  return r === null;
288
288
  }
289
- function fe(r) {
289
+ function oe(r) {
290
290
  return typeof r == "object";
291
291
  }
292
- function oe(r) {
292
+ function fe(r) {
293
293
  return typeof r == "string";
294
294
  }
295
295
  function Y(r) {
296
296
  return typeof r > "u";
297
297
  }
298
- const Se = /^[0-9]+$/, Ee = ["__proto__", "prototype", "constructor"];
299
- function Z(r, i, e) {
300
- const c = ke(e) ? e : void 0;
301
- if (!fe(r) || !oe(i))
298
+ const ke = /^[0-9]+$/, Ee = ["__proto__", "prototype", "constructor"];
299
+ function M(r, i, e) {
300
+ const c = Se() ? e : void 0;
301
+ if (!oe(r) || !fe(i))
302
302
  return c;
303
- const a = ve(i);
304
- if (a.length !== 0) {
305
- for (const t of a) {
306
- if (t === "*")
303
+ const t = ve(i);
304
+ if (t.length !== 0) {
305
+ for (const u of t) {
306
+ if (u === "*")
307
307
  continue;
308
- const d = function(o) {
309
- return o.map((f) => Y(f) || se(f) ? f : re(f) ? d(f) : f[t]);
308
+ const d = function(f) {
309
+ return f.map((o) => Y(o) || se(o) ? o : re(o) ? d(o) : o[u]);
310
310
  };
311
- if (re(r) && !Se.test(t) ? r = d(r) : r = r[t], Y(r) || se(r))
311
+ if (re(r) && !ke.test(u) ? r = d(r) : r = r[u], Y(r) || se(r))
312
312
  break;
313
313
  }
314
314
  return Y(r) ? c : r;
315
315
  }
316
316
  }
317
- function ae(r, i, e) {
318
- if (!fe(r) || !oe(i))
317
+ function ue(r, i, e) {
318
+ if (!oe(r) || !fe(i))
319
319
  return;
320
320
  const c = ve(i);
321
321
  if (c.length === 0)
322
322
  return;
323
- const a = c.length;
324
- for (let t = 0; t < a; t++) {
325
- const d = c[t];
326
- if (t === a - 1) {
323
+ const t = c.length;
324
+ for (let u = 0; u < t; u++) {
325
+ const d = c[u];
326
+ if (u === t - 1) {
327
327
  r[d] = e;
328
328
  return;
329
329
  }
330
330
  if (d === "*" && re(r)) {
331
- const o = c.slice(t + 1).join(".");
332
- for (const f of r)
333
- ae(f, o, e);
331
+ const f = c.slice(u + 1).join(".");
332
+ for (const o of r)
333
+ ue(o, f, e);
334
334
  return;
335
335
  }
336
336
  Y(r[d]) && (r[d] = {}), r = r[d];
@@ -341,12 +341,12 @@ function ve(r) {
341
341
  return i.some((e) => Ee.indexOf(e) !== -1) ? [] : i;
342
342
  }
343
343
  function Ae(r, i, e, c) {
344
- return q({
344
+ return W({
345
345
  name: "VvFormField",
346
346
  props: {
347
347
  type: {
348
348
  type: String,
349
- validator: (a) => Object.values(p).includes(a),
349
+ validator: (t) => Object.values(p).includes(t),
350
350
  default: p.custom
351
351
  },
352
352
  is: {
@@ -394,74 +394,74 @@ function Ae(r, i, e, c) {
394
394
  "type"
395
395
  ],
396
396
  slots: Object,
397
- setup(a, { slots: t, emit: d }) {
398
- const { props: o, name: f } = te(a), V = ie(), v = N(i, void 0);
399
- v && v.fields.value.set(V, a.name);
400
- const s = N(r), h = I({
397
+ setup(t, { slots: u, emit: d }) {
398
+ const { props: f, name: o } = te(t), w = ie(), v = P(i, void 0);
399
+ v && v.fields.value.set(w, t.name);
400
+ const n = P(r), h = I({
401
401
  get() {
402
- if (s != null && s.formData)
403
- return Z(
404
- new Object(s.formData.value),
405
- String(a.name)
402
+ if (n != null && n.formData)
403
+ return M(
404
+ new Object(n.formData.value),
405
+ String(t.name)
406
406
  );
407
407
  },
408
- set(n) {
409
- s != null && s.formData && (ae(
410
- new Object(s.formData.value),
411
- String(a.name),
412
- n
408
+ set(l) {
409
+ n != null && n.formData && (ue(
410
+ new Object(n.formData.value),
411
+ String(t.name),
412
+ l
413
413
  ), d("update:modelValue", {
414
414
  newValue: h.value,
415
- formData: s == null ? void 0 : s.formData
415
+ formData: n == null ? void 0 : n.formData
416
416
  }));
417
417
  }
418
418
  });
419
419
  j(() => {
420
- h.value === void 0 && a.defaultValue !== void 0 && (h.value = a.defaultValue);
420
+ h.value === void 0 && t.defaultValue !== void 0 && (h.value = t.defaultValue);
421
421
  }), J(() => {
422
- v && v.fields.value.delete(V);
422
+ v && v.fields.value.delete(w);
423
423
  });
424
- const m = I(() => {
425
- if (s != null && s.errors.value)
426
- return Z(s.errors.value, String(a.name));
427
- }), b = I(() => {
428
- var n;
429
- return (n = m.value) == null ? void 0 : n._errors;
430
- }), l = I(() => m.value !== void 0), x = W(l, () => {
431
- if (l.value) {
432
- d("invalid", m.value), v && v.errors.value.set(
433
- String(a.name),
434
- m.value
424
+ const V = I(() => {
425
+ if (n != null && n.errors.value)
426
+ return M(n.errors.value, String(t.name));
427
+ }), m = I(() => {
428
+ var l;
429
+ return (l = V.value) == null ? void 0 : l._errors;
430
+ }), s = I(() => V.value !== void 0), g = U(s, (l) => {
431
+ if (l) {
432
+ d("invalid", V.value), v && v.errors.value.set(
433
+ String(t.name),
434
+ V.value
435
435
  );
436
436
  return;
437
437
  }
438
438
  d("valid", h.value), v && v.errors.value.delete(
439
- a.name
439
+ t.name
440
440
  );
441
- }), g = W(
442
- () => s == null ? void 0 : s.formData,
441
+ }), b = U(
442
+ () => n == null ? void 0 : n.formData,
443
443
  () => {
444
- d("update:formData", s == null ? void 0 : s.formData);
444
+ d("update:formData", n == null ? void 0 : n.formData);
445
445
  },
446
446
  { deep: !0 }
447
447
  );
448
448
  J(() => {
449
- x(), g();
449
+ g(), b();
450
450
  });
451
- const E = (n) => {
452
- n instanceof InputEvent && (n = n.target.value), h.value = n;
451
+ const E = (l) => {
452
+ l instanceof InputEvent && (l = l.target.value), h.value = l;
453
453
  }, A = I(() => {
454
- let n = o.value;
455
- return typeof n == "function" && (n = n(s == null ? void 0 : s.formData)), Object.keys(n).reduce(
456
- (w, $) => (w[$] = K(n[$]), w),
454
+ let l = f.value;
455
+ return typeof l == "function" && (l = l(n == null ? void 0 : n.formData)), Object.keys(l).reduce(
456
+ (x, R) => (x[R] = K(l[R]), x),
457
457
  {}
458
458
  );
459
- }), B = I(() => s != null && s.readonly.value ? !0 : A.value.readonly ?? a.readonly), k = I(() => ({
459
+ }), B = I(() => n != null && n.readonly.value || v != null && v.readonly.value ? !0 : A.value.readonly ?? t.readonly), S = I(() => ({
460
460
  ...A.value,
461
- name: A.value.name ?? a.name,
462
- invalid: l.value,
463
- valid: a.showValid ? !!(!l.value && h.value) : void 0,
464
- type: ((n) => {
461
+ name: A.value.name ?? t.name,
462
+ invalid: s.value,
463
+ valid: t.showValid ? !!(!s.value && h.value) : void 0,
464
+ type: ((l) => {
465
465
  if ([
466
466
  p.color,
467
467
  p.date,
@@ -476,71 +476,71 @@ function Ae(r, i, e, c) {
476
476
  p.time,
477
477
  p.url,
478
478
  p.week
479
- ].includes(n))
480
- return n;
481
- })(a.type),
482
- invalidLabel: b.value,
479
+ ].includes(l))
480
+ return l;
481
+ })(t.type),
482
+ invalidLabel: m.value,
483
483
  modelValue: h.value,
484
484
  readonly: B.value,
485
485
  "onUpdate:modelValue": E
486
486
  }));
487
487
  return F(e, {
488
- name: _(f),
489
- errors: _(m)
488
+ name: L(o),
489
+ errors: L(V)
490
490
  }), { component: I(() => {
491
- if (a.type === p.custom)
491
+ if (t.type === p.custom)
492
492
  return {
493
493
  render() {
494
- var n;
495
- return ((n = t.default) == null ? void 0 : n.call(t, {
496
- errors: m.value,
497
- formData: s == null ? void 0 : s.formData.value,
498
- formErrors: s == null ? void 0 : s.errors.value,
499
- invalid: l.value,
500
- invalidLabel: b.value,
494
+ var l;
495
+ return ((l = u.default) == null ? void 0 : l.call(u, {
496
+ errors: V.value,
497
+ formData: n == null ? void 0 : n.formData.value,
498
+ formErrors: n == null ? void 0 : n.errors.value,
499
+ invalid: s.value,
500
+ invalidLabel: m.value,
501
501
  modelValue: h.value,
502
502
  readonly: B.value,
503
503
  onUpdate: E,
504
- submit: s == null ? void 0 : s.submit,
505
- validate: s == null ? void 0 : s.validate
506
- })) ?? t.default;
504
+ submit: n == null ? void 0 : n.submit,
505
+ validate: n == null ? void 0 : n.validate
506
+ })) ?? u.default;
507
507
  }
508
508
  };
509
- if (!((c == null ? void 0 : c.lazyLoad) ?? a.lazyLoad)) {
510
- let n;
511
- switch (a.type) {
509
+ if (!((c == null ? void 0 : c.lazyLoad) ?? t.lazyLoad)) {
510
+ let l;
511
+ switch (t.type) {
512
512
  case p.select:
513
- n = L("VvSelect");
513
+ l = N("VvSelect");
514
514
  break;
515
515
  case p.checkbox:
516
- n = L("VvCheckbox");
516
+ l = N("VvCheckbox");
517
517
  break;
518
518
  case p.radio:
519
- n = L("VvRadio");
519
+ l = N("VvRadio");
520
520
  break;
521
521
  case p.textarea:
522
- n = L("VvTextarea");
522
+ l = N("VvTextarea");
523
523
  break;
524
524
  case p.radioGroup:
525
- n = L("VvRadioGroup");
525
+ l = N("VvRadioGroup");
526
526
  break;
527
527
  case p.checkboxGroup:
528
- n = L("VvCheckboxGroup");
528
+ l = N("VvCheckboxGroup");
529
529
  break;
530
530
  case p.combobox:
531
- n = L("VvCombobox");
531
+ l = N("VvCombobox");
532
532
  break;
533
533
  default:
534
- n = L("VvInputText");
534
+ l = N("VvInputText");
535
535
  }
536
- if (typeof n != "string")
537
- return n;
536
+ if (typeof l != "string")
537
+ return l;
538
538
  console.warn(
539
- `[@volverjs/form-vue]: ${n} not found, the component will be loaded asynchronously. To avoid this warning, please set "lazyLoad" option.`
539
+ `[@volverjs/form-vue]: ${l} not found, the component will be loaded asynchronously. To avoid this warning, please set "lazyLoad" option.`
540
540
  );
541
541
  }
542
542
  return ye(async () => {
543
- switch (c != null && c.sideEffects && await Promise.resolve(c.sideEffects(a.type)), a.type) {
543
+ switch (c != null && c.sideEffects && await Promise.resolve(c.sideEffects(t.type)), t.type) {
544
544
  case p.textarea:
545
545
  return import("@volverjs/ui-vue/vv-textarea");
546
546
  case p.radio:
@@ -558,15 +558,15 @@ function Ae(r, i, e, c) {
558
558
  }
559
559
  return import("@volverjs/ui-vue/vv-input-text");
560
560
  });
561
- }), hasProps: k, invalid: l };
561
+ }), hasProps: S, invalid: s };
562
562
  },
563
563
  render() {
564
- return this.is ? R(this.is, this.hasProps, this.$slots) : this.type === p.custom ? R(this.component, null, this.$slots) : R(this.component, this.hasProps, this.$slots);
564
+ return this.is ? $(this.is, this.hasProps, this.$slots) : this.type === p.custom ? $(this.component, null, this.$slots) : $(this.component, this.hasProps, this.$slots);
565
565
  }
566
566
  });
567
567
  }
568
568
  function Ge(r, i, e) {
569
- return q({
569
+ return W({
570
570
  name: "VvFormFieldsGroup",
571
571
  props: {
572
572
  is: {
@@ -609,159 +609,159 @@ function Ge(r, i, e) {
609
609
  "is"
610
610
  ],
611
611
  slots: Object,
612
- setup(c, { slots: a, emit: t }) {
613
- const { props: d, names: o, defaultValues: f } = te(c), V = ie(), v = I(() => Array.isArray(o.value) ? o.value : Object.values(o.value)), s = I(() => Array.isArray(o.value) ? o.value : Object.keys(o.value)), h = I(() => Array.isArray(o.value) ? o.value.reduce((u, y) => (u[String(y)] = y, u), {}) : o.value), m = I(() => Object.keys(h.value).reduce((u, y) => (u[String(h.value[y])] = y, u), {})), b = N(i, void 0);
614
- b && v.value.forEach((u) => {
615
- b.fields.value.set(`${V}-${u}`, u);
612
+ setup(c, { slots: t, emit: u }) {
613
+ const { props: d, names: f, defaultValues: o } = te(c), w = ie(), v = I(() => Array.isArray(f.value) ? f.value : Object.values(f.value)), n = I(() => Array.isArray(f.value) ? f.value : Object.keys(f.value)), h = I(() => Array.isArray(f.value) ? f.value.reduce((a, y) => (a[String(y)] = y, a), {}) : f.value), V = I(() => Object.keys(h.value).reduce((a, y) => (a[String(h.value[y])] = y, a), {})), m = P(i, void 0);
614
+ m && v.value.forEach((a) => {
615
+ m.fields.value.set(`${w}-${a}`, a);
616
616
  });
617
- const l = N(r), x = I({
617
+ const s = P(r), g = I({
618
618
  get() {
619
- return l != null && l.formData ? s.value.reduce((u, y) => (u[y] = Z(
620
- new Object(l.formData.value),
619
+ return s != null && s.formData ? n.value.reduce((a, y) => (a[y] = M(
620
+ new Object(s.formData.value),
621
621
  h.value[y]
622
- ), u), {}) : {};
622
+ ), a), {}) : {};
623
623
  },
624
- set(u) {
625
- l != null && l.formData && (s.value.forEach((y) => {
626
- ae(
627
- new Object(l.formData.value),
624
+ set(a) {
625
+ s != null && s.formData && (n.value.forEach((y) => {
626
+ ue(
627
+ new Object(s.formData.value),
628
628
  h.value[y],
629
- u == null ? void 0 : u[y]
629
+ a == null ? void 0 : a[y]
630
630
  );
631
- }), t("update:modelValue", {
632
- newValue: x.value,
633
- formData: l == null ? void 0 : l.formData
631
+ }), u("update:modelValue", {
632
+ newValue: g.value,
633
+ formData: s == null ? void 0 : s.formData
634
634
  }));
635
635
  }
636
636
  });
637
637
  j(() => {
638
- f.value && v.value.forEach((u) => {
639
- var y, S;
640
- ((y = f.value) == null ? void 0 : y[u]) !== void 0 && x.value[u] === void 0 && (x.value = {
641
- ...x.value,
642
- [u]: (S = f.value) == null ? void 0 : S[u]
638
+ o.value && v.value.forEach((a) => {
639
+ var y, k;
640
+ ((y = o.value) == null ? void 0 : y[a]) !== void 0 && g.value[a] === void 0 && (g.value = {
641
+ ...g.value,
642
+ [a]: (k = o.value) == null ? void 0 : k[a]
643
643
  });
644
644
  });
645
645
  }), J(() => {
646
- b && v.value.forEach((u) => {
647
- b.fields.value.delete(
648
- `${V}-${u}`
646
+ m && v.value.forEach((a) => {
647
+ m.fields.value.delete(
648
+ `${w}-${a}`
649
649
  );
650
650
  });
651
651
  });
652
- const g = I(() => {
653
- if (!(l != null && l.errors.value))
652
+ const b = I(() => {
653
+ if (!(s != null && s.errors.value))
654
654
  return;
655
- const u = v.value.reduce((y, S) => {
656
- if (!l.errors.value)
655
+ const a = v.value.reduce((y, k) => {
656
+ if (!s.errors.value)
657
657
  return y;
658
- const z = Z(l.errors.value, String(S));
659
- return z === void 0 || (y[String(S)] = z), y;
658
+ const z = M(s.errors.value, String(k));
659
+ return z === void 0 || (y[String(k)] = z), y;
660
660
  }, {});
661
- if (Object.keys(u).length !== 0)
662
- return u;
661
+ if (Object.keys(a).length !== 0)
662
+ return a;
663
663
  }), E = I(() => {
664
- if (!g.value)
664
+ if (!b.value)
665
665
  return;
666
- const u = Object.keys(g.value).reduce((y, S) => {
666
+ const a = Object.keys(b.value).reduce((y, k) => {
667
667
  var z;
668
- return (z = g.value) != null && z[S] && (y[m.value[S]] = g.value[S]._errors), y;
668
+ return (z = b.value) != null && z[k] && (y[V.value[k]] = b.value[k]._errors), y;
669
669
  }, {});
670
- if (Object.keys(u).length !== 0)
671
- return u;
672
- }), A = I(() => g.value !== void 0), B = I(() => s.value.reduce((u, y) => {
673
- var S;
674
- return u[y] = !!((S = g.value) != null && S[m.value[y]]), u;
675
- }, {})), k = W(A, () => {
670
+ if (Object.keys(a).length !== 0)
671
+ return a;
672
+ }), A = I(() => b.value !== void 0), B = I(() => n.value.reduce((a, y) => {
673
+ var k;
674
+ return a[y] = !!((k = b.value) != null && k[V.value[y]]), a;
675
+ }, {})), S = U(A, () => {
676
676
  if (A.value) {
677
- t("invalid", g.value), b && v.value.forEach((u) => {
678
- var y, S;
679
- if (!((y = g.value) != null && y[u])) {
680
- b.errors.value.delete(
681
- u
677
+ u("invalid", b.value), m && v.value.forEach((a) => {
678
+ var y, k;
679
+ if (!((y = b.value) != null && y[a])) {
680
+ m.errors.value.delete(
681
+ a
682
682
  );
683
683
  return;
684
684
  }
685
- b.errors.value.set(
686
- u,
687
- (S = g.value) == null ? void 0 : S[u]
685
+ m.errors.value.set(
686
+ a,
687
+ (k = b.value) == null ? void 0 : k[a]
688
688
  );
689
689
  });
690
690
  return;
691
691
  }
692
- t("valid", x.value), b && v.value.forEach((u) => {
693
- b.errors.value.delete(
694
- u
692
+ u("valid", g.value), m && v.value.forEach((a) => {
693
+ m.errors.value.delete(
694
+ a
695
695
  );
696
696
  });
697
- }), O = W(
698
- () => l == null ? void 0 : l.formData,
697
+ }), O = U(
698
+ () => s == null ? void 0 : s.formData,
699
699
  () => {
700
- t("update:formData", l == null ? void 0 : l.formData);
700
+ u("update:formData", s == null ? void 0 : s.formData);
701
701
  },
702
702
  { deep: !0 }
703
703
  );
704
704
  J(() => {
705
- k(), O();
705
+ S(), O();
706
706
  });
707
- const n = (u) => {
708
- x.value = u;
709
- }, w = (u, y) => {
710
- y instanceof InputEvent && (y = y.target.value), s.value.includes(u) && (x.value = {
711
- ...x.value,
712
- [u]: y
707
+ const l = (a) => {
708
+ g.value = a;
709
+ }, x = (a, y) => {
710
+ y instanceof InputEvent && (y = y.target.value), n.value.includes(a) && (g.value = {
711
+ ...g.value,
712
+ [a]: y
713
713
  });
714
- }, $ = I(() => {
715
- let u = d.value;
716
- return typeof u == "function" && (u = u(l == null ? void 0 : l.formData)), Object.keys(u).reduce(
717
- (y, S) => (y[S] = K(u[S]), y),
714
+ }, R = I(() => {
715
+ let a = d.value;
716
+ return typeof a == "function" && (a = a(s == null ? void 0 : s.formData)), Object.keys(a).reduce(
717
+ (y, k) => (y[k] = K(a[k]), y),
718
718
  {}
719
719
  );
720
- }), M = I(() => l != null && l.readonly.value ? !0 : $.value.readonly ?? c.readonly), T = I(() => s.value.reduce((u, y) => (u[`onUpdate:${y}`] = (S) => {
721
- w(y, S);
722
- }, u), {
723
- "onUpdate:modelValue": n
724
- })), P = I(() => ({
725
- ...T.value,
726
- ...$.value,
727
- names: $.value.name ?? v.value,
720
+ }), Z = I(() => s != null && s.readonly.value ? !0 : R.value.readonly ?? c.readonly), q = I(() => n.value.reduce((a, y) => (a[`onUpdate:${y}`] = (k) => {
721
+ x(y, k);
722
+ }, a), {
723
+ "onUpdate:modelValue": l
724
+ })), T = I(() => ({
725
+ ...q.value,
726
+ ...R.value,
727
+ names: R.value.name ?? v.value,
728
728
  invalid: A.value,
729
729
  invalids: B.value,
730
- valid: c.showValid ? !!(!A.value && x.value) : void 0,
730
+ valid: c.showValid ? !!(!A.value && g.value) : void 0,
731
731
  invalidLabels: E.value,
732
- modelValue: x.value,
733
- readonly: M.value
732
+ modelValue: g.value,
733
+ readonly: Z.value
734
734
  }));
735
735
  return F(e, {
736
- names: _(o),
737
- errors: _(g)
736
+ names: L(f),
737
+ errors: L(b)
738
738
  }), { component: I(() => ({
739
739
  render() {
740
- var u;
741
- return ((u = a.default) == null ? void 0 : u.call(a, {
742
- errors: g.value,
743
- formData: l == null ? void 0 : l.formData.value,
744
- formErrors: l == null ? void 0 : l.errors.value,
740
+ var a;
741
+ return ((a = t.default) == null ? void 0 : a.call(t, {
742
+ errors: b.value,
743
+ formData: s == null ? void 0 : s.formData.value,
744
+ formErrors: s == null ? void 0 : s.errors.value,
745
745
  invalid: A.value,
746
746
  invalids: B.value,
747
747
  invalidLabels: E.value,
748
- modelValue: x.value,
749
- onUpdate: n,
750
- onUpdateField: w,
751
- readonly: M.value,
752
- submit: l == null ? void 0 : l.submit,
753
- validate: l == null ? void 0 : l.validate
754
- })) ?? a.default;
748
+ modelValue: g.value,
749
+ onUpdate: l,
750
+ onUpdateField: x,
751
+ readonly: Z.value,
752
+ submit: s == null ? void 0 : s.submit,
753
+ validate: s == null ? void 0 : s.validate
754
+ })) ?? t.default;
755
755
  }
756
- })), hasProps: P, invalid: A };
756
+ })), hasProps: T, invalid: A };
757
757
  },
758
758
  render() {
759
- return this.is ? R(this.is, this.hasProps, this.$slots) : R(this.component, null, this.$slots);
759
+ return this.is ? $(this.is, this.hasProps, this.$slots) : $(this.component, null, this.$slots);
760
760
  }
761
761
  });
762
762
  }
763
- function $e(r, i) {
764
- return q({
763
+ function Re(r, i) {
764
+ return W({
765
765
  name: "VvFormWrapper",
766
766
  props: {
767
767
  name: {
@@ -771,6 +771,10 @@ function $e(r, i) {
771
771
  tag: {
772
772
  type: String,
773
773
  default: void 0
774
+ },
775
+ readonly: {
776
+ type: Boolean,
777
+ default: !1
774
778
  }
775
779
  },
776
780
  emits: ["invalid", "valid"],
@@ -781,6 +785,7 @@ function $e(r, i) {
781
785
  "fieldsErrors",
782
786
  "formData",
783
787
  "invalid",
788
+ "readonly",
784
789
  "reset",
785
790
  "submit",
786
791
  "tag",
@@ -789,72 +794,81 @@ function $e(r, i) {
789
794
  ],
790
795
  slots: Object,
791
796
  setup(e, { emit: c }) {
792
- const a = N(r), t = N(i, void 0), d = C(/* @__PURE__ */ new Map()), o = C(/* @__PURE__ */ new Map()), { name: f } = te(e), V = I(() => a != null && a.invalid.value ? o.value.size > 0 : !1);
793
- W(V, () => {
794
- V.value ? c("invalid") : c("valid");
797
+ const t = P(r), u = P(i, void 0), d = C(/* @__PURE__ */ new Map()), f = C(/* @__PURE__ */ new Map()), { name: o } = te(e), w = I(() => t != null && t.invalid.value ? f.value.size > 0 : !1);
798
+ U(w, (m) => {
799
+ if (m) {
800
+ c("invalid");
801
+ return;
802
+ }
803
+ c("valid");
795
804
  });
796
- const v = {
797
- name: _(f),
798
- errors: o,
799
- invalid: _(V),
805
+ const v = I(() => (t == null ? void 0 : t.readonly.value) || e.readonly), n = {
806
+ name: L(o),
807
+ errors: f,
808
+ invalid: L(w),
809
+ readonly: L(v),
800
810
  fields: d
801
811
  };
802
- F(i, v), W(
803
- d,
804
- (h, m) => {
805
- t != null && t.fields && m.forEach((b, l) => {
806
- h.has(l) || t == null || t.fields.value.delete(l);
807
- }), t != null && t.fields && h.forEach((b, l) => {
808
- t != null && t.fields.value.has(l) || t == null || t.fields.value.set(l, b);
809
- });
812
+ F(i, n);
813
+ const h = I(() => new Map(d.value));
814
+ U(
815
+ h,
816
+ (m, s) => {
817
+ u != null && u.fields && (s.forEach((g, b) => {
818
+ m.has(b) || u == null || u.fields.value.delete(b);
819
+ }), m.forEach((g, b) => {
820
+ u != null && u.fields.value.has(b) || u == null || u.fields.value.set(b, g);
821
+ }));
810
822
  },
811
823
  { deep: !0 }
812
- ), W(
813
- o,
814
- (h, m) => {
815
- t != null && t.errors && (Array.from(m.keys()).forEach((b) => {
816
- t.errors.value.delete(b);
817
- }), Array.from(h.keys()).forEach((b) => {
818
- const l = h.get(b);
819
- l && t.errors.value.set(b, l);
820
- }));
824
+ ), U(
825
+ f,
826
+ (m) => {
827
+ u != null && u.errors && d.value.forEach((s) => {
828
+ if (m.has(s) || u.errors.value.delete(s), m.has(s)) {
829
+ const g = m.get(s);
830
+ g && u.errors.value.set(s, g);
831
+ }
832
+ });
821
833
  },
822
834
  { deep: !0 }
823
835
  ), j(() => {
824
- if (!(a != null && a.wrappers) || !f.value) {
836
+ if (!(t != null && t.wrappers) || !o.value) {
825
837
  console.warn("[@volverjs/form-vue]: Invalid wrapper registration state");
826
838
  return;
827
839
  }
828
- if (a.wrappers.has(f.value)) {
829
- console.warn(`[@volverjs/form-vue]: wrapper name "${f.value}" is already used`);
840
+ if (t.wrappers.has(o.value)) {
841
+ console.warn(`[@volverjs/form-vue]: wrapper name "${o.value}" is already used`);
830
842
  return;
831
843
  }
832
- a.wrappers.set(f.value, v);
844
+ t.wrappers.set(o.value, n);
833
845
  }), J(() => {
834
- a != null && a.wrappers && f.value && a.wrappers.delete(f.value);
846
+ t != null && t.wrappers && o.value && t.wrappers.delete(o.value);
835
847
  });
836
- const s = () => (a == null ? void 0 : a.validate(void 0, new Set(d.value.values()))) ?? Promise.resolve(!0);
848
+ const V = () => (t == null ? void 0 : t.validate(void 0, new Set(d.value.values()))) ?? Promise.resolve(!0);
837
849
  return {
838
- errors: a == null ? void 0 : a.errors,
850
+ errors: t == null ? void 0 : t.errors,
839
851
  fields: d,
840
- fieldsErrors: o,
841
- formData: a == null ? void 0 : a.formData,
842
- invalid: V,
843
- clear: a == null ? void 0 : a.clear,
844
- reset: a == null ? void 0 : a.reset,
845
- submit: a == null ? void 0 : a.submit,
846
- validate: a == null ? void 0 : a.validate,
847
- validateWrapper: s
852
+ fieldsErrors: f,
853
+ formData: t == null ? void 0 : t.formData,
854
+ invalid: w,
855
+ readonly: v,
856
+ clear: t == null ? void 0 : t.clear,
857
+ reset: t == null ? void 0 : t.reset,
858
+ submit: t == null ? void 0 : t.submit,
859
+ validate: t == null ? void 0 : t.validate,
860
+ validateWrapper: V
848
861
  };
849
862
  },
850
863
  render() {
851
864
  const e = () => {
852
- var c, a;
853
- return (a = (c = this.$slots).default) == null ? void 0 : a.call(c, {
865
+ var c, t;
866
+ return (t = (c = this.$slots).default) == null ? void 0 : t.call(c, {
854
867
  errors: this.errors,
855
868
  fieldsErrors: this.fieldsErrors,
856
869
  formData: this.formData,
857
870
  invalid: this.invalid,
871
+ readonly: this.readonly,
858
872
  clear: this.clear,
859
873
  reset: this.reset,
860
874
  submit: this.submit,
@@ -862,14 +876,14 @@ function $e(r, i) {
862
876
  validateWrapper: this.validateWrapper
863
877
  });
864
878
  };
865
- return this.tag ? R(this.tag, null, {
879
+ return this.tag ? $(this.tag, null, {
866
880
  default: e
867
881
  }) : e();
868
882
  }
869
883
  });
870
884
  }
871
- function Re(r, i) {
872
- const e = q({
885
+ function $e(r, i) {
886
+ const e = W({
873
887
  name: "VvFormTemplate",
874
888
  props: {
875
889
  schema: {
@@ -882,142 +896,142 @@ function Re(r, i) {
882
896
  }
883
897
  },
884
898
  slots: Object,
885
- setup(c, { slots: a }) {
886
- const t = N(r);
887
- if (t != null && t.formData)
899
+ setup(c, { slots: t }) {
900
+ const u = P(r);
901
+ if (u != null && u.formData)
888
902
  return () => {
889
- var V;
903
+ var w;
890
904
  const d = typeof c.schema == "function" ? c.schema(
891
- t,
905
+ u,
892
906
  c.scope
893
907
  ) : c.schema;
894
- let o;
895
- const f = d.reduce((v, s) => {
896
- const h = typeof s == "function" ? s(t, c.scope) : s, {
897
- vvIs: m,
898
- vvName: b,
899
- vvSlots: l,
900
- vvChildren: x,
901
- vvIf: g,
908
+ let f;
909
+ const o = d.reduce((v, n) => {
910
+ const h = typeof n == "function" ? n(u, c.scope) : n, {
911
+ vvIs: V,
912
+ vvName: m,
913
+ vvSlots: s,
914
+ vvChildren: g,
915
+ vvIf: b,
902
916
  vvElseIf: E,
903
917
  vvType: A,
904
918
  vvDefaultValue: B,
905
- vvShowValid: k,
919
+ vvShowValid: S,
906
920
  vvContent: O,
907
- ...n
921
+ ...l
908
922
  } = h;
909
- if (g !== void 0) {
910
- if (typeof g == "string" ? o = !!Z(
911
- new Object(t.formData.value),
912
- g
913
- ) : typeof g == "function" ? o = K(g(t)) : o = K(g), !o)
923
+ if (b !== void 0) {
924
+ if (typeof b == "string" ? f = !!M(
925
+ new Object(u.formData.value),
926
+ b
927
+ ) : typeof b == "function" ? f = K(b(u)) : f = K(b), !f)
914
928
  return v;
915
- } else if (E !== void 0 && o !== void 0) {
916
- if (o || (typeof E == "string" ? o = !!Z(
917
- new Object(t.formData.value),
929
+ } else if (E !== void 0 && f !== void 0) {
930
+ if (f || (typeof E == "string" ? f = !!M(
931
+ new Object(u.formData.value),
918
932
  E
919
- ) : typeof E == "function" ? o = K(E(t)) : o = K(E), !o))
933
+ ) : typeof E == "function" ? f = K(E(u)) : f = K(E), !f))
920
934
  return v;
921
935
  } else
922
- o = void 0;
923
- let w;
924
- return x && (typeof m == "string" ? w = R(e, {
925
- schema: x
926
- }) : w = {
927
- default: ($) => R(e, {
928
- schema: x,
929
- scope: $
936
+ f = void 0;
937
+ let x;
938
+ return g && (typeof V == "string" ? x = $(e, {
939
+ schema: g
940
+ }) : x = {
941
+ default: (R) => $(e, {
942
+ schema: g,
943
+ scope: R
930
944
  })
931
- }), b ? (v.push(
932
- R(
945
+ }), m ? (v.push(
946
+ $(
933
947
  i,
934
948
  {
935
- name: b,
936
- is: m,
949
+ name: m,
950
+ is: V,
937
951
  type: A,
938
952
  defaultValue: B,
939
- showValid: k,
940
- props: n
953
+ showValid: S,
954
+ props: l
941
955
  },
942
- l ?? w ?? O
956
+ s ?? x ?? O
943
957
  )
944
- ), v) : m ? (v.push(
945
- R(
946
- m,
947
- n,
948
- l ?? w ?? O
958
+ ), v) : V ? (v.push(
959
+ $(
960
+ V,
961
+ l,
962
+ s ?? x ?? O
949
963
  )
950
- ), v) : (w && ("default" in w ? v.push(w.default(c.scope)) : v.push(w)), v);
964
+ ), v) : (x && ("default" in x ? v.push(x.default(c.scope)) : v.push(x)), v);
951
965
  }, []);
952
- return f.push(
953
- (V = a == null ? void 0 : a.default) == null ? void 0 : V.call(a, {
954
- errors: t == null ? void 0 : t.errors.value,
955
- formData: t == null ? void 0 : t.formData.value,
956
- invalid: t == null ? void 0 : t.invalid.value,
957
- status: t == null ? void 0 : t.status.value,
958
- submit: t == null ? void 0 : t.submit,
959
- validate: t == null ? void 0 : t.validate,
960
- clear: t == null ? void 0 : t.clear,
961
- reset: t == null ? void 0 : t.reset
966
+ return o.push(
967
+ (w = t == null ? void 0 : t.default) == null ? void 0 : w.call(t, {
968
+ errors: u == null ? void 0 : u.errors.value,
969
+ formData: u == null ? void 0 : u.formData.value,
970
+ invalid: u == null ? void 0 : u.invalid.value,
971
+ status: u == null ? void 0 : u.status.value,
972
+ submit: u == null ? void 0 : u.submit,
973
+ validate: u == null ? void 0 : u.validate,
974
+ clear: u == null ? void 0 : u.clear,
975
+ reset: u == null ? void 0 : u.reset
962
976
  })
963
- ), f;
977
+ ), o;
964
978
  };
965
979
  }
966
980
  });
967
981
  return e;
968
982
  }
969
983
  function D(r, i = {}) {
970
- const e = Symbol("formInjectionKey"), c = Symbol("formWrapperInjectionKey"), a = Symbol("formFieldInjectionKey"), t = Symbol("formFieldsGroupInjectionKey"), d = $e(
984
+ const e = Symbol("formInjectionKey"), c = Symbol("formWrapperInjectionKey"), t = Symbol("formFieldInjectionKey"), u = Symbol("formFieldsGroupInjectionKey"), d = Re(
971
985
  e,
972
986
  c
973
- ), o = Ae(
987
+ ), f = Ae(
974
988
  e,
975
989
  c,
976
- a,
990
+ t,
977
991
  i
978
- ), f = Ge(
992
+ ), o = Ge(
979
993
  e,
980
994
  c,
981
- t
982
- ), V = Re(e, o), v = /* @__PURE__ */ new Map(), {
983
- clear: s,
995
+ u
996
+ ), w = $e(e, f), v = /* @__PURE__ */ new Map(), {
997
+ clear: n,
984
998
  errors: h,
985
- formData: m,
986
- ignoreUpdates: b,
987
- invalid: l,
988
- readonly: x,
989
- reset: g,
999
+ formData: V,
1000
+ ignoreUpdates: m,
1001
+ invalid: s,
1002
+ readonly: g,
1003
+ reset: b,
990
1004
  status: E,
991
1005
  stopUpdatesWatch: A,
992
1006
  submit: B,
993
- validate: k,
1007
+ validate: S,
994
1008
  VvForm: O
995
- } = Ie(r, e, i, V, v);
1009
+ } = Ie(r, e, i, w, v);
996
1010
  return {
997
- clear: s,
1011
+ clear: n,
998
1012
  errors: h,
999
- formData: m,
1000
- formFieldInjectionKey: a,
1013
+ formData: V,
1014
+ formFieldInjectionKey: t,
1001
1015
  formInjectionKey: e,
1002
1016
  formWrapperInjectionKey: c,
1003
- ignoreUpdates: b,
1004
- invalid: l,
1005
- readonly: x,
1006
- reset: g,
1017
+ ignoreUpdates: m,
1018
+ invalid: s,
1019
+ readonly: g,
1020
+ reset: b,
1007
1021
  status: E,
1008
1022
  stopUpdatesWatch: A,
1009
1023
  submit: B,
1010
- validate: k,
1024
+ validate: S,
1011
1025
  wrappers: v,
1012
1026
  VvForm: O,
1013
- VvFormField: o,
1014
- VvFormFieldsGroup: f,
1015
- VvFormTemplate: V,
1027
+ VvFormField: f,
1028
+ VvFormFieldsGroup: o,
1029
+ VvFormTemplate: w,
1016
1030
  VvFormWrapper: d
1017
1031
  };
1018
1032
  }
1019
1033
  const de = Symbol("pluginInjectionKey");
1020
- function Le(r) {
1034
+ function _e(r) {
1021
1035
  let i = {};
1022
1036
  return r.schema && (i = D(r.schema, r)), {
1023
1037
  ...i,
@@ -1027,7 +1041,7 @@ function Le(r) {
1027
1041
  };
1028
1042
  }
1029
1043
  const Q = /* @__PURE__ */ new Map();
1030
- function _e(r, i = {}) {
1044
+ function Ne(r, i = {}) {
1031
1045
  if (i.scope && Q.has(i.scope))
1032
1046
  return Q.get(i.scope);
1033
1047
  if (!he()) {
@@ -1037,20 +1051,20 @@ function _e(r, i = {}) {
1037
1051
  const e = D(
1038
1052
  r,
1039
1053
  {
1040
- ...N(de, {}),
1054
+ ...P(de, {}),
1041
1055
  ...i
1042
1056
  }
1043
1057
  );
1044
1058
  return i.scope && Q.set(i.scope, e), e;
1045
1059
  }
1046
- function Ne(r, i = {}) {
1060
+ function Pe(r, i = {}) {
1047
1061
  return D(r, i);
1048
1062
  }
1049
1063
  export {
1050
1064
  p as FormFieldType,
1051
- Le as createForm,
1065
+ _e as createForm,
1052
1066
  X as defaultObjectBySchema,
1053
- Ne as formType,
1067
+ Pe as formType,
1054
1068
  de as pluginInjectionKey,
1055
- _e as useForm
1069
+ Ne as useForm
1056
1070
  };