ps-toolkit-ui 0.1.76 → 0.1.77

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.
@@ -3238,46 +3238,40 @@
3238
3238
  this.part4 = new InputClass(this.inp.environment, this.inp.l, 'BankCardPart4', null, exports.InputType.Number, 'bank-card-part-4 bank-card-part-item', '', true, 1000, 9999);
3239
3239
  this.part1.displayLabel = this.part2.displayLabel = this.part3.displayLabel = this.part4.displayLabel = false;
3240
3240
  this.part1.placeholder = this.part2.placeholder = this.part3.placeholder = this.part4.placeholder = null;
3241
- var bankNames = this.banks.map(function (x) { return x.name; });
3242
3241
  this.part1.onChange = function (v) {
3243
3242
  _this.inp.error = null;
3243
+ _this.setIcon();
3244
3244
  if (v.length === 4) {
3245
3245
  _this.part2.focus();
3246
- var b = _this.banks.filter(function (x) { return x.startWith.includes(_this.part1.data().toString()); });
3247
- if (b.length > 0) {
3248
- $__namespace(_this.inputIcon.nativeElement).removeClass('fa-money-check').addClass(b[0].name);
3249
- }
3250
- else {
3251
- $__namespace(_this.inputIcon.nativeElement).addClass('fa-money-check').removeClass(bankNames);
3252
- }
3253
3246
  }
3254
3247
  };
3255
3248
  this.part2.onChange = function (v) {
3256
3249
  _this.inp.error = null;
3257
- if (v.length === 2) {
3258
- var b = _this.banks.filter(function (x) { return x.startWith.includes(_this.part1.data().toString() + _this.part2.data().toString()); });
3259
- if (b.length > 0) {
3260
- $__namespace(_this.inputIcon.nativeElement).removeClass('fa-money-check').addClass(b[0].name);
3261
- }
3262
- else {
3263
- $__namespace(_this.inputIcon.nativeElement).addClass('fa-money-check').removeClass(bankNames);
3264
- }
3265
- }
3250
+ _this.setIcon();
3266
3251
  if (v.length === 4) {
3267
3252
  _this.part3.focus();
3268
3253
  }
3254
+ else if (v.length === 0) {
3255
+ _this.part1.focus();
3256
+ }
3269
3257
  };
3270
3258
  this.part3.onChange = function (v) {
3271
3259
  _this.inp.error = null;
3272
3260
  if (v.length === 4) {
3273
3261
  _this.part4.focus();
3274
3262
  }
3263
+ else if (v.length === 0) {
3264
+ _this.part2.focus();
3265
+ }
3275
3266
  };
3276
3267
  this.part4.onChange = function (v) {
3277
3268
  _this.inp.error = null;
3278
3269
  if (v.length === 4) {
3279
3270
  _this.changeIndex.emit('Tab');
3280
3271
  }
3272
+ else if (v.length === 0) {
3273
+ _this.part3.focus();
3274
+ }
3281
3275
  };
3282
3276
  this.inp.setValue = function (v) {
3283
3277
  if (v === null) {
@@ -3317,6 +3311,17 @@
3317
3311
  _this.onFocusIn();
3318
3312
  };
3319
3313
  };
3314
+ FormBankCardComponent.prototype.setIcon = function () {
3315
+ var _this = this;
3316
+ console.log(this.part1.data().toString() + this.part2.data().toString());
3317
+ var b = this.banks.filter(function (x) { return x.startWith.includes(_this.part1.data().toString() + _this.part2.data().toString()); });
3318
+ if (b.length > 0) {
3319
+ $__namespace(this.inputIcon.nativeElement).removeClass('fa-money-check').addClass(b[0].name);
3320
+ }
3321
+ else {
3322
+ $__namespace(this.inputIcon.nativeElement).addClass('fa-money-check').removeClass(this.banks.map(function (x) { return x.name; }));
3323
+ }
3324
+ };
3320
3325
  FormBankCardComponent.prototype.changeFocus = function (p, a) {
3321
3326
  if (p === 'Part1') {
3322
3327
  if (a === 'Tab' || a === 'Enter') {