@paragrav/rhf-utils 0.0.145 → 0.0.147
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/index.d.ts +1 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ export const rhfUtilsClientConfig: RhfUtilsClientConfig = {
|
|
|
59
59
|
devTool: import.meta.env.DEV && { placement: 'top-right' },
|
|
60
60
|
},
|
|
61
61
|
|
|
62
|
-
// default form props
|
|
62
|
+
// global default native form props
|
|
63
63
|
form: {
|
|
64
64
|
noValidate: true,
|
|
65
65
|
className: 'my-form-class',
|
|
@@ -88,7 +88,7 @@ export const rhfUtilsClientConfig: RhfUtilsClientConfig = {
|
|
|
88
88
|
// form-level control of your own hooks/behaviors via custom option props
|
|
89
89
|
// (see "Extend RhfUtilsFormOptions" section for more info)
|
|
90
90
|
useMyOptionalFormHook({
|
|
91
|
-
enabled: !!options
|
|
91
|
+
enabled: !!options.enableMyOptionalFormHook,
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
return (
|
|
@@ -8,11 +8,7 @@ import { UseRhfUtilsFormReturn } from '../form/UseRhfUtilsFormReturn';
|
|
|
8
8
|
/**
|
|
9
9
|
* Generic object schema type.
|
|
10
10
|
*/
|
|
11
|
-
export type ObjectSchema<TInputKey extends string, TOutputKey extends string> =
|
|
12
|
-
[key in TInputKey]: SafeFieldValues;
|
|
13
|
-
} & {
|
|
14
|
-
[key in TOutputKey]: SafeFieldValues;
|
|
15
|
-
};
|
|
11
|
+
export type ObjectSchema<TInputKey extends string, TOutputKey extends string> = Record<TInputKey, SafeFieldValues> & Record<TOutputKey, SafeFieldValues>;
|
|
16
12
|
export type CreateRhfUtilsClient<TObjectSchema extends ObjectSchema<TObjectSchemaInputKey, TObjectSchemaOutputKey>, TObjectSchemaInputKey extends string, TObjectSchemaOutputKey extends string> = {
|
|
17
13
|
useForm: <TSchema extends TObjectSchema, TSchemaInput extends SafeFieldValues = TSchema[TObjectSchemaInputKey], TSchemaOutput extends SafeFieldValues = TSchema[TObjectSchemaOutputKey]>(schema: TSchema, form: UseRhfUtilsFormProps<TSchemaInput, TSchemaOutput>) => UseRhfUtilsFormReturn<TSchemaInput, TSchemaOutput> & {
|
|
18
14
|
FormWithProviders: React.FC<React.PropsWithChildren>;
|