@volverjs/form-vue 1.0.0-beta.7 → 1.0.0-beta.9

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.
@@ -1,3 +1,3 @@
1
1
  import { type z } from 'zod';
2
2
  import type { FormSchema } from './types';
3
- export declare const defaultObjectBySchema: <Schema extends FormSchema>(schema: Schema, original?: Partial<z.TypeOf<Schema>> & Record<string, unknown>) => Partial<z.TypeOf<Schema>>;
3
+ export declare const defaultObjectBySchema: <Schema extends FormSchema>(schema: Schema, original?: Partial<z.infer<Schema>> & Record<string, unknown>) => Partial<z.infer<Schema>>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@volverjs/form-vue",
3
3
  "description": "Vue 3 Forms with @volverjs/ui-vue",
4
- "author": "24/Consulting",
4
+ "author": "8 Wave",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "form",
@@ -19,7 +19,7 @@
19
19
  "bugs": {
20
20
  "url": "https://github.com/volverjs/form-vue/issues"
21
21
  },
22
- "version": "1.0.0-beta.7",
22
+ "version": "1.0.0-beta.9",
23
23
  "engines": {
24
24
  "node": ">= 16.x"
25
25
  },
@@ -35,35 +35,35 @@
35
35
  "*.d.ts"
36
36
  ],
37
37
  "dependencies": {
38
- "@volverjs/ui-vue": "^0.0.9",
39
- "@vueuse/core": "^10.6.1",
38
+ "@volverjs/ui-vue": "0.0.10-beta.29",
39
+ "@vueuse/core": "^10.9.0",
40
40
  "ts-dot-prop": "^2.1.3",
41
- "vue": "^3.3.8",
41
+ "vue": "^3.4.21",
42
42
  "zod": "^3.22.4"
43
43
  },
44
44
  "devDependencies": {
45
- "@playwright/experimental-ct-vue": "1.40.0",
46
- "@testing-library/vue": "^8.0.1",
47
- "@typescript-eslint/eslint-plugin": "^6.12.0",
48
- "@vitejs/plugin-vue": "^4.5.0",
45
+ "@playwright/experimental-ct-vue": "1.42.1",
46
+ "@testing-library/vue": "^8.0.3",
47
+ "@typescript-eslint/eslint-plugin": "^7.3.1",
48
+ "@vitejs/plugin-vue": "^5.0.4",
49
49
  "@volverjs/style": "^0.1.11",
50
- "@vue/compiler-sfc": "^3.3.8",
51
- "@vue/eslint-config-typescript": "^12.0.0",
52
- "@vue/runtime-core": "^3.3.8",
53
- "@vue/test-utils": "^2.4.2",
50
+ "@vue/compiler-sfc": "^3.4.21",
51
+ "@vue/eslint-config-typescript": "^13.0.0",
52
+ "@vue/runtime-core": "^3.4.21",
53
+ "@vue/test-utils": "^2.4.5",
54
54
  "copy": "^0.3.2",
55
- "eslint": "^8.54.0",
56
- "eslint-config-prettier": "^9.0.0",
57
- "eslint-plugin-prettier": "^5.0.1",
58
- "eslint-plugin-vue": "^9.18.1",
59
- "happy-dom": "^12.10.3",
60
- "prettier": "^3.1.0",
61
- "typescript": "^5.3.2",
62
- "vite": "^5.0.2",
63
- "vite-plugin-dts": "^3.6.3",
55
+ "eslint": "^8.57.0",
56
+ "eslint-config-prettier": "^9.1.0",
57
+ "eslint-plugin-prettier": "^5.1.3",
58
+ "eslint-plugin-vue": "^9.23.0",
59
+ "happy-dom": "^14.3.1",
60
+ "prettier": "^3.2.5",
61
+ "typescript": "^5.4.3",
62
+ "vite": "^5.2.2",
63
+ "vite-plugin-dts": "^3.7.3",
64
64
  "vite-plugin-eslint": "^1.8.1",
65
- "vite-plugin-externalize-deps": "^0.7.0",
66
- "vitest": "^0.34.6"
65
+ "vite-plugin-externalize-deps": "^0.8.0",
66
+ "vitest": "^1.4.0"
67
67
  },
68
68
  "typesVersions": {
69
69
  "*": {
package/src/VvForm.ts CHANGED
@@ -202,12 +202,10 @@ export const defineForm = <Schema extends FormSchema>(
202
202
  }
203
203
  })
204
204
 
205
+ // readonly
205
206
  onMounted(() => {
206
- if (props.readonly && !readonly.value) {
207
- readonly.value = props.readonly
208
- }
207
+ readonly.value = props.readonly
209
208
  })
210
-
211
209
  watch(
212
210
  () => props.readonly,
213
211
  (newValue) => {
@@ -273,10 +271,10 @@ export const defineForm = <Schema extends FormSchema>(
273
271
  default: defaultSlot,
274
272
  },
275
273
  ),
276
- ]
274
+ ]
277
275
  : {
278
276
  default: defaultSlot,
279
- },
277
+ },
280
278
  )
281
279
  },
282
280
  })
@@ -191,14 +191,11 @@ export const defineFormField = <Schema extends FormSchema>(
191
191
  )
192
192
  })
193
193
  const isReadonly = computed(() => {
194
- const fieldReadonly =
195
- hasFieldProps.value.readonly ?? props.readonly
196
- if (fieldReadonly === undefined) {
197
- return injectedFormData?.readonly.value
194
+ if (injectedFormData?.readonly.value) {
195
+ return true
198
196
  }
199
- return fieldReadonly
197
+ return hasFieldProps.value.readonly ?? props.readonly
200
198
  })
201
-
202
199
  const hasProps = computed(() => ({
203
200
  ...hasFieldProps.value,
204
201
  name: hasFieldProps.value.name ?? props.name,
@@ -234,11 +231,13 @@ export const defineFormField = <Schema extends FormSchema>(
234
231
  'onUpdate:modelValue': onUpdate,
235
232
  }))
236
233
 
234
+ // provide data to children
237
235
  provide(formFieldInjectionKey, {
238
236
  name: readonly(fieldName as Ref<string>),
239
237
  errors: readonly(errors),
240
238
  })
241
239
 
240
+ // load component
242
241
  const component = computed(() => {
243
242
  if (props.type === FormFieldType.custom) {
244
243
  return {