react-hook-form 7.31.0 → 7.31.1
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.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +21 -3
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/logic/createFormControl.d.ts.map +1 -1
- package/dist/useController.d.ts.map +1 -1
- package/dist/utils/cloneObject.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/logic/setCustomValidty.d.ts +0 -3
- package/dist/logic/setCustomValidty.d.ts.map +0 -1
package/dist/index.esm.mjs
CHANGED
@@ -416,7 +416,20 @@ function useController(props) {
|
|
416
416
|
}, [name, control._fields]),
|
417
417
|
},
|
418
418
|
formState,
|
419
|
-
fieldState:
|
419
|
+
fieldState: Object.defineProperties({}, {
|
420
|
+
invalid: {
|
421
|
+
get: () => !!get(formState.errors, name),
|
422
|
+
},
|
423
|
+
isDirty: {
|
424
|
+
get: () => !!get(formState.dirtyFields, name),
|
425
|
+
},
|
426
|
+
isTouched: {
|
427
|
+
get: () => !!get(formState.touchedFields, name),
|
428
|
+
},
|
429
|
+
error: {
|
430
|
+
get: () => get(formState.errors, name),
|
431
|
+
},
|
432
|
+
}),
|
420
433
|
};
|
421
434
|
}
|
422
435
|
|
@@ -554,6 +567,12 @@ function cloneObject(data) {
|
|
554
567
|
else if (data instanceof Set) {
|
555
568
|
copy = new Set(data);
|
556
569
|
}
|
570
|
+
else if (globalThis.Blob && data instanceof Blob) {
|
571
|
+
copy = data;
|
572
|
+
}
|
573
|
+
else if (globalThis.FileList && data instanceof FileList) {
|
574
|
+
copy = data;
|
575
|
+
}
|
557
576
|
else if (isArray || isObject(data)) {
|
558
577
|
copy = isArray ? [] : {};
|
559
578
|
for (const key in data) {
|
@@ -1926,8 +1945,7 @@ function createFormControl(props = {}) {
|
|
1926
1945
|
else {
|
1927
1946
|
await executeBuildInValidation(_fields);
|
1928
1947
|
}
|
1929
|
-
if (isEmptyObject(_formState.errors)
|
1930
|
-
Object.keys(_formState.errors).every((name) => get(fieldValues, name))) {
|
1948
|
+
if (isEmptyObject(_formState.errors)) {
|
1931
1949
|
_subjects.state.next({
|
1932
1950
|
errors: {},
|
1933
1951
|
isSubmitting: true,
|