refactor(input): restructure input component to separate modules

restructure input component to separate modules
This commit is contained in:
Dan Bucholtz
2017-03-02 14:50:07 -06:00
parent a7ce20f990
commit ece5047b6c
3 changed files with 20 additions and 19 deletions

View File

@ -10,7 +10,8 @@ import { Form, IonicFormInput } from '../../util/form';
import { Ion } from '../ion'; import { Ion } from '../ion';
import { isString, isTrueProperty } from '../../util/util'; import { isString, isTrueProperty } from '../../util/util';
import { Item } from '../item/item'; import { Item } from '../item/item';
import { NativeInput, NextInput } from './native-input'; import { NativeInput } from './native-input';
import { NextInput } from './next-input';
import { NavController } from '../../navigation/nav-controller'; import { NavController } from '../../navigation/nav-controller';
import { NavControllerBase } from '../../navigation/nav-controller-base'; import { NavControllerBase } from '../../navigation/nav-controller-base';
import { Platform } from '../../platform/platform'; import { Platform } from '../../platform/platform';

View File

@ -240,21 +240,3 @@ function removeClone(plt: Platform, srcNativeInputEle: HTMLElement) {
(<any>srcNativeInputEle.style)[plt.Css.transform] = ''; (<any>srcNativeInputEle.style)[plt.Css.transform] = '';
srcNativeInputEle.style.opacity = ''; srcNativeInputEle.style.opacity = '';
} }
/**
* @private
*/
@Directive({
selector: '[next-input]'
})
export class NextInput {
@Output() focused: EventEmitter<boolean> = new EventEmitter<boolean>();
@HostListener('focus')
receivedFocus() {
console.debug('native-input, next-input received focus');
this.focused.emit(true);
}
}

View File

@ -0,0 +1,18 @@
import { Directive, EventEmitter, HostListener, Output } from '@angular/core';
/**
* @private
*/
@Directive({
selector: '[next-input]'
})
export class NextInput {
@Output() focused: EventEmitter<boolean> = new EventEmitter<boolean>();
@HostListener('focus')
receivedFocus() {
console.debug('native-input, next-input received focus');
this.focused.emit(true);
}
}