@formisch/svelte 0.5.4 → 0.5.6
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 +2 -1
- package/dist/core/index.svelte.d.ts +1 -1
- package/dist/core/index.svelte.js +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Formisch is a schema-based, headless form library for Svelte. It manages form state and validation. It is type-safe, fast by default and its bundle size is small due to its modular design. Try it out in our [playground](https://stackblitz.com/edit/formisch-playground-svelte)!
|
|
4
4
|
|
|
5
|
-
Formisch is also available for [Preact][formisch-preact], [Qwik][formisch-qwik], [SolidJS][formisch-solid], and [Vue][formisch-vue].
|
|
5
|
+
Formisch is also available for [Preact][formisch-preact], [Qwik][formisch-qwik], [React][formisch-react], [SolidJS][formisch-solid], and [Vue][formisch-vue].
|
|
6
6
|
|
|
7
7
|
## Highlights
|
|
8
8
|
|
|
@@ -77,5 +77,6 @@ This project is available free of charge and licensed under the [MIT license](ht
|
|
|
77
77
|
|
|
78
78
|
[formisch-preact]: https://github.com/open-circle/formisch/tree/main/frameworks/preact
|
|
79
79
|
[formisch-qwik]: https://github.com/open-circle/formisch/tree/main/frameworks/qwik
|
|
80
|
+
[formisch-react]: https://github.com/open-circle/formisch/tree/main/frameworks/react
|
|
80
81
|
[formisch-solid]: https://github.com/open-circle/formisch/tree/main/frameworks/solid
|
|
81
82
|
[formisch-vue]: https://github.com/open-circle/formisch/tree/main/frameworks/vue
|
|
@@ -547,7 +547,7 @@ declare function validateIfRequired(internalFormStore: InternalFormStore, intern
|
|
|
547
547
|
/**
|
|
548
548
|
* Framework type.
|
|
549
549
|
*/
|
|
550
|
-
type Framework = "preact" | "qwik" | "solid" | "svelte" | "vue";
|
|
550
|
+
type Framework = "preact" | "qwik" | "solid" | "svelte" | "vanilla" | "vue";
|
|
551
551
|
//#endregion
|
|
552
552
|
//#region src/framework/index.svelte.d.ts
|
|
553
553
|
/**
|
|
@@ -62,7 +62,7 @@ function batch(fn) {
|
|
|
62
62
|
function initializeFieldStore(internalFieldStore, schema, initialInput, path, nullish = false) {
|
|
63
63
|
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`);
|
|
64
64
|
else if (schema.type === "lazy") initializeFieldStore(internalFieldStore, schema.getter(void 0), initialInput, path);
|
|
65
|
-
else if (schema.type === "exact_optional" || schema.type === "nullable" || schema.type === "nullish" || schema.type === "optional" || schema.type === "undefinedable") initializeFieldStore(internalFieldStore, schema.wrapped, initialInput
|
|
65
|
+
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);
|
|
66
66
|
else if (schema.type === "non_nullable" || schema.type === "non_nullish" || schema.type === "non_optional") initializeFieldStore(internalFieldStore, schema.wrapped, initialInput, path);
|
|
67
67
|
else if (schema.type === "intersect" || schema.type === "union" || schema.type === "variant") for (const schemaOption of schema.options) initializeFieldStore(internalFieldStore, schemaOption, initialInput, path);
|
|
68
68
|
else {
|
|
@@ -452,8 +452,8 @@ function setFieldInput(internalFormStore, path, input) {
|
|
|
452
452
|
for (let index = 0; index < path.length; index++) {
|
|
453
453
|
internalFieldStore = internalFieldStore.children[path[index]];
|
|
454
454
|
if (index < path.length - 1) internalFieldStore.input.value = true;
|
|
455
|
-
else setNestedInput(internalFieldStore, input);
|
|
456
455
|
}
|
|
456
|
+
setNestedInput(internalFieldStore, input);
|
|
457
457
|
});
|
|
458
458
|
});
|
|
459
459
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formisch/svelte",
|
|
3
3
|
"description": "The modular and type-safe form library for Svelte",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.6",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Fabian Hiller",
|
|
7
7
|
"homepage": "https://formisch.dev",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"typescript-eslint": "^8.43.0",
|
|
53
53
|
"valibot": "^1.2.0",
|
|
54
54
|
"vite": "^7.1.5",
|
|
55
|
-
"@formisch/core": "0.4.
|
|
56
|
-
"@formisch/methods": "0.5.
|
|
55
|
+
"@formisch/core": "0.4.5",
|
|
56
|
+
"@formisch/methods": "0.5.2"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"svelte": "^5.29.0",
|