UNPKG

1.4 kBJavaScriptView Raw
1import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
2import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
3import _inherits from 'babel-runtime/helpers/inherits';
4
5var _class, _temp;
6
7import React, { Component } from 'react';
8import PropTypes from 'prop-types';
9
10/* eslint-disable react/prefer-stateless-function */
11var Wrapper = (_temp = _class = function (_Component) {
12 _inherits(Wrapper, _Component);
13
14 function Wrapper() {
15 _classCallCheck(this, Wrapper);
16
17 return _possibleConstructorReturn(this, _Component.apply(this, arguments));
18 }
19
20 Wrapper.prototype.render = function render() {
21 var _props = this.props,
22 colGroup = _props.colGroup,
23 children = _props.children,
24 tableWidth = _props.tableWidth,
25 Tag = _props.component;
26
27 return React.createElement(
28 Tag,
29 { role: 'table', style: { width: tableWidth } },
30 colGroup,
31 children
32 );
33 };
34
35 return Wrapper;
36}(Component), _class.propTypes = {
37 tableWidth: PropTypes.number
38}, _temp);
39Wrapper.displayName = 'Wrapper';
40export { Wrapper as default };
41
42
43Wrapper.defaultProps = {
44 component: 'table'
45};
46
47Wrapper.propTypes = {
48 children: PropTypes.any,
49 prefix: PropTypes.string,
50 colGroup: PropTypes.any,
51 component: PropTypes.string
52};
\No newline at end of file