react-hook-form 7.5.2-beta.0 → 7.5.2
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.js +23 -42
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/logic/getFields.d.ts +1 -1
- package/dist/logic/getFieldsValues.d.ts +1 -1
- package/dist/logic/getValueAndMessage.d.ts +1 -1
- package/dist/logic/hasValidation.d.ts +2 -2
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/validator.d.ts +1 -1
- package/dist/utils/isMessage.d.ts +1 -2
- package/package.json +1 -1
@@ -6,7 +6,7 @@ export default function getFields(fieldsNames: Set<InternalFieldName> | Internal
|
|
6
6
|
refs?: HTMLInputElement[] | undefined;
|
7
7
|
mount?: boolean | undefined;
|
8
8
|
} & Partial<{
|
9
|
-
required:
|
9
|
+
required: string | import("../types").ValidationRule<boolean>;
|
10
10
|
min: import("../types").ValidationRule<string | number>;
|
11
11
|
max: import("../types").ValidationRule<string | number>;
|
12
12
|
maxLength: import("../types").ValidationRule<string | number>;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { FieldRefs, FieldValues } from '../types';
|
3
|
-
declare const getFieldsValues: (fieldsRef: React.MutableRefObject<FieldRefs>, defaultValuesRef?:
|
3
|
+
declare const getFieldsValues: (fieldsRef: React.MutableRefObject<FieldRefs>, defaultValuesRef?: FieldValues | undefined, output?: Record<string, any>) => any;
|
4
4
|
export default getFieldsValues;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ValidationRule } from '../types';
|
2
|
-
declare const _default: (validationData?: ValidationRule<import("../types").ValidationValue> | undefined) =>
|
2
|
+
declare const _default: (validationData?: ValidationRule<import("../types").ValidationValue> | undefined) => {
|
3
3
|
value: string | number | boolean | RegExp | undefined;
|
4
4
|
message: string;
|
5
5
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
declare const _default: <T extends Partial<{
|
2
|
-
required:
|
2
|
+
required: string | import("../types").ValidationRule<boolean>;
|
3
3
|
min: import("../types").ValidationRule<string | number>;
|
4
4
|
max: import("../types").ValidationRule<string | number>;
|
5
5
|
maxLength: import("../types").ValidationRule<string | number>;
|
@@ -10,5 +10,5 @@ declare const _default: <T extends Partial<{
|
|
10
10
|
valueAsDate: boolean;
|
11
11
|
setValueAs: (value: any) => any;
|
12
12
|
shouldUnregister?: boolean | undefined;
|
13
|
-
}>>(options?: T | undefined, mounted?: boolean | undefined) => boolean |
|
13
|
+
}>>(options?: T | undefined, mounted?: boolean | undefined) => boolean | import("../types").ValidationValueMessage<boolean> | import("../types").ValidationRule<string | number> | import("../types").ValidationRule<RegExp> | import("../types").Validate<any> | Record<string, import("../types").Validate<any>> | undefined;
|
14
14
|
export default _default;
|
package/dist/types/errors.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { FieldValues, InternalFieldName, Ref } from './fields';
|
2
2
|
import { DeepMap, LiteralUnion } from './utils';
|
3
3
|
import { RegisterOptions, ValidateResult } from './validator';
|
4
|
-
export declare type Message = string
|
4
|
+
export declare type Message = string;
|
5
5
|
export declare type MultipleFieldErrors = {
|
6
6
|
[K in keyof RegisterOptions]?: ValidateResult;
|
7
7
|
} & {
|
@@ -7,7 +7,7 @@ export declare type ValidationValueMessage<TValidationValue extends ValidationVa
|
|
7
7
|
value: TValidationValue;
|
8
8
|
message: Message;
|
9
9
|
};
|
10
|
-
export declare type ValidateResult = Message | boolean | undefined;
|
10
|
+
export declare type ValidateResult = Message | Message[] | boolean | undefined;
|
11
11
|
export declare type Validate<TFieldValue> = (value: TFieldValue) => ValidateResult | Promise<ValidateResult>;
|
12
12
|
export declare type RegisterOptions<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Partial<{
|
13
13
|
required: Message | ValidationRule<boolean>;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-hook-form",
|
3
3
|
"description": "Performant, flexible and extensible forms library for React Hooks",
|
4
|
-
"version": "7.5.2
|
4
|
+
"version": "7.5.2",
|
5
5
|
"main": "dist/index.cjs.js",
|
6
6
|
"module": "dist/index.esm.js",
|
7
7
|
"umd:main": "dist/index.umd.js",
|