@paragrav/rhf-utils 0.0.141 → 0.0.143
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 +2 -2
- package/dist/types/client/config/RhfUtilsClientConfig.d.ts +0 -1
- package/dist/types/client/config/useRhfUtilsClientConfigContext.d.ts +0 -1
- package/dist/types/client/context.d.ts +0 -1
- package/dist/types/client/index.d.ts +1 -2
- package/dist/types/client/utils.d.ts +0 -1
- package/dist/types/client/zod/RhfUtilsUseFormChildrenZodFC.d.ts +0 -1
- package/dist/types/client/zod/RhfUtilsUseFormChildrenZodProps.d.ts +0 -1
- package/dist/types/client/zod/ZodTypeFieldValues.d.ts +0 -1
- package/dist/types/client/zod/context/RhfUtilsClientForZodContextProvider.d.ts +0 -1
- package/dist/types/client/zod/context/RhfUtilsZodForm.d.ts +0 -1
- package/dist/types/client/zod/context/useRhfUtilsClientForZodContext.d.ts +0 -1
- package/dist/types/client/zod/context/useRhfUtilsZodForm.d.ts +1 -2
- package/dist/types/client/zod/createRhfUtilsClientForZod.d.ts +0 -1
- package/dist/types/devtool/LazyDevTool.d.ts +0 -1
- package/dist/types/errors/flat/FlatFieldErrorsList.d.ts +0 -1
- package/dist/types/errors/flat/context/FlatFieldErrorsContextProvider.d.ts +0 -1
- package/dist/types/errors/flat/context/FlatFieldErrorsOutputConfig.d.ts +0 -1
- package/dist/types/errors/flat/context/useFlatFieldErrorsContext.d.ts +0 -1
- package/dist/types/errors/flat/context/useFlatFieldErrorsContextOutput.d.ts +0 -1
- package/dist/types/errors/flat/filterFlatFieldErrors.d.ts +0 -1
- package/dist/types/errors/flat/flattenFieldErrors.d.ts +0 -1
- package/dist/types/errors/flat/getFlatFieldErrors.d.ts +0 -1
- package/dist/types/errors/flat/types.d.ts +0 -1
- package/dist/types/errors/isFieldErrorRefd.d.ts +0 -1
- package/dist/types/errors/isFlatFieldErrorEntryRefd.d.ts +0 -1
- package/dist/types/errors/message/FormErrorMessage.d.ts +0 -1
- package/dist/types/errors/nonfield/isNonFieldError.d.ts +0 -1
- package/dist/types/errors/orphan/getIsOrphanFormErrorWithParentElement.d.ts +0 -1
- package/dist/types/errors/orphan/getOrphansFromFlatFieldErrors.d.ts +0 -1
- package/dist/types/errors/orphan/isOrphanFormError.d.ts +0 -1
- package/dist/types/errors/output/consoleErrors.d.ts +0 -1
- package/dist/types/errors/root/isFlatFieldErrorEntryPathRoot.d.ts +0 -1
- package/dist/types/errors/trpc/makeOnSubmitTrpcClientErrorHandler.d.ts +0 -1
- package/dist/types/errors/trpc/trpcClientErrorMessageSchema.d.ts +0 -1
- package/dist/types/errors/trpc/trpcClientErrorToFormSubmitFieldErrorsSchemaTransformer.d.ts +3 -4
- package/dist/types/form/Form.d.ts +0 -1
- package/dist/types/form/FormWithProviders.d.ts +0 -1
- package/dist/types/form/RhfUtilsFormOptions.d.ts +0 -1
- package/dist/types/form/RhfUtilsFormProviders.d.ts +0 -1
- package/dist/types/form/UseRhfUtilsFormChildrenProps.d.ts +0 -1
- package/dist/types/form/UseRhfUtilsFormOnSubmitContext.d.ts +0 -1
- package/dist/types/form/UseRhfUtilsFormProps.d.ts +0 -1
- package/dist/types/form/UseRhfUtilsFormReturn.d.ts +0 -1
- package/dist/types/form/_Controller.d.ts +0 -1
- package/dist/types/form/context/group/FormGroupContextProvider.d.ts +0 -1
- package/dist/types/form/context/utils/RhfUtilsContextProvider.d.ts +0 -1
- package/dist/types/form/context/utils/useRhfUtilsContext.d.ts +0 -1
- package/dist/types/form/useRhfUtilsForm.d.ts +0 -1
- package/dist/types/form/utils/getSubmitterButtonData.d.ts +0 -1
- package/dist/types/form/utils/useFormRequestSubmit.d.ts +0 -1
- package/dist/types/form/utils/useShouldFormBlockNavigation.d.ts +0 -1
- package/dist/types/submit/error/FormSubmitError.d.ts +0 -1
- package/dist/types/submit/error/FormSubmitFieldErrors.d.ts +0 -1
- package/dist/types/submit/error/setCtxErrorsByFormSubmitFieldErrors.d.ts +0 -1
- package/dist/types/submit/useFormOnSubmitSuccessfulAndReset.d.ts +0 -1
- package/dist/types/submit/useFormOnSubmitted.d.ts +0 -1
- package/dist/types/submit/useSubmitFormOnChange.d.ts +0 -1
- package/dist/types/utils/createContext.d.ts +0 -1
- package/dist/types/utils/fixedForwardRef.d.ts +1 -2
- package/dist/types/utils/useImperativeForwardedRef.d.ts +0 -1
- package/dist/types/utils/useToggle.d.ts +0 -1
- package/package.json +4 -4
- /package/dist/esm/{main.mjs → index.mjs} +0 -0
- /package/dist/types/_exports/{main.d.ts → index.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -383,7 +383,7 @@ _If you include the marker in bulk error lists, it will defeat the purpose of th
|
|
|
383
383
|
|
|
384
384
|
## Other Features
|
|
385
385
|
|
|
386
|
-
### Form Groups _(0.
|
|
386
|
+
### Form Groups _(0.7kB min+gzip)_
|
|
387
387
|
|
|
388
388
|
Sometimes you need to group multiple forms together.
|
|
389
389
|
|
|
@@ -408,7 +408,7 @@ In children forms, there are two options. You can choose to consider form "busy"
|
|
|
408
408
|
|
|
409
409
|
Both hooks return `boolean` value indicating whether parent form is busy.
|
|
410
410
|
|
|
411
|
-
### TRPC.io Utils _(0.
|
|
411
|
+
### TRPC.io Utils _(0.4kB min+gzip)_
|
|
412
412
|
|
|
413
413
|
#### `trpcClientErrorToFormSubmitFieldErrorsSchemaTransformer`
|
|
414
414
|
|
|
@@ -3,7 +3,6 @@ import { FlatFieldErrorsOutputConfig } from '../../errors/flat/context/FlatField
|
|
|
3
3
|
import { RhfUtilsFormOptions } from '../../form/RhfUtilsFormOptions';
|
|
4
4
|
import { UseRhfUtilsFormChildrenProps } from '../../form/UseRhfUtilsFormChildrenProps';
|
|
5
5
|
import { FormSubmitFieldErrors } from '../../submit/error/FormSubmitFieldErrors';
|
|
6
|
-
|
|
7
6
|
/**
|
|
8
7
|
* Client configuration object.
|
|
9
8
|
*
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RhfUtilsClientConfig } from './RhfUtilsClientConfig';
|
|
2
|
-
|
|
3
2
|
declare const _RhfUtilsClientConfigContextProvider: import('react').Provider<RhfUtilsClientConfig | undefined>, useRhfUtilsClientConfigMaybeContext: () => RhfUtilsClientConfig | undefined;
|
|
4
3
|
export default useRhfUtilsClientConfigMaybeContext;
|
|
5
4
|
export { _RhfUtilsClientConfigContextProvider };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { CreateRhfUtilsClient, ObjectSchema } from '.';
|
|
2
|
-
|
|
3
2
|
export type RhfUtilsClientContext<TObjectSchema extends ObjectSchema<TObjectSchemaInputKey, TObjectSchemaOutputKey>, TObjectSchemaInputKey extends string, TObjectSchemaOutputKey extends string> = CreateRhfUtilsClient<TObjectSchema, TObjectSchemaInputKey, TObjectSchemaOutputKey>;
|
|
@@ -5,7 +5,6 @@ import { FormWithProvidersProps } from '../form/FormWithProviders';
|
|
|
5
5
|
import { SafeFieldValues } from '../form/SafeFieldValues';
|
|
6
6
|
import { UseRhfUtilsFormProps } from '../form/UseRhfUtilsFormProps';
|
|
7
7
|
import { UseRhfUtilsFormReturn } from '../form/UseRhfUtilsFormReturn';
|
|
8
|
-
|
|
9
8
|
/**
|
|
10
9
|
* Generic object schema type.
|
|
11
10
|
*/
|
|
@@ -15,7 +14,7 @@ export type ObjectSchema<TInputKey extends string, TOutputKey extends string> =
|
|
|
15
14
|
[key in TOutputKey]: SafeFieldValues;
|
|
16
15
|
};
|
|
17
16
|
export type CreateRhfUtilsClient<TObjectSchema extends ObjectSchema<TObjectSchemaInputKey, TObjectSchemaOutputKey>, TObjectSchemaInputKey extends string, TObjectSchemaOutputKey extends string> = {
|
|
18
|
-
useForm: <TSchema extends TObjectSchema, TSchemaInput extends SafeFieldValues = TSchema[TObjectSchemaInputKey], TSchemaOutput extends SafeFieldValues = TSchema[TObjectSchemaOutputKey]
|
|
17
|
+
useForm: <TSchema extends TObjectSchema, TSchemaInput extends SafeFieldValues = TSchema[TObjectSchemaInputKey], TSchemaOutput extends SafeFieldValues = TSchema[TObjectSchemaOutputKey]>(schema: TSchema, form: UseRhfUtilsFormProps<TSchemaInput, TSchemaOutput>) => UseRhfUtilsFormReturn<TSchemaInput, TSchemaOutput> & {
|
|
19
18
|
FormWithProviders: React.FC<React.PropsWithChildren>;
|
|
20
19
|
};
|
|
21
20
|
FormWithProviders: <TSchema extends TObjectSchema, TSchemaInput extends SafeFieldValues = TSchema[TObjectSchemaInputKey], TSchemaOutput extends SafeFieldValues = TSchema[TObjectSchemaOutputKey]>(props: {
|
|
@@ -2,7 +2,6 @@ import { RhfUtilsFormOptions } from '../form/RhfUtilsFormOptions';
|
|
|
2
2
|
import { SafeFieldValues } from '../form/SafeFieldValues';
|
|
3
3
|
import { UseRhfUtilsFormProps } from '../form/UseRhfUtilsFormProps';
|
|
4
4
|
import { RhfUtilsClientConfig } from './config/RhfUtilsClientConfig';
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* Merge {@link RhfUtilsClientConfig.defaults} with array of {@link UseRhfUtilsFormProps}'s overrides.
|
|
8
7
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UseRhfUtilsFormChildrenProps } from '../../form/UseRhfUtilsFormChildrenProps';
|
|
2
2
|
import { zodTypeInput, zodTypeOutput } from './consts';
|
|
3
3
|
import { ZodTypeFieldValues } from './ZodTypeFieldValues';
|
|
4
|
-
|
|
5
4
|
export type RhfUtilsUseFormChildrenZodProps<TSchema extends ZodTypeFieldValues> = UseRhfUtilsFormChildrenProps<TSchema[typeof zodTypeInput], TSchema[typeof zodTypeOutput]>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { UseRhfUtilsFormProps } from '../../../form/UseRhfUtilsFormProps';
|
|
2
2
|
import { zodTypeInput, zodTypeOutput } from '../consts';
|
|
3
3
|
import { ZodTypeFieldValues } from '../ZodTypeFieldValues';
|
|
4
|
-
|
|
5
4
|
type Props<TSchema extends ZodTypeFieldValues> = {
|
|
6
5
|
schema: TSchema;
|
|
7
6
|
} & UseRhfUtilsFormProps<TSchema[typeof zodTypeInput], TSchema[typeof zodTypeOutput]>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as createRhfUtilsClientForZod } from '../createRhfUtilsClientForZod';
|
|
2
|
-
|
|
3
2
|
export type RhfUtilsClientForZodContext = ReturnType<typeof createRhfUtilsClientForZod>;
|
|
4
3
|
declare const _RhfUtilsClientForZodContextProvider: import('react').Provider<import('../..').CreateRhfUtilsClient<import('../ZodTypeFieldValues').ZodTypeFieldValues, "_input", "_output"> | undefined>, useRhfUtilsClientForZodContext: () => import('../..').CreateRhfUtilsClient<import('../ZodTypeFieldValues').ZodTypeFieldValues, "_input", "_output">;
|
|
5
4
|
export default useRhfUtilsClientForZodContext;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { UseRhfUtilsFormProps } from '../../../form/UseRhfUtilsFormProps';
|
|
2
2
|
import { zodTypeInput, zodTypeOutput } from '../consts';
|
|
3
3
|
import { ZodTypeFieldValues } from '../ZodTypeFieldValues';
|
|
4
|
-
|
|
5
4
|
declare const useRhfUtilsZodForm: <TSchema extends ZodTypeFieldValues>(schema: TSchema, form: UseRhfUtilsFormProps<TSchema[typeof zodTypeInput], TSchema[typeof zodTypeOutput]>) => import('../../../form/UseRhfUtilsFormReturn').UseRhfUtilsFormReturn<TSchema["_input"], TSchema["_output"]> & {
|
|
6
|
-
FormWithProviders:
|
|
5
|
+
FormWithProviders: React.FC<React.PropsWithChildren>;
|
|
7
6
|
};
|
|
8
7
|
export default useRhfUtilsZodForm;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ZodTypeFieldValues } from './ZodTypeFieldValues';
|
|
2
|
-
|
|
3
2
|
declare const createRhfUtilsClientForZod: (config: import('../config/RhfUtilsClientConfig').RhfUtilsClientConfig) => import('..').CreateRhfUtilsClient<ZodTypeFieldValues, "_input", "_output">;
|
|
4
3
|
export default createRhfUtilsClientForZod;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RhfUtilsClientConfig } from '../../client/config/RhfUtilsClientConfig';
|
|
2
2
|
import { FormSubmitFieldErrors } from '../../submit/error/FormSubmitFieldErrors';
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* HOF that returns submit error handler for {@link RhfUtilsClientConfig.onSubmitErrorUnknown}.
|
|
6
5
|
*
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { TRPCClientErrorLike } from '@trpc/client';
|
|
2
|
-
import {
|
|
2
|
+
import { AnyTRPCRouter } from '@trpc/server';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { FormSubmitFieldErrors } from '../../submit/error/FormSubmitFieldErrors';
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* Schema that transforms {@link TRPCClientError} to RHF {@link FormSubmitFieldErrors}.
|
|
8
7
|
*/
|
|
9
|
-
declare const trpcClientErrorToFormSubmitFieldErrorsSchemaTransformer: z.ZodEffects<z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodEffects<z.ZodType<TRPCClientErrorLike<
|
|
8
|
+
declare const trpcClientErrorToFormSubmitFieldErrorsSchemaTransformer: z.ZodEffects<z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodEffects<z.ZodType<TRPCClientErrorLike<AnyTRPCRouter>, z.ZodTypeDef, TRPCClientErrorLike<AnyTRPCRouter>>, string, TRPCClientErrorLike<AnyTRPCRouter>>, unknown, TRPCClientErrorLike<AnyTRPCRouter>>, z.ZodArray<z.ZodObject<{
|
|
10
9
|
validation: z.ZodString;
|
|
11
10
|
code: z.ZodString;
|
|
12
11
|
message: z.ZodString;
|
|
@@ -24,5 +23,5 @@ declare const trpcClientErrorToFormSubmitFieldErrorsSchemaTransformer: z.ZodEffe
|
|
|
24
23
|
}>, "many">>, (readonly [string, {
|
|
25
24
|
type: string;
|
|
26
25
|
message: string;
|
|
27
|
-
}])[], TRPCClientErrorLike<
|
|
26
|
+
}])[], TRPCClientErrorLike<AnyTRPCRouter>>, FormSubmitFieldErrors, TRPCClientErrorLike<AnyTRPCRouter>>;
|
|
28
27
|
export default trpcClientErrorToFormSubmitFieldErrorsSchemaTransformer;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { SafeFieldValues } from './SafeFieldValues';
|
|
3
3
|
import { UseRhfUtilsFormProps } from './UseRhfUtilsFormProps';
|
|
4
|
-
|
|
5
4
|
export type FormChildrenSlots = 'top' | 'bottom';
|
|
6
5
|
export type FormProps<TFieldValues extends SafeFieldValues, TTransformedValues extends SafeFieldValues> = {
|
|
7
6
|
formId: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SafeFieldValues } from './SafeFieldValues';
|
|
2
2
|
import { UseRhfUtilsFormProps } from './UseRhfUtilsFormProps';
|
|
3
|
-
|
|
4
3
|
export type FormWithProvidersProps<TFieldValues extends SafeFieldValues, TTransformedValues extends SafeFieldValues> = React.PropsWithChildren<UseRhfUtilsFormProps<TFieldValues, TTransformedValues>>;
|
|
5
4
|
/**
|
|
6
5
|
* Form providers (with utils) with immediate descendent {@link Form}.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DevtoolUIProps } from '@hookform/devtools/dist/devToolUI';
|
|
2
2
|
import { UseResetFormOnSubmittedOptions } from '../submit/useResetFormOnSubmitted';
|
|
3
3
|
import { Register } from '../register';
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Options for enabling utils functionality provided by this library.
|
|
7
6
|
*
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { UseFormReturn } from 'react-hook-form';
|
|
2
2
|
import { RhfUtilsFormOptions } from './RhfUtilsFormOptions';
|
|
3
3
|
import { SafeFieldValues } from './SafeFieldValues';
|
|
4
|
-
|
|
5
4
|
export type RhfUtilsFormProvidersProps<TFieldValues extends SafeFieldValues, TTransformedValues extends SafeFieldValues> = React.PropsWithChildren<{
|
|
6
5
|
formId: string;
|
|
7
6
|
formRef: React.RefObject<HTMLFormElement>;
|
|
@@ -4,7 +4,6 @@ import { FormSubmitError } from '../submit/error/FormSubmitError';
|
|
|
4
4
|
import { default as _Controller } from './_Controller';
|
|
5
5
|
import { RhfUtilsFormOptions } from './RhfUtilsFormOptions';
|
|
6
6
|
import { SafeFieldValues } from './SafeFieldValues';
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Component props for `Children`.
|
|
10
9
|
*
|
|
@@ -3,7 +3,6 @@ import { UseFormReturn } from 'react-hook-form';
|
|
|
3
3
|
import { FormSubmitError } from '../submit/error/FormSubmitError';
|
|
4
4
|
import { RhfUtilsFormOptions } from './RhfUtilsFormOptions';
|
|
5
5
|
import { SafeFieldValues } from './SafeFieldValues';
|
|
6
|
-
|
|
7
6
|
/**
|
|
8
7
|
* Props for onSubmit other than `data` and `event`.
|
|
9
8
|
*
|
|
@@ -5,7 +5,6 @@ import { RhfUtilsFormOptions } from './RhfUtilsFormOptions';
|
|
|
5
5
|
import { SafeFieldValues } from './SafeFieldValues';
|
|
6
6
|
import { UseRhfUtilsFormChildrenProps } from './UseRhfUtilsFormChildrenProps';
|
|
7
7
|
import { UseRhfUtilsFormOnSubmitContext, UseRhfUtilsFormOnSubmitErrorContext } from './UseRhfUtilsFormOnSubmitContext';
|
|
8
|
-
|
|
9
8
|
export type UseRhfUtilsFormProps<TFieldValues extends SafeFieldValues, TTransformedValues extends SafeFieldValues> = {
|
|
10
9
|
defaultValues?: UseFormProps<TFieldValues>['defaultValues'];
|
|
11
10
|
onSubmit?: (values: TTransformedValues, context: UseRhfUtilsFormOnSubmitContext<TFieldValues, TTransformedValues>, event: React.BaseSyntheticEvent<SubmitEvent>) => MaybePromise<unknown>;
|
|
@@ -4,7 +4,6 @@ import { FormSubmitError } from '../submit/error/FormSubmitError';
|
|
|
4
4
|
import { FormProps } from './Form';
|
|
5
5
|
import { RhfUtilsFormProvidersProps } from './RhfUtilsFormProviders';
|
|
6
6
|
import { SafeFieldValues } from './SafeFieldValues';
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Return type for `useRhfUtilsForm`.
|
|
10
9
|
*
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ControllerProps, FieldPath } from 'react-hook-form';
|
|
2
2
|
import { SafeFieldValues } from './SafeFieldValues';
|
|
3
|
-
|
|
4
3
|
export type _ControllerProps<TFieldValues extends SafeFieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<ControllerProps<TFieldValues, TName>, 'control'>;
|
|
5
4
|
declare function _Controller<TFieldValues extends SafeFieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(props: _ControllerProps<TFieldValues, TName>): import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export default _Controller;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SafeFieldValues } from './SafeFieldValues';
|
|
2
2
|
import { UseRhfUtilsFormProps } from './UseRhfUtilsFormProps';
|
|
3
3
|
import { UseRhfUtilsFormReturn } from './UseRhfUtilsFormReturn';
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Core Rhf Form hook. Use `Form` in `index.ts` for most cases.
|
|
7
6
|
* Use this if you need to separate form components.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SafeFieldValues } from '../../form/SafeFieldValues';
|
|
2
2
|
import { FormSubmitFieldErrors } from './FormSubmitFieldErrors';
|
|
3
|
-
|
|
4
3
|
export declare class FormSubmitError<TFieldValues extends SafeFieldValues = SafeFieldValues> extends Error {
|
|
5
4
|
errors: FormSubmitFieldErrors<TFieldValues>;
|
|
6
5
|
constructor(errors: FormSubmitFieldErrors<TFieldValues>, message?: string);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { UseFormReturn } from 'react-hook-form';
|
|
2
2
|
import { SafeFieldValues } from '../../form/SafeFieldValues';
|
|
3
3
|
import { FormSubmitFieldErrors } from './FormSubmitFieldErrors';
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Handle thrown {@link FormSubmitError}.
|
|
7
6
|
* Add key/values as name/message to RHF context errors.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* @see https://www.totaltypescript.com/forwardref-with-generic-components
|
|
5
4
|
*/
|
|
6
|
-
declare function fixedForwardRef<T, P = object>(render:
|
|
5
|
+
declare function fixedForwardRef<T, P = object>(render: React.ForwardRefRenderFunction<T, React.PropsWithoutRef<P>>): (props: P & React.RefAttributes<T>) => React.ReactNode;
|
|
7
6
|
export default fixedForwardRef;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@paragrav/rhf-utils",
|
|
3
3
|
"author": "paragrav.dev",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.143",
|
|
6
6
|
"description": "Integration utilities for react-hook-form.",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
"dist/esm/*",
|
|
11
11
|
"dist/types/*"
|
|
12
12
|
],
|
|
13
|
-
"module": "./dist/esm/
|
|
13
|
+
"module": "./dist/esm/index.mjs",
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
16
|
"import": {
|
|
17
|
-
"default": "./dist/esm/
|
|
18
|
-
"types": "./dist/types/_exports/
|
|
17
|
+
"default": "./dist/esm/index.mjs",
|
|
18
|
+
"types": "./dist/types/_exports/index.d.ts"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"./group": {
|
|
File without changes
|
|
File without changes
|