Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 166d46d

Browse files
committedFeb 19, 2025·
fix(material/button): combine MatButton and MatAnchor
Currently we have two directives for each button variant: `MatButton` which applies to `button` elements and `MatButtonAnchor` which applies to anchors. This is problematic in a couple of ways: 1. The styles, which can be non-trivial, are duplicated if both classes are used. 2. Users have to think about which class they're importing. These changes combine the two classes to resolve the issues and simplify our setup. BREAKING CHANGE: `tabindex` values set as `[attr.tabindex]` set on a Material button might not work as expected. Use `tabindex` for static values, or `[tabindex]`/`[tabIndex]` for dynamic ones.
1 parent 01292a1 commit 166d46d

File tree

8 files changed

+110
-209
lines changed

8 files changed

+110
-209
lines changed
 

‎src/material/button/button-base.ts

+57-67
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
NgZone,
2020
numberAttribute,
2121
OnDestroy,
22-
OnInit,
2322
Renderer2,
2423
} from '@angular/core';
2524
import {_StructuralStylesLoader, MatRippleLoader, ThemePalette} from '@angular/material/core';
@@ -52,8 +51,13 @@ export const MAT_BUTTON_HOST = {
5251
// wants to target all Material buttons.
5352
'[class.mat-mdc-button-base]': 'true',
5453
'[class]': 'color ? "mat-" + color : ""',
54+
'[attr.tabindex]': '_getTabIndex()',
5555
};
5656

57+
function transformTabIndex(value: unknown): number | undefined {
58+
return value == null ? undefined : numberAttribute(value);
59+
}
60+
5761
/** List of classes to add to buttons instances based on host attribute selector. */
5862
const HOST_SELECTOR_MDC_CLASS_PAIR: {attribute: string; mdcClasses: string[]}[] = [
5963
{
@@ -94,13 +98,18 @@ export class MatButtonBase implements AfterViewInit, OnDestroy {
9498
_animationMode = inject(ANIMATION_MODULE_TYPE, {optional: true});
9599

96100
private readonly _focusMonitor = inject(FocusMonitor);
101+
private _cleanupClick: (() => void) | undefined;
102+
private _renderer = inject(Renderer2);
97103

98104
/**
99105
* Handles the lazy creation of the MatButton ripple.
100106
* Used to improve initial load time of large applications.
101107
*/
102108
protected _rippleLoader: MatRippleLoader = inject(MatRippleLoader);
103109

110+
/** Whether the button is set on an anchor node. */
111+
protected _isAnchor: boolean;
112+
104113
/** Whether this button is a FAB. Used to apply the correct class on the ripple. */
105114
protected _isFab = false;
106115

@@ -153,14 +162,28 @@ export class MatButtonBase implements AfterViewInit, OnDestroy {
153162
@Input({transform: booleanAttribute})
154163
disabledInteractive: boolean;
155164

165+
/** Tab index for the button. */
166+
@Input({transform: transformTabIndex})
167+
tabIndex: number;
168+
169+
/**
170+
* Backwards-compatibility input that handles pre-existing `[tabindex]` bindings.
171+
* @docs-private
172+
*/
173+
@Input({alias: 'tabindex', transform: transformTabIndex})
174+
set _tabindex(value: number) {
175+
this.tabIndex = value;
176+
}
177+
156178
constructor(...args: unknown[]);
157179

158180
constructor() {
159181
inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);
160182
const config = inject(MAT_BUTTON_CONFIG, {optional: true});
161-
const element = this._elementRef.nativeElement;
183+
const element: HTMLElement = this._elementRef.nativeElement;
162184
const classList = (element as HTMLElement).classList;
163185

186+
this._isAnchor = element.tagName === 'A';
164187
this.disabledInteractive = config?.disabledInteractive ?? false;
165188
this.color = config?.color ?? null;
166189
this._rippleLoader?.configureRipple(element, {className: 'mat-mdc-button-ripple'});
@@ -176,9 +199,16 @@ export class MatButtonBase implements AfterViewInit, OnDestroy {
176199

177200
ngAfterViewInit() {
178201
this._focusMonitor.monitor(this._elementRef, true);
202+
203+
// Some internal tests depend on the timing of this,
204+
// otherwise we could bind it in the constructor.
205+
if (this._isAnchor) {
206+
this._setupAsAnchor();
207+
}
179208
}
180209

181210
ngOnDestroy() {
211+
this._cleanupClick?.();
182212
this._focusMonitor.stopMonitoring(this._elementRef);
183213
this._rippleLoader?.destroyRipple(this._elementRef.nativeElement);
184214
}
@@ -197,6 +227,10 @@ export class MatButtonBase implements AfterViewInit, OnDestroy {
197227
return this.ariaDisabled;
198228
}
199229

230+
if (this._isAnchor) {
231+
return this.disabled || null;
232+
}
233+
200234
return this.disabled && this.disabledInteractive ? true : null;
201235
}
202236

@@ -210,74 +244,30 @@ export class MatButtonBase implements AfterViewInit, OnDestroy {
210244
this.disableRipple || this.disabled,
211245
);
212246
}
213-
}
214247

215-
/** Shared host configuration for buttons using the `<a>` tag. */
216-
export const MAT_ANCHOR_HOST = {
217-
// Note that this is basically a noop on anchors,
218-
// but it appears that some internal apps depend on it.
219-
'[attr.disabled]': '_getDisabledAttribute()',
220-
'[class.mat-mdc-button-disabled]': 'disabled',
221-
'[class.mat-mdc-button-disabled-interactive]': 'disabledInteractive',
222-
'[class._mat-animation-noopable]': '_animationMode === "NoopAnimations"',
248+
protected _getTabIndex() {
249+
if (this._isAnchor) {
250+
return this.disabled && !this.disabledInteractive ? -1 : this.tabIndex;
251+
}
252+
return this.tabIndex;
253+
}
223254

224-
// Note that we ignore the user-specified tabindex when it's disabled for
225-
// consistency with the `mat-button` applied on native buttons where even
226-
// though they have an index, they're not tabbable.
227-
'[attr.tabindex]': 'disabled && !disabledInteractive ? -1 : tabIndex',
228-
'[attr.aria-disabled]': '_getAriaDisabled()',
229-
// MDC automatically applies the primary theme color to the button, but we want to support
230-
// an unthemed version. If color is undefined, apply a CSS class that makes it easy to
231-
// select and style this "theme".
232-
'[class.mat-unthemed]': '!color',
233-
// Add a class that applies to all buttons. This makes it easier to target if somebody
234-
// wants to target all Material buttons.
235-
'[class.mat-mdc-button-base]': 'true',
236-
'[class]': 'color ? "mat-" + color : ""',
237-
};
255+
private _setupAsAnchor() {
256+
this._cleanupClick = this._ngZone.runOutsideAngular(() =>
257+
this._renderer.listen(this._elementRef.nativeElement, 'click', (event: Event) => {
258+
if (this.disabled) {
259+
event.preventDefault();
260+
event.stopImmediatePropagation();
261+
}
262+
}),
263+
);
264+
}
265+
}
238266

267+
// tslint:disable:variable-name
239268
/**
240269
* Anchor button base.
241270
*/
242-
@Directive()
243-
export class MatAnchorBase extends MatButtonBase implements OnInit, OnDestroy {
244-
private _renderer = inject(Renderer2);
245-
private _cleanupClick: () => void;
246-
247-
@Input({
248-
transform: (value: unknown) => {
249-
return value == null ? undefined : numberAttribute(value);
250-
},
251-
})
252-
tabIndex: number;
253-
254-
ngOnInit(): void {
255-
this._ngZone.runOutsideAngular(() => {
256-
this._cleanupClick = this._renderer.listen(
257-
this._elementRef.nativeElement,
258-
'click',
259-
this._haltDisabledEvents,
260-
);
261-
});
262-
}
263-
264-
override ngOnDestroy(): void {
265-
super.ngOnDestroy();
266-
this._cleanupClick?.();
267-
}
268-
269-
_haltDisabledEvents = (event: Event): void => {
270-
// A disabled button shouldn't apply any actions
271-
if (this.disabled) {
272-
event.preventDefault();
273-
event.stopImmediatePropagation();
274-
}
275-
};
276-
277-
protected override _getAriaDisabled() {
278-
if (this.ariaDisabled != null) {
279-
return this.ariaDisabled;
280-
}
281-
return this.disabled || null;
282-
}
283-
}
271+
export const MatAnchorBase = MatButtonBase;
272+
export type MatAnchorBase = MatButtonBase;
273+
// tslint:enable:variable-name

‎src/material/button/button.ts

+8-13
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';
10-
import {MAT_ANCHOR_HOST, MAT_BUTTON_HOST, MatAnchorBase, MatButtonBase} from './button-base';
10+
import {MAT_BUTTON_HOST, MatButtonBase} from './button-base';
1111

1212
/**
1313
* Material Design button component. Users interact with a button to perform an action.
@@ -21,17 +21,19 @@ import {MAT_ANCHOR_HOST, MAT_BUTTON_HOST, MatAnchorBase, MatButtonBase} from './
2121
@Component({
2222
selector: `
2323
button[mat-button], button[mat-raised-button], button[mat-flat-button],
24-
button[mat-stroked-button]
24+
button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button],
25+
a[mat-stroked-button]
2526
`,
2627
templateUrl: 'button.html',
2728
styleUrls: ['button.css', 'button-high-contrast.css'],
2829
host: MAT_BUTTON_HOST,
29-
exportAs: 'matButton',
30+
exportAs: 'matButton, matAnchor',
3031
encapsulation: ViewEncapsulation.None,
3132
changeDetection: ChangeDetectionStrategy.OnPush,
3233
})
3334
export class MatButton extends MatButtonBase {}
3435

36+
// tslint:disable:variable-name
3537
/**
3638
* Material Design button component for anchor elements. Anchor elements are used to provide
3739
* links for the user to navigate across different routes or pages.
@@ -42,13 +44,6 @@ export class MatButton extends MatButtonBase {}
4244
* specification. `MatAnchor` additionally captures an additional "flat" appearance, which matches
4345
* "contained" but without elevation.
4446
*/
45-
@Component({
46-
selector: `a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]`,
47-
exportAs: 'matButton, matAnchor',
48-
host: MAT_ANCHOR_HOST,
49-
templateUrl: 'button.html',
50-
styleUrls: ['button.css', 'button-high-contrast.css'],
51-
encapsulation: ViewEncapsulation.None,
52-
changeDetection: ChangeDetectionStrategy.OnPush,
53-
})
54-
export class MatAnchor extends MatAnchorBase {}
47+
export const MatAnchor = MatButton;
48+
export type MatAnchor = MatButton;
49+
// tslint:enable:variable-name

‎src/material/button/fab.ts

+11-56
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import {
1616
inject,
1717
} from '@angular/core';
1818

19-
import {MatAnchor} from './button';
20-
import {MAT_ANCHOR_HOST, MAT_BUTTON_HOST, MatButtonBase} from './button-base';
19+
import {MAT_BUTTON_HOST, MatButtonBase} from './button-base';
2120
import {ThemePalette} from '@angular/material/core';
2221

2322
/** Default FAB options that can be overridden. */
@@ -60,15 +59,15 @@ const defaults = MAT_FAB_DEFAULT_OPTIONS_FACTORY();
6059
* The `MatFabButton` class has two appearances: normal and extended.
6160
*/
6261
@Component({
63-
selector: `button[mat-fab]`,
62+
selector: `button[mat-fab], a[mat-fab]`,
6463
templateUrl: 'button.html',
6564
styleUrl: 'fab.css',
6665
host: {
6766
...MAT_BUTTON_HOST,
6867
'[class.mdc-fab--extended]': 'extended',
6968
'[class.mat-mdc-extended-fab]': 'extended',
7069
},
71-
exportAs: 'matButton',
70+
exportAs: 'matButton, matAnchor',
7271
encapsulation: ViewEncapsulation.None,
7372
changeDetection: ChangeDetectionStrategy.OnPush,
7473
})
@@ -94,11 +93,11 @@ export class MatFabButton extends MatButtonBase {
9493
* See https://material.io/components/buttons-floating-action-button/
9594
*/
9695
@Component({
97-
selector: `button[mat-mini-fab]`,
96+
selector: `button[mat-mini-fab], a[mat-mini-fab]`,
9897
templateUrl: 'button.html',
9998
styleUrl: 'fab.css',
10099
host: MAT_BUTTON_HOST,
101-
exportAs: 'matButton',
100+
exportAs: 'matButton, matAnchor',
102101
encapsulation: ViewEncapsulation.None,
103102
changeDetection: ChangeDetectionStrategy.OnPush,
104103
})
@@ -116,66 +115,22 @@ export class MatMiniFabButton extends MatButtonBase {
116115
}
117116
}
118117

118+
// tslint:disable:variable-name
119119
/**
120120
* Material Design floating action button (FAB) component for anchor elements. Anchor elements
121121
* are used to provide links for the user to navigate across different routes or pages.
122122
* See https://material.io/components/buttons-floating-action-button/
123123
*
124124
* The `MatFabAnchor` class has two appearances: normal and extended.
125125
*/
126-
@Component({
127-
selector: `a[mat-fab]`,
128-
templateUrl: 'button.html',
129-
styleUrl: 'fab.css',
130-
host: {
131-
...MAT_ANCHOR_HOST,
132-
'[class.mdc-fab--extended]': 'extended',
133-
'[class.mat-mdc-extended-fab]': 'extended',
134-
},
135-
exportAs: 'matButton, matAnchor',
136-
encapsulation: ViewEncapsulation.None,
137-
changeDetection: ChangeDetectionStrategy.OnPush,
138-
})
139-
export class MatFabAnchor extends MatAnchor {
140-
private _options = inject<MatFabDefaultOptions>(MAT_FAB_DEFAULT_OPTIONS, {optional: true});
141-
142-
override _isFab = true;
143-
144-
@Input({transform: booleanAttribute}) extended: boolean;
145-
146-
constructor(...args: unknown[]);
147-
148-
constructor() {
149-
super();
150-
this._options = this._options || defaults;
151-
this.color = this._options!.color || defaults.color;
152-
}
153-
}
126+
export const MatFabAnchor = MatFabButton;
127+
export type MatFabAnchor = MatFabButton;
154128

155129
/**
156130
* Material Design mini floating action button (FAB) component for anchor elements. Anchor elements
157131
* are used to provide links for the user to navigate across different routes or pages.
158132
* See https://material.io/components/buttons-floating-action-button/
159133
*/
160-
@Component({
161-
selector: `a[mat-mini-fab]`,
162-
templateUrl: 'button.html',
163-
styleUrl: 'fab.css',
164-
host: MAT_ANCHOR_HOST,
165-
exportAs: 'matButton, matAnchor',
166-
encapsulation: ViewEncapsulation.None,
167-
changeDetection: ChangeDetectionStrategy.OnPush,
168-
})
169-
export class MatMiniFabAnchor extends MatAnchor {
170-
private _options = inject<MatFabDefaultOptions>(MAT_FAB_DEFAULT_OPTIONS, {optional: true});
171-
172-
override _isFab = true;
173-
174-
constructor(...args: unknown[]);
175-
176-
constructor() {
177-
super();
178-
this._options = this._options || defaults;
179-
this.color = this._options!.color || defaults.color;
180-
}
181-
}
134+
export const MatMiniFabAnchor = MatMiniFabButton;
135+
export type MatMiniFabAnchor = MatMiniFabButton;
136+
// tslint:enable:variable-name

‎src/material/button/icon-button.ts

+7-13
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
*/
88

99
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';
10-
import {MAT_ANCHOR_HOST, MAT_BUTTON_HOST, MatAnchorBase, MatButtonBase} from './button-base';
10+
import {MAT_BUTTON_HOST, MatButtonBase} from './button-base';
1111

1212
/**
1313
* Material Design icon button component. This type of button displays a single interactive icon for
1414
* users to perform an action.
1515
* See https://material.io/develop/web/components/buttons/icon-buttons/
1616
*/
1717
@Component({
18-
selector: `button[mat-icon-button]`,
18+
selector: `button[mat-icon-button], a[mat-icon-button]`,
1919
templateUrl: 'icon-button.html',
2020
styleUrls: ['icon-button.css', 'button-high-contrast.css'],
2121
host: MAT_BUTTON_HOST,
22-
exportAs: 'matButton',
22+
exportAs: 'matButton, matAnchor',
2323
encapsulation: ViewEncapsulation.None,
2424
changeDetection: ChangeDetectionStrategy.OnPush,
2525
})
@@ -32,18 +32,12 @@ export class MatIconButton extends MatButtonBase {
3232
}
3333
}
3434

35+
// tslint:disable:variable-name
3536
/**
3637
* Material Design icon button component for anchor elements. This button displays a single
3738
* interaction icon that allows users to navigate across different routes or pages.
3839
* See https://material.io/develop/web/components/buttons/icon-buttons/
3940
*/
40-
@Component({
41-
selector: `a[mat-icon-button]`,
42-
templateUrl: 'icon-button.html',
43-
styleUrls: ['icon-button.css', 'button-high-contrast.css'],
44-
host: MAT_ANCHOR_HOST,
45-
exportAs: 'matButton, matAnchor',
46-
encapsulation: ViewEncapsulation.None,
47-
changeDetection: ChangeDetectionStrategy.OnPush,
48-
})
49-
export class MatIconAnchor extends MatAnchorBase {}
41+
export const MatIconAnchor = MatIconButton;
42+
export type MatIconAnchor = MatIconButton;
43+
// tslint:enable:variable-name

‎src/material/button/module.ts

+4-18
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,19 @@
88

99
import {NgModule} from '@angular/core';
1010
import {MatCommonModule, MatRippleModule} from '@angular/material/core';
11-
import {MatAnchor, MatButton} from './button';
12-
import {MatFabAnchor, MatFabButton, MatMiniFabAnchor, MatMiniFabButton} from './fab';
13-
import {MatIconAnchor, MatIconButton} from './icon-button';
11+
import {MatButton} from './button';
12+
import {MatFabButton, MatMiniFabButton} from './fab';
13+
import {MatIconButton} from './icon-button';
1414

1515
@NgModule({
1616
imports: [
1717
MatCommonModule,
1818
MatRippleModule,
19-
MatAnchor,
2019
MatButton,
21-
MatIconAnchor,
22-
MatMiniFabAnchor,
2320
MatMiniFabButton,
2421
MatIconButton,
25-
MatFabAnchor,
2622
MatFabButton,
2723
],
28-
exports: [
29-
MatAnchor,
30-
MatButton,
31-
MatIconAnchor,
32-
MatIconButton,
33-
MatMiniFabAnchor,
34-
MatMiniFabButton,
35-
MatFabAnchor,
36-
MatFabButton,
37-
MatCommonModule,
38-
],
24+
exports: [MatCommonModule, MatButton, MatMiniFabButton, MatIconButton, MatFabButton],
3925
})
4026
export class MatButtonModule {}

‎src/material/datepicker/datepicker-toggle.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
type="button"
55
[attr.aria-haspopup]="datepicker ? 'dialog' : null"
66
[attr.aria-label]="ariaLabel || _intl.openCalendarLabel"
7-
[attr.tabindex]="disabled ? -1 : tabIndex"
7+
[tabIndex]="disabled ? -1 : tabIndex"
88
[attr.aria-expanded]="datepicker ? datepicker.opened : null"
99
[disabled]="disabled"
1010
[disableRipple]="disableRipple">

‎src/material/timepicker/timepicker-toggle.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[attr.aria-label]="getAriaLabel()"
66
[attr.aria-labelledby]="ariaLabelledby()"
77
[attr.aria-expanded]="timepicker().isOpen()"
8-
[attr.tabindex]="_isDisabled() ? -1 : tabIndex()"
8+
[tabIndex]="_isDisabled() ? -1 : tabIndex()"
99
[disabled]="_isDisabled()"
1010
[disableRipple]="disableRipple()">
1111

‎tools/public_api_guard/material/button.md

+21-40
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { InjectionToken } from '@angular/core';
1313
import { MatRippleLoader } from '@angular/material/core';
1414
import { NgZone } from '@angular/core';
1515
import { OnDestroy } from '@angular/core';
16-
import { OnInit } from '@angular/core';
1716
import { ThemePalette } from '@angular/material/core';
1817

1918
// @public
@@ -26,17 +25,15 @@ export const MAT_FAB_DEFAULT_OPTIONS: InjectionToken<MatFabDefaultOptions>;
2625
export function MAT_FAB_DEFAULT_OPTIONS_FACTORY(): MatFabDefaultOptions;
2726

2827
// @public
29-
export class MatAnchor extends MatAnchorBase {
30-
// (undocumented)
31-
static ɵcmp: i0.ɵɵComponentDeclaration<MatAnchor, "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", ["matButton", "matAnchor"], {}, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
32-
// (undocumented)
33-
static ɵfac: i0.ɵɵFactoryDeclaration<MatAnchor, never>;
34-
}
28+
export const MatAnchor: typeof MatButton;
29+
30+
// @public (undocumented)
31+
export type MatAnchor = MatButton;
3532

3633
// @public
3734
export class MatButton extends MatButtonBase {
3835
// (undocumented)
39-
static ɵcmp: i0.ɵɵComponentDeclaration<MatButton, " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", ["matButton"], {}, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
36+
static ɵcmp: i0.ɵɵComponentDeclaration<MatButton, " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", ["matButton", "matAnchor"], {}, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
4037
// (undocumented)
4138
static ɵfac: i0.ɵɵFactoryDeclaration<MatButton, never>;
4239
}
@@ -54,23 +51,14 @@ export class MatButtonModule {
5451
// (undocumented)
5552
static ɵinj: i0.ɵɵInjectorDeclaration<MatButtonModule>;
5653
// (undocumented)
57-
static ɵmod: i0.ɵɵNgModuleDeclaration<MatButtonModule, never, [typeof i1.MatCommonModule, typeof i1.MatRippleModule, typeof i2.MatAnchor, typeof i2.MatButton, typeof i3.MatIconAnchor, typeof i4.MatMiniFabAnchor, typeof i4.MatMiniFabButton, typeof i3.MatIconButton, typeof i4.MatFabAnchor, typeof i4.MatFabButton], [typeof i2.MatAnchor, typeof i2.MatButton, typeof i3.MatIconAnchor, typeof i3.MatIconButton, typeof i4.MatMiniFabAnchor, typeof i4.MatMiniFabButton, typeof i4.MatFabAnchor, typeof i4.MatFabButton, typeof i1.MatCommonModule]>;
54+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatButtonModule, never, [typeof i1.MatCommonModule, typeof i1.MatRippleModule, typeof i2.MatButton, typeof i3.MatMiniFabButton, typeof i4.MatIconButton, typeof i3.MatFabButton], [typeof i1.MatCommonModule, typeof i2.MatButton, typeof i3.MatMiniFabButton, typeof i4.MatIconButton, typeof i3.MatFabButton]>;
5855
}
5956

6057
// @public
61-
export class MatFabAnchor extends MatAnchor {
62-
constructor(...args: unknown[]);
63-
// (undocumented)
64-
extended: boolean;
65-
// (undocumented)
66-
_isFab: boolean;
67-
// (undocumented)
68-
static ngAcceptInputType_extended: unknown;
69-
// (undocumented)
70-
static ɵcmp: i0.ɵɵComponentDeclaration<MatFabAnchor, "a[mat-fab]", ["matButton", "matAnchor"], { "extended": { "alias": "extended"; "required": false; }; }, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
71-
// (undocumented)
72-
static ɵfac: i0.ɵɵFactoryDeclaration<MatFabAnchor, never>;
73-
}
58+
export const MatFabAnchor: typeof MatFabButton;
59+
60+
// @public (undocumented)
61+
export type MatFabAnchor = MatFabButton;
7462

7563
// @public
7664
export class MatFabButton extends MatButtonBase {
@@ -82,7 +70,7 @@ export class MatFabButton extends MatButtonBase {
8270
// (undocumented)
8371
static ngAcceptInputType_extended: unknown;
8472
// (undocumented)
85-
static ɵcmp: i0.ɵɵComponentDeclaration<MatFabButton, "button[mat-fab]", ["matButton"], { "extended": { "alias": "extended"; "required": false; }; }, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
73+
static ɵcmp: i0.ɵɵComponentDeclaration<MatFabButton, "button[mat-fab], a[mat-fab]", ["matButton", "matAnchor"], { "extended": { "alias": "extended"; "required": false; }; }, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
8674
// (undocumented)
8775
static ɵfac: i0.ɵɵFactoryDeclaration<MatFabButton, never>;
8876
}
@@ -93,40 +81,33 @@ export interface MatFabDefaultOptions {
9381
}
9482

9583
// @public
96-
export class MatIconAnchor extends MatAnchorBase {
97-
// (undocumented)
98-
static ɵcmp: i0.ɵɵComponentDeclaration<MatIconAnchor, "a[mat-icon-button]", ["matButton", "matAnchor"], {}, {}, never, ["*"], true, never>;
99-
// (undocumented)
100-
static ɵfac: i0.ɵɵFactoryDeclaration<MatIconAnchor, never>;
101-
}
84+
export const MatIconAnchor: typeof MatIconButton;
85+
86+
// @public (undocumented)
87+
export type MatIconAnchor = MatIconButton;
10288

10389
// @public
10490
export class MatIconButton extends MatButtonBase {
10591
constructor(...args: unknown[]);
10692
// (undocumented)
107-
static ɵcmp: i0.ɵɵComponentDeclaration<MatIconButton, "button[mat-icon-button]", ["matButton"], {}, {}, never, ["*"], true, never>;
93+
static ɵcmp: i0.ɵɵComponentDeclaration<MatIconButton, "button[mat-icon-button], a[mat-icon-button]", ["matButton", "matAnchor"], {}, {}, never, ["*"], true, never>;
10894
// (undocumented)
10995
static ɵfac: i0.ɵɵFactoryDeclaration<MatIconButton, never>;
11096
}
11197

11298
// @public
113-
export class MatMiniFabAnchor extends MatAnchor {
114-
constructor(...args: unknown[]);
115-
// (undocumented)
116-
_isFab: boolean;
117-
// (undocumented)
118-
static ɵcmp: i0.ɵɵComponentDeclaration<MatMiniFabAnchor, "a[mat-mini-fab]", ["matButton", "matAnchor"], {}, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
119-
// (undocumented)
120-
static ɵfac: i0.ɵɵFactoryDeclaration<MatMiniFabAnchor, never>;
121-
}
99+
export const MatMiniFabAnchor: typeof MatMiniFabButton;
100+
101+
// @public (undocumented)
102+
export type MatMiniFabAnchor = MatMiniFabButton;
122103

123104
// @public
124105
export class MatMiniFabButton extends MatButtonBase {
125106
constructor(...args: unknown[]);
126107
// (undocumented)
127108
_isFab: boolean;
128109
// (undocumented)
129-
static ɵcmp: i0.ɵɵComponentDeclaration<MatMiniFabButton, "button[mat-mini-fab]", ["matButton"], {}, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
110+
static ɵcmp: i0.ɵɵComponentDeclaration<MatMiniFabButton, "button[mat-mini-fab], a[mat-mini-fab]", ["matButton", "matAnchor"], {}, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
130111
// (undocumented)
131112
static ɵfac: i0.ɵɵFactoryDeclaration<MatMiniFabButton, never>;
132113
}

0 commit comments

Comments
 (0)
Please sign in to comment.