Skip to content

Commit 4752be8

Browse files
committed
Merge branch 'v2-dev' into v2-fix-tests
2 parents c6fb118 + 05579dc commit 4752be8

File tree

5 files changed

+29
-15
lines changed

5 files changed

+29
-15
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-ellipse-progress",
3-
"version": "2.0.0-alpha.6",
3+
"version": "2.0.0-alpha.7",
44
"private": false,
55
"description": "A Vue.js component to create beautiful animated circular progress bars",
66
"main": "./dist/veprogress.umd.min.js",

src/App.vue

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,29 @@
3939
</div>-->
4040
<div style="border: 1px solid red; display: inline-block">
4141
<ve-progress
42-
:size="600"
43-
:angle="0"
44-
line-position="out 26"
45-
empty-line-position="out 20"
46-
empty-color-fill="transparent"
47-
color-fill="red"
42+
:size="200"
4843
:progress="progress"
44+
:legend="1315.56"
45+
animation="rs 2000 500"
46+
:loading="loading"
47+
:reverse="true"
48+
:thickness="20"
49+
:empty-thickness="10"
50+
dot="10 red"
51+
:loader="{ thickness: 40, color: 'red' }"
52+
line-mode="bottom"
4953
:no-data="noData"
54+
:determinate="determinate"
5055
>
56+
<template v-slot:default="{ counterTick }">
57+
<span
58+
:style="` transition: 0.5s; font-weight: bold; font-size: 1.6rem; color: ${
59+
counterTick.currentValue < 600 ? 'red' : 'yellow'
60+
};`"
61+
>
62+
{{ formattedPrice(counterTick.currentValue) }}
63+
</span>
64+
</template>
5165
</ve-progress>
5266
</div>
5367
<ve-progress

src/components/VueEllipseProgress.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
<div class="ep-legend--container" :style="{ maxWidth: `${size}px` }">
1212
<div
1313
class="ep-legend--value"
14-
v-if="legend && !isMultiple"
14+
v-if="!hideLegend && !isMultiple"
1515
:class="[legendClass, { 'ep-hidden': shouldHideLegendValue }]"
1616
:style="{ fontSize, color: fontColor }"
1717
>
18-
<counter :value="legendVal" :animation="normalizedCircles[0].animation" :loading="loading">
18+
<counter :value="computedLegend" :animation="normalizedCircles[0].animation" :loading="loading">
1919
<template v-slot:default="{ counterTick }">
2020
<span v-if="legendFormatter">
2121
<span v-if="isHTML" v-html="legendFormatter(counterTick)"></span>
@@ -49,11 +49,11 @@ export default {
4949
counterTick: {},
5050
}),
5151
computed: {
52-
legendVal() {
52+
computedLegend() {
5353
if (this.loading || this.noData) {
5454
return 0;
5555
}
56-
return this.legendValue ? this.legendValue : getNumberIfValid(this.progress) || 0;
56+
return this.legend ? this.legend : getNumberIfValid(this.progress) || 0;
5757
},
5858
shouldHideLegendValue() {
5959
return !this.isDataAvailable || this.loading;

src/components/interface.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const options = {
3838
require: true,
3939
validator: (val) => val >= -100 && val <= 100,
4040
},
41-
legendValue: {
41+
legend: {
4242
type: [Number, String],
4343
required: false,
4444
validator: (value) => !Number.isNaN(parseFloat(value.toString().replace(",", "."))),
@@ -105,10 +105,10 @@ const options = {
105105
return isValidType && isValidDuration && isValidDelay;
106106
},
107107
},
108-
legend: {
108+
hideLegend: {
109109
type: Boolean,
110110
required: false,
111-
default: true,
111+
default: false,
112112
},
113113
legendClass: {
114114
type: String,

tests/unit/container.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe("[ EllipseProgressContainer.vue ]", () => {
6969
it("replaces the progress as the legend of the circle", () => {
7070
const legendValue = 324;
7171
wrapper.setProps({ legendValue });
72-
expect(wrapper.vm.legendVal).to.equal(legendValue);
72+
expect(wrapper.vm.computedLegend).to.equal(legendValue);
7373
expect(wrapper.vm.progress).to.equal(progress);
7474
});
7575
});

0 commit comments

Comments
 (0)