Stream line <umb-progress-bar> and <umb-progress-circle>

This commit is contained in:
Bjarne Fyrstenborg
2021-08-23 23:34:48 +02:00
committed by Nathan Woulfe
parent aa48cdbbfd
commit a4e472b4d3
5 changed files with 43 additions and 21 deletions

View File

@@ -17,6 +17,7 @@ Use this directive to generate a progress bar.
@param {number} percentage (<code>attribute</code>): The progress in percentage. @param {number} percentage (<code>attribute</code>): The progress in percentage.
@param {string} size (<code>attribute</code>): The size (s, m). @param {string} size (<code>attribute</code>): The size (s, m).
@param {string} color (<code>attribute</code>): The color of the progress (primary, secondary, success, warning, danger). Success by default.
**/ **/
@@ -31,7 +32,8 @@ Use this directive to generate a progress bar.
templateUrl: 'views/components/umb-progress-bar.html', templateUrl: 'views/components/umb-progress-bar.html',
scope: { scope: {
percentage: "@", percentage: "@",
size: "@?" size: "@?",
color: "@?"
} }
}; };

View File

@@ -20,8 +20,8 @@ Use this directive to render a circular progressbar.
</div> </div>
</pre> </pre>
@param {string} size (<code>attribute</code>): This parameter defines the width and the height of the circle in pixels.
@param {string} percentage (<code>attribute</code>): Takes a number between 0 and 100 and applies it to the circle's highlight length. @param {string} percentage (<code>attribute</code>): Takes a number between 0 and 100 and applies it to the circle's highlight length.
@param {string} size (<code>attribute</code>): This parameter defines the width and the height of the circle in pixels.
@param {string} color (<code>attribute</code>): The color of the highlight (primary, secondary, success, warning, danger). Success by default. @param {string} color (<code>attribute</code>): The color of the highlight (primary, secondary, success, warning, danger). Success by default.
**/ **/
@@ -72,9 +72,9 @@ Use this directive to render a circular progressbar.
replace: true, replace: true,
templateUrl: 'views/components/umb-progress-circle.html', templateUrl: 'views/components/umb-progress-circle.html',
scope: { scope: {
size: "@?",
percentage: "@", percentage: "@",
color: "@" size: "@?",
color: "@?"
}, },
link: link link: link

View File

@@ -17,6 +17,26 @@
bottom: 0; bottom: 0;
width: 100%; width: 100%;
border-radius: 10px; border-radius: 10px;
&--primary {
background: @blue;
}
&--secondary {
background: @purple;
}
&--success {
background: @green;
}
&--warning {
background: @yellow;
}
&--danger {
background: @red;
}
} }
.umb-progress-bar--s { .umb-progress-bar--s {
@@ -27,4 +47,4 @@
.umb-progress-bar--m { .umb-progress-bar--m {
height: 10px; height: 10px;
border-radius: 10px; border-radius: 10px;
} }

View File

@@ -11,26 +11,26 @@
// circle highlight on progressbar // circle highlight on progressbar
.umb-progress-circle__highlight { .umb-progress-circle__highlight {
stroke: @green; stroke: @green;
}
.umb-progress-circle__highlight--primary { &--primary {
stroke: @blue; stroke: @blue;
} }
.umb-progress-circle__highlight--secondary { &--secondary {
stroke: @purple; stroke: @purple;
} }
.umb-progress-circle__highlight--success { &--success {
stroke: @green; stroke: @green;
} }
.umb-progress-circle__highlight--warning { &--warning {
stroke: @yellow; stroke: @yellow;
} }
.umb-progress-circle__highlight--danger { &--danger {
stroke: @red; stroke: @red;
}
} }
// circle progressbar bg // circle progressbar bg

View File

@@ -1,3 +1,3 @@
<span class="umb-progress-bar umb-progress-bar--{{size}}"> <span class="umb-progress-bar umb-progress-bar--{{size}}">
<span class="umb-progress-bar__progress" style="width: {{percentage}}%"></span> <span class="umb-progress-bar__progress umb-progress-bar__progress--{{color}}" ng-style="{'width': percentage + '%'}"></span>
</span> </span>