ps-toolkit-ui 1.6.82 → 1.6.85

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.
@@ -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();
4286
- }
4287
- else {
4288
- this.part2.focus();
4289
- }
4280
+ this.part2.focus(true);
4290
4281
  }
4291
4282
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4292
4283
  this.changeIndex.emit('ShiftTab');
@@ -4294,23 +4285,18 @@ class FormPlaqueComponent {
4294
4285
  }
4295
4286
  else if (p === 'Part2') {
4296
4287
  if (a === 'Tab' || a === 'Enter') {
4297
- this.part3.focus();
4288
+ this.part3.focus(true);
4298
4289
  }
4299
4290
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4300
- this.part1.focus();
4291
+ this.part1.focus(true);
4301
4292
  }
4302
4293
  }
4303
4294
  else if (p === 'Part3') {
4304
4295
  if (a === 'Tab' || a === 'Enter') {
4305
- this.part4.focus();
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();
4310
- }
4311
- else {
4312
- this.part2.focus();
4313
- }
4299
+ this.part2.focus(true);
4314
4300
  }
4315
4301
  }
4316
4302
  else if (p === 'Part4') {
@@ -4318,14 +4304,14 @@ class FormPlaqueComponent {
4318
4304
  this.changeIndex.emit('Tab');
4319
4305
  }
4320
4306
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4321
- this.part3.focus();
4307
+ this.part3.focus(true);
4322
4308
  }
4323
4309
  }
4324
4310
  }
4325
4311
  else if (this.inp.type === InputType.PlaqueM || this.inp.type === InputType.PlaqueF) {
4326
4312
  if (p === 'Part1') {
4327
4313
  if (a === 'Tab' || a === 'Enter') {
4328
- this.part3.focus();
4314
+ this.part3.focus(true);
4329
4315
  }
4330
4316
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4331
4317
  this.changeIndex.emit('ShiftTab');
@@ -4336,7 +4322,7 @@ class FormPlaqueComponent {
4336
4322
  this.changeIndex.emit('Tab');
4337
4323
  }
4338
4324
  else if (a === 'ShiftTab' || a === 'ShiftEnter') {
4339
- this.part1.focus();
4325
+ this.part1.focus(true);
4340
4326
  }
4341
4327
  }
4342
4328
  }
@@ -4353,7 +4339,7 @@ class FormPlaqueComponent {
4353
4339
  }
4354
4340
  onFocusIn(e = null) {
4355
4341
  if (e == null || !(e.screenX && e.screenX !== 0 && e.screenY && e.screenY !== 0)) {
4356
- this.part1.focus();
4342
+ this.part1.focus(true);
4357
4343
  }
4358
4344
  }
4359
4345
  onKeyDown(e) {