|
1 | 1 | import { Component, OnInit, Input, ContentChild } from '@angular/core'; |
| 2 | + |
2 | 3 | import { BoxInfoContentDirective, BoxInfoFooterDirective, BoxInfoHeaderDirective } from './box-info.directive'; |
3 | 4 |
|
4 | | -/* |
5 | | - * |
6 | | - */ |
| 5 | + |
7 | 6 | @Component({ |
8 | 7 | selector: 'mk-box-info', |
9 | 8 | styleUrls: ['./box-info.component.css'], |
10 | 9 | templateUrl: './box-info.component.html' |
11 | 10 | }) |
12 | 11 | export class BoxInfoComponent implements OnInit { |
13 | | - public progressBarBg: string; |
14 | | - |
15 | | - @Input() public backgroundColor: string; |
| 12 | + @Input() public backgroundColor?: string; |
16 | 13 | @Input() public contentStyleClass = 'info-box-number'; |
17 | | - @Input() public contentColor: string; |
18 | | - @Input() public footer: string; |
19 | | - @Input() public footerColor: string; |
| 14 | + @Input() public contentColor?: string; |
| 15 | + @Input() public footer?: string; |
| 16 | + @Input() public footerColor?: string; |
20 | 17 | @Input() public footerStyleClass = 'progress-description'; |
21 | | - @Input() public header: string; |
22 | | - @Input() public headerColor: string; |
| 18 | + @Input() public header?: string; |
| 19 | + @Input() public headerColor?: string; |
23 | 20 | @Input() public headerStyleClass = 'info-box-text'; |
24 | | - @Input() public iconBackgroundColor: string; |
| 21 | + @Input() public iconBackgroundColor?: string; |
25 | 22 | @Input() public iconColor = '#fff'; |
26 | 23 | @Input() public iconStyleClass = 'ion ion-bag'; |
27 | | - @Input() public progressWidth: number; |
| 24 | + @Input() public progressWidth?: number; |
28 | 25 | @Input() public styleClass = 'info-box'; |
29 | 26 |
|
30 | | - @ContentChild(BoxInfoHeaderDirective, /* TODO: add static flag */ {}) public boxInfoHeaderDirective: BoxInfoHeaderDirective; |
31 | | - @ContentChild(BoxInfoFooterDirective, /* TODO: add static flag */ {}) public boxInfoFooterDirective: BoxInfoFooterDirective; |
32 | | - @ContentChild(BoxInfoContentDirective, /* TODO: add static flag */ {}) public boxInfoContentDirective: BoxInfoContentDirective; |
| 27 | + @ContentChild(BoxInfoHeaderDirective) public boxInfoHeaderDirective?: BoxInfoHeaderDirective; |
| 28 | + @ContentChild(BoxInfoFooterDirective) public boxInfoFooterDirective?: BoxInfoFooterDirective; |
| 29 | + @ContentChild(BoxInfoContentDirective) public boxInfoContentDirective?: BoxInfoContentDirective; |
| 30 | + |
| 31 | + public progressBarBg?: string; |
33 | 32 |
|
34 | | - /** |
35 | | - * @method ngOnInit |
36 | | - */ |
37 | | - ngOnInit() { |
| 33 | + ngOnInit(): void { |
38 | 34 | if (!this.backgroundColor) { |
39 | 35 | this.progressBarBg = this.iconBackgroundColor; |
40 | 36 | } |
|
0 commit comments