@massds/mayflower-react
Version:
React versions of Mayflower design system UI components
44 lines (43 loc) • 1.54 kB
TypeScript
/**
* InputText module.
* @module @massds/mayflower-react/InputText
* @requires module:@massds/mayflower-assets/scss/01-atoms/error-msg
* @requires module:@massds/mayflower-assets/scss/01-atoms/svg-icons
* @requires module:@massds/mayflower-assets/scss/01-atoms/svg-loc-icons
*/
import React from 'react';
export interface InputTextProps {
/** Whether the label should be hidden or not */
hiddenLabel?: boolean;
/** The label text for the input field */
labelText: string;
/** Whether the field is required or not */
required?: boolean;
/** The unique ID for the input field */
id: string;
/** The name for the input field */
name: string;
/** The type of the input field */
type: string;
/** The max acceptable input length */
maxlength?: number;
/** The pattern to filter input against, e.g. "[0-9]" for numbers only */
pattern?: string;
/** The number of characters wide to make the input field */
width?: number;
/** The placeholder text for the input field */
placeholder?: string;
/** The message to be displayed in the event of an error */
errorMsg?: string;
/** Custom change function */
onChange?(...args: unknown[]): unknown;
/** Default input text value */
defaultText?: string;
}
declare class InputText extends React.Component<InputTextProps> {
constructor(props: any);
UNSAFE_componentWillReceiveProps(nextProps: any): void;
handleChange(event: any): void;
render(): any;
}
export default InputText;