solid-hook-form 1.3.1 → 1.3.3
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 +1 -1
- package/dist/types/form.d.ts +2 -3
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
### Playground
|
|
4
4
|
|
|
5
|
-
[<img width="1171" alt="Screenshot 2025-04-05 at 15 01 47" src="https://github.com/
|
|
5
|
+
[<img width="1171" alt="Screenshot 2025-04-05 at 15 01 47" src="https://github.com/tatsmaki/solid-hook-form/blob/master/assets/demo.png" />](https://solid-hook-form.vercel.app/)
|
|
6
6
|
|
|
7
7
|
### Install
|
|
8
8
|
|
package/dist/types/form.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Rules } from './validate';
|
|
|
4
4
|
import { FieldErrors } from './errors';
|
|
5
5
|
export type FormValues = Record<string, any>;
|
|
6
6
|
export type Ref = HTMLElement | null;
|
|
7
|
-
type RegisterReturn<F extends FormValues> = {
|
|
7
|
+
export type RegisterReturn<F extends FormValues> = {
|
|
8
8
|
name: Path<F>;
|
|
9
9
|
ref(ref: Ref): void;
|
|
10
10
|
onInput(event: Event): void;
|
|
@@ -16,7 +16,7 @@ export type GetValues<F extends FormValues> = {
|
|
|
16
16
|
<N extends FieldPath<F>>(name: N): FieldPathValue<F, N>;
|
|
17
17
|
};
|
|
18
18
|
export type SetValue<F extends FormValues> = (name: Path<F>, value: FieldPathValue<F, Path<F>>) => void;
|
|
19
|
-
type SubmitCallback<F extends FormValues> = (values: F) => void;
|
|
19
|
+
export type SubmitCallback<F extends FormValues> = (values: F) => void;
|
|
20
20
|
export type OnSubmit<F extends FormValues> = (submit: SubmitCallback<F>) => (event: SubmitEvent) => void;
|
|
21
21
|
export type Reset<F extends FormValues> = (newDefaultValues?: Partial<F>) => void;
|
|
22
22
|
export type UseFormReturn<F extends FormValues = FormValues> = {
|
|
@@ -30,4 +30,3 @@ export type UseFormReturn<F extends FormValues = FormValues> = {
|
|
|
30
30
|
reset: Reset<F>;
|
|
31
31
|
};
|
|
32
32
|
export type FormFields = Record<string, Ref>;
|
|
33
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-hook-form",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/main.umd.cjs",
|
|
6
6
|
"module": "./dist/main.js",
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"solid-js": "^1.9.5"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
+
"@solidjs/testing-library": "^0.8.10",
|
|
23
|
+
"@testing-library/user-event": "^14.6.1",
|
|
24
|
+
"happy-dom": "^17.4.4",
|
|
22
25
|
"react-hook-form": "^7.55.0",
|
|
23
26
|
"typescript": "~5.7.2",
|
|
24
27
|
"vite": "^6.0.11",
|