forked from epicmaxco/vuestic-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(progress-bar): remove redundant styles * feat(progress-bar): reimplement circle progress bar * feat(progress-bar): remove old styles * feat(progress-bar): remove vertical progress bar * feat(progress-bar): fix code style * feat(progress-bar): fix code style * feat(progress-bar): reimplement horizontal progress bar * feat(progress-bar): remove 'vuestic-progress-bar' component * feat(progress-bar): move common logic into utils * feat(progress-bar): reimplement presentation * feat(progress-bar): use new circle progress on dashboard * feat(progress-bar): add colors presentation * feat(progress-bar): remove unused prop * feat(progress-bar): minor code chnages * feat(progress-bar): fix code style * feat(progress-bar): remove demo styles * feat(progress-bar): remove unused styles * feat(progress-bar): fix minor xs screen issues * feat(progress-bar): create mixin for common functionality * feat(progress-bar): final minor fixes * make naming consistent for styles, components * tweak demos, add several checks * use more & in scss * move intermediate class to root div * use relative routes for imports * feat(progress-bar): rename progress components * VaCircleProgressBar -> VaProgressCircle * VaVarticalProgressBar -> VaProgressBar
- Loading branch information
Showing
28 changed files
with
571 additions
and
893 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
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,24 +1,30 @@ | ||
<template> | ||
<div class="progress-bars"> | ||
<div class="va-row"> | ||
<div class="flex md12"> | ||
<standard-bars/> | ||
<div class="flex md12 xs12"> | ||
<horizontal-bars/> | ||
</div> | ||
</div> | ||
<div class="va-row"> | ||
<div class="flex md12"> | ||
<div class="flex md12 xs12"> | ||
<circle-bars/> | ||
</div> | ||
</div> | ||
<div class="va-row"> | ||
<div class="flex md12 xs12"> | ||
<colorful-bars/> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import HorizontalBars from './Widgets/HorizontalBars' | ||
import CircleBars from './Widgets/CircleBars' | ||
import ColorfulBars from './Widgets/ColorfulBars' | ||
import StandardBars from './Widgets/StandardBars' | ||
export default { | ||
name: 'progress-bars', | ||
components: { StandardBars, ColorfulBars }, | ||
components: { HorizontalBars, CircleBars, ColorfulBars } | ||
} | ||
</script> |
40 changes: 40 additions & 0 deletions
40
src/components/statistics/progress-bars/Widgets/CircleBars.vue
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<vuestic-widget class="progress-bar-widget" :headerText="$t('progressBars.circle')"> | ||
<div class="va-row"> | ||
<div v-for="n in 10" :key="n" class="flex xs2 md1"> | ||
<va-progress-circle :value="value * n / 10"/> | ||
</div> | ||
<div class="flex xs2 md1"> | ||
<va-progress-circle indeterminate/> | ||
</div> | ||
</div> | ||
<div class="va-row"> | ||
<div v-for="n in 10" :key="n" class="flex xs2 md1"> | ||
<va-progress-circle :value="value * n / 10" theme="Info">{{ value * n / 10 }}%</va-progress-circle> | ||
</div> | ||
<div class="flex xs2 md1"> | ||
<va-progress-circle indeterminate theme="Info"/> | ||
</div> | ||
</div> | ||
</vuestic-widget> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { | ||
value: 0 | ||
} | ||
}, | ||
mounted () { | ||
this.animateValue() | ||
}, | ||
methods: { | ||
animateValue () { | ||
setTimeout(() => { | ||
this.value = 100 | ||
}) | ||
} | ||
} | ||
} | ||
</script> |
55 changes: 22 additions & 33 deletions
55
src/components/statistics/progress-bars/Widgets/ColorfulBars.vue
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,45 +1,34 @@ | ||
<template> | ||
<vuestic-widget headerText="Colorful Bars"> | ||
<vuestic-widget class="progress-bar-widget" :headerText="$t('progressBars.colors')"> | ||
<div class="va-row"> | ||
<div class="flex sm4 md4"> | ||
{{'progressBars.basic' | translate}} | ||
<vuestic-progress-bar :value="100" theme="Danger"/> | ||
<div v-for="n in 3" :key="n" class="flex md3 xs12"> | ||
<va-progress-bar | ||
:value="value * n / 4" | ||
:theme="themes[n - 1]" | ||
>{{ themes[n - 1] }}</va-progress-bar> | ||
</div> | ||
<div class="flex sm4 md4"> | ||
{{'progressBars.thin' | translate}} | ||
<vuestic-progress-bar :value="100" size="thin" theme="Info"/> | ||
</div> | ||
<div class="flex sm4 md4"> | ||
{{'progressBars.thick' | translate}} | ||
<vuestic-progress-bar :value="100" size="thick" theme="Warning"/> | ||
</div> | ||
</div> | ||
<div class="va-row"> | ||
<div class="flex sm4 md4"> | ||
{{'progressBars.basicVertical' | translate}} | ||
<div class="pb-container"> | ||
<vuestic-progress-bar :value="100" type="vertical" theme="Success"/> | ||
</div> | ||
</div> | ||
<div class="flex sm4 md4"> | ||
{{'progressBars.thinVertical' | translate}} | ||
<div class="pb-container"> | ||
<vuestic-progress-bar :value="100" size="thin" type="vertical" | ||
theme="Black"/> | ||
</div> | ||
</div> | ||
<div class="flex sm4 md4"> | ||
{{'progressBars.circle' | translate}} | ||
<div class="pb-container"> | ||
<vuestic-progress-bar :value="100" type="circle"/> | ||
</div> | ||
<div class="flex md3 xs12"> | ||
<va-progress-bar indeterminate theme="Black">Black</va-progress-bar> | ||
</div> | ||
</div> | ||
</vuestic-widget> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'standard-bars', | ||
data () { | ||
return { | ||
value: 0, | ||
themes: ['Danger', 'Success', 'Warning'] | ||
} | ||
}, | ||
mounted () { | ||
this.animateValue() | ||
}, | ||
methods: { | ||
animateValue () { | ||
setTimeout(() => (this.value = 100)) | ||
} | ||
} | ||
} | ||
</script> |
65 changes: 65 additions & 0 deletions
65
src/components/statistics/progress-bars/Widgets/HorizontalBars.vue
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<template> | ||
<vuestic-widget class="progress-bar-widget" :headerText="$t('progressBars.horizontal')"> | ||
<div class="va-row"> | ||
<div class="flex md4 xs12"> | ||
<va-progress-bar :value="value / 3"/> | ||
</div> | ||
<div class="flex md4 xs12"> | ||
<va-progress-bar :value="bufferValues.value" :buffer="bufferValues.buffer"/> | ||
</div> | ||
<div class="flex md4 xs12"> | ||
<va-progress-bar indeterminate/> | ||
</div> | ||
</div> | ||
<div class="va-row"> | ||
<div class="flex md4 xs12"> | ||
<va-progress-bar :value="value * 2 / 3" theme="Info">66%</va-progress-bar> | ||
</div> | ||
<div class="flex md4 xs12"> | ||
<va-progress-bar | ||
:value="bufferValues.value" | ||
:buffer="bufferValues.buffer" | ||
theme="Info" | ||
>Buffering</va-progress-bar> | ||
</div> | ||
<div class="flex md4 xs12"> | ||
<va-progress-bar indeterminate theme="Info">Loading...</va-progress-bar> | ||
</div> | ||
</div> | ||
</vuestic-widget> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { | ||
value: 0, | ||
bufferValues: { | ||
value: 0, | ||
buffer: 0 | ||
} | ||
} | ||
}, | ||
mounted () { | ||
this.animateValue() | ||
this.animateBufferValues() | ||
}, | ||
methods: { | ||
animateValue () { | ||
setTimeout(() => { | ||
this.value = 100 | ||
}) | ||
}, | ||
animateBufferValues () { | ||
const interval = setInterval(() => { | ||
this.bufferValues.value += 2 + Math.floor(Math.random() * 2) | ||
this.bufferValues.buffer += 2 + Math.floor(Math.random() * 4) | ||
if (this.bufferValues.value >= 100) { | ||
clearInterval(interval) | ||
} | ||
}, 400) | ||
} | ||
} | ||
} | ||
</script> |
73 changes: 0 additions & 73 deletions
73
src/components/statistics/progress-bars/Widgets/StandardBars.vue
This file was deleted.
Oops, something went wrong.
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
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.