Skip to content

Commit 4ff907e

Browse files
committed
Merge branch 'md-to-cdk' of https://github.com/crisbeto/material2 into md-to-cdk
# Conflicts: # src/lib/core/core.ts
2 parents 5c42dd8 + c8ffc50 commit 4ff907e

Some content is hidden

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

49 files changed

+872
-252
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
"axe-core": "^2.0.7",
5555
"axe-webdriverjs": "^0.4.0",
5656
"conventional-changelog": "^1.1.0",
57+
"dgeni": "^0.4.2",
58+
"dgeni-packages": "^0.16.2",
5759
"express": "^4.14.0",
5860
"firebase-tools": "^2.2.1",
5961
"fs-extra": "^0.26.5",

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<p>You clicked on: {{ selected }}</p>
44

55
<md-toolbar>
6-
<button md-icon-button [md-menu-trigger-for]="menu" aria-label="Open basic menu">
6+
<button md-icon-button [mdMenuTriggerFor]="menu" aria-label="Open basic menu">
77
<md-icon>more_vert</md-icon>
88
</button>
99
</md-toolbar>
@@ -17,7 +17,7 @@
1717
<div class="menu-section">
1818
<p> Clicking these will navigate:</p>
1919
<md-toolbar>
20-
<button md-icon-button [md-menu-trigger-for]="anchorMenu" aria-label="Open anchor menu">
20+
<button md-icon-button [mdMenuTriggerFor]="anchorMenu" aria-label="Open anchor menu">
2121
<md-icon>more_vert</md-icon>
2222
</button>
2323
</md-toolbar>
@@ -33,7 +33,7 @@
3333
Position x: before
3434
</p>
3535
<md-toolbar class="end-icon">
36-
<button md-icon-button [md-menu-trigger-for]="posXMenu" aria-label="Open x-positioned menu">
36+
<button md-icon-button [mdMenuTriggerFor]="posXMenu" aria-label="Open x-positioned menu">
3737
<md-icon>more_vert</md-icon>
3838
</button>
3939
</md-toolbar>
@@ -50,7 +50,7 @@
5050
Position y: above
5151
</p>
5252
<md-toolbar>
53-
<button md-icon-button [md-menu-trigger-for]="posYMenu" aria-label="Open y-positioned menu">
53+
<button md-icon-button [mdMenuTriggerFor]="posYMenu" aria-label="Open y-positioned menu">
5454
<md-icon>more_vert</md-icon>
5555
</button>
5656
</md-toolbar>

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
[class.demo-ripple-disabled]="disabled"
4949
[class.demo-ripple-rounded]="rounded"
5050
md-ripple
51-
[md-ripple-centered]="centered"
52-
[md-ripple-disabled]="disabled"
53-
[md-ripple-unbounded]="unbounded"
54-
[md-ripple-max-radius]="maxRadius"
55-
[md-ripple-color]="rippleColor"
56-
[md-ripple-background-color]="rippleBackgroundColor"
57-
[md-ripple-speed-factor]="rippleSpeed">
51+
[mdRippleCentered]="centered"
52+
[mdRippleDisabled]="disabled"
53+
[mdRippleUnbounded]="unbounded"
54+
[mdRippleMaxRadius]="maxRadius"
55+
[mdRippleColor]="rippleColor"
56+
[mdRippleBackgroundColor]="rippleBackgroundColor"
57+
[mdRippleSpeedFactor]="rippleSpeed">
5858
Click me
5959
</div>
6060
</section>

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ <h1>Default Slider</h1>
44

55
<h1>Slider with Min and Max</h1>
66
<input [(ngModel)]="min">
7-
<md-slider [min]="min" [max]="max" tick-interval="5" #slider2></md-slider>
7+
<md-slider [min]="min" [max]="max" tickInterval="5" #slider2></md-slider>
88
{{slider2.value}}
99
<input [(ngModel)]="max">
1010

@@ -20,11 +20,11 @@ <h1>Slider with step defined</h1>
2020
{{slider5.value}}
2121

2222
<h1>Slider with set tick interval</h1>
23-
<md-slider tick-interval="auto"></md-slider>
24-
<md-slider tick-interval="9"></md-slider>
23+
<md-slider tickInterval="auto"></md-slider>
24+
<md-slider tickInterval="9"></md-slider>
2525

2626
<h1>Slider with Thumb Label</h1>
27-
<md-slider thumb-label></md-slider>
27+
<md-slider thumbLabel></md-slider>
2828

2929
<h1>Slider with one-way binding</h1>
3030
<md-slider [value]="val" step="40"></md-slider>
@@ -35,13 +35,13 @@ <h1>Slider with two-way binding</h1>
3535
<input [(ngModel)]="demo">
3636

3737
<h1>Inverted slider</h1>
38-
<md-slider invert value="50" tick-interval="5"></md-slider>
38+
<md-slider invert value="50" tickInterval="5"></md-slider>
3939

4040
<h1>Vertical slider</h1>
41-
<md-slider vertical thumb-label tick-interval="auto" value="50"></md-slider>
41+
<md-slider vertical thumbLabel tickInterval="auto" value="50"></md-slider>
4242

4343
<h1>Inverted vertical slider</h1>
44-
<md-slider vertical invert thumb-label tick-interval="auto" value="50"></md-slider>
44+
<md-slider vertical invert thumbLabel tickInterval="auto" value="50"></md-slider>
4545

4646
<md-tab-group>
4747
<md-tab label="One">

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ <h1>Tab Group Demo - Dynamic Tabs</h1>
4242
</md-card-content>
4343
</md-card>
4444

45-
<md-tab-group class="demo-tab-group"
46-
md-dynamic-height
47-
[(selectedIndex)]="activeTabIndex">
45+
<md-tab-group class="demo-tab-group" dynamicHeight [(selectedIndex)]="activeTabIndex">
4846
<md-tab *ngFor="let tab of dynamicTabs" [disabled]="tab.disabled">
4947
<template md-tab-label>{{tab.label}}</template>
5048
{{tab.content}}
@@ -92,7 +90,7 @@ <h1>Tab Group Demo - Dynamic Tabs</h1>
9290

9391
<h1>Tab Group Demo - Dynamic Height</h1>
9492

95-
<md-tab-group class="demo-tab-group" md-dynamic-height>
93+
<md-tab-group class="demo-tab-group" dynamicHeight>
9694
<md-tab *ngFor="let tab of tabs" [disabled]="tab.disabled">
9795
<template md-tab-label>{{tab.label}}</template>
9896
{{tab.content}}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ <h1>Tooltip Demo</h1>
55
<button #tooltip="mdTooltip"
66
md-raised-button
77
color="primary"
8-
[md-tooltip]="message"
9-
[tooltip-position]="position"
10-
[tooltipShowDelay]="showDelay"
11-
[tooltipHideDelay]="hideDelay">
8+
[mdTooltip]="message"
9+
[mdTooltipPosition]="position"
10+
[mdTooltipShowDelay]="showDelay"
11+
[mdTooltipHideDelay]="hideDelay">
1212
Mouse over to see the tooltip
1313
</button>
1414
</p>

src/e2e-app/menu/menu-e2e.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<div style="float:left">
33
<div id="text">{{ selected }}</div>
44
<button id="start">START</button>
5-
<button [md-menu-trigger-for]="menu" id="trigger">TRIGGER</button>
6-
<button [md-menu-trigger-for]="menu" id="trigger-two">TRIGGER 2</button>
5+
<button [mdMenuTriggerFor]="menu" id="trigger">TRIGGER</button>
6+
<button [mdMenuTriggerFor]="menu" id="trigger-two">TRIGGER 2</button>
77

88
<md-menu #menu="mdMenu" y-position="below" class="custom">
99
<button md-menu-item (click)="selected='one'">One</button>
@@ -12,20 +12,20 @@
1212
<button md-menu-item>Four</button>
1313
</md-menu>
1414

15-
<button [md-menu-trigger-for]="beforeMenu" id="before-t">
15+
<button [mdMenuTriggerFor]="beforeMenu" id="before-t">
1616
BEFORE
1717
</button>
1818
<md-menu x-position="before" y-position="below" class="before" #beforeMenu="mdMenu">
1919
<button md-menu-item>Item</button>
2020
</md-menu>
2121

2222
<div class="bottom-row">
23-
<button [md-menu-trigger-for]="aboveMenu" id="above-t">ABOVE</button>
23+
<button [mdMenuTriggerFor]="aboveMenu" id="above-t">ABOVE</button>
2424
<md-menu y-position="above" class="above" #aboveMenu="mdMenu">
2525
<button md-menu-item>Item</button>
2626
</md-menu>
2727

28-
<button [md-menu-trigger-for]="combined" id="combined-t">
28+
<button [mdMenuTriggerFor]="combined" id="combined-t">
2929
BOTH
3030
</button>
3131
<md-menu x-position="before" y-position="above" class="combined" #combined="mdMenu">

src/lib/button-toggle/button-toggle.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export type ToggleType = 'checkbox' | 'radio';
3434
/**
3535
* Provider Expression that allows md-button-toggle-group to register as a ControlValueAccessor.
3636
* This allows it to support [(ngModel)].
37+
* @docs-private
3738
*/
3839
export const MD_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR: any = {
3940
provide: NG_VALUE_ACCESSOR,
@@ -43,7 +44,7 @@ export const MD_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR: any = {
4344

4445
var _uniqueIdCounter = 0;
4546

46-
/** A simple change event emitted by either MdButtonToggle or MdButtonToggleGroup. */
47+
/** Change event object emitted by MdButtonToggle. */
4748
export class MdButtonToggleChange {
4849
source: MdButtonToggle;
4950
value: any;

src/lib/button/button.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<span class="md-button-wrapper"><ng-content></ng-content></span>
22
<div md-ripple *ngIf="!_isRippleDisabled()" class="md-button-ripple"
3-
[class.md-button-ripple-round]="isRoundButton()"
4-
[md-ripple-trigger]="getHostElement()"
5-
[md-ripple-color]="isRoundButton() ? 'rgba(255, 255, 255, 0.2)' : ''"
6-
md-ripple-background-color="rgba(0, 0, 0, 0)"></div>
3+
[class.md-button-ripple-round]="_isRoundButton()"
4+
[mdRippleTrigger]="_getHostElement()"
5+
[mdRippleColor]="_isRoundButton() ? 'rgba(255, 255, 255, 0.2)' : ''"
6+
mdRippleBackgroundColor="rgba(0, 0, 0, 0)"></div>
77
<!-- the touchstart handler prevents the overlay from capturing the initial tap on touch devices -->
88
<div class="md-button-focus-overlay" (touchstart)="$event.preventDefault()"></div>

src/lib/button/button.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ describe('MdButton', () => {
168168
anchorElement = fixture.nativeElement.querySelector('a[md-button]');
169169
});
170170

171-
it('should remove ripple if md-ripple-disabled input is set', () => {
171+
it('should remove ripple if mdRippleDisabled input is set', () => {
172172
expect(buttonElement.querySelectorAll('[md-ripple]').length).toBe(1);
173173

174174
testComponent.rippleDisabled = true;

src/lib/button/button.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,22 @@ export class MdButton {
4747
private _disableRipple: boolean = false;
4848
private _disabled: boolean = null;
4949

50+
/** Whether the ripple effect for this button is disabled. */
5051
@Input()
5152
get disableRipple() { return this._disableRipple; }
5253
set disableRipple(v) { this._disableRipple = coerceBooleanProperty(v); }
5354

55+
/** Whether the button is disabled. */
5456
@Input()
5557
get disabled() { return this._disabled; }
5658
set disabled(value: boolean) { this._disabled = coerceBooleanProperty(value) ? true : null; }
5759

5860
constructor(private _elementRef: ElementRef, private _renderer: Renderer) { }
5961

62+
/** The color of the button. Can be `primary`, `accent`, or `warn`. */
6063
@Input()
61-
get color(): string {
62-
return this._color;
63-
}
64-
65-
set color(value: string) {
66-
this._updateColor(value);
67-
}
64+
get color(): string { return this._color; }
65+
set color(value: string) { this._updateColor(value); }
6866

6967
_setMousedown() {
7068
// We only *show* the focus style when focus has come to the button via the keyboard.
@@ -95,16 +93,16 @@ export class MdButton {
9593
this._isKeyboardFocused = false;
9694
}
9795

98-
/** TODO(hansl): e2e test this function. */
99-
focus() {
96+
/** Focuses the button. */
97+
focus(): void {
10098
this._renderer.invokeElementMethod(this._elementRef.nativeElement, 'focus');
10199
}
102100

103-
getHostElement() {
101+
_getHostElement() {
104102
return this._elementRef.nativeElement;
105103
}
106104

107-
isRoundButton() {
105+
_isRoundButton() {
108106
const el = this._elementRef.nativeElement;
109107
return el.hasAttribute('md-icon-button') ||
110108
el.hasAttribute('md-fab') ||
@@ -122,6 +120,7 @@ export class MdButton {
122120
inputs: ['color', 'disabled', 'disableRipple'],
123121
host: {
124122
'[attr.disabled]': 'disabled',
123+
'[attr.aria-disabled]': '_isAriaDisabled',
125124
'[class.md-button-focus]': '_isKeyboardFocused',
126125
'(mousedown)': '_setMousedown()',
127126
'(focus)': '_setKeyboardFocus()',
@@ -137,14 +136,13 @@ export class MdAnchor extends MdButton {
137136
super(elementRef, renderer);
138137
}
139138

139+
/** @docs-private */
140140
@HostBinding('tabIndex')
141141
get tabIndex(): number {
142142
return this.disabled ? -1 : 0;
143143
}
144144

145-
/** Gets the aria-disabled value for the component, which must be a string for Dart. */
146-
@HostBinding('attr.aria-disabled')
147-
get isAriaDisabled(): string {
145+
get _isAriaDisabled(): string {
148146
return this.disabled ? 'true' : 'false';
149147
}
150148

src/lib/checkbox/checkbox.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
(change)="_onInteractionEvent($event)"
1717
(click)="_onInputClick($event)">
1818
<div md-ripple *ngIf="!_isRippleDisabled()" class="md-checkbox-ripple"
19-
[md-ripple-trigger]="getHostElement()"
20-
[md-ripple-centered]="true"
21-
[md-ripple-speed-factor]="0.3"
22-
md-ripple-background-color="rgba(0, 0, 0, 0)"></div>
19+
[mdRippleTrigger]="_getHostElement()"
20+
[mdRippleCentered]="true"
21+
[mdRippleSpeedFactor]="0.3"
22+
mdRippleBackgroundColor="rgba(0, 0, 0, 0)"></div>
2323
<div class="md-checkbox-frame"></div>
2424
<div class="md-checkbox-background">
2525
<svg version="1.1"

src/lib/checkbox/checkbox.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ describe('MdCheckbox', () => {
521521
expect(inputElement.tabIndex).toBe(13);
522522
});
523523

524-
it('should remove ripple if md-ripple-disabled input is set', async(() => {
524+
it('should remove ripple if mdRippleDisabled input is set', async(() => {
525525
testComponent.disableRipple = true;
526526
fixture.detectChanges();
527527

0 commit comments

Comments
 (0)