ps-toolkit-ui 1.6.83 → 1.6.86

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.
@@ -1899,7 +1899,7 @@
1899
1899
  this.level = null;
1900
1900
  this.modal = null;
1901
1901
  this.nameFun = null;
1902
- this.onFocusOut = function () { };
1902
+ this.onFocusOut = null;
1903
1903
  this.changeType = function () { };
1904
1904
  this.setValue = function (v, isEdit) { _this.value = v; };
1905
1905
  this.setSearch = function () { };
@@ -4464,32 +4464,44 @@
4464
4464
  _this.inp.error = null;
4465
4465
  _this.inp.value = null;
4466
4466
  if (v.length === 2 && _this.inp.type === exports.InputType.SelectAutoCompletePlaque) {
4467
- _this.part2.focus();
4467
+ _this.part2.focus(true);
4468
4468
  _this.loadOptions();
4469
4469
  }
4470
4470
  else if (v.length === 3 && _this.inp.type === exports.InputType.SelectAutoCompletePlaqueM) {
4471
- _this.part3.focus();
4471
+ _this.part3.focus(true);
4472
4472
  _this.loadOptions();
4473
4473
  }
4474
4474
  };
4475
- this.part2.onChange = function () {
4475
+ this.part2.onChange = function (v) {
4476
4476
  _this.inp.error = null;
4477
4477
  _this.inp.value = null;
4478
- setTimeout(function () {
4479
- _this.part3.focus();
4478
+ if (v.length === 1) {
4479
+ _this.part3.focus(true);
4480
4480
  _this.loadOptions();
4481
- }, 100);
4481
+ }
4482
+ else if (v.length === 0) {
4483
+ _this.part1.focus(true);
4484
+ _this.loadOptions();
4485
+ }
4482
4486
  };
4483
4487
  this.part3.onChange = function (v) {
4484
4488
  _this.inp.error = null;
4485
4489
  _this.inp.value = null;
4486
4490
  if (v.length === 3 && _this.inp.type === exports.InputType.SelectAutoCompletePlaque) {
4487
- _this.part4.focus();
4491
+ _this.part4.focus(true);
4492
+ _this.loadOptions();
4493
+ }
4494
+ else if (v.length === 0 && _this.inp.type === exports.InputType.SelectAutoCompletePlaque) {
4495
+ _this.part2.focus(true);
4488
4496
  _this.loadOptions();
4489
4497
  }
4490
4498
  else if (v.length === 5 && _this.inp.type === exports.InputType.SelectAutoCompletePlaqueM) {
4491
4499
  _this.loadOptions();
4492
4500
  }
4501
+ else if (v.length === 0 && _this.inp.type === exports.InputType.SelectAutoCompletePlaqueM) {
4502
+ _this.part1.focus(true);
4503
+ _this.loadOptions();
4504
+ }
4493
4505
  };
4494
4506
  this.part4.onChange = function (v) {
4495
4507
  _this.inp.error = null;
@@ -4497,6 +4509,9 @@
4497
4509
  if (v.length === 2) {
4498
4510
  _this.loadOptions();
4499
4511
  }
4512
+ else if (v.length === 0) {
4513
+ _this.part3.focus(true);
4514
+ }
4500
4515
  };
4501
4516
  this.part1.onKeyDown = this.part2.onKeyDown = this.part3.onKeyDown = this.part4.onKeyDown = function (e) {
4502
4517
  var code = e.keyCode || e.which;
@@ -4505,6 +4520,8 @@
4505
4520
  }
4506
4521
  };
4507
4522
  this.part1.onFocusOut = function (e) {
4523
+ console.log($__namespace(e.relatedTarget));
4524
+ console.log($__namespace(e.rangeParent));
4508
4525
  if (!$__namespace(e.relatedTarget).closest('.form-input.plaque-select').hasClass('plaque-select') && !$__namespace(e.rangeParent).closest('.form-input.plaque-select').hasClass('plaque-select')) {
4509
4526
  if (_this.open) {
4510
4527
  _this.closeOptions();
@@ -4553,7 +4570,7 @@
4553
4570
  FormPlaqueSelectComponent.prototype.focusInput = function (f) {
4554
4571
  if (f === void 0) { f = false; }
4555
4572
  if (f) {
4556
- this.part1.focus();
4573
+ this.part1.focus(true);
4557
4574
  }
4558
4575
  };
4559
4576
  FormPlaqueSelectComponent.prototype.closeOptions = function () {
@@ -4764,12 +4781,7 @@
4764
4781
  if (this.inp.type === exports.InputType.SelectAutoCompletePlaque) {
4765
4782
  if (p === 'Part1') {
4766
4783
  if (a === 'Tab' || a === 'Enter') {
4767
- if (this.part2.data() != null) {
4768
- this.part3.focus();
4769
- }
4770
- else {
4771
- this.part2.focus();
4772
- }
4784
+ this.part2.focus(true);
4773
4785
  }
4774
4786
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4775
4787
  this.changeIndex.emit('ShiftTab');
@@ -4777,23 +4789,18 @@
4777
4789
  }
4778
4790
  else if (p === 'Part2') {
4779
4791
  if (a === 'Tab' || a === 'Enter') {
4780
- this.part3.focus();
4792
+ this.part3.focus(true);
4781
4793
  }
4782
4794
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4783
- this.part1.focus();
4795
+ this.part1.focus(true);
4784
4796
  }
4785
4797
  }
4786
4798
  else if (p === 'Part3') {
4787
4799
  if (a === 'Tab' || a === 'Enter') {
4788
- this.part4.focus();
4800
+ this.part4.focus(true);
4789
4801
  }
4790
4802
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4791
- if (this.part2.data() != null) {
4792
- this.part1.focus();
4793
- }
4794
- else {
4795
- this.part2.focus();
4796
- }
4803
+ this.part2.focus(true);
4797
4804
  }
4798
4805
  }
4799
4806
  else if (p === 'Part4') {
@@ -4801,14 +4808,14 @@
4801
4808
  this.changeIndex.emit('Tab');
4802
4809
  }
4803
4810
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4804
- this.part3.focus();
4811
+ this.part3.focus(true);
4805
4812
  }
4806
4813
  }
4807
4814
  }
4808
4815
  else if (this.inp.type === exports.InputType.SelectAutoCompletePlaqueM || this.inp.type === exports.InputType.SelectAutoCompletePlaqueF) {
4809
4816
  if (p === 'Part1') {
4810
4817
  if (a === 'Tab' || a === 'Enter') {
4811
- this.part3.focus();
4818
+ this.part3.focus(true);
4812
4819
  if (this.inp.type === exports.InputType.SelectAutoCompletePlaqueF) {
4813
4820
  this.loadOptions();
4814
4821
  }
@@ -4822,7 +4829,7 @@
4822
4829
  this.changeIndex.emit('Tab');
4823
4830
  }
4824
4831
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4825
- this.part1.focus();
4832
+ this.part1.focus(true);
4826
4833
  if (this.inp.type === exports.InputType.SelectAutoCompletePlaqueF) {
4827
4834
  this.loadOptions();
4828
4835
  }
@@ -4920,12 +4927,7 @@
4920
4927
  this.part1.onChange = function (v) {
4921
4928
  _this.inp.error = null;
4922
4929
  if (v.length === 2 && _this.inp.type === exports.InputType.Plaque) {
4923
- if (_this.part2.data() != null) {
4924
- _this.part3.focus(true);
4925
- }
4926
- else {
4927
- _this.part2.focus(true);
4928
- }
4930
+ _this.part2.focus(true);
4929
4931
  }
4930
4932
  else if (v.length === 3 && _this.inp.type === exports.InputType.PlaqueM) {
4931
4933
  _this.part3.focus(true);
@@ -4934,14 +4936,10 @@
4934
4936
  this.part2.onChange = function (v) {
4935
4937
  _this.inp.error = null;
4936
4938
  if (v.length === 1) {
4937
- setTimeout(function () {
4938
- _this.part3.focus(true);
4939
- }, 100);
4939
+ _this.part3.focus(true);
4940
4940
  }
4941
4941
  else if (v.length === 0) {
4942
- setTimeout(function () {
4943
- _this.part1.focus(true);
4944
- }, 100);
4942
+ _this.part1.focus(true);
4945
4943
  }
4946
4944
  };
4947
4945
  this.part3.onChange = function (v) {
@@ -4949,7 +4947,7 @@
4949
4947
  if (v.length === 3 && _this.inp.type === exports.InputType.Plaque) {
4950
4948
  _this.part4.focus(true);
4951
4949
  }
4952
- if (v.length === 0 && _this.inp.type === exports.InputType.Plaque) {
4950
+ else if (v.length === 0 && _this.inp.type === exports.InputType.Plaque) {
4953
4951
  _this.part2.focus(true);
4954
4952
  }
4955
4953
  else if (v.length === 5 && _this.inp.type === exports.InputType.PlaqueM) {
@@ -4964,10 +4962,8 @@
4964
4962
  if (v.length === 2) {
4965
4963
  _this.changeIndex.emit('Tab');
4966
4964
  }
4967
- else {
4968
- if (v.length === 0) {
4969
- _this.part3.focus(true);
4970
- }
4965
+ else if (v.length === 0) {
4966
+ _this.part3.focus(true);
4971
4967
  }
4972
4968
  };
4973
4969
  this.inp.setValue = function (v) {
@@ -5037,12 +5033,7 @@
5037
5033
  if (this.inp.type === exports.InputType.Plaque) {
5038
5034
  if (p === 'Part1') {
5039
5035
  if (a === 'Tab' || a === 'Enter') {
5040
- if (this.part2.data() != null) {
5041
- this.part3.focus(true);
5042
- }
5043
- else {
5044
- this.part2.focus(true);
5045
- }
5036
+ this.part2.focus(true);
5046
5037
  }
5047
5038
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
5048
5039
  this.changeIndex.emit('ShiftTab');
@@ -5061,12 +5052,7 @@
5061
5052
  this.part4.focus(true);
5062
5053
  }
5063
5054
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
5064
- if (this.part2.data() != null) {
5065
- this.part1.focus(true);
5066
- }
5067
- else {
5068
- this.part2.focus(true);
5069
- }
5055
+ this.part2.focus(true);
5070
5056
  }
5071
5057
  }
5072
5058
  else if (p === 'Part4') {
@@ -6044,6 +6030,11 @@
6044
6030
  this.inputBase.nativeElement.focus();
6045
6031
  }
6046
6032
  };
6033
+ FormTextboxComponent.prototype.onFocusOut = function (e) {
6034
+ if (this.inp.onFocusOut !== null) {
6035
+ this.inp.onFocusOut(e);
6036
+ }
6037
+ };
6047
6038
  FormTextboxComponent.prototype.onChange = function (e) {
6048
6039
  this.onKeyUp(e);
6049
6040
  };
@@ -6101,7 +6092,7 @@
6101
6092
  FormTextboxComponent.decorators = [
6102
6093
  { type: core.Component, args: [{
6103
6094
  selector: 'lib-form-textbox',
6104
- template: "<div #inputDiv [id]=\"inp.id + 'TextInput'\" [style]=\"inp.style\" [className]=\"'form-input-con text w-100' + (inp.error == null ? '' : ' error') + (inp.disabled || inp.loading ? ' disabled' : '') + (inp.icon == null ? ' without-icon' : '') + ' ' + 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 <input (keydown)=\"onKeyDown($event)\" (change)=\"onChange($event)\" (keyup)=\"onKeyUp($event)\" [disabled]=\"inp.disabled || inp.loading\" [value]=\"getValue()\" [placeholder]=\"inp.placeholder ? inp.l(inp.placeholder) : ''\" #inputBase [type]=\"inp.type == type.Password ? 'password': 'text'\" [name]=\"inp.name\" class=\"control\" autocomplete=\"off\" [maxLength]=\"inp.maxLength > 0 ? inp.type == type.Number || inp.type == type.Price ? inp.maxLength.toString().length : inp.maxLength : 524288\">\r\n <span *ngIf=\"inp.icon != null || inp.loading\" (click)=\"inp.button && onClickButton()\" #inputIcon [className]=\"(inp.button ? inp.button + ' button ' : '') + 'icon'\">\r\n <i [className]=\"(inp.loading ? 'fa-duotone fa-spin fa-spinner ' : inp.icon + ' ')\">{{inp.type === type.Sheba ? 'IR' : ''}}</i>\r\n </span>\r\n <span *ngIf=\"inp.withClear && inp.value\" (click)=\"inp.clear()\" class=\"clear-icon\">\r\n <i class=\"fa-duotone fa-eraser\"></i>\r\n </span>\r\n <div *ngIf=\"inp.progress != null && inp.progress.remainSecs > 0\" [ngStyle]=\"{width: inp.progress.percent + '%'}\" class=\"progress\"></div>\r\n </div>\r\n</div>\r\n",
6095
+ template: "<div #inputDiv [id]=\"inp.id + 'TextInput'\" [style]=\"inp.style\" [className]=\"'form-input-con text w-100' + (inp.error == null ? '' : ' error') + (inp.disabled || inp.loading ? ' disabled' : '') + (inp.icon == null ? ' without-icon' : '') + ' ' + 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 <input (keydown)=\"onKeyDown($event)\" (change)=\"onChange($event)\" (keyup)=\"onKeyUp($event)\" (focusout)=\"onFocusOut($event)\" [disabled]=\"inp.disabled || inp.loading\" [value]=\"getValue()\" [placeholder]=\"inp.placeholder ? inp.l(inp.placeholder) : ''\" #inputBase [type]=\"inp.type == type.Password ? 'password': 'text'\" [name]=\"inp.name\" class=\"control\" autocomplete=\"off\" [maxLength]=\"inp.maxLength > 0 ? inp.type == type.Number || inp.type == type.Price ? inp.maxLength.toString().length : inp.maxLength : 524288\">\r\n <span *ngIf=\"inp.icon != null || inp.loading\" (click)=\"inp.button && onClickButton()\" #inputIcon [className]=\"(inp.button ? inp.button + ' button ' : '') + 'icon'\">\r\n <i [className]=\"(inp.loading ? 'fa-duotone fa-spin fa-spinner ' : inp.icon + ' ')\">{{inp.type === type.Sheba ? 'IR' : ''}}</i>\r\n </span>\r\n <span *ngIf=\"inp.withClear && inp.value\" (click)=\"inp.clear()\" class=\"clear-icon\">\r\n <i class=\"fa-duotone fa-eraser\"></i>\r\n </span>\r\n <div *ngIf=\"inp.progress != null && inp.progress.remainSecs > 0\" [ngStyle]=\"{width: inp.progress.percent + '%'}\" class=\"progress\"></div>\r\n </div>\r\n</div>\r\n",
6105
6096
  styles: [".form-input-con.text{padding:0 15px;position:relative}.form-input-con.text .form-input{float:right;position:relative;width:100%}.form-input-con.text .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.text.error .form-input .label{color:var(--red);font-size:10px}.form-input-con.text .form-input .label .required-icon{color:var(--red);font-size:9px;height:20px;line-height:20px;text-align:center;width:20px}.form-input-con.text .form-input .control{background-color:#fff;background-image:none;border:var(--border-input);border-radius:var(--border-radius-base);color:var(--black);display:block;font-family:Vazir;font-size:11px;height:35px;padding:5px 35px;position:relative;text-align:center;width:100%;z-index:2}.form-input-con.text .form-input .control:focus,.form-input-con.text .form-input:hover .control{border:var(--border-input-dark);outline:none}.form-input-con.text.error .form-input .control{border:var(--border-input-red)}.form-input-con.text.error .form-input .control,.form-input-con.text.error .form-input span.icon{color:var(--red)}.form-input-con.text.error .form-input .control:focus,.form-input-con.text.error .form-input:hover .control{border:var(--border-input-red-dark)}.form-input-con.text .form-input span.icon{color:var(--primary);cursor:text;left:0}.form-input-con.text .form-input span.clear-icon,.form-input-con.text .form-input span.icon{bottom:0;font-size:14px;height:35px;line-height:38px;position:absolute;text-align:center;transition:all .35s ease-in-out;width:35px;z-index:2}.form-input-con.text .form-input span.clear-icon{color:var(--red);cursor:pointer;right:0}.form-input-con.text .form-input span.icon.button{background-color:var(--base);border-radius:var(--border-radius-base) 0 0 var(--border-radius-base);color:#fff;cursor:pointer}.form-input-con.text .form-input span.icon.button:hover{background-color:var(--base-dark)}.form-input-con.text .form-input span.icon.button.blue{background-color:var(--blue)}.form-input-con.text .form-input span.icon.button.blue:hover{background-color:var(--blue-dark)}.form-input-con.text .form-input span.icon.button.green{background-color:var(--green)}.form-input-con.text .form-input span.icon.button.green:hover{background-color:var(--green-dark)}.form-input-con.text .form-input span.icon.button.red{background-color:var(--red)}.form-input-con.text .form-input span.icon.button.red:hover{background-color:var(--red-dark)}.form-input-con.text .form-input span.icon.button.primary{background-color:var(--primary)}.form-input-con.text .form-input span.icon.button.primary:hover{background-color:var(--primary-dark)}.form-input-con.text.disabled .form-input .control,.form-input-con.text.disabled .form-input .label,.form-input-con.text.disabled .form-input span.icon{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;box-shadow:unset;cursor:default;filter:blur(.5px);opacity:.7}.form-input-con.text .form-input .progress{background-color:var(--primary);border-radius:var(--border-radius-base);bottom:-3px;height:10px;line-height:10px;margin-right:0;position:absolute;right:0;transition:width .5s ease-in-out;width:100%}.form-input-con.text.without-icon .form-input .control{padding:5px 10px}.form-input-con.text.h-50 .form-input .control{height:50px}.form-input-con.text.h-50 .form-input span.icon{height:50px;line-height:50px}.form-input-con.text.h-45 .form-input .control{font-size:17px;height:45px}.form-input-con.text.h-45 .form-input .control::-moz-placeholder,.form-input-con.text.h-45 .form-input .control::-webkit-input-placeholder{font-size:12px}.form-input-con.text.h-45 .form-input span.icon{font-size:15px;height:45px;line-height:50px}.form-input-con.text.h-30 .form-input .control{font-size:10px;height:30px;padding:0}.form-input-con.text.h-30 .form-input span.icon{font-size:11px;height:30px;line-height:33px;width:30px}.form-input-con.text.h-35{height:35px}.form-input-con.text.h-35 .form-input .control{height:35px;padding:0 35px}.form-input-con.text.h-35 .form-input span.icon{height:35px;line-height:35px}.form-input-con.text.h-25 .form-input .control{height:25px;padding:0}.form-input-con.text.h-25 .form-input span.icon{height:25px;line-height:25px}.form-input-con.text.h-25 .form-input .control::-moz-placeholder,.form-input-con.text.h-25 .form-input .control::-webkit-input-placeholder{font-family:VazirLight;font-size:10px}.form-input-con.text.plaque-part-item .form-input .control{border:none!important}.form-input-con.text.plaque-part-item.disabled .form-input .control{filter:blur(0);opacity:1}.form-input-con.text.plaque-part-1{float:left!important;padding:0!important;width:35px!important}.form-input-con.text.plaque-part-1.plaque-part-m{float:left!important;padding:0!important;width:49px!important}.form-input-con.text.plaque-part-1.plaque-part-f{float:right!important;margin-right:35px!important;width:68px!important}.form-input-con.text.plaque-part-1.plaque-part-g{float:right!important;margin-right:35px!important;width:132px!important}.form-input-con.text.plaque-part-2{float:left!important;padding:0!important;width:35px!important}.form-input-con.text.plaque-part-2.plaque-part-f,.form-input-con.text.plaque-part-2.plaque-part-g,.form-input-con.text.plaque-part-2.plaque-part-m{display:none!important}.form-input-con.text.plaque-part-3{float:left!important;padding:0!important;width:49px!important}.form-input-con.text.plaque-part-3.plaque-part-m{width:69px!important}.form-input-con.text.plaque-part-3.plaque-part-f{float:right!important;width:65px!important}.form-input-con.text.plaque-part-3.plaque-part-g{display:none!important}.form-input-con.text.plaque-part-4{float:left!important;margin-top:10px;padding:0!important;width:31px!important}.form-input-con.text.plaque-part-4 .form-input .control{height:25px!important}.form-input-con.text.plaque-part-4.plaque-part-f,.form-input-con.text.plaque-part-4.plaque-part-g,.form-input-con.text.plaque-part-4.plaque-part-m{display:none!important}.form-input-con.text.bank-card-part-item{float:left!important;padding:0!important;width:25%}.form-input-con.text.bank-card-part-item:not(.bank-card-part-4):after{content:\"\\f068\";font-family:Font Awesome\\ 5 Pro;font-size:6px;font-weight:900;height:20px;line-height:20px;position:absolute;right:-10px;text-align:center;top:calc(50% - 10px);width:20px}.form-input-con.text.bank-card-part-item .form-input .control{background-color:initial!important;border:unset!important;box-shadow:unset!important;font-size:13px!important;padding:0!important}"]
6106
6097
  },] }
6107
6098
  ];