Skip to content

Commit 224eb2d

Browse files
author
Vivian Hu
committed
address code review comment
1 parent 26058eb commit 224eb2d

File tree

7 files changed

+19
-38
lines changed

7 files changed

+19
-38
lines changed

src/demo-app/list/list-demo.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ <h2>Nav lists</h2>
105105
</div>
106106

107107
<div>
108-
<h2>Button lists</h2>
109-
<mat-button-list>
110-
<button mat-list-item *ngFor="let link of links" (click)="onButtonClick(link.name)">
111-
{{ link.name }}
108+
<h2>Action list</h2>
109+
<mat-action-list>
110+
<button mat-list-item *ngFor="let link of links" (click)="alertItem(link.name)">
111+
{{link.name}}
112112
</button>
113-
</mat-button-list>
113+
</mat-action-list>
114114
</div>
115115

116116
<div>

src/demo-app/list/list-demo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class ListDemo {
7070
this.modelChangeEventCount++;
7171
}
7272

73-
onButtonClick(msg: string) {
73+
alertItem(msg: string) {
7474
alert(msg);
7575
}
7676
}

src/lib/list/_list-theme.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
$background: map-get($theme, background);
99
$foreground: map-get($theme, foreground);
1010

11-
.mat-list, .mat-nav-list, .mat-button-list, .mat-selection-list {
11+
.mat-list, .mat-nav-list, .mat-selection-list {
1212
.mat-list-item {
1313
color: mat-color($foreground, text);
1414
}
@@ -27,7 +27,7 @@
2727
}
2828

2929
.mat-list-option,
30-
.mat-nav-list .mat-button-list .mat-list-item {
30+
.mat-nav-list .mat-list-item {
3131
&:hover, &.mat-list-item-focus {
3232
background: mat-color($background, 'hover');
3333
}
@@ -46,7 +46,7 @@
4646
}
4747

4848
// Default list
49-
.mat-list, .mat-nav-list, .mat-button-list, .mat-selection-list {
49+
.mat-list, .mat-nav-list, .mat-selection-list {
5050
.mat-list-item {
5151
font-size: mat-font-size($config, subheading-2);
5252
@include mat-line-base(mat-font-size($config, body-1));

src/lib/list/list-module.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
MatListAvatarCssMatStyler,
2121
MatListIconCssMatStyler,
2222
MatListItem,
23-
MatListSubheaderCssMatStyler, MatButtonList,
23+
MatListSubheaderCssMatStyler,
2424
} from './list';
2525
import {MatListOption, MatSelectionList} from './selection-list';
2626
import {MatDividerModule} from '@angular/material/divider';
@@ -31,7 +31,6 @@ import {MatDividerModule} from '@angular/material/divider';
3131
exports: [
3232
MatList,
3333
MatNavList,
34-
MatButtonList,
3534
MatListItem,
3635
MatListAvatarCssMatStyler,
3736
MatLineModule,
@@ -46,7 +45,6 @@ import {MatDividerModule} from '@angular/material/divider';
4645
declarations: [
4746
MatList,
4847
MatNavList,
49-
MatButtonList,
5048
MatListItem,
5149
MatListAvatarCssMatStyler,
5250
MatListIconCssMatStyler,

src/lib/list/list.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ $mat-list-item-inset-divider-offset: 72px;
206206
}
207207
}
208208

209-
.mat-list, .mat-nav-list, .mat-button-list, .mat-selection-list {
209+
.mat-list, .mat-nav-list, .mat-selection-list {
210210
padding-top: $mat-list-top-padding;
211211
display: block;
212212

@@ -262,7 +262,7 @@ $mat-list-item-inset-divider-offset: 72px;
262262
}
263263
}
264264

265-
.mat-button-list {
265+
mat-action-list {
266266
//remove the native button look and make is look like a list item
267267
button {
268268
background: none;

src/lib/list/list.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('MatList', () => {
2020
ListWithMultipleItems,
2121
ListWithManyLines,
2222
NavListWithOneAnchorItem,
23-
ButtonListWithOneItem
23+
ActionListWithOneItem
2424
],
2525
});
2626

@@ -145,8 +145,8 @@ describe('MatList', () => {
145145
items.forEach(item => expect(item._isRippleDisabled()).toBe(true));
146146
});
147147

148-
it('button list should be created successfully', () => {
149-
let fixture = TestBed.createComponent(ButtonListWithOneItem);
148+
it('action list should be created successfully', () => {
149+
let fixture = TestBed.createComponent(ActionListWithOneItem);
150150
fixture.detectChanges();
151151

152152
const items = fixture.componentInstance.listItems;
@@ -205,12 +205,12 @@ class NavListWithOneAnchorItem extends BaseTestList {
205205
}
206206

207207
@Component({template: `
208-
<mat-button-list>
208+
<mat-action-list>
209209
<button mat-list-item>
210210
Paprika
211211
</button>
212-
</mat-button-list>`})
213-
class ButtonListWithOneItem extends BaseTestList {
212+
</mat-action-list>`})
213+
class ActionListWithOneItem extends BaseTestList {
214214
@ViewChildren(MatListItem) listItems: QueryList<MatListItem>;
215215
}
216216

src/lib/list/list.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,9 @@ export const _MatListItemMixinBase = mixinDisableRipple(MatListItemBase);
4646
})
4747
export class MatNavList extends _MatListMixinBase implements CanDisableRipple {}
4848

49-
50-
@Component({
51-
moduleId: module.id,
52-
selector: 'mat-button-list',
53-
exportAs: 'matButtonList',
54-
host: {
55-
'role': 'button list',
56-
'class': 'mat-button-list'
57-
},
58-
templateUrl: 'list.html',
59-
styleUrls: ['list.css'],
60-
inputs: ['disableRipple'],
61-
encapsulation: ViewEncapsulation.None,
62-
changeDetection: ChangeDetectionStrategy.OnPush,
63-
})
64-
export class MatButtonList extends _MatListMixinBase implements CanDisableRipple {}
65-
6649
@Component({
6750
moduleId: module.id,
68-
selector: 'mat-list',
51+
selector: 'mat-list, mat-action-list',
6952
exportAs: 'matList',
7053
templateUrl: 'list.html',
7154
host: {'class': 'mat-list'},

0 commit comments

Comments
 (0)