forked from react-bootstrap/react-bootstrap-bower
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTable.js
37 lines (33 loc) · 1.02 KB
/
Table.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
define(function (require, exports, module) {var React = require('react');
var joinClasses = require('./utils/joinClasses');
var classSet = require('./utils/classSet');
var Table = React.createClass({displayName: 'Table',
propTypes: {
striped: React.PropTypes.bool,
bordered: React.PropTypes.bool,
condensed: React.PropTypes.bool,
hover: React.PropTypes.bool,
responsive: React.PropTypes.bool
},
render: function () {
var classes = {
'table': true,
'table-striped': this.props.striped,
'table-bordered': this.props.bordered,
'table-condensed': this.props.condensed,
'table-hover': this.props.hover
};
var table = (
React.createElement("table", React.__spread({}, this.props, {className: joinClasses(this.props.className, classSet(classes))}),
this.props.children
)
);
return this.props.responsive ? (
React.createElement("div", {className: "table-responsive"},
table
)
) : table;
}
});
module.exports = Table;
});