@redneckz/wildless-cms-uni-blocks 0.14.81 → 0.14.83
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/bundle/bundle.umd.js +4 -4
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +6 -0
- package/bundle/components/StickyBottomMenu/StickyBottomMenuItem.d.ts +8 -0
- package/bundle/components/StickyBottomMenu/StickyBottomMenuProps.d.ts +1 -4
- package/bundle/hooks/useActiveRoute.d.ts +3 -2
- package/dist/components/Calculator/CreditCalculatorForm.js +1 -1
- package/dist/components/Calculator/RefinancingCalculatorForm.js +2 -2
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js +11 -18
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +6 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuBurger.js +8 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuBurger.js.map +1 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuItem.d.ts +8 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuItem.js +15 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuItem.js.map +1 -0
- package/dist/components/StickyBottomMenu/StickyBottomMenuProps.d.ts +1 -4
- package/dist/hooks/useActiveRoute.d.ts +3 -2
- package/dist/hooks/useActiveRoute.js.map +1 -1
- package/lib/components/Calculator/CreditCalculatorForm.js +1 -1
- package/lib/components/Calculator/RefinancingCalculatorForm.js +2 -2
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js +12 -19
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +6 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuBurger.js +6 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuBurger.js.map +1 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuItem.d.ts +8 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuItem.js +13 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuItem.js.map +1 -0
- package/lib/components/StickyBottomMenu/StickyBottomMenuProps.d.ts +1 -4
- package/lib/hooks/useActiveRoute.d.ts +3 -2
- package/lib/hooks/useActiveRoute.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +18 -39
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +6 -0
- package/mobile/bundle/components/StickyBottomMenu/StickyBottomMenuItem.d.ts +8 -0
- package/mobile/bundle/components/StickyBottomMenu/StickyBottomMenuProps.d.ts +1 -4
- package/mobile/bundle/hooks/useActiveRoute.d.ts +3 -2
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js +1 -1
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js +2 -2
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js +11 -18
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +6 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuBurger.js +8 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuBurger.js.map +1 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuItem.d.ts +8 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuItem.js +15 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuItem.js.map +1 -0
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuProps.d.ts +1 -4
- package/mobile/dist/hooks/useActiveRoute.d.ts +3 -2
- package/mobile/dist/hooks/useActiveRoute.js.map +1 -1
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js +1 -1
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js +2 -2
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js +12 -19
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuBurger.d.ts +6 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuBurger.js +6 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuBurger.js.map +1 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuItem.d.ts +8 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuItem.js +13 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuItem.js.map +1 -0
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuProps.d.ts +1 -4
- package/mobile/lib/hooks/useActiveRoute.d.ts +3 -2
- package/mobile/lib/hooks/useActiveRoute.js.map +1 -1
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +1 -1
- package/mobile/src/components/Calculator/RefinancingCalculatorForm.tsx +2 -2
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenu.tsx +28 -23
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenuBurger.tsx +21 -0
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenuItem.tsx +42 -0
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenuProps.tsx +1 -5
- package/mobile/src/hooks/useActiveRoute.ts +3 -4
- package/package.json +1 -1
- package/src/components/Calculator/CreditCalculatorForm.tsx +1 -1
- package/src/components/Calculator/RefinancingCalculatorForm.tsx +2 -2
- package/src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx +28 -23
- package/src/components/StickyBottomMenu/StickyBottomMenuBurger.tsx +21 -0
- package/src/components/StickyBottomMenu/StickyBottomMenuItem.tsx +42 -0
- package/src/components/StickyBottomMenu/StickyBottomMenuProps.tsx +1 -5
- package/src/hooks/useActiveRoute.ts +3 -4
- package/bundle/components/StickyBottomMenu/RenderItem.d.ts +0 -8
- package/bundle/components/StickyBottomMenu/RenderMenuItems.d.ts +0 -7
- package/dist/components/StickyBottomMenu/RenderItem.d.ts +0 -8
- package/dist/components/StickyBottomMenu/RenderItem.js +0 -25
- package/dist/components/StickyBottomMenu/RenderItem.js.map +0 -1
- package/dist/components/StickyBottomMenu/RenderMenuItems.d.ts +0 -7
- package/dist/components/StickyBottomMenu/RenderMenuItems.js +0 -11
- package/dist/components/StickyBottomMenu/RenderMenuItems.js.map +0 -1
- package/lib/components/StickyBottomMenu/RenderItem.d.ts +0 -8
- package/lib/components/StickyBottomMenu/RenderItem.js +0 -23
- package/lib/components/StickyBottomMenu/RenderItem.js.map +0 -1
- package/lib/components/StickyBottomMenu/RenderMenuItems.d.ts +0 -7
- package/lib/components/StickyBottomMenu/RenderMenuItems.js +0 -9
- package/lib/components/StickyBottomMenu/RenderMenuItems.js.map +0 -1
- package/mobile/bundle/components/StickyBottomMenu/RenderItem.d.ts +0 -8
- package/mobile/bundle/components/StickyBottomMenu/RenderMenuItems.d.ts +0 -7
- package/mobile/dist/components/StickyBottomMenu/RenderItem.d.ts +0 -8
- package/mobile/dist/components/StickyBottomMenu/RenderItem.js +0 -25
- package/mobile/dist/components/StickyBottomMenu/RenderItem.js.map +0 -1
- package/mobile/dist/components/StickyBottomMenu/RenderMenuItems.d.ts +0 -7
- package/mobile/dist/components/StickyBottomMenu/RenderMenuItems.js +0 -11
- package/mobile/dist/components/StickyBottomMenu/RenderMenuItems.js.map +0 -1
- package/mobile/lib/components/StickyBottomMenu/RenderItem.d.ts +0 -8
- package/mobile/lib/components/StickyBottomMenu/RenderItem.js +0 -23
- package/mobile/lib/components/StickyBottomMenu/RenderItem.js.map +0 -1
- package/mobile/lib/components/StickyBottomMenu/RenderMenuItems.d.ts +0 -7
- package/mobile/lib/components/StickyBottomMenu/RenderMenuItems.js +0 -9
- package/mobile/lib/components/StickyBottomMenu/RenderMenuItems.js.map +0 -1
- package/mobile/src/components/StickyBottomMenu/RenderItem.tsx +0 -51
- package/mobile/src/components/StickyBottomMenu/RenderMenuItems.tsx +0 -21
- package/src/components/StickyBottomMenu/RenderItem.tsx +0 -51
- package/src/components/StickyBottomMenu/RenderMenuItems.tsx +0 -21
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MenuItem } from './StickyBottomMenuContent';
|
|
2
|
+
interface StickyBottomMenuItemProps {
|
|
3
|
+
isActive?: boolean;
|
|
4
|
+
item?: MenuItem;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const StickyBottomMenuItem: import("@redneckz/uni-jsx").UNIComponent<StickyBottomMenuItemProps, any, any>;
|
|
8
|
+
export {};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type UniBlockProps } from '../../model/JSXBlock';
|
|
2
2
|
import { type MenuItem, type StickyBottomMenuContent } from './StickyBottomMenuContent';
|
|
3
|
-
export interface MenuItemProps extends MenuItem {
|
|
4
|
-
isActive?: boolean;
|
|
5
|
-
}
|
|
6
3
|
export interface StickyBottomMenuProps extends StickyBottomMenuContent, UniBlockProps {
|
|
7
|
-
menuItems?:
|
|
4
|
+
menuItems?: MenuItem[];
|
|
8
5
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare function useActiveRoute<T extends {
|
|
2
|
+
href?: string;
|
|
3
|
+
}>(items?: T[] | undefined): [number, T];
|
|
@@ -48,7 +48,7 @@ exports.CreditCalculatorForm = (0, uni_jsx_1.JSX)(({ className, sourceBookDir, b
|
|
|
48
48
|
value: calculatorParams.monthsValue,
|
|
49
49
|
}), renderCreditParamsForm({ ...calculatorParams, ...paramsViewSettings }, field), (0, jsx_runtime_1.jsx)("div", { className: "sm:hidden", children: paymentTypeElement })] }), (0, jsx_runtime_1.jsx)("div", { className: "border-b border-main-divider md:hidden" }), (0, renderRate_1.renderRate)({
|
|
50
50
|
rate: calculatorParams.rate,
|
|
51
|
-
}), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2xl sm:w-96", children: [(0, jsx_runtime_1.jsx)(CalculatorValueBlock_1.CalculatorValueBlock, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\
|
|
51
|
+
}), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2xl sm:w-96", children: [(0, jsx_runtime_1.jsx)(CalculatorValueBlock_1.CalculatorValueBlock, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436", value: calculatorParams.monthlyPayment, postfix: "\u20BD" }), (0, jsx_runtime_1.jsx)("div", { className: "hidden sm:block", children: paymentTypeElement }), (0, renderButtonsSection_1.renderButtonsSection)(buttons, { isVertical: true }), (0, renderFootnote_1.renderFootnote)(footnote)] })] }));
|
|
52
52
|
});
|
|
53
53
|
const renderCreditParamsForm = (params, field) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-y-2xl", children: [params.isShowSalaryClient ? ((0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { text: `Получаю зарплату на счёт\nв Россельхозбанке`, ...field('isSalaryClient'), value: params.isSalaryClient, className: "whitespace-pre-line sm:whitespace-normal" })) : null, params.isShowStateEmployee ? ((0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { text: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E \u0432 \u0431\u044E\u0434\u0436\u0435\u0442\u043D\u043E\u0439 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('isStateEmployee'), value: params.isStateEmployee })) : null, params.isShowPensionClient ? ((0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", ...field('isPensionClient'), value: params.isPensionClient })) : null, params.isShowInsurance ? ((0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", ...field('isInsurance'), value: params.isInsurance })) : null] }));
|
|
54
54
|
//# sourceMappingURL=CreditCalculatorForm.js.map
|
|
@@ -41,7 +41,7 @@ exports.RefinancingCalculatorForm = (0, uni_jsx_1.JSX)(({ className, sourceBookD
|
|
|
41
41
|
...field('moneyValue'),
|
|
42
42
|
value: calculatorParams.moneyValue,
|
|
43
43
|
}), (0, renderWantedSumInput_1.renderWantedSumInput)({
|
|
44
|
-
title: 'Ежемесячный
|
|
44
|
+
title: 'Ежемесячный платёж в других банках, ₽',
|
|
45
45
|
step: 500,
|
|
46
46
|
min: calculatorParams.minSumOld,
|
|
47
47
|
max: calculatorParams.maxSumOld,
|
|
@@ -65,7 +65,7 @@ exports.RefinancingCalculatorForm = (0, uni_jsx_1.JSX)(({ className, sourceBookD
|
|
|
65
65
|
: null, (0, jsx_runtime_1.jsx)("div", { className: "sm:hidden pt-1 pb-4 border-b border-main-divider", children: paymentTypeElement })] }), (0, renderRate_1.renderRate)({
|
|
66
66
|
rate: calculatorParams.rate,
|
|
67
67
|
fractionDigits: 1,
|
|
68
|
-
}), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2xl mt-2 sm:w-96 sm:mt-0", children: [(0, jsx_runtime_1.jsx)(CalculatorValueBlock_1.CalculatorValueBlock, { title: 'Ежемесячный
|
|
68
|
+
}), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2xl mt-2 sm:w-96 sm:mt-0", children: [(0, jsx_runtime_1.jsx)(CalculatorValueBlock_1.CalculatorValueBlock, { title: 'Ежемесячный платёж', value: calculatorParams.monthlyPayment, postfix: "\u20BD" }), calculatorParams.benefit > 0 ? ((0, jsx_runtime_1.jsx)(CalculatorValueBlock_1.CalculatorValueBlock, { title: 'Выгода в месяц', value: calculatorParams.benefit, postfix: "\u20BD" })) : null, (0, jsx_runtime_1.jsx)("div", { className: "hidden sm:block", children: paymentTypeElement }), (0, renderButtonsSection_1.renderButtonsSection)(buttons, { isVertical: true }), (0, renderFootnote_1.renderFootnote)(footnote)] })] }));
|
|
69
69
|
});
|
|
70
70
|
const renderCreditParamsForm = (params, field) => ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-lg sm:space-y-s", children: [params.isShowSalaryClient ? ((0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0443 \u043D\u0430 \u0441\u0447\u0451\u0442 \u0432 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0435", ...field('isSalaryClient'), value: params.isSalaryClient })) : null, params.isShowInsurance ? ((0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", ...field('isInsurance'), value: params.isInsurance })) : null, (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0443\u044E \u0441\u0443\u043C\u043C\u0443", ...field('isExtraMoney'), value: params.isExtraMoney })] }));
|
|
71
71
|
//# sourceMappingURL=RefinancingCalculatorForm.js.map
|
|
@@ -2,30 +2,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.StickyBottomMenu = void 0;
|
|
3
3
|
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
-
const
|
|
5
|
+
const useActiveRoute_1 = require("../../hooks/useActiveRoute");
|
|
6
6
|
const useSWRResource_1 = require("../../hooks/useSWRResource");
|
|
7
7
|
const ProjectSettings_1 = require("../../ProjectSettings");
|
|
8
8
|
const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
9
|
-
const
|
|
9
|
+
const StickyBottomMenuBurger_1 = require("./StickyBottomMenuBurger");
|
|
10
|
+
const StickyBottomMenuItem_1 = require("./StickyBottomMenuItem");
|
|
10
11
|
const useBurgerMenuDialog_1 = require("./useBurgerMenuDialog");
|
|
12
|
+
const EMPTY_MENU = [];
|
|
11
13
|
exports.StickyBottomMenu = (0, uni_jsx_1.JSX)(({ ...rest }) => {
|
|
12
|
-
const {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
title: 'Меню',
|
|
16
|
-
icon: {
|
|
17
|
-
icon: 'BurgerIcon',
|
|
18
|
-
iconVersion: isBurgerMenuDialogOpen ? 'color' : 'black',
|
|
19
|
-
},
|
|
20
|
-
isActive: isBurgerMenuDialogOpen,
|
|
21
|
-
};
|
|
14
|
+
const [isBurgerMenuDialogOpen, { toggle, close }] = (0, useBurgerMenuDialog_1.useBurgerMenuDialog)();
|
|
15
|
+
const { menuItems = EMPTY_MENU } = (0, useSWRResource_1.useSWRResource)(ProjectSettings_1.projectSettings.STICKY_MOBILE_MENU || 'sticky-mobile-menu', { fallback: rest.options?.page?.fallback, folderName: 'portal-resources', setBasePath: true });
|
|
16
|
+
const [, activeItem] = (0, useActiveRoute_1.useActiveRoute)(menuItems);
|
|
22
17
|
const middleIdx = Math.floor(menuItems.length / 2);
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
burgerMenu,
|
|
26
|
-
...menuItems.slice(middleIdx),
|
|
27
|
-
], [menuItems, middleIdx, burgerMenu]);
|
|
18
|
+
const leftItems = menuItems.slice(0, middleIdx);
|
|
19
|
+
const rightItems = menuItems.slice(middleIdx);
|
|
28
20
|
/* Attribute [data-component] need for correct render in wcms editor. Do not remove. */
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "w-full mb-5", "data-component": "sticky-bottom-menu-container", children: (0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: "@container-normal fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]", padding: "p-0", children: (0, jsx_runtime_1.jsx)(
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "w-full mb-5", "data-component": "sticky-bottom-menu-container", children: (0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: "@container-normal fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]", padding: "p-0", children: (0, jsx_runtime_1.jsxs)("div", { className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: [leftItems.map(renderMenuItem(activeItem, close)), (0, jsx_runtime_1.jsx)(StickyBottomMenuBurger_1.StickyBottomMenuBurger, { isActive: isBurgerMenuDialogOpen, onClick: toggle }), rightItems.map(renderMenuItem(activeItem, close))] }) }) }));
|
|
30
22
|
});
|
|
23
|
+
const renderMenuItem = (activeItem, close) => (_, i) => ((0, jsx_runtime_1.jsx)(StickyBottomMenuItem_1.StickyBottomMenuItem, { isActive: _ === activeItem, item: _, onClick: close }, _.href || String(i)));
|
|
31
24
|
//# sourceMappingURL=StickyBottomMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyBottomMenu.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenu.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC
|
|
1
|
+
{"version":3,"file":"StickyBottomMenu.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenu.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,+DAA4D;AAC5D,+DAA4D;AAC5D,2DAAwD;AACxD,4DAAyD;AACzD,qEAAkE;AAElE,iEAA8D;AAE9D,+DAA4D;AAE5D,MAAM,UAAU,GAAG,EAAE,CAAC;AAET,QAAA,gBAAgB,GAAG,IAAA,aAAG,EAAwB,CAAC,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACzE,MAAM,CAAC,sBAAsB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAA,yCAAmB,GAAE,CAAC;IAE1E,MAAM,EAAE,SAAS,GAAG,UAAU,EAAE,GAAG,IAAA,+BAAc,EAC/C,iCAAe,CAAC,kBAAkB,IAAI,oBAAoB,EAC1D,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,IAAI,EAAE,CAC9F,CAAC;IAEF,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG,IAAA,+BAAc,EAAC,SAAS,CAAC,CAAC;IAEjD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAE9C,uFAAuF;IACvF,OAAO,CACL,gCAAK,SAAS,EAAC,aAAa,oBAAgB,8BAA8B,YACxE,uBAAC,2BAAY,IACX,SAAS,EAAC,6FAA6F,EACvG,OAAO,EAAC,KAAK,YAEb,iCAAK,SAAS,EAAC,iEAAiE,aAC7E,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,EACjD,uBAAC,+CAAsB,IAAC,QAAQ,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,GAAI,EAC5E,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,IAC9C,GACO,GACX,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,CAAC,UAAoB,EAAE,KAAiB,EAAE,EAAE,CAAC,CAAC,CAAW,EAAE,CAAS,EAAE,EAAE,CAC7F,CACE,uBAAC,2CAAoB,IAEnB,QAAQ,EAAE,CAAC,KAAK,UAAU,EAC1B,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,KAAK,IAHT,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,CAIxB,CACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.StickyBottomMenuBurger = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const Icon_1 = require("../../ui-kit/Icon/Icon");
|
|
6
|
+
const style_1 = require("../../utils/style");
|
|
7
|
+
exports.StickyBottomMenuBurger = (0, uni_jsx_1.JSX)(({ isActive, onClick }) => ((0, jsx_runtime_1.jsxs)("button", { className: (0, style_1.style)(isActive ? 'text-primary-main' : 'text-primary-text', `w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`), onClick: onClick, children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { className: "w-6 h-6", name: "BurgerIcon", iconVersion: isActive ? 'color' : 'black' }), "\u041C\u0435\u043D\u044E"] })));
|
|
8
|
+
//# sourceMappingURL=StickyBottomMenuBurger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StickyBottomMenuBurger.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenuBurger.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,iDAA8C;AAC9C,6CAA0C;AAO7B,QAAA,sBAAsB,GAAG,IAAA,aAAG,EAA8B,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAChG,oCACE,SAAS,EAAE,IAAA,aAAK,EACd,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,EACpD,2EAA2E,CAC5E,EACD,OAAO,EAAE,OAAO,aAEhB,uBAAC,WAAI,IAAC,SAAS,EAAC,SAAS,EAAC,IAAI,EAAC,YAAY,EAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,GAAI,gCAElF,CACV,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MenuItem } from './StickyBottomMenuContent';
|
|
2
|
+
interface StickyBottomMenuItemProps {
|
|
3
|
+
isActive?: boolean;
|
|
4
|
+
item?: MenuItem;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const StickyBottomMenuItem: import("@redneckz/uni-jsx").UNIComponent<StickyBottomMenuItemProps, any, any>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.StickyBottomMenuItem = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const useLink_1 = require("../../hooks/useLink");
|
|
6
|
+
const ProjectSettings_1 = require("../../ProjectSettings");
|
|
7
|
+
const Icon_1 = require("../../ui-kit/Icon/Icon");
|
|
8
|
+
const style_1 = require("../../utils/style");
|
|
9
|
+
exports.StickyBottomMenuItem = (0, uni_jsx_1.JSX)(({ isActive, item, onClick }) => {
|
|
10
|
+
const isAnotherPortal = !ProjectSettings_1.projectSettings?.BASE_PATH || !item?.href?.startsWith(ProjectSettings_1.projectSettings.BASE_PATH);
|
|
11
|
+
const link = (0, useLink_1.useLink)({ isRemote: isAnotherPortal });
|
|
12
|
+
const { href, onClick: handleClick } = link({ href: item?.href, onClick });
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("a", { className: (0, style_1.style)(isActive ? 'text-primary-main' : 'text-primary-text', `w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`), href: href, target: "_self", title: item?.title || '', onClick: handleClick, children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { className: "w-6 h-6", name: item?.icon?.icon, iconVersion: isActive ? 'color' : 'black' }), item?.title || ''] }));
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=StickyBottomMenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StickyBottomMenuItem.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenuItem.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,iDAA8C;AAC9C,2DAAwD;AACxD,iDAA8C;AAC9C,6CAA0C;AAS7B,QAAA,oBAAoB,GAAG,IAAA,aAAG,EACrC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IAC9B,MAAM,eAAe,GACnB,CAAC,iCAAe,EAAE,SAAS,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,iCAAe,CAAC,SAAS,CAAC,CAAC;IAEpF,MAAM,IAAI,GAAG,IAAA,iBAAO,EAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC;IACpD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAE3E,OAAO,CACL,+BACE,SAAS,EAAE,IAAA,aAAK,EACd,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,EACpD,2EAA2E,CAC5E,EACD,IAAI,EAAE,IAAI,EACV,MAAM,EAAC,OAAO,EACd,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,EACxB,OAAO,EAAE,WAAW,aAEpB,uBAAC,WAAI,IACH,SAAS,EAAC,SAAS,EACnB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EACtB,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,GACzC,EACD,IAAI,EAAE,KAAK,IAAI,EAAE,IAChB,CACL,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type UniBlockProps } from '../../model/JSXBlock';
|
|
2
2
|
import { type MenuItem, type StickyBottomMenuContent } from './StickyBottomMenuContent';
|
|
3
|
-
export interface MenuItemProps extends MenuItem {
|
|
4
|
-
isActive?: boolean;
|
|
5
|
-
}
|
|
6
3
|
export interface StickyBottomMenuProps extends StickyBottomMenuContent, UniBlockProps {
|
|
7
|
-
menuItems?:
|
|
4
|
+
menuItems?: MenuItem[];
|
|
8
5
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare function useActiveRoute<T extends {
|
|
2
|
+
href?: string;
|
|
3
|
+
}>(items?: T[] | undefined): [number, T];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveRoute.js","sourceRoot":"","sources":["../../src/hooks/useActiveRoute.ts"],"names":[],"mappings":";;AAAA,0EAAuE;
|
|
1
|
+
{"version":3,"file":"useActiveRoute.js","sourceRoot":"","sources":["../../src/hooks/useActiveRoute.ts"],"names":[],"mappings":";;AAAA,0EAAuE;AACvE,2CAAwC;AAExC,SAAgB,cAAc,CAC5B,QAAyB,EAAE;IAE3B,MAAM,MAAM,GAAG,IAAA,qBAAS,GAAE,CAAC;IAC3B,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,IAAA,iCAAe,EAAC,MAAM,CAAC,CAAC,CAAC;IAE7D,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;AAC3C,CAAC;AAPD,wCAOC"}
|
|
@@ -46,7 +46,7 @@ export const CreditCalculatorForm = JSX(({ className, sourceBookDir, buttons, fo
|
|
|
46
46
|
value: calculatorParams.monthsValue,
|
|
47
47
|
}), renderCreditParamsForm({ ...calculatorParams, ...paramsViewSettings }, field), _jsx("div", { className: "sm:hidden", children: paymentTypeElement })] }), _jsx("div", { className: "border-b border-main-divider md:hidden" }), renderRate({
|
|
48
48
|
rate: calculatorParams.rate,
|
|
49
|
-
}), _jsxs("div", { className: "flex flex-col gap-2xl sm:w-96", children: [_jsx(CalculatorValueBlock, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\
|
|
49
|
+
}), _jsxs("div", { className: "flex flex-col gap-2xl sm:w-96", children: [_jsx(CalculatorValueBlock, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436", value: calculatorParams.monthlyPayment, postfix: "\u20BD" }), _jsx("div", { className: "hidden sm:block", children: paymentTypeElement }), renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }));
|
|
50
50
|
});
|
|
51
51
|
const renderCreditParamsForm = (params, field) => (_jsxs("div", { className: "flex flex-col gap-y-2xl", children: [params.isShowSalaryClient ? (_jsx(Checkbox, { text: `Получаю зарплату на счёт\nв Россельхозбанке`, ...field('isSalaryClient'), value: params.isSalaryClient, className: "whitespace-pre-line sm:whitespace-normal" })) : null, params.isShowStateEmployee ? (_jsx(Checkbox, { text: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E \u0432 \u0431\u044E\u0434\u0436\u0435\u0442\u043D\u043E\u0439 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('isStateEmployee'), value: params.isStateEmployee })) : null, params.isShowPensionClient ? (_jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", ...field('isPensionClient'), value: params.isPensionClient })) : null, params.isShowInsurance ? (_jsx(Checkbox, { text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", ...field('isInsurance'), value: params.isInsurance })) : null] }));
|
|
52
52
|
//# sourceMappingURL=CreditCalculatorForm.js.map
|
|
@@ -39,7 +39,7 @@ export const RefinancingCalculatorForm = JSX(({ className, sourceBookDir, button
|
|
|
39
39
|
...field('moneyValue'),
|
|
40
40
|
value: calculatorParams.moneyValue,
|
|
41
41
|
}), renderWantedSumInput({
|
|
42
|
-
title: 'Ежемесячный
|
|
42
|
+
title: 'Ежемесячный платёж в других банках, ₽',
|
|
43
43
|
step: 500,
|
|
44
44
|
min: calculatorParams.minSumOld,
|
|
45
45
|
max: calculatorParams.maxSumOld,
|
|
@@ -63,7 +63,7 @@ export const RefinancingCalculatorForm = JSX(({ className, sourceBookDir, button
|
|
|
63
63
|
: null, _jsx("div", { className: "sm:hidden pt-1 pb-4 border-b border-main-divider", children: paymentTypeElement })] }), renderRate({
|
|
64
64
|
rate: calculatorParams.rate,
|
|
65
65
|
fractionDigits: 1,
|
|
66
|
-
}), _jsxs("div", { className: "flex flex-col gap-2xl mt-2 sm:w-96 sm:mt-0", children: [_jsx(CalculatorValueBlock, { title: 'Ежемесячный
|
|
66
|
+
}), _jsxs("div", { className: "flex flex-col gap-2xl mt-2 sm:w-96 sm:mt-0", children: [_jsx(CalculatorValueBlock, { title: 'Ежемесячный платёж', value: calculatorParams.monthlyPayment, postfix: "\u20BD" }), calculatorParams.benefit > 0 ? (_jsx(CalculatorValueBlock, { title: 'Выгода в месяц', value: calculatorParams.benefit, postfix: "\u20BD" })) : null, _jsx("div", { className: "hidden sm:block", children: paymentTypeElement }), renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }));
|
|
67
67
|
});
|
|
68
68
|
const renderCreditParamsForm = (params, field) => (_jsxs("div", { className: "space-y-lg sm:space-y-s", children: [params.isShowSalaryClient ? (_jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0443 \u043D\u0430 \u0441\u0447\u0451\u0442 \u0432 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0435", ...field('isSalaryClient'), value: params.isSalaryClient })) : null, params.isShowInsurance ? (_jsx(Checkbox, { text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", ...field('isInsurance'), value: params.isInsurance })) : null, _jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0443\u044E \u0441\u0443\u043C\u043C\u0443", ...field('isExtraMoney'), value: params.isExtraMoney })] }));
|
|
69
69
|
//# sourceMappingURL=RefinancingCalculatorForm.js.map
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
import {
|
|
3
|
+
import { useActiveRoute } from '../../hooks/useActiveRoute.js';
|
|
4
4
|
import { useSWRResource } from '../../hooks/useSWRResource.js';
|
|
5
5
|
import { projectSettings } from '../../ProjectSettings.js';
|
|
6
6
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
7
|
-
import {
|
|
7
|
+
import { StickyBottomMenuBurger } from './StickyBottomMenuBurger.js';
|
|
8
|
+
import { StickyBottomMenuItem } from './StickyBottomMenuItem.js';
|
|
8
9
|
import { useBurgerMenuDialog } from './useBurgerMenuDialog.js';
|
|
10
|
+
const EMPTY_MENU = [];
|
|
9
11
|
export const StickyBottomMenu = JSX(({ ...rest }) => {
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
title: 'Меню',
|
|
14
|
-
icon: {
|
|
15
|
-
icon: 'BurgerIcon',
|
|
16
|
-
iconVersion: isBurgerMenuDialogOpen ? 'color' : 'black',
|
|
17
|
-
},
|
|
18
|
-
isActive: isBurgerMenuDialogOpen,
|
|
19
|
-
};
|
|
12
|
+
const [isBurgerMenuDialogOpen, { toggle, close }] = useBurgerMenuDialog();
|
|
13
|
+
const { menuItems = EMPTY_MENU } = useSWRResource(projectSettings.STICKY_MOBILE_MENU || 'sticky-mobile-menu', { fallback: rest.options?.page?.fallback, folderName: 'portal-resources', setBasePath: true });
|
|
14
|
+
const [, activeItem] = useActiveRoute(menuItems);
|
|
20
15
|
const middleIdx = Math.floor(menuItems.length / 2);
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
burgerMenu,
|
|
24
|
-
...menuItems.slice(middleIdx),
|
|
25
|
-
], [menuItems, middleIdx, burgerMenu]);
|
|
16
|
+
const leftItems = menuItems.slice(0, middleIdx);
|
|
17
|
+
const rightItems = menuItems.slice(middleIdx);
|
|
26
18
|
/* Attribute [data-component] need for correct render in wcms editor. Do not remove. */
|
|
27
|
-
return (_jsx("div", { className: "w-full mb-5", "data-component": "sticky-bottom-menu-container", children: _jsx(BlockWrapper, { className: "@container-normal fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]", padding: "p-0", children: _jsx(
|
|
19
|
+
return (_jsx("div", { className: "w-full mb-5", "data-component": "sticky-bottom-menu-container", children: _jsx(BlockWrapper, { className: "@container-normal fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]", padding: "p-0", children: _jsxs("div", { className: "ml-auto container bg-white flex justify-center shadow-blue-gray", children: [leftItems.map(renderMenuItem(activeItem, close)), _jsx(StickyBottomMenuBurger, { isActive: isBurgerMenuDialogOpen, onClick: toggle }), rightItems.map(renderMenuItem(activeItem, close))] }) }) }));
|
|
28
20
|
});
|
|
21
|
+
const renderMenuItem = (activeItem, close) => (_, i) => (_jsx(StickyBottomMenuItem, { isActive: _ === activeItem, item: _, onClick: close }, _.href || String(i)));
|
|
29
22
|
//# sourceMappingURL=StickyBottomMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyBottomMenu.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"StickyBottomMenu.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAwB,CAAC,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACzE,MAAM,CAAC,sBAAsB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,mBAAmB,EAAE,CAAC;IAE1E,MAAM,EAAE,SAAS,GAAG,UAAU,EAAE,GAAG,cAAc,CAC/C,eAAe,CAAC,kBAAkB,IAAI,oBAAoB,EAC1D,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,IAAI,EAAE,CAC9F,CAAC;IAEF,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IAEjD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAE9C,uFAAuF;IACvF,OAAO,CACL,cAAK,SAAS,EAAC,aAAa,oBAAgB,8BAA8B,YACxE,KAAC,YAAY,IACX,SAAS,EAAC,6FAA6F,EACvG,OAAO,EAAC,KAAK,YAEb,eAAK,SAAS,EAAC,iEAAiE,aAC7E,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,EACjD,KAAC,sBAAsB,IAAC,QAAQ,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,GAAI,EAC5E,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,IAC9C,GACO,GACX,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,CAAC,UAAoB,EAAE,KAAiB,EAAE,EAAE,CAAC,CAAC,CAAW,EAAE,CAAS,EAAE,EAAE,CAC7F,CACE,KAAC,oBAAoB,IAEnB,QAAQ,EAAE,CAAC,KAAK,UAAU,EAC1B,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,KAAK,IAHT,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,CAIxB,CACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { Icon } from '../../ui-kit/Icon/Icon.js';
|
|
4
|
+
import { style } from '../../utils/style.js';
|
|
5
|
+
export const StickyBottomMenuBurger = JSX(({ isActive, onClick }) => (_jsxs("button", { className: style(isActive ? 'text-primary-main' : 'text-primary-text', `w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`), onClick: onClick, children: [_jsx(Icon, { className: "w-6 h-6", name: "BurgerIcon", iconVersion: isActive ? 'color' : 'black' }), "\u041C\u0435\u043D\u044E"] })));
|
|
6
|
+
//# sourceMappingURL=StickyBottomMenuBurger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StickyBottomMenuBurger.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenuBurger.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAO1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAA8B,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAChG,kBACE,SAAS,EAAE,KAAK,CACd,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,EACpD,2EAA2E,CAC5E,EACD,OAAO,EAAE,OAAO,aAEhB,KAAC,IAAI,IAAC,SAAS,EAAC,SAAS,EAAC,IAAI,EAAC,YAAY,EAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,GAAI,gCAElF,CACV,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MenuItem } from './StickyBottomMenuContent';
|
|
2
|
+
interface StickyBottomMenuItemProps {
|
|
3
|
+
isActive?: boolean;
|
|
4
|
+
item?: MenuItem;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const StickyBottomMenuItem: import("@redneckz/uni-jsx").UNIComponent<StickyBottomMenuItemProps, any, any>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { useLink } from '../../hooks/useLink.js';
|
|
4
|
+
import { projectSettings } from '../../ProjectSettings.js';
|
|
5
|
+
import { Icon } from '../../ui-kit/Icon/Icon.js';
|
|
6
|
+
import { style } from '../../utils/style.js';
|
|
7
|
+
export const StickyBottomMenuItem = JSX(({ isActive, item, onClick }) => {
|
|
8
|
+
const isAnotherPortal = !projectSettings?.BASE_PATH || !item?.href?.startsWith(projectSettings.BASE_PATH);
|
|
9
|
+
const link = useLink({ isRemote: isAnotherPortal });
|
|
10
|
+
const { href, onClick: handleClick } = link({ href: item?.href, onClick });
|
|
11
|
+
return (_jsxs("a", { className: style(isActive ? 'text-primary-main' : 'text-primary-text', `w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`), href: href, target: "_self", title: item?.title || '', onClick: handleClick, children: [_jsx(Icon, { className: "w-6 h-6", name: item?.icon?.icon, iconVersion: isActive ? 'color' : 'black' }), item?.title || ''] }));
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=StickyBottomMenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StickyBottomMenuItem.js","sourceRoot":"","sources":["../../../src/components/StickyBottomMenu/StickyBottomMenuItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAS1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CACrC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IAC9B,MAAM,eAAe,GACnB,CAAC,eAAe,EAAE,SAAS,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAEpF,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC;IACpD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAE3E,OAAO,CACL,aACE,SAAS,EAAE,KAAK,CACd,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,EACpD,2EAA2E,CAC5E,EACD,IAAI,EAAE,IAAI,EACV,MAAM,EAAC,OAAO,EACd,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,EACxB,OAAO,EAAE,WAAW,aAEpB,KAAC,IAAI,IACH,SAAS,EAAC,SAAS,EACnB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EACtB,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,GACzC,EACD,IAAI,EAAE,KAAK,IAAI,EAAE,IAChB,CACL,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type UniBlockProps } from '../../model/JSXBlock';
|
|
2
2
|
import { type MenuItem, type StickyBottomMenuContent } from './StickyBottomMenuContent';
|
|
3
|
-
export interface MenuItemProps extends MenuItem {
|
|
4
|
-
isActive?: boolean;
|
|
5
|
-
}
|
|
6
3
|
export interface StickyBottomMenuProps extends StickyBottomMenuContent, UniBlockProps {
|
|
7
|
-
menuItems?:
|
|
4
|
+
menuItems?: MenuItem[];
|
|
8
5
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare function useActiveRoute<T extends {
|
|
2
|
+
href?: string;
|
|
3
|
+
}>(items?: T[] | undefined): [number, T];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveRoute.js","sourceRoot":"","sources":["../../src/hooks/useActiveRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"useActiveRoute.js","sourceRoot":"","sources":["../../src/hooks/useActiveRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,UAAU,cAAc,CAC5B,QAAyB,EAAE;IAE3B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAE7D,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -77,7 +77,7 @@ export const CreditCalculatorForm = JSX<CreditCalculatorProp>(
|
|
|
77
77
|
})}
|
|
78
78
|
<div className="flex flex-col gap-2xl sm:w-96">
|
|
79
79
|
<CalculatorValueBlock
|
|
80
|
-
title="Ежемесячный
|
|
80
|
+
title="Ежемесячный платёж"
|
|
81
81
|
value={calculatorParams.monthlyPayment}
|
|
82
82
|
postfix="₽"
|
|
83
83
|
/>
|
|
@@ -67,7 +67,7 @@ export const RefinancingCalculatorForm = JSX<RefinancingCalculatorProp>(
|
|
|
67
67
|
value: calculatorParams.moneyValue,
|
|
68
68
|
})}
|
|
69
69
|
{renderWantedSumInput({
|
|
70
|
-
title: 'Ежемесячный
|
|
70
|
+
title: 'Ежемесячный платёж в других банках, ₽',
|
|
71
71
|
step: 500,
|
|
72
72
|
min: calculatorParams.minSumOld,
|
|
73
73
|
max: calculatorParams.maxSumOld,
|
|
@@ -102,7 +102,7 @@ export const RefinancingCalculatorForm = JSX<RefinancingCalculatorProp>(
|
|
|
102
102
|
})}
|
|
103
103
|
<div className="flex flex-col gap-2xl mt-2 sm:w-96 sm:mt-0">
|
|
104
104
|
<CalculatorValueBlock
|
|
105
|
-
title={'Ежемесячный
|
|
105
|
+
title={'Ежемесячный платёж'}
|
|
106
106
|
value={calculatorParams.monthlyPayment}
|
|
107
107
|
postfix="₽"
|
|
108
108
|
/>
|
|
@@ -1,38 +1,29 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useActiveRoute } from '../../hooks/useActiveRoute';
|
|
3
3
|
import { useSWRResource } from '../../hooks/useSWRResource';
|
|
4
4
|
import { projectSettings } from '../../ProjectSettings';
|
|
5
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
6
|
+
import { StickyBottomMenuBurger } from './StickyBottomMenuBurger';
|
|
7
|
+
import type { MenuItem } from './StickyBottomMenuContent';
|
|
8
|
+
import { StickyBottomMenuItem } from './StickyBottomMenuItem';
|
|
9
|
+
import { type StickyBottomMenuProps } from './StickyBottomMenuProps';
|
|
8
10
|
import { useBurgerMenuDialog } from './useBurgerMenuDialog';
|
|
9
11
|
|
|
12
|
+
const EMPTY_MENU = [];
|
|
13
|
+
|
|
10
14
|
export const StickyBottomMenu = JSX<StickyBottomMenuProps>(({ ...rest }) => {
|
|
11
|
-
const {
|
|
15
|
+
const [isBurgerMenuDialogOpen, { toggle, close }] = useBurgerMenuDialog();
|
|
16
|
+
|
|
17
|
+
const { menuItems = EMPTY_MENU } = useSWRResource<StickyBottomMenuProps>(
|
|
12
18
|
projectSettings.STICKY_MOBILE_MENU || 'sticky-mobile-menu',
|
|
13
19
|
{ fallback: rest.options?.page?.fallback, folderName: 'portal-resources', setBasePath: true },
|
|
14
20
|
);
|
|
15
21
|
|
|
16
|
-
const [
|
|
22
|
+
const [, activeItem] = useActiveRoute(menuItems);
|
|
17
23
|
|
|
18
|
-
const burgerMenu = {
|
|
19
|
-
title: 'Меню',
|
|
20
|
-
icon: {
|
|
21
|
-
icon: 'BurgerIcon',
|
|
22
|
-
iconVersion: isBurgerMenuDialogOpen ? 'color' : 'black',
|
|
23
|
-
},
|
|
24
|
-
isActive: isBurgerMenuDialogOpen,
|
|
25
|
-
};
|
|
26
24
|
const middleIdx = Math.floor(menuItems.length / 2);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
[
|
|
30
|
-
...menuItems.slice(0, middleIdx),
|
|
31
|
-
burgerMenu,
|
|
32
|
-
...menuItems.slice(middleIdx),
|
|
33
|
-
] as MenuItemProps[],
|
|
34
|
-
[menuItems, middleIdx, burgerMenu],
|
|
35
|
-
);
|
|
25
|
+
const leftItems = menuItems.slice(0, middleIdx);
|
|
26
|
+
const rightItems = menuItems.slice(middleIdx);
|
|
36
27
|
|
|
37
28
|
/* Attribute [data-component] need for correct render in wcms editor. Do not remove. */
|
|
38
29
|
return (
|
|
@@ -41,8 +32,22 @@ export const StickyBottomMenu = JSX<StickyBottomMenuProps>(({ ...rest }) => {
|
|
|
41
32
|
className="@container-normal fixed w-full h-[74px] bottom-0 left-0 my-0 mx-auto bg-transparent z-[100]"
|
|
42
33
|
padding="p-0"
|
|
43
34
|
>
|
|
44
|
-
<
|
|
35
|
+
<div className="ml-auto container bg-white flex justify-center shadow-blue-gray">
|
|
36
|
+
{leftItems.map(renderMenuItem(activeItem, close))}
|
|
37
|
+
<StickyBottomMenuBurger isActive={isBurgerMenuDialogOpen} onClick={toggle} />
|
|
38
|
+
{rightItems.map(renderMenuItem(activeItem, close))}
|
|
39
|
+
</div>
|
|
45
40
|
</BlockWrapper>
|
|
46
41
|
</div>
|
|
47
42
|
);
|
|
48
43
|
});
|
|
44
|
+
|
|
45
|
+
const renderMenuItem = (activeItem: MenuItem, close: () => void) => (_: MenuItem, i: number) =>
|
|
46
|
+
(
|
|
47
|
+
<StickyBottomMenuItem
|
|
48
|
+
key={_.href || String(i)}
|
|
49
|
+
isActive={_ === activeItem}
|
|
50
|
+
item={_}
|
|
51
|
+
onClick={close}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
3
|
+
import { style } from '../../utils/style';
|
|
4
|
+
|
|
5
|
+
interface StickyBottomMenuBurgerProps {
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const StickyBottomMenuBurger = JSX<StickyBottomMenuBurgerProps>(({ isActive, onClick }) => (
|
|
11
|
+
<button
|
|
12
|
+
className={style(
|
|
13
|
+
isActive ? 'text-primary-main' : 'text-primary-text',
|
|
14
|
+
`w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`,
|
|
15
|
+
)}
|
|
16
|
+
onClick={onClick}
|
|
17
|
+
>
|
|
18
|
+
<Icon className="w-6 h-6" name="BurgerIcon" iconVersion={isActive ? 'color' : 'black'} />
|
|
19
|
+
Меню
|
|
20
|
+
</button>
|
|
21
|
+
));
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useLink } from '../../hooks/useLink';
|
|
3
|
+
import { projectSettings } from '../../ProjectSettings';
|
|
4
|
+
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
5
|
+
import { style } from '../../utils/style';
|
|
6
|
+
import type { MenuItem } from './StickyBottomMenuContent';
|
|
7
|
+
|
|
8
|
+
interface StickyBottomMenuItemProps {
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
item?: MenuItem;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const StickyBottomMenuItem = JSX<StickyBottomMenuItemProps>(
|
|
15
|
+
({ isActive, item, onClick }) => {
|
|
16
|
+
const isAnotherPortal =
|
|
17
|
+
!projectSettings?.BASE_PATH || !item?.href?.startsWith(projectSettings.BASE_PATH);
|
|
18
|
+
|
|
19
|
+
const link = useLink({ isRemote: isAnotherPortal });
|
|
20
|
+
const { href, onClick: handleClick } = link({ href: item?.href, onClick });
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<a
|
|
24
|
+
className={style(
|
|
25
|
+
isActive ? 'text-primary-main' : 'text-primary-text',
|
|
26
|
+
`w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer`,
|
|
27
|
+
)}
|
|
28
|
+
href={href}
|
|
29
|
+
target="_self"
|
|
30
|
+
title={item?.title || ''}
|
|
31
|
+
onClick={handleClick}
|
|
32
|
+
>
|
|
33
|
+
<Icon
|
|
34
|
+
className="w-6 h-6"
|
|
35
|
+
name={item?.icon?.icon}
|
|
36
|
+
iconVersion={isActive ? 'color' : 'black'}
|
|
37
|
+
/>
|
|
38
|
+
{item?.title || ''}
|
|
39
|
+
</a>
|
|
40
|
+
);
|
|
41
|
+
},
|
|
42
|
+
);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { type UniBlockProps } from '../../model/JSXBlock';
|
|
2
2
|
import { type MenuItem, type StickyBottomMenuContent } from './StickyBottomMenuContent';
|
|
3
3
|
|
|
4
|
-
export interface MenuItemProps extends MenuItem {
|
|
5
|
-
isActive?: boolean;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
4
|
export interface StickyBottomMenuProps extends StickyBottomMenuContent, UniBlockProps {
|
|
9
|
-
menuItems?:
|
|
5
|
+
menuItems?: MenuItem[];
|
|
10
6
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { isTopItemActive } from '../components/Header/isTopItemActive';
|
|
2
|
-
import { type TopMenuItemProps } from '../services/sitemap/SitemapData';
|
|
3
2
|
import { useRouter } from './useRouter';
|
|
4
3
|
|
|
5
|
-
export function useActiveRoute(
|
|
6
|
-
items:
|
|
7
|
-
): [number,
|
|
4
|
+
export function useActiveRoute<T extends { href?: string }>(
|
|
5
|
+
items: T[] | undefined = [],
|
|
6
|
+
): [number, T] {
|
|
8
7
|
const router = useRouter();
|
|
9
8
|
const activeIndex = items.findIndex(isTopItemActive(router));
|
|
10
9
|
|
package/package.json
CHANGED
|
@@ -77,7 +77,7 @@ export const CreditCalculatorForm = JSX<CreditCalculatorProp>(
|
|
|
77
77
|
})}
|
|
78
78
|
<div className="flex flex-col gap-2xl sm:w-96">
|
|
79
79
|
<CalculatorValueBlock
|
|
80
|
-
title="Ежемесячный
|
|
80
|
+
title="Ежемесячный платёж"
|
|
81
81
|
value={calculatorParams.monthlyPayment}
|
|
82
82
|
postfix="₽"
|
|
83
83
|
/>
|