@redneckz/wildless-cms-uni-blocks 0.8.19 → 0.8.21
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 +87 -44
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
- package/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
- package/bundle/components/ApplicationForm/renderSubmitButton.d.ts +2 -2
- package/bundle/components/Calculator/CreditCalculatorForm.d.ts +0 -2
- package/bundle/components/Calculator/constants.d.ts +2 -2
- package/bundle/components/Calculator/renderInterestPayment.d.ts +9 -1
- package/bundle/components/Calculator/renderPaymentType.d.ts +12 -0
- package/bundle/components/Calculator/renderRegistrationType.d.ts +10 -0
- package/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
- package/bundle/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
- package/bundle/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
- package/dist/api/CorporateLeadAPI.js +1 -1
- package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
- package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
- package/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
- package/dist/components/ApplicationForm/renderBankOffices.js +1 -1
- package/dist/components/ApplicationForm/renderBankOffices.js.map +1 -1
- package/dist/components/ApplicationForm/renderSelects.js +2 -2
- package/dist/components/ApplicationForm/renderSelects.js.map +1 -1
- package/dist/components/ApplicationForm/renderSubmitButton.d.ts +2 -2
- package/dist/components/ApplicationForm/renderSubmitButton.js.map +1 -1
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js +7 -2
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/CreditCalculatorForm.d.ts +0 -2
- package/dist/components/Calculator/CreditCalculatorForm.js +7 -15
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.js +13 -1
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/constants.d.ts +2 -2
- package/dist/components/Calculator/constants.js +6 -7
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/Calculator/rangeHelpers.js +1 -1
- package/dist/components/Calculator/rangeHelpers.js.map +1 -1
- package/dist/components/Calculator/renderInterestPayment.d.ts +9 -1
- package/dist/components/Calculator/renderInterestPayment.js +2 -2
- package/dist/components/Calculator/renderInterestPayment.js.map +1 -1
- package/dist/components/Calculator/renderPaymentType.d.ts +12 -0
- package/dist/components/Calculator/renderPaymentType.js +22 -0
- package/dist/components/Calculator/renderPaymentType.js.map +1 -0
- package/dist/components/Calculator/renderRegistrationType.d.ts +10 -0
- package/dist/components/Calculator/renderRegistrationType.js +22 -0
- package/dist/components/Calculator/renderRegistrationType.js.map +1 -0
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
- package/dist/components/Calculator/useCreditCalculatorParams.js +2 -4
- package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/dist/components/Calculator/useDepositCalculatorParams.js +2 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/dist/components/Footer/Contacts.js +1 -1
- package/dist/components/Footer/Contacts.js.map +1 -1
- package/dist/components/Footer/Sitemap.js +7 -5
- package/dist/components/Footer/Sitemap.js.map +1 -1
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +5 -1
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/lib/api/CorporateLeadAPI.js +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
- package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
- package/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
- package/lib/components/ApplicationForm/renderBankOffices.js +1 -1
- package/lib/components/ApplicationForm/renderBankOffices.js.map +1 -1
- package/lib/components/ApplicationForm/renderSelects.js +2 -2
- package/lib/components/ApplicationForm/renderSelects.js.map +1 -1
- package/lib/components/ApplicationForm/renderSubmitButton.d.ts +2 -2
- package/lib/components/ApplicationForm/renderSubmitButton.js.map +1 -1
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js +7 -2
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/CreditCalculatorForm.d.ts +0 -2
- package/lib/components/Calculator/CreditCalculatorForm.js +6 -14
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.js +13 -1
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/constants.d.ts +2 -2
- package/lib/components/Calculator/constants.js +6 -7
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/Calculator/rangeHelpers.js +1 -1
- package/lib/components/Calculator/rangeHelpers.js.map +1 -1
- package/lib/components/Calculator/renderInterestPayment.d.ts +9 -1
- package/lib/components/Calculator/renderInterestPayment.js +2 -2
- package/lib/components/Calculator/renderInterestPayment.js.map +1 -1
- package/lib/components/Calculator/renderPaymentType.d.ts +12 -0
- package/lib/components/Calculator/renderPaymentType.js +19 -0
- package/lib/components/Calculator/renderPaymentType.js.map +1 -0
- package/lib/components/Calculator/renderRegistrationType.d.ts +10 -0
- package/lib/components/Calculator/renderRegistrationType.js +19 -0
- package/lib/components/Calculator/renderRegistrationType.js.map +1 -0
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
- package/lib/components/Calculator/useCreditCalculatorParams.js +2 -4
- package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/lib/components/Calculator/useDepositCalculatorParams.js +2 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/lib/components/Footer/Contacts.js +1 -1
- package/lib/components/Footer/Contacts.js.map +1 -1
- package/lib/components/Footer/Sitemap.js +7 -5
- package/lib/components/Footer/Sitemap.js.map +1 -1
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +5 -1
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +2 -2
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
- package/mobile/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
- package/mobile/bundle/components/ApplicationForm/renderSubmitButton.d.ts +2 -2
- package/mobile/bundle/components/Calculator/CreditCalculatorForm.d.ts +0 -2
- package/mobile/bundle/components/Calculator/constants.d.ts +2 -2
- package/mobile/bundle/components/Calculator/renderInterestPayment.d.ts +9 -1
- package/mobile/bundle/components/Calculator/renderPaymentType.d.ts +12 -0
- package/mobile/bundle/components/Calculator/renderRegistrationType.d.ts +10 -0
- package/mobile/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
- package/mobile/bundle/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
- package/mobile/bundle/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/mobile/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
- package/mobile/dist/api/CorporateLeadAPI.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
- package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
- package/mobile/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
- package/mobile/dist/components/ApplicationForm/renderBankOffices.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderBankOffices.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderSelects.js +2 -2
- package/mobile/dist/components/ApplicationForm/renderSelects.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderSubmitButton.d.ts +2 -2
- package/mobile/dist/components/ApplicationForm/renderSubmitButton.js.map +1 -1
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +7 -2
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/CreditCalculatorForm.d.ts +0 -2
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js +7 -15
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +13 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.d.ts +2 -2
- package/mobile/dist/components/Calculator/constants.js +6 -7
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/Calculator/rangeHelpers.js +1 -1
- package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -1
- package/mobile/dist/components/Calculator/renderInterestPayment.d.ts +9 -1
- package/mobile/dist/components/Calculator/renderInterestPayment.js +2 -2
- package/mobile/dist/components/Calculator/renderInterestPayment.js.map +1 -1
- package/mobile/dist/components/Calculator/renderPaymentType.d.ts +12 -0
- package/mobile/dist/components/Calculator/renderPaymentType.js +22 -0
- package/mobile/dist/components/Calculator/renderPaymentType.js.map +1 -0
- package/mobile/dist/components/Calculator/renderRegistrationType.d.ts +10 -0
- package/mobile/dist/components/Calculator/renderRegistrationType.js +22 -0
- package/mobile/dist/components/Calculator/renderRegistrationType.js.map +1 -0
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
- 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.d.ts +1 -4
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +2 -4
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +2 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Footer/Contacts.js +1 -1
- package/mobile/dist/components/Footer/Contacts.js.map +1 -1
- package/mobile/dist/components/Footer/Sitemap.js +7 -5
- package/mobile/dist/components/Footer/Sitemap.js.map +1 -1
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +5 -1
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/mobile/lib/api/CorporateLeadAPI.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
- package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
- package/mobile/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
- package/mobile/lib/components/ApplicationForm/renderBankOffices.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderBankOffices.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderSelects.js +2 -2
- package/mobile/lib/components/ApplicationForm/renderSelects.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderSubmitButton.d.ts +2 -2
- package/mobile/lib/components/ApplicationForm/renderSubmitButton.js.map +1 -1
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +7 -2
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/CreditCalculatorForm.d.ts +0 -2
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js +6 -14
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +13 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.d.ts +2 -2
- package/mobile/lib/components/Calculator/constants.js +6 -7
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/Calculator/rangeHelpers.js +1 -1
- package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -1
- package/mobile/lib/components/Calculator/renderInterestPayment.d.ts +9 -1
- package/mobile/lib/components/Calculator/renderInterestPayment.js +2 -2
- package/mobile/lib/components/Calculator/renderInterestPayment.js.map +1 -1
- package/mobile/lib/components/Calculator/renderPaymentType.d.ts +12 -0
- package/mobile/lib/components/Calculator/renderPaymentType.js +19 -0
- package/mobile/lib/components/Calculator/renderPaymentType.js.map +1 -0
- package/mobile/lib/components/Calculator/renderRegistrationType.d.ts +10 -0
- package/mobile/lib/components/Calculator/renderRegistrationType.js +19 -0
- package/mobile/lib/components/Calculator/renderRegistrationType.js.map +1 -0
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
- 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.d.ts +1 -4
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +2 -4
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +2 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Footer/Contacts.js +1 -1
- package/mobile/lib/components/Footer/Contacts.js.map +1 -1
- package/mobile/lib/components/Footer/Sitemap.js +7 -5
- package/mobile/lib/components/Footer/Sitemap.js.map +1 -1
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +5 -1
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/mobile/src/api/CorporateLeadAPI.ts +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +2 -2
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +2 -2
- package/mobile/src/components/ApplicationForm/ApplicationFormsProps.ts +2 -2
- package/mobile/src/components/ApplicationForm/renderBankOffices.tsx +2 -2
- package/mobile/src/components/ApplicationForm/renderSelects.tsx +3 -3
- package/mobile/src/components/ApplicationForm/renderSubmitButton.tsx +2 -2
- package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +9 -8
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +8 -22
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +22 -8
- package/mobile/src/components/Calculator/constants.ts +6 -7
- package/mobile/src/components/Calculator/rangeHelpers.ts +1 -1
- package/mobile/src/components/Calculator/renderInterestPayment.tsx +21 -9
- package/mobile/src/components/Calculator/renderPaymentType.tsx +49 -0
- package/mobile/src/components/Calculator/renderRegistrationType.tsx +51 -0
- package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +4 -3
- package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +3 -8
- package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +4 -2
- package/mobile/src/components/Footer/Contacts.tsx +1 -1
- package/mobile/src/components/Footer/Sitemap.tsx +10 -5
- package/mobile/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +9 -2
- package/package.json +1 -1
- package/src/api/CorporateLeadAPI.ts +1 -1
- package/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +2 -2
- package/src/components/ApplicationForm/ApplicationFormContent.ts +2 -2
- package/src/components/ApplicationForm/ApplicationFormsProps.ts +2 -2
- package/src/components/ApplicationForm/renderBankOffices.tsx +2 -2
- package/src/components/ApplicationForm/renderSelects.tsx +3 -3
- package/src/components/ApplicationForm/renderSubmitButton.tsx +2 -2
- package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +9 -8
- package/src/components/Calculator/CreditCalculatorForm.tsx +8 -22
- package/src/components/Calculator/DepositCalculatorForm.tsx +22 -8
- package/src/components/Calculator/constants.ts +6 -7
- package/src/components/Calculator/rangeHelpers.ts +1 -1
- package/src/components/Calculator/renderInterestPayment.tsx +21 -9
- package/src/components/Calculator/renderPaymentType.tsx +49 -0
- package/src/components/Calculator/renderRegistrationType.tsx +51 -0
- package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +4 -3
- package/src/components/Calculator/useCreditCalculatorParams.ts +3 -8
- package/src/components/Calculator/useDepositCalculatorParams.ts +4 -2
- package/src/components/Footer/Contacts.tsx +1 -1
- package/src/components/Footer/Sitemap.tsx +10 -5
- package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.fixture.tsx +22 -5
- package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +9 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ListOrientation } from '../../model/ListOrientation';
|
|
1
2
|
import { RadioButtonGroup } from '../../ui-kit/RadioButtonGroup/RadioButtonGroup';
|
|
2
3
|
import { Text } from '../../ui-kit/Text/Text';
|
|
3
4
|
|
|
@@ -15,21 +16,32 @@ const depositTypeItems = [
|
|
|
15
16
|
},
|
|
16
17
|
];
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
isMonthlyInterestPayment: boolean
|
|
20
|
-
callback?: (value: boolean) => void
|
|
21
|
-
title?: string
|
|
22
|
-
|
|
19
|
+
interface InterestPaymentProps {
|
|
20
|
+
isMonthlyInterestPayment: boolean;
|
|
21
|
+
callback?: (value: boolean) => void;
|
|
22
|
+
title?: string;
|
|
23
|
+
orientation?: ListOrientation;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function renderInterestPayment({
|
|
27
|
+
isMonthlyInterestPayment,
|
|
28
|
+
callback,
|
|
29
|
+
title,
|
|
30
|
+
orientation = 'horizontal',
|
|
31
|
+
}: InterestPaymentProps) {
|
|
23
32
|
return (
|
|
24
33
|
<div>
|
|
25
34
|
{title ? (
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
<div className="mb-3">
|
|
36
|
+
<Text color="text-secondary-text" font="font-light">
|
|
37
|
+
{title}
|
|
38
|
+
</Text>
|
|
39
|
+
</div>
|
|
29
40
|
) : null}
|
|
30
41
|
|
|
31
|
-
<div
|
|
42
|
+
<div>
|
|
32
43
|
<RadioButtonGroup
|
|
44
|
+
orientation={orientation}
|
|
33
45
|
items={depositTypeItems}
|
|
34
46
|
checkedItem={isMonthlyInterestPayment ? EVERY_MONTH : AT_END_TERM}
|
|
35
47
|
onChange={(text: string) => callback && callback(text === EVERY_MONTH)}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ListOrientation } from '../../model/ListOrientation';
|
|
2
|
+
import { RadioButtonGroup } from '../../ui-kit/RadioButtonGroup/RadioButtonGroup';
|
|
3
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
4
|
+
|
|
5
|
+
export const ANNUITY = 'annuity';
|
|
6
|
+
export const DIFFERENTIAL = 'differential';
|
|
7
|
+
|
|
8
|
+
const paymentTypeItems = [
|
|
9
|
+
{
|
|
10
|
+
id: ANNUITY,
|
|
11
|
+
text: 'Аннуитетный',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: DIFFERENTIAL,
|
|
15
|
+
text: 'Дифференцированный',
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
interface PaymentTypeProps {
|
|
20
|
+
isAnnuity: boolean;
|
|
21
|
+
callback?: (value: boolean) => void;
|
|
22
|
+
title?: string;
|
|
23
|
+
orientation?: ListOrientation;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function renderPaymentType({
|
|
27
|
+
isAnnuity,
|
|
28
|
+
callback,
|
|
29
|
+
title,
|
|
30
|
+
orientation = 'horizontal',
|
|
31
|
+
}: PaymentTypeProps) {
|
|
32
|
+
return (
|
|
33
|
+
<div>
|
|
34
|
+
{title ? (
|
|
35
|
+
<div className="mb-3">
|
|
36
|
+
<Text color="text-secondary-text" font="font-light">
|
|
37
|
+
{title}
|
|
38
|
+
</Text>
|
|
39
|
+
</div>
|
|
40
|
+
) : null}
|
|
41
|
+
<RadioButtonGroup
|
|
42
|
+
orientation={orientation}
|
|
43
|
+
items={paymentTypeItems}
|
|
44
|
+
checkedItem={isAnnuity ? ANNUITY : DIFFERENTIAL}
|
|
45
|
+
onChange={(text: string) => callback && callback(text === ANNUITY)}
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ListOrientation } from '../../model/ListOrientation';
|
|
2
|
+
import { RadioButtonGroup } from '../../ui-kit/RadioButtonGroup/RadioButtonGroup';
|
|
3
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
4
|
+
|
|
5
|
+
const REMOTE_REGISTRATION = 'remote';
|
|
6
|
+
const OFFICE_REGISTRATION = 'office';
|
|
7
|
+
|
|
8
|
+
const registrationTypeItems = [
|
|
9
|
+
{
|
|
10
|
+
id: OFFICE_REGISTRATION,
|
|
11
|
+
text: 'Офис Банка',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: REMOTE_REGISTRATION,
|
|
15
|
+
text: 'Дистанционно',
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
interface RegistrationTypeProps {
|
|
20
|
+
isRemoteRegistration: boolean;
|
|
21
|
+
callback?: (value: boolean) => void;
|
|
22
|
+
title?: string;
|
|
23
|
+
orientation?: ListOrientation;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function renderRegistrationType({
|
|
27
|
+
isRemoteRegistration,
|
|
28
|
+
callback,
|
|
29
|
+
title,
|
|
30
|
+
orientation = 'horizontal',
|
|
31
|
+
}: RegistrationTypeProps) {
|
|
32
|
+
return (
|
|
33
|
+
<div>
|
|
34
|
+
{title ? (
|
|
35
|
+
<div className="mb-3">
|
|
36
|
+
<Text color="text-secondary-text" font="font-light">
|
|
37
|
+
{title}
|
|
38
|
+
</Text>
|
|
39
|
+
</div>
|
|
40
|
+
) : null}
|
|
41
|
+
<div>
|
|
42
|
+
<RadioButtonGroup
|
|
43
|
+
orientation={orientation}
|
|
44
|
+
items={registrationTypeItems}
|
|
45
|
+
checkedItem={isRemoteRegistration ? REMOTE_REGISTRATION : OFFICE_REGISTRATION}
|
|
46
|
+
onChange={(text: string) => callback && callback(text === REMOTE_REGISTRATION)}
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
} from './constants';
|
|
8
8
|
import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers';
|
|
9
9
|
import { useCalculatorParams } from './useCalculatorParams';
|
|
10
|
-
import type { CommonDepositParams } from './useDepositCalculatorParams';
|
|
11
10
|
|
|
12
|
-
export interface BusinessCommonDepositParams
|
|
11
|
+
export interface BusinessCommonDepositParams {
|
|
12
|
+
isMonthlyInterestPayment: boolean;
|
|
13
13
|
isReplenished: boolean;
|
|
14
14
|
isPartialWithdrawal: boolean;
|
|
15
15
|
isSmallBusiness: boolean;
|
|
@@ -34,6 +34,7 @@ export interface BusinessDepositCalculatorParams
|
|
|
34
34
|
income?: number;
|
|
35
35
|
finalSum?: number;
|
|
36
36
|
isDisabledOperatingDeposit?: boolean;
|
|
37
|
+
isShowUnknownRate?: boolean;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
export type BusinessDepositCalculatorData = {
|
|
@@ -65,7 +66,7 @@ export const useBusinessDepositCalculatorParams = (
|
|
|
65
66
|
...DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS,
|
|
66
67
|
...userInputParams,
|
|
67
68
|
isDisabledOperatingDeposit,
|
|
68
|
-
|
|
69
|
+
isShowUnknownRate: true,
|
|
69
70
|
};
|
|
70
71
|
}
|
|
71
72
|
const businessDepositCalculatorSourceBookParams =
|
|
@@ -13,9 +13,7 @@ export interface CreditCalculatorSourceBookParams extends CommonCreditParams {
|
|
|
13
13
|
maxSum: number;
|
|
14
14
|
minMonths: number;
|
|
15
15
|
maxMonths: number;
|
|
16
|
-
|
|
17
|
-
rateTopRange: number;
|
|
18
|
-
sumBorder: number;
|
|
16
|
+
rate: number;
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
export interface CreditCalculatorUserInputParams extends CommonCreditParams {
|
|
@@ -28,7 +26,6 @@ export interface CreditCalculatorParams
|
|
|
28
26
|
extends CreditCalculatorSourceBookParams,
|
|
29
27
|
CreditCalculatorUserInputParams {
|
|
30
28
|
monthlyPayment: number;
|
|
31
|
-
finalRate: number;
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
export type CreditCalculatorData = {
|
|
@@ -53,9 +50,8 @@ export const useCreditCalculatorParams = (
|
|
|
53
50
|
);
|
|
54
51
|
}) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
|
|
55
52
|
|
|
56
|
-
const {
|
|
57
|
-
const
|
|
58
|
-
const monthlyPayment = getMonthlyPayment(finalRate, userInputParams);
|
|
53
|
+
const { rate } = creditCalculatorSourceBookParams;
|
|
54
|
+
const monthlyPayment = getMonthlyPayment(rate, userInputParams);
|
|
59
55
|
const sourceBookRows = data?.rows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
|
|
60
56
|
|
|
61
57
|
return {
|
|
@@ -63,7 +59,6 @@ export const useCreditCalculatorParams = (
|
|
|
63
59
|
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
64
60
|
...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
|
|
65
61
|
...userInputParams,
|
|
66
|
-
finalRate,
|
|
67
62
|
monthlyPayment,
|
|
68
63
|
};
|
|
69
64
|
};
|
|
@@ -4,6 +4,7 @@ import { useCalculatorParams } from './useCalculatorParams';
|
|
|
4
4
|
|
|
5
5
|
export interface CommonDepositParams {
|
|
6
6
|
isMonthlyInterestPayment: boolean;
|
|
7
|
+
isRemoteRegistration: boolean;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export interface DepositCalculatorSourceBookParams extends CommonDepositParams {
|
|
@@ -34,7 +35,8 @@ export const useDepositCalculatorParams = (
|
|
|
34
35
|
userInputParams: DepositCalculatorUserInputParams,
|
|
35
36
|
sourceBookDir?: string,
|
|
36
37
|
): DepositCalculatorParams => {
|
|
37
|
-
const { isMonthlyInterestPayment, moneyValue, monthsValue } =
|
|
38
|
+
const { isMonthlyInterestPayment, isRemoteRegistration, moneyValue, monthsValue } =
|
|
39
|
+
userInputParams;
|
|
38
40
|
|
|
39
41
|
const data = useCalculatorParams<DepositCalculatorData>(
|
|
40
42
|
sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR,
|
|
@@ -44,12 +46,12 @@ export const useDepositCalculatorParams = (
|
|
|
44
46
|
data?.rows?.find(
|
|
45
47
|
(_) =>
|
|
46
48
|
isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
|
|
49
|
+
isRemoteRegistration === _.isRemoteRegistration &&
|
|
47
50
|
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
48
51
|
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _),
|
|
49
52
|
) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
|
|
50
53
|
|
|
51
54
|
const { rate } = depositCalculatorSourceBookParams;
|
|
52
|
-
|
|
53
55
|
const income = getDepositIncome(rate, userInputParams);
|
|
54
56
|
const finalSum = moneyValue + income;
|
|
55
57
|
const sourceBookRows = data?.rows || [DEFAULT_DEPOSIT_CALCULATOR_PARAMS];
|
|
@@ -15,7 +15,7 @@ export const Contacts = JSX<ContactsProps>(({ className = '', items, hasButton }
|
|
|
15
15
|
<Button
|
|
16
16
|
version="primary"
|
|
17
17
|
className="mb-6 w-full"
|
|
18
|
-
href="/"
|
|
18
|
+
href="https://www.rshb.ru/feedback/question/"
|
|
19
19
|
target="_blank"
|
|
20
20
|
ariaLabel="Обратная связь"
|
|
21
21
|
text="Обратная связь"
|
|
@@ -5,6 +5,7 @@ import type { LinkProps } from '../../model/LinkProps';
|
|
|
5
5
|
import { projectSettings } from '../../ProjectSettings';
|
|
6
6
|
import type { SitemapDataProps, TopMenuItem } from '../../services/sitemap/SitemapProps';
|
|
7
7
|
import { useSWRResource } from '../../services/sitemap/useSWRResource';
|
|
8
|
+
import { joinPath } from '../../utils/url';
|
|
8
9
|
|
|
9
10
|
export interface SitemapProps {
|
|
10
11
|
className?: string;
|
|
@@ -12,7 +13,7 @@ export interface SitemapProps {
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export const Sitemap = JSX<SitemapProps>(({ className = '', fallback }) => {
|
|
15
|
-
const link = useLink();
|
|
16
|
+
const link = useLink(true);
|
|
16
17
|
const sitemap = useSWRResource<SitemapDataProps>(projectSettings.SITEMAP || 'sitemap', fallback);
|
|
17
18
|
|
|
18
19
|
return (
|
|
@@ -36,24 +37,28 @@ const renderColumn = (menuItem: TopMenuItem & { onClick: () => void }, index: nu
|
|
|
36
37
|
{text || `Раздел ${index}`}
|
|
37
38
|
</a>
|
|
38
39
|
{items?.map((_, i) => (
|
|
39
|
-
<ColumnItem key={String(i)} {..._} index={i} />
|
|
40
|
+
<ColumnItem key={String(i)} {..._} basePath={href} index={i} />
|
|
40
41
|
))}
|
|
41
42
|
</div>
|
|
42
43
|
);
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
interface ColumnItemProps extends LinkProps {
|
|
47
|
+
basePath?: string;
|
|
46
48
|
index?: number;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
const ColumnItem = JSX<ColumnItemProps>(({ text, index, ...rest }) => {
|
|
50
|
-
const
|
|
51
|
+
const ColumnItem = JSX<ColumnItemProps>(({ text, index, basePath, ...rest }) => {
|
|
52
|
+
const isAnotherPortal =
|
|
53
|
+
projectSettings.BASE_PATH && basePath ? !projectSettings.BASE_PATH.startsWith(basePath) : false;
|
|
54
|
+
|
|
55
|
+
const link = useLink(isAnotherPortal);
|
|
51
56
|
const { href, target, onClick } = link(rest);
|
|
52
57
|
|
|
53
58
|
return (
|
|
54
59
|
<a
|
|
55
60
|
className="block text-l-light text-secondary-text hover:text-primary-main no-underline"
|
|
56
|
-
href={href}
|
|
61
|
+
href={isAnotherPortal ? joinPath(basePath, href) : href}
|
|
57
62
|
target={target || '_self'}
|
|
58
63
|
onClick={onClick}
|
|
59
64
|
>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { ListOrientation } from '../../model/ListOrientation';
|
|
2
3
|
import { Checkbox } from '../Checkbox/Checkbox';
|
|
3
4
|
|
|
4
5
|
export interface RadioButtonItem {
|
|
@@ -10,11 +11,17 @@ interface RadioButtonGroupProps {
|
|
|
10
11
|
items?: RadioButtonItem[];
|
|
11
12
|
checkedItem?: string;
|
|
12
13
|
onChange?: (id: string) => void;
|
|
14
|
+
orientation?: ListOrientation;
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
const orientationStyleMap: Record<ListOrientation, string> = {
|
|
18
|
+
horizontal: 'gap-10',
|
|
19
|
+
vertical: 'flex-col gap-3',
|
|
20
|
+
};
|
|
21
|
+
|
|
15
22
|
export const RadioButtonGroup = JSX<RadioButtonGroupProps>(
|
|
16
|
-
({ items, checkedItem, onChange: onChangeCheckedItem }) => (
|
|
17
|
-
<div className=
|
|
23
|
+
({ items, checkedItem, onChange: onChangeCheckedItem, orientation = 'horizontal' }) => (
|
|
24
|
+
<div className={`flex ${orientationStyleMap[orientation]}`}>
|
|
18
25
|
{items?.map(({ id, text }) => (
|
|
19
26
|
<Checkbox
|
|
20
27
|
key={String(id)}
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ export interface DaDataResult {
|
|
|
15
15
|
export function CorporateLeadAPI() {
|
|
16
16
|
async function send(body: Record<string, string>) {
|
|
17
17
|
try {
|
|
18
|
-
const response = await fetch('/api/v1/
|
|
18
|
+
const response = await fetch('/api/v1/sendcorporatelead', {
|
|
19
19
|
method: 'POST',
|
|
20
20
|
headers: { 'Content-Type': 'application/json' },
|
|
21
21
|
mode: 'cors',
|
|
@@ -6,11 +6,11 @@ import { Input } from '../../ui-kit/Input/Input';
|
|
|
6
6
|
import { useGetRegions } from '../SafeDepositRental/useGetRegions';
|
|
7
7
|
import type { ApplicationFormsProps } from './ApplicationFormsProps';
|
|
8
8
|
import { Footnote } from './Footnote';
|
|
9
|
+
import { WrapperSelect } from './WrapperSelect';
|
|
9
10
|
import type { HandleFormStateChange } from './models';
|
|
10
11
|
import { normalizeSelectedRegion } from './normalizeSelectedRegion';
|
|
11
12
|
import { renderSubmitButton } from './renderSubmitButton';
|
|
12
13
|
import { useFormHandlers } from './useFormHandlers';
|
|
13
|
-
import { WrapperSelect } from './WrapperSelect';
|
|
14
14
|
|
|
15
15
|
export interface BusinessCardFormState {
|
|
16
16
|
region: string;
|
|
@@ -135,7 +135,7 @@ const renderRegion = ({ regions, region, handleChange }: RenderRegionProps) => (
|
|
|
135
135
|
<div className="w-full">
|
|
136
136
|
<WrapperSelect
|
|
137
137
|
data={regions}
|
|
138
|
-
fieldValue="
|
|
138
|
+
fieldValue="code"
|
|
139
139
|
fieldLabel="name"
|
|
140
140
|
selected={region}
|
|
141
141
|
setSelected={(value) => handleChange({ region: value })}
|
|
@@ -6,7 +6,7 @@ import type { ButtonAdditionalProps } from '../../ui-kit/Button/ButtonProps';
|
|
|
6
6
|
/**
|
|
7
7
|
* @title Кнопка
|
|
8
8
|
*/
|
|
9
|
-
export interface
|
|
9
|
+
export interface SubmitButtonProps extends ButtonAdditionalProps {
|
|
10
10
|
/**
|
|
11
11
|
* @title Текст
|
|
12
12
|
* @default "Отправить заявку"
|
|
@@ -25,7 +25,7 @@ export type ApplicationFormContent = TitleProps & {
|
|
|
25
25
|
* @enumNames ["Бизнес-карта", "ВЭД", "Депозит", "Кредит", "Эквайринг"]
|
|
26
26
|
*/
|
|
27
27
|
typeForm?: 'business-card' | 'wed' | 'deposit' | 'credit' | 'acquiring';
|
|
28
|
-
button?:
|
|
28
|
+
button?: SubmitButtonProps;
|
|
29
29
|
/** @title Условия передачи данных */
|
|
30
30
|
link?: LinkProps;
|
|
31
31
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { LinkProps } from '../../model/LinkProps';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SubmitButtonProps } from './ApplicationFormContent';
|
|
3
3
|
|
|
4
4
|
export interface ApplicationFormsProps {
|
|
5
|
-
button?:
|
|
5
|
+
button?: SubmitButtonProps;
|
|
6
6
|
link?: LinkProps;
|
|
7
7
|
handleSubmit: (data: Record<string, string>) => Promise<string>;
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Branch } from '../../hooks/useSafeBoxes';
|
|
2
2
|
import type { CreditFormState } from './ApplicationFormCredit';
|
|
3
|
-
import type { HandleFormStateChange, Select } from './models';
|
|
4
3
|
import { WrapperSelect } from './WrapperSelect';
|
|
4
|
+
import type { HandleFormStateChange, Select } from './models';
|
|
5
5
|
|
|
6
6
|
interface RenderBankOfficesProps {
|
|
7
7
|
regions: Select[];
|
|
@@ -22,7 +22,7 @@ export const renderBankOffices = ({
|
|
|
22
22
|
<div className="w-1/2">
|
|
23
23
|
<WrapperSelect
|
|
24
24
|
data={regions}
|
|
25
|
-
fieldValue="
|
|
25
|
+
fieldValue="code"
|
|
26
26
|
fieldLabel="name"
|
|
27
27
|
selected={region}
|
|
28
28
|
setSelected={(value) => handleChange({ region: value })}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ACQUIRING_TYPES } from './acquiringTypes';
|
|
2
1
|
import type { AcquiringFormState } from './ApplicationFormAcquiring';
|
|
3
|
-
import type { HandleFormStateChange, Select } from './models';
|
|
4
2
|
import { WrapperSelect } from './WrapperSelect';
|
|
3
|
+
import { ACQUIRING_TYPES } from './acquiringTypes';
|
|
4
|
+
import type { HandleFormStateChange, Select } from './models';
|
|
5
5
|
|
|
6
6
|
interface SelectsProps {
|
|
7
7
|
acquiringType: string;
|
|
@@ -26,7 +26,7 @@ export const renderSelects = ({ acquiringType, regions, region, handleChange }:
|
|
|
26
26
|
<div className="w-1/2">
|
|
27
27
|
<WrapperSelect
|
|
28
28
|
data={regions}
|
|
29
|
-
fieldValue="
|
|
29
|
+
fieldValue="code"
|
|
30
30
|
fieldLabel="name"
|
|
31
31
|
selected={region}
|
|
32
32
|
setSelected={(value) => handleChange({ region: value })}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRegularButtonClasses } from '../../ui-kit/Button/getRegularButtonClasses';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SubmitButtonProps } from './ApplicationFormContent';
|
|
3
3
|
|
|
4
|
-
export const renderSubmitButton = (button?:
|
|
4
|
+
export const renderSubmitButton = (button?: SubmitButtonProps, className?: string) => {
|
|
5
5
|
const buttonStyle = getRegularButtonClasses({
|
|
6
6
|
className: 'text-white',
|
|
7
7
|
version: button?.version,
|
|
@@ -47,7 +47,7 @@ export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, sourceBookDir);
|
|
50
|
-
const { income, finalSum, rate, depositeName } = calculatorParams;
|
|
50
|
+
const { income, finalSum, rate, depositeName, isShowUnknownRate } = calculatorParams;
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
53
|
<section className={className}>
|
|
@@ -62,14 +62,17 @@ export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
|
|
|
62
62
|
handleIsPartialWithdrawal,
|
|
63
63
|
handleIsSmallBusiness,
|
|
64
64
|
})}
|
|
65
|
-
{renderInterestPayment(
|
|
65
|
+
{renderInterestPayment({
|
|
66
66
|
isMonthlyInterestPayment,
|
|
67
|
-
handleIsMonthlyInterestPayment,
|
|
68
|
-
'Выплата процентов',
|
|
69
|
-
|
|
67
|
+
callback: handleIsMonthlyInterestPayment,
|
|
68
|
+
title: 'Выплата процентов',
|
|
69
|
+
orientation: 'vertical',
|
|
70
|
+
})}
|
|
70
71
|
</div>
|
|
71
72
|
</div>
|
|
72
|
-
{
|
|
73
|
+
{isShowUnknownRate ? (
|
|
74
|
+
<UnknownRate />
|
|
75
|
+
) : (
|
|
73
76
|
<Rate
|
|
74
77
|
rate={rate}
|
|
75
78
|
depositeName={depositeName}
|
|
@@ -77,8 +80,6 @@ export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
|
|
|
77
80
|
rateBlockClassName="tracking-[-25px]"
|
|
78
81
|
unit="%"
|
|
79
82
|
/>
|
|
80
|
-
) : (
|
|
81
|
-
<UnknownRate />
|
|
82
83
|
)}
|
|
83
84
|
|
|
84
85
|
<div className="w-full max-w-[350px]">
|
|
@@ -2,7 +2,6 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
4
4
|
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
5
|
-
import { RadioButtonGroup } from '../../ui-kit/RadioButtonGroup/RadioButtonGroup';
|
|
6
5
|
import { style } from '../../utils/style';
|
|
7
6
|
import type { CommonCalculatorProps } from './CalculatorContent';
|
|
8
7
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
@@ -10,23 +9,10 @@ import { DEFAULT_MONTHS, DEFAULT_SUM } from './constants';
|
|
|
10
9
|
import { Rate } from './Rate';
|
|
11
10
|
import { renderFootnote } from './renderFootnote';
|
|
12
11
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
12
|
+
import { renderPaymentType } from './renderPaymentType';
|
|
13
13
|
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
14
14
|
import { useCreditCalculatorParams } from './useCreditCalculatorParams';
|
|
15
15
|
|
|
16
|
-
export const ANNUITY = 'annuity';
|
|
17
|
-
export const DIFFERENTIAL = 'differential';
|
|
18
|
-
|
|
19
|
-
const paymentTypeItems = [
|
|
20
|
-
{
|
|
21
|
-
id: ANNUITY,
|
|
22
|
-
text: 'Аннуитетный',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: DIFFERENTIAL,
|
|
26
|
-
text: 'Дифференцированный',
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
|
|
30
16
|
export interface CreditCalculatorProp extends CommonCalculatorProps {
|
|
31
17
|
className?: string;
|
|
32
18
|
}
|
|
@@ -82,21 +68,21 @@ export const CreditCalculatorForm = JSX<CreditCalculatorProp>(
|
|
|
82
68
|
</div>
|
|
83
69
|
<Rate
|
|
84
70
|
title="Ставка"
|
|
85
|
-
rate={calculatorParams.
|
|
71
|
+
rate={calculatorParams.rate}
|
|
86
72
|
rateBlockClassName="tracking-[-25px]"
|
|
87
73
|
unit="%"
|
|
88
74
|
/>
|
|
89
75
|
<div className="w-full max-w-[350px]">
|
|
90
76
|
<CalculatorValueBlock
|
|
91
|
-
title={
|
|
77
|
+
title={'Ежемесячный платеж'}
|
|
92
78
|
value={calculatorParams.monthlyPayment}
|
|
93
79
|
postfix="₽"
|
|
94
80
|
/>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
81
|
+
{renderPaymentType({
|
|
82
|
+
isAnnuity,
|
|
83
|
+
orientation: 'vertical',
|
|
84
|
+
callback: toggleIsAnnuity,
|
|
85
|
+
})}
|
|
100
86
|
{renderButtonsSection(buttons, { className: 'mt-7', isVertical: true })}
|
|
101
87
|
{renderFootnote(footnote)}
|
|
102
88
|
</div>
|
|
@@ -11,6 +11,7 @@ import { Rate } from './Rate';
|
|
|
11
11
|
import { renderFootnote } from './renderFootnote';
|
|
12
12
|
import { renderInterestPayment } from './renderInterestPayment';
|
|
13
13
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
14
|
+
import { renderRegistrationType } from './renderRegistrationType';
|
|
14
15
|
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
15
16
|
import { useDepositCalculatorParams } from './useDepositCalculatorParams';
|
|
16
17
|
|
|
@@ -28,10 +29,16 @@ export const DepositCalculatorForm = JSX<DepositCalculatorProp>(
|
|
|
28
29
|
(_: boolean) => toggleIsMonthlyInterestPayment(_),
|
|
29
30
|
[],
|
|
30
31
|
);
|
|
32
|
+
const [isRemoteRegistration, toggleIsRemoteRegistration] = useState(false);
|
|
33
|
+
const handleIsRemoteRegistration = useCallback(
|
|
34
|
+
(_: boolean) => toggleIsRemoteRegistration(_),
|
|
35
|
+
[],
|
|
36
|
+
);
|
|
31
37
|
const userInputParams = {
|
|
32
38
|
moneyValue,
|
|
33
39
|
monthsValue,
|
|
34
40
|
isMonthlyInterestPayment,
|
|
41
|
+
isRemoteRegistration,
|
|
35
42
|
};
|
|
36
43
|
const handleMonthsValue = useCallback((_: number) => setMonthsValue(_), []);
|
|
37
44
|
|
|
@@ -55,16 +62,23 @@ export const DepositCalculatorForm = JSX<DepositCalculatorProp>(
|
|
|
55
62
|
},
|
|
56
63
|
handleMonthsValue,
|
|
57
64
|
)}
|
|
65
|
+
<div className="mt-7 flex flex-col gap-y-7">
|
|
66
|
+
{renderInterestPayment({
|
|
67
|
+
isMonthlyInterestPayment,
|
|
68
|
+
callback: handleIsMonthlyInterestPayment,
|
|
69
|
+
title: 'Выплата процентов',
|
|
70
|
+
})}
|
|
71
|
+
{renderRegistrationType({
|
|
72
|
+
isRemoteRegistration,
|
|
73
|
+
callback: handleIsRemoteRegistration,
|
|
74
|
+
title: 'Оформление',
|
|
75
|
+
})}
|
|
76
|
+
</div>
|
|
58
77
|
</div>
|
|
59
|
-
<Rate rate={rate
|
|
78
|
+
<Rate rate={rate} rateBlockClassName="tracking-[-25px]" unit="%" />
|
|
60
79
|
<div className="w-full max-w-[350px]">
|
|
61
|
-
{income
|
|
62
|
-
|
|
63
|
-
) : null}
|
|
64
|
-
{finalSum ? (
|
|
65
|
-
<CalculatorValueBlock title="Сумма в конце срока" value={finalSum} postfix="₽" />
|
|
66
|
-
) : null}
|
|
67
|
-
{renderInterestPayment(isMonthlyInterestPayment, handleIsMonthlyInterestPayment)}
|
|
80
|
+
<CalculatorValueBlock title="Доход по вкладу" value={income} postfix="₽" prefix="+" />
|
|
81
|
+
<CalculatorValueBlock title="Сумма в конце срока" value={finalSum} postfix="₽" />
|
|
68
82
|
{renderButtonsSection(buttons, { className: 'mt-7', isVertical: true })}
|
|
69
83
|
{renderFootnote(footnote)}
|
|
70
84
|
</div>
|
|
@@ -3,8 +3,8 @@ import { BusinessDepositCalculatorSourceBookParams } from './useBusinessDepositC
|
|
|
3
3
|
import { CreditCalculatorSourceBookParams } from './useCreditCalculatorParams';
|
|
4
4
|
import { DepositCalculatorSourceBookParams } from './useDepositCalculatorParams';
|
|
5
5
|
|
|
6
|
-
export const DEFAULT_MIN_SUM =
|
|
7
|
-
export const DEFAULT_MAX_SUM =
|
|
6
|
+
export const DEFAULT_MIN_SUM = 30000;
|
|
7
|
+
export const DEFAULT_MAX_SUM = 5000000;
|
|
8
8
|
export const DEFAULT_SUM = (DEFAULT_MAX_SUM - DEFAULT_MIN_SUM) / 2;
|
|
9
9
|
export const DEFAULT_MIN_MONTHS = 13;
|
|
10
10
|
export const DEFAULT_MAX_MONTHS = 60;
|
|
@@ -25,12 +25,10 @@ export const DEFAULT_CREDIT_CALCULATOR_PARAMS: CreditCalculatorSourceBookParams
|
|
|
25
25
|
maxSum: DEFAULT_MAX_SUM,
|
|
26
26
|
minMonths: DEFAULT_MIN_MONTHS,
|
|
27
27
|
maxMonths: DEFAULT_MAX_MONTHS,
|
|
28
|
-
|
|
29
|
-
rateTopRange: 7,
|
|
28
|
+
rate: 0,
|
|
30
29
|
isSalaryClient: true,
|
|
31
30
|
isStateEmployee: true,
|
|
32
31
|
isInsurance: true,
|
|
33
|
-
sumBorder: 999999,
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
export const DEFAULT_TRAVEL_MIN_SUM = 6000;
|
|
@@ -54,8 +52,9 @@ export const DEFAULT_DEPOSIT_CALCULATOR_PARAMS: DepositCalculatorSourceBookParam
|
|
|
54
52
|
maxSum: 5000000,
|
|
55
53
|
minMonths: 2,
|
|
56
54
|
maxMonths: 120,
|
|
57
|
-
rate:
|
|
55
|
+
rate: 0,
|
|
58
56
|
isMonthlyInterestPayment: true,
|
|
57
|
+
isRemoteRegistration: true,
|
|
59
58
|
};
|
|
60
59
|
|
|
61
60
|
export const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS: BusinessDepositCalculatorSourceBookParams =
|
|
@@ -64,7 +63,7 @@ export const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS: BusinessDepositCalculat
|
|
|
64
63
|
maxSum: 500000,
|
|
65
64
|
minDays: BUSINESS_MIN_DAYS,
|
|
66
65
|
maxDays: BUSINESS_MAX_DAYS,
|
|
67
|
-
rate:
|
|
66
|
+
rate: 0,
|
|
68
67
|
isMonthlyInterestPayment: true,
|
|
69
68
|
isReplenished: false,
|
|
70
69
|
isPartialWithdrawal: false,
|