refactor(text-input): renamed some classes and removed some nesting

references #689
This commit is contained in:
Brandy Carney
2015-12-08 15:44:11 -05:00
parent 6a7f5fadc9
commit abc93bc355
6 changed files with 14 additions and 18 deletions

View File

@ -18,14 +18,10 @@ ion-label {
max-width: 200px; max-width: 200px;
} }
ion-input[stacked-label],
ion-input[floating-label] {
flex-direction: column;
align-items: flex-start;
}
[stacked-label], [stacked-label],
[floating-label] { [floating-label] {
flex-direction: column;
align-items: flex-start;
ion-label { ion-label {
align-self: stretch; align-self: stretch;

View File

@ -48,8 +48,8 @@ ion-label + [text-input] {
transition: transform 150ms ease-in-out; transition: transform 150ms ease-in-out;
} }
[floating-label].has-focus ion-label, [floating-label].input-focused ion-label,
[floating-label].has-value ion-label { [floating-label].input-has-value ion-label {
transform: translate3d(0, 0, 0) scale(0.8); transform: translate3d(0, 0, 0) scale(0.8);
} }

View File

@ -37,11 +37,11 @@ ion-input:after {
content: ''; content: '';
} }
ion-input.has-focus:after { .input-focused:after {
border-bottom: 2px solid $text-input-md-highlight-color; border-bottom: 2px solid $text-input-md-highlight-color;
} }
ion-input.ng-valid.has-value:after { ion-input.ng-valid.input-has-value:after {
border-bottom: 2px solid $text-input-md-hightlight-color-valid; border-bottom: 2px solid $text-input-md-hightlight-color-valid;
} }
@ -59,8 +59,8 @@ ion-input.ng-invalid.ng-touched:after {
margin-left: 0; margin-left: 0;
} }
[stacked-label].has-focus ion-label, [stacked-label].input-focused ion-label,
[floating-label].has-focus ion-label { [floating-label].input-focused ion-label {
color: $text-input-md-highlight-color; color: $text-input-md-highlight-color;
} }
@ -78,8 +78,8 @@ ion-input.ng-invalid.ng-touched:after {
transition: transform 150ms ease-in-out; transition: transform 150ms ease-in-out;
} }
[floating-label].has-focus ion-label, [floating-label].input-focused ion-label,
[floating-label].has-value ion-label { [floating-label].input-has-value ion-label {
transform: translate3d(0, 0, 0) scale(0.8); transform: translate3d(0, 0, 0) scale(0.8);
} }

View File

@ -11,7 +11,7 @@
<input type="text"> <input type="text">
</ion-input> </ion-input>
<ion-input floating-label class="has-value"> <ion-input floating-label class="input-has-value">
<ion-label>Floating Label 2</ion-label> <ion-label>Floating Label 2</ion-label>
<input value="Has Value" type="text"> <input value="Has Value" type="text">
</ion-input> </ion-input>

View File

@ -34,7 +34,7 @@ ion-input [text-input] {
pointer-events: none; pointer-events: none;
} }
ion-input.has-focus [text-input] { .input-focused [text-input] {
pointer-events: auto; pointer-events: auto;
} }

View File

@ -372,7 +372,7 @@ export class TextInput {
* @private * @private
*/ */
focusChange(hasFocus) { focusChange(hasFocus) {
this.renderer.setElementClass(this.elementRef, 'has-focus', hasFocus); this.renderer.setElementClass(this.elementRef, 'input-focused', hasFocus);
if (!hasFocus) { if (!hasFocus) {
this.deregMove(); this.deregMove();
this.input.hideFocus(false); this.input.hideFocus(false);
@ -383,7 +383,7 @@ export class TextInput {
* @private * @private
*/ */
hasValue(inputValue) { hasValue(inputValue) {
this.renderer.setElementClass(this.elementRef, 'has-value', inputValue && inputValue !== ''); this.renderer.setElementClass(this.elementRef, 'input-has-value', inputValue && inputValue !== '');
} }
/** /**