import * as React from 'react';
import AbstractInput from '../AbstractInput/AbstractInput';
import AbstractInputCore from '../AbstractInputCore/AbstractInputCore';
import InputBox from '../InputBox/InputBox';
import ValidationState from '../../enums/ValidationState';
export { ValidationState };
class AbstractTextInput extends React.Component {
    constructor() {
        super(...arguments);
        this._renderInput = ({ focused, labelMode, validationMessage, validationState, onFocus, onBlur, }) => {
            return (<InputBox focused={focused} labelMode={labelMode} validationMessage={validationMessage} validationState={validationState}>
        {this.props.prefix}
        <AbstractInputCore type={this.props.type} name={this.props.name} value={this.props.value} placeholder={this.props.placeholder} validationMessage={validationMessage} validationState={validationState} onChange={this.props.onChange} onFocus={onFocus} onBlur={onBlur}/>
        {this.props.suffix}
      </InputBox>);
        };
    }
    render() {
        return (<AbstractInput formGroupComponent="label" inputContainerStyle={this.props.inputContainerStyle} label={this.props.label} labelMode={this.props.labelMode} labelStyle={this.props.labelStyle} required={this.props.required} validationMessage={this.props.validationMessage} validationState={this.props.validationState || ValidationState.Hidden} renderInput={this._renderInput} onFocus={this.props.onFocus} onBlur={this.props.onBlur}/>);
    }
}
export default AbstractTextInput;
