@@ -50,9 +50,11 @@ var TableBody = function (_React$Component) {
5050 toggleSort = _props . toggleSort ,
5151 sortedOrientation = _props . sortedOrientation ,
5252 sortedIdx = _props . sortedIdx ,
53- rowSelect = _props . rowSelect ,
5453 contentWidth = _props . contentWidth ,
55- contentHeight = _props . contentHeight ;
54+ contentHeight = _props . contentHeight ,
55+ noTableHeader = _props . noTableHeader ,
56+ rowHeight = _props . rowHeight ,
57+ headerHeight = _props . headerHeight ;
5658
5759
5860 var indexOffset = ( currentPage - 1 ) * pageSize ;
@@ -69,16 +71,16 @@ var TableBody = function (_React$Component) {
6971 return _react2 . default . createElement (
7072 _fixedDataTable . Table ,
7173 {
72- rowHeight : 50 ,
73- headerHeight : 50 ,
74+ rowHeight : rowHeight ,
75+ headerHeight : noTableHeader ? 0 : headerHeight ,
7476 rowsCount : activeData . length ,
7577 width : contentWidth ,
7678 height : contentHeight ,
7779 onRowClick : function onRowClick ( event , rowIndex ) {
78- if ( selectable && rowSelect ) {
79- onCheck ( rowIndex + indexOffset ) ;
80+ if ( event . target . tagName !== 'INPUT' ) {
81+ // e.stopPropagation on cell doesn't work. This will be invoked first.
82+ _onRowClick ( activeData [ rowIndex ] ) ;
8083 }
81- _onRowClick ( activeData [ rowIndex ] ) ;
8284 } ,
8385 rowClassNameGetter : function rowClassNameGetter ( idx ) {
8486 return ( 0 , _classnames2 . default ) ( {
@@ -91,7 +93,7 @@ var TableBody = function (_React$Component) {
9193 } ,
9294 selectable && _react2 . default . createElement ( _fixedDataTable . Column , {
9395 columnKey : 'select' ,
94- header : _react2 . default . createElement (
96+ header : noTableHeader ? undefined : _react2 . default . createElement (
9597 _fixedDataTable . Cell ,
9698 null ,
9799 allCheckbox
@@ -104,9 +106,8 @@ var TableBody = function (_React$Component) {
104106 type : 'checkbox' ,
105107 checked : activeData [ props . rowIndex ] . checked ,
106108 onChange : function onChange ( e ) {
107- if ( ! rowSelect ) {
108- onCheck ( props . rowIndex + indexOffset ) ;
109- }
109+ e . stopPropagation ( ) ;
110+ onCheck ( props . rowIndex + indexOffset ) ;
110111 }
111112 } )
112113 ) ;
@@ -118,7 +119,7 @@ var TableBody = function (_React$Component) {
118119 key : i
119120 } , item , {
120121 columnKey : item . columnKey || item . name ,
121- header : _react2 . default . createElement (
122+ header : noTableHeader ? undefined : _react2 . default . createElement (
122123 _fixedDataTable . Cell ,
123124 {
124125 className : ( 0 , _classnames2 . default ) ( {
@@ -145,7 +146,7 @@ var TableBody = function (_React$Component) {
145146 item . display ( activeData [ props . rowIndex ] )
146147 ) ;
147148 } ,
148- flexGrow : item . flexGrow || 1 ,
149+ flexGrow : typeof item . flexGrow !== 'undefined' || 1 ,
149150 width : item . width || 20
150151 } ) ) ;
151152 } )
@@ -168,9 +169,10 @@ TableBody.propTypes = {
168169 toggleSort : _react2 . default . PropTypes . func ,
169170 sortedOrientation : _react2 . default . PropTypes . string ,
170171 sortedIdx : _react2 . default . PropTypes . number ,
171- rowSelect : _react2 . default . PropTypes . bool ,
172172 contentWidth : _react2 . default . PropTypes . number ,
173- contentHeight : _react2 . default . PropTypes . number
173+ contentHeight : _react2 . default . PropTypes . number ,
174+ rowHeight : _react2 . default . PropTypes . number ,
175+ headerHeight : _react2 . default . PropTypes . number
174176} ;
175177
176178TableBody . defaultProps = {
@@ -180,7 +182,6 @@ TableBody.defaultProps = {
180182 toggleSort : function toggleSort ( f ) {
181183 return f ;
182184 } ,
183- rowSelect : false ,
184185 contentWidth : 100 ,
185186 contentHeight : 300
186187} ;
0 commit comments