@energycap/components 0.27.6 → 0.27.7
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/bundles/energycap-components.umd.js +12 -0
- package/bundles/energycap-components.umd.js.map +1 -1
- package/bundles/energycap-components.umd.min.js +1 -1
- package/bundles/energycap-components.umd.min.js.map +1 -1
- package/energycap-components.metadata.json +1 -1
- package/esm2015/lib/core/custom-validators.js +8 -1
- package/esm2015/lib/core/validation-message.service.js +5 -2
- package/esm2015/lib/core/validation-patterns.js +3 -1
- package/fesm2015/energycap-components.js +12 -1
- package/fesm2015/energycap-components.js.map +1 -1
- package/lib/core/custom-validators.d.ts +4 -0
- package/lib/core/validation-message.service.d.ts +1 -1
- package/lib/core/validation-patterns.d.ts +2 -0
- package/package.json +1 -1
- package/src/assets/locales/en_US.json +2 -1
|
@@ -869,6 +869,9 @@
|
|
|
869
869
|
case 'passwordInvalid':
|
|
870
870
|
translationObservables.push(this.translate.get('PasswordInvalidValidationMessage_LC'));
|
|
871
871
|
break;
|
|
872
|
+
case 'domain':
|
|
873
|
+
translationObservables.push(this.translate.get('DomainValidationMessage_SC'));
|
|
874
|
+
break;
|
|
872
875
|
default:
|
|
873
876
|
break;
|
|
874
877
|
}
|
|
@@ -3862,6 +3865,8 @@
|
|
|
3862
3865
|
* invalidate if just a minus sign is entered in the input, any digit `0-9` is allowed
|
|
3863
3866
|
*/
|
|
3864
3867
|
var integerPattern = new RegExp("^(-)?([\\d]+)?$");
|
|
3868
|
+
/** Pattern to validate most public domains */
|
|
3869
|
+
var domainPattern = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$/;
|
|
3865
3870
|
/**
|
|
3866
3871
|
* Function to return a decimal RegExp. Takes in the number of decimals to validate
|
|
3867
3872
|
* against
|
|
@@ -8861,6 +8866,12 @@
|
|
|
8861
8866
|
*/
|
|
8862
8867
|
CustomValidators.json = function (control) {
|
|
8863
8868
|
return (control.value && JsonHelper.tryParseJSON(control.value) === undefined) ? { json: true } : null;
|
|
8869
|
+
};
|
|
8870
|
+
/**
|
|
8871
|
+
* Returns a validation error if the control's value is not a valid domain.
|
|
8872
|
+
*/
|
|
8873
|
+
CustomValidators.domain = function (control) {
|
|
8874
|
+
return (control.value && domainPattern.test(control.value) === false) ? { domain: true } : null;
|
|
8864
8875
|
};
|
|
8865
8876
|
|
|
8866
8877
|
(function (PageStatus) {
|
|
@@ -9969,6 +9980,7 @@
|
|
|
9969
9980
|
exports.canadianPostalCodeRegex = canadianPostalCodeRegex;
|
|
9970
9981
|
exports.clickEvent = clickEvent;
|
|
9971
9982
|
exports.dateInputFormatRegex = dateInputFormatRegex;
|
|
9983
|
+
exports.domainPattern = domainPattern;
|
|
9972
9984
|
exports.findAllSpacesPattern = findAllSpacesPattern;
|
|
9973
9985
|
exports.forEachFormControl = forEachFormControl;
|
|
9974
9986
|
exports.getApiError = getApiError;
|