@saasmakers/ui 1.5.3 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { BaseProgress } from '../../types/bases'
|
|
3
3
|
|
|
4
4
|
const props = withDefaults(defineProps<BaseProgress>(), {
|
|
5
|
+
labelFormat: 'fraction',
|
|
5
6
|
max: 100,
|
|
6
7
|
showLabel: false,
|
|
7
8
|
size: 'base',
|
|
@@ -17,7 +18,7 @@ const percent = computed(() => {
|
|
|
17
18
|
})
|
|
18
19
|
|
|
19
20
|
const label = computed(() => {
|
|
20
|
-
if (props.
|
|
21
|
+
if (props.labelFormat === 'percent') {
|
|
21
22
|
return `${Math.round(percent.value)} %`
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -28,12 +29,18 @@ const label = computed(() => {
|
|
|
28
29
|
<template>
|
|
29
30
|
<div
|
|
30
31
|
class="flex items-center"
|
|
31
|
-
:class="
|
|
32
|
+
:class="{
|
|
33
|
+
'gap-2.5': size === 'base',
|
|
34
|
+
'gap-2': !(size === 'base'),
|
|
35
|
+
}"
|
|
32
36
|
>
|
|
33
37
|
<div
|
|
34
38
|
role="progressbar"
|
|
35
39
|
class="min-w-0 flex-1 overflow-hidden rounded-full bg-gray-200 dark:bg-gray-800"
|
|
36
|
-
:class="
|
|
40
|
+
:class="{
|
|
41
|
+
'h-1.5': size === 'base',
|
|
42
|
+
'h-1': !(size === 'base'),
|
|
43
|
+
}"
|
|
37
44
|
:aria-label="label"
|
|
38
45
|
:aria-valuemax="max"
|
|
39
46
|
:aria-valuemin="0"
|
|
@@ -243,7 +243,10 @@ watch(visible, (isVisible) => {
|
|
|
243
243
|
<div
|
|
244
244
|
ref="contentRef"
|
|
245
245
|
class="min-h-0 flex-1 overflow-y-auto px-5"
|
|
246
|
-
:class="
|
|
246
|
+
:class="{
|
|
247
|
+
'pb-4': $slots.footer,
|
|
248
|
+
'pb-6': !($slots.footer),
|
|
249
|
+
}"
|
|
247
250
|
@pointercancel="onPointerUp"
|
|
248
251
|
@pointerdown="onContentPointerDown"
|
|
249
252
|
@pointermove="onPointerMove"
|
package/app/types/bases.d.ts
CHANGED
|
@@ -282,12 +282,15 @@ export type BasePowerPower
|
|
|
282
282
|
export type BasePowerSize = 'base' | 'lg' | 'sm' | 'xs'
|
|
283
283
|
|
|
284
284
|
export interface BaseProgress {
|
|
285
|
+
labelFormat?: BaseProgressLabelFormat
|
|
285
286
|
max?: number
|
|
286
287
|
showLabel?: boolean
|
|
287
288
|
size?: BaseProgressSize
|
|
288
289
|
value?: number
|
|
289
290
|
}
|
|
290
291
|
|
|
292
|
+
export type BaseProgressLabelFormat = 'fraction' | 'percent'
|
|
293
|
+
|
|
291
294
|
export type BaseProgressSize = 'base' | 'sm'
|
|
292
295
|
|
|
293
296
|
export interface BaseQuote {
|