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

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