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.
@@ -1430,7 +1430,7 @@ class InputClass {
1430
1430
  this.level = null;
1431
1431
  this.modal = null;
1432
1432
  this.nameFun = null;
1433
- this.onFocusOut = () => { };
1433
+ this.onFocusOut = null;
1434
1434
  this.changeType = () => { };
1435
1435
  this.setValue = (v, isEdit) => { this.value = v; };
1436
1436
  this.setSearch = () => { };
@@ -3759,32 +3759,44 @@ class FormPlaqueSelectComponent {
3759
3759
  this.inp.error = null;
3760
3760
  this.inp.value = null;
3761
3761
  if (v.length === 2 && this.inp.type === InputType.SelectAutoCompletePlaque) {
3762
- this.part2.focus();
3762
+ this.part2.focus(true);
3763
3763
  this.loadOptions();
3764
3764
  }
3765
3765
  else if (v.length === 3 && this.inp.type === InputType.SelectAutoCompletePlaqueM) {
3766
- this.part3.focus();
3766
+ this.part3.focus(true);
3767
3767
  this.loadOptions();
3768
3768
  }
3769
3769
  };
3770
- this.part2.onChange = () => {
3770
+ this.part2.onChange = (v) => {
3771
3771
  this.inp.error = null;
3772
3772
  this.inp.value = null;
3773
- setTimeout(() => {
3774
- this.part3.focus();
3773
+ if (v.length === 1) {
3774
+ this.part3.focus(true);
3775
3775
  this.loadOptions();
3776
- }, 100);
3776
+ }
3777
+ else if (v.length === 0) {
3778
+ this.part1.focus(true);
3779
+ this.loadOptions();
3780
+ }
3777
3781
  };
3778
3782
  this.part3.onChange = (v) => {
3779
3783
  this.inp.error = null;
3780
3784
  this.inp.value = null;
3781
3785
  if (v.length === 3 && this.inp.type === InputType.SelectAutoCompletePlaque) {
3782
- this.part4.focus();
3786
+ this.part4.focus(true);
3787
+ this.loadOptions();
3788
+ }
3789
+ else if (v.length === 0 && this.inp.type === InputType.SelectAutoCompletePlaque) {
3790
+ this.part2.focus(true);
3783
3791
  this.loadOptions();
3784
3792
  }
3785
3793
  else if (v.length === 5 && this.inp.type === InputType.SelectAutoCompletePlaqueM) {
3786
3794
  this.loadOptions();
3787
3795
  }
3796
+ else if (v.length === 0 && this.inp.type === InputType.SelectAutoCompletePlaqueM) {
3797
+ this.part1.focus(true);
3798
+ this.loadOptions();
3799
+ }
3788
3800
  };
3789
3801
  this.part4.onChange = (v) => {
3790
3802
  this.inp.error = null;
@@ -3792,6 +3804,9 @@ class FormPlaqueSelectComponent {
3792
3804
  if (v.length === 2) {
3793
3805
  this.loadOptions();
3794
3806
  }
3807
+ else if (v.length === 0) {
3808
+ this.part3.focus(true);
3809
+ }
3795
3810
  };
3796
3811
  this.part1.onKeyDown = this.part2.onKeyDown = this.part3.onKeyDown = this.part4.onKeyDown = (e) => {
3797
3812
  const code = e.keyCode || e.which;
@@ -3800,6 +3815,8 @@ class FormPlaqueSelectComponent {
3800
3815
  }
3801
3816
  };
3802
3817
  this.part1.onFocusOut = (e) => {
3818
+ console.log($$1(e.relatedTarget));
3819
+ console.log($$1(e.rangeParent));
3803
3820
  if (!$$1(e.relatedTarget).closest('.form-input.plaque-select').hasClass('plaque-select') && !$$1(e.rangeParent).closest('.form-input.plaque-select').hasClass('plaque-select')) {
3804
3821
  if (this.open) {
3805
3822
  this.closeOptions();
@@ -3846,7 +3863,7 @@ class FormPlaqueSelectComponent {
3846
3863
  }
3847
3864
  focusInput(f = false) {
3848
3865
  if (f) {
3849
- this.part1.focus();
3866
+ this.part1.focus(true);
3850
3867
  }
3851
3868
  }
3852
3869
  closeOptions() {
@@ -4014,12 +4031,7 @@ class FormPlaqueSelectComponent {
4014
4031
  if (this.inp.type === InputType.SelectAutoCompletePlaque) {
4015
4032
  if (p === 'Part1') {
4016
4033
  if (a === 'Tab' || a === 'Enter') {
4017
- if (this.part2.data() != null) {
4018
- this.part3.focus();
4019
- }
4020
- else {
4021
- this.part2.focus();
4022
- }
4034
+ this.part2.focus(true);
4023
4035
  }
4024
4036
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4025
4037
  this.changeIndex.emit('ShiftTab');
@@ -4027,23 +4039,18 @@ class FormPlaqueSelectComponent {
4027
4039
  }
4028
4040
  else if (p === 'Part2') {
4029
4041
  if (a === 'Tab' || a === 'Enter') {
4030
- this.part3.focus();
4042
+ this.part3.focus(true);
4031
4043
  }
4032
4044
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4033
- this.part1.focus();
4045
+ this.part1.focus(true);
4034
4046
  }
4035
4047
  }
4036
4048
  else if (p === 'Part3') {
4037
4049
  if (a === 'Tab' || a === 'Enter') {
4038
- this.part4.focus();
4050
+ this.part4.focus(true);
4039
4051
  }
4040
4052
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4041
- if (this.part2.data() != null) {
4042
- this.part1.focus();
4043
- }
4044
- else {
4045
- this.part2.focus();
4046
- }
4053
+ this.part2.focus(true);
4047
4054
  }
4048
4055
  }
4049
4056
  else if (p === 'Part4') {
@@ -4051,14 +4058,14 @@ class FormPlaqueSelectComponent {
4051
4058
  this.changeIndex.emit('Tab');
4052
4059
  }
4053
4060
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4054
- this.part3.focus();
4061
+ this.part3.focus(true);
4055
4062
  }
4056
4063
  }
4057
4064
  }
4058
4065
  else if (this.inp.type === InputType.SelectAutoCompletePlaqueM || this.inp.type === InputType.SelectAutoCompletePlaqueF) {
4059
4066
  if (p === 'Part1') {
4060
4067
  if (a === 'Tab' || a === 'Enter') {
4061
- this.part3.focus();
4068
+ this.part3.focus(true);
4062
4069
  if (this.inp.type === InputType.SelectAutoCompletePlaqueF) {
4063
4070
  this.loadOptions();
4064
4071
  }
@@ -4072,7 +4079,7 @@ class FormPlaqueSelectComponent {
4072
4079
  this.changeIndex.emit('Tab');
4073
4080
  }
4074
4081
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4075
- this.part1.focus();
4082
+ this.part1.focus(true);
4076
4083
  if (this.inp.type === InputType.SelectAutoCompletePlaqueF) {
4077
4084
  this.loadOptions();
4078
4085
  }
@@ -4164,12 +4171,7 @@ class FormPlaqueComponent {
4164
4171
  this.part1.onChange = (v) => {
4165
4172
  this.inp.error = null;
4166
4173
  if (v.length === 2 && this.inp.type === InputType.Plaque) {
4167
- if (this.part2.data() != null) {
4168
- this.part3.focus(true);
4169
- }
4170
- else {
4171
- this.part2.focus(true);
4172
- }
4174
+ this.part2.focus(true);
4173
4175
  }
4174
4176
  else if (v.length === 3 && this.inp.type === InputType.PlaqueM) {
4175
4177
  this.part3.focus(true);
@@ -4178,14 +4180,10 @@ class FormPlaqueComponent {
4178
4180
  this.part2.onChange = (v) => {
4179
4181
  this.inp.error = null;
4180
4182
  if (v.length === 1) {
4181
- setTimeout(() => {
4182
- this.part3.focus(true);
4183
- }, 100);
4183
+ this.part3.focus(true);
4184
4184
  }
4185
4185
  else if (v.length === 0) {
4186
- setTimeout(() => {
4187
- this.part1.focus(true);
4188
- }, 100);
4186
+ this.part1.focus(true);
4189
4187
  }
4190
4188
  };
4191
4189
  this.part3.onChange = (v) => {
@@ -4193,7 +4191,7 @@ class FormPlaqueComponent {
4193
4191
  if (v.length === 3 && this.inp.type === InputType.Plaque) {
4194
4192
  this.part4.focus(true);
4195
4193
  }
4196
- if (v.length === 0 && this.inp.type === InputType.Plaque) {
4194
+ else if (v.length === 0 && this.inp.type === InputType.Plaque) {
4197
4195
  this.part2.focus(true);
4198
4196
  }
4199
4197
  else if (v.length === 5 && this.inp.type === InputType.PlaqueM) {
@@ -4208,10 +4206,8 @@ class FormPlaqueComponent {
4208
4206
  if (v.length === 2) {
4209
4207
  this.changeIndex.emit('Tab');
4210
4208
  }
4211
- else {
4212
- if (v.length === 0) {
4213
- this.part3.focus(true);
4214
- }
4209
+ else if (v.length === 0) {
4210
+ this.part3.focus(true);
4215
4211
  }
4216
4212
  };
4217
4213
  this.inp.setValue = (v) => {
@@ -4281,12 +4277,7 @@ class FormPlaqueComponent {
4281
4277
  if (this.inp.type === InputType.Plaque) {
4282
4278
  if (p === 'Part1') {
4283
4279
  if (a === 'Tab' || a === 'Enter') {
4284
- if (this.part2.data() != null) {
4285
- this.part3.focus(true);
4286
- }
4287
- else {
4288
- this.part2.focus(true);
4289
- }
4280
+ this.part2.focus(true);
4290
4281
  }
4291
4282
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4292
4283
  this.changeIndex.emit('ShiftTab');
@@ -4305,12 +4296,7 @@ class FormPlaqueComponent {
4305
4296
  this.part4.focus(true);
4306
4297
  }
4307
4298
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4308
- if (this.part2.data() != null) {
4309
- this.part1.focus(true);
4310
- }
4311
- else {
4312
- this.part2.focus(true);
4313
- }
4299
+ this.part2.focus(true);
4314
4300
  }
4315
4301
  }
4316
4302
  else if (p === 'Part4') {
@@ -5182,6 +5168,11 @@ class FormTextboxComponent {
5182
5168
  this.inputBase.nativeElement.focus();
5183
5169
  }
5184
5170
  }
5171
+ onFocusOut(e) {
5172
+ if (this.inp.onFocusOut !== null) {
5173
+ this.inp.onFocusOut(e);
5174
+ }
5175
+ }
5185
5176
  onChange(e) {
5186
5177
  this.onKeyUp(e);
5187
5178
  }
@@ -5238,7 +5229,7 @@ class FormTextboxComponent {
5238
5229
  FormTextboxComponent.decorators = [
5239
5230
  { type: Component, args: [{
5240
5231
  selector: 'lib-form-textbox',
5241
- 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",
5232
+ 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",
5242
5233
  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}"]
5243
5234
  },] }
5244
5235
  ];