@volverjs/form-vue 0.0.10-beta.3 → 0.0.10-beta.5

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,77 +1,77 @@
1
- import { defineComponent as $, computed as V, onMounted as z, onBeforeUnmount as q, inject as S, toRefs as A, watch as y, provide as D, readonly as w, resolveComponent as h, defineAsyncComponent as R, h as x, ref as g, isProxy as H, toRaw as Q, withModifiers as X } from "vue";
2
- import { watchThrottled as Y } from "@vueuse/core";
3
- import { ZodObject as C, ZodDefault as P, ZodNullable as F, ZodSchema as T, ZodEffects as ee } from "zod";
1
+ import { defineComponent as E, computed as b, onMounted as R, onBeforeUnmount as q, inject as S, toRefs as I, watch as y, provide as $, readonly as w, resolveComponent as p, defineAsyncComponent as H, h as x, ref as g, isProxy as Q, toRaw as X, withModifiers as Y } from "vue";
2
+ import { watchThrottled as D } from "@vueuse/core";
3
+ import { ZodObject as L, ZodDefault as T, ZodNullable as j, ZodSchema as F, ZodEffects as ee } from "zod";
4
4
  function O(e) {
5
5
  return Array.isArray(e);
6
6
  }
7
7
  function te(e) {
8
8
  return typeof e < "u";
9
9
  }
10
- function L(e) {
10
+ function N(e) {
11
11
  return e === null;
12
12
  }
13
- function _(e) {
13
+ function W(e) {
14
14
  return typeof e == "object";
15
15
  }
16
- function B(e) {
16
+ function _(e) {
17
17
  return typeof e == "string";
18
18
  }
19
19
  function k(e) {
20
20
  return typeof e > "u";
21
21
  }
22
- const re = /^[0-9]+$/, ae = ["__proto__", "prototype", "constructor"];
23
- function N(e, n, o) {
24
- const l = te(o) ? o : void 0;
25
- if (!_(e) || !B(n))
26
- return l;
27
- const a = W(n);
22
+ const re = /^[0-9]+$/, ne = ["__proto__", "prototype", "constructor"];
23
+ function A(e, o, s) {
24
+ const u = te(s) ? s : void 0;
25
+ if (!W(e) || !_(o))
26
+ return u;
27
+ const a = K(o);
28
28
  if (a.length !== 0) {
29
29
  for (const t of a) {
30
30
  if (t === "*")
31
31
  continue;
32
- const u = function(s) {
33
- return s.map((i) => k(i) || L(i) ? i : O(i) ? u(i) : i[t]);
32
+ const r = function(c) {
33
+ return c.map((l) => k(l) || N(l) ? l : O(l) ? r(l) : l[t]);
34
34
  };
35
- if (O(e) && !re.test(t) ? e = u(e) : e = e[t], k(e) || L(e))
35
+ if (O(e) && !re.test(t) ? e = r(e) : e = e[t], k(e) || N(e))
36
36
  break;
37
37
  }
38
- return k(e) ? l : e;
38
+ return k(e) ? u : e;
39
39
  }
40
40
  }
41
- function I(e, n, o) {
42
- if (!_(e) || !B(n))
41
+ function B(e, o, s) {
42
+ if (!W(e) || !_(o))
43
43
  return;
44
- const l = W(n);
45
- if (l.length === 0)
44
+ const u = K(o);
45
+ if (u.length === 0)
46
46
  return;
47
- const a = l.length;
47
+ const a = u.length;
48
48
  for (let t = 0; t < a; t++) {
49
- const u = l[t];
49
+ const r = u[t];
50
50
  if (t === a - 1) {
51
- e[u] = o;
51
+ e[r] = s;
52
52
  return;
53
53
  }
54
- if (u === "*" && O(e)) {
55
- const s = l.slice(t + 1).join(".");
56
- for (const i of e)
57
- I(i, s, o);
54
+ if (r === "*" && O(e)) {
55
+ const c = u.slice(t + 1).join(".");
56
+ for (const l of e)
57
+ B(l, c, s);
58
58
  return;
59
59
  }
60
- k(e[u]) && (e[u] = {}), e = e[u];
60
+ k(e[r]) && (e[r] = {}), e = e[r];
61
61
  }
62
62
  }
63
- function W(e) {
64
- const n = e.split(/[.]|(?:\[(\d|\*)\])/).filter((o) => !!o);
65
- return n.some((o) => ae.indexOf(o) !== -1) ? [] : n;
63
+ function K(e) {
64
+ const o = e.split(/[.]|(?:\[(\d|\*)\])/).filter((s) => !!s);
65
+ return o.some((s) => ne.indexOf(s) !== -1) ? [] : o;
66
66
  }
67
- var c = /* @__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 = "datetimeLocal", 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))(c || {});
68
- const ne = (e, n, o, l = {}) => $({
67
+ var i = /* @__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 = "datetimeLocal", 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))(i || {});
68
+ const oe = (e, o, s, u = {}) => E({
69
69
  name: "FieldComponent",
70
70
  props: {
71
71
  type: {
72
72
  type: String,
73
- validator: (a) => Object.values(c).includes(a),
74
- default: c.custom
73
+ validator: (a) => Object.values(i).includes(a),
74
+ default: i.custom
75
75
  },
76
76
  is: {
77
77
  type: [Object, String],
@@ -96,126 +96,129 @@ const ne = (e, n, o, l = {}) => $({
96
96
  },
97
97
  emits: ["invalid", "valid", "update:formData", "update:modelValue"],
98
98
  expose: ["invalid", "invalidLabel", "errors"],
99
- setup(a, { slots: t, emit: u }) {
100
- const s = V({
99
+ setup(a, { slots: t, emit: r }) {
100
+ const c = b({
101
101
  get() {
102
- if (r != null && r.modelValue)
103
- return N(
104
- Object(r.modelValue.value),
102
+ if (n != null && n.modelValue)
103
+ return A(
104
+ Object(n.modelValue.value),
105
105
  String(a.name)
106
106
  );
107
107
  },
108
108
  set(f) {
109
- r != null && r.modelValue && (I(
110
- Object(r.modelValue.value),
109
+ n != null && n.modelValue && (B(
110
+ Object(n.modelValue.value),
111
111
  String(a.name),
112
112
  f
113
- ), u("update:modelValue", {
114
- newValue: s.value,
115
- formData: r == null ? void 0 : r.modelValue
113
+ ), r("update:modelValue", {
114
+ newValue: c.value,
115
+ formData: n == null ? void 0 : n.modelValue
116
116
  }));
117
117
  }
118
118
  });
119
- z(() => {
120
- s.value === void 0 && a.defaultValue !== void 0 && (s.value = a.defaultValue);
119
+ R(() => {
120
+ c.value === void 0 && a.defaultValue !== void 0 && (c.value = a.defaultValue);
121
121
  }), q(() => {
122
- j(), J();
122
+ J(), U();
123
123
  });
124
- const i = S(n, void 0);
125
- i && i.fields.value.add(a.name);
126
- const r = S(e), { props: m, name: v } = A(a), d = V(() => {
127
- if (r != null && r.errors.value)
128
- return N(r.errors.value, String(a.name));
129
- }), p = V(() => {
124
+ const l = S(o, void 0);
125
+ l && l.fields.value.add(a.name);
126
+ const n = S(e), { props: m, name: v } = I(a), d = b(() => {
127
+ if (n != null && n.errors.value)
128
+ return A(n.errors.value, String(a.name));
129
+ }), h = b(() => {
130
130
  var f;
131
131
  return (f = d.value) == null ? void 0 : f._errors;
132
- }), b = V(() => d.value !== void 0), j = y(b, () => {
133
- b.value ? (u("invalid", p.value), i && i.errors.value.set(a.name, {
134
- _errors: p.value
135
- })) : (u("valid", s.value), i && i.errors.value.delete(
132
+ }), V = b(() => d.value !== void 0), J = y(V, () => {
133
+ V.value ? (r("invalid", h.value), l && l.errors.value.set(
134
+ a.name,
135
+ {
136
+ _errors: h.value
137
+ }
138
+ )) : (r("valid", c.value), l && l.errors.value.delete(
136
139
  a.name
137
140
  ));
138
- }), J = y(
139
- () => r == null ? void 0 : r.modelValue,
141
+ }), U = y(
142
+ () => n == null ? void 0 : n.modelValue,
140
143
  () => {
141
- u("update:formData", r == null ? void 0 : r.modelValue);
144
+ r("update:formData", n == null ? void 0 : n.modelValue);
142
145
  },
143
146
  { deep: !0 }
144
- ), E = (f) => {
145
- s.value = f;
146
- }, G = V(() => typeof m.value == "function" ? m.value(r == null ? void 0 : r.modelValue) : m.value), U = V(() => ({
147
- ...G.value,
148
- name: G.value.name ?? a.name,
149
- invalid: b.value,
150
- valid: a.showValid ? !!(!b.value && s.value) : void 0,
147
+ ), G = (f) => {
148
+ c.value = f;
149
+ }, C = b(() => typeof m.value == "function" ? m.value(n == null ? void 0 : n.modelValue) : m.value), z = b(() => ({
150
+ ...C.value,
151
+ name: C.value.name ?? a.name,
152
+ invalid: V.value,
153
+ valid: a.showValid ? !!(!V.value && c.value) : void 0,
151
154
  type: ((f) => {
152
155
  if ([
153
- c.text,
154
- c.number,
155
- c.email,
156
- c.password,
157
- c.tel,
158
- c.url,
159
- c.search,
160
- c.date,
161
- c.time,
162
- c.datetimeLocal,
163
- c.month,
164
- c.week,
165
- c.color
156
+ i.text,
157
+ i.number,
158
+ i.email,
159
+ i.password,
160
+ i.tel,
161
+ i.url,
162
+ i.search,
163
+ i.date,
164
+ i.time,
165
+ i.datetimeLocal,
166
+ i.month,
167
+ i.week,
168
+ i.color
166
169
  ].includes(f))
167
170
  return f;
168
171
  })(a.type),
169
- invalidLabel: p.value,
170
- modelValue: s.value,
172
+ invalidLabel: h.value,
173
+ modelValue: c.value,
171
174
  errors: a.is ? d.value : void 0,
172
- "onUpdate:modelValue": E
175
+ "onUpdate:modelValue": G
173
176
  }));
174
- return D(o, {
177
+ return $(s, {
175
178
  name: w(v),
176
179
  errors: w(d)
177
- }), { component: V(() => {
178
- if (a.type === c.custom)
180
+ }), { component: b(() => {
181
+ if (a.type === i.custom)
179
182
  return {
180
183
  render() {
181
184
  var f;
182
185
  return ((f = t.default) == null ? void 0 : f.call(t, {
183
- modelValue: s.value,
184
- onUpdate: E,
185
- invalid: b.value,
186
- invalidLabel: p.value,
187
- formData: r == null ? void 0 : r.modelValue.value,
188
- formErrors: r == null ? void 0 : r.errors.value,
186
+ modelValue: c.value,
187
+ onUpdate: G,
188
+ invalid: V.value,
189
+ invalidLabel: h.value,
190
+ formData: n == null ? void 0 : n.modelValue.value,
191
+ formErrors: n == null ? void 0 : n.errors.value,
189
192
  errors: d.value
190
193
  })) ?? t.defalut;
191
194
  }
192
195
  };
193
- if (!l.lazyLoad) {
196
+ if (!u.lazyLoad) {
194
197
  let f;
195
198
  switch (a.type) {
196
- case c.select:
197
- f = h("VvSelect");
199
+ case i.select:
200
+ f = p("VvSelect");
198
201
  break;
199
- case c.checkbox:
200
- f = h("VvCheckbox");
202
+ case i.checkbox:
203
+ f = p("VvCheckbox");
201
204
  break;
202
- case c.radio:
203
- f = h("VvRadio");
205
+ case i.radio:
206
+ f = p("VvRadio");
204
207
  break;
205
- case c.textarea:
206
- f = h("VvTextarea");
208
+ case i.textarea:
209
+ f = p("VvTextarea");
207
210
  break;
208
- case c.radioGroup:
209
- f = h("VvRadioGroup");
211
+ case i.radioGroup:
212
+ f = p("VvRadioGroup");
210
213
  break;
211
- case c.checkboxGroup:
212
- f = h("VvCheckboxGroup");
214
+ case i.checkboxGroup:
215
+ f = p("VvCheckboxGroup");
213
216
  break;
214
- case c.combobox:
215
- f = h("VvCombobox");
217
+ case i.combobox:
218
+ f = p("VvCombobox");
216
219
  break;
217
220
  default:
218
- f = h("VvInputText");
221
+ f = p("VvInputText");
219
222
  }
220
223
  if (typeof f != "string")
221
224
  return f;
@@ -223,65 +226,65 @@ const ne = (e, n, o, l = {}) => $({
223
226
  `[form-vue warn]: ${f} not found, the component will be loaded asynchronously. To avoid this warning, please set "lazyLoad" option.`
224
227
  );
225
228
  }
226
- return R(async () => {
227
- switch (l.sideEffects && await Promise.resolve(l.sideEffects(a.type)), a.type) {
228
- case c.textarea:
229
+ return H(async () => {
230
+ switch (u.sideEffects && await Promise.resolve(u.sideEffects(a.type)), a.type) {
231
+ case i.textarea:
229
232
  return import("@volverjs/ui-vue/vv-textarea");
230
- case c.radio:
233
+ case i.radio:
231
234
  return import("@volverjs/ui-vue/vv-radio");
232
- case c.radioGroup:
235
+ case i.radioGroup:
233
236
  return import("@volverjs/ui-vue/vv-radio-group");
234
- case c.checkbox:
237
+ case i.checkbox:
235
238
  return import("@volverjs/ui-vue/vv-checkbox");
236
- case c.checkboxGroup:
239
+ case i.checkboxGroup:
237
240
  return import("@volverjs/ui-vue/vv-checkbox-group");
238
- case c.combobox:
241
+ case i.combobox:
239
242
  return import("@volverjs/ui-vue/vv-combobox");
240
243
  }
241
244
  return import("@volverjs/ui-vue/vv-input-text");
242
245
  });
243
- }), hasProps: U, invalid: b };
246
+ }), hasProps: z, invalid: V };
244
247
  },
245
248
  render() {
246
- return this.is ? x(this.is, this.hasProps, this.$slots) : this.type === c.custom ? x(this.component, null, this.$slots) : x(this.component, this.hasProps, this.$slots);
249
+ return this.is ? x(this.is, this.hasProps, this.$slots) : this.type === i.custom ? x(this.component, null, this.$slots) : x(this.component, this.hasProps, this.$slots);
247
250
  }
248
- }), K = (e, n = {}) => {
249
- const o = (t) => {
250
- let u = t;
251
- for (; u instanceof ee; )
252
- u = u.innerType();
253
- return u;
254
- }, l = o(e);
251
+ }), M = (e, o = {}) => {
252
+ const s = (t) => {
253
+ let r = t;
254
+ for (; r instanceof ee; )
255
+ r = r.innerType();
256
+ return r;
257
+ }, u = s(e);
255
258
  return {
256
- ...(l instanceof C ? l._def.unknownKeys === "passthrough" : !1) ? n : {},
259
+ ...(u instanceof L ? u._def.unknownKeys === "passthrough" : !1) ? o : {},
257
260
  ...Object.fromEntries(
258
- Object.entries(l.shape).map(([t, u]) => {
259
- const s = n[t], i = o(u);
260
- let r;
261
- if (i instanceof P && (r = i._def.defaultValue()), s === null && i instanceof F)
262
- return [t, s];
263
- if (i instanceof T) {
264
- const m = i.safeParse(n[t]);
261
+ Object.entries(u.shape).map(([t, r]) => {
262
+ const c = o[t], l = s(r);
263
+ let n;
264
+ if (l instanceof T && (n = l._def.defaultValue()), c === null && l instanceof j)
265
+ return [t, c];
266
+ if (l instanceof F) {
267
+ const m = l.safeParse(o[t]);
265
268
  if (m.success)
266
- return [t, m.data ?? r];
269
+ return [t, m.data ?? n];
267
270
  }
268
- return i instanceof C ? [
271
+ return l instanceof L ? [
269
272
  t,
270
- K(
271
- i,
272
- s && typeof s == "object" ? s : {}
273
+ M(
274
+ l,
275
+ c && typeof c == "object" ? c : {}
273
276
  )
274
- ] : [t, r];
277
+ ] : [t, n];
275
278
  })
276
279
  )
277
280
  };
278
- }, oe = (e, n, o) => {
279
- const l = g(), a = g(), t = g();
281
+ }, ae = (e, o, s) => {
282
+ const u = g(), a = g(), t = g();
280
283
  return {
281
- errors: l,
284
+ errors: u,
282
285
  status: a,
283
286
  formData: t,
284
- component: $({
287
+ component: E({
285
288
  name: "FormComponent",
286
289
  props: {
287
290
  modelValue: {
@@ -295,50 +298,50 @@ const ne = (e, n, o, l = {}) => $({
295
298
  },
296
299
  emits: ["invalid", "valid", "submit", "update:modelValue"],
297
300
  expose: ["submit", "errors", "status"],
298
- setup(u, { emit: s }) {
299
- t.value = K(
301
+ setup(r, { emit: c }) {
302
+ t.value = M(
300
303
  e,
301
- u.modelValue
304
+ r.modelValue
302
305
  );
303
- const i = (o == null ? void 0 : o.continuosValidation) || u.continuosValidation;
306
+ const l = (s == null ? void 0 : s.continuosValidation) || r.continuosValidation;
304
307
  y(
305
- () => u.modelValue,
308
+ () => r.modelValue,
306
309
  (v) => {
307
310
  if (v) {
308
- const d = H(v) ? Q(v) : v;
311
+ const d = Q(v) ? X(v) : v;
309
312
  t.value = typeof (d == null ? void 0 : d.clone) == "function" ? d.clone() : JSON.parse(JSON.stringify(d));
310
313
  }
311
314
  },
312
315
  { deep: !0 }
313
- ), Y(
316
+ ), D(
314
317
  t,
315
318
  (v) => {
316
- (l.value || i) && r(), (!v || !u.modelValue || JSON.stringify(v) !== JSON.stringify(u.modelValue)) && s("update:modelValue", v);
319
+ (u.value || l) && n(), (!v || !r.modelValue || JSON.stringify(v) !== JSON.stringify(r.modelValue)) && c("update:modelValue", v);
317
320
  },
318
- { deep: !0, throttle: (o == null ? void 0 : o.updateThrottle) ?? 500 }
321
+ { deep: !0, throttle: (s == null ? void 0 : s.updateThrottle) ?? 500 }
319
322
  );
320
- const r = (v = t.value) => {
323
+ const n = (v = t.value) => {
321
324
  const d = e.safeParse(v);
322
- return d.success ? (l.value = void 0, a.value = "valid", t.value = d.data, s("update:modelValue", t.value), s("valid", d.data), !0) : (l.value = d.error.format(), a.value = "invalid", s("invalid", l.value), !1);
323
- }, m = () => r() ? (s("submit", t.value), !0) : !1;
324
- return D(n, {
325
+ return d.success ? (u.value = void 0, a.value = "valid", t.value = d.data, c("update:modelValue", t.value), c("valid", d.data), !0) : (u.value = d.error.format(), a.value = "invalid", c("invalid", u.value), !1);
326
+ }, m = () => n() ? (c("submit", t.value), !0) : !1;
327
+ return $(o, {
325
328
  modelValue: t,
326
329
  submit: m,
327
- errors: w(l)
330
+ errors: w(u)
328
331
  }), { submit: m };
329
332
  },
330
333
  render() {
331
334
  return x(
332
335
  "form",
333
336
  {
334
- onSubmit: X(this.submit, ["prevent"])
337
+ onSubmit: Y(this.submit, ["prevent"])
335
338
  },
336
339
  this.$slots
337
340
  );
338
341
  }
339
342
  })
340
343
  };
341
- }, ue = (e, n) => $({
344
+ }, se = (e, o) => E({
342
345
  name: "WrapperComponent",
343
346
  props: {
344
347
  name: {
@@ -352,98 +355,104 @@ const ne = (e, n, o, l = {}) => $({
352
355
  },
353
356
  emits: ["invalid", "valid"],
354
357
  expose: ["fields", "invalid"],
355
- setup(o, { emit: l }) {
356
- const a = S(e), t = S(n, void 0), u = g(/* @__PURE__ */ new Set()), s = g(/* @__PURE__ */ new Map()), { name: i } = A(o);
357
- D(n, {
358
- name: w(i),
359
- errors: s,
360
- fields: u
358
+ setup(u, { emit: a }) {
359
+ const t = S(e), r = S(o, void 0), c = g(/* @__PURE__ */ new Set()), l = g(/* @__PURE__ */ new Map()), { name: n } = I(u);
360
+ $(o, {
361
+ name: w(n),
362
+ errors: l,
363
+ fields: c
361
364
  }), y(
362
- u,
363
- (m) => {
364
- t != null && t.fields && m.forEach((v) => {
365
- t == null || t.fields.value.add(v);
365
+ c,
366
+ (v) => {
367
+ r != null && r.fields && v.forEach((d) => {
368
+ r == null || r.fields.value.add(d);
366
369
  });
367
370
  },
368
371
  { deep: !0 }
369
372
  ), y(
370
- () => new Map(s.value),
371
- (m, v) => {
372
- t != null && t.errors && (Array.from(v.keys()).forEach((d) => {
373
- t.errors.value.delete(d);
374
- }), Array.from(m.keys()).forEach((d) => {
375
- const p = m.get(d);
376
- p && t.errors.value.set(d, p);
373
+ () => new Map(l.value),
374
+ (v, d) => {
375
+ r != null && r.errors && (Array.from(d.keys()).forEach((h) => {
376
+ r.errors.value.delete(h);
377
+ }), Array.from(v.keys()).forEach((h) => {
378
+ const V = v.get(h);
379
+ V && r.errors.value.set(h, V);
377
380
  }));
378
381
  },
379
382
  { deep: !0 }
380
383
  );
381
- const r = V(() => a != null && a.errors.value ? s.value.size > 0 : !1);
382
- return y(r, () => {
383
- r.value ? l("invalid") : l("valid");
384
- }), { formProvided: a, invalid: r, fields: u, errors: s };
384
+ const m = b(() => t != null && t.errors.value ? l.value.size > 0 : !1);
385
+ return y(m, () => {
386
+ m.value ? a("invalid") : a("valid");
387
+ }), {
388
+ formData: t == null ? void 0 : t.modelValue,
389
+ errors: t == null ? void 0 : t.errors,
390
+ invalid: m,
391
+ fields: c,
392
+ fieldsErrors: l
393
+ };
385
394
  },
386
395
  render() {
387
- var o, l, a, t, u, s, i, r;
396
+ var u, a, t, r;
388
397
  return this.tag ? x(
389
398
  this.tag,
390
399
  null,
391
- ((t = (a = this.$slots).default) == null ? void 0 : t.call(a, {
400
+ ((a = (u = this.$slots).default) == null ? void 0 : a.call(u, {
392
401
  invalid: this.invalid,
393
- formData: (o = this.formProvided) == null ? void 0 : o.modelValue.value,
394
- errors: (l = this.formProvided) == null ? void 0 : l.errors.value,
395
- fieldsErrors: this.errors
402
+ formData: this.formData,
403
+ errors: this.errors,
404
+ fieldsErrors: this.fieldsErrors
396
405
  })) ?? this.$slots.defalut
397
- ) : ((r = (i = this.$slots).default) == null ? void 0 : r.call(i, {
406
+ ) : ((r = (t = this.$slots).default) == null ? void 0 : r.call(t, {
398
407
  invalid: this.invalid,
399
- formData: (u = this.formProvided) == null ? void 0 : u.modelValue.value,
400
- errors: (s = this.formProvided) == null ? void 0 : s.errors.value,
401
- fieldsErrors: this.errors
408
+ formData: this.formData,
409
+ errors: this.errors,
410
+ fieldsErrors: this.fieldsErrors
402
411
  })) ?? this.$slots.defalut;
403
412
  }
404
- }), M = (e, n = {}) => {
405
- const o = Symbol(), l = Symbol(), a = Symbol(), {
413
+ }), P = (e, o = {}) => {
414
+ const s = Symbol(), u = Symbol(), a = Symbol(), {
406
415
  component: t,
407
- errors: u,
408
- status: s,
409
- formData: i
410
- } = oe(e, o, n), r = ue(
411
- o,
412
- l
413
- ), m = ne(
414
- o,
415
- l,
416
+ errors: r,
417
+ status: c,
418
+ formData: l
419
+ } = ae(e, s, o), n = se(
420
+ s,
421
+ u
422
+ ), m = oe(
423
+ s,
424
+ u,
416
425
  a,
417
- n
426
+ o
418
427
  );
419
428
  return {
420
429
  VvForm: t,
421
- VvFormWrapper: r,
430
+ VvFormWrapper: n,
422
431
  VvFormField: m,
423
- formInjectionKey: o,
424
- formWrapperInjectionKey: l,
432
+ formInjectionKey: s,
433
+ formWrapperInjectionKey: u,
425
434
  formFieldInjectionKey: a,
426
- errors: u,
427
- status: s,
428
- formData: i
435
+ errors: r,
436
+ status: c,
437
+ formData: l
429
438
  };
430
439
  }, Z = Symbol(), fe = (e) => {
431
- let n = {};
432
- return e.schema && (n = M(e.schema, e)), {
433
- ...n,
434
- install(o, { global: l = !1 } = {}) {
435
- o.provide(Z, e), l && (o.config.globalProperties.$vvForm = e, n != null && n.VvForm && o.component("VvForm", n.VvForm), n != null && n.VvFormWrapper && o.component("VvFormWrapper", n.VvFormWrapper), n != null && n.VvFormField && o.component("VvFormField", n.VvFormField));
440
+ let o = {};
441
+ return e.schema && (o = P(e.schema, e)), {
442
+ ...o,
443
+ install(s, { global: u = !1 } = {}) {
444
+ s.provide(Z, e), u && (s.config.globalProperties.$vvForm = e, o != null && o.VvForm && s.component("VvForm", o.VvForm), o != null && o.VvFormWrapper && s.component("VvFormWrapper", o.VvFormWrapper), o != null && o.VvFormField && s.component("VvFormField", o.VvFormField));
436
445
  }
437
446
  };
438
- }, de = (e, n = {}) => {
439
- const o = { ...S(Z, {}), ...n };
440
- return M(e, o);
447
+ }, de = (e, o = {}) => {
448
+ const s = { ...S(Z, {}), ...o };
449
+ return P(e, s);
441
450
  };
442
451
  export {
443
- c as FormFieldType,
452
+ i as FormFieldType,
444
453
  fe as createForm,
445
- K as defaultObjectBySchema,
446
- M as formFactory,
454
+ M as defaultObjectBySchema,
455
+ P as formFactory,
447
456
  Z as pluginInjectionKey,
448
457
  de as useForm
449
458
  };