@formisch/svelte 0.4.0 → 0.5.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-preact]: https://github.com/fabian-hiller/formisch/tree/main/frameworks/preact
79
- [formisch-qwik]: https://github.com/fabian-hiller/formisch/tree/main/frameworks/qwik
80
- [formisch-solid]: https://github.com/fabian-hiller/formisch/tree/main/frameworks/solid
81
- [formisch-vue]: https://github.com/fabian-hiller/formisch/tree/main/frameworks/vue
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-solid]: https://github.com/open-circle/formisch/tree/main/frameworks/solid
81
+ [formisch-vue]: https://github.com/open-circle/formisch/tree/main/frameworks/vue
@@ -435,7 +435,7 @@ function setNestedInput(internalFieldStore, input) {
435
435
  } else {
436
436
  internalFieldStore.input.value = input;
437
437
  const startInput = internalFieldStore.startInput.value;
438
- internalFieldStore.isDirty.value = startInput !== input && (startInput !== void 0 || input !== "" && !Number.isNaN(input));
438
+ internalFieldStore.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
439
439
  }
440
440
  }
441
441
  /**
@@ -62,7 +62,7 @@ function handleSubmit(form, handler) {
62
62
  const result = await validateFormInput(internalFormStore, { shouldFocus: true });
63
63
  if (result.success) await handler(result.output, event);
64
64
  } catch (error) {
65
- internalFormStore.errors.value = [error instanceof Error ? error.message : "An unknown error has occurred."];
65
+ internalFormStore.errors.value = [error && typeof error === "object" && "message" in error && typeof error.message === "string" ? error.message : "An unknown error has occurred."];
66
66
  } finally {
67
67
  internalFormStore.isSubmitting.value = false;
68
68
  }
@@ -125,10 +125,10 @@ function move(form, config) {
125
125
  internalArrayStore.items.value = newItems;
126
126
  const tempInternalFieldStore = {};
127
127
  initializeFieldStore(tempInternalFieldStore, internalArrayStore.schema.item, void 0, []);
128
- copyItemState(internalArrayStore.children[config.from < config.to ? config.from : config.to], tempInternalFieldStore);
128
+ copyItemState(internalArrayStore.children[config.from], tempInternalFieldStore);
129
129
  if (config.from < config.to) for (let index = config.from; index < config.to; index++) copyItemState(internalArrayStore.children[index + 1], internalArrayStore.children[index]);
130
130
  else for (let index = config.from; index > config.to; index--) copyItemState(internalArrayStore.children[index - 1], internalArrayStore.children[index]);
131
- copyItemState(tempInternalFieldStore, internalArrayStore.children[config.from < config.to ? config.to : config.from]);
131
+ copyItemState(tempInternalFieldStore, internalArrayStore.children[config.to]);
132
132
  internalArrayStore.isTouched.value = true;
133
133
  internalArrayStore.isDirty.value = internalArrayStore.startItems.value.join() !== newItems.join();
134
134
  validateIfRequired(internalFormStore, internalArrayStore, "input");
@@ -204,7 +204,7 @@ function reset(form, config) {
204
204
  else {
205
205
  const startInput = internalFieldStore$1.startInput.value;
206
206
  const input = internalFieldStore$1.input.value;
207
- internalFieldStore$1.isDirty.value = startInput !== input && (startInput !== void 0 || input !== "" && !Number.isNaN(input));
207
+ internalFieldStore$1.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
208
208
  for (const element of internalFieldStore$1.elements) if (element.type === "file") element.value = "";
209
209
  }
210
210
  });
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@formisch/svelte",
3
3
  "description": "The modular and type-safe form library for Svelte",
4
- "version": "0.4.0",
4
+ "version": "0.5.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
  "svelte",
@@ -51,8 +51,8 @@
51
51
  "typescript": "^5.9.2",
52
52
  "typescript-eslint": "^8.43.0",
53
53
  "vite": "^7.1.5",
54
- "@formisch/methods": "0.4.0",
55
- "@formisch/core": "0.4.1"
54
+ "@formisch/core": "0.4.2",
55
+ "@formisch/methods": "0.5.0"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "svelte": "^5.29.0",