|
| 1 | +import {Component} from '@angular/core'; |
| 2 | +import {Toolbar, ToolbarWidget} from '@angular/aria/toolbar'; |
| 3 | +import {RadioGroup, RadioButton} from '@angular/aria/radio-group'; |
| 4 | +import {LiveAnnouncer} from '@angular/cdk/a11y'; |
| 5 | + |
| 6 | +/** @title Skip Disabled Toolbar Example */ |
| 7 | +@Component({ |
| 8 | + selector: 'toolbar-skip-disabled-example', |
| 9 | + templateUrl: 'toolbar-skip-disabled-example.html', |
| 10 | + styleUrl: '../toolbar-common.css', |
| 11 | + imports: [RadioButton, RadioGroup, Toolbar, ToolbarWidget], |
| 12 | +}) |
| 13 | +export class ToolbarSkipDisabledExample { |
| 14 | + constructor(private _liveAnnouncer: LiveAnnouncer) {} |
| 15 | + alignments = [ |
| 16 | + {value: 'left', label: 'Left'}, |
| 17 | + {value: 'center', label: 'Center'}, |
| 18 | + {value: 'right', label: 'Right'}, |
| 19 | + ]; |
| 20 | + |
| 21 | + // Control for which radio options are individually disabled |
| 22 | + disabledOptions: string[] = ['center']; |
| 23 | + |
| 24 | + format(tool: string) { |
| 25 | + console.log(`Tool activated: ${tool}`); |
| 26 | + this._liveAnnouncer.announce(`${tool} applied`, 'polite'); |
| 27 | + } |
| 28 | + test(action: string) { |
| 29 | + console.log(`Action triggered: ${action}`); |
| 30 | + this._liveAnnouncer.announce(`${action} button activated`, 'polite'); |
| 31 | + } |
| 32 | +} |
0 commit comments