Skip to content

Commit 1316182

Browse files
authored
Merge branch 'master' into fix/slide-toggle-ripple-speed
2 parents 7fc24b3 + c203589 commit 1316182

Some content is hidden

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

54 files changed

+950
-274
lines changed

README.md

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ and which pieces are blocked) and make a comment.
3838
Also see our [`Good for community contribution`](https://github.com/angular/material2/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+for+community+contribution%22)
3939
label.
4040

41-
High level items planned for January 2017:
42-
43-
* Initial version of md-autocomplete
44-
* Prototyping for data-table
45-
* Improvements to https://material.angular.io
46-
* Continued expanding e2e test coverage
47-
* More work on scroll / resize handling for overlays
48-
* Screenshot tests
49-
* Better development automation
41+
High level items planned for next few months:
5042

43+
- Initial version of datepicker
44+
- Initial version of data table
45+
- Initial version of tree
46+
- Select improvements (multi-select, etc)
47+
- Screenshot test improvements
48+
- Docs site improvements
49+
- A11y audit
50+
- Various bug fixes
5151

5252
#### Feature status:
5353

@@ -76,7 +76,7 @@ High level items planned for January 2017:
7676
| snackbar / toast | Available | [README][21] | [#115][0115] |
7777
| select | Available | [README][23] | [#118][0118] |
7878
| textarea | Available | [README][5] | - |
79-
| autocomplete | In-progress | - | [#117][0117] |
79+
| autocomplete | Initial version, features evolving | [README][24] | [#117][0117] |
8080
| chips | Initial version, features evolving | - | [#120][0120] |
8181
| theming | Available, need guidance overlays | [Guide][20] | - |
8282
| docs site | UX design and tooling in progress | - | - |
@@ -86,36 +86,37 @@ High level items planned for January 2017:
8686
| bottom-sheet | Not started | - | - |
8787
| bottom-nav | Not started | - | [#408][0408] |
8888
| virtual-repeat | Not started | - | [#823][0823] |
89-
| datepicker | Not started | - | [#675][0675] |
89+
| datepicker | In progress | - | [#675][0675] |
9090
| data-table | Design in-progress | - | [#581][0581] |
9191
| stepper | Not started | - | [#508][0508] |
9292
| layout | See [angular/flex-layout][lay_rp] | [Wiki][0] | - |
9393

9494
[lay_rp]: https://github.com/angular/flex-layout
9595
[0]: https://github.com/angular/flex-layout/wiki
96-
[1]: https://github.com/angular/material2/blob/master/src/lib/button/README.md
97-
[2]: https://github.com/angular/material2/blob/master/src/lib/card/README.md
98-
[3]: https://github.com/angular/material2/blob/master/src/lib/checkbox/README.md
99-
[4]: https://github.com/angular/material2/blob/master/src/lib/radio/README.md
100-
[5]: https://github.com/angular/material2/blob/master/src/lib/input/README.md
101-
[6]: https://github.com/angular/material2/blob/master/src/lib/sidenav/README.md
102-
[7]: https://github.com/angular/material2/blob/master/src/lib/toolbar/README.md
103-
[8]: https://github.com/angular/material2/blob/master/src/lib/list/README.md
104-
[9]: https://github.com/angular/material2/blob/master/src/lib/grid-list/README.md
105-
[10]: https://github.com/angular/material2/blob/master/src/lib/icon/README.md
106-
[11]: https://github.com/angular/material2/blob/master/src/lib/progress-spinner/README.md
107-
[12]: https://github.com/angular/material2/blob/master/src/lib/progress-bar/README.md
108-
[13]: https://github.com/angular/material2/blob/master/src/lib/tabs/README.md
109-
[14]: https://github.com/angular/material2/blob/master/src/lib/slide-toggle/README.md
110-
[15]: https://github.com/angular/material2/blob/master/src/lib/button-toggle/README.md
111-
[16]: https://github.com/angular/material2/blob/master/src/lib/slider/README.md
112-
[17]: https://github.com/angular/material2/blob/master/src/lib/menu/README.md
113-
[18]: https://github.com/angular/material2/blob/master/src/lib/tooltip/README.md
96+
[1]: https://material.angular.io/components/component/button
97+
[2]: https://material.angular.io/components/component/card
98+
[3]: https://material.angular.io/components/component/checkbox
99+
[4]: https://material.angular.io/components/component/radio
100+
[5]: https://material.angular.io/components/component/input
101+
[6]: https://material.angular.io/components/component/sidenav
102+
[7]: https://material.angular.io/components/component/toolbar
103+
[8]: https://material.angular.io/components/component/list
104+
[9]: https://material.angular.io/components/component/grid-list
105+
[10]: https://material.angular.io/components/component/icon
106+
[11]: https://material.angular.io/components/component/progress-spinner
107+
[12]: https://material.angular.io/components/component/progress-bar
108+
[13]: https://material.angular.io/components/component/tabs
109+
[14]: https://material.angular.io/components/component/slide-toggle
110+
[15]: https://material.angular.io/components/component/button-toggle
111+
[16]: https://material.angular.io/components/component/slider
112+
[17]: https://material.angular.io/components/component/menu
113+
[18]: https://material.angular.io/components/component/tooltip
114114
[19]: https://github.com/angular/material2/blob/master/src/lib/core/ripple/README.md
115115
[20]: https://github.com/angular/material2/blob/master/guides/theming.md
116-
[21]: https://github.com/angular/material2/blob/master/src/lib/snack-bar/README.md
117-
[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
116+
[21]: https://material.angular.io/components/component/snack-bar
117+
[22]: https://material.angular.io/components/component/dialog
118+
[23]: https://material.angular.io/components/component/select
119+
[24]: https://material.angular.io/components/component/autocomplete
119120

120121
[0107]: https://github.com/angular/material2/issues/107
121122
[0119]: https://github.com/angular/material2/issues/119

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

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

@@ -21,7 +21,9 @@ describe('slide-toggle', () => {
2121
getNormalToggle().click();
2222

2323
expect(inputEl.getAttribute('checked')).toBeTruthy('Expect slide-toggle to be checked');
24-
screenshot();
24+
browser.wait(ExpectedConditions.not(
25+
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
26+
.then(() => screenshot());
2527
});
2628

2729
it('should change the checked state on click', () => {
@@ -32,7 +34,9 @@ describe('slide-toggle', () => {
3234
getNormalToggle().click();
3335

3436
expect(inputEl.getAttribute('checked')).toBeTruthy('Expect slide-toggle to be checked');
35-
screenshot();
37+
browser.wait(ExpectedConditions.not(
38+
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
39+
.then(() => screenshot());
3640
});
3741

3842
it('should not change the checked state on click when disabled', () => {
@@ -43,7 +47,9 @@ describe('slide-toggle', () => {
4347
element(by.css('#disabled-slide-toggle')).click();
4448

4549
expect(inputEl.getAttribute('checked')).toBeFalsy('Expect slide-toggle to be unchecked');
46-
screenshot();
50+
browser.wait(ExpectedConditions.not(
51+
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
52+
.then(() => screenshot());
4753
});
4854

4955
it('should move the thumb on state change', () => {
@@ -57,7 +63,9 @@ describe('slide-toggle', () => {
5763
let newX = thumbEl.getLocation().then(pos => pos.x);
5864

5965
expect(previousX).not.toBe(newX);
60-
screenshot();
66+
browser.wait(ExpectedConditions.not(
67+
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
68+
.then(() => screenshot());
6169
});
6270

6371
it('should toggle the slide-toggle on space key', () => {

e2e/screenshot.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ import * as path from 'path';
33
import {browser} from 'protractor';
44

55
const OUTPUT_DIR = './screenshots/';
6+
const HEIGHT = 768;
7+
const WIDTH = 1024;
68

79
let currentJasmineSpecName = '';
810

911
/** Adds a custom jasmine reporter that simply keeps track of the current test name. */
1012
function initializeEnvironment(jasmine: any) {
13+
browser.manage().window().setSize(WIDTH, HEIGHT);
1114
let reporter = new jasmine.JsApiReporter({});
1215
reporter.specStarted = function(result: any) {
1316
currentJasmineSpecName = result.fullName;

guides/theming-your-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ All you need is to create a `@mixin` function in the custom-component-theme.scss
2222
$primary: map-get($theme, primary);
2323
$accent: map-get($theme, accent);
2424

25-
// Use md-color to extract individual colors from a palette as necessary.
25+
// Use mat-color to extract individual colors from a palette as necessary.
2626
.candy-carousel {
2727
background-color: mat-color($primary);
2828
border-color: mat-color($accent, A400);

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"@angular/platform-browser-dynamic": "^2.3.0",
4242
"@angular/platform-server": "^2.3.0",
4343
"@angular/router": "^3.3.0",
44+
"@types/fs-extra": "0.0.37",
4445
"@types/glob": "^5.0.30",
4546
"@types/gulp": "^3.8.32",
4647
"@types/hammerjs": "^2.0.34",
@@ -59,6 +60,7 @@
5960
"firebase-tools": "^2.2.1",
6061
"fs-extra": "^2.0.0",
6162
"glob": "^7.1.1",
63+
"google-cloud": "^0.45.1",
6264
"gulp": "^3.9.1",
6365
"gulp-autoprefixer": "^3.1.1",
6466
"gulp-better-rollup": "^1.0.2",
@@ -77,6 +79,7 @@
7779
"gulp-transform": "^1.1.0",
7880
"hammerjs": "^2.0.8",
7981
"highlight.js": "^9.9.0",
82+
"image-diff": "^1.6.3",
8083
"jasmine-core": "^2.5.2",
8184
"karma": "^1.4.1",
8285
"karma-browserstack-launcher": "^1.2.0",

src/demo-app/checkbox/checkbox-demo.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,15 @@ <h1>md-checkbox: Basic Example</h1>
4343
</div>
4444
</div>
4545

46+
<h1>Pseudo checkboxes</h1>
47+
<md-pseudo-checkbox></md-pseudo-checkbox>
48+
<md-pseudo-checkbox [disabled]="true"></md-pseudo-checkbox>
49+
50+
<md-pseudo-checkbox state="checked"></md-pseudo-checkbox>
51+
<md-pseudo-checkbox state="checked" [disabled]="true"></md-pseudo-checkbox>
52+
53+
<md-pseudo-checkbox state="indeterminate"></md-pseudo-checkbox>
54+
<md-pseudo-checkbox state="indeterminate" [disabled]="true"></md-pseudo-checkbox>
55+
4656
<h1>Nested Checklist</h1>
4757
<md-checkbox-demo-nested-checklist></md-checkbox-demo-nested-checklist>

src/demo-app/demo-app-module.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import {HttpModule} from '@angular/http';
44
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
55
import {DemoApp, Home} from './demo-app/demo-app';
66
import {RouterModule} from '@angular/router';
7-
import {MaterialModule, OverlayContainer, FullscreenOverlayContainer} from '@angular/material';
7+
import {
8+
MaterialModule,
9+
OverlayContainer,
10+
FullscreenOverlayContainer,
11+
MdSelectionModule,
12+
} from '@angular/material';
813
import {DEMO_APP_ROUTES} from './demo-app/routes';
914
import {ProgressBarDemo} from './progress-bar/progress-bar-demo';
1015
import {JazzDialog, ContentElementDialog, DialogDemo, IFrameDialog} from './dialog/dialog-demo';
@@ -47,6 +52,7 @@ import {StyleDemo} from './style/style-demo';
4752
ReactiveFormsModule,
4853
RouterModule.forRoot(DEMO_APP_ROUTES),
4954
MaterialModule.forRoot(),
55+
MdSelectionModule,
5056
],
5157
declarations: [
5258
AutocompleteDemo,
@@ -93,7 +99,7 @@ import {StyleDemo} from './style/style-demo';
9399
SunnyTabContent,
94100
RainyTabContent,
95101
FoggyTabContent,
96-
PlatformDemo
102+
PlatformDemo,
97103
],
98104
providers: [
99105
{provide: OverlayContainer, useClass: FullscreenOverlayContainer}

src/demo-app/select/select-demo.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<md-card>
2020
<md-select placeholder="Drink" [(ngModel)]="currentDrink" [required]="isRequired" [disabled]="isDisabled"
21-
#drinkControl="ngModel">
21+
[floatPlaceholder]="floatPlaceholder" #drinkControl="ngModel">
2222
<md-option *ngFor="let drink of drinks" [value]="drink.value" [disabled]="drink.disabled">
2323
{{ drink.viewValue }}
2424
</md-option>
@@ -27,6 +27,15 @@
2727
<p> Touched: {{ drinkControl.touched }} </p>
2828
<p> Dirty: {{ drinkControl.dirty }} </p>
2929
<p> Status: {{ drinkControl.control?.status }} </p>
30+
<p>
31+
<label for="floating-placeholder">Floating placeholder:</label>
32+
<select [(ngModel)]="floatPlaceholder" id="floating-placeholder">
33+
<option value="auto">Auto</option>
34+
<option value="always">Always</option>
35+
<option value="never">Never</option>
36+
</select>
37+
</p>
38+
3039
<button md-button (click)="currentDrink='water-2'">SET VALUE</button>
3140
<button md-button (click)="isRequired=!isRequired">TOGGLE REQUIRED</button>
3241
<button md-button (click)="isDisabled=!isDisabled">TOGGLE DISABLED</button>

src/demo-app/select/select-demo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export class SelectDemo {
1414
showSelect = false;
1515
currentDrink: string;
1616
latestChangeEvent: MdSelectChange;
17+
floatPlaceholder: string = 'auto';
1718
foodControl = new FormControl('pizza-1');
1819

1920
foods = [

src/lib/autocomplete/autocomplete-trigger.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const MD_AUTOCOMPLETE_VALUE_ACCESSOR: any = {
6161
'[attr.aria-owns]': 'autocomplete?.id',
6262
'(focus)': 'openPanel()',
6363
'(blur)': '_handleBlur($event.relatedTarget?.tagName)',
64-
'(input)': '_handleInput($event.target.value)',
64+
'(input)': '_handleInput($event)',
6565
'(keydown)': '_handleKeydown($event)',
6666
},
6767
providers: [MD_AUTOCOMPLETE_VALUE_ACCESSOR]
@@ -153,15 +153,15 @@ export class MdAutocompleteTrigger implements AfterContentInit, ControlValueAcce
153153
*/
154154
get panelClosingActions(): Observable<MdOptionSelectEvent> {
155155
return Observable.merge(
156-
...this.optionSelections,
156+
this.optionSelections,
157157
this._blurStream.asObservable(),
158158
this._keyManager.tabOut
159159
);
160160
}
161161

162162
/** Stream of autocomplete option selections. */
163-
get optionSelections(): Observable<MdOptionSelectEvent>[] {
164-
return this.autocomplete.options.map(option => option.onSelect);
163+
get optionSelections(): Observable<MdOptionSelectEvent> {
164+
return Observable.merge(...this.autocomplete.options.map(option => option.onSelect));
165165
}
166166

167167
/** The currently active option, coerced to MdOption type. */
@@ -213,9 +213,14 @@ export class MdAutocompleteTrigger implements AfterContentInit, ControlValueAcce
213213
}
214214
}
215215

216-
_handleInput(value: string): void {
217-
this._onChange(value);
218-
this.openPanel();
216+
_handleInput(event: KeyboardEvent): void {
217+
// We need to ensure that the input is focused, because IE will fire the `input`
218+
// event on focus/blur/load if the input has a placeholder. See:
219+
// https://connect.microsoft.com/IE/feedback/details/885747/
220+
if (document.activeElement === event.target) {
221+
this._onChange((event.target as HTMLInputElement).value);
222+
this.openPanel();
223+
}
219224
}
220225

221226
_handleBlur(newlyFocusedTag: string): void {

0 commit comments

Comments
 (0)