ps-toolkit-ui 1.5.28 → 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)) {
@@ -1559,6 +1560,7 @@
1559
1560
  if (url === void 0) { url = null; }
1560
1561
  if (cls === void 0) { cls = null; }
1561
1562
  this.environment = null;
1563
+ this.isEdit = false;
1562
1564
  this.subName = null;
1563
1565
  this.method = exports.Method.Post;
1564
1566
  this.loading = false;
@@ -1774,6 +1776,7 @@
1774
1776
  this.inEditVisible = true;
1775
1777
  this.inEditRequired = true;
1776
1778
  this.displayLabel = true;
1779
+ this.label = null;
1777
1780
  this.withClear = false;
1778
1781
  this.minLength = -1;
1779
1782
  this.maxLength = -1;
@@ -2912,6 +2915,7 @@
2912
2915
  };
2913
2916
  TableRowComponent.prototype.edit = function (opt, option) {
2914
2917
  var _this = this;
2918
+ this.table.form.isEdit = true;
2915
2919
  if (this.table.permissions.Type === exports.PermissionTypeEnum.Form) {
2916
2920
  this.table.form.name = opt.name;
2917
2921
  this.table.form.setData(this.row.Data);
@@ -4985,12 +4989,12 @@
4985
4989
  FormRadioComponent.prototype.ngOnInit = function () {
4986
4990
  var _this = this;
4987
4991
  this.inp.load();
4988
- this.inp.setValue = function (v) {
4992
+ this.inp.setValue = function (v, isEdit) {
4989
4993
  _this.inp.value = v !== null ? v.toString() : null;
4990
4994
  if (_this.inp.value == null && _this.inp.options.length > 0) {
4991
4995
  _this.inp.value = _this.inp.options.find(function (x) { return true; }).value;
4992
4996
  }
4993
- _this.onChange();
4997
+ _this.onChange(isEdit);
4994
4998
  };
4995
4999
  this.inp.setValue(this.inp.value, false);
4996
5000
  this.inp.isValid = function () {
@@ -5032,11 +5036,15 @@
5032
5036
  this.inp.value = this.inp.options[next].value;
5033
5037
  }
5034
5038
  };
5035
- FormRadioComponent.prototype.onChange = function () {
5039
+ FormRadioComponent.prototype.onChange = function (isEdit) {
5040
+ if (isEdit === void 0) { isEdit = false; }
5036
5041
  this.inp.error = null;
5037
5042
  if (this.inp.onChange) {
5038
5043
  this.inp.onChange(this.inp);
5039
5044
  }
5045
+ if (!isEdit) {
5046
+ this.changeIndex.emit('Tab');
5047
+ }
5040
5048
  };
5041
5049
  FormRadioComponent.prototype.onFocusIn = function () {
5042
5050
  $__namespace(this.inputBase.nativeElement).focus();
@@ -7499,6 +7507,7 @@
7499
7507
  TableClass.prototype.showInsertModal = function (cId) {
7500
7508
  if (cId === void 0) { cId = null; }
7501
7509
  var insertAccess = this.permissions.getAccess(exports.PermissionAccessTypeEnum.Insert);
7510
+ this.form.isEdit = false;
7502
7511
  this.form.url = this.form.baseUrl = insertAccess.Url.replace('{}', this.permissions.RelatedId) + (cId ? '/' + cId : '');
7503
7512
  this.form.name = insertAccess.Name;
7504
7513
  this.form.method = exports.Method.Post;