Skip to content

Commit 2d75aef

Browse files
committed
fix: ProgressBar labels and values take their own space instead of drawing outside the bar, so they no longer overlap the content around it AdminForth/2005
1 parent c2927c8 commit 2d75aef

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

‎adminforth/spa/src/afcl/ProgressBar.vue‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<template>
2-
<div class="relative w-full bg-lightProgressBarUnfilledColor rounded-full h-1.5 dark:bg-darkProgressBarUnfilledColor" :class="props.height ? `h-${props.height}` : ''">
3-
<span v-if="leftLabel" class="absolute -top-6 left-0 text-sm" :class="textClass">{{ leftLabel }}</span>
4-
<span v-if="rightLabel" class="absolute -top-6 right-0 text-sm" :class="textClass">{{ rightLabel }}</span>
5-
<div
6-
class="bg-lightPrimary dark:bg-darkPrimary h-1.5 rounded-full transition-all duration-300 ease-in-out"
7-
:class="{ 'progress-bar': showAnimation, [`h-${props.height}`]: props.height }"
8-
:style="{ width: `${percentage}%` }"
9-
></div>
2+
<div class="w-full">
3+
<div v-if="leftLabel || rightLabel" class="flex justify-between mb-1 text-sm" :class="textClass">
4+
<span>{{ leftLabel }}</span>
5+
<span>{{ rightLabel }}</span>
6+
</div>
7+
<div class="w-full bg-lightProgressBarUnfilledColor rounded-full h-1.5 dark:bg-darkProgressBarUnfilledColor" :class="props.height ? `h-${props.height}` : ''">
8+
<div
9+
class="bg-lightPrimary dark:bg-darkPrimary h-1.5 rounded-full transition-all duration-300 ease-in-out"
10+
:class="{ 'progress-bar': showAnimation, [`h-${props.height}`]: props.height }"
11+
:style="{ width: `${percentage}%` }"
12+
></div>
13+
</div>
1014
<div v-if="showValues || showProgress" class="flex justify-between mt-2">
1115
<span v-if="showValues" class="text-sm" :class="textClass">{{ formatValue(minValue) }}</span>
1216
<span v-if="showProgress" class="text-sm" :class="textClass">{{ progressText }}</span>

0 commit comments

Comments
 (0)