@neoprototype/neop-ui-lib 1.1.3 → 1.1.4

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.
@@ -2581,8 +2581,13 @@ class NpTabComponent {
2581
2581
  this.setTabActiveDefault();
2582
2582
  }
2583
2583
  setTabActiveDefault() {
2584
- if (this.tabActive) {
2585
- this.indexActive = this.tabs?.findIndex((x) => x.key === this.tabActive);
2584
+ if (this.tabActive !== undefined && this.tabActive !== null && this.tabActive !== '') {
2585
+ if (typeof this.tabActive === 'number') {
2586
+ this.indexActive = this.tabActive;
2587
+ }
2588
+ else {
2589
+ this.indexActive = this.tabs?.findIndex((x) => x.key === this.tabActive);
2590
+ }
2586
2591
  return;
2587
2592
  }
2588
2593
  if (!this.isLink) {
@@ -2641,16 +2646,16 @@ class NpTabComponent {
2641
2646
  const pageWidth = wrapper.clientWidth;
2642
2647
  wrapper.scrollBy({ left: pageWidth, behavior: 'smooth' });
2643
2648
  }
2644
- ngAfterViewInit() {
2645
- const wrapper = this.headerWrapperRef?.nativeElement;
2646
- if (wrapper) {
2647
- wrapper.addEventListener('scroll', this.updateScrollButtons);
2648
- }
2649
- window.addEventListener('resize', this.updateScrollButtons);
2650
- setTimeout(() => {
2651
- this.updateScrollButtons();
2652
- }, 0);
2653
- }
2649
+ // ngAfterViewInit(): void {
2650
+ // const wrapper = this.headerWrapperRef?.nativeElement;
2651
+ // if (wrapper) {
2652
+ // wrapper.addEventListener('scroll', this.updateScrollButtons);
2653
+ // }
2654
+ // window.addEventListener('resize', this.updateScrollButtons);
2655
+ // setTimeout(() => {
2656
+ // this.updateScrollButtons();
2657
+ // }, 0);
2658
+ // }
2654
2659
  ngOnDestroy() {
2655
2660
  const wrapper = this.headerWrapperRef?.nativeElement;
2656
2661
  if (wrapper) {