mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-06-29 05:30:05 +00:00
Compare commits
6 Commits
bugfix/979
...
react-boot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e8bb3426a | ||
|
|
03f2ce4792 | ||
|
|
7382010822 | ||
|
|
a1a59f9419 | ||
|
|
59f184d74d | ||
|
|
643b9bca5f |
@@ -74,7 +74,7 @@ const options = {
|
||||
// hidePageListOnlyOnePage: true, // Hide the pagination list when only one page
|
||||
firstPageText: 'First',
|
||||
prePageText: 'Back',
|
||||
nextPageText: 'Next',
|
||||
nextPageText: <span>Next</span>,
|
||||
lastPageText: 'Last',
|
||||
nextPageTitle: 'First page',
|
||||
prePageTitle: 'Pre page',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-bootstrap-table2-example",
|
||||
"version": "1.0.26",
|
||||
"version": "1.0.27",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-bootstrap-table2-filter",
|
||||
"version": "1.1.9",
|
||||
"version": "1.1.10",
|
||||
"description": "it's a column filter addon for react-bootstrap-table2",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -18,8 +18,18 @@ function optionsEquals(currOpts, prevOpts) {
|
||||
return Object.keys(currOpts).length === Object.keys(prevOpts).length;
|
||||
}
|
||||
|
||||
const getSelections = container =>
|
||||
Array.from(container.selectedOptions).map(item => item.value);
|
||||
const getSelections = (container) => {
|
||||
if (container.selectedOptions) {
|
||||
return Array.from(container.selectedOptions).map(item => item.value);
|
||||
}
|
||||
const selections = [];
|
||||
const totalLen = container.options.length;
|
||||
for (let i = 0; i < totalLen; i += 1) {
|
||||
const option = container.options.item(i);
|
||||
if (option.selected) selections.push(option.value);
|
||||
}
|
||||
return selections;
|
||||
};
|
||||
|
||||
class MultiSelectFilter extends Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-bootstrap-table2-paginator",
|
||||
"version": "2.0.6",
|
||||
"version": "2.0.7",
|
||||
"description": "it's the pagination addon for react-bootstrap-table2",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -39,7 +39,11 @@ class PageButton extends Component {
|
||||
|
||||
PageButton.propTypes = {
|
||||
onPageChange: PropTypes.func.isRequired,
|
||||
page: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
||||
page: PropTypes.oneOfType([
|
||||
PropTypes.node,
|
||||
PropTypes.number,
|
||||
PropTypes.string
|
||||
]).isRequired,
|
||||
active: PropTypes.bool.isRequired,
|
||||
disabled: PropTypes.bool.isRequired,
|
||||
className: PropTypes.string,
|
||||
|
||||
@@ -27,7 +27,11 @@ const PaginatonList = props => (
|
||||
|
||||
PaginatonList.propTypes = {
|
||||
pages: PropTypes.arrayOf(PropTypes.shape({
|
||||
page: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
page: PropTypes.oneOfType([
|
||||
PropTypes.node,
|
||||
PropTypes.number,
|
||||
PropTypes.string
|
||||
]),
|
||||
active: PropTypes.bool,
|
||||
disable: PropTypes.bool,
|
||||
title: PropTypes.string
|
||||
|
||||
@@ -100,10 +100,10 @@ Pagination.propTypes = {
|
||||
sizePerPageRenderer: PropTypes.func,
|
||||
paginationTotalRenderer: PropTypes.func,
|
||||
sizePerPageOptionRenderer: PropTypes.func,
|
||||
firstPageText: PropTypes.string,
|
||||
prePageText: PropTypes.string,
|
||||
nextPageText: PropTypes.string,
|
||||
lastPageText: PropTypes.string,
|
||||
firstPageText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
||||
prePageText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
||||
nextPageText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
||||
lastPageText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
||||
nextPageTitle: PropTypes.string,
|
||||
prePageTitle: PropTypes.string,
|
||||
firstPageTitle: PropTypes.string,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-bootstrap-table-next",
|
||||
"version": "3.1.4",
|
||||
"version": "3.1.5",
|
||||
"description": "Next generation of react-bootstrap-table",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import _ from './utils';
|
||||
|
||||
const events = [
|
||||
'onClick',
|
||||
'onDoubleClick',
|
||||
@@ -23,7 +25,7 @@ export default ExtendBase =>
|
||||
delegate(attrs = {}) {
|
||||
const newAttrs = { ...attrs };
|
||||
Object.keys(attrs).forEach((attr) => {
|
||||
if (events.includes(attr)) {
|
||||
if (_.contains(events, attr)) {
|
||||
newAttrs[attr] = this.createDefaultEventHandler(attrs[attr]);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ class RowExpandProvider extends React.Component {
|
||||
if (nextProps.expandRow) {
|
||||
const nextExpanded = nextProps.expandRow.expanded || this.state.expanded;
|
||||
const isClosing = this.state.expanded.reduce((acc, cur) => {
|
||||
if (!nextExpanded.includes(cur)) {
|
||||
if (!_.contains(nextExpanded, cur)) {
|
||||
acc.push(cur);
|
||||
}
|
||||
return acc;
|
||||
@@ -42,7 +42,7 @@ class RowExpandProvider extends React.Component {
|
||||
|
||||
handleRowExpand = (rowKey, expanded, rowIndex, e) => {
|
||||
const { data, keyField, expandRow: { onExpand, onlyOneExpanding, nonExpandable } } = this.props;
|
||||
if (nonExpandable && nonExpandable.includes(rowKey)) {
|
||||
if (nonExpandable && _.contains(nonExpandable, rowKey)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ export default ExtendBase =>
|
||||
if (!hiddenRows || hiddenRows.length === 0) return data;
|
||||
return data.filter((row) => {
|
||||
const key = _.get(row, keyField);
|
||||
return !hiddenRows.includes(key);
|
||||
return !_.contains(hiddenRows, key);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
/* eslint react/prop-types: 0 */
|
||||
import React from 'react';
|
||||
import ExpandRow from './expand-row';
|
||||
import _ from '../utils';
|
||||
import ExpansionContext from '../contexts/row-expand-context';
|
||||
|
||||
export default (Component) => {
|
||||
const renderWithExpansion = (props, expandRow) => {
|
||||
const key = props.value;
|
||||
|
||||
const expanded = expandRow.expanded.includes(key);
|
||||
const isClosing = expandRow.isClosing.includes(key);
|
||||
const expandable = !expandRow.nonExpandable || !expandRow.nonExpandable.includes(key);
|
||||
const expanded = _.contains(expandRow.expanded, key);
|
||||
const isClosing = _.contains(expandRow.isClosing, key);
|
||||
const expandable = !expandRow.nonExpandable || !_.contains(expandRow.nonExpandable, key);
|
||||
return [
|
||||
<Component
|
||||
{ ...props }
|
||||
|
||||
@@ -7,8 +7,8 @@ import SelectionContext from '../contexts/selection-context';
|
||||
export default (Component) => {
|
||||
const renderWithSelection = (props, selectRow) => {
|
||||
const key = props.value;
|
||||
const selected = selectRow.selected.includes(key);
|
||||
const selectable = !selectRow.nonSelectable || !selectRow.nonSelectable.includes(key);
|
||||
const selected = _.contains(selectRow.selected, key);
|
||||
const selectable = !selectRow.nonSelectable || !_.contains(selectRow.nonSelectable, key);
|
||||
|
||||
let {
|
||||
style,
|
||||
|
||||
@@ -74,7 +74,7 @@ export default ExtendBase =>
|
||||
delegate(attrs = {}) {
|
||||
const newAttrs = { ...attrs };
|
||||
Object.keys(attrs).forEach((attr) => {
|
||||
if (events.includes(attr)) {
|
||||
if (_.contains(events, attr)) {
|
||||
newAttrs[attr] = this.createDefaultEventHandler(attrs[attr]);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ export const expandableKeys = (data, keyField, skips = []) => {
|
||||
return data.map(row => _.get(row, keyField));
|
||||
}
|
||||
return data
|
||||
.filter(row => !skips.includes(_.get(row, keyField)))
|
||||
.filter(row => !_.contains(skips, _.get(row, keyField)))
|
||||
.map(row => _.get(row, keyField));
|
||||
};
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export const selectableKeys = (data, keyField, skips = []) => {
|
||||
return data.map(row => _.get(row, keyField));
|
||||
}
|
||||
return data
|
||||
.filter(row => !skips.includes(_.get(row, keyField)))
|
||||
.filter(row => !_.contains(skips, _.get(row, keyField)))
|
||||
.map(row => _.get(row, keyField));
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ export const unSelectableKeys = (selected, skips = []) => {
|
||||
if (skips.length === 0) {
|
||||
return [];
|
||||
}
|
||||
return selected.filter(x => skips.includes(x));
|
||||
return selected.filter(x => _.contains(skips, x));
|
||||
};
|
||||
|
||||
export const getSelectedRows = (data, keyField, selected) =>
|
||||
|
||||
Reference in New Issue
Block a user