Skip to content

Commit a1c7e69

Browse files
committed
fixed demos, tests still broken
1 parent 8c4ed06 commit a1c7e69

File tree

9 files changed

+164
-114
lines changed

9 files changed

+164
-114
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<md-input placeholder="Input"></md-input>
1414
| Text 5 |
1515
<md-input-wrapper>
16-
<input placeholder="Input">
16+
<input md-input placeholder="Input">
1717
</md-input-wrapper>
1818
| Text After
1919
</md-card-content>
@@ -35,7 +35,7 @@ <h1>
3535
<md-input placeholder="Input"></md-input>
3636
| Text 5 |
3737
<md-input-wrapper>
38-
<input placeholder="Input">
38+
<input md-input placeholder="Input">
3939
</md-input-wrapper>
4040
| Text After
4141
</h1>

src/demo-app/input/input-wrapper-demo.html

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,43 @@
33
<md-card-content>
44
<form>
55
<md-input-wrapper class="demo-full-width">
6-
<input placeholder="Company (disabled)" disabled value="Google">
6+
<input md-input placeholder="Company (disabled)" disabled value="Google">
77
</md-input-wrapper>
88

99
<table style="width: 100%" cellspacing="0"><tr>
1010
<td>
1111
<md-input-wrapper style="width: 100%">
12-
<input placeholder="First name">
12+
<input md-input placeholder="First name">
1313
</md-input-wrapper>
1414
</td>
1515
<td>
1616
<md-input-wrapper style="width: 100%">
17-
<input placeholder="Long Last Name That Will Be Truncated">
17+
<input md-input placeholder="Long Last Name That Will Be Truncated">
1818
</md-input-wrapper>
1919
</td>
2020
</tr></table>
2121
<p>
2222
<md-input-wrapper class="demo-full-width">
23-
<textarea placeholder="Address">1600 Amphitheatre Pkway</textarea>
23+
<textarea md-input placeholder="Address">1600 Amphitheatre Pkway</textarea>
2424
</md-input-wrapper>
2525
<md-input-wrapper class="demo-full-width">
26-
<textarea placeholder="Address 2"></textarea>
26+
<textarea md-input placeholder="Address 2"></textarea>
2727
</md-input-wrapper>
2828
</p>
2929
<table style="width: 100%" cellspacing="0"><tr>
3030
<td>
3131
<md-input-wrapper class="demo-full-width">
32-
<input placeholder="City" value="Mountain View">
32+
<input md-input placeholder="City" value="Mountain View">
3333
</md-input-wrapper>
3434
</td>
3535
<td>
3636
<md-input-wrapper class="demo-full-width">
37-
<input placeholder="State" maxLength="2" value="CA">
37+
<input md-input placeholder="State" maxLength="2" value="CA">
3838
</md-input-wrapper>
3939
</td>
4040
<td>
4141
<md-input-wrapper class="demo-full-width">
42-
<input #postalCode maxLength="5" placeholder="Postal Code" value="94043">
42+
<input md-input #postalCode maxLength="5" placeholder="Postal Code" value="94043">
4343
<md-hint align="end">{{postalCode.value.length}} / 5</md-hint>
4444
</md-input-wrapper>
4545
</td>
@@ -52,7 +52,7 @@
5252
<md-toolbar color="primary">Prefix + Suffix</md-toolbar>
5353
<md-card-content>
5454
<md-input-wrapper align="end">
55-
<input placeholder="amount">
55+
<input md-input placeholder="amount">
5656
<span md-prefix>$&nbsp;</span>
5757
<span md-suffix>.00</span>
5858
</md-input-wrapper>
@@ -64,24 +64,24 @@
6464
<md-card-content>
6565
<h4>Input</h4>
6666
<md-input-wrapper dividerColor="primary" >
67-
<input placeholder="Default Color" value="example">
67+
<input md-input placeholder="Default Color" value="example">
6868
</md-input-wrapper>
6969
<md-input-wrapper dividerColor="accent">
70-
<input placeholder="Accent Color" value="example">
70+
<input md-input placeholder="Accent Color" value="example">
7171
</md-input-wrapper>
7272
<md-input-wrapper dividerColor="warn">
73-
<input placeholder="Warn Color" value="example">
73+
<input md-input placeholder="Warn Color" value="example">
7474
</md-input-wrapper>
7575

7676
<h4>Textarea</h4>
7777
<md-input-wrapper dividerColor="primary">
78-
<textarea placeholder="Default Color">example</textarea>
78+
<textarea md-input placeholder="Default Color">example</textarea>
7979
</md-input-wrapper>
8080
<md-input-wrapper dividerColor="accent">
81-
<textarea placeholder="Accent Color">example</textarea>
81+
<textarea md-input placeholder="Accent Color">example</textarea>
8282
</md-input-wrapper>
8383
<md-input-wrapper dividerColor="warn">
84-
<textarea placeholder="Warn Color">example</textarea>
84+
<textarea md-input placeholder="Warn Color">example</textarea>
8585
</md-input-wrapper>
8686
</md-card-content>
8787
</md-card>
@@ -92,7 +92,8 @@ <h4>Textarea</h4>
9292
<h4>Input</h4>
9393
<p>
9494
<md-input-wrapper class="demo-full-width">
95-
<input #characterCountInputHintExample
95+
<input md-input
96+
#characterCountInputHintExample
9697
placeholder="Character count (100 max)"
9798
maxLength="100"
9899
value="Hello world. How are you?">
@@ -103,7 +104,8 @@ <h4>Input</h4>
103104
<h4>Textarea</h4>
104105
<p>
105106
<md-input-wrapper class="demo-full-width">
106-
<textarea #characterCountTextareaHintExample
107+
<textarea md-input
108+
#characterCountTextareaHintExample
107109
placeholder="Character count (100 max)"
108110
maxLength="100">Hello world. How are you?</textarea>
109111
<md-hint align="end">{{characterCountTextareaHintExample.value.length}} / 100</md-hint>
@@ -116,39 +118,39 @@ <h4>Textarea</h4>
116118
<md-toolbar color="primary">
117119
Hello&nbsp;
118120
<md-input-wrapper dividerColor="accent">
119-
<input [(ngModel)]="name" type="text" placeholder="First name">
121+
<input md-input [(ngModel)]="name" type="text" placeholder="First name">
120122
</md-input-wrapper>,
121123
how are you?
122124
</md-toolbar>
123125
<md-card-content>
124126
<p>
125127
<md-input-wrapper>
126-
<input disabled placeholder="Disabled field" value="Value">
128+
<input md-input disabled placeholder="Disabled field" value="Value">
127129
</md-input-wrapper>
128130
<md-input-wrapper>
129-
<input required placeholder="Required field">
131+
<input md-input required placeholder="Required field">
130132
</md-input-wrapper>
131133
</p>
132134
<p>
133135
<md-input-wrapper style="width: 100%">
134-
<input placeholder="100% width placeholder">
136+
<input md-input placeholder="100% width placeholder">
135137
</md-input-wrapper>
136138
</p>
137139
<p>
138140
<md-input-wrapper style="width: 100%">
139-
<input #input placeholder="Character count (100 max)" maxLength="100">
141+
<input md-input #input placeholder="Character count (100 max)" maxLength="100">
140142
<md-hint align="end">{{input.value.length}} / 100</md-hint>
141143
</md-input-wrapper>
142144
</p>
143145
<p>
144146
<md-input-wrapper hintLabel="Hint label" style="width: 100%">
145-
<input placeholder="Show Hint Label">
147+
<input md-input placeholder="Show Hint Label">
146148
</md-input-wrapper>
147149
</p>
148150

149151
<p>
150152
<md-input-wrapper>
151-
<input>
153+
<input md-input>
152154
<md-placeholder>
153155
I <md-icon class="demo-icons">favorite</md-icon> <b>bold</b> placeholder
154156
</md-placeholder>
@@ -159,43 +161,44 @@ <h4>Textarea</h4>
159161
</p>
160162
<p>
161163
<md-input-wrapper hintLabel="Hint label" style="width: 100%">
162-
<input #hintLabelWithCharCount placeholder="Show Hint Label With Character Count">
164+
<input md-input #hintLabelWithCharCount placeholder="Show Hint Label With Character Count">
163165
<md-hint align="end">{{hintLabelWithCharCount.value.length}}</md-hint>
164166
</md-input-wrapper>
165167
</p>
166168
<p>
167169
<md-checkbox [(ngModel)]="dividerColor">Check to change the divider color:</md-checkbox>
168170
<md-input-wrapper [dividerColor]="dividerColor ? 'primary' : 'accent'">
169-
<input [placeholder]="dividerColor ? 'Primary color' : 'Accent color'">
171+
<input md-input [placeholder]="dividerColor ? 'Primary color' : 'Accent color'">
170172
</md-input-wrapper>
171173
</p>
172174
<p>
173175
<md-checkbox [(ngModel)]="requiredField"> Check to make required:</md-checkbox>
174176
<md-input-wrapper>
175-
<input [required]="requiredField"
177+
<input md-input
178+
[required]="requiredField"
176179
[placeholder]="requiredField ? 'Required field' : 'Not required field'">
177180
</md-input-wrapper>
178181
</p>
179182
<p>
180183
<md-checkbox [(ngModel)]="floatingLabel"> Check to make floating label:</md-checkbox>
181184
<md-input-wrapper [floatingPlaceholder]="floatingLabel">
182-
<input [placeholder]="floatingLabel ? 'Floating label' : 'Not floating label'">
185+
<input md-input [placeholder]="floatingLabel ? 'Floating label' : 'Not floating label'">
183186
</md-input-wrapper>
184187
</p>
185188

186189
<p>
187190
<md-input-wrapper>
188-
<input placeholder="Prefixed" value="example">
191+
<input md-input placeholder="Prefixed" value="example">
189192
<div md-prefix>Example:&nbsp;</div>
190193
</md-input-wrapper>
191194
<md-input-wrapper align="end">
192-
<input placeholder="Suffixed" value="123">
195+
<input md-input placeholder="Suffixed" value="123">
193196
<span md-suffix>.00 €</span>
194197
</md-input-wrapper>
195198
<br/>
196199
Both:
197200
<md-input-wrapper align="end">
198-
<input #email placeholder="Email Address" value="angular-core">
201+
<input md-input #email placeholder="Email Address" value="angular-core">
199202
<span md-prefix>
200203
<md-icon [class.primary]="email.focused" class="demo-icons demo-transform">email</md-icon>
201204
&nbsp;
@@ -207,8 +210,8 @@ <h4>Textarea</h4>
207210
</p>
208211

209212
<p>
210-
Empty: <md-input-wrapper><input></md-input-wrapper>
211-
<label>Label: <md-input-wrapper><input></md-input-wrapper></label>
213+
Empty: <md-input-wrapper><input md-input></md-input-wrapper>
214+
<label>Label: <md-input-wrapper><input md-input></md-input-wrapper></label>
212215
</p>
213216
</md-card-content>
214217
</md-card>
@@ -230,7 +233,8 @@ <h4>Textarea</h4>
230233
<td>{{i+1}}</td>
231234
<td>
232235
<md-input-wrapper>
233-
<input type="number"
236+
<input md-input
237+
type="number"
234238
placeholder="value"
235239
aria-label="hello"
236240
[(ngModel)]="items[i].value">
@@ -251,8 +255,10 @@ <h4>Textarea</h4>
251255
<md-card-content>
252256
<textarea md-autosize class="demo-textarea"></textarea>
253257
<div>
254-
<md-input-wrapper style="width:300px;">
255-
<textarea placeholder="Autosized textarea (currently broken)" md-autoresize></textarea>
258+
<md-input-wrapper>
259+
<textarea md-input
260+
md-autosize
261+
placeholder="Autosized textarea"></textarea>
256262
</md-input-wrapper>
257263
</div>
258264
</md-card-content>

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@
2828
</section>
2929
<section>
3030
<md-input-wrapper>
31-
<input placeholder="Max radius" aria-label="radius" [(ngModel)]="maxRadius">
31+
<input md-input placeholder="Max radius" aria-label="radius" [(ngModel)]="maxRadius">
3232
</md-input-wrapper>
3333
<md-input-wrapper>
34-
<input placeholder="Ripple color" aria-label="color" [(ngModel)]="rippleColor">
34+
<input md-input placeholder="Ripple color" aria-label="color" [(ngModel)]="rippleColor">
3535
</md-input-wrapper>
3636
<md-input-wrapper>
37-
<input placeholder="Ripple background"
37+
<input md-input
38+
placeholder="Ripple background"
3839
aria-label="background"
3940
[(ngModel)]="rippleBackgroundColor">
4041
</md-input-wrapper>

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<h1>SnackBar demo</h1>
22
<div>
3-
<div>Message: <md-input-wrapper><input type="text" [(ngModel)]="message"></md-input-wrapper></div>
3+
<div>
4+
Message: <md-input-wrapper><input md-input type="text" [(ngModel)]="message"></md-input-wrapper>
5+
</div>
46
<div>
57
<md-checkbox [(ngModel)]="action">
68
<p *ngIf="!action">Show button on snack bar</p>
79
<md-input-wrapper *ngIf="action">
8-
<input type="text"
10+
<input md-input
11+
type="text"
912
class="demo-button-label-input"
1013
placeholder="Snack bar action label"
1114
[(ngModel)]="actionButtonLabel">
@@ -16,7 +19,8 @@ <h1>SnackBar demo</h1>
1619
<md-checkbox [(ngModel)]="setAutoHide">
1720
<p *ngIf="!setAutoHide">Auto hide after duration</p>
1821
<md-input-wrapper *ngIf="setAutoHide">
19-
<input type="number"
22+
<input md-input
23+
type="number"
2024
class="demo-button-label-input"
2125
placeholder="Auto Hide Duration in ms"
2226
[(ngModel)]="autoHide">

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ <h1>Tab Group Demo - Dynamic Height</h1>
124124
</div>
125125
<br>
126126
<br>
127-
<md-input-wrapper><input placeholder="Tab Label" [(ngModel)]="tab.label"></md-input-wrapper>
127+
<md-input-wrapper>
128+
<input md-input placeholder="Tab Label" [(ngModel)]="tab.label">
129+
</md-input-wrapper>
128130
</md-tab>
129131
</md-tab-group>
130132

@@ -166,7 +168,9 @@ <h1>Tab Group Demo - Fixed Height</h1>
166168
</div>
167169
<br>
168170
<br>
169-
<md-input-wrapper><input placeholder="Tab Label" [(ngModel)]="tab.label"></md-input-wrapper>
171+
<md-input-wrapper>
172+
<input md-input placeholder="Tab Label" [(ngModel)]="tab.label">
173+
</md-input-wrapper>
170174
</md-tab>
171175
</md-tab-group>
172176

@@ -189,7 +193,9 @@ <h1>Async Tabs</h1>
189193
<br>
190194
<br>
191195
<br>
192-
<md-input-wrapper><input placeholder="Tab Label" [(ngModel)]="tab.label"></md-input-wrapper>
196+
<md-input-wrapper>
197+
<input md-input placeholder="Tab Label" [(ngModel)]="tab.label">
198+
</md-input-wrapper>
193199
</md-tab>
194200
</md-tab-group>
195201

@@ -202,4 +208,4 @@ <h1>Tabs with simplified api</h1>
202208
<md-tab label="Fire">
203209
This tab is about combustion!
204210
</md-tab>
205-
</md-tab-group>
211+
</md-tab-group>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h1>Tooltip Demo</h1>
2222

2323
<p>
2424
<strong>Message: </strong>
25-
<md-input-wrapper><input type="text" [(ngModel)]="message"></md-input-wrapper>
25+
<md-input-wrapper><input md-input type="text" [(ngModel)]="message"></md-input-wrapper>
2626
</p>
2727

2828
<strong>Mouse over to</strong>

src/lib/input/input-wrapper.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@
66
<ng-content selector="input, textarea"></ng-content>
77

88
<label class="md-input-placeholder"
9-
[attr.for]="_inputId"
10-
[class.md-empty]="_empty"
11-
[class.md-focused]="_focused"
9+
[attr.for]="_mdInputChild.id"
10+
[class.md-empty]="_mdInputChild.empty"
11+
[class.md-focused]="_mdInputChild.focused"
1212
[class.md-float]="floatingPlaceholder"
1313
[class.md-accent]="dividerColor == 'accent'"
1414
[class.md-warn]="dividerColor == 'warn'"
1515
*ngIf="_hasPlaceholder()">
1616
<ng-content select="md-placeholder"></ng-content>
17-
{{_inputPlaceholder}}
18-
<span class="md-placeholder-required" *ngIf="_inputRequired">*</span>
17+
{{_mdInputChild.placeholder}}
18+
<span class="md-placeholder-required" *ngIf="_mdInputChild.required">*</span>
1919
</label>
2020
</div>
2121

2222
<div class="md-input-suffix"><ng-content select="[md-suffix]"></ng-content></div>
2323
</div>
2424

2525
<div class="md-input-underline"
26-
[class.md-disabled]="_inputDisabled">
26+
[class.md-disabled]="_mdInputChild.disabled">
2727
<span class="md-input-ripple"
28-
[class.md-focused]="_focused"
28+
[class.md-focused]="_mdInputChild.focused"
2929
[class.md-accent]="dividerColor == 'accent'"
3030
[class.md-warn]="dividerColor == 'warn'"></span>
3131
</div>

0 commit comments

Comments
 (0)