@formisch/vue 0.7.2 → 0.7.4

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/dist/index.d.ts CHANGED
@@ -1012,7 +1012,7 @@ interface FormProps<TSchema extends Schema = Schema> {
1012
1012
  /**
1013
1013
  * The submit handler called when the form is submitted and validation succeeds.
1014
1014
  */
1015
- onSubmit: SubmitHandler<TSchema> | SubmitEventHandler<TSchema>;
1015
+ onSubmit: SubmitEventHandler<TSchema>;
1016
1016
  }
1017
1017
  declare const __VLS_export: <TSchema extends Schema = Schema>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
1018
1018
  props: __VLS_PrettifyLocal<FormProps<TSchema>> & vue1.PublicProps;
package/dist/index.js CHANGED
@@ -50,10 +50,10 @@ function untrack(fn) {
50
50
  */
51
51
  function initializeFieldStore(internalFieldStore, schema, initialInput, path, nullish = false) {
52
52
  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`);
53
- else if (schema.type === "lazy") initializeFieldStore(internalFieldStore, schema.getter(void 0), initialInput, path);
53
+ else if (schema.type === "lazy") initializeFieldStore(internalFieldStore, schema.getter(void 0), initialInput, path, nullish);
54
54
  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);
55
55
  else if (schema.type === "non_nullable" || schema.type === "non_nullish" || schema.type === "non_optional") initializeFieldStore(internalFieldStore, schema.wrapped, initialInput, path);
56
- else if (schema.type === "intersect" || schema.type === "union" || schema.type === "variant") for (const schemaOption of schema.options) initializeFieldStore(internalFieldStore, schemaOption, initialInput, path);
56
+ else if (schema.type === "intersect" || schema.type === "union" || schema.type === "variant") for (const schemaOption of schema.options) initializeFieldStore(internalFieldStore, schemaOption, initialInput, path, nullish);
57
57
  else {
58
58
  internalFieldStore.schema = schema;
59
59
  internalFieldStore.name = JSON.stringify(path);
@@ -949,12 +949,15 @@ var Form_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
949
949
  },
950
950
  setup(__props) {
951
951
  const props = __props;
952
- const handler = handleSubmit(props.of, props.onSubmit);
952
+ const handler = computed(() => handleSubmit(props.of, props.onSubmit));
953
953
  return (_ctx, _cache) => {
954
954
  return openBlock(), createElementBlock("form", {
955
955
  novalidate: "",
956
- onSubmit: _cache[0] || (_cache[0] = (...args) => unref(handler) && unref(handler)(...args))
957
- }, [renderSlot(_ctx.$slots, "default")], 32);
956
+ ref: (element) => {
957
+ if (element) __props.of[unref(INTERNAL)].element = element;
958
+ },
959
+ onSubmit: _cache[0] || (_cache[0] = (...args) => handler.value && handler.value(...args))
960
+ }, [renderSlot(_ctx.$slots, "default")], 544);
958
961
  };
959
962
  }
960
963
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formisch/vue",
3
3
  "description": "The modular and type-safe form library for Vue",
4
- "version": "0.7.2",
4
+ "version": "0.7.4",
5
5
  "license": "MIT",
6
6
  "author": "Fabian Hiller",
7
7
  "homepage": "https://formisch.dev",
@@ -32,7 +32,18 @@
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
+ "scripts": {
36
+ "build": "tsdown",
37
+ "lint": "eslint \"src/**/*.ts*\" && tsc --noEmit",
38
+ "lint.fix": "eslint \"src/**/*.ts*\" --fix",
39
+ "format": "prettier --write ./src",
40
+ "format.check": "prettier --check ./src",
41
+ "vite": "vite"
42
+ },
35
43
  "devDependencies": {
44
+ "@formisch/core": "workspace:*",
45
+ "@formisch/eslint-config": "workspace:*",
46
+ "@formisch/methods": "workspace:*",
36
47
  "@types/node": "^24.1.0",
37
48
  "@vue/eslint-config-typescript": "^14.6.0",
38
49
  "eslint": "^9.32.0",
@@ -42,10 +53,7 @@
42
53
  "unplugin-vue": "^7.0.0",
43
54
  "valibot": "^1.2.0",
44
55
  "vue": "^3.5.18",
45
- "vue-tsc": "^3.0.4",
46
- "@formisch/methods": "0.7.0",
47
- "@formisch/core": "0.6.2",
48
- "@formisch/eslint-config": "0.1.0"
56
+ "vue-tsc": "^3.0.4"
49
57
  },
50
58
  "peerDependencies": {
51
59
  "typescript": ">=5",
@@ -56,13 +64,5 @@
56
64
  "typescript": {
57
65
  "optional": true
58
66
  }
59
- },
60
- "scripts": {
61
- "build": "tsdown",
62
- "lint": "eslint \"src/**/*.ts*\" && tsc --noEmit",
63
- "lint.fix": "eslint \"src/**/*.ts*\" --fix",
64
- "format": "prettier --write ./src",
65
- "format.check": "prettier --check ./src",
66
- "vite": "vite"
67
67
  }
68
- }
68
+ }
package/LICENSE.md DELETED
@@ -1,9 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Fabian Hiller
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.