monkey-front-core 0.0.66 → 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 +4 -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 +24 -20
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +24 -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.66.tgz +0 -0
|
@@ -244,9 +244,9 @@ class MonkeyEcxFormatDateTimelapsePipe {
|
|
|
244
244
|
transform(date, showTime = false, useUtc = true, format = '- HH:mm') {
|
|
245
245
|
if (!MonkeyEcxUtils.persistNullEmptyUndefined(date))
|
|
246
246
|
return '';
|
|
247
|
-
let stillUtc = moment$3.utc(date).toDate();
|
|
247
|
+
let stillUtc = moment$3.default.utc(date).toDate();
|
|
248
248
|
if (!useUtc)
|
|
249
|
-
stillUtc = moment$3(date).toDate();
|
|
249
|
+
stillUtc = moment$3.default(date).toDate();
|
|
250
250
|
if (date.toString().indexOf(':') <= -1) {
|
|
251
251
|
if (typeof date === 'string') {
|
|
252
252
|
stillUtc = date;
|
|
@@ -255,7 +255,7 @@ class MonkeyEcxFormatDateTimelapsePipe {
|
|
|
255
255
|
}
|
|
256
256
|
const formatFrom = `YYYY/MM/DD${showTime ? ` ${format}` : ''}`;
|
|
257
257
|
const formatTo = `DD/MM/YYYY${showTime ? ` ${format}` : ''}`;
|
|
258
|
-
return `${moment$3(stillUtc, formatFrom).format(formatTo)}`;
|
|
258
|
+
return `${moment$3.default(stillUtc, formatFrom).format(formatTo)}`;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
MonkeyEcxFormatDateTimelapsePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxFormatDateTimelapsePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -556,12 +556,12 @@ class MonkeyEcxFormatDateGroupPipe {
|
|
|
556
556
|
format(date) {
|
|
557
557
|
if (!MonkeyEcxUtils.persistNullEmptyUndefined(date))
|
|
558
558
|
return '';
|
|
559
|
-
let stillUtc = moment$2.utc(date).toDate();
|
|
559
|
+
let stillUtc = moment$2.default.utc(date).toDate();
|
|
560
560
|
if (date.toString()?.indexOf(':') <= -1) {
|
|
561
561
|
stillUtc = date;
|
|
562
562
|
}
|
|
563
563
|
const formatFrom = 'YYYY/MM/DD';
|
|
564
|
-
const fmt = moment$2(stillUtc, formatFrom).locale(this.lang);
|
|
564
|
+
const fmt = moment$2.default(stillUtc, formatFrom).locale(this.lang);
|
|
565
565
|
const dayFormated = fmt.format('DD/');
|
|
566
566
|
const monthFormated = MonkeyEcxUtils.capitalize(fmt.format('MMMM'));
|
|
567
567
|
const yearFormated = fmt.format('YYYY');
|
|
@@ -866,9 +866,11 @@ class DateValidator {
|
|
|
866
866
|
return null;
|
|
867
867
|
if (control && control.value) {
|
|
868
868
|
const dateFormat = 'MM-DD-YYYY';
|
|
869
|
-
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()) {
|
|
870
872
|
return {
|
|
871
|
-
invalidDate: true
|
|
873
|
+
invalidDate: true,
|
|
872
874
|
};
|
|
873
875
|
}
|
|
874
876
|
}
|
|
@@ -882,7 +884,7 @@ class DocumentValidator {
|
|
|
882
884
|
if (control && control.value) {
|
|
883
885
|
if (!MonkeyEcxUtils.isCPFCNPJValid(control.value)) {
|
|
884
886
|
return {
|
|
885
|
-
invalidCpfCnpj: true
|
|
887
|
+
invalidCpfCnpj: true,
|
|
886
888
|
};
|
|
887
889
|
}
|
|
888
890
|
}
|
|
@@ -896,7 +898,7 @@ class DocumentRutValidator {
|
|
|
896
898
|
if (control && control.value) {
|
|
897
899
|
if (!MonkeyEcxUtils.isValidRUT(control.value)) {
|
|
898
900
|
return {
|
|
899
|
-
invalidRut: true
|
|
901
|
+
invalidRut: true,
|
|
900
902
|
};
|
|
901
903
|
}
|
|
902
904
|
}
|
|
@@ -910,7 +912,7 @@ class ZipCodeValidator {
|
|
|
910
912
|
if (control && control.value) {
|
|
911
913
|
if (!MonkeyEcxUtils.isValidZipCode(control.value)) {
|
|
912
914
|
return {
|
|
913
|
-
invalidZipCode: true
|
|
915
|
+
invalidZipCode: true,
|
|
914
916
|
};
|
|
915
917
|
}
|
|
916
918
|
}
|
|
@@ -924,7 +926,7 @@ class ComboValidator {
|
|
|
924
926
|
if (control && control.value !== '0')
|
|
925
927
|
return null;
|
|
926
928
|
return {
|
|
927
|
-
invalidCombo: true
|
|
929
|
+
invalidCombo: true,
|
|
928
930
|
};
|
|
929
931
|
}
|
|
930
932
|
}
|
|
@@ -935,7 +937,7 @@ class isTrueValidator {
|
|
|
935
937
|
if (control && control.value !== false)
|
|
936
938
|
return null;
|
|
937
939
|
return {
|
|
938
|
-
invalidTrue: true
|
|
940
|
+
invalidTrue: true,
|
|
939
941
|
};
|
|
940
942
|
}
|
|
941
943
|
}
|
|
@@ -951,7 +953,7 @@ class PasswordMatchValidation {
|
|
|
951
953
|
if (password === passwordConfirm)
|
|
952
954
|
return null;
|
|
953
955
|
return {
|
|
954
|
-
passwordsNotMatching: true
|
|
956
|
+
passwordsNotMatching: true,
|
|
955
957
|
};
|
|
956
958
|
}
|
|
957
959
|
}
|
|
@@ -962,7 +964,7 @@ class UrlValidator {
|
|
|
962
964
|
if (control && control.value) {
|
|
963
965
|
if (!MonkeyEcxUtils.isValidUrl(control.value)) {
|
|
964
966
|
return {
|
|
965
|
-
invalidUrl: true
|
|
967
|
+
invalidUrl: true,
|
|
966
968
|
};
|
|
967
969
|
}
|
|
968
970
|
}
|
|
@@ -988,7 +990,7 @@ class CustomDatesStartValidator {
|
|
|
988
990
|
return null;
|
|
989
991
|
if (dateStart > dateEnd) {
|
|
990
992
|
return {
|
|
991
|
-
dateStartMustBeLessThanAnd: true
|
|
993
|
+
dateStartMustBeLessThanAnd: true,
|
|
992
994
|
};
|
|
993
995
|
}
|
|
994
996
|
return null;
|
|
@@ -1013,7 +1015,7 @@ class CustomDatesEndValidator {
|
|
|
1013
1015
|
return null;
|
|
1014
1016
|
if (dateEnd < dateStart) {
|
|
1015
1017
|
return {
|
|
1016
|
-
dateEndMustBeGreaterThanStart: true
|
|
1018
|
+
dateEndMustBeGreaterThanStart: true,
|
|
1017
1019
|
};
|
|
1018
1020
|
}
|
|
1019
1021
|
return null;
|
|
@@ -1025,7 +1027,7 @@ class UnlockRegisterBuyerValidator {
|
|
|
1025
1027
|
return null;
|
|
1026
1028
|
if (control && control.value !== '#MONKEYBUYER') {
|
|
1027
1029
|
return {
|
|
1028
|
-
invalidUnlockRegister: true
|
|
1030
|
+
invalidUnlockRegister: true,
|
|
1029
1031
|
};
|
|
1030
1032
|
}
|
|
1031
1033
|
return null;
|
|
@@ -1037,7 +1039,7 @@ class UnlockRegisterSponsorValidator {
|
|
|
1037
1039
|
return null;
|
|
1038
1040
|
if (control && control.value !== '#MONKEYSPONSOR') {
|
|
1039
1041
|
return {
|
|
1040
|
-
invalidUnlockRegister: true
|
|
1042
|
+
invalidUnlockRegister: true,
|
|
1041
1043
|
};
|
|
1042
1044
|
}
|
|
1043
1045
|
return null;
|
|
@@ -1053,7 +1055,7 @@ class DateRangeValidator {
|
|
|
1053
1055
|
(!MonkeyEcxUtils.persistNullEmptyUndefined(dates.startDate) ||
|
|
1054
1056
|
!MonkeyEcxUtils.persistNullEmptyUndefined(dates.endDate))) {
|
|
1055
1057
|
return {
|
|
1056
|
-
invalidDateRange: true
|
|
1058
|
+
invalidDateRange: true,
|
|
1057
1059
|
};
|
|
1058
1060
|
}
|
|
1059
1061
|
return null;
|
|
@@ -1312,7 +1314,9 @@ function dateValidator(control) {
|
|
|
1312
1314
|
if (!control.parent || !control || isEmptyInputValue(control.value))
|
|
1313
1315
|
return null;
|
|
1314
1316
|
const dateFormat = 'MM-DD-YYYY';
|
|
1315
|
-
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()) {
|
|
1316
1320
|
return {
|
|
1317
1321
|
invalidDate: true,
|
|
1318
1322
|
};
|