@redneckz/wildless-cms-uni-blocks 0.14.9 → 0.14.11
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.
- package/bin/migration-scripts/0.14.7.js +32 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +40 -38
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Depository/useDepository.d.ts +1 -1
- package/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +4 -4
- package/bundle/ui-kit/BaseTile/BaseTile.d.ts +1 -1
- package/bundle/ui-kit/Pagination/PageSizeSelector.d.ts +7 -0
- package/bundle/ui-kit/Pagination/Pagination.d.ts +3 -2
- package/bundle/ui-kit/Pagination/PaginationContainer.d.ts +7 -0
- package/bundle/ui-kit/Pagination/paginationBlockStyle.d.ts +1 -0
- package/bundle/ui-kit/Pagination/renderPages.d.ts +2 -2
- package/bundle/utils/formatDate.d.ts +1 -0
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +2 -2
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/dist/components/CarouselInvestmentCard/CarouselInvestmentCard.js +1 -1
- package/dist/components/CarouselInvestmentCard/CarouselInvestmentCard.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/dist/components/ContentPage/ContentPage.js +1 -1
- package/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/dist/components/Depository/Depository.js +3 -2
- package/dist/components/Depository/Depository.js.map +1 -1
- package/dist/components/Depository/DepositoryItem.js +3 -3
- package/dist/components/Depository/DepositoryItem.js.map +1 -1
- package/dist/components/Depository/useDepository.d.ts +1 -1
- package/dist/components/ProductTile/ProductTile.js +1 -1
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +4 -4
- package/dist/ui-kit/BaseTile/BaseTile.d.ts +1 -1
- package/dist/ui-kit/BaseTile/BaseTile.js +8 -5
- package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/dist/ui-kit/Icon/Icon.js +1 -1
- package/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/dist/ui-kit/Pagination/PageSizeSelector.d.ts +7 -0
- package/dist/ui-kit/Pagination/PageSizeSelector.js +12 -0
- package/dist/ui-kit/Pagination/PageSizeSelector.js.map +1 -0
- package/dist/ui-kit/Pagination/Pagination.d.ts +3 -2
- package/dist/ui-kit/Pagination/Pagination.js +4 -27
- package/dist/ui-kit/Pagination/Pagination.js.map +1 -1
- package/dist/ui-kit/Pagination/PaginationContainer.d.ts +7 -0
- package/dist/ui-kit/Pagination/PaginationContainer.js +31 -0
- package/dist/ui-kit/Pagination/PaginationContainer.js.map +1 -0
- package/dist/ui-kit/Pagination/paginationBlockStyle.d.ts +1 -0
- package/dist/ui-kit/Pagination/paginationBlockStyle.js +4 -0
- package/dist/ui-kit/Pagination/paginationBlockStyle.js.map +1 -0
- package/dist/ui-kit/Pagination/renderPages.d.ts +2 -2
- package/dist/ui-kit/Pagination/renderPages.js +2 -2
- package/dist/ui-kit/Pagination/renderPages.js.map +1 -1
- package/dist/ui-kit/Select/Select.js +1 -1
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/dist/utils/formatDate.d.ts +1 -0
- package/dist/utils/formatDate.js +5 -0
- package/dist/utils/formatDate.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +2 -2
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/lib/components/CarouselInvestmentCard/CarouselInvestmentCard.js +1 -1
- package/lib/components/CarouselInvestmentCard/CarouselInvestmentCard.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/lib/components/ContentPage/ContentPage.js +1 -1
- package/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/lib/components/Depository/Depository.js +3 -2
- package/lib/components/Depository/Depository.js.map +1 -1
- package/lib/components/Depository/DepositoryItem.js +3 -3
- package/lib/components/Depository/DepositoryItem.js.map +1 -1
- package/lib/components/Depository/useDepository.d.ts +1 -1
- package/lib/components/ProductTile/ProductTile.js +1 -1
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/Tile/Tile.fixture.d.ts +1 -1
- package/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +4 -4
- package/lib/ui-kit/BaseTile/BaseTile.d.ts +1 -1
- package/lib/ui-kit/BaseTile/BaseTile.js +8 -5
- package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/lib/ui-kit/Icon/Icon.js +1 -1
- package/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/lib/ui-kit/Pagination/PageSizeSelector.d.ts +7 -0
- package/lib/ui-kit/Pagination/PageSizeSelector.js +9 -0
- package/lib/ui-kit/Pagination/PageSizeSelector.js.map +1 -0
- package/lib/ui-kit/Pagination/Pagination.d.ts +3 -2
- package/lib/ui-kit/Pagination/Pagination.js +3 -26
- package/lib/ui-kit/Pagination/Pagination.js.map +1 -1
- package/lib/ui-kit/Pagination/PaginationContainer.d.ts +7 -0
- package/lib/ui-kit/Pagination/PaginationContainer.js +28 -0
- package/lib/ui-kit/Pagination/PaginationContainer.js.map +1 -0
- package/lib/ui-kit/Pagination/paginationBlockStyle.d.ts +1 -0
- package/lib/ui-kit/Pagination/paginationBlockStyle.js +2 -0
- package/lib/ui-kit/Pagination/paginationBlockStyle.js.map +1 -0
- package/lib/ui-kit/Pagination/renderPages.d.ts +2 -2
- package/lib/ui-kit/Pagination/renderPages.js +1 -1
- package/lib/ui-kit/Pagination/renderPages.js.map +1 -1
- package/lib/ui-kit/Select/Select.js +1 -1
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/lib/utils/formatDate.d.ts +1 -0
- package/lib/utils/formatDate.js +2 -0
- package/lib/utils/formatDate.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +15 -12
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Depository/useDepository.d.ts +1 -1
- package/mobile/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +4 -4
- package/mobile/bundle/ui-kit/BaseTile/BaseTile.d.ts +1 -1
- package/mobile/bundle/ui-kit/Pagination/PageSizeSelector.d.ts +7 -0
- package/mobile/bundle/ui-kit/Pagination/Pagination.d.ts +3 -2
- package/mobile/bundle/ui-kit/Pagination/PaginationContainer.d.ts +7 -0
- package/mobile/bundle/ui-kit/Pagination/paginationBlockStyle.d.ts +1 -0
- package/mobile/bundle/ui-kit/Pagination/renderPages.d.ts +2 -2
- package/mobile/bundle/utils/formatDate.d.ts +1 -0
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +2 -2
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/dist/components/CarouselInvestmentCard/CarouselInvestmentCard.js +1 -1
- package/mobile/dist/components/CarouselInvestmentCard/CarouselInvestmentCard.js.map +1 -1
- package/mobile/dist/components/ContentPage/ContentPage.js +1 -1
- package/mobile/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/mobile/dist/components/Depository/Depository.js +3 -2
- package/mobile/dist/components/Depository/Depository.js.map +1 -1
- package/mobile/dist/components/Depository/DepositoryItem.js +3 -3
- package/mobile/dist/components/Depository/DepositoryItem.js.map +1 -1
- package/mobile/dist/components/Depository/useDepository.d.ts +1 -1
- package/mobile/dist/components/ProductTile/ProductTile.js +1 -1
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +4 -4
- package/mobile/dist/ui-kit/BaseTile/BaseTile.d.ts +1 -1
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js +8 -5
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/dist/ui-kit/Icon/Icon.js +1 -1
- package/mobile/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/mobile/dist/ui-kit/Pagination/PageSizeSelector.d.ts +7 -0
- package/mobile/dist/ui-kit/Pagination/PageSizeSelector.js +12 -0
- package/mobile/dist/ui-kit/Pagination/PageSizeSelector.js.map +1 -0
- package/mobile/dist/ui-kit/Pagination/Pagination.d.ts +3 -2
- package/mobile/dist/ui-kit/Pagination/Pagination.js +4 -27
- package/mobile/dist/ui-kit/Pagination/Pagination.js.map +1 -1
- package/mobile/dist/ui-kit/Pagination/PaginationContainer.d.ts +7 -0
- package/mobile/dist/ui-kit/Pagination/PaginationContainer.js +31 -0
- package/mobile/dist/ui-kit/Pagination/PaginationContainer.js.map +1 -0
- package/mobile/dist/ui-kit/Pagination/paginationBlockStyle.d.ts +1 -0
- package/mobile/dist/ui-kit/Pagination/paginationBlockStyle.js +4 -0
- package/mobile/dist/ui-kit/Pagination/paginationBlockStyle.js.map +1 -0
- package/mobile/dist/ui-kit/Pagination/renderPages.d.ts +2 -2
- package/mobile/dist/ui-kit/Pagination/renderPages.js +2 -2
- package/mobile/dist/ui-kit/Pagination/renderPages.js.map +1 -1
- package/mobile/dist/ui-kit/Select/Select.js +1 -1
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/dist/utils/formatDate.d.ts +1 -0
- package/mobile/dist/utils/formatDate.js +5 -0
- package/mobile/dist/utils/formatDate.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +2 -2
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/lib/components/CarouselInvestmentCard/CarouselInvestmentCard.js +1 -1
- package/mobile/lib/components/CarouselInvestmentCard/CarouselInvestmentCard.js.map +1 -1
- package/mobile/lib/components/ContentPage/ContentPage.js +1 -1
- package/mobile/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/mobile/lib/components/Depository/Depository.js +3 -2
- package/mobile/lib/components/Depository/Depository.js.map +1 -1
- package/mobile/lib/components/Depository/DepositoryItem.js +3 -3
- package/mobile/lib/components/Depository/DepositoryItem.js.map +1 -1
- package/mobile/lib/components/Depository/useDepository.d.ts +1 -1
- package/mobile/lib/components/ProductTile/ProductTile.js +1 -1
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +4 -4
- package/mobile/lib/ui-kit/BaseTile/BaseTile.d.ts +1 -1
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js +8 -5
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/lib/ui-kit/Icon/Icon.js +1 -1
- package/mobile/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/mobile/lib/ui-kit/Pagination/PageSizeSelector.d.ts +7 -0
- package/mobile/lib/ui-kit/Pagination/PageSizeSelector.js +9 -0
- package/mobile/lib/ui-kit/Pagination/PageSizeSelector.js.map +1 -0
- package/mobile/lib/ui-kit/Pagination/Pagination.d.ts +3 -2
- package/mobile/lib/ui-kit/Pagination/Pagination.js +3 -26
- package/mobile/lib/ui-kit/Pagination/Pagination.js.map +1 -1
- package/mobile/lib/ui-kit/Pagination/PaginationContainer.d.ts +7 -0
- package/mobile/lib/ui-kit/Pagination/PaginationContainer.js +28 -0
- package/mobile/lib/ui-kit/Pagination/PaginationContainer.js.map +1 -0
- package/mobile/lib/ui-kit/Pagination/paginationBlockStyle.d.ts +1 -0
- package/mobile/lib/ui-kit/Pagination/paginationBlockStyle.js +2 -0
- package/mobile/lib/ui-kit/Pagination/paginationBlockStyle.js.map +1 -0
- package/mobile/lib/ui-kit/Pagination/renderPages.d.ts +2 -2
- package/mobile/lib/ui-kit/Pagination/renderPages.js +1 -1
- package/mobile/lib/ui-kit/Pagination/renderPages.js.map +1 -1
- package/mobile/lib/ui-kit/Select/Select.js +1 -1
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/utils/formatDate.d.ts +1 -0
- package/mobile/lib/utils/formatDate.js +2 -0
- package/mobile/lib/utils/formatDate.js.map +1 -0
- package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +2 -2
- package/mobile/src/components/CarouselInvestmentCard/CarouselInvestmentCard.tsx +1 -1
- package/mobile/src/components/ContentPage/ContentPage.tsx +1 -1
- package/mobile/src/components/Depository/Depository.tsx +5 -2
- package/mobile/src/components/Depository/DepositoryItem.tsx +3 -3
- package/mobile/src/components/Depository/useDepository.ts +1 -1
- package/mobile/src/components/ProductTile/ProductTile.example.json +1 -1
- package/mobile/src/components/ProductTile/ProductTile.tsx +1 -1
- package/mobile/src/ui-kit/BaseProductTile/BaseProductTile.tsx +6 -5
- package/mobile/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +4 -4
- package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +24 -18
- package/mobile/src/ui-kit/Icon/Icon.tsx +1 -1
- package/mobile/src/ui-kit/Pagination/PageSizeSelector.tsx +27 -0
- package/mobile/src/ui-kit/Pagination/Pagination.tsx +26 -80
- package/mobile/src/ui-kit/Pagination/PaginationContainer.tsx +87 -0
- package/mobile/src/ui-kit/Pagination/paginationBlockStyle.ts +2 -0
- package/mobile/src/ui-kit/Pagination/renderPages.tsx +3 -2
- package/mobile/src/ui-kit/Select/Select.tsx +2 -2
- package/mobile/src/utils/formatDate.ts +1 -0
- package/package.json +1 -1
- package/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +2 -2
- package/src/components/CarouselInvestmentCard/CarouselInvestmentCard.tsx +1 -1
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +1 -1
- package/src/components/ContentPage/ContentPage.tsx +1 -1
- package/src/components/Depository/Depository.fixture.tsx +2 -0
- package/src/components/Depository/Depository.tsx +5 -2
- package/src/components/Depository/DepositoryItem.tsx +3 -3
- package/src/components/Depository/useDepository.ts +1 -1
- package/src/components/ProductBlock/ProductBlock.fixture.mobile.tsx +1 -1
- package/src/components/ProductTile/ProductTile.example.json +1 -1
- package/src/components/ProductTile/ProductTile.tsx +1 -1
- package/src/components/Tile/Tile.fixture.tsx +1 -2
- package/src/ui-kit/BaseProductTile/BaseProductTile.tsx +6 -5
- package/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +4 -4
- package/src/ui-kit/BaseTile/BaseTile.tsx +24 -18
- package/src/ui-kit/Icon/Icon.tsx +1 -1
- package/src/ui-kit/Pagination/PageSizeSelector.tsx +27 -0
- package/src/ui-kit/Pagination/Pagination.tsx +26 -80
- package/src/ui-kit/Pagination/PaginationContainer.tsx +87 -0
- package/src/ui-kit/Pagination/paginationBlockStyle.ts +2 -0
- package/src/ui-kit/Pagination/renderPages.tsx +3 -2
- package/src/ui-kit/Select/Select.tsx +2 -2
- package/src/utils/formatDate.ts +1 -0
- package/tailwind.config.cjs +20 -1
- package/bundle/utils/convertTimestampToDate.d.ts +0 -1
- package/dist/utils/convertTimestampToDate.d.ts +0 -1
- package/dist/utils/convertTimestampToDate.js +0 -16
- package/dist/utils/convertTimestampToDate.js.map +0 -1
- package/lib/utils/convertTimestampToDate.d.ts +0 -1
- package/lib/utils/convertTimestampToDate.js +0 -13
- package/lib/utils/convertTimestampToDate.js.map +0 -1
- package/mobile/bundle/utils/convertTimestampToDate.d.ts +0 -1
- package/mobile/dist/utils/convertTimestampToDate.d.ts +0 -1
- package/mobile/dist/utils/convertTimestampToDate.js +0 -16
- package/mobile/dist/utils/convertTimestampToDate.js.map +0 -1
- package/mobile/lib/utils/convertTimestampToDate.d.ts +0 -1
- package/mobile/lib/utils/convertTimestampToDate.js +0 -13
- package/mobile/lib/utils/convertTimestampToDate.js.map +0 -1
- package/mobile/src/utils/convertTimestampToDate.ts +0 -15
- package/src/utils/convertTimestampToDate.ts +0 -15
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { Icon } from '../Icon/Icon';
|
|
3
|
+
import { paginationBlockStyle } from './paginationBlockStyle';
|
|
4
|
+
import { renderPages } from './renderPages';
|
|
5
|
+
|
|
6
|
+
const ICON_SIZE = { width: '24', height: '24' };
|
|
7
|
+
|
|
8
|
+
export interface PaginationContainerProps {
|
|
9
|
+
currentPage: number;
|
|
10
|
+
onPageChange: (page: number) => void;
|
|
11
|
+
totalPages: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const PaginationContainer = ({
|
|
15
|
+
currentPage,
|
|
16
|
+
onPageChange,
|
|
17
|
+
totalPages,
|
|
18
|
+
}: PaginationContainerProps) => {
|
|
19
|
+
const pages = useMemo(
|
|
20
|
+
() =>
|
|
21
|
+
new Array(totalPages).fill({
|
|
22
|
+
currentPage,
|
|
23
|
+
onPageChange,
|
|
24
|
+
totalPages,
|
|
25
|
+
}),
|
|
26
|
+
[totalPages, currentPage],
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const handlePrevPage = useCallback(() => {
|
|
30
|
+
if (currentPage > 1) {
|
|
31
|
+
onPageChange(currentPage - 1);
|
|
32
|
+
}
|
|
33
|
+
}, [currentPage]);
|
|
34
|
+
|
|
35
|
+
const handleNextPage = useCallback(() => {
|
|
36
|
+
if (currentPage < totalPages - 1) {
|
|
37
|
+
onPageChange(currentPage + 1);
|
|
38
|
+
}
|
|
39
|
+
}, [currentPage, totalPages]);
|
|
40
|
+
|
|
41
|
+
const handleFirstPage = useCallback(() => onPageChange(1), []);
|
|
42
|
+
const handleLastPage = useCallback(() => onPageChange(totalPages), [totalPages]);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className="flex gap-m items-center">
|
|
46
|
+
<div onClick={handlePrevPage}>
|
|
47
|
+
<Icon
|
|
48
|
+
name="ArrowLeftIcon"
|
|
49
|
+
iconVersion="black"
|
|
50
|
+
imageClassName={getIconStyle(currentPage === 1)}
|
|
51
|
+
{...ICON_SIZE}
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
<div className="flex gap-xs">
|
|
55
|
+
{currentPage > 1 ? (
|
|
56
|
+
<div onClick={handleFirstPage} className={paginationBlockStyle} aria-label="Страница 1">
|
|
57
|
+
1
|
|
58
|
+
</div>
|
|
59
|
+
) : null}
|
|
60
|
+
{currentPage > 4 ? <div className="py-m px-s">...</div> : null}
|
|
61
|
+
{pages.map(renderPages)}
|
|
62
|
+
{currentPage < totalPages - 3 ? <div className="py-m px-s">...</div> : null}
|
|
63
|
+
{currentPage < totalPages ? (
|
|
64
|
+
<div
|
|
65
|
+
onClick={handleLastPage}
|
|
66
|
+
className={paginationBlockStyle}
|
|
67
|
+
aria-label={`Страница ${totalPages}}`}
|
|
68
|
+
>
|
|
69
|
+
{totalPages}
|
|
70
|
+
</div>
|
|
71
|
+
) : null}
|
|
72
|
+
</div>
|
|
73
|
+
<div onClick={handleNextPage}>
|
|
74
|
+
<Icon
|
|
75
|
+
className="rotate-180"
|
|
76
|
+
name="ArrowLeftIcon"
|
|
77
|
+
iconVersion="black"
|
|
78
|
+
imageClassName={getIconStyle(currentPage === totalPages)}
|
|
79
|
+
{...ICON_SIZE}
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const getIconStyle = (condition: boolean) =>
|
|
87
|
+
condition ? 'opacity-20' : 'cursor-pointer hover:opacity-60';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { paginationBlockStyle
|
|
1
|
+
import { paginationBlockStyle } from './paginationBlockStyle';
|
|
2
|
+
import type { PaginationContainerProps } from './PaginationContainer';
|
|
2
3
|
import { shouldRenderPage } from './shouldRenderPage';
|
|
3
4
|
|
|
4
|
-
export const renderPages = (pagesParams:
|
|
5
|
+
export const renderPages = (pagesParams: PaginationContainerProps, index: number) => {
|
|
5
6
|
const { currentPage, onPageChange, totalPages } = pagesParams;
|
|
6
7
|
const page = index + 1;
|
|
7
8
|
if (page === currentPage) {
|
|
@@ -2,12 +2,12 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
4
4
|
import { LabelProps } from '../../model/HeadlineType';
|
|
5
|
-
import { Text } from '../../ui-kit/Text/Text';
|
|
6
5
|
import { style } from '../../utils/style';
|
|
7
6
|
import { Icon } from '../Icon/Icon';
|
|
8
7
|
import { Input } from '../Input/Input';
|
|
9
|
-
import
|
|
8
|
+
import { Text } from '../Text/Text';
|
|
10
9
|
import { formatOption } from './formatOption';
|
|
10
|
+
import type { Option } from './Option';
|
|
11
11
|
import { useSelectPopup } from './useSelectPopup';
|
|
12
12
|
|
|
13
13
|
export type SelectProps = LabelProps & {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const formatDate = (date: string) => date.split('-').reverse().join('.');
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
3
3
|
import type { ProductColorVersion } from '../../model/ProductColorVersion';
|
|
4
|
-
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
4
|
import { BaseTile } from '../../ui-kit/BaseTile/BaseTile';
|
|
5
|
+
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
6
|
import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
7
7
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
8
|
import { Text } from '../../ui-kit/Text/Text';
|
|
@@ -54,7 +54,7 @@ export const CarouselCatalogCard = JSX<CarouselCatalogCardProps>(
|
|
|
54
54
|
<Img className="flex justify-center align-center mb-xl" image={image} />
|
|
55
55
|
) : null
|
|
56
56
|
}
|
|
57
|
-
buttons={renderButtonsSection([button], { buttonClassName: 'w-full
|
|
57
|
+
buttons={renderButtonsSection([button], { buttonClassName: 'w-full self-end' })}
|
|
58
58
|
>
|
|
59
59
|
{colors?.length ? (
|
|
60
60
|
<div className="flex text-secondary-text mb-m">
|
|
@@ -39,7 +39,7 @@ export const CarouselInvestmentCard = JSX<CarouselInvestmentCardProps>(
|
|
|
39
39
|
title={
|
|
40
40
|
title ? <Heading headingType="h4" as="h3" className="mb-m z-10" title={title} /> : null
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
rightImage={image?.src ? <Img image={image} /> : null}
|
|
43
43
|
>
|
|
44
44
|
<div className="flex justify-between mb-m">
|
|
45
45
|
{description ? (
|
|
@@ -50,7 +50,7 @@ export const CarouselRecommendationCard = JSX<RecommendationCardProps>(
|
|
|
50
50
|
/>
|
|
51
51
|
) : null
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
rightImage={icon?.icon || icon?.src ? <Img image={icon} /> : null}
|
|
54
54
|
buttons={
|
|
55
55
|
socialMedia.length ? <SocialMedia media={socialMedia} showButtonText={true} /> : null
|
|
56
56
|
}
|
|
@@ -36,7 +36,7 @@ export const ContentPage: JSXBlock<ContentPageProps> = JSX<ContentPageProps>(
|
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
38
|
<div data-theme={colorPalette}>
|
|
39
|
-
<section className={style('relative', pageStyle, className)}>
|
|
39
|
+
<section className={style('@container relative', pageStyle, className)}>
|
|
40
40
|
{slots?.header ? (
|
|
41
41
|
<div className="relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]">
|
|
42
42
|
{renderBlocksList(slots?.header, { ...options, slotName: 'header' })}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import '../../setup-fixture';
|
|
2
|
+
import { PopupManager } from '../../ui-kit/PopupManager/PopupManager';
|
|
2
3
|
import { Depository } from './Depository';
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
default: (
|
|
6
7
|
<div className="container grid grid-cols-12">
|
|
7
8
|
<Depository className="col-span-12" />
|
|
9
|
+
<PopupManager />
|
|
8
10
|
</div>
|
|
9
11
|
),
|
|
10
12
|
};
|
|
@@ -15,11 +15,12 @@ interface DepositoryProps extends DepositoryContent, UniBlockProps {}
|
|
|
15
15
|
export const Depository: JSXBlock<DepositoryProps> = JSX<DepositoryProps>(
|
|
16
16
|
({ className, ...rest }) => {
|
|
17
17
|
const [currentPage, setCurrentPage] = useState(0);
|
|
18
|
-
const [itemCount] = useState(DEFAULT_ITEMS_COUNT);
|
|
18
|
+
const [itemCount, setItemCount] = useState(DEFAULT_ITEMS_COUNT);
|
|
19
19
|
|
|
20
20
|
const { totalPages = 0, items } = useDepository(itemCount, currentPage);
|
|
21
21
|
|
|
22
|
-
const handleChangePage = useCallback((page) => setCurrentPage(page - 1), []);
|
|
22
|
+
const handleChangePage = useCallback((page: number) => setCurrentPage(page - 1), []);
|
|
23
|
+
const handleItemCountChange = useCallback((count: number) => setItemCount(count), []);
|
|
23
24
|
|
|
24
25
|
return (
|
|
25
26
|
<BlockWrapper className={style(className, 'container p-4xl')} {...rest}>
|
|
@@ -35,6 +36,8 @@ export const Depository: JSXBlock<DepositoryProps> = JSX<DepositoryProps>(
|
|
|
35
36
|
currentPage={currentPage + 1}
|
|
36
37
|
onPageChange={handleChangePage}
|
|
37
38
|
totalPages={totalPages + 1}
|
|
39
|
+
itemCount={itemCount}
|
|
40
|
+
onItemCountChange={handleItemCountChange}
|
|
38
41
|
/>
|
|
39
42
|
</div>
|
|
40
43
|
</BlockWrapper>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useLink } from '../../hooks/useLink';
|
|
2
|
-
import {
|
|
2
|
+
import { formatDate } from '../../utils/formatDate';
|
|
3
3
|
import { DepositoryDataItem } from './useDepository';
|
|
4
4
|
|
|
5
|
-
export const DepositoryItem = ({ title, timestamp =
|
|
5
|
+
export const DepositoryItem = ({ title, timestamp = '', publicId }: DepositoryDataItem) => {
|
|
6
6
|
const link = useLink();
|
|
7
7
|
const { href } = link({ href: `/api/v1/depository/${publicId}/file` });
|
|
8
8
|
|
|
9
9
|
return (
|
|
10
10
|
<div className="grid grid-cols-12 py-lg border-gray border-opacity-50 border-b" key={publicId}>
|
|
11
11
|
<div className="col-span-2 text-m">
|
|
12
|
-
<span>{
|
|
12
|
+
<span>{formatDate(timestamp)}</span>
|
|
13
13
|
</div>
|
|
14
14
|
<div className="col-span-10 text-h6 hover:text-primary-active">
|
|
15
15
|
<a href={href} download aria-label="Скачать">
|
|
@@ -24,7 +24,7 @@ export const ProductTile = JSX<ProductTileProps>(
|
|
|
24
24
|
padding={padding}
|
|
25
25
|
headlineVersion={headlineVersion}
|
|
26
26
|
isTabularBenefits={isTabularBenefits}
|
|
27
|
-
imageOptions={{
|
|
27
|
+
imageOptions={{ isImageSecondary: true, ...imageOptions }}
|
|
28
28
|
{...rest}
|
|
29
29
|
>
|
|
30
30
|
{additionalDescription ? (
|
|
@@ -9,7 +9,6 @@ const image: Picture = {
|
|
|
9
9
|
format: 'webp',
|
|
10
10
|
size: {
|
|
11
11
|
width: 445,
|
|
12
|
-
height: 202,
|
|
13
12
|
},
|
|
14
13
|
};
|
|
15
14
|
|
|
@@ -61,7 +60,7 @@ export const TILE_PREMIUM: TileContent = {
|
|
|
61
60
|
const tags = ['Tag #1', 'Tag #2', 'Tag #3'];
|
|
62
61
|
|
|
63
62
|
export default {
|
|
64
|
-
|
|
63
|
+
default: (
|
|
65
64
|
<div className="container grid grid-cols-12">
|
|
66
65
|
<Tile className="col-span-8" {...TILE} />
|
|
67
66
|
</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { Headline } from '../../components/Headline/Headline';
|
|
3
|
+
import type { HeadlineVersion } from '../../model/HeadlineType';
|
|
3
4
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
5
|
import type { VNode } from '../../model/VNode';
|
|
5
6
|
import { BaseTile } from '../BaseTile/BaseTile';
|
|
@@ -9,9 +10,8 @@ import { Img } from '../Img/Img';
|
|
|
9
10
|
import { List } from '../List/List';
|
|
10
11
|
import { RichText } from '../RichText/RichText';
|
|
11
12
|
import { Tags } from '../Tags/Tags';
|
|
12
|
-
import type { BaseProductTileContent } from './BaseProductTileContent';
|
|
13
|
-
import type { HeadlineVersion } from '../../model/HeadlineType';
|
|
14
13
|
import type { TextAlign } from '../Text/TextProps';
|
|
14
|
+
import type { BaseProductTileContent } from './BaseProductTileContent';
|
|
15
15
|
|
|
16
16
|
interface BaseProductTileProps extends UniBlockProps, BaseProductTileContent {}
|
|
17
17
|
|
|
@@ -36,10 +36,10 @@ export const BaseProductTile = JSX<BaseProductTileProps>(
|
|
|
36
36
|
buttons,
|
|
37
37
|
image,
|
|
38
38
|
imageOptions: {
|
|
39
|
-
imageAlign = '
|
|
39
|
+
imageAlign = 'center',
|
|
40
40
|
directionRight = true,
|
|
41
|
-
isBackground,
|
|
42
41
|
isImageAlwaysOnRight,
|
|
42
|
+
isImageSecondary = false,
|
|
43
43
|
} = {},
|
|
44
44
|
children,
|
|
45
45
|
}) => {
|
|
@@ -55,7 +55,8 @@ export const BaseProductTile = JSX<BaseProductTileProps>(
|
|
|
55
55
|
padding={padding}
|
|
56
56
|
defaultPadding={defaultPadding}
|
|
57
57
|
{...(isFullWidthTitle ? { insetTitle: headline } : { title: headline })}
|
|
58
|
-
{...
|
|
58
|
+
{...leftOrRightImage(img, directionRight)}
|
|
59
|
+
isImageSecondary={isImageSecondary}
|
|
59
60
|
imageAlign={imageAlign}
|
|
60
61
|
isImageAlwaysOnRight={isImageAlwaysOnRight}
|
|
61
62
|
buttons={renderButtonsSection(buttons)}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Align } from '../../model/Align';
|
|
2
2
|
import type { BulletsProps } from '../../model/Bullets';
|
|
3
3
|
import type { HeadlineProps } from '../../model/HeadlineType';
|
|
4
|
+
import type { BenefitsListContent } from '../BenefitsList/BenefitsListContent';
|
|
5
|
+
import type { ButtonsSectionContent } from '../Button/ButtonsSectionContent';
|
|
4
6
|
import type { ImageContent } from '../Img/ImgProps';
|
|
5
7
|
import type { ListContent } from '../List/ListContent';
|
|
6
8
|
import type { RichTextProps } from '../RichText/RichTextProps';
|
|
7
9
|
import type { TagsContent } from '../Tags/TagsContent';
|
|
8
|
-
import type { BenefitsListContent } from '../BenefitsList/BenefitsListContent';
|
|
9
|
-
import type { ButtonsSectionContent } from '../Button/ButtonsSectionContent';
|
|
10
10
|
|
|
11
11
|
/** @title Доп. настройки картинки */
|
|
12
12
|
export interface TileImageOptions {
|
|
@@ -14,8 +14,8 @@ export interface TileImageOptions {
|
|
|
14
14
|
directionRight?: boolean;
|
|
15
15
|
/** @title Выравнивание изображения */
|
|
16
16
|
imageAlign?: Align;
|
|
17
|
-
/** @title
|
|
18
|
-
|
|
17
|
+
/** @title Второстепенное изображение */
|
|
18
|
+
isImageSecondary?: boolean;
|
|
19
19
|
/** @title Изображение всегда справа */
|
|
20
20
|
isImageAlwaysOnRight?: boolean;
|
|
21
21
|
}
|
|
@@ -10,9 +10,9 @@ interface BaseTileProps extends UniBlockProps {
|
|
|
10
10
|
leftImage?: VNode;
|
|
11
11
|
rightImage?: VNode;
|
|
12
12
|
imageAlign?: Align;
|
|
13
|
-
backImage?: VNode;
|
|
14
13
|
buttons?: VNode;
|
|
15
14
|
isImageAlwaysOnRight?: boolean;
|
|
15
|
+
isImageSecondary?: boolean;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const imageAlignmentMap: Record<Align, string> = {
|
|
@@ -32,8 +32,8 @@ export const BaseTile = JSX<BaseTileProps>(
|
|
|
32
32
|
leftImage,
|
|
33
33
|
rightImage,
|
|
34
34
|
imageAlign,
|
|
35
|
-
backImage,
|
|
36
35
|
isImageAlwaysOnRight = false,
|
|
36
|
+
isImageSecondary,
|
|
37
37
|
children,
|
|
38
38
|
}) => (
|
|
39
39
|
<div
|
|
@@ -46,35 +46,41 @@ export const BaseTile = JSX<BaseTileProps>(
|
|
|
46
46
|
{title ? <div className="relative">{title}</div> : null}
|
|
47
47
|
<div
|
|
48
48
|
className={style(
|
|
49
|
-
'grow relative flex justify-around @
|
|
50
|
-
isImageAlwaysOnRight ? 'flex-row' : 'flex-col-reverse @lg:flex-row',
|
|
49
|
+
'grow relative flex flex-col-reverse @xl:flex-row justify-around @xl:justify-between items-stretch gap-3xl',
|
|
51
50
|
)}
|
|
52
51
|
>
|
|
53
52
|
{renderImageContainer(leftImage, { imageAlign })}
|
|
54
53
|
<div
|
|
55
54
|
className={style(
|
|
56
|
-
'
|
|
55
|
+
'grid gap-3xl',
|
|
56
|
+
rightImage ? '@xl:grid-cols-2' : '',
|
|
57
57
|
leftImage ? '' : 'grow',
|
|
58
58
|
)}
|
|
59
59
|
>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
<div className="grow grid gap-3xl row-span-1">
|
|
61
|
+
{insetTitle}
|
|
62
|
+
{children}
|
|
63
|
+
</div>
|
|
64
|
+
{renderImageContainer(rightImage, {
|
|
65
|
+
className: style(
|
|
66
|
+
'@xl:justify-self-end row-start-1 @xl:row-end-3 @xl:col-start-2',
|
|
67
|
+
positionStyle(isImageAlwaysOnRight),
|
|
68
|
+
isImageSecondary ? 'hidden @xl:block' : '',
|
|
69
|
+
),
|
|
70
|
+
imageAlign,
|
|
71
|
+
})}
|
|
72
|
+
<div className="self-end">{buttons}</div>
|
|
68
73
|
</div>
|
|
69
|
-
{renderImageContainer(rightImage, {
|
|
70
|
-
className: isImageAlwaysOnRight ? '' : '@xl:order-1',
|
|
71
|
-
imageAlign,
|
|
72
|
-
})}
|
|
73
74
|
</div>
|
|
74
75
|
</div>
|
|
75
76
|
),
|
|
76
77
|
);
|
|
77
78
|
|
|
79
|
+
const positionStyle = (isImageAlwaysOnRight: boolean) =>
|
|
80
|
+
isImageAlwaysOnRight
|
|
81
|
+
? 'ml-xl justify-self-end row-start-1 row-end-3 col-start-2 self-center'
|
|
82
|
+
: '';
|
|
83
|
+
|
|
78
84
|
const renderImageContainer = (
|
|
79
85
|
image: VNode | undefined,
|
|
80
86
|
{ className, imageAlign }: { className?: string; imageAlign?: Align },
|
|
@@ -82,7 +88,7 @@ const renderImageContainer = (
|
|
|
82
88
|
image ? (
|
|
83
89
|
<div
|
|
84
90
|
className={style(
|
|
85
|
-
'
|
|
91
|
+
'shrink-1/2 justify-self-center',
|
|
86
92
|
imageAlign && imageAlignmentMap[imageAlign],
|
|
87
93
|
className,
|
|
88
94
|
)}
|
package/src/ui-kit/Icon/Icon.tsx
CHANGED
|
@@ -71,7 +71,7 @@ const getInlineStyle = (className?: string, height?: string) => {
|
|
|
71
71
|
return {};
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
return { height: isOnlyDigits(height) ? `${height}px` : height };
|
|
74
|
+
return { height: isOnlyDigits(height) ? `${height}px` : height, width: 'auto' };
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
const getSvgSize = (width?: string) => (width ? '' : 'w-full h-full');
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { Select } from '../Select/Select';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_OPTIONS = [{ key: '10' }, { key: '50' }, { key: '100' }];
|
|
5
|
+
|
|
6
|
+
interface PageSizeSelectorProps {
|
|
7
|
+
itemCount: number;
|
|
8
|
+
onItemCountChange: (count: number) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const PageSizeSelector = ({ itemCount, onItemCountChange }: PageSizeSelectorProps) => {
|
|
12
|
+
const handleItemCountChange = useCallback(
|
|
13
|
+
({ key }: { key: string }) => onItemCountChange(Number(key)),
|
|
14
|
+
[],
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div className="flex items-center gap-s">
|
|
19
|
+
<span>Показать по</span>
|
|
20
|
+
<Select
|
|
21
|
+
onChange={handleItemCountChange}
|
|
22
|
+
value={{ key: String(itemCount) }}
|
|
23
|
+
options={DEFAULT_OPTIONS}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -1,87 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { renderPages } from './renderPages';
|
|
4
|
-
|
|
5
|
-
export const paginationBlockStyle =
|
|
6
|
-
'py-m px-lg rounded-md cursor-pointer hover:bg-green-more-dark hover:text-white';
|
|
1
|
+
import { PageSizeSelector } from './PageSizeSelector';
|
|
2
|
+
import { PaginationContainer } from './PaginationContainer';
|
|
7
3
|
|
|
8
4
|
export interface PaginationProps {
|
|
9
5
|
currentPage: number;
|
|
10
6
|
onPageChange: (page: number) => void;
|
|
11
7
|
totalPages: number;
|
|
8
|
+
itemCount?: number;
|
|
9
|
+
onItemCountChange?: (count: number) => void;
|
|
12
10
|
}
|
|
13
11
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
onPageChange,
|
|
37
|
-
totalPages,
|
|
38
|
-
}),
|
|
39
|
-
[totalPages, currentPage],
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div className="mt-3xl flex items-center select-none" role="navigation" aria-label="Пагинация">
|
|
44
|
-
<div className="flex gap-m items-center">
|
|
45
|
-
<div onClick={handlePrevPage}>
|
|
46
|
-
<Icon
|
|
47
|
-
name="ArrowLeftIcon"
|
|
48
|
-
iconVersion="black"
|
|
49
|
-
imageClassName={getIconStyle(currentPage === 1)}
|
|
50
|
-
{...ICON_SIZE}
|
|
51
|
-
/>
|
|
52
|
-
</div>
|
|
53
|
-
<div className="flex gap-xs">
|
|
54
|
-
{currentPage > 1 ? (
|
|
55
|
-
<div onClick={handleFirstPage} className={paginationBlockStyle} aria-label="Страница 1">
|
|
56
|
-
1
|
|
57
|
-
</div>
|
|
58
|
-
) : null}
|
|
59
|
-
{currentPage > 4 ? <div className="py-m px-s">...</div> : null}
|
|
60
|
-
{pages.map(renderPages)}
|
|
61
|
-
{currentPage < totalPages - 3 ? <div className="py-m px-s">...</div> : null}
|
|
62
|
-
{currentPage < totalPages ? (
|
|
63
|
-
<div
|
|
64
|
-
onClick={handleLastPage}
|
|
65
|
-
className={paginationBlockStyle}
|
|
66
|
-
aria-label={`Страница ${totalPages}}`}
|
|
67
|
-
>
|
|
68
|
-
{totalPages}
|
|
69
|
-
</div>
|
|
70
|
-
) : null}
|
|
71
|
-
</div>
|
|
72
|
-
<div onClick={handleNextPage}>
|
|
73
|
-
<Icon
|
|
74
|
-
className="rotate-180"
|
|
75
|
-
name="ArrowLeftIcon"
|
|
76
|
-
iconVersion="black"
|
|
77
|
-
imageClassName={getIconStyle(currentPage === totalPages)}
|
|
78
|
-
{...ICON_SIZE}
|
|
79
|
-
/>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
);
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const getIconStyle = (condition: boolean) =>
|
|
87
|
-
condition ? 'opacity-20' : 'cursor-pointer hover:opacity-60';
|
|
12
|
+
export const Pagination = ({
|
|
13
|
+
currentPage,
|
|
14
|
+
onPageChange,
|
|
15
|
+
totalPages,
|
|
16
|
+
itemCount,
|
|
17
|
+
onItemCountChange,
|
|
18
|
+
}: PaginationProps) => (
|
|
19
|
+
<div
|
|
20
|
+
className="mt-3xl flex justify-between items-center select-none"
|
|
21
|
+
role="navigation"
|
|
22
|
+
aria-label="Пагинация"
|
|
23
|
+
>
|
|
24
|
+
<PaginationContainer
|
|
25
|
+
currentPage={currentPage}
|
|
26
|
+
onPageChange={onPageChange}
|
|
27
|
+
totalPages={totalPages}
|
|
28
|
+
/>
|
|
29
|
+
{itemCount && onItemCountChange ? (
|
|
30
|
+
<PageSizeSelector itemCount={itemCount} onItemCountChange={onItemCountChange} />
|
|
31
|
+
) : null}
|
|
32
|
+
</div>
|
|
33
|
+
);
|