Skip to content

Commit 6632f1f

Browse files
committed
prod
1 parent 7669ee9 commit 6632f1f

File tree

3 files changed

+87
-46
lines changed

3 files changed

+87
-46
lines changed

dist/react-bootstrap-table.js

Lines changed: 78 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,10 @@ return /******/ (function(modules) { // webpackBootstrap
362362

363363
var isKeyFieldDefined = typeof keyField === 'string' && keyField.length;
364364
_react2.default.Children.forEach(props.children, function (column) {
365+
if (column === null || column === undefined) {
366+
// Skip null and undefined value
367+
return;
368+
}
365369
if (column.props.isKey) {
366370
if (keyField) {
367371
throw new Error('Error. Multiple key column be detected in TableHeaderColumn.');
@@ -451,11 +455,21 @@ return /******/ (function(modules) { // webpackBootstrap
451455

452456
var rowCount = 0;
453457
_react2.default.Children.forEach(children, function (column) {
458+
if (column === null || column === undefined) {
459+
// Skip null and undefined value
460+
return;
461+
}
462+
454463
if (Number(column.props.row) > rowCount) {
455464
rowCount = Number(column.props.row);
456465
}
457466
});
458467
return _react2.default.Children.map(children, function (column, i) {
468+
if (column === null || column === undefined) {
469+
// Return null for empty objects
470+
return null;
471+
}
472+
459473
var rowIndex = column.props.row ? Number(column.props.row) : 0;
460474
var rowSpan = column.props.rowSpan ? Number(column.props.rowSpan) : 1;
461475
if (rowSpan + rowIndex === rowCount + 1) {
@@ -1393,7 +1407,9 @@ return /******/ (function(modules) { // webpackBootstrap
13931407
}
13941408

13951409
var keys = [];
1396-
this.props.children.map(function (column) {
1410+
this.props.children.filter(function (_) {
1411+
return _ != null;
1412+
}).map(function (column) {
13971413
if (column.props.export === true || typeof column.props.export === 'undefined' && column.props.hidden === false) {
13981414
keys.push({
13991415
field: column.props.dataField,
@@ -1531,7 +1547,10 @@ return /******/ (function(modules) { // webpackBootstrap
15311547
if (enableShowOnlySelected || insertRow || deleteRow || search || exportCSV || this.props.options.searchPanel || this.props.options.btnGroup || this.props.options.toolBar) {
15321548
var columns = void 0;
15331549
if (Array.isArray(children)) {
1534-
columns = children.map(function (column, r) {
1550+
columns = children.filter(function (_) {
1551+
return _ != null;
1552+
}).map(function (column, r) {
1553+
if (!column) return;
15351554
var props = column.props;
15361555

15371556
var isKey = props.isKey || keyField === props.dataField;
@@ -1687,7 +1706,9 @@ return /******/ (function(modules) { // webpackBootstrap
16871706
}
16881707
}
16891708
} else {
1690-
_react2.default.Children.forEach(this.props.children, function (child, i) {
1709+
_react2.default.Children.forEach(this.props.children.filter(function (_) {
1710+
return !!_;
1711+
}), function (child, i) {
16911712
if (child.props.width) {
16921713
header[i].style.width = child.props.width + 'px';
16931714
header[i].style.minWidth = child.props.width + 'px';
@@ -2338,7 +2359,7 @@ return /******/ (function(modules) { // webpackBootstrap
23382359
}, this.props.tableHeaderClass);
23392360

23402361
var rowCount = Math.max.apply(Math, _toConsumableArray(_react2.default.Children.map(this.props.children, function (elm) {
2341-
return elm.props.row ? Number(elm.props.row) : 0;
2362+
return elm && elm.props.row ? Number(elm.props.row) : 0;
23422363
})));
23432364

23442365
var rows = [];
@@ -2362,6 +2383,10 @@ return /******/ (function(modules) { // webpackBootstrap
23622383

23632384

23642385
_react2.default.Children.forEach(this.props.children, function (elm) {
2386+
if (elm === null || elm === undefined) {
2387+
// Skip null or undefined elements.
2388+
return;
2389+
}
23652390
var _elm$props = elm.props,
23662391
dataField = _elm$props.dataField,
23672392
dataSort = _elm$props.dataSort;
@@ -2714,7 +2739,7 @@ return /******/ (function(modules) { // webpackBootstrap
27142739
var customNavStyle = (typeof keyBoardNav === 'undefined' ? 'undefined' : _typeof(keyBoardNav)) === 'object' ? keyBoardNav.customStyle : null;
27152740
var ExpandColumnCustomComponent = this.props.expandColumnOptions.expandColumnComponent;
27162741
var expandColSpan = this.props.columns.filter(function (col) {
2717-
return !col.hidden;
2742+
return col && !col.hidden;
27182743
}).length;
27192744
if (isSelectRowDefined && !this.props.selectRow.hideSelectColumn) {
27202745
expandColSpan += 1;
@@ -2725,7 +2750,9 @@ return /******/ (function(modules) { // webpackBootstrap
27252750
}
27262751

27272752
var tableRows = this.props.data.map(function (data, r) {
2728-
var tableColumns = this.props.columns.map(function (column, i) {
2753+
var tableColumns = this.props.columns.filter(function (_) {
2754+
return _ != null;
2755+
}).map(function (column, i) {
27292756
var fieldValue = data[column.name];
27302757
var isFocusCell = r === y && i === x;
27312758
if (column.name !== this.props.keyField && // Key field can't be edit
@@ -4221,37 +4248,47 @@ return /******/ (function(modules) { // webpackBootstrap
42214248
attr.className = (editorClass || '') + ' form-control editor edit-' + editable.type + (editable.className ? ' ' + editable.className : '');
42224249

42234250
if (editable.type === 'select') {
4224-
// process select input
4225-
var options = [];
4226-
var values = editable.options.values;
4227-
if (Array.isArray(values)) {
4228-
(function () {
4229-
// only can use arrray data for options
4230-
var text = void 0;
4231-
var value = void 0;
4232-
options = values.map(function (option, i) {
4233-
if ((typeof option === 'undefined' ? 'undefined' : _typeof(option)) === 'object') {
4234-
text = option.text;
4235-
value = option.value;
4236-
} else {
4237-
text = format ? format(option) : option;
4238-
value = option;
4239-
}
4240-
return _react2.default.createElement(
4241-
'option',
4242-
{ key: 'option' + i, value: value },
4243-
text
4244-
);
4245-
});
4246-
})();
4247-
}
4248-
return _react2.default.createElement(
4249-
'select',
4250-
_extends({}, attr, { defaultValue: defaultValue }),
4251-
options
4252-
);
4251+
var _ret = function () {
4252+
// process select input
4253+
var options = [];
4254+
var _editable$options = editable.options,
4255+
values = _editable$options.values,
4256+
textKey = _editable$options.textKey,
4257+
valueKey = _editable$options.valueKey;
4258+
4259+
if (Array.isArray(values)) {
4260+
(function () {
4261+
// only can use arrray data for options
4262+
var text = void 0;
4263+
var value = void 0;
4264+
options = values.map(function (option, i) {
4265+
if ((typeof option === 'undefined' ? 'undefined' : _typeof(option)) === 'object') {
4266+
text = textKey ? option[textKey] : option.text;
4267+
value = valueKey ? option[valueKey] : option.value;
4268+
} else {
4269+
text = format ? format(option) : option;
4270+
value = option;
4271+
}
4272+
return _react2.default.createElement(
4273+
'option',
4274+
{ key: 'option' + i, value: value },
4275+
text
4276+
);
4277+
});
4278+
})();
4279+
}
4280+
return {
4281+
v: _react2.default.createElement(
4282+
'select',
4283+
_extends({}, attr, { defaultValue: defaultValue }),
4284+
options
4285+
)
4286+
};
4287+
}();
4288+
4289+
if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v;
42534290
} else if (editable.type === 'textarea') {
4254-
var _ret2 = function () {
4291+
var _ret3 = function () {
42554292
// process textarea input
42564293
// put other if exist
42574294
editable.cols && (attr.cols = editable.cols);
@@ -4283,7 +4320,7 @@ return /******/ (function(modules) { // webpackBootstrap
42834320
};
42844321
}();
42854322

4286-
if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v;
4323+
if ((typeof _ret3 === 'undefined' ? 'undefined' : _typeof(_ret3)) === "object") return _ret3.v;
42874324
} else if (editable.type === 'checkbox') {
42884325
var _values = 'true:false';
42894326
if (editable.options && editable.options.values) {
@@ -15035,6 +15072,10 @@ return /******/ (function(modules) { // webpackBootstrap
1503515072
var filterMonth = filterVal.getMonth();
1503615073
var filterYear = filterVal.getFullYear();
1503715074

15075+
if ((typeof targetVal === 'undefined' ? 'undefined' : _typeof(targetVal)) !== 'object') {
15076+
targetVal = new Date(targetVal);
15077+
}
15078+
1503815079
var targetDate = targetVal.getDate();
1503915080
var targetMonth = targetVal.getMonth();
1504015081
var targetYear = targetVal.getFullYear();

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)