@formisch/solid 0.6.0 → 0.7.0
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 +7 -7
- package/dist/dev.js +5 -5
- package/dist/dev.jsx +5 -5
- package/dist/index.js +5 -5
- package/dist/index.jsx +5 -5
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -65,17 +65,17 @@ What makes Formisch unique is its framework-agnostic core, which is fully native
|
|
|
65
65
|
|
|
66
66
|
Thanks to our partners who support the development! [Join them](https://github.com/sponsors/fabian-hiller) and contribute to the sustainability of open source software!
|
|
67
67
|
|
|
68
|
-

|
|
69
69
|
|
|
70
70
|
## Feedback
|
|
71
71
|
|
|
72
|
-
Find a bug or have an idea how to improve the library? Please fill out an [issue](https://github.com/
|
|
72
|
+
Find a bug or have an idea how to improve the library? Please fill out an [issue](https://github.com/open-circle/formisch/issues/new). Together we can make forms even better!
|
|
73
73
|
|
|
74
74
|
## License
|
|
75
75
|
|
|
76
|
-
This project is available free of charge and licensed under the [MIT license](https://github.com/
|
|
76
|
+
This project is available free of charge and licensed under the [MIT license](https://github.com/open-circle/formisch/blob/main/LICENSE.md).
|
|
77
77
|
|
|
78
|
-
[formisch-preact]: https://github.com/
|
|
79
|
-
[formisch-qwik]: https://github.com/
|
|
80
|
-
[formisch-svelte]: https://github.com/
|
|
81
|
-
[formisch-vue]: https://github.com/
|
|
78
|
+
[formisch-preact]: https://github.com/open-circle/formisch/tree/main/frameworks/preact
|
|
79
|
+
[formisch-qwik]: https://github.com/open-circle/formisch/tree/main/frameworks/qwik
|
|
80
|
+
[formisch-svelte]: https://github.com/open-circle/formisch/tree/main/frameworks/svelte
|
|
81
|
+
[formisch-vue]: https://github.com/open-circle/formisch/tree/main/frameworks/vue
|
package/dist/dev.js
CHANGED
|
@@ -286,7 +286,7 @@ function setNestedInput(internalFieldStore, input) {
|
|
|
286
286
|
} else {
|
|
287
287
|
internalFieldStore.input.value = input;
|
|
288
288
|
const startInput = internalFieldStore.startInput.value;
|
|
289
|
-
internalFieldStore.isDirty.value = startInput !== input && (startInput
|
|
289
|
+
internalFieldStore.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
function setFieldInput(internalFormStore, path, input) {
|
|
@@ -420,7 +420,7 @@ function handleSubmit(form, handler) {
|
|
|
420
420
|
const result = await validateFormInput(internalFormStore, { shouldFocus: true });
|
|
421
421
|
if (result.success) await handler(result.output, event);
|
|
422
422
|
} catch (error) {
|
|
423
|
-
internalFormStore.errors.value = [error
|
|
423
|
+
internalFormStore.errors.value = [error && typeof error === "object" && "message" in error && typeof error.message === "string" ? error.message : "An unknown error has occurred."];
|
|
424
424
|
} finally {
|
|
425
425
|
internalFormStore.isSubmitting.value = false;
|
|
426
426
|
}
|
|
@@ -463,10 +463,10 @@ function move(form, config) {
|
|
|
463
463
|
internalArrayStore.items.value = newItems;
|
|
464
464
|
const tempInternalFieldStore = {};
|
|
465
465
|
initializeFieldStore(tempInternalFieldStore, internalArrayStore.schema.item, void 0, []);
|
|
466
|
-
copyItemState(internalArrayStore.children[config.from
|
|
466
|
+
copyItemState(internalArrayStore.children[config.from], tempInternalFieldStore);
|
|
467
467
|
if (config.from < config.to) for (let index = config.from; index < config.to; index++) copyItemState(internalArrayStore.children[index + 1], internalArrayStore.children[index]);
|
|
468
468
|
else for (let index = config.from; index > config.to; index--) copyItemState(internalArrayStore.children[index - 1], internalArrayStore.children[index]);
|
|
469
|
-
copyItemState(tempInternalFieldStore, internalArrayStore.children[config.
|
|
469
|
+
copyItemState(tempInternalFieldStore, internalArrayStore.children[config.to]);
|
|
470
470
|
internalArrayStore.isTouched.value = true;
|
|
471
471
|
internalArrayStore.isDirty.value = internalArrayStore.startItems.value.join() !== newItems.join();
|
|
472
472
|
validateIfRequired(internalFormStore, internalArrayStore, "input");
|
|
@@ -520,7 +520,7 @@ function reset(form, config) {
|
|
|
520
520
|
else {
|
|
521
521
|
const startInput = internalFieldStore$1.startInput.value;
|
|
522
522
|
const input = internalFieldStore$1.input.value;
|
|
523
|
-
internalFieldStore$1.isDirty.value = startInput !== input && (startInput
|
|
523
|
+
internalFieldStore$1.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
|
|
524
524
|
for (const element of internalFieldStore$1.elements) if (element.type === "file") element.value = "";
|
|
525
525
|
}
|
|
526
526
|
});
|
package/dist/dev.jsx
CHANGED
|
@@ -284,7 +284,7 @@ function setNestedInput(internalFieldStore, input) {
|
|
|
284
284
|
} else {
|
|
285
285
|
internalFieldStore.input.value = input;
|
|
286
286
|
const startInput = internalFieldStore.startInput.value;
|
|
287
|
-
internalFieldStore.isDirty.value = startInput !== input && (startInput
|
|
287
|
+
internalFieldStore.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
function setFieldInput(internalFormStore, path, input) {
|
|
@@ -418,7 +418,7 @@ function handleSubmit(form, handler) {
|
|
|
418
418
|
const result = await validateFormInput(internalFormStore, { shouldFocus: true });
|
|
419
419
|
if (result.success) await handler(result.output, event);
|
|
420
420
|
} catch (error) {
|
|
421
|
-
internalFormStore.errors.value = [error
|
|
421
|
+
internalFormStore.errors.value = [error && typeof error === "object" && "message" in error && typeof error.message === "string" ? error.message : "An unknown error has occurred."];
|
|
422
422
|
} finally {
|
|
423
423
|
internalFormStore.isSubmitting.value = false;
|
|
424
424
|
}
|
|
@@ -461,10 +461,10 @@ function move(form, config) {
|
|
|
461
461
|
internalArrayStore.items.value = newItems;
|
|
462
462
|
const tempInternalFieldStore = {};
|
|
463
463
|
initializeFieldStore(tempInternalFieldStore, internalArrayStore.schema.item, void 0, []);
|
|
464
|
-
copyItemState(internalArrayStore.children[config.from
|
|
464
|
+
copyItemState(internalArrayStore.children[config.from], tempInternalFieldStore);
|
|
465
465
|
if (config.from < config.to) for (let index = config.from; index < config.to; index++) copyItemState(internalArrayStore.children[index + 1], internalArrayStore.children[index]);
|
|
466
466
|
else for (let index = config.from; index > config.to; index--) copyItemState(internalArrayStore.children[index - 1], internalArrayStore.children[index]);
|
|
467
|
-
copyItemState(tempInternalFieldStore, internalArrayStore.children[config.
|
|
467
|
+
copyItemState(tempInternalFieldStore, internalArrayStore.children[config.to]);
|
|
468
468
|
internalArrayStore.isTouched.value = true;
|
|
469
469
|
internalArrayStore.isDirty.value = internalArrayStore.startItems.value.join() !== newItems.join();
|
|
470
470
|
validateIfRequired(internalFormStore, internalArrayStore, "input");
|
|
@@ -518,7 +518,7 @@ function reset(form, config) {
|
|
|
518
518
|
else {
|
|
519
519
|
const startInput = internalFieldStore$1.startInput.value;
|
|
520
520
|
const input = internalFieldStore$1.input.value;
|
|
521
|
-
internalFieldStore$1.isDirty.value = startInput !== input && (startInput
|
|
521
|
+
internalFieldStore$1.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
|
|
522
522
|
for (const element of internalFieldStore$1.elements) if (element.type === "file") element.value = "";
|
|
523
523
|
}
|
|
524
524
|
});
|
package/dist/index.js
CHANGED
|
@@ -286,7 +286,7 @@ function setNestedInput(internalFieldStore, input) {
|
|
|
286
286
|
} else {
|
|
287
287
|
internalFieldStore.input.value = input;
|
|
288
288
|
const startInput = internalFieldStore.startInput.value;
|
|
289
|
-
internalFieldStore.isDirty.value = startInput !== input && (startInput
|
|
289
|
+
internalFieldStore.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
function setFieldInput(internalFormStore, path, input) {
|
|
@@ -420,7 +420,7 @@ function handleSubmit(form, handler) {
|
|
|
420
420
|
const result = await validateFormInput(internalFormStore, { shouldFocus: true });
|
|
421
421
|
if (result.success) await handler(result.output, event);
|
|
422
422
|
} catch (error) {
|
|
423
|
-
internalFormStore.errors.value = [error
|
|
423
|
+
internalFormStore.errors.value = [error && typeof error === "object" && "message" in error && typeof error.message === "string" ? error.message : "An unknown error has occurred."];
|
|
424
424
|
} finally {
|
|
425
425
|
internalFormStore.isSubmitting.value = false;
|
|
426
426
|
}
|
|
@@ -463,10 +463,10 @@ function move(form, config) {
|
|
|
463
463
|
internalArrayStore.items.value = newItems;
|
|
464
464
|
const tempInternalFieldStore = {};
|
|
465
465
|
initializeFieldStore(tempInternalFieldStore, internalArrayStore.schema.item, void 0, []);
|
|
466
|
-
copyItemState(internalArrayStore.children[config.from
|
|
466
|
+
copyItemState(internalArrayStore.children[config.from], tempInternalFieldStore);
|
|
467
467
|
if (config.from < config.to) for (let index = config.from; index < config.to; index++) copyItemState(internalArrayStore.children[index + 1], internalArrayStore.children[index]);
|
|
468
468
|
else for (let index = config.from; index > config.to; index--) copyItemState(internalArrayStore.children[index - 1], internalArrayStore.children[index]);
|
|
469
|
-
copyItemState(tempInternalFieldStore, internalArrayStore.children[config.
|
|
469
|
+
copyItemState(tempInternalFieldStore, internalArrayStore.children[config.to]);
|
|
470
470
|
internalArrayStore.isTouched.value = true;
|
|
471
471
|
internalArrayStore.isDirty.value = internalArrayStore.startItems.value.join() !== newItems.join();
|
|
472
472
|
validateIfRequired(internalFormStore, internalArrayStore, "input");
|
|
@@ -520,7 +520,7 @@ function reset(form, config) {
|
|
|
520
520
|
else {
|
|
521
521
|
const startInput = internalFieldStore$1.startInput.value;
|
|
522
522
|
const input = internalFieldStore$1.input.value;
|
|
523
|
-
internalFieldStore$1.isDirty.value = startInput !== input && (startInput
|
|
523
|
+
internalFieldStore$1.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
|
|
524
524
|
for (const element of internalFieldStore$1.elements) if (element.type === "file") element.value = "";
|
|
525
525
|
}
|
|
526
526
|
});
|
package/dist/index.jsx
CHANGED
|
@@ -284,7 +284,7 @@ function setNestedInput(internalFieldStore, input) {
|
|
|
284
284
|
} else {
|
|
285
285
|
internalFieldStore.input.value = input;
|
|
286
286
|
const startInput = internalFieldStore.startInput.value;
|
|
287
|
-
internalFieldStore.isDirty.value = startInput !== input && (startInput
|
|
287
|
+
internalFieldStore.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
function setFieldInput(internalFormStore, path, input) {
|
|
@@ -418,7 +418,7 @@ function handleSubmit(form, handler) {
|
|
|
418
418
|
const result = await validateFormInput(internalFormStore, { shouldFocus: true });
|
|
419
419
|
if (result.success) await handler(result.output, event);
|
|
420
420
|
} catch (error) {
|
|
421
|
-
internalFormStore.errors.value = [error
|
|
421
|
+
internalFormStore.errors.value = [error && typeof error === "object" && "message" in error && typeof error.message === "string" ? error.message : "An unknown error has occurred."];
|
|
422
422
|
} finally {
|
|
423
423
|
internalFormStore.isSubmitting.value = false;
|
|
424
424
|
}
|
|
@@ -461,10 +461,10 @@ function move(form, config) {
|
|
|
461
461
|
internalArrayStore.items.value = newItems;
|
|
462
462
|
const tempInternalFieldStore = {};
|
|
463
463
|
initializeFieldStore(tempInternalFieldStore, internalArrayStore.schema.item, void 0, []);
|
|
464
|
-
copyItemState(internalArrayStore.children[config.from
|
|
464
|
+
copyItemState(internalArrayStore.children[config.from], tempInternalFieldStore);
|
|
465
465
|
if (config.from < config.to) for (let index = config.from; index < config.to; index++) copyItemState(internalArrayStore.children[index + 1], internalArrayStore.children[index]);
|
|
466
466
|
else for (let index = config.from; index > config.to; index--) copyItemState(internalArrayStore.children[index - 1], internalArrayStore.children[index]);
|
|
467
|
-
copyItemState(tempInternalFieldStore, internalArrayStore.children[config.
|
|
467
|
+
copyItemState(tempInternalFieldStore, internalArrayStore.children[config.to]);
|
|
468
468
|
internalArrayStore.isTouched.value = true;
|
|
469
469
|
internalArrayStore.isDirty.value = internalArrayStore.startItems.value.join() !== newItems.join();
|
|
470
470
|
validateIfRequired(internalFormStore, internalArrayStore, "input");
|
|
@@ -518,7 +518,7 @@ function reset(form, config) {
|
|
|
518
518
|
else {
|
|
519
519
|
const startInput = internalFieldStore$1.startInput.value;
|
|
520
520
|
const input = internalFieldStore$1.input.value;
|
|
521
|
-
internalFieldStore$1.isDirty.value = startInput !== input && (startInput
|
|
521
|
+
internalFieldStore$1.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
|
|
522
522
|
for (const element of internalFieldStore$1.elements) if (element.type === "file") element.value = "";
|
|
523
523
|
}
|
|
524
524
|
});
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formisch/solid",
|
|
3
3
|
"description": "The modular and type-safe form library for SolidJS",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Fabian Hiller",
|
|
7
7
|
"homepage": "https://formisch.dev",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/
|
|
10
|
+
"url": "https://github.com/open-circle/formisch"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [
|
|
13
13
|
"solidjs",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"typescript-eslint": "^8.36.0",
|
|
63
63
|
"valibot": "^1.1.0",
|
|
64
64
|
"vitest": "3.2.4",
|
|
65
|
-
"@formisch/core": "0.4.
|
|
66
|
-
"@formisch/methods": "0.
|
|
65
|
+
"@formisch/core": "0.4.2",
|
|
66
|
+
"@formisch/methods": "0.5.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"solid-js": "^1.6.0",
|