-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(progress-bar): set aria attributes and allow custom ranges (#1205)
* feat(progress-bar): add a11y attributes * feat(progress-bar): enable custom ranges * feat(progress-indicator): set aria values for progressbar properly * fix: simplify inputs to use native aria attributes * fix: fix a11y test * fix: restore aria inputs * fix: simplify input attributes * fix: simplify input parameter * Update projects/ng-aquila/documentation/examples/progressbar/progressbar-custom-range/progressbar-custom-range-example.ts Co-authored-by: Philipp Fahrenschon <[email protected]> * fix: simplify input parameters * fix: simplify input parameters * fix: simplify input parameters * fix: simplify input parameters * docs: add documentation * docs: fix aria attributes names --------- Co-authored-by: [email protected] <[email protected]> Co-authored-by: Philipp Fahrenschon <[email protected]>
- Loading branch information
1 parent
edb6909
commit e7fa382
Showing
16 changed files
with
139 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
...on/examples/progress-stepper/progress-stepper-custom/progress-stepper-custom-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...tion/examples/progress-stepper/progress-stepper-title/progress-stepper-title-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...la/documentation/examples/progress-stepper/progress-stepper/progress-stepper-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
8 changes: 8 additions & 0 deletions
8
...ation/examples/progressbar/progressbar-custom-range/progressbar-custom-range-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<nx-progressbar | ||
ariaLabel="Some aria label" | ||
aria-valuetext="Some value description" | ||
[value]="value" | ||
[min]="min" | ||
[max]="max" | ||
></nx-progressbar> | ||
value: {{value}} | completed: {{getCompletedPercentage()}}% |
35 changes: 35 additions & 0 deletions
35
...ntation/examples/progressbar/progressbar-custom-range/progressbar-custom-range-example.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
import { NxProgressbarComponent } from '@aposin/ng-aquila/progressbar'; | ||
|
||
/** | ||
* @title Progress Bar Example | ||
*/ | ||
@Component({ | ||
selector: 'progressbar-custom-range-example', | ||
templateUrl: './progressbar-custom-range-example.html', | ||
styleUrls: ['./progressbar-custom-range-example.css'], | ||
imports: [NxProgressbarComponent], | ||
standalone: true, | ||
}) | ||
export class ProgressbarCustomRangeExample implements OnInit { | ||
value = 15; | ||
min = 5; | ||
max = 80; | ||
|
||
ngOnInit(): void { | ||
(async () => { | ||
while (this.value !== 80) { | ||
await new Promise(resolve => setTimeout(resolve, 2000)); | ||
|
||
this.value = (this.value + 10) % this.max; | ||
} | ||
})(); | ||
} | ||
|
||
getCompletedPercentage() { | ||
return Math.round( | ||
((this.value - this.min) / (this.max - this.min)) * 100, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters