notform 1.0.3 → 1.0.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
@@ -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
@@ -5,7 +5,7 @@
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "version": "1.0.3",
8
+ "version": "1.0.4",
9
9
  "description": "Vue Forms Without the Friction",
10
10
  "author": "Favour Emeka <favorodera@gmail.com>",
11
11
  "license": "MIT",