-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(progressbar): value input can handle array of staked data (#2037)
* fix(progressbar): bs4 progressbar wip * refactor(progressbar): get rid of unnecessary input params, rework bs3 stacked demo * refactor(progressbar): string setters, rename vars, remove unnecessary operations
- Loading branch information
Showing
9 changed files
with
56 additions
and
49 deletions.
There are no files selected for viewing
13 changes: 5 additions & 8 deletions
13
demo/src/app/components/+progressbar/demos/bs3/stacked/stacked.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
<bs-progress> | ||
<bar *ngFor="let baz of stacked" [value]="baz.value" [type]="baz?.type"> | ||
<span *ngIf="baz.value > 5">{{baz?.value}}%</span> | ||
</bar> | ||
</bs-progress> | ||
|
||
<div class="row col-lg-12"> | ||
<progressbar class="progress" [value]="stacked" max="100"></progressbar> | ||
</div> | ||
<br> | ||
<div class="row col-md-12"> | ||
<button type="button" class="btn btn-sm btn-primary" (click)="randomStacked()" style="margin: 15px 0;">Randomize | ||
</button> | ||
<button type="button" class="btn btn-sm btn-primary" (click)="randomStacked()">Randomize</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
demo/src/app/components/+progressbar/demos/bs4/dynamic/dynamic.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<progress class="progress progress-striped progress-animated" [max]="max" [value]="dynamic"> | ||
<progressbar class="progress progress-striped progress-animated" [max]="max" [value]="dynamic"> | ||
<span style="color:white; white-space:nowrap;">{{dynamic}} / {{max}}</span> | ||
</progress> | ||
</progressbar> | ||
|
||
<small><em>No animation</em></small> | ||
<progress class="progress progress-success" [value]="dynamic" [max]="100"><b>{{dynamic}}%</b></progress> | ||
<progressbar class="progress progress-success" [value]="dynamic" [max]="100" type="success"><b>{{dynamic}}%</b></progressbar> | ||
|
||
<small><em>Object (changes type based on value)</em></small> | ||
<progress class="progress progress-striped progress-animated active progress-{{ type }}" [value]="dynamic" [max]="max"> | ||
<progressbar class="progress progress-striped progress-animated" [value]="dynamic" [max]="max" [type]="type"> | ||
{{type}} <i *ngIf="showWarning">!!! Watch out !!!</i> | ||
</progress> | ||
</progressbar> | ||
|
||
<button type="button" class="btn btn-sm btn-primary" (click)="random()">Randomize</button> |
13 changes: 2 additions & 11 deletions
13
demo/src/app/components/+progressbar/demos/bs4/stacked/stacked.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,7 @@ | ||
<div class="row col-lg-12"> | ||
<!-- todo: implement as component --> | ||
<progress *ngFor="let baz of stacked" | ||
class="progress progress-{{ baz?.type }}" | ||
style="float: left;" | ||
[ngStyle]="{width: baz.value + '%'}" | ||
[value]="baz.value" [max]="baz.max"> | ||
<span *ngIf="baz.value > 3">{{baz?.value}}%</span> | ||
</progress> | ||
<!-- gray background --> | ||
<progress class="progress" value="0" max="100" style="width: 100%;"></progress> | ||
<progressbar class="progress" [value]="stacked" max="100"></progressbar> | ||
</div> | ||
|
||
<br> | ||
<div class="row col-md-12"> | ||
<button type="button" class="btn btn-sm btn-primary" (click)="randomStacked()">Randomize</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
demo/src/app/components/+progressbar/demos/bs4/static/static.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<div class="row"> | ||
<div class="col-sm-4"> | ||
<progress class="progress" value="55" max="100"></progress> | ||
<progressbar class="progress" value="55" max="100"></progressbar> | ||
</div> | ||
<div class="col-sm-4"> | ||
<progress class="progress progress-striped" value="22" max="100" type="warning">22%</progress> | ||
<progressbar class="progress progress-striped" value="22" max="100" type="warning">22%</progressbar> | ||
</div> | ||
<div class="col-sm-4"> | ||
<progress class="progress progress-striped active" max="200" value="166" type="danger"><i>166 / 200</i></progress> | ||
<progressbar class="progress progress-striped active" max="200" value="166" type="danger"><i>166 / 200</i></progressbar> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters