@ascentgl/ads-ui 20.15.1 → 20.16.0

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.
@@ -7652,10 +7652,24 @@ class AdsTabsComponent {
7652
7652
  }
7653
7653
  ngAfterViewInit() {
7654
7654
  const tabGroup = this.tabGroup();
7655
- const handleClick = tabGroup._handleClick;
7655
+ const originalHandleClick = tabGroup._handleClick;
7656
7656
  tabGroup._handleClick = (tab, tabHeader, index) => {
7657
- const originalClick = () => handleClick.call(tabGroup, tab, tabHeader, index);
7658
- this.tabChange.emit({ index, originalClick });
7657
+ // Check if there are any subscribers to the tabChange event
7658
+ if (this.tabChange.observed) {
7659
+ // Custom logic is provided - emit event and let parent decide
7660
+ const originalClick = () => {
7661
+ originalHandleClick.call(tabGroup, tab, tabHeader, index);
7662
+ this.selectedIndex = index;
7663
+ this.selectedIndexChange.emit(index);
7664
+ };
7665
+ this.tabChange.emit({ index, originalClick });
7666
+ }
7667
+ else {
7668
+ // No custom logic - proceed with normal tab behavior
7669
+ originalHandleClick.call(tabGroup, tab, tabHeader, index);
7670
+ this.selectedIndex = index;
7671
+ this.selectedIndexChange.emit(index);
7672
+ }
7659
7673
  };
7660
7674
  }
7661
7675
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AdsTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }