11<template >
22 <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 >
5- <div
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
66 class =" bg-lightPrimary dark:bg-darkPrimary h-2.5 rounded-full transition-all duration-300 ease-in-out"
7- :class =" { 'progress-bar': showAnimation, [`h-${props.height}`]: props.height }"
7+ :class =" { 'progress-bar': showAnimation, [`h-${props.height}`]: props.height }"
88 :style =" { width: `${percentage}%` }"
99 ></div >
1010 <div v-if =" showValues || showProgress" class =" flex justify-between mt-2" >
11- <span v-if =" showValues" class =" text-sm text-lightProgressBarText dark:text-darkProgressBarText " >{{ formatValue(minValue) }}</span >
12- <span v-if =" showProgress" class =" text-sm text-lightProgressBarText dark:text-darkProgressBarText " >{{ progressText }}</span >
13- <span v-if =" showValues" class =" text-sm text-lightProgressBarText dark:text-darkProgressBarText " >{{ formatValue(maxValue) }}</span >
11+ <span v-if =" showValues" class =" text-sm" :class = " textClass " >{{ formatValue(minValue) }}</span >
12+ <span v-if =" showProgress" class =" text-sm" :class = " textClass " >{{ progressText }}</span >
13+ <span v-if =" showValues" class =" text-sm" :class = " textClass " >{{ formatValue(maxValue) }}</span >
1414 </div >
1515 </div >
1616</template >
@@ -31,6 +31,7 @@ interface Props {
3131 showProgress? : boolean
3232 showAnimation? : boolean
3333 height? : number
34+ textClass? : string
3435}
3536
3637const props = withDefaults (defineProps <Props >(), {
@@ -39,7 +40,8 @@ const props = withDefaults(defineProps<Props>(), {
3940 formatter : (value : number ) => ` ${value } ` ,
4041 progressFormatter : (value : number , percentage : number ) => ` ${value } ` ,
4142 showValues: true ,
42- showProgress: true
43+ showProgress: true ,
44+ textClass: ' text-lightProgressBarText dark:text-darkProgressBarText' ,
4345})
4446
4547const percentage = computed ((): number => {
0 commit comments