Skip to content

Commit

Permalink
docs(progressbar): extend documentation for types (#3393)
Browse files Browse the repository at this point in the history
This change outlines that types are based on Bootstrap background color
variants, thus allowing types like 'dark', 'light', etc.

Fixes #3391
  • Loading branch information
peterblazejewicz authored and maxokorokov committed Oct 4, 2019
1 parent d0654c1 commit 6ea487c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
Expand Up @@ -2,3 +2,6 @@
<p><ngb-progressbar type="info" [value]="50"></ngb-progressbar></p>
<p><ngb-progressbar type="warning" [value]="75"></ngb-progressbar></p>
<p><ngb-progressbar type="danger" [value]="100"></ngb-progressbar></p>
<p><ngb-progressbar type="primary" [value]="75"></ngb-progressbar></p>
<p><ngb-progressbar type="secondary" [value]="50"></ngb-progressbar></p>
<p><ngb-progressbar type="dark" [value]="25"></ngb-progressbar></p>
Expand Up @@ -2,4 +2,4 @@
<p><ngb-progressbar value="250"></ngb-progressbar></p>

<p>This progress bar uses the customized default values, but changes the type using an input.</p>
<p><ngb-progressbar value="500" type="info"></ngb-progressbar></p>
<p><ngb-progressbar value="500" type="dark"></ngb-progressbar></p>
1 change: 1 addition & 0 deletions src/progressbar/progressbar-config.spec.ts
Expand Up @@ -9,5 +9,6 @@ describe('ngb-progressbar-config', () => {
expect(config.animated).toBe(false);
expect(config.type).toBeUndefined();
expect(config.showValue).toBe(false);
expect(config.height).toBeUndefined();
});
});
4 changes: 4 additions & 0 deletions src/progressbar/progressbar.spec.ts
Expand Up @@ -138,6 +138,10 @@ describe('ngb-progressbar', () => {
fixture.componentInstance.type = 'info';
fixture.detectChanges();
expect(getProgressbar(fixture.nativeElement)).toHaveCssClass('bg-info');

fixture.componentInstance.type = 'dark';
fixture.detectChanges();
expect(getProgressbar(fixture.nativeElement)).toHaveCssClass('bg-dark');
});

it('accepts animated as normal attr', () => {
Expand Down
3 changes: 2 additions & 1 deletion src/progressbar/progressbar.ts
Expand Up @@ -44,7 +44,8 @@ export class NgbProgressbar {
/**
* The type of the progress bar.
*
* Currently Bootstrap supports `"success"`, `"info"`, `"warning"` or `"danger"`.
* Supports types based on Bootstrap background color variants, like:
* `"success"`, `"info"`, `"warning"`, `"danger"`, `"primary"`, `"secondary"`, `"dark"` and so on.
*/
@Input() type: string;

Expand Down

0 comments on commit 6ea487c

Please sign in to comment.