Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import PropTypes from 'prop-types';
import BootstrapTable from 'react-bootstrap-table-next';
import filterFactory, { textFilter, selectFilter, numberFilter, customFilter } from 'react-bootstrap-table2-filter';
import { forbidExtraProps, nonNegativeInteger } from 'airbnb-prop-types';
import paginationFactory from './Pagination';
import { NO_DATA_INDICATOR } from './constants';
const propTypes = forbidExtraProps({
dataTotalSize: nonNegativeInteger.isRequired,
clearFilters: PropTypes.func.isRequired,
currentPage: nonNegativeInteger.isRequired,
keyField: PropTypes.string.isRequired,
onExportToCSV: PropTypes.func.isRequired,
onSearchChange: PropTypes.func.isRequired,
onSizePerPageChange: PropTypes.func.isRequired,
onTableChange: PropTypes.func.isRequired,
refreshTable: PropTypes.func.isRequired,
sizePerPage: nonNegativeInteger.isRequired,
startClearingFilters: PropTypes.func.isRequired,
tableColumns: PropTypes.object.isRequired,
defaultSort: PropTypes.array,
extraButtons: PropTypes.func,
isFiltered: PropTypes.bool,
noDataIndication: PropTypes.any,
searchValue: PropTypes.string,
import cs from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
import { forbidExtraProps, nonNegativeInteger } from 'airbnb-prop-types';
import { calculateFromTo, calculatePageCount, createListItems } from './Pagination.helpers';
import SizePerPageSelect from './SizePerPageSelect/SizePerPageSelect';
import PaginationList from './PaginationList/PaginationList';
import PaginationTotal from './PaginationTotal/PaginationTotal';
import { LIST_ITEMS } from './constants';
const propTypes = forbidExtraProps({
dataSize: nonNegativeInteger.isRequired,
currentPage: nonNegativeInteger.isRequired,
currentSizePerPage: nonNegativeInteger.isRequired,
onPageChange: PropTypes.func.isRequired,
onSizePerPageChange: PropTypes.func.isRequired,
paginationTotal: PropTypes.func,
});
const defaultProps = {
paginationTotal: undefined,
};
class Pagination extends React.Component {
state = {
isDropDownOpen: false,
};
toggleDropDown = () => {
import cs from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
import { forbidExtraProps, nonNegativeInteger } from 'airbnb-prop-types';
import { calculateFromTo, calculatePageCount, createListItems } from './Pagination.helpers';
import SizePerPageSelect from './SizePerPageSelect/SizePerPageSelect';
import PaginationList from './PaginationList/PaginationList';
import PaginationTotal from './PaginationTotal/PaginationTotal';
import { LIST_ITEMS } from './constants';
const propTypes = forbidExtraProps({
dataSize: nonNegativeInteger.isRequired,
currentPage: nonNegativeInteger.isRequired,
currentSizePerPage: nonNegativeInteger.isRequired,
onPageChange: PropTypes.func.isRequired,
onSizePerPageChange: PropTypes.func.isRequired,
paginationTotal: PropTypes.func,
});
const defaultProps = {
paginationTotal: undefined,
};
class Pagination extends React.Component {
state = {
isDropDownOpen: false,
};
import { forbidExtraProps, nonNegativeInteger } from 'airbnb-prop-types';
import paginationFactory from './Pagination';
import { NO_DATA_INDICATOR } from './constants';
const propTypes = forbidExtraProps({
dataTotalSize: nonNegativeInteger.isRequired,
clearFilters: PropTypes.func.isRequired,
currentPage: nonNegativeInteger.isRequired,
keyField: PropTypes.string.isRequired,
onExportToCSV: PropTypes.func.isRequired,
onSearchChange: PropTypes.func.isRequired,
onSizePerPageChange: PropTypes.func.isRequired,
onTableChange: PropTypes.func.isRequired,
refreshTable: PropTypes.func.isRequired,
sizePerPage: nonNegativeInteger.isRequired,
startClearingFilters: PropTypes.func.isRequired,
tableColumns: PropTypes.object.isRequired,
defaultSort: PropTypes.array,
extraButtons: PropTypes.func,
isFiltered: PropTypes.bool,
noDataIndication: PropTypes.any,
searchValue: PropTypes.string,
tableData: PropTypes.any,
});
const defaultProps = {
defaultSort: null,
extraButtons: null,
isFiltered: false,
noDataIndication: NO_DATA_INDICATOR,
searchValue: undefined,
import React from 'react';
import { forbidExtraProps, nonNegativeInteger } from 'airbnb-prop-types';
const propTypes = forbidExtraProps({
start: nonNegativeInteger.isRequired,
to: nonNegativeInteger.isRequired,
total: nonNegativeInteger.isRequired,
});
const PaginationTotal = ({ start, to, total }) => (
<div style="{{">
Showing {start} to {to} of {total} Results
</div>
);
PaginationTotal.propTypes = propTypes;
export default PaginationTotal;
import React from 'react';
import { forbidExtraProps, nonNegativeInteger } from 'airbnb-prop-types';
const propTypes = forbidExtraProps({
start: nonNegativeInteger.isRequired,
to: nonNegativeInteger.isRequired,
total: nonNegativeInteger.isRequired,
});
const PaginationTotal = ({ start, to, total }) => (
<div style="{{">
Showing {start} to {to} of {total} Results
</div>
);
PaginationTotal.propTypes = propTypes;
export default PaginationTotal;
import cs from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
import { forbidExtraProps, nonNegativeInteger } from 'airbnb-prop-types';
import { calculateFromTo, calculatePageCount, createListItems } from './Pagination.helpers';
import SizePerPageSelect from './SizePerPageSelect/SizePerPageSelect';
import PaginationList from './PaginationList/PaginationList';
import PaginationTotal from './PaginationTotal/PaginationTotal';
import { LIST_ITEMS } from './constants';
const propTypes = forbidExtraProps({
dataSize: nonNegativeInteger.isRequired,
currentPage: nonNegativeInteger.isRequired,
currentSizePerPage: nonNegativeInteger.isRequired,
onPageChange: PropTypes.func.isRequired,
onSizePerPageChange: PropTypes.func.isRequired,
paginationTotal: PropTypes.func,
});
const defaultProps = {
paginationTotal: undefined,
};
class Pagination extends React.Component {
state = {
isDropDownOpen: false,
};
toggleDropDown = () => {
this.setState(prevState => ({
import React from 'react';
import PropTypes from 'prop-types';
import BootstrapTable from 'react-bootstrap-table-next';
import filterFactory, { textFilter, selectFilter, numberFilter, customFilter } from 'react-bootstrap-table2-filter';
import { forbidExtraProps, nonNegativeInteger } from 'airbnb-prop-types';
import paginationFactory from './Pagination';
import { NO_DATA_INDICATOR } from './constants';
const propTypes = forbidExtraProps({
dataTotalSize: nonNegativeInteger.isRequired,
clearFilters: PropTypes.func.isRequired,
currentPage: nonNegativeInteger.isRequired,
keyField: PropTypes.string.isRequired,
onExportToCSV: PropTypes.func.isRequired,
onSearchChange: PropTypes.func.isRequired,
onSizePerPageChange: PropTypes.func.isRequired,
onTableChange: PropTypes.func.isRequired,
refreshTable: PropTypes.func.isRequired,
sizePerPage: nonNegativeInteger.isRequired,
startClearingFilters: PropTypes.func.isRequired,
tableColumns: PropTypes.object.isRequired,
defaultSort: PropTypes.array,
extraButtons: PropTypes.func,
isFiltered: PropTypes.bool,
noDataIndication: PropTypes.any,
searchValue: PropTypes.string,
tableData: PropTypes.any,
});
import React from 'react';
import { forbidExtraProps, nonNegativeInteger } from 'airbnb-prop-types';
const propTypes = forbidExtraProps({
start: nonNegativeInteger.isRequired,
to: nonNegativeInteger.isRequired,
total: nonNegativeInteger.isRequired,
});
const PaginationTotal = ({ start, to, total }) => (
<div style="{{">
Showing {start} to {to} of {total} Results
</div>
);
PaginationTotal.propTypes = propTypes;
export default PaginationTotal;