@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
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const paginationBlockStyle = "py-m px-lg rounded-md cursor-pointer hover:bg-green-more-dark hover:text-white";
|
|
3
2
|
export interface PaginationProps {
|
|
4
3
|
currentPage: number;
|
|
5
4
|
onPageChange: (page: number) => void;
|
|
6
5
|
totalPages: number;
|
|
6
|
+
itemCount?: number;
|
|
7
|
+
onItemCountChange?: (count: number) => void;
|
|
7
8
|
}
|
|
8
|
-
export declare const Pagination: ({ currentPage, onPageChange, totalPages }: PaginationProps) => JSX.Element;
|
|
9
|
+
export declare const Pagination: ({ currentPage, onPageChange, totalPages, itemCount, onItemCountChange, }: PaginationProps) => JSX.Element;
|
|
@@ -1,28 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export const paginationBlockStyle = 'py-m px-lg rounded-md cursor-pointer hover:bg-green-more-dark hover:text-white';
|
|
6
|
-
const ICON_SIZE = { width: '24', height: '24' };
|
|
7
|
-
export const Pagination = ({ currentPage, onPageChange, totalPages }) => {
|
|
8
|
-
const handlePrevPage = useCallback(() => {
|
|
9
|
-
if (currentPage > 1) {
|
|
10
|
-
onPageChange(currentPage - 1);
|
|
11
|
-
}
|
|
12
|
-
}, [currentPage]);
|
|
13
|
-
const handleNextPage = useCallback(() => {
|
|
14
|
-
if (currentPage < totalPages - 1) {
|
|
15
|
-
onPageChange(currentPage + 1);
|
|
16
|
-
}
|
|
17
|
-
}, [currentPage, totalPages]);
|
|
18
|
-
const handleFirstPage = useCallback(() => onPageChange(1), []);
|
|
19
|
-
const handleLastPage = useCallback(() => onPageChange(totalPages), [totalPages]);
|
|
20
|
-
const pages = useMemo(() => new Array(totalPages).fill({
|
|
21
|
-
currentPage,
|
|
22
|
-
onPageChange,
|
|
23
|
-
totalPages,
|
|
24
|
-
}), [totalPages, currentPage]);
|
|
25
|
-
return (_jsx("div", { className: "mt-3xl flex items-center select-none", role: "navigation", "aria-label": "\u041F\u0430\u0433\u0438\u043D\u0430\u0446\u0438\u044F", children: _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 }) }), _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 }) })] }) }));
|
|
26
|
-
};
|
|
27
|
-
const getIconStyle = (condition) => condition ? 'opacity-20' : 'cursor-pointer hover:opacity-60';
|
|
2
|
+
import { PageSizeSelector } from './PageSizeSelector.js';
|
|
3
|
+
import { PaginationContainer } from './PaginationContainer.js';
|
|
4
|
+
export const Pagination = ({ currentPage, onPageChange, totalPages, itemCount, onItemCountChange, }) => (_jsxs("div", { className: "mt-3xl flex justify-between items-center select-none", role: "navigation", "aria-label": "\u041F\u0430\u0433\u0438\u043D\u0430\u0446\u0438\u044F", children: [_jsx(PaginationContainer, { currentPage: currentPage, onPageChange: onPageChange, totalPages: totalPages }), itemCount && onItemCountChange ? (_jsx(PageSizeSelector, { itemCount: itemCount, onItemCountChange: onItemCountChange })) : null] }));
|
|
28
5
|
//# sourceMappingURL=Pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../../src/ui-kit/Pagination/Pagination.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../../src/ui-kit/Pagination/Pagination.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAU5D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,WAAW,EACX,YAAY,EACZ,UAAU,EACV,SAAS,EACT,iBAAiB,GACD,EAAE,EAAE,CAAC,CACrB,eACE,SAAS,EAAC,sDAAsD,EAChE,IAAI,EAAC,YAAY,gBACN,wDAAW,aAEtB,KAAC,mBAAmB,IAClB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,GACtB,EACD,SAAS,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAChC,KAAC,gBAAgB,IAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,iBAAiB,GAAI,CACjF,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface PaginationContainerProps {
|
|
3
|
+
currentPage: number;
|
|
4
|
+
onPageChange: (page: number) => void;
|
|
5
|
+
totalPages: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const PaginationContainer: ({ currentPage, onPageChange, totalPages, }: PaginationContainerProps) => JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { Icon } from '../Icon/Icon.js';
|
|
4
|
+
import { paginationBlockStyle } from './paginationBlockStyle.js';
|
|
5
|
+
import { renderPages } from './renderPages.js';
|
|
6
|
+
const ICON_SIZE = { width: '24', height: '24' };
|
|
7
|
+
export const PaginationContainer = ({ currentPage, onPageChange, totalPages, }) => {
|
|
8
|
+
const pages = useMemo(() => new Array(totalPages).fill({
|
|
9
|
+
currentPage,
|
|
10
|
+
onPageChange,
|
|
11
|
+
totalPages,
|
|
12
|
+
}), [totalPages, currentPage]);
|
|
13
|
+
const handlePrevPage = useCallback(() => {
|
|
14
|
+
if (currentPage > 1) {
|
|
15
|
+
onPageChange(currentPage - 1);
|
|
16
|
+
}
|
|
17
|
+
}, [currentPage]);
|
|
18
|
+
const handleNextPage = useCallback(() => {
|
|
19
|
+
if (currentPage < totalPages - 1) {
|
|
20
|
+
onPageChange(currentPage + 1);
|
|
21
|
+
}
|
|
22
|
+
}, [currentPage, totalPages]);
|
|
23
|
+
const handleFirstPage = useCallback(() => onPageChange(1), []);
|
|
24
|
+
const handleLastPage = useCallback(() => onPageChange(totalPages), [totalPages]);
|
|
25
|
+
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 }) }), _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 }) })] }));
|
|
26
|
+
};
|
|
27
|
+
const getIconStyle = (condition) => condition ? 'opacity-20' : 'cursor-pointer hover:opacity-60';
|
|
28
|
+
//# sourceMappingURL=PaginationContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationContainer.js","sourceRoot":"","sources":["../../../src/ui-kit/Pagination/PaginationContainer.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const paginationBlockStyle = "py-m px-lg rounded-md cursor-pointer hover:bg-green-more-dark hover:text-white";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginationBlockStyle.js","sourceRoot":"","sources":["../../../src/ui-kit/Pagination/paginationBlockStyle.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAC/B,gFAAgF,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export declare const renderPages: (pagesParams:
|
|
2
|
+
import type { PaginationContainerProps } from './PaginationContainer';
|
|
3
|
+
export declare const renderPages: (pagesParams: PaginationContainerProps, index: number) => JSX.Element | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
-
import { paginationBlockStyle } from './
|
|
2
|
+
import { paginationBlockStyle } from './paginationBlockStyle.js';
|
|
3
3
|
import { shouldRenderPage } from './shouldRenderPage.js';
|
|
4
4
|
export const renderPages = (pagesParams, index) => {
|
|
5
5
|
const { currentPage, onPageChange, totalPages } = pagesParams;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderPages.js","sourceRoot":"","sources":["../../../src/ui-kit/Pagination/renderPages.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"renderPages.js","sourceRoot":"","sources":["../../../src/ui-kit/Pagination/renderPages.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,WAAqC,EAAE,KAAa,EAAE,EAAE;IAClF,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC;IAC9D,MAAM,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC;IACvB,IAAI,IAAI,KAAK,WAAW,EAAE;QACxB,OAAO,CACL,8BAEe,MAAM,EACnB,SAAS,EAAC,iDAAiD,YAE1D,IAAI,IAJA,MAAM,CAAC,KAAK,CAAC,CAKd,CACP,CAAC;KACH;IAED,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,UAAU,IAAI,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE;QACxF,OAAO,CACL,cAEE,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EACjC,SAAS,EAAE,oBAAoB,gBACnB,YAAY,IAAI,EAAE,YAE7B,IAAI,IALA,MAAM,CAAC,KAAK,CAAC,CAMd,CACP,CAAC;KACH;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
4
|
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
5
|
-
import { Text } from '../../ui-kit/Text/Text.js';
|
|
6
5
|
import { style } from '../../utils/style.js';
|
|
7
6
|
import { Icon } from '../Icon/Icon.js';
|
|
8
7
|
import { Input } from '../Input/Input.js';
|
|
8
|
+
import { Text } from '../Text/Text.js';
|
|
9
9
|
import { formatOption } from './formatOption.js';
|
|
10
10
|
import { useSelectPopup } from './useSelectPopup.js';
|
|
11
11
|
export const Select = JSX(({ className, label, options = [], value, valid = true, isBorder = true, placeholder = '', isSearch = false, onChange, }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/Select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAE9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/Select.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatDate: (date: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDate.js","sourceRoot":"","sources":["../../src/utils/formatDate.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -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 ? (
|
|
@@ -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' })}
|
|
@@ -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 ? (
|
|
@@ -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
|
)}
|
|
@@ -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
|
+
);
|