myrta-ui 14.0.0-beta.4 → 14.0.0-beta.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/fesm2020/myrta-ui.mjs
CHANGED
|
@@ -4379,6 +4379,9 @@ class MrxFormValidator {
|
|
|
4379
4379
|
if (!silent && !this._errors[name]) {
|
|
4380
4380
|
this._errors[name] = requiredRes.message;
|
|
4381
4381
|
}
|
|
4382
|
+
if (!this._isValid) {
|
|
4383
|
+
return;
|
|
4384
|
+
}
|
|
4382
4385
|
break;
|
|
4383
4386
|
case ValidationTypesEnum.Email:
|
|
4384
4387
|
const emailRes = emailValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4386,6 +4389,9 @@ class MrxFormValidator {
|
|
|
4386
4389
|
if (!silent && !this._errors[name]) {
|
|
4387
4390
|
this._errors[name] = emailRes.message;
|
|
4388
4391
|
}
|
|
4392
|
+
if (!this._isValid) {
|
|
4393
|
+
return;
|
|
4394
|
+
}
|
|
4389
4395
|
break;
|
|
4390
4396
|
case ValidationTypesEnum.Pattern:
|
|
4391
4397
|
const patternRes = patternValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4393,6 +4399,9 @@ class MrxFormValidator {
|
|
|
4393
4399
|
if (!silent && !this._errors[name]) {
|
|
4394
4400
|
this._errors[name] = patternRes.message;
|
|
4395
4401
|
}
|
|
4402
|
+
if (!this._isValid) {
|
|
4403
|
+
return;
|
|
4404
|
+
}
|
|
4396
4405
|
break;
|
|
4397
4406
|
case ValidationTypesEnum.MinLength:
|
|
4398
4407
|
const minLengthRes = minLengthValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4400,6 +4409,9 @@ class MrxFormValidator {
|
|
|
4400
4409
|
if (!silent && !this._errors[name]) {
|
|
4401
4410
|
this._errors[name] = minLengthRes.message;
|
|
4402
4411
|
}
|
|
4412
|
+
if (!this._isValid) {
|
|
4413
|
+
return;
|
|
4414
|
+
}
|
|
4403
4415
|
break;
|
|
4404
4416
|
case ValidationTypesEnum.MaxLength:
|
|
4405
4417
|
const maxLengthRes = maxLengthValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4407,6 +4419,9 @@ class MrxFormValidator {
|
|
|
4407
4419
|
if (!silent && !this._errors[name]) {
|
|
4408
4420
|
this._errors[name] = maxLengthRes.message;
|
|
4409
4421
|
}
|
|
4422
|
+
if (!this._isValid) {
|
|
4423
|
+
return;
|
|
4424
|
+
}
|
|
4410
4425
|
break;
|
|
4411
4426
|
case ValidationTypesEnum.MinValue:
|
|
4412
4427
|
const minValueRes = minValueValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4414,6 +4429,9 @@ class MrxFormValidator {
|
|
|
4414
4429
|
if (!silent && !this._errors[name]) {
|
|
4415
4430
|
this._errors[name] = minValueRes.message;
|
|
4416
4431
|
}
|
|
4432
|
+
if (!this._isValid) {
|
|
4433
|
+
return;
|
|
4434
|
+
}
|
|
4417
4435
|
break;
|
|
4418
4436
|
case ValidationTypesEnum.MaxValue:
|
|
4419
4437
|
const maxValueRes = maxValueValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4421,6 +4439,9 @@ class MrxFormValidator {
|
|
|
4421
4439
|
if (!silent && !this._errors[name]) {
|
|
4422
4440
|
this._errors[name] = maxValueRes.message;
|
|
4423
4441
|
}
|
|
4442
|
+
if (!this._isValid) {
|
|
4443
|
+
return;
|
|
4444
|
+
}
|
|
4424
4445
|
break;
|
|
4425
4446
|
case ValidationTypesEnum.Callback:
|
|
4426
4447
|
const callbackRes = callbackValidation(value, validations, key, this._invalidMessages);
|
|
@@ -4428,6 +4449,9 @@ class MrxFormValidator {
|
|
|
4428
4449
|
if (!silent && !this._errors[name]) {
|
|
4429
4450
|
this._errors[name] = callbackRes.message;
|
|
4430
4451
|
}
|
|
4452
|
+
if (!this._isValid) {
|
|
4453
|
+
return;
|
|
4454
|
+
}
|
|
4431
4455
|
break;
|
|
4432
4456
|
}
|
|
4433
4457
|
}
|
|
@@ -4466,11 +4490,11 @@ class MrxFormValidator {
|
|
|
4466
4490
|
}
|
|
4467
4491
|
}
|
|
4468
4492
|
isValid() {
|
|
4469
|
-
this._isValid = true;
|
|
4470
4493
|
for (let key in this._validations) {
|
|
4471
4494
|
this.errors[key] = null;
|
|
4472
4495
|
this.validateField(this._fields[key], key, this._validations[key], true);
|
|
4473
4496
|
}
|
|
4497
|
+
console.log(1, this._isValid);
|
|
4474
4498
|
return this._isValid;
|
|
4475
4499
|
}
|
|
4476
4500
|
// TODO Вырезать в будущем
|