Skip to content

Commit 3a75f7b

Browse files
Angular Material Teamannieyw
Angular Material Team
authored andcommitted
fix(material-experimental/mdc-list): rename mdc-list-* classes
1 parent 85b5df6 commit 3a75f7b

24 files changed

+745
-109
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@types/youtube": "^0.0.40",
6464
"@webcomponents/custom-elements": "^1.1.0",
6565
"core-js-bundle": "^3.8.2",
66-
"material-components-web": "11.0.0-canary.3201cae47.0",
66+
"material-components-web": "11.0.0-canary.73a227194.0",
6767
"rxjs": "^6.5.3",
6868
"rxjs-tslint-rules": "^4.33.1",
6969
"systemjs": "0.19.43",

src/material-experimental/mdc-core/option/_option-theme.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,28 @@
1717
@include mdc-list.deprecated-item-disabled-text-color(
1818
mdc-list.$deprecated-text-disabled-color, $query: mdc-helpers.$mat-theme-styles-query);
1919

20-
&:hover:not(.mdc-list-item--disabled),
21-
&:focus:not(.mdc-list-item--disabled),
20+
&:hover:not(.mdc-deprecated-list-item--disabled),
21+
&:focus:not(.mdc-deprecated-list-item--disabled),
2222
&.mat-mdc-option-active,
2323

2424
// In multiple mode there is a checkbox to show that the option is selected.
25-
&.mdc-list-item--selected:not(.mat-mdc-option-multiple):not(.mdc-list-item--disabled) {
25+
&.mdc-deprecated-list-item--selected:not(.mat-mdc-option-multiple):not(.mdc-deprecated-list-item--disabled) {
2626
$color: mdc-theme-color.$on-surface;
2727
background: rgba($color, mdc-ripple.states-opacity($color, hover));
2828
}
2929
}
3030

31-
.mat-primary .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled) {
31+
.mat-primary .mat-mdc-option.mdc-deprecated-list-item--selected:not(.mdc-deprecated-list-item--disabled) {
3232
@include mdc-list.deprecated-item-primary-text-ink-color(
3333
primary, $query: mdc-helpers.$mat-theme-styles-query);
3434
}
3535

36-
.mat-accent .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled) {
36+
.mat-accent .mat-mdc-option.mdc-deprecated-list-item--selected:not(.mdc-deprecated-list-item--disabled) {
3737
@include mdc-list.deprecated-item-primary-text-ink-color(
3838
secondary, $query: mdc-helpers.$mat-theme-styles-query);
3939
}
4040

41-
.mat-warn .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled) {
41+
.mat-warn .mat-mdc-option.mdc-deprecated-list-item--selected:not(.mdc-deprecated-list-item--disabled) {
4242
@include mdc-list.deprecated-item-primary-text-ink-color(
4343
error, $query: mdc-helpers.$mat-theme-styles-query);
4444
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<span
22
class="mat-mdc-optgroup-label"
33
aria-hidden="true"
4-
[class.mdc-list-item--disabled]="disabled"
4+
[class.mdc-deprecated-list-item--disabled]="disabled"
55
[id]="_labelId">
6-
<span class="mdc-list-item__text">{{ label }} <ng-content></ng-content></span>
6+
<span class="mdc-deprecated-list-item__text">{{ label }} <ng-content></ng-content></span>
77
</span>
88

99
<ng-content select="mat-option, ng-container"></ng-content>

src/material-experimental/mdc-core/option/option.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<mat-pseudo-checkbox *ngIf="multiple" class="mat-mdc-option-pseudo-checkbox"
22
[state]="selected ? 'checked' : 'unchecked'" [disabled]="disabled"></mat-pseudo-checkbox>
33

4-
<span class="mdc-list-item__text"><ng-content></ng-content></span>
4+
<span class="mdc-deprecated-list-item__text"><ng-content></ng-content></span>
55

66
<!-- See a11y notes inside optgroup.ts for context behind this element. -->
77
<span class="cdk-visually-hidden" *ngIf="group && group._inert">({{ group.label }})</span>

src/material-experimental/mdc-core/option/option.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
content: '';
3030
}
3131

32-
&:not(.mdc-list-item--disabled) {
32+
&:not(.mdc-deprecated-list-item--disabled) {
3333
cursor: pointer;
3434
}
3535

src/material-experimental/mdc-core/option/option.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ import {MatOptgroup} from './optgroup';
3232
host: {
3333
'role': 'option',
3434
'[attr.tabindex]': '_getTabIndex()',
35-
'[class.mdc-list-item--selected]': 'selected',
35+
'[class.mdc-deprecated-list-item--selected]': 'selected',
3636
'[class.mat-mdc-option-multiple]': 'multiple',
3737
'[class.mat-mdc-option-active]': 'active',
38-
'[class.mdc-list-item--disabled]': 'disabled',
38+
'[class.mdc-deprecated-list-item--disabled]': 'disabled',
3939
'[id]': 'id',
4040
'[attr.aria-selected]': '_getAriaSelected()',
4141
'[attr.aria-disabled]': 'disabled.toString()',

src/material-experimental/mdc-core/testing/option-harness.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class MatOptionHarness extends ComponentHarness {
1515
static hostSelector = '.mat-mdc-option';
1616

1717
/** Element containing the option's text. */
18-
private _text = this.locatorFor('.mdc-list-item__text');
18+
private _text = this.locatorFor('.mdc-deprecated-list-item__text');
1919

2020
/**
2121
* Gets a `HarnessPredicate` that can be used to search for a `MatOptionsHarness` that meets
@@ -45,12 +45,12 @@ export class MatOptionHarness extends ComponentHarness {
4545

4646
/** Gets whether the option is disabled. */
4747
async isDisabled(): Promise<boolean> {
48-
return (await this.host()).hasClass('mdc-list-item--disabled');
48+
return (await this.host()).hasClass('mdc-deprecated-list-item--disabled');
4949
}
5050

5151
/** Gets whether the option is selected. */
5252
async isSelected(): Promise<boolean> {
53-
return (await this.host()).hasClass('mdc-list-item--selected');
53+
return (await this.host()).hasClass('mdc-deprecated-list-item--selected');
5454
}
5555

5656
/** Gets whether the option is active. */

src/material-experimental/mdc-list/_interactive-list-theme.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
background: if($is-dark-theme, white, black);
1616
}
1717

18-
&.mdc-list-item--selected::before {
18+
&.mdc-deprecated-list-item--selected::before {
1919
background: theming.color(map.get($config, primary));
2020
opacity: map.get($state-opacities, selected);
2121
}
@@ -27,7 +27,7 @@
2727

2828
// MDC still shows focus/selected state if the option is disabled. Just the hover
2929
// styles should not show up.
30-
.mat-mdc-list-item-interactive:not(.mdc-list-item--disabled) {
30+
.mat-mdc-list-item-interactive:not(.mdc-deprecated-list-item--disabled) {
3131
&:hover::before {
3232
opacity: map.get($state-opacities, hover);
3333
}

src/material-experimental/mdc-list/_list-option-theme.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
// default, the MDC list uses the `primary` color for list items. The MDC checkbox
1010
// inside list options by default uses the `primary` color too.
1111
@mixin private-list-option-color-override($color) {
12-
& .mdc-list-item__meta, & .mdc-list-item__graphic {
12+
& .mdc-deprecated-list-item__meta, & .mdc-deprecated-list-item__graphic {
1313
@include checkbox-theme.private-checkbox-styles-with-color($color);
1414
}
1515

16-
&.mdc-list-item--selected {
16+
&.mdc-deprecated-list-item--selected {
1717
@include mdc-list.deprecated-item-primary-text-ink-color($color);
1818
@include mdc-list.deprecated-item-graphic-ink-color($color);
1919

@@ -25,7 +25,7 @@
2525

2626
@mixin private-list-option-density-styles($density-scale) {
2727
.mat-mdc-list-option {
28-
.mdc-list-item__meta, .mdc-list-item__graphic {
28+
.mdc-deprecated-list-item__meta, .mdc-deprecated-list-item__graphic {
2929
.mdc-checkbox {
3030
@include mdc-checkbox.density($density-scale, $query: mdc-helpers.$mat-base-styles-query);
3131
}
@@ -35,7 +35,7 @@
3535

3636
@mixin private-list-option-typography-styles() {
3737
.mat-mdc-list-option {
38-
.mdc-list-item__meta, .mdc-list-item__graphic {
38+
.mdc-deprecated-list-item__meta, .mdc-deprecated-list-item__graphic {
3939
@include mdc-checkbox.without-ripple($query: mdc-helpers.$mat-typography-styles-query);
4040
}
4141
}

src/material-experimental/mdc-list/_list-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
);
4141

4242
// MDC list provides a mixin called `mdc-list-single-line-density`, but we cannot use
43-
// that mixin, as the generated generated density styles are scoped to `.mdc-list-item`, while
43+
// that mixin, as the generated generated density styles are scoped to `.mdc-deprecated-list-item`, while
4444
// the styles should actually only affect single-line list items. This has been reported as
4545
// a bug in the MDC repository: https://github.com/material-components/material-components-web/issues/5737.
4646
.mat-mdc-list-item-single-line {

src/material-experimental/mdc-list/action-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {MatListBase} from './list-base';
1414
exportAs: 'matActionList',
1515
template: '<ng-content></ng-content>',
1616
host: {
17-
'class': 'mat-mdc-action-list mat-mdc-list-base mdc-list',
17+
'class': 'mat-mdc-action-list mat-mdc-list-base mdc-deprecated-list',
1818
},
1919
styleUrls: ['list.css'],
2020
encapsulation: ViewEncapsulation.None,

src/material-experimental/mdc-list/list-base.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export abstract class MatListItemBase implements AfterContentInit, OnDestroy, Ri
6464
private _disableRipple: boolean = false;
6565

6666
/** Whether the list-item is disabled. */
67-
@HostBinding('class.mdc-list-item--disabled')
67+
@HostBinding('class.mdc-deprecated-list-item--disabled')
6868
@HostBinding('attr.aria-disabled')
6969
@Input()
7070
get disabled(): boolean { return this._disabled || (this._listBase && this._listBase.disabled); }
@@ -145,8 +145,8 @@ export abstract class MatListItemBase implements AfterContentInit, OnDestroy, Ri
145145
toggleClass(this._hostElement, 'mat-mdc-list-item-single-line', lines.length <= 1);
146146
lines.forEach((line: ElementRef<Element>, index: number) => {
147147
toggleClass(line.nativeElement,
148-
'mdc-list-item__primary-text', index === 0 && lines.length > 1);
149-
toggleClass(line.nativeElement, 'mdc-list-item__secondary-text', index !== 0);
148+
'mdc-deprecated-list-item__primary-text', index === 0 && lines.length > 1);
149+
toggleClass(line.nativeElement, 'mdc-deprecated-list-item__secondary-text', index !== 0);
150150
});
151151
setLines(lines, this._elementRef, 'mat-mdc');
152152
}));

src/material-experimental/mdc-list/list-item.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<!-- If lines were explicitly given, use those as the text. -->
44
<ng-container *ngIf="lines.length">
5-
<span class="mdc-list-item__text"><ng-content select="[mat-line],[matLine]"></ng-content></span>
5+
<span class="mdc-deprecated-list-item__text"><ng-content select="[mat-line],[matLine]"></ng-content></span>
66
</ng-container>
77

88
<!--
99
If lines were not explicitly given, assume the remaining content is the text, otherwise assume it
1010
is an action that belongs in the "meta" section.
1111
-->
12-
<span [class.mdc-list-item__text]="!lines.length"
13-
[class.mdc-list-item__meta]="lines.length" #text>
12+
<span [class.mdc-deprecated-list-item__text]="!lines.length"
13+
[class.mdc-deprecated-list-item__meta]="lines.length" #text>
1414
<ng-content></ng-content>
1515
</span>
1616

src/material-experimental/mdc-list/list-option.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</ng-template>
2626

2727
<!-- Container for the checkbox at start. -->
28-
<span class="mdc-list-item__graphic mat-mdc-list-option-checkbox-before"
28+
<span class="mdc-deprecated-list-item__graphic mat-mdc-list-option-checkbox-before"
2929
*ngIf="_shouldShowCheckboxAt('before')">
3030
<ng-template [ngTemplateOutlet]="checkbox"></ng-template>
3131
</span>
@@ -35,12 +35,12 @@
3535
</ng-template>
3636

3737
<!-- Text -->
38-
<span class="mdc-list-item__text" #text>
38+
<span class="mdc-deprecated-list-item__text" #text>
3939
<ng-content></ng-content>
4040
</span>
4141

4242
<!-- Container for the checkbox at the end. -->
43-
<span class="mdc-list-item__meta" *ngIf="_shouldShowCheckboxAt('after')">
43+
<span class="mdc-deprecated-list-item__meta" *ngIf="_shouldShowCheckboxAt('after')">
4444
<ng-template [ngTemplateOutlet]="checkbox"></ng-template>
4545
</span>
4646
<!-- Conditionally renders icons/avatars after the list item text. -->

src/material-experimental/mdc-list/list-option.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ export interface SelectionList extends MatListBase {
6262
exportAs: 'matListOption',
6363
styleUrls: ['list-option.css'],
6464
host: {
65-
'class': 'mat-mdc-list-item mat-mdc-list-option mdc-list-item',
65+
'class': 'mat-mdc-list-item mat-mdc-list-option mdc-deprecated-list-item',
6666
'role': 'option',
6767
// As per MDC, only list items in single selection mode should receive the `--selected`
6868
// class. For multi selection, the checkbox is used as indicator.
69-
'[class.mdc-list-item--selected]': 'selected && !_selectionList.multiple',
69+
'[class.mdc-deprecated-list-item--selected]': 'selected && !_selectionList.multiple',
7070
'[class.mat-mdc-list-item-with-avatar]': '_hasIconOrAvatar()',
7171
'[class.mat-accent]': 'color !== "primary" && color !== "warn"',
7272
'[class.mat-warn]': 'color === "warn"',

src/material-experimental/mdc-list/list-styling.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {Directive, Inject, Optional} from '@angular/core';
1010
import {LIST_OPTION, ListOption} from './list-option-types';
1111

1212
/**
13-
* MDC uses the very intuitively named classes `.mdc-list-item__graphic` and `.mat-list-item__meta`
13+
* MDC uses the very intuitively named classes `.mdc-deprecated-list-item__graphic` and `.mat-list-item__meta`
1414
* to position content such as icons or checkboxes that comes either before or after the text
1515
* content respectively. This directive detects the placement of the checkbox and applies the
1616
* correct MDC class to position the icon/avatar on the opposite side.
@@ -19,8 +19,8 @@ import {LIST_OPTION, ListOption} from './list-option-types';
1919
@Directive({
2020
selector: '[mat-list-avatar], [matListAvatar], [mat-list-icon], [matListIcon]',
2121
host: {
22-
'[class.mdc-list-item__graphic]': '_isAlignedAtStart()',
23-
'[class.mdc-list-item__meta]': '!_isAlignedAtStart()',
22+
'[class.mdc-deprecated-list-item__graphic]': '_isAlignedAtStart()',
23+
'[class.mdc-deprecated-list-item__meta]': '!_isAlignedAtStart()',
2424
}
2525
})
2626
export class MatListGraphicAlignmentStyler {
@@ -62,6 +62,6 @@ export class MatListIconCssMatStyler {}
6262
selector: '[mat-subheader], [matSubheader]',
6363
// TODO(mmalerba): MDC's subheader font looks identical to the list item font, figure out why and
6464
// make a change in one of the repos to visually distinguish.
65-
host: {'class': 'mat-mdc-subheader mdc-list-group__subheader'}
65+
host: {'class': 'mat-mdc-subheader mdc-deprecated-list-group__subheader'}
6666
})
6767
export class MatListSubheaderCssMatStyler {}

src/material-experimental/mdc-list/list.scss

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
display: block;
1111
}
1212

13-
// .mdc-list-item__primary-text adds its own margin settings, so only reset if it doesn't have that
13+
// .mdc-deprecated-list-item__primary-text adds its own margin settings, so only reset if it doesn't have that
1414
// class
15-
.mat-mdc-list-base .mdc-list-item__text > :not(.mdc-list-item__primary-text),
16-
.mat-mdc-list-base .mdc-list-item__text > :not(.mdc-list-item__primary-text) {
15+
.mat-mdc-list-base .mdc-deprecated-list-item__text > :not(.mdc-deprecated-list-item__primary-text),
16+
.mat-mdc-list-base .mdc-deprecated-list-item__text > :not(.mdc-deprecated-list-item__primary-text) {
1717
margin: 0;
1818

1919
// Fixes the gap between the 2nd & 3rd lines.
20-
&.mdc-list-item__secondary-text {
20+
&.mdc-deprecated-list-item__secondary-text {
2121
margin-top: -3px;
2222
}
2323
}
@@ -28,7 +28,7 @@
2828
.mat-mdc-2-line {
2929
height: 72px;
3030

31-
.mdc-list-item__text {
31+
.mdc-deprecated-list-item__text {
3232
align-self: flex-start;
3333
}
3434
}
@@ -37,7 +37,7 @@
3737
.mat-mdc-3-line {
3838
height: 88px;
3939

40-
.mdc-list-item__text {
40+
.mdc-deprecated-list-item__text {
4141
align-self: flex-start;
4242
}
4343
}
@@ -54,11 +54,11 @@
5454
height: $size;
5555
border-radius: 50%;
5656

57-
// Avatars that come before the text have the .mdc-list-item__graphic class.
58-
// MDC's .mdc-list--avatar-list class would normally apply overrides to set the appropriate
57+
// Avatars that come before the text have the .mdc-deprecated-list-item__graphic class.
58+
// MDC's .mdc-deprecated-list--avatar-list class would normally apply overrides to set the appropriate
5959
// margins for avatar images, but since ours is a per-list-item setting we need to add similar
6060
// styles ourselves.
61-
&.mdc-list-item__graphic {
61+
&.mdc-deprecated-list-item__graphic {
6262
margin-left: 0;
6363
margin-right: $margin-value;
6464

@@ -113,7 +113,7 @@
113113

114114
// MDC always sets the cursor to `pointer`. We do not want to show this for non-interactive
115115
// lists. See: https://github.com/material-components/material-components-web/issues/6443
116-
.mat-mdc-list-non-interactive .mdc-list-item {
116+
.mat-mdc-list-non-interactive .mdc-deprecated-list-item {
117117
cursor: default;
118118
}
119119

src/material-experimental/mdc-list/list.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {MatListBase, MatListItemBase} from './list-base';
3131
exportAs: 'matList',
3232
template: '<ng-content></ng-content>',
3333
host: {
34-
'class': 'mat-mdc-list mat-mdc-list-base mdc-list',
34+
'class': 'mat-mdc-list mat-mdc-list-base mdc-deprecated-list',
3535
},
3636
styleUrls: ['list.css'],
3737
encapsulation: ViewEncapsulation.None,
@@ -46,7 +46,7 @@ export class MatList extends MatListBase {}
4646
selector: 'mat-list-item, a[mat-list-item], button[mat-list-item]',
4747
exportAs: 'matListItem',
4848
host: {
49-
'class': 'mat-mdc-list-item mdc-list-item',
49+
'class': 'mat-mdc-list-item mdc-deprecated-list-item',
5050
'[class.mat-mdc-list-item-with-avatar]': '_hasIconOrAvatar()',
5151
},
5252
templateUrl: 'list-item.html',

src/material-experimental/mdc-list/nav-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {MatListBase} from './list-base';
1414
exportAs: 'matNavList',
1515
template: '<ng-content></ng-content>',
1616
host: {
17-
'class': 'mat-mdc-nav-list mat-mdc-list-base mdc-list',
17+
'class': 'mat-mdc-nav-list mat-mdc-list-base mdc-deprecated-list',
1818
},
1919
styleUrls: ['list.css'],
2020
encapsulation: ViewEncapsulation.None,

src/material-experimental/mdc-list/selection-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class MatSelectionListChange {
6060
selector: 'mat-selection-list',
6161
exportAs: 'matSelectionList',
6262
host: {
63-
'class': 'mat-mdc-selection-list mat-mdc-list-base mdc-list',
63+
'class': 'mat-mdc-selection-list mat-mdc-list-base mdc-deprecated-list',
6464
'role': 'listbox',
6565
'[attr.aria-multiselectable]': 'multiple',
6666
},

src/material-experimental/mdc-list/testing/list-item-harness-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class MatSubheaderHarness extends ComponentHarness {
5454

5555
/** Selectors for the various list item sections that may contain user content. */
5656
export const enum MatListItemSection {
57-
CONTENT = '.mdc-list-item__text',
57+
CONTENT = '.mdc-deprecated-list-item__text',
5858
}
5959

6060
/**

src/material-experimental/mdc-list/testing/selection-list-harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class MatListOptionHarness extends MatListItemHarnessBase {
8787
async (harness, selected) => await harness.isSelected() === selected);
8888
}
8989

90-
private _beforeCheckbox = this.locatorForOptional('.mdc-list-item__graphic .mdc-checkbox');
90+
private _beforeCheckbox = this.locatorForOptional('.mdc-deprecated-list-item__graphic .mdc-checkbox');
9191

9292
/** Gets the position of the checkbox relative to the list option content. */
9393
async getCheckboxPosition(): Promise<MatListOptionCheckboxPosition> {

0 commit comments

Comments
 (0)