@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 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?.enableMyOptionalFormHook,
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>;
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.145",
5
+ "version": "0.0.147",
6
6
  "description": "Integration utilities for react-hook-form.",
7
7
  "type": "module",
8
8
  "sideEffects": false,