Skip to content

Commit

Permalink
feat(tabs): added input tabId (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
lskramarov authored and pimenovoleg committed Jun 26, 2019
1 parent 7311fab commit d06ffa5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/mosaic-dev/tabs/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ export class TabsDemoComponent {
toggleBackground() {
this.background = this.background ? '' : 'primary';
}

selectedTabChange($event: any) {
console.log('selectedTabChange');
}
}


Expand Down
6 changes: 3 additions & 3 deletions packages/mosaic-dev/tabs/template.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div>
<h4>Default tabs</h4>
<mc-tab-group>
<mc-tab label="First">Content 1</mc-tab>
<mc-tab label="Second">Content 2</mc-tab>
<mc-tab-group (selectedTabChange)="selectedTabChange($event)">
<mc-tab [tabId]="'firstTab'" label="First">Content 1</mc-tab>
<mc-tab [tabId]="'secondTab'" label="Second">Content 2</mc-tab>
<mc-tab disabled label="Third">Content 3</mc-tab>
<mc-tab label="4">Content 4</mc-tab>
<mc-tab label="5">Content 5</mc-tab>
Expand Down
3 changes: 3 additions & 0 deletions packages/mosaic/tabs/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export class McTab extends mcTabMixinBase
@Input('label')
textLabel: string = '';

@Input('tabId')
tabId: string;

/** Aria label for the tab. */
@Input('aria-label')
ariaLabel: string;
Expand Down

0 comments on commit d06ffa5

Please sign in to comment.