@formisch/qwik 0.7.1 → 0.7.3

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Formisch is a schema-based, headless form library for Qwik. 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-qwik)!
4
4
 
5
- Formisch is also available for [Preact][formisch-preact], [SolidJS][formisch-solid], [Svelte][formisch-svelte] and [Vue][formisch-vue].
5
+ Formisch is also available for [Preact][formisch-preact], [React][formisch-react], [SolidJS][formisch-solid], [Svelte][formisch-svelte] and [Vue][formisch-vue].
6
6
 
7
7
  ## Highlights
8
8
 
@@ -81,6 +81,7 @@ Find a bug or have an idea how to improve the library? Please fill out an [issue
81
81
  This project is available free of charge and licensed under the [MIT license](https://github.com/open-circle/formisch/blob/main/LICENSE.md).
82
82
 
83
83
  [formisch-preact]: https://github.com/open-circle/formisch/tree/main/frameworks/preact
84
+ [formisch-react]: https://github.com/open-circle/formisch/tree/main/frameworks/react
84
85
  [formisch-solid]: https://github.com/open-circle/formisch/tree/main/frameworks/solid
85
86
  [formisch-svelte]: https://github.com/open-circle/formisch/tree/main/frameworks/svelte
86
87
  [formisch-vue]: https://github.com/open-circle/formisch/tree/main/frameworks/vue
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as v from "valibot";
2
2
  import { JSXOutput, NoSerialize, PropsOf, QRL, ReadonlySignal } from "@qwik.dev/core";
3
- import * as _qwik_dev_core_internal0 from "@qwik.dev/core/internal";
3
+ import * as _qwik_dev_core_internal3 from "@qwik.dev/core/internal";
4
4
 
5
5
  //#region ../../packages/core/dist/index.qwik.d.ts
6
6
 
@@ -30,9 +30,6 @@ interface Signal<T> {
30
30
  * Field element type.
31
31
  */
32
32
  type FieldElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
33
- /**
34
- * Internal base store interface.
35
- */
36
33
  //#endregion
37
34
  //#region src/types/field.qwik.d.ts
38
35
  /**
@@ -227,10 +224,6 @@ type PartialValues<TValue> = TValue extends readonly unknown[] ? number extends
227
224
  * Validation mode type.
228
225
  */
229
226
  type ValidationMode = "initial" | "touch" | "input" | "change" | "blur" | "submit";
230
- /**
231
- * Form config interface.
232
- */
233
-
234
227
  /**
235
228
  * Submit handler type.
236
229
  */
@@ -973,7 +966,7 @@ interface FieldProps<TSchema extends Schema = Schema, TFieldPath extends Require
973
966
  *
974
967
  * @returns The UI of the field to be rendered.
975
968
  */
976
- declare const Field: <TSchema extends Schema, TFieldPath extends RequiredPath>(props: _qwik_dev_core_internal0.PublicProps<FieldProps<TSchema, TFieldPath>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal0.DevJSX) => JSXOutput;
969
+ declare const Field: <TSchema extends Schema, TFieldPath extends RequiredPath>(props: _qwik_dev_core_internal3.PublicProps<FieldProps<TSchema, TFieldPath>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal3.DevJSX) => JSXOutput;
977
970
  //#endregion
978
971
  //#region src/components/FieldArray/FieldArray.d.ts
979
972
  /**
@@ -1001,7 +994,7 @@ interface FieldArrayProps<TSchema extends Schema = Schema, TFieldArrayPath exten
1001
994
  *
1002
995
  * @returns The UI of the field array to be rendered.
1003
996
  */
1004
- declare const FieldArray: <TSchema extends Schema, TFieldArrayPath extends RequiredPath>(props: _qwik_dev_core_internal0.PublicProps<FieldArrayProps<TSchema, TFieldArrayPath>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal0.DevJSX) => JSXOutput;
997
+ declare const FieldArray: <TSchema extends Schema, TFieldArrayPath extends RequiredPath>(props: _qwik_dev_core_internal3.PublicProps<FieldArrayProps<TSchema, TFieldArrayPath>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal3.DevJSX) => JSXOutput;
1005
998
  //#endregion
1006
999
  //#region src/components/Form/Form.d.ts
1007
1000
  /**
@@ -1023,7 +1016,7 @@ type FormProps<TSchema extends Schema = Schema> = Omit<PropsOf<'form'>, 'onSubmi
1023
1016
  *
1024
1017
  * @returns The a native form element.
1025
1018
  */
1026
- declare const Form: <TSchema extends Schema>(props: _qwik_dev_core_internal0.PublicProps<FormProps<TSchema>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal0.DevJSX) => JSXOutput;
1019
+ declare const Form: <TSchema extends Schema>(props: _qwik_dev_core_internal3.PublicProps<FormProps<TSchema>>, key: string | null, flags: number, dev?: _qwik_dev_core_internal3.DevJSX) => JSXOutput;
1027
1020
  //#endregion
1028
1021
  //#region src/hooks/useField/useField.d.ts
1029
1022
  /**
@@ -288,9 +288,8 @@ function getElementInput(element, internalFieldStore) {
288
288
  return element.checked;
289
289
  }
290
290
  if (element.type === "radio") {
291
- const prevValue = untrack(() => /* @__PURE__ */ getFieldInput(internalFieldStore));
292
- if (element.checked) return [...prevValue, element.value];
293
- return prevValue.filter((value) => value !== element.value);
291
+ if (element.checked) return element.value;
292
+ return untrack(() => /* @__PURE__ */ getFieldInput(internalFieldStore));
294
293
  }
295
294
  if (element.type === "file") {
296
295
  if (element.multiple) return [...element.files];
@@ -405,8 +404,8 @@ function setFieldInput(internalFormStore, path, input) {
405
404
  for (let index = 0; index < path.length; index++) {
406
405
  internalFieldStore = internalFieldStore.children[path[index]];
407
406
  if (index < path.length - 1) internalFieldStore.input.value = true;
408
- else setNestedInput(internalFieldStore, input);
409
407
  }
408
+ setNestedInput(internalFieldStore, input);
410
409
  });
411
410
  });
412
411
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formisch/qwik",
3
3
  "description": "The modular and type-safe form library for Qwik",
4
- "version": "0.7.1",
4
+ "version": "0.7.3",
5
5
  "license": "MIT",
6
6
  "author": "Fabian Hiller",
7
7
  "homepage": "https://formisch.dev",
@@ -43,14 +43,14 @@
43
43
  "eslint-plugin-qwik": "2.0.0-beta.5",
44
44
  "globals": "16.3.0",
45
45
  "prettier": "3.6.2",
46
- "tsdown": "^0.12.9",
46
+ "tsdown": "0.12.9",
47
47
  "typescript": "5.8.3",
48
48
  "typescript-eslint": "8.36.0",
49
- "valibot": "^1.1.0",
49
+ "valibot": "^1.2.0",
50
50
  "vite": "7.0.4",
51
51
  "vite-tsconfig-paths": "^5.1.4",
52
- "@formisch/core": "0.4.2",
53
- "@formisch/methods": "0.5.1"
52
+ "@formisch/core": "0.4.4",
53
+ "@formisch/methods": "0.5.2"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@qwik.dev/core": ">=2",