@formisch/vue 0.5.1 → 0.6.1
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/{index.d.ts → index-DnufmfNB.d.ts} +8 -8
- package/dist/index.js +3 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -59,17 +59,17 @@ What makes Formisch unique is its framework-agnostic core, which is fully native
|
|
|
59
59
|
|
|
60
60
|
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!
|
|
61
61
|
|
|
62
|
-

|
|
63
63
|
|
|
64
64
|
## Feedback
|
|
65
65
|
|
|
66
|
-
Find a bug or have an idea how to improve the library? Please fill out an [issue](https://github.com/
|
|
66
|
+
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!
|
|
67
67
|
|
|
68
68
|
## License
|
|
69
69
|
|
|
70
|
-
This project is available free of charge and licensed under the [MIT license](https://github.com/
|
|
70
|
+
This project is available free of charge and licensed under the [MIT license](https://github.com/open-circle/formisch/blob/main/LICENSE.md).
|
|
71
71
|
|
|
72
|
-
[formisch-preact]: https://github.com/
|
|
73
|
-
[formisch-qwik]: https://github.com/
|
|
74
|
-
[formisch-solid]: https://github.com/
|
|
75
|
-
[formisch-svelte]: https://github.com/
|
|
72
|
+
[formisch-preact]: https://github.com/open-circle/formisch/tree/main/frameworks/preact
|
|
73
|
+
[formisch-qwik]: https://github.com/open-circle/formisch/tree/main/frameworks/qwik
|
|
74
|
+
[formisch-solid]: https://github.com/open-circle/formisch/tree/main/frameworks/solid
|
|
75
|
+
[formisch-svelte]: https://github.com/open-circle/formisch/tree/main/frameworks/svelte
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue0 from "vue";
|
|
3
3
|
import { ComponentPublicInstance, MaybeRefOrGetter, ShallowRef as Signal } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region ../../packages/core/dist/index.vue.d.ts
|
|
@@ -475,7 +475,7 @@ declare function getInput<TSchema extends Schema, TFieldPath extends RequiredPat
|
|
|
475
475
|
*
|
|
476
476
|
* @returns A submit event handler function to attach to the form element.
|
|
477
477
|
*/
|
|
478
|
-
declare function handleSubmit<TSchema extends Schema>(form: BaseFormStore<TSchema>, handler: SubmitHandler<TSchema>): (event: SubmitEvent) => void
|
|
478
|
+
declare function handleSubmit<TSchema extends Schema>(form: BaseFormStore<TSchema>, handler: SubmitHandler<TSchema>): (event: SubmitEvent) => Promise<void>;
|
|
479
479
|
//#endregion
|
|
480
480
|
//#region src/insert/insert.d.ts
|
|
481
481
|
/**
|
|
@@ -939,14 +939,14 @@ interface FieldProps<TSchema extends Schema = Schema, TFieldPath extends Require
|
|
|
939
939
|
readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
|
|
940
940
|
}
|
|
941
941
|
declare const __VLS_export$2: <TSchema extends Schema, TFieldPath extends RequiredPath>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$2<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
942
|
-
props: __VLS_PrettifyLocal$2<FieldProps<TSchema, TFieldPath>> &
|
|
942
|
+
props: __VLS_PrettifyLocal$2<FieldProps<TSchema, TFieldPath>> & vue0.PublicProps;
|
|
943
943
|
expose: (exposed: {}) => void;
|
|
944
944
|
attrs: any;
|
|
945
945
|
slots: {
|
|
946
946
|
default(props: FieldStore<TSchema, TFieldPath>): any;
|
|
947
947
|
};
|
|
948
948
|
emit: {};
|
|
949
|
-
}>) =>
|
|
949
|
+
}>) => vue0.VNode & {
|
|
950
950
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
951
951
|
};
|
|
952
952
|
declare const _default: typeof __VLS_export$2;
|
|
@@ -967,14 +967,14 @@ interface FieldArrayProps<TSchema extends Schema = Schema, TFieldArrayPath exten
|
|
|
967
967
|
readonly path: ValidArrayPath<v.InferInput<TSchema>, TFieldArrayPath>;
|
|
968
968
|
}
|
|
969
969
|
declare const __VLS_export$1: <TSchema extends Schema, TFieldArrayPath extends RequiredPath>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$1<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
970
|
-
props: __VLS_PrettifyLocal$1<FieldArrayProps<TSchema, TFieldArrayPath>> &
|
|
970
|
+
props: __VLS_PrettifyLocal$1<FieldArrayProps<TSchema, TFieldArrayPath>> & vue0.PublicProps;
|
|
971
971
|
expose: (exposed: {}) => void;
|
|
972
972
|
attrs: any;
|
|
973
973
|
slots: {
|
|
974
974
|
default(props: FieldArrayStore<TSchema, TFieldArrayPath>): any;
|
|
975
975
|
};
|
|
976
976
|
emit: {};
|
|
977
|
-
}>) =>
|
|
977
|
+
}>) => vue0.VNode & {
|
|
978
978
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
979
979
|
};
|
|
980
980
|
declare const _default$1: typeof __VLS_export$1;
|
|
@@ -995,14 +995,14 @@ interface FormProps<TSchema extends Schema = Schema> {
|
|
|
995
995
|
onSubmit: SubmitHandler<TSchema>;
|
|
996
996
|
}
|
|
997
997
|
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<{
|
|
998
|
-
props: __VLS_PrettifyLocal<FormProps<TSchema>> &
|
|
998
|
+
props: __VLS_PrettifyLocal<FormProps<TSchema>> & vue0.PublicProps;
|
|
999
999
|
expose: (exposed: {}) => void;
|
|
1000
1000
|
attrs: any;
|
|
1001
1001
|
slots: {
|
|
1002
1002
|
default?: (props: {}) => any;
|
|
1003
1003
|
};
|
|
1004
1004
|
emit: {};
|
|
1005
|
-
}>) =>
|
|
1005
|
+
}>) => vue0.VNode & {
|
|
1006
1006
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
1007
1007
|
};
|
|
1008
1008
|
declare const _default$2: typeof __VLS_export;
|
package/dist/index.js
CHANGED
|
@@ -369,7 +369,7 @@ function setNestedInput(internalFieldStore, input) {
|
|
|
369
369
|
} else {
|
|
370
370
|
internalFieldStore.input.value = input;
|
|
371
371
|
const startInput = internalFieldStore.startInput.value;
|
|
372
|
-
internalFieldStore.isDirty.value = startInput !== input && (startInput
|
|
372
|
+
internalFieldStore.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
/**
|
|
@@ -576,7 +576,7 @@ function handleSubmit(form, handler) {
|
|
|
576
576
|
const result = await validateFormInput(internalFormStore, { shouldFocus: true });
|
|
577
577
|
if (result.success) await handler(result.output, event);
|
|
578
578
|
} catch (error) {
|
|
579
|
-
internalFormStore.errors.value = [error
|
|
579
|
+
internalFormStore.errors.value = [error && typeof error === "object" && "message" in error && typeof error.message === "string" ? error.message : "An unknown error has occurred."];
|
|
580
580
|
} finally {
|
|
581
581
|
internalFormStore.isSubmitting.value = false;
|
|
582
582
|
}
|
|
@@ -703,7 +703,7 @@ function reset(form, config) {
|
|
|
703
703
|
else {
|
|
704
704
|
const startInput = internalFieldStore$1.startInput.value;
|
|
705
705
|
const input = internalFieldStore$1.input.value;
|
|
706
|
-
internalFieldStore$1.isDirty.value = startInput !== input && (startInput
|
|
706
|
+
internalFieldStore$1.isDirty.value = startInput !== input && (startInput != null || input !== "" && !Number.isNaN(input));
|
|
707
707
|
for (const element of internalFieldStore$1.elements) if (element.type === "file") element.value = "";
|
|
708
708
|
}
|
|
709
709
|
});
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formisch/vue",
|
|
3
3
|
"description": "The modular and type-safe form library for Vue",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.1",
|
|
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
|
"vue",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"valibot": "^1.1.0",
|
|
44
44
|
"vue": "^3.5.18",
|
|
45
45
|
"vue-tsc": "^3.0.4",
|
|
46
|
-
"@formisch/core": "0.4.
|
|
47
|
-
"@formisch/methods": "0.
|
|
46
|
+
"@formisch/core": "0.4.2",
|
|
47
|
+
"@formisch/methods": "0.5.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"typescript": ">=5",
|