@redneckz/wildless-cms-uni-blocks 0.14.868 → 0.14.870
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.14.869.js +13 -0
- package/bundle/bundle.umd.js +50 -53
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
- package/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +1 -0
- package/bundle/components/OfficesAtmsMap/filters.d.ts +23 -13
- package/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/dist/components/AdTile/AdTile.js.map +1 -1
- package/dist/components/OfficesAtmsMap/AtmsMap.js +3 -23
- package/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +3 -3
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +1 -0
- package/dist/components/OfficesAtmsMap/filters.d.ts +23 -13
- package/dist/components/OfficesAtmsMap/filters.js +28 -12
- package/dist/components/OfficesAtmsMap/filters.js.map +1 -1
- package/dist/components/OfficesAtmsMap/renderButtonsGroup.js +1 -1
- package/dist/components/OfficesAtmsMap/renderButtonsGroup.js.map +1 -1
- package/dist/components/OfficesAtmsMap/renderDescriptionBlock.js +2 -1
- package/dist/components/OfficesAtmsMap/renderDescriptionBlock.js.map +1 -1
- package/dist/components/OfficesAtmsMap/renderHeading.js +1 -1
- package/dist/components/OfficesAtmsMap/renderHeading.js.map +1 -1
- package/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/dist/ui-kit/PriceList/PriceList.js +1 -1
- package/dist/ui-kit/PriceList/PriceList.js.map +1 -1
- package/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/AdTile/AdTile.js.map +1 -1
- package/lib/components/OfficesAtmsMap/AtmsMap.js +3 -23
- package/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +3 -3
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +1 -0
- package/lib/components/OfficesAtmsMap/filters.d.ts +23 -13
- package/lib/components/OfficesAtmsMap/filters.js +28 -12
- package/lib/components/OfficesAtmsMap/filters.js.map +1 -1
- package/lib/components/OfficesAtmsMap/renderButtonsGroup.js +1 -1
- package/lib/components/OfficesAtmsMap/renderButtonsGroup.js.map +1 -1
- package/lib/components/OfficesAtmsMap/renderDescriptionBlock.js +2 -1
- package/lib/components/OfficesAtmsMap/renderDescriptionBlock.js.map +1 -1
- package/lib/components/OfficesAtmsMap/renderHeading.js +1 -1
- package/lib/components/OfficesAtmsMap/renderHeading.js.map +1 -1
- package/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/lib/ui-kit/PriceList/PriceList.js +1 -1
- package/lib/ui-kit/PriceList/PriceList.js.map +1 -1
- package/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +48 -51
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
- package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +1 -0
- package/mobile/bundle/components/OfficesAtmsMap/filters.d.ts +23 -13
- package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/dist/components/AdTile/AdTile.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js +3 -23
- package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +3 -3
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +1 -0
- package/mobile/dist/components/OfficesAtmsMap/filters.d.ts +23 -13
- package/mobile/dist/components/OfficesAtmsMap/filters.js +28 -12
- package/mobile/dist/components/OfficesAtmsMap/filters.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderButtonsGroup.js +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderButtonsGroup.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderDescriptionBlock.js +2 -1
- package/mobile/dist/components/OfficesAtmsMap/renderDescriptionBlock.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderHeading.js +1 -1
- package/mobile/dist/components/OfficesAtmsMap/renderHeading.js.map +1 -1
- package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/dist/ui-kit/PriceList/PriceList.js +1 -1
- package/mobile/dist/ui-kit/PriceList/PriceList.js.map +1 -1
- package/mobile/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/AdTile/AdTile.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js +3 -23
- package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +3 -3
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +1 -0
- package/mobile/lib/components/OfficesAtmsMap/filters.d.ts +23 -13
- package/mobile/lib/components/OfficesAtmsMap/filters.js +28 -12
- package/mobile/lib/components/OfficesAtmsMap/filters.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderButtonsGroup.js +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderButtonsGroup.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderDescriptionBlock.js +2 -1
- package/mobile/lib/components/OfficesAtmsMap/renderDescriptionBlock.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderHeading.js +1 -1
- package/mobile/lib/components/OfficesAtmsMap/renderHeading.js.map +1 -1
- package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
- package/mobile/lib/ui-kit/PriceList/PriceList.js +1 -1
- package/mobile/lib/ui-kit/PriceList/PriceList.js.map +1 -1
- package/mobile/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/src/components/AdTile/AdTile.tsx +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +3 -3
- package/mobile/src/components/OfficesAtmsMap/AtmsMap.tsx +3 -31
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +3 -3
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +1 -0
- package/mobile/src/components/OfficesAtmsMap/filters.ts +31 -13
- package/mobile/src/components/OfficesAtmsMap/renderButtonsGroup.tsx +1 -1
- package/mobile/src/components/OfficesAtmsMap/renderDescriptionBlock.tsx +15 -17
- package/mobile/src/components/OfficesAtmsMap/renderHeading.tsx +13 -12
- package/mobile/src/model/FormTypeFieldDef.ts +1 -1
- package/mobile/src/ui-kit/PriceList/PriceList.tsx +1 -1
- package/mobile/src/ui-kit/TopItem/TopItem.tsx +1 -1
- package/package.json +1 -1
- package/src/components/AdTile/AdTile.tsx +1 -1
- package/src/components/ApplicationForm/ApplicationForm.example.json +3 -3
- package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +2 -2
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +2 -2
- package/src/components/OfficesAtmsMap/AtmsMap.tsx +3 -31
- package/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +3 -3
- package/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +1 -0
- package/src/components/OfficesAtmsMap/filters.ts +31 -13
- package/src/components/OfficesAtmsMap/renderButtonsGroup.tsx +1 -1
- package/src/components/OfficesAtmsMap/renderDescriptionBlock.tsx +15 -17
- package/src/components/OfficesAtmsMap/renderHeading.tsx +13 -12
- package/src/model/FormTypeFieldDef.ts +1 -1
- package/src/ui-kit/PriceList/PriceList.tsx +1 -1
- package/src/ui-kit/TopItem/TopItem.tsx +1 -1
|
@@ -3,44 +3,31 @@ import { useLocation } from '../../hooks/useLocation';
|
|
|
3
3
|
import { type ComponentType } from '../../model/ComponentType';
|
|
4
4
|
import { type AtmsDef } from './OfficesAtmsMapContent';
|
|
5
5
|
import { OfficesAtmsMapLayout } from './OfficesAtmsMapLayout';
|
|
6
|
-
import { type Atm } from './OfficesAtmsMapProps';
|
|
7
6
|
import { getAtmPoint, renderAtmCard } from './renderAtmCard';
|
|
8
7
|
import { useAtms } from './useAtms';
|
|
9
8
|
|
|
10
9
|
const INITIAL_FILTRATION_STATE = {
|
|
11
|
-
terminalTypeAtms: true,
|
|
12
10
|
terminalTypeTerm: false,
|
|
11
|
+
terminalTypeAtms: false,
|
|
13
12
|
workAllTime: false,
|
|
14
13
|
billAcceptorEnable: false,
|
|
15
14
|
locationDisabledPeople: false,
|
|
16
15
|
designDisabledPeople: false,
|
|
17
16
|
};
|
|
18
17
|
|
|
19
|
-
const FILTRATION_PREDICATES = {
|
|
20
|
-
terminalTypeAtms: (item: Atm) => item.terminalType?.toLowerCase() === 'банкомат',
|
|
21
|
-
terminalTypeTerm: (item: Atm) => item.terminalType?.toLowerCase() === 'терминал',
|
|
22
|
-
workAllTime: (item: Atm) => item.workTime?.toLowerCase() === 'круглосуточно',
|
|
23
|
-
billAcceptorEnable: (item: Atm) => Boolean(item.billAcceptorEnable),
|
|
24
|
-
locationDisabledPeople: (item: Atm) => Boolean(item.locationDisabledPeople),
|
|
25
|
-
designDisabledPeople: (item: Atm) => Boolean(item.designDisabledPeople),
|
|
26
|
-
};
|
|
27
|
-
|
|
28
18
|
export interface AtmsMapProps extends ComponentType {
|
|
29
19
|
descriptionData?: AtmsDef;
|
|
30
20
|
}
|
|
31
21
|
|
|
32
22
|
export const AtmsMap = JSX<AtmsMapProps>(({ descriptionData, className }) => {
|
|
33
23
|
const currentLocation = useLocation();
|
|
34
|
-
|
|
35
24
|
const regionCode = currentLocation?.code ?? '000';
|
|
36
|
-
|
|
37
|
-
const { data: officesData, isLoad } = useAtms(regionCode);
|
|
25
|
+
const { data, isLoad } = useAtms(regionCode);
|
|
38
26
|
|
|
39
27
|
return (
|
|
40
28
|
<OfficesAtmsMapLayout
|
|
41
29
|
className={className}
|
|
42
|
-
|
|
43
|
-
data={officesData}
|
|
30
|
+
data={data}
|
|
44
31
|
isLoad={isLoad}
|
|
45
32
|
initFilterState={INITIAL_FILTRATION_STATE}
|
|
46
33
|
renderCard={renderAtmCard}
|
|
@@ -50,18 +37,3 @@ export const AtmsMap = JSX<AtmsMapProps>(({ descriptionData, className }) => {
|
|
|
50
37
|
/>
|
|
51
38
|
);
|
|
52
39
|
});
|
|
53
|
-
|
|
54
|
-
const filterItems = (data: Atm[], filtrationState: Record<string, boolean>) => {
|
|
55
|
-
const truthyFilters = Object.keys(filtrationState).filter((key) => filtrationState[key]);
|
|
56
|
-
const filtersOR = truthyFilters.filter((_) => _.startsWith('terminalType'));
|
|
57
|
-
const filtersAND = truthyFilters.filter((_) => !filtersOR.includes(_));
|
|
58
|
-
|
|
59
|
-
return data.filter((item) => {
|
|
60
|
-
const resultAND = filtersAND.every((_) => FILTRATION_PREDICATES[_](item));
|
|
61
|
-
const resultOR = filtersOR.length
|
|
62
|
-
? filtersOR.some((_) => FILTRATION_PREDICATES[_](item))
|
|
63
|
-
: true;
|
|
64
|
-
|
|
65
|
-
return resultAND && resultOR;
|
|
66
|
-
});
|
|
67
|
-
};
|
|
@@ -27,7 +27,6 @@ export interface OfficesAtmsMapLayoutProps<T> extends ComponentType, TitleProps
|
|
|
27
27
|
remoteWorkplaces?: T[];
|
|
28
28
|
renderCard?: (item: T, index: number) => VNode;
|
|
29
29
|
renderRemoteWorkplaceCard?: (item: T, index: number) => VNode;
|
|
30
|
-
filterItems?: (data: T[], filtrationState: InitFilterState) => T[];
|
|
31
30
|
getBalloon?: (item: T) => BalloonContent;
|
|
32
31
|
getBalloonRemoteWorkplaces?: (item: T) => BalloonContent;
|
|
33
32
|
initFilterState?: InitFilterState;
|
|
@@ -46,12 +45,13 @@ export const OfficesAtmsMapLayout = JSX<OfficesAtmsMapLayoutProps<Branch | Atm |
|
|
|
46
45
|
renderCard = defaultEmptyFunction,
|
|
47
46
|
renderRemoteWorkplaceCard = defaultEmptyFunction,
|
|
48
47
|
getBalloon = defaultEmptyFunction,
|
|
48
|
+
initFilterState = INITIAL_FILTRATION_STATE,
|
|
49
49
|
getBalloonRemoteWorkplaces = defaultEmptyFunction,
|
|
50
50
|
descriptionData,
|
|
51
51
|
title,
|
|
52
52
|
}) => {
|
|
53
53
|
const onlyOffice = title?.includes('Офис');
|
|
54
|
-
const [filtrationState, { field, reset }] = useForm(
|
|
54
|
+
const [filtrationState, { field, reset }] = useForm(initFilterState);
|
|
55
55
|
|
|
56
56
|
const { filteredItems, points, filteredRemoteWorkplaces, lengthItems } = useOfficesAtmsMapData({
|
|
57
57
|
data,
|
|
@@ -66,7 +66,7 @@ export const OfficesAtmsMapLayout = JSX<OfficesAtmsMapLayoutProps<Branch | Atm |
|
|
|
66
66
|
return (
|
|
67
67
|
<div className={style('space-y-1', className)}>
|
|
68
68
|
<div className="bg-white">
|
|
69
|
-
<div className="p-3xl pb-0">
|
|
69
|
+
<div className="p-3xl pb-0 grid gap-xl">
|
|
70
70
|
{renderHeading(title, lengthItems)}
|
|
71
71
|
{descriptionData ? renderDescriptionBlock(descriptionData) : null}
|
|
72
72
|
{onlyOffice && renderButtonsGroup(data, activeButton, setActiveButton)}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Atm, type Branch, type RemoteWorkplace } from './OfficesAtmsMapProps';
|
|
2
|
+
|
|
3
|
+
const ATMS_INITIAL_FILTRATION_STATE = {
|
|
4
|
+
billAcceptorEnable: false,
|
|
5
|
+
workAllTime: false,
|
|
6
|
+
terminalTypeTerm: false,
|
|
7
|
+
terminalTypeAtms: false,
|
|
8
|
+
};
|
|
2
9
|
|
|
3
10
|
export const INITIAL_FILTRATION_STATE = {
|
|
4
11
|
workingSaturday: false,
|
|
@@ -11,29 +18,40 @@ export const INITIAL_FILTRATION_STATE = {
|
|
|
11
18
|
bullionOperations: false,
|
|
12
19
|
preciousMetalsOperations: false,
|
|
13
20
|
transferringDataToBiometricSystem: false,
|
|
21
|
+
...ATMS_INITIAL_FILTRATION_STATE,
|
|
14
22
|
};
|
|
15
23
|
|
|
16
24
|
export const FILTRATION_LABELS = {
|
|
17
|
-
safeBoxCaseVolumes: 'Аренда индивидуальных сейфовых ячеек',
|
|
18
|
-
workingSaturday: 'Открыты по субботам',
|
|
19
|
-
terminalTypeAtms: 'Банкоматы',
|
|
20
|
-
terminalTypeTerm: 'Терминалы',
|
|
21
|
-
workAllTime: 'Круглосуточно',
|
|
22
25
|
billAcceptorEnable: 'Прием наличных',
|
|
23
|
-
premiumService: 'Премиальное обслуживание',
|
|
24
|
-
privateBanking: 'Услуга Private banking',
|
|
25
|
-
sellingCoins: 'Продажа монет из драгоценных металлов',
|
|
26
|
-
buyingCoins: 'Покупка монет из драгоценных металлов',
|
|
27
26
|
bullionOperations: 'Операции со слитками',
|
|
28
|
-
|
|
29
|
-
transferringDataToBiometricSystem: 'Передача фото и голоса в Единую биометрическую систему',
|
|
30
|
-
locationDisabledPeople: 'Для маломобильных',
|
|
27
|
+
buyingCoins: 'Покупка монет из драгоценных металлов',
|
|
31
28
|
designDisabledPeople: 'Для слабовидящих',
|
|
29
|
+
locationDisabledPeople: 'Для маломобильных',
|
|
30
|
+
preciousMetalsOperations: 'Операции с драгоценными металлами',
|
|
31
|
+
premiumService: 'Премиальное обслуживание',
|
|
32
|
+
privateBanking: 'Услуга Private banking',
|
|
32
33
|
remoteWorkplace: 'Удаленное рабочее место',
|
|
34
|
+
terminalTypeAtms: 'Банкоматы',
|
|
35
|
+
terminalTypeTerm: 'Терминалы',
|
|
36
|
+
transferringDataToBiometricSystem: 'Передача фото и голоса в Единую биометрическую систему',
|
|
37
|
+
sellingCoins: 'Продажа монет из драгоценных металлов',
|
|
38
|
+
safeBoxCaseVolumes: 'Аренда индивидуальных сейфовых ячеек',
|
|
33
39
|
serviceDisabledPeople: 'Для маломобильных граждан',
|
|
40
|
+
workAllTime: 'Круглосуточно',
|
|
41
|
+
workingSaturday: 'Открыты по субботам',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const FILTRATION_PREDICATES_ATMS = {
|
|
45
|
+
terminalTypeTerm: (item: Atm) => item.terminalType?.toLowerCase() === 'терминал',
|
|
46
|
+
terminalTypeAtms: (item: Atm) => item.terminalType?.toLowerCase() === 'банкомат',
|
|
47
|
+
workAllTime: (item: Atm) => item.workTime?.toLowerCase() === 'круглосуточно',
|
|
48
|
+
billAcceptorEnable: (item: Atm) => Boolean(item.billAcceptorEnable),
|
|
49
|
+
locationDisabledPeople: (item: Atm) => Boolean(item.locationDisabledPeople),
|
|
50
|
+
designDisabledPeople: (item: Atm) => Boolean(item.designDisabledPeople),
|
|
34
51
|
};
|
|
35
52
|
|
|
36
53
|
export const FILTRATION_PREDICATES = {
|
|
54
|
+
...FILTRATION_PREDICATES_ATMS,
|
|
37
55
|
workingSaturday: (item: Branch | RemoteWorkplace) =>
|
|
38
56
|
Boolean('workSchedule' in item && item.workSchedule?.workingSaturday),
|
|
39
57
|
premiumService: (item: Branch | RemoteWorkplace) =>
|
|
@@ -29,7 +29,7 @@ export const renderButtonsGroup = (
|
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
|
-
<div className="flex gap-lg flex-col sm:flex-row
|
|
32
|
+
<div className="flex gap-lg flex-col sm:flex-row">
|
|
33
33
|
<Button data-id="all" onClick={(e) => handleClick(e, 'all', data)} version={allButtonVersion}>
|
|
34
34
|
Для физических лиц
|
|
35
35
|
</Button>
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import { Img } from '../../ui-kit/Img/Img';
|
|
2
2
|
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
3
3
|
import { Text } from '../../ui-kit/Text/Text';
|
|
4
|
-
import { type AtmsDef } from './OfficesAtmsMapContent';
|
|
4
|
+
import { type AtmsDef, type ItemList } from './OfficesAtmsMapContent';
|
|
5
5
|
|
|
6
6
|
export const renderDescriptionBlock = ({ __html, list, richVersion }: AtmsDef) =>
|
|
7
7
|
__html || list?.length ? (
|
|
8
|
-
<div className="
|
|
9
|
-
{__html ?
|
|
10
|
-
<div className="mb-2xl">
|
|
11
|
-
<RichText __html={__html} richVersion={richVersion} />
|
|
12
|
-
</div>
|
|
13
|
-
) : null}
|
|
8
|
+
<div className="border-b sm:border border-main-divider rounded-md space-y-2xl">
|
|
9
|
+
{__html ? <RichText __html={__html} richVersion={richVersion} /> : null}
|
|
14
10
|
{list?.length ? (
|
|
15
11
|
<div className="flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl">
|
|
16
|
-
{list.map(
|
|
17
|
-
<div key={String(i)} className="flex gap-xs items-center">
|
|
18
|
-
{item?.image ? <Img image={item.image} /> : null}
|
|
19
|
-
{item?.text ? (
|
|
20
|
-
<Text size="text-m" font="font-light">
|
|
21
|
-
{item.text}
|
|
22
|
-
</Text>
|
|
23
|
-
) : null}
|
|
24
|
-
</div>
|
|
25
|
-
))}
|
|
12
|
+
{list.map(renderItem)}
|
|
26
13
|
</div>
|
|
27
14
|
) : null}
|
|
28
15
|
</div>
|
|
29
16
|
) : null;
|
|
17
|
+
|
|
18
|
+
const renderItem = (item: ItemList, i: number) => (
|
|
19
|
+
<div key={String(i)} className="flex gap-xs items-center">
|
|
20
|
+
<Img image={item.image} />
|
|
21
|
+
{item?.text ? (
|
|
22
|
+
<Text size="text-m" font="font-light">
|
|
23
|
+
{item.text}
|
|
24
|
+
</Text>
|
|
25
|
+
) : null}
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
2
2
|
import { Text } from '../../ui-kit/Text/Text';
|
|
3
3
|
|
|
4
|
-
export const renderHeading = (title?: string, lengthItems?: number) =>
|
|
5
|
-
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
export const renderHeading = (title?: string, lengthItems?: number) =>
|
|
5
|
+
title ? (
|
|
6
|
+
<div className="flex flex-row gap-xs">
|
|
7
|
+
<Heading headingType="h3">
|
|
8
|
+
<span suppressHydrationWarning>{title}</span>
|
|
9
|
+
{lengthItems ? (
|
|
10
|
+
<Text size="text-h2" color="text-secondary-text">
|
|
11
|
+
<span suppressHydrationWarning>{` (${lengthItems})`}</span>
|
|
12
|
+
</Text>
|
|
13
|
+
) : null}
|
|
14
|
+
</Heading>
|
|
15
|
+
</div>
|
|
16
|
+
) : null;
|
|
@@ -18,7 +18,7 @@ export const PriceList = JSX<PriceListProps>(({ priceList }) =>
|
|
|
18
18
|
const renderPriceListItem = ({ label, amount, unit }: PriceItem, i: number) => (
|
|
19
19
|
<div
|
|
20
20
|
key={String(i)}
|
|
21
|
-
className="basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg
|
|
21
|
+
className="basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg rounded-md items-baseline whitespace-pre"
|
|
22
22
|
role="listitem"
|
|
23
23
|
>
|
|
24
24
|
<Text font="font-light" size="text-l" color="text-secondary-text">
|
|
@@ -31,7 +31,7 @@ export const TopItem = JSX<TopItemProps>(
|
|
|
31
31
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
32
32
|
{...getAspectsAttributes(data)}
|
|
33
33
|
>
|
|
34
|
-
<span suppressHydrationWarning
|
|
34
|
+
<span suppressHydrationWarning className={getTextStyle(active, flat)}>
|
|
35
35
|
{text || children}
|
|
36
36
|
</span>
|
|
37
37
|
</a>
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@ export const AdTile = JSX<AdTileProps>((props) => {
|
|
|
20
20
|
const content = items?.[tileIndex];
|
|
21
21
|
|
|
22
22
|
return content ? (
|
|
23
|
-
<ProductBlock suppressHydrationWarning
|
|
23
|
+
<ProductBlock suppressHydrationWarning {...content} {...props} />
|
|
24
24
|
) : (
|
|
25
25
|
<BlockWrapper {...props}>
|
|
26
26
|
<Shimmer />
|
|
@@ -1062,13 +1062,13 @@
|
|
|
1062
1062
|
}
|
|
1063
1063
|
],
|
|
1064
1064
|
[
|
|
1065
|
-
"
|
|
1065
|
+
"Шеф в деле",
|
|
1066
1066
|
{
|
|
1067
1067
|
"content": {
|
|
1068
1068
|
"version": "primary",
|
|
1069
1069
|
"padding": "",
|
|
1070
|
-
"title": "Заявка по акции '
|
|
1071
|
-
"typeForm": "
|
|
1070
|
+
"title": "Заявка по акции 'Шеф в деле'",
|
|
1071
|
+
"typeForm": "FCB",
|
|
1072
1072
|
"endpoint": "sendcorporatelead",
|
|
1073
1073
|
"sections": [
|
|
1074
1074
|
{
|
|
@@ -656,8 +656,8 @@ export default {
|
|
|
656
656
|
<div className="container grid grid-cols-12">
|
|
657
657
|
<ApplicationForm
|
|
658
658
|
className="col-span-12"
|
|
659
|
-
title="Заявка по акции '
|
|
660
|
-
typeForm="
|
|
659
|
+
title="Заявка по акции 'Шеф в деле'"
|
|
660
|
+
typeForm="FCB"
|
|
661
661
|
endpoint="sendcorporatelead"
|
|
662
662
|
sections={[
|
|
663
663
|
{
|
|
@@ -651,8 +651,8 @@ export default {
|
|
|
651
651
|
<div className="container grid grid-cols-12">
|
|
652
652
|
<ApplicationForm
|
|
653
653
|
className="col-span-12"
|
|
654
|
-
title="Заявка по акции '
|
|
655
|
-
typeForm="
|
|
654
|
+
title="Заявка по акции 'Шеф в деле'"
|
|
655
|
+
typeForm="FCB"
|
|
656
656
|
endpoint="sendcorporatelead"
|
|
657
657
|
sections={[
|
|
658
658
|
{
|
|
@@ -3,44 +3,31 @@ import { useLocation } from '../../hooks/useLocation';
|
|
|
3
3
|
import { type ComponentType } from '../../model/ComponentType';
|
|
4
4
|
import { type AtmsDef } from './OfficesAtmsMapContent';
|
|
5
5
|
import { OfficesAtmsMapLayout } from './OfficesAtmsMapLayout';
|
|
6
|
-
import { type Atm } from './OfficesAtmsMapProps';
|
|
7
6
|
import { getAtmPoint, renderAtmCard } from './renderAtmCard';
|
|
8
7
|
import { useAtms } from './useAtms';
|
|
9
8
|
|
|
10
9
|
const INITIAL_FILTRATION_STATE = {
|
|
11
|
-
terminalTypeAtms: true,
|
|
12
10
|
terminalTypeTerm: false,
|
|
11
|
+
terminalTypeAtms: false,
|
|
13
12
|
workAllTime: false,
|
|
14
13
|
billAcceptorEnable: false,
|
|
15
14
|
locationDisabledPeople: false,
|
|
16
15
|
designDisabledPeople: false,
|
|
17
16
|
};
|
|
18
17
|
|
|
19
|
-
const FILTRATION_PREDICATES = {
|
|
20
|
-
terminalTypeAtms: (item: Atm) => item.terminalType?.toLowerCase() === 'банкомат',
|
|
21
|
-
terminalTypeTerm: (item: Atm) => item.terminalType?.toLowerCase() === 'терминал',
|
|
22
|
-
workAllTime: (item: Atm) => item.workTime?.toLowerCase() === 'круглосуточно',
|
|
23
|
-
billAcceptorEnable: (item: Atm) => Boolean(item.billAcceptorEnable),
|
|
24
|
-
locationDisabledPeople: (item: Atm) => Boolean(item.locationDisabledPeople),
|
|
25
|
-
designDisabledPeople: (item: Atm) => Boolean(item.designDisabledPeople),
|
|
26
|
-
};
|
|
27
|
-
|
|
28
18
|
export interface AtmsMapProps extends ComponentType {
|
|
29
19
|
descriptionData?: AtmsDef;
|
|
30
20
|
}
|
|
31
21
|
|
|
32
22
|
export const AtmsMap = JSX<AtmsMapProps>(({ descriptionData, className }) => {
|
|
33
23
|
const currentLocation = useLocation();
|
|
34
|
-
|
|
35
24
|
const regionCode = currentLocation?.code ?? '000';
|
|
36
|
-
|
|
37
|
-
const { data: officesData, isLoad } = useAtms(regionCode);
|
|
25
|
+
const { data, isLoad } = useAtms(regionCode);
|
|
38
26
|
|
|
39
27
|
return (
|
|
40
28
|
<OfficesAtmsMapLayout
|
|
41
29
|
className={className}
|
|
42
|
-
|
|
43
|
-
data={officesData}
|
|
30
|
+
data={data}
|
|
44
31
|
isLoad={isLoad}
|
|
45
32
|
initFilterState={INITIAL_FILTRATION_STATE}
|
|
46
33
|
renderCard={renderAtmCard}
|
|
@@ -50,18 +37,3 @@ export const AtmsMap = JSX<AtmsMapProps>(({ descriptionData, className }) => {
|
|
|
50
37
|
/>
|
|
51
38
|
);
|
|
52
39
|
});
|
|
53
|
-
|
|
54
|
-
const filterItems = (data: Atm[], filtrationState: Record<string, boolean>) => {
|
|
55
|
-
const truthyFilters = Object.keys(filtrationState).filter((key) => filtrationState[key]);
|
|
56
|
-
const filtersOR = truthyFilters.filter((_) => _.startsWith('terminalType'));
|
|
57
|
-
const filtersAND = truthyFilters.filter((_) => !filtersOR.includes(_));
|
|
58
|
-
|
|
59
|
-
return data.filter((item) => {
|
|
60
|
-
const resultAND = filtersAND.every((_) => FILTRATION_PREDICATES[_](item));
|
|
61
|
-
const resultOR = filtersOR.length
|
|
62
|
-
? filtersOR.some((_) => FILTRATION_PREDICATES[_](item))
|
|
63
|
-
: true;
|
|
64
|
-
|
|
65
|
-
return resultAND && resultOR;
|
|
66
|
-
});
|
|
67
|
-
};
|
|
@@ -27,7 +27,6 @@ export interface OfficesAtmsMapLayoutProps<T> extends ComponentType, TitleProps
|
|
|
27
27
|
remoteWorkplaces?: T[];
|
|
28
28
|
renderCard?: (item: T, index: number) => VNode;
|
|
29
29
|
renderRemoteWorkplaceCard?: (item: T, index: number) => VNode;
|
|
30
|
-
filterItems?: (data: T[], filtrationState: InitFilterState) => T[];
|
|
31
30
|
getBalloon?: (item: T) => BalloonContent;
|
|
32
31
|
getBalloonRemoteWorkplaces?: (item: T) => BalloonContent;
|
|
33
32
|
initFilterState?: InitFilterState;
|
|
@@ -46,12 +45,13 @@ export const OfficesAtmsMapLayout = JSX<OfficesAtmsMapLayoutProps<Branch | Atm |
|
|
|
46
45
|
renderCard = defaultEmptyFunction,
|
|
47
46
|
renderRemoteWorkplaceCard = defaultEmptyFunction,
|
|
48
47
|
getBalloon = defaultEmptyFunction,
|
|
48
|
+
initFilterState = INITIAL_FILTRATION_STATE,
|
|
49
49
|
getBalloonRemoteWorkplaces = defaultEmptyFunction,
|
|
50
50
|
descriptionData,
|
|
51
51
|
title,
|
|
52
52
|
}) => {
|
|
53
53
|
const onlyOffice = title?.includes('Офис');
|
|
54
|
-
const [filtrationState, { field, reset }] = useForm(
|
|
54
|
+
const [filtrationState, { field, reset }] = useForm(initFilterState);
|
|
55
55
|
|
|
56
56
|
const { filteredItems, points, filteredRemoteWorkplaces, lengthItems } = useOfficesAtmsMapData({
|
|
57
57
|
data,
|
|
@@ -66,7 +66,7 @@ export const OfficesAtmsMapLayout = JSX<OfficesAtmsMapLayoutProps<Branch | Atm |
|
|
|
66
66
|
return (
|
|
67
67
|
<div className={style('space-y-1', className)}>
|
|
68
68
|
<div className="bg-white">
|
|
69
|
-
<div className="p-3xl pb-0">
|
|
69
|
+
<div className="p-3xl pb-0 grid gap-xl">
|
|
70
70
|
{renderHeading(title, lengthItems)}
|
|
71
71
|
{descriptionData ? renderDescriptionBlock(descriptionData) : null}
|
|
72
72
|
{onlyOffice && renderButtonsGroup(data, activeButton, setActiveButton)}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Atm, type Branch, type RemoteWorkplace } from './OfficesAtmsMapProps';
|
|
2
|
+
|
|
3
|
+
const ATMS_INITIAL_FILTRATION_STATE = {
|
|
4
|
+
billAcceptorEnable: false,
|
|
5
|
+
workAllTime: false,
|
|
6
|
+
terminalTypeTerm: false,
|
|
7
|
+
terminalTypeAtms: false,
|
|
8
|
+
};
|
|
2
9
|
|
|
3
10
|
export const INITIAL_FILTRATION_STATE = {
|
|
4
11
|
workingSaturday: false,
|
|
@@ -11,29 +18,40 @@ export const INITIAL_FILTRATION_STATE = {
|
|
|
11
18
|
bullionOperations: false,
|
|
12
19
|
preciousMetalsOperations: false,
|
|
13
20
|
transferringDataToBiometricSystem: false,
|
|
21
|
+
...ATMS_INITIAL_FILTRATION_STATE,
|
|
14
22
|
};
|
|
15
23
|
|
|
16
24
|
export const FILTRATION_LABELS = {
|
|
17
|
-
safeBoxCaseVolumes: 'Аренда индивидуальных сейфовых ячеек',
|
|
18
|
-
workingSaturday: 'Открыты по субботам',
|
|
19
|
-
terminalTypeAtms: 'Банкоматы',
|
|
20
|
-
terminalTypeTerm: 'Терминалы',
|
|
21
|
-
workAllTime: 'Круглосуточно',
|
|
22
25
|
billAcceptorEnable: 'Прием наличных',
|
|
23
|
-
premiumService: 'Премиальное обслуживание',
|
|
24
|
-
privateBanking: 'Услуга Private banking',
|
|
25
|
-
sellingCoins: 'Продажа монет из драгоценных металлов',
|
|
26
|
-
buyingCoins: 'Покупка монет из драгоценных металлов',
|
|
27
26
|
bullionOperations: 'Операции со слитками',
|
|
28
|
-
|
|
29
|
-
transferringDataToBiometricSystem: 'Передача фото и голоса в Единую биометрическую систему',
|
|
30
|
-
locationDisabledPeople: 'Для маломобильных',
|
|
27
|
+
buyingCoins: 'Покупка монет из драгоценных металлов',
|
|
31
28
|
designDisabledPeople: 'Для слабовидящих',
|
|
29
|
+
locationDisabledPeople: 'Для маломобильных',
|
|
30
|
+
preciousMetalsOperations: 'Операции с драгоценными металлами',
|
|
31
|
+
premiumService: 'Премиальное обслуживание',
|
|
32
|
+
privateBanking: 'Услуга Private banking',
|
|
32
33
|
remoteWorkplace: 'Удаленное рабочее место',
|
|
34
|
+
terminalTypeAtms: 'Банкоматы',
|
|
35
|
+
terminalTypeTerm: 'Терминалы',
|
|
36
|
+
transferringDataToBiometricSystem: 'Передача фото и голоса в Единую биометрическую систему',
|
|
37
|
+
sellingCoins: 'Продажа монет из драгоценных металлов',
|
|
38
|
+
safeBoxCaseVolumes: 'Аренда индивидуальных сейфовых ячеек',
|
|
33
39
|
serviceDisabledPeople: 'Для маломобильных граждан',
|
|
40
|
+
workAllTime: 'Круглосуточно',
|
|
41
|
+
workingSaturday: 'Открыты по субботам',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const FILTRATION_PREDICATES_ATMS = {
|
|
45
|
+
terminalTypeTerm: (item: Atm) => item.terminalType?.toLowerCase() === 'терминал',
|
|
46
|
+
terminalTypeAtms: (item: Atm) => item.terminalType?.toLowerCase() === 'банкомат',
|
|
47
|
+
workAllTime: (item: Atm) => item.workTime?.toLowerCase() === 'круглосуточно',
|
|
48
|
+
billAcceptorEnable: (item: Atm) => Boolean(item.billAcceptorEnable),
|
|
49
|
+
locationDisabledPeople: (item: Atm) => Boolean(item.locationDisabledPeople),
|
|
50
|
+
designDisabledPeople: (item: Atm) => Boolean(item.designDisabledPeople),
|
|
34
51
|
};
|
|
35
52
|
|
|
36
53
|
export const FILTRATION_PREDICATES = {
|
|
54
|
+
...FILTRATION_PREDICATES_ATMS,
|
|
37
55
|
workingSaturday: (item: Branch | RemoteWorkplace) =>
|
|
38
56
|
Boolean('workSchedule' in item && item.workSchedule?.workingSaturday),
|
|
39
57
|
premiumService: (item: Branch | RemoteWorkplace) =>
|
|
@@ -29,7 +29,7 @@ export const renderButtonsGroup = (
|
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
|
-
<div className="flex gap-lg flex-col sm:flex-row
|
|
32
|
+
<div className="flex gap-lg flex-col sm:flex-row">
|
|
33
33
|
<Button data-id="all" onClick={(e) => handleClick(e, 'all', data)} version={allButtonVersion}>
|
|
34
34
|
Для физических лиц
|
|
35
35
|
</Button>
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import { Img } from '../../ui-kit/Img/Img';
|
|
2
2
|
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
3
3
|
import { Text } from '../../ui-kit/Text/Text';
|
|
4
|
-
import { type AtmsDef } from './OfficesAtmsMapContent';
|
|
4
|
+
import { type AtmsDef, type ItemList } from './OfficesAtmsMapContent';
|
|
5
5
|
|
|
6
6
|
export const renderDescriptionBlock = ({ __html, list, richVersion }: AtmsDef) =>
|
|
7
7
|
__html || list?.length ? (
|
|
8
|
-
<div className="
|
|
9
|
-
{__html ?
|
|
10
|
-
<div className="mb-2xl">
|
|
11
|
-
<RichText __html={__html} richVersion={richVersion} />
|
|
12
|
-
</div>
|
|
13
|
-
) : null}
|
|
8
|
+
<div className="border-b sm:border border-main-divider rounded-md space-y-2xl">
|
|
9
|
+
{__html ? <RichText __html={__html} richVersion={richVersion} /> : null}
|
|
14
10
|
{list?.length ? (
|
|
15
11
|
<div className="flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl">
|
|
16
|
-
{list.map(
|
|
17
|
-
<div key={String(i)} className="flex gap-xs items-center">
|
|
18
|
-
{item?.image ? <Img image={item.image} /> : null}
|
|
19
|
-
{item?.text ? (
|
|
20
|
-
<Text size="text-m" font="font-light">
|
|
21
|
-
{item.text}
|
|
22
|
-
</Text>
|
|
23
|
-
) : null}
|
|
24
|
-
</div>
|
|
25
|
-
))}
|
|
12
|
+
{list.map(renderItem)}
|
|
26
13
|
</div>
|
|
27
14
|
) : null}
|
|
28
15
|
</div>
|
|
29
16
|
) : null;
|
|
17
|
+
|
|
18
|
+
const renderItem = (item: ItemList, i: number) => (
|
|
19
|
+
<div key={String(i)} className="flex gap-xs items-center">
|
|
20
|
+
<Img image={item.image} />
|
|
21
|
+
{item?.text ? (
|
|
22
|
+
<Text size="text-m" font="font-light">
|
|
23
|
+
{item.text}
|
|
24
|
+
</Text>
|
|
25
|
+
) : null}
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
2
2
|
import { Text } from '../../ui-kit/Text/Text';
|
|
3
3
|
|
|
4
|
-
export const renderHeading = (title?: string, lengthItems?: number) =>
|
|
5
|
-
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
export const renderHeading = (title?: string, lengthItems?: number) =>
|
|
5
|
+
title ? (
|
|
6
|
+
<div className="flex flex-row gap-xs">
|
|
7
|
+
<Heading headingType="h3">
|
|
8
|
+
<span suppressHydrationWarning>{title}</span>
|
|
9
|
+
{lengthItems ? (
|
|
10
|
+
<Text size="text-h2" color="text-secondary-text">
|
|
11
|
+
<span suppressHydrationWarning>{` (${lengthItems})`}</span>
|
|
12
|
+
</Text>
|
|
13
|
+
) : null}
|
|
14
|
+
</Heading>
|
|
15
|
+
</div>
|
|
16
|
+
) : null;
|
|
@@ -18,7 +18,7 @@ export const PriceList = JSX<PriceListProps>(({ priceList }) =>
|
|
|
18
18
|
const renderPriceListItem = ({ label, amount, unit }: PriceItem, i: number) => (
|
|
19
19
|
<div
|
|
20
20
|
key={String(i)}
|
|
21
|
-
className="basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg
|
|
21
|
+
className="basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg rounded-md items-baseline whitespace-pre"
|
|
22
22
|
role="listitem"
|
|
23
23
|
>
|
|
24
24
|
<Text font="font-light" size="text-l" color="text-secondary-text">
|
|
@@ -31,7 +31,7 @@ export const TopItem = JSX<TopItemProps>(
|
|
|
31
31
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
32
32
|
{...getAspectsAttributes(data)}
|
|
33
33
|
>
|
|
34
|
-
<span suppressHydrationWarning
|
|
34
|
+
<span suppressHydrationWarning className={getTextStyle(active, flat)}>
|
|
35
35
|
{text || children}
|
|
36
36
|
</span>
|
|
37
37
|
</a>
|