import React from 'react'; function prefixClsFn(prefixCls, ...args) { return args.map((s)=> { return prefixCls + '-' + s; }).join(' '); } class Group extends React.Component { render() { return (
{this.props.children}
); } } Group.propTypes = { className: React.PropTypes.string, children: React.PropTypes.any, }; Group.defaultProps = { className: 'ant-input-group', }; class Input extends React.Component { getInputDOMNode() { return this.refs.input; } getValue() { if (this.props.type === 'static') { return this.props.value; } else if (this.props.type) { return this.getInputDOMNode().value; } throw new Error('Cannot use getValue without specifying input type.'); } renderLabledInput(children) { const props = this.props; const wrapperClassName = prefixClsFn(props.prefixCls, 'input-group'); const addonClassName = prefixClsFn(wrapperClassName, 'addon'); const addonBefore = props.addonBefore ? ( {props.addonBefore} ) : null; const addonAfter = props.addonAfter ? ( {props.addonAfter} ) : null; return addonBefore || addonAfter ? (
{addonBefore} {children} {addonAfter}
) : children; } renderInput() { const props = this.props; const prefixCls = props.prefixCls; let inputClassName = prefixClsFn(prefixCls, 'input'); if (!props.type) { return props.children; } switch (props.size) { case 'small': inputClassName = prefixClsFn(prefixCls, 'input', 'input-sm'); break; case 'large': inputClassName = prefixClsFn(prefixCls, 'input', 'input-lg'); break; default: } switch (props.type) { case 'textarea': return