ssc-refer
Version:
React refer component for SSC 3.0
45 lines (38 loc) • 1.2 kB
JavaScript
;
import _extends from 'babel-runtime/helpers/extends';
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import cx from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
var TextInput = React.createClass({
displayName: 'TextInput',
propTypes: {
/**
* Specify the size of the input.
*/
bsSize: PropTypes.oneOf(['large', 'lg', 'small', 'sm'])
},
render: function render() {
var _this = this;
var _props = this.props,
bsSize = _props.bsSize,
className = _props.className,
hasAux = _props.hasAux,
otherProps = _objectWithoutProperties(_props, ['bsSize', 'className', 'hasAux']);
return React.createElement('input', _extends({}, otherProps, {
className: cx('form-control', {
'has-aux': hasAux,
'input-lg': bsSize === 'large' || bsSize === 'lg',
'input-sm': bsSize === 'small' || bsSize === 'sm'
}, className),
ref: function ref(input) {
return _this._input = input;
},
type: 'text'
}));
},
getInstance: function getInstance() {
return this._input;
}
});
export default TextInput;