monkey-front-core 0.0.260 → 0.0.262

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.
@@ -849,7 +849,7 @@ function emailValidator(control) {
849
849
  if (test)
850
850
  return null;
851
851
  return {
852
- email: true,
852
+ email: true
853
853
  };
854
854
  }
855
855
  function dateRangeValidator(control) {
@@ -861,7 +861,7 @@ function dateRangeValidator(control) {
861
861
  (!MonkeyEcxUtils.persistNullEmptyUndefined(dates?.startDate) ||
862
862
  !MonkeyEcxUtils.persistNullEmptyUndefined(dates?.endDate))) {
863
863
  return {
864
- dateRange: true,
864
+ dateRange: true
865
865
  };
866
866
  }
867
867
  return null;
@@ -872,7 +872,7 @@ function registerValidator(control, type) {
872
872
  }
873
873
  if (control && control.value !== `#MONKEY${type}`.toUpperCase()) {
874
874
  return {
875
- invalidUnlockRegister: true,
875
+ invalidUnlockRegister: true
876
876
  };
877
877
  }
878
878
  return null;
@@ -896,7 +896,7 @@ function dateStartEndValidator(control) {
896
896
  return null;
897
897
  if (dateStart > dateEnd) {
898
898
  return {
899
- dateStartMustBeLessThanAnd: true,
899
+ dateStartMustBeLessThanAnd: true
900
900
  };
901
901
  }
902
902
  return null;
@@ -906,7 +906,7 @@ function urlValidator(control) {
906
906
  return null;
907
907
  if (!MonkeyEcxUtils.isValidUrl(control.value)) {
908
908
  return {
909
- url: true,
909
+ url: true
910
910
  };
911
911
  }
912
912
  return null;
@@ -922,7 +922,7 @@ function passwordConfirmValidator(control) {
922
922
  if (password === passwordConfirm)
923
923
  return null;
924
924
  return {
925
- passwordsNotMatching: true,
925
+ passwordsNotMatching: true
926
926
  };
927
927
  }
928
928
  function trueValidator(control) {
@@ -931,7 +931,7 @@ function trueValidator(control) {
931
931
  if (control && control.value !== false)
932
932
  return null;
933
933
  return {
934
- invalidTrue: true,
934
+ invalidTrue: true
935
935
  };
936
936
  }
937
937
  function comboValidator(control) {
@@ -940,16 +940,16 @@ function comboValidator(control) {
940
940
  if (control && control.value !== '0')
941
941
  return null;
942
942
  return {
943
- invalidCombo: true,
943
+ invalidCombo: true
944
944
  };
945
945
  }
946
- function zipCodeValidator(control) {
946
+ function zipCodeValidator(control, country) {
947
947
  if (!control.parent || !control || isEmptyInputValue(control.value))
948
948
  return null;
949
949
  if (control && control.value) {
950
- if (!MonkeyEcxUtils.isValidZipCode(control.value)) {
950
+ if (!MonkeyEcxUtils.isValidZipCode(control.value, country)) {
951
951
  return {
952
- invalidZipCode: true,
952
+ invalidZipCode: true
953
953
  };
954
954
  }
955
955
  }
@@ -961,14 +961,14 @@ function documentValidator(control, country) {
961
961
  if (country === 'BR') {
962
962
  if (!MonkeyEcxUtils.isCPFCNPJValid(control.value)) {
963
963
  return {
964
- invalidCpfCnpj: true,
964
+ invalidCpfCnpj: true
965
965
  };
966
966
  }
967
967
  }
968
968
  else if (country === 'CL') {
969
969
  if (!MonkeyEcxUtils.isValidRUT(control.value)) {
970
970
  return {
971
- invalidCpfCnpj: true,
971
+ invalidCpfCnpj: true
972
972
  };
973
973
  }
974
974
  }
@@ -982,7 +982,7 @@ function dateValidator(control) {
982
982
  .default(moment$2.default(control.value).format(dateFormat), ['DD/MM/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD'], true)
983
983
  .isValid()) {
984
984
  return {
985
- invalidDate: true,
985
+ invalidDate: true
986
986
  };
987
987
  }
988
988
  return null;
@@ -992,7 +992,7 @@ function valueGreaterThanZero(control) {
992
992
  return null;
993
993
  if (control && `${control?.value}` === '0') {
994
994
  return {
995
- invalidValueGreaterThanZero: true,
995
+ invalidValueGreaterThanZero: true
996
996
  };
997
997
  }
998
998
  return null;
@@ -1028,6 +1028,11 @@ class Validators {
1028
1028
  static zipCode(control) {
1029
1029
  return zipCodeValidator(control);
1030
1030
  }
1031
+ static zipCodeByCountry(country) {
1032
+ return (control) => {
1033
+ return zipCodeValidator(control, country);
1034
+ };
1035
+ }
1031
1036
  static documentBR(control) {
1032
1037
  return documentValidator(control, 'BR');
1033
1038
  }