@redneckz/wildless-cms-uni-blocks 0.14.211 → 0.14.212

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3554,10 +3554,10 @@
3554
3554
 
3555
3555
  const paginationBlockStyle = 'py-m px-lg rounded-md cursor-pointer hover:bg-primary-hover hover:text-white';
3556
3556
 
3557
- const checkPageRange = (page, currentPage, totalPages) => (currentPage <= 3 && page <= currentPage + 3) ||
3558
- (currentPage >= totalPages - 1 && page >= totalPages - 4);
3559
- const shouldRenderPage = (page, currentPage, totalPages) => (page < currentPage && page >= currentPage - 2) ||
3560
- (page <= currentPage + 2 && page > currentPage) ||
3557
+ const checkPageRange = (page, currentPage, totalPages) => (currentPage <= 2 && page <= currentPage + 2) ||
3558
+ (currentPage >= totalPages - 1 && page >= totalPages - 3);
3559
+ const shouldRenderPage = (page, currentPage, totalPages) => (page < currentPage && page >= currentPage - 1) ||
3560
+ (page <= currentPage + 1 && page > currentPage) ||
3561
3561
  checkPageRange(page, currentPage, totalPages);
3562
3562
 
3563
3563
  const renderPages = (pagesParams, index) => {
@@ -3585,13 +3585,13 @@
3585
3585
  }
3586
3586
  }, [currentPage]);
3587
3587
  const handleNextPage = useCallback(() => {
3588
- if (currentPage < totalPages - 1) {
3588
+ if (currentPage < totalPages) {
3589
3589
  onPageChange(currentPage + 1);
3590
3590
  }
3591
3591
  }, [currentPage, totalPages]);
3592
3592
  const handleFirstPage = useCallback(() => onPageChange(1), []);
3593
3593
  const handleLastPage = useCallback(() => onPageChange(totalPages), [totalPages]);
3594
- return (jsxs("div", { className: "flex gap-m items-center", children: [jsx("div", { onClick: handlePrevPage, children: jsx(Icon, { name: "ArrowLeftIcon", iconVersion: "black", imageClassName: getIconStyle(currentPage === 1), ...ICON_SIZE$1 }) }), jsxs("div", { className: "flex gap-xs", children: [currentPage > 1 ? (jsx("div", { onClick: handleFirstPage, className: paginationBlockStyle, "aria-label": "\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430 1", children: "1" })) : null, currentPage > 4 ? jsx("div", { className: "py-m px-s", children: "..." }) : null, pages.map(renderPages), currentPage < totalPages - 3 ? jsx("div", { className: "py-m px-s", children: "..." }) : null, currentPage < totalPages ? (jsx("div", { onClick: handleLastPage, className: paginationBlockStyle, "aria-label": `Страница ${totalPages}`, children: totalPages })) : null] }), jsx("div", { onClick: handleNextPage, children: jsx(Icon, { className: "rotate-180", name: "ArrowLeftIcon", iconVersion: "black", imageClassName: getIconStyle(currentPage === totalPages), ...ICON_SIZE$1 }) })] }));
3594
+ return (jsxs("div", { className: "flex gap-m items-center", children: [jsx("div", { onClick: handlePrevPage, children: jsx(Icon, { name: "ArrowLeftIcon", iconVersion: "black", imageClassName: getIconStyle(currentPage === 1), ...ICON_SIZE$1 }) }), jsxs("div", { className: "flex gap-2xs", children: [currentPage > 1 ? (jsx("div", { onClick: handleFirstPage, className: paginationBlockStyle, "aria-label": "\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430 1", children: "1" })) : null, currentPage > 3 ? jsx("div", { className: "py-m px-s", children: "..." }) : null, pages.map(renderPages), currentPage < totalPages - 2 ? jsx("div", { className: "py-m px-s", children: "..." }) : null, currentPage < totalPages ? (jsx("div", { onClick: handleLastPage, className: paginationBlockStyle, "aria-label": `Страница ${totalPages}`, children: totalPages })) : null] }), jsx("div", { onClick: handleNextPage, children: jsx(Icon, { className: "rotate-180", name: "ArrowLeftIcon", iconVersion: "black", imageClassName: getIconStyle(currentPage === totalPages), ...ICON_SIZE$1 }) })] }));
3595
3595
  };
3596
3596
  const getIconStyle = (condition) => condition ? 'opacity-20' : 'cursor-pointer hover:opacity-60';
3597
3597
 
@@ -6054,7 +6054,7 @@
6054
6054
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6055
6055
  });
6056
6056
 
6057
- const packageVersion = "0.14.210";
6057
+ const packageVersion = "0.14.211";
6058
6058
 
6059
6059
  exports.Blocks = Blocks;
6060
6060
  exports.ContentPage = ContentPage;