Skip to content

Commit 0898098

Browse files
committed
Merge branch 'master' into 2326/tooltip-touch-click
# Conflicts: # src/lib/tooltip/tooltip.spec.ts # src/lib/tooltip/tooltip.ts
2 parents 98557a0 + fe113eb commit 0898098

File tree

228 files changed

+3987
-2831
lines changed

Some content is hidden

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

228 files changed

+3987
-2831
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

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ High level items planned for January 2017:
7575
| dialog | Available | [README][22] | [#114][0114] |
7676
| snackbar / toast | Available | [README][21] | [#115][0115] |
7777
| select | Available | [README][23] | [#118][0118] |
78-
| textarea | Available | - | - |
78+
| textarea | Available | [README][5] | - |
7979
| autocomplete | In-progress | - | [#117][0117] |
8080
| chips | Initial version, features evolving | - | [#120][0120] |
8181
| theming | Available, need guidance overlays | [Guide][20] | - |

e2e/components/dialog/dialog.e2e.ts

Lines changed: 6 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

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/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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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';
55

66
describe('menu', () => {
7-
const menuSelector = '.md-menu-panel';
7+
const menuSelector = '.mat-menu-panel';
88
let page: MenuPage;
99

1010
beforeEach(() => page = new MenuPage());
@@ -60,7 +60,7 @@ describe('menu', () => {
6060
it('should mirror classes on host to menu template in overlay', () => {
6161
page.trigger().click();
6262
page.menu().getAttribute('class').then((classes: string) => {
63-
expect(classes).toContain('md-menu-panel custom');
63+
expect(classes).toContain('mat-menu-panel custom');
6464
});
6565
});
6666

e2e/components/radio/radio.e2e.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('radio', () => {
77
it('should be checked when clicked', () => {
88
element(by.id('water')).click();
99
element(by.id('water')).getAttribute('class').then((value: string) => {
10-
expect(value).toContain('md-radio-checked');
10+
expect(value).toContain('mat-radio-checked');
1111
});
1212
element(by.css('input[id=water-input]')).getAttribute('checked').then((value: string) => {
1313
expect(value).toBeTruthy();
@@ -18,7 +18,7 @@ describe('radio', () => {
1818

1919
element(by.id('leaf')).click();
2020
element(by.id('leaf')).getAttribute('class').then((value: string) => {
21-
expect(value).toContain('md-radio-checked');
21+
expect(value).toContain('mat-radio-checked');
2222
});
2323
element(by.css('input[id=leaf-input]')).getAttribute('checked').then((value: string) => {
2424
expect(value).toBeTruthy();
@@ -32,15 +32,15 @@ describe('radio', () => {
3232
element(by.id('toggle-disable')).click();
3333
element(by.id('water')).click();
3434
element(by.id('water')).getAttribute('class').then((value: string) => {
35-
expect(value).toContain('md-radio-disabled');
35+
expect(value).toContain('mat-radio-disabled');
3636
});
3737
element(by.css('input[id=water-input]')).getAttribute('disabled').then((value: string) => {
3838
expect(value).toBeTruthy();
3939
});
4040

4141
element(by.id('leaf')).click();
4242
element(by.id('leaf')).getAttribute('class').then((value: string) => {
43-
expect(value).toContain('md-radio-disabled');
43+
expect(value).toContain('mat-radio-disabled');
4444
});
4545
element(by.css('input[id=leaf-input]')).getAttribute('disabled').then((value: string) => {
4646
expect(value).toBeTruthy();

e2e/components/slide-toggle/slide-toggle.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('slide-toggle', () => {
4343

4444
it('should move the thumb on state change', () => {
4545
let slideToggleEl = getNormalToggle();
46-
let thumbEl = element(by.css('#normal-slide-toggle .md-slide-toggle-thumb-container'));
46+
let thumbEl = element(by.css('#normal-slide-toggle .mat-slide-toggle-thumb-container'));
4747

4848
let previousX = thumbEl.getLocation().then(pos => pos.x);
4949

e2e/components/tabs/tabs.e2e.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('tabs', () => {
1010
beforeEach(() => {
1111
browser.get('/tabs');
1212
tabGroup = element(by.css('md-tab-group'));
13-
tabLabels = element.all(by.css('.md-tab-label'));
13+
tabLabels = element.all(by.css('.mat-tab-label'));
1414
tabBodies = element.all(by.css('md-tab-body'));
1515
});
1616

@@ -67,12 +67,12 @@ function getFocusStates(elements: ElementArrayFinder) {
6767

6868
/** Returns an array of true/false that represents the active states for the provided elements. */
6969
function getLabelActiveStates(elements: ElementArrayFinder) {
70-
return getClassStates(elements, 'md-tab-label-active');
70+
return getClassStates(elements, 'mat-tab-label-active');
7171
}
7272

7373
/** Returns an array of true/false that represents the active states for the provided elements */
7474
function getBodyActiveStates(elements: ElementArrayFinder) {
75-
return getClassStates(elements, 'md-tab-body-active');
75+
return getClassStates(elements, 'mat-tab-body-active');
7676
}
7777

7878
/**

e2e/screenshot.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as fs from 'fs';
2-
import * as gulp from 'gulp';
32
import * as path from 'path';
43
import {browser} from 'protractor';
54

guides/theming.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The actual path will depend on your server setup.
4141
You can also concatenate the file with the rest of your application's css.
4242

4343
Finally, if your app's content **is not** placed inside of a `md-sidenav-container` element, you
44-
need to add the `md-app-background` class to your wrapper element (for example the `body`). This
44+
need to add the `mat-app-background` class to your wrapper element (for example the `body`). This
4545
ensures that the proper theme background is applied to your page.
4646

4747
### Defining a custom theme
@@ -55,19 +55,19 @@ the corresponding styles. A typical theme file will look something like this:
5555

5656
// Include the base styles for Angular Material core. We include this here so that you only
5757
// have to load a single css file for Angular Material in your app.
58-
@include md-core();
58+
@include mat-core();
5959

6060
// Define the palettes for your theme using the Material Design palettes available in palette.scss
6161
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
6262
// hue.
63-
$candy-app-primary: md-palette($md-indigo);
64-
$candy-app-accent: md-palette($md-pink, A200, A100, A400);
63+
$candy-app-primary: mat-palette($mat-indigo);
64+
$candy-app-accent: mat-palette($mat-pink, A200, A100, A400);
6565

6666
// The warn palette is optional (defaults to red).
67-
$candy-app-warn: md-palette($md-red);
67+
$candy-app-warn: mat-palette($mat-red);
6868

6969
// Create the theme object (a Sass map containing all of the palettes).
70-
$candy-app-theme: md-light-theme($candy-app-primary, $candy-app-accent, $candy-app-warn);
70+
$candy-app-theme: mat-light-theme($candy-app-primary, $candy-app-accent, $candy-app-warn);
7171

7272
// Include theme styles for core and each component used in your app.
7373
// Alternatively, you can import and @include the theme mixins for each component
@@ -96,11 +96,11 @@ some selector. For example, we could append the following to the example above t
9696
secondary dark theme:
9797
```scss
9898
.unicorn-dark-theme {
99-
$dark-primary: md-palette($md-blue-grey);
100-
$dark-accent: md-palette($md-amber, A200, A100, A400);
101-
$dark-warn: md-palette($md-deep-orange);
99+
$dark-primary: mat-palette($mat-blue-grey);
100+
$dark-accent: mat-palette($mat-amber, A200, A100, A400);
101+
$dark-warn: mat-palette($mat-deep-orange);
102102

103-
$dark-theme: md-dark-theme($dark-primary, $dark-accent, $dark-warn);
103+
$dark-theme: mat-dark-theme($dark-primary, $dark-accent, $dark-warn);
104104

105105
@include angular-material-theme($dark-theme);
106106
}

0 commit comments

Comments
 (0)