@formisch/preact 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 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
- ![Partners of Formisch](https://github.com/fabian-hiller/formisch/blob/main/partners.webp?raw=true)
68
+ ![Partners of Formisch](https://github.com/open-circle/formisch/blob/main/partners.webp?raw=true)
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/fabian-hiller/formisch/issues/new). Together we can make forms even better!
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/fabian-hiller/formisch/blob/main/LICENSE.md).
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-qwik]: https://github.com/fabian-hiller/formisch/tree/main/frameworks/qwik
79
- [formisch-solid]: https://github.com/fabian-hiller/formisch/tree/main/frameworks/solid
80
- [formisch-svelte]: https://github.com/fabian-hiller/formisch/tree/main/frameworks/svelte
81
- [formisch-vue]: https://github.com/fabian-hiller/formisch/tree/main/frameworks/vue
78
+ [formisch-qwik]: https://github.com/open-circle/formisch/tree/main/frameworks/qwik
79
+ [formisch-solid]: https://github.com/open-circle/formisch/tree/main/frameworks/solid
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/index.js CHANGED
@@ -377,7 +377,7 @@ function setNestedInput(internalFieldStore, input) {
377
377
  } else {
378
378
  internalFieldStore.input.value = input;
379
379
  const startInput = internalFieldStore.startInput.value;
380
- internalFieldStore.isDirty.value = startInput !== input && (startInput !== void 0 || input !== "" && !Number.isNaN(input));
380
+ internalFieldStore.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
381
381
  }
382
382
  }
383
383
  /**
@@ -584,7 +584,7 @@ function handleSubmit(form, handler) {
584
584
  const result = await validateFormInput(internalFormStore, { shouldFocus: true });
585
585
  if (result.success) await handler(result.output, event);
586
586
  } catch (error) {
587
- internalFormStore.errors.value = [error instanceof Error ? error.message : "An unknown error has occurred."];
587
+ internalFormStore.errors.value = [error && typeof error === "object" && "message" in error && typeof error.message === "string" ? error.message : "An unknown error has occurred."];
588
588
  } finally {
589
589
  internalFormStore.isSubmitting.value = false;
590
590
  }
@@ -641,10 +641,10 @@ function move(form, config) {
641
641
  internalArrayStore.items.value = newItems;
642
642
  const tempInternalFieldStore = {};
643
643
  initializeFieldStore(tempInternalFieldStore, internalArrayStore.schema.item, void 0, []);
644
- copyItemState(internalArrayStore.children[config.from < config.to ? config.from : config.to], tempInternalFieldStore);
644
+ copyItemState(internalArrayStore.children[config.from], tempInternalFieldStore);
645
645
  if (config.from < config.to) for (let index = config.from; index < config.to; index++) copyItemState(internalArrayStore.children[index + 1], internalArrayStore.children[index]);
646
646
  else for (let index = config.from; index > config.to; index--) copyItemState(internalArrayStore.children[index - 1], internalArrayStore.children[index]);
647
- copyItemState(tempInternalFieldStore, internalArrayStore.children[config.from < config.to ? config.to : config.from]);
647
+ copyItemState(tempInternalFieldStore, internalArrayStore.children[config.to]);
648
648
  internalArrayStore.isTouched.value = true;
649
649
  internalArrayStore.isDirty.value = internalArrayStore.startItems.value.join() !== newItems.join();
650
650
  validateIfRequired(internalFormStore, internalArrayStore, "input");
@@ -711,7 +711,7 @@ function reset(form, config) {
711
711
  else {
712
712
  const startInput = internalFieldStore$1.startInput.value;
713
713
  const input = internalFieldStore$1.input.value;
714
- internalFieldStore$1.isDirty.value = startInput !== input && (startInput !== void 0 || input !== "" && !Number.isNaN(input));
714
+ internalFieldStore$1.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
715
715
  for (const element of internalFieldStore$1.elements) if (element.type === "file") element.value = "";
716
716
  }
717
717
  });
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@formisch/preact",
3
3
  "description": "The modular and type-safe form library for Preact",
4
- "version": "0.6.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/fabian-hiller/formisch"
10
+ "url": "https://github.com/open-circle/formisch"
11
11
  },
12
12
  "keywords": [
13
13
  "preact",
@@ -43,8 +43,8 @@
43
43
  "typescript": "^5.8.3",
44
44
  "typescript-eslint": "^8.37.0",
45
45
  "vite": "^6.0.4",
46
- "@formisch/methods": "0.4.0",
47
- "@formisch/core": "0.4.1"
46
+ "@formisch/core": "0.4.2",
47
+ "@formisch/methods": "0.5.0"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@preact/signals": "^2.0.0",