Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var PaginationBase = function PaginationBase(_ref2) {
var totalPages = _ref2.totalPages,
totalCount = _ref2.totalCount,
pageSize = _ref2.pageSize,
currentPage = _ref2.currentPage,
onCurrentPageChange = _ref2.onCurrentPageChange,
getMessage = _ref2.getMessage,
classes = _ref2.classes;
var from = dxGridCore.firstRowOnPage(currentPage, pageSize, totalCount);
var to = dxGridCore.lastRowOnPage(currentPage, pageSize, totalCount);
return React.createElement(
'div',
{ className: classes.pagination },
React.createElement(
'span',
{ className: classes.rowsLabel },
getMessage('info', { from: from, to: to, count: totalCount })
),
React.createElement(
IconButton,
{
className: classNames(classes.arrowButton, classes.prev),
disabled: currentPage === 0,
onClick: function onClick() {
export const Pagination = ({
totalPages,
totalCount,
pageSize,
currentPage,
onCurrentPageChange,
getMessage,
}) => {
const from = firstRowOnPage(currentPage, pageSize, totalCount);
const to = lastRowOnPage(currentPage, pageSize, totalCount);
return (
<button>}
disabled={currentPage === 0}
onClick={() => (currentPage > 0) && onCurrentPageChange(currentPage - 1)}
/>
{renderPageButtons(currentPage, totalPages, onCurrentPageChange)}
</button>
var PaginationBase = function PaginationBase(_ref2) {
var totalPages = _ref2.totalPages,
totalCount = _ref2.totalCount,
pageSize = _ref2.pageSize,
currentPage = _ref2.currentPage,
onCurrentPageChange = _ref2.onCurrentPageChange,
getMessage = _ref2.getMessage,
classes = _ref2.classes;
var from = firstRowOnPage(currentPage, pageSize, totalCount);
var to = lastRowOnPage(currentPage, pageSize, totalCount);
return React.createElement(
'div',
{ className: classes.pagination },
React.createElement(
'span',
{ className: classes.rowsLabel },
getMessage('info', { from: from, to: to, count: totalCount })
),
React.createElement(
IconButton,
{
className: classNames(classes.arrowButton, classes.prev),
disabled: currentPage === 0,
onClick: function onClick() {
export const Pagination = ({
totalPages,
totalCount,
pageSize,
currentPage,
onCurrentPageChange,
getMessage,
}) => {
const from = firstRowOnPage(currentPage, pageSize, totalCount);
const to = lastRowOnPage(currentPage, pageSize, totalCount);
return (
<button>}
disabled={currentPage === 0}
onClick={() => (currentPage > 0) && onCurrentPageChange(currentPage - 1)}
/>
{renderPageButtons(currentPage, totalPages, onCurrentPageChange)}
</button>
var PaginationBase = function PaginationBase(_ref2) {
var totalPages = _ref2.totalPages,
totalCount = _ref2.totalCount,
pageSize = _ref2.pageSize,
currentPage = _ref2.currentPage,
onCurrentPageChange = _ref2.onCurrentPageChange,
getMessage = _ref2.getMessage,
classes = _ref2.classes;
var from = firstRowOnPage(currentPage, pageSize, totalCount);
var to = lastRowOnPage(currentPage, pageSize, totalCount);
return React.createElement(
'div',
{ className: classes.pagination },
React.createElement(
'span',
{ className: classes.rowsLabel },
getMessage('info', { from: from, to: to, count: totalCount })
),
React.createElement(
IconButton,
{
className: classNames(classes.arrowButton, classes.prev),
disabled: currentPage === 0,
onClick: function onClick() {
return currentPage > 0 && onCurrentPageChange(currentPage - 1);
var PaginationBase = function PaginationBase(_ref2) {
var totalPages = _ref2.totalPages,
totalCount = _ref2.totalCount,
pageSize = _ref2.pageSize,
currentPage = _ref2.currentPage,
onCurrentPageChange = _ref2.onCurrentPageChange,
getMessage = _ref2.getMessage,
classes = _ref2.classes;
var from = dxGridCore.firstRowOnPage(currentPage, pageSize, totalCount);
var to = dxGridCore.lastRowOnPage(currentPage, pageSize, totalCount);
return React.createElement(
'div',
{ className: classes.pagination },
React.createElement(
'span',
{ className: classes.rowsLabel },
getMessage('info', { from: from, to: to, count: totalCount })
),
React.createElement(
IconButton,
{
className: classNames(classes.arrowButton, classes.prev),
disabled: currentPage === 0,
onClick: function onClick() {
return currentPage > 0 && onCurrentPageChange(currentPage - 1);
const renderPageButtons = (
currentPage,
totalPageCount,
onCurrentPageChange,
) => {
const pageButtons = [];
const maxButtonCount = 3;
let startPage = 1;
let endPage = totalPageCount || 1;
if (maxButtonCount < totalPageCount) {
startPage = calculateStartPage(currentPage + 1, maxButtonCount, totalPageCount);
endPage = (startPage + maxButtonCount) - 1;
}
if (startPage > 1) {
pageButtons.push((
onCurrentPageChange(0)}
/>
));
if (startPage > 2) {
pageButtons.push((