Skip to content

Commit 5038744

Browse files
authored
Merge branch 'master' into dialog-backdrop-config-feature
2 parents 807d1d7 + e783494 commit 5038744

File tree

119 files changed

+1337
-2642
lines changed

Some content is hidden

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

119 files changed

+1337
-2642
lines changed

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: 6 additions & 6 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),
@@ -18,15 +18,15 @@ The latest release of Angular Material can be installed from npm
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)
@@ -141,7 +141,7 @@ High level items planned for January 2017:
141141
be missing some behaviors or polish.
142142

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

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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Get started with Angular Material 2 using the Angular CLI.
1+
Get started with Angular Material using the Angular CLI.
22

33
## Install the CLI
44

@@ -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: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "material2-srcs",
3-
"description": "Material Design components for Angular 2",
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",

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/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/demo-app-module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {MaterialModule, OverlayContainer,
88
FullscreenOverlayContainer} from '@angular/material';
99
import {DEMO_APP_ROUTES} from './demo-app/routes';
1010
import {ProgressBarDemo} from './progress-bar/progress-bar-demo';
11-
import {JazzDialog, ContentElementDialog, DialogDemo} from './dialog/dialog-demo';
11+
import {JazzDialog, ContentElementDialog, DialogDemo, IFrameDialog} from './dialog/dialog-demo';
1212
import {RippleDemo} from './ripple/ripple-demo';
1313
import {IconDemo} from './icon/icon-demo';
1414
import {GesturesDemo} from './gestures/gestures-demo';
@@ -65,6 +65,7 @@ import {InputContainerDemo} from './input/input-container-demo';
6565
InputContainerDemo,
6666
JazzDialog,
6767
ContentElementDialog,
68+
IFrameDialog,
6869
ListDemo,
6970
LiveAnnouncerDemo,
7071
MdCheckboxDemoNestedChecklist,
@@ -100,6 +101,7 @@ import {InputContainerDemo} from './input/input-container-demo';
100101
DemoApp,
101102
JazzDialog,
102103
ContentElementDialog,
104+
IFrameDialog,
103105
RotiniPanel,
104106
ScienceJoke,
105107
SpagettiPanel,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<md-icon class="md-24" >menu</md-icon>
2525
</button>
2626
<div class="demo-toolbar">
27-
<h1>Angular Material 2 Demos</h1>
27+
<h1>Angular Material Demos</h1>
2828
<button md-button (click)="toggleFullscreen()" title="Toggle fullscreen">
2929
Fullscreen
3030
</button>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {Component, ViewEncapsulation, ElementRef} from '@angular/core';
44
@Component({
55
selector: 'home',
66
template: `
7-
<p>Welcome to the development demos for Angular Material 2!</p>
7+
<p>Welcome to the development demos for Angular Material!</p>
88
<p>Open the sidenav to select a demo. </p>
99
`
1010
})

src/demo-app/dialog/dialog-demo.ts

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {Component} from '@angular/core';
1+
import {Component, Inject} from '@angular/core';
2+
import {DOCUMENT} from '@angular/platform-browser';
23
import {MdDialog, MdDialogRef, MdDialogConfig} from '@angular/material';
34

45
@Component({
@@ -25,7 +26,19 @@ export class DialogDemo {
2526
}
2627
};
2728

28-
constructor(public dialog: MdDialog) { }
29+
constructor(public dialog: MdDialog, @Inject(DOCUMENT) doc: any) {
30+
// Possible useful example for the open and closeAll events.
31+
// Adding a class to the body if a dialog opens and
32+
// removing it after all open dialogs are closed
33+
dialog.afterOpen.subscribe((ref: MdDialogRef<any>) => {
34+
if (!doc.body.classList.contains('no-scroll')) {
35+
doc.body.classList.add('no-scroll');
36+
}
37+
});
38+
dialog.afterAllClosed.subscribe(() => {
39+
doc.body.classList.remove('no-scroll');
40+
});
41+
}
2942

3043
openJazz() {
3144
this.dialogRef = this.dialog.open(JazzDialog, this.config);
@@ -93,9 +106,46 @@ export class JazzDialog {
93106
color="primary"
94107
href="https://en.wikipedia.org/wiki/Neptune"
95108
target="_blank">Read more on Wikipedia</a>
109+
110+
<button
111+
md-button
112+
color="secondary"
113+
(click)="showInStackedDialog()">
114+
Show in Dialog</button>
96115
</md-dialog-actions>
97116
`
98117
})
99118
export class ContentElementDialog {
100119
actionsAlignment: string;
120+
121+
constructor(public dialog: MdDialog) { }
122+
123+
showInStackedDialog() {
124+
this.dialog.open(IFrameDialog);
125+
}
126+
}
127+
128+
@Component({
129+
selector: 'demo-iframe-dialog',
130+
styles: [
131+
`iframe {
132+
width: 800px;
133+
}`
134+
],
135+
template: `
136+
<h2 md-dialog-title>Neptune</h2>
137+
138+
<md-dialog-content>
139+
<iframe frameborder="0" src="https://en.wikipedia.org/wiki/Neptune"></iframe>
140+
</md-dialog-content>
141+
142+
<md-dialog-actions>
143+
<button
144+
md-raised-button
145+
color="primary"
146+
md-dialog-close>Close</button>
147+
</md-dialog-actions>
148+
`
149+
})
150+
export class IFrameDialog {
101151
}

src/demo-app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6-
<title>Material2</title>
6+
<title>Angular Material</title>
77
<base href="/">
88

99
<link rel="icon" type="image/x-icon" href="favicon.ico">

src/demo-app/snack-bar/snack-bar-demo.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ <h1>SnackBar demo</h1>
2727
</md-input-container>
2828
</md-checkbox>
2929
</div>
30+
31+
<p>
32+
<md-checkbox [(ngModel)]="addExtraClass">Add extra class to container</md-checkbox>
33+
</p>
3034
</div>
3135

3236
<button md-raised-button (click)="open()">OPEN</button>
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1-
.demo-button-label-input {
2-
display: inline-block;
3-
}
1+
.party {
2+
animation: party 5000ms infinite;
3+
}
4+
5+
@keyframes party {
6+
0% { background: #00f; }
7+
10% { background: #8e44ad; }
8+
20% { background: #1abc9c; }
9+
30% { background: #d35400; }
10+
40% { background: #00f; }
11+
50% { background: #34495e; }
12+
60% { background: #00f; }
13+
70% { background: #2980b9; }
14+
80% { background: #f1c40f; }
15+
90% { background: #2980b9; }
16+
100% { background: #0ff; }
17+
}
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
import {Component} from '@angular/core';
1+
import {Component, ViewEncapsulation} from '@angular/core';
22
import {MdSnackBar, MdSnackBarConfig} from '@angular/material';
33

44
@Component({
55
moduleId: module.id,
66
selector: 'snack-bar-demo',
7+
styleUrls: ['snack-bar-demo.css'],
78
templateUrl: 'snack-bar-demo.html',
9+
encapsulation: ViewEncapsulation.None,
810
})
911
export class SnackBarDemo {
1012
message: string = 'Snack Bar opened.';
1113
actionButtonLabel: string = 'Retry';
1214
action: boolean = false;
1315
setAutoHide: boolean = true;
14-
autoHide: number = 0;
16+
autoHide: number = 10000;
17+
addExtraClass: boolean = false;
1518

16-
constructor(
17-
public snackBar: MdSnackBar) { }
19+
constructor(public snackBar: MdSnackBar) { }
1820

1921
open() {
2022
let config = new MdSnackBarConfig();
2123
config.duration = this.autoHide;
24+
config.extraClasses = this.addExtraClass ? ['party'] : null;
2225
this.snackBar.open(this.message, this.action && this.actionButtonLabel, config);
2326
}
2427
}

src/demo-app/tooltip/tooltip-demo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component} from '@angular/core';
1+
import {Component, ChangeDetectionStrategy} from '@angular/core';
22
import {TooltipPosition} from '@angular/material';
33

44

@@ -7,6 +7,7 @@ import {TooltipPosition} from '@angular/material';
77
selector: 'tooltip-demo',
88
templateUrl: 'tooltip-demo.html',
99
styleUrls: ['tooltip-demo.css'],
10+
changeDetection: ChangeDetectionStrategy.OnPush // make sure tooltip also works OnPush
1011
})
1112
export class TooltipDemo {
1213
position: TooltipPosition = 'below';

src/demo-app/tsconfig.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"declaration": true,
3+
"declaration": false,
44
"emitDecoratorMetadata": true,
55
"experimentalDecorators": true,
66
"lib": ["es6", "es2015", "dom"],
@@ -22,8 +22,11 @@
2222
]
2323
}
2424
},
25-
"exclude": [
26-
"*-aot.ts"
25+
"files": [
26+
"./demo-app-types.d.ts",
27+
"./demo-app-module.ts",
28+
"./system-config.ts",
29+
"./main.ts"
2730
],
2831
"angularCompilerOptions": {
2932
"genDir": "../../dist",

src/e2e-app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
6-
<title>Material2</title>
6+
<title>Angular Material</title>
77
<base href="/">
88

99
<link rel="icon" type="image/x-icon" href="favicon.ico">

0 commit comments

Comments
 (0)