notform 1.0.3 → 1.0.5
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 +2 -0
- package/dist/index.js +4 -0
- package/package.json +2 -3
package/dist/index.d.ts
CHANGED
|
@@ -153,6 +153,8 @@ type NotFormContext<TSchema extends ObjectSchema> = {
|
|
|
153
153
|
reset: (_state?: DeepPartial<StandardSchemaV1.InferInput<TSchema>>, _errors?: StandardSchemaV1.Issue[], _validate?: boolean) => void;
|
|
154
154
|
/** Reactive status of async validation process */
|
|
155
155
|
isValidating: Ref<boolean>;
|
|
156
|
+
/** Reactive status of form submission */
|
|
157
|
+
isSubmitting: Ref<boolean>;
|
|
156
158
|
/** Computed status of form validity */
|
|
157
159
|
isValid: ComputedRef<boolean>;
|
|
158
160
|
/** Computed status of field interactions */
|
package/dist/index.js
CHANGED
|
@@ -411,6 +411,7 @@ function useNotForm(options) {
|
|
|
411
411
|
state: ref(structuredClone(initialState)),
|
|
412
412
|
errors: ref([...initialErrors]),
|
|
413
413
|
isValidating: ref(false),
|
|
414
|
+
isSubmitting: ref(false),
|
|
414
415
|
touchedFields: ref(/* @__PURE__ */ new Set()),
|
|
415
416
|
dirtyFields: ref(/* @__PURE__ */ new Set()),
|
|
416
417
|
isValid: computed(() => context.errors.value.length === 0),
|
|
@@ -523,6 +524,7 @@ function useNotForm(options) {
|
|
|
523
524
|
context.dirtyFields.value = new Set(paths);
|
|
524
525
|
},
|
|
525
526
|
async submit(event) {
|
|
527
|
+
context.isSubmitting.value = true;
|
|
526
528
|
try {
|
|
527
529
|
context.touchAllFields();
|
|
528
530
|
context.dirtyAllFields();
|
|
@@ -544,6 +546,8 @@ function useNotForm(options) {
|
|
|
544
546
|
message: "An unexpected error occurred during submission",
|
|
545
547
|
path: []
|
|
546
548
|
}]);
|
|
549
|
+
} finally {
|
|
550
|
+
context.isSubmitting.value = false;
|
|
547
551
|
}
|
|
548
552
|
}
|
|
549
553
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "notform",
|
|
3
|
+
"version": "1.0.5",
|
|
3
4
|
"type": "module",
|
|
4
5
|
"private": false,
|
|
5
6
|
"publishConfig": {
|
|
6
7
|
"access": "public"
|
|
7
8
|
},
|
|
8
|
-
"version": "1.0.3",
|
|
9
9
|
"description": "Vue Forms Without the Friction",
|
|
10
10
|
"author": "Favour Emeka <favorodera@gmail.com>",
|
|
11
11
|
"license": "MIT",
|
|
@@ -51,8 +51,7 @@
|
|
|
51
51
|
"vitest": "^4.0.16",
|
|
52
52
|
"vitest-browser-vue": "^2.0.1",
|
|
53
53
|
"vue": "^3.5.25",
|
|
54
|
-
"vue-tsc": "^3.2.2"
|
|
55
|
-
"yup": "^1.7.1"
|
|
54
|
+
"vue-tsc": "^3.2.2"
|
|
56
55
|
},
|
|
57
56
|
"dependencies": {
|
|
58
57
|
"@standard-schema/spec": "^1.1.0",
|