UNPKG

1.5 kBTypeScriptView Raw
1import * as React from 'react';
2import type { DirectionType } from '../config-provider';
3import type { SizeType } from '../config-provider/SizeContext';
4import type { FormItemStatusContextProps } from '../form/context';
5import type { InputStatus } from '../_util/statusUtils';
6declare const ClearableInputType: ["text", "input"];
7/** This basic props required for input and textarea. */
8interface BasicProps {
9 prefixCls: string;
10 inputType: typeof ClearableInputType[number];
11 value?: any;
12 allowClear?: boolean;
13 element: React.ReactElement;
14 handleReset: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
15 className?: string;
16 style?: React.CSSProperties;
17 disabled?: boolean;
18 direction?: DirectionType;
19 focused?: boolean;
20 readOnly?: boolean;
21 bordered: boolean;
22 hidden?: boolean;
23}
24/** This props only for input. */
25export interface ClearableInputProps extends BasicProps {
26 size?: SizeType;
27 suffix?: React.ReactNode;
28 prefix?: React.ReactNode;
29 addonBefore?: React.ReactNode;
30 addonAfter?: React.ReactNode;
31 triggerFocus?: () => void;
32 status?: InputStatus;
33 hashId?: string;
34}
35declare class ClearableLabeledInput extends React.Component<ClearableInputProps> {
36 renderClearIcon(prefixCls: string): JSX.Element;
37 renderTextAreaWithClearIcon(prefixCls: string, element: React.ReactElement, statusContext: FormItemStatusContextProps): JSX.Element;
38 render(): JSX.Element;
39}
40export default ClearableLabeledInput;