@@ -24,10 +24,12 @@ import {
24
24
changeDetection : ChangeDetectionStrategy . OnPush ,
25
25
template : `
26
26
<div class="bar-gauge" (htLayoutChange)="this.checkNearMaxValue()">
27
- <div *ngIf="this.title" class="title">{{ this.title | htDisplayTitle }}</div>
28
- <div class="count">
29
- {{ this.totalValue | number }} / {{ this.maxValue | number }}
30
- <span class="units" *ngIf="this.units">{{ this.units }}</span>
27
+ <div class="header-data" [ngClass]="this.display">
28
+ <div *ngIf="this.title" class="title">{{ this.title | htDisplayTitle }}</div>
29
+ <div class="count">
30
+ {{ this.totalValue | number }} / {{ this.maxValue | number }}
31
+ <span class="units" *ngIf="this.units">{{ this.units }}</span>
32
+ </div>
31
33
</div>
32
34
<div class="bar">
33
35
<div #maxValueBar class="max-value-bar" [ngClass]="{ 'over-max-value': this.overMaxValue }">
@@ -45,7 +47,7 @@ import {
45
47
</div>
46
48
</div>
47
49
</div>
48
- <div class="legend">
50
+ <div *ngIf="this.display === ' ${ BarGaugeStyle . Regular } '" class="legend">
49
51
<div class="legend-item" *ngFor="let segment of this.barSegments">
50
52
<span class="legend-symbol" [style.backgroundColor]="segment.color"></span>
51
53
<span class="legend-value" *ngIf="this.barSegments.length > 1">{{ segment.value | number }}</span>
@@ -79,6 +81,9 @@ export class BarGaugeComponent implements OnChanges, AfterViewInit {
79
81
@Input ( )
80
82
public segments ?: Segment [ ] = [ ] ;
81
83
84
+ @Input ( )
85
+ public display : BarGaugeStyle = BarGaugeStyle . Regular ;
86
+
82
87
public barSegments : BarSegment [ ] = [ ] ;
83
88
public totalValue : number = 0 ;
84
89
public overMaxValue : boolean = false ;
@@ -148,3 +153,8 @@ export interface Segment {
148
153
interface BarSegment extends Segment {
149
154
percentage : number ;
150
155
}
156
+
157
+ export const enum BarGaugeStyle {
158
+ Regular = 'regular' ,
159
+ Compact = 'compact'
160
+ }
0 commit comments