1 | import _extends from 'babel-runtime/helpers/extends';
|
2 | import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
3 | import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
4 | import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
5 | import _inherits from 'babel-runtime/helpers/inherits';
|
6 | import classNames from 'classnames';
|
7 | import React from 'react';
|
8 | import PropTypes from 'prop-types';
|
9 | import elementType from 'prop-types-extra/lib/elementType';
|
10 |
|
11 | import { bsClass, prefix, splitBsProps } from './utils/bootstrapUtils';
|
12 |
|
13 | var propTypes = {
|
14 | |
15 |
|
16 |
|
17 |
|
18 |
|
19 | fluid: PropTypes.bool,
|
20 | |
21 |
|
22 |
|
23 | componentClass: elementType
|
24 | };
|
25 |
|
26 | var defaultProps = {
|
27 | componentClass: 'div',
|
28 | fluid: false
|
29 | };
|
30 |
|
31 | var Grid = function (_React$Component) {
|
32 | _inherits(Grid, _React$Component);
|
33 |
|
34 | function Grid() {
|
35 | _classCallCheck(this, Grid);
|
36 |
|
37 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
38 | }
|
39 |
|
40 | Grid.prototype.render = function render() {
|
41 | var _props = this.props,
|
42 | fluid = _props.fluid,
|
43 | Component = _props.componentClass,
|
44 | className = _props.className,
|
45 | props = _objectWithoutProperties(_props, ['fluid', 'componentClass', 'className']);
|
46 |
|
47 | var _splitBsProps = splitBsProps(props),
|
48 | bsProps = _splitBsProps[0],
|
49 | elementProps = _splitBsProps[1];
|
50 |
|
51 | var classes = prefix(bsProps, fluid && 'fluid');
|
52 |
|
53 | return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
|
54 | };
|
55 |
|
56 | return Grid;
|
57 | }(React.Component);
|
58 |
|
59 | Grid.propTypes = propTypes;
|
60 | Grid.defaultProps = defaultProps;
|
61 |
|
62 | export default bsClass('container', Grid); |
\ | No newline at end of file |