All files / formly/structural/si-formly-tabset si-formly-object-tabset.component.ts

50% Statements 2/4
0% Branches 0/3
0% Functions 0/1
33.33% Lines 1/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22                            1x              
/**
 * Copyright (c) Siemens 2016 - 2025
 * SPDX-License-Identifier: MIT
 */
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { FieldType, FormlyModule } from '@ngx-formly/core';
import { SiTabComponent, SiTabsetComponent } from '@siemens/element-ng/tabs';
 
@Component({
  selector: 'si-formly-object-tabset',
  imports: [SiTabsetComponent, SiTabComponent, FormlyModule],
  templateUrl: './si-formly-object-tabset.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class SiFormlyObjectTabsetComponent extends FieldType {
  protected tabIndexChange(isActive: boolean, selectedTab: number): void {
    Iif (this.options?.formState && isActive) {
      this.options.formState.selectedTabIndex = selectedTab;
    }
  }
}