ontime-components
Version:
List of react components
51 lines (50 loc) • 1.5 kB
TypeScript
import { PureComponent } from 'react';
import { IProps } from '../../libs/interfaces';
import { TFuncClick, TFuncChange, TFuncFocus } from '../../libs/types';
import { TError } from '../InputErrors';
declare type TLabelPosition = 'top' | 'left' | 'right';
interface ITextareaProps extends IProps {
label?: string;
labelPosition?: TLabelPosition;
required?: boolean;
id?: string;
name?: string;
value?: any;
placeholder?: string;
autoFocus?: boolean;
disabled?: boolean;
tabIndex?: string | number;
errors?: TError[] | null;
children?: any;
onClick?: Function;
onChange?: Function;
onFocus?: Function;
onBlur?: Function;
onKeyDown?: Function;
}
interface ITextareaDefProps {
labelPosition: TLabelPosition;
}
interface ITextareaState {
value: any;
isFocused: boolean;
}
declare class Textarea extends PureComponent<ITextareaProps & ITextareaDefProps, ITextareaState> {
static defaultProps: ITextareaDefProps;
readonly state: ITextareaState;
constructor(props: ITextareaDefProps & ITextareaState);
value: any;
onClick: TFuncClick;
onChange: TFuncChange;
onFocus: TFuncFocus;
onBlur: TFuncFocus;
onKeyDown: TFuncClick;
focus(): void;
blur(): void;
isActive(): boolean;
renderLabel(): JSX.Element;
renderErrors(): JSX.Element | null;
renderInput(): JSX.Element;
render(): JSX.Element;
}
export { Textarea, ITextareaProps, ITextareaState, TLabelPosition };