Skip to content

Commit a4ffeb1

Browse files
committed
fix: get rid of max-w for the afcl progress bar and hide values container, if values are hidden
https://web.tracklify.com/project/2b7ZVgE5/AdminForth/1284/3vwJrEPz/rework-afcl-progress-bar
1 parent eafd26a commit a4ffeb1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adminforth/spa/src/afcl/ProgressBar.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
2-
<div class="relative w-full max-w-[700px] bg-lightProgressBarUnfilledColor rounded-full h-2.5 dark:bg-darkProgressBarUnfilledColor" :class="props.height ? `h-${props.height}` : ''">
3-
<span class="absolute -top-6 left-0 text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ leftLabel }}</span>
4-
<span class="absolute -top-6 right-0 text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ rightLabel }}</span>
2+
<div class="relative w-full bg-lightProgressBarUnfilledColor rounded-full h-2.5 dark:bg-darkProgressBarUnfilledColor" :class="props.height ? `h-${props.height}` : ''">
3+
<span v-if="leftLabel" class="absolute -top-6 left-0 text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ leftLabel }}</span>
4+
<span v-if="rightLabel" class="absolute -top-6 right-0 text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ rightLabel }}</span>
55
<div
66
class="bg-lightProgressBarFilledColor dark:bg-darkProgressBarFilledColor h-2.5 rounded-full transition-all duration-300 ease-in-out"
77
:class="{ 'progress-bar': showAnimation, [`h-${props.height}`]: props.height }"
88
:style="{ width: `${percentage}%` }"
99
></div>
10-
<div class="flex justify-between mt-2">
10+
<div v-if="showValues || showProgress" class="flex justify-between mt-2">
1111
<span v-if="showValues" class="text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ formatValue(minValue) }}</span>
1212
<span v-if="showProgress" class="text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ progressText }}</span>
1313
<span v-if="showValues" class="text-sm text-lightProgressBarText dark:text-darkProgressBarText">{{ formatValue(maxValue) }}</span>

0 commit comments

Comments
 (0)