@volverjs/form-vue 0.0.13 → 0.0.14-beta.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.
package/dist/index.es.js CHANGED
@@ -1,71 +1,71 @@
1
- import { defineComponent as W, computed as y, onMounted as T, onBeforeUnmount as D, inject as S, toRefs as q, watch as O, unref as I, provide as z, readonly as k, resolveComponent as g, defineAsyncComponent as j, h as x, ref as C, toRaw as J, isProxy as F, withModifiers as ee, getCurrentInstance as re } from "vue";
1
+ import { defineComponent as G, computed as y, onMounted as Y, onBeforeUnmount as D, inject as S, toRefs as P, watch as w, unref as I, provide as K, readonly as k, resolveComponent as g, defineAsyncComponent as j, h as x, ref as A, toRaw as U, isProxy as F, withModifiers as ee, getCurrentInstance as re } from "vue";
2
2
  import { watchThrottled as te } from "@vueuse/core";
3
- import { ZodObject as M, ZodDefault as ae, ZodNullable as ne, ZodSchema as se, ZodEffects as oe, ZodOptional as ue } from "zod";
4
- function A(e) {
3
+ import { ZodObject as W, ZodDefault as ae, ZodNullable as ne, ZodSchema as oe, ZodArray as se, ZodEffects as ue, ZodOptional as ie } from "zod";
4
+ function z(e) {
5
5
  return Array.isArray(e);
6
6
  }
7
- function ie(e) {
7
+ function le(e) {
8
8
  return typeof e < "u";
9
9
  }
10
- function U(e) {
10
+ function q(e) {
11
11
  return e === null;
12
12
  }
13
- function P(e) {
13
+ function T(e) {
14
14
  return typeof e == "object";
15
15
  }
16
16
  function H(e) {
17
17
  return typeof e == "string";
18
18
  }
19
- function N(e) {
19
+ function _(e) {
20
20
  return typeof e > "u";
21
21
  }
22
- const le = /^[0-9]+$/, fe = ["__proto__", "prototype", "constructor"];
23
- function G(e, s, l) {
24
- const u = ie(l) ? l : void 0;
25
- if (!P(e) || !H(s))
26
- return u;
27
- const n = R(s);
22
+ const fe = /^[0-9]+$/, ve = ["__proto__", "prototype", "constructor"];
23
+ function N(e, o, l) {
24
+ const i = le(l) ? l : void 0;
25
+ if (!T(e) || !H(o))
26
+ return i;
27
+ const n = R(o);
28
28
  if (n.length !== 0) {
29
29
  for (const r of n) {
30
30
  if (r === "*")
31
31
  continue;
32
- const o = function(a) {
33
- return a.map((i) => N(i) || U(i) ? i : A(i) ? o(i) : i[r]);
32
+ const s = function(a) {
33
+ return a.map((u) => _(u) || q(u) ? u : z(u) ? s(u) : u[r]);
34
34
  };
35
- if (A(e) && !le.test(r) ? e = o(e) : e = e[r], N(e) || U(e))
35
+ if (z(e) && !fe.test(r) ? e = s(e) : e = e[r], _(e) || q(e))
36
36
  break;
37
37
  }
38
- return N(e) ? u : e;
38
+ return _(e) ? i : e;
39
39
  }
40
40
  }
41
- function Q(e, s, l) {
42
- if (!P(e) || !H(s))
41
+ function Q(e, o, l) {
42
+ if (!T(e) || !H(o))
43
43
  return;
44
- const u = R(s);
45
- if (u.length === 0)
44
+ const i = R(o);
45
+ if (i.length === 0)
46
46
  return;
47
- const n = u.length;
47
+ const n = i.length;
48
48
  for (let r = 0; r < n; r++) {
49
- const o = u[r];
49
+ const s = i[r];
50
50
  if (r === n - 1) {
51
- e[o] = l;
51
+ e[s] = l;
52
52
  return;
53
53
  }
54
- if (o === "*" && A(e)) {
55
- const a = u.slice(r + 1).join(".");
56
- for (const i of e)
57
- Q(i, a, l);
54
+ if (s === "*" && z(e)) {
55
+ const a = i.slice(r + 1).join(".");
56
+ for (const u of e)
57
+ Q(u, a, l);
58
58
  return;
59
59
  }
60
- N(e[o]) && (e[o] = {}), e = e[o];
60
+ _(e[s]) && (e[s] = {}), e = e[s];
61
61
  }
62
62
  }
63
63
  function R(e) {
64
- const s = e.split(/[.]|(?:\[(\d|\*)\])/).filter((l) => !!l);
65
- return s.some((l) => fe.indexOf(l) !== -1) ? [] : s;
64
+ const o = e.split(/[.]|(?:\[(\d|\*)\])/).filter((l) => !!l);
65
+ return o.some((l) => ve.indexOf(l) !== -1) ? [] : o;
66
66
  }
67
- var v = /* @__PURE__ */ ((e) => (e.text = "text", e.number = "number", e.email = "email", e.password = "password", e.tel = "tel", e.url = "url", e.search = "search", e.date = "date", e.time = "time", e.datetimeLocal = "datetime-local", e.month = "month", e.week = "week", e.color = "color", e.select = "select", e.checkbox = "checkbox", e.radio = "radio", e.textarea = "textarea", e.radioGroup = "radioGroup", e.checkboxGroup = "checkboxGroup", e.combobox = "combobox", e.custom = "custom", e))(v || {}), B = /* @__PURE__ */ ((e) => (e.invalid = "invalid", e.valid = "valid", e))(B || {});
68
- const ve = (e, s, l, u) => W({
67
+ var v = /* @__PURE__ */ ((e) => (e.text = "text", e.number = "number", e.email = "email", e.password = "password", e.tel = "tel", e.url = "url", e.search = "search", e.date = "date", e.time = "time", e.datetimeLocal = "datetime-local", e.month = "month", e.week = "week", e.color = "color", e.select = "select", e.checkbox = "checkbox", e.radio = "radio", e.textarea = "textarea", e.radioGroup = "radioGroup", e.checkboxGroup = "checkboxGroup", e.combobox = "combobox", e.custom = "custom", e))(v || {}), $ = /* @__PURE__ */ ((e) => (e.invalid = "invalid", e.valid = "valid", e))($ || {});
68
+ const de = (e, o, l, i) => G({
69
69
  name: "FieldComponent",
70
70
  props: {
71
71
  type: {
@@ -100,11 +100,11 @@ const ve = (e, s, l, u) => W({
100
100
  },
101
101
  emits: ["invalid", "valid", "update:formData", "update:modelValue"],
102
102
  expose: ["invalid", "invalidLabel", "errors"],
103
- setup(n, { slots: r, emit: o }) {
103
+ setup(n, { slots: r, emit: s }) {
104
104
  const a = y({
105
105
  get() {
106
106
  if (t != null && t.formData)
107
- return G(
107
+ return N(
108
108
  Object(t.formData.value),
109
109
  String(n.name)
110
110
  );
@@ -114,51 +114,51 @@ const ve = (e, s, l, u) => W({
114
114
  Object(t.formData.value),
115
115
  String(n.name),
116
116
  f
117
- ), o("update:modelValue", {
117
+ ), s("update:modelValue", {
118
118
  newValue: a.value,
119
119
  formData: t == null ? void 0 : t.formData
120
120
  }));
121
121
  }
122
122
  });
123
- T(() => {
123
+ Y(() => {
124
124
  a.value === void 0 && n.defaultValue !== void 0 && (a.value = n.defaultValue);
125
125
  }), D(() => {
126
126
  E(), V();
127
127
  });
128
- const i = S(s, void 0);
129
- i && i.fields.value.add(n.name);
130
- const t = S(e), { props: m, name: h } = q(n), d = y(() => {
128
+ const u = S(o, void 0);
129
+ u && u.fields.value.add(n.name);
130
+ const t = S(e), { props: m, name: h } = P(n), d = y(() => {
131
131
  if (t != null && t.errors.value)
132
- return G(t.errors.value, String(n.name));
132
+ return N(t.errors.value, String(n.name));
133
133
  }), c = y(() => {
134
134
  var f;
135
135
  return (f = d.value) == null ? void 0 : f._errors;
136
- }), b = y(() => d.value !== void 0), E = O(b, () => {
137
- b.value ? (o("invalid", c.value), i && i.errors.value.set(
136
+ }), b = y(() => d.value !== void 0), E = w(b, () => {
137
+ b.value ? (s("invalid", c.value), u && u.errors.value.set(
138
138
  n.name,
139
139
  {
140
140
  _errors: c.value
141
141
  }
142
- )) : (o("valid", a.value), i && i.errors.value.delete(
142
+ )) : (s("valid", a.value), u && u.errors.value.delete(
143
143
  n.name
144
144
  ));
145
- }), V = O(
145
+ }), V = w(
146
146
  () => t == null ? void 0 : t.formData,
147
147
  () => {
148
- o("update:formData", t == null ? void 0 : t.formData);
148
+ s("update:formData", t == null ? void 0 : t.formData);
149
149
  },
150
150
  { deep: !0 }
151
151
  ), p = (f) => {
152
152
  a.value = f;
153
- }, $ = y(() => {
153
+ }, C = y(() => {
154
154
  let f = m.value;
155
155
  return typeof f == "function" && (f = f(t == null ? void 0 : t.formData)), Object.keys(f).reduce(
156
- (w, Z) => (w[Z] = I(f[Z]), w),
156
+ (O, M) => (O[M] = I(f[M]), O),
157
157
  {}
158
158
  );
159
- }), _ = y(() => ({
160
- ...$.value,
161
- name: $.value.name ?? n.name,
159
+ }), L = y(() => ({
160
+ ...C.value,
161
+ name: C.value.name ?? n.name,
162
162
  invalid: b.value,
163
163
  valid: n.showValid ? !!(!b.value && a.value) : void 0,
164
164
  type: ((f) => {
@@ -183,7 +183,7 @@ const ve = (e, s, l, u) => W({
183
183
  modelValue: a.value,
184
184
  "onUpdate:modelValue": p
185
185
  }));
186
- return z(l, {
186
+ return K(l, {
187
187
  name: k(h),
188
188
  errors: k(d)
189
189
  }), { component: y(() => {
@@ -204,7 +204,7 @@ const ve = (e, s, l, u) => W({
204
204
  })) ?? r.defalut;
205
205
  }
206
206
  };
207
- if (!((u == null ? void 0 : u.lazyLoad) ?? n.lazyLoad)) {
207
+ if (!((i == null ? void 0 : i.lazyLoad) ?? n.lazyLoad)) {
208
208
  let f;
209
209
  switch (n.type) {
210
210
  case v.select:
@@ -238,7 +238,7 @@ const ve = (e, s, l, u) => W({
238
238
  );
239
239
  }
240
240
  return j(async () => {
241
- switch (u != null && u.sideEffects && await Promise.resolve(u.sideEffects(n.type)), n.type) {
241
+ switch (i != null && i.sideEffects && await Promise.resolve(i.sideEffects(n.type)), n.type) {
242
242
  case v.textarea:
243
243
  return import("@volverjs/ui-vue/vv-textarea");
244
244
  case v.radio:
@@ -256,47 +256,58 @@ const ve = (e, s, l, u) => W({
256
256
  }
257
257
  return import("@volverjs/ui-vue/vv-input-text");
258
258
  });
259
- }), hasProps: _, invalid: b };
259
+ }), hasProps: L, invalid: b };
260
260
  },
261
261
  render() {
262
262
  return this.is ? x(this.is, this.hasProps, this.$slots) : this.type === v.custom ? x(this.component, null, this.$slots) : x(this.component, this.hasProps, this.$slots);
263
263
  }
264
- }), X = (e, s = {}) => {
264
+ }), Z = (e, o = {}) => {
265
265
  const l = (r) => {
266
- let o = r;
267
- for (; o instanceof oe; )
268
- o = o.innerType();
269
- for (; o instanceof ue; )
270
- o = o._def.innerType;
271
- return o;
272
- }, u = l(e);
266
+ let s = r;
267
+ for (; s instanceof ue; )
268
+ s = s.innerType();
269
+ return s instanceof ie && (s = s._def.innerType), s;
270
+ }, i = l(e);
273
271
  return {
274
- ...(u instanceof M ? u._def.unknownKeys === "passthrough" : !1) ? s : {},
272
+ ...(i instanceof W ? i._def.unknownKeys === "passthrough" : !1) ? o : {},
275
273
  ...Object.fromEntries(
276
- Object.entries(u.shape).map(
277
- ([r, o]) => {
278
- const a = s[r], i = l(o);
279
- let t;
280
- if (i instanceof ae && (t = i._def.defaultValue()), a === null && i instanceof ne)
274
+ Object.entries(i.shape).map(
275
+ ([r, s]) => {
276
+ const a = o[r];
277
+ let u = l(s), t;
278
+ if (u instanceof ae && (t = u._def.defaultValue(), u = u._def.innerType), a === null && u instanceof ne)
281
279
  return [r, a];
282
- if (i instanceof se) {
283
- const m = o.safeParse(a);
280
+ if (u instanceof oe) {
281
+ const m = s.safeParse(a);
284
282
  if (m.success)
285
283
  return [r, m.data ?? t];
286
284
  }
287
- return i instanceof M ? [
285
+ if (u instanceof se && Array.isArray(a) && a.length) {
286
+ const m = l(u._def.type);
287
+ if (m instanceof W)
288
+ return [
289
+ r,
290
+ a.map(
291
+ (h) => Z(
292
+ m,
293
+ h && typeof h == "object" ? h : void 0
294
+ )
295
+ ) ?? t
296
+ ];
297
+ }
298
+ return u instanceof W ? [
288
299
  r,
289
- X(
290
- i,
291
- a && typeof a == "object" ? a : {}
300
+ Z(
301
+ u,
302
+ a && typeof a == "object" ? a : t
292
303
  )
293
304
  ] : [r, t];
294
305
  }
295
306
  )
296
307
  )
297
308
  };
298
- }, de = (e, s, l) => {
299
- const u = C(), n = C(), r = C(), o = W({
309
+ }, ce = (e, o, l) => {
310
+ const i = A(), n = A(), r = A(), s = G({
300
311
  name: "FormComponent",
301
312
  props: {
302
313
  modelValue: {
@@ -314,15 +325,15 @@ const ve = (e, s, l, u) => W({
314
325
  },
315
326
  emits: ["invalid", "valid", "submit", "update:modelValue"],
316
327
  expose: ["submit", "validate", "errors", "status", "valid", "invalid"],
317
- setup(a, { emit: i }) {
318
- r.value = X(
328
+ setup(a, { emit: u }) {
329
+ r.value = Z(
319
330
  e,
320
- J(a.modelValue)
321
- ), O(
331
+ U(a.modelValue)
332
+ ), w(
322
333
  () => a.modelValue,
323
334
  (d) => {
324
335
  if (d) {
325
- const c = F(d) ? J(d) : d;
336
+ const c = F(d) ? U(d) : d;
326
337
  r.value = typeof (c == null ? void 0 : c.clone) == "function" ? c.clone() : JSON.parse(JSON.stringify(c));
327
338
  }
328
339
  },
@@ -330,7 +341,7 @@ const ve = (e, s, l, u) => W({
330
341
  ), te(
331
342
  r,
332
343
  (d) => {
333
- ((u.value || (l == null ? void 0 : l.continuosValidation)) ?? a.continuosValidation) && t(), (!d || !a.modelValue || JSON.stringify(d) !== JSON.stringify(a.modelValue)) && i("update:modelValue", d);
344
+ ((i.value || (l == null ? void 0 : l.continuosValidation)) ?? a.continuosValidation) && t(), (!d || !a.modelValue || JSON.stringify(d) !== JSON.stringify(a.modelValue)) && u("update:modelValue", d);
334
345
  },
335
346
  {
336
347
  deep: !0,
@@ -339,20 +350,20 @@ const ve = (e, s, l, u) => W({
339
350
  );
340
351
  const t = (d = r.value) => {
341
352
  const c = e.safeParse(d);
342
- return c.success ? (u.value = void 0, n.value = B.valid, r.value = c.data, i("update:modelValue", r.value), i("valid", c.data), !0) : (u.value = c.error.format(), n.value = B.invalid, i("invalid", u.value), !1);
343
- }, m = () => t() ? (i("submit", r.value), !0) : !1, h = y(() => n.value === B.invalid);
344
- return z(s, {
353
+ return c.success ? (i.value = void 0, n.value = $.valid, r.value = c.data, u("update:modelValue", r.value), u("valid", c.data), !0) : (i.value = c.error.format(), n.value = $.invalid, u("invalid", i.value), !1);
354
+ }, m = () => t() ? (u("submit", r.value), !0) : !1, h = y(() => n.value === $.invalid);
355
+ return K(o, {
345
356
  formData: r,
346
357
  submit: m,
347
358
  validate: t,
348
- errors: k(u),
359
+ errors: k(i),
349
360
  status: k(n),
350
361
  invalid: h
351
362
  }), {
352
363
  formData: r,
353
364
  submit: m,
354
365
  validate: t,
355
- errors: k(u),
366
+ errors: k(i),
356
367
  status: k(n),
357
368
  invalid: h
358
369
  };
@@ -365,8 +376,8 @@ const ve = (e, s, l, u) => W({
365
376
  },
366
377
  {
367
378
  default: () => {
368
- var a, i;
369
- return ((i = (a = this.$slots) == null ? void 0 : a.default) == null ? void 0 : i.call(a, {
379
+ var a, u;
380
+ return ((u = (a = this.$slots) == null ? void 0 : a.default) == null ? void 0 : u.call(a, {
370
381
  formData: this.formData,
371
382
  submit: this.submit,
372
383
  validate: this.validate,
@@ -380,15 +391,15 @@ const ve = (e, s, l, u) => W({
380
391
  }
381
392
  });
382
393
  return {
383
- errors: u,
394
+ errors: i,
384
395
  status: n,
385
396
  formData: r,
386
397
  /**
387
398
  * An hack to add types to the default slot
388
399
  */
389
- VvForm: o
400
+ VvForm: s
390
401
  };
391
- }, ce = (e, s) => W({
402
+ }, me = (e, o) => G({
392
403
  name: "WrapperComponent",
393
404
  props: {
394
405
  name: {
@@ -402,34 +413,34 @@ const ve = (e, s, l, u) => W({
402
413
  },
403
414
  emits: ["invalid", "valid"],
404
415
  expose: ["fields", "invalid"],
405
- setup(u, { emit: n }) {
406
- const r = S(e), o = S(s, void 0), a = C(/* @__PURE__ */ new Set()), i = C(/* @__PURE__ */ new Map()), { name: t } = q(u);
407
- z(s, {
416
+ setup(i, { emit: n }) {
417
+ const r = S(e), s = S(o, void 0), a = A(/* @__PURE__ */ new Set()), u = A(/* @__PURE__ */ new Map()), { name: t } = P(i);
418
+ K(o, {
408
419
  name: k(t),
409
- errors: i,
420
+ errors: u,
410
421
  fields: a
411
- }), O(
422
+ }), w(
412
423
  a,
413
424
  (h) => {
414
- o != null && o.fields && h.forEach((d) => {
415
- o == null || o.fields.value.add(d);
425
+ s != null && s.fields && h.forEach((d) => {
426
+ s == null || s.fields.value.add(d);
416
427
  });
417
428
  },
418
429
  { deep: !0 }
419
- ), O(
420
- () => new Map(i.value),
430
+ ), w(
431
+ () => new Map(u.value),
421
432
  (h, d) => {
422
- o != null && o.errors && (Array.from(d.keys()).forEach((c) => {
423
- o.errors.value.delete(c);
433
+ s != null && s.errors && (Array.from(d.keys()).forEach((c) => {
434
+ s.errors.value.delete(c);
424
435
  }), Array.from(h.keys()).forEach((c) => {
425
436
  const b = h.get(c);
426
- b && o.errors.value.set(c, b);
437
+ b && s.errors.value.set(c, b);
427
438
  }));
428
439
  },
429
440
  { deep: !0 }
430
441
  );
431
- const m = y(() => r != null && r.invalid.value ? i.value.size > 0 : !1);
432
- return O(m, () => {
442
+ const m = y(() => r != null && r.invalid.value ? u.value.size > 0 : !1);
443
+ return w(m, () => {
433
444
  m.value ? n("invalid") : n("valid");
434
445
  }), {
435
446
  formData: r == null ? void 0 : r.formData,
@@ -438,15 +449,15 @@ const ve = (e, s, l, u) => W({
438
449
  validate: r == null ? void 0 : r.validate,
439
450
  invalid: m,
440
451
  fields: a,
441
- fieldsErrors: i
452
+ fieldsErrors: u
442
453
  };
443
454
  },
444
455
  render() {
445
- var u, n;
456
+ var i, n;
446
457
  return this.tag ? x(this.tag, null, {
447
458
  default: () => {
448
- var r, o;
449
- return ((o = (r = this.$slots).default) == null ? void 0 : o.call(r, {
459
+ var r, s;
460
+ return ((s = (r = this.$slots).default) == null ? void 0 : s.call(r, {
450
461
  invalid: this.invalid,
451
462
  formData: this.formData,
452
463
  submit: this.submit,
@@ -455,7 +466,7 @@ const ve = (e, s, l, u) => W({
455
466
  fieldsErrors: this.fieldsErrors
456
467
  })) ?? this.$slots.defalut;
457
468
  }
458
- }) : ((n = (u = this.$slots).default) == null ? void 0 : n.call(u, {
469
+ }) : ((n = (i = this.$slots).default) == null ? void 0 : n.call(i, {
459
470
  invalid: this.invalid,
460
471
  formData: this.formData,
461
472
  submit: this.submit,
@@ -464,23 +475,23 @@ const ve = (e, s, l, u) => W({
464
475
  fieldsErrors: this.fieldsErrors
465
476
  })) ?? this.$slots.defalut;
466
477
  }
467
- }), me = (e, s) => {
468
- const l = W({
478
+ }), he = (e, o) => {
479
+ const l = G({
469
480
  props: {
470
481
  schema: {
471
482
  type: [Array, Function],
472
483
  required: !0
473
484
  }
474
485
  },
475
- setup(u, { slots: n }) {
486
+ setup(i, { slots: n }) {
476
487
  const r = S(e);
477
488
  if (!(r != null && r.formData))
478
489
  return;
479
- const o = typeof u.schema == "function" ? u.schema(r) : u.schema;
490
+ const s = typeof i.schema == "function" ? i.schema(r) : i.schema;
480
491
  let a;
481
492
  return () => {
482
- var i;
483
- return o.reduce(
493
+ var u;
494
+ return s.reduce(
484
495
  (t, m) => {
485
496
  const h = typeof m == "function" ? m(r) : m, {
486
497
  vvIs: d,
@@ -489,51 +500,51 @@ const ve = (e, s, l, u) => W({
489
500
  vvChildren: E,
490
501
  vvIf: V,
491
502
  vvElseIf: p,
492
- vvType: $,
493
- vvDefaultValue: _,
494
- vvShowValid: K,
503
+ vvType: C,
504
+ vvDefaultValue: L,
505
+ vvShowValid: J,
495
506
  ...f
496
507
  } = h;
497
508
  if (V !== void 0) {
498
- if (typeof V == "string" ? a = !!G(
509
+ if (typeof V == "string" ? a = !!N(
499
510
  Object(r.formData.value),
500
511
  V
501
512
  ) : typeof V == "function" ? a = I(V(r)) : a = I(V), !a)
502
513
  return t;
503
514
  } else if (p !== void 0 && a !== void 0) {
504
- if (a || (typeof p == "string" ? a = !!G(
515
+ if (a || (typeof p == "string" ? a = !!N(
505
516
  Object(r.formData.value),
506
517
  p
507
518
  ) : typeof p == "function" ? a = I(p(r)) : a = I(p), !a))
508
519
  return t;
509
520
  } else
510
521
  a = void 0;
511
- const w = E ? x(l, {
522
+ const O = E ? x(l, {
512
523
  schema: E
513
524
  }) : void 0;
514
525
  return c ? (t.push(
515
526
  x(
516
- s,
527
+ o,
517
528
  {
518
529
  name: c,
519
530
  is: d,
520
- type: $,
521
- defaultValue: _,
522
- showValid: K,
531
+ type: C,
532
+ defaultValue: L,
533
+ showValid: J,
523
534
  props: f
524
535
  },
525
- b ?? w
536
+ b ?? O
526
537
  )
527
538
  ), t) : d ? (t.push(
528
539
  x(
529
540
  d,
530
541
  f,
531
- b ?? w
542
+ b ?? O
532
543
  )
533
- ), t) : (E && t.push(w), t);
544
+ ), t) : (E && t.push(O), t);
534
545
  },
535
546
  [
536
- (i = n == null ? void 0 : n.default) == null ? void 0 : i.call(n, {
547
+ (u = n == null ? void 0 : n.default) == null ? void 0 : u.call(n, {
537
548
  formData: r == null ? void 0 : r.formData.value,
538
549
  submit: r == null ? void 0 : r.submit,
539
550
  validate: r == null ? void 0 : r.validate,
@@ -547,49 +558,49 @@ const ve = (e, s, l, u) => W({
547
558
  }
548
559
  });
549
560
  return l;
550
- }, L = (e, s = {}) => {
551
- const l = Symbol(), u = Symbol(), n = Symbol(), { VvForm: r, errors: o, status: a, formData: i } = de(
561
+ }, B = (e, o = {}) => {
562
+ const l = Symbol(), i = Symbol(), n = Symbol(), { VvForm: r, errors: s, status: a, formData: u } = ce(
552
563
  e,
553
564
  l,
554
- s
555
- ), t = ce(
565
+ o
566
+ ), t = me(
556
567
  l,
557
- u
558
- ), m = ve(
568
+ i
569
+ ), m = de(
559
570
  l,
560
- u,
571
+ i,
561
572
  n,
562
- s
563
- ), h = me(l, m);
573
+ o
574
+ ), h = he(l, m);
564
575
  return {
565
576
  VvForm: r,
566
577
  VvFormWrapper: t,
567
578
  VvFormField: m,
568
579
  VvFormTemplate: h,
569
580
  formInjectionKey: l,
570
- formWrapperInjectionKey: u,
581
+ formWrapperInjectionKey: i,
571
582
  formFieldInjectionKey: n,
572
- errors: o,
583
+ errors: s,
573
584
  status: a,
574
- formData: i
585
+ formData: u
575
586
  };
576
- }, Y = Symbol(), ye = (e) => {
577
- let s = {};
578
- return e.schema && (s = L(e.schema, e)), {
579
- ...s,
580
- install(l, { global: u = !1 } = {}) {
581
- l.provide(Y, e), u && (l.config.globalProperties.$vvForm = e, s != null && s.VvForm && l.component("VvForm", s.VvForm), s != null && s.VvFormWrapper && l.component("VvFormWrapper", s.VvFormWrapper), s != null && s.VvFormField && l.component("VvFormField", s.VvFormField), s != null && s.VvFormTemplate && l.component("VvFormTemplate", s.VvFormTemplate));
587
+ }, X = Symbol(), Ve = (e) => {
588
+ let o = {};
589
+ return e.schema && (o = B(e.schema, e)), {
590
+ ...o,
591
+ install(l, { global: i = !1 } = {}) {
592
+ l.provide(X, e), i && (l.config.globalProperties.$vvForm = e, o != null && o.VvForm && l.component("VvForm", o.VvForm), o != null && o.VvFormWrapper && l.component("VvFormWrapper", o.VvFormWrapper), o != null && o.VvFormField && l.component("VvFormField", o.VvFormField), o != null && o.VvFormTemplate && l.component("VvFormTemplate", o.VvFormTemplate));
582
593
  }
583
594
  };
584
- }, Ve = (e, s = {}) => re() ? L(e, {
585
- ...S(Y, {}),
586
- ...s
587
- }) : L(e, s), ge = (e, s = {}) => L(e, s);
595
+ }, ge = (e, o = {}) => re() ? B(e, {
596
+ ...S(X, {}),
597
+ ...o
598
+ }) : B(e, o), xe = (e, o = {}) => B(e, o);
588
599
  export {
589
600
  v as FormFieldType,
590
- ye as createForm,
591
- X as defaultObjectBySchema,
592
- ge as formFactory,
593
- Y as pluginInjectionKey,
594
- Ve as useForm
601
+ Ve as createForm,
602
+ Z as defaultObjectBySchema,
603
+ xe as formFactory,
604
+ X as pluginInjectionKey,
605
+ ge as useForm
595
606
  };