1
1
/* eslint no-alert: 0 */
2
2
/* eslint max-len: 0 */
3
3
import React , { Component , PropTypes } from 'react' ;
4
+ import classSet from 'classnames' ;
4
5
import Const from './Const' ;
5
6
import TableHeader from './TableHeader' ;
6
7
import TableBody from './TableBody' ;
@@ -258,13 +259,17 @@ class BootstrapTable extends Component {
258
259
let sortIndicator = this . props . options . sortIndicator ;
259
260
if ( typeof this . props . options . sortIndicator === 'undefined' ) sortIndicator = true ;
260
261
return (
261
- < div className = 'react-bs-table-container' style = { this . props . containerStyle } >
262
+ < div className = { classSet ( 'react-bs-table-container' , this . props . containerClass ) }
263
+ style = { this . props . containerStyle } >
262
264
{ toolBar }
263
- < div className = 'react-bs-table' ref = 'table' style = { { ...style , ...this . props . tableStyle } }
265
+ < div ref = 'table'
266
+ className = { classSet ( 'react-bs-table' , this . props . tableContainerClass ) }
267
+ style = { { ...style , ...this . props . tableStyle } }
264
268
onMouseEnter = { this . handleMouseEnter }
265
269
onMouseLeave = { this . handleMouseLeave } >
266
270
< TableHeader
267
271
ref = 'header'
272
+ headerContainerClass = { this . props . headerContainerClass }
268
273
tableHeaderClass = { this . props . tableHeaderClass }
269
274
style = { this . props . headerStyle }
270
275
rowSelectType = { this . props . selectRow . mode }
@@ -282,6 +287,7 @@ class BootstrapTable extends Component {
282
287
{ this . props . children }
283
288
</ TableHeader >
284
289
< TableBody ref = 'body'
290
+ bodyContainerClass = { this . props . bodyContainerClass }
285
291
tableBodyClass = { this . props . tableBodyClass }
286
292
style = { { ...style , ...this . props . bodyStyle } }
287
293
data = { this . state . data }
@@ -982,6 +988,10 @@ BootstrapTable.propTypes = {
982
988
containerStyle : PropTypes . object ,
983
989
headerStyle : PropTypes . object ,
984
990
bodyStyle : PropTypes . object ,
991
+ containerClass : PropTypes . string ,
992
+ tableContainerClass : PropTypes . string ,
993
+ headerContainerClass : PropTypes . string ,
994
+ bodyContainerClass : PropTypes . string ,
985
995
tableHeaderClass : PropTypes . string ,
986
996
tableBodyClass : PropTypes . string ,
987
997
options : PropTypes . shape ( {
@@ -1072,6 +1082,10 @@ BootstrapTable.defaultProps = {
1072
1082
containerStyle : undefined ,
1073
1083
headerStyle : undefined ,
1074
1084
bodyStyle : undefined ,
1085
+ containerClass : null ,
1086
+ tableContainerClass : null ,
1087
+ headerContainerClass : null ,
1088
+ bodyContainerClass : null ,
1075
1089
tableHeaderClass : null ,
1076
1090
tableBodyClass : null ,
1077
1091
options : {
0 commit comments