@redneckz/wildless-cms-uni-blocks 0.14.898 → 0.14.899
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/bundle.umd.js +76 -8
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
- package/bundle/components/OfficesAtmsMap/filters.d.ts +18 -0
- package/dist/components/OfficesAtmsMap/FiltrationForm.js +58 -7
- package/dist/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
- package/dist/components/OfficesAtmsMap/filters.d.ts +18 -0
- package/dist/components/OfficesAtmsMap/filters.js +18 -0
- package/dist/components/OfficesAtmsMap/filters.js.map +1 -1
- package/lib/components/OfficesAtmsMap/FiltrationForm.js +58 -7
- package/lib/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
- package/lib/components/OfficesAtmsMap/filters.d.ts +18 -0
- package/lib/components/OfficesAtmsMap/filters.js +18 -0
- package/lib/components/OfficesAtmsMap/filters.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +76 -8
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
- package/mobile/bundle/components/OfficesAtmsMap/filters.d.ts +18 -0
- package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.js +58 -7
- package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
- package/mobile/dist/components/OfficesAtmsMap/filters.d.ts +18 -0
- package/mobile/dist/components/OfficesAtmsMap/filters.js +18 -0
- package/mobile/dist/components/OfficesAtmsMap/filters.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.js +58 -7
- package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
- package/mobile/lib/components/OfficesAtmsMap/filters.d.ts +18 -0
- package/mobile/lib/components/OfficesAtmsMap/filters.js +18 -0
- package/mobile/lib/components/OfficesAtmsMap/filters.js.map +1 -1
- package/mobile/src/components/OfficesAtmsMap/FiltrationForm.tsx +91 -12
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +6 -0
- package/mobile/src/components/OfficesAtmsMap/filters.ts +24 -0
- package/package.json +1 -1
- package/src/components/OfficesAtmsMap/FiltrationForm.tsx +91 -12
- package/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +6 -0
- package/src/components/OfficesAtmsMap/filters.ts +24 -0
|
@@ -18,6 +18,12 @@ export const INITIAL_FILTRATION_STATE = {
|
|
|
18
18
|
bullionOperations: false,
|
|
19
19
|
preciousMetalsOperations: false,
|
|
20
20
|
transferringDataToBiometricSystem: false,
|
|
21
|
+
hasAccessibilitySign: false,
|
|
22
|
+
equippedWithRamp: false,
|
|
23
|
+
equippedWithLift: false,
|
|
24
|
+
equippedWithElevator: false,
|
|
25
|
+
equippedWithStairclimber: false,
|
|
26
|
+
hasHelpMeButton: false,
|
|
21
27
|
...ATMS_INITIAL_FILTRATION_STATE,
|
|
22
28
|
};
|
|
23
29
|
|
|
@@ -39,6 +45,12 @@ export const FILTRATION_LABELS = {
|
|
|
39
45
|
serviceDisabledPeople: 'Для маломобильных граждан',
|
|
40
46
|
workAllTime: 'Круглосуточно',
|
|
41
47
|
workingSaturday: 'Открыты по субботам',
|
|
48
|
+
hasAccessibilitySign: 'Без барьеров',
|
|
49
|
+
equippedWithRamp: 'Есть пандус',
|
|
50
|
+
equippedWithLift: 'Есть подъёмник',
|
|
51
|
+
equippedWithElevator: 'Есть лифт',
|
|
52
|
+
equippedWithStairclimber: 'Есть лестницеход',
|
|
53
|
+
hasHelpMeButton: 'Есть кнопка «HELP ME»',
|
|
42
54
|
};
|
|
43
55
|
|
|
44
56
|
const FILTRATION_PREDICATES_ATMS = {
|
|
@@ -71,4 +83,16 @@ export const FILTRATION_PREDICATES = {
|
|
|
71
83
|
Boolean('preciousMetalsOperations' in item && item.preciousMetalsOperations),
|
|
72
84
|
transferringDataToBiometricSystem: (item: Branch | RemoteWorkplace) =>
|
|
73
85
|
Boolean('transferringDataToBiometricSystem' in item && item.transferringDataToBiometricSystem),
|
|
86
|
+
hasAccessibilitySign: (item: Branch | RemoteWorkplace) =>
|
|
87
|
+
Boolean('hasAccessibilitySign' in item && item.hasAccessibilitySign),
|
|
88
|
+
equippedWithRamp: (item: Branch | RemoteWorkplace) =>
|
|
89
|
+
Boolean('equippedWithRamp' in item && item.equippedWithRamp),
|
|
90
|
+
equippedWithLift: (item: Branch | RemoteWorkplace) =>
|
|
91
|
+
Boolean('equippedWithLift' in item && item.equippedWithLift),
|
|
92
|
+
equippedWithElevator: (item: Branch | RemoteWorkplace) =>
|
|
93
|
+
Boolean('equippedWithElevator' in item && item.equippedWithElevator),
|
|
94
|
+
equippedWithStairclimber: (item: Branch | RemoteWorkplace) =>
|
|
95
|
+
Boolean('equippedWithStairclimber' in item && item.equippedWithStairclimber),
|
|
96
|
+
hasHelpMeButton: (item: Branch | RemoteWorkplace) =>
|
|
97
|
+
Boolean('hasHelpMeButton' in item && item.hasHelpMeButton),
|
|
74
98
|
};
|
package/package.json
CHANGED
|
@@ -8,8 +8,32 @@ import { DefaultFoldButton } from '../../ui-kit/Foldable/DefaultFoldButton';
|
|
|
8
8
|
import { Foldable } from '../../ui-kit/Foldable/Foldable';
|
|
9
9
|
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
10
10
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
11
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
11
12
|
|
|
12
13
|
const COMMON_FILTERS_STYLES = 'flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl';
|
|
14
|
+
const VISIBLE_FILTERS = [
|
|
15
|
+
'workingSaturday',
|
|
16
|
+
'premiumService',
|
|
17
|
+
'privateBanking',
|
|
18
|
+
'remoteWorkplace',
|
|
19
|
+
'serviceDisabledPeople',
|
|
20
|
+
'transferringDataToBiometricSystem',
|
|
21
|
+
];
|
|
22
|
+
const PRECIOUS_METALS_FILTERS = [
|
|
23
|
+
'sellingCoins',
|
|
24
|
+
'buyingCoins',
|
|
25
|
+
'bullionOperations',
|
|
26
|
+
'preciousMetalsOperations',
|
|
27
|
+
];
|
|
28
|
+
const DISABLED_SERVICE_FILTERS = [
|
|
29
|
+
'hasAccessibilitySign',
|
|
30
|
+
'equippedWithRamp',
|
|
31
|
+
'equippedWithLift',
|
|
32
|
+
'equippedWithElevator',
|
|
33
|
+
'equippedWithStairclimber',
|
|
34
|
+
'hasHelpMeButton',
|
|
35
|
+
];
|
|
36
|
+
const VISIBLE_ATMS_FILTERS_NUM = 6;
|
|
13
37
|
|
|
14
38
|
export interface RenderFiltrationFormProps {
|
|
15
39
|
filters: string[];
|
|
@@ -18,18 +42,25 @@ export interface RenderFiltrationFormProps {
|
|
|
18
42
|
labels: Record<string, string>;
|
|
19
43
|
}
|
|
20
44
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
45
|
+
type getFilterProps = {
|
|
46
|
+
onlyOffice?: boolean;
|
|
47
|
+
filtersCheckbox?: filtersCheckboxType[];
|
|
48
|
+
};
|
|
24
49
|
|
|
25
|
-
|
|
50
|
+
type filtersCheckboxType = {
|
|
51
|
+
key: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const FiltrationForm = JSX<RenderFiltrationFormProps>(
|
|
55
|
+
({ filters = [], field: { field, reset }, onlyOffice, labels }) => {
|
|
56
|
+
const filtersCheckbox = filters.map((key) => (
|
|
26
57
|
<Checkbox key={key} text={labels[key]} {...field(key)} />
|
|
27
58
|
));
|
|
28
59
|
|
|
29
|
-
const [visibleFilters,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
60
|
+
const [visibleFilters, hiddenPreciousMetalsFilters, hiddenDisabledServiceFilters] = getFilters({
|
|
61
|
+
onlyOffice,
|
|
62
|
+
filtersCheckbox,
|
|
63
|
+
});
|
|
33
64
|
|
|
34
65
|
const [isUnfolded, { toggle }] = useBool(false);
|
|
35
66
|
|
|
@@ -40,11 +71,8 @@ export const FiltrationForm = JSX<RenderFiltrationFormProps>(
|
|
|
40
71
|
<Foldable>
|
|
41
72
|
<div>
|
|
42
73
|
<div className={COMMON_FILTERS_STYLES}>{visibleFilters}</div>
|
|
43
|
-
<FoldableSection className={COMMON_FILTERS_STYLES} isUnfolded={isUnfolded}>
|
|
44
|
-
{hiddenFilters}
|
|
45
|
-
</FoldableSection>
|
|
46
74
|
</div>
|
|
47
|
-
<div className="flex space-x-lg">
|
|
75
|
+
<div className="flex space-x-lg pb-2xl">
|
|
48
76
|
{onlyOffice ? (
|
|
49
77
|
<DefaultFoldButton
|
|
50
78
|
label={isUnfolded ? 'Меньше фильтров' : 'Больше фильтров'}
|
|
@@ -59,6 +87,15 @@ export const FiltrationForm = JSX<RenderFiltrationFormProps>(
|
|
|
59
87
|
<Icon name="CloseIcon" size="small" />
|
|
60
88
|
</Button>
|
|
61
89
|
</div>
|
|
90
|
+
<div>
|
|
91
|
+
<FoldableSection isUnfolded={isUnfolded}>
|
|
92
|
+
{renderFoldableSubsection('Драгоценные металлы', hiddenPreciousMetalsFilters)}
|
|
93
|
+
{renderFoldableSubsection(
|
|
94
|
+
'Специальные возможности',
|
|
95
|
+
hiddenDisabledServiceFilters,
|
|
96
|
+
)}
|
|
97
|
+
</FoldableSection>
|
|
98
|
+
</div>
|
|
62
99
|
</Foldable>
|
|
63
100
|
</div>
|
|
64
101
|
) : null}
|
|
@@ -66,3 +103,45 @@ export const FiltrationForm = JSX<RenderFiltrationFormProps>(
|
|
|
66
103
|
);
|
|
67
104
|
},
|
|
68
105
|
);
|
|
106
|
+
|
|
107
|
+
const getFilters = ({ onlyOffice = false, filtersCheckbox = [] }: getFilterProps) => {
|
|
108
|
+
return onlyOffice ? getOfficeFilters(filtersCheckbox) : getAtmsFilters(filtersCheckbox);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const getOfficeFilters = (filtersCheckbox: filtersCheckboxType[]) => {
|
|
112
|
+
const visibleFilters: filtersCheckboxType[] = [];
|
|
113
|
+
const preciousMetalsFilters: filtersCheckboxType[] = [];
|
|
114
|
+
const disabledServiceFilters: filtersCheckboxType[] = [];
|
|
115
|
+
|
|
116
|
+
for (const item of filtersCheckbox) {
|
|
117
|
+
if (VISIBLE_FILTERS.includes(item.key)) {
|
|
118
|
+
visibleFilters.push(item);
|
|
119
|
+
}
|
|
120
|
+
if (PRECIOUS_METALS_FILTERS.includes(item.key)) {
|
|
121
|
+
preciousMetalsFilters.push(item);
|
|
122
|
+
}
|
|
123
|
+
if (DISABLED_SERVICE_FILTERS.includes(item.key)) {
|
|
124
|
+
disabledServiceFilters.push(item);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return [visibleFilters, preciousMetalsFilters, disabledServiceFilters];
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const getAtmsFilters = (filtersCheckbox: filtersCheckboxType[]) => [
|
|
132
|
+
filtersCheckbox.slice(0, VISIBLE_ATMS_FILTERS_NUM),
|
|
133
|
+
filtersCheckbox.slice(VISIBLE_ATMS_FILTERS_NUM),
|
|
134
|
+
];
|
|
135
|
+
|
|
136
|
+
const renderFoldableSubsection = (text: string, filters: filtersCheckboxType[] = []) => {
|
|
137
|
+
return (
|
|
138
|
+
<div>
|
|
139
|
+
{filters.length > 0 ? (
|
|
140
|
+
<div className="space-y-s">
|
|
141
|
+
<Text>{text}</Text>
|
|
142
|
+
<div className={COMMON_FILTERS_STYLES}>{filters}</div>
|
|
143
|
+
</div>
|
|
144
|
+
) : null}
|
|
145
|
+
</div>
|
|
146
|
+
);
|
|
147
|
+
};
|
|
@@ -82,6 +82,12 @@ export interface Branch {
|
|
|
82
82
|
preciousMetalsOperations?: false;
|
|
83
83
|
transferringDataToBiometricSystem?: false;
|
|
84
84
|
serviceDisabledPeople?: false;
|
|
85
|
+
hasAccessibilitySign?: boolean;
|
|
86
|
+
equippedWithRamp?: boolean;
|
|
87
|
+
equippedWithLift?: boolean;
|
|
88
|
+
equippedWithElevator?: boolean;
|
|
89
|
+
equippedWithStairclimber?: boolean;
|
|
90
|
+
hasHelpMeButton?: boolean;
|
|
85
91
|
}
|
|
86
92
|
|
|
87
93
|
export interface RemoteWorkplace extends DescriptionProps {
|
|
@@ -18,6 +18,12 @@ export const INITIAL_FILTRATION_STATE = {
|
|
|
18
18
|
bullionOperations: false,
|
|
19
19
|
preciousMetalsOperations: false,
|
|
20
20
|
transferringDataToBiometricSystem: false,
|
|
21
|
+
hasAccessibilitySign: false,
|
|
22
|
+
equippedWithRamp: false,
|
|
23
|
+
equippedWithLift: false,
|
|
24
|
+
equippedWithElevator: false,
|
|
25
|
+
equippedWithStairclimber: false,
|
|
26
|
+
hasHelpMeButton: false,
|
|
21
27
|
...ATMS_INITIAL_FILTRATION_STATE,
|
|
22
28
|
};
|
|
23
29
|
|
|
@@ -39,6 +45,12 @@ export const FILTRATION_LABELS = {
|
|
|
39
45
|
serviceDisabledPeople: 'Для маломобильных граждан',
|
|
40
46
|
workAllTime: 'Круглосуточно',
|
|
41
47
|
workingSaturday: 'Открыты по субботам',
|
|
48
|
+
hasAccessibilitySign: 'Без барьеров',
|
|
49
|
+
equippedWithRamp: 'Есть пандус',
|
|
50
|
+
equippedWithLift: 'Есть подъёмник',
|
|
51
|
+
equippedWithElevator: 'Есть лифт',
|
|
52
|
+
equippedWithStairclimber: 'Есть лестницеход',
|
|
53
|
+
hasHelpMeButton: 'Есть кнопка «HELP ME»',
|
|
42
54
|
};
|
|
43
55
|
|
|
44
56
|
const FILTRATION_PREDICATES_ATMS = {
|
|
@@ -71,4 +83,16 @@ export const FILTRATION_PREDICATES = {
|
|
|
71
83
|
Boolean('preciousMetalsOperations' in item && item.preciousMetalsOperations),
|
|
72
84
|
transferringDataToBiometricSystem: (item: Branch | RemoteWorkplace) =>
|
|
73
85
|
Boolean('transferringDataToBiometricSystem' in item && item.transferringDataToBiometricSystem),
|
|
86
|
+
hasAccessibilitySign: (item: Branch | RemoteWorkplace) =>
|
|
87
|
+
Boolean('hasAccessibilitySign' in item && item.hasAccessibilitySign),
|
|
88
|
+
equippedWithRamp: (item: Branch | RemoteWorkplace) =>
|
|
89
|
+
Boolean('equippedWithRamp' in item && item.equippedWithRamp),
|
|
90
|
+
equippedWithLift: (item: Branch | RemoteWorkplace) =>
|
|
91
|
+
Boolean('equippedWithLift' in item && item.equippedWithLift),
|
|
92
|
+
equippedWithElevator: (item: Branch | RemoteWorkplace) =>
|
|
93
|
+
Boolean('equippedWithElevator' in item && item.equippedWithElevator),
|
|
94
|
+
equippedWithStairclimber: (item: Branch | RemoteWorkplace) =>
|
|
95
|
+
Boolean('equippedWithStairclimber' in item && item.equippedWithStairclimber),
|
|
96
|
+
hasHelpMeButton: (item: Branch | RemoteWorkplace) =>
|
|
97
|
+
Boolean('hasHelpMeButton' in item && item.hasHelpMeButton),
|
|
74
98
|
};
|