UNPKG

1.57 kBJavaScriptView Raw
1import _extends from 'babel-runtime/helpers/extends';
2import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
3import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
4import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
5import _inherits from 'babel-runtime/helpers/inherits';
6import classNames from 'classnames';
7import React from 'react';
8
9import InputGroupAddon from './InputGroupAddon';
10import InputGroupButton from './InputGroupButton';
11import { bsClass, bsSizes, getClassSet, splitBsProps } from './utils/bootstrapUtils';
12import { Size } from './utils/StyleConfig';
13
14var InputGroup = function (_React$Component) {
15 _inherits(InputGroup, _React$Component);
16
17 function InputGroup() {
18 _classCallCheck(this, InputGroup);
19
20 return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
21 }
22
23 InputGroup.prototype.render = function render() {
24 var _props = this.props,
25 className = _props.className,
26 props = _objectWithoutProperties(_props, ['className']);
27
28 var _splitBsProps = splitBsProps(props),
29 bsProps = _splitBsProps[0],
30 elementProps = _splitBsProps[1];
31
32 var classes = getClassSet(bsProps);
33
34 return React.createElement('span', _extends({}, elementProps, { className: classNames(className, classes) }));
35 };
36
37 return InputGroup;
38}(React.Component);
39
40InputGroup.Addon = InputGroupAddon;
41InputGroup.Button = InputGroupButton;
42
43export default bsClass('input-group', bsSizes([Size.LARGE, Size.SMALL], InputGroup));
\No newline at end of file