@redneckz/wildless-cms-uni-blocks 0.3.63 → 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/content-page-repository/ContentPageRepository.js +1 -1
- package/dist/content-page-repository/ContentPageRepository.js.map +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/types.d.ts +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/content-page-repository/ContentPageRepository.js +1 -1
- package/lib/content-page-repository/ContentPageRepository.js.map +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/types.d.ts +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/content-page-repository/ContentPageRepository.js +1 -1
- package/mobile/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- 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/types.d.ts +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/content-page-repository/ContentPageRepository.js +1 -1
- package/mobile/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- 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/types.d.ts +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/content-page-repository/ContentPageRepository.ts +1 -1
- package/mobile/src/model/EmptyOptionType.ts +4 -0
- package/mobile/src/types.ts +1 -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/content-page-repository/ContentPageRepository.ts +1 -1
- package/src/model/EmptyOptionType.ts +4 -0
- package/src/types.ts +1 -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
|
@@ -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":"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"}
|
|
@@ -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"}
|
|
@@ -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
|
*/
|
|
@@ -11,7 +11,7 @@ export function ContentPageRepository({ contentDir = 'content', publicDir = 'pub
|
|
|
11
11
|
}
|
|
12
12
|
async function getSecondaryContentPages() {
|
|
13
13
|
const pages = await getAllContentPages();
|
|
14
|
-
return pages.filter((content) => content.slug !== INDEX_PAGE_SLUG);
|
|
14
|
+
return pages.filter((content) => content.slug !== INDEX_PAGE_SLUG && !content._customPageType);
|
|
15
15
|
}
|
|
16
16
|
async function getContentPageBySlug(slug) {
|
|
17
17
|
const pages = await getAllContentPages();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,kDAAkD;AAClD,MAAM,UAAU,qBAAqB,CAAC,EACpC,UAAU,GAAG,SAAS,EACtB,SAAS,GAAG,QAAQ,MACc,EAAE;IACpC,KAAK,UAAU,kBAAkB;QAC/B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,UAAU,iBAAiB,CAAC,CAAC;QAC7D,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,UAAU,wBAAwB;QACrC,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,kDAAkD;AAClD,MAAM,UAAU,qBAAqB,CAAC,EACpC,UAAU,GAAG,SAAS,EACtB,SAAS,GAAG,QAAQ,MACc,EAAE;IACpC,KAAK,UAAU,kBAAkB;QAC/B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,UAAU,iBAAiB,CAAC,CAAC;QAC7D,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,UAAU,wBAAwB;QACrC,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,eAAe,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACjG,CAAC;IAED,KAAK,UAAU,oBAAoB,CAAC,IAAY;QAC9C,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,UAAU,YAAY;QACzB,OAAO,MAAM,oBAAoB,CAAC,eAAe,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,KAAK,GAAmC,EAAE,CAAC;IACjD,KAAK,UAAU,QAAQ,CAAC,QAAgB;QACtC,IAAI,CAAC,CAAC,QAAQ,IAAI,KAAK,CAAC,EAAE;YACxB,KAAK,CAAC,QAAQ,CAAC,GAAG,MAAM,oBAAoB,CAAC,QAAQ,EAAE;gBACrD,UAAU;gBACV,SAAS;aACV,CAAC,CAAC;SACJ;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IAED,OAAO;QACL,kBAAkB;QAClB,oBAAoB;QACpB,wBAAwB;QACxB,YAAY;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyOptionType.js","sourceRoot":"","sources":["../../src/model/EmptyOptionType.ts"],"names":[],"mappings":""}
|
package/mobile/lib/types.d.ts
CHANGED
|
@@ -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
|
*/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"calcTabs": [
|
|
3
|
+
{
|
|
4
|
+
"nav": {
|
|
5
|
+
"title": "Вкладка 1",
|
|
6
|
+
"description": "Описание вкладки 1",
|
|
7
|
+
"icon": { "icon": "CalendarIcon" }
|
|
8
|
+
},
|
|
9
|
+
"calculatorBlock": {
|
|
10
|
+
"calcType": "CreditCalculatorForm",
|
|
11
|
+
"buttons": [
|
|
12
|
+
{
|
|
13
|
+
"href": "#",
|
|
14
|
+
"text": "Кнопка 1",
|
|
15
|
+
"version": "primary"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { UniBlockProps } from '../../types';
|
|
3
|
-
import type { CalculatorContent, CalculatorBlockDef } from './CalculatorContent';
|
|
4
3
|
import { ArrowButton } from '../../ui-kit/Button/ArrowButton';
|
|
5
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
-
import {
|
|
5
|
+
import type { CalculatorBlockDef, CalculatorContent } from './CalculatorContent';
|
|
7
6
|
import { CalculatorNav } from './CalculatorContent';
|
|
7
|
+
import { renderCalculatorBlock } from './renderCalculatorBlock';
|
|
8
8
|
|
|
9
9
|
export interface CalculatorProps extends CalculatorContent, UniBlockProps {}
|
|
10
10
|
|
|
@@ -72,11 +72,9 @@ export const Calculator = JSX<CalculatorProps>(
|
|
|
72
72
|
style={{ transform: `translateX(-${activeSlideIndex}00%)` }}
|
|
73
73
|
role="list"
|
|
74
74
|
>
|
|
75
|
-
{
|
|
76
|
-
context,
|
|
77
|
-
|
|
78
|
-
blockCalcTabs,
|
|
79
|
-
})}
|
|
75
|
+
{blockCalcTabs?.length
|
|
76
|
+
? blockCalcTabs.map(renderCalculatorBlock({ context, className }))
|
|
77
|
+
: null}
|
|
80
78
|
</div>
|
|
81
79
|
</section>
|
|
82
80
|
);
|
|
@@ -99,7 +97,7 @@ function renderNavButton({ tab, i, activeSlideIndex, onClick }: NavButtonProps)
|
|
|
99
97
|
key={String(i)}
|
|
100
98
|
onClick={onClick}
|
|
101
99
|
aria-label={tab?.title}
|
|
102
|
-
className={`box-border font-sans relative border
|
|
100
|
+
className={`box-border font-sans relative border border-main-stroke cursor-pointer text-left border-b-0 flex
|
|
103
101
|
${btnClassName}`}
|
|
104
102
|
>
|
|
105
103
|
<Img
|
|
@@ -1,49 +1,96 @@
|
|
|
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
|
|
|
4
5
|
export interface CommonCalculatorProps {
|
|
6
|
+
/** @title Кнопки */
|
|
5
7
|
buttons?: ButtonWithIconProps[];
|
|
6
8
|
}
|
|
7
9
|
|
|
10
|
+
/**
|
|
11
|
+
* TODO: данные из справочника
|
|
12
|
+
**/
|
|
8
13
|
export interface CreditCalculatorParams {
|
|
14
|
+
/** @hidden */
|
|
9
15
|
isSalary?: boolean;
|
|
16
|
+
/** @hidden */
|
|
10
17
|
isInsurance?: boolean;
|
|
18
|
+
/** @hidden */
|
|
11
19
|
isAnnuity?: boolean;
|
|
20
|
+
/** @hidden */
|
|
12
21
|
minSum?: number;
|
|
22
|
+
/** @hidden */
|
|
13
23
|
maxSum?: number;
|
|
24
|
+
/** @hidden */
|
|
14
25
|
minMonths?: number;
|
|
26
|
+
/** @hidden */
|
|
15
27
|
maxMonths?: number;
|
|
28
|
+
/** @hidden */
|
|
16
29
|
rateWithInsurance?: number;
|
|
30
|
+
/** @hidden */
|
|
17
31
|
rateWithoutInsurance?: number;
|
|
18
32
|
}
|
|
19
33
|
|
|
34
|
+
/**
|
|
35
|
+
* TODO: данные из справочника
|
|
36
|
+
**/
|
|
20
37
|
export interface MortgageCalculatorParams {
|
|
38
|
+
/** @hidden */
|
|
21
39
|
isAnnuity?: boolean;
|
|
40
|
+
/** @hidden */
|
|
22
41
|
minInitialContribution?: number;
|
|
42
|
+
/** @hidden */
|
|
23
43
|
minSum?: number;
|
|
44
|
+
/** @hidden */
|
|
24
45
|
maxSum?: number;
|
|
46
|
+
/** @hidden */
|
|
25
47
|
minMonths?: number;
|
|
48
|
+
/** @hidden */
|
|
26
49
|
maxMonths?: number;
|
|
50
|
+
/** @hidden */
|
|
27
51
|
rateWithInsurance?: number;
|
|
52
|
+
/** @hidden */
|
|
28
53
|
rateWithoutInsurance?: number;
|
|
29
54
|
}
|
|
30
55
|
|
|
56
|
+
/**
|
|
57
|
+
* TODO: данные из справочника
|
|
58
|
+
**/
|
|
31
59
|
export interface DepositCalculatorParams {
|
|
60
|
+
/** @hidden */
|
|
32
61
|
minSum?: number;
|
|
62
|
+
/** @hidden */
|
|
33
63
|
maxSum?: number;
|
|
64
|
+
/** @hidden */
|
|
34
65
|
minMonths?: number;
|
|
66
|
+
/** @hidden */
|
|
35
67
|
maxMonths?: number;
|
|
68
|
+
/** @hidden */
|
|
36
69
|
rate?: number;
|
|
37
70
|
}
|
|
38
71
|
|
|
72
|
+
/**
|
|
73
|
+
* TODO: данные из справочника
|
|
74
|
+
**/
|
|
75
|
+
|
|
39
76
|
export interface BonusCalculatorParams {
|
|
77
|
+
/** @hidden */
|
|
40
78
|
bonus?: number;
|
|
79
|
+
/** @hidden */
|
|
41
80
|
minSumTrip?: number;
|
|
81
|
+
/** @hidden */
|
|
42
82
|
maxSumTrip?: number;
|
|
83
|
+
/** @hidden */
|
|
43
84
|
minSumOther?: number;
|
|
85
|
+
/** @hidden */
|
|
44
86
|
maxSumOther?: number;
|
|
45
87
|
}
|
|
46
88
|
|
|
89
|
+
/**
|
|
90
|
+
* ? Общий интерфейс для всех типов калькуляторов?
|
|
91
|
+
* ? Используется во вложенных функциях. Может быть как то разбить это и вынести отсюда?
|
|
92
|
+
* @hidden
|
|
93
|
+
*/
|
|
47
94
|
export interface CalculatorParams {
|
|
48
95
|
isAnnuity?: boolean;
|
|
49
96
|
minSum?: number;
|
|
@@ -55,7 +102,7 @@ export interface CalculatorParams {
|
|
|
55
102
|
}
|
|
56
103
|
|
|
57
104
|
/**
|
|
58
|
-
* @title
|
|
105
|
+
* @title Кредитный калькулятор
|
|
59
106
|
* @default {"calcType": "CreditCalculatorForm"}
|
|
60
107
|
*/
|
|
61
108
|
export type CreditCalculatorParamsDef = CreditCalculatorParams &
|
|
@@ -64,7 +111,7 @@ export type CreditCalculatorParamsDef = CreditCalculatorParams &
|
|
|
64
111
|
};
|
|
65
112
|
|
|
66
113
|
/**
|
|
67
|
-
* @title
|
|
114
|
+
* @title Ипотечный калькулятор
|
|
68
115
|
* @default {"calcType": "MortgageCalculatorForm"}
|
|
69
116
|
*/
|
|
70
117
|
export type MortgageCalculatorParamsDef = MortgageCalculatorParams &
|
|
@@ -73,7 +120,7 @@ export type MortgageCalculatorParamsDef = MortgageCalculatorParams &
|
|
|
73
120
|
};
|
|
74
121
|
|
|
75
122
|
/**
|
|
76
|
-
* @title
|
|
123
|
+
* @title Калькулятор вкладов
|
|
77
124
|
* @default {"calcType": "DepositCalculatorForm"}
|
|
78
125
|
*/
|
|
79
126
|
export type DepositCalculatorParamsDef = DepositCalculatorParams &
|
|
@@ -82,7 +129,7 @@ export type DepositCalculatorParamsDef = DepositCalculatorParams &
|
|
|
82
129
|
};
|
|
83
130
|
|
|
84
131
|
/**
|
|
85
|
-
* @title
|
|
132
|
+
* @title Калькулятор бонусов
|
|
86
133
|
* @default {"calcType": "BonusCalculatorForm"}
|
|
87
134
|
*/
|
|
88
135
|
export type BonusCalculatorParamsDef = BonusCalculatorParams &
|
|
@@ -91,12 +138,7 @@ export type BonusCalculatorParamsDef = BonusCalculatorParams &
|
|
|
91
138
|
};
|
|
92
139
|
|
|
93
140
|
/**
|
|
94
|
-
* @title
|
|
95
|
-
*/
|
|
96
|
-
export type EmptyOption = null;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @title Калькулятор
|
|
141
|
+
* @title Настройки калькулятора
|
|
100
142
|
*/
|
|
101
143
|
export type CalculatorBlockDef =
|
|
102
144
|
| EmptyOption
|
|
@@ -121,7 +163,6 @@ export interface CalculatorNav {
|
|
|
121
163
|
*/
|
|
122
164
|
export interface CalculatorTab {
|
|
123
165
|
nav?: CalculatorNav;
|
|
124
|
-
/** @title Настройки калькулятора */
|
|
125
166
|
calculatorBlock?: CalculatorBlockDef;
|
|
126
167
|
}
|
|
127
168
|
|
package/mobile/src/components/Calculator/{renderCalculatorList.tsx → renderCalculatorBlock.tsx}
RENAMED
|
@@ -9,15 +9,7 @@ type EmbeddableCalcBlocks = {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export const
|
|
13
|
-
blockCalcTabs,
|
|
14
|
-
context,
|
|
15
|
-
className,
|
|
16
|
-
}: EmbeddableCalcBlocks) => {
|
|
17
|
-
return blockCalcTabs?.length ? blockCalcTabs.map(renderBlock({ context, className })) : null;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const renderBlock =
|
|
12
|
+
export const renderCalculatorBlock =
|
|
21
13
|
({ context, className }: any) =>
|
|
22
14
|
(blockCalcTabs: CalculatorBlockDef, i: number) => {
|
|
23
15
|
const type = blockCalcTabs?.calcType;
|
|
@@ -27,16 +19,12 @@ const renderBlock =
|
|
|
27
19
|
const EmbeddedBlock: JSXBlock<EmbeddableCalcProps> = EmbeddableCalcBlocks[type];
|
|
28
20
|
return (
|
|
29
21
|
<section
|
|
30
|
-
key={
|
|
31
|
-
className={`box-border relative flex
|
|
22
|
+
key={String(i)}
|
|
23
|
+
className={`box-border relative flex shrink-0 basis-full ${className}`}
|
|
32
24
|
role="listitem"
|
|
33
25
|
>
|
|
34
|
-
<div className=
|
|
35
|
-
<EmbeddedBlock
|
|
36
|
-
context={context}
|
|
37
|
-
{...blockCalcTabs}
|
|
38
|
-
className="!p-0 flex justify-between"
|
|
39
|
-
/>
|
|
26
|
+
<div className="box-border p-9 w-full">
|
|
27
|
+
<EmbeddedBlock context={context} {...blockCalcTabs} className="flex justify-between" />
|
|
40
28
|
</div>
|
|
41
29
|
</section>
|
|
42
30
|
);
|
|
@@ -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
|
|
|
5
6
|
export interface ActiveHandler {
|
|
6
7
|
context: ContentPageContext;
|
|
@@ -29,11 +30,6 @@ export type ProductBlockDef = ProductBlockContent &
|
|
|
29
30
|
export type ProductTileDef = ProductTileContent &
|
|
30
31
|
GroupBlockCommonProps & { blockType: 'ProductTile' };
|
|
31
32
|
|
|
32
|
-
/**
|
|
33
|
-
* @title Выберите блок
|
|
34
|
-
*/
|
|
35
|
-
export type EmptyOption = null;
|
|
36
|
-
|
|
37
33
|
/**
|
|
38
34
|
* @title Содержимое блока
|
|
39
35
|
*/
|
|
@@ -19,7 +19,7 @@ export function ContentPageRepository({
|
|
|
19
19
|
|
|
20
20
|
async function getSecondaryContentPages() {
|
|
21
21
|
const pages = await getAllContentPages();
|
|
22
|
-
return pages.filter((content) => content.slug !== INDEX_PAGE_SLUG);
|
|
22
|
+
return pages.filter((content) => content.slug !== INDEX_PAGE_SLUG && !content._customPageType);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
async function getContentPageBySlug(slug: string): Promise<ContentPageDef | undefined> {
|