Skip to content

Commit

Permalink
refactor(tabset): accept icon config
Browse files Browse the repository at this point in the history
  • Loading branch information
yggg committed Aug 28, 2019
1 parent df45d4c commit 13d74cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ import { convertToBoolProperty } from '../helpers';
class="route-tab disabled"
tabindex="-1">
<a tabindex="-1" class="tab-link">
<nb-icon *ngIf="tab.icon" [icon]="tab.icon"></nb-icon>
<nb-icon *ngIf="tab.icon" [config]="tab.icon"></nb-icon>
<span *ngIf="tab.title" class="tab-text">{{ tab.title }}</span>
</a>
</li>
Expand Down
9 changes: 5 additions & 4 deletions src/framework/theme/components/tabset/tabset.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { ActivatedRoute } from '@angular/router';
import { convertToBoolProperty } from '../helpers';
import { NbComponentStatus } from '../component-status';
import { NbBadgePosition } from '../badge/badge.component';
import { NbIconConfig } from '../icon/icon.component';

/**
* Specific tab container.
Expand Down Expand Up @@ -50,10 +51,10 @@ export class NbTabComponent {
@Input() tabTitle: string;

/**
* Tab icon
* @type {string}
* Tab icon name or icon config object
* @type {string | NbIconConfig}
*/
@Input() tabIcon: string;
@Input() tabIcon: string | NbIconConfig;

/**
* Item is disabled and cannot be opened.
Expand Down Expand Up @@ -248,7 +249,7 @@ export class NbTabComponent {
[attr.tabindex]="tab.disabled ? -1 : 0"
class="tab">
<a href (click)="$event.preventDefault()" tabindex="-1" class="tab-link">
<nb-icon *ngIf="tab.tabIcon" [icon]="tab.tabIcon"></nb-icon>
<nb-icon *ngIf="tab.tabIcon" [config]="tab.tabIcon"></nb-icon>
<span *ngIf="tab.tabTitle" class="tab-text">{{ tab.tabTitle }}</span>
</a>
<nb-badge *ngIf="tab.badgeText"
Expand Down

0 comments on commit 13d74cf

Please sign in to comment.