@redneckz/wildless-cms-uni-blocks 0.14.52 → 0.14.54
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 +30 -21
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/CalculatorContent.d.ts +38 -0
- package/bundle/components/Calculator/CreditCalculatorForm.d.ts +0 -1
- package/bundle/components/Calculator/getDefaultValues.d.ts +4 -0
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js +7 -6
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/CalculatorContent.d.ts +38 -0
- package/dist/components/Calculator/CreditCalculatorForm.d.ts +0 -1
- package/dist/components/Calculator/CreditCalculatorForm.js +9 -8
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.js +6 -5
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/getDefaultValues.d.ts +4 -0
- package/dist/components/Calculator/getDefaultValues.js +20 -0
- package/dist/components/Calculator/getDefaultValues.js.map +1 -0
- package/dist/ui-kit/BaseTile/BaseTile.js +1 -1
- package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js +7 -6
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/CalculatorContent.d.ts +38 -0
- package/lib/components/Calculator/CreditCalculatorForm.d.ts +0 -1
- package/lib/components/Calculator/CreditCalculatorForm.js +9 -8
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.js +6 -5
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/getDefaultValues.d.ts +4 -0
- package/lib/components/Calculator/getDefaultValues.js +15 -0
- package/lib/components/Calculator/getDefaultValues.js.map +1 -0
- package/lib/ui-kit/BaseTile/BaseTile.js +1 -1
- package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +30 -21
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +38 -0
- package/mobile/bundle/components/Calculator/CreditCalculatorForm.d.ts +0 -1
- package/mobile/bundle/components/Calculator/getDefaultValues.d.ts +4 -0
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +7 -6
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/CalculatorContent.d.ts +38 -0
- package/mobile/dist/components/Calculator/CreditCalculatorForm.d.ts +0 -1
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js +9 -8
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +6 -5
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/getDefaultValues.d.ts +4 -0
- package/mobile/dist/components/Calculator/getDefaultValues.js +20 -0
- package/mobile/dist/components/Calculator/getDefaultValues.js.map +1 -0
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js +1 -1
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +7 -6
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/CalculatorContent.d.ts +38 -0
- package/mobile/lib/components/Calculator/CreditCalculatorForm.d.ts +0 -1
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js +9 -8
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +6 -5
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/getDefaultValues.d.ts +4 -0
- package/mobile/lib/components/Calculator/getDefaultValues.js +15 -0
- package/mobile/lib/components/Calculator/getDefaultValues.js.map +1 -0
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js +1 -1
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +15 -6
- package/mobile/src/components/Calculator/CalculatorContent.ts +42 -0
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +9 -9
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +6 -5
- package/mobile/src/components/Calculator/getDefaultValues.ts +28 -0
- package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
- package/package.json +1 -1
- package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +15 -6
- package/src/components/Calculator/Calculator.fixture.tsx +4 -0
- package/src/components/Calculator/CalculatorContent.ts +42 -0
- package/src/components/Calculator/CreditCalculatorForm.tsx +9 -9
- package/src/components/Calculator/DepositCalculatorForm.tsx +6 -5
- package/src/components/Calculator/getDefaultValues.ts +28 -0
- package/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
|
@@ -15,7 +15,7 @@ export const BaseTile = JSX(({ className, version = 'primary', defaultPadding, p
|
|
|
15
15
|
ev?.preventDefault();
|
|
16
16
|
router.back();
|
|
17
17
|
}, []);
|
|
18
|
-
return (_jsxs("div", { className: getStyle(padding, defaultPadding, className), children: [backwardButton ? renderBackwardButton(version, handleClick) : null, title ? _jsx("div", { className: "relative", children: title }) : null, _jsxs("div", { className: style('grow relative flex flex-col @xl:flex-row gap-3xl w-full', leftImage ? 'self-start @xl:w-auto' : ''), children: [renderImageContainer(leftImage, { imageAlign, className: 'mx-auto' }), _jsxs("div", { className: style('grid gap-3xl', rightImage ? '@xl:grid-cols-2' : '', leftImage ? '' : 'grow'), children: [_jsxs("div", { className: "grow space-y-lg min-w-fit", children: [insetTitle, children] }), renderImageContainer(rightImage, {
|
|
18
|
+
return (_jsxs("div", { className: getStyle(padding, defaultPadding, className), children: [backwardButton ? renderBackwardButton(version, handleClick) : null, title ? _jsx("div", { className: "relative", children: title }) : null, _jsxs("div", { className: style('grow relative flex flex-col @xl:flex-row gap-3xl w-full', leftImage ? 'self-start @xl:w-auto' : ''), children: [renderImageContainer(leftImage, { imageAlign, className: 'mx-auto' }), _jsxs("div", { className: style('grid gap-3xl h-full', rightImage ? '@xl:grid-cols-2' : '', leftImage ? '' : 'grow'), children: [_jsxs("div", { className: "grow space-y-lg min-w-fit", children: [insetTitle, children] }), renderImageContainer(rightImage, {
|
|
19
19
|
className: style('@xl:justify-self-end @xl:col-start-2', buttons ? rowSpanStyle(isImageAlwaysOnRight) : '', positionStyle(isImageAlwaysOnRight), imageSecondaryStyle(isImageSecondary)),
|
|
20
20
|
imageAlign,
|
|
21
21
|
}), renderButtons(buttons)] })] })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseTile.js","sourceRoot":"","sources":["../../../src/ui-kit/BaseTile/BaseTile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIlD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAe1C,MAAM,iBAAiB,GAA0B;IAC/C,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,iBAAiB;IACzB,GAAG,EAAE,cAAc;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CACzB,CAAC,EACC,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,cAAc,EACd,OAAO,EACP,KAAK,GAAG,EAAE,EACV,UAAU,GAAG,EAAE,EACf,OAAO,EACP,SAAS,EACT,UAAU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AAG,CAAC,gBAAyB,EAAE,EAAE,CACxD,gBAAgB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { style } from '../../utils/style';
|
|
|
7
7
|
import { type BusinessDepositCalculatorProps } from './CalculatorContent';
|
|
8
8
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
9
9
|
import { BUSINESS_DEFAULT_DAYS, BUSINESS_DEFAULT_SUM } from './constants';
|
|
10
|
+
import { getMoneyDefaultValue, getMonthsDefaultValue } from './getDefaultValues';
|
|
10
11
|
import { renderDaysInput } from './renderDaysInput';
|
|
11
12
|
import { renderFootnote } from './renderFootnote';
|
|
12
13
|
import { renderInterestPayment } from './renderInterestPayment';
|
|
@@ -23,13 +24,21 @@ export interface BusinessDepositCalculatorProp extends BusinessDepositCalculator
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
|
|
26
|
-
({
|
|
27
|
+
({
|
|
28
|
+
className = '',
|
|
29
|
+
rateParams,
|
|
30
|
+
buttons,
|
|
31
|
+
footnote,
|
|
32
|
+
bottomFootnote,
|
|
33
|
+
isShowDepositeName,
|
|
34
|
+
defaultParams,
|
|
35
|
+
}) => {
|
|
27
36
|
const [userInputParams, { field }] = useForm({
|
|
28
|
-
moneyValue: BUSINESS_DEFAULT_SUM,
|
|
29
|
-
daysValue: BUSINESS_DEFAULT_DAYS,
|
|
30
|
-
isReplenished:
|
|
31
|
-
isPartialWithdrawal:
|
|
32
|
-
isMonthlyInterestPayment:
|
|
37
|
+
moneyValue: getMoneyDefaultValue(defaultParams, BUSINESS_DEFAULT_SUM),
|
|
38
|
+
daysValue: getMonthsDefaultValue(defaultParams, BUSINESS_DEFAULT_DAYS),
|
|
39
|
+
isReplenished: Boolean(defaultParams?.isReplenished),
|
|
40
|
+
isPartialWithdrawal: Boolean(defaultParams?.isPartialWithdrawal),
|
|
41
|
+
isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
|
|
33
42
|
});
|
|
34
43
|
|
|
35
44
|
const calculatorParams = useBusinessDepositCalculatorParams(
|
|
@@ -43,6 +43,13 @@ export type CommonCalculatorProps = Footnote &
|
|
|
43
43
|
sourceBookDir?: string;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
export interface CommonDefaultParams {
|
|
47
|
+
/** @title Сумма по умолчанию */
|
|
48
|
+
sum?: number;
|
|
49
|
+
/** @title Период по умолчанию */
|
|
50
|
+
period?: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
46
53
|
export interface CreditCalculatorParamsViewSettings {
|
|
47
54
|
/** @title Получаю зарплату на счёт в Россельхозбанке */
|
|
48
55
|
isShowSalaryClient?: boolean;
|
|
@@ -74,14 +81,47 @@ export interface DepositCalculatorParamsViewSettings {
|
|
|
74
81
|
isShowRemoteRegistration?: boolean;
|
|
75
82
|
}
|
|
76
83
|
|
|
84
|
+
export interface CreditDefaultParams extends CommonDefaultParams {
|
|
85
|
+
/** @title Получаю зарплату на счёт в Россельхозбанке */
|
|
86
|
+
isEnableSalaryClient?: boolean;
|
|
87
|
+
/** @title Работаю в бюджетной организации */
|
|
88
|
+
isEnableStateEmployee?: boolean;
|
|
89
|
+
/** @title Получаю пенсию на карту Россельхозбанка */
|
|
90
|
+
isEnablePensionClient?: boolean;
|
|
91
|
+
/** @title Комплексная страховая защита */
|
|
92
|
+
isEnableInsurance?: boolean;
|
|
93
|
+
/** @title Аннуитетный платеж */
|
|
94
|
+
isAnnuity?: boolean;
|
|
95
|
+
}
|
|
96
|
+
|
|
77
97
|
export interface CreditCalculatorProps extends CommonCalculatorProps {
|
|
78
98
|
/** @title Настройка отображения чекбоксов */
|
|
79
99
|
paramsViewSettings?: CreditCalculatorParamsViewSettings;
|
|
100
|
+
/** @title Параметры по умолчанию */
|
|
101
|
+
defaultParams?: CreditDefaultParams;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface DepositDefaultParams extends CommonDefaultParams {
|
|
105
|
+
/** @title Выплата процентов */
|
|
106
|
+
isMonthlyInterestPayment?: boolean;
|
|
107
|
+
/** @title Оформление */
|
|
108
|
+
isRemoteRegistration?: boolean;
|
|
80
109
|
}
|
|
81
110
|
|
|
82
111
|
export interface DepositCalculatorProps extends CommonCalculatorProps {
|
|
83
112
|
/** @title Настройка отображения радио */
|
|
84
113
|
paramsViewSettings?: DepositCalculatorParamsViewSettings;
|
|
114
|
+
/** @title Параметры по умолчанию */
|
|
115
|
+
defaultParams?: DepositDefaultParams;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface BusinessDepositDefaultParams extends CommonDefaultParams {
|
|
119
|
+
/** @title Пополнение */
|
|
120
|
+
isReplenished?: boolean;
|
|
121
|
+
/** @title Частичное снятие */
|
|
122
|
+
isPartialWithdrawal?: boolean;
|
|
123
|
+
/** @title Выплата процентов */
|
|
124
|
+
isMonthlyInterestPayment?: boolean;
|
|
85
125
|
}
|
|
86
126
|
|
|
87
127
|
export interface BusinessDepositCalculatorProps extends Footnote, ButtonsSectionContent {
|
|
@@ -91,6 +131,8 @@ export interface BusinessDepositCalculatorProps extends Footnote, ButtonsSection
|
|
|
91
131
|
bottomFootnote?: string;
|
|
92
132
|
/** @title Показывать название депозита */
|
|
93
133
|
isShowDepositeName?: boolean;
|
|
134
|
+
/** @title Параметры по умолчанию */
|
|
135
|
+
defaultParams?: BusinessDepositDefaultParams;
|
|
94
136
|
}
|
|
95
137
|
|
|
96
138
|
export interface RefinancingCalculatorProps extends CommonCalculatorProps {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from './CalculatorContent';
|
|
11
11
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
12
12
|
import { CREDIT_DEFAULT_SUM, DEFAULT_MONTHS } from './constants';
|
|
13
|
+
import { getMoneyDefaultValue, getMonthsDefaultValue } from './getDefaultValues';
|
|
13
14
|
import { renderFootnote } from './renderFootnote';
|
|
14
15
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
15
16
|
import { renderPaymentType } from './renderPaymentType';
|
|
@@ -22,19 +23,18 @@ import {
|
|
|
22
23
|
|
|
23
24
|
export interface CreditCalculatorProp extends CreditCalculatorProps {
|
|
24
25
|
className?: string;
|
|
25
|
-
isMobile?: boolean;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const CreditCalculatorForm = JSX<CreditCalculatorProp>(
|
|
29
|
-
({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
29
|
+
({ className, sourceBookDir, buttons, footnote, paramsViewSettings, defaultParams }) => {
|
|
30
30
|
const [userInputParams, { field }] = useForm({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
moneyValue: getMoneyDefaultValue(defaultParams, CREDIT_DEFAULT_SUM),
|
|
32
|
+
monthsValue: getMonthsDefaultValue(defaultParams, DEFAULT_MONTHS),
|
|
33
|
+
isAnnuity: Boolean(defaultParams?.isAnnuity),
|
|
34
|
+
isInsurance: Boolean(defaultParams?.isEnableInsurance),
|
|
35
|
+
isSalaryClient: Boolean(defaultParams?.isEnableSalaryClient),
|
|
36
|
+
isPensionClient: Boolean(defaultParams?.isEnablePensionClient),
|
|
37
|
+
isStateEmployee: Boolean(defaultParams?.isEnableStateEmployee),
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
const calculatorParams = useCreditCalculatorParams(
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from './CalculatorContent';
|
|
10
10
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
11
11
|
import { DEPOSIT_DEFAULT_SUM } from './constants';
|
|
12
|
+
import { getMoneyDefaultValue, getMonthsDefaultValue } from './getDefaultValues';
|
|
12
13
|
import { renderFootnote } from './renderFootnote';
|
|
13
14
|
import { renderInterestPayment } from './renderInterestPayment';
|
|
14
15
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
@@ -25,12 +26,12 @@ export interface DepositCalculatorProp extends DepositCalculatorProps {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export const DepositCalculatorForm = JSX<DepositCalculatorProp>(
|
|
28
|
-
({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
29
|
+
({ className, sourceBookDir, buttons, footnote, paramsViewSettings, defaultParams }) => {
|
|
29
30
|
const [userInputParams, { field }] = useForm({
|
|
30
|
-
moneyValue: DEPOSIT_DEFAULT_SUM,
|
|
31
|
-
monthsValue: 0,
|
|
32
|
-
isMonthlyInterestPayment:
|
|
33
|
-
isRemoteRegistration:
|
|
31
|
+
moneyValue: getMoneyDefaultValue(defaultParams, DEPOSIT_DEFAULT_SUM),
|
|
32
|
+
monthsValue: getMonthsDefaultValue(defaultParams, 0),
|
|
33
|
+
isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
|
|
34
|
+
isRemoteRegistration: Boolean(defaultParams?.isRemoteRegistration),
|
|
34
35
|
});
|
|
35
36
|
|
|
36
37
|
const calculatorParams = useDepositCalculatorParams(
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CommonDefaultParams } from './CalculatorContent';
|
|
2
|
+
import {
|
|
3
|
+
BUSINESS_MAX_DAYS,
|
|
4
|
+
BUSINESS_MIN_DAYS,
|
|
5
|
+
DEFAULT_MAX_MONTHS,
|
|
6
|
+
DEFAULT_MAX_SUM,
|
|
7
|
+
DEFAULT_MIN_MONTHS,
|
|
8
|
+
DEFAULT_MIN_SUM,
|
|
9
|
+
} from './constants';
|
|
10
|
+
|
|
11
|
+
export const getMoneyDefaultValue = (defaultParams?: CommonDefaultParams, defaultMoney = 0) =>
|
|
12
|
+
defaultParams?.sum && defaultParams.sum >= DEFAULT_MIN_SUM && defaultParams.sum <= DEFAULT_MAX_SUM
|
|
13
|
+
? defaultParams.sum
|
|
14
|
+
: defaultMoney;
|
|
15
|
+
|
|
16
|
+
export const getMonthsDefaultValue = (defaultParams?: CommonDefaultParams, defaultMonth = 0) =>
|
|
17
|
+
defaultParams?.period &&
|
|
18
|
+
defaultParams.period >= DEFAULT_MIN_MONTHS &&
|
|
19
|
+
defaultParams.period <= DEFAULT_MAX_MONTHS
|
|
20
|
+
? defaultParams.period
|
|
21
|
+
: defaultMonth;
|
|
22
|
+
|
|
23
|
+
export const getDaysDefaultValue = (defaultParams?: CommonDefaultParams, defaultDays = 0) =>
|
|
24
|
+
defaultParams?.period &&
|
|
25
|
+
defaultParams.period >= BUSINESS_MIN_DAYS &&
|
|
26
|
+
defaultParams.period <= BUSINESS_MAX_DAYS
|
|
27
|
+
? defaultParams.period
|
|
28
|
+
: defaultDays;
|
|
@@ -62,7 +62,7 @@ export const BaseTile = JSX<BaseTileProps>(
|
|
|
62
62
|
{renderImageContainer(leftImage, { imageAlign, className: 'mx-auto' })}
|
|
63
63
|
<div
|
|
64
64
|
className={style(
|
|
65
|
-
'grid gap-3xl',
|
|
65
|
+
'grid gap-3xl h-full',
|
|
66
66
|
rightImage ? '@xl:grid-cols-2' : '',
|
|
67
67
|
leftImage ? '' : 'grow',
|
|
68
68
|
)}
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import { style } from '../../utils/style';
|
|
|
7
7
|
import { type BusinessDepositCalculatorProps } from './CalculatorContent';
|
|
8
8
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
9
9
|
import { BUSINESS_DEFAULT_DAYS, BUSINESS_DEFAULT_SUM } from './constants';
|
|
10
|
+
import { getMoneyDefaultValue, getMonthsDefaultValue } from './getDefaultValues';
|
|
10
11
|
import { renderDaysInput } from './renderDaysInput';
|
|
11
12
|
import { renderFootnote } from './renderFootnote';
|
|
12
13
|
import { renderInterestPayment } from './renderInterestPayment';
|
|
@@ -23,13 +24,21 @@ export interface BusinessDepositCalculatorProp extends BusinessDepositCalculator
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
|
|
26
|
-
({
|
|
27
|
+
({
|
|
28
|
+
className = '',
|
|
29
|
+
rateParams,
|
|
30
|
+
buttons,
|
|
31
|
+
footnote,
|
|
32
|
+
bottomFootnote,
|
|
33
|
+
isShowDepositeName,
|
|
34
|
+
defaultParams,
|
|
35
|
+
}) => {
|
|
27
36
|
const [userInputParams, { field }] = useForm({
|
|
28
|
-
moneyValue: BUSINESS_DEFAULT_SUM,
|
|
29
|
-
daysValue: BUSINESS_DEFAULT_DAYS,
|
|
30
|
-
isReplenished:
|
|
31
|
-
isPartialWithdrawal:
|
|
32
|
-
isMonthlyInterestPayment:
|
|
37
|
+
moneyValue: getMoneyDefaultValue(defaultParams, BUSINESS_DEFAULT_SUM),
|
|
38
|
+
daysValue: getMonthsDefaultValue(defaultParams, BUSINESS_DEFAULT_DAYS),
|
|
39
|
+
isReplenished: Boolean(defaultParams?.isReplenished),
|
|
40
|
+
isPartialWithdrawal: Boolean(defaultParams?.isPartialWithdrawal),
|
|
41
|
+
isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
|
|
33
42
|
});
|
|
34
43
|
|
|
35
44
|
const calculatorParams = useBusinessDepositCalculatorParams(
|
|
@@ -33,6 +33,10 @@ const bottomFootnote =
|
|
|
33
33
|
|
|
34
34
|
const CREDIT_CALCULATOR_BLOCK: CreditCalculatorParamsDef = {
|
|
35
35
|
calcType: 'CreditCalculatorForm',
|
|
36
|
+
defaultParams: {
|
|
37
|
+
sum: 100000,
|
|
38
|
+
period: 16,
|
|
39
|
+
},
|
|
36
40
|
paramsViewSettings: {
|
|
37
41
|
isShowSalaryClient: true,
|
|
38
42
|
isShowStateEmployee: true,
|
|
@@ -43,6 +43,13 @@ export type CommonCalculatorProps = Footnote &
|
|
|
43
43
|
sourceBookDir?: string;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
export interface CommonDefaultParams {
|
|
47
|
+
/** @title Сумма по умолчанию */
|
|
48
|
+
sum?: number;
|
|
49
|
+
/** @title Период по умолчанию */
|
|
50
|
+
period?: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
46
53
|
export interface CreditCalculatorParamsViewSettings {
|
|
47
54
|
/** @title Получаю зарплату на счёт в Россельхозбанке */
|
|
48
55
|
isShowSalaryClient?: boolean;
|
|
@@ -74,14 +81,47 @@ export interface DepositCalculatorParamsViewSettings {
|
|
|
74
81
|
isShowRemoteRegistration?: boolean;
|
|
75
82
|
}
|
|
76
83
|
|
|
84
|
+
export interface CreditDefaultParams extends CommonDefaultParams {
|
|
85
|
+
/** @title Получаю зарплату на счёт в Россельхозбанке */
|
|
86
|
+
isEnableSalaryClient?: boolean;
|
|
87
|
+
/** @title Работаю в бюджетной организации */
|
|
88
|
+
isEnableStateEmployee?: boolean;
|
|
89
|
+
/** @title Получаю пенсию на карту Россельхозбанка */
|
|
90
|
+
isEnablePensionClient?: boolean;
|
|
91
|
+
/** @title Комплексная страховая защита */
|
|
92
|
+
isEnableInsurance?: boolean;
|
|
93
|
+
/** @title Аннуитетный платеж */
|
|
94
|
+
isAnnuity?: boolean;
|
|
95
|
+
}
|
|
96
|
+
|
|
77
97
|
export interface CreditCalculatorProps extends CommonCalculatorProps {
|
|
78
98
|
/** @title Настройка отображения чекбоксов */
|
|
79
99
|
paramsViewSettings?: CreditCalculatorParamsViewSettings;
|
|
100
|
+
/** @title Параметры по умолчанию */
|
|
101
|
+
defaultParams?: CreditDefaultParams;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface DepositDefaultParams extends CommonDefaultParams {
|
|
105
|
+
/** @title Выплата процентов */
|
|
106
|
+
isMonthlyInterestPayment?: boolean;
|
|
107
|
+
/** @title Оформление */
|
|
108
|
+
isRemoteRegistration?: boolean;
|
|
80
109
|
}
|
|
81
110
|
|
|
82
111
|
export interface DepositCalculatorProps extends CommonCalculatorProps {
|
|
83
112
|
/** @title Настройка отображения радио */
|
|
84
113
|
paramsViewSettings?: DepositCalculatorParamsViewSettings;
|
|
114
|
+
/** @title Параметры по умолчанию */
|
|
115
|
+
defaultParams?: DepositDefaultParams;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface BusinessDepositDefaultParams extends CommonDefaultParams {
|
|
119
|
+
/** @title Пополнение */
|
|
120
|
+
isReplenished?: boolean;
|
|
121
|
+
/** @title Частичное снятие */
|
|
122
|
+
isPartialWithdrawal?: boolean;
|
|
123
|
+
/** @title Выплата процентов */
|
|
124
|
+
isMonthlyInterestPayment?: boolean;
|
|
85
125
|
}
|
|
86
126
|
|
|
87
127
|
export interface BusinessDepositCalculatorProps extends Footnote, ButtonsSectionContent {
|
|
@@ -91,6 +131,8 @@ export interface BusinessDepositCalculatorProps extends Footnote, ButtonsSection
|
|
|
91
131
|
bottomFootnote?: string;
|
|
92
132
|
/** @title Показывать название депозита */
|
|
93
133
|
isShowDepositeName?: boolean;
|
|
134
|
+
/** @title Параметры по умолчанию */
|
|
135
|
+
defaultParams?: BusinessDepositDefaultParams;
|
|
94
136
|
}
|
|
95
137
|
|
|
96
138
|
export interface RefinancingCalculatorProps extends CommonCalculatorProps {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from './CalculatorContent';
|
|
11
11
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
12
12
|
import { CREDIT_DEFAULT_SUM, DEFAULT_MONTHS } from './constants';
|
|
13
|
+
import { getMoneyDefaultValue, getMonthsDefaultValue } from './getDefaultValues';
|
|
13
14
|
import { renderFootnote } from './renderFootnote';
|
|
14
15
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
15
16
|
import { renderPaymentType } from './renderPaymentType';
|
|
@@ -22,19 +23,18 @@ import {
|
|
|
22
23
|
|
|
23
24
|
export interface CreditCalculatorProp extends CreditCalculatorProps {
|
|
24
25
|
className?: string;
|
|
25
|
-
isMobile?: boolean;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const CreditCalculatorForm = JSX<CreditCalculatorProp>(
|
|
29
|
-
({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
29
|
+
({ className, sourceBookDir, buttons, footnote, paramsViewSettings, defaultParams }) => {
|
|
30
30
|
const [userInputParams, { field }] = useForm({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
moneyValue: getMoneyDefaultValue(defaultParams, CREDIT_DEFAULT_SUM),
|
|
32
|
+
monthsValue: getMonthsDefaultValue(defaultParams, DEFAULT_MONTHS),
|
|
33
|
+
isAnnuity: Boolean(defaultParams?.isAnnuity),
|
|
34
|
+
isInsurance: Boolean(defaultParams?.isEnableInsurance),
|
|
35
|
+
isSalaryClient: Boolean(defaultParams?.isEnableSalaryClient),
|
|
36
|
+
isPensionClient: Boolean(defaultParams?.isEnablePensionClient),
|
|
37
|
+
isStateEmployee: Boolean(defaultParams?.isEnableStateEmployee),
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
const calculatorParams = useCreditCalculatorParams(
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from './CalculatorContent';
|
|
10
10
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
11
11
|
import { DEPOSIT_DEFAULT_SUM } from './constants';
|
|
12
|
+
import { getMoneyDefaultValue, getMonthsDefaultValue } from './getDefaultValues';
|
|
12
13
|
import { renderFootnote } from './renderFootnote';
|
|
13
14
|
import { renderInterestPayment } from './renderInterestPayment';
|
|
14
15
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
@@ -25,12 +26,12 @@ export interface DepositCalculatorProp extends DepositCalculatorProps {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export const DepositCalculatorForm = JSX<DepositCalculatorProp>(
|
|
28
|
-
({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
29
|
+
({ className, sourceBookDir, buttons, footnote, paramsViewSettings, defaultParams }) => {
|
|
29
30
|
const [userInputParams, { field }] = useForm({
|
|
30
|
-
moneyValue: DEPOSIT_DEFAULT_SUM,
|
|
31
|
-
monthsValue: 0,
|
|
32
|
-
isMonthlyInterestPayment:
|
|
33
|
-
isRemoteRegistration:
|
|
31
|
+
moneyValue: getMoneyDefaultValue(defaultParams, DEPOSIT_DEFAULT_SUM),
|
|
32
|
+
monthsValue: getMonthsDefaultValue(defaultParams, 0),
|
|
33
|
+
isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
|
|
34
|
+
isRemoteRegistration: Boolean(defaultParams?.isRemoteRegistration),
|
|
34
35
|
});
|
|
35
36
|
|
|
36
37
|
const calculatorParams = useDepositCalculatorParams(
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CommonDefaultParams } from './CalculatorContent';
|
|
2
|
+
import {
|
|
3
|
+
BUSINESS_MAX_DAYS,
|
|
4
|
+
BUSINESS_MIN_DAYS,
|
|
5
|
+
DEFAULT_MAX_MONTHS,
|
|
6
|
+
DEFAULT_MAX_SUM,
|
|
7
|
+
DEFAULT_MIN_MONTHS,
|
|
8
|
+
DEFAULT_MIN_SUM,
|
|
9
|
+
} from './constants';
|
|
10
|
+
|
|
11
|
+
export const getMoneyDefaultValue = (defaultParams?: CommonDefaultParams, defaultMoney = 0) =>
|
|
12
|
+
defaultParams?.sum && defaultParams.sum >= DEFAULT_MIN_SUM && defaultParams.sum <= DEFAULT_MAX_SUM
|
|
13
|
+
? defaultParams.sum
|
|
14
|
+
: defaultMoney;
|
|
15
|
+
|
|
16
|
+
export const getMonthsDefaultValue = (defaultParams?: CommonDefaultParams, defaultMonth = 0) =>
|
|
17
|
+
defaultParams?.period &&
|
|
18
|
+
defaultParams.period >= DEFAULT_MIN_MONTHS &&
|
|
19
|
+
defaultParams.period <= DEFAULT_MAX_MONTHS
|
|
20
|
+
? defaultParams.period
|
|
21
|
+
: defaultMonth;
|
|
22
|
+
|
|
23
|
+
export const getDaysDefaultValue = (defaultParams?: CommonDefaultParams, defaultDays = 0) =>
|
|
24
|
+
defaultParams?.period &&
|
|
25
|
+
defaultParams.period >= BUSINESS_MIN_DAYS &&
|
|
26
|
+
defaultParams.period <= BUSINESS_MAX_DAYS
|
|
27
|
+
? defaultParams.period
|
|
28
|
+
: defaultDays;
|
|
@@ -62,7 +62,7 @@ export const BaseTile = JSX<BaseTileProps>(
|
|
|
62
62
|
{renderImageContainer(leftImage, { imageAlign, className: 'mx-auto' })}
|
|
63
63
|
<div
|
|
64
64
|
className={style(
|
|
65
|
-
'grid gap-3xl',
|
|
65
|
+
'grid gap-3xl h-full',
|
|
66
66
|
rightImage ? '@xl:grid-cols-2' : '',
|
|
67
67
|
leftImage ? '' : 'grow',
|
|
68
68
|
)}
|