@volverjs/form-vue 1.0.0-beta.36 → 1.0.0-beta.37

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