fix: select type definition (#12865)

* fix: select type definition

* fix: wrapPicker type definition

* fix: select type definition
This commit is contained in:
MuYu 2018-10-30 10:52:27 +08:00 committed by zombieJ
parent ca11e2de00
commit 72a6febcc4
3 changed files with 8 additions and 8 deletions

View File

@ -31,8 +31,8 @@ export interface AutoCompleteProps extends AbstractSelectProps {
optionLabelProp?: string;
onChange?: (value: SelectValue) => void;
onSelect?: (value: SelectValue, option: Object) => any;
onBlur?: () => any;
onFocus?: () => any;
onBlur?: (value: SelectValue) => void;
onFocus?: () => void;
children?: ValidInputElement |
React.ReactElement<OptionProps> |
Array<React.ReactElement<OptionProps>>;

View File

@ -53,28 +53,28 @@ export default function wrapPicker(Picker: React.ComponentClass<any>, defaultFor
onOpenChange(open);
}
handleFocus = (e: React.FocusEventHandler<HTMLInputElement>) => {
handleFocus: React.FocusEventHandler<HTMLInputElement> = (e) => {
const { onFocus } = this.props;
if (onFocus) {
onFocus(e);
}
}
handleBlur = (e: React.FocusEventHandler<HTMLInputElement>) => {
handleBlur: React.FocusEventHandler<HTMLInputElement> = (e) => {
const { onBlur } = this.props;
if (onBlur) {
onBlur(e);
}
}
handleMouseEnter = (e: React.MouseEventHandler<HTMLInputElement>) => {
handleMouseEnter: React.MouseEventHandler<HTMLInputElement> = (e) => {
const { onMouseEnter } = this.props;
if (onMouseEnter) {
onMouseEnter(e);
}
}
handleMouseLeave = (e: React.MouseEventHandler<HTMLInputElement>) => {
handleMouseLeave: React.MouseEventHandler<HTMLInputElement> = (e) => {
const { onMouseLeave } = this.props;
if (onMouseLeave) {
onMouseLeave(e);

View File

@ -53,8 +53,8 @@ export interface SelectProps extends AbstractSelectProps {
onChange?: (value: SelectValue, option: React.ReactElement<any> | React.ReactElement<any>[]) => void;
onSelect?: (value: SelectValue, option: React.ReactElement<any>) => any;
onDeselect?: (value: SelectValue) => any;
onBlur?: () => any;
onFocus?: () => any;
onBlur?: (value: SelectValue) => void;
onFocus?: () => void;
onPopupScroll?: () => any;
onInputKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
onMouseEnter?: (e: React.MouseEvent<HTMLInputElement>) => any;