UNPKG

1.57 kBTypeScriptView Raw
1import * as React from 'react';
2import * as PropTypes from 'prop-types';
3import { SearchBarPropsType, SearchBarState } from './PropsType';
4export interface SearchBarProps extends SearchBarPropsType {
5 prefixCls?: string;
6 className?: string;
7 style?: React.CSSProperties;
8}
9export default class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
10 static defaultProps: {
11 prefixCls: string;
12 placeholder: string;
13 onSubmit: () => void;
14 onChange: () => void;
15 onFocus: () => void;
16 onBlur: () => void;
17 onClear: () => void;
18 showCancelButton: boolean;
19 disabled: boolean;
20 };
21 static contextTypes: {
22 antLocale: PropTypes.Requireable<object>;
23 };
24 rightBtnInitMarginleft: string | null;
25 firstFocus: boolean;
26 blurFromOnClear: boolean;
27 onBlurTimeout: number | null;
28 inputRef: HTMLInputElement | null;
29 private rightBtnRef;
30 private syntheticPhContainerRef;
31 private syntheticPhRef;
32 private inputContainerRef;
33 constructor(props: SearchBarProps);
34 componentDidMount(): void;
35 componentDidUpdate(): void;
36 componentWillReceiveProps(nextProps: SearchBarProps): void;
37 componentWillUnmount(): void;
38 onSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
39 onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
40 onFocus: () => void;
41 onBlur: () => void;
42 onClear: () => void;
43 doClear: (blurFromOnClear?: boolean) => void;
44 onCancel: () => void;
45 focus: () => void;
46 render(): JSX.Element;
47}