@paragrav/rhf-utils 0.0.87 → 0.0.88
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/dist/types/client/config.d.ts +4 -4
- package/dist/types/client/index.d.ts +4 -4
- package/dist/types/client/zod/context/RhfUtilsClientForZodContextProvider.d.ts +1 -1
- package/dist/types/client/zod/createRhfUtilsClientForZod.d.ts +1 -1
- package/dist/types/devtool/LazyDevTool.d.ts +1 -1
- package/dist/types/errors/consoleErrors.d.ts +1 -1
- package/dist/types/errors/flat/getFlatFieldErrors.d.ts +1 -1
- package/dist/types/errors/flat/useRefdFieldErrorsMemo.d.ts +1 -1
- package/dist/types/errors/orphan/getOrphansFromFieldErrors.d.ts +1 -1
- package/dist/types/errors/outputErrors.d.ts +1 -1
- package/dist/types/errors/root/getRootsFromFieldErrors.d.ts +1 -1
- package/dist/types/form/Form.d.ts +2 -2
- package/dist/types/form/FormProviders.d.ts +2 -2
- package/dist/types/form/FormWithProviders.d.ts +1 -1
- package/dist/types/form/_Controller.d.ts +1 -1
- package/dist/types/form/_FormBase.d.ts +1 -1
- package/dist/types/form/useForm.d.ts +8 -8
- package/dist/types/form/useFormOptions.d.ts +2 -2
- package/dist/types/submit/error/FormSubmitError.d.ts +1 -1
- package/dist/types/submit/error/setCtxErrorsByFormSubmitError.d.ts +2 -2
- package/dist/types/submit/useResetFormOnSubmitSuccessful.d.ts +1 -1
- package/package.json +20 -20
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FormSubmitError } from '../submit/error/FormSubmitError';
|
|
2
|
-
import { UseFormOptions } from '../form/useFormOptions';
|
|
3
|
-
import { UseFormFieldsProps } from '../form/useForm';
|
|
4
|
-
import { FormChildrenSlots } from '../form/Form';
|
|
5
1
|
import { UseFormProps } from 'react-hook-form';
|
|
2
|
+
import { FormChildrenSlots } from '../form/Form';
|
|
3
|
+
import { UseFormFieldsProps } from '../form/useForm';
|
|
4
|
+
import { UseFormOptions } from '../form/useFormOptions';
|
|
5
|
+
import { FormSubmitError } from '../submit/error/FormSubmitError';
|
|
6
6
|
|
|
7
7
|
export type ClientConfig = {
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { UseFormProps, UseFormReturn } from '../form/useForm';
|
|
2
|
-
import { SafeFieldValues } from '../form/SafeFieldValues';
|
|
3
|
-
import { FormWithProvidersProps } from '../form/FormWithProviders';
|
|
4
|
-
import { ClientConfig } from './config';
|
|
5
1
|
import { Resolver } from 'react-hook-form';
|
|
2
|
+
import { ClientConfig } from './config';
|
|
3
|
+
import { FormWithProvidersProps } from '../form/FormWithProviders';
|
|
4
|
+
import { SafeFieldValues } from '../form/SafeFieldValues';
|
|
5
|
+
import { UseFormProps, UseFormReturn } from '../form/useForm';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Generic object schema type.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SafeFieldValues } from '../../form/SafeFieldValues';
|
|
2
1
|
import { z } from 'zod';
|
|
2
|
+
import { SafeFieldValues } from '../../form/SafeFieldValues';
|
|
3
3
|
|
|
4
4
|
export type ZodTypeFieldValues = z.ZodType<SafeFieldValues>;
|
|
5
5
|
declare const createRhfUtilsClientForZod: (config: import('../config').ClientConfig) => import('..').CreateRhfUtilsClient<ZodTypeFieldValues, "_input", "_output">;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FlatFieldErrors } from '../flat/types';
|
|
2
1
|
import { FieldErrors } from 'react-hook-form';
|
|
2
|
+
import { FlatFieldErrors } from '../flat/types';
|
|
3
3
|
|
|
4
4
|
declare const getOrphansFromFieldErrors: (errors: FieldErrors, parentElement: Pick<HTMLElement, 'querySelector'>) => FlatFieldErrors;
|
|
5
5
|
export default getOrphansFromFieldErrors;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FlatFieldErrors } from '../flat/types';
|
|
2
1
|
import { FieldErrors } from 'react-hook-form';
|
|
2
|
+
import { FlatFieldErrors } from '../flat/types';
|
|
3
3
|
|
|
4
4
|
declare const getRootsFromFieldErrors: (errors: FieldErrors) => FlatFieldErrors;
|
|
5
5
|
export default getRootsFromFieldErrors;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UseFormProps } from './useForm';
|
|
2
|
-
import { SafeFieldValues } from './SafeFieldValues';
|
|
3
1
|
import { default as React } from 'react';
|
|
2
|
+
import { SafeFieldValues } from './SafeFieldValues';
|
|
3
|
+
import { UseFormProps } from './useForm';
|
|
4
4
|
|
|
5
5
|
export type FormChildrenSlots = 'top' | 'bottom';
|
|
6
6
|
export type FormProps<TFieldValues extends SafeFieldValues, TTransformedValues extends SafeFieldValues> = React.PropsWithChildren<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UseFormOptions } from './useFormOptions';
|
|
2
|
-
import { SafeFieldValues } from './SafeFieldValues';
|
|
3
1
|
import { UseFormReturn } from 'react-hook-form';
|
|
2
|
+
import { SafeFieldValues } from './SafeFieldValues';
|
|
3
|
+
import { UseFormOptions } from './useFormOptions';
|
|
4
4
|
|
|
5
5
|
export type FormProvidersProps<TFieldValues extends SafeFieldValues, TTransformedValues extends SafeFieldValues> = React.PropsWithChildren<{
|
|
6
6
|
formId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UseFormProps } from './useForm';
|
|
2
1
|
import { SafeFieldValues } from './SafeFieldValues';
|
|
2
|
+
import { UseFormProps } from './useForm';
|
|
3
3
|
|
|
4
4
|
export type FormWithProvidersProps<TFieldValues extends SafeFieldValues, TTransformedValues extends SafeFieldValues> = React.PropsWithChildren<UseFormProps<TFieldValues, TTransformedValues>>;
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SafeFieldValues } from './SafeFieldValues';
|
|
2
1
|
import { ControllerProps, FieldPath } from 'react-hook-form';
|
|
2
|
+
import { SafeFieldValues } from './SafeFieldValues';
|
|
3
3
|
|
|
4
4
|
export type _ControllerProps<TFieldValues extends SafeFieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<ControllerProps<TFieldValues, TName>, 'control'>;
|
|
5
5
|
declare function _Controller<TFieldValues extends SafeFieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(props: _ControllerProps<TFieldValues, TName>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { UseFormOptions } from './useFormOptions';
|
|
2
|
-
import { SafeFieldValues } from './SafeFieldValues';
|
|
3
|
-
import { FormProvidersProps } from './FormProviders';
|
|
4
|
-
import { FormProps } from './Form';
|
|
5
|
-
import { default as _Controller } from './_Controller';
|
|
6
|
-
import { FormSubmitError } from '../submit/error/FormSubmitError';
|
|
7
|
-
import { ClientConfig } from '../client/config';
|
|
8
|
-
import { SubmitErrorHandler, UseFormProps as RhfUseFormProps, UseFormReturn as RhfUseFormReturn } from 'react-hook-form';
|
|
9
1
|
import { default as React } from 'react';
|
|
2
|
+
import { SubmitErrorHandler, UseFormProps as RhfUseFormProps, UseFormReturn as RhfUseFormReturn } from 'react-hook-form';
|
|
3
|
+
import { ClientConfig } from '../client/config';
|
|
4
|
+
import { FormSubmitError } from '../submit/error/FormSubmitError';
|
|
5
|
+
import { default as _Controller } from './_Controller';
|
|
6
|
+
import { FormProps } from './Form';
|
|
7
|
+
import { FormProvidersProps } from './FormProviders';
|
|
8
|
+
import { SafeFieldValues } from './SafeFieldValues';
|
|
9
|
+
import { UseFormOptions } from './useFormOptions';
|
|
10
10
|
|
|
11
11
|
export type UseFormFieldsProps<TFieldValues extends SafeFieldValues = SafeFieldValues, TTransformedValues extends SafeFieldValues = SafeFieldValues> = {
|
|
12
12
|
formId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Register } from '../register';
|
|
2
|
-
import { default as useResetFormAfterSubmitSuccessful } from '../submit/useResetFormOnSubmitSuccessful';
|
|
3
1
|
import { DevtoolUIProps } from '@hookform/devtools/dist/devToolUI';
|
|
2
|
+
import { default as useResetFormAfterSubmitSuccessful } from '../submit/useResetFormOnSubmitSuccessful';
|
|
3
|
+
import { Register } from '../register';
|
|
4
4
|
|
|
5
5
|
export type UseFormOptions = {
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SafeFieldValues } from '../../form/SafeFieldValues';
|
|
2
1
|
import { FieldPath } from 'react-hook-form';
|
|
2
|
+
import { SafeFieldValues } from '../../form/SafeFieldValues';
|
|
3
3
|
|
|
4
4
|
export declare class FormSubmitError<TFieldValues extends SafeFieldValues = SafeFieldValues> extends Error {
|
|
5
5
|
errors: Record<FieldPath<TFieldValues> | `root.${string}`, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FormSubmitError } from './FormSubmitError';
|
|
2
|
-
import { SafeFieldValues } from '../../form/SafeFieldValues';
|
|
3
1
|
import { UseFormReturn } from 'react-hook-form';
|
|
2
|
+
import { SafeFieldValues } from '../../form/SafeFieldValues';
|
|
3
|
+
import { FormSubmitError } from './FormSubmitError';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Handle thrown {@link FormSubmitError}.
|
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.88",
|
|
6
6
|
"description": "Integration utilities for react-hook-form.",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -26,21 +26,21 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@hookform/devtools": "
|
|
30
|
-
"@hookform/resolvers": "
|
|
31
|
-
"flat": "
|
|
32
|
-
"react": "
|
|
33
|
-
"react-dom": "
|
|
34
|
-
"react-hook-form": "
|
|
35
|
-
"zod": "
|
|
29
|
+
"@hookform/devtools": "4",
|
|
30
|
+
"@hookform/resolvers": "3",
|
|
31
|
+
"flat": "6",
|
|
32
|
+
"react": "18",
|
|
33
|
+
"react-dom": "18",
|
|
34
|
+
"react-hook-form": "7",
|
|
35
|
+
"zod": "3"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@playwright/experimental-ct-react": "^1.
|
|
39
|
-
"@playwright/test": "^1.
|
|
38
|
+
"@playwright/experimental-ct-react": "^1.44.0",
|
|
39
|
+
"@playwright/test": "^1.44.0",
|
|
40
40
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
41
|
-
"@types/node": "^20.12.
|
|
42
|
-
"@types/react": "^18.
|
|
43
|
-
"@types/react-dom": "^18.
|
|
41
|
+
"@types/node": "^20.12.11",
|
|
42
|
+
"@types/react": "^18.3.1",
|
|
43
|
+
"@types/react-dom": "^18.3.0",
|
|
44
44
|
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
|
45
45
|
"@typescript-eslint/parser": "^7.8.0",
|
|
46
46
|
"@vitejs/plugin-react": "^4.2.1",
|
|
@@ -50,18 +50,18 @@
|
|
|
50
50
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
51
51
|
"eslint-plugin-import": "^2.29.1",
|
|
52
52
|
"eslint-plugin-react": "^7.34.1",
|
|
53
|
-
"eslint-plugin-react-hooks": "^4.6.
|
|
54
|
-
"eslint-plugin-simple-import-sort": "^12.
|
|
55
|
-
"happy-dom": "^14.
|
|
53
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
54
|
+
"eslint-plugin-simple-import-sort": "^12.1.0",
|
|
55
|
+
"happy-dom": "^14.10.1",
|
|
56
56
|
"husky": "^9.0.11",
|
|
57
57
|
"lint-staged": "^15.2.2",
|
|
58
58
|
"prettier": "^3.2.5",
|
|
59
59
|
"rollup": "^4.17.2",
|
|
60
|
-
"typescript": "^5.4.
|
|
60
|
+
"typescript": "^5.4.5",
|
|
61
61
|
"vite": "^5.2.11",
|
|
62
|
-
"vite-plugin-dts": "^3.
|
|
62
|
+
"vite-plugin-dts": "^3.9.1",
|
|
63
63
|
"vite-tsconfig-paths": "^4.3.2",
|
|
64
|
-
"vitest": "^1.
|
|
64
|
+
"vitest": "^1.6.0"
|
|
65
65
|
},
|
|
66
66
|
"engines": {
|
|
67
67
|
"node": ">=20.12",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"lint": "eslint --ignore-path ./.gitignore --ext ts,tsx --report-unused-disable-directives --max-warnings 0 .",
|
|
93
93
|
"preinstall": "npx only-allow pnpm",
|
|
94
94
|
"preview": "vite preview --config vite.config.dev.ts",
|
|
95
|
-
"test": "vitest",
|
|
95
|
+
"test": "vitest run",
|
|
96
96
|
"test:ct": "playwright test -c playwright-ct.config.ts",
|
|
97
97
|
"test:ct:ui": "playwright test -c playwright-ct.config.ts --ui",
|
|
98
98
|
"tsc": "tsc",
|