ps-toolkit-ui 1.5.30 → 1.5.31

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.
@@ -879,56 +879,57 @@
879
879
  function HelperClass() {
880
880
  }
881
881
  HelperClass.getLabel = function (inp) {
882
+ var n = inp.label != null ? inp.label : inp.name;
882
883
  if (inp.error === exports.InputError.Required) {
883
- return inp.l('FormErrorRequired', inp.name);
884
+ return inp.l('FormErrorRequired', n);
884
885
  }
885
886
  else if (inp.error === exports.InputError.Invalid) {
886
- return inp.l('FormErrorInvalid', inp.name);
887
+ return inp.l('FormErrorInvalid', n);
887
888
  }
888
889
  else if (inp.error === exports.InputError.Length) {
889
- return inp.l('FormErrorLength', [inp.name, inp.minLength]);
890
+ return inp.l('FormErrorLength', [n, inp.minLength]);
890
891
  }
891
892
  else if (inp.error === exports.InputError.MinLength) {
892
- return inp.l('FormErrorMinLength', [inp.name, inp.minLength]);
893
+ return inp.l('FormErrorMinLength', [n, inp.minLength]);
893
894
  }
894
895
  else if (inp.error === exports.InputError.MaxLength) {
895
- return inp.l('FormErrorMaxLength', [inp.name, inp.maxLength]);
896
+ return inp.l('FormErrorMaxLength', [n, inp.maxLength]);
896
897
  }
897
898
  else if (inp.error === exports.InputError.MinAmount) {
898
- return inp.l('FormErrorMinAmount', [inp.name, inp.minLength]);
899
+ return inp.l('FormErrorMinAmount', [n, inp.minLength]);
899
900
  }
900
901
  else if (inp.error === exports.InputError.MaxAmount) {
901
- return inp.l('FormErrorMaxAmount', [inp.name, inp.maxLength]);
902
+ return inp.l('FormErrorMaxAmount', [n, inp.maxLength]);
902
903
  }
903
904
  else if (inp.error === exports.InputError.Expired) {
904
- return inp.l('FormErrorExpired', inp.name);
905
+ return inp.l('FormErrorExpired', n);
905
906
  }
906
907
  else if (inp.error === exports.InputError.Wrong) {
907
- return inp.l('FormErrorWrong', inp.name);
908
+ return inp.l('FormErrorWrong', n);
908
909
  }
909
910
  else if (inp.error === exports.InputError.Error) {
910
- return inp.l('FormError', inp.name);
911
+ return inp.l('FormError', n);
911
912
  }
912
913
  else if (inp.error === exports.InputError.NotMatch) {
913
914
  return inp.l('FormErrorNotMatch', inp.match.name);
914
915
  }
915
916
  else if (inp.error === exports.InputError.Exist) {
916
- return inp.l('FormErrorExist', inp.name);
917
+ return inp.l('FormErrorExist', n);
917
918
  }
918
919
  else if (inp.error === exports.InputError.NotExist) {
919
- return inp.l('FormErrorNotExist', inp.name);
920
+ return inp.l('FormErrorNotExist', n);
920
921
  }
921
922
  else if (inp.error === exports.InputError.NotAllowed) {
922
- return inp.l('FormErrorNotAllowed', [inp.name, inp.allowed.join(', ')]);
923
+ return inp.l('FormErrorNotAllowed', [n, inp.allowed.join(', ')]);
923
924
  }
924
925
  else if (inp.error === exports.InputError.MaxContent) {
925
- return inp.l('FormErrorMaxContent', [inp.name, inp.maxLength]);
926
+ return inp.l('FormErrorMaxContent', [n, inp.maxLength]);
926
927
  }
927
928
  else if (inp.error === exports.InputError.Upload) {
928
- return inp.l('FormErrorUpload', inp.name);
929
+ return inp.l('FormErrorUpload', n);
929
930
  }
930
931
  var desc = inp.description !== null ? ' (' + inp.l(inp.description) + ')' : '';
931
- return inp.l(inp.name) + desc;
932
+ return inp.l(n) + desc;
932
933
  };
933
934
  HelperClass.nationalCodeValid = function (c) {
934
935
  if (!RegExp(/^\d{10}$/).test(c) || RegExp(/^(.)\1+$/).test(c)) {
@@ -1775,6 +1776,7 @@
1775
1776
  this.inEditVisible = true;
1776
1777
  this.inEditRequired = true;
1777
1778
  this.displayLabel = true;
1779
+ this.label = null;
1778
1780
  this.withClear = false;
1779
1781
  this.minLength = -1;
1780
1782
  this.maxLength = -1;