This repository has been archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.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): add
max
attribute & support transclusion
* General refactor. Move logic to controller. * Remove `onFull` & `onEmpty` handlers. * Remove automatic types and stacked types. * `progress` & `bar` transclude content to support text & extra elements. BREAKING CHANGE: The onFull/onEmpty handlers & auto/stacked types have been removed. To migrate your code change your markup like below. Before: <progress percent="var" class="progress-warning"></progress> After: <progressbar value="var" type="warning"></progressbar> and for stacked instead of passing array/objects you can do: <progress><bar ng-repeat="obj in objs" value="obj.var" type="{{obj.type}}"></bar></progress>
- Loading branch information
Showing
8 changed files
with
247 additions
and
394 deletions.
There are no files selected for viewing
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,27 +1,23 @@ | ||
<div ng-controller="ProgressDemoCtrl" class="well"> | ||
<h2>Static</h2> | ||
|
||
<h3>Static</h3> | ||
<div class="row-fluid"> | ||
<div class="span4"><progress percent="55"></progress></div> | ||
<div class="span4"><progress percent="22" class="progress-warning progress-striped"></progress></div> | ||
<div class="span4"><progress percent="88" class="progress-danger progress-striped active"></div> | ||
<div class="span4"><progressbar value="55"></progressbar></div> | ||
<div class="span4"><progressbar class="progress-striped" value="22" type="warning">22%</progressbar></div> | ||
<div class="span4"><progressbar class="progress-striped active" max="200" value="166" type="danger"><i>166 / 200</i></progressbar></div> | ||
</div> | ||
|
||
<h2>Dynamic <button class="btn btn-primary" type="button" ng-click="random()">Randomize</button></h2> | ||
<pre>Value: {{dynamic}}</pre> | ||
<progress percent="dynamic"></progress> | ||
|
||
<h3>Dynamic <button class="btn btn-small btn-primary" type="button" ng-click="random()">Randomize</button></h3> | ||
<progressbar max="max" value="dynamic"><span style="color:black; white-space:nowrap;">{{dynamic}} / {{max}}</span></progressbar> | ||
|
||
<small><em>No animation</em></small> | ||
<progress percent="dynamic" class="progress-success" animate="false"></progress> | ||
<progressbar animate="false" value="dynamic" type="success"><b>{{dynamic}}%</b></progressbar> | ||
|
||
<small><em>Object (changes type based on value)</em></small> | ||
<progress percent="dynamicObject" class="progress-striped active"></progress> | ||
<progressbar class="progress-striped active" value="dynamic" type="{{type}}">{{type}} <i ng-show="showWarning">!!! Watch out !!!</i></progressbar> | ||
|
||
<h2>Stacked <button class="btn btn-primary" type="button" ng-click="randomStacked()">Randomize</button></h2> | ||
<small><em>Array values with automatic types</em></small> | ||
<pre>Value: {{stackedArray}}</pre> | ||
<progress percent="stackedArray" auto-type="true"></progress> | ||
|
||
<small><em>Objects</em></small> | ||
<pre>Value: {{stacked}}</pre> | ||
<progress percent="stacked"></progress> | ||
|
||
<h3>Stacked <button class="btn btn-small btn-primary" type="button" ng-click="randomStacked()">Randomize</button></h3> | ||
<progress><bar ng-repeat="bar in stacked" value="bar.value" type="{{bar.type}}"><span ng-hide="bar.value < 5">{{bar.value}}%</span></bar></progress> | ||
|
||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,29 @@ | ||
A lightweight progress bar directive that is focused on providing progress visualization! | ||
A progress bar directive that is focused on providing feedback on the progress of a workflow or action. | ||
|
||
The progress bar directive supports multiple (stacked) bars into the same element, optional transition animation, event handler for full & empty state and many more. | ||
It supports multiple (stacked) bars into the same `<progress>` element or a single `<progressbar>` elemtnt with optional `max` attribute and transition animations. | ||
|
||
### Settings ### | ||
|
||
#### `<progressbar>` #### | ||
|
||
* `value` <i class="icon-eye-open"></i> | ||
: | ||
The current value of progress completed. | ||
|
||
* `type` | ||
_(Default: null)_ : | ||
Style type. Possible values are 'success', 'warning' etc. | ||
|
||
* `max` | ||
_(Default: 100)_ : | ||
A number that specifies the total value of bars that is required. | ||
|
||
* `animate` | ||
_(Default: true)_ : | ||
Whether bars use transitions to achieve the width change. | ||
|
||
|
||
### Stacked ### | ||
|
||
Place multiple `<bars>` into the same `<progress>` element to stack them. | ||
`<progress>` supports `max` and `animate` & `<bar>` supports `value` and `type` attributes. |
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
Oops, something went wrong.