monkey-front-core 0.0.70 → 0.0.71
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/pipes/monkeyecx-format-date-group.mjs +3 -3
- package/esm2020/lib/core/pipes/monkeyecx-format-date-timelapse.mjs +1 -4
- package/esm2020/lib/core/utils/validate-utils.mjs +17 -15
- package/esm2020/lib/core/utils/validators.mjs +4 -2
- package/fesm2015/monkey-front-core.mjs +21 -20
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +21 -20
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/monkey-front-core-0.0.71.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.70.tgz +0 -0
|
@@ -242,9 +242,6 @@ class MonkeyEcxUtils {
|
|
|
242
242
|
const moment$3 = moment_;
|
|
243
243
|
class MonkeyEcxFormatDateTimelapsePipe {
|
|
244
244
|
transform(date, showTime = false, useUtc = true, format = '- HH:mm') {
|
|
245
|
-
console.log('moment');
|
|
246
|
-
console.log('11');
|
|
247
|
-
console.log(moment$3);
|
|
248
245
|
if (!MonkeyEcxUtils.persistNullEmptyUndefined(date))
|
|
249
246
|
return '';
|
|
250
247
|
let stillUtc = moment$3.default.utc(date).toDate();
|
|
@@ -559,12 +556,12 @@ class MonkeyEcxFormatDateGroupPipe {
|
|
|
559
556
|
format(date) {
|
|
560
557
|
if (!MonkeyEcxUtils.persistNullEmptyUndefined(date))
|
|
561
558
|
return '';
|
|
562
|
-
let stillUtc = moment$2.utc(date).toDate();
|
|
559
|
+
let stillUtc = moment$2.default.utc(date).toDate();
|
|
563
560
|
if (date.toString()?.indexOf(':') <= -1) {
|
|
564
561
|
stillUtc = date;
|
|
565
562
|
}
|
|
566
563
|
const formatFrom = 'YYYY/MM/DD';
|
|
567
|
-
const fmt = moment$2(stillUtc, formatFrom).locale(this.lang);
|
|
564
|
+
const fmt = moment$2.default(stillUtc, formatFrom).locale(this.lang);
|
|
568
565
|
const dayFormated = fmt.format('DD/');
|
|
569
566
|
const monthFormated = MonkeyEcxUtils.capitalize(fmt.format('MMMM'));
|
|
570
567
|
const yearFormated = fmt.format('YYYY');
|
|
@@ -869,9 +866,11 @@ class DateValidator {
|
|
|
869
866
|
return null;
|
|
870
867
|
if (control && control.value) {
|
|
871
868
|
const dateFormat = 'MM-DD-YYYY';
|
|
872
|
-
if (!moment$1
|
|
869
|
+
if (!moment$1
|
|
870
|
+
.default(moment$1.default(control.value).format(dateFormat), ['DD/MM/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD'], true)
|
|
871
|
+
.isValid()) {
|
|
873
872
|
return {
|
|
874
|
-
invalidDate: true
|
|
873
|
+
invalidDate: true,
|
|
875
874
|
};
|
|
876
875
|
}
|
|
877
876
|
}
|
|
@@ -885,7 +884,7 @@ class DocumentValidator {
|
|
|
885
884
|
if (control && control.value) {
|
|
886
885
|
if (!MonkeyEcxUtils.isCPFCNPJValid(control.value)) {
|
|
887
886
|
return {
|
|
888
|
-
invalidCpfCnpj: true
|
|
887
|
+
invalidCpfCnpj: true,
|
|
889
888
|
};
|
|
890
889
|
}
|
|
891
890
|
}
|
|
@@ -899,7 +898,7 @@ class DocumentRutValidator {
|
|
|
899
898
|
if (control && control.value) {
|
|
900
899
|
if (!MonkeyEcxUtils.isValidRUT(control.value)) {
|
|
901
900
|
return {
|
|
902
|
-
invalidRut: true
|
|
901
|
+
invalidRut: true,
|
|
903
902
|
};
|
|
904
903
|
}
|
|
905
904
|
}
|
|
@@ -913,7 +912,7 @@ class ZipCodeValidator {
|
|
|
913
912
|
if (control && control.value) {
|
|
914
913
|
if (!MonkeyEcxUtils.isValidZipCode(control.value)) {
|
|
915
914
|
return {
|
|
916
|
-
invalidZipCode: true
|
|
915
|
+
invalidZipCode: true,
|
|
917
916
|
};
|
|
918
917
|
}
|
|
919
918
|
}
|
|
@@ -927,7 +926,7 @@ class ComboValidator {
|
|
|
927
926
|
if (control && control.value !== '0')
|
|
928
927
|
return null;
|
|
929
928
|
return {
|
|
930
|
-
invalidCombo: true
|
|
929
|
+
invalidCombo: true,
|
|
931
930
|
};
|
|
932
931
|
}
|
|
933
932
|
}
|
|
@@ -938,7 +937,7 @@ class isTrueValidator {
|
|
|
938
937
|
if (control && control.value !== false)
|
|
939
938
|
return null;
|
|
940
939
|
return {
|
|
941
|
-
invalidTrue: true
|
|
940
|
+
invalidTrue: true,
|
|
942
941
|
};
|
|
943
942
|
}
|
|
944
943
|
}
|
|
@@ -954,7 +953,7 @@ class PasswordMatchValidation {
|
|
|
954
953
|
if (password === passwordConfirm)
|
|
955
954
|
return null;
|
|
956
955
|
return {
|
|
957
|
-
passwordsNotMatching: true
|
|
956
|
+
passwordsNotMatching: true,
|
|
958
957
|
};
|
|
959
958
|
}
|
|
960
959
|
}
|
|
@@ -965,7 +964,7 @@ class UrlValidator {
|
|
|
965
964
|
if (control && control.value) {
|
|
966
965
|
if (!MonkeyEcxUtils.isValidUrl(control.value)) {
|
|
967
966
|
return {
|
|
968
|
-
invalidUrl: true
|
|
967
|
+
invalidUrl: true,
|
|
969
968
|
};
|
|
970
969
|
}
|
|
971
970
|
}
|
|
@@ -991,7 +990,7 @@ class CustomDatesStartValidator {
|
|
|
991
990
|
return null;
|
|
992
991
|
if (dateStart > dateEnd) {
|
|
993
992
|
return {
|
|
994
|
-
dateStartMustBeLessThanAnd: true
|
|
993
|
+
dateStartMustBeLessThanAnd: true,
|
|
995
994
|
};
|
|
996
995
|
}
|
|
997
996
|
return null;
|
|
@@ -1016,7 +1015,7 @@ class CustomDatesEndValidator {
|
|
|
1016
1015
|
return null;
|
|
1017
1016
|
if (dateEnd < dateStart) {
|
|
1018
1017
|
return {
|
|
1019
|
-
dateEndMustBeGreaterThanStart: true
|
|
1018
|
+
dateEndMustBeGreaterThanStart: true,
|
|
1020
1019
|
};
|
|
1021
1020
|
}
|
|
1022
1021
|
return null;
|
|
@@ -1028,7 +1027,7 @@ class UnlockRegisterBuyerValidator {
|
|
|
1028
1027
|
return null;
|
|
1029
1028
|
if (control && control.value !== '#MONKEYBUYER') {
|
|
1030
1029
|
return {
|
|
1031
|
-
invalidUnlockRegister: true
|
|
1030
|
+
invalidUnlockRegister: true,
|
|
1032
1031
|
};
|
|
1033
1032
|
}
|
|
1034
1033
|
return null;
|
|
@@ -1040,7 +1039,7 @@ class UnlockRegisterSponsorValidator {
|
|
|
1040
1039
|
return null;
|
|
1041
1040
|
if (control && control.value !== '#MONKEYSPONSOR') {
|
|
1042
1041
|
return {
|
|
1043
|
-
invalidUnlockRegister: true
|
|
1042
|
+
invalidUnlockRegister: true,
|
|
1044
1043
|
};
|
|
1045
1044
|
}
|
|
1046
1045
|
return null;
|
|
@@ -1056,7 +1055,7 @@ class DateRangeValidator {
|
|
|
1056
1055
|
(!MonkeyEcxUtils.persistNullEmptyUndefined(dates.startDate) ||
|
|
1057
1056
|
!MonkeyEcxUtils.persistNullEmptyUndefined(dates.endDate))) {
|
|
1058
1057
|
return {
|
|
1059
|
-
invalidDateRange: true
|
|
1058
|
+
invalidDateRange: true,
|
|
1060
1059
|
};
|
|
1061
1060
|
}
|
|
1062
1061
|
return null;
|
|
@@ -1315,7 +1314,9 @@ function dateValidator(control) {
|
|
|
1315
1314
|
if (!control.parent || !control || isEmptyInputValue(control.value))
|
|
1316
1315
|
return null;
|
|
1317
1316
|
const dateFormat = 'MM-DD-YYYY';
|
|
1318
|
-
if (!moment
|
|
1317
|
+
if (!moment
|
|
1318
|
+
.default(moment.default(control.value).format(dateFormat), ['DD/MM/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD'], true)
|
|
1319
|
+
.isValid()) {
|
|
1319
1320
|
return {
|
|
1320
1321
|
invalidDate: true,
|
|
1321
1322
|
};
|