@formisch/react 0.4.2 → 0.4.4
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/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +13 -13
- package/LICENSE.md +0 -9
package/dist/index.d.ts
CHANGED
|
@@ -1033,7 +1033,7 @@ type FormProps<TSchema extends Schema = Schema> = Omit<FormHTMLAttributes<HTMLFo
|
|
|
1033
1033
|
/**
|
|
1034
1034
|
* The submit handler called when the form is submitted and validation succeeds.
|
|
1035
1035
|
*/
|
|
1036
|
-
readonly onSubmit:
|
|
1036
|
+
readonly onSubmit: SubmitEventHandler<TSchema>;
|
|
1037
1037
|
};
|
|
1038
1038
|
/**
|
|
1039
1039
|
* Form component that manages form submission and applies internal state.
|
package/dist/index.js
CHANGED
|
@@ -116,10 +116,10 @@ function untrack(fn) {
|
|
|
116
116
|
*/
|
|
117
117
|
function initializeFieldStore(internalFieldStore, schema, initialInput, path, nullish = false) {
|
|
118
118
|
if (framework === "qwik" && schema.type === "lazy" || schema.type === "object_with_rest" || schema.type === "record" || schema.type === "tuple_with_rest" || schema.type === "promise") throw new Error(`"${schema.type}" schema is not supported`);
|
|
119
|
-
else if (schema.type === "lazy") initializeFieldStore(internalFieldStore, schema.getter(void 0), initialInput, path);
|
|
119
|
+
else if (schema.type === "lazy") initializeFieldStore(internalFieldStore, schema.getter(void 0), initialInput, path, nullish);
|
|
120
120
|
else if (schema.type === "exact_optional" || schema.type === "nullable" || schema.type === "nullish" || schema.type === "optional" || schema.type === "undefinedable") initializeFieldStore(internalFieldStore, schema.wrapped, initialInput === void 0 ? v.getDefault(schema) : initialInput, path, true);
|
|
121
121
|
else if (schema.type === "non_nullable" || schema.type === "non_nullish" || schema.type === "non_optional") initializeFieldStore(internalFieldStore, schema.wrapped, initialInput, path);
|
|
122
|
-
else if (schema.type === "intersect" || schema.type === "union" || schema.type === "variant") for (const schemaOption of schema.options) initializeFieldStore(internalFieldStore, schemaOption, initialInput, path);
|
|
122
|
+
else if (schema.type === "intersect" || schema.type === "union" || schema.type === "variant") for (const schemaOption of schema.options) initializeFieldStore(internalFieldStore, schemaOption, initialInput, path, nullish);
|
|
123
123
|
else {
|
|
124
124
|
internalFieldStore.schema = schema;
|
|
125
125
|
internalFieldStore.name = JSON.stringify(path);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formisch/react",
|
|
3
3
|
"description": "The modular and type-safe form library for React",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Fabian Hiller",
|
|
7
7
|
"homepage": "https://formisch.dev",
|
|
@@ -32,7 +32,17 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsdown",
|
|
37
|
+
"lint": "eslint \"src/**/*.ts*\" && tsc --noEmit",
|
|
38
|
+
"lint.fix": "eslint \"src/**/*.ts*\" --fix",
|
|
39
|
+
"format": "prettier --write ./src",
|
|
40
|
+
"format.check": "prettier --check ./src"
|
|
41
|
+
},
|
|
35
42
|
"devDependencies": {
|
|
43
|
+
"@formisch/core": "workspace:*",
|
|
44
|
+
"@formisch/eslint-config": "workspace:*",
|
|
45
|
+
"@formisch/methods": "workspace:*",
|
|
36
46
|
"@types/node": "^24.10.1",
|
|
37
47
|
"@types/react": "^19.2.5",
|
|
38
48
|
"@types/react-dom": "^19.2.3",
|
|
@@ -45,10 +55,7 @@
|
|
|
45
55
|
"react-dom": "^19.2.1",
|
|
46
56
|
"tsdown": "^0.16.8",
|
|
47
57
|
"typescript": "~5.9.3",
|
|
48
|
-
"vite": "^7.2.4"
|
|
49
|
-
"@formisch/core": "0.6.2",
|
|
50
|
-
"@formisch/methods": "0.7.0",
|
|
51
|
-
"@formisch/eslint-config": "0.1.0"
|
|
58
|
+
"vite": "^7.2.4"
|
|
52
59
|
},
|
|
53
60
|
"peerDependencies": {
|
|
54
61
|
"react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
@@ -60,12 +67,5 @@
|
|
|
60
67
|
"typescript": {
|
|
61
68
|
"optional": true
|
|
62
69
|
}
|
|
63
|
-
},
|
|
64
|
-
"scripts": {
|
|
65
|
-
"build": "tsdown",
|
|
66
|
-
"lint": "eslint \"src/**/*.ts*\" && tsc --noEmit",
|
|
67
|
-
"lint.fix": "eslint \"src/**/*.ts*\" --fix",
|
|
68
|
-
"format": "prettier --write ./src",
|
|
69
|
-
"format.check": "prettier --check ./src"
|
|
70
70
|
}
|
|
71
|
-
}
|
|
71
|
+
}
|
package/LICENSE.md
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Fabian Hiller
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|