@angular/material 21.0.0-next.8 → 21.0.0-rc.0
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.
- package/core/tokens/_classes.scss +1 -1
- package/core/tokens/m2/_md-sys-color.scss +17 -17
- package/fesm2022/_animation-chunk.mjs +10 -16
- package/fesm2022/_animation-chunk.mjs.map +1 -1
- package/fesm2022/_date-formats-chunk.mjs +68 -164
- package/fesm2022/_date-formats-chunk.mjs.map +1 -1
- package/fesm2022/_date-range-input-harness-chunk.mjs +284 -463
- package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_error-options-chunk.mjs +56 -19
- package/fesm2022/_error-options-chunk.mjs.map +1 -1
- package/fesm2022/_error-state-chunk.mjs +24 -31
- package/fesm2022/_error-state-chunk.mjs.map +1 -1
- package/fesm2022/_form-field-chunk.mjs +1224 -1017
- package/fesm2022/_form-field-chunk.mjs.map +1 -1
- package/fesm2022/_icon-button-chunk.mjs +243 -187
- package/fesm2022/_icon-button-chunk.mjs.map +1 -1
- package/fesm2022/_icon-registry-chunk.mjs +350 -575
- package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
- package/fesm2022/_input-harness-chunk.mjs +56 -107
- package/fesm2022/_input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_input-value-accessor-chunk.mjs +0 -6
- package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
- package/fesm2022/_internal-form-field-chunk.mjs +59 -19
- package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
- package/fesm2022/_line-chunk.mjs +83 -43
- package/fesm2022/_line-chunk.mjs.map +1 -1
- package/fesm2022/_option-chunk.mjs +348 -311
- package/fesm2022/_option-chunk.mjs.map +1 -1
- package/fesm2022/_option-harness-chunk.mjs +23 -39
- package/fesm2022/_option-harness-chunk.mjs.map +1 -1
- package/fesm2022/_option-module-chunk.mjs +36 -10
- package/fesm2022/_option-module-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-chunk.mjs +79 -44
- package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs +36 -10
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
- package/fesm2022/_public-api-chunk.mjs +71 -134
- package/fesm2022/_public-api-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-chunk.mjs +504 -600
- package/fesm2022/_ripple-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-loader-chunk.mjs +120 -138
- package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-module-chunk.mjs +36 -10
- package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
- package/fesm2022/_structural-styles-chunk.mjs +37 -10
- package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
- package/fesm2022/_tooltip-chunk.mjs +810 -888
- package/fesm2022/_tooltip-chunk.mjs.map +1 -1
- package/fesm2022/autocomplete-testing.mjs +62 -86
- package/fesm2022/autocomplete-testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +965 -1126
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge-testing.mjs +38 -54
- package/fesm2022/badge-testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +321 -272
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet-testing.mjs +10 -24
- package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +349 -344
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-testing.mjs +60 -94
- package/fesm2022/button-testing.mjs.map +1 -1
- package/fesm2022/button-toggle-testing.mjs +76 -125
- package/fesm2022/button-toggle-testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +752 -662
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +263 -158
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card-testing.mjs +19 -33
- package/fesm2022/card-testing.mjs.map +1 -1
- package/fesm2022/card.mjs +576 -272
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox-testing.mjs +71 -123
- package/fesm2022/checkbox-testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +515 -477
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips-testing.mjs +201 -350
- package/fesm2022/chips-testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +2552 -2289
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core-testing.mjs +14 -28
- package/fesm2022/core-testing.mjs.map +1 -1
- package/fesm2022/core.mjs +357 -328
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker-testing.mjs +15 -25
- package/fesm2022/datepicker-testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +4826 -4563
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog-testing.mjs +93 -129
- package/fesm2022/dialog-testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +810 -829
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider-testing.mjs +10 -11
- package/fesm2022/divider-testing.mjs.map +1 -1
- package/fesm2022/divider.mjs +119 -43
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion-testing.mjs +74 -130
- package/fesm2022/expansion-testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +703 -515
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field-testing-control.mjs +16 -33
- package/fesm2022/form-field-testing-control.mjs.map +1 -1
- package/fesm2022/form-field-testing.mjs +118 -179
- package/fesm2022/form-field-testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs +36 -10
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list-testing.mjs +65 -113
- package/fesm2022/grid-list-testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +559 -494
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon-testing.mjs +148 -127
- package/fesm2022/icon-testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +325 -351
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input-testing.mjs +59 -99
- package/fesm2022/input-testing.mjs.map +1 -1
- package/fesm2022/input.mjs +457 -520
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list-testing.mjs +251 -434
- package/fesm2022/list-testing.mjs.map +1 -1
- package/fesm2022/list.mjs +1522 -1204
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/material.mjs +0 -5
- package/fesm2022/material.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs +159 -228
- package/fesm2022/menu-testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +1338 -1343
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator-testing.mjs +55 -79
- package/fesm2022/paginator-testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +381 -309
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar-testing.mjs +12 -21
- package/fesm2022/progress-bar-testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +224 -169
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner-testing.mjs +13 -23
- package/fesm2022/progress-spinner-testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +235 -160
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio-testing.mjs +133 -208
- package/fesm2022/radio-testing.mjs.map +1 -1
- package/fesm2022/radio.mjs +712 -679
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select-testing.mjs +83 -117
- package/fesm2022/select-testing.mjs.map +1 -1
- package/fesm2022/select.mjs +1116 -1246
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav-testing.mjs +54 -120
- package/fesm2022/sidenav-testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +1078 -995
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle-testing.mjs +57 -92
- package/fesm2022/slide-toggle-testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +369 -279
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider-testing.mjs +90 -138
- package/fesm2022/slider-testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +1651 -1716
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar-testing.mjs +40 -87
- package/fesm2022/snack-bar-testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +763 -714
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort-testing.mjs +45 -66
- package/fesm2022/sort-testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +419 -344
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper-testing.mjs +78 -154
- package/fesm2022/stepper-testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +790 -498
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table-testing.mjs +125 -186
- package/fesm2022/table-testing.mjs.map +1 -1
- package/fesm2022/table.mjs +1026 -684
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs-testing.mjs +125 -197
- package/fesm2022/tabs-testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +2351 -2028
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker-testing.mjs +113 -172
- package/fesm2022/timepicker-testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +1019 -826
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs +16 -27
- package/fesm2022/toolbar-testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +163 -78
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip-testing.mjs +41 -52
- package/fesm2022/tooltip-testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +36 -10
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs +86 -162
- package/fesm2022/tree-testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +638 -466
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -2
- package/schematics/ng-add/index.js +1 -1
- package/types/expansion.d.ts +4 -2
- package/types/menu-testing.d.ts +2 -0
- package/types/select.d.ts +1 -1
- package/types/sort.d.ts +1 -1
- package/types/table-testing.d.ts +27 -1
- package/types/timepicker.d.ts +148 -128
|
@@ -6,206 +6,262 @@ import { MatRippleLoader } from './_ripple-loader-chunk.mjs';
|
|
|
6
6
|
import { _StructuralStylesLoader } from './_structural-styles-chunk.mjs';
|
|
7
7
|
import { _animationsDisabled } from './_animation-chunk.mjs';
|
|
8
8
|
|
|
9
|
-
/** Injection token that can be used to provide the default options the button component. */
|
|
10
9
|
const MAT_BUTTON_CONFIG = new InjectionToken('MAT_BUTTON_CONFIG');
|
|
11
10
|
function transformTabIndex(value) {
|
|
12
|
-
|
|
11
|
+
return value == null ? undefined : numberAttribute(value);
|
|
13
12
|
}
|
|
14
|
-
/** Base class for all buttons. */
|
|
15
13
|
class MatButtonBase {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
14
|
+
_elementRef = inject(ElementRef);
|
|
15
|
+
_ngZone = inject(NgZone);
|
|
16
|
+
_animationsDisabled = _animationsDisabled();
|
|
17
|
+
_config = inject(MAT_BUTTON_CONFIG, {
|
|
18
|
+
optional: true
|
|
19
|
+
});
|
|
20
|
+
_focusMonitor = inject(FocusMonitor);
|
|
21
|
+
_cleanupClick;
|
|
22
|
+
_renderer = inject(Renderer2);
|
|
23
|
+
_rippleLoader = inject(MatRippleLoader);
|
|
24
|
+
_isAnchor;
|
|
25
|
+
_isFab = false;
|
|
26
|
+
color;
|
|
27
|
+
get disableRipple() {
|
|
28
|
+
return this._disableRipple;
|
|
29
|
+
}
|
|
30
|
+
set disableRipple(value) {
|
|
31
|
+
this._disableRipple = value;
|
|
32
|
+
this._updateRippleDisabled();
|
|
33
|
+
}
|
|
34
|
+
_disableRipple = false;
|
|
35
|
+
get disabled() {
|
|
36
|
+
return this._disabled;
|
|
37
|
+
}
|
|
38
|
+
set disabled(value) {
|
|
39
|
+
this._disabled = value;
|
|
40
|
+
this._updateRippleDisabled();
|
|
41
|
+
}
|
|
42
|
+
_disabled = false;
|
|
43
|
+
ariaDisabled;
|
|
44
|
+
disabledInteractive;
|
|
45
|
+
tabIndex;
|
|
46
|
+
set _tabindex(value) {
|
|
47
|
+
this.tabIndex = value;
|
|
48
|
+
}
|
|
49
|
+
constructor() {
|
|
50
|
+
inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);
|
|
51
|
+
const element = this._elementRef.nativeElement;
|
|
52
|
+
this._isAnchor = element.tagName === 'A';
|
|
53
|
+
this.disabledInteractive = this._config?.disabledInteractive ?? false;
|
|
54
|
+
this.color = this._config?.color ?? null;
|
|
55
|
+
this._rippleLoader?.configureRipple(element, {
|
|
56
|
+
className: 'mat-mdc-button-ripple'
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
ngAfterViewInit() {
|
|
60
|
+
this._focusMonitor.monitor(this._elementRef, true);
|
|
61
|
+
if (this._isAnchor) {
|
|
62
|
+
this._setupAsAnchor();
|
|
43
63
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
64
|
+
}
|
|
65
|
+
ngOnDestroy() {
|
|
66
|
+
this._cleanupClick?.();
|
|
67
|
+
this._focusMonitor.stopMonitoring(this._elementRef);
|
|
68
|
+
this._rippleLoader?.destroyRipple(this._elementRef.nativeElement);
|
|
69
|
+
}
|
|
70
|
+
focus(origin = 'program', options) {
|
|
71
|
+
if (origin) {
|
|
72
|
+
this._focusMonitor.focusVia(this._elementRef.nativeElement, origin, options);
|
|
73
|
+
} else {
|
|
74
|
+
this._elementRef.nativeElement.focus(options);
|
|
47
75
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
76
|
+
}
|
|
77
|
+
_getAriaDisabled() {
|
|
78
|
+
if (this.ariaDisabled != null) {
|
|
79
|
+
return this.ariaDisabled;
|
|
52
80
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
this._updateRippleDisabled();
|
|
81
|
+
if (this._isAnchor) {
|
|
82
|
+
return this.disabled || null;
|
|
56
83
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
* marked as `aria-disabled`, but it will allow the button to receive events and focus.
|
|
69
|
-
*
|
|
70
|
-
* Note that by enabling this, you need to set the `tabindex` yourself if the button isn't
|
|
71
|
-
* meant to be tabbable and you have to prevent the button action (e.g. form submissions).
|
|
72
|
-
*/
|
|
73
|
-
disabledInteractive;
|
|
74
|
-
/** Tab index for the button. */
|
|
75
|
-
tabIndex;
|
|
76
|
-
/**
|
|
77
|
-
* Backwards-compatibility input that handles pre-existing `[tabindex]` bindings.
|
|
78
|
-
* @docs-private
|
|
79
|
-
*/
|
|
80
|
-
set _tabindex(value) {
|
|
81
|
-
this.tabIndex = value;
|
|
84
|
+
return this.disabled && this.disabledInteractive ? true : null;
|
|
85
|
+
}
|
|
86
|
+
_getDisabledAttribute() {
|
|
87
|
+
return this.disabledInteractive || !this.disabled ? null : true;
|
|
88
|
+
}
|
|
89
|
+
_updateRippleDisabled() {
|
|
90
|
+
this._rippleLoader?.setDisabled(this._elementRef.nativeElement, this.disableRipple || this.disabled);
|
|
91
|
+
}
|
|
92
|
+
_getTabIndex() {
|
|
93
|
+
if (this._isAnchor) {
|
|
94
|
+
return this.disabled && !this.disabledInteractive ? -1 : this.tabIndex;
|
|
82
95
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
return this.disabled && !this.disabledInteractive ? -1 : this.tabIndex;
|
|
131
|
-
}
|
|
132
|
-
return this.tabIndex;
|
|
133
|
-
}
|
|
134
|
-
_setupAsAnchor() {
|
|
135
|
-
this._cleanupClick = this._ngZone.runOutsideAngular(() => this._renderer.listen(this._elementRef.nativeElement, 'click', (event) => {
|
|
136
|
-
if (this.disabled) {
|
|
137
|
-
event.preventDefault();
|
|
138
|
-
event.stopImmediatePropagation();
|
|
139
|
-
}
|
|
140
|
-
}));
|
|
141
|
-
}
|
|
142
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatButtonBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
143
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.2.0-next.2", type: MatButtonBase, isStandalone: true, inputs: { color: "color", disableRipple: ["disableRipple", "disableRipple", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], ariaDisabled: ["aria-disabled", "ariaDisabled", booleanAttribute], disabledInteractive: ["disabledInteractive", "disabledInteractive", booleanAttribute], tabIndex: ["tabIndex", "tabIndex", transformTabIndex], _tabindex: ["tabindex", "_tabindex", transformTabIndex] }, host: { properties: { "class": "color ? \"mat-\" + color : \"\"", "attr.disabled": "_getDisabledAttribute()", "attr.aria-disabled": "_getAriaDisabled()", "attr.tabindex": "_getTabIndex()", "class.mat-mdc-button-disabled": "disabled", "class.mat-mdc-button-disabled-interactive": "disabledInteractive", "class.mat-unthemed": "!color", "class._mat-animation-noopable": "_animationsDisabled" }, classAttribute: "mat-mdc-button-base" }, ngImport: i0 });
|
|
96
|
+
return this.tabIndex;
|
|
97
|
+
}
|
|
98
|
+
_setupAsAnchor() {
|
|
99
|
+
this._cleanupClick = this._ngZone.runOutsideAngular(() => this._renderer.listen(this._elementRef.nativeElement, 'click', event => {
|
|
100
|
+
if (this.disabled) {
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
event.stopImmediatePropagation();
|
|
103
|
+
}
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
107
|
+
minVersion: "12.0.0",
|
|
108
|
+
version: "20.2.0-next.2",
|
|
109
|
+
ngImport: i0,
|
|
110
|
+
type: MatButtonBase,
|
|
111
|
+
deps: [],
|
|
112
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
113
|
+
});
|
|
114
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
115
|
+
minVersion: "16.1.0",
|
|
116
|
+
version: "20.2.0-next.2",
|
|
117
|
+
type: MatButtonBase,
|
|
118
|
+
isStandalone: true,
|
|
119
|
+
inputs: {
|
|
120
|
+
color: "color",
|
|
121
|
+
disableRipple: ["disableRipple", "disableRipple", booleanAttribute],
|
|
122
|
+
disabled: ["disabled", "disabled", booleanAttribute],
|
|
123
|
+
ariaDisabled: ["aria-disabled", "ariaDisabled", booleanAttribute],
|
|
124
|
+
disabledInteractive: ["disabledInteractive", "disabledInteractive", booleanAttribute],
|
|
125
|
+
tabIndex: ["tabIndex", "tabIndex", transformTabIndex],
|
|
126
|
+
_tabindex: ["tabindex", "_tabindex", transformTabIndex]
|
|
127
|
+
},
|
|
128
|
+
host: {
|
|
129
|
+
properties: {
|
|
130
|
+
"class": "color ? \"mat-\" + color : \"\"",
|
|
131
|
+
"attr.disabled": "_getDisabledAttribute()",
|
|
132
|
+
"attr.aria-disabled": "_getAriaDisabled()",
|
|
133
|
+
"attr.tabindex": "_getTabIndex()",
|
|
134
|
+
"class.mat-mdc-button-disabled": "disabled",
|
|
135
|
+
"class.mat-mdc-button-disabled-interactive": "disabledInteractive",
|
|
136
|
+
"class.mat-unthemed": "!color",
|
|
137
|
+
"class._mat-animation-noopable": "_animationsDisabled"
|
|
138
|
+
},
|
|
139
|
+
classAttribute: "mat-mdc-button-base"
|
|
140
|
+
},
|
|
141
|
+
ngImport: i0
|
|
142
|
+
});
|
|
144
143
|
}
|
|
145
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
144
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
145
|
+
minVersion: "12.0.0",
|
|
146
|
+
version: "20.2.0-next.2",
|
|
147
|
+
ngImport: i0,
|
|
148
|
+
type: MatButtonBase,
|
|
149
|
+
decorators: [{
|
|
150
|
+
type: Directive,
|
|
151
|
+
args: [{
|
|
152
|
+
host: {
|
|
153
|
+
'class': 'mat-mdc-button-base',
|
|
154
|
+
'[class]': 'color ? "mat-" + color : ""',
|
|
155
|
+
'[attr.disabled]': '_getDisabledAttribute()',
|
|
156
|
+
'[attr.aria-disabled]': '_getAriaDisabled()',
|
|
157
|
+
'[attr.tabindex]': '_getTabIndex()',
|
|
158
|
+
'[class.mat-mdc-button-disabled]': 'disabled',
|
|
159
|
+
'[class.mat-mdc-button-disabled-interactive]': 'disabledInteractive',
|
|
160
|
+
'[class.mat-unthemed]': '!color',
|
|
161
|
+
'[class._mat-animation-noopable]': '_animationsDisabled'
|
|
162
|
+
}
|
|
163
|
+
}]
|
|
164
|
+
}],
|
|
165
|
+
ctorParameters: () => [],
|
|
166
|
+
propDecorators: {
|
|
167
|
+
color: [{
|
|
168
|
+
type: Input
|
|
169
|
+
}],
|
|
170
|
+
disableRipple: [{
|
|
171
|
+
type: Input,
|
|
172
|
+
args: [{
|
|
173
|
+
transform: booleanAttribute
|
|
174
|
+
}]
|
|
175
|
+
}],
|
|
176
|
+
disabled: [{
|
|
177
|
+
type: Input,
|
|
178
|
+
args: [{
|
|
179
|
+
transform: booleanAttribute
|
|
180
|
+
}]
|
|
181
|
+
}],
|
|
182
|
+
ariaDisabled: [{
|
|
183
|
+
type: Input,
|
|
184
|
+
args: [{
|
|
185
|
+
transform: booleanAttribute,
|
|
186
|
+
alias: 'aria-disabled'
|
|
187
|
+
}]
|
|
188
|
+
}],
|
|
189
|
+
disabledInteractive: [{
|
|
190
|
+
type: Input,
|
|
191
|
+
args: [{
|
|
192
|
+
transform: booleanAttribute
|
|
193
|
+
}]
|
|
194
|
+
}],
|
|
195
|
+
tabIndex: [{
|
|
196
|
+
type: Input,
|
|
197
|
+
args: [{
|
|
198
|
+
transform: transformTabIndex
|
|
199
|
+
}]
|
|
200
|
+
}],
|
|
201
|
+
_tabindex: [{
|
|
202
|
+
type: Input,
|
|
203
|
+
args: [{
|
|
204
|
+
alias: 'tabindex',
|
|
205
|
+
transform: transformTabIndex
|
|
206
|
+
}]
|
|
207
|
+
}]
|
|
208
|
+
}
|
|
209
|
+
});
|
|
183
210
|
|
|
184
|
-
/**
|
|
185
|
-
* Material Design icon button component. This type of button displays a single interactive icon for
|
|
186
|
-
* users to perform an action.
|
|
187
|
-
* See https://material.io/develop/web/components/buttons/icon-buttons/
|
|
188
|
-
*/
|
|
189
211
|
class MatIconButton extends MatButtonBase {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
212
|
+
constructor() {
|
|
213
|
+
super();
|
|
214
|
+
this._rippleLoader.configureRipple(this._elementRef.nativeElement, {
|
|
215
|
+
centered: true
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
219
|
+
minVersion: "12.0.0",
|
|
220
|
+
version: "20.2.0-next.2",
|
|
221
|
+
ngImport: i0,
|
|
222
|
+
type: MatIconButton,
|
|
223
|
+
deps: [],
|
|
224
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
225
|
+
});
|
|
226
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
227
|
+
minVersion: "14.0.0",
|
|
228
|
+
version: "20.2.0-next.2",
|
|
229
|
+
type: MatIconButton,
|
|
230
|
+
isStandalone: true,
|
|
231
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
232
|
+
host: {
|
|
233
|
+
classAttribute: "mdc-icon-button mat-mdc-icon-button"
|
|
234
|
+
},
|
|
235
|
+
exportAs: ["matButton", "matAnchor"],
|
|
236
|
+
usesInheritance: true,
|
|
237
|
+
ngImport: i0,
|
|
238
|
+
template: "<span class=\"mat-mdc-button-persistent-ripple mdc-icon-button__ripple\"></span>\n\n<ng-content></ng-content>\n\n<!--\n The indicator can't be directly on the button, because MDC uses ::before for high contrast\n indication and it can't be on the ripple, because it has a border radius and overflow: hidden.\n-->\n<span class=\"mat-focus-indicator\"></span>\n\n<span class=\"mat-mdc-button-touch-target\"></span>\n",
|
|
239
|
+
styles: [".mat-mdc-icon-button{-webkit-user-select:none;user-select:none;display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;text-decoration:none;cursor:pointer;z-index:0;overflow:visible;border-radius:var(--mat-icon-button-container-shape, var(--mat-sys-corner-full, 50%));flex-shrink:0;text-align:center;width:var(--mat-icon-button-state-layer-size, 40px);height:var(--mat-icon-button-state-layer-size, 40px);padding:calc(calc(var(--mat-icon-button-state-layer-size, 40px) - var(--mat-icon-button-icon-size, 24px)) / 2);font-size:var(--mat-icon-button-icon-size, 24px);color:var(--mat-icon-button-icon-color, var(--mat-sys-on-surface-variant));-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:\"\";opacity:0}.mat-mdc-icon-button .mdc-button__label,.mat-mdc-icon-button .mat-icon{z-index:1;position:relative}.mat-mdc-icon-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-icon-button:focus>.mat-focus-indicator::before{content:\"\";border-radius:inherit}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface-variant) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-icon-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-icon-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-icon-button-touch-target-size, 48px);display:var(--mat-icon-button-touch-target-display, block);left:50%;width:var(--mat-icon-button-touch-target-size, 48px);transform:translate(-50%, -50%)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-icon-button-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button img,.mat-mdc-icon-button svg{width:var(--mat-icon-button-icon-size, 24px);height:var(--mat-icon-button-icon-size, 24px);vertical-align:baseline}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:var(--mat-icon-button-container-shape, var(--mat-sys-corner-full, 50%))}.mat-mdc-icon-button[hidden]{display:none}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}\n", "@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-button-base.mat-tonal-button,.mat-mdc-icon-button.mat-mdc-icon-button,.mat-mdc-outlined-button .mdc-button__ripple{outline:solid 1px}}\n"],
|
|
240
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
241
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
242
|
+
});
|
|
196
243
|
}
|
|
197
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
244
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
245
|
+
minVersion: "12.0.0",
|
|
246
|
+
version: "20.2.0-next.2",
|
|
247
|
+
ngImport: i0,
|
|
248
|
+
type: MatIconButton,
|
|
249
|
+
decorators: [{
|
|
250
|
+
type: Component,
|
|
251
|
+
args: [{
|
|
252
|
+
selector: `button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]`,
|
|
253
|
+
host: {
|
|
254
|
+
'class': 'mdc-icon-button mat-mdc-icon-button'
|
|
255
|
+
},
|
|
256
|
+
exportAs: 'matButton, matAnchor',
|
|
257
|
+
encapsulation: ViewEncapsulation.None,
|
|
258
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
259
|
+
template: "<span class=\"mat-mdc-button-persistent-ripple mdc-icon-button__ripple\"></span>\n\n<ng-content></ng-content>\n\n<!--\n The indicator can't be directly on the button, because MDC uses ::before for high contrast\n indication and it can't be on the ripple, because it has a border radius and overflow: hidden.\n-->\n<span class=\"mat-focus-indicator\"></span>\n\n<span class=\"mat-mdc-button-touch-target\"></span>\n",
|
|
260
|
+
styles: [".mat-mdc-icon-button{-webkit-user-select:none;user-select:none;display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;text-decoration:none;cursor:pointer;z-index:0;overflow:visible;border-radius:var(--mat-icon-button-container-shape, var(--mat-sys-corner-full, 50%));flex-shrink:0;text-align:center;width:var(--mat-icon-button-state-layer-size, 40px);height:var(--mat-icon-button-state-layer-size, 40px);padding:calc(calc(var(--mat-icon-button-state-layer-size, 40px) - var(--mat-icon-button-icon-size, 24px)) / 2);font-size:var(--mat-icon-button-icon-size, 24px);color:var(--mat-icon-button-icon-color, var(--mat-sys-on-surface-variant));-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:\"\";opacity:0}.mat-mdc-icon-button .mdc-button__label,.mat-mdc-icon-button .mat-icon{z-index:1;position:relative}.mat-mdc-icon-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-icon-button:focus>.mat-focus-indicator::before{content:\"\";border-radius:inherit}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface-variant) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-icon-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-icon-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-icon-button-touch-target-size, 48px);display:var(--mat-icon-button-touch-target-display, block);left:50%;width:var(--mat-icon-button-touch-target-size, 48px);transform:translate(-50%, -50%)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-icon-button-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button img,.mat-mdc-icon-button svg{width:var(--mat-icon-button-icon-size, 24px);height:var(--mat-icon-button-icon-size, 24px);vertical-align:baseline}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:var(--mat-icon-button-container-shape, var(--mat-sys-corner-full, 50%))}.mat-mdc-icon-button[hidden]{display:none}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}\n", "@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-button-base.mat-tonal-button,.mat-mdc-icon-button.mat-mdc-icon-button,.mat-mdc-outlined-button .mdc-button__ripple{outline:solid 1px}}\n"]
|
|
261
|
+
}]
|
|
262
|
+
}],
|
|
263
|
+
ctorParameters: () => []
|
|
264
|
+
});
|
|
209
265
|
const MatIconAnchor = MatIconButton;
|
|
210
266
|
|
|
211
267
|
export { MAT_BUTTON_CONFIG, MatButtonBase, MatIconAnchor, MatIconButton };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_icon-button-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/button/button-base.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/button/icon-button.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/button/icon-button.html"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {FocusMonitor, FocusOrigin} from '@angular/cdk/a11y';\nimport {\n AfterViewInit,\n booleanAttribute,\n Directive,\n ElementRef,\n inject,\n InjectionToken,\n Input,\n NgZone,\n numberAttribute,\n OnDestroy,\n Renderer2,\n} from '@angular/core';\nimport {_animationsDisabled, _StructuralStylesLoader, MatRippleLoader, ThemePalette} from '../core';\nimport {_CdkPrivateStyleLoader} from '@angular/cdk/private';\n\n/**\n * Possible appearances for a `MatButton`.\n * See https://m3.material.io/components/buttons/overview\n */\nexport type MatButtonAppearance = 'text' | 'filled' | 'elevated' | 'outlined' | 'tonal';\n\n/** Object that can be used to configure the default options for the button component. */\nexport interface MatButtonConfig {\n /** Whether disabled buttons should be interactive. */\n disabledInteractive?: boolean;\n\n /** Default palette color to apply to buttons. */\n color?: ThemePalette;\n\n /** Default appearance for plain buttons (not icon buttons or FABs). */\n defaultAppearance?: MatButtonAppearance;\n}\n\n/** Injection token that can be used to provide the default options the button component. */\nexport const MAT_BUTTON_CONFIG = new InjectionToken<MatButtonConfig>('MAT_BUTTON_CONFIG');\n\nfunction transformTabIndex(value: unknown): number | undefined {\n return value == null ? undefined : numberAttribute(value);\n}\n\n/** Base class for all buttons. */\n@Directive({\n host: {\n // Add a class that applies to all buttons. This makes it easier to target if somebody\n // wants to target all Material buttons.\n 'class': 'mat-mdc-button-base',\n '[class]': 'color ? \"mat-\" + color : \"\"',\n '[attr.disabled]': '_getDisabledAttribute()',\n '[attr.aria-disabled]': '_getAriaDisabled()',\n '[attr.tabindex]': '_getTabIndex()',\n '[class.mat-mdc-button-disabled]': 'disabled',\n '[class.mat-mdc-button-disabled-interactive]': 'disabledInteractive',\n '[class.mat-unthemed]': '!color',\n '[class._mat-animation-noopable]': '_animationsDisabled',\n },\n})\nexport class MatButtonBase implements AfterViewInit, OnDestroy {\n _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n protected _ngZone = inject(NgZone);\n protected _animationsDisabled = _animationsDisabled();\n\n protected readonly _config = inject(MAT_BUTTON_CONFIG, {optional: true});\n private readonly _focusMonitor = inject(FocusMonitor);\n private _cleanupClick: (() => void) | undefined;\n private _renderer = inject(Renderer2);\n\n /**\n * Handles the lazy creation of the MatButton ripple.\n * Used to improve initial load time of large applications.\n */\n protected _rippleLoader: MatRippleLoader = inject(MatRippleLoader);\n\n /** Whether the button is set on an anchor node. */\n protected _isAnchor: boolean;\n\n /** Whether this button is a FAB. Used to apply the correct class on the ripple. */\n protected _isFab = false;\n\n /**\n * Theme color of the button. This API is supported in M2 themes only, it has\n * no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/button/styling.\n *\n * For information on applying color variants in M3, see\n * https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants\n */\n @Input() color?: string | null;\n\n /** Whether the ripple effect is disabled or not. */\n @Input({transform: booleanAttribute})\n get disableRipple(): boolean {\n return this._disableRipple;\n }\n set disableRipple(value: any) {\n this._disableRipple = value;\n this._updateRippleDisabled();\n }\n private _disableRipple: boolean = false;\n\n /** Whether the button is disabled. */\n @Input({transform: booleanAttribute})\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: any) {\n this._disabled = value;\n this._updateRippleDisabled();\n }\n private _disabled: boolean = false;\n\n /** `aria-disabled` value of the button. */\n @Input({transform: booleanAttribute, alias: 'aria-disabled'})\n ariaDisabled: boolean | undefined;\n\n /**\n * Natively disabled buttons prevent focus and any pointer events from reaching the button.\n * In some scenarios this might not be desirable, because it can prevent users from finding out\n * why the button is disabled (e.g. via tooltip). This is also useful for buttons that may\n * become disabled when activated, which would cause focus to be transferred to the document\n * body instead of remaining on the button.\n *\n * Enabling this input will change the button so that it is styled to be disabled and will be\n * marked as `aria-disabled`, but it will allow the button to receive events and focus.\n *\n * Note that by enabling this, you need to set the `tabindex` yourself if the button isn't\n * meant to be tabbable and you have to prevent the button action (e.g. form submissions).\n */\n @Input({transform: booleanAttribute})\n disabledInteractive: boolean;\n\n /** Tab index for the button. */\n @Input({transform: transformTabIndex})\n tabIndex: number;\n\n /**\n * Backwards-compatibility input that handles pre-existing `[tabindex]` bindings.\n * @docs-private\n */\n @Input({alias: 'tabindex', transform: transformTabIndex})\n set _tabindex(value: number) {\n this.tabIndex = value;\n }\n\n constructor(...args: unknown[]);\n\n constructor() {\n inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);\n const element = this._elementRef.nativeElement;\n\n this._isAnchor = element.tagName === 'A';\n this.disabledInteractive = this._config?.disabledInteractive ?? false;\n this.color = this._config?.color ?? null;\n this._rippleLoader?.configureRipple(element, {className: 'mat-mdc-button-ripple'});\n }\n\n ngAfterViewInit() {\n this._focusMonitor.monitor(this._elementRef, true);\n\n // Some internal tests depend on the timing of this,\n // otherwise we could bind it in the constructor.\n if (this._isAnchor) {\n this._setupAsAnchor();\n }\n }\n\n ngOnDestroy() {\n this._cleanupClick?.();\n this._focusMonitor.stopMonitoring(this._elementRef);\n this._rippleLoader?.destroyRipple(this._elementRef.nativeElement);\n }\n\n /** Focuses the button. */\n focus(origin: FocusOrigin = 'program', options?: FocusOptions): void {\n if (origin) {\n this._focusMonitor.focusVia(this._elementRef.nativeElement, origin, options);\n } else {\n this._elementRef.nativeElement.focus(options);\n }\n }\n\n protected _getAriaDisabled() {\n if (this.ariaDisabled != null) {\n return this.ariaDisabled;\n }\n\n if (this._isAnchor) {\n return this.disabled || null;\n }\n\n return this.disabled && this.disabledInteractive ? true : null;\n }\n\n protected _getDisabledAttribute() {\n return this.disabledInteractive || !this.disabled ? null : true;\n }\n\n private _updateRippleDisabled(): void {\n this._rippleLoader?.setDisabled(\n this._elementRef.nativeElement,\n this.disableRipple || this.disabled,\n );\n }\n\n protected _getTabIndex() {\n if (this._isAnchor) {\n return this.disabled && !this.disabledInteractive ? -1 : this.tabIndex;\n }\n return this.tabIndex;\n }\n\n private _setupAsAnchor() {\n this._cleanupClick = this._ngZone.runOutsideAngular(() =>\n this._renderer.listen(this._elementRef.nativeElement, 'click', (event: Event) => {\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }),\n );\n }\n}\n\n// tslint:disable:variable-name\n/**\n * Anchor button base.\n */\nexport const MatAnchorBase = MatButtonBase;\nexport type MatAnchorBase = MatButtonBase;\n// tslint:enable:variable-name\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';\nimport {MatButtonBase} from './button-base';\n\n/**\n * Material Design icon button component. This type of button displays a single interactive icon for\n * users to perform an action.\n * See https://material.io/develop/web/components/buttons/icon-buttons/\n */\n@Component({\n selector: `button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]`,\n templateUrl: 'icon-button.html',\n styleUrls: ['icon-button.css', 'button-high-contrast.css'],\n host: {\n 'class': 'mdc-icon-button mat-mdc-icon-button',\n },\n exportAs: 'matButton, matAnchor',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatIconButton extends MatButtonBase {\n constructor(...args: unknown[]);\n\n constructor() {\n super();\n this._rippleLoader.configureRipple(this._elementRef.nativeElement, {centered: true});\n }\n}\n\n// tslint:disable:variable-name\n/**\n * Material Design icon button component for anchor elements. This button displays a single\n * interaction icon that allows users to navigate across different routes or pages.\n * See https://material.io/develop/web/components/buttons/icon-buttons/\n */\nexport const MatIconAnchor = MatIconButton;\nexport type MatIconAnchor = MatIconButton;\n// tslint:enable:variable-name\n","<span class=\"mat-mdc-button-persistent-ripple mdc-icon-button__ripple\"></span>\n\n<ng-content></ng-content>\n\n<!--\n The indicator can't be directly on the button, because MDC uses ::before for high contrast\n indication and it can't be on the ripple, because it has a border radius and overflow: hidden.\n-->\n<span class=\"mat-focus-indicator\"></span>\n\n<span class=\"mat-mdc-button-touch-target\"></span>\n"],"names":[],"mappings":";;;;;;;;AA2CA;MACa,iBAAiB,GAAG,IAAI,cAAc,CAAkB,mBAAmB;AAExF,SAAS,iBAAiB,CAAC,KAAc,EAAA;AACvC,IAAA,OAAO,KAAK,IAAI,IAAI,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;AAC3D;AAEA;MAgBa,aAAa,CAAA;AACxB,IAAA,WAAW,GAAG,MAAM,CAA0B,UAAU,CAAC;AAC/C,IAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IACxB,mBAAmB,GAAG,mBAAmB,EAAE;IAElC,OAAO,GAAG,MAAM,CAAC,iBAAiB,EAAE,EAAC,QAA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4e20/bin/src/material/button/button-base.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/button/icon-button.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {FocusMonitor, FocusOrigin} from '@angular/cdk/a11y';\nimport {\n AfterViewInit,\n booleanAttribute,\n Directive,\n ElementRef,\n inject,\n InjectionToken,\n Input,\n NgZone,\n numberAttribute,\n OnDestroy,\n Renderer2,\n} from '@angular/core';\nimport {_animationsDisabled, _StructuralStylesLoader, MatRippleLoader, ThemePalette} from '../core';\nimport {_CdkPrivateStyleLoader} from '@angular/cdk/private';\n\n/**\n * Possible appearances for a `MatButton`.\n * See https://m3.material.io/components/buttons/overview\n */\nexport type MatButtonAppearance = 'text' | 'filled' | 'elevated' | 'outlined' | 'tonal';\n\n/** Object that can be used to configure the default options for the button component. */\nexport interface MatButtonConfig {\n /** Whether disabled buttons should be interactive. */\n disabledInteractive?: boolean;\n\n /** Default palette color to apply to buttons. */\n color?: ThemePalette;\n\n /** Default appearance for plain buttons (not icon buttons or FABs). */\n defaultAppearance?: MatButtonAppearance;\n}\n\n/** Injection token that can be used to provide the default options the button component. */\nexport const MAT_BUTTON_CONFIG = new InjectionToken<MatButtonConfig>('MAT_BUTTON_CONFIG');\n\nfunction transformTabIndex(value: unknown): number | undefined {\n return value == null ? undefined : numberAttribute(value);\n}\n\n/** Base class for all buttons. */\n@Directive({\n host: {\n // Add a class that applies to all buttons. This makes it easier to target if somebody\n // wants to target all Material buttons.\n 'class': 'mat-mdc-button-base',\n '[class]': 'color ? \"mat-\" + color : \"\"',\n '[attr.disabled]': '_getDisabledAttribute()',\n '[attr.aria-disabled]': '_getAriaDisabled()',\n '[attr.tabindex]': '_getTabIndex()',\n '[class.mat-mdc-button-disabled]': 'disabled',\n '[class.mat-mdc-button-disabled-interactive]': 'disabledInteractive',\n '[class.mat-unthemed]': '!color',\n '[class._mat-animation-noopable]': '_animationsDisabled',\n },\n})\nexport class MatButtonBase implements AfterViewInit, OnDestroy {\n _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n protected _ngZone = inject(NgZone);\n protected _animationsDisabled = _animationsDisabled();\n\n protected readonly _config = inject(MAT_BUTTON_CONFIG, {optional: true});\n private readonly _focusMonitor = inject(FocusMonitor);\n private _cleanupClick: (() => void) | undefined;\n private _renderer = inject(Renderer2);\n\n /**\n * Handles the lazy creation of the MatButton ripple.\n * Used to improve initial load time of large applications.\n */\n protected _rippleLoader: MatRippleLoader = inject(MatRippleLoader);\n\n /** Whether the button is set on an anchor node. */\n protected _isAnchor: boolean;\n\n /** Whether this button is a FAB. Used to apply the correct class on the ripple. */\n protected _isFab = false;\n\n /**\n * Theme color of the button. This API is supported in M2 themes only, it has\n * no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/button/styling.\n *\n * For information on applying color variants in M3, see\n * https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants\n */\n @Input() color?: string | null;\n\n /** Whether the ripple effect is disabled or not. */\n @Input({transform: booleanAttribute})\n get disableRipple(): boolean {\n return this._disableRipple;\n }\n set disableRipple(value: any) {\n this._disableRipple = value;\n this._updateRippleDisabled();\n }\n private _disableRipple: boolean = false;\n\n /** Whether the button is disabled. */\n @Input({transform: booleanAttribute})\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: any) {\n this._disabled = value;\n this._updateRippleDisabled();\n }\n private _disabled: boolean = false;\n\n /** `aria-disabled` value of the button. */\n @Input({transform: booleanAttribute, alias: 'aria-disabled'})\n ariaDisabled: boolean | undefined;\n\n /**\n * Natively disabled buttons prevent focus and any pointer events from reaching the button.\n * In some scenarios this might not be desirable, because it can prevent users from finding out\n * why the button is disabled (e.g. via tooltip). This is also useful for buttons that may\n * become disabled when activated, which would cause focus to be transferred to the document\n * body instead of remaining on the button.\n *\n * Enabling this input will change the button so that it is styled to be disabled and will be\n * marked as `aria-disabled`, but it will allow the button to receive events and focus.\n *\n * Note that by enabling this, you need to set the `tabindex` yourself if the button isn't\n * meant to be tabbable and you have to prevent the button action (e.g. form submissions).\n */\n @Input({transform: booleanAttribute})\n disabledInteractive: boolean;\n\n /** Tab index for the button. */\n @Input({transform: transformTabIndex})\n tabIndex: number;\n\n /**\n * Backwards-compatibility input that handles pre-existing `[tabindex]` bindings.\n * @docs-private\n */\n @Input({alias: 'tabindex', transform: transformTabIndex})\n set _tabindex(value: number) {\n this.tabIndex = value;\n }\n\n constructor(...args: unknown[]);\n\n constructor() {\n inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);\n const element = this._elementRef.nativeElement;\n\n this._isAnchor = element.tagName === 'A';\n this.disabledInteractive = this._config?.disabledInteractive ?? false;\n this.color = this._config?.color ?? null;\n this._rippleLoader?.configureRipple(element, {className: 'mat-mdc-button-ripple'});\n }\n\n ngAfterViewInit() {\n this._focusMonitor.monitor(this._elementRef, true);\n\n // Some internal tests depend on the timing of this,\n // otherwise we could bind it in the constructor.\n if (this._isAnchor) {\n this._setupAsAnchor();\n }\n }\n\n ngOnDestroy() {\n this._cleanupClick?.();\n this._focusMonitor.stopMonitoring(this._elementRef);\n this._rippleLoader?.destroyRipple(this._elementRef.nativeElement);\n }\n\n /** Focuses the button. */\n focus(origin: FocusOrigin = 'program', options?: FocusOptions): void {\n if (origin) {\n this._focusMonitor.focusVia(this._elementRef.nativeElement, origin, options);\n } else {\n this._elementRef.nativeElement.focus(options);\n }\n }\n\n protected _getAriaDisabled() {\n if (this.ariaDisabled != null) {\n return this.ariaDisabled;\n }\n\n if (this._isAnchor) {\n return this.disabled || null;\n }\n\n return this.disabled && this.disabledInteractive ? true : null;\n }\n\n protected _getDisabledAttribute() {\n return this.disabledInteractive || !this.disabled ? null : true;\n }\n\n private _updateRippleDisabled(): void {\n this._rippleLoader?.setDisabled(\n this._elementRef.nativeElement,\n this.disableRipple || this.disabled,\n );\n }\n\n protected _getTabIndex() {\n if (this._isAnchor) {\n return this.disabled && !this.disabledInteractive ? -1 : this.tabIndex;\n }\n return this.tabIndex;\n }\n\n private _setupAsAnchor() {\n this._cleanupClick = this._ngZone.runOutsideAngular(() =>\n this._renderer.listen(this._elementRef.nativeElement, 'click', (event: Event) => {\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }),\n );\n }\n}\n\n// tslint:disable:variable-name\n/**\n * Anchor button base.\n */\nexport const MatAnchorBase = MatButtonBase;\nexport type MatAnchorBase = MatButtonBase;\n// tslint:enable:variable-name\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';\nimport {MatButtonBase} from './button-base';\n\n/**\n * Material Design icon button component. This type of button displays a single interactive icon for\n * users to perform an action.\n * See https://material.io/develop/web/components/buttons/icon-buttons/\n */\n@Component({\n selector: `button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]`,\n templateUrl: 'icon-button.html',\n styleUrls: ['icon-button.css', 'button-high-contrast.css'],\n host: {\n 'class': 'mdc-icon-button mat-mdc-icon-button',\n },\n exportAs: 'matButton, matAnchor',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatIconButton extends MatButtonBase {\n constructor(...args: unknown[]);\n\n constructor() {\n super();\n this._rippleLoader.configureRipple(this._elementRef.nativeElement, {centered: true});\n }\n}\n\n// tslint:disable:variable-name\n/**\n * Material Design icon button component for anchor elements. This button displays a single\n * interaction icon that allows users to navigate across different routes or pages.\n * See https://material.io/develop/web/components/buttons/icon-buttons/\n */\nexport const MatIconAnchor = MatIconButton;\nexport type MatIconAnchor = MatIconButton;\n// tslint:enable:variable-name\n"],"names":["MAT_BUTTON_CONFIG","InjectionToken","transformTabIndex","value","undefined","numberAttribute","inject","NgZone","_animationsDisabled","optional","_cleanupClick","_rippleLoader","MatRippleLoader","_disableRipple","_updateRippleDisabled","disabled","constructor","disabledInteractive","_config","color","configureRipple","element","className","ngAfterViewInit","_focusMonitor","monitor","_elementRef","stopMonitoring","destroyRipple","nativeElement","focusVia","origin","options","_getAriaDisabled","ariaDisabled","type","Input","booleanAttribute","alias","transform","MatIconButton","MatButtonBase","ChangeDetectionStrategy","OnPush","template","styles"],"mappings":";;;;;;;;AA4CMA,MAAAA,iBAAA,OAAAC,cAAA,CAAA,mBAAA;AAGJ,SAAAC,iBAAuBA,CAAAC,KAAY,EAAA;AACrC,EAAA,OAkBAA,KAAA,IACEC,IAAAA,GAAAA,SAAA,GACUC;AAWP;;;SA2BmB,GAAAC,MAAA,CAAAC,MAAA,CAAA;AAGtBC,EAAAA,mBACY,GAAAA,mBAAA,EAAA;SACH,GAAAF,MAAA,CAAAN,iBAAc,EAAA;IAAAS,QAAA,EAAA;AAAA,GAAA,CAAA;;EAGrBC,aAAA;;EA6BFC,aAAA,GAAAL,MAAA,CAAAM,eAAA,CAAA;;;;;;;;IA6BA,IAAAC,CAAAA,cAAA,GAAAV,KAAA;AAEW,IAAA,IAAA,CAAAW,qBAAA,EAAA;;gBAIX,GAAA,KAAA;AAGA,EAAA,IAAAC,QAAA,GAAA;yBACc;;cAEZA,CAAAZ,KAAA,EAAA;;8BACgC,EAAA;;WAKhC;;;;qBAsCF,EAAA;;;EAjLSa,WAAA,GAAA;;;;AAKP,IAAA,IAAA,CAAAC,mBAAA,GAAA,IAAA,CAAAC,OAAA,EAAAD,mBAAA,IAAA,KAAA;AACA,IAAA,IAAA,CAAAE,KAAA,GAAA,IAAA,CAAAD,OAAA,EAAAC,KAAA,IAAA,IAAA;AACA,IAAA,IAAA,CAAAR,aAAA,EAAAS,eAAA,CAAAC,OAAA,EAAA;MAAAC,SAAA,EAAA;AAAA,KAAA,CAAA;AAIA;iBACAC,GAAA;AACD,IAAA,IAAA,CAAAC,aAAA,CAAAC,OAAA,CAAA,IAAA,C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