@redneckz/wildless-cms-uni-blocks 0.14.5 → 0.14.7
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.13.5.js +14 -11
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +168 -92
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Depository/Depository.d.ts +6 -0
- package/bundle/components/Depository/DepositoryContent.d.ts +5 -0
- package/bundle/components/Depository/DepositoryItem.d.ts +3 -0
- package/bundle/components/Depository/useDepository.d.ts +9 -0
- package/bundle/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +3 -0
- package/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +3 -0
- package/bundle/ui-kit/Pagination/Pagination.d.ts +8 -0
- package/bundle/ui-kit/Pagination/renderPages.d.ts +3 -0
- package/bundle/ui-kit/Pagination/shouldRenderPage.d.ts +1 -0
- package/bundle/utils/convertTimestampToDate.d.ts +1 -0
- package/dist/components/ApplicationForm/renderRegion.js +1 -1
- package/dist/components/ApplicationForm/renderRegionDepartment.js +1 -1
- package/dist/components/ApplicationForm/renderWedDataOrganization.js +2 -2
- package/dist/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
- package/dist/components/BenefitsBlock/BenefitsBlock.js +7 -7
- package/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.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.d.ts +6 -0
- package/dist/components/Depository/Depository.js +19 -0
- package/dist/components/Depository/Depository.js.map +1 -0
- package/dist/components/Depository/DepositoryContent.d.ts +5 -0
- package/dist/components/Depository/DepositoryContent.js +2 -0
- package/dist/components/Depository/DepositoryContent.js.map +1 -0
- package/dist/components/Depository/DepositoryItem.d.ts +3 -0
- package/dist/components/Depository/DepositoryItem.js +12 -0
- package/dist/components/Depository/DepositoryItem.js.map +1 -0
- package/dist/components/Depository/useDepository.d.ts +9 -0
- package/dist/components/Depository/useDepository.js +10 -0
- package/dist/components/Depository/useDepository.js.map +1 -0
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +3 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +3 -0
- package/dist/ui-kit/Input/Input.js +7 -1
- package/dist/ui-kit/Input/Input.js.map +1 -1
- package/dist/ui-kit/Pagination/Pagination.d.ts +8 -0
- package/dist/ui-kit/Pagination/Pagination.js +31 -0
- package/dist/ui-kit/Pagination/Pagination.js.map +1 -0
- package/dist/ui-kit/Pagination/renderPages.d.ts +3 -0
- package/dist/ui-kit/Pagination/renderPages.js +18 -0
- package/dist/ui-kit/Pagination/renderPages.js.map +1 -0
- package/dist/ui-kit/Pagination/shouldRenderPage.d.ts +1 -0
- package/dist/ui-kit/Pagination/shouldRenderPage.js +9 -0
- package/dist/ui-kit/Pagination/shouldRenderPage.js.map +1 -0
- package/dist/ui-kit/Select/filterOptions.js +1 -10
- package/dist/ui-kit/Select/filterOptions.js.map +1 -1
- package/dist/utils/convertTimestampToDate.d.ts +1 -0
- package/dist/utils/convertTimestampToDate.js +16 -0
- package/dist/utils/convertTimestampToDate.js.map +1 -0
- package/dist/utils/fetchMultitudeJSON.js +1 -1
- package/dist/utils/fetchMultitudeJSON.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/renderRegion.js +1 -1
- package/lib/components/ApplicationForm/renderRegionDepartment.js +1 -1
- package/lib/components/ApplicationForm/renderWedDataOrganization.js +2 -2
- package/lib/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
- package/lib/components/BenefitsBlock/BenefitsBlock.js +7 -7
- package/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.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.d.ts +6 -0
- package/lib/components/Depository/Depository.fixture.d.ts +6 -0
- package/lib/components/Depository/Depository.js +17 -0
- package/lib/components/Depository/Depository.js.map +1 -0
- package/lib/components/Depository/DepositoryContent.d.ts +5 -0
- package/lib/components/Depository/DepositoryContent.js +2 -0
- package/lib/components/Depository/DepositoryContent.js.map +1 -0
- package/lib/components/Depository/DepositoryItem.d.ts +3 -0
- package/lib/components/Depository/DepositoryItem.js +9 -0
- package/lib/components/Depository/DepositoryItem.js.map +1 -0
- package/lib/components/Depository/useDepository.d.ts +9 -0
- package/lib/components/Depository/useDepository.js +7 -0
- package/lib/components/Depository/useDepository.js.map +1 -0
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +3 -0
- package/lib/components/ProductBlock/ProductBlock.fixture.mobile.d.ts +1 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +3 -0
- package/lib/ui-kit/Input/Input.js +8 -2
- package/lib/ui-kit/Input/Input.js.map +1 -1
- package/lib/ui-kit/Pagination/Pagination.d.ts +8 -0
- package/lib/ui-kit/Pagination/Pagination.js +28 -0
- package/lib/ui-kit/Pagination/Pagination.js.map +1 -0
- package/lib/ui-kit/Pagination/renderPages.d.ts +3 -0
- package/lib/ui-kit/Pagination/renderPages.js +15 -0
- package/lib/ui-kit/Pagination/renderPages.js.map +1 -0
- package/lib/ui-kit/Pagination/shouldRenderPage.d.ts +1 -0
- package/lib/ui-kit/Pagination/shouldRenderPage.js +6 -0
- package/lib/ui-kit/Pagination/shouldRenderPage.js.map +1 -0
- package/lib/ui-kit/Select/filterOptions.js +1 -10
- package/lib/ui-kit/Select/filterOptions.js.map +1 -1
- package/lib/utils/convertTimestampToDate.d.ts +1 -0
- package/lib/utils/convertTimestampToDate.js +13 -0
- package/lib/utils/convertTimestampToDate.js.map +1 -0
- package/lib/utils/fetchMultitudeJSON.js +1 -1
- package/lib/utils/fetchMultitudeJSON.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +93 -93
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Depository/Depository.d.ts +6 -0
- package/mobile/bundle/components/Depository/DepositoryContent.d.ts +5 -0
- package/mobile/bundle/components/Depository/DepositoryItem.d.ts +3 -0
- package/mobile/bundle/components/Depository/useDepository.d.ts +9 -0
- package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +3 -0
- package/mobile/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +3 -0
- package/mobile/bundle/ui-kit/Pagination/Pagination.d.ts +8 -0
- package/mobile/bundle/ui-kit/Pagination/renderPages.d.ts +3 -0
- package/mobile/bundle/ui-kit/Pagination/shouldRenderPage.d.ts +1 -0
- package/mobile/bundle/utils/convertTimestampToDate.d.ts +1 -0
- package/mobile/dist/components/ApplicationForm/renderRegion.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderRegionDepartment.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.js +2 -2
- package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
- package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js +7 -7
- package/mobile/dist/components/BenefitsBlock/BenefitsBlock.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.d.ts +6 -0
- package/mobile/dist/components/Depository/Depository.js +19 -0
- package/mobile/dist/components/Depository/Depository.js.map +1 -0
- package/mobile/dist/components/Depository/DepositoryContent.d.ts +5 -0
- package/mobile/dist/components/Depository/DepositoryContent.js +2 -0
- package/mobile/dist/components/Depository/DepositoryContent.js.map +1 -0
- package/mobile/dist/components/Depository/DepositoryItem.d.ts +3 -0
- package/mobile/dist/components/Depository/DepositoryItem.js +12 -0
- package/mobile/dist/components/Depository/DepositoryItem.js.map +1 -0
- package/mobile/dist/components/Depository/useDepository.d.ts +9 -0
- package/mobile/dist/components/Depository/useDepository.js +10 -0
- package/mobile/dist/components/Depository/useDepository.js.map +1 -0
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +3 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +3 -0
- package/mobile/dist/ui-kit/Input/Input.js +7 -1
- package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
- package/mobile/dist/ui-kit/Pagination/Pagination.d.ts +8 -0
- package/mobile/dist/ui-kit/Pagination/Pagination.js +31 -0
- package/mobile/dist/ui-kit/Pagination/Pagination.js.map +1 -0
- package/mobile/dist/ui-kit/Pagination/renderPages.d.ts +3 -0
- package/mobile/dist/ui-kit/Pagination/renderPages.js +18 -0
- package/mobile/dist/ui-kit/Pagination/renderPages.js.map +1 -0
- package/mobile/dist/ui-kit/Pagination/shouldRenderPage.d.ts +1 -0
- package/mobile/dist/ui-kit/Pagination/shouldRenderPage.js +9 -0
- package/mobile/dist/ui-kit/Pagination/shouldRenderPage.js.map +1 -0
- package/mobile/dist/ui-kit/Select/filterOptions.js +1 -10
- package/mobile/dist/ui-kit/Select/filterOptions.js.map +1 -1
- package/mobile/dist/utils/convertTimestampToDate.d.ts +1 -0
- package/mobile/dist/utils/convertTimestampToDate.js +16 -0
- package/mobile/dist/utils/convertTimestampToDate.js.map +1 -0
- package/mobile/dist/utils/fetchMultitudeJSON.js +1 -1
- package/mobile/dist/utils/fetchMultitudeJSON.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/renderRegion.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderRegionDepartment.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.js +2 -2
- package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
- package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js +7 -7
- package/mobile/lib/components/BenefitsBlock/BenefitsBlock.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.d.ts +6 -0
- package/mobile/lib/components/Depository/Depository.js +17 -0
- package/mobile/lib/components/Depository/Depository.js.map +1 -0
- package/mobile/lib/components/Depository/DepositoryContent.d.ts +5 -0
- package/mobile/lib/components/Depository/DepositoryContent.js +2 -0
- package/mobile/lib/components/Depository/DepositoryContent.js.map +1 -0
- package/mobile/lib/components/Depository/DepositoryItem.d.ts +3 -0
- package/mobile/lib/components/Depository/DepositoryItem.js +9 -0
- package/mobile/lib/components/Depository/DepositoryItem.js.map +1 -0
- package/mobile/lib/components/Depository/useDepository.d.ts +9 -0
- package/mobile/lib/components/Depository/useDepository.js +7 -0
- package/mobile/lib/components/Depository/useDepository.js.map +1 -0
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +3 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +3 -0
- package/mobile/lib/ui-kit/Input/Input.js +8 -2
- package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
- package/mobile/lib/ui-kit/Pagination/Pagination.d.ts +8 -0
- package/mobile/lib/ui-kit/Pagination/Pagination.js +28 -0
- package/mobile/lib/ui-kit/Pagination/Pagination.js.map +1 -0
- package/mobile/lib/ui-kit/Pagination/renderPages.d.ts +3 -0
- package/mobile/lib/ui-kit/Pagination/renderPages.js +15 -0
- package/mobile/lib/ui-kit/Pagination/renderPages.js.map +1 -0
- package/mobile/lib/ui-kit/Pagination/shouldRenderPage.d.ts +1 -0
- package/mobile/lib/ui-kit/Pagination/shouldRenderPage.js +6 -0
- package/mobile/lib/ui-kit/Pagination/shouldRenderPage.js.map +1 -0
- package/mobile/lib/ui-kit/Select/filterOptions.js +1 -10
- package/mobile/lib/ui-kit/Select/filterOptions.js.map +1 -1
- package/mobile/lib/utils/convertTimestampToDate.d.ts +1 -0
- package/mobile/lib/utils/convertTimestampToDate.js +13 -0
- package/mobile/lib/utils/convertTimestampToDate.js.map +1 -0
- package/mobile/lib/utils/fetchMultitudeJSON.js +1 -1
- package/mobile/lib/utils/fetchMultitudeJSON.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormGrantSupport.tsx +1 -1
- package/mobile/src/components/ApplicationForm/renderRegion.tsx +2 -2
- package/mobile/src/components/ApplicationForm/renderRegionDepartment.tsx +2 -2
- package/mobile/src/components/ApplicationForm/renderWedDataOrganization.tsx +5 -5
- package/mobile/src/components/BenefitsBlock/BenefitsBlock.tsx +24 -22
- package/mobile/src/components/ContentPage/ContentPage.tsx +1 -1
- package/mobile/src/components/Depository/Depository.tsx +43 -0
- package/mobile/src/components/Depository/DepositoryContent.ts +6 -0
- package/mobile/src/components/Depository/DepositoryItem.tsx +21 -0
- package/mobile/src/components/Depository/useDepository.ts +23 -0
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMap.example.json +1 -0
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapContent.ts +3 -0
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenu.tsx +8 -6
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +3 -0
- package/mobile/src/ui-kit/Input/Input.tsx +9 -2
- package/mobile/src/ui-kit/Pagination/Pagination.tsx +87 -0
- package/mobile/src/ui-kit/Pagination/renderPages.tsx +33 -0
- package/mobile/src/ui-kit/Pagination/shouldRenderPage.ts +8 -0
- package/mobile/src/ui-kit/Select/filterOptions.ts +1 -11
- package/mobile/src/utils/convertTimestampToDate.ts +15 -0
- package/mobile/src/utils/fetchMultitudeJSON.ts +1 -1
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationFormGrantSupport.tsx +1 -1
- package/src/components/ApplicationForm/renderRegion.tsx +2 -2
- package/src/components/ApplicationForm/renderRegionDepartment.tsx +2 -2
- package/src/components/ApplicationForm/renderWedDataOrganization.tsx +5 -5
- package/src/components/BenefitsBlock/BenefitsBlock.tsx +24 -22
- package/src/components/Blocks.ts +2 -0
- package/src/components/ContentPage/ContentPage.tsx +1 -1
- package/src/components/Depository/Depository.example.json +1 -0
- package/src/components/Depository/Depository.fixture.tsx +10 -0
- package/src/components/Depository/Depository.tsx +43 -0
- package/src/components/Depository/Depository.ui.json +1 -0
- package/src/components/Depository/DepositoryContent.ts +6 -0
- package/src/components/Depository/DepositoryItem.tsx +21 -0
- package/src/components/Depository/useDepository.ts +23 -0
- package/src/components/OfficesAtmsMap/OfficesAtmsMap.example.json +1 -0
- package/src/components/OfficesAtmsMap/OfficesAtmsMapContent.ts +3 -0
- package/src/components/ProductBlock/ProductBlock.fixture.mobile.tsx +23 -3
- package/src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx +8 -6
- package/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +3 -0
- package/src/ui-kit/Input/Input.tsx +9 -2
- package/src/ui-kit/Pagination/Pagination.tsx +87 -0
- package/src/ui-kit/Pagination/renderPages.tsx +33 -0
- package/src/ui-kit/Pagination/shouldRenderPage.ts +8 -0
- package/src/ui-kit/Select/filterOptions.ts +1 -11
- package/src/utils/convertTimestampToDate.ts +15 -0
- package/src/utils/fetchMultitudeJSON.ts +1 -1
- /package/mobile/src/components/{OfficesAtmsMap/OfficesAtmsMaps.example.json → Depository/Depository.example.json} +0 -0
- /package/{src/components/OfficesAtmsMap/OfficesAtmsMaps.example.json → mobile/src/components/Depository/Depository.ui.json} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
export interface PaginationProps {
|
|
4
|
+
currentPage: number;
|
|
5
|
+
onPageChange: (page: number) => void;
|
|
6
|
+
totalPages: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const Pagination: ({ currentPage, onPageChange, totalPages }: PaginationProps) => 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 { renderPages } from './renderPages.js';
|
|
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';
|
|
28
|
+
//# sourceMappingURL=Pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../../src/ui-kit/Pagination/Pagination.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,CAAC,MAAM,oBAAoB,GAC/B,gFAAgF,CAAC;AAQnF,MAAM,SAAS,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAEhD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAmB,EAAE,EAAE;IACvF,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,IAAI,WAAW,GAAG,CAAC,EAAE;YACnB,YAAY,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;SAC/B;IACH,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,IAAI,WAAW,GAAG,UAAU,GAAG,CAAC,EAAE;YAChC,YAAY,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;SAC/B;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC;IAE9B,MAAM,eAAe,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC/D,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjF,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CACH,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;QACzB,WAAW;QACX,YAAY;QACZ,UAAU;KACX,CAAC,EACJ,CAAC,UAAU,EAAE,WAAW,CAAC,CAC1B,CAAC;IAEF,OAAO,CACL,cAAK,SAAS,EAAC,sCAAsC,EAAC,IAAI,EAAC,YAAY,gBAAY,wDAAW,YAC5F,eAAK,SAAS,EAAC,yBAAyB,aACtC,cAAK,OAAO,EAAE,cAAc,YAC1B,KAAC,IAAI,IACH,IAAI,EAAC,eAAe,EACpB,WAAW,EAAC,OAAO,EACnB,cAAc,EAAE,YAAY,CAAC,WAAW,KAAK,CAAC,CAAC,KAC3C,SAAS,GACb,GACE,EACN,eAAK,SAAS,EAAC,aAAa,aACzB,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,CACjB,cAAK,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,oBAAoB,gBAAa,oDAAY,kBAEjF,CACP,CAAC,CAAC,CAAC,IAAI,EACP,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,WAAW,oBAAU,CAAC,CAAC,CAAC,IAAI,EAC7D,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,EACtB,WAAW,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,WAAW,oBAAU,CAAC,CAAC,CAAC,IAAI,EAC1E,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,CAC1B,cACE,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,oBAAoB,gBACnB,YAAY,UAAU,GAAG,YAEpC,UAAU,GACP,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,EACN,cAAK,OAAO,EAAE,cAAc,YAC1B,KAAC,IAAI,IACH,SAAS,EAAC,YAAY,EACtB,IAAI,EAAC,eAAe,EACpB,WAAW,EAAC,OAAO,EACnB,cAAc,EAAE,YAAY,CAAC,WAAW,KAAK,UAAU,CAAC,KACpD,SAAS,GACb,GACE,IACF,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,SAAkB,EAAE,EAAE,CAC1C,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { paginationBlockStyle } from './Pagination.js';
|
|
3
|
+
import { shouldRenderPage } from './shouldRenderPage.js';
|
|
4
|
+
export const renderPages = (pagesParams, index) => {
|
|
5
|
+
const { currentPage, onPageChange, totalPages } = pagesParams;
|
|
6
|
+
const page = index + 1;
|
|
7
|
+
if (page === currentPage) {
|
|
8
|
+
return (_jsx("div", { "aria-current": "true", className: "py-m px-lg bg-green-light text-white rounded-md", children: page }, String(index)));
|
|
9
|
+
}
|
|
10
|
+
if (page !== 1 && page !== totalPages && shouldRenderPage(page, currentPage, totalPages)) {
|
|
11
|
+
return (_jsx("div", { onClick: () => onPageChange(page), className: paginationBlockStyle, "aria-label": `Страница ${page}`, children: page }, String(index)));
|
|
12
|
+
}
|
|
13
|
+
return null;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=renderPages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderPages.js","sourceRoot":"","sources":["../../../src/ui-kit/Pagination/renderPages.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAmB,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,WAA4B,EAAE,KAAa,EAAE,EAAE;IACzE,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const shouldRenderPage: (page: number, currentPage: number, totalPages: number) => boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const checkPageRange = (page, currentPage, totalPages) => (currentPage <= 3 && page <= currentPage + 3) ||
|
|
2
|
+
(currentPage >= totalPages - 1 && page >= totalPages - 4);
|
|
3
|
+
export const shouldRenderPage = (page, currentPage, totalPages) => (page < currentPage && page >= currentPage - 2) ||
|
|
4
|
+
(page <= currentPage + 2 && page > currentPage) ||
|
|
5
|
+
checkPageRange(page, currentPage, totalPages);
|
|
6
|
+
//# sourceMappingURL=shouldRenderPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shouldRenderPage.js","sourceRoot":"","sources":["../../../src/ui-kit/Pagination/shouldRenderPage.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,WAAmB,EAAE,UAAkB,EAAE,EAAE,CAC/E,CAAC,WAAW,IAAI,CAAC,IAAI,IAAI,IAAI,WAAW,GAAG,CAAC,CAAC;IAC7C,CAAC,WAAW,IAAI,UAAU,GAAG,CAAC,IAAI,IAAI,IAAI,UAAU,GAAG,CAAC,CAAC,CAAC;AAE5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,WAAmB,EAAE,UAAkB,EAAE,EAAE,CACxF,CAAC,IAAI,GAAG,WAAW,IAAI,IAAI,IAAI,WAAW,GAAG,CAAC,CAAC;IAC/C,CAAC,IAAI,IAAI,WAAW,GAAG,CAAC,IAAI,IAAI,GAAG,WAAW,CAAC;IAC/C,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import { compareBy, desc } from '../../utils/Comparator.js';
|
|
2
|
-
import { jaroWinklerDistance } from '../../utils/jaroWinklerDistance.js';
|
|
3
|
-
import { zip } from '../../utils/zip.js';
|
|
4
1
|
export const filterOptions = (options, query) => {
|
|
5
2
|
if (!options?.length || !query?.trim()) {
|
|
6
3
|
return options;
|
|
7
4
|
}
|
|
8
|
-
|
|
9
|
-
.map((_) => _.text?.toLowerCase())
|
|
10
|
-
.map(jaroWinklerDistance(query?.trim().toLowerCase()));
|
|
11
|
-
return zip(options, ranking)
|
|
12
|
-
.filter(([, rank]) => rank >= 0.5)
|
|
13
|
-
.sort(desc(compareBy(([, rank]) => rank)))
|
|
14
|
-
.map(([option]) => option);
|
|
5
|
+
return options.filter((_) => _.text?.toLocaleLowerCase().includes(query?.trim().toLocaleLowerCase()));
|
|
15
6
|
};
|
|
16
7
|
//# sourceMappingURL=filterOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterOptions.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/filterOptions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filterOptions.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/filterOptions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAiB,EAAE,KAAyB,EAAY,EAAE;IACtF,IAAI,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACtC,OAAO,OAAO,CAAC;KAChB;IAED,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAA;AACvG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const convertTimestampToDate: (timestamp: number) => string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const convertTimestampToDate = (timestamp) => {
|
|
2
|
+
const date = new Date(timestamp * 1000);
|
|
3
|
+
let dd = date.getDate();
|
|
4
|
+
if (dd < 10) {
|
|
5
|
+
dd = '0' + dd;
|
|
6
|
+
}
|
|
7
|
+
let mm = date.getMonth() + 1;
|
|
8
|
+
if (mm < 10) {
|
|
9
|
+
mm = '0' + mm;
|
|
10
|
+
}
|
|
11
|
+
return dd + '.' + mm + '.' + date.getFullYear();
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=convertTimestampToDate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertTimestampToDate.js","sourceRoot":"","sources":["../../src/utils/convertTimestampToDate.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,SAAiB,EAAE,EAAE;IAC1D,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAExC,IAAI,EAAE,GAAoB,IAAI,CAAC,OAAO,EAAE,CAAC;IACzC,IAAI,EAAE,GAAG,EAAE,EAAE;QACX,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC;KACf;IAED,IAAI,EAAE,GAAoB,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC9C,IAAI,EAAE,GAAG,EAAE,EAAE;QACX,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC;KACf;IAED,OAAO,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AAClD,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fetchJSON } from './fetchJSON.js';
|
|
2
2
|
export async function fetchMultitudeJSON(...urls) {
|
|
3
3
|
const fetchPromises = urls.map((url) => fetchJSON(url));
|
|
4
|
-
return
|
|
4
|
+
return Promise.all(fetchPromises);
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=fetchMultitudeJSON.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchMultitudeJSON.js","sourceRoot":"","sources":["../../src/utils/fetchMultitudeJSON.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,GAAG,IAAc;IAEjB,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAI,GAAG,CAAC,CAAC,CAAC;IAE3D,OAAO,
|
|
1
|
+
{"version":3,"file":"fetchMultitudeJSON.js","sourceRoot":"","sources":["../../src/utils/fetchMultitudeJSON.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,GAAG,IAAc;IAEjB,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAI,GAAG,CAAC,CAAC,CAAC;IAE3D,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -700,14 +700,20 @@
|
|
|
700
700
|
};
|
|
701
701
|
|
|
702
702
|
const Input = JSX(({ key, className = '', inputClassName = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, autoFocus = false, }) => {
|
|
703
|
+
const inputRef = useRef(null);
|
|
703
704
|
const handleChange = useCallback((e) => {
|
|
704
705
|
onChange && onChange(e.target?.value || '');
|
|
705
706
|
}, [onChange]);
|
|
707
|
+
useEffect(() => {
|
|
708
|
+
if (autoFocus) {
|
|
709
|
+
inputRef.current?.focus();
|
|
710
|
+
}
|
|
711
|
+
}, [autoFocus, inputRef]);
|
|
706
712
|
const paddingStyle = children ? 'pr-3xl' : '';
|
|
707
713
|
const validStyle = valid
|
|
708
714
|
? 'border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'
|
|
709
715
|
: 'border-error';
|
|
710
|
-
return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { children: [label ? (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", font: "font-light", children: label }) })) : null, jsx("input", { className: style('w-full border rounded-md text-primary-text outline-none p-m', paddingStyle, validStyle, inputClassName), id: id, name: name || id, placeholder: placeholder, type: type, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern
|
|
716
|
+
return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { children: [label ? (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", font: "font-light", children: label }) })) : null, jsx("input", { ref: inputRef, className: style('w-full border rounded-md text-primary-text outline-none p-m', paddingStyle, validStyle, inputClassName), id: id, name: name || id, placeholder: placeholder, type: type, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern }, key)] }), children] }));
|
|
711
717
|
});
|
|
712
718
|
|
|
713
719
|
const InputControl = JSX(({ className, label, value = '', error, onChange, onBlur }) => (jsxs("div", { className: className, children: [jsx(Input, { type: "text", "aria-label": label, label: label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur }), jsx("div", { className: "h-2", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null })] })));
|
|
@@ -827,88 +833,11 @@
|
|
|
827
833
|
close: () => defaultEventBus.fire('popup', { type: 'close' }),
|
|
828
834
|
});
|
|
829
835
|
|
|
830
|
-
const compareBy = (indexOf) => (a, b) => indexOf(a) - indexOf(b);
|
|
831
|
-
const desc = (cmp) => (a, b) => -cmp(a, b);
|
|
832
|
-
|
|
833
|
-
const JARO_WINKLER_P = 0.1;
|
|
834
|
-
const JARO_WINKLER_MAX_L = 4;
|
|
835
|
-
const jaroWinklerDistance = (s1) => (s2) => {
|
|
836
|
-
if (s1 === s2) {
|
|
837
|
-
return 1;
|
|
838
|
-
}
|
|
839
|
-
if (!s1 || !s2) {
|
|
840
|
-
return 0;
|
|
841
|
-
}
|
|
842
|
-
const { m, s1Matches, s2Matches } = computeM(s1, s2);
|
|
843
|
-
if (m === 0) {
|
|
844
|
-
return 0;
|
|
845
|
-
}
|
|
846
|
-
const t = computeT(s1, s2, { s1Matches, s2Matches });
|
|
847
|
-
const jaroWeight = (m / s1.length + m / s2.length + (m - t / 2) / m) / 3;
|
|
848
|
-
const winklerWeight = jaroWeight > 0.7 ? computePrefixL(s1, s2) * JARO_WINKLER_P : 0;
|
|
849
|
-
return jaroWeight + winklerWeight * (1 - jaroWeight);
|
|
850
|
-
};
|
|
851
|
-
function computeM(s1, s2) {
|
|
852
|
-
const range = Math.max(0, Math.floor(Math.max(s1.length, s2.length) / 2) - 1);
|
|
853
|
-
const s1Matches = new Array(s1.length);
|
|
854
|
-
const s2Matches = new Array(s2.length);
|
|
855
|
-
let m = 0;
|
|
856
|
-
for (let i = 0; i < s1.length; i++) {
|
|
857
|
-
const low = Math.max(0, i - range);
|
|
858
|
-
const high = Math.min(i + range, s2.length - 1);
|
|
859
|
-
for (let j = low; j <= high; j++) {
|
|
860
|
-
if (s1Matches[i] || s2Matches[j] || s1[i] !== s2[j]) {
|
|
861
|
-
continue;
|
|
862
|
-
}
|
|
863
|
-
m++;
|
|
864
|
-
s1Matches[i] = true;
|
|
865
|
-
s2Matches[j] = true;
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
return { m, s1Matches, s2Matches };
|
|
869
|
-
}
|
|
870
|
-
function computeT(s1, s2, { s1Matches, s2Matches }) {
|
|
871
|
-
let t = 0;
|
|
872
|
-
for (let i = 0, k = 0; i < s1.length; i++) {
|
|
873
|
-
if (!s1Matches[i]) {
|
|
874
|
-
continue;
|
|
875
|
-
}
|
|
876
|
-
let j = k;
|
|
877
|
-
for (; j < s2.length; j++) {
|
|
878
|
-
if (s2Matches[j]) {
|
|
879
|
-
k = j + 1;
|
|
880
|
-
break;
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
if (s1[i] !== s2[j]) {
|
|
884
|
-
t++;
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
return t;
|
|
888
|
-
}
|
|
889
|
-
function computePrefixL(s1, s2) {
|
|
890
|
-
let prefixL = 0;
|
|
891
|
-
while (s1[prefixL] === s2[prefixL] && prefixL < JARO_WINKLER_MAX_L) {
|
|
892
|
-
prefixL++;
|
|
893
|
-
}
|
|
894
|
-
return prefixL;
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
function zip(firstCol, ...restCols) {
|
|
898
|
-
return firstCol.map((firstEl, rowIndex) => [firstEl, ...restCols.map((col) => col[rowIndex])]);
|
|
899
|
-
}
|
|
900
|
-
|
|
901
836
|
const filterOptions = (options, query) => {
|
|
902
837
|
if (!options?.length || !query?.trim()) {
|
|
903
838
|
return options;
|
|
904
839
|
}
|
|
905
|
-
|
|
906
|
-
.map((_) => _.text?.toLowerCase())
|
|
907
|
-
.map(jaroWinklerDistance(query?.trim().toLowerCase()));
|
|
908
|
-
return zip(options, ranking)
|
|
909
|
-
.filter(([, rank]) => rank >= 0.5)
|
|
910
|
-
.sort(desc(compareBy(([, rank]) => rank)))
|
|
911
|
-
.map(([option]) => option);
|
|
840
|
+
return options.filter((_) => _.text?.toLocaleLowerCase().includes(query?.trim().toLocaleLowerCase()));
|
|
912
841
|
};
|
|
913
842
|
|
|
914
843
|
const SelectPopup = JSX(({ popupRef, options, value, query, onChange }) => options?.length ? (jsx("div", { className: "bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]", role: "listbox", ref: popupRef, children: filterOptions(options, query).map((option) => (jsxs("div", { className: "flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative", role: "option", "aria-selected": option.key === value?.key, onClick: () => onChange && onChange(option), children: [jsx("span", { className: "min-h-6", children: formatOption(option) }), jsx(Icon, { name: "DoneSimpleIcon", width: "16", height: "16", className: style('absolute right-4 pt-3xs', option.key === value?.key ? '' : 'hidden') })] }, option.key))) })) : null);
|
|
@@ -1016,7 +945,7 @@
|
|
|
1016
945
|
|
|
1017
946
|
const renderBusinessCardDataOrganization = (field) => (jsxs("div", { className: "@xl:flex @xl:justify-between @xl:gap-lg", children: [jsxs("div", { className: "@xl:w-1/2 space-y-s", children: [jsx(InputControl, { className: "shrink-0 w-full", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) })] }), jsxs("div", { className: "@xl:w-1/2 space-y-s", children: [jsx(PhoneInputControl, { className: "shrink-0 w-full", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('mail'), defaultValidator) })] })] }));
|
|
1018
947
|
|
|
1019
|
-
const renderRegion$1 = ({ regions, field }) => (jsx(SelectControl, { className: "w-full", label: "\
|
|
948
|
+
const renderRegion$1 = ({ regions, field }) => (jsx(SelectControl, { className: "w-full", label: "\u0424\u0438\u043B\u0438\u0430\u043B", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }));
|
|
1020
949
|
|
|
1021
950
|
const initialFormState$3 = {
|
|
1022
951
|
name: '',
|
|
@@ -1134,7 +1063,7 @@
|
|
|
1134
1063
|
|
|
1135
1064
|
const renderCreditParameters = (field) => (jsxs("div", { className: "border-b border-b-main-divider @xl:border-none @xl:flex @xl:justify-between gap-lg", children: [jsxs("div", { className: "@xl:w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m", font: "font-light", children: "\u0421\u0443\u043C\u043C\u0430, \u20BD" }) }), jsx(InputRange, { items: ITEMS_CREDIT_AMOUNT, min: MIN_CREDIT_AMOUNT, max: MAX_CREDIT_AMOUNT, ...field('amount') })] }), jsxs("div", { className: "@xl:w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m", font: "font-light", children: "\u0421\u0440\u043E\u043A, \u043C\u0435\u0441\u044F\u0446\u0435\u0432" }) }), jsx(InputRange, { items: ITEMS_CREDIT_TERM, min: MIN_CREDIT_TERM, max: MAX_CREDIT_TERM, ...field('term') })] })] }));
|
|
1136
1065
|
|
|
1137
|
-
const renderRegionDepartment = ({ regions, branches, field }) => (jsxs("div", { className: "@xl:flex @xl:justify-between @xl:gap-lg @xl:mb-2xl @xl:border-none @xl:pb-0", children: [jsx("div", { className: "@xl:w-1/2", children: jsx(SelectControl, { label: "\
|
|
1066
|
+
const renderRegionDepartment = ({ regions, branches, field }) => (jsxs("div", { className: "@xl:flex @xl:justify-between @xl:gap-lg @xl:mb-2xl @xl:border-none @xl:pb-0", children: [jsx("div", { className: "@xl:w-1/2", children: jsx(SelectControl, { label: "\u0424\u0438\u043B\u0438\u0430\u043B", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }) }), jsx("div", { className: "@xl:w-1/2", children: jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: branches.map(({ branchCode = '', address = '' }) => ({
|
|
1138
1067
|
key: branchCode,
|
|
1139
1068
|
text: address,
|
|
1140
1069
|
})), ...withValidator(field('department'), defaultValidator) }) })] }));
|
|
@@ -1263,7 +1192,7 @@
|
|
|
1263
1192
|
|
|
1264
1193
|
const renderWedDataOrganization = (field, regions) => {
|
|
1265
1194
|
const isCurrencyControl = field('vedTypes').value === 'currencyControl';
|
|
1266
|
-
return (jsxs("div", { children: [
|
|
1195
|
+
return (jsxs("div", { children: [isCurrencyControl ? (jsx(SelectControl, { className: "mb-s", label: "\u0424\u0438\u043B\u0438\u0430\u043B", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) })) : null, jsxs("div", { className: "@xl:grid @xl:grid-cols-2 @xl:gap-x-lg", children: [isCurrencyControl ? (jsx(InputControl, { className: "w-full mb-s", label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) })) : null, jsx(InputControl, { className: "w-full mb-s", label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...withValidator(field('fullName'), defaultValidator) }), jsx(InputControl, { className: "w-full mb-s", label: "\u0424\u0418\u041E", ...withValidator(field('name'), nameValidator) }), jsx(PhoneInputControl, { className: "w-full mb-s", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), !isCurrencyControl ? (jsx(InputControl, { className: "w-full mb-s", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('mail'), defaultValidator) })) : null] })] }));
|
|
1267
1196
|
};
|
|
1268
1197
|
|
|
1269
1198
|
const activeTextareaStyles = 'hover:border-primary-hover active:focus:border-primary-text focus:border-primary-text';
|
|
@@ -1374,18 +1303,20 @@
|
|
|
1374
1303
|
|
|
1375
1304
|
const defaultIconSize = 56;
|
|
1376
1305
|
|
|
1377
|
-
const
|
|
1378
|
-
|
|
1306
|
+
const AlignStyles = 'text-left';
|
|
1307
|
+
|
|
1308
|
+
const BenefitsBlock = JSX(({ className = '', title, benefitList, ...rest }) => (jsxs(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: [title ? jsx(Heading, { headingType: "h3", as: "h2", className: AlignStyles, title: title }) : null, benefitList?.length ? (jsx("div", { className: "flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl", role: "list", children: benefitList.map(renderBenefit) })) : null] })));
|
|
1309
|
+
const renderBenefit = (benefit, i) => (jsxs("div", { className: "flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]", role: "listitem", children: [benefit?.icon?.icon ? (jsx(RoundedIcon, { className: "shrink-0", defaultIconSize: defaultIconSize, iconBgVersion: benefit?.iconBgVersion || '', ...benefit?.icon })) : null, benefit?.icon?.src ? jsx(Img, { className: "shrink-0", image: benefit.icon }) : null, benefit?.label ? (jsxs("div", { className: "@sm:h-full", children: [jsx(Heading, { headingType: "h6", children: benefit.label }), renderDescription$3(benefit.description)] })) : null] }, String(i)));
|
|
1379
1310
|
const renderDescription$3 = (description) => {
|
|
1380
1311
|
const benefitType = description?.benefitType || null;
|
|
1381
|
-
return description && benefitType ? (jsx("div", { className: "mt-
|
|
1312
|
+
return description && benefitType ? (jsx("div", { className: "mt-xs text-l font-light text-secondary-text group-data-secondary:text-white/80", children: benefitType === 'list'
|
|
1382
1313
|
? renderListBenefit(description)
|
|
1383
1314
|
: renderTextBenefit(description) })) : null;
|
|
1384
1315
|
};
|
|
1385
|
-
const renderTextBenefit = (description) => description?.name ? (jsx(
|
|
1316
|
+
const renderTextBenefit = (description) => description?.name ? (jsx(Text, { size: "text-l", color: "text-secondary-text group-data-secondary:text-white/80", font: "font-light", children: description.name })) : null;
|
|
1386
1317
|
const renderListBenefit = (description) => {
|
|
1387
1318
|
const listStyleType = description?.bullets ? 'list-disc pl-3xl' : '';
|
|
1388
|
-
return description?.items && description.items.length > 0 ? (jsx("ul", { className: listStyleType, children: description.items.map((_, i) => (jsx(
|
|
1319
|
+
return description?.items && description.items.length > 0 ? (jsx("ul", { className: listStyleType, children: description.items.map((_, i) => (jsx("li", { children: jsx(Text, { size: "text-l", color: "text-secondary-text group-data-secondary:text-white/80", font: "font-light", children: _ }) }, `benefitListItem-${i}`))) })) : null;
|
|
1389
1320
|
};
|
|
1390
1321
|
|
|
1391
1322
|
const renderButtonsSection = (buttons, { className, buttonClassName, isVertical } = {}) => buttons?.length && buttons.some((_) => _?.text || _?.icon?.icon) ? (jsx("div", { className: style('flex', isVertical ? 'flex-col gap-xs justify-items-stretch' : 'flex-wrap gap-lg sm:gap-m', className), children: buttons.map(renderButton$1(buttonClassName)) })) : null;
|
|
@@ -1458,8 +1389,6 @@
|
|
|
1458
1389
|
return (jsxs(BlockWrapper, { className: style(isEmbedded ? '@container-normal' : '', className), defaultPadding: isEmbedded ? '' : 'p-6xl', version: version, isTheme: isTheme, ...rest, children: [title ? (jsx(Heading, { className: style('whitespace-pre-wrap', align), ...versionStyle?.title, as: as || versionStyle?.title.as, title: title })) : null, description ? (jsx(Paragraph, { size: versionStyle.descriptionSize, font: versionStyle.descriptionWeight, align: align, ...descriptionStyle, children: description })) : null] }));
|
|
1459
1390
|
});
|
|
1460
1391
|
|
|
1461
|
-
const AlignStyles = 'text-left';
|
|
1462
|
-
|
|
1463
1392
|
const Bonus = JSX(({ className = '', title, description, bonusItems = [], align = AlignStyles, ...rest }) => (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container", children: [jsx(Headline, { className: "mb-xl", isEmbedded: true, title: title, description: description, headlineVersion: "M", align: align }), jsx("div", { className: "flex flex-wrap w-full", children: bonusItems.length > 0
|
|
1464
1393
|
? bonusItems.map((_, i) => (jsxs("div", { className: "mb-3xl last:mb-0 sm:space-y-xs flex flex-col grow w-full p-4xl sm:p-m @xl:w-[49%] border border-gray", children: [jsx("div", { className: "grow", children: jsx(Headline, { title: _?.title, description: _?.description, headlineVersion: "S", isEmbedded: true, align: "text-left" }) }), jsxs("div", { className: "flex justify-center sm:justify-between sm:items-end", children: [jsx("div", { className: "hidden sm:block", children: renderButtonsSection(_?.buttons) }), _.bonusItemContent?.bonusType
|
|
1465
1394
|
? renderBonusItemContent(_.bonusItemContent)
|
|
@@ -3861,6 +3790,70 @@
|
|
|
3861
3790
|
return result;
|
|
3862
3791
|
};
|
|
3863
3792
|
|
|
3793
|
+
const JARO_WINKLER_P = 0.1;
|
|
3794
|
+
const JARO_WINKLER_MAX_L = 4;
|
|
3795
|
+
const jaroWinklerDistance = (s1) => (s2) => {
|
|
3796
|
+
if (s1 === s2) {
|
|
3797
|
+
return 1;
|
|
3798
|
+
}
|
|
3799
|
+
if (!s1 || !s2) {
|
|
3800
|
+
return 0;
|
|
3801
|
+
}
|
|
3802
|
+
const { m, s1Matches, s2Matches } = computeM(s1, s2);
|
|
3803
|
+
if (m === 0) {
|
|
3804
|
+
return 0;
|
|
3805
|
+
}
|
|
3806
|
+
const t = computeT(s1, s2, { s1Matches, s2Matches });
|
|
3807
|
+
const jaroWeight = (m / s1.length + m / s2.length + (m - t / 2) / m) / 3;
|
|
3808
|
+
const winklerWeight = jaroWeight > 0.7 ? computePrefixL(s1, s2) * JARO_WINKLER_P : 0;
|
|
3809
|
+
return jaroWeight + winklerWeight * (1 - jaroWeight);
|
|
3810
|
+
};
|
|
3811
|
+
function computeM(s1, s2) {
|
|
3812
|
+
const range = Math.max(0, Math.floor(Math.max(s1.length, s2.length) / 2) - 1);
|
|
3813
|
+
const s1Matches = new Array(s1.length);
|
|
3814
|
+
const s2Matches = new Array(s2.length);
|
|
3815
|
+
let m = 0;
|
|
3816
|
+
for (let i = 0; i < s1.length; i++) {
|
|
3817
|
+
const low = Math.max(0, i - range);
|
|
3818
|
+
const high = Math.min(i + range, s2.length - 1);
|
|
3819
|
+
for (let j = low; j <= high; j++) {
|
|
3820
|
+
if (s1Matches[i] || s2Matches[j] || s1[i] !== s2[j]) {
|
|
3821
|
+
continue;
|
|
3822
|
+
}
|
|
3823
|
+
m++;
|
|
3824
|
+
s1Matches[i] = true;
|
|
3825
|
+
s2Matches[j] = true;
|
|
3826
|
+
}
|
|
3827
|
+
}
|
|
3828
|
+
return { m, s1Matches, s2Matches };
|
|
3829
|
+
}
|
|
3830
|
+
function computeT(s1, s2, { s1Matches, s2Matches }) {
|
|
3831
|
+
let t = 0;
|
|
3832
|
+
for (let i = 0, k = 0; i < s1.length; i++) {
|
|
3833
|
+
if (!s1Matches[i]) {
|
|
3834
|
+
continue;
|
|
3835
|
+
}
|
|
3836
|
+
let j = k;
|
|
3837
|
+
for (; j < s2.length; j++) {
|
|
3838
|
+
if (s2Matches[j]) {
|
|
3839
|
+
k = j + 1;
|
|
3840
|
+
break;
|
|
3841
|
+
}
|
|
3842
|
+
}
|
|
3843
|
+
if (s1[i] !== s2[j]) {
|
|
3844
|
+
t++;
|
|
3845
|
+
}
|
|
3846
|
+
}
|
|
3847
|
+
return t;
|
|
3848
|
+
}
|
|
3849
|
+
function computePrefixL(s1, s2) {
|
|
3850
|
+
let prefixL = 0;
|
|
3851
|
+
while (s1[prefixL] === s2[prefixL] && prefixL < JARO_WINKLER_MAX_L) {
|
|
3852
|
+
prefixL++;
|
|
3853
|
+
}
|
|
3854
|
+
return prefixL;
|
|
3855
|
+
}
|
|
3856
|
+
|
|
3864
3857
|
const SearchBar$1 = JSX(({ className, searchTerm, onSearch }) => {
|
|
3865
3858
|
return (jsxs("form", { className: `font-sans relative ${className}`, children: [jsx("div", { className: "absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none", children: searchTerm ? null : (jsx("label", { htmlFor: "search-bar-input", className: `text-secondary-text `, children: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0444\u0438\u043B\u0438\u0430\u043B\u0430\u043C" })) }), jsx("input", { id: "search-bar-input", className: `h-12 pl-m w-full peer text-l text-black border border-solid rounded-md box-border
|
|
3866
3859
|
outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text`, value: searchTerm, onChange: (e) => onSearch(e.target.value.toLowerCase()), type: "text", name: "location-search-bar-input" })] }));
|
|
@@ -3925,6 +3918,13 @@
|
|
|
3925
3918
|
}, deps);
|
|
3926
3919
|
}
|
|
3927
3920
|
|
|
3921
|
+
const compareBy = (indexOf) => (a, b) => indexOf(a) - indexOf(b);
|
|
3922
|
+
const desc = (cmp) => (a, b) => -cmp(a, b);
|
|
3923
|
+
|
|
3924
|
+
function zip(firstCol, ...restCols) {
|
|
3925
|
+
return firstCol.map((firstEl, rowIndex) => [firstEl, ...restCols.map((col) => col[rowIndex])]);
|
|
3926
|
+
}
|
|
3927
|
+
|
|
3928
3928
|
const joinMaps = (aggregate, emptyVal) => (acc, map) => {
|
|
3929
3929
|
for (const [key, b] of map) {
|
|
3930
3930
|
acc.set(key, aggregate(acc.get(key) || emptyVal, b));
|
|
@@ -4173,7 +4173,7 @@
|
|
|
4173
4173
|
burgerMenu,
|
|
4174
4174
|
...menuItems.slice(middleIdx),
|
|
4175
4175
|
], [menuItems, middleIdx, burgerMenu]);
|
|
4176
|
-
return (jsx(BlockWrapper, { className: "fixed bottom-0 left-0
|
|
4176
|
+
return (jsx("div", { className: "w-full mb-5", children: jsx(BlockWrapper, { className: "@container-normal fixed w-full h-[74] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]", padding: "p-0", children: jsx(RenderMenuItems, { menuItems: menuItemsWithButton, onClick: toggle }) }) }));
|
|
4177
4177
|
});
|
|
4178
4178
|
|
|
4179
4179
|
const tabPaddingStyleMap = {
|
|
@@ -4553,7 +4553,7 @@
|
|
|
4553
4553
|
|
|
4554
4554
|
async function fetchMultitudeJSON(...urls) {
|
|
4555
4555
|
const fetchPromises = urls.map((url) => fetchJSON(url));
|
|
4556
|
-
return
|
|
4556
|
+
return Promise.all(fetchPromises);
|
|
4557
4557
|
}
|
|
4558
4558
|
|
|
4559
4559
|
const unique = (list) => [...new Set(list)];
|
|
@@ -4902,7 +4902,7 @@
|
|
|
4902
4902
|
parent: data,
|
|
4903
4903
|
};
|
|
4904
4904
|
useBlockRouterProvider();
|
|
4905
|
-
return (jsxs("div", {
|
|
4905
|
+
return (jsxs("div", { "data-theme": colorPalette, children: [jsxs("section", { className: style('relative', pageStyle, className), children: [slots?.header ? (jsx("div", { className: "relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]", children: renderBlocksList(slots?.header, { ...options, slotName: 'header' }) })) : null, jsxs("div", { className: "container space-y-px @lg:space-y-0 @lg:grid @lg:grid-cols-12 @lg:gap-2xs", children: [renderChildren({ block: data, options, extraProps: { className: 'scroll-mt-12' } }), renderBlocksList(slots?.footer, { ...options, slotName: 'footer' })] }), likeControl ? renderLikeControl() : null] }), jsx(StickyBottomMenu, {}), jsx(DialogManager, {}), jsx(PopupManager, {}), jsx(CookiePopup, { termLink: { href: '/pd-policy#cookie', target: '_blank' }, personalDataPolicyLink: { href: '/pd-policy', target: '_blank' } })] }));
|
|
4906
4906
|
});
|
|
4907
4907
|
ContentPage.childrenTypes = [];
|
|
4908
4908
|
ContentPage.slots = () => ['header', 'footer', 'StickyBottomMenu'];
|
|
@@ -4912,7 +4912,7 @@
|
|
|
4912
4912
|
|
|
4913
4913
|
const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
|
|
4914
4914
|
|
|
4915
|
-
const packageVersion = "0.14.
|
|
4915
|
+
const packageVersion = "0.14.7";
|
|
4916
4916
|
|
|
4917
4917
|
exports.Blocks = Blocks;
|
|
4918
4918
|
exports.ContentPage = ContentPage;
|