Skip to content

Commit feebb4c

Browse files
committed
prod
1 parent 2a2e8f6 commit feebb4c

File tree

3 files changed

+90
-54
lines changed

3 files changed

+90
-54
lines changed

dist/react-bootstrap-table.js

Lines changed: 84 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,7 @@ return /******/ (function(modules) { // webpackBootstrap
18751875
ref: function ref(node) {
18761876
return _this12.pagination = node;
18771877
},
1878+
version: this.props.version,
18781879
withFirstAndLast: withFirstAndLast,
18791880
alwaysShowAllBtns: options.alwaysShowAllBtns,
18801881
currPage: this.state.currPage,
@@ -5059,7 +5060,7 @@ return /******/ (function(modules) { // webpackBootstrap
50595060
var filter = currentFilter[nextProps.dataField];
50605061
var value = filter ? filter.value : '';
50615062

5062-
var _ref = this.getFilters() || {},
5063+
var _ref = this.getFilters(nextProps) || {},
50635064
ref = _ref.ref;
50645065

50655066
if (this.refs[ref]) {
@@ -5088,49 +5089,49 @@ return /******/ (function(modules) { // webpackBootstrap
50885089
value: function getFilters() {
50895090
var _this2 = this;
50905091

5091-
var _props = this.props,
5092-
headerText = _props.headerText,
5093-
children = _props.children;
5092+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;
5093+
var headerText = props.headerText,
5094+
children = props.children;
50945095

5095-
switch (this.props.filter.type) {
5096+
switch (props.filter.type) {
50965097
case _Const2.default.FILTER_TYPE.TEXT:
50975098
{
50985099
return _react2.default.createElement(_Text2.default, _extends({ ref: function ref(n) {
50995100
return _this2.textFilter = n;
5100-
} }, this.props.filter, {
5101+
} }, props.filter, {
51015102
columnName: headerText || children, filterHandler: this.handleFilter }));
51025103
}
51035104
case _Const2.default.FILTER_TYPE.REGEX:
51045105
{
51055106
return _react2.default.createElement(_Regex2.default, _extends({ ref: function ref(n) {
51065107
return _this2.regexFilter = n;
5107-
} }, this.props.filter, {
5108+
} }, props.filter, {
51085109
columnName: headerText || children, filterHandler: this.handleFilter }));
51095110
}
51105111
case _Const2.default.FILTER_TYPE.SELECT:
51115112
{
51125113
return _react2.default.createElement(_Select2.default, _extends({ ref: function ref(n) {
51135114
return _this2.selectFilter = n;
5114-
} }, this.props.filter, {
5115+
} }, props.filter, {
51155116
columnName: headerText || children, filterHandler: this.handleFilter }));
51165117
}
51175118
case _Const2.default.FILTER_TYPE.NUMBER:
51185119
{
51195120
return _react2.default.createElement(_Number2.default, _extends({ ref: function ref(n) {
51205121
return _this2.numberFilter = n;
5121-
} }, this.props.filter, {
5122+
} }, props.filter, {
51225123
columnName: headerText || children, filterHandler: this.handleFilter }));
51235124
}
51245125
case _Const2.default.FILTER_TYPE.DATE:
51255126
{
51265127
return _react2.default.createElement(_Date2.default, _extends({ ref: function ref(n) {
51275128
return _this2.dateFilter = n;
5128-
} }, this.props.filter, {
5129+
} }, props.filter, {
51295130
columnName: headerText || children, filterHandler: this.handleFilter }));
51305131
}
51315132
case _Const2.default.FILTER_TYPE.CUSTOM:
51325133
{
5133-
var elm = this.props.filter.getElement(this.handleFilter, this.props.filter.customFilterParameters);
5134+
var elm = props.filter.getElement(this.handleFilter, props.filter.customFilterParameters);
51345135

51355136
return _react2.default.cloneElement(elm, { ref: function ref(n) {
51365137
return _this2.customFilter = n;
@@ -5175,23 +5176,23 @@ return /******/ (function(modules) { // webpackBootstrap
51755176
var defaultCaret = void 0;
51765177
var sortCaret = void 0;
51775178
var sortClass = void 0;
5178-
var _props2 = this.props,
5179-
headerText = _props2.headerText,
5180-
dataAlign = _props2.dataAlign,
5181-
dataField = _props2.dataField,
5182-
headerAlign = _props2.headerAlign,
5183-
headerTitle = _props2.headerTitle,
5184-
hidden = _props2.hidden,
5185-
sort = _props2.sort,
5186-
dataSort = _props2.dataSort,
5187-
sortIndicator = _props2.sortIndicator,
5188-
children = _props2.children,
5189-
caretRender = _props2.caretRender,
5190-
className = _props2.className,
5191-
isOnlyHead = _props2.isOnlyHead,
5192-
version = _props2.version,
5193-
customSortClass = _props2.sortHeaderColumnClassName,
5194-
style = _props2.thStyle;
5179+
var _props = this.props,
5180+
headerText = _props.headerText,
5181+
dataAlign = _props.dataAlign,
5182+
dataField = _props.dataField,
5183+
headerAlign = _props.headerAlign,
5184+
headerTitle = _props.headerTitle,
5185+
hidden = _props.hidden,
5186+
sort = _props.sort,
5187+
dataSort = _props.dataSort,
5188+
sortIndicator = _props.sortIndicator,
5189+
children = _props.children,
5190+
caretRender = _props.caretRender,
5191+
className = _props.className,
5192+
isOnlyHead = _props.isOnlyHead,
5193+
version = _props.version,
5194+
customSortClass = _props.sortHeaderColumnClassName,
5195+
style = _props.thStyle;
51955196

51965197
var thStyle = _extends({
51975198
textAlign: headerAlign || dataAlign,
@@ -9614,33 +9615,51 @@ return /******/ (function(modules) { // webpackBootstrap
96149615
}
96159616

96169617
if (dropdownProps || !dropdown) {
9618+
var isBootstrap4 = _util2.default.isBootstrap4(this.props.version);
96179619
var sizePerPageOptions = sizePerPageList.map(function (_sizePerPage) {
96189620
var pageText = _sizePerPage.text || _sizePerPage;
96199621
var pageNum = _sizePerPage.value || _sizePerPage;
96209622
if (sizePerPage === pageNum) sizePerPageText = pageText;
9621-
return _react2.default.createElement(
9622-
'li',
9623-
{ key: pageText, role: 'presentation', className: 'dropdown-item' },
9624-
_react2.default.createElement(
9623+
if (isBootstrap4) {
9624+
return _react2.default.createElement(
96259625
'a',
9626-
{ role: 'menuitem',
9627-
tabIndex: '-1', href: '#',
9628-
'data-page': pageNum,
9626+
{
9627+
href: '#',
9628+
tabIndex: '-1',
9629+
key: pageText,
9630+
className: 'dropdown-item',
96299631
onMouseDown: function onMouseDown(e) {
96309632
e.preventDefault();
96319633
_this3.changeSizePerPage(pageNum);
96329634
} },
96339635
pageText
9634-
)
9635-
);
9636+
);
9637+
} else {
9638+
return _react2.default.createElement(
9639+
'li',
9640+
{ key: pageText, role: 'presentation', className: 'dropdown-item' },
9641+
_react2.default.createElement(
9642+
'a',
9643+
{ role: 'menuitem',
9644+
tabIndex: '-1', href: '#',
9645+
'data-page': pageNum,
9646+
onMouseDown: function onMouseDown(e) {
9647+
e.preventDefault();
9648+
_this3.changeSizePerPage(pageNum);
9649+
} },
9650+
pageText
9651+
)
9652+
);
9653+
}
96369654
});
96379655
dropdown = _react2.default.createElement(_SizePerPageDropDown2.default, _extends({
96389656
open: this.state.open,
96399657
hidden: hideSizePerPage,
96409658
currSizePerPage: String(sizePerPageText),
96419659
options: sizePerPageOptions,
96429660
onClick: this.toggleDropDown,
9643-
onBlur: this.closeDropDown
9661+
onBlur: this.closeDropDown,
9662+
isBootstrap4: isBootstrap4
96449663
}, dropdownProps));
96459664
}
96469665
return dropdown;
@@ -9675,15 +9694,20 @@ return /******/ (function(modules) { // webpackBootstrap
96759694
var isActive = page === this.props.currPage;
96769695
var isDisabled = isStart(page, this.props) || isEnd(page, this.props) ? true : false;
96779696
var title = page + '';
9697+
var pageNumber = page;
96789698

96799699
if (page === this.props.nextPage) {
96809700
title = this.props.nextPageTitle;
9701+
pageNumber = this.props.currPage + 1;
96819702
} else if (page === this.props.prePage) {
96829703
title = this.props.prePageTitle;
9704+
pageNumber = this.props.currPage - 1;
96839705
} else if (page === this.props.firstPage) {
96849706
title = this.props.firstPageTitle;
9707+
pageNumber = this.props.pageStartIndex;
96859708
} else if (page === this.props.lastPage) {
96869709
title = this.props.lastPageTitle;
9710+
pageNumber = this.getLastPage();
96879711
}
96889712

96899713
return _react2.default.createElement(
@@ -9692,7 +9716,8 @@ return /******/ (function(modules) { // webpackBootstrap
96929716
title: title,
96939717
changePage: this.changePage,
96949718
active: isActive,
9695-
disable: isDisabled },
9719+
disable: isDisabled,
9720+
pageNumber: pageNumber },
96969721
page
96979722
);
96989723
}, this);
@@ -9852,7 +9877,7 @@ return /******/ (function(modules) { // webpackBootstrap
98529877
key: '__pageBtnClick__REACT_HOT_LOADER__',
98539878
value: function __pageBtnClick__REACT_HOT_LOADER__(e) {
98549879
e.preventDefault();
9855-
this.props.changePage(e.currentTarget.textContent);
9880+
this.props.changePage(this.props.pageNumber);
98569881
}
98579882
}, {
98589883
key: 'render',
@@ -9884,7 +9909,8 @@ return /******/ (function(modules) { // webpackBootstrap
98849909
active: _propTypes2.default.bool,
98859910
disable: _propTypes2.default.bool,
98869911
hidden: _propTypes2.default.bool,
9887-
children: _propTypes2.default.node
9912+
children: _propTypes2.default.node,
9913+
pageNumber: _propTypes2.default.number
98889914
};
98899915

98909916
var _default = PageButton;
@@ -9954,21 +9980,35 @@ return /******/ (function(modules) { // webpackBootstrap
99549980
className = _props.className,
99559981
variation = _props.variation,
99569982
btnContextual = _props.btnContextual,
9983+
isBootstrap4 = _props.isBootstrap4,
99579984
currSizePerPage = _props.currSizePerPage;
99589985

99599986

9987+
if (hidden) return null;
9988+
99609989
var openClass = open ? 'open show' : '';
9961-
var dropDownStyle = { visibility: hidden ? 'hidden' : 'visible' };
9990+
9991+
var renderOptions = function renderOptions() {
9992+
var attrs = {
9993+
className: 'dropdown-menu ' + openClass,
9994+
role: 'menu',
9995+
'aria-labelledby': 'pageDropDown'
9996+
};
9997+
var type = isBootstrap4 ? 'div' : 'ul';
9998+
9999+
return _react2.default.createElement(type, attrs, options);
10000+
};
996210001

996310002
return _react2.default.createElement(
996410003
'span',
9965-
{ style: dropDownStyle,
10004+
{
996610005
className: variation + ' ' + openClass + ' ' + className + ' ' + sizePerPageDefaultClass },
996710006
_react2.default.createElement(
996810007
'button',
996910008
{ className: 'btn ' + btnContextual + ' dropdown-toggle',
997010009
id: 'pageDropDown', 'data-toggle': 'dropdown',
997110010
'aria-expanded': open,
10011+
'aria-haspopup': !open,
997210012
onClick: onClick,
997310013
onBlur: onBlur },
997410014
currSizePerPage,
@@ -9979,11 +10019,7 @@ return /******/ (function(modules) { // webpackBootstrap
997910019
_react2.default.createElement('span', { className: 'caret' })
998010020
)
998110021
),
9982-
_react2.default.createElement(
9983-
'ul',
9984-
{ className: 'dropdown-menu', role: 'menu', 'aria-labelledby': 'pageDropDown' },
9985-
options
9986-
)
10022+
renderOptions()
998710023
);
998810024
}
998910025
}]);

dist/react-bootstrap-table.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)