ps-toolkit-ui 1.5.29 → 1.5.32

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;
@@ -4987,12 +4989,12 @@
4987
4989
  FormRadioComponent.prototype.ngOnInit = function () {
4988
4990
  var _this = this;
4989
4991
  this.inp.load();
4990
- this.inp.setValue = function (v) {
4992
+ this.inp.setValue = function (v, isEdit) {
4991
4993
  _this.inp.value = v !== null ? v.toString() : null;
4992
4994
  if (_this.inp.value == null && _this.inp.options.length > 0) {
4993
4995
  _this.inp.value = _this.inp.options.find(function (x) { return true; }).value;
4994
4996
  }
4995
- _this.onChange();
4997
+ _this.onChange(isEdit);
4996
4998
  };
4997
4999
  this.inp.setValue(this.inp.value, false);
4998
5000
  this.inp.isValid = function () {
@@ -5034,11 +5036,15 @@
5034
5036
  this.inp.value = this.inp.options[next].value;
5035
5037
  }
5036
5038
  };
5037
- FormRadioComponent.prototype.onChange = function () {
5039
+ FormRadioComponent.prototype.onChange = function (isEdit) {
5040
+ if (isEdit === void 0) { isEdit = false; }
5038
5041
  this.inp.error = null;
5039
5042
  if (this.inp.onChange) {
5040
5043
  this.inp.onChange(this.inp);
5041
5044
  }
5045
+ if (!isEdit) {
5046
+ this.changeIndex.emit('Tab');
5047
+ }
5042
5048
  };
5043
5049
  FormRadioComponent.prototype.onFocusIn = function () {
5044
5050
  $__namespace(this.inputBase.nativeElement).focus();
@@ -5722,7 +5728,7 @@
5722
5728
  { type: core.Component, args: [{
5723
5729
  selector: 'lib-form-textarea',
5724
5730
  template: "<div #inputDiv [id]=\"inp.name + 'Input'\" [className]=\"'form-input-con textarea w-100' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '') + ' ' + inp.class\">\r\n <div class=\"form-input\" (click)=\"onFocusIn()\">\r\n <div *ngIf=\"inp.displayLabel\" class=\"label\"><i *ngIf=\"inp.required\" class=\"fas fa-star-of-life required-icon\"></i>{{inp.getLabel()}}</div>\r\n <div class=\"w-100 p-r\">\r\n <textarea (keydown)=\"onKeyDown($event)\" [disabled]=\"inp.disabled\" [(ngModel)]=\"inp.value\" [placeholder]=\"inp.placeholder ? inp.l(inp.placeholder) : ''\" #inputBase [name]=\"inp.name\" class=\"control\" autocomplete=\"off\" [maxLength]=\"inp.maxLength > 0 ? inp.maxLength : 524288\"></textarea>\r\n <i *ngIf=\"inp.icon != null || inp.loading\" #inputIcon [className]=\"(inp.loading ? 'fa-duotone fa-spin fa-spinner' : inp.icon) + ' icon'\"></i>\r\n <i *ngIf=\"inp.withClear && inp.value\" (click)=\"inp.clear()\" class=\"fa-duotone fa-eraser clear-icon\"></i>\r\n </div>\r\n </div>\r\n</div>\r\n",
5725
- styles: [".form-input-con.textarea{padding:0 15px;position:relative}.form-input-con.textarea .form-input{float:right;position:relative;width:100%}.form-input-con.textarea .form-input .label{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;cursor:default;direction:rtl;float:right;font-size:12px;height:20px;line-height:20px;margin-bottom:3px;padding:0 10px;text-align:right;width:100%}.form-input-con.textarea.error .form-input .label{color:var(--red);font-size:10px}.form-input-con.textarea .form-input .label .required-icon{color:var(--red);font-size:9px;height:20px;line-height:20px;text-align:center;width:20px}.form-input-con.textarea .form-input .control{background-image:none;border:none;border:var(--border-input);border-radius:var(--border-radius-base);color:var(--black);display:block;font-family:Vazir;font-size:11px;height:80px;margin:0;padding:10px 35px;resize:none;text-align:center;width:100%}.form-input-con.textarea .form-input .control:focus,.form-input-con.textarea .form-input .control:hover{border:var(--border-input-dark);outline:none}.form-input-con.textarea .form-input i.icon{color:var(--primary);cursor:text;left:0;line-height:35px;z-index:1}.form-input-con.textarea .form-input i.clear-icon,.form-input-con.textarea .form-input i.icon{font-size:14px;height:35px;position:absolute;text-align:center;top:0;transition:all .35s ease-in-out;width:35px}.form-input-con.textarea .form-input i.clear-icon{color:var(--red);cursor:pointer;line-height:38px;right:0;z-index:3}.form-input-con.textarea.error .form-input .control{border:var(--border-input-red)}.form-input-con.textarea.error .form-input .control:focus,.form-input-con.textarea.error .form-input .control:hover{border:var(--border-input-red-dark)}.form-input-con.textarea.error .form-input .control,.form-input-con.textarea.error .form-input i.icon{color:var(--red-light)}.form-input-con.textarea.h-50 .form-input,.form-input-con.textarea.h-50 .form-input .control{height:50px}.form-input-con.textarea.h-50 .form-input i.icon{height:50px;line-height:50px}"]
5731
+ styles: [".form-input-con.textarea{padding:0 15px;position:relative}.form-input-con.textarea .form-input{float:right;position:relative;width:100%}.form-input-con.textarea .form-input .label{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;cursor:default;direction:rtl;float:right;font-size:12px;height:20px;line-height:20px;margin-bottom:3px;padding:0 10px;text-align:right;width:100%}.form-input-con.textarea.error .form-input .label{color:var(--red);font-size:10px}.form-input-con.textarea .form-input .label .required-icon{color:var(--red);font-size:9px;height:20px;line-height:20px;text-align:center;width:20px}.form-input-con.textarea .form-input .control{background-image:none;border:none;border:var(--border-input);border-radius:var(--border-radius-base);color:var(--black);display:block;font-family:Vazir;font-size:11px;height:80px;margin:0;padding:10px 35px;resize:none;text-align:center;width:100%}.form-input-con.textarea .form-input .control:focus,.form-input-con.textarea .form-input .control:hover{border:var(--border-input-dark);outline:none}.form-input-con.textarea .form-input i.icon{color:var(--primary);cursor:text;left:0;line-height:35px;z-index:1}.form-input-con.textarea .form-input i.clear-icon,.form-input-con.textarea .form-input i.icon{font-size:14px;height:35px;position:absolute;text-align:center;top:0;transition:all .35s ease-in-out;width:35px}.form-input-con.textarea .form-input i.clear-icon{color:var(--red);cursor:pointer;line-height:38px;right:0;z-index:3}.form-input-con.textarea.error .form-input .control{border:var(--border-input-red)}.form-input-con.textarea.error .form-input .control:focus,.form-input-con.textarea.error .form-input .control:hover{border:var(--border-input-red-dark)}.form-input-con.textarea.error .form-input .control,.form-input-con.textarea.error .form-input i.icon{color:var(--red-light)}.form-input-con.textarea.h-50 .form-input .control{height:50px}"]
5726
5732
  },] }
5727
5733
  ];
5728
5734
  FormTextareaComponent.ctorParameters = function () { return []; };