react-hook-form 7.57.0-next.0 → 7.58.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.
- package/README.md +8 -4
- package/dist/__typetest__/form.test-d.d.ts +1 -1
- package/dist/__typetest__/form.test-d.d.ts.map +1 -1
- package/dist/controller.d.ts +1 -1
- package/dist/controller.d.ts.map +1 -1
- package/dist/form.d.ts +1 -1
- package/dist/form.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +116 -107
- 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/appendErrors.d.ts +1 -1
- package/dist/logic/appendErrors.d.ts.map +1 -1
- package/dist/logic/createFormControl.d.ts +1 -1
- package/dist/logic/createFormControl.d.ts.map +1 -1
- package/dist/logic/generateId.d.ts.map +1 -1
- package/dist/logic/generateWatchOutput.d.ts +1 -1
- package/dist/logic/generateWatchOutput.d.ts.map +1 -1
- package/dist/logic/getFieldValue.d.ts +1 -1
- package/dist/logic/getFieldValue.d.ts.map +1 -1
- package/dist/logic/getFieldValueAs.d.ts +1 -1
- package/dist/logic/getFieldValueAs.d.ts.map +1 -1
- package/dist/logic/getFocusFieldName.d.ts +1 -1
- package/dist/logic/getFocusFieldName.d.ts.map +1 -1
- package/dist/logic/getProxyFormState.d.ts +1 -1
- package/dist/logic/getProxyFormState.d.ts.map +1 -1
- package/dist/logic/getResolverOptions.d.ts +1 -1
- package/dist/logic/getResolverOptions.d.ts.map +1 -1
- package/dist/logic/getRuleValue.d.ts +1 -1
- package/dist/logic/getRuleValue.d.ts.map +1 -1
- package/dist/logic/getValidateError.d.ts +1 -1
- package/dist/logic/getValidateError.d.ts.map +1 -1
- package/dist/logic/getValidationModes.d.ts +1 -1
- package/dist/logic/getValidationModes.d.ts.map +1 -1
- package/dist/logic/getValueAndMessage.d.ts +1 -1
- package/dist/logic/getValueAndMessage.d.ts.map +1 -1
- package/dist/logic/hasPromiseValidation.d.ts +1 -1
- package/dist/logic/hasPromiseValidation.d.ts.map +1 -1
- package/dist/logic/hasValidation.d.ts +1 -1
- package/dist/logic/hasValidation.d.ts.map +1 -1
- package/dist/logic/isNameInFieldArray.d.ts +1 -1
- package/dist/logic/isNameInFieldArray.d.ts.map +1 -1
- package/dist/logic/isWatched.d.ts +1 -1
- package/dist/logic/isWatched.d.ts.map +1 -1
- package/dist/logic/iterateFieldsByAction.d.ts +1 -1
- package/dist/logic/iterateFieldsByAction.d.ts.map +1 -1
- package/dist/logic/schemaErrorLookup.d.ts +1 -1
- package/dist/logic/schemaErrorLookup.d.ts.map +1 -1
- package/dist/logic/shouldRenderFormState.d.ts +1 -1
- package/dist/logic/shouldRenderFormState.d.ts.map +1 -1
- package/dist/logic/shouldSubscribeByName.d.ts +1 -1
- package/dist/logic/shouldSubscribeByName.d.ts.map +1 -1
- package/dist/logic/skipValidation.d.ts +1 -1
- package/dist/logic/skipValidation.d.ts.map +1 -1
- package/dist/logic/updateFieldArrayRootError.d.ts +1 -1
- package/dist/logic/updateFieldArrayRootError.d.ts.map +1 -1
- package/dist/logic/validateField.d.ts +1 -1
- package/dist/logic/validateField.d.ts.map +1 -1
- package/dist/react-server.esm.mjs +30 -16
- package/dist/react-server.esm.mjs.map +1 -1
- package/dist/types/controller.d.ts +3 -3
- package/dist/types/controller.d.ts.map +1 -1
- package/dist/types/errors.d.ts +3 -3
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/fieldArray.d.ts +4 -4
- package/dist/types/fieldArray.d.ts.map +1 -1
- package/dist/types/fields.d.ts +2 -2
- package/dist/types/fields.d.ts.map +1 -1
- package/dist/types/form.d.ts +25 -22
- package/dist/types/form.d.ts.map +1 -1
- package/dist/types/path/common.d.ts +1 -1
- package/dist/types/path/common.d.ts.map +1 -1
- package/dist/types/path/eager.d.ts +16 -3
- package/dist/types/path/eager.d.ts.map +1 -1
- package/dist/types/path/index.d.ts +1 -1
- package/dist/types/path/index.d.ts.map +1 -1
- package/dist/types/resolvers.d.ts +3 -3
- package/dist/types/resolvers.d.ts.map +1 -1
- package/dist/types/utils.d.ts +1 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/dist/types/validator.d.ts +4 -4
- package/dist/types/validator.d.ts.map +1 -1
- package/dist/useController.d.ts +1 -1
- package/dist/useController.d.ts.map +1 -1
- package/dist/useFieldArray.d.ts +1 -1
- package/dist/useFieldArray.d.ts.map +1 -1
- package/dist/useForm.d.ts +1 -1
- package/dist/useForm.d.ts.map +1 -1
- package/dist/useFormContext.d.ts +1 -1
- package/dist/useFormContext.d.ts.map +1 -1
- package/dist/useFormState.d.ts +1 -1
- package/dist/useFormState.d.ts.map +1 -1
- package/dist/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/dist/useWatch.d.ts +1 -92
- package/dist/useWatch.d.ts.map +1 -1
- package/dist/utils/createSubject.d.ts +1 -1
- package/dist/utils/createSubject.d.ts.map +1 -1
- package/dist/utils/flatten.d.ts +1 -1
- package/dist/utils/flatten.d.ts.map +1 -1
- package/dist/utils/get.d.ts.map +1 -1
- package/dist/utils/isCheckBoxInput.d.ts +1 -1
- package/dist/utils/isCheckBoxInput.d.ts.map +1 -1
- package/dist/utils/isEmptyObject.d.ts +1 -1
- package/dist/utils/isEmptyObject.d.ts.map +1 -1
- package/dist/utils/isFileInput.d.ts +1 -1
- package/dist/utils/isFileInput.d.ts.map +1 -1
- package/dist/utils/isMessage.d.ts +1 -1
- package/dist/utils/isMessage.d.ts.map +1 -1
- package/dist/utils/isMultipleSelect.d.ts +1 -1
- package/dist/utils/isMultipleSelect.d.ts.map +1 -1
- package/dist/utils/isPrimitive.d.ts +1 -1
- package/dist/utils/isPrimitive.d.ts.map +1 -1
- package/dist/utils/isRadioInput.d.ts +1 -1
- package/dist/utils/isRadioInput.d.ts.map +1 -1
- package/dist/utils/isRadioOrCheckbox.d.ts +1 -1
- package/dist/utils/isRadioOrCheckbox.d.ts.map +1 -1
- package/dist/utils/live.d.ts +1 -1
- package/dist/utils/live.d.ts.map +1 -1
- package/dist/utils/set.d.ts +1 -1
- package/dist/utils/set.d.ts.map +1 -1
- package/package.json +14 -14
- package/dist/useDeepEqualEffect.d.ts +0 -3
- package/dist/useDeepEqualEffect.d.ts.map +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import { InternalFieldErrors, InternalFieldName, ValidateResult } from '../types';
|
1
|
+
import type { InternalFieldErrors, InternalFieldName, ValidateResult } from '../types';
|
2
2
|
declare const _default: (name: InternalFieldName, validateAllFieldCriteria: boolean, errors: InternalFieldErrors, type: string, message: ValidateResult) => {};
|
3
3
|
export default _default;
|
4
4
|
//# sourceMappingURL=appendErrors.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"appendErrors.d.ts","sourceRoot":"","sources":["../../src/logic/appendErrors.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"appendErrors.d.ts","sourceRoot":"","sources":["../../src/logic/appendErrors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACf,MAAM,UAAU,CAAC;yBAGhB,MAAM,iBAAiB,EACvB,0BAA0B,OAAO,EACjC,QAAQ,mBAAmB,EAC3B,MAAM,MAAM,EACZ,SAAS,cAAc;AALzB,wBAeS"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FieldValues, UseFormProps, UseFormReturn } from '../types';
|
1
|
+
import type { FieldValues, UseFormProps, UseFormReturn } from '../types';
|
2
2
|
export declare function createFormControl<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues = TFieldValues>(props?: UseFormProps<TFieldValues, TContext, TTransformedValues>): Omit<UseFormReturn<TFieldValues, TContext, TTransformedValues>, 'formState'> & {
|
3
3
|
formControl: Omit<UseFormReturn<TFieldValues, TContext, TTransformedValues>, 'formState'>;
|
4
4
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createFormControl.d.ts","sourceRoot":"","sources":["../../src/logic/createFormControl.ts"],"names":[],"mappings":"AACA,OAAO,
|
1
|
+
{"version":3,"file":"createFormControl.d.ts","sourceRoot":"","sources":["../../src/logic/createFormControl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAaV,WAAW,EAgBX,YAAY,EAIZ,aAAa,EAUd,MAAM,UAAU,CAAC;AAoDlB,wBAAgB,iBAAiB,CAC/B,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,QAAQ,GAAG,GAAG,EACd,kBAAkB,GAAG,YAAY,EAEjC,KAAK,GAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAM,GACnE,IAAI,CACL,aAAa,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EACzD,WAAW,CACZ,GAAG;IACF,WAAW,EAAE,IAAI,CACf,aAAa,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EACzD,WAAW,CACZ,CAAC;CACH,CAg6CA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generateId.d.ts","sourceRoot":"","sources":["../../src/logic/generateId.ts"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"generateId.d.ts","sourceRoot":"","sources":["../../src/logic/generateId.ts"],"names":[],"mappings":";AAEA,wBAaE"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { DeepPartial, FieldValues, Names } from '../types';
|
1
|
+
import type { DeepPartial, FieldValues, Names } from '../types';
|
2
2
|
declare const _default: <T>(names: string | string[] | undefined, _names: Names, formValues?: FieldValues, isGlobal?: boolean, defaultValue?: DeepPartial<T> | unknown) => any;
|
3
3
|
export default _default;
|
4
4
|
//# sourceMappingURL=generateWatchOutput.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generateWatchOutput.d.ts","sourceRoot":"","sources":["../../src/logic/generateWatchOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"generateWatchOutput.d.ts","sourceRoot":"","sources":["../../src/logic/generateWatchOutput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;yBAIhD,CAAC,EACf,OAAO,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EACpC,QAAQ,KAAK,EACb,aAAa,WAAW,EACxB,WAAW,OAAO,EAClB,eAAe,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO;AALzC,wBAuBE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getFieldValue.d.ts","sourceRoot":"","sources":["../../src/logic/getFieldValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"getFieldValue.d.ts","sourceRoot":"","sources":["../../src/logic/getFieldValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAWtC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,OAoBpD"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Field, NativeFieldValue } from '../types';
|
1
|
+
import type { Field, NativeFieldValue } from '../types';
|
2
2
|
declare const _default: <T extends NativeFieldValue>(value: T, { valueAsNumber, valueAsDate, setValueAs }: Field["_f"]) => any;
|
3
3
|
export default _default;
|
4
4
|
//# sourceMappingURL=getFieldValueAs.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getFieldValueAs.d.ts","sourceRoot":"","sources":["../../src/logic/getFieldValueAs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"getFieldValueAs.d.ts","sourceRoot":"","sources":["../../src/logic/getFieldValueAs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;yBAIxC,CAAC,SAAS,gBAAgB,EACxC,OAAO,CAAC,EACR,4CAA4C,KAAK,CAAC,IAAI,CAAC;AAFzD,wBAgBkB"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FieldArrayMethodProps, InternalFieldName } from '../types';
|
1
|
+
import type { FieldArrayMethodProps, InternalFieldName } from '../types';
|
2
2
|
declare const _default: (name: InternalFieldName, index: number, options?: FieldArrayMethodProps) => string;
|
3
3
|
export default _default;
|
4
4
|
//# sourceMappingURL=getFocusFieldName.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getFocusFieldName.d.ts","sourceRoot":"","sources":["../../src/logic/getFocusFieldName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"getFocusFieldName.d.ts","sourceRoot":"","sources":["../../src/logic/getFocusFieldName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;yBAIvE,MAAM,iBAAiB,EACvB,OAAO,MAAM,EACb,UAAS,qBAA0B,KAClC,MAAM;AAJT,wBAQS"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Control, FieldValues, FormState, ReadFormState } from '../types';
|
1
|
+
import type { Control, FieldValues, FormState, ReadFormState } from '../types';
|
2
2
|
declare const _default: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(formState: FormState<TFieldValues>, control: Control<TFieldValues, TContext, TTransformedValues>, localProxyFormState?: ReadFormState, isRoot?: boolean) => FormState<TFieldValues>;
|
3
3
|
export default _default;
|
4
4
|
//# sourceMappingURL=getProxyFormState.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getProxyFormState.d.ts","sourceRoot":"","sources":["../../src/logic/getProxyFormState.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"getProxyFormState.d.ts","sourceRoot":"","sources":["../../src/logic/getProxyFormState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;yBAG7E,YAAY,SAAS,WAAW,EAChC,QAAQ,GAAG,GAAG,EACd,kBAAkB,GAAG,YAAY,EAEjC,WAAW,SAAS,CAAC,YAAY,CAAC,EAClC,SAAS,OAAO,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EAC5D,sBAAsB,aAAa,EACnC,gBAAa;AARf,wBA8BE"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CriteriaMode, FieldName, FieldRefs, FieldValues, InternalFieldName } from '../types';
|
1
|
+
import type { CriteriaMode, FieldName, FieldRefs, FieldValues, InternalFieldName } from '../types';
|
2
2
|
declare const _default: <TFieldValues extends FieldValues>(fieldsNames: Set<InternalFieldName> | InternalFieldName[], _fields: FieldRefs, criteriaMode?: CriteriaMode, shouldUseNativeValidation?: boolean | undefined) => {
|
3
3
|
criteriaMode: CriteriaMode | undefined;
|
4
4
|
names: FieldName<TFieldValues>[];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getResolverOptions.d.ts","sourceRoot":"","sources":["../../src/logic/getResolverOptions.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"getResolverOptions.d.ts","sourceRoot":"","sources":["../../src/logic/getResolverOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,SAAS,EACT,SAAS,EACT,WAAW,EACX,iBAAiB,EAClB,MAAM,UAAU,CAAC;yBAIF,YAAY,SAAS,WAAW,EAC9C,aAAa,GAAG,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,EAAE,EACzD,SAAS,SAAS,EAClB,eAAe,YAAY,EAC3B,4BAA4B,OAAO,GAAG,SAAS;;WAYlB,SAAS,CAAC,YAAY,CAAC,EAAE;;;;;;;;;AAhBxD,wBAoBE"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ValidationRule, ValidationValue, ValidationValueMessage } from '../types';
|
1
|
+
import type { ValidationRule, ValidationValue, ValidationValueMessage } from '../types';
|
2
2
|
declare const _default: <T extends ValidationValue>(rule?: ValidationRule<T> | ValidationValueMessage<T>) => string | T | undefined;
|
3
3
|
export default _default;
|
4
4
|
//# sourceMappingURL=getRuleValue.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getRuleValue.d.ts","sourceRoot":"","sources":["../../src/logic/getRuleValue.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"getRuleValue.d.ts","sourceRoot":"","sources":["../../src/logic/getRuleValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,sBAAsB,EACvB,MAAM,UAAU,CAAC;yBAKF,CAAC,SAAS,eAAe,EACvC,OAAO,cAAc,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC;AADtD,wBAWe"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { FieldError, Ref, ValidateResult } from '../types';
|
1
|
+
import type { FieldError, Ref, ValidateResult } from '../types';
|
2
2
|
export default function getValidateError(result: ValidateResult, ref: Ref, type?: string): FieldError | void;
|
3
3
|
//# sourceMappingURL=getValidateError.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getValidateError.d.ts","sourceRoot":"","sources":["../../src/logic/getValidateError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"getValidateError.d.ts","sourceRoot":"","sources":["../../src/logic/getValidateError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAIhE,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,GAAG,EACR,IAAI,SAAa,GAChB,UAAU,GAAG,IAAI,CAYnB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getValidationModes.d.ts","sourceRoot":"","sources":["../../src/logic/getValidationModes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"getValidationModes.d.ts","sourceRoot":"","sources":["../../src/logic/getValidationModes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;yBAE1C,OAAO,IAAI,KAAG,mBAAmB;AAAjD,wBAMG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getValueAndMessage.d.ts","sourceRoot":"","sources":["../../src/logic/getValueAndMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"getValueAndMessage.d.ts","sourceRoot":"","sources":["../../src/logic/getValueAndMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;yBAI/B,iBAAiB,cAAc;;;;AAA/C,wBAMQ"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hasPromiseValidation.d.ts","sourceRoot":"","sources":["../../src/logic/hasPromiseValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAY,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"hasPromiseValidation.d.ts","sourceRoot":"","sources":["../../src/logic/hasPromiseValidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAY,MAAM,UAAU,CAAC;yBAMhC,gBAAgB,KAAK,CAAC,IAAI,CAAC;AAA3C,wBAWI"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Field } from '../types';
|
1
|
+
import type { Field } from '../types';
|
2
2
|
declare const _default: (options: Field["_f"]) => string | number | boolean | import("../types").ValidationValueMessage<boolean> | import("../types").ValidationValueMessage<string | number> | import("../types").ValidationRule<RegExp> | import("../types").Validate<any, import("../types").FieldValues> | Record<string, import("../types").Validate<any, import("../types").FieldValues>> | undefined;
|
3
3
|
export default _default;
|
4
4
|
//# sourceMappingURL=hasValidation.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hasValidation.d.ts","sourceRoot":"","sources":["../../src/logic/hasValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"hasValidation.d.ts","sourceRoot":"","sources":["../../src/logic/hasValidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;yBAEtB,SAAS,KAAK,CAAC,IAAI,CAAC;AAApC,wBAQsB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"isNameInFieldArray.d.ts","sourceRoot":"","sources":["../../src/logic/isNameInFieldArray.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"isNameInFieldArray.d.ts","sourceRoot":"","sources":["../../src/logic/isNameInFieldArray.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;yBAIlC,OAAO,GAAG,CAAC,iBAAiB,CAAC,EAAE,MAAM,iBAAiB;AAAtE,wBACqC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { InternalFieldName, Names } from '../types';
|
1
|
+
import type { InternalFieldName, Names } from '../types';
|
2
2
|
declare const _default: (name: InternalFieldName, _names: Names, isBlurEvent?: boolean) => boolean;
|
3
3
|
export default _default;
|
4
4
|
//# sourceMappingURL=isWatched.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"isWatched.d.ts","sourceRoot":"","sources":["../../src/logic/isWatched.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"isWatched.d.ts","sourceRoot":"","sources":["../../src/logic/isWatched.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;yBAGvD,MAAM,iBAAiB,EACvB,QAAQ,KAAK,EACb,cAAc,OAAO;AAHvB,wBAYO"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FieldRefs, InternalFieldName, Ref } from '../types';
|
1
|
+
import type { FieldRefs, InternalFieldName, Ref } from '../types';
|
2
2
|
declare const iterateFieldsByAction: (fields: FieldRefs, action: (ref: Ref, name: string) => 1 | undefined | void, fieldsNames?: Set<InternalFieldName> | InternalFieldName[] | 0, abortEarly?: boolean) => true | undefined;
|
3
3
|
export default iterateFieldsByAction;
|
4
4
|
//# sourceMappingURL=iterateFieldsByAction.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"iterateFieldsByAction.d.ts","sourceRoot":"","sources":["../../src/logic/iterateFieldsByAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"iterateFieldsByAction.d.ts","sourceRoot":"","sources":["../../src/logic/iterateFieldsByAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAIlE,QAAA,MAAM,qBAAqB,GACzB,QAAQ,SAAS,EACjB,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC,GAAG,SAAS,GAAG,IAAI,EACxD,cAAc,GAAG,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,EAAE,GAAG,CAAC,EAC9D,aAAa,OAAO,qBA0BrB,CAAC;AACF,eAAe,qBAAqB,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FieldError, FieldErrors, FieldValues } from '../types';
|
1
|
+
import type { FieldError, FieldErrors, FieldValues } from '../types';
|
2
2
|
export default function schemaErrorLookup<T extends FieldValues = FieldValues>(errors: FieldErrors<T>, _fields: FieldValues, name: string): {
|
3
3
|
error?: FieldError;
|
4
4
|
name: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schemaErrorLookup.d.ts","sourceRoot":"","sources":["../../src/logic/schemaErrorLookup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"schemaErrorLookup.d.ts","sourceRoot":"","sources":["../../src/logic/schemaErrorLookup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIrE,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAC3E,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,EACtB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,MAAM,GACX;IACD,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAyCA"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FieldValues, FormState, InternalFieldName, ReadFormState } from '../types';
|
1
|
+
import type { FieldValues, FormState, InternalFieldName, ReadFormState } from '../types';
|
2
2
|
declare const _default: <T extends FieldValues, K extends ReadFormState>(formStateData: Partial<FormState<T>> & {
|
3
3
|
name?: InternalFieldName;
|
4
4
|
values?: T;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"shouldRenderFormState.d.ts","sourceRoot":"","sources":["../../src/logic/shouldRenderFormState.ts"],"names":[],"mappings":"AACA,OAAO,
|
1
|
+
{"version":3,"file":"shouldRenderFormState.d.ts","sourceRoot":"","sources":["../../src/logic/shouldRenderFormState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,aAAa,EACd,MAAM,UAAU,CAAC;yBAGF,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,aAAa,EAC5D,eAAe,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG;IACrC,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,CAAC;CACZ,EACD,iBAAiB,CAAC,EAClB,iBAAiB,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAC3D,SAAS,OAAO;AAPlB,wBAqBE"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
declare const _default: <T extends string | string[] | undefined>(name?: T, signalName?: string, exact?: boolean) => boolean;
|
1
|
+
declare const _default: <T extends string | readonly string[] | undefined>(name?: T, signalName?: string, exact?: boolean) => boolean;
|
2
2
|
export default _default;
|
3
3
|
//# sourceMappingURL=shouldSubscribeByName.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"shouldSubscribeByName.d.ts","sourceRoot":"","sources":["../../src/logic/shouldSubscribeByName.ts"],"names":[],"mappings":"yBAEgB,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,
|
1
|
+
{"version":3,"file":"shouldSubscribeByName.d.ts","sourceRoot":"","sources":["../../src/logic/shouldSubscribeByName.ts"],"names":[],"mappings":"yBAEgB,CAAC,SAAS,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,EAC9D,OAAO,CAAC,EACR,aAAa,MAAM,EACnB,QAAQ,OAAO;AAHjB,wBAeI"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"skipValidation.d.ts","sourceRoot":"","sources":["../../src/logic/skipValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"skipValidation.d.ts","sourceRoot":"","sources":["../../src/logic/skipValidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;yBAGlD,aAAa,OAAO,EACpB,WAAW,OAAO,EAClB,aAAa,OAAO,EACpB,gBAAgB;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;CACrB,EACD,MAAM,OAAO,CAAC,mBAAmB,CAAC;AARpC,wBAoBE"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FieldError, FieldErrors, FieldValues, InternalFieldName } from '../types';
|
1
|
+
import type { FieldError, FieldErrors, FieldValues, InternalFieldName } from '../types';
|
2
2
|
declare const _default: <T extends FieldValues = FieldValues>(errors: FieldErrors<T>, error: Partial<Record<string, FieldError>>, name: InternalFieldName) => FieldErrors<T>;
|
3
3
|
export default _default;
|
4
4
|
//# sourceMappingURL=updateFieldArrayRootError.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"updateFieldArrayRootError.d.ts","sourceRoot":"","sources":["../../src/logic/updateFieldArrayRootError.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"updateFieldArrayRootError.d.ts","sourceRoot":"","sources":["../../src/logic/updateFieldArrayRootError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,iBAAiB,EAClB,MAAM,UAAU,CAAC;yBAKF,CAAC,SAAS,WAAW,GAAG,WAAW,EACjD,QAAQ,WAAW,CAAC,CAAC,CAAC,EACtB,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,EAC1C,MAAM,iBAAiB,KACtB,WAAW,CAAC,CAAC,CAAC;AAJjB,wBASE"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Field, FieldValues, InternalFieldErrors, InternalNameSet } from '../types';
|
1
|
+
import type { Field, FieldValues, InternalFieldErrors, InternalNameSet } from '../types';
|
2
2
|
declare const _default: <T extends FieldValues>(field: Field, disabledFieldNames: InternalNameSet, formValues: T, validateAllFieldCriteria: boolean, shouldUseNativeValidation?: boolean, isFieldArray?: boolean) => Promise<InternalFieldErrors>;
|
3
3
|
export default _default;
|
4
4
|
//# sourceMappingURL=validateField.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"validateField.d.ts","sourceRoot":"","sources":["../../src/logic/validateField.ts"],"names":[],"mappings":"AACA,OAAO,
|
1
|
+
{"version":3,"file":"validateField.d.ts","sourceRoot":"","sources":["../../src/logic/validateField.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EAEL,WAAW,EACX,mBAAmB,EACnB,eAAe,EAKhB,MAAM,UAAU,CAAC;yBAsBI,CAAC,SAAS,WAAW,EACzC,OAAO,KAAK,EACZ,oBAAoB,eAAe,EACnC,YAAY,CAAC,EACb,0BAA0B,OAAO,EACjC,4BAA4B,OAAO,EACnC,eAAe,OAAO,KACrB,OAAO,CAAC,mBAAmB,CAAC;AAP/B,wBA6PE"}
|
@@ -142,13 +142,17 @@ function deepEqual(object1, object2) {
|
|
142
142
|
return true;
|
143
143
|
}
|
144
144
|
|
145
|
+
var isKey = (value) => /^\w*$/.test(value);
|
146
|
+
|
145
147
|
var isUndefined = (val) => val === undefined;
|
146
148
|
|
149
|
+
var stringToPath = (input) => compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));
|
150
|
+
|
147
151
|
var get = (object, path, defaultValue) => {
|
148
152
|
if (!path || !isObject(object)) {
|
149
153
|
return defaultValue;
|
150
154
|
}
|
151
|
-
const result =
|
155
|
+
const result = (isKey(path) ? [path] : stringToPath(path)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], object);
|
152
156
|
return isUndefined(result) || result === object
|
153
157
|
? isUndefined(object[path])
|
154
158
|
? defaultValue
|
@@ -185,10 +189,6 @@ var isString = (value) => typeof value === 'string';
|
|
185
189
|
|
186
190
|
var live = (ref) => isHTMLElement(ref) && ref.isConnected;
|
187
191
|
|
188
|
-
var isKey = (value) => /^\w*$/.test(value);
|
189
|
-
|
190
|
-
var stringToPath = (input) => compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));
|
191
|
-
|
192
192
|
var set = (object, path, value) => {
|
193
193
|
let index = -1;
|
194
194
|
const tempPath = isKey(path) ? [path] : stringToPath(path);
|
@@ -498,6 +498,12 @@ function schemaErrorLookup(errors, _fields, name) {
|
|
498
498
|
error: foundError,
|
499
499
|
};
|
500
500
|
}
|
501
|
+
if (foundError && foundError.root && foundError.root.type) {
|
502
|
+
return {
|
503
|
+
name: `${fieldName}.root`,
|
504
|
+
error: foundError.root,
|
505
|
+
};
|
506
|
+
}
|
501
507
|
names.pop();
|
502
508
|
}
|
503
509
|
return {
|
@@ -776,7 +782,7 @@ function createFormControl(props = {}) {
|
|
776
782
|
};
|
777
783
|
const _fields = {};
|
778
784
|
let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values)
|
779
|
-
? cloneObject(_options.
|
785
|
+
? cloneObject(_options.defaultValues || _options.values) || {}
|
780
786
|
: {};
|
781
787
|
let _formValues = _options.shouldUnregister
|
782
788
|
? {}
|
@@ -811,8 +817,6 @@ function createFormControl(props = {}) {
|
|
811
817
|
array: createSubject(),
|
812
818
|
state: createSubject(),
|
813
819
|
};
|
814
|
-
const validationModeBeforeSubmit = getValidationModes(_options.mode);
|
815
|
-
const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);
|
816
820
|
const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;
|
817
821
|
const debounce = (callback) => (wait) => {
|
818
822
|
clearTimeout(timer);
|
@@ -1083,13 +1087,17 @@ function createFormControl(props = {}) {
|
|
1083
1087
|
}
|
1084
1088
|
else if (fieldReference.refs) {
|
1085
1089
|
if (isCheckBoxInput(fieldReference.ref)) {
|
1086
|
-
fieldReference.refs.
|
1087
|
-
|
1088
|
-
(
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1090
|
+
fieldReference.refs.forEach((checkboxRef) => {
|
1091
|
+
if (!checkboxRef.defaultChecked || !checkboxRef.disabled) {
|
1092
|
+
if (Array.isArray(fieldValue)) {
|
1093
|
+
checkboxRef.checked = !!fieldValue.find((data) => data === checkboxRef.value);
|
1094
|
+
}
|
1095
|
+
else {
|
1096
|
+
checkboxRef.checked =
|
1097
|
+
fieldValue === checkboxRef.value || !!fieldValue;
|
1098
|
+
}
|
1099
|
+
}
|
1100
|
+
});
|
1093
1101
|
}
|
1094
1102
|
else {
|
1095
1103
|
fieldReference.refs.forEach((radioRef) => (radioRef.checked = radioRef.value === fieldValue));
|
@@ -1115,8 +1123,11 @@ function createFormControl(props = {}) {
|
|
1115
1123
|
};
|
1116
1124
|
const setValues = (name, value, options) => {
|
1117
1125
|
for (const fieldKey in value) {
|
1126
|
+
if (!value.hasOwnProperty(fieldKey)) {
|
1127
|
+
return;
|
1128
|
+
}
|
1118
1129
|
const fieldValue = value[fieldKey];
|
1119
|
-
const fieldName =
|
1130
|
+
const fieldName = name + '.' + fieldKey;
|
1120
1131
|
const field = get(_fields, fieldName);
|
1121
1132
|
(_names.array.has(name) ||
|
1122
1133
|
isObject(fieldValue) ||
|
@@ -1171,6 +1182,8 @@ function createFormControl(props = {}) {
|
|
1171
1182
|
(isDateObject(fieldValue) && isNaN(fieldValue.getTime())) ||
|
1172
1183
|
deepEqual(fieldValue, get(_formValues, name, fieldValue));
|
1173
1184
|
};
|
1185
|
+
const validationModeBeforeSubmit = getValidationModes(_options.mode);
|
1186
|
+
const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);
|
1174
1187
|
if (field) {
|
1175
1188
|
let error;
|
1176
1189
|
let isValid;
|
@@ -1713,6 +1726,7 @@ function createFormControl(props = {}) {
|
|
1713
1726
|
setError,
|
1714
1727
|
_subscribe,
|
1715
1728
|
_runSchema,
|
1729
|
+
_focusError,
|
1716
1730
|
_getWatch,
|
1717
1731
|
_getDirty,
|
1718
1732
|
_setValid,
|