react-hook-form 7.21.1-0 → 7.22.0

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,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  declare const _default: <T, K>(values: T[], _fieldIds: React.MutableRefObject<K>, keyName: string) => (T & {
3
3
  [x: string]: any;
4
4
  })[];
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { RegisterOptions } from './validator';
3
3
  import { Control, FieldError, FieldPath, FieldPathValue, FieldValues, Noop, RefCallBack, UnpackNestedValue, UseFormStateReturn } from './';
4
4
  export declare type ControllerFieldState = {
@@ -1,5 +1,5 @@
1
1
  import { FieldValues, InternalFieldName, Ref } from './fields';
2
- import { DeepMap, DeepPartial, LiteralUnion, UnionLike } from './utils';
2
+ import { DeepMap, DeepPartial, LiteralUnion } from './utils';
3
3
  import { RegisterOptions, ValidateResult } from './validator';
4
4
  export declare type Message = string;
5
5
  export declare type MultipleFieldErrors = {
@@ -18,5 +18,5 @@ export declare type ErrorOption = {
18
18
  type?: LiteralUnion<keyof RegisterOptions, string>;
19
19
  types?: MultipleFieldErrors;
20
20
  };
21
- export declare type FieldErrors<TFieldValues extends FieldValues = FieldValues> = DeepMap<DeepPartial<UnionLike<TFieldValues>>, FieldError>;
21
+ export declare type FieldErrors<TFieldValues extends FieldValues = FieldValues> = DeepMap<DeepPartial<TFieldValues>, FieldError>;
22
22
  export declare type InternalFieldErrors = Partial<Record<InternalFieldName, FieldError>>;
@@ -1,11 +1,11 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { Subject, Subscription } from '../utils/createSubject';
3
3
  import { ErrorOption, FieldError, FieldErrors } from './errors';
4
4
  import { EventType } from './events';
5
5
  import { FieldArrayWithId } from './fieldArray';
6
6
  import { FieldRefs, FieldValue, FieldValues, InternalFieldName } from './fields';
7
7
  import { Resolver } from './resolvers';
8
- import { DeepMap, DeepPartial, FieldArrayPath, FieldPath, FieldPathValue, FieldPathValues, Noop, UnionLike } from './utils';
8
+ import { DeepMap, DeepPartial, FieldArrayPath, FieldPath, FieldPathValue, FieldPathValues, Noop } from './utils';
9
9
  import { RegisterOptions } from './validator';
10
10
  declare const $NestedValue: unique symbol;
11
11
  export declare type NestedValue<TValue extends object = object> = {
@@ -52,7 +52,7 @@ export declare type UseFormProps<TFieldValues extends FieldValues = FieldValues,
52
52
  criteriaMode: CriteriaMode;
53
53
  delayError: number;
54
54
  }>;
55
- export declare type FieldNamesMarkedBoolean<TFieldValues extends FieldValues> = DeepMap<DeepPartial<UnionLike<TFieldValues>>, true>;
55
+ export declare type FieldNamesMarkedBoolean<TFieldValues extends FieldValues> = DeepMap<DeepPartial<TFieldValues>, true>;
56
56
  export declare type FormStateProxy<TFieldValues extends FieldValues = FieldValues> = {
57
57
  isDirty: boolean;
58
58
  isValidating: boolean;
@@ -54,15 +54,4 @@ export declare type FieldArrayPathValue<TFieldValues extends FieldValues, TField
54
54
  export declare type FieldPathValues<TFieldValues extends FieldValues, TPath extends FieldPath<TFieldValues>[] | readonly FieldPath<TFieldValues>[]> = {} & {
55
55
  [K in keyof TPath]: FieldPathValue<TFieldValues, TPath[K] & FieldPath<TFieldValues>>;
56
56
  };
57
- declare type UnionKeys<T> = T extends any ? keyof T : never;
58
- declare type UnionValues<T, K> = T extends any ? K extends keyof T ? T[K] : never : never;
59
- declare type OptionalKeys<T> = T extends any ? {
60
- [K in keyof T]-?: {} extends Pick<T, K> ? K : never;
61
- }[keyof T] : never;
62
- declare type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
63
- export declare type UnionLike<T> = [T] extends [Date | FileList | File | NestedValue] ? T : [T] extends [ReadonlyArray<any>] ? {
64
- [K in keyof T]: UnionLike<T[K]>;
65
- } : [T] extends [object] ? PartialBy<{
66
- [K in UnionKeys<T>]: UnionLike<UnionValues<T, K>>;
67
- }, Exclude<UnionKeys<T>, keyof T> | OptionalKeys<T>> : T;
68
57
  export {};
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.21.1-0",
4
+ "version": "7.22.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.mjs",
7
7
  "umd:main": "dist/index.umd.js",
@@ -26,7 +26,7 @@
26
26
  "clean": "rimraf dist",
27
27
  "prebuild": "yarn clean",
28
28
  "build": "yarn build:modern",
29
- "postbuild": "rimraf dist/__tests__; node ./scripts/rollup/assert-esm-exports.mjs",
29
+ "postbuild": "rimraf dist/__tests__; node ./scripts/rollup/assert-esm-exports.mjs && node ./scripts/rollup/assert-cjs-exports.cjs",
30
30
  "build:modern": "rollup -c ./scripts/rollup/rollup.config.js",
31
31
  "build:esm": "rollup -c ./scripts/rollup/rollup.esm.config.js",
32
32
  "prettier:fix": "prettier --config .prettierrc --write \"**/*.{ts,tsx}\"",
@@ -67,20 +67,20 @@
67
67
  "devDependencies": {
68
68
  "@rollup/plugin-commonjs": "^21.0.1",
69
69
  "@rollup/plugin-node-resolve": "^13.0.6",
70
- "@testing-library/jest-dom": "^5.15.1",
70
+ "@testing-library/jest-dom": "^5.16.1",
71
71
  "@testing-library/react": "^12.1.2",
72
72
  "@testing-library/react-hooks": "^7.0.2",
73
- "@testing-library/react-native": "^8.0.0",
73
+ "@testing-library/react-native": "^9.0.0",
74
74
  "@types/jest": "^27.0.3",
75
75
  "@types/react": "^17.0.37",
76
- "@types/react-native": "^0.66.6",
77
- "@typescript-eslint/eslint-plugin": "^5.5.0",
78
- "@typescript-eslint/parser": "^5.5.0",
76
+ "@types/react-native": "^0.66.8",
77
+ "@typescript-eslint/eslint-plugin": "^5.6.0",
78
+ "@typescript-eslint/parser": "^5.6.0",
79
79
  "@vitejs/plugin-react-refresh": "^1.3.6",
80
- "babel-jest": "^27.4.2",
80
+ "babel-jest": "^27.4.4",
81
81
  "bundlesize": "^0.18.0",
82
- "cypress": "9.1.0",
83
- "eslint": "^8.3.0",
82
+ "cypress": "9.1.1",
83
+ "eslint": "^8.4.1",
84
84
  "eslint-config-prettier": "^8.3.0",
85
85
  "eslint-plugin-cypress": "^2.12.1",
86
86
  "eslint-plugin-prettier": "^4.0.0",
@@ -88,21 +88,21 @@
88
88
  "eslint-plugin-react-hooks": "^4.3.0",
89
89
  "eslint-plugin-simple-import-sort": "^7.0.0",
90
90
  "husky": "^7.0.4",
91
- "jest": "^27.4.3",
91
+ "jest": "^27.4.4",
92
92
  "lint-staged": "^12.1.2",
93
- "prettier": "^2.5.0",
93
+ "prettier": "^2.5.1",
94
94
  "react": "^17.0.1",
95
95
  "react-dom": "^17.0.1",
96
- "react-native": "^0.66.3",
96
+ "react-native": "^0.66.4",
97
97
  "react-test-renderer": "^17.0.1",
98
98
  "rimraf": "^3.0.2",
99
- "rollup": "^2.60.2",
99
+ "rollup": "^2.61.1",
100
100
  "rollup-plugin-peer-deps-external": "^2.2.4",
101
101
  "rollup-plugin-sourcemaps": "^0.6.2",
102
102
  "rollup-plugin-terser": "^7.0.2",
103
103
  "rollup-plugin-typescript2": "^0.31.1",
104
- "ts-jest": "^27.0.7",
105
- "typescript": "^4.5.2"
104
+ "ts-jest": "^27.1.1",
105
+ "typescript": "^4.5.3"
106
106
  },
107
107
  "resolutions": {
108
108
  "react-native/@jest/create-cache-key-function": "^27.0.2"