react-hook-form 7.19.3 → 7.20.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.
@@ -0,0 +1,3 @@
1
+ import { InternalFieldName, Names } from '../types';
2
+ declare const _default: (name: InternalFieldName, _names: Names, isBlurEvent?: boolean | undefined) => boolean;
3
+ export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: <T extends string | string[] | undefined>(name?: T | undefined, signalName?: string | undefined) => boolean;
1
+ declare const _default: <T extends string | string[] | undefined>(name?: T | undefined, signalName?: string | undefined, exact?: boolean | undefined) => boolean;
2
2
  export default _default;
@@ -164,7 +164,7 @@ export declare type Control<TFieldValues extends FieldValues = FieldValues, TCon
164
164
  action: boolean;
165
165
  watch: boolean;
166
166
  };
167
- _options: Pick<UseFormProps<TFieldValues, TContext>, 'shouldUnregister'>;
167
+ _options: UseFormProps<TFieldValues, TContext>;
168
168
  _getDirty: GetIsDirty;
169
169
  _formState: FormState<TFieldValues>;
170
170
  _updateValid: Noop;
@@ -206,6 +206,7 @@ export declare type UseFormStateProps<TFieldValues> = Partial<{
206
206
  control?: Control<TFieldValues>;
207
207
  disabled?: boolean;
208
208
  name?: FieldPath<TFieldValues> | FieldPath<TFieldValues>[] | readonly FieldPath<TFieldValues>[];
209
+ exact?: boolean;
209
210
  }>;
210
211
  export declare type UseFormStateReturn<TFieldValues> = FormState<TFieldValues>;
211
212
  export declare type UseWatchProps<TFieldValues extends FieldValues = FieldValues> = {
@@ -213,6 +214,7 @@ export declare type UseWatchProps<TFieldValues extends FieldValues = FieldValues
213
214
  disabled?: boolean;
214
215
  name?: FieldPath<TFieldValues> | FieldPath<TFieldValues>[] | readonly FieldPath<TFieldValues>[];
215
216
  control?: Control<TFieldValues>;
217
+ exact?: boolean;
216
218
  };
217
219
  export declare type FormProviderProps<TFieldValues extends FieldValues = FieldValues, TContext extends object = object> = {
218
220
  children: React.ReactNode;
@@ -3,16 +3,20 @@ export declare function useWatch<TFieldValues extends FieldValues = FieldValues>
3
3
  defaultValue?: UnpackNestedValue<DeepPartialSkipArrayKey<TFieldValues>>;
4
4
  control?: Control<TFieldValues>;
5
5
  disabled?: boolean;
6
+ exact?: boolean;
6
7
  }): UnpackNestedValue<DeepPartialSkipArrayKey<TFieldValues>>;
7
8
  export declare function useWatch<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(props: {
8
9
  name: TFieldName;
9
10
  defaultValue?: FieldPathValue<TFieldValues, TFieldName>;
10
11
  control?: Control<TFieldValues>;
11
12
  disabled?: boolean;
13
+ exact?: boolean;
12
14
  }): FieldPathValue<TFieldValues, TFieldName>;
13
- export declare function useWatch<TFieldValues extends FieldValues = FieldValues, TFieldNames extends FieldPath<TFieldValues>[] = FieldPath<TFieldValues>[]>(props: {
15
+ export declare function useWatch<TFieldValues extends FieldValues = FieldValues, TFieldNames extends readonly FieldPath<TFieldValues>[] = readonly FieldPath<TFieldValues>[]>(props: {
14
16
  name: readonly [...TFieldNames];
15
17
  defaultValue?: UnpackNestedValue<DeepPartialSkipArrayKey<TFieldValues>>;
16
18
  control?: Control<TFieldValues>;
17
19
  disabled?: boolean;
20
+ exact?: boolean;
18
21
  }): FieldPathValues<TFieldValues, TFieldNames>;
22
+ export declare function useWatch<TFieldValues extends FieldValues = FieldValues, TFieldNames extends FieldPath<TFieldValues>[] = FieldPath<TFieldValues>[]>(): FieldPathValues<TFieldValues, TFieldNames>;
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "react-hook-form",
3
3
  "description": "Performant, flexible and extensible forms library for React Hooks",
4
- "version": "7.19.3",
4
+ "version": "7.20.1",
5
+ "type": "module",
5
6
  "main": "dist/index.cjs.js",
6
7
  "module": "dist/index.esm.js",
7
8
  "umd:main": "dist/index.umd.js",
@@ -34,7 +35,7 @@
34
35
  "lint:fix": "yarn lint -- --fix",
35
36
  "type": "tsc --noEmit",
36
37
  "coverage": "jest --coverage --coverageReporters=text-lcov",
37
- "test": "jest --config ./scripts/jest/jest.config.js",
38
+ "test": "jest --config ./scripts/jest/jest.config.cjs",
38
39
  "test:coverage": "yarn test -- --coverage",
39
40
  "test:watch": "yarn test -- --onlyChanged --watch",
40
41
  "test:web": "TEST_ENV=web yarn test",
@@ -67,42 +68,42 @@
67
68
  "devDependencies": {
68
69
  "@rollup/plugin-commonjs": "^21.0.1",
69
70
  "@rollup/plugin-node-resolve": "^13.0.6",
70
- "@testing-library/jest-dom": "^5.14.1",
71
+ "@testing-library/jest-dom": "^5.15.0",
71
72
  "@testing-library/react": "^12.1.2",
72
73
  "@testing-library/react-hooks": "^7.0.2",
73
74
  "@testing-library/react-native": "^8.0.0",
74
75
  "@types/jest": "^27.0.2",
75
- "@types/react": "^17.0.31",
76
- "@types/react-native": "^0.65.10",
77
- "@typescript-eslint/eslint-plugin": "^5.1.0",
78
- "@typescript-eslint/parser": "^5.1.0",
76
+ "@types/react": "^17.0.34",
77
+ "@types/react-native": "^0.66.4",
78
+ "@typescript-eslint/eslint-plugin": "^5.3.1",
79
+ "@typescript-eslint/parser": "^5.3.1",
79
80
  "@vitejs/plugin-react-refresh": "^1.3.6",
80
81
  "babel-jest": "^27.3.1",
81
82
  "bundlesize": "^0.18.0",
82
- "cypress": "8.6.0",
83
- "eslint": "^8.0.1",
83
+ "cypress": "9.0.0",
84
+ "eslint": "^8.2.0",
84
85
  "eslint-config-prettier": "^8.3.0",
85
86
  "eslint-plugin-cypress": "^2.12.1",
86
87
  "eslint-plugin-prettier": "^4.0.0",
87
- "eslint-plugin-react": "^7.26.1",
88
- "eslint-plugin-react-hooks": "^4.2.0",
88
+ "eslint-plugin-react": "^7.27.0",
89
+ "eslint-plugin-react-hooks": "^4.3.0",
89
90
  "eslint-plugin-simple-import-sort": "^7.0.0",
90
91
  "husky": "^7.0.4",
91
92
  "jest": "^27.3.1",
92
- "lint-staged": "^11.2.3",
93
+ "lint-staged": "^12.0.1",
93
94
  "prettier": "^2.4.1",
94
95
  "react": "^17.0.1",
95
96
  "react-dom": "^17.0.1",
96
- "react-native": "^0.66.1",
97
+ "react-native": "^0.66.3",
97
98
  "react-test-renderer": "^17.0.1",
98
99
  "rimraf": "^3.0.2",
99
- "rollup": "^2.58.0",
100
+ "rollup": "^2.60.0",
100
101
  "rollup-plugin-peer-deps-external": "^2.2.4",
101
102
  "rollup-plugin-sourcemaps": "^0.6.2",
102
103
  "rollup-plugin-terser": "^7.0.2",
103
104
  "rollup-plugin-typescript2": "^0.30.0",
104
105
  "ts-jest": "^27.0.7",
105
- "typescript": "^4.4.4"
106
+ "typescript": "^4.5.2"
106
107
  },
107
108
  "resolutions": {
108
109
  "react-native/@jest/create-cache-key-function": "^27.0.2"
@@ -134,5 +135,7 @@
134
135
  "type": "opencollective",
135
136
  "url": "https://opencollective.com/react-hook-form"
136
137
  },
137
- "dependencies": {}
138
+ "engines": {
139
+ "node": ">=14.16"
140
+ }
138
141
  }