@octanejs/formisch 0.0.16 → 0.0.17
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/package.json +6 -7
- package/src/components/Form/Form.tsrx +17 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/formisch",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -38,20 +38,20 @@
|
|
|
38
38
|
".": "./src/index.ts"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"octane": "^0.
|
|
41
|
+
"octane": "^0.11.0",
|
|
42
42
|
"valibot": "^1.4.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@formisch/react": "1.0.0-rc.0",
|
|
46
|
-
"@octanejs/testing-library": "0.1.
|
|
46
|
+
"@octanejs/testing-library": "0.1.61",
|
|
47
47
|
"@testing-library/dom": "^10.4.1",
|
|
48
48
|
"@testing-library/jest-dom": "^6.9.1",
|
|
49
49
|
"@testing-library/react": "16.3.2",
|
|
50
50
|
"@testing-library/user-event": "^14.6.1",
|
|
51
|
-
"@tsrx/react": "^0.
|
|
51
|
+
"@tsrx/react": "^0.4.5",
|
|
52
52
|
"@types/react": "^19.2.17",
|
|
53
53
|
"@types/react-dom": "^19.2.3",
|
|
54
|
-
"octane": "0.
|
|
54
|
+
"octane": "0.11.0",
|
|
55
55
|
"react": "19.2.7",
|
|
56
56
|
"react-dom": "19.2.7",
|
|
57
57
|
"valibot": "^1.4.1",
|
|
@@ -59,7 +59,6 @@
|
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"test": "vitest run --root ../.. --project formisch",
|
|
62
|
-
"test:parity": "node ../../scripts/react-parity/formisch-check.mjs"
|
|
63
|
-
"typecheck": "tsrx-tsc --noEmit -p tsconfig.json && tsrx-tsc --noEmit -p typetests/tsconfig.json"
|
|
62
|
+
"test:parity": "node ../../scripts/react-parity/formisch-check.mjs"
|
|
64
63
|
}
|
|
65
64
|
}
|
|
@@ -4,19 +4,21 @@ import type { FormStore } from '../../types/index.ts';
|
|
|
4
4
|
import type { OctaneNode } from 'octane';
|
|
5
5
|
import type { Octane } from 'octane/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
export type FormProps<TSchema extends FormSchema = FormSchema> =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
7
|
+
export type FormProps<TSchema extends FormSchema = FormSchema> = Omit<
|
|
8
|
+
Octane.FormHTMLAttributes<HTMLFormElement>,
|
|
9
|
+
'onSubmit' | 'novalidate' | 'noValidate' | 'children'
|
|
10
|
+
> & {
|
|
11
|
+
readonly of: FormStore<TSchema>;
|
|
12
|
+
readonly onSubmit: SubmitEventHandler<TSchema>;
|
|
13
|
+
readonly children?: OctaneNode;
|
|
14
|
+
};
|
|
16
15
|
|
|
17
|
-
export function Form<TSchema extends FormSchema>({
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
export function Form<TSchema extends FormSchema>({
|
|
17
|
+
of,
|
|
18
|
+
onSubmit,
|
|
19
|
+
children,
|
|
20
|
+
...other
|
|
21
|
+
}: FormProps<TSchema>) @{
|
|
20
22
|
<form
|
|
21
23
|
{...other}
|
|
22
24
|
noValidate
|
|
@@ -24,5 +26,7 @@ export function Form<TSchema extends FormSchema>({ of, onSubmit, children, ...ot
|
|
|
24
26
|
if (element) of[INTERNAL].element = element;
|
|
25
27
|
}}
|
|
26
28
|
onSubmit={handleSubmit(of, onSubmit)}
|
|
27
|
-
>
|
|
29
|
+
>
|
|
30
|
+
{children}
|
|
31
|
+
</form>
|
|
28
32
|
}
|