Skip to content

Commit be8a895

Browse files
committed
Merge branch 'master' into 2326/tooltip-touch-click
# Conflicts: # src/lib/tooltip/tooltip.ts
2 parents daf754d + 8d900e0 commit be8a895

File tree

317 files changed

+5385
-4685
lines changed

Some content is hidden

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

317 files changed

+5385
-4685
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: node_js
22
sudo: false
33

44
node_js:
5-
- '6.9.1'
5+
- '6.9.4'
66

77
branches:
88
only:

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Contributing to Angular 2 Material
1+
# Contributing to Angular Material
22

3-
We would love for you to contribute to Angular 2 Material and help make it ever better!
3+
We would love for you to contribute to Angular Material and help make it ever better!
44
As a contributor, here are the guidelines we would like you to follow:
55

66
- [Code of Conduct](#coc)
@@ -19,7 +19,7 @@ Help us keep Angular open and inclusive. Please read and follow our [Code of Con
1919

2020
If you have questions about how to *use* Angular Material, please direct them to the
2121
[Google Group][material-group] discussion list or [StackOverflow][stackoverflow].
22-
Please note that Angular 2 Material is still in very early development, and the team's capacity
22+
Please note that Angular Material is still in very early development, and the team's capacity
2323
to answer usage questions is limited. Community chat is also available on [Gitter][gitter].
2424

2525
## <a name="issue"></a> Found an Issue?
@@ -33,7 +33,7 @@ You can help the team even more and [submit a Pull Request](#submit-pr) with a f
3333
## <a name="feature"></a> Want a Feature?
3434
You can *request* a new feature by [submitting an issue](#submit-issue) to our [GitHub
3535
Repository][github]. If you would like to *implement* a new feature, please submit an issue with
36-
a proposal for your work first, to be sure that we can use it. Angular 2 Material is in very early
36+
a proposal for your work first, to be sure that we can use it. Angular Material is in very early
3737
stages and we are not ready to accept major contributions ahead of the full release.
3838
Please consider what kind of change it is:
3939

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Material Design for Angular 2
1+
# Material Design for Angular
22
[![npm version](https://badge.fury.io/js/%40angular%2Fmaterial.svg)](https://www.npmjs.com/package/%40angular%2Fmaterial)
33
[![Build Status](https://travis-ci.org/angular/material2.svg?branch=master)](https://travis-ci.org/angular/material2)
44
[![Gitter](https://badges.gitter.im/angular/material2.svg)](https://gitter.im/angular/material2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
55

6-
This is the home for the Angular team's Material Design components built on top of Angular 2.
6+
This is the home for the Angular team's Material Design components built on top of Angular.
77

88
#### Quick links
99
[Google group](https://groups.google.com/forum/#!forum/angular-material2),
@@ -14,19 +14,19 @@ This is the home for the Angular team's Material Design components built on top
1414

1515
The latest release of Angular Material can be installed from npm
1616

17-
`npm install @angular/material`
17+
`npm install --save @angular/material`
1818

1919
Playing with the latest changes from [master](https://github.com/angular/material2/tree/master) is also possible
2020

21-
`npm install https://github.com/angular/material2-builds.git`
21+
`npm install --save https://github.com/angular/material2-builds.git`
2222

2323
### Getting started
2424

2525
See our [Getting Started Guide][getting-started]
26-
if you're building your first project with Angular Material 2.
26+
if you're building your first project with Angular Material.
2727

2828
### Project status
29-
Angular Material 2 is currently in beta and under active development.
29+
Angular Material is currently in beta and under active development.
3030
During beta, new features will be added regularly and APIs will evolve based on user feedback.
3131

3232
Check out our [directory of design documents](https://github.com/angular/material2/wiki/Design-doc-directory)
@@ -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,7 +74,7 @@ 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+
| select | Available | [README][23] | [#118][0118] |
7778
| textarea | Available | - | - |
7879
| autocomplete | In-progress | - | [#117][0117] |
7980
| chips | Initial version, features evolving | - | [#120][0120] |
@@ -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
@@ -141,7 +143,7 @@ High level items planned for January 2017:
141143
be missing some behaviors or polish.
142144

143145
## The goal of Angular Material
144-
Our goal is to build a set of high-quality UI components built with Angular 2 and TypeScript,
146+
Our goal is to build a set of high-quality UI components built with Angular and TypeScript,
145147
following the Material Design spec. These
146148
components will serve as an example of how to write Angular code following best practices.
147149

e2e/index.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ describe('hello, protractor', function () {
44
describe('index', function () {
55
browser.get('/');
66
it('should have a title', function () {
7-
expect(browser.getTitle()).toBe('Material2');
7+
expect(browser.getTitle()).toBe('Angular Material');
88
});
99
});
1010
});

guides/getting-started.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Get started with Angular Material 2 using the Angular CLI.
1+
Get started with Angular Material using the Angular CLI.
22

3-
## Install the CLI
3+
## Install Angular CLI
44

55
```bash
6-
npm install -g angular-cli
6+
npm install -g @angular/cli
77
```
88

99
## Create a new project
@@ -85,6 +85,6 @@ load the Material Design font in your `index.html`.
8585
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
8686
```
8787

88-
## Sample Angular Material 2 projects
89-
- [Material 2 Sample App](https://github.com/jelbourn/material2-app)
88+
## Sample Angular Material projects
89+
- [Material Sample App](https://github.com/jelbourn/material2-app)
9090
- [Angular Connect 2016 Demo](https://github.com/kara/leashed-in)

guides/theming.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ a theme consists of:
1313
* A foreground palette: colors for text and icons.
1414
* A background palette: colors used for element backgrounds.
1515

16-
In Angular Material 2, all theme styles are generated _statically_ at build-time so that your
16+
In Angular Material, all theme styles are generated _statically_ at build-time so that your
1717
app doesn't have to spend cycles generating theme styles on startup.
1818

1919
[1]: https://material.google.com/style/color.html#color-color-palette

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "material2",
3-
"description": "Material Design components for Angular 2",
2+
"name": "material2-srcs",
3+
"description": "Material Design components for Angular",
44
"homepage": "https://github.com/angular/material2",
55
"bugs": "https://github.com/angular/material2/issues",
66
"repository": {
@@ -72,7 +72,6 @@
7272
"gulp-sass": "^3.1.0",
7373
"gulp-sourcemaps": "^2.4.0",
7474
"gulp-transform": "^1.1.0",
75-
"gulp-typescript": "^3.1.4",
7675
"hammerjs": "^2.0.8",
7776
"highlight.js": "^9.9.0",
7877
"jasmine-core": "^2.5.2",
@@ -97,6 +96,7 @@
9796
"ts-node": "^2.0.0",
9897
"tslint": "^3.13.0",
9998
"typescript": "~2.0.10",
100-
"uglify-js": "^2.7.5"
99+
"uglify-js": "^2.7.5",
100+
"web-animations-js": "^2.2.2"
101101
}
102102
}

scripts/release/copy-docs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Use OVERVIEW.html when possible. If there's no OVERVIEW file exists, use README.html
88

99
usage='Usage: copy-docs.sh $destinationFolder'
10-
if [ $# -ne 1 ]; then
10+
if [ $# -ne 1 ]; then
1111
echo "Missing destination folder. $usage"
1212
exit
1313
fi
@@ -23,7 +23,7 @@ fi
2323
for file in $originFolder*
2424
do
2525
name=${file#$originFolder}
26-
overviewFile=$originFolder$name/OVERVIEW.html
26+
overviewFile=$originFolder$name/$name.html
2727
readmeFile=$originFolder$name/README.html
2828
destFile=$destFolder/$name.html
2929
if [ -f $overviewFile ]; then

src/demo-app/autocomplete/autocomplete-demo.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
Space above cards: <input type="number" [formControl]="topHeightCtrl">
2+
<div [style.height.px]="topHeightCtrl.value"></div>
13
<div class="demo-autocomplete">
24
<md-card>
3-
<div>Reactive value: {{ stateCtrl.value }}</div>
5+
Reactive length: {{ reactiveStates.length }}
6+
<div>Reactive value: {{ stateCtrl.value | json }}</div>
47
<div>Reactive dirty: {{ stateCtrl.dirty }}</div>
58

69
<md-input-container>
@@ -9,7 +12,7 @@
912

1013
<md-card-actions>
1114
<button md-button (click)="stateCtrl.reset()">RESET</button>
12-
<button md-button (click)="stateCtrl.setValue('California')">SET VALUE</button>
15+
<button md-button (click)="stateCtrl.setValue(states[10])">SET VALUE</button>
1316
<button md-button (click)="stateCtrl.enabled ? stateCtrl.disable() : stateCtrl.enable()">
1417
TOGGLE DISABLED
1518
</button>
@@ -37,8 +40,8 @@
3740
</md-card>
3841
</div>
3942

40-
<md-autocomplete #reactiveAuto="mdAutocomplete">
41-
<md-option *ngFor="let state of reactiveStates" [value]="state.name">
43+
<md-autocomplete #reactiveAuto="mdAutocomplete" [displayWith]="displayFn">
44+
<md-option *ngFor="let state of reactiveStates | async" [value]="state">
4245
<span>{{ state.name }}</span>
4346
<span class="demo-secondary-text"> ({{state.code}}) </span>
4447
</md-option>
@@ -47,6 +50,5 @@
4750
<md-autocomplete #tdAuto="mdAutocomplete">
4851
<md-option *ngFor="let state of tdStates" [value]="state.name">
4952
<span>{{ state.name }}</span>
50-
<span class="demo-secondary-text"> ({{state.code}}) </span>
5153
</md-option>
5254
</md-autocomplete>

src/demo-app/autocomplete/autocomplete-demo.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
flex-flow: row wrap;
44

55
md-card {
6-
width: 350px;
6+
width: 400px;
77
margin: 24px;
88
}
99

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {Component, OnDestroy, ViewEncapsulation} from '@angular/core';
1+
import {Component, ViewEncapsulation} from '@angular/core';
22
import {FormControl} from '@angular/forms';
3-
import {Subscription} from 'rxjs/Subscription';
3+
import 'rxjs/add/operator/startWith';
44

55
@Component({
66
moduleId: module.id,
@@ -9,59 +9,84 @@ import {Subscription} from 'rxjs/Subscription';
99
styleUrls: ['autocomplete-demo.css'],
1010
encapsulation: ViewEncapsulation.None
1111
})
12-
export class AutocompleteDemo implements OnDestroy {
13-
stateCtrl = new FormControl();
12+
export class AutocompleteDemo {
13+
stateCtrl: FormControl;
1414
currentState = '';
15+
topHeightCtrl = new FormControl(0);
1516

16-
reactiveStates: any[];
17+
reactiveStates: any;
1718
tdStates: any[];
1819

19-
reactiveValueSub: Subscription;
2020
tdDisabled = false;
2121

2222
states = [
2323
{code: 'AL', name: 'Alabama'},
24+
{code: 'AK', name: 'Alaska'},
2425
{code: 'AZ', name: 'Arizona'},
26+
{code: 'AR', name: 'Arkansas'},
2527
{code: 'CA', name: 'California'},
2628
{code: 'CO', name: 'Colorado'},
2729
{code: 'CT', name: 'Connecticut'},
30+
{code: 'DE', name: 'Delaware'},
2831
{code: 'FL', name: 'Florida'},
2932
{code: 'GA', name: 'Georgia'},
33+
{code: 'HI', name: 'Hawaii'},
3034
{code: 'ID', name: 'Idaho'},
35+
{code: 'IL', name: 'Illinois'},
36+
{code: 'IN', name: 'Indiana'},
37+
{code: 'IA', name: 'Iowa'},
3138
{code: 'KS', name: 'Kansas'},
39+
{code: 'KY', name: 'Kentucky'},
3240
{code: 'LA', name: 'Louisiana'},
41+
{code: 'ME', name: 'Maine'},
42+
{code: 'MD', name: 'Maryland'},
3343
{code: 'MA', name: 'Massachusetts'},
44+
{code: 'MI', name: 'Michigan'},
3445
{code: 'MN', name: 'Minnesota'},
35-
{code: 'MI', name: 'Mississippi'},
46+
{code: 'MS', name: 'Mississippi'},
47+
{code: 'MO', name: 'Missouri'},
48+
{code: 'MT', name: 'Montana'},
49+
{code: 'NE', name: 'Nebraska'},
50+
{code: 'NV', name: 'Nevada'},
51+
{code: 'NH', name: 'New Hampshire'},
52+
{code: 'NJ', name: 'New Jersey'},
53+
{code: 'NM', name: 'New Mexico'},
3654
{code: 'NY', name: 'New York'},
3755
{code: 'NC', name: 'North Carolina'},
38-
{code: 'OK', name: 'Oklahoma'},
56+
{code: 'ND', name: 'North Dakota'},
3957
{code: 'OH', name: 'Ohio'},
58+
{code: 'OK', name: 'Oklahoma'},
4059
{code: 'OR', name: 'Oregon'},
4160
{code: 'PA', name: 'Pennsylvania'},
61+
{code: 'RI', name: 'Rhode Island'},
4262
{code: 'SC', name: 'South Carolina'},
63+
{code: 'SD', name: 'South Dakota'},
4364
{code: 'TN', name: 'Tennessee'},
4465
{code: 'TX', name: 'Texas'},
66+
{code: 'UT', name: 'Utah'},
67+
{code: 'VT', name: 'Vermont'},
4568
{code: 'VA', name: 'Virginia'},
4669
{code: 'WA', name: 'Washington'},
70+
{code: 'WV', name: 'West Virginia'},
4771
{code: 'WI', name: 'Wisconsin'},
4872
{code: 'WY', name: 'Wyoming'},
4973
];
5074

5175
constructor() {
52-
this.reactiveStates = this.states;
5376
this.tdStates = this.states;
54-
this.reactiveValueSub =
55-
this.stateCtrl.valueChanges.subscribe(val => this.reactiveStates = this.filterStates(val));
77+
this.stateCtrl = new FormControl({code: 'CA', name: 'California'});
78+
this.reactiveStates = this.stateCtrl.valueChanges
79+
.startWith(this.stateCtrl.value)
80+
.map(val => this.displayFn(val))
81+
.map(name => this.filterStates(name));
82+
}
5683

84+
displayFn(value: any): string {
85+
return value && typeof value === 'object' ? value.name : value;
5786
}
5887

5988
filterStates(val: string) {
6089
return val ? this.states.filter((s) => s.name.match(new RegExp(val, 'gi'))) : this.states;
6190
}
6291

63-
ngOnDestroy() {
64-
this.reactiveValueSub.unsubscribe();
65-
}
66-
6792
}

src/demo-app/baseline/baseline-demo.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
| Text 3 |
1111
<md-radio-button value="option_3">Radio 3</md-radio-button>
1212
| Text 4 |
13-
<md-input placeholder="Input"></md-input>
14-
| Text 5 |
1513
<md-input-container>
1614
<input mdInput placeholder="Input">
1715
</md-input-container>
@@ -32,8 +30,6 @@ <h1>
3230
| Text 3 |
3331
<md-radio-button value="option_3">Radio 3</md-radio-button>
3432
| Text 4 |
35-
<md-input placeholder="Input"></md-input>
36-
| Text 5 |
3733
<md-input-container>
3834
<input mdInput placeholder="Input">
3935
</md-input-container>

src/demo-app/checkbox/checkbox-demo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class MdCheckboxDemoNestedChecklist {
2525
subtasks: [
2626
{ name: 'Cook Dinner', completed: false },
2727
{ name: 'Read the Material Design Spec', completed: false },
28-
{ name: 'Upgrade Application to Angular2', completed: false }
28+
{ name: 'Upgrade Application to Angular', completed: false }
2929
]
3030
},
3131
{

src/demo-app/chips/chips-demo.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import {Component} from '@angular/core';
2-
import {MdInput} from '@angular/material';
1+
import {Component, ElementRef} from '@angular/core';
32

43
export interface Person {
54
name: string;
@@ -40,10 +39,10 @@ export class ChipsDemo {
4039
alert(message);
4140
}
4241

43-
add(input: MdInput): void {
44-
if (input.value && input.value.trim() != '') {
45-
this.people.push({ name: input.value.trim() });
46-
input.value = '';
42+
add(input: ElementRef): void {
43+
if (input.nativeElement.value && input.nativeElement.value.trim() != '') {
44+
this.people.push({ name: input.nativeElement.value.trim() });
45+
input.nativeElement.value = '';
4746
}
4847
}
4948

0 commit comments

Comments
 (0)