@senior-agronegocio/angular-components 0.0.71-origination → 0.0.72-origination
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/senior-agronegocio-angular-components.umd.js +6 -4
- package/bundles/senior-agronegocio-angular-components.umd.js.map +1 -1
- package/bundles/senior-agronegocio-angular-components.umd.min.js +1 -1
- package/bundles/senior-agronegocio-angular-components.umd.min.js.map +1 -1
- package/esm2015/form-validator/agro-form-validator.js +7 -5
- package/esm5/form-validator/agro-form-validator.js +7 -5
- package/fesm2015/senior-agronegocio-angular-components.js +6 -4
- package/fesm2015/senior-agronegocio-angular-components.js.map +1 -1
- package/fesm5/senior-agronegocio-angular-components.js +6 -4
- package/fesm5/senior-agronegocio-angular-components.js.map +1 -1
- package/form-validator/agro-form-validator.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1994,8 +1994,8 @@
|
|
|
1994
1994
|
* Validator de CNPJ (Cadastro Nacional da Pessoa Jurídica).
|
|
1995
1995
|
* @returns
|
|
1996
1996
|
*/
|
|
1997
|
-
AgroFormValidator.
|
|
1998
|
-
|
|
1997
|
+
AgroFormValidator.CNPJValidator = function () {
|
|
1998
|
+
var cnpjVal = function (control) {
|
|
1999
1999
|
var _a;
|
|
2000
2000
|
var value = (_a = control.value) === null || _a === void 0 ? void 0 : _a.replace(/\D/g, '');
|
|
2001
2001
|
if (!value || value.length !== 14) {
|
|
@@ -2026,13 +2026,14 @@
|
|
|
2026
2026
|
}
|
|
2027
2027
|
return null; // válido
|
|
2028
2028
|
};
|
|
2029
|
+
return cnpjVal;
|
|
2029
2030
|
};
|
|
2030
2031
|
/**
|
|
2031
2032
|
* Valida se a placa do veículo é válida.
|
|
2032
2033
|
* @returns
|
|
2033
2034
|
*/
|
|
2034
|
-
AgroFormValidator.
|
|
2035
|
-
|
|
2035
|
+
AgroFormValidator.licensePlateValidator = function () {
|
|
2036
|
+
var licensePlateVal = function (control) {
|
|
2036
2037
|
var value = (control.value || '').toUpperCase().trim().replace(/-/g, '');
|
|
2037
2038
|
if (!value) {
|
|
2038
2039
|
return null; // Campo vazio não é responsabilidade desse validador
|
|
@@ -2041,6 +2042,7 @@
|
|
|
2041
2042
|
AGRO_REGEX.isOldLicensePlate.test(value);
|
|
2042
2043
|
return isValid ? null : { licensePlateInvalid: true };
|
|
2043
2044
|
};
|
|
2045
|
+
return licensePlateVal;
|
|
2044
2046
|
};
|
|
2045
2047
|
return AgroFormValidator;
|
|
2046
2048
|
}());
|