@bagelink/vue 1.9.142 → 1.9.144
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/form-flow/FormFlow.vue.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/form-flow/FormFlow.vue +2 -0
package/package.json
CHANGED
|
@@ -216,6 +216,7 @@ function validateField(key: string, field: FieldBuilder): boolean {
|
|
|
216
216
|
|
|
217
217
|
if (field._config.required === true) {
|
|
218
218
|
const isEmpty = value == null || value === '' || (Array.isArray(value) && value.length === 0)
|
|
219
|
+
|| (field._type === 'tel' && typeof value === 'string' && /^\+\d+$/.test(value))
|
|
219
220
|
if (isEmpty) {
|
|
220
221
|
validationErrors.value = { ...validationErrors.value, [key]: field._config.requiredMessage || $t('form.required') }
|
|
221
222
|
return false
|
|
@@ -358,6 +359,7 @@ function validateAll(): boolean {
|
|
|
358
359
|
// Check required fields first
|
|
359
360
|
if (field._config.required === true) {
|
|
360
361
|
const isEmpty = value == null || value === '' || (Array.isArray(value) && value.length === 0)
|
|
362
|
+
|| (field._type === 'tel' && typeof value === 'string' && /^\+\d+$/.test(value))
|
|
361
363
|
if (isEmpty) {
|
|
362
364
|
newErrors[key] = field._config.requiredMessage || $t('form.required')
|
|
363
365
|
isValid = false
|