monkey-front-core 0.0.452 → 0.0.454
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/core/utils/validators.mjs +9 -2
- package/fesm2015/monkey-front-core.mjs +8 -1
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +8 -1
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/monkey-front-core-0.0.454.tgz +0 -0
- package/package.json +3 -3
- package/monkey-front-core-0.0.452.tgz +0 -0
|
@@ -1275,9 +1275,16 @@ function differentFromZero(control) {
|
|
|
1275
1275
|
function documentValidatorByType(type, control) {
|
|
1276
1276
|
if (!control.parent || !control || isEmptyInputValue(control.value))
|
|
1277
1277
|
return null;
|
|
1278
|
+
const handle = MonkeyEcxUtils.handleOnlyNumbers(control.value);
|
|
1278
1279
|
let valid = false;
|
|
1279
1280
|
if (type === 'CPF' || type === 'CNPJ') {
|
|
1280
|
-
|
|
1281
|
+
if ((type === 'CNPJ' && `${handle}`.length !== 14) ||
|
|
1282
|
+
(type === 'CPF' && `${handle}`.length !== 11)) {
|
|
1283
|
+
valid = false;
|
|
1284
|
+
}
|
|
1285
|
+
else {
|
|
1286
|
+
valid = MonkeyEcxUtils.isCPFCNPJValid(control.value);
|
|
1287
|
+
}
|
|
1281
1288
|
}
|
|
1282
1289
|
else if (type === 'RUT') {
|
|
1283
1290
|
valid = MonkeyEcxUtils.isValidRUT(control.value);
|