@redneckz/wildless-cms-uni-blocks 0.13.7 → 0.13.9
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/bin/migration-scripts/0.13.9.js +59 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +60 -57
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/UnknownRate.d.ts +1 -0
- package/bundle/components/Calculator/renderRate.d.ts +2 -1
- package/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
- package/bundle/components/Carousel/CarouselContent.d.ts +2 -2
- package/bundle/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js +9 -9
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/RefinancingCalculatorForm.js +6 -3
- package/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/UnknownRate.d.ts +1 -0
- package/dist/components/Calculator/UnknownRate.js +1 -1
- package/dist/components/Calculator/UnknownRate.js.map +1 -1
- package/dist/components/Calculator/constants.js +2 -2
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/Calculator/renderRate.d.ts +2 -1
- package/dist/components/Calculator/renderRate.js +5 -5
- package/dist/components/Calculator/renderRate.js.map +1 -1
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useCreditCalculatorParams.js +1 -4
- package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useRefinancingCalculatorParams.js +4 -11
- package/dist/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
- package/dist/components/Carousel/CarouselContent.d.ts +2 -2
- package/dist/components/Carousel/renderCarouselCards.js +1 -0
- package/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/dist/components/DepositFiltration/DepositFiltration.js +14 -8
- package/dist/components/DepositFiltration/DepositFiltration.js.map +1 -1
- package/dist/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
- package/dist/ui-kit/InputRange/renderRangeWithTicks.js +2 -1
- package/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js +9 -9
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/RefinancingCalculatorForm.js +6 -3
- package/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/UnknownRate.d.ts +1 -0
- package/lib/components/Calculator/UnknownRate.js +1 -1
- package/lib/components/Calculator/UnknownRate.js.map +1 -1
- package/lib/components/Calculator/constants.js +2 -2
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/Calculator/renderRate.d.ts +2 -1
- package/lib/components/Calculator/renderRate.js +5 -5
- package/lib/components/Calculator/renderRate.js.map +1 -1
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useCreditCalculatorParams.js +1 -4
- package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useRefinancingCalculatorParams.js +4 -11
- package/lib/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
- package/lib/components/Carousel/CarouselContent.d.ts +2 -2
- package/lib/components/Carousel/renderCarouselCards.js +1 -0
- package/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/lib/components/DepositFiltration/DepositFiltration.js +14 -8
- package/lib/components/DepositFiltration/DepositFiltration.js.map +1 -1
- package/lib/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
- package/lib/ui-kit/InputRange/renderRangeWithTicks.js +2 -1
- package/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +46 -49
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/UnknownRate.d.ts +1 -0
- package/mobile/bundle/components/Calculator/renderRate.d.ts +2 -1
- package/mobile/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
- package/mobile/bundle/components/Carousel/CarouselContent.d.ts +2 -2
- package/mobile/bundle/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +9 -9
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js +6 -3
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/UnknownRate.d.ts +1 -0
- package/mobile/dist/components/Calculator/UnknownRate.js +1 -1
- package/mobile/dist/components/Calculator/UnknownRate.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.js +2 -2
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/Calculator/renderRate.d.ts +2 -1
- package/mobile/dist/components/Calculator/renderRate.js +5 -5
- package/mobile/dist/components/Calculator/renderRate.js.map +1 -1
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +1 -4
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useRefinancingCalculatorParams.js +4 -11
- package/mobile/dist/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Carousel/CarouselContent.d.ts +2 -2
- package/mobile/dist/components/Carousel/renderCarouselCards.js +1 -0
- package/mobile/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/dist/components/DepositFiltration/DepositFiltration.js +14 -8
- package/mobile/dist/components/DepositFiltration/DepositFiltration.js.map +1 -1
- package/mobile/dist/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
- package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js +2 -1
- package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +9 -9
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js +6 -3
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/UnknownRate.d.ts +1 -0
- package/mobile/lib/components/Calculator/UnknownRate.js +1 -1
- package/mobile/lib/components/Calculator/UnknownRate.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.js +2 -2
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/Calculator/renderRate.d.ts +2 -1
- package/mobile/lib/components/Calculator/renderRate.js +5 -5
- package/mobile/lib/components/Calculator/renderRate.js.map +1 -1
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +1 -4
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useRefinancingCalculatorParams.js +4 -11
- package/mobile/lib/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Carousel/CarouselContent.d.ts +2 -2
- package/mobile/lib/components/Carousel/renderCarouselCards.js +1 -0
- package/mobile/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/lib/components/DepositFiltration/DepositFiltration.js +14 -8
- package/mobile/lib/components/DepositFiltration/DepositFiltration.js.map +1 -1
- package/mobile/lib/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
- package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js +2 -1
- package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
- package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +11 -11
- package/mobile/src/components/Calculator/RefinancingCalculatorForm.tsx +6 -9
- package/mobile/src/components/Calculator/UnknownRate.tsx +24 -14
- package/mobile/src/components/Calculator/constants.ts +2 -2
- package/mobile/src/components/Calculator/renderRate.tsx +13 -6
- package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +2 -2
- package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +1 -5
- package/mobile/src/components/Calculator/useRefinancingCalculatorParams.ts +5 -23
- package/mobile/src/components/Carousel/CarouselContent.ts +2 -2
- package/mobile/src/components/Carousel/renderCarouselCards.tsx +1 -0
- package/mobile/src/components/DepositFiltration/DepositFiltration.example.json +11 -1
- package/mobile/src/components/DepositFiltration/DepositFiltration.tsx +18 -12
- package/mobile/src/components/DepositFiltration/DepositFiltrationContent.ts +1 -2
- package/mobile/src/ui-kit/InputRange/renderRangeWithTicks.tsx +2 -1
- package/package.json +1 -1
- package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +11 -11
- package/src/components/Calculator/RefinancingCalculatorForm.tsx +6 -9
- package/src/components/Calculator/UnknownRate.tsx +24 -14
- package/src/components/Calculator/constants.ts +2 -2
- package/src/components/Calculator/renderRate.tsx +13 -6
- package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +2 -2
- package/src/components/Calculator/useCreditCalculatorParams.ts +1 -5
- package/src/components/Calculator/useRefinancingCalculatorParams.ts +5 -23
- package/src/components/Carousel/CarouselContent.ts +2 -2
- package/src/components/Carousel/renderCarouselCards.tsx +1 -0
- package/src/components/DepositFiltration/DepositFiltration.example.json +11 -1
- package/src/components/DepositFiltration/DepositFiltration.fixture.tsx +21 -8
- package/src/components/DepositFiltration/DepositFiltration.tsx +18 -12
- package/src/components/DepositFiltration/DepositFiltrationContent.ts +1 -2
- package/src/ui-kit/InputRange/renderRangeWithTicks.tsx +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DepositFiltration.js","sourceRoot":"","sources":["../../../src/components/DepositFiltration/DepositFiltration.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK1C,MAAM,
|
|
1
|
+
{"version":3,"file":"DepositFiltration.js","sourceRoot":"","sources":["../../../src/components/DepositFiltration/DepositFiltration.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseFiltrationInnerContent, NumberRange,
|
|
1
|
+
import type { BaseFiltrationInnerContent, NumberRange, StringArray } from '../../ui-kit/BaseFiltration/BaseFiltrationContent';
|
|
2
2
|
export declare type DepositFiltrationSchema = {
|
|
3
3
|
/** @title Валюта */
|
|
4
4
|
currency?: StringArray;
|
|
@@ -7,7 +7,7 @@ export declare type DepositFiltrationSchema = {
|
|
|
7
7
|
/** @title Выплата процентов */
|
|
8
8
|
percents?: StringArray;
|
|
9
9
|
/** @hidden */
|
|
10
|
-
sum?:
|
|
10
|
+
sum?: NumberRange;
|
|
11
11
|
/** @hidden */
|
|
12
12
|
period?: NumberRange;
|
|
13
13
|
};
|
|
@@ -2,8 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
2
2
|
import { parseDecimal } from './parseDecimal.js';
|
|
3
3
|
export function renderRangeWithTicks({ list = [], min, max, step, value = list[0] || min, disabled, onChange, }) {
|
|
4
4
|
const rangeValue = list.length ? list.indexOf(value) : value;
|
|
5
|
+
const rangeValueShift = rangeValue > min ? rangeValue - min : 0;
|
|
5
6
|
const inputStyle = {
|
|
6
|
-
backgroundSize: `${((
|
|
7
|
+
backgroundSize: `${((rangeValueShift * 100) / (max - min)).toFixed(2)}% 100%`,
|
|
7
8
|
};
|
|
8
9
|
return (_jsxs("div", { children: [list.length ? (_jsx("div", { className: "absolute w-full flex justify-between -bottom-[3px] px-m", children: list.map((_, i) => (_jsx("div", { className: `w-2 h-2 rounded-full ${rangeValue <= i || disabled ? 'bg-gray' : 'bg-primary-main'}` }, String(i)))) })) : null, _jsx("div", { className: "absolute inset-x-0 -bottom-1 px-m leading-[18px]", children: _jsx("input", { className: "box-border w-full m-0 cursor-pointer slider relative z-10", style: inputStyle, type: "range", min: min, max: max, step: step, value: rangeValue, disabled: disabled, onInput: ((e) => {
|
|
9
10
|
const rawValue = parseDecimal(e.target?.value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderRangeWithTicks.js","sourceRoot":"","sources":["../../../src/ui-kit/InputRange/renderRangeWithTicks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAY9C,MAAM,UAAU,oBAAoB,CAAC,EACnC,IAAI,GAAG,EAAE,EACT,GAAG,EACH,GAAG,EACH,IAAI,EACJ,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,EACtB,QAAQ,EACR,QAAQ,GACY;IACpB,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC7D,MAAM,UAAU,GAAG
|
|
1
|
+
{"version":3,"file":"renderRangeWithTicks.js","sourceRoot":"","sources":["../../../src/ui-kit/InputRange/renderRangeWithTicks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAY9C,MAAM,UAAU,oBAAoB,CAAC,EACnC,IAAI,GAAG,EAAE,EACT,GAAG,EACH,GAAG,EACH,IAAI,EACJ,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,EACtB,QAAQ,EACR,QAAQ,GACY;IACpB,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC7D,MAAM,eAAe,GAAG,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAChE,MAAM,UAAU,GAAG;QACjB,cAAc,EAAE,GAAG,CAAC,CAAC,eAAe,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ;KAC9E,CAAC;IAEF,OAAO,CACL,0BACG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CACb,cAAK,SAAS,EAAC,yDAAyD,YACrE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAClB,cAEE,SAAS,EAAE,wBACT,UAAU,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iBAC5C,EAAE,IAHG,MAAM,CAAC,CAAC,CAAC,CAId,CACH,CAAC,GACE,CACP,CAAC,CAAC,CAAC,IAAI,EACR,cAAK,SAAS,EAAC,kDAAkD,YAC/D,gBACE,SAAS,EAAC,2DAA2D,EACrE,KAAK,EAAE,UAAU,EACjB,IAAI,EAAC,OAAO,EACZ,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EACL,CAAC,CAAC,CAAkC,EAAE,EAAE;wBACtC,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;wBAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;wBACzD,QAAQ,IAAI,QAAQ,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC;oBACtC,CAAC,CAAQ,GAEX,GACE,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { FormFieldRegisterer, useForm } from '../../hooks/useForm';
|
|
2
3
|
import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
4
|
+
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
5
|
+
import { style } from '../../utils/style';
|
|
3
6
|
import type { BusinessDepositCalculatorProps } from './CalculatorContent';
|
|
4
|
-
import {
|
|
5
|
-
import { FormFieldRegisterer, useForm } from '../../hooks/useForm';
|
|
7
|
+
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
6
8
|
import { BUSINESS_DEFAULT_DAYS, BUSINESS_DEFAULT_SUM } from './constants';
|
|
9
|
+
import { renderDaysInput } from './renderDaysInput';
|
|
10
|
+
import { renderFootnote } from './renderFootnote';
|
|
11
|
+
import { renderInterestPayment } from './renderInterestPayment';
|
|
12
|
+
import { renderRate } from './renderRate';
|
|
13
|
+
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
7
14
|
import {
|
|
8
15
|
BusinessDepositCalculatorParams,
|
|
9
16
|
BusinessDepositCalculatorUserInputParams,
|
|
10
17
|
useBusinessDepositCalculatorParams,
|
|
11
18
|
} from './useBusinessDepositCalculatorParams';
|
|
12
|
-
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
13
|
-
import { renderDaysInput } from './renderDaysInput';
|
|
14
|
-
import { renderInterestPayment } from './renderInterestPayment';
|
|
15
|
-
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
16
|
-
import { renderRate } from './renderRate';
|
|
17
|
-
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
18
|
-
import { style } from '../../utils/style';
|
|
19
19
|
|
|
20
20
|
export interface BusinessDepositCalculatorProp extends BusinessDepositCalculatorProps {
|
|
21
21
|
className?: string;
|
|
@@ -33,7 +33,7 @@ export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, sourceBookDir);
|
|
36
|
-
const { income, finalSum, rate,
|
|
36
|
+
const { income, finalSum, rate, isUnavailableByTerm, depositeName } = calculatorParams;
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
39
|
<section className={style('flex flex-col justify-between sm:flex-row gap-m', className)}>
|
|
@@ -65,7 +65,7 @@ export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
|
|
|
65
65
|
rate,
|
|
66
66
|
depositeName,
|
|
67
67
|
isShowDepositeName,
|
|
68
|
-
|
|
68
|
+
isUnavailableByTerm,
|
|
69
69
|
})}
|
|
70
70
|
<div className="flex flex-col gap-2xl sm:w-96">
|
|
71
71
|
{renderDepositResults(finalSum, income)}
|
|
@@ -14,15 +14,15 @@ import {
|
|
|
14
14
|
REFINANCING_DEFAULT_SUM,
|
|
15
15
|
REFINANCING_OLD_DEFAULT_SUM,
|
|
16
16
|
} from './constants';
|
|
17
|
-
import { Rate } from './Rate';
|
|
18
17
|
import { renderFootnote } from './renderFootnote';
|
|
19
18
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
19
|
+
import { renderPaymentType } from './renderPaymentType';
|
|
20
|
+
import { renderRate } from './renderRate';
|
|
20
21
|
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
21
22
|
import {
|
|
22
23
|
RefinancingCalculatorParams,
|
|
23
24
|
useRefinancingCalculatorParams,
|
|
24
25
|
} from './useRefinancingCalculatorParams';
|
|
25
|
-
import { renderPaymentType } from './renderPaymentType';
|
|
26
26
|
|
|
27
27
|
export interface RefinancingCalculatorProp extends RefinancingCalculatorProps {
|
|
28
28
|
className?: string;
|
|
@@ -86,13 +86,10 @@ export const RefinancingCalculatorForm = JSX<RefinancingCalculatorProp>(
|
|
|
86
86
|
})
|
|
87
87
|
: null}
|
|
88
88
|
</div>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
rateBlockClassName="tracking-[-25px]"
|
|
94
|
-
unit="%"
|
|
95
|
-
/>
|
|
89
|
+
{renderRate({
|
|
90
|
+
rate: calculatorParams.rate,
|
|
91
|
+
fractionDigits: 1,
|
|
92
|
+
})}
|
|
96
93
|
<div className="flex flex-col gap-2xl sm:w-96">
|
|
97
94
|
<CalculatorValueBlock
|
|
98
95
|
title={'Ежемесячный платеж'}
|
|
@@ -5,20 +5,30 @@ import { Text } from '../../ui-kit/Text/Text';
|
|
|
5
5
|
|
|
6
6
|
export interface UnknownRateProps {
|
|
7
7
|
title?: string;
|
|
8
|
+
isUnavailableByTerm?: boolean;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
export const UnknownRate = JSX<UnknownRateProps>(
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<
|
|
11
|
+
export const UnknownRate = JSX<UnknownRateProps>(
|
|
12
|
+
({ title = 'Ставка', isUnavailableByTerm = false }) => (
|
|
13
|
+
<div>
|
|
14
|
+
<Text size="text-l" font="font-light" color="text-secondary-text">
|
|
15
|
+
{title}
|
|
16
|
+
</Text>
|
|
17
|
+
<div className="mt-2xs pt-2xs pl-lg pb-xs">
|
|
18
|
+
<Icon name="PercentIcon" width="90" height="85" />
|
|
19
|
+
</div>
|
|
20
|
+
<div className="w-64 mt-m">
|
|
21
|
+
{isUnavailableByTerm ? (
|
|
22
|
+
<Paragraph size="text-xl" font="font-light" color="text-primary-text">
|
|
23
|
+
Процентная ставка для срока <strong>1-30 дней</strong> устанавливается при обращении в
|
|
24
|
+
Банк
|
|
25
|
+
</Paragraph>
|
|
26
|
+
) : (
|
|
27
|
+
<Paragraph size="text-xl" font="font-light" color="text-primary-text">
|
|
28
|
+
Выберите другую сумму или срок
|
|
29
|
+
</Paragraph>
|
|
30
|
+
)}
|
|
31
|
+
</div>
|
|
17
32
|
</div>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Процентная ставка для срока <strong>1-30 дней</strong> устанавливается при обращении в Банк
|
|
21
|
-
</Paragraph>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
));
|
|
33
|
+
),
|
|
34
|
+
);
|
|
@@ -36,7 +36,7 @@ export const DEFAULT_CREDIT_CALCULATOR_PARAMS: CreditCalculatorSourceBookRatePar
|
|
|
36
36
|
maxSum: DEFAULT_MAX_SUM,
|
|
37
37
|
minMonths: DEFAULT_MIN_MONTHS,
|
|
38
38
|
maxMonths: DEFAULT_MAX_MONTHS,
|
|
39
|
-
rate:
|
|
39
|
+
rate: 0,
|
|
40
40
|
isSalaryClient: false,
|
|
41
41
|
isPensionClient: false,
|
|
42
42
|
isStateEmployee: false,
|
|
@@ -52,7 +52,7 @@ export const DEFAULT_REFINANCING_CALCULATOR_PARAMS: RefinancingCalculatorSourceB
|
|
|
52
52
|
maxSumExtra: REFINANCING_EXTRA_MAX_SUM,
|
|
53
53
|
minMonths: DEFAULT_REFINANCING_MIN_MONTHS,
|
|
54
54
|
maxMonths: DEFAULT_MAX_MONTHS,
|
|
55
|
-
rate:
|
|
55
|
+
rate: 0,
|
|
56
56
|
isExtraMoney: false,
|
|
57
57
|
isSalaryClient: false,
|
|
58
58
|
isInsurance: true,
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
import { UnknownRate } from './UnknownRate';
|
|
2
|
-
import { Rate } from './Rate';
|
|
3
1
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
2
|
+
import { Rate } from './Rate';
|
|
3
|
+
import { UnknownRate } from './UnknownRate';
|
|
4
4
|
|
|
5
5
|
interface RenderRateProps {
|
|
6
6
|
rate: number;
|
|
7
7
|
depositeName?: string;
|
|
8
|
-
|
|
8
|
+
isUnavailableByTerm?: boolean;
|
|
9
9
|
isShowDepositeName?: boolean;
|
|
10
|
+
fractionDigits?: number;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
const renderDesktopRate = ({
|
|
13
|
+
const renderDesktopRate = ({
|
|
14
|
+
rate,
|
|
15
|
+
depositeName,
|
|
16
|
+
fractionDigits,
|
|
17
|
+
isShowDepositeName,
|
|
18
|
+
}: RenderRateProps) => (
|
|
13
19
|
<Rate
|
|
14
20
|
rate={rate}
|
|
15
21
|
depositeName={depositeName}
|
|
22
|
+
fractionDigits={fractionDigits}
|
|
16
23
|
isShowDepositeName={isShowDepositeName}
|
|
17
24
|
rateBlockClassName="tracking-[-25px]"
|
|
18
25
|
unit="%"
|
|
@@ -24,8 +31,8 @@ const renderMobileRate = ({ rate }: RenderRateProps) => (
|
|
|
24
31
|
);
|
|
25
32
|
|
|
26
33
|
export const renderRate = (props: RenderRateProps) => {
|
|
27
|
-
if (props.
|
|
28
|
-
return <UnknownRate />;
|
|
34
|
+
if (props.rate === 0) {
|
|
35
|
+
return <UnknownRate isUnavailableByTerm={props.isUnavailableByTerm} />;
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
return (
|
|
@@ -34,7 +34,7 @@ export interface BusinessDepositCalculatorParams
|
|
|
34
34
|
income?: number;
|
|
35
35
|
finalSum?: number;
|
|
36
36
|
isDisabledOperatingDeposit?: boolean;
|
|
37
|
-
|
|
37
|
+
isUnavailableByTerm?: boolean;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export type BusinessDepositCalculatorData = {
|
|
@@ -66,7 +66,7 @@ export const useBusinessDepositCalculatorParams = (
|
|
|
66
66
|
...DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS,
|
|
67
67
|
...userInputParams,
|
|
68
68
|
isDisabledOperatingDeposit,
|
|
69
|
-
|
|
69
|
+
isUnavailableByTerm: true,
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
const businessDepositCalculatorSourceBookParams =
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
import { clamp } from '../../utils/clamp';
|
|
3
2
|
import type { CreditCalculatorParamsViewSettings } from './CalculatorContent';
|
|
4
3
|
import { CREDIT_CALC_DEFAULT_DIR, DEFAULT_CREDIT_CALCULATOR_PARAMS } from './constants';
|
|
5
4
|
import { getCreditCalculatorLimitParams } from './getCreditCalculatorLimitParams';
|
|
@@ -51,7 +50,7 @@ export const useCreditCalculatorParams = (
|
|
|
51
50
|
sourceBookDir?: string,
|
|
52
51
|
paramsViewSettings?: CreditCalculatorParamsViewSettings,
|
|
53
52
|
): CreditCalculatorParams => {
|
|
54
|
-
|
|
53
|
+
const { moneyValue, monthsValue } = userInputParams;
|
|
55
54
|
const data = useCalculatorParams<CreditCalculatorData>(sourceBookDir || CREDIT_CALC_DEFAULT_DIR);
|
|
56
55
|
const rateRows = data?.rateRows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
|
|
57
56
|
const limitRows = data?.limitRows || [];
|
|
@@ -72,9 +71,6 @@ export const useCreditCalculatorParams = (
|
|
|
72
71
|
rateRows,
|
|
73
72
|
);
|
|
74
73
|
|
|
75
|
-
moneyValue = clamp(moneyValue, minSum, maxSum);
|
|
76
|
-
monthsValue = clamp(monthsValue, minMonths, maxMonths);
|
|
77
|
-
|
|
78
74
|
const creditCalculatorRateParams = getCreditCalculatorRateParams({
|
|
79
75
|
rateRows,
|
|
80
76
|
userInputParams,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
import { clamp } from '../../utils/clamp';
|
|
3
|
-
import { DEFAULT_REFINANCING_CALCULATOR_PARAMS, REFINANCING_CALC_DEFAULT_DIR } from './constants';
|
|
4
|
-
import { getLimitRangeByKeys } from './rangeHelpers';
|
|
5
|
-
import { useCalculatorParams } from './useCalculatorParams';
|
|
6
2
|
import { RefinancingCalculatorParamsViewSettings } from './CalculatorContent';
|
|
3
|
+
import { DEFAULT_REFINANCING_CALCULATOR_PARAMS, REFINANCING_CALC_DEFAULT_DIR } from './constants';
|
|
4
|
+
import { getMonthlyPayment } from './getMonthlyPayment';
|
|
7
5
|
import { getRefinancingCalculatorLimitParams } from './getRefinancingCalculatorLimitParams';
|
|
8
6
|
import { getRefinancingCalculatorRateParams } from './getRefinancingCalculatorRateParams';
|
|
9
|
-
import {
|
|
7
|
+
import { getLimitRangeByKeys } from './rangeHelpers';
|
|
8
|
+
import { useCalculatorParams } from './useCalculatorParams';
|
|
10
9
|
|
|
11
10
|
export interface CommonRefinancingParams {
|
|
12
11
|
isSalaryClient: boolean;
|
|
@@ -61,7 +60,7 @@ export const useRefinancingCalculatorParams = (
|
|
|
61
60
|
sourceBookDir?: string,
|
|
62
61
|
paramsViewSettings?: RefinancingCalculatorParamsViewSettings,
|
|
63
62
|
): RefinancingCalculatorParams => {
|
|
64
|
-
|
|
63
|
+
const { moneyValue, monthsValue, oldMonthlyPayment, moneyExtra } = userInputParams;
|
|
65
64
|
const data = useCalculatorParams<RefinancingCalculatorData>(
|
|
66
65
|
sourceBookDir || REFINANCING_CALC_DEFAULT_DIR,
|
|
67
66
|
);
|
|
@@ -79,29 +78,12 @@ export const useRefinancingCalculatorParams = (
|
|
|
79
78
|
rateRows,
|
|
80
79
|
);
|
|
81
80
|
|
|
82
|
-
const { minSumOld, maxSumOld } = getLimitRangeByKeys(
|
|
83
|
-
['minSumOld', 'maxSumOld'],
|
|
84
|
-
sourceBookLimitParams,
|
|
85
|
-
rateRows,
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
const { minSumExtra, maxSumExtra } = getLimitRangeByKeys(
|
|
89
|
-
['minSumExtra', 'maxSumExtra'],
|
|
90
|
-
sourceBookLimitParams,
|
|
91
|
-
rateRows,
|
|
92
|
-
);
|
|
93
|
-
|
|
94
81
|
const { minMonths, maxMonths } = getLimitRangeByKeys(
|
|
95
82
|
['minMonths', 'maxMonths'],
|
|
96
83
|
sourceBookLimitParams,
|
|
97
84
|
rateRows,
|
|
98
85
|
);
|
|
99
86
|
|
|
100
|
-
moneyValue = clamp(moneyValue, minSum, maxSum);
|
|
101
|
-
oldMonthlyPayment = clamp(oldMonthlyPayment, minSumOld, maxSumOld);
|
|
102
|
-
moneyExtra = clamp(moneyExtra, minSumExtra, maxSumExtra);
|
|
103
|
-
monthsValue = clamp(monthsValue, minMonths, maxMonths);
|
|
104
|
-
|
|
105
87
|
const refinancingCalculatorSourceBookRateParams = getRefinancingCalculatorRateParams({
|
|
106
88
|
rateRows,
|
|
107
89
|
userInputParams,
|
|
@@ -2,9 +2,9 @@ import type { UniBlockContent } from '../../model/JSXBlock';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @title Размер карточек
|
|
5
|
-
* @enumNames ["Нормальный", "Большой"]
|
|
5
|
+
* @enumNames ["Маленький", "Нормальный", "Большой"]
|
|
6
6
|
*/
|
|
7
|
-
export type CardSizeMode = 'normal' | 'big';
|
|
7
|
+
export type CardSizeMode = 'small' | 'normal' | 'big';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @title Карусель
|
|
@@ -30,7 +30,17 @@
|
|
|
30
30
|
},
|
|
31
31
|
"sum": {
|
|
32
32
|
"title": "Сумма",
|
|
33
|
-
"type": "
|
|
33
|
+
"type": "object",
|
|
34
|
+
"properties": {
|
|
35
|
+
"min": {
|
|
36
|
+
"title": "Минимум",
|
|
37
|
+
"type": "number"
|
|
38
|
+
},
|
|
39
|
+
"max": {
|
|
40
|
+
"title": "Максимум",
|
|
41
|
+
"type": "number"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
34
44
|
},
|
|
35
45
|
"period": {
|
|
36
46
|
"title": "Срок",
|
|
@@ -11,25 +11,28 @@ import type { DepositFiltrationContent } from './DepositFiltrationContent';
|
|
|
11
11
|
|
|
12
12
|
interface DepositFiltrationProps extends DepositFiltrationContent, UniBlockProps {}
|
|
13
13
|
|
|
14
|
+
const DEFAULT_MIN_MONTHS = 3;
|
|
15
|
+
const DEFAULT_MAX_MONTHS = 60;
|
|
16
|
+
|
|
17
|
+
const DEFAULT_MIN_SUM = 500;
|
|
18
|
+
const DEFAULT_MAX_SUM = 1000000000;
|
|
19
|
+
|
|
14
20
|
const initialFiltrationState = {
|
|
15
|
-
sum:
|
|
21
|
+
sum: {
|
|
22
|
+
min: 10000,
|
|
23
|
+
max: DEFAULT_MAX_SUM,
|
|
24
|
+
},
|
|
16
25
|
period: {
|
|
17
26
|
min: 3,
|
|
18
27
|
max: 36,
|
|
19
28
|
},
|
|
20
29
|
};
|
|
21
30
|
|
|
22
|
-
const DEFAULT_MIN_MONTHS = 3;
|
|
23
|
-
const DEFAULT_MAX_MONTHS = 36;
|
|
24
|
-
|
|
25
|
-
const DEFAULT_MIN_SUM = 500;
|
|
26
|
-
const DEFAULT_MAX_SUM = 1000000000;
|
|
27
|
-
|
|
28
31
|
export const DepositFiltration: JSXBlock<DepositFiltrationProps> = JSX<DepositFiltrationProps>(
|
|
29
32
|
({ className, filtrationSchema = {}, resetButton, sumInput, periodInput, ...rest }) => {
|
|
30
33
|
const [filtrationState, { field, reset }] = useForm(initialFiltrationState);
|
|
31
34
|
|
|
32
|
-
const
|
|
35
|
+
const maxPeriodValue = periodInput?.max || DEFAULT_MAX_MONTHS;
|
|
33
36
|
|
|
34
37
|
const Inputs = (
|
|
35
38
|
<div>
|
|
@@ -37,15 +40,18 @@ export const DepositFiltration: JSXBlock<DepositFiltrationProps> = JSX<DepositFi
|
|
|
37
40
|
label={sumInput?.title}
|
|
38
41
|
min={DEFAULT_MIN_SUM}
|
|
39
42
|
max={DEFAULT_MAX_SUM}
|
|
40
|
-
{...field('sum', {
|
|
43
|
+
{...field('sum', {
|
|
44
|
+
parse: (min) => ({ min: Number(min), max: DEFAULT_MAX_SUM }),
|
|
45
|
+
format: ({ min }) => String(min),
|
|
46
|
+
})}
|
|
41
47
|
/>
|
|
42
48
|
<InputRange
|
|
43
49
|
title={periodInput?.title}
|
|
44
|
-
items={['От 3 мес', 'До
|
|
50
|
+
items={['От 3 мес', 'До 5 лет']}
|
|
45
51
|
min={periodInput?.min || DEFAULT_MIN_MONTHS}
|
|
46
|
-
max={
|
|
52
|
+
max={maxPeriodValue}
|
|
47
53
|
{...field('period', {
|
|
48
|
-
parse: (min) => ({ min, max:
|
|
54
|
+
parse: (min) => ({ min, max: maxPeriodValue }),
|
|
49
55
|
format: ({ min }) => min,
|
|
50
56
|
})}
|
|
51
57
|
/>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
BaseFiltrationInnerContent,
|
|
3
3
|
NumberRange,
|
|
4
|
-
NumberValue,
|
|
5
4
|
StringArray,
|
|
6
5
|
} from '../../ui-kit/BaseFiltration/BaseFiltrationContent';
|
|
7
6
|
|
|
@@ -13,7 +12,7 @@ export type DepositFiltrationSchema = {
|
|
|
13
12
|
/** @title Выплата процентов */
|
|
14
13
|
percents?: StringArray;
|
|
15
14
|
/** @hidden */
|
|
16
|
-
sum?:
|
|
15
|
+
sum?: NumberRange;
|
|
17
16
|
/** @hidden */
|
|
18
17
|
period?: NumberRange;
|
|
19
18
|
};
|
|
@@ -20,8 +20,9 @@ export function renderRangeWithTicks({
|
|
|
20
20
|
onChange,
|
|
21
21
|
}: RangeWithTicksProps) {
|
|
22
22
|
const rangeValue = list.length ? list.indexOf(value) : value;
|
|
23
|
+
const rangeValueShift = rangeValue > min ? rangeValue - min : 0;
|
|
23
24
|
const inputStyle = {
|
|
24
|
-
backgroundSize: `${((
|
|
25
|
+
backgroundSize: `${((rangeValueShift * 100) / (max - min)).toFixed(2)}% 100%`,
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
return (
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { FormFieldRegisterer, useForm } from '../../hooks/useForm';
|
|
2
3
|
import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
4
|
+
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
5
|
+
import { style } from '../../utils/style';
|
|
3
6
|
import type { BusinessDepositCalculatorProps } from './CalculatorContent';
|
|
4
|
-
import {
|
|
5
|
-
import { FormFieldRegisterer, useForm } from '../../hooks/useForm';
|
|
7
|
+
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
6
8
|
import { BUSINESS_DEFAULT_DAYS, BUSINESS_DEFAULT_SUM } from './constants';
|
|
9
|
+
import { renderDaysInput } from './renderDaysInput';
|
|
10
|
+
import { renderFootnote } from './renderFootnote';
|
|
11
|
+
import { renderInterestPayment } from './renderInterestPayment';
|
|
12
|
+
import { renderRate } from './renderRate';
|
|
13
|
+
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
7
14
|
import {
|
|
8
15
|
BusinessDepositCalculatorParams,
|
|
9
16
|
BusinessDepositCalculatorUserInputParams,
|
|
10
17
|
useBusinessDepositCalculatorParams,
|
|
11
18
|
} from './useBusinessDepositCalculatorParams';
|
|
12
|
-
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
13
|
-
import { renderDaysInput } from './renderDaysInput';
|
|
14
|
-
import { renderInterestPayment } from './renderInterestPayment';
|
|
15
|
-
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
16
|
-
import { renderRate } from './renderRate';
|
|
17
|
-
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
18
|
-
import { style } from '../../utils/style';
|
|
19
19
|
|
|
20
20
|
export interface BusinessDepositCalculatorProp extends BusinessDepositCalculatorProps {
|
|
21
21
|
className?: string;
|
|
@@ -33,7 +33,7 @@ export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, sourceBookDir);
|
|
36
|
-
const { income, finalSum, rate,
|
|
36
|
+
const { income, finalSum, rate, isUnavailableByTerm, depositeName } = calculatorParams;
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
39
|
<section className={style('flex flex-col justify-between sm:flex-row gap-m', className)}>
|
|
@@ -65,7 +65,7 @@ export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
|
|
|
65
65
|
rate,
|
|
66
66
|
depositeName,
|
|
67
67
|
isShowDepositeName,
|
|
68
|
-
|
|
68
|
+
isUnavailableByTerm,
|
|
69
69
|
})}
|
|
70
70
|
<div className="flex flex-col gap-2xl sm:w-96">
|
|
71
71
|
{renderDepositResults(finalSum, income)}
|
|
@@ -14,15 +14,15 @@ import {
|
|
|
14
14
|
REFINANCING_DEFAULT_SUM,
|
|
15
15
|
REFINANCING_OLD_DEFAULT_SUM,
|
|
16
16
|
} from './constants';
|
|
17
|
-
import { Rate } from './Rate';
|
|
18
17
|
import { renderFootnote } from './renderFootnote';
|
|
19
18
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
19
|
+
import { renderPaymentType } from './renderPaymentType';
|
|
20
|
+
import { renderRate } from './renderRate';
|
|
20
21
|
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
21
22
|
import {
|
|
22
23
|
RefinancingCalculatorParams,
|
|
23
24
|
useRefinancingCalculatorParams,
|
|
24
25
|
} from './useRefinancingCalculatorParams';
|
|
25
|
-
import { renderPaymentType } from './renderPaymentType';
|
|
26
26
|
|
|
27
27
|
export interface RefinancingCalculatorProp extends RefinancingCalculatorProps {
|
|
28
28
|
className?: string;
|
|
@@ -86,13 +86,10 @@ export const RefinancingCalculatorForm = JSX<RefinancingCalculatorProp>(
|
|
|
86
86
|
})
|
|
87
87
|
: null}
|
|
88
88
|
</div>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
rateBlockClassName="tracking-[-25px]"
|
|
94
|
-
unit="%"
|
|
95
|
-
/>
|
|
89
|
+
{renderRate({
|
|
90
|
+
rate: calculatorParams.rate,
|
|
91
|
+
fractionDigits: 1,
|
|
92
|
+
})}
|
|
96
93
|
<div className="flex flex-col gap-2xl sm:w-96">
|
|
97
94
|
<CalculatorValueBlock
|
|
98
95
|
title={'Ежемесячный платеж'}
|
|
@@ -5,20 +5,30 @@ import { Text } from '../../ui-kit/Text/Text';
|
|
|
5
5
|
|
|
6
6
|
export interface UnknownRateProps {
|
|
7
7
|
title?: string;
|
|
8
|
+
isUnavailableByTerm?: boolean;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
export const UnknownRate = JSX<UnknownRateProps>(
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<
|
|
11
|
+
export const UnknownRate = JSX<UnknownRateProps>(
|
|
12
|
+
({ title = 'Ставка', isUnavailableByTerm = false }) => (
|
|
13
|
+
<div>
|
|
14
|
+
<Text size="text-l" font="font-light" color="text-secondary-text">
|
|
15
|
+
{title}
|
|
16
|
+
</Text>
|
|
17
|
+
<div className="mt-2xs pt-2xs pl-lg pb-xs">
|
|
18
|
+
<Icon name="PercentIcon" width="90" height="85" />
|
|
19
|
+
</div>
|
|
20
|
+
<div className="w-64 mt-m">
|
|
21
|
+
{isUnavailableByTerm ? (
|
|
22
|
+
<Paragraph size="text-xl" font="font-light" color="text-primary-text">
|
|
23
|
+
Процентная ставка для срока <strong>1-30 дней</strong> устанавливается при обращении в
|
|
24
|
+
Банк
|
|
25
|
+
</Paragraph>
|
|
26
|
+
) : (
|
|
27
|
+
<Paragraph size="text-xl" font="font-light" color="text-primary-text">
|
|
28
|
+
Выберите другую сумму или срок
|
|
29
|
+
</Paragraph>
|
|
30
|
+
)}
|
|
31
|
+
</div>
|
|
17
32
|
</div>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Процентная ставка для срока <strong>1-30 дней</strong> устанавливается при обращении в Банк
|
|
21
|
-
</Paragraph>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
));
|
|
33
|
+
),
|
|
34
|
+
);
|
|
@@ -36,7 +36,7 @@ export const DEFAULT_CREDIT_CALCULATOR_PARAMS: CreditCalculatorSourceBookRatePar
|
|
|
36
36
|
maxSum: DEFAULT_MAX_SUM,
|
|
37
37
|
minMonths: DEFAULT_MIN_MONTHS,
|
|
38
38
|
maxMonths: DEFAULT_MAX_MONTHS,
|
|
39
|
-
rate:
|
|
39
|
+
rate: 0,
|
|
40
40
|
isSalaryClient: false,
|
|
41
41
|
isPensionClient: false,
|
|
42
42
|
isStateEmployee: false,
|
|
@@ -52,7 +52,7 @@ export const DEFAULT_REFINANCING_CALCULATOR_PARAMS: RefinancingCalculatorSourceB
|
|
|
52
52
|
maxSumExtra: REFINANCING_EXTRA_MAX_SUM,
|
|
53
53
|
minMonths: DEFAULT_REFINANCING_MIN_MONTHS,
|
|
54
54
|
maxMonths: DEFAULT_MAX_MONTHS,
|
|
55
|
-
rate:
|
|
55
|
+
rate: 0,
|
|
56
56
|
isExtraMoney: false,
|
|
57
57
|
isSalaryClient: false,
|
|
58
58
|
isInsurance: true,
|