UNPKG

1.71 kBTypeScriptView Raw
1import * as React from 'react';
2import { InputProps } from './Input';
3import { SizeType } from '../config-provider/SizeContext';
4declare const ClearableInputType: ["text", "input"];
5export declare function hasPrefixSuffix(props: InputProps | ClearableInputProps): boolean;
6/**
7 * This basic props required for input and textarea.
8 */
9interface BasicProps {
10 prefixCls: string;
11 inputType: typeof ClearableInputType[number];
12 value?: any;
13 allowClear?: boolean;
14 element: React.ReactElement<any>;
15 handleReset: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
16 className?: string;
17 style?: object;
18 disabled?: boolean;
19 direction?: any;
20 focused?: boolean;
21 readOnly?: boolean;
22}
23/**
24 * This props only for input.
25 */
26interface ClearableInputProps extends BasicProps {
27 size?: SizeType;
28 suffix?: React.ReactNode;
29 prefix?: React.ReactNode;
30 addonBefore?: React.ReactNode;
31 addonAfter?: React.ReactNode;
32 triggerFocus: () => void;
33}
34declare class ClearableLabeledInput extends React.Component<ClearableInputProps> {
35 /** @private Do not use out of this class. We do not promise this is always keep. */
36 private containerRef;
37 onInputMouseUp: React.MouseEventHandler;
38 renderClearIcon(prefixCls: string): JSX.Element | null;
39 renderSuffix(prefixCls: string): JSX.Element | null;
40 renderLabeledIcon(prefixCls: string, element: React.ReactElement<any>): JSX.Element;
41 renderInputWithLabel(prefixCls: string, labeledElement: React.ReactElement<any>): JSX.Element;
42 renderTextAreaWithClearIcon(prefixCls: string, element: React.ReactElement<any>): JSX.Element;
43 render(): JSX.Element;
44}
45export default ClearableLabeledInput;