vue3-form-validation
Advanced tools
Comparing version 3.0.0 to 3.0.1
import { reactive, watch, ref } from 'vue'; | ||
import useUid from './useUid'; | ||
import Form from '../Form'; | ||
import { path } from '../utils'; | ||
import { path, PromiseCancel } from '../utils'; | ||
const isField = (field) => typeof field === 'object' ? '$value' in field : false; | ||
@@ -95,2 +95,3 @@ const isTransformedField = (field) => typeof field === 'object' | ||
const submitting = ref(false); | ||
const promiseCancel = new PromiseCancel(); | ||
transformFormData(form, formData); | ||
@@ -104,3 +105,3 @@ const transformedFormData = reactive(formData); | ||
submitting.value = true; | ||
const hasError = await form.validateAll(); | ||
const hasError = await promiseCancel.race(form.validateAll()); | ||
if (hasError) { | ||
@@ -115,3 +116,6 @@ submitting.value = false; | ||
}, | ||
resetFields() { | ||
async resetFields() { | ||
if (submitting.value) { | ||
promiseCancel.cancelResolve(true); | ||
} | ||
form.resetFields(); | ||
@@ -118,0 +122,0 @@ }, |
export { trySet } from './map/trySet'; | ||
export { tryGet } from './map/tryGet'; | ||
export { path } from './path/path'; | ||
export { PromiseCancel } from './promise-cancel/PromiseCancel'; |
export { trySet } from './map/trySet'; | ||
export { tryGet } from './map/tryGet'; | ||
export { path } from './path/path'; | ||
export { PromiseCancel } from './promise-cancel/PromiseCancel'; |
{ | ||
"name": "vue3-form-validation", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Vue composition function for Form Validation", | ||
@@ -11,3 +11,3 @@ "author": { | ||
"type": "git", | ||
"url": "https://github.com/JensDll/vue3-form-validation#readme" | ||
"url": "https://github.com/JensDll/vue3-form-validation" | ||
}, | ||
@@ -14,0 +14,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30506
23
561