Skip to content

Commit 6696623

Browse files
vitaliy-bobrovDomainv
authored andcommitted
feat(progressbar): create type interface (#5440)
1 parent b0a448b commit 6696623

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

src/progressbar/bar.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from '@angular/core';
99

1010
import { ProgressbarComponent } from './progressbar.component';
11+
import { ProgressbarType } from './progressbar-type.interface';
1112
import { isBs3 } from 'ngx-bootstrap/utils';
1213

1314
// todo: number pipe
@@ -32,7 +33,7 @@ export class BarComponent implements OnInit, OnDestroy {
3233
max: number;
3334

3435
/** provide one of the four supported contextual classes: `success`, `info`, `warning`, `danger` */
35-
@Input() type: string;
36+
@Input() type: ProgressbarType;
3637

3738
/** current value of progress bar */
3839
@Input()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type ProgressbarType = 'success' | 'info' | 'warning' | 'danger';

src/progressbar/progressbar.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component, HostBinding, Input } from '@angular/core';
22
import { ProgressbarConfig } from './progressbar.config';
3+
import { ProgressbarType } from './progressbar-type.interface';
34
import { isBs3 } from 'ngx-bootstrap/utils';
45
import { BarComponent } from './bar.component';
56

@@ -34,7 +35,7 @@ export class ProgressbarComponent {
3435
}
3536

3637
/** provide one of the four supported contextual classes: `success`, `info`, `warning`, `danger` */
37-
@Input() type: string;
38+
@Input() type: ProgressbarType;
3839
/** current value of progress bar. Could be a number or array of objects
3940
* like {"value":15,"type":"info","label":"15 %"}
4041
*/

src/progressbar/public_api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ export { BarComponent } from './bar.component';
22
export { ProgressbarComponent } from './progressbar.component';
33
export { ProgressbarModule } from './progressbar.module';
44
export { ProgressbarConfig } from './progressbar.config';
5+
export { ProgressbarType } from './progressbar-type.interface';

0 commit comments

Comments
 (0)