Skip to content

Commit 1f212ca

Browse files
committed
fix conflicts
2 parents c083924 + e00f585 commit 1f212ca

File tree

14 files changed

+120
-21
lines changed

14 files changed

+120
-21
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ node_modules
66
*.idea
77
*.iml
88
lib/
9-
npm-debug.log
9+
npm-debug.log

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
<a name="v2.6.0"></a>
2+
# [v2.6.0](https://github.com/AllenFang/react-bootstrap-table/compare/v2.5.9...v2.6.0) (2016-11-28)
3+
## Bug fixes
4+
* Fixed [#838](https://github.com/AllenFang/react-bootstrap-table/issues/838)
5+
6+
## Features
7+
* Support expandable row([00d1756](https://github.com/AllenFang/react-bootstrap-table/commit/00d17562eebf4cfba78c0ec0c762e7c032f20239))
8+
* Check [example](https://github.com/AllenFang/react-bootstrap-table/blob/master/examples/js/expandRow/expandRow.js)
9+
10+
## Enhancement
11+
* Support row lock level on cell edit([7c57b52](https://github.com/AllenFang/react-bootstrap-table/commit/7c57b52b06b2455d025f0810a38da4ad0ea6f58c))
12+
* Use ```nonEditableRows``` in ```cellEdit``` props
13+
* ```nonEditableRows``` accept a callback function which return an array of rowKey which is noneditable rows
14+
115
<a name="v2.5.9"></a>
216
# [v2.5.9](https://github.com/AllenFang/react-bootstrap-table/compare/v2.5.8...v2.5.9) (2016-11-21)
317
## Bug fixes

dist/react-bootstrap-table.js

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ return /******/ (function(modules) { // webpackBootstrap
347347
return _this.__handleSearch__REACT_HOT_LOADER__.apply(_this, arguments);
348348
};
349349

350+
_this._scrollTop = function () {
351+
return _this.___scrollTop__REACT_HOT_LOADER__.apply(_this, arguments);
352+
};
353+
350354
_this._scrollHeader = function () {
351355
return _this.___scrollHeader__REACT_HOT_LOADER__.apply(_this, arguments);
352356
};
@@ -568,6 +572,9 @@ return /******/ (function(modules) { // webpackBootstrap
568572
this._adjustTable();
569573
window.addEventListener('resize', this._adjustTable);
570574
this.refs.body.refs.container.addEventListener('scroll', this._scrollHeader);
575+
if (this.props.scrollTop) {
576+
this._scrollTop();
577+
}
571578
}
572579
}, {
573580
key: 'componentWillUnmount',
@@ -1177,6 +1184,11 @@ return /******/ (function(modules) { // webpackBootstrap
11771184
}, {
11781185
key: '__handleSearch__REACT_HOT_LOADER__',
11791186
value: function __handleSearch__REACT_HOT_LOADER__(searchText) {
1187+
// Set search field if this function being called outside
1188+
// but it's not necessary if calling fron inside.
1189+
if (this.refs.toolbar) {
1190+
this.refs.toolbar.setSearchInput(searchText);
1191+
}
11801192
var onSearchChange = this.props.options.onSearchChange;
11811193

11821194
if (onSearchChange) {
@@ -1310,6 +1322,7 @@ return /******/ (function(modules) { // webpackBootstrap
13101322
'div',
13111323
{ className: 'react-bs-table-tool-bar' },
13121324
_react2.default.createElement(_ToolBar2.default, {
1325+
ref: 'toolbar',
13131326
defaultSearch: this.props.options.defaultSearch,
13141327
clearSearch: this.props.options.clearSearch,
13151328
searchPosition: this.props.options.searchPosition,
@@ -1361,6 +1374,19 @@ return /******/ (function(modules) { // webpackBootstrap
13611374
return null;
13621375
}
13631376
}
1377+
}, {
1378+
key: '___scrollTop__REACT_HOT_LOADER__',
1379+
value: function ___scrollTop__REACT_HOT_LOADER__() {
1380+
var scrollTop = this.props.scrollTop;
1381+
1382+
if (scrollTop === _Const2.default.SCROLL_TOP) {
1383+
this.refs.body.refs.container.scrollTop = 0;
1384+
} else if (scrollTop === _Const2.default.SCROLL_BOTTOM) {
1385+
this.refs.body.refs.container.scrollTop = this.refs.body.refs.container.scrollHeight;
1386+
} else if (typeof scrollTop === 'number' && !isNaN(scrollTop)) {
1387+
this.refs.body.refs.container.scrollTop = scrollTop;
1388+
}
1389+
}
13641390
}, {
13651391
key: '___scrollHeader__REACT_HOT_LOADER__',
13661392
value: function ___scrollHeader__REACT_HOT_LOADER__(e) {
@@ -1387,7 +1413,7 @@ return /******/ (function(modules) { // webpackBootstrap
13871413
var cells = firstRow.childNodes;
13881414
for (var i = 0; i < cells.length; i++) {
13891415
var cell = cells[i];
1390-
var computedStyle = getComputedStyle(cell);
1416+
var computedStyle = window.getComputedStyle(cell);
13911417
var width = parseFloat(computedStyle.width.replace('px', ''));
13921418
if (this.isIE) {
13931419
var paddingLeftWidth = parseFloat(computedStyle.paddingLeft.replace('px', ''));
@@ -1477,6 +1503,7 @@ return /******/ (function(modules) { // webpackBootstrap
14771503
maxHeight: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
14781504
data: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.object]),
14791505
remote: _react.PropTypes.bool, // remote data, default is false
1506+
scrollTop: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
14801507
striped: _react.PropTypes.bool,
14811508
bordered: _react.PropTypes.bool,
14821509
hover: _react.PropTypes.bool,
@@ -1596,6 +1623,7 @@ return /******/ (function(modules) { // webpackBootstrap
15961623
expandComponent: _react.PropTypes.func
15971624
};
15981625
BootstrapTable.defaultProps = {
1626+
scrollTop: undefined,
15991627
expandComponent: undefined,
16001628
expandableRow: undefined,
16011629
height: '100%',
@@ -1834,6 +1862,8 @@ return /******/ (function(modules) { // webpackBootstrap
18341862
SAVE_BTN_TEXT: 'Save',
18351863
CLOSE_BTN_TEXT: 'Close',
18361864
FILTER_DELAY: 500,
1865+
SCROLL_TOP: 'Top',
1866+
SCROLL_BOTTOM: 'Bottom',
18371867
FILTER_TYPE: {
18381868
TEXT: 'TextFilter',
18391869
REGEX: 'RegexFilter',
@@ -5590,16 +5620,16 @@ return /******/ (function(modules) { // webpackBootstrap
55905620
/* 77 */
55915621
/***/ function(module, exports) {
55925622

5593-
module.exports = function(module) {
5594-
if(!module.webpackPolyfill) {
5595-
module.deprecate = function() {};
5596-
module.paths = [];
5597-
// module.parent = undefined by default
5598-
module.children = [];
5599-
module.webpackPolyfill = 1;
5600-
}
5601-
return module;
5602-
}
5623+
module.exports = function(module) {
5624+
if(!module.webpackPolyfill) {
5625+
module.deprecate = function() {};
5626+
module.paths = [];
5627+
// module.parent = undefined by default
5628+
module.children = [];
5629+
module.webpackPolyfill = 1;
5630+
}
5631+
return module;
5632+
}
56035633

56045634

56055635
/***/ },
@@ -10489,6 +10519,13 @@ return /******/ (function(modules) { // webpackBootstrap
1048910519
value: function componentWillUnmount() {
1049010520
this.clearTimeout();
1049110521
}
10522+
}, {
10523+
key: 'setSearchInput',
10524+
value: function setSearchInput(text) {
10525+
if (this.refs.seachInput.value !== text) {
10526+
this.refs.seachInput.value = text;
10527+
}
10528+
}
1049210529
}, {
1049310530
key: 'clearTimeout',
1049410531
value: function (_clearTimeout) {
@@ -13598,7 +13635,7 @@ return /******/ (function(modules) { // webpackBootstrap
1359813635
>>>>>>> master
1359913636
/***/ function(module, exports) {
1360013637

13601-
module.exports = function() { throw new Error("define cannot be used indirect"); };
13638+
module.exports = function() { throw new Error("define cannot be used indirect"); };
1360213639

1360313640

1360413641
/***/ },
@@ -13609,7 +13646,7 @@ return /******/ (function(modules) { // webpackBootstrap
1360913646
>>>>>>> master
1361013647
/***/ function(module, exports) {
1361113648

13612-
/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__;
13649+
/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__;
1361313650

1361413651
/* WEBPACK VAR INJECTION */}.call(exports, {}))
1361513652

dist/react-bootstrap-table.js.map

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-bootstrap-table.min.js

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<title>react-bootstrap-table demo</title>
6-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
6+
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
77
<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
88
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.js"></script>
99
</head>

examples/js/basic/demo.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ class Demo extends React.Component {
4747
</Panel>
4848
<Panel header={ 'Table Scroll Example' }>
4949
{ renderLinks('basic/scroll-table') }
50+
<span style={ { color: 'red' } }>
51+
You can use <code>scrollTop</code> to set the table content scroll, available value is <code>Top</code>, <code>Bottom</code> and a numeric value
52+
</span>
5053
<ScrollTable/>
5154
</Panel>
5255
</Col>

examples/js/basic/scroll-table.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ function addProducts(quantity) {
1717
}
1818
}
1919

20-
addProducts(5);
20+
addProducts(20);
2121

2222
export default class BasicTable extends React.Component {
2323
render() {
2424
return (
25-
<BootstrapTable data={ products } height='120'>
25+
<BootstrapTable data={ products } height='150' scrollTop={ 'Bottom' }>
2626
<TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn>
2727
<TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
2828
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>

examples/js/remote/remote-paging.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export default class RemotePaging extends React.Component {
1313
options={ { sizePerPage: this.props.sizePerPage,
1414
onPageChange: this.props.onPageChange,
1515
sizePerPageList: [ 5, 10 ],
16-
pageStartIndex: 0,
1716
page: this.props.currentPage,
1817
onSizePerPageList: this.props.onSizePerPageList } }>
1918
<TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"dependencies": {
6969
"classnames": "^2.1.2",
7070
"react-modal": "^1.4.0",
71-
"react-toastr": "git+https://github.com/AllenFang/react-toastr.git"
71+
"@allenfang/react-toastr": "2.8.2"
7272
},
7373
"peerDependencies": {
7474
"react": "^0.14.3 || ^15.0.0"

0 commit comments

Comments
 (0)