Skip to content

Commit d082d4d

Browse files
authored
docs: switch remaining docs examples to MDC (#25653)
Switches the remaining usages of legacy components in other components' examples to use the non-legacy versions.
1 parent b8af554 commit d082d4d

File tree

68 files changed

+157
-176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+157
-176
lines changed

src/components-examples/cdk-experimental/selection/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ng_module(
1313
"//src/cdk-experimental/selection",
1414
"//src/cdk/collections",
1515
"//src/cdk/table",
16-
"//src/material/legacy-checkbox",
16+
"//src/material/checkbox",
1717
"@npm//@angular/forms",
1818
],
1919
)

src/components-examples/cdk-experimental/selection/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {CdkTableModule} from '@angular/cdk/table';
33
import {CommonModule} from '@angular/common';
44
import {NgModule} from '@angular/core';
55
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
6-
import {MatLegacyCheckboxModule} from '@angular/material/legacy-checkbox';
6+
import {MatCheckboxModule} from '@angular/material/checkbox';
77

88
import {CdkSelectionColumnExample} from './cdk-selection-column/cdk-selection-column-example';
99
import {CdkSelectionListExample} from './cdk-selection-list/cdk-selection-list-example';
@@ -19,7 +19,7 @@ const EXAMPLES = [CdkSelectionListExample, CdkSelectionColumnExample];
1919
CommonModule,
2020
FormsModule,
2121
ReactiveFormsModule,
22-
MatLegacyCheckboxModule,
22+
MatCheckboxModule,
2323
],
2424
declarations: EXAMPLES,
2525
exports: EXAMPLES,

src/components-examples/cdk/a11y/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ng_module(
1111
]),
1212
deps = [
1313
"//src/cdk/a11y",
14-
"//src/material/legacy-select",
14+
"//src/material/select",
1515
],
1616
)
1717

src/components-examples/cdk/a11y/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {A11yModule} from '@angular/cdk/a11y';
22
import {NgModule} from '@angular/core';
3-
import {MatLegacySelectModule} from '@angular/material/legacy-select';
3+
import {MatSelectModule} from '@angular/material/select';
44
import {FocusMonitorDirectivesExample} from './focus-monitor-directives/focus-monitor-directives-example';
55
import {FocusMonitorFocusViaExample} from './focus-monitor-focus-via/focus-monitor-focus-via-example';
66
import {FocusMonitorOverviewExample} from './focus-monitor-overview/focus-monitor-overview-example';
@@ -14,7 +14,7 @@ const EXAMPLES = [
1414
];
1515

1616
@NgModule({
17-
imports: [A11yModule, MatLegacySelectModule],
17+
imports: [A11yModule, MatSelectModule],
1818
declarations: EXAMPLES,
1919
exports: EXAMPLES,
2020
})

src/components-examples/cdk/text-field/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ ng_module(
1111
]),
1212
deps = [
1313
"//src/cdk/text-field",
14-
"//src/material/legacy-button",
15-
"//src/material/legacy-input",
16-
"//src/material/legacy-select",
14+
"//src/material/button",
15+
"//src/material/input",
16+
"//src/material/select",
1717
],
1818
)
1919

src/components-examples/cdk/text-field/index.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {TextFieldModule} from '@angular/cdk/text-field';
22
import {CommonModule} from '@angular/common';
33
import {NgModule} from '@angular/core';
4-
import {MatLegacyButtonModule} from '@angular/material/legacy-button';
5-
import {MatLegacyInputModule} from '@angular/material/legacy-input';
6-
import {MatLegacySelectModule} from '@angular/material/legacy-select';
4+
import {MatButtonModule} from '@angular/material/button';
5+
import {MatInputModule} from '@angular/material/input';
6+
import {MatSelectModule} from '@angular/material/select';
77
import {TextFieldAutofillDirectiveExample} from './text-field-autofill-directive/text-field-autofill-directive-example';
88
import {TextFieldAutofillMonitorExample} from './text-field-autofill-monitor/text-field-autofill-monitor-example';
99
import {TextFieldAutosizeTextareaExample} from './text-field-autosize-textarea/text-field-autosize-textarea-example';
@@ -21,13 +21,7 @@ const EXAMPLES = [
2121
];
2222

2323
@NgModule({
24-
imports: [
25-
CommonModule,
26-
TextFieldModule,
27-
MatLegacyButtonModule,
28-
MatLegacyInputModule,
29-
MatLegacySelectModule,
30-
],
24+
imports: [CommonModule, TextFieldModule, MatButtonModule, MatInputModule, MatSelectModule],
3125
declarations: EXAMPLES,
3226
exports: EXAMPLES,
3327
})

src/components-examples/cdk/tree/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ ng_module(
1111
]),
1212
deps = [
1313
"//src/cdk/tree",
14+
"//src/material/button",
1415
"//src/material/icon",
15-
"//src/material/legacy-button",
1616
],
1717
)
1818

src/components-examples/cdk/tree/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {CdkTreeModule} from '@angular/cdk/tree';
22
import {NgModule} from '@angular/core';
3-
import {MatLegacyButtonModule} from '@angular/material/legacy-button';
3+
import {MatButtonModule} from '@angular/material/button';
44
import {MatIconModule} from '@angular/material/icon';
55
import {CdkTreeFlatExample} from './cdk-tree-flat/cdk-tree-flat-example';
66
import {CdkTreeNestedExample} from './cdk-tree-nested/cdk-tree-nested-example';
@@ -10,7 +10,7 @@ export {CdkTreeFlatExample, CdkTreeNestedExample};
1010
const EXAMPLES = [CdkTreeFlatExample, CdkTreeNestedExample];
1111

1212
@NgModule({
13-
imports: [CdkTreeModule, MatLegacyButtonModule, MatIconModule],
13+
imports: [CdkTreeModule, MatButtonModule, MatIconModule],
1414
declarations: EXAMPLES,
1515
exports: EXAMPLES,
1616
})

src/components-examples/material-experimental/column-resize/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ng_module(
1111
]),
1212
deps = [
1313
"//src/material-experimental/column-resize",
14-
"//src/material/legacy-table",
14+
"//src/material/table",
1515
],
1616
)
1717

src/components-examples/material-experimental/column-resize/default-enabled-column-resize-flex/default-enabled-column-resize-flex-example-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
*/
88

99
import {NgModule} from '@angular/core';
10-
import {MatLegacyTableModule} from '@angular/material/legacy-table';
10+
import {MatTableModule} from '@angular/material/table';
1111
import {MatDefaultEnabledColumnResizeModule} from '@angular/material-experimental/column-resize';
1212

1313
import {DefaultEnabledColumnResizeFlexExample} from './default-enabled-column-resize-flex-example';
1414

1515
@NgModule({
16-
imports: [MatDefaultEnabledColumnResizeModule, MatLegacyTableModule],
16+
imports: [MatDefaultEnabledColumnResizeModule, MatTableModule],
1717
declarations: [DefaultEnabledColumnResizeFlexExample],
1818
exports: [DefaultEnabledColumnResizeFlexExample],
1919
})

src/components-examples/material-experimental/column-resize/default-enabled-column-resize/default-enabled-column-resize-example-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
*/
88

99
import {NgModule} from '@angular/core';
10-
import {MatLegacyTableModule} from '@angular/material/legacy-table';
10+
import {MatTableModule} from '@angular/material/table';
1111
import {MatDefaultEnabledColumnResizeModule} from '@angular/material-experimental/column-resize';
1212

1313
import {DefaultEnabledColumnResizeExample} from './default-enabled-column-resize-example';
1414

1515
@NgModule({
16-
imports: [MatDefaultEnabledColumnResizeModule, MatLegacyTableModule],
16+
imports: [MatDefaultEnabledColumnResizeModule, MatTableModule],
1717
declarations: [DefaultEnabledColumnResizeExample],
1818
exports: [DefaultEnabledColumnResizeExample],
1919
})

src/components-examples/material-experimental/column-resize/opt-in-column-resize/opt-in-column-resize-example-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
*/
88

99
import {NgModule} from '@angular/core';
10-
import {MatLegacyTableModule} from '@angular/material/legacy-table';
10+
import {MatTableModule} from '@angular/material/table';
1111
import {MatColumnResizeModule} from '@angular/material-experimental/column-resize';
1212

1313
import {OptInColumnResizeExample} from './opt-in-column-resize-example';
1414

1515
@NgModule({
16-
imports: [MatColumnResizeModule, MatLegacyTableModule],
16+
imports: [MatColumnResizeModule, MatTableModule],
1717
declarations: [OptInColumnResizeExample],
1818
exports: [OptInColumnResizeExample],
1919
})

src/components-examples/material-experimental/popover-edit/BUILD.bazel

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ ng_module(
1111
]),
1212
deps = [
1313
"//src/material-experimental/popover-edit",
14+
"//src/material/button",
15+
"//src/material/checkbox",
1416
"//src/material/icon",
15-
"//src/material/legacy-button",
16-
"//src/material/legacy-checkbox",
17-
"//src/material/legacy-input",
18-
"//src/material/legacy-list",
19-
"//src/material/legacy-snack-bar",
20-
"//src/material/legacy-table",
17+
"//src/material/input",
18+
"//src/material/list",
19+
"//src/material/snack-bar",
20+
"//src/material/table",
2121
"@npm//@angular/common",
2222
"@npm//@angular/forms",
2323
],

src/components-examples/material-experimental/popover-edit/index.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import {NgModule} from '@angular/core';
22
import {CommonModule} from '@angular/common';
33
import {FormsModule} from '@angular/forms';
44
import {MatPopoverEditModule} from '@angular/material-experimental/popover-edit';
5-
import {MatLegacyButtonModule} from '@angular/material/legacy-button';
6-
import {MatLegacyCheckboxModule} from '@angular/material/legacy-checkbox';
5+
import {MatButtonModule} from '@angular/material/button';
6+
import {MatCheckboxModule} from '@angular/material/checkbox';
77
import {MatIconModule} from '@angular/material/icon';
8-
import {MatLegacyInputModule} from '@angular/material/legacy-input';
9-
import {MatLegacyListModule} from '@angular/material/legacy-list';
10-
import {MatLegacySnackBarModule} from '@angular/material/legacy-snack-bar';
11-
import {MatLegacyTableModule} from '@angular/material/legacy-table';
8+
import {MatInputModule} from '@angular/material/input';
9+
import {MatListModule} from '@angular/material/list';
10+
import {MatSnackBarModule} from '@angular/material/snack-bar';
11+
import {MatTableModule} from '@angular/material/table';
1212
import {PopoverEditCellSpanMatTableExample} from './popover-edit-cell-span-mat-table/popover-edit-cell-span-mat-table-example';
1313
import {PopoverEditMatTableFlexExample} from './popover-edit-mat-table-flex/popover-edit-mat-table-flex-example';
1414
import {PopoverEditMatTableExample} from './popover-edit-mat-table/popover-edit-mat-table-example';
@@ -31,14 +31,14 @@ const EXAMPLES = [
3131
@NgModule({
3232
imports: [
3333
CommonModule,
34-
MatLegacyButtonModule,
35-
MatLegacyCheckboxModule,
34+
MatButtonModule,
35+
MatCheckboxModule,
3636
MatIconModule,
37-
MatLegacyInputModule,
38-
MatLegacyListModule,
37+
MatInputModule,
38+
MatListModule,
3939
MatPopoverEditModule,
40-
MatLegacySnackBarModule,
41-
MatLegacyTableModule,
40+
MatSnackBarModule,
41+
MatTableModule,
4242
FormsModule,
4343
],
4444
declarations: EXAMPLES,

src/components-examples/material-experimental/popover-edit/popover-edit-mat-table/popover-edit-mat-table-example.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Component} from '@angular/core';
22
import {DataSource} from '@angular/cdk/collections';
33
import {FormValueContainer} from '@angular/cdk-experimental/popover-edit';
44
import {NgForm} from '@angular/forms';
5-
import {MatLegacySnackBar} from '@angular/material/legacy-snack-bar';
5+
import {MatSnackBar} from '@angular/material/snack-bar';
66
import {BehaviorSubject, Observable} from 'rxjs';
77

88
export type ElementType = 'Metal' | 'Semimetal' | 'Nonmetal';
@@ -220,7 +220,7 @@ export class PopoverEditMatTableExample {
220220
readonly typeValues = new FormValueContainer<PeriodicElement, any>();
221221
readonly fantasyValues = new FormValueContainer<PeriodicElement, any>();
222222

223-
constructor(private readonly _snackBar: MatLegacySnackBar) {}
223+
constructor(private readonly _snackBar: MatSnackBar) {}
224224

225225
onSubmitName(element: PeriodicElement, f: NgForm) {
226226
if (!f.valid) {

src/components-examples/material-experimental/selection/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ng_module(
1313
"//src/cdk/collections",
1414
"//src/cdk/table",
1515
"//src/material-experimental/selection",
16-
"//src/material/legacy-checkbox",
16+
"//src/material/checkbox",
1717
"@npm//@angular/forms",
1818
],
1919
)

src/components-examples/material-experimental/selection/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {MatSelectionModule} from '@angular/material-experimental/selection';
2-
import {MatLegacyTableModule} from '@angular/material/legacy-table';
2+
import {MatTableModule} from '@angular/material/table';
33
import {CommonModule} from '@angular/common';
44
import {NgModule} from '@angular/core';
55
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
6-
import {MatLegacyCheckboxModule} from '@angular/material/legacy-checkbox';
6+
import {MatCheckboxModule} from '@angular/material/checkbox';
77

88
import {MatSelectionColumnExample} from './mat-selection-column/mat-selection-column-example';
99
import {MatSelectionListExample} from './mat-selection-list/mat-selection-list-example';
@@ -15,11 +15,11 @@ const EXAMPLES = [MatSelectionListExample, MatSelectionColumnExample];
1515
@NgModule({
1616
imports: [
1717
MatSelectionModule,
18-
MatLegacyTableModule,
18+
MatTableModule,
1919
CommonModule,
2020
FormsModule,
2121
ReactiveFormsModule,
22-
MatLegacyCheckboxModule,
22+
MatCheckboxModule,
2323
],
2424
declarations: EXAMPLES,
2525
exports: EXAMPLES,

src/components-examples/material/badge/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ ng_module(
1717
"//src/cdk/testing/testbed",
1818
"//src/material/badge",
1919
"//src/material/badge/testing",
20+
"//src/material/button",
2021
"//src/material/icon",
21-
"//src/material/legacy-button",
2222
"@npm//@angular/platform-browser",
2323
"@npm//@angular/platform-browser-dynamic",
2424
"@npm//@types/jasmine",

src/components-examples/material/badge/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {NgModule} from '@angular/core';
22
import {MatBadgeModule} from '@angular/material/badge';
3-
import {MatLegacyButtonModule} from '@angular/material/legacy-button';
3+
import {MatButtonModule} from '@angular/material/button';
44
import {MatIconModule} from '@angular/material/icon';
55
import {BadgeOverviewExample} from './badge-overview/badge-overview-example';
66
import {BadgeHarnessExample} from './badge-harness/badge-harness-example';
@@ -10,7 +10,7 @@ export {BadgeOverviewExample, BadgeHarnessExample};
1010
const EXAMPLES = [BadgeOverviewExample, BadgeHarnessExample];
1111

1212
@NgModule({
13-
imports: [MatBadgeModule, MatLegacyButtonModule, MatIconModule],
13+
imports: [MatBadgeModule, MatButtonModule, MatIconModule],
1414
declarations: EXAMPLES,
1515
exports: EXAMPLES,
1616
})

src/components-examples/material/bottom-sheet/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ ng_module(
1818
"//src/cdk/testing/testbed",
1919
"//src/material/bottom-sheet",
2020
"//src/material/bottom-sheet/testing",
21-
"//src/material/legacy-button",
22-
"//src/material/legacy-list",
21+
"//src/material/button",
22+
"//src/material/list",
2323
"@npm//@angular/platform-browser",
2424
"@npm//@angular/platform-browser-dynamic",
2525
"@npm//@types/jasmine",
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<mat-nav-list>
22
<a href="https://keep.google.com/" mat-list-item (click)="openLink($event)">
3-
<span mat-line>Google Keep</span>
4-
<span mat-line>Add to a note</span>
3+
<span matListItemTitle>Google Keep</span>
4+
<span matLine>Add to a note</span>
55
</a>
66

77
<a href="https://docs.google.com/" mat-list-item (click)="openLink($event)">
8-
<span mat-line>Google Docs</span>
9-
<span mat-line>Embed in a document</span>
8+
<span matListItemTitle>Google Docs</span>
9+
<span matLine>Embed in a document</span>
1010
</a>
1111

1212
<a href="https://plus.google.com/" mat-list-item (click)="openLink($event)">
13-
<span mat-line>Google Plus</span>
14-
<span mat-line>Share with your friends</span>
13+
<span matListItemTitle>Google Plus</span>
14+
<span matLine>Share with your friends</span>
1515
</a>
1616

1717
<a href="https://hangouts.google.com/" mat-list-item (click)="openLink($event)">
18-
<span mat-line>Google Hangouts</span>
19-
<span mat-line>Show to your coworkers</span>
18+
<span matListItemTitle>Google Hangouts</span>
19+
<span matLine>Show to your coworkers</span>
2020
</a>
2121
</mat-nav-list>

src/components-examples/material/bottom-sheet/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {NgModule} from '@angular/core';
22
import {MatBottomSheetModule} from '@angular/material/bottom-sheet';
3-
import {MatLegacyButtonModule} from '@angular/material/legacy-button';
4-
import {MatLegacyListModule} from '@angular/material/legacy-list';
3+
import {MatButtonModule} from '@angular/material/button';
4+
import {MatListModule} from '@angular/material/list';
55
import {
66
BottomSheetOverviewExample,
77
BottomSheetOverviewExampleSheet,
@@ -17,7 +17,7 @@ const EXAMPLES = [
1717
];
1818

1919
@NgModule({
20-
imports: [MatBottomSheetModule, MatLegacyButtonModule, MatLegacyListModule],
20+
imports: [MatBottomSheetModule, MatButtonModule, MatListModule],
2121
declarations: EXAMPLES,
2222
exports: EXAMPLES,
2323
})

src/components-examples/material/button/button-harness/button-harness-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {Component} from '@angular/core';
22

33
/**
4-
* @title Testing with MatLegacyButtonHarness
4+
* @title Testing with MatButtonHarness
55
*/
66
@Component({
77
selector: 'button-harness-example',

0 commit comments

Comments
 (0)