Skip to content

Commit

Permalink
feat(tabset): allow arbitrary nav type (#2592)
Browse files Browse the repository at this point in the history
Closes #1661
  • Loading branch information
pkozlowski-opensource committed Aug 10, 2018
1 parent 0647212 commit 1e68401
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/tabset/tabset.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,18 @@ describe('ngb-tabset', () => {
expect(fixture.nativeElement.querySelector('ul')).not.toHaveCssClass('nav-tabs');
});

it('should allow arbitrary nav type', () => {
const fixture = createTestComponent(`
<ngb-tabset type="bordered">
<ngb-tab title="bar"><ng-template ngbTabContent>Bar</ng-template></ngb-tab>
</ngb-tabset>
`);

expect(fixture.nativeElement.querySelector('ul')).toHaveCssClass('nav-bordered');
expect(fixture.nativeElement.querySelector('ul')).not.toHaveCssClass('nav-pills');
expect(fixture.nativeElement.querySelector('ul')).not.toHaveCssClass('nav-tabs');
});

it('should have the "justify-content-start" class by default', () => {
const fixture = createTestComponent(`
<ngb-tabset>
Expand Down
5 changes: 3 additions & 2 deletions src/tabset/tabset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ export class NgbTabset implements AfterContentChecked {
@Input() orientation: 'horizontal' | 'vertical';

/**
* Type of navigation to be used for tabs. Can be one of 'tabs' or 'pills'.
* Type of navigation to be used for tabs. Can be one of Bootstrap defined types ('tabs' or 'pills') or an arbitrary
* string (for custom themes).
*/
@Input() type: 'tabs' | 'pills';
@Input() type: 'tabs' | 'pills' | string;

/**
* A tab change event fired right before the tab selection happens. See NgbTabChangeEvent for payload details
Expand Down

0 comments on commit 1e68401

Please sign in to comment.