@redneckz/wildless-cms-uni-blocks 0.14.430 → 0.14.431
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 +93 -33
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CalculatorDeposit/CalculatorDepositContent.d.ts +10 -0
- package/bundle/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +5 -0
- package/bundle/components/CalculatorDeposit/renderDepositParamsForm.d.ts +5 -0
- package/bundle/ui-kit/Calculator/renderRate.d.ts +3 -1
- package/dist/components/CalculatorDeposit/CalculatorDeposit.js +31 -26
- package/dist/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
- package/dist/components/CalculatorDeposit/CalculatorDepositContent.d.ts +10 -0
- package/dist/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +5 -0
- package/dist/components/CalculatorDeposit/getDepositCalculatorParams.js +19 -2
- package/dist/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
- package/dist/components/CalculatorDeposit/renderDepositParamsForm.d.ts +5 -0
- package/dist/components/CalculatorDeposit/renderDepositParamsForm.js +45 -0
- package/dist/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -0
- package/dist/components/CalculatorDeposit/renderDepositResult.js +1 -1
- package/dist/components/CalculatorDeposit/renderDepositResult.js.map +1 -1
- package/dist/ui-kit/Calculator/CalculatorStyle.js +3 -3
- package/dist/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
- package/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -2
- package/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/dist/ui-kit/Calculator/renderRate.d.ts +3 -1
- package/dist/ui-kit/Calculator/renderRate.js +1 -1
- package/dist/ui-kit/Calculator/renderRate.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/CalculatorDeposit/CalculatorDeposit.fixture.d.ts +1 -0
- package/lib/components/CalculatorDeposit/CalculatorDeposit.js +30 -25
- package/lib/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
- package/lib/components/CalculatorDeposit/CalculatorDepositContent.d.ts +10 -0
- package/lib/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +5 -0
- package/lib/components/CalculatorDeposit/getDepositCalculatorParams.js +19 -2
- package/lib/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
- package/lib/components/CalculatorDeposit/renderDepositParamsForm.d.ts +4 -0
- package/lib/components/CalculatorDeposit/renderDepositParamsForm.js +42 -0
- package/lib/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -0
- package/lib/components/CalculatorDeposit/renderDepositResult.js +1 -1
- package/lib/components/CalculatorDeposit/renderDepositResult.js.map +1 -1
- package/lib/ui-kit/Calculator/CalculatorStyle.js +3 -3
- package/lib/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
- package/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -2
- package/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/lib/ui-kit/Calculator/renderRate.d.ts +3 -1
- package/lib/ui-kit/Calculator/renderRate.js +1 -1
- package/lib/ui-kit/Calculator/renderRate.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +93 -33
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CalculatorDeposit/CalculatorDepositContent.d.ts +10 -0
- package/mobile/bundle/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +5 -0
- package/mobile/bundle/components/CalculatorDeposit/renderDepositParamsForm.d.ts +5 -0
- package/mobile/bundle/ui-kit/Calculator/renderRate.d.ts +3 -1
- package/mobile/dist/components/CalculatorDeposit/CalculatorDeposit.js +31 -26
- package/mobile/dist/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
- package/mobile/dist/components/CalculatorDeposit/CalculatorDepositContent.d.ts +10 -0
- package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +5 -0
- package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.js +19 -2
- package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/CalculatorDeposit/renderDepositParamsForm.d.ts +5 -0
- package/mobile/dist/components/CalculatorDeposit/renderDepositParamsForm.js +45 -0
- package/mobile/dist/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -0
- package/mobile/dist/components/CalculatorDeposit/renderDepositResult.js +1 -1
- package/mobile/dist/components/CalculatorDeposit/renderDepositResult.js.map +1 -1
- package/mobile/dist/ui-kit/Calculator/CalculatorStyle.js +3 -3
- package/mobile/dist/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
- package/mobile/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -2
- package/mobile/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/mobile/dist/ui-kit/Calculator/renderRate.d.ts +3 -1
- package/mobile/dist/ui-kit/Calculator/renderRate.js +1 -1
- package/mobile/dist/ui-kit/Calculator/renderRate.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/CalculatorDeposit/CalculatorDeposit.js +30 -25
- package/mobile/lib/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
- package/mobile/lib/components/CalculatorDeposit/CalculatorDepositContent.d.ts +10 -0
- package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +5 -0
- package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.js +19 -2
- package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/CalculatorDeposit/renderDepositParamsForm.d.ts +5 -0
- package/mobile/lib/components/CalculatorDeposit/renderDepositParamsForm.js +42 -0
- package/mobile/lib/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -0
- package/mobile/lib/components/CalculatorDeposit/renderDepositResult.js +1 -1
- package/mobile/lib/components/CalculatorDeposit/renderDepositResult.js.map +1 -1
- package/mobile/lib/ui-kit/Calculator/CalculatorStyle.js +3 -3
- package/mobile/lib/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
- package/mobile/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -2
- package/mobile/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/mobile/lib/ui-kit/Calculator/renderRate.d.ts +3 -1
- package/mobile/lib/ui-kit/Calculator/renderRate.js +1 -1
- package/mobile/lib/ui-kit/Calculator/renderRate.js.map +1 -1
- package/mobile/src/components/CalculatorDeposit/CalculatorDeposit.tsx +45 -41
- package/mobile/src/components/CalculatorDeposit/CalculatorDepositContent.ts +10 -0
- package/mobile/src/components/CalculatorDeposit/getDepositCalculatorParams.ts +23 -0
- package/mobile/src/components/CalculatorDeposit/renderDepositParamsForm.tsx +59 -0
- package/mobile/src/components/CalculatorDeposit/renderDepositResult.tsx +1 -1
- package/mobile/src/ui-kit/Calculator/CalculatorStyle.tsx +3 -3
- package/mobile/src/ui-kit/Calculator/renderBinaryRadioButtonGroup.tsx +2 -3
- package/mobile/src/ui-kit/Calculator/renderRate.tsx +5 -1
- package/package.json +1 -1
- package/src/components/CalculatorDeposit/CalculatorDeposit.fixture.tsx +20 -0
- package/src/components/CalculatorDeposit/CalculatorDeposit.tsx +45 -41
- package/src/components/CalculatorDeposit/CalculatorDepositContent.ts +10 -0
- package/src/components/CalculatorDeposit/getDepositCalculatorParams.ts +23 -0
- package/src/components/CalculatorDeposit/renderDepositParamsForm.tsx +59 -0
- package/src/components/CalculatorDeposit/renderDepositResult.tsx +1 -1
- package/src/ui-kit/Calculator/CalculatorStyle.tsx +3 -3
- package/src/ui-kit/Calculator/renderBinaryRadioButtonGroup.tsx +2 -3
- package/src/ui-kit/Calculator/renderRate.tsx +5 -1
- package/tailwind.config.cjs +1 -1
- package/bundle/ui-kit/Breadcrumb.d.ts +0 -6
- package/dist/ui-kit/Breadcrumb.d.ts +0 -6
- package/dist/ui-kit/Breadcrumb.js +0 -11
- package/dist/ui-kit/Breadcrumb.js.map +0 -1
- package/lib/ui-kit/Breadcrumb.d.ts +0 -6
- package/lib/ui-kit/Breadcrumb.js +0 -9
- package/lib/ui-kit/Breadcrumb.js.map +0 -1
- package/mobile/bundle/ui-kit/Breadcrumb.d.ts +0 -6
- package/mobile/dist/ui-kit/Breadcrumb.d.ts +0 -6
- package/mobile/dist/ui-kit/Breadcrumb.js +0 -11
- package/mobile/dist/ui-kit/Breadcrumb.js.map +0 -1
- package/mobile/lib/ui-kit/Breadcrumb.d.ts +0 -6
- package/mobile/lib/ui-kit/Breadcrumb.js +0 -9
- package/mobile/lib/ui-kit/Breadcrumb.js.map +0 -1
- package/mobile/src/ui-kit/Breadcrumb.tsx +0 -21
- package/src/ui-kit/Breadcrumb.tsx +0 -21
package/bundle/bundle.umd.js
CHANGED
|
@@ -2492,9 +2492,9 @@
|
|
|
2492
2492
|
const CalculatorLayout = JSX(({ className, title, children, ...rest }) => (jsxs(BlockWrapper, { className: style('space-y-xl', className), defaultPadding: "p-4xl", ...rest, children: [title ? jsx(Heading, { className: "text-center", title: title }) : null, children] })));
|
|
2493
2493
|
|
|
2494
2494
|
const CalculatorStyle = {
|
|
2495
|
-
wrapper: 'flex flex-col justify-between @4xl:flex-row gap-x-
|
|
2496
|
-
input: 'flex flex-col
|
|
2497
|
-
result: 'flex flex-col gap-y-xl
|
|
2495
|
+
wrapper: 'flex flex-col justify-between @4xl:flex-row gap-x-s gap-y-7 @xl:gap-y-4xl',
|
|
2496
|
+
input: 'flex flex-col lg:max-w-80 gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0',
|
|
2497
|
+
result: 'flex flex-col gap-y-xl',
|
|
2498
2498
|
};
|
|
2499
2499
|
|
|
2500
2500
|
const calculatorValueBlockStyle = 'flex justify-between @xl:flex-col';
|
|
@@ -2508,7 +2508,7 @@
|
|
|
2508
2508
|
|
|
2509
2509
|
const UnknownRate = JSX(({ title = 'Ставка', isUnavailableByTerm = false }) => (jsxs("div", { className: "space-y-s", children: [jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: title }), jsx(Icon, { className: "w-10 h-10 @5xl:h-auto @5xl:w-40", name: "PercentIcon" }), jsx("div", { className: "w-64", children: isUnavailableByTerm ? (jsxs(Paragraph, { size: "text-xl", font: "font-light", color: "text-primary-text", children: ["\u041F\u0440\u043E\u0446\u0435\u043D\u0442\u043D\u0430\u044F \u0441\u0442\u0430\u0432\u043A\u0430 \u0434\u043B\u044F \u0441\u0440\u043E\u043A\u0430 ", jsx("strong", { children: "1-30 \u0434\u043D\u0435\u0439" }), " \u0443\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0438 \u0432 \u0411\u0430\u043D\u043A"] })) : (jsx(Paragraph, { size: "text-xl", font: "font-light", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u0443\u044E \u0441\u0443\u043C\u043C\u0443 \u0438\u043B\u0438 \u0441\u0440\u043E\u043A" })) })] })));
|
|
2510
2510
|
|
|
2511
|
-
const renderRate = ({ title = 'Ставка', rate = 0, unit = '%', fractionDigits = 2, isUnknownRateShown = true, color = 'text-secondary-text', ...rest }) => isUnknownRateShown && rate === 0 ? (jsx(UnknownRate, { title: title, ...rest })) : (jsxs("div", { children: [jsx("div", { className: "hidden @xl:block", children: jsx(Rate, { title: title, rate: rate, unit: unit, fractionDigits: fractionDigits, color: color, ...rest }) }), jsx("div", { className: "@xl:hidden", children: jsx(CalculatorValueBlock, { title: title, value: rate, postfix: unit, fractionDigits: fractionDigits, fixed: true, color: color, ...rest }) })] }));
|
|
2511
|
+
const renderRate = ({ title = 'Ставка', rate = 0, unit = '%', fractionDigits = 2, isUnknownRateShown = true, color = 'text-secondary-text', children, ...rest }) => isUnknownRateShown && rate === 0 ? (jsx(UnknownRate, { title: title, ...rest })) : (jsxs("div", { children: [jsx("div", { className: "hidden @xl:block min-w-96", children: jsx(Rate, { title: title, rate: rate, unit: unit, fractionDigits: fractionDigits, color: color, ...rest }) }), jsx("div", { className: "@xl:hidden", children: jsx(CalculatorValueBlock, { title: title, value: rate, postfix: unit, fractionDigits: fractionDigits, fixed: true, color: color, ...rest }) }), children] }));
|
|
2512
2512
|
|
|
2513
2513
|
const DEFAULT_MONEY_STEP = 1000;
|
|
2514
2514
|
function renderWantedSumInput({ isShowItems = true, step = DEFAULT_MONEY_STEP, ...rest }) {
|
|
@@ -2621,7 +2621,7 @@
|
|
|
2621
2621
|
};
|
|
2622
2622
|
const RadioButtonGroup = JSX(({ items, checkedItem, className, onChange: onChangeCheckedItem, orientation = 'horizontal', }) => (jsx("div", { className: style(`flex ${orientationStyleMap[orientation]}`, className), role: "radiogroup", children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: checkedItem === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id) }, String(id)))) })));
|
|
2623
2623
|
|
|
2624
|
-
const renderBinaryRadioButtonGroup = ({ items, title, mobileTitle = title, orientation = 'horizontal', value, radioGroupClassName, onChange, }) => (jsxs("div", { className: "
|
|
2624
|
+
const renderBinaryRadioButtonGroup = ({ items, title, mobileTitle = title, orientation = 'horizontal', value, radioGroupClassName, onChange, }) => (jsxs("div", { className: "grid gap-s whitespace-nowrap", children: [title ? (jsx("div", { className: "hidden @5xl:block", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, mobileTitle ? (jsx("div", { className: "@5xl:hidden", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: mobileTitle }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items, checkedItem: items[value ? 0 : 1].id, className: radioGroupClassName, onChange: (_) => onChange && onChange(_ === items[0].id) })] }));
|
|
2625
2625
|
|
|
2626
2626
|
const renderPayout = (props) => renderBinaryRadioButtonGroup({
|
|
2627
2627
|
...props,
|
|
@@ -2631,7 +2631,7 @@
|
|
|
2631
2631
|
],
|
|
2632
2632
|
});
|
|
2633
2633
|
|
|
2634
|
-
const renderDepositResult = ({ income, finalSum, buttons, footnotes = [], }) => (jsxs("div", { className: CalculatorStyle.result, children: [jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: income, postfix: "\u20BD", prefix: "+" }), jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: finalSum, postfix: "\u20BD" }), renderButtonsSection(buttons, { isVertical: true }), footnotes?.map(renderFootnote)] }));
|
|
2634
|
+
const renderDepositResult = ({ income, finalSum, buttons = [], footnotes = [], }) => (jsxs("div", { className: CalculatorStyle.result, children: [jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: income, postfix: "\u20BD", prefix: "+" }), jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: finalSum, postfix: "\u20BD" }), renderButtonsSection(buttons, { isVertical: true }), footnotes?.map(renderFootnote)] }));
|
|
2635
2635
|
|
|
2636
2636
|
const getLimitRangeByKeys = ([minKey, maxKey], limitParams, rateRows = []) => limitParams && limitParams[minKey] && limitParams[maxKey]
|
|
2637
2637
|
? {
|
|
@@ -3012,6 +3012,9 @@
|
|
|
3012
3012
|
rate: 0,
|
|
3013
3013
|
isMonthlyInterestPayment: true,
|
|
3014
3014
|
isRemoteRegistration: true,
|
|
3015
|
+
isReplenish: false,
|
|
3016
|
+
isWithdrawn: false,
|
|
3017
|
+
type: '',
|
|
3015
3018
|
};
|
|
3016
3019
|
const getDepositCalculatorParams = (userInputParams, calcSource, paramsViewSettings) => {
|
|
3017
3020
|
const { moneyValue, monthsValue } = userInputParams;
|
|
@@ -3020,12 +3023,26 @@
|
|
|
3020
3023
|
: 0;
|
|
3021
3024
|
const isExcludeMonthlyInterestPayment = !paramsViewSettings?.isShowMonthlyInterestPayment;
|
|
3022
3025
|
const isExcludeRemoteRegistration = !paramsViewSettings?.isShowRemoteRegistration;
|
|
3026
|
+
const isExcludeReplenish = !paramsViewSettings?.isShowReplenish;
|
|
3027
|
+
const isExcludeWithdrawn = !paramsViewSettings?.isShowWithdrawn;
|
|
3023
3028
|
const depositCalculatorSourceBookParams = calcSource?.rateRows?.find((row) => checkRowByParam({
|
|
3024
3029
|
row,
|
|
3025
3030
|
userInputParams,
|
|
3026
|
-
paramKey: '
|
|
3027
|
-
isExclude:
|
|
3031
|
+
paramKey: 'isReplenish',
|
|
3032
|
+
isExclude: isExcludeReplenish,
|
|
3028
3033
|
}) &&
|
|
3034
|
+
checkRowByParam({
|
|
3035
|
+
row,
|
|
3036
|
+
userInputParams,
|
|
3037
|
+
paramKey: 'isWithdrawn',
|
|
3038
|
+
isExclude: isExcludeWithdrawn,
|
|
3039
|
+
}) &&
|
|
3040
|
+
checkRowByParam({
|
|
3041
|
+
row,
|
|
3042
|
+
userInputParams,
|
|
3043
|
+
paramKey: 'isMonthlyInterestPayment',
|
|
3044
|
+
isExclude: isExcludeMonthlyInterestPayment,
|
|
3045
|
+
}) &&
|
|
3029
3046
|
checkRowByParam({
|
|
3030
3047
|
row,
|
|
3031
3048
|
userInputParams,
|
|
@@ -3072,22 +3089,64 @@
|
|
|
3072
3089
|
],
|
|
3073
3090
|
});
|
|
3074
3091
|
|
|
3092
|
+
const renderDepositParamsForm = (params, field) => (jsxs("div", { className: "grid gap-lg", children: [jsxs("div", { className: "flex gap-lg", children: [params.isShowReplenish
|
|
3093
|
+
? renderBinaryRadioButtonGroup({
|
|
3094
|
+
title: 'Пополнение',
|
|
3095
|
+
...field('isReplenish'),
|
|
3096
|
+
value: params.isReplenish,
|
|
3097
|
+
orientation: 'vertical',
|
|
3098
|
+
items: [
|
|
3099
|
+
{ id: 'withReplenish', text: 'С пополнением' },
|
|
3100
|
+
{ id: 'withoutReplenish', text: 'Без пополнения' },
|
|
3101
|
+
],
|
|
3102
|
+
})
|
|
3103
|
+
: null, params.isShowWithdrawn
|
|
3104
|
+
? renderBinaryRadioButtonGroup({
|
|
3105
|
+
title: 'Снятие',
|
|
3106
|
+
...field('isWithdrawn'),
|
|
3107
|
+
value: params.isWithdrawn,
|
|
3108
|
+
orientation: 'vertical',
|
|
3109
|
+
items: [
|
|
3110
|
+
{ id: 'wthDrawn', text: 'Со снятием' },
|
|
3111
|
+
{ id: 'noWithdrawn', text: 'Без снятия' },
|
|
3112
|
+
],
|
|
3113
|
+
})
|
|
3114
|
+
: null] }), jsx("div", { className: "border-b border-main-divider w-full" }), jsxs("div", { className: "flex gap-lg", children: [params.isShowMonthlyInterestPayment
|
|
3115
|
+
? renderPayout({
|
|
3116
|
+
title: 'Выплата процентов',
|
|
3117
|
+
...field('isMonthlyInterestPayment'),
|
|
3118
|
+
value: params.isMonthlyInterestPayment,
|
|
3119
|
+
orientation: 'vertical',
|
|
3120
|
+
})
|
|
3121
|
+
: null, params.isShowRemoteRegistration
|
|
3122
|
+
? renderRegistrationType({
|
|
3123
|
+
title: 'Оформление',
|
|
3124
|
+
...field('isRemoteRegistration'),
|
|
3125
|
+
value: params.isRemoteRegistration,
|
|
3126
|
+
orientation: 'vertical',
|
|
3127
|
+
})
|
|
3128
|
+
: null] })] }));
|
|
3129
|
+
|
|
3075
3130
|
const MAP = {
|
|
3076
3131
|
isMonthlyInterestPayment: 'isMonthlyInterestPayment',
|
|
3077
3132
|
isRemoteRegistration: 'isRemoteRegistration',
|
|
3133
|
+
isReplenish: 'isReplenish',
|
|
3134
|
+
isWithdrawn: 'isWithdrawn',
|
|
3078
3135
|
moneyValue: 'minSum',
|
|
3079
3136
|
};
|
|
3080
3137
|
const DEPOSIT_DEFAULT_SUM = 20000;
|
|
3081
|
-
const CalculatorDeposit = UniBlock(({ className, title, calcSource, buttons, footnote, paramsViewSettings, defaultParams, ...rest }) => {
|
|
3138
|
+
const CalculatorDeposit = UniBlock(({ className, title, calcSource, buttons = [], footnote = '', paramsViewSettings, defaultParams, ...rest }) => {
|
|
3082
3139
|
const defParams = getDefaultParamsMax(calcSource?.rateRows);
|
|
3083
3140
|
const [userInputParams, { field }] = useForm({
|
|
3084
3141
|
moneyValue: getMoneyDefaultValue(defaultParams, DEPOSIT_DEFAULT_SUM),
|
|
3085
3142
|
monthsValue: getMonthsDefaultValue(defaultParams),
|
|
3086
3143
|
isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
|
|
3087
3144
|
isRemoteRegistration: Boolean(defaultParams?.isRemoteRegistration),
|
|
3145
|
+
isReplenish: false,
|
|
3146
|
+
isWithdrawn: Boolean(defaultParams?.isWithdrawn ?? false),
|
|
3088
3147
|
});
|
|
3089
3148
|
const calcParams = getDepositCalculatorParams(userInputParams, calcSource, paramsViewSettings);
|
|
3090
|
-
const { defaultMonth, rate, income, finalSum } = calcParams;
|
|
3149
|
+
const { defaultMonth, rate, income, finalSum, type = '' } = calcParams;
|
|
3091
3150
|
const { onChange: setMonthsValue } = field('monthsValue');
|
|
3092
3151
|
const { onChange: setMoneyValue } = field('moneyValue');
|
|
3093
3152
|
useEffect(() => {
|
|
@@ -3097,17 +3156,19 @@
|
|
|
3097
3156
|
setMoneyValue &&
|
|
3098
3157
|
setMoneyValue(clamp(userInputParams.moneyValue, calcParams.minSum, calcParams.maxSum));
|
|
3099
3158
|
}, [calcParams.minSum, calcParams.maxSum]);
|
|
3159
|
+
const handleDefaultParamsCals = () => setDefaultParamsCalc({
|
|
3160
|
+
field,
|
|
3161
|
+
defParams: defParams,
|
|
3162
|
+
calcParams,
|
|
3163
|
+
monthsValue: 'minMonths',
|
|
3164
|
+
map: MAP,
|
|
3165
|
+
});
|
|
3100
3166
|
useEffect(() => {
|
|
3101
3167
|
if (!isDefaultParams(defaultParams) && defParams) {
|
|
3102
|
-
|
|
3103
|
-
field,
|
|
3104
|
-
defParams: defParams,
|
|
3105
|
-
calcParams,
|
|
3106
|
-
monthsValue: 'minMonths',
|
|
3107
|
-
map: MAP,
|
|
3108
|
-
});
|
|
3168
|
+
handleDefaultParamsCals();
|
|
3109
3169
|
}
|
|
3110
3170
|
}, [calcSource, defaultParams]);
|
|
3171
|
+
const isMaxRate = rate === defParams?.rate;
|
|
3111
3172
|
return (jsx(CalculatorLayout, { className: className, title: title, ...rest, children: jsxs("section", { className: style(CalculatorStyle.wrapper, className), children: [jsxs("div", { className: CalculatorStyle.input, children: [renderWantedSumInput({
|
|
3112
3173
|
title: 'Сумма, ₽',
|
|
3113
3174
|
min: calcParams.minSum,
|
|
@@ -3123,21 +3184,20 @@
|
|
|
3123
3184
|
value: calcParams.monthsValue,
|
|
3124
3185
|
}), renderDepositParamsForm({ ...calcParams, ...paramsViewSettings }, field)] }), renderRate({
|
|
3125
3186
|
rate,
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
: null] }));
|
|
3187
|
+
children: renderMaxRateButton(handleDefaultParamsCals, isMaxRate),
|
|
3188
|
+
}), renderDepositResult({
|
|
3189
|
+
income,
|
|
3190
|
+
finalSum,
|
|
3191
|
+
buttons: [...buttons, getTariffButton(calcSource?.buttons, type)],
|
|
3192
|
+
footnotes: [footnote],
|
|
3193
|
+
})] }) }));
|
|
3194
|
+
});
|
|
3195
|
+
const getTariffButton = (buttons = [], btnType = '') => {
|
|
3196
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3197
|
+
const { type, ...button } = buttons.find((_) => _.type === btnType) ?? {};
|
|
3198
|
+
return button;
|
|
3199
|
+
};
|
|
3200
|
+
const renderMaxRateButton = (handleDefaultParamsCals, isMaxRate = false) => isMaxRate ? null : (jsx(Button, { type: "button", version: "secondary", onClick: handleDefaultParamsCals, children: "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0443\u044E \u0441\u0442\u0430\u0432\u043A\u0443" }));
|
|
3141
3201
|
|
|
3142
3202
|
const checkRefinancingSourceBookRowCommonParams = (props) => checkRowParam({
|
|
3143
3203
|
...props,
|
|
@@ -6430,7 +6490,7 @@
|
|
|
6430
6490
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
6431
6491
|
});
|
|
6432
6492
|
|
|
6433
|
-
const packageVersion = "0.14.
|
|
6493
|
+
const packageVersion = "0.14.430";
|
|
6434
6494
|
|
|
6435
6495
|
exports.Blocks = Blocks;
|
|
6436
6496
|
exports.ContentPage = ContentPage;
|