tnx-shared 5.1.352 → 5.1.353

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.
@@ -48490,7 +48490,6 @@
48490
48490
  this.data = [];
48491
48491
  this.allowViewAll = false;
48492
48492
  this.isDynamicHeight = false;
48493
- this.onTabChange = new i0.EventEmitter();
48494
48493
  this.activeCodeChange = new i0.EventEmitter();
48495
48494
  this.template = {};
48496
48495
  this.onlyIcon = false;
@@ -48571,11 +48570,32 @@
48571
48570
  this.styleClass = result;
48572
48571
  };
48573
48572
  TnTabViewComponent.prototype.handleTabChange = function (evt) {
48573
+ var e_1, _a;
48574
48574
  this.currentTabIndex = evt.index;
48575
- this.setActiveTabCodeAndFireEvent();
48575
+ var index = 0;
48576
+ try {
48577
+ for (var _b = __values(this.data), _c = _b.next(); !_c.done; _c = _b.next()) {
48578
+ var item = _c.value;
48579
+ if (!item.hidden && this.template[item.code]) {
48580
+ if (index == this.currentTabIndex) {
48581
+ this.currentTabCode = item.code;
48582
+ break;
48583
+ }
48584
+ index++;
48585
+ }
48586
+ }
48587
+ }
48588
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
48589
+ finally {
48590
+ try {
48591
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
48592
+ }
48593
+ finally { if (e_1) throw e_1.error; }
48594
+ }
48595
+ this.activeCodeChange.emit(this.currentTabCode);
48576
48596
  };
48577
48597
  TnTabViewComponent.prototype.setActiveTabCodeAndFireEvent = function () {
48578
- var e_1, _a;
48598
+ var e_2, _a;
48579
48599
  var index = -1;
48580
48600
  var firsItem = null;
48581
48601
  var lastItem = null;
@@ -48594,12 +48614,12 @@
48594
48614
  }
48595
48615
  }
48596
48616
  }
48597
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
48617
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
48598
48618
  finally {
48599
48619
  try {
48600
48620
  if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
48601
48621
  }
48602
- finally { if (e_1) throw e_1.error; }
48622
+ finally { if (e_2) throw e_2.error; }
48603
48623
  }
48604
48624
  // Nếu có item display thì ms set active
48605
48625
  if (index > -1) {
@@ -48609,10 +48629,6 @@
48609
48629
  this.currentTabCode = firsItem.code;
48610
48630
  }
48611
48631
  this.activeCodeChange.emit(this.currentTabCode);
48612
- this.onTabChange.emit({
48613
- index: this.currentTabIndex,
48614
- code: this.currentTabCode
48615
- });
48616
48632
  }
48617
48633
  };
48618
48634
  return TnTabViewComponent;
@@ -48634,7 +48650,6 @@
48634
48650
  allowViewAll: [{ type: i0.Input }],
48635
48651
  activeCode: [{ type: i0.Input }],
48636
48652
  isDynamicHeight: [{ type: i0.Input }],
48637
- onTabChange: [{ type: i0.Output }],
48638
48653
  activeCodeChange: [{ type: i0.Output }]
48639
48654
  };
48640
48655