Skip to content

Commit 06b21da

Browse files
authored
Merge branch 'master' into 2351/dialog-document-doctype
2 parents 787ea0f + b939cd8 commit 06b21da

File tree

471 files changed

+9859
-6280
lines changed

Some content is hidden

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

471 files changed

+9859
-6280
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
/libpeerconnection.log
3434
npm-debug.log
3535
testem.log
36-
/.chrome
36+
/.chrome

CHANGELOG.md

Lines changed: 164 additions & 1 deletion
Large diffs are not rendered by default.

CODING_STANDARDS.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ if (!$attrs['tabindex']) {
4343
For example, rather than doing this:
4444
```html
4545
<md-button>Basic button</md-button>
46-
<md-button class="md-fab">FAB</md-button>
47-
<md-button class="md-icon-button">pony</md-button>
46+
<md-button class="mat-fab">FAB</md-button>
47+
<md-button class="mat-icon-button">pony</md-button>
4848
```
4949

5050
do this:
@@ -192,13 +192,13 @@ code organization.** This will allow users to much more easily override styles.
192192

193193
For example, rather than doing this:
194194
```scss
195-
md-calendar {
195+
.mat-calendar {
196196
display: block;
197197

198-
.md-month {
198+
.mat-month {
199199
display: inline-block;
200200

201-
.md-date.md-selected {
201+
.mat-date.mat-selected {
202202
font-weight: bold;
203203
}
204204
}
@@ -207,15 +207,15 @@ md-calendar {
207207

208208
do this:
209209
```scss
210-
md-calendar {
210+
.mat-calendar {
211211
display: block;
212212
}
213213

214-
.md-calendar-month {
214+
.mat-calendar-month {
215215
display: inline-block;
216216
}
217217

218-
.md-calendar-date.md-selected {
218+
.mat-calendar-date.mat-selected {
219219
font-weight: bold;
220220
}
221221
```
@@ -260,11 +260,11 @@ This is a low-effort task that makes a big difference for low-vision users. Exam
260260
When it is not super obvious, include a brief description of what a class represents. For example:
261261
```scss
262262
// The calendar icon button used to open the calendar pane.
263-
.md-datepicker-button { ... }
263+
.mat-datepicker-button { ... }
264264

265265
// Floating pane that contains the calendar at the bottom of the input.
266-
.md-datepicker-calendar-pane { ... }
266+
.mat-datepicker-calendar-pane { ... }
267267

268268
// Portion of the floating panel that sits, invisibly, on top of the input.
269-
.md-datepicker-input-mask { }
269+
.mat-datepicker-input-mask { }
270270
```

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Also see our [`Good for community contribution`](https://github.com/angular/mate
3939
label.
4040

4141
High level items planned for January 2017:
42+
4243
* Initial version of md-autocomplete
4344
* Prototyping for data-table
4445
* Improvements to https://material.angular.io
@@ -73,8 +74,8 @@ High level items planned for January 2017:
7374
| ripples | Available | [README][19] | [#108][0108] |
7475
| dialog | Available | [README][22] | [#114][0114] |
7576
| snackbar / toast | Available | [README][21] | [#115][0115] |
76-
| select | Available | - | [#118][0118] |
77-
| textarea | Available | - | - |
77+
| select | Available | [README][23] | [#118][0118] |
78+
| textarea | Available | [README][5] | - |
7879
| autocomplete | In-progress | - | [#117][0117] |
7980
| chips | Initial version, features evolving | - | [#120][0120] |
8081
| theming | Available, need guidance overlays | [Guide][20] | - |
@@ -114,6 +115,7 @@ High level items planned for January 2017:
114115
[20]: https://github.com/angular/material2/blob/master/guides/theming.md
115116
[21]: https://github.com/angular/material2/blob/master/src/lib/snack-bar/README.md
116117
[22]: https://github.com/angular/material2/blob/master/src/lib/dialog/README.md
118+
[23]: https://github.com/angular/material2/blob/master/src/lib/select/README.md
117119

118120
[0107]: https://github.com/angular/material2/issues/107
119121
[0119]: https://github.com/angular/material2/issues/119

e2e/components/button/button.e2e.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {browser, by, element} from 'protractor';
1+
import {browser, by, element, ExpectedConditions} from 'protractor';
22
import {screenshot} from '../../screenshot';
33

44

@@ -9,12 +9,16 @@ describe('button', () => {
99
it('should prevent click handlers from executing when disabled', () => {
1010
element(by.id('test-button')).click();
1111
expect(element(by.id('click-counter')).getText()).toEqual('1');
12-
screenshot('clicked once');
12+
browser.wait(ExpectedConditions.not(
13+
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
14+
.then(() => screenshot('clicked once'));
1315

1416
element(by.id('disable-toggle')).click();
1517
element(by.id('test-button')).click();
1618
expect(element(by.id('click-counter')).getText()).toEqual('1');
17-
screenshot('click disabled');
19+
browser.wait(ExpectedConditions.not(
20+
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
21+
.then(() => screenshot('click disabled'));
1822
});
1923
});
2024
});

e2e/components/checkbox/checkbox.e2e.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {browser, by, element, Key} from 'protractor';
1+
import {browser, by, element, Key, ExpectedConditions} from 'protractor';
22
import {screenshot} from '../../screenshot';
33

44
describe('checkbox', function () {
@@ -17,31 +17,32 @@ describe('checkbox', function () {
1717
checkboxEl.click();
1818
inputEl.getAttribute('checked').then((value: string) => {
1919
expect(value).toBeTruthy('Expect checkbox "checked" property to be true');
20+
browser.wait(ExpectedConditions.not(
21+
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
22+
.then(() => screenshot('checked'));
2023
});
21-
screenshot('checked');
2224

2325
checkboxEl.click();
2426
inputEl.getAttribute('checked').then((value: string) => {
2527
expect(value).toBeFalsy('Expect checkbox "checked" property to be false');
28+
browser.wait(ExpectedConditions.not(
29+
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
30+
.then(() => screenshot('unchecked'));
2631
});
27-
screenshot('unchecked');
2832
});
2933

3034
it('should toggle the checkbox when pressing space', () => {
3135
let inputEl = element(by.css('input[id=input-test-checkbox]'));
3236

3337
inputEl.getAttribute('checked').then((value: string) => {
3438
expect(value).toBeFalsy('Expect checkbox "checked" property to be false');
35-
screenshot('start');
3639
});
3740

3841
inputEl.sendKeys(Key.SPACE);
3942

4043
inputEl.getAttribute('checked').then((value: string) => {
4144
expect(value).toBeTruthy('Expect checkbox "checked" property to be true');
42-
screenshot('pressed space');
4345
});
4446
});
45-
4647
});
4748
});

e2e/components/dialog/dialog.e2e.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ describe('dialog', () => {
1111
expectToExist('md-dialog-container');
1212
});
1313

14+
it('should open a template dialog', () => {
15+
expectToExist('.my-template-dialog', false);
16+
element(by.id('template')).click();
17+
expectToExist('.my-template-dialog');
18+
});
19+
1420
it('should close by clicking on the backdrop', () => {
1521
element(by.id('default')).click();
1622

@@ -29,6 +35,16 @@ describe('dialog', () => {
2935
});
3036
});
3137

38+
it('should close by pressing escape when the first tabbable element has lost focus', () => {
39+
element(by.id('default')).click();
40+
41+
waitForDialog().then(() => {
42+
clickElementAtPoint('md-dialog-container', { x: 0, y: 0 });
43+
pressKeys(Key.ESCAPE);
44+
expectToExist('md-dialog-container', false);
45+
});
46+
});
47+
3248
it('should close by clicking on the "close" button', () => {
3349
element(by.id('default')).click();
3450

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
import {browser, by, element, Key, ProtractorBy} from 'protractor';
1+
import {browser, by, element} from 'protractor';
22

33
describe('fullscreen', () => {
4-
beforeEach(() => browser.get('/fullscreen'));
54

6-
let overlayInBody = () =>
7-
browser.isElementPresent(by.css('body > .cdk-overlay-container') as ProtractorBy);
8-
let overlayInFullscreen = () =>
9-
browser.isElementPresent(by.css('#fullscreenpane > .cdk-overlay-container') as ProtractorBy);
5+
beforeEach(() => browser.get('/fullscreen'));
106

117
it('should open a dialog inside a fullscreen element and move it to the document body', () => {
128
element(by.id('fullscreen')).click();
139
element(by.id('dialog')).click();
1410

15-
overlayInFullscreen().then((isPresent: boolean) => {
16-
expect(isPresent).toBe(true);
17-
element(by.id('exitfullscreenindialog')).click();
18-
overlayInBody().then((isPresent: boolean) => {
19-
expect(isPresent).toBe(true);
20-
});
21-
});
11+
expectOverlayInFullscreen();
12+
13+
element(by.id('exitfullscreenindialog')).click();
14+
expectOverlayInBody();
2215
});
2316

2417
it('should open a dialog inside the document body and move it to a fullscreen element', () => {
2518
element(by.id('dialog')).click();
26-
overlayInBody().then((isPresent: boolean) => {
27-
expect(isPresent).toBe(true);
28-
element(by.id('fullscreenindialog')).click();
29-
overlayInFullscreen().then((isPresent: boolean) => {
30-
expect(isPresent).toBe(true);
31-
element(by.id('exitfullscreenindialog')).click();
32-
overlayInBody().then((isPresent: boolean) => {
33-
expect(isPresent).toBe(true);
34-
});
35-
});
36-
});
19+
expectOverlayInBody();
20+
21+
element(by.id('fullscreenindialog')).click();
22+
expectOverlayInFullscreen();
23+
24+
element(by.id('exitfullscreenindialog')).click();
25+
expectOverlayInBody();
3726
});
27+
28+
/** Expects the overlay container to be inside of the body element. */
29+
function expectOverlayInBody() {
30+
expect(browser.isElementPresent(by.css('body > .cdk-overlay-container'))).toBe(true);
31+
}
32+
33+
/** Expects the overlay container to be in fullscreen mode. */
34+
function expectOverlayInFullscreen() {
35+
expect(browser.isElementPresent(by.css('#fullscreenpane > .cdk-overlay-container'))).toBe(true);
36+
}
37+
3838
});

e2e/components/grid-list/grid-list.e2e.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import {browser} from 'protractor';
22
import {expectToExist} from '../../util/asserts';
3+
import {screenshot} from '../../screenshot';
34

45
describe('grid-list', () => {
56
beforeEach(() => browser.get('/grid-list'));
67

78
it('should render a grid list container', () => {
89
expectToExist('md-grid-list');
10+
screenshot();
911
});
1012

1113
it('should render list items inside the grid list container', () => {

e2e/components/icon/icon.e2e.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {browser, by, element} from 'protractor';
2+
import {screenshot} from '../../screenshot';
23

34
describe('icon', () => {
45
describe('font icons by ligature', () => {
@@ -13,6 +14,7 @@ describe('icon', () => {
1314
testIcon.getAttribute('aria-label').then((attr: string) => {
1415
expect(attr).toEqual('favorite');
1516
});
17+
screenshot();
1618
});
1719

1820
it('should have the correct class when used', () => {

e2e/components/list/list.e2e.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import {browser} from 'protractor';
22
import {expectToExist} from '../../util/asserts';
3+
import {screenshot} from '../../screenshot';
34

45
describe('list', () => {
56
beforeEach(() => browser.get('/list'));
67

78
it('should render a list container', () => {
89
expectToExist('md-list');
10+
screenshot();
911
});
1012

1113
it('should render list items inside the list container', () => {

e2e/components/menu/menu-page.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {browser, by, element, ElementFinder} from 'protractor';
33
export class MenuPage {
44
constructor() { browser.get('/menu'); }
55

6-
menu(): ElementFinder { return element(by.css('.md-menu-panel')); }
6+
menu(): ElementFinder { return element(by.css('.mat-menu-panel')); }
77

88
start(): ElementFinder { return element(by.id('start')); }
99

@@ -23,11 +23,11 @@ export class MenuPage {
2323

2424
combinedTrigger(): ElementFinder { return element(by.id('combined-t')); }
2525

26-
beforeMenu(): ElementFinder { return element(by.css('.md-menu-panel.before')); }
26+
beforeMenu(): ElementFinder { return element(by.css('.mat-menu-panel.before')); }
2727

28-
aboveMenu(): ElementFinder { return element(by.css('.md-menu-panel.above')); }
28+
aboveMenu(): ElementFinder { return element(by.css('.mat-menu-panel.above')); }
2929

30-
combinedMenu(): ElementFinder { return element(by.css('.md-menu-panel.combined')); }
30+
combinedMenu(): ElementFinder { return element(by.css('.mat-menu-panel.combined')); }
3131

3232
getResultText() { return this.textArea().getText(); }
3333
}

e2e/components/menu/menu.e2e.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import {browser, Key, protractor} from 'protractor';
1+
import {Key, protractor} from 'protractor';
22
import {MenuPage} from './menu-page';
33
import {expectToExist, expectAlignedWith, expectFocusOn, expectLocation} from '../../util/asserts';
44
import {pressKeys} from '../../util/actions';
5+
import {screenshot} from '../../screenshot';
56

67
describe('menu', () => {
7-
const menuSelector = '.md-menu-panel';
8+
const menuSelector = '.mat-menu-panel';
89
let page: MenuPage;
910

1011
beforeEach(() => page = new MenuPage());
@@ -15,28 +16,33 @@ describe('menu', () => {
1516

1617
expectToExist(menuSelector);
1718
expect(page.menu().getText()).toEqual('One\nTwo\nThree\nFour');
19+
screenshot();
1820
});
1921

2022
it('should close menu when menu item is clicked', () => {
2123
page.trigger().click();
2224
page.items(0).click();
2325
expectToExist(menuSelector, false);
26+
screenshot();
2427
});
2528

2629
it('should run click handlers on regular menu items', () => {
2730
page.trigger().click();
2831
page.items(0).click();
2932
expect(page.getResultText()).toEqual('one');
33+
screenshot('one');
3034

3135
page.trigger().click();
3236
page.items(1).click();
3337
expect(page.getResultText()).toEqual('two');
38+
screenshot('two');
3439
});
3540

3641
it('should run not run click handlers on disabled menu items', () => {
3742
page.trigger().click();
3843
page.items(2).click();
3944
expect(page.getResultText()).toEqual('');
45+
screenshot();
4046
});
4147

4248
it('should support multiple triggers opening the same menu', () => {
@@ -60,7 +66,7 @@ describe('menu', () => {
6066
it('should mirror classes on host to menu template in overlay', () => {
6167
page.trigger().click();
6268
page.menu().getAttribute('class').then((classes: string) => {
63-
expect(classes).toContain('md-menu-panel custom');
69+
expect(classes).toContain('mat-menu-panel custom');
6470
});
6571
});
6672

0 commit comments

Comments
 (0)