Skip to content

Commit 9a9e397

Browse files
committed
2 parents 13397fa + 3f2057e commit 9a9e397

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

exampleVault/Input Fields/Progress Bar.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ progress1: -6
33
progress2: 0.7
44
progress3: 2
55
progress4: 2.6
6+
progress5: 60
7+
progress6: 75
68
---
79

810
```meta-bind
@@ -21,8 +23,13 @@ INPUT[progressBar(showcase, minValue(0), maxValue(10), stepSize(-1)):progress3]
2123
INPUT[progressBar(showcase, minValue(0), maxValue(10), stepSize(0.1)):progress4]
2224
```
2325

24-
With some snippets we can change the color of the progress bar.
26+
The labels can be hidden if they are not required.
2527

2628
```meta-bind
27-
INPUT[progressBar(defaultValue(53), class(red-progress-bar))]
28-
```
29+
INPUT[progressBar(defaultValue(53), addLabels(false)):progress5]
30+
```
31+
With some css-snippets we can change the color of the progress bar.
32+
33+
```meta-bind
34+
INPUT[progressBar(defaultValue(53), class(red-progress-bar)):progress6]
35+
```

packages/core/src/fields/inputFields/fields/ProgressBar/ProgressBarComponent.svelte

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,12 @@
125125
aria-valuemin={props.minValue}
126126
aria-valuemax={props.maxValue}
127127
aria-valuenow={value}
128+
aria-label={value}
128129
tabindex="0"
129130
></div>
131+
{#if props.addLabels}
130132
<span class="mb-progress-bar-value">{value}</span>
131133
<span class="mb-progress-bar-label-left">{props.minValue}</span>
132134
<span class="mb-progress-bar-label-right">{props.maxValue}</span>
135+
{/if}
133136
</div>

packages/core/src/fields/inputFields/fields/ProgressBar/ProgressBarIPF.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export class ProgressBarIPF extends AbstractInputField<number, number> {
5454
minValue: this.minValue,
5555
maxValue: this.maxValue,
5656
stepSize: this.stepSize,
57+
addLabels: (this.mountable.getArgument(InputFieldArgumentType.ADD_LABELS)?.value ?? true) === true ,
5758
};
5859
}
5960
}

0 commit comments

Comments
 (0)