Skip to content

Commit f84d1d7

Browse files
committed
prod
1 parent 8954de6 commit f84d1d7

File tree

3 files changed

+40
-28
lines changed

3 files changed

+40
-28
lines changed

dist/react-bootstrap-table.js

+36-24
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ return /******/ (function(modules) { // webpackBootstrap
283283
return _this.__handleSelectRow__REACT_HOT_LOADER__.apply(_this, arguments);
284284
};
285285

286+
_this.handleEditCell = function () {
287+
return _this.__handleEditCell__REACT_HOT_LOADER__.apply(_this, arguments);
288+
};
289+
286290
_this.handleAddRow = function () {
287291
return _this.__handleAddRow__REACT_HOT_LOADER__.apply(_this, arguments);
288292
};
@@ -316,7 +320,6 @@ return /******/ (function(modules) { // webpackBootstrap
316320
};
317321

318322
_this.isIE = false;
319-
_this._attachCellEditFunc();
320323
if (_util2.default.canUseDOM()) {
321324
_this.isIE = document.documentMode;
322325
}
@@ -656,23 +659,10 @@ return /******/ (function(modules) { // webpackBootstrap
656659
key: 'componentDidUpdate',
657660
value: function componentDidUpdate() {
658661
this._adjustTable();
659-
this._attachCellEditFunc();
660662
if (this.props.options.afterTableComplete) {
661663
this.props.options.afterTableComplete();
662664
}
663665
}
664-
}, {
665-
key: '_attachCellEditFunc',
666-
value: function _attachCellEditFunc() {
667-
var cellEdit = this.props.cellEdit;
668-
669-
if (cellEdit) {
670-
this.props.cellEdit.__onCompleteEdit__ = this.handleEditCell.bind(this);
671-
if (cellEdit.mode !== _Const2.default.CELL_EDIT_NONE) {
672-
this.props.selectRow.clickToSelect = false;
673-
}
674-
}
675-
}
676666

677667
/**
678668
* Returns true if in the current configuration,
@@ -739,6 +729,10 @@ return /******/ (function(modules) { // webpackBootstrap
739729

740730
var showPaginationOnTop = paginationPosition !== _Const2.default.PAGINATION_POS_BOTTOM;
741731
var showPaginationOnBottom = paginationPosition !== _Const2.default.PAGINATION_POS_TOP;
732+
var selectRow = _extends({}, this.props.selectRow);
733+
if (this.props.cellEdit && this.props.cellEdit.mode !== _Const2.default.CELL_EDIT_NONE) {
734+
selectRow.clickToSelect = false;
735+
}
742736

743737
return _react2.default.createElement(
744738
'div',
@@ -791,12 +785,13 @@ return /******/ (function(modules) { // webpackBootstrap
791785
expandParentClass: this.props.options.expandParentClass,
792786
columns: columns,
793787
trClassName: this.props.trClassName,
788+
trStyle: this.props.trStyle,
794789
striped: this.props.striped,
795790
bordered: this.props.bordered,
796791
hover: this.props.hover,
797792
keyField: this.store.getKeyField(),
798793
condensed: this.props.condensed,
799-
selectRow: this.props.selectRow,
794+
selectRow: selectRow,
800795
expandColumnOptions: this.props.expandColumnOptions,
801796
cellEdit: this.props.cellEdit,
802797
selectedRowKeys: this.state.selectedRowKeys,
@@ -815,7 +810,8 @@ return /******/ (function(modules) { // webpackBootstrap
815810
onNavigateCell: this.handleNavigateCell,
816811
x: this.state.x,
817812
y: this.state.y,
818-
withoutTabIndex: this.props.withoutTabIndex })
813+
withoutTabIndex: this.props.withoutTabIndex,
814+
onEditCell: this.handleEditCell })
819815
),
820816
tableFilter,
821817
showPaginationOnBottom ? pagination : null
@@ -1206,8 +1202,8 @@ return /******/ (function(modules) { // webpackBootstrap
12061202
}
12071203
}
12081204
}, {
1209-
key: 'handleEditCell',
1210-
value: function handleEditCell(newVal, rowIndex, colIndex) {
1205+
key: '__handleEditCell__REACT_HOT_LOADER__',
1206+
value: function __handleEditCell__REACT_HOT_LOADER__(newVal, rowIndex, colIndex) {
12111207
var _this6 = this;
12121208

12131209
var beforeSaveCell = this.props.cellEdit.beforeSaveCell;
@@ -1951,6 +1947,7 @@ return /******/ (function(modules) { // webpackBootstrap
19511947
strictSearch: _react.PropTypes.bool,
19521948
columnFilter: _react.PropTypes.bool,
19531949
trClassName: _react.PropTypes.any,
1950+
trStyle: _react.PropTypes.any,
19541951
tableStyle: _react.PropTypes.object,
19551952
containerStyle: _react.PropTypes.object,
19561953
headerStyle: _react.PropTypes.object,
@@ -2109,6 +2106,7 @@ return /******/ (function(modules) { // webpackBootstrap
21092106
multiColumnSort: 1,
21102107
columnFilter: false,
21112108
trClassName: '',
2109+
trStyle: undefined,
21122110
tableStyle: undefined,
21132111
containerStyle: undefined,
21142112
headerStyle: undefined,
@@ -2921,7 +2919,8 @@ return /******/ (function(modules) { // webpackBootstrap
29212919
beforeShowError = _props.beforeShowError,
29222920
x = _props.x,
29232921
y = _props.y,
2924-
keyBoardNav = _props.keyBoardNav;
2922+
keyBoardNav = _props.keyBoardNav,
2923+
trStyle = _props.trStyle;
29252924

29262925
var tableClasses = (0, _classnames2.default)('table', {
29272926
'table-striped': this.props.striped,
@@ -3060,7 +3059,8 @@ return /******/ (function(modules) { // webpackBootstrap
30603059
onRowMouseOut: this.handleRowMouseOut,
30613060
onSelectRow: this.handleSelectRow,
30623061
onExpandRow: this.handleClickCell,
3063-
unselectableRow: disable },
3062+
unselectableRow: disable,
3063+
style: trStyle },
30643064
this.props.expandColumnOptions.expandColumnVisible && this.props.expandColumnOptions.expandColumnBeforeSelectColumn && expandedRowColumn,
30653065
selectRowColumn,
30663066
this.props.expandColumnOptions.expandColumnVisible && !this.props.expandColumnOptions.expandColumnBeforeSelectColumn && expandedRowColumn,
@@ -3091,7 +3091,7 @@ return /******/ (function(modules) { // webpackBootstrap
30913091
}).length + (isSelectRowDefined && !this.props.selectRow.hideSelectColumn ? 1 : 0) + (this.props.expandColumnOptions.expandColumnVisible ? 1 : 0);
30923092
tableRows = [_react2.default.createElement(
30933093
_TableRow2.default,
3094-
{ key: '##table-empty##' },
3094+
{ key: '##table-empty##', style: trStyle },
30953095
_react2.default.createElement(
30963096
'td',
30973097
{ 'data-toggle': 'collapse',
@@ -3333,7 +3333,7 @@ return /******/ (function(modules) { // webpackBootstrap
33333333
key: '__handleCompleteEditCell__REACT_HOT_LOADER__',
33343334
value: function __handleCompleteEditCell__REACT_HOT_LOADER__(newVal, rowIndex, columnIndex) {
33353335
if (newVal !== null) {
3336-
var result = this.props.cellEdit.__onCompleteEdit__(newVal, rowIndex, columnIndex);
3336+
var result = this.props.onEditCell(newVal, rowIndex, columnIndex);
33373337
if (result !== _Const2.default.AWAIT_BEFORE_CELL_EDIT) {
33383338
this.setState(function () {
33393339
return { currEditCell: null };
@@ -3773,7 +3773,9 @@ return /******/ (function(modules) { // webpackBootstrap
37733773
selectRow = _props2.selectRow,
37743774
row = _props2.row,
37753775
isSelected = _props2.isSelected,
3776-
className = _props2.className;
3776+
className = _props2.className,
3777+
index = _props2.index;
3778+
var style = this.props.style;
37773779

37783780
var backgroundColor = null;
37793781
var selectRowClass = null;
@@ -3784,8 +3786,17 @@ return /******/ (function(modules) { // webpackBootstrap
37843786
selectRowClass = _util2.default.isFunction(selectRow.className) ? selectRow.className(row, isSelected) : isSelected ? selectRow.className : null;
37853787
}
37863788

3789+
if (_util2.default.isFunction(style)) {
3790+
style = style(row, index);
3791+
} else {
3792+
style = _extends({}, style) || {};
3793+
}
3794+
// the bgcolor of row selection always overwrite the bgcolor defined by global.
3795+
if (style && backgroundColor && isSelected) {
3796+
style.backgroundColor = backgroundColor;
3797+
}
37873798
var trCss = {
3788-
style: { backgroundColor: backgroundColor },
3799+
style: _extends({}, style),
37893800
className: (0, _classnames2.default)(selectRowClass, className)
37903801
};
37913802

@@ -3807,6 +3818,7 @@ return /******/ (function(modules) { // webpackBootstrap
38073818
TableRow.propTypes = {
38083819
index: _react.PropTypes.number,
38093820
row: _react.PropTypes.any,
3821+
style: _react.PropTypes.any,
38103822
isSelected: _react.PropTypes.bool,
38113823
enableCellEdit: _react.PropTypes.bool,
38123824
onRowClick: _react.PropTypes.func,

dist/react-bootstrap-table.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)