myrta-ui 1.1.68 → 1.1.70
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/esm2020/lib/services/mrx-form-validator/helpers/get-sorting-validations.helper.mjs +2 -2
- package/esm2020/lib/services/mrx-form-validator/validations/min-length.validation.mjs +2 -3
- package/esm2020/lib/services/mrx-form-validator/validations/pattern.validation.mjs +2 -2
- package/fesm2015/myrta-ui.mjs +3 -3
- package/fesm2015/myrta-ui.mjs.map +1 -1
- package/fesm2020/myrta-ui.mjs +3 -3
- package/fesm2020/myrta-ui.mjs.map +1 -1
- package/package.json +1 -1
package/fesm2020/myrta-ui.mjs
CHANGED
|
@@ -4636,7 +4636,7 @@ const emailValidation = (value, validations, key, invalidMessages) => {
|
|
|
4636
4636
|
const patternValidation = (value, validations, key, invalidMessages) => {
|
|
4637
4637
|
const validation = new RegExp(validations[key]);
|
|
4638
4638
|
const result = { isValid: true, message: null };
|
|
4639
|
-
if (!validation.test(value)) {
|
|
4639
|
+
if (value && !validation.test(value)) {
|
|
4640
4640
|
result.message = getErrorMessageHelper(key, invalidMessages, validations.messages);
|
|
4641
4641
|
result.isValid = false;
|
|
4642
4642
|
}
|
|
@@ -4662,7 +4662,7 @@ const minLengthValidation = (value, validations, key, invalidMessages) => {
|
|
|
4662
4662
|
result.message = getErrorMessageHelper(key, invalidMessages, validations.messages, Number(validations[key]));
|
|
4663
4663
|
result.isValid = false;
|
|
4664
4664
|
}
|
|
4665
|
-
else if (!Array.isArray(value) && String(value).length < Number(validations[key])
|
|
4665
|
+
else if (!Array.isArray(value) && String(value).length < Number(validations[key])) {
|
|
4666
4666
|
result.message = getErrorMessageHelper(key, invalidMessages, validations.messages, Number(validations[key]));
|
|
4667
4667
|
result.isValid = false;
|
|
4668
4668
|
}
|
|
@@ -4712,12 +4712,12 @@ const INVALID_MESSAGES = {
|
|
|
4712
4712
|
|
|
4713
4713
|
const getSortingValidationsHelper = (validation) => {
|
|
4714
4714
|
const sortedValidatorsConstant = [
|
|
4715
|
+
ValidationTypesEnum.Required,
|
|
4715
4716
|
ValidationTypesEnum.MaxValue,
|
|
4716
4717
|
ValidationTypesEnum.MinValue,
|
|
4717
4718
|
ValidationTypesEnum.MaxLength,
|
|
4718
4719
|
ValidationTypesEnum.MinLength,
|
|
4719
4720
|
ValidationTypesEnum.Email,
|
|
4720
|
-
ValidationTypesEnum.Required,
|
|
4721
4721
|
ValidationTypesEnum.Pattern,
|
|
4722
4722
|
ValidationTypesEnum.Callback,
|
|
4723
4723
|
ValidationOptionsEnum.Type,
|