Skip to content

Commit e67e493

Browse files
committed
fix(material/legacy-list): deprecate all ts symbols
1 parent cf0dd6c commit e67e493

13 files changed

+180
-45
lines changed

src/material/legacy-list/list-module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ import {
2525
import {MatLegacyListOption, MatLegacySelectionList} from './selection-list';
2626
import {MatDividerModule} from '@angular/material/divider';
2727

28+
/**
29+
* @deprecated Use `MatListModule` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
30+
* @breaking-change 17.0.0
31+
*/
2832
@NgModule({
2933
imports: [MatLineModule, MatRippleModule, MatCommonModule, MatPseudoCheckboxModule, CommonModule],
3034
exports: [

src/material/legacy-list/list.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ const _MatListBase = mixinDisabled(mixinDisableRipple(class {}));
4444
/** @docs-private */
4545
const _MatListItemMixinBase = mixinDisableRipple(class {});
4646

47+
/**
48+
* @deprecated Use `MatNavList` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
49+
* @breaking-change 17.0.0
50+
*/
4751
@Component({
4852
selector: 'mat-nav-list',
4953
exportAs: 'matNavList',
@@ -74,6 +78,10 @@ export class MatLegacyNavList
7478
}
7579
}
7680

81+
/**
82+
* @deprecated Use `MatList` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
83+
* @breaking-change 17.0.0
84+
*/
7785
@Component({
7886
selector: 'mat-list, mat-action-list',
7987
exportAs: 'matList',
@@ -129,6 +137,8 @@ export class MatLegacyList
129137
/**
130138
* Directive whose purpose is to add the mat- CSS styling to this selector.
131139
* @docs-private
140+
* @deprecated Use `MatListAvatarCssMatStyler` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
141+
* @breaking-change 17.0.0
132142
*/
133143
@Directive({
134144
selector: '[mat-list-avatar], [matListAvatar]',
@@ -139,6 +149,8 @@ export class MatLegacyListAvatarCssMatStyler {}
139149
/**
140150
* Directive whose purpose is to add the mat- CSS styling to this selector.
141151
* @docs-private
152+
* @deprecated Use `MatListIconCssMatStyler` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
153+
* @breaking-change 17.0.0
142154
*/
143155
@Directive({
144156
selector: '[mat-list-icon], [matListIcon]',
@@ -149,14 +161,20 @@ export class MatLegacyListIconCssMatStyler {}
149161
/**
150162
* Directive whose purpose is to add the mat- CSS styling to this selector.
151163
* @docs-private
164+
* @deprecated Use `MatListSubheaderCssMatStyler` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
165+
* @breaking-change 17.0.0
152166
*/
153167
@Directive({
154168
selector: '[mat-subheader], [matSubheader]',
155169
host: {'class': 'mat-subheader'},
156170
})
157171
export class MatLegacyListSubheaderCssMatStyler {}
158172

159-
/** An item within a Material Design list. */
173+
/**
174+
* An item within a Material Design list.
175+
* @deprecated Use `MatListItem` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
176+
* @breaking-change 17.0.0
177+
*/
160178
@Component({
161179
selector: 'mat-list-item, a[mat-list-item], button[mat-list-item]',
162180
exportAs: 'matListItem',

src/material/legacy-list/public-api.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ export {
2424
} from './selection-list';
2525

2626
export {
27+
/**
28+
* @deprecated Use `MAT_LIST` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
29+
* @breaking-change 17.0.0
30+
*/
2731
MAT_LIST as MAT_LEGACY_LIST,
32+
33+
/**
34+
* @deprecated Use `MAT_NAV_LIST` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
35+
* @breaking-change 17.0.0
36+
*/
2837
MAT_NAV_LIST as MAT_LEGACY_NAV_LIST,
2938
} from '@angular/material/list';

src/material/legacy-list/selection-list.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,22 @@ import {MatLegacyListAvatarCssMatStyler, MatLegacyListIconCssMatStyler} from './
4646
const _MatSelectionListBase = mixinDisableRipple(class {});
4747
const _MatListOptionBase = mixinDisableRipple(class {});
4848

49-
/** @docs-private */
49+
/**
50+
* @docs-private
51+
* @deprecated Use `MAT_SELECTION_LIST_VALUE_ACCESSOR` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
52+
* @breaking-change 17.0.0
53+
*/
5054
export const MAT_LEGACY_SELECTION_LIST_VALUE_ACCESSOR: any = {
5155
provide: NG_VALUE_ACCESSOR,
5256
useExisting: forwardRef(() => MatLegacySelectionList),
5357
multi: true,
5458
};
5559

56-
/** Change event that is being fired whenever the selected state of an option changes. */
60+
/**
61+
* Change event that is being fired whenever the selected state of an option changes.
62+
* @deprecated Use `MatSelectionListChange` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
63+
* @breaking-change 17.0.0
64+
*/
5765
export class MatLegacySelectionListChange {
5866
constructor(
5967
/** Reference to the selection list that emitted the event. */
@@ -66,13 +74,17 @@ export class MatLegacySelectionListChange {
6674
/**
6775
* Type describing possible positions of a checkbox in a list option
6876
* with respect to the list item's text.
77+
* @deprecated Use `MatListOptionCheckboxPosition` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
78+
* @breaking-change 17.0.0
6979
*/
7080
export type MatLegacyListOptionCheckboxPosition = 'before' | 'after';
7181

7282
/**
7383
* Component for list-options of selection-list. Each list-option can automatically
7484
* generate a checkbox and can put current item into the selectionModel of selection-list
7585
* if the current item is selected.
86+
* @deprecated Use `MatListOption` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
87+
* @breaking-change 17.0.0
7688
*/
7789
@Component({
7890
selector: 'mat-list-option',
@@ -325,6 +337,8 @@ export class MatLegacyListOption
325337

326338
/**
327339
* Material Design list component where each item is a selectable option. Behaves as a listbox.
340+
* @deprecated Use `MatSelectionList` from `@angular/material/list` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
341+
* @breaking-change 17.0.0
328342
*/
329343
@Component({
330344
selector: 'mat-selection-list',

src/material/legacy-list/testing/action-list-harness.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ import {
1414
} from './list-harness-filters';
1515
import {getListItemPredicate, MatLegacyListItemHarnessBase} from './list-item-harness-base';
1616

17-
/** Harness for interacting with a standard mat-action-list in tests. */
17+
/**
18+
* Harness for interacting with a standard mat-action-list in tests.
19+
* @deprecated Use `MatActionListHarness` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
20+
* @breaking-change 17.0.0
21+
*/
1822
export class MatLegacyActionListHarness extends MatLegacyListHarnessBase<
1923
typeof MatLegacyActionListItemHarness,
2024
MatLegacyActionListItemHarness,
@@ -38,7 +42,11 @@ export class MatLegacyActionListHarness extends MatLegacyListHarnessBase<
3842
override _itemHarness = MatLegacyActionListItemHarness;
3943
}
4044

41-
/** Harness for interacting with an action list item. */
45+
/**
46+
* Harness for interacting with an action list item.
47+
* @deprecated Use `MatActionListItemHarness` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
48+
* @breaking-change 17.0.0
49+
*/
4250
export class MatLegacyActionListItemHarness extends MatLegacyListItemHarnessBase {
4351
/** The selector for the host element of a `MatListItem` instance. */
4452
static hostSelector = `${MatLegacyActionListHarness.hostSelector} .mat-list-item`;

src/material/legacy-list/testing/list-harness-base.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ import {
1919
} from './list-harness-filters';
2020
import {MatLegacySubheaderHarness} from './list-item-harness-base';
2121

22-
/** Represents a section of a list falling under a specific header. */
22+
/**
23+
* Represents a section of a list falling under a specific header.
24+
* @deprecated Use `ListSection` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
25+
* @breaking-change 17.0.0
26+
*/
2327
export interface ListSection<I> {
2428
/** The heading for this list section. `undefined` if there is no heading. */
2529
heading?: string;
@@ -34,6 +38,8 @@ export interface ListSection<I> {
3438
* @template C The list item harness type that `T` constructs.
3539
* @template F The filter type used filter list item harness of type `C`.
3640
* @docs-private
41+
* @deprecated Use `class` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
42+
* @breaking-change 17.0.0
3743
*/
3844
export abstract class MatLegacyListHarnessBase<
3945
T extends ComponentHarnessConstructor<C> & {with: (options?: F) => HarnessPredicate<C>},

src/material/legacy-list/testing/list-harness-filters.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,70 @@
88

99
import {BaseHarnessFilters} from '@angular/cdk/testing';
1010

11+
/**
12+
* @deprecated Use `ListHarnessFilters` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
13+
* @breaking-change 17.0.0
14+
*/
1115
export interface LegacyListHarnessFilters extends BaseHarnessFilters {}
1216

17+
/**
18+
* @deprecated Use `ActionListHarnessFilters` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
19+
* @breaking-change 17.0.0
20+
*/
1321
export interface LegacyActionListHarnessFilters extends BaseHarnessFilters {}
1422

23+
/**
24+
* @deprecated Use `NavListHarnessFilters` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
25+
* @breaking-change 17.0.0
26+
*/
1527
export interface LegacyNavListHarnessFilters extends BaseHarnessFilters {}
1628

29+
/**
30+
* @deprecated Use `SelectionListHarnessFilters` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
31+
* @breaking-change 17.0.0
32+
*/
1733
export interface LegacySelectionListHarnessFilters extends BaseHarnessFilters {}
1834

35+
/**
36+
* @deprecated Use `BaseListItemHarnessFilters` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
37+
* @breaking-change 17.0.0
38+
*/
1939
export interface LegacyBaseListItemHarnessFilters extends BaseHarnessFilters {
2040
text?: string | RegExp;
2141
}
2242

43+
/**
44+
* @deprecated Use `ListItemHarnessFilters` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
45+
* @breaking-change 17.0.0
46+
*/
2347
export interface LegacyListItemHarnessFilters extends LegacyBaseListItemHarnessFilters {}
2448

49+
/**
50+
* @deprecated Use `ActionListItemHarnessFilters` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
51+
* @breaking-change 17.0.0
52+
*/
2553
export interface LegacyActionListItemHarnessFilters extends LegacyBaseListItemHarnessFilters {}
2654

55+
/**
56+
* @deprecated Use `NavListItemHarnessFilters` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
57+
* @breaking-change 17.0.0
58+
*/
2759
export interface LegacyNavListItemHarnessFilters extends LegacyBaseListItemHarnessFilters {
2860
href?: string | RegExp | null;
2961
}
3062

63+
/**
64+
* @deprecated Use `ListOptionHarnessFilters` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
65+
* @breaking-change 17.0.0
66+
*/
3167
export interface LegacyListOptionHarnessFilters extends LegacyBaseListItemHarnessFilters {
3268
selected?: boolean;
3369
}
3470

71+
/**
72+
* @deprecated Use `SubheaderHarnessFilters` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
73+
* @breaking-change 17.0.0
74+
*/
3575
export interface LegacySubheaderHarnessFilters extends BaseHarnessFilters {
3676
text?: string | RegExp;
3777
}

src/material/legacy-list/testing/list-harness.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ import {MatLegacyListHarnessBase} from './list-harness-base';
1111
import {LegacyListHarnessFilters, LegacyListItemHarnessFilters} from './list-harness-filters';
1212
import {getListItemPredicate, MatLegacyListItemHarnessBase} from './list-item-harness-base';
1313

14-
/** Harness for interacting with a standard mat-list in tests. */
14+
/**
15+
* Harness for interacting with a standard mat-list in tests.
16+
* @deprecated Use `MatListHarness` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
17+
* @breaking-change 17.0.0
18+
*/
1519
export class MatLegacyListHarness extends MatLegacyListHarnessBase<
1620
typeof MatLegacyListItemHarness,
1721
MatLegacyListItemHarness,
@@ -33,7 +37,11 @@ export class MatLegacyListHarness extends MatLegacyListHarnessBase<
3337
override _itemHarness = MatLegacyListItemHarness;
3438
}
3539

36-
/** Harness for interacting with a list item. */
40+
/**
41+
* Harness for interacting with a list item.
42+
* @deprecated Use `MatListItemHarness` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
43+
* @breaking-change 17.0.0
44+
*/
3745
export class MatLegacyListItemHarness extends MatLegacyListItemHarnessBase {
3846
/** The selector for the host element of a `MatListItem` instance. */
3947
static hostSelector = `${MatLegacyListHarness.hostSelector} .mat-list-item`;

src/material/legacy-list/testing/list-item-harness-base.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ const avatarSelector = '.mat-list-avatar';
2828
* @param harnessType A constructor for a list item harness.
2929
* @param options An instance of `BaseListItemHarnessFilters` to apply.
3030
* @return A `HarnessPredicate` for the given harness type with the given options applied.
31+
* @deprecated Use `getListItemPredicate` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
32+
* @breaking-change 17.0.0
3133
*/
3234
export function getListItemPredicate<H extends MatLegacyListItemHarnessBase>(
3335
harnessType: ComponentHarnessConstructor<H>,
@@ -40,7 +42,11 @@ export function getListItemPredicate<H extends MatLegacyListItemHarnessBase>(
4042
);
4143
}
4244

43-
/** Harness for interacting with a list subheader. */
45+
/**
46+
* Harness for interacting with a list subheader.
47+
* @deprecated Use `MatSubheaderHarness` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
48+
* @breaking-change 17.0.0
49+
*/
4450
export class MatLegacySubheaderHarness extends ComponentHarness {
4551
static hostSelector = '.mat-subheader';
4652

@@ -60,7 +66,11 @@ export class MatLegacySubheaderHarness extends ComponentHarness {
6066
}
6167
}
6268

63-
/** Selectors for the various list item sections that may contain user content. */
69+
/**
70+
* Selectors for the various list item sections that may contain user content.
71+
* @deprecated Use `enum` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
72+
* @breaking-change 17.0.0
73+
*/
6474
export const enum MatLegacyListItemSection {
6575
CONTENT = '.mat-list-item-content',
6676
// TODO(mmalerba): consider adding sections for leading/trailing icons.
@@ -69,6 +79,8 @@ export const enum MatLegacyListItemSection {
6979
/**
7080
* Shared behavior among the harnesses for the various `MatListItem` flavors.
7181
* @docs-private
82+
* @deprecated Use `class` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
83+
* @breaking-change 17.0.0
7284
*/
7385
export abstract class MatLegacyListItemHarnessBase extends ContentContainerComponentHarness<MatLegacyListItemSection> {
7486
private _lines = this.locatorForAll('.mat-line');

src/material/legacy-list/testing/nav-list-harness.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ import {MatLegacyListHarnessBase} from './list-harness-base';
1111
import {LegacyNavListHarnessFilters, LegacyNavListItemHarnessFilters} from './list-harness-filters';
1212
import {getListItemPredicate, MatLegacyListItemHarnessBase} from './list-item-harness-base';
1313

14-
/** Harness for interacting with a standard mat-nav-list in tests. */
14+
/**
15+
* Harness for interacting with a standard mat-nav-list in tests.
16+
* @deprecated Use `MatNavListHarness` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
17+
* @breaking-change 17.0.0
18+
*/
1519
export class MatLegacyNavListHarness extends MatLegacyListHarnessBase<
1620
typeof MatLegacyNavListItemHarness,
1721
MatLegacyNavListItemHarness,
@@ -35,7 +39,11 @@ export class MatLegacyNavListHarness extends MatLegacyListHarnessBase<
3539
override _itemHarness = MatLegacyNavListItemHarness;
3640
}
3741

38-
/** Harness for interacting with a nav list item. */
42+
/**
43+
* Harness for interacting with a nav list item.
44+
* @deprecated Use `MatNavListItemHarness` from `@angular/material/list/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
45+
* @breaking-change 17.0.0
46+
*/
3947
export class MatLegacyNavListItemHarness extends MatLegacyListItemHarnessBase {
4048
/** The selector for the host element of a `MatListItem` instance. */
4149
static hostSelector = `${MatLegacyNavListHarness.hostSelector} .mat-list-item`;

0 commit comments

Comments
 (0)