@redneckz/wildless-cms-uni-blocks 0.8.23 → 0.8.24
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.8.17.js +27 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +59 -28
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +6 -2
- package/bundle/components/Tabs/LinkTab.d.ts +1 -0
- package/bundle/hooks/useBranches.d.ts +20 -0
- package/bundle/ui-kit/TopItem/TopItem.d.ts +2 -1
- package/dist/components/ApplicationForm/ApplicationFormAcquiring.js +1 -1
- package/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
- package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormCredit.js +5 -5
- package/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/dist/components/ApplicationForm/renderBankOffices.js.map +1 -1
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +6 -2
- package/dist/components/Calculator/getMonthlyPayment.js +4 -1
- package/dist/components/Calculator/getMonthlyPayment.js.map +1 -1
- package/dist/components/Header/HeaderSecondaryMenu.js +7 -2
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/Tabs/LinkTab.d.ts +1 -0
- package/dist/components/Tabs/LinkTab.js +6 -2
- package/dist/components/Tabs/LinkTab.js.map +1 -1
- package/dist/components/Tabs/Tabs.js +15 -3
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/renderTab.js +1 -1
- package/dist/components/Tabs/renderTab.js.map +1 -1
- package/dist/hooks/useBranches.d.ts +20 -0
- package/dist/hooks/useBranches.js +16 -0
- package/dist/hooks/useBranches.js.map +1 -0
- package/dist/ui-kit/BlockWrapper.js +1 -4
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/dist/ui-kit/TopItem/TopItem.d.ts +2 -1
- package/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormAcquiring.js +1 -1
- package/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
- package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormCredit.js +5 -5
- package/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/lib/components/ApplicationForm/renderBankOffices.js.map +1 -1
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +6 -2
- package/lib/components/Calculator/getMonthlyPayment.js +4 -1
- package/lib/components/Calculator/getMonthlyPayment.js.map +1 -1
- package/lib/components/Header/HeaderSecondaryMenu.js +7 -2
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/Tabs/LinkTab.d.ts +1 -0
- package/lib/components/Tabs/LinkTab.js +6 -2
- package/lib/components/Tabs/LinkTab.js.map +1 -1
- package/lib/components/Tabs/Tabs.js +15 -3
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/renderTab.js +1 -1
- package/lib/components/Tabs/renderTab.js.map +1 -1
- package/lib/hooks/useBranches.d.ts +20 -0
- package/lib/hooks/useBranches.js +13 -0
- package/lib/hooks/useBranches.js.map +1 -0
- package/lib/ui-kit/BlockWrapper.js +1 -4
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/ui-kit/TopItem/TopItem.d.ts +2 -1
- package/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +2 -5
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +6 -2
- package/mobile/bundle/components/Tabs/LinkTab.d.ts +1 -0
- package/mobile/bundle/hooks/useBranches.d.ts +20 -0
- package/mobile/bundle/ui-kit/TopItem/TopItem.d.ts +2 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +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/ApplicationFormCredit.js +5 -5
- package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderBankOffices.js.map +1 -1
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +6 -2
- package/mobile/dist/components/Calculator/getMonthlyPayment.js +4 -1
- package/mobile/dist/components/Calculator/getMonthlyPayment.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js +7 -2
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/dist/components/Tabs/LinkTab.d.ts +1 -0
- package/mobile/dist/components/Tabs/LinkTab.js +6 -2
- package/mobile/dist/components/Tabs/LinkTab.js.map +1 -1
- package/mobile/dist/components/Tabs/Tabs.js +15 -3
- package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
- package/mobile/dist/components/Tabs/renderTab.js +1 -1
- package/mobile/dist/components/Tabs/renderTab.js.map +1 -1
- package/mobile/dist/hooks/useBranches.d.ts +20 -0
- package/mobile/dist/hooks/useBranches.js +16 -0
- package/mobile/dist/hooks/useBranches.js.map +1 -0
- package/mobile/dist/ui-kit/BlockWrapper.js +1 -4
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/dist/ui-kit/TopItem/TopItem.d.ts +2 -1
- package/mobile/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +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/ApplicationFormCredit.js +5 -5
- package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderBankOffices.js.map +1 -1
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +6 -2
- package/mobile/lib/components/Calculator/getMonthlyPayment.js +4 -1
- package/mobile/lib/components/Calculator/getMonthlyPayment.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js +7 -2
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/lib/components/Tabs/LinkTab.d.ts +1 -0
- package/mobile/lib/components/Tabs/LinkTab.js +6 -2
- package/mobile/lib/components/Tabs/LinkTab.js.map +1 -1
- package/mobile/lib/components/Tabs/Tabs.js +15 -3
- package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/components/Tabs/renderTab.js +1 -1
- package/mobile/lib/components/Tabs/renderTab.js.map +1 -1
- package/mobile/lib/hooks/useBranches.d.ts +20 -0
- package/mobile/lib/hooks/useBranches.js +13 -0
- package/mobile/lib/hooks/useBranches.js.map +1 -0
- package/mobile/lib/ui-kit/BlockWrapper.js +1 -4
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/ui-kit/TopItem/TopItem.d.ts +2 -1
- package/mobile/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +2 -2
- package/mobile/src/components/ApplicationForm/ApplicationFormCredit.tsx +5 -5
- package/mobile/src/components/ApplicationForm/renderBankOffices.tsx +1 -1
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.example.json +16 -8
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +3 -3
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlockContent.ts +6 -2
- package/mobile/src/components/Calculator/getMonthlyPayment.ts +3 -1
- package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +9 -2
- package/mobile/src/components/Tabs/LinkTab.tsx +8 -2
- package/mobile/src/components/Tabs/Tabs.tsx +18 -3
- package/mobile/src/components/Tabs/renderTab.tsx +7 -1
- package/mobile/src/hooks/useBranches.ts +43 -0
- package/mobile/src/ui-kit/BlockWrapper.tsx +1 -6
- package/mobile/src/ui-kit/TopItem/TopItem.tsx +2 -1
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +1 -1
- package/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +2 -2
- package/src/components/ApplicationForm/ApplicationFormCredit.tsx +5 -5
- package/src/components/ApplicationForm/renderBankOffices.tsx +1 -1
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.example.json +16 -8
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.fixture.tsx +8 -8
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +3 -3
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlockContent.ts +6 -2
- package/src/components/Calculator/getMonthlyPayment.ts +3 -1
- package/src/components/Header/HeaderSecondaryMenu.tsx +9 -2
- package/src/components/Tabs/LinkTab.tsx +8 -2
- package/src/components/Tabs/Tabs.tsx +18 -3
- package/src/components/Tabs/renderTab.tsx +7 -1
- package/src/hooks/useBranches.ts +43 -0
- package/src/ui-kit/BlockWrapper.tsx +1 -6
- package/src/ui-kit/TopItem/TopItem.tsx +2 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LinkProps } from '../../model/LinkProps';
|
|
2
|
+
import type { PreventableEvent } from '../../model/PreventableEvent';
|
|
2
3
|
export interface TopItemContent extends LinkProps {
|
|
3
4
|
active?: boolean;
|
|
4
5
|
}
|
|
@@ -6,6 +7,6 @@ export interface TopItemProps extends TopItemContent {
|
|
|
6
7
|
className?: string;
|
|
7
8
|
flat?: boolean;
|
|
8
9
|
dataItemName?: string;
|
|
9
|
-
onClick?: () => void;
|
|
10
|
+
onClick?: (ev?: PreventableEvent) => void;
|
|
10
11
|
}
|
|
11
12
|
export declare const TopItem: import("@redneckz/uni-jsx").UNIComponent<TopItemProps, any, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopItem.js","sourceRoot":"","sources":["../../../src/ui-kit/TopItem/TopItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"TopItem.js","sourceRoot":"","sources":["../../../src/ui-kit/TopItem/TopItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAa1C,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAe,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IAC/F,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IAEnD,OAAO,CACL,YACE,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,CAAC,EACvD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,GAAG,EAAC,qBAAqB,gBACb,IAAI,YAEhB,eAAM,SAAS,EAAE,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,YAAG,IAAI,IAAI,QAAQ,GAAQ,GACpE,CACL,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,CAAC,MAAM,GAAG,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,EAAE,CACpD,KAAK,CACH,0EAA0E,EAC1E,MAAM;IACJ,CAAC,CAAC,oEAAoE;IACtE,CAAC,CAAC,oBAAoB,EACxB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CACxB,CAAC;AAEJ,MAAM,YAAY,GAAG,CAAC,MAAM,GAAG,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,EAAE,CACpD,KAAK,CACH,wBAAwB,EACxB,MAAM;IACJ,CAAC,CAAC,mBAAmB;IACrB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,qBAAqB,EAAE,yBAAyB,CAAC,EACxF,mFAAmF,CACpF,CAAC"}
|
|
@@ -66,7 +66,7 @@ export const ApplicationFormAcquiring = JSX<ApplicationFormsProps>((props) => {
|
|
|
66
66
|
handleSubmit &&
|
|
67
67
|
(await handleSubmit({
|
|
68
68
|
typeForm: 'acqr',
|
|
69
|
-
region,
|
|
69
|
+
region: regions.find((_) => _.code === selectedRegion)?.name || '',
|
|
70
70
|
PartnerComments,
|
|
71
71
|
fullName,
|
|
72
72
|
inn,
|
|
@@ -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';
|
|
10
9
|
import type { HandleFormStateChange } from './models';
|
|
11
10
|
import { normalizeSelectedRegion } from './normalizeSelectedRegion';
|
|
12
11
|
import { renderSubmitButton } from './renderSubmitButton';
|
|
13
12
|
import { useFormHandlers } from './useFormHandlers';
|
|
13
|
+
import { WrapperSelect } from './WrapperSelect';
|
|
14
14
|
|
|
15
15
|
export interface BusinessCardFormState {
|
|
16
16
|
region: string;
|
|
@@ -47,7 +47,7 @@ export const ApplicationFormBusinessCard = JSX<ApplicationFormsProps>((props) =>
|
|
|
47
47
|
handleSubmit &&
|
|
48
48
|
(await handleSubmit({
|
|
49
49
|
typeForm: 'bcrd',
|
|
50
|
-
region,
|
|
50
|
+
region: regions.find((_) => _.code === selectedRegion)?.name || '',
|
|
51
51
|
name,
|
|
52
52
|
phone,
|
|
53
53
|
inn,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
-
import {
|
|
3
|
+
import { useBranches } from '../../hooks/useBranches';
|
|
4
4
|
import type { PreventableEvent } from '../../model/PreventableEvent';
|
|
5
5
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
6
|
import { useGetRegions } from '../SafeDepositRental/useGetRegions';
|
|
@@ -52,9 +52,9 @@ export const ApplicationFormCredit = JSX<ApplicationFormsProps>((props) => {
|
|
|
52
52
|
setFormState,
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
const selectedRegion = normalizeSelectedRegion(
|
|
55
|
+
const selectedRegion = normalizeSelectedRegion(region, regions);
|
|
56
56
|
|
|
57
|
-
const branches =
|
|
57
|
+
const branches = useBranches(selectedRegion).filter((branch) => branch.address);
|
|
58
58
|
|
|
59
59
|
useEffect(() => {
|
|
60
60
|
handleChange({
|
|
@@ -75,8 +75,8 @@ export const ApplicationFormCredit = JSX<ApplicationFormsProps>((props) => {
|
|
|
75
75
|
name,
|
|
76
76
|
phone,
|
|
77
77
|
mail,
|
|
78
|
-
region,
|
|
79
|
-
department,
|
|
78
|
+
region: regions.find((_) => _.code === selectedRegion)?.name || '',
|
|
79
|
+
department: branches.find((_) => _.branchCode === department)?.address || '',
|
|
80
80
|
PartnerComments,
|
|
81
81
|
}));
|
|
82
82
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Branch } from '../../hooks/useSafeBoxes';
|
|
2
2
|
import type { CreditFormState } from './ApplicationFormCredit';
|
|
3
|
-
import { WrapperSelect } from './WrapperSelect';
|
|
4
3
|
import type { HandleFormStateChange, Select } from './models';
|
|
4
|
+
import { WrapperSelect } from './WrapperSelect';
|
|
5
5
|
|
|
6
6
|
interface RenderBankOfficesProps {
|
|
7
7
|
regions: Select[];
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
"cardTextAlign": "center",
|
|
7
7
|
"bonusBenefits": [
|
|
8
8
|
{
|
|
9
|
-
"
|
|
9
|
+
"title": "",
|
|
10
|
+
"description": "Более 5000 товаров",
|
|
10
11
|
"icon": {
|
|
11
12
|
"format": "webp",
|
|
12
13
|
"size": {
|
|
@@ -17,7 +18,8 @@
|
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
{
|
|
20
|
-
"
|
|
21
|
+
"title": "",
|
|
22
|
+
"description": "750 авиакомпаний, 1,2 млн отелей, билеты РЖД",
|
|
21
23
|
"icon": {
|
|
22
24
|
"format": "webp",
|
|
23
25
|
"size": {
|
|
@@ -28,7 +30,8 @@
|
|
|
28
30
|
}
|
|
29
31
|
},
|
|
30
32
|
{
|
|
31
|
-
"
|
|
33
|
+
"title": "",
|
|
34
|
+
"description": "Аренда автомобилей",
|
|
32
35
|
"icon": {
|
|
33
36
|
"format": "webp",
|
|
34
37
|
"size": {
|
|
@@ -39,7 +42,8 @@
|
|
|
39
42
|
}
|
|
40
43
|
},
|
|
41
44
|
{
|
|
42
|
-
"
|
|
45
|
+
"title": "",
|
|
46
|
+
"description": "Болеее 1000 развлечений",
|
|
43
47
|
"icon": {
|
|
44
48
|
"format": "webp",
|
|
45
49
|
"size": {
|
|
@@ -50,7 +54,8 @@
|
|
|
50
54
|
}
|
|
51
55
|
},
|
|
52
56
|
{
|
|
53
|
-
"
|
|
57
|
+
"title": "",
|
|
58
|
+
"description": "Платежные гаджеты Pay Ring",
|
|
54
59
|
"icon": {
|
|
55
60
|
"format": "webp",
|
|
56
61
|
"size": {
|
|
@@ -61,7 +66,8 @@
|
|
|
61
66
|
}
|
|
62
67
|
},
|
|
63
68
|
{
|
|
64
|
-
"
|
|
69
|
+
"title": "",
|
|
70
|
+
"description": "Цифровые сервисы",
|
|
65
71
|
"icon": {
|
|
66
72
|
"format": "webp",
|
|
67
73
|
"size": {
|
|
@@ -72,7 +78,8 @@
|
|
|
72
78
|
}
|
|
73
79
|
},
|
|
74
80
|
{
|
|
75
|
-
"
|
|
81
|
+
"title": "",
|
|
82
|
+
"description": "Фермерские продукты",
|
|
76
83
|
"icon": {
|
|
77
84
|
"format": "webp",
|
|
78
85
|
"size": {
|
|
@@ -83,7 +90,8 @@
|
|
|
83
90
|
}
|
|
84
91
|
},
|
|
85
92
|
{
|
|
86
|
-
"
|
|
93
|
+
"title": "",
|
|
94
|
+
"description": "Страхование",
|
|
87
95
|
"icon": {
|
|
88
96
|
"format": "webp",
|
|
89
97
|
"size": {
|
|
@@ -38,12 +38,12 @@ export const BonusBenefitsBlock = JSX<BenefitsBlockProps>(
|
|
|
38
38
|
),
|
|
39
39
|
);
|
|
40
40
|
|
|
41
|
-
const renderBonusBenefit = ({ icon,
|
|
41
|
+
const renderBonusBenefit = ({ icon, title, description }: BonusBenefit, i: number) => {
|
|
42
42
|
return (
|
|
43
43
|
<div key={String(i)} className="flex flex-col items-center text-h6">
|
|
44
|
-
{
|
|
44
|
+
{title ? <span>{title}</span> : null}
|
|
45
45
|
{icon ? <Img image={icon} height="180" width="auto" className="h-[180px] w-auto" /> : null}
|
|
46
|
-
<div>{
|
|
46
|
+
<div>{description ? <span>{description}</span> : null}</div>
|
|
47
47
|
</div>
|
|
48
48
|
);
|
|
49
49
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AlignType } from '../../model/AlignType';
|
|
2
|
-
import type { DescriptionProps,
|
|
2
|
+
import type { DescriptionProps, TitleProps } from '../../model/HeadlineType';
|
|
3
3
|
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
4
4
|
import type { IconProps } from '../../model/Picture';
|
|
5
5
|
|
|
@@ -15,8 +15,12 @@ export type ColumnsCount = '3' | '4' | '5';
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @title Бонус и преимущество
|
|
18
|
+
* @default {
|
|
19
|
+
* "title": "Верхний заголовок",
|
|
20
|
+
* "description": "Нижний заголовок",
|
|
21
|
+
* }
|
|
18
22
|
*/
|
|
19
|
-
export type BonusBenefit =
|
|
23
|
+
export type BonusBenefit = TitleProps & IconProps & DescriptionProps;
|
|
20
24
|
|
|
21
25
|
/**
|
|
22
26
|
* @title Блок бонусов и преимуществ
|
|
@@ -9,7 +9,9 @@ import type { CreditCalculatorUserInputParams } from './useCreditCalculatorParam
|
|
|
9
9
|
export const getMonthlyPayment = (rate: number, params: CreditCalculatorUserInputParams) => {
|
|
10
10
|
const { isAnnuity, moneyValue, monthsValue } = params;
|
|
11
11
|
|
|
12
|
-
if (
|
|
12
|
+
if (rate === 0) {
|
|
13
|
+
return 0;
|
|
14
|
+
} else if (isAnnuity) {
|
|
13
15
|
const i = rate / MONTHLY_INTEREST_RATE; // Используется значение ставки в процентах
|
|
14
16
|
|
|
15
17
|
return moneyValue * (i + i / (Math.pow(1 + i, monthsValue) - 1));
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
3
|
import { useBool } from '../../hooks/useBool';
|
|
3
4
|
import { useLocation } from '../../hooks/useLocation';
|
|
4
5
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
5
6
|
import type { IconVersion } from '../../model/IconVersion';
|
|
7
|
+
import type { PreventableEvent } from '../../model/PreventableEvent';
|
|
8
|
+
import { projectSettings } from '../../ProjectSettings';
|
|
6
9
|
import type { ForeignOffice } from '../../services/sitemap/SitemapProps';
|
|
7
10
|
import { Location } from '../../ui-kit/Location/Location';
|
|
8
11
|
import { TopItem } from '../../ui-kit/TopItem/TopItem';
|
|
9
12
|
import { style } from '../../utils/style';
|
|
10
13
|
import { HeaderChatBotButton } from './HeaderChatBotButton';
|
|
11
|
-
import { projectSettings } from '../../ProjectSettings';
|
|
12
14
|
|
|
13
15
|
interface HeaderSecondaryMenuContent {
|
|
14
16
|
version?: BlockVersion;
|
|
@@ -30,6 +32,11 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
30
32
|
|
|
31
33
|
const iconVersion: IconVersion = version === 'transparent' ? 'white' : 'black';
|
|
32
34
|
|
|
35
|
+
const handleShowLocationModal = useCallback((ev?: PreventableEvent) => {
|
|
36
|
+
ev?.preventDefault();
|
|
37
|
+
showLocationModal();
|
|
38
|
+
}, []);
|
|
39
|
+
|
|
33
40
|
return (
|
|
34
41
|
<div className={style('flex items-center', className)}>
|
|
35
42
|
<TopItem
|
|
@@ -37,7 +44,7 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
37
44
|
flat={true}
|
|
38
45
|
href="#"
|
|
39
46
|
text={location.name}
|
|
40
|
-
onClick={
|
|
47
|
+
onClick={handleShowLocationModal}
|
|
41
48
|
/>
|
|
42
49
|
{officesLink ? (
|
|
43
50
|
<TopItem className="mr-7" flat={true} href={officesLink} text="Офисы и банкоматы" />
|
|
@@ -7,22 +7,28 @@ interface LinkTabProps {
|
|
|
7
7
|
tab: LinkTabData;
|
|
8
8
|
currentTab?: TabData;
|
|
9
9
|
isScrollable?: boolean;
|
|
10
|
+
onClick: (tab: TabData) => void;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export const LinkTab = JSX<LinkTabProps>((props) => {
|
|
13
|
-
const { tab, currentTab, isScrollable = false } = props;
|
|
14
|
+
const { tab, currentTab, onClick, isScrollable = false } = props;
|
|
14
15
|
const active = currentTab?.type === 'link' && currentTab.href === tab.href;
|
|
15
16
|
|
|
16
17
|
const link = useLink();
|
|
17
18
|
const adjustedProps = link(tab);
|
|
18
19
|
|
|
20
|
+
const handleClick = (ev?: { preventDefault: () => void }) => {
|
|
21
|
+
adjustedProps.onClick(ev);
|
|
22
|
+
onClick(tab);
|
|
23
|
+
};
|
|
24
|
+
|
|
19
25
|
return (
|
|
20
26
|
<a
|
|
21
27
|
role="tab"
|
|
22
28
|
className={getLinkTabClassName('link', active, isScrollable)}
|
|
23
29
|
target={tab.target}
|
|
24
30
|
href={adjustedProps.href}
|
|
25
|
-
onClick={
|
|
31
|
+
onClick={handleClick}
|
|
26
32
|
>
|
|
27
33
|
<span className={getLinkTabClassName('text', active, isScrollable)}>{tab.text}</span>
|
|
28
34
|
</a>
|
|
@@ -19,6 +19,14 @@ export const Tabs = JSX<TabsBlockProps>((props) => {
|
|
|
19
19
|
|
|
20
20
|
const [currentTab, setCurrentTab] = useState(tabs ? tabs[0] : undefined);
|
|
21
21
|
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!tabs || !tabs[0]) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
fireTabEvent(tabs[0]);
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
22
30
|
useEffect(() => {
|
|
23
31
|
if (currentTab?.type === 'group') {
|
|
24
32
|
defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref });
|
|
@@ -26,9 +34,7 @@ export const Tabs = JSX<TabsBlockProps>((props) => {
|
|
|
26
34
|
}, [currentTab]);
|
|
27
35
|
|
|
28
36
|
const handleClick = useCallback((selectedTab: TabData) => {
|
|
29
|
-
|
|
30
|
-
defaultEventBus.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
|
|
31
|
-
}
|
|
37
|
+
fireTabEvent(selectedTab);
|
|
32
38
|
setCurrentTab(selectedTab);
|
|
33
39
|
}, []);
|
|
34
40
|
|
|
@@ -61,3 +67,12 @@ export const Tabs = JSX<TabsBlockProps>((props) => {
|
|
|
61
67
|
</BlockWrapper>
|
|
62
68
|
);
|
|
63
69
|
});
|
|
70
|
+
|
|
71
|
+
const fireTabEvent = (tab: TabData) => {
|
|
72
|
+
if (tab.type === 'group') {
|
|
73
|
+
defaultEventBus.fire('tab', { type: tab.type, label: tab.ref });
|
|
74
|
+
}
|
|
75
|
+
if (tab.type === 'link') {
|
|
76
|
+
defaultEventBus.fire('tab', { type: tab.type, label: tab.href });
|
|
77
|
+
}
|
|
78
|
+
};
|
|
@@ -26,7 +26,13 @@ export const renderTab =
|
|
|
26
26
|
return renderGroupTab({ page, currentTab, showCounter, onClick, isScrollable })(tab, i);
|
|
27
27
|
case 'link': {
|
|
28
28
|
return (
|
|
29
|
-
<LinkTab
|
|
29
|
+
<LinkTab
|
|
30
|
+
key={String(i)}
|
|
31
|
+
tab={tab}
|
|
32
|
+
currentTab={currentTab}
|
|
33
|
+
isScrollable={isScrollable}
|
|
34
|
+
onClick={onClick}
|
|
35
|
+
/>
|
|
30
36
|
);
|
|
31
37
|
}
|
|
32
38
|
default:
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
2
|
+
import { fetchJSON } from '../utils/fetchJSON';
|
|
3
|
+
|
|
4
|
+
export interface Tariff {
|
|
5
|
+
tariffType?: string;
|
|
6
|
+
tariffValue?: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface SafeBoxCase {
|
|
10
|
+
safeBoxCasesSize?: string;
|
|
11
|
+
tariffs?: Tariff[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface SafeBoxCaseVolume {
|
|
15
|
+
volume?: string;
|
|
16
|
+
safeBoxCases?: SafeBoxCase[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface Branch {
|
|
20
|
+
branchCode?: string;
|
|
21
|
+
address?: string;
|
|
22
|
+
gpsLatitude?: number;
|
|
23
|
+
gpsLongitude?: number;
|
|
24
|
+
safeBoxCaseVolumes?: SafeBoxCaseVolume[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const BRANCHES_URL = '/api/v1/branches';
|
|
28
|
+
const EMPTY_VALUE = [];
|
|
29
|
+
|
|
30
|
+
export function useBranches(regionCode?: string): Branch[] {
|
|
31
|
+
const { data } = useAsyncData<Branch[], any, string | null>(
|
|
32
|
+
regionCode ? `${BRANCHES_URL}?regionCode=${regionCode}` : null,
|
|
33
|
+
fetchSafeBoxes,
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
return data || EMPTY_VALUE;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const fetchSafeBoxes = async (url: string): Promise<Branch[]> => {
|
|
40
|
+
const result = await fetchJSON<Branch[]>(url, { method: 'GET' });
|
|
41
|
+
|
|
42
|
+
return result || EMPTY_VALUE;
|
|
43
|
+
};
|
|
@@ -38,12 +38,7 @@ export const BlockWrapper = JSX<BlockWrapperProps>(
|
|
|
38
38
|
() =>
|
|
39
39
|
defaultEventBus.subscribe('tab', (event) => {
|
|
40
40
|
setHidden(
|
|
41
|
-
Boolean(
|
|
42
|
-
event.type === 'group' &&
|
|
43
|
-
event.label &&
|
|
44
|
-
block?.labels?.length &&
|
|
45
|
-
!block.labels.includes(event.label),
|
|
46
|
-
),
|
|
41
|
+
Boolean(event.label && block?.labels?.length && !block.labels.includes(event.label)),
|
|
47
42
|
);
|
|
48
43
|
}),
|
|
49
44
|
[block],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useLink } from '../../hooks/useLink';
|
|
3
3
|
import type { LinkProps } from '../../model/LinkProps';
|
|
4
|
+
import type { PreventableEvent } from '../../model/PreventableEvent';
|
|
4
5
|
import { style } from '../../utils/style';
|
|
5
6
|
|
|
6
7
|
export interface TopItemContent extends LinkProps {
|
|
@@ -11,7 +12,7 @@ export interface TopItemProps extends TopItemContent {
|
|
|
11
12
|
className?: string;
|
|
12
13
|
flat?: boolean;
|
|
13
14
|
dataItemName?: string;
|
|
14
|
-
onClick?: () => void;
|
|
15
|
+
onClick?: (ev?: PreventableEvent) => void;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export const TopItem = JSX<TopItemProps>(({ className = '', active, flat, children, ...rest }) => {
|
package/package.json
CHANGED
|
@@ -66,7 +66,7 @@ export const ApplicationFormAcquiring = JSX<ApplicationFormsProps>((props) => {
|
|
|
66
66
|
handleSubmit &&
|
|
67
67
|
(await handleSubmit({
|
|
68
68
|
typeForm: 'acqr',
|
|
69
|
-
region,
|
|
69
|
+
region: regions.find((_) => _.code === selectedRegion)?.name || '',
|
|
70
70
|
PartnerComments,
|
|
71
71
|
fullName,
|
|
72
72
|
inn,
|
|
@@ -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';
|
|
10
9
|
import type { HandleFormStateChange } from './models';
|
|
11
10
|
import { normalizeSelectedRegion } from './normalizeSelectedRegion';
|
|
12
11
|
import { renderSubmitButton } from './renderSubmitButton';
|
|
13
12
|
import { useFormHandlers } from './useFormHandlers';
|
|
13
|
+
import { WrapperSelect } from './WrapperSelect';
|
|
14
14
|
|
|
15
15
|
export interface BusinessCardFormState {
|
|
16
16
|
region: string;
|
|
@@ -47,7 +47,7 @@ export const ApplicationFormBusinessCard = JSX<ApplicationFormsProps>((props) =>
|
|
|
47
47
|
handleSubmit &&
|
|
48
48
|
(await handleSubmit({
|
|
49
49
|
typeForm: 'bcrd',
|
|
50
|
-
region,
|
|
50
|
+
region: regions.find((_) => _.code === selectedRegion)?.name || '',
|
|
51
51
|
name,
|
|
52
52
|
phone,
|
|
53
53
|
inn,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
-
import {
|
|
3
|
+
import { useBranches } from '../../hooks/useBranches';
|
|
4
4
|
import type { PreventableEvent } from '../../model/PreventableEvent';
|
|
5
5
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
6
|
import { useGetRegions } from '../SafeDepositRental/useGetRegions';
|
|
@@ -52,9 +52,9 @@ export const ApplicationFormCredit = JSX<ApplicationFormsProps>((props) => {
|
|
|
52
52
|
setFormState,
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
const selectedRegion = normalizeSelectedRegion(
|
|
55
|
+
const selectedRegion = normalizeSelectedRegion(region, regions);
|
|
56
56
|
|
|
57
|
-
const branches =
|
|
57
|
+
const branches = useBranches(selectedRegion).filter((branch) => branch.address);
|
|
58
58
|
|
|
59
59
|
useEffect(() => {
|
|
60
60
|
handleChange({
|
|
@@ -75,8 +75,8 @@ export const ApplicationFormCredit = JSX<ApplicationFormsProps>((props) => {
|
|
|
75
75
|
name,
|
|
76
76
|
phone,
|
|
77
77
|
mail,
|
|
78
|
-
region,
|
|
79
|
-
department,
|
|
78
|
+
region: regions.find((_) => _.code === selectedRegion)?.name || '',
|
|
79
|
+
department: branches.find((_) => _.branchCode === department)?.address || '',
|
|
80
80
|
PartnerComments,
|
|
81
81
|
}));
|
|
82
82
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Branch } from '../../hooks/useSafeBoxes';
|
|
2
2
|
import type { CreditFormState } from './ApplicationFormCredit';
|
|
3
|
-
import { WrapperSelect } from './WrapperSelect';
|
|
4
3
|
import type { HandleFormStateChange, Select } from './models';
|
|
4
|
+
import { WrapperSelect } from './WrapperSelect';
|
|
5
5
|
|
|
6
6
|
interface RenderBankOfficesProps {
|
|
7
7
|
regions: Select[];
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
"cardTextAlign": "center",
|
|
7
7
|
"bonusBenefits": [
|
|
8
8
|
{
|
|
9
|
-
"
|
|
9
|
+
"title": "",
|
|
10
|
+
"description": "Более 5000 товаров",
|
|
10
11
|
"icon": {
|
|
11
12
|
"format": "webp",
|
|
12
13
|
"size": {
|
|
@@ -17,7 +18,8 @@
|
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
{
|
|
20
|
-
"
|
|
21
|
+
"title": "",
|
|
22
|
+
"description": "750 авиакомпаний, 1,2 млн отелей, билеты РЖД",
|
|
21
23
|
"icon": {
|
|
22
24
|
"format": "webp",
|
|
23
25
|
"size": {
|
|
@@ -28,7 +30,8 @@
|
|
|
28
30
|
}
|
|
29
31
|
},
|
|
30
32
|
{
|
|
31
|
-
"
|
|
33
|
+
"title": "",
|
|
34
|
+
"description": "Аренда автомобилей",
|
|
32
35
|
"icon": {
|
|
33
36
|
"format": "webp",
|
|
34
37
|
"size": {
|
|
@@ -39,7 +42,8 @@
|
|
|
39
42
|
}
|
|
40
43
|
},
|
|
41
44
|
{
|
|
42
|
-
"
|
|
45
|
+
"title": "",
|
|
46
|
+
"description": "Болеее 1000 развлечений",
|
|
43
47
|
"icon": {
|
|
44
48
|
"format": "webp",
|
|
45
49
|
"size": {
|
|
@@ -50,7 +54,8 @@
|
|
|
50
54
|
}
|
|
51
55
|
},
|
|
52
56
|
{
|
|
53
|
-
"
|
|
57
|
+
"title": "",
|
|
58
|
+
"description": "Платежные гаджеты Pay Ring",
|
|
54
59
|
"icon": {
|
|
55
60
|
"format": "webp",
|
|
56
61
|
"size": {
|
|
@@ -61,7 +66,8 @@
|
|
|
61
66
|
}
|
|
62
67
|
},
|
|
63
68
|
{
|
|
64
|
-
"
|
|
69
|
+
"title": "",
|
|
70
|
+
"description": "Цифровые сервисы",
|
|
65
71
|
"icon": {
|
|
66
72
|
"format": "webp",
|
|
67
73
|
"size": {
|
|
@@ -72,7 +78,8 @@
|
|
|
72
78
|
}
|
|
73
79
|
},
|
|
74
80
|
{
|
|
75
|
-
"
|
|
81
|
+
"title": "",
|
|
82
|
+
"description": "Фермерские продукты",
|
|
76
83
|
"icon": {
|
|
77
84
|
"format": "webp",
|
|
78
85
|
"size": {
|
|
@@ -83,7 +90,8 @@
|
|
|
83
90
|
}
|
|
84
91
|
},
|
|
85
92
|
{
|
|
86
|
-
"
|
|
93
|
+
"title": "",
|
|
94
|
+
"description": "Страхование",
|
|
87
95
|
"icon": {
|
|
88
96
|
"format": "webp",
|
|
89
97
|
"size": {
|
|
@@ -5,35 +5,35 @@ import { BonusBenefit } from './BonusBenefitsBlockContent';
|
|
|
5
5
|
|
|
6
6
|
const bonusBenefits: BonusBenefit[] = [
|
|
7
7
|
{
|
|
8
|
-
|
|
8
|
+
description: 'Более 5000 товаров',
|
|
9
9
|
icon: { icon: 'WateringCanIcon' },
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
|
|
12
|
+
description: '750 авиакомпаний, 1,2 млн отелей, билеты РЖД',
|
|
13
13
|
icon: { icon: 'AirPlaneIcon' },
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
|
|
16
|
+
description: 'Аренда автомобилей',
|
|
17
17
|
icon: { icon: 'CarIcon' },
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
|
|
20
|
+
description: 'Болеее 1000 развлечений',
|
|
21
21
|
icon: { icon: 'CinemaIcon' },
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
|
|
24
|
+
description: 'Платежные гаджеты Pay Ring',
|
|
25
25
|
icon: { icon: 'SoundIcon' },
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
|
|
28
|
+
description: 'Цифровые сервисы',
|
|
29
29
|
icon: { icon: 'DocsIcon' },
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
|
|
32
|
+
description: 'Фермерские продукты',
|
|
33
33
|
icon: { icon: 'PumpkinIcon' },
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
|
|
36
|
+
description: 'Страхование',
|
|
37
37
|
icon: { icon: 'PowerIcon' },
|
|
38
38
|
},
|
|
39
39
|
];
|
|
@@ -38,12 +38,12 @@ export const BonusBenefitsBlock = JSX<BenefitsBlockProps>(
|
|
|
38
38
|
),
|
|
39
39
|
);
|
|
40
40
|
|
|
41
|
-
const renderBonusBenefit = ({ icon,
|
|
41
|
+
const renderBonusBenefit = ({ icon, title, description }: BonusBenefit, i: number) => {
|
|
42
42
|
return (
|
|
43
43
|
<div key={String(i)} className="flex flex-col items-center text-h6">
|
|
44
|
-
{
|
|
44
|
+
{title ? <span>{title}</span> : null}
|
|
45
45
|
{icon ? <Img image={icon} height="180" width="auto" className="h-[180px] w-auto" /> : null}
|
|
46
|
-
<div>{
|
|
46
|
+
<div>{description ? <span>{description}</span> : null}</div>
|
|
47
47
|
</div>
|
|
48
48
|
);
|
|
49
49
|
};
|