From 7b30fdc5352c17a0710db467510ce431f1b11714 Mon Sep 17 00:00:00 2001 From: mmalerba Date: Thu, 26 Jan 2017 10:03:09 -0800 Subject: [PATCH] fix(input): remove md-input and md-textarea in favor of md-input-container (#2788) * remove md-input and md-textarea * fix demo * clean up filenames --- src/demo-app/baseline/baseline-demo.html | 4 - src/demo-app/chips/chips-demo.ts | 11 +- src/demo-app/demo-app-module.ts | 2 - src/demo-app/demo-app/routes.ts | 2 - src/demo-app/dialog/dialog-demo.html | 24 +- src/demo-app/input/input-container-demo.html | 14 +- ...ut-demo.scss => input-container-demo.scss} | 0 src/demo-app/input/input-container-demo.ts | 2 +- src/demo-app/input/input-demo.html | 184 ---- src/demo-app/input/input-demo.ts | 31 - src/demo-app/snack-bar/snack-bar-demo.html | 4 +- src/demo-app/tabs/tabs-demo.html | 12 +- src/demo-app/tabs/tabs-demo.scss | 4 +- src/demo-app/tooltip/tooltip-demo.html | 8 +- src/lib/core/compatibility/compatibility.ts | 2 - src/lib/input/README.md | 3 - src/lib/input/autosize.spec.ts | 2 +- src/lib/input/index.ts | 41 +- src/lib/input/input-container.scss | 185 +++- src/lib/input/input-container.spec.ts | 16 +- src/lib/input/input-container.ts | 8 +- src/lib/input/input.html | 96 -- src/lib/input/input.scss | 202 ----- src/lib/input/input.spec.ts | 843 ------------------ src/lib/input/input.ts | 440 --------- 25 files changed, 282 insertions(+), 1858 deletions(-) rename src/demo-app/input/{input-demo.scss => input-container-demo.scss} (100%) delete mode 100644 src/demo-app/input/input-demo.html delete mode 100644 src/demo-app/input/input-demo.ts delete mode 100644 src/lib/input/input.html delete mode 100644 src/lib/input/input.scss delete mode 100644 src/lib/input/input.spec.ts delete mode 100644 src/lib/input/input.ts diff --git a/src/demo-app/baseline/baseline-demo.html b/src/demo-app/baseline/baseline-demo.html index 3b2e6a47aaf5..707b445e3c22 100644 --- a/src/demo-app/baseline/baseline-demo.html +++ b/src/demo-app/baseline/baseline-demo.html @@ -10,8 +10,6 @@ | Text 3 | Radio 3 | Text 4 | - - | Text 5 | @@ -32,8 +30,6 @@

| Text 3 | Radio 3 | Text 4 | - - | Text 5 | diff --git a/src/demo-app/chips/chips-demo.ts b/src/demo-app/chips/chips-demo.ts index 16135f235cf0..90593475db14 100644 --- a/src/demo-app/chips/chips-demo.ts +++ b/src/demo-app/chips/chips-demo.ts @@ -1,5 +1,4 @@ -import {Component} from '@angular/core'; -import {MdInput} from '@angular/material'; +import {Component, ElementRef} from '@angular/core'; export interface Person { name: string; @@ -40,10 +39,10 @@ export class ChipsDemo { alert(message); } - add(input: MdInput): void { - if (input.value && input.value.trim() != '') { - this.people.push({ name: input.value.trim() }); - input.value = ''; + add(input: ElementRef): void { + if (input.nativeElement.value && input.nativeElement.value.trim() != '') { + this.people.push({ name: input.nativeElement.value.trim() }); + input.nativeElement.value = ''; } } diff --git a/src/demo-app/demo-app-module.ts b/src/demo-app/demo-app-module.ts index 5f99a3a54225..47e20162af9e 100644 --- a/src/demo-app/demo-app-module.ts +++ b/src/demo-app/demo-app-module.ts @@ -12,7 +12,6 @@ import {JazzDialog, ContentElementDialog, DialogDemo} from './dialog/dialog-demo import {RippleDemo} from './ripple/ripple-demo'; import {IconDemo} from './icon/icon-demo'; import {GesturesDemo} from './gestures/gestures-demo'; -import {InputDemo} from './input/input-demo'; import {CardDemo} from './card/card-demo'; import {ChipsDemo} from './chips/chips-demo'; import {RadioDemo} from './radio/radio-demo'; @@ -63,7 +62,6 @@ import {InputContainerDemo} from './input/input-container-demo'; GridListDemo, Home, IconDemo, - InputDemo, InputContainerDemo, JazzDialog, ContentElementDialog, diff --git a/src/demo-app/demo-app/routes.ts b/src/demo-app/demo-app/routes.ts index 7af0ae91863e..3a1b3ba916b6 100644 --- a/src/demo-app/demo-app/routes.ts +++ b/src/demo-app/demo-app/routes.ts @@ -10,7 +10,6 @@ import {LiveAnnouncerDemo} from '../live-announcer/live-announcer-demo'; import {ListDemo} from '../list/list-demo'; import {IconDemo} from '../icon/icon-demo'; import {ToolbarDemo} from '../toolbar/toolbar-demo'; -import {InputDemo} from '../input/input-demo'; import {CheckboxDemo} from '../checkbox/checkbox-demo'; import {OverlayDemo} from '../overlay/overlay-demo'; import {PortalDemo} from '../portal/portal-demo'; @@ -51,7 +50,6 @@ export const DEMO_APP_ROUTES: Routes = [ {path: 'projection', component: ProjectionDemo}, {path: 'overlay', component: OverlayDemo}, {path: 'checkbox', component: CheckboxDemo}, - {path: 'input', component: InputDemo}, {path: 'input-container', component: InputContainerDemo}, {path: 'toolbar', component: ToolbarDemo}, {path: 'icon', component: IconDemo}, diff --git a/src/demo-app/dialog/dialog-demo.html b/src/demo-app/dialog/dialog-demo.html index 975d81d534c3..53734bbbfdff 100644 --- a/src/demo-app/dialog/dialog-demo.html +++ b/src/demo-app/dialog/dialog-demo.html @@ -8,20 +8,32 @@

Dialog demo

Dialog dimensions

- - + + + + + +

Dialog position

- - + + + + + +

- - + + + + + +

Other options

diff --git a/src/demo-app/input/input-container-demo.html b/src/demo-app/input/input-container-demo.html index 23c5fe7528da..d393a5b6459e 100644 --- a/src/demo-app/input/input-container-demo.html +++ b/src/demo-app/input/input-container-demo.html @@ -92,7 +92,7 @@

Textarea

Input

- Input

Textarea

- @@ -150,7 +150,7 @@

Textarea

- + I favorite bold placeholder @@ -174,7 +174,7 @@

Textarea

Check to make required: - @@ -210,8 +210,8 @@

Textarea

- Empty: - + Empty: +

@@ -233,7 +233,7 @@

Textarea

{{i+1}} - - Basic - -
- - - - - - -
-

- - -

- - - - -
- {{postalCode.characterCount}} / 5 -
-
-
- - - - Prefix + Suffix - - - - .00 - - - - - - Divider Colors - -

Input

- - - - -

Textarea

- - - - -
-
- - - Hints - -

Input

-

- - {{characterCountHintExample.characterCount}} / 100 - -

- -

Textarea

-

- - {{characterCountHintExampleTextarea.characterCount}} / 100 - -

-
-
- - - - Hello , - how are you? - - -

- - -

-

- -

-

- - {{input.characterCount}} / 100 - -

-

- -

- -

- - - I favorite bold placeholder - - - I also home italic hint labels - - -

-

- - {{characterCountHintExampleInput.characterCount}} - -

-

- Check to change the divider color: - -

-

- Check to make required: - -

-

- Check to make floating label: - -

- -

- -

Example: 
- - - .00 € - -
- Both: - - email  -  @gmail.com - -

- -

- Empty: - -

-
-
- - - - - - - - - - - - - -
Table - - - - -
{{i+1}} - - - - {{item.value}}
-
- - - -

textarea autosize

- -
diff --git a/src/demo-app/input/input-demo.ts b/src/demo-app/input/input-demo.ts deleted file mode 100644 index 49dcfe0f56a8..000000000000 --- a/src/demo-app/input/input-demo.ts +++ /dev/null @@ -1,31 +0,0 @@ -import {Component} from '@angular/core'; - - -let max = 5; - -@Component({ - moduleId: module.id, - selector: 'input-demo', - templateUrl: 'input-demo.html', - styleUrls: ['input-demo.css'], -}) -export class InputDemo { - dividerColor: boolean; - requiredField: boolean; - floatingLabel: boolean; - name: string; - items: any[] = [ - { value: 10 }, - { value: 20 }, - { value: 30 }, - { value: 40 }, - { value: 50 }, - ]; - rows = 8; - - addABunch(n: number) { - for (let x = 0; x < n; x++) { - this.items.push({ value: ++max }); - } - } -} diff --git a/src/demo-app/snack-bar/snack-bar-demo.html b/src/demo-app/snack-bar/snack-bar-demo.html index de6ed632bfdb..314064e9b67a 100644 --- a/src/demo-app/snack-bar/snack-bar-demo.html +++ b/src/demo-app/snack-bar/snack-bar-demo.html @@ -7,7 +7,7 @@

SnackBar demo

Show button on snack bar

- SnackBar demo

Auto hide after duration

- Tab Group Demo - Dynamic Tabs
Selected tab index: - + + +
@@ -33,7 +35,9 @@

Tab Group Demo - Dynamic Tabs

Position: - + + +


- + + +