@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.
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/dist/index.es.js +161 -164
- package/dist/index.umd.js +1 -1
- package/dist/src/VvForm.d.ts +86 -127
- package/dist/src/VvFormField.d.ts +5 -5
- package/dist/src/VvFormTemplate.d.ts +23 -55
- package/dist/src/VvFormWrapper.d.ts +46 -81
- package/dist/src/index.d.ts +491 -815
- package/dist/src/utils.d.ts +1 -1
- package/package.json +24 -24
- package/src/VvForm.ts +4 -6
- package/src/VvFormField.ts +5 -6
package/dist/src/utils.d.ts
CHANGED
|
@@ -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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
39
|
-
"@vueuse/core": "^10.
|
|
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.
|
|
41
|
+
"vue": "^3.4.21",
|
|
42
42
|
"zod": "^3.22.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@playwright/experimental-ct-vue": "1.
|
|
46
|
-
"@testing-library/vue": "^8.0.
|
|
47
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
48
|
-
"@vitejs/plugin-vue": "^
|
|
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.
|
|
51
|
-
"@vue/eslint-config-typescript": "^
|
|
52
|
-
"@vue/runtime-core": "^3.
|
|
53
|
-
"@vue/test-utils": "^2.4.
|
|
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.
|
|
56
|
-
"eslint-config-prettier": "^9.
|
|
57
|
-
"eslint-plugin-prettier": "^5.
|
|
58
|
-
"eslint-plugin-vue": "^9.
|
|
59
|
-
"happy-dom": "^
|
|
60
|
-
"prettier": "^3.
|
|
61
|
-
"typescript": "^5.3
|
|
62
|
-
"vite": "^5.
|
|
63
|
-
"vite-plugin-dts": "^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.
|
|
66
|
-
"vitest": "^
|
|
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
|
-
|
|
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
|
})
|
package/src/VvFormField.ts
CHANGED
|
@@ -191,14 +191,11 @@ export const defineFormField = <Schema extends FormSchema>(
|
|
|
191
191
|
)
|
|
192
192
|
})
|
|
193
193
|
const isReadonly = computed(() => {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (fieldReadonly === undefined) {
|
|
197
|
-
return injectedFormData?.readonly.value
|
|
194
|
+
if (injectedFormData?.readonly.value) {
|
|
195
|
+
return true
|
|
198
196
|
}
|
|
199
|
-
return
|
|
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 {
|