@redneckz/wildless-cms-uni-blocks 0.3.64 → 0.3.65
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +9 -14
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Calculator/Calculator.js +5 -7
- package/dist/components/Calculator/Calculator.js.map +1 -1
- package/dist/components/Calculator/CalculatorContent.d.ts +52 -11
- package/dist/components/Calculator/renderCalculatorBlock.d.ts +2 -0
- package/dist/components/Calculator/renderCalculatorBlock.js +14 -0
- package/dist/components/Calculator/renderCalculatorBlock.js.map +1 -0
- package/dist/components/CreditCalculator/CreditCalculatorContent.d.ts +3 -0
- package/dist/components/GroupBlock/BlocksTypeProps.d.ts +2 -5
- package/dist/components/ProductGallery/ProductGallery.js +1 -1
- package/dist/model/EmptyOptionType.d.ts +4 -0
- package/dist/model/EmptyOptionType.js +2 -0
- package/dist/model/EmptyOptionType.js.map +1 -0
- package/dist/ui-kit/BlocksList/BlocksListProps.d.ts +4 -7
- package/lib/common.css +1 -1
- package/lib/components/Calculator/Calculator.js +5 -7
- package/lib/components/Calculator/Calculator.js.map +1 -1
- package/lib/components/Calculator/CalculatorContent.d.ts +52 -11
- package/lib/components/Calculator/renderCalculatorBlock.d.ts +2 -0
- package/lib/components/Calculator/renderCalculatorBlock.js +11 -0
- package/lib/components/Calculator/renderCalculatorBlock.js.map +1 -0
- package/lib/components/CreditCalculator/CreditCalculatorContent.d.ts +3 -0
- package/lib/components/GroupBlock/BlocksTypeProps.d.ts +2 -5
- package/lib/components/ProductGallery/ProductGallery.js +1 -1
- package/lib/model/EmptyOptionType.d.ts +4 -0
- package/lib/model/EmptyOptionType.js +2 -0
- package/lib/model/EmptyOptionType.js.map +1 -0
- package/lib/ui-kit/BlocksList/BlocksListProps.d.ts +4 -7
- package/mobile/dist/components/Calculator/Calculator.js +5 -7
- package/mobile/dist/components/Calculator/Calculator.js.map +1 -1
- package/mobile/dist/components/Calculator/CalculatorContent.d.ts +52 -11
- package/mobile/dist/components/Calculator/renderCalculatorBlock.d.ts +2 -0
- package/mobile/dist/components/Calculator/renderCalculatorBlock.js +14 -0
- package/mobile/dist/components/Calculator/renderCalculatorBlock.js.map +1 -0
- package/mobile/dist/components/CreditCalculator/CreditCalculatorContent.d.ts +3 -0
- package/mobile/dist/components/GroupBlock/BlocksTypeProps.d.ts +2 -5
- package/mobile/dist/model/EmptyOptionType.d.ts +4 -0
- package/mobile/dist/model/EmptyOptionType.js +2 -0
- package/mobile/dist/model/EmptyOptionType.js.map +1 -0
- package/mobile/dist/ui-kit/BlocksList/BlocksListProps.d.ts +4 -7
- package/mobile/lib/components/Calculator/Calculator.js +5 -7
- package/mobile/lib/components/Calculator/Calculator.js.map +1 -1
- package/mobile/lib/components/Calculator/CalculatorContent.d.ts +52 -11
- package/mobile/lib/components/Calculator/renderCalculatorBlock.d.ts +2 -0
- package/mobile/lib/components/Calculator/renderCalculatorBlock.js +11 -0
- package/mobile/lib/components/Calculator/renderCalculatorBlock.js.map +1 -0
- package/mobile/lib/components/CreditCalculator/CreditCalculatorContent.d.ts +3 -0
- package/mobile/lib/components/GroupBlock/BlocksTypeProps.d.ts +2 -5
- package/mobile/lib/model/EmptyOptionType.d.ts +4 -0
- package/mobile/lib/model/EmptyOptionType.js +2 -0
- package/mobile/lib/model/EmptyOptionType.js.map +1 -0
- package/mobile/lib/ui-kit/BlocksList/BlocksListProps.d.ts +4 -7
- package/mobile/src/components/Calculator/Calculator.example.json +21 -0
- package/mobile/src/components/Calculator/Calculator.tsx +6 -8
- package/mobile/src/components/Calculator/CalculatorContent.ts +53 -12
- package/mobile/src/components/Calculator/{renderCalculatorList.tsx → renderCalculatorBlock.tsx} +5 -17
- package/mobile/src/components/CreditCalculator/CreditCalculatorContent.ts +3 -0
- package/mobile/src/components/GroupBlock/BlocksTypeProps.ts +2 -6
- package/mobile/src/model/EmptyOptionType.ts +4 -0
- package/mobile/src/ui-kit/BlocksList/BlocksListProps.ts +4 -8
- package/package.json +1 -1
- package/src/components/Calculator/Calculator.example.json +21 -0
- package/src/components/Calculator/Calculator.tsx +6 -8
- package/src/components/Calculator/CalculatorContent.ts +53 -12
- package/src/components/Calculator/{renderCalculatorList.tsx → renderCalculatorBlock.tsx} +5 -17
- package/src/components/CreditCalculator/CreditCalculatorContent.ts +3 -0
- package/src/components/GroupBlock/BlocksTypeProps.ts +2 -6
- package/src/components/ProductGallery/ProductGallery.tsx +2 -2
- package/src/model/EmptyOptionType.ts +4 -0
- package/src/ui-kit/BlocksList/BlocksListProps.ts +4 -8
- package/dist/components/Calculator/renderCalculatorList.d.ts +0 -10
- package/dist/components/Calculator/renderCalculatorList.js +0 -17
- package/dist/components/Calculator/renderCalculatorList.js.map +0 -1
- package/lib/components/Calculator/renderCalculatorList.d.ts +0 -10
- package/lib/components/Calculator/renderCalculatorList.js +0 -14
- package/lib/components/Calculator/renderCalculatorList.js.map +0 -1
- package/mobile/dist/components/Calculator/renderCalculatorList.d.ts +0 -10
- package/mobile/dist/components/Calculator/renderCalculatorList.js +0 -17
- package/mobile/dist/components/Calculator/renderCalculatorList.js.map +0 -1
- package/mobile/lib/components/Calculator/renderCalculatorList.d.ts +0 -10
- package/mobile/lib/components/Calculator/renderCalculatorList.js +0 -14
- package/mobile/lib/components/Calculator/renderCalculatorList.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderCalculatorBlock.js","sourceRoot":"","sources":["../../../src/components/Calculator/renderCalculatorBlock.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,oBAAoB,EAAuB,MAAM,wBAAwB,CAAC;AAQnF,MAAM,CAAC,MAAM,qBAAqB,GAChC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAO,EAAE,EAAE,CAChC,CAAC,aAAiC,EAAE,CAAS,EAAE,EAAE;IAC/C,MAAM,IAAI,GAAG,aAAa,EAAE,QAAQ,CAAC;IACrC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,oBAAoB,CAAC,EAAE;QAC5C,OAAO,IAAI,CAAC;KACb;IACD,MAAM,aAAa,GAAkC,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAChF,OAAO,CACL,kBAEE,SAAS,EAAE,gDAAgD,SAAS,EAAE,EACtE,IAAI,EAAC,UAAU,YAEf,cAAK,SAAS,EAAC,uBAAuB,YACpC,KAAC,aAAa,IAAC,OAAO,EAAE,OAAO,KAAM,aAAa,EAAE,SAAS,EAAC,sBAAsB,GAAG,GACnF,IAND,MAAM,CAAC,CAAC,CAAC,CAON,CACX,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ContentPageContext } from '../../components/ContentPage/ContentPageContext';
|
|
1
2
|
import type { ProductBlockContent } from '../../components/ProductBlock/ProductBlockContent';
|
|
2
3
|
import type { ProductTileContent } from '../../components/ProductTile/ProductTileContent';
|
|
3
|
-
import {
|
|
4
|
+
import type { EmptyOption } from '../../model/EmptyOptionType';
|
|
4
5
|
export interface ActiveHandler {
|
|
5
6
|
context: ContentPageContext;
|
|
6
7
|
blocks?: GroupBlockDef[];
|
|
@@ -26,10 +27,6 @@ export declare type ProductBlockDef = ProductBlockContent & GroupBlockCommonProp
|
|
|
26
27
|
export declare type ProductTileDef = ProductTileContent & GroupBlockCommonProps & {
|
|
27
28
|
blockType: 'ProductTile';
|
|
28
29
|
};
|
|
29
|
-
/**
|
|
30
|
-
* @title Выберите блок
|
|
31
|
-
*/
|
|
32
|
-
export declare type EmptyOption = null;
|
|
33
30
|
/**
|
|
34
31
|
* @title Содержимое блока
|
|
35
32
|
*/
|
|
@@ -44,7 +44,7 @@ function renderNavButton({ slide, i, activeSlideIndex, onClick, version }) {
|
|
|
44
44
|
? 'text-secondary-text text-m-title-xs mt-2.5'
|
|
45
45
|
: `text-m-md mt-1.5 ${productBlockStyleMap[version].text}`;
|
|
46
46
|
const additionalBorder = version === 'secondary' ? 'border-white/50' : 'border-black/50';
|
|
47
|
-
return (_jsx("button", { type: "button", onClick: onClick, "aria-label": slide?.title, className: `box-border font-sans relative overflow-hidden border
|
|
47
|
+
return (_jsx("button", { type: "button", onClick: onClick, "aria-label": slide?.title, className: `box-border font-sans relative overflow-hidden border border-white/50 cursor-pointer text-left mx-1 grow basis-0
|
|
48
48
|
${btnClassName} ${additionalBorder}
|
|
49
49
|
`, children: _jsxs("div", { className: "border-0 px-6", children: [_jsx("div", { className: `font-medium ${btnTitleClassName}`, children: slide?.title }), _jsx("div", { className: `text-secondary-text ${btnDescClassName}`, children: slide.description })] }) }, String(i)));
|
|
50
50
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyOptionType.js","sourceRoot":"","sources":["../../src/model/EmptyOptionType.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { ContentPageContext } from '../../components/ContentPage/ContentPageContext';
|
|
1
2
|
import type { GalleryContent } from '../../components/Gallery/GalleryContent';
|
|
2
3
|
import type { HeadlineContent } from '../../components/Headline/HeadlineContent';
|
|
3
4
|
import type { LinkDocsContent } from '../../components/LinkDocs/LinkDocsContent';
|
|
5
|
+
import type { LinkListContent } from '../../components/LinkList/LinkListContent';
|
|
4
6
|
import type { MiniGalleryContent } from '../../components/MiniGallery/MiniGalleryContent';
|
|
5
7
|
import type { PictureTextContent } from '../../components/PictureText/PictureTextContent';
|
|
6
8
|
import type { ProductBlockContent } from '../../components/ProductBlock/ProductBlockContent';
|
|
7
9
|
import type { ProductTileContent } from '../../components/ProductTile/ProductTileContent';
|
|
8
10
|
import type { TextBlockContent } from '../../components/TextBlock/TextBlockContent';
|
|
9
11
|
import type { TileContent } from '../../components/Tile/TileContent';
|
|
10
|
-
import type {
|
|
11
|
-
import { ContentPageContext } from '../../components/ContentPage/ContentPageContext';
|
|
12
|
+
import type { EmptyOption } from '../../model/EmptyOptionType';
|
|
12
13
|
export interface ActiveHandler {
|
|
13
14
|
context: ContentPageContext;
|
|
14
15
|
blocks?: BlockDef[];
|
|
@@ -69,7 +70,7 @@ export declare type ProductTileBlockListDef = ProductTileContent & {
|
|
|
69
70
|
blockListType: 'ProductTile';
|
|
70
71
|
};
|
|
71
72
|
/**
|
|
72
|
-
* @title
|
|
73
|
+
* @title Галерея
|
|
73
74
|
* @default {"blockListType": "Gallery"}
|
|
74
75
|
*/
|
|
75
76
|
export declare type GalleryBlockListDef = GalleryContent & {
|
|
@@ -89,10 +90,6 @@ export declare type MiniGalleryBlockListDef = MiniGalleryContent & {
|
|
|
89
90
|
export declare type LinkListBlockListDef = LinkListContent & {
|
|
90
91
|
blockListType: 'LinkList';
|
|
91
92
|
};
|
|
92
|
-
/**
|
|
93
|
-
* @title Выберите блок
|
|
94
|
-
*/
|
|
95
|
-
export declare type EmptyOption = null;
|
|
96
93
|
/**
|
|
97
94
|
* @title Содержимое блока
|
|
98
95
|
*/
|
|
@@ -4,7 +4,7 @@ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
5
|
const ArrowButton_1 = require("../../ui-kit/Button/ArrowButton");
|
|
6
6
|
const Img_1 = require("../../ui-kit/Img/Img");
|
|
7
|
-
const
|
|
7
|
+
const renderCalculatorBlock_1 = require("./renderCalculatorBlock");
|
|
8
8
|
const arrowBtnStyle = 'absolute w-[56px] h-[56px] min-h-[56px] max-h-[56px] top-1 z-10 mt-[25px] bg-white rounded-full';
|
|
9
9
|
exports.Calculator = (0, uni_jsx_1.JSX)(({ className = '', context, calcTabs = [], anchor = null }) => {
|
|
10
10
|
const tabsNav = calcTabs.map((_) => _.nav || {});
|
|
@@ -18,11 +18,9 @@ exports.Calculator = (0, uni_jsx_1.JSX)(({ className = '', context, calcTabs = [
|
|
|
18
18
|
const showPrevButton = tabsShift > 0;
|
|
19
19
|
return ((0, jsx_runtime_1.jsxs)("section", { id: anchor, className: `box-border overflow-hidden relative font-sans w-100 bg-white text-primary-text ${className}`, children: [(0, jsx_runtime_1.jsxs)("div", { children: [tabsNav.length > 1
|
|
20
20
|
? renderTabs({ tabsShift, tabsNav, activeSlideIndex, setActiveSlideIndex })
|
|
21
|
-
: null, showPrevButton ? ((0, jsx_runtime_1.jsx)(ArrowButton_1.ArrowButton, { className: `${arrowBtnStyle} left-3 top-3`, onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E", "data-block-control": "scroll-left" })) : null, showNextButton ? ((0, jsx_runtime_1.jsx)(ArrowButton_1.ArrowButton, { className: `${arrowBtnStyle} right-3 top-3 rotate-180`, onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E", "data-block-control": "scroll-right" })) : null] }), (0, jsx_runtime_1.jsx)("div", { className: "flex", style: { transform: `translateX(-${activeSlideIndex}00%)` }, role: "list", children:
|
|
22
|
-
context,
|
|
23
|
-
|
|
24
|
-
blockCalcTabs,
|
|
25
|
-
}) })] }));
|
|
21
|
+
: null, showPrevButton ? ((0, jsx_runtime_1.jsx)(ArrowButton_1.ArrowButton, { className: `${arrowBtnStyle} left-3 top-3`, onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E", "data-block-control": "scroll-left" })) : null, showNextButton ? ((0, jsx_runtime_1.jsx)(ArrowButton_1.ArrowButton, { className: `${arrowBtnStyle} right-3 top-3 rotate-180`, onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E", "data-block-control": "scroll-right" })) : null] }), (0, jsx_runtime_1.jsx)("div", { className: "flex", style: { transform: `translateX(-${activeSlideIndex}00%)` }, role: "list", children: blockCalcTabs?.length
|
|
22
|
+
? blockCalcTabs.map((0, renderCalculatorBlock_1.renderCalculatorBlock)({ context, className }))
|
|
23
|
+
: null })] }));
|
|
26
24
|
});
|
|
27
25
|
function renderNavButton({ tab, i, activeSlideIndex, onClick }) {
|
|
28
26
|
const isActiveBtn = i === activeSlideIndex;
|
|
@@ -32,7 +30,7 @@ function renderNavButton({ tab, i, activeSlideIndex, onClick }) {
|
|
|
32
30
|
const btnTitleClassName = isActiveBtn ? 'text-md-new mb-1.5' : `text-base mb-[3px]`;
|
|
33
31
|
const btnDescClassName = isActiveBtn ? 'text-base text-white' : `text-m-md`;
|
|
34
32
|
const iconClassName = isActiveBtn ? '' : `text-primary-main`;
|
|
35
|
-
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: onClick, "aria-label": tab?.title, className: `box-border font-sans relative border
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: onClick, "aria-label": tab?.title, className: `box-border font-sans relative border border-main-stroke cursor-pointer text-left border-b-0 flex
|
|
36
34
|
${btnClassName}`, children: [(0, jsx_runtime_1.jsx)(Img_1.Img, { className: `h-[24px] w-[24px] min-w-[24px] min-h-[24px] mr-4 ${iconClassName}`, image: { ...tab?.icon, iconVersion: isActiveBtn ? 'white' : 'normal' }, width: "24", height: "24", asSVG: true }), (0, jsx_runtime_1.jsxs)("div", { className: "border-0", children: [(0, jsx_runtime_1.jsx)("div", { className: `font-medium ${btnTitleClassName}`, children: tab?.title }), (0, jsx_runtime_1.jsx)("div", { className: `text-secondary-text ${btnDescClassName}`, children: tab.description })] })] }, String(i)));
|
|
37
35
|
}
|
|
38
36
|
function renderTabs({ tabsShift, tabsNav, activeSlideIndex, setActiveSlideIndex }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calculator.js","sourceRoot":"","sources":["../../../src/components/Calculator/Calculator.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;
|
|
1
|
+
{"version":3,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;AACJ,CAAC"}
|
|
@@ -1,43 +1,89 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { EmptyOption } from '../../model/EmptyOptionType';
|
|
2
|
+
import type { Picture } from '../../model/Picture';
|
|
2
3
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
3
4
|
export interface CommonCalculatorProps {
|
|
5
|
+
/** @title Кнопки */
|
|
4
6
|
buttons?: ButtonWithIconProps[];
|
|
5
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* TODO: данные из справочника
|
|
10
|
+
**/
|
|
6
11
|
export interface CreditCalculatorParams {
|
|
12
|
+
/** @hidden */
|
|
7
13
|
isSalary?: boolean;
|
|
14
|
+
/** @hidden */
|
|
8
15
|
isInsurance?: boolean;
|
|
16
|
+
/** @hidden */
|
|
9
17
|
isAnnuity?: boolean;
|
|
18
|
+
/** @hidden */
|
|
10
19
|
minSum?: number;
|
|
20
|
+
/** @hidden */
|
|
11
21
|
maxSum?: number;
|
|
22
|
+
/** @hidden */
|
|
12
23
|
minMonths?: number;
|
|
24
|
+
/** @hidden */
|
|
13
25
|
maxMonths?: number;
|
|
26
|
+
/** @hidden */
|
|
14
27
|
rateWithInsurance?: number;
|
|
28
|
+
/** @hidden */
|
|
15
29
|
rateWithoutInsurance?: number;
|
|
16
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* TODO: данные из справочника
|
|
33
|
+
**/
|
|
17
34
|
export interface MortgageCalculatorParams {
|
|
35
|
+
/** @hidden */
|
|
18
36
|
isAnnuity?: boolean;
|
|
37
|
+
/** @hidden */
|
|
19
38
|
minInitialContribution?: number;
|
|
39
|
+
/** @hidden */
|
|
20
40
|
minSum?: number;
|
|
41
|
+
/** @hidden */
|
|
21
42
|
maxSum?: number;
|
|
43
|
+
/** @hidden */
|
|
22
44
|
minMonths?: number;
|
|
45
|
+
/** @hidden */
|
|
23
46
|
maxMonths?: number;
|
|
47
|
+
/** @hidden */
|
|
24
48
|
rateWithInsurance?: number;
|
|
49
|
+
/** @hidden */
|
|
25
50
|
rateWithoutInsurance?: number;
|
|
26
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* TODO: данные из справочника
|
|
54
|
+
**/
|
|
27
55
|
export interface DepositCalculatorParams {
|
|
56
|
+
/** @hidden */
|
|
28
57
|
minSum?: number;
|
|
58
|
+
/** @hidden */
|
|
29
59
|
maxSum?: number;
|
|
60
|
+
/** @hidden */
|
|
30
61
|
minMonths?: number;
|
|
62
|
+
/** @hidden */
|
|
31
63
|
maxMonths?: number;
|
|
64
|
+
/** @hidden */
|
|
32
65
|
rate?: number;
|
|
33
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* TODO: данные из справочника
|
|
69
|
+
**/
|
|
34
70
|
export interface BonusCalculatorParams {
|
|
71
|
+
/** @hidden */
|
|
35
72
|
bonus?: number;
|
|
73
|
+
/** @hidden */
|
|
36
74
|
minSumTrip?: number;
|
|
75
|
+
/** @hidden */
|
|
37
76
|
maxSumTrip?: number;
|
|
77
|
+
/** @hidden */
|
|
38
78
|
minSumOther?: number;
|
|
79
|
+
/** @hidden */
|
|
39
80
|
maxSumOther?: number;
|
|
40
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* ? Общий интерфейс для всех типов калькуляторов?
|
|
84
|
+
* ? Используется во вложенных функциях. Может быть как то разбить это и вынести отсюда?
|
|
85
|
+
* @hidden
|
|
86
|
+
*/
|
|
41
87
|
export interface CalculatorParams {
|
|
42
88
|
isAnnuity?: boolean;
|
|
43
89
|
minSum?: number;
|
|
@@ -48,39 +94,35 @@ export interface CalculatorParams {
|
|
|
48
94
|
rateWithoutInsurance?: number;
|
|
49
95
|
}
|
|
50
96
|
/**
|
|
51
|
-
* @title
|
|
97
|
+
* @title Кредитный калькулятор
|
|
52
98
|
* @default {"calcType": "CreditCalculatorForm"}
|
|
53
99
|
*/
|
|
54
100
|
export declare type CreditCalculatorParamsDef = CreditCalculatorParams & CommonCalculatorProps & {
|
|
55
101
|
calcType: 'CreditCalculatorForm';
|
|
56
102
|
};
|
|
57
103
|
/**
|
|
58
|
-
* @title
|
|
104
|
+
* @title Ипотечный калькулятор
|
|
59
105
|
* @default {"calcType": "MortgageCalculatorForm"}
|
|
60
106
|
*/
|
|
61
107
|
export declare type MortgageCalculatorParamsDef = MortgageCalculatorParams & CommonCalculatorProps & {
|
|
62
108
|
calcType: 'MortgageCalculatorForm';
|
|
63
109
|
};
|
|
64
110
|
/**
|
|
65
|
-
* @title
|
|
111
|
+
* @title Калькулятор вкладов
|
|
66
112
|
* @default {"calcType": "DepositCalculatorForm"}
|
|
67
113
|
*/
|
|
68
114
|
export declare type DepositCalculatorParamsDef = DepositCalculatorParams & CommonCalculatorProps & {
|
|
69
115
|
calcType: 'DepositCalculatorForm';
|
|
70
116
|
};
|
|
71
117
|
/**
|
|
72
|
-
* @title
|
|
118
|
+
* @title Калькулятор бонусов
|
|
73
119
|
* @default {"calcType": "BonusCalculatorForm"}
|
|
74
120
|
*/
|
|
75
121
|
export declare type BonusCalculatorParamsDef = BonusCalculatorParams & CommonCalculatorProps & {
|
|
76
122
|
calcType: 'BonusCalculatorForm';
|
|
77
123
|
};
|
|
78
124
|
/**
|
|
79
|
-
* @title
|
|
80
|
-
*/
|
|
81
|
-
export declare type EmptyOption = null;
|
|
82
|
-
/**
|
|
83
|
-
* @title Калькулятор
|
|
125
|
+
* @title Настройки калькулятора
|
|
84
126
|
*/
|
|
85
127
|
export declare type CalculatorBlockDef = EmptyOption | CreditCalculatorParamsDef | MortgageCalculatorParamsDef | DepositCalculatorParamsDef | BonusCalculatorParamsDef;
|
|
86
128
|
/**
|
|
@@ -98,7 +140,6 @@ export interface CalculatorNav {
|
|
|
98
140
|
*/
|
|
99
141
|
export interface CalculatorTab {
|
|
100
142
|
nav?: CalculatorNav;
|
|
101
|
-
/** @title Настройки калькулятора */
|
|
102
143
|
calculatorBlock?: CalculatorBlockDef;
|
|
103
144
|
}
|
|
104
145
|
/**
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.renderCalculatorBlock = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const EmbeddableCalcBlocks_1 = require("./EmbeddableCalcBlocks");
|
|
5
|
+
const renderCalculatorBlock = ({ context, className }) => (blockCalcTabs, i) => {
|
|
6
|
+
const type = blockCalcTabs?.calcType;
|
|
7
|
+
if (!type || !(type in EmbeddableCalcBlocks_1.EmbeddableCalcBlocks)) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
const EmbeddedBlock = EmbeddableCalcBlocks_1.EmbeddableCalcBlocks[type];
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)("section", { className: `box-border relative flex shrink-0 basis-full ${className}`, role: "listitem", children: (0, jsx_runtime_1.jsx)("div", { className: "box-border p-9 w-full", children: (0, jsx_runtime_1.jsx)(EmbeddedBlock, { context: context, ...blockCalcTabs, className: "flex justify-between" }) }) }, String(i)));
|
|
12
|
+
};
|
|
13
|
+
exports.renderCalculatorBlock = renderCalculatorBlock;
|
|
14
|
+
//# sourceMappingURL=renderCalculatorBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderCalculatorBlock.js","sourceRoot":"","sources":["../../../src/components/Calculator/renderCalculatorBlock.tsx"],"names":[],"mappings":";;;AAGA,iEAAmF;AAQ5E,MAAM,qBAAqB,GAChC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAO,EAAE,EAAE,CAChC,CAAC,aAAiC,EAAE,CAAS,EAAE,EAAE;IAC/C,MAAM,IAAI,GAAG,aAAa,EAAE,QAAQ,CAAC;IACrC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,2CAAoB,CAAC,EAAE;QAC5C,OAAO,IAAI,CAAC;KACb;IACD,MAAM,aAAa,GAAkC,2CAAoB,CAAC,IAAI,CAAC,CAAC;IAChF,OAAO,CACL,oCAEE,SAAS,EAAE,gDAAgD,SAAS,EAAE,EACtE,IAAI,EAAC,UAAU,YAEf,gCAAK,SAAS,EAAC,uBAAuB,YACpC,uBAAC,aAAa,IAAC,OAAO,EAAE,OAAO,KAAM,aAAa,EAAE,SAAS,EAAC,sBAAsB,GAAG,GACnF,IAND,MAAM,CAAC,CAAC,CAAC,CAON,CACX,CAAC;AACJ,CAAC,CAAC;AAnBS,QAAA,qBAAqB,yBAmB9B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ContentPageContext } from '../../components/ContentPage/ContentPageContext';
|
|
1
2
|
import type { ProductBlockContent } from '../../components/ProductBlock/ProductBlockContent';
|
|
2
3
|
import type { ProductTileContent } from '../../components/ProductTile/ProductTileContent';
|
|
3
|
-
import {
|
|
4
|
+
import type { EmptyOption } from '../../model/EmptyOptionType';
|
|
4
5
|
export interface ActiveHandler {
|
|
5
6
|
context: ContentPageContext;
|
|
6
7
|
blocks?: GroupBlockDef[];
|
|
@@ -26,10 +27,6 @@ export declare type ProductBlockDef = ProductBlockContent & GroupBlockCommonProp
|
|
|
26
27
|
export declare type ProductTileDef = ProductTileContent & GroupBlockCommonProps & {
|
|
27
28
|
blockType: 'ProductTile';
|
|
28
29
|
};
|
|
29
|
-
/**
|
|
30
|
-
* @title Выберите блок
|
|
31
|
-
*/
|
|
32
|
-
export declare type EmptyOption = null;
|
|
33
30
|
/**
|
|
34
31
|
* @title Содержимое блока
|
|
35
32
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyOptionType.js","sourceRoot":"","sources":["../../src/model/EmptyOptionType.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { ContentPageContext } from '../../components/ContentPage/ContentPageContext';
|
|
1
2
|
import type { GalleryContent } from '../../components/Gallery/GalleryContent';
|
|
2
3
|
import type { HeadlineContent } from '../../components/Headline/HeadlineContent';
|
|
3
4
|
import type { LinkDocsContent } from '../../components/LinkDocs/LinkDocsContent';
|
|
5
|
+
import type { LinkListContent } from '../../components/LinkList/LinkListContent';
|
|
4
6
|
import type { MiniGalleryContent } from '../../components/MiniGallery/MiniGalleryContent';
|
|
5
7
|
import type { PictureTextContent } from '../../components/PictureText/PictureTextContent';
|
|
6
8
|
import type { ProductBlockContent } from '../../components/ProductBlock/ProductBlockContent';
|
|
7
9
|
import type { ProductTileContent } from '../../components/ProductTile/ProductTileContent';
|
|
8
10
|
import type { TextBlockContent } from '../../components/TextBlock/TextBlockContent';
|
|
9
11
|
import type { TileContent } from '../../components/Tile/TileContent';
|
|
10
|
-
import type {
|
|
11
|
-
import { ContentPageContext } from '../../components/ContentPage/ContentPageContext';
|
|
12
|
+
import type { EmptyOption } from '../../model/EmptyOptionType';
|
|
12
13
|
export interface ActiveHandler {
|
|
13
14
|
context: ContentPageContext;
|
|
14
15
|
blocks?: BlockDef[];
|
|
@@ -69,7 +70,7 @@ export declare type ProductTileBlockListDef = ProductTileContent & {
|
|
|
69
70
|
blockListType: 'ProductTile';
|
|
70
71
|
};
|
|
71
72
|
/**
|
|
72
|
-
* @title
|
|
73
|
+
* @title Галерея
|
|
73
74
|
* @default {"blockListType": "Gallery"}
|
|
74
75
|
*/
|
|
75
76
|
export declare type GalleryBlockListDef = GalleryContent & {
|
|
@@ -89,10 +90,6 @@ export declare type MiniGalleryBlockListDef = MiniGalleryContent & {
|
|
|
89
90
|
export declare type LinkListBlockListDef = LinkListContent & {
|
|
90
91
|
blockListType: 'LinkList';
|
|
91
92
|
};
|
|
92
|
-
/**
|
|
93
|
-
* @title Выберите блок
|
|
94
|
-
*/
|
|
95
|
-
export declare type EmptyOption = null;
|
|
96
93
|
/**
|
|
97
94
|
* @title Содержимое блока
|
|
98
95
|
*/
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { ArrowButton } from '../../ui-kit/Button/ArrowButton.js';
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img.js';
|
|
5
|
-
import {
|
|
5
|
+
import { renderCalculatorBlock } from './renderCalculatorBlock.js';
|
|
6
6
|
const arrowBtnStyle = 'absolute w-[56px] h-[56px] min-h-[56px] max-h-[56px] top-1 z-10 mt-[25px] bg-white rounded-full';
|
|
7
7
|
export const Calculator = JSX(({ className = '', context, calcTabs = [], anchor = null }) => {
|
|
8
8
|
const tabsNav = calcTabs.map((_) => _.nav || {});
|
|
@@ -16,11 +16,9 @@ export const Calculator = JSX(({ className = '', context, calcTabs = [], anchor
|
|
|
16
16
|
const showPrevButton = tabsShift > 0;
|
|
17
17
|
return (_jsxs("section", { id: anchor, className: `box-border overflow-hidden relative font-sans w-100 bg-white text-primary-text ${className}`, children: [_jsxs("div", { children: [tabsNav.length > 1
|
|
18
18
|
? renderTabs({ tabsShift, tabsNav, activeSlideIndex, setActiveSlideIndex })
|
|
19
|
-
: null, showPrevButton ? (_jsx(ArrowButton, { className: `${arrowBtnStyle} left-3 top-3`, onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E", "data-block-control": "scroll-left" })) : null, showNextButton ? (_jsx(ArrowButton, { className: `${arrowBtnStyle} right-3 top-3 rotate-180`, onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E", "data-block-control": "scroll-right" })) : null] }), _jsx("div", { className: "flex", style: { transform: `translateX(-${activeSlideIndex}00%)` }, role: "list", children:
|
|
20
|
-
context,
|
|
21
|
-
|
|
22
|
-
blockCalcTabs,
|
|
23
|
-
}) })] }));
|
|
19
|
+
: null, showPrevButton ? (_jsx(ArrowButton, { className: `${arrowBtnStyle} left-3 top-3`, onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E", "data-block-control": "scroll-left" })) : null, showNextButton ? (_jsx(ArrowButton, { className: `${arrowBtnStyle} right-3 top-3 rotate-180`, onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E", "data-block-control": "scroll-right" })) : null] }), _jsx("div", { className: "flex", style: { transform: `translateX(-${activeSlideIndex}00%)` }, role: "list", children: blockCalcTabs?.length
|
|
20
|
+
? blockCalcTabs.map(renderCalculatorBlock({ context, className }))
|
|
21
|
+
: null })] }));
|
|
24
22
|
});
|
|
25
23
|
function renderNavButton({ tab, i, activeSlideIndex, onClick }) {
|
|
26
24
|
const isActiveBtn = i === activeSlideIndex;
|
|
@@ -30,7 +28,7 @@ function renderNavButton({ tab, i, activeSlideIndex, onClick }) {
|
|
|
30
28
|
const btnTitleClassName = isActiveBtn ? 'text-md-new mb-1.5' : `text-base mb-[3px]`;
|
|
31
29
|
const btnDescClassName = isActiveBtn ? 'text-base text-white' : `text-m-md`;
|
|
32
30
|
const iconClassName = isActiveBtn ? '' : `text-primary-main`;
|
|
33
|
-
return (_jsxs("button", { type: "button", onClick: onClick, "aria-label": tab?.title, className: `box-border font-sans relative border
|
|
31
|
+
return (_jsxs("button", { type: "button", onClick: onClick, "aria-label": tab?.title, className: `box-border font-sans relative border border-main-stroke cursor-pointer text-left border-b-0 flex
|
|
34
32
|
${btnClassName}`, children: [_jsx(Img, { className: `h-[24px] w-[24px] min-w-[24px] min-h-[24px] mr-4 ${iconClassName}`, image: { ...tab?.icon, iconVersion: isActiveBtn ? 'white' : 'normal' }, width: "24", height: "24", asSVG: true }), _jsxs("div", { className: "border-0", children: [_jsx("div", { className: `font-medium ${btnTitleClassName}`, children: tab?.title }), _jsx("div", { className: `text-secondary-text ${btnDescClassName}`, children: tab.description })] })] }, String(i)));
|
|
35
33
|
}
|
|
36
34
|
function renderTabs({ tabsShift, tabsNav, activeSlideIndex, setActiveSlideIndex }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calculator.js","sourceRoot":"","sources":["../../../src/components/Calculator/Calculator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Calculator.js","sourceRoot":"","sources":["../../../src/components/Calculator/Calculator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAG3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAkBhE,MAAM,aAAa,GACjB,iGAAiG,CAAC;AAEpG,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAC3B,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,EAAE,QAAQ,GAAG,EAAE,EAAE,MAAM,GAAG,IAAI,EAAE,EAAE,EAAE;IAC5D,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,IAAK,EAAoB,CAAC,CAAC;IACpE,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,CAChC,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,eAAe,IAAK,EAAyB,CACvE,CAAC;IACF,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEtD,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;IAC1D,MAAM,eAAe,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,GAAG,KAAK,EAAE,EACzD,SAAS,EAAC,qFAAqF,YAE/F,cAAK,SAAS,EAAC,yCAAyC,YACrD,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CACtB,eAAe,CAAC;wBACd,GAAG;wBACH,CAAC;wBACD,gBAAgB;wBAChB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC;qBACtC,CAAC,CACH,GACG,GACF,EACN,cAAK,SAAS,EAAC,4BAA4B,GAAG,IAC1C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,43 +1,89 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { EmptyOption } from '../../model/EmptyOptionType';
|
|
2
|
+
import type { Picture } from '../../model/Picture';
|
|
2
3
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
3
4
|
export interface CommonCalculatorProps {
|
|
5
|
+
/** @title Кнопки */
|
|
4
6
|
buttons?: ButtonWithIconProps[];
|
|
5
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* TODO: данные из справочника
|
|
10
|
+
**/
|
|
6
11
|
export interface CreditCalculatorParams {
|
|
12
|
+
/** @hidden */
|
|
7
13
|
isSalary?: boolean;
|
|
14
|
+
/** @hidden */
|
|
8
15
|
isInsurance?: boolean;
|
|
16
|
+
/** @hidden */
|
|
9
17
|
isAnnuity?: boolean;
|
|
18
|
+
/** @hidden */
|
|
10
19
|
minSum?: number;
|
|
20
|
+
/** @hidden */
|
|
11
21
|
maxSum?: number;
|
|
22
|
+
/** @hidden */
|
|
12
23
|
minMonths?: number;
|
|
24
|
+
/** @hidden */
|
|
13
25
|
maxMonths?: number;
|
|
26
|
+
/** @hidden */
|
|
14
27
|
rateWithInsurance?: number;
|
|
28
|
+
/** @hidden */
|
|
15
29
|
rateWithoutInsurance?: number;
|
|
16
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* TODO: данные из справочника
|
|
33
|
+
**/
|
|
17
34
|
export interface MortgageCalculatorParams {
|
|
35
|
+
/** @hidden */
|
|
18
36
|
isAnnuity?: boolean;
|
|
37
|
+
/** @hidden */
|
|
19
38
|
minInitialContribution?: number;
|
|
39
|
+
/** @hidden */
|
|
20
40
|
minSum?: number;
|
|
41
|
+
/** @hidden */
|
|
21
42
|
maxSum?: number;
|
|
43
|
+
/** @hidden */
|
|
22
44
|
minMonths?: number;
|
|
45
|
+
/** @hidden */
|
|
23
46
|
maxMonths?: number;
|
|
47
|
+
/** @hidden */
|
|
24
48
|
rateWithInsurance?: number;
|
|
49
|
+
/** @hidden */
|
|
25
50
|
rateWithoutInsurance?: number;
|
|
26
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* TODO: данные из справочника
|
|
54
|
+
**/
|
|
27
55
|
export interface DepositCalculatorParams {
|
|
56
|
+
/** @hidden */
|
|
28
57
|
minSum?: number;
|
|
58
|
+
/** @hidden */
|
|
29
59
|
maxSum?: number;
|
|
60
|
+
/** @hidden */
|
|
30
61
|
minMonths?: number;
|
|
62
|
+
/** @hidden */
|
|
31
63
|
maxMonths?: number;
|
|
64
|
+
/** @hidden */
|
|
32
65
|
rate?: number;
|
|
33
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* TODO: данные из справочника
|
|
69
|
+
**/
|
|
34
70
|
export interface BonusCalculatorParams {
|
|
71
|
+
/** @hidden */
|
|
35
72
|
bonus?: number;
|
|
73
|
+
/** @hidden */
|
|
36
74
|
minSumTrip?: number;
|
|
75
|
+
/** @hidden */
|
|
37
76
|
maxSumTrip?: number;
|
|
77
|
+
/** @hidden */
|
|
38
78
|
minSumOther?: number;
|
|
79
|
+
/** @hidden */
|
|
39
80
|
maxSumOther?: number;
|
|
40
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* ? Общий интерфейс для всех типов калькуляторов?
|
|
84
|
+
* ? Используется во вложенных функциях. Может быть как то разбить это и вынести отсюда?
|
|
85
|
+
* @hidden
|
|
86
|
+
*/
|
|
41
87
|
export interface CalculatorParams {
|
|
42
88
|
isAnnuity?: boolean;
|
|
43
89
|
minSum?: number;
|
|
@@ -48,39 +94,35 @@ export interface CalculatorParams {
|
|
|
48
94
|
rateWithoutInsurance?: number;
|
|
49
95
|
}
|
|
50
96
|
/**
|
|
51
|
-
* @title
|
|
97
|
+
* @title Кредитный калькулятор
|
|
52
98
|
* @default {"calcType": "CreditCalculatorForm"}
|
|
53
99
|
*/
|
|
54
100
|
export declare type CreditCalculatorParamsDef = CreditCalculatorParams & CommonCalculatorProps & {
|
|
55
101
|
calcType: 'CreditCalculatorForm';
|
|
56
102
|
};
|
|
57
103
|
/**
|
|
58
|
-
* @title
|
|
104
|
+
* @title Ипотечный калькулятор
|
|
59
105
|
* @default {"calcType": "MortgageCalculatorForm"}
|
|
60
106
|
*/
|
|
61
107
|
export declare type MortgageCalculatorParamsDef = MortgageCalculatorParams & CommonCalculatorProps & {
|
|
62
108
|
calcType: 'MortgageCalculatorForm';
|
|
63
109
|
};
|
|
64
110
|
/**
|
|
65
|
-
* @title
|
|
111
|
+
* @title Калькулятор вкладов
|
|
66
112
|
* @default {"calcType": "DepositCalculatorForm"}
|
|
67
113
|
*/
|
|
68
114
|
export declare type DepositCalculatorParamsDef = DepositCalculatorParams & CommonCalculatorProps & {
|
|
69
115
|
calcType: 'DepositCalculatorForm';
|
|
70
116
|
};
|
|
71
117
|
/**
|
|
72
|
-
* @title
|
|
118
|
+
* @title Калькулятор бонусов
|
|
73
119
|
* @default {"calcType": "BonusCalculatorForm"}
|
|
74
120
|
*/
|
|
75
121
|
export declare type BonusCalculatorParamsDef = BonusCalculatorParams & CommonCalculatorProps & {
|
|
76
122
|
calcType: 'BonusCalculatorForm';
|
|
77
123
|
};
|
|
78
124
|
/**
|
|
79
|
-
* @title
|
|
80
|
-
*/
|
|
81
|
-
export declare type EmptyOption = null;
|
|
82
|
-
/**
|
|
83
|
-
* @title Калькулятор
|
|
125
|
+
* @title Настройки калькулятора
|
|
84
126
|
*/
|
|
85
127
|
export declare type CalculatorBlockDef = EmptyOption | CreditCalculatorParamsDef | MortgageCalculatorParamsDef | DepositCalculatorParamsDef | BonusCalculatorParamsDef;
|
|
86
128
|
/**
|
|
@@ -98,7 +140,6 @@ export interface CalculatorNav {
|
|
|
98
140
|
*/
|
|
99
141
|
export interface CalculatorTab {
|
|
100
142
|
nav?: CalculatorNav;
|
|
101
|
-
/** @title Настройки калькулятора */
|
|
102
143
|
calculatorBlock?: CalculatorBlockDef;
|
|
103
144
|
}
|
|
104
145
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { EmbeddableCalcBlocks } from './EmbeddableCalcBlocks.js';
|
|
3
|
+
export const renderCalculatorBlock = ({ context, className }) => (blockCalcTabs, i) => {
|
|
4
|
+
const type = blockCalcTabs?.calcType;
|
|
5
|
+
if (!type || !(type in EmbeddableCalcBlocks)) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
const EmbeddedBlock = EmbeddableCalcBlocks[type];
|
|
9
|
+
return (_jsx("section", { className: `box-border relative flex shrink-0 basis-full ${className}`, role: "listitem", children: _jsx("div", { className: "box-border p-9 w-full", children: _jsx(EmbeddedBlock, { context: context, ...blockCalcTabs, className: "flex justify-between" }) }) }, String(i)));
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=renderCalculatorBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderCalculatorBlock.js","sourceRoot":"","sources":["../../../src/components/Calculator/renderCalculatorBlock.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,oBAAoB,EAAuB,MAAM,wBAAwB,CAAC;AAQnF,MAAM,CAAC,MAAM,qBAAqB,GAChC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAO,EAAE,EAAE,CAChC,CAAC,aAAiC,EAAE,CAAS,EAAE,EAAE;IAC/C,MAAM,IAAI,GAAG,aAAa,EAAE,QAAQ,CAAC;IACrC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,oBAAoB,CAAC,EAAE;QAC5C,OAAO,IAAI,CAAC;KACb;IACD,MAAM,aAAa,GAAkC,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAChF,OAAO,CACL,kBAEE,SAAS,EAAE,gDAAgD,SAAS,EAAE,EACtE,IAAI,EAAC,UAAU,YAEf,cAAK,SAAS,EAAC,uBAAuB,YACpC,KAAC,aAAa,IAAC,OAAO,EAAE,OAAO,KAAM,aAAa,EAAE,SAAS,EAAC,sBAAsB,GAAG,GACnF,IAND,MAAM,CAAC,CAAC,CAAC,CAON,CACX,CAAC;AACJ,CAAC,CAAC"}
|