@volverjs/form-vue 0.0.13-beta.3 → 0.0.13-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/README.md CHANGED
@@ -6,6 +6,8 @@
6
6
 
7
7
  `form` `form-field` `form-wrapper` `vue3` `zod` `validation`
8
8
 
9
+ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=volverjs_form-vue&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=volverjs_form-vue) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=volverjs_form-vue&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=volverjs_form-vue) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=volverjs_form-vue&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=volverjs_form-vue) [![Depfu](https://badges.depfu.com/badges/e2c464e3cb95f98ee6a9a566dd44e0a9/status.svg)](https://depfu.com) [![Depfu](https://badges.depfu.com/badges/e2c464e3cb95f98ee6a9a566dd44e0a9/overview.svg)](https://depfu.com/github/volverjs/form-vue?project_id=38569)
10
+
9
11
  <br>
10
12
 
11
13
  #### proudly powered by
@@ -4,7 +4,7 @@ import { FormFieldType } from './enums';
4
4
  import type { InjectedFormData, InjectedFormWrapperData, InjectedFormFieldData, FormFieldComponentOptions, Path, FormSchema } from './types';
5
5
  export declare const defineFormField: <Schema extends FormSchema>(formProvideKey: InjectionKey<InjectedFormData<Schema>>, wrapperProvideKey: InjectionKey<InjectedFormWrapperData<Schema>>, formFieldInjectionKey: InjectionKey<InjectedFormFieldData<Schema>>, options?: FormFieldComponentOptions) => import("vue").DefineComponent<{
6
6
  type: {
7
- type: PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetimeLocal" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
7
+ type: PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
8
8
  validator: (value: FormFieldType) => boolean;
9
9
  default: FormFieldType;
10
10
  };
@@ -57,7 +57,7 @@ export declare const defineFormField: <Schema extends FormSchema>(formProvideKey
57
57
  invalid: import("vue").ComputedRef<boolean>;
58
58
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "update:formData")[], "invalid" | "valid" | "update:modelValue" | "update:formData", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
59
59
  type: {
60
- type: PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetimeLocal" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
60
+ type: PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
61
61
  validator: (value: FormFieldType) => boolean;
62
62
  default: FormFieldType;
63
63
  };
@@ -91,7 +91,7 @@ export declare const defineFormField: <Schema extends FormSchema>(formProvideKey
91
91
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
92
92
  "onUpdate:formData"?: ((...args: any[]) => any) | undefined;
93
93
  }, {
94
- type: "number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetimeLocal" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom";
94
+ type: "number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom";
95
95
  props: [{
96
96
  type: PropType<Partial<z.TypeOf<Schema> | ((formData?: Ref<ObjectConstructor>) => Partial<z.TypeOf<Schema>> | undefined) | undefined>>;
97
97
  default: () => {};
package/dist/enums.d.ts CHANGED
@@ -8,7 +8,7 @@ export declare enum FormFieldType {
8
8
  search = "search",
9
9
  date = "date",
10
10
  time = "time",
11
- datetimeLocal = "datetimeLocal",
11
+ datetimeLocal = "datetime-local",
12
12
  month = "month",
13
13
  week = "week",
14
14
  color = "color",
package/dist/index.d.ts CHANGED
@@ -373,7 +373,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
373
373
  });
374
374
  VvFormField: import("vue").DefineComponent<{
375
375
  type: {
376
- type: import("vue").PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetimeLocal" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
376
+ type: import("vue").PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
377
377
  validator: (value: import("./enums").FormFieldType) => boolean;
378
378
  default: import("./enums").FormFieldType;
379
379
  };
@@ -426,7 +426,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
426
426
  invalid: import("vue").ComputedRef<boolean>;
427
427
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "update:formData")[], "invalid" | "valid" | "update:modelValue" | "update:formData", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
428
428
  type: {
429
- type: import("vue").PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetimeLocal" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
429
+ type: import("vue").PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
430
430
  validator: (value: import("./enums").FormFieldType) => boolean;
431
431
  default: import("./enums").FormFieldType;
432
432
  };
@@ -460,7 +460,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
460
460
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
461
461
  "onUpdate:formData"?: ((...args: any[]) => any) | undefined;
462
462
  }, {
463
- type: "number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetimeLocal" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom";
463
+ type: "number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom";
464
464
  props: [{
465
465
  type: import("vue").PropType<Partial<import("zod").TypeOf<Schema> | ((formData?: import("vue").Ref<ObjectConstructor> | undefined) => Partial<import("zod").TypeOf<Schema>> | undefined) | undefined>>;
466
466
  default: () => {};
@@ -874,7 +874,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
874
874
  });
875
875
  VvFormField: import("vue").DefineComponent<{
876
876
  type: {
877
- type: import("vue").PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetimeLocal" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
877
+ type: import("vue").PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
878
878
  validator: (value: import("./enums").FormFieldType) => boolean;
879
879
  default: import("./enums").FormFieldType;
880
880
  };
@@ -927,7 +927,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
927
927
  invalid: import("vue").ComputedRef<boolean>;
928
928
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "update:formData")[], "invalid" | "valid" | "update:modelValue" | "update:formData", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
929
929
  type: {
930
- type: import("vue").PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetimeLocal" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
930
+ type: import("vue").PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
931
931
  validator: (value: import("./enums").FormFieldType) => boolean;
932
932
  default: import("./enums").FormFieldType;
933
933
  };
@@ -961,7 +961,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
961
961
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
962
962
  "onUpdate:formData"?: ((...args: any[]) => any) | undefined;
963
963
  }, {
964
- type: "number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetimeLocal" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom";
964
+ type: "number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom";
965
965
  props: [{
966
966
  type: import("vue").PropType<Partial<import("zod").TypeOf<Schema> | ((formData?: import("vue").Ref<ObjectConstructor> | undefined) => Partial<import("zod").TypeOf<Schema>> | undefined) | undefined>>;
967
967
  default: () => {};
package/dist/index.es.js CHANGED
@@ -16,11 +16,11 @@ function P(e) {
16
16
  function H(e) {
17
17
  return typeof e == "string";
18
18
  }
19
- function L(e) {
19
+ function N(e) {
20
20
  return typeof e > "u";
21
21
  }
22
22
  const le = /^[0-9]+$/, fe = ["__proto__", "prototype", "constructor"];
23
- function B(e, s, l) {
23
+ function G(e, s, l) {
24
24
  const u = ie(l) ? l : void 0;
25
25
  if (!P(e) || !H(s))
26
26
  return u;
@@ -30,12 +30,12 @@ function B(e, s, l) {
30
30
  if (r === "*")
31
31
  continue;
32
32
  const o = function(a) {
33
- return a.map((i) => L(i) || U(i) ? i : A(i) ? o(i) : i[r]);
33
+ return a.map((i) => N(i) || U(i) ? i : A(i) ? o(i) : i[r]);
34
34
  };
35
- if (A(e) && !le.test(r) ? e = o(e) : e = e[r], L(e) || U(e))
35
+ if (A(e) && !le.test(r) ? e = o(e) : e = e[r], N(e) || U(e))
36
36
  break;
37
37
  }
38
- return L(e) ? u : e;
38
+ return N(e) ? u : e;
39
39
  }
40
40
  }
41
41
  function Q(e, s, l) {
@@ -57,14 +57,14 @@ function Q(e, s, l) {
57
57
  Q(i, a, l);
58
58
  return;
59
59
  }
60
- L(e[o]) && (e[o] = {}), e = e[o];
60
+ N(e[o]) && (e[o] = {}), e = e[o];
61
61
  }
62
62
  }
63
63
  function R(e) {
64
64
  const s = e.split(/[.]|(?:\[(\d|\*)\])/).filter((l) => !!l);
65
65
  return s.some((l) => fe.indexOf(l) !== -1) ? [] : s;
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 = "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))(v || {}), N = /* @__PURE__ */ ((e) => (e.invalid = "invalid", e.valid = "valid", e))(N || {});
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
68
  const ve = (e, s, l, u) => W({
69
69
  name: "FieldComponent",
70
70
  props: {
@@ -104,7 +104,7 @@ const ve = (e, s, l, u) => W({
104
104
  const a = y({
105
105
  get() {
106
106
  if (t != null && t.formData)
107
- return B(
107
+ return G(
108
108
  Object(t.formData.value),
109
109
  String(n.name)
110
110
  );
@@ -129,7 +129,7 @@ const ve = (e, s, l, u) => W({
129
129
  i && i.fields.value.add(n.name);
130
130
  const t = S(e), { props: m, name: h } = q(n), d = y(() => {
131
131
  if (t != null && t.errors.value)
132
- return B(t.errors.value, String(n.name));
132
+ return G(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;
@@ -339,8 +339,8 @@ const ve = (e, s, l, u) => W({
339
339
  );
340
340
  const t = (d = r.value) => {
341
341
  const c = e.safeParse(d);
342
- return c.success ? (u.value = void 0, n.value = N.valid, r.value = c.data, i("update:modelValue", r.value), i("valid", c.data), !0) : (u.value = c.error.format(), n.value = N.invalid, i("invalid", u.value), !1);
343
- }, m = () => t() ? (i("submit", r.value), !0) : !1, h = y(() => n.value === N.invalid);
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
344
  return z(s, {
345
345
  formData: r,
346
346
  submit: m,
@@ -495,13 +495,13 @@ const ve = (e, s, l, u) => W({
495
495
  ...f
496
496
  } = h;
497
497
  if (V !== void 0) {
498
- if (typeof V == "string" ? a = !!B(
498
+ if (typeof V == "string" ? a = !!G(
499
499
  Object(r.formData.value),
500
500
  V
501
501
  ) : typeof V == "function" ? a = I(V(r)) : a = I(V), !a)
502
502
  return t;
503
503
  } else if (p !== void 0 && a !== void 0) {
504
- if (a || (typeof p == "string" ? a = !!B(
504
+ if (a || (typeof p == "string" ? a = !!G(
505
505
  Object(r.formData.value),
506
506
  p
507
507
  ) : typeof p == "function" ? a = I(p(r)) : a = I(p), !a))
@@ -547,7 +547,7 @@ const ve = (e, s, l, u) => W({
547
547
  }
548
548
  });
549
549
  return l;
550
- }, G = (e, s = {}) => {
550
+ }, L = (e, s = {}) => {
551
551
  const l = Symbol(), u = Symbol(), n = Symbol(), { VvForm: r, errors: o, status: a, formData: i } = de(
552
552
  e,
553
553
  l,
@@ -575,16 +575,16 @@ const ve = (e, s, l, u) => W({
575
575
  };
576
576
  }, Y = Symbol(), ye = (e) => {
577
577
  let s = {};
578
- return e.schema && (s = G(e.schema, e)), {
578
+ return e.schema && (s = L(e.schema, e)), {
579
579
  ...s,
580
580
  install(l, { global: u = !1 } = {}) {
581
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));
582
582
  }
583
583
  };
584
- }, Ve = (e, s = {}) => re() ? G(e, {
584
+ }, Ve = (e, s = {}) => re() ? L(e, {
585
585
  ...S(Y, {}),
586
586
  ...s
587
- }) : G(e, s), ge = (e, s = {}) => G(e, s);
587
+ }) : L(e, s), ge = (e, s = {}) => L(e, s);
588
588
  export {
589
589
  v as FormFieldType,
590
590
  ye as createForm,
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(p,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@vueuse/core"),require("zod")):typeof define=="function"&&define.amd?define(["exports","vue","@vueuse/core","zod"],r):(p=typeof globalThis<"u"?globalThis:p||self,r(p["@volverjs/form-vue"]={},p.Vue,p.VueUseCore,p.zod))})(this,function(p,r,M,x){"use strict";function $(e){return Array.isArray(e)}function U(e){return typeof e<"u"}function G(e){return e===null}function W(e){return typeof e=="object"}function _(e){return typeof e=="string"}function k(e){return typeof e>"u"}const z=/^[0-9]+$/,J=["__proto__","prototype","constructor"];function C(e,s,f){const l=U(f)?f:void 0;if(!W(e)||!_(s))return l;const a=K(s);if(a.length!==0){for(const t of a){if(t==="*")continue;const i=function(o){return o.map(u=>k(u)||G(u)?u:$(u)?i(u):u[t])};if($(e)&&!z.test(t)?e=i(e):e=e[t],k(e)||G(e))break}return k(e)?l:e}}function A(e,s,f){if(!W(e)||!_(s))return;const l=K(s);if(l.length===0)return;const a=l.length;for(let t=0;t<a;t++){const i=l[t];if(t===a-1){e[i]=f;return}if(i==="*"&&$(e)){const o=l.slice(t+1).join(".");for(const u of e)A(u,o,f);return}k(e[i])&&(e[i]={}),e=e[i]}}function K(e){const s=e.split(/[.]|(?:\[(\d|\*)\])/).filter(f=>!!f);return s.some(f=>J.indexOf(f)!==-1)?[]:s}var d=(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))(d||{}),S=(e=>(e.invalid="invalid",e.valid="valid",e))(S||{});const P=(e,s,f,l)=>r.defineComponent({name:"FieldComponent",props:{type:{type:String,validator:a=>Object.values(d).includes(a),default:d.custom},is:{type:[Object,String],default:void 0},name:{type:[String,Number,Boolean,Symbol],required:!0},props:{type:[Object,Function],default:()=>({})},showValid:{type:Boolean,default:!1},defaultValue:{type:[String,Number,Boolean,Array,Object],default:void 0},lazyLoad:{type:Boolean,default:!1}},emits:["invalid","valid","update:formData","update:modelValue"],expose:["invalid","invalidLabel","errors"],setup(a,{slots:t,emit:i}){const o=r.computed({get(){if(n!=null&&n.formData)return C(Object(n.formData.value),String(a.name))},set(c){n!=null&&n.formData&&(A(Object(n.formData.value),String(a.name),c),i("update:modelValue",{newValue:o.value,formData:n==null?void 0:n.formData}))}});r.onMounted(()=>{o.value===void 0&&a.defaultValue!==void 0&&(o.value=a.defaultValue)}),r.onBeforeUnmount(()=>{O(),g()});const u=r.inject(s,void 0);u&&u.fields.value.add(a.name);const n=r.inject(e),{props:h,name:y}=r.toRefs(a),m=r.computed(()=>{if(n!=null&&n.errors.value)return C(n.errors.value,String(a.name))}),v=r.computed(()=>{var c;return(c=m.value)==null?void 0:c._errors}),b=r.computed(()=>m.value!==void 0),O=r.watch(b,()=>{b.value?(i("invalid",v.value),u&&u.errors.value.set(a.name,{_errors:v.value})):(i("valid",o.value),u&&u.errors.value.delete(a.name))}),g=r.watch(()=>n==null?void 0:n.formData,()=>{i("update:formData",n==null?void 0:n.formData)},{deep:!0}),V=c=>{o.value=c},I=r.computed(()=>{let c=h.value;return typeof c=="function"&&(c=c(n==null?void 0:n.formData)),Object.keys(c).reduce((w,q)=>(w[q]=r.unref(c[q]),w),{})}),N=r.computed(()=>({...I.value,name:I.value.name??a.name,invalid:b.value,valid:a.showValid?!!(!b.value&&o.value):void 0,type:(c=>{if([d.text,d.number,d.email,d.password,d.tel,d.url,d.search,d.date,d.time,d.datetimeLocal,d.month,d.week,d.color].includes(c))return c})(a.type),invalidLabel:v.value,modelValue:o.value,"onUpdate:modelValue":V}));return r.provide(f,{name:r.readonly(y),errors:r.readonly(m)}),{component:r.computed(()=>{if(a.type===d.custom)return{render(){var c;return((c=t.default)==null?void 0:c.call(t,{modelValue:o.value,onUpdate:V,submit:n==null?void 0:n.submit,validate:n==null?void 0:n.validate,invalid:b.value,invalidLabel:v.value,formData:n==null?void 0:n.formData.value,formErrors:n==null?void 0:n.errors.value,errors:m.value}))??t.defalut}};if(!((l==null?void 0:l.lazyLoad)??a.lazyLoad)){let c;switch(a.type){case d.select:c=r.resolveComponent("VvSelect");break;case d.checkbox:c=r.resolveComponent("VvCheckbox");break;case d.radio:c=r.resolveComponent("VvRadio");break;case d.textarea:c=r.resolveComponent("VvTextarea");break;case d.radioGroup:c=r.resolveComponent("VvRadioGroup");break;case d.checkboxGroup:c=r.resolveComponent("VvCheckboxGroup");break;case d.combobox:c=r.resolveComponent("VvCombobox");break;default:c=r.resolveComponent("VvInputText")}if(typeof c!="string")return c;console.warn(`[form-vue warn]: ${c} not found, the component will be loaded asynchronously. To avoid this warning, please set "lazyLoad" option.`)}return r.defineAsyncComponent(async()=>{switch(l!=null&&l.sideEffects&&await Promise.resolve(l.sideEffects(a.type)),a.type){case d.textarea:return import("@volverjs/ui-vue/vv-textarea");case d.radio:return import("@volverjs/ui-vue/vv-radio");case d.radioGroup:return import("@volverjs/ui-vue/vv-radio-group");case d.checkbox:return import("@volverjs/ui-vue/vv-checkbox");case d.checkboxGroup:return import("@volverjs/ui-vue/vv-checkbox-group");case d.select:return import("@volverjs/ui-vue/vv-select");case d.combobox:return import("@volverjs/ui-vue/vv-combobox")}return import("@volverjs/ui-vue/vv-input-text")})}),hasProps:N,invalid:b}},render(){return this.is?r.h(this.is,this.hasProps,this.$slots):this.type===d.custom?r.h(this.component,null,this.$slots):r.h(this.component,this.hasProps,this.$slots)}}),B=(e,s={})=>{const f=t=>{let i=t;for(;i instanceof x.ZodEffects;)i=i.innerType();for(;i instanceof x.ZodOptional;)i=i._def.innerType;return i},l=f(e);return{...(l instanceof x.ZodObject?l._def.unknownKeys==="passthrough":!1)?s:{},...Object.fromEntries(Object.entries(l.shape).map(([t,i])=>{const o=s[t],u=f(i);let n;if(u instanceof x.ZodDefault&&(n=u._def.defaultValue()),o===null&&u instanceof x.ZodNullable)return[t,o];if(u instanceof x.ZodSchema){const h=i.safeParse(o);if(h.success)return[t,h.data??n]}return u instanceof x.ZodObject?[t,B(u,o&&typeof o=="object"?o:{})]:[t,n]}))}},T=(e,s,f)=>{const l=r.ref(),a=r.ref(),t=r.ref(),i=r.defineComponent({name:"FormComponent",props:{modelValue:{type:Object,default:()=>({})},updateThrottle:{type:Number,default:500},continuosValidation:{type:Boolean,default:!1}},emits:["invalid","valid","submit","update:modelValue"],expose:["submit","validate","errors","status","valid","invalid"],setup(o,{emit:u}){t.value=B(e,r.toRaw(o.modelValue)),r.watch(()=>o.modelValue,m=>{if(m){const v=r.isProxy(m)?r.toRaw(m):m;t.value=typeof(v==null?void 0:v.clone)=="function"?v.clone():JSON.parse(JSON.stringify(v))}},{deep:!0}),M.watchThrottled(t,m=>{((l.value||(f==null?void 0:f.continuosValidation))??o.continuosValidation)&&n(),(!m||!o.modelValue||JSON.stringify(m)!==JSON.stringify(o.modelValue))&&u("update:modelValue",m)},{deep:!0,throttle:(f==null?void 0:f.updateThrottle)??o.updateThrottle});const n=(m=t.value)=>{const v=e.safeParse(m);return v.success?(l.value=void 0,a.value=S.valid,t.value=v.data,u("update:modelValue",t.value),u("valid",v.data),!0):(l.value=v.error.format(),a.value=S.invalid,u("invalid",l.value),!1)},h=()=>n()?(u("submit",t.value),!0):!1,y=r.computed(()=>a.value===S.invalid);return r.provide(s,{formData:t,submit:h,validate:n,errors:r.readonly(l),status:r.readonly(a),invalid:y}),{formData:t,submit:h,validate:n,errors:r.readonly(l),status:r.readonly(a),invalid:y}},render(){return r.h("form",{onSubmit:r.withModifiers(this.submit,["prevent"])},{default:()=>{var o,u;return((u=(o=this.$slots)==null?void 0:o.default)==null?void 0:u.call(o,{formData:this.formData,submit:this.submit,validate:this.validate,errors:this.errors,status:this.status,invalid:this.invalid}))??this.$slots.default}})}});return{errors:l,status:a,formData:t,VvForm:i}},R=(e,s)=>r.defineComponent({name:"WrapperComponent",props:{name:{type:String,required:!0},tag:{type:String,default:void 0}},emits:["invalid","valid"],expose:["fields","invalid"],setup(l,{emit:a}){const t=r.inject(e),i=r.inject(s,void 0),o=r.ref(new Set),u=r.ref(new Map),{name:n}=r.toRefs(l);r.provide(s,{name:r.readonly(n),errors:u,fields:o}),r.watch(o,y=>{i!=null&&i.fields&&y.forEach(m=>{i==null||i.fields.value.add(m)})},{deep:!0}),r.watch(()=>new Map(u.value),(y,m)=>{i!=null&&i.errors&&(Array.from(m.keys()).forEach(v=>{i.errors.value.delete(v)}),Array.from(y.keys()).forEach(v=>{const b=y.get(v);b&&i.errors.value.set(v,b)}))},{deep:!0});const h=r.computed(()=>t!=null&&t.invalid.value?u.value.size>0:!1);return r.watch(h,()=>{h.value?a("invalid"):a("valid")}),{formData:t==null?void 0:t.formData,errors:t==null?void 0:t.errors,submit:t==null?void 0:t.submit,validate:t==null?void 0:t.validate,invalid:h,fields:o,fieldsErrors:u}},render(){var l,a;return this.tag?r.h(this.tag,null,{default:()=>{var t,i;return((i=(t=this.$slots).default)==null?void 0:i.call(t,{invalid:this.invalid,formData:this.formData,submit:this.submit,validate:this.validate,errors:this.errors,fieldsErrors:this.fieldsErrors}))??this.$slots.defalut}}):((a=(l=this.$slots).default)==null?void 0:a.call(l,{invalid:this.invalid,formData:this.formData,submit:this.submit,validate:this.validate,errors:this.errors,fieldsErrors:this.fieldsErrors}))??this.$slots.defalut}}),H=(e,s)=>{const f=r.defineComponent({props:{schema:{type:[Array,Function],required:!0}},setup(l,{slots:a}){const t=r.inject(e);if(!(t!=null&&t.formData))return;const i=typeof l.schema=="function"?l.schema(t):l.schema;let o;return()=>{var u;return i.reduce((n,h)=>{const y=typeof h=="function"?h(t):h,{vvIs:m,vvName:v,vvSlots:b,vvChildren:O,vvIf:g,vvElseIf:V,vvType:I,vvDefaultValue:N,vvShowValid:Z,...c}=y;if(g!==void 0){if(typeof g=="string"?o=!!C(Object(t.formData.value),g):typeof g=="function"?o=r.unref(g(t)):o=r.unref(g),!o)return n}else if(V!==void 0&&o!==void 0){if(o||(typeof V=="string"?o=!!C(Object(t.formData.value),V):typeof V=="function"?o=r.unref(V(t)):o=r.unref(V),!o))return n}else o=void 0;const w=O?r.h(f,{schema:O}):void 0;return v?(n.push(r.h(s,{name:v,is:m,type:I,defaultValue:N,showValid:Z,props:c},b??w)),n):m?(n.push(r.h(m,c,b??w)),n):(O&&n.push(w),n)},[(u=a==null?void 0:a.default)==null?void 0:u.call(a,{formData:t==null?void 0:t.formData.value,submit:t==null?void 0:t.submit,validate:t==null?void 0:t.validate,errors:t==null?void 0:t.errors.value,status:t==null?void 0:t.status.value,invalid:t==null?void 0:t.invalid.value})])}}});return f},E=(e,s={})=>{const f=Symbol(),l=Symbol(),a=Symbol(),{VvForm:t,errors:i,status:o,formData:u}=T(e,f,s),n=R(f,l),h=P(f,l,a,s),y=H(f,h);return{VvForm:t,VvFormWrapper:n,VvFormField:h,VvFormTemplate:y,formInjectionKey:f,formWrapperInjectionKey:l,formFieldInjectionKey:a,errors:i,status:o,formData:u}},L=Symbol(),Q=e=>{let s={};return e.schema&&(s=E(e.schema,e)),{...s,install(f,{global:l=!1}={}){f.provide(L,e),l&&(f.config.globalProperties.$vvForm=e,s!=null&&s.VvForm&&f.component("VvForm",s.VvForm),s!=null&&s.VvFormWrapper&&f.component("VvFormWrapper",s.VvFormWrapper),s!=null&&s.VvFormField&&f.component("VvFormField",s.VvFormField),s!=null&&s.VvFormTemplate&&f.component("VvFormTemplate",s.VvFormTemplate))}}},X=(e,s={})=>r.getCurrentInstance()?E(e,{...r.inject(L,{}),...s}):E(e,s),Y=(e,s={})=>E(e,s);p.FormFieldType=d,p.createForm=Q,p.defaultObjectBySchema=B,p.formFactory=Y,p.pluginInjectionKey=L,p.useForm=X,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
1
+ (function(p,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@vueuse/core"),require("zod")):typeof define=="function"&&define.amd?define(["exports","vue","@vueuse/core","zod"],r):(p=typeof globalThis<"u"?globalThis:p||self,r(p["@volverjs/form-vue"]={},p.Vue,p.VueUseCore,p.zod))})(this,function(p,r,M,x){"use strict";function $(e){return Array.isArray(e)}function U(e){return typeof e<"u"}function L(e){return e===null}function W(e){return typeof e=="object"}function _(e){return typeof e=="string"}function k(e){return typeof e>"u"}const z=/^[0-9]+$/,J=["__proto__","prototype","constructor"];function C(e,s,f){const l=U(f)?f:void 0;if(!W(e)||!_(s))return l;const a=K(s);if(a.length!==0){for(const t of a){if(t==="*")continue;const i=function(o){return o.map(u=>k(u)||L(u)?u:$(u)?i(u):u[t])};if($(e)&&!z.test(t)?e=i(e):e=e[t],k(e)||L(e))break}return k(e)?l:e}}function A(e,s,f){if(!W(e)||!_(s))return;const l=K(s);if(l.length===0)return;const a=l.length;for(let t=0;t<a;t++){const i=l[t];if(t===a-1){e[i]=f;return}if(i==="*"&&$(e)){const o=l.slice(t+1).join(".");for(const u of e)A(u,o,f);return}k(e[i])&&(e[i]={}),e=e[i]}}function K(e){const s=e.split(/[.]|(?:\[(\d|\*)\])/).filter(f=>!!f);return s.some(f=>J.indexOf(f)!==-1)?[]:s}var d=(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))(d||{}),S=(e=>(e.invalid="invalid",e.valid="valid",e))(S||{});const P=(e,s,f,l)=>r.defineComponent({name:"FieldComponent",props:{type:{type:String,validator:a=>Object.values(d).includes(a),default:d.custom},is:{type:[Object,String],default:void 0},name:{type:[String,Number,Boolean,Symbol],required:!0},props:{type:[Object,Function],default:()=>({})},showValid:{type:Boolean,default:!1},defaultValue:{type:[String,Number,Boolean,Array,Object],default:void 0},lazyLoad:{type:Boolean,default:!1}},emits:["invalid","valid","update:formData","update:modelValue"],expose:["invalid","invalidLabel","errors"],setup(a,{slots:t,emit:i}){const o=r.computed({get(){if(n!=null&&n.formData)return C(Object(n.formData.value),String(a.name))},set(c){n!=null&&n.formData&&(A(Object(n.formData.value),String(a.name),c),i("update:modelValue",{newValue:o.value,formData:n==null?void 0:n.formData}))}});r.onMounted(()=>{o.value===void 0&&a.defaultValue!==void 0&&(o.value=a.defaultValue)}),r.onBeforeUnmount(()=>{O(),g()});const u=r.inject(s,void 0);u&&u.fields.value.add(a.name);const n=r.inject(e),{props:h,name:y}=r.toRefs(a),m=r.computed(()=>{if(n!=null&&n.errors.value)return C(n.errors.value,String(a.name))}),v=r.computed(()=>{var c;return(c=m.value)==null?void 0:c._errors}),b=r.computed(()=>m.value!==void 0),O=r.watch(b,()=>{b.value?(i("invalid",v.value),u&&u.errors.value.set(a.name,{_errors:v.value})):(i("valid",o.value),u&&u.errors.value.delete(a.name))}),g=r.watch(()=>n==null?void 0:n.formData,()=>{i("update:formData",n==null?void 0:n.formData)},{deep:!0}),V=c=>{o.value=c},I=r.computed(()=>{let c=h.value;return typeof c=="function"&&(c=c(n==null?void 0:n.formData)),Object.keys(c).reduce((w,q)=>(w[q]=r.unref(c[q]),w),{})}),G=r.computed(()=>({...I.value,name:I.value.name??a.name,invalid:b.value,valid:a.showValid?!!(!b.value&&o.value):void 0,type:(c=>{if([d.text,d.number,d.email,d.password,d.tel,d.url,d.search,d.date,d.time,d.datetimeLocal,d.month,d.week,d.color].includes(c))return c})(a.type),invalidLabel:v.value,modelValue:o.value,"onUpdate:modelValue":V}));return r.provide(f,{name:r.readonly(y),errors:r.readonly(m)}),{component:r.computed(()=>{if(a.type===d.custom)return{render(){var c;return((c=t.default)==null?void 0:c.call(t,{modelValue:o.value,onUpdate:V,submit:n==null?void 0:n.submit,validate:n==null?void 0:n.validate,invalid:b.value,invalidLabel:v.value,formData:n==null?void 0:n.formData.value,formErrors:n==null?void 0:n.errors.value,errors:m.value}))??t.defalut}};if(!((l==null?void 0:l.lazyLoad)??a.lazyLoad)){let c;switch(a.type){case d.select:c=r.resolveComponent("VvSelect");break;case d.checkbox:c=r.resolveComponent("VvCheckbox");break;case d.radio:c=r.resolveComponent("VvRadio");break;case d.textarea:c=r.resolveComponent("VvTextarea");break;case d.radioGroup:c=r.resolveComponent("VvRadioGroup");break;case d.checkboxGroup:c=r.resolveComponent("VvCheckboxGroup");break;case d.combobox:c=r.resolveComponent("VvCombobox");break;default:c=r.resolveComponent("VvInputText")}if(typeof c!="string")return c;console.warn(`[form-vue warn]: ${c} not found, the component will be loaded asynchronously. To avoid this warning, please set "lazyLoad" option.`)}return r.defineAsyncComponent(async()=>{switch(l!=null&&l.sideEffects&&await Promise.resolve(l.sideEffects(a.type)),a.type){case d.textarea:return import("@volverjs/ui-vue/vv-textarea");case d.radio:return import("@volverjs/ui-vue/vv-radio");case d.radioGroup:return import("@volverjs/ui-vue/vv-radio-group");case d.checkbox:return import("@volverjs/ui-vue/vv-checkbox");case d.checkboxGroup:return import("@volverjs/ui-vue/vv-checkbox-group");case d.select:return import("@volverjs/ui-vue/vv-select");case d.combobox:return import("@volverjs/ui-vue/vv-combobox")}return import("@volverjs/ui-vue/vv-input-text")})}),hasProps:G,invalid:b}},render(){return this.is?r.h(this.is,this.hasProps,this.$slots):this.type===d.custom?r.h(this.component,null,this.$slots):r.h(this.component,this.hasProps,this.$slots)}}),B=(e,s={})=>{const f=t=>{let i=t;for(;i instanceof x.ZodEffects;)i=i.innerType();for(;i instanceof x.ZodOptional;)i=i._def.innerType;return i},l=f(e);return{...(l instanceof x.ZodObject?l._def.unknownKeys==="passthrough":!1)?s:{},...Object.fromEntries(Object.entries(l.shape).map(([t,i])=>{const o=s[t],u=f(i);let n;if(u instanceof x.ZodDefault&&(n=u._def.defaultValue()),o===null&&u instanceof x.ZodNullable)return[t,o];if(u instanceof x.ZodSchema){const h=i.safeParse(o);if(h.success)return[t,h.data??n]}return u instanceof x.ZodObject?[t,B(u,o&&typeof o=="object"?o:{})]:[t,n]}))}},T=(e,s,f)=>{const l=r.ref(),a=r.ref(),t=r.ref(),i=r.defineComponent({name:"FormComponent",props:{modelValue:{type:Object,default:()=>({})},updateThrottle:{type:Number,default:500},continuosValidation:{type:Boolean,default:!1}},emits:["invalid","valid","submit","update:modelValue"],expose:["submit","validate","errors","status","valid","invalid"],setup(o,{emit:u}){t.value=B(e,r.toRaw(o.modelValue)),r.watch(()=>o.modelValue,m=>{if(m){const v=r.isProxy(m)?r.toRaw(m):m;t.value=typeof(v==null?void 0:v.clone)=="function"?v.clone():JSON.parse(JSON.stringify(v))}},{deep:!0}),M.watchThrottled(t,m=>{((l.value||(f==null?void 0:f.continuosValidation))??o.continuosValidation)&&n(),(!m||!o.modelValue||JSON.stringify(m)!==JSON.stringify(o.modelValue))&&u("update:modelValue",m)},{deep:!0,throttle:(f==null?void 0:f.updateThrottle)??o.updateThrottle});const n=(m=t.value)=>{const v=e.safeParse(m);return v.success?(l.value=void 0,a.value=S.valid,t.value=v.data,u("update:modelValue",t.value),u("valid",v.data),!0):(l.value=v.error.format(),a.value=S.invalid,u("invalid",l.value),!1)},h=()=>n()?(u("submit",t.value),!0):!1,y=r.computed(()=>a.value===S.invalid);return r.provide(s,{formData:t,submit:h,validate:n,errors:r.readonly(l),status:r.readonly(a),invalid:y}),{formData:t,submit:h,validate:n,errors:r.readonly(l),status:r.readonly(a),invalid:y}},render(){return r.h("form",{onSubmit:r.withModifiers(this.submit,["prevent"])},{default:()=>{var o,u;return((u=(o=this.$slots)==null?void 0:o.default)==null?void 0:u.call(o,{formData:this.formData,submit:this.submit,validate:this.validate,errors:this.errors,status:this.status,invalid:this.invalid}))??this.$slots.default}})}});return{errors:l,status:a,formData:t,VvForm:i}},R=(e,s)=>r.defineComponent({name:"WrapperComponent",props:{name:{type:String,required:!0},tag:{type:String,default:void 0}},emits:["invalid","valid"],expose:["fields","invalid"],setup(l,{emit:a}){const t=r.inject(e),i=r.inject(s,void 0),o=r.ref(new Set),u=r.ref(new Map),{name:n}=r.toRefs(l);r.provide(s,{name:r.readonly(n),errors:u,fields:o}),r.watch(o,y=>{i!=null&&i.fields&&y.forEach(m=>{i==null||i.fields.value.add(m)})},{deep:!0}),r.watch(()=>new Map(u.value),(y,m)=>{i!=null&&i.errors&&(Array.from(m.keys()).forEach(v=>{i.errors.value.delete(v)}),Array.from(y.keys()).forEach(v=>{const b=y.get(v);b&&i.errors.value.set(v,b)}))},{deep:!0});const h=r.computed(()=>t!=null&&t.invalid.value?u.value.size>0:!1);return r.watch(h,()=>{h.value?a("invalid"):a("valid")}),{formData:t==null?void 0:t.formData,errors:t==null?void 0:t.errors,submit:t==null?void 0:t.submit,validate:t==null?void 0:t.validate,invalid:h,fields:o,fieldsErrors:u}},render(){var l,a;return this.tag?r.h(this.tag,null,{default:()=>{var t,i;return((i=(t=this.$slots).default)==null?void 0:i.call(t,{invalid:this.invalid,formData:this.formData,submit:this.submit,validate:this.validate,errors:this.errors,fieldsErrors:this.fieldsErrors}))??this.$slots.defalut}}):((a=(l=this.$slots).default)==null?void 0:a.call(l,{invalid:this.invalid,formData:this.formData,submit:this.submit,validate:this.validate,errors:this.errors,fieldsErrors:this.fieldsErrors}))??this.$slots.defalut}}),H=(e,s)=>{const f=r.defineComponent({props:{schema:{type:[Array,Function],required:!0}},setup(l,{slots:a}){const t=r.inject(e);if(!(t!=null&&t.formData))return;const i=typeof l.schema=="function"?l.schema(t):l.schema;let o;return()=>{var u;return i.reduce((n,h)=>{const y=typeof h=="function"?h(t):h,{vvIs:m,vvName:v,vvSlots:b,vvChildren:O,vvIf:g,vvElseIf:V,vvType:I,vvDefaultValue:G,vvShowValid:Z,...c}=y;if(g!==void 0){if(typeof g=="string"?o=!!C(Object(t.formData.value),g):typeof g=="function"?o=r.unref(g(t)):o=r.unref(g),!o)return n}else if(V!==void 0&&o!==void 0){if(o||(typeof V=="string"?o=!!C(Object(t.formData.value),V):typeof V=="function"?o=r.unref(V(t)):o=r.unref(V),!o))return n}else o=void 0;const w=O?r.h(f,{schema:O}):void 0;return v?(n.push(r.h(s,{name:v,is:m,type:I,defaultValue:G,showValid:Z,props:c},b??w)),n):m?(n.push(r.h(m,c,b??w)),n):(O&&n.push(w),n)},[(u=a==null?void 0:a.default)==null?void 0:u.call(a,{formData:t==null?void 0:t.formData.value,submit:t==null?void 0:t.submit,validate:t==null?void 0:t.validate,errors:t==null?void 0:t.errors.value,status:t==null?void 0:t.status.value,invalid:t==null?void 0:t.invalid.value})])}}});return f},E=(e,s={})=>{const f=Symbol(),l=Symbol(),a=Symbol(),{VvForm:t,errors:i,status:o,formData:u}=T(e,f,s),n=R(f,l),h=P(f,l,a,s),y=H(f,h);return{VvForm:t,VvFormWrapper:n,VvFormField:h,VvFormTemplate:y,formInjectionKey:f,formWrapperInjectionKey:l,formFieldInjectionKey:a,errors:i,status:o,formData:u}},N=Symbol(),Q=e=>{let s={};return e.schema&&(s=E(e.schema,e)),{...s,install(f,{global:l=!1}={}){f.provide(N,e),l&&(f.config.globalProperties.$vvForm=e,s!=null&&s.VvForm&&f.component("VvForm",s.VvForm),s!=null&&s.VvFormWrapper&&f.component("VvFormWrapper",s.VvFormWrapper),s!=null&&s.VvFormField&&f.component("VvFormField",s.VvFormField),s!=null&&s.VvFormTemplate&&f.component("VvFormTemplate",s.VvFormTemplate))}}},X=(e,s={})=>r.getCurrentInstance()?E(e,{...r.inject(N,{}),...s}):E(e,s),Y=(e,s={})=>E(e,s);p.FormFieldType=d,p.createForm=Q,p.defaultObjectBySchema=B,p.formFactory=Y,p.pluginInjectionKey=N,p.useForm=X,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "bugs": {
20
20
  "url": "https://github.com/volverjs/form-vue/issues"
21
21
  },
22
- "version": "0.0.13-beta.3",
22
+ "version": "0.0.13-beta.5",
23
23
  "engines": {
24
24
  "node": ">= 16.x"
25
25
  },
@@ -35,34 +35,34 @@
35
35
  "*.d.ts"
36
36
  ],
37
37
  "dependencies": {
38
- "@vueuse/core": "^10.1.2",
39
- "@volverjs/ui-vue": "0.0.8-beta.4",
40
- "ts-dot-prop": "^2.1.2",
38
+ "@volverjs/ui-vue": "^0.0.8",
39
+ "@vueuse/core": "^10.2.1",
40
+ "ts-dot-prop": "^2.1.3",
41
41
  "vue": "^3.3.4",
42
42
  "zod": "^3.21.4"
43
43
  },
44
44
  "devDependencies": {
45
- "@playwright/experimental-ct-vue": "1.33.0",
45
+ "@playwright/experimental-ct-vue": "1.35.1",
46
46
  "@testing-library/vue": "^7.0.0",
47
- "@typescript-eslint/eslint-plugin": "^5.59.6",
48
- "@typescript-eslint/parser": "^5.59.6",
47
+ "@typescript-eslint/eslint-plugin": "^5.60.1",
48
+ "@typescript-eslint/parser": "^5.60.1",
49
49
  "@vitejs/plugin-vue": "^4.2.3",
50
- "@volverjs/style": "^0.1.10",
50
+ "@volverjs/style": "^0.1.11",
51
51
  "@vue/compiler-sfc": "^3.3.4",
52
52
  "@vue/runtime-core": "^3.3.4",
53
- "@vue/test-utils": "^2.3.2",
53
+ "@vue/test-utils": "^2.4.0",
54
54
  "copy": "^0.3.2",
55
- "eslint": "^8.40.0",
55
+ "eslint": "^8.44.0",
56
56
  "eslint-config-prettier": "^8.8.0",
57
57
  "eslint-plugin-prettier": "^4.2.1",
58
- "happy-dom": "^9.19.2",
58
+ "happy-dom": "^9.20.3",
59
59
  "prettier": "^2.8.8",
60
- "typescript": "^5.0.4",
61
- "vite": "^4.3.8",
60
+ "typescript": "^5.1.6",
61
+ "vite": "^4.3.9",
62
62
  "vite-plugin-eslint": "^1.8.1",
63
- "vite-plugin-externalize-deps": "^0.6.0",
64
- "vitest": "^0.31.1",
65
- "vue-tsc": "^1.6.5"
63
+ "vite-plugin-externalize-deps": "^0.7.0",
64
+ "vitest": "^0.32.4",
65
+ "vue-tsc": "^1.8.3"
66
66
  },
67
67
  "typesVersions": {
68
68
  "*": {
package/src/enums.ts CHANGED
@@ -8,7 +8,7 @@ export enum FormFieldType {
8
8
  search = 'search',
9
9
  date = 'date',
10
10
  time = 'time',
11
- datetimeLocal = 'datetimeLocal',
11
+ datetimeLocal = 'datetime-local',
12
12
  month = 'month',
13
13
  week = 'week',
14
14
  color = 'color',