/**
 * Created by steve on 15/09/15.
 */
import React from 'react';
import ComposedComponent from './ComposedComponent';
import TextField from 'material-ui/TextField';

class Text extends React.Component {
    render() {
        //console.log('Text props', this.props);
        return (
            <div className={this.props.form.htmlClass}>
                <TextField
                    type={this.props.form.type}
                    floatingLabelText={this.props.form.title}
                    hintText={this.props.form.placeholder}
                    errorText={this.props.error || this.props.errorText}
                    onChange={this.props.onChangeValidate}
                    defaultValue={this.props.value}
                    disabled={this.props.form.readonly}
                    style={this.props.form.style || {width: '100%'}} />
            </div>
        );
    }
}

export default ComposedComponent(Text);

@@ -199,16 +199,205 @@
 onent %7B%0A
+%0A    constructor(props) %7B%0A        super(props);%0A%0A        const %7Bmodel, form, value%7D = this.props;%0A        const %7Bkey%7D = form;%0A%0A        this.props.setDefault(key, model, form, value)%0A    %7D%0A%0A
     rend

Handle <Text> initialization with defaults and model propagation