forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbutton-toggle.html
36 lines (34 loc) · 1.38 KB
/
button-toggle.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<button #button class="mat-button-toggle-button mat-focus-indicator"
type="button"
[id]="buttonId"
[attr.role]="isSingleSelector() ? 'radio' : 'button'"
[attr.tabindex]="disabled && !disabledInteractive ? -1 : tabIndex"
[attr.aria-pressed]="!isSingleSelector() ? checked : null"
[attr.aria-checked]="isSingleSelector() ? checked : null"
[disabled]="(disabled && !disabledInteractive) || null"
[attr.name]="_getButtonName()"
[attr.aria-label]="ariaLabel"
[attr.aria-labelledby]="ariaLabelledby"
[attr.aria-disabled]="disabled && disabledInteractive ? 'true' : null"
(click)="_onButtonClick()">
@if (buttonToggleGroup && (
!buttonToggleGroup.multiple && !buttonToggleGroup.hideSingleSelectionIndicator ||
buttonToggleGroup.multiple && !buttonToggleGroup.hideMultipleSelectionIndicator)
) {
<div class="mat-button-toggle-checkbox-wrapper">
<mat-pseudo-checkbox
[disabled]="disabled"
state="checked"
aria-hidden="true"
appearance="minimal"/>
</div>
}
<span class="mat-button-toggle-label-content">
<ng-content></ng-content>
</span>
</button>
<span class="mat-button-toggle-focus-overlay"></span>
<span class="mat-button-toggle-ripple" matRipple
[matRippleTrigger]="button"
[matRippleDisabled]="this.disableRipple || this.disabled">
</span>