mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
parent
ffc6cb3c14
commit
0fdc3799b6
@ -47,20 +47,18 @@ export interface InputProps {
|
||||
addonBefore?: React.ReactNode;
|
||||
addonAfter?: React.ReactNode;
|
||||
onPressEnter?: React.FormEventHandler<any>;
|
||||
onKeyDown?: React.FormEventHandler<any>;
|
||||
onChange?: React.FormEventHandler<any>;
|
||||
onClick?: React.FormEventHandler<any>;
|
||||
onFocus?: React.FormEventHandler<any>;
|
||||
onBlur?: React.FormEventHandler<any>;
|
||||
autosize?: boolean | AutoSizeType;
|
||||
autoComplete?: 'on' | 'off';
|
||||
style?: React.CSSProperties;
|
||||
prefix?: React.ReactNode;
|
||||
suffix?: React.ReactNode;
|
||||
spellCheck?: boolean;
|
||||
}
|
||||
|
||||
export default class Input extends Component<InputProps, any> {
|
||||
export type HTMLInputProps = React.HTMLProps<HTMLInputElement>;
|
||||
|
||||
export default class Input extends Component<InputProps & HTMLInputProps, any> {
|
||||
static Group: any;
|
||||
static Search: any;
|
||||
static defaultProps = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import Input from './Input';
|
||||
import Input, { HTMLInputProps } from './Input';
|
||||
import Icon from '../icon';
|
||||
|
||||
export interface SearchProps {
|
||||
@ -10,14 +10,13 @@ export interface SearchProps {
|
||||
style?: React.CSSProperties;
|
||||
defaultValue?: any;
|
||||
value?: any;
|
||||
onChange?: React.FormEventHandler<any>;
|
||||
onSearch?: (value: string) => any;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
disabled?: boolean;
|
||||
readOnly?: boolean;
|
||||
}
|
||||
|
||||
export default class Search extends React.Component<SearchProps, any> {
|
||||
export default class Search extends React.Component<SearchProps & HTMLInputProps, any> {
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-input-search',
|
||||
onSearch() {},
|
||||
@ -42,11 +41,11 @@ export default class Search extends React.Component<SearchProps, any> {
|
||||
);
|
||||
return (
|
||||
<Input
|
||||
className={classNames(prefixCls, className)}
|
||||
onPressEnter={this.onSearch}
|
||||
ref={node => this.input = node}
|
||||
suffix={searchSuffix}
|
||||
{...others}
|
||||
suffix={searchSuffix}
|
||||
className={classNames(prefixCls, className)}
|
||||
ref={node => this.input = node}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user