core/tabs/tabs-outlet.component.ts
OnDestroy
AfterContentInit
OnChanges
| selector | c8y-tabs-outlet,c8y-ui-tabs |
| templateUrl | ./tabs-outlet.component.html |
Properties |
Methods |
Inputs |
HostBindings |
Accessors |
constructor(router: Router, renderer: Renderer2, el: ElementRef, header: HeaderService)
|
|||||||||||||||
|
Parameters :
|
| navigatorOpen |
Type : boolean
|
Default value : false
|
| orientation |
Type : "vertical" | "horizontal"
|
Default value : 'vertical'
|
| tabs |
Type : any[]
|
Default value : []
|
| class.navigator-open |
Type : boolean
|
| class.page-tabs |
Type : any
|
| class.page-tabs-horizontal |
Type : boolean
|
| class.page-tabs-vertical |
Type : boolean
|
| isActive | ||||||
isActive(tab: Tab)
|
||||||
|
Parameters :
Returns :
any
|
| navigateTo | ||||
navigateTo(path)
|
||||
|
Parameters :
Returns :
void
|
| ngAfterContentInit |
ngAfterContentInit()
|
|
Returns :
void
|
| ngOnChanges | ||||||
ngOnChanges(changes: SimpleChanges)
|
||||||
|
Parameters :
Returns :
void
|
| ngOnDestroy |
ngOnDestroy()
|
|
Returns :
void
|
| scroll | ||||||||
scroll(direction: "right" | "left")
|
||||||||
|
Parameters :
Returns :
void
|
| showLeft |
Default value : false
|
| showRight |
Default value : false
|
| isNavigatorOpen |
getisNavigatorOpen()
|
| hasTabs |
gethasTabs()
|
| isHorizontal |
getisHorizontal()
|
| isVertical |
getisVertical()
|
<div
class="tabContainer hidden-xs"
#container
>
<button
class="tabs-slider tabs-slider-left"
title="{{ 'Scroll to the left' | translate }}"
type="button"
#left
*ngIf="showLeft || showRight"
[disabled]="!showLeft"
(click)="scroll('left')"
>
<i [c8yIcon]="'chevron-left'"></i>
</button>
<button
class="tabs-slider tabs-slider-right"
title="{{ 'Scroll to the right' | translate }}"
type="button"
#right
*ngIf="showRight || showLeft"
[disabled]="!showRight"
(click)="scroll('right')"
>
<i [c8yIcon]="'chevron-right'"></i>
</button>
<div
class="nav nav-tabs nav-tabsc8y"
role="list"
#tabsContainer
>
<ng-container *ngFor="let tab of tabs">
<div
role="listitem"
[ngClass]="{ active: rla?.isActive }"
*ngIf="!tab.component"
>
<a
title="{{ tab?.label | translate }}"
[routerLink]="tab.path"
routerLinkActive
#rla="routerLinkActive"
>
<i
[c8yIcon]="tab?.icon"
*ngIf="!tab.template && tab?.icon"
></i>
<span *ngIf="!tab.template && !tab.component">
{{ tab?.label | translate }}
</span>
</a>
<ng-container *ngTemplateOutlet="tab.template; injector: tab.injector"></ng-container>
</div>
<ng-container *ngComponentOutlet="tab.component; injector: tab.injector"></ng-container>
</ng-container>
</div>
</div>
<div class="visible-xs mobile-tabs">
<ul class="list-unstyled d-flex m-b-0">
<li class="c8y-select-wrapper flex-grow">
<select
(change)="navigateTo($event.target.value)"
#select
>
<ng-container *ngFor="let tab of tabs">
<option
*ngIf="!tab.component"
[value]="tab.path"
[selected]="isActive(tab)"
>
{{ tab?.label | translate }}
</option>
</ng-container>
</select>
</li>
<ng-container *ngFor="let tab of tabs">
<ng-container *ngIf="tab.component">
<ng-container *ngComponentOutlet="tab.component; injector: tab.injector"></ng-container>
</ng-container>
</ng-container>
</ul>
</div>