mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 13:32:54 +08:00
refactor(input): restructure input component to separate modules
restructure input component to separate modules
This commit is contained in:
@ -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';
|
||||||
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
18
src/components/input/next-input.ts
Normal file
18
src/components/input/next-input.ts
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user