react-bootstrap-table-next
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -64,20 +64,21 @@ 'use strict'; | ||
if (mode === ROW_SELECT_SINGLE) { | ||
// when select mode is radio | ||
currSelected = [rowKey]; | ||
} else if (checked) { | ||
// when select mode is checkbox | ||
currSelected.push(rowKey); | ||
} else { | ||
currSelected = currSelected.filter(function (value) { | ||
return value !== rowKey; | ||
}); | ||
} | ||
if (onSelect) { | ||
var row = _operators2.default.getRowByRowId(data, keyField, rowKey); | ||
onSelect(row, checked, rowIndex, e); | ||
} | ||
_this.setState(function () { | ||
var result = true; | ||
if (onSelect) { | ||
var row = _operators2.default.getRowByRowId(data, keyField, rowKey); | ||
result = onSelect(row, checked, rowIndex, e); | ||
} | ||
if (result === true || result === undefined) { | ||
if (mode === ROW_SELECT_SINGLE) { | ||
// when select mode is radio | ||
currSelected = [rowKey]; | ||
} else if (checked) { | ||
// when select mode is checkbox | ||
currSelected.push(rowKey); | ||
} else { | ||
currSelected = currSelected.filter(function (value) { | ||
return value !== rowKey; | ||
}); | ||
} | ||
} | ||
return { selected: currSelected }; | ||
@@ -109,7 +110,10 @@ }); | ||
if (onSelectAll) { | ||
onSelectAll(!isUnSelect, _operators2.default.getSelectedRows(data, keyField, isUnSelect ? _this.state.selected : currSelected), e); | ||
} | ||
_this.setState(function () { | ||
var result = void 0; | ||
if (onSelectAll) { | ||
result = onSelectAll(!isUnSelect, _operators2.default.getSelectedRows(data, keyField, isUnSelect ? _this.state.selected : currSelected), e); | ||
if (Array.isArray(result)) { | ||
currSelected = result; | ||
} | ||
} | ||
return { selected: currSelected }; | ||
@@ -116,0 +120,0 @@ }); |
{ | ||
"name": "react-bootstrap-table-next", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "Next generation of react-bootstrap-table", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
801833
9405