@redneckz/wildless-cms-uni-blocks 0.14.573 → 0.14.574

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.
Files changed (107) hide show
  1. package/bundle/bundle.umd.js +73 -61
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +2 -0
  4. package/bundle/components/OfficesAtmsMap/filters.d.ts +44 -0
  5. package/bundle/components/OfficesAtmsMap/renderButtonsGroup.d.ts +3 -0
  6. package/bundle/components/OfficesAtmsMap/renderFiltrationForm.d.ts +10 -4
  7. package/bundle/components/OfficesAtmsMap/renderHeading.d.ts +2 -0
  8. package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +2 -0
  9. package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +21 -25
  10. package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  11. package/dist/components/OfficesAtmsMap/OfficesMap.js +1 -29
  12. package/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  13. package/dist/components/OfficesAtmsMap/filters.d.ts +44 -0
  14. package/dist/components/OfficesAtmsMap/filters.js +46 -0
  15. package/dist/components/OfficesAtmsMap/filters.js.map +1 -0
  16. package/dist/components/OfficesAtmsMap/renderButtonsGroup.d.ts +3 -0
  17. package/dist/components/OfficesAtmsMap/renderButtonsGroup.js +21 -0
  18. package/dist/components/OfficesAtmsMap/renderButtonsGroup.js.map +1 -0
  19. package/dist/components/OfficesAtmsMap/renderFiltrationForm.d.ts +10 -4
  20. package/dist/components/OfficesAtmsMap/renderFiltrationForm.js +2 -21
  21. package/dist/components/OfficesAtmsMap/renderFiltrationForm.js.map +1 -1
  22. package/dist/components/OfficesAtmsMap/renderHeading.d.ts +2 -0
  23. package/dist/components/OfficesAtmsMap/renderHeading.js +8 -0
  24. package/dist/components/OfficesAtmsMap/renderHeading.js.map +1 -0
  25. package/dist/ui-kit/YandexMap/renderClusterer.js +4 -1
  26. package/dist/ui-kit/YandexMap/renderClusterer.js.map +1 -1
  27. package/lib/common.css +1 -1
  28. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +2 -0
  29. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +16 -22
  30. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  31. package/lib/components/OfficesAtmsMap/OfficesMap.js +1 -29
  32. package/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  33. package/lib/components/OfficesAtmsMap/filters.d.ts +44 -0
  34. package/lib/components/OfficesAtmsMap/filters.js +44 -0
  35. package/lib/components/OfficesAtmsMap/filters.js.map +1 -0
  36. package/lib/components/OfficesAtmsMap/renderButtonsGroup.d.ts +2 -0
  37. package/lib/components/OfficesAtmsMap/renderButtonsGroup.js +18 -0
  38. package/lib/components/OfficesAtmsMap/renderButtonsGroup.js.map +1 -0
  39. package/lib/components/OfficesAtmsMap/renderFiltrationForm.d.ts +10 -4
  40. package/lib/components/OfficesAtmsMap/renderFiltrationForm.js +2 -21
  41. package/lib/components/OfficesAtmsMap/renderFiltrationForm.js.map +1 -1
  42. package/lib/components/OfficesAtmsMap/renderHeading.d.ts +1 -0
  43. package/lib/components/OfficesAtmsMap/renderHeading.js +5 -0
  44. package/lib/components/OfficesAtmsMap/renderHeading.js.map +1 -0
  45. package/lib/ui-kit/YandexMap/renderClusterer.js +4 -1
  46. package/lib/ui-kit/YandexMap/renderClusterer.js.map +1 -1
  47. package/mobile/bundle/bundle.umd.js +73 -61
  48. package/mobile/bundle/bundle.umd.min.js +1 -1
  49. package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +2 -0
  50. package/mobile/bundle/components/OfficesAtmsMap/filters.d.ts +44 -0
  51. package/mobile/bundle/components/OfficesAtmsMap/renderButtonsGroup.d.ts +3 -0
  52. package/mobile/bundle/components/OfficesAtmsMap/renderFiltrationForm.d.ts +10 -4
  53. package/mobile/bundle/components/OfficesAtmsMap/renderHeading.d.ts +2 -0
  54. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +2 -0
  55. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +21 -25
  56. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  57. package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js +1 -29
  58. package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  59. package/mobile/dist/components/OfficesAtmsMap/filters.d.ts +44 -0
  60. package/mobile/dist/components/OfficesAtmsMap/filters.js +46 -0
  61. package/mobile/dist/components/OfficesAtmsMap/filters.js.map +1 -0
  62. package/mobile/dist/components/OfficesAtmsMap/renderButtonsGroup.d.ts +3 -0
  63. package/mobile/dist/components/OfficesAtmsMap/renderButtonsGroup.js +21 -0
  64. package/mobile/dist/components/OfficesAtmsMap/renderButtonsGroup.js.map +1 -0
  65. package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.d.ts +10 -4
  66. package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.js +2 -21
  67. package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.js.map +1 -1
  68. package/mobile/dist/components/OfficesAtmsMap/renderHeading.d.ts +2 -0
  69. package/mobile/dist/components/OfficesAtmsMap/renderHeading.js +8 -0
  70. package/mobile/dist/components/OfficesAtmsMap/renderHeading.js.map +1 -0
  71. package/mobile/dist/ui-kit/YandexMap/renderClusterer.js +4 -1
  72. package/mobile/dist/ui-kit/YandexMap/renderClusterer.js.map +1 -1
  73. package/mobile/lib/common.css +1 -1
  74. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +2 -0
  75. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +16 -22
  76. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  77. package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js +1 -29
  78. package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  79. package/mobile/lib/components/OfficesAtmsMap/filters.d.ts +44 -0
  80. package/mobile/lib/components/OfficesAtmsMap/filters.js +44 -0
  81. package/mobile/lib/components/OfficesAtmsMap/filters.js.map +1 -0
  82. package/mobile/lib/components/OfficesAtmsMap/renderButtonsGroup.d.ts +3 -0
  83. package/mobile/lib/components/OfficesAtmsMap/renderButtonsGroup.js +18 -0
  84. package/mobile/lib/components/OfficesAtmsMap/renderButtonsGroup.js.map +1 -0
  85. package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.d.ts +10 -4
  86. package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.js +2 -21
  87. package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.js.map +1 -1
  88. package/mobile/lib/components/OfficesAtmsMap/renderHeading.d.ts +2 -0
  89. package/mobile/lib/components/OfficesAtmsMap/renderHeading.js +5 -0
  90. package/mobile/lib/components/OfficesAtmsMap/renderHeading.js.map +1 -0
  91. package/mobile/lib/ui-kit/YandexMap/renderClusterer.js +4 -1
  92. package/mobile/lib/ui-kit/YandexMap/renderClusterer.js.map +1 -1
  93. package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +22 -58
  94. package/mobile/src/components/OfficesAtmsMap/OfficesMap.tsx +0 -47
  95. package/mobile/src/components/OfficesAtmsMap/filters.ts +56 -0
  96. package/mobile/src/components/OfficesAtmsMap/renderButtonsGroup.tsx +43 -0
  97. package/mobile/src/components/OfficesAtmsMap/renderFiltrationForm.tsx +14 -26
  98. package/mobile/src/components/OfficesAtmsMap/renderHeading.tsx +15 -0
  99. package/mobile/src/ui-kit/YandexMap/renderClusterer.ts +6 -2
  100. package/package.json +1 -1
  101. package/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +22 -58
  102. package/src/components/OfficesAtmsMap/OfficesMap.tsx +0 -47
  103. package/src/components/OfficesAtmsMap/filters.ts +56 -0
  104. package/src/components/OfficesAtmsMap/renderButtonsGroup.tsx +43 -0
  105. package/src/components/OfficesAtmsMap/renderFiltrationForm.tsx +14 -26
  106. package/src/components/OfficesAtmsMap/renderHeading.tsx +15 -0
  107. package/src/ui-kit/YandexMap/renderClusterer.ts +6 -2
@@ -0,0 +1,56 @@
1
+ import type { Branch, RemoteWorkplace } from './OfficesAtmsMapProps';
2
+
3
+ export const INITIAL_FILTRATION_STATE = {
4
+ workingSaturday: false,
5
+ premiumService: false,
6
+ privateBanking: false,
7
+ remoteWorkplace: false,
8
+ serviceDisabledPeople: false,
9
+ sellingCoins: false,
10
+ buyingCoins: false,
11
+ bullionOperations: false,
12
+ preciousMetalsOperations: false,
13
+ transferringDataToBiometricSystem: false,
14
+ };
15
+
16
+ export const FILTRATION_LABELS = {
17
+ safeBoxCaseVolumes: 'Аренда индивидуальных сейфовых ячеек',
18
+ workingSaturday: 'Открыты по субботам',
19
+ terminalTypeAtms: 'Банкоматы',
20
+ terminalTypeTerm: 'Терминалы',
21
+ workAllTime: 'Круглосуточно',
22
+ billAcceptorEnable: 'Прием наличных',
23
+ premiumService: 'Премиальное обслуживание',
24
+ privateBanking: 'Услуга Private banking',
25
+ sellingCoins: 'Продажа монет из драгоценных металлов',
26
+ buyingCoins: 'Покупка монет из драгоценных металлов',
27
+ bullionOperations: 'Операции со слитками',
28
+ preciousMetalsOperations: 'Операции с драгоценными металлами',
29
+ transferringDataToBiometricSystem: 'Передача фото и голоса в Единую биометрическую систему',
30
+ locationDisabledPeople: 'Для маломобильных',
31
+ designDisabledPeople: 'Для слабовидящих',
32
+ remoteWorkplace: 'Удаленное рабочее место',
33
+ serviceDisabledPeople: 'Для маломобильных граждан',
34
+ };
35
+
36
+ export const FILTRATION_PREDICATES = {
37
+ workingSaturday: (item: Branch | RemoteWorkplace) =>
38
+ Boolean('workSchedule' in item && item.workSchedule?.workingSaturday),
39
+ premiumService: (item: Branch | RemoteWorkplace) =>
40
+ Boolean('premiumService' in item && item.premiumService),
41
+ privateBanking: (item: Branch | RemoteWorkplace) =>
42
+ Boolean('privateBanking' in item && item.privateBanking),
43
+ remoteWorkplace: (item: Branch | RemoteWorkplace) => Boolean('workScheduleDescription' in item),
44
+ serviceDisabledPeople: (item: Branch | RemoteWorkplace) =>
45
+ Boolean('serviceDisabledPeople' in item && item.serviceDisabledPeople),
46
+ sellingCoins: (item: Branch | RemoteWorkplace) =>
47
+ Boolean('sellingCoins' in item && item.sellingCoins),
48
+ buyingCoins: (item: Branch | RemoteWorkplace) =>
49
+ Boolean('buyingCoins' in item && item.buyingCoins),
50
+ bullionOperations: (item: Branch | RemoteWorkplace) =>
51
+ Boolean('bullionOperations' in item && item.bullionOperations),
52
+ preciousMetalsOperations: (item: Branch | RemoteWorkplace) =>
53
+ Boolean('preciousMetalsOperations' in item && item.preciousMetalsOperations),
54
+ transferringDataToBiometricSystem: (item: Branch | RemoteWorkplace) =>
55
+ Boolean('transferringDataToBiometricSystem' in item && item.transferringDataToBiometricSystem),
56
+ };
@@ -0,0 +1,43 @@
1
+ import { Button } from '../../ui-kit/Button/Button';
2
+ import { getVersion } from '../../utils/getVersion';
3
+ import type { Branch } from './OfficesAtmsMapProps';
4
+
5
+ export const renderButtonsGroup = (
6
+ data: Branch[],
7
+ activeButton: string,
8
+ onButtonClick: (item: string) => void,
9
+ ) => {
10
+ const allButtonVersion = getVersion(activeButton === 'all');
11
+
12
+ const businessButtonVersion = getVersion(activeButton === 'business');
13
+
14
+ const handleClick = (e: any, key: string, branches: Branch[]) => {
15
+ if (e.currentTarget === e.target && key === 'business') {
16
+ branches.filter(
17
+ (branch) =>
18
+ branch.workSchedule &&
19
+ branch.workSchedule.businessScheduleVisibleTag &&
20
+ !branch.workSchedule.businessScheduleDescription,
21
+ );
22
+ }
23
+
24
+ onButtonClick(key);
25
+
26
+ return branches;
27
+ };
28
+
29
+ return (
30
+ <div className="flex gap-lg flex-col sm:flex-row pb-lg">
31
+ <Button data-id="all" onClick={(e) => handleClick(e, 'all', data)} version={allButtonVersion}>
32
+ Для физических лиц
33
+ </Button>
34
+ <Button
35
+ data-id="business"
36
+ onClick={(e) => handleClick(e, 'business', data)}
37
+ version={businessButtonVersion}
38
+ >
39
+ Для юридических лиц
40
+ </Button>
41
+ </div>
42
+ );
43
+ };
@@ -8,37 +8,25 @@ import { Icon } from '../../ui-kit/Icon/Icon';
8
8
  import { type IconName } from '../../ui-kit/Icon/IconProps';
9
9
  import { LinkButton } from '../../ui-kit/LinkButton/LinkButton';
10
10
 
11
- const FILTRATION_LABELS = {
12
- safeBoxCaseVolumes: 'Аренда индивидуальных сейфовых ячеек',
13
- workingSaturday: 'Открыты по субботам',
14
- terminalTypeAtms: 'Банкоматы',
15
- terminalTypeTerm: 'Терминалы',
16
- workAllTime: 'Круглосуточно',
17
- billAcceptorEnable: 'Прием наличных',
18
- premiumService: 'Премиальное обслуживание',
19
- privateBanking: 'Услуга Private banking',
20
- sellingCoins: 'Продажа монет из драгоценных металлов',
21
- buyingCoins: 'Покупка монет из драгоценных металлов',
22
- bullionOperations: 'Операции со слитками',
23
- preciousMetalsOperations: 'Операции с драгоценными металлами',
24
- transferringDataToBiometricSystem: 'Передача фото и голоса в Единую биометрическую систему',
25
- locationDisabledPeople: 'Для маломобильных',
26
- designDisabledPeople: 'Для слабовидящих',
27
- remoteWorkplace: 'Удаленное рабочее место',
28
- serviceDisabledPeople: 'Для маломобильных граждан',
29
- };
30
-
31
11
  const COMMON_FILTERS_STYLES = 'flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl';
32
12
 
33
- export const renderFiltrationForm = (
34
- filters: string[],
35
- { field, reset }: { field: FormFieldRegisterer<any>; reset: () => void },
36
- onlyOffice?: boolean,
37
- ) => {
13
+ export interface RenderFiltrationFormOptions {
14
+ filters: string[];
15
+ field: { field: FormFieldRegisterer<any>; reset: () => void };
16
+ onlyOffice?: boolean;
17
+ labels: Record<string, string>;
18
+ }
19
+
20
+ export const renderFiltrationForm = ({
21
+ filters,
22
+ field: { field, reset },
23
+ onlyOffice,
24
+ labels,
25
+ }: RenderFiltrationFormOptions) => {
38
26
  const visibleFiltersNum = onlyOffice ? 5 : 6;
39
27
 
40
28
  const filtersCheckbox = (filters || []).map((key) => (
41
- <Checkbox key={key} text={FILTRATION_LABELS[key]} {...field(key)} />
29
+ <Checkbox key={key} text={labels[key]} {...field(key)} />
42
30
  ));
43
31
 
44
32
  const [visibleFilters, hiddenFilters] =
@@ -0,0 +1,15 @@
1
+ import { Heading } from '../../ui-kit/Heading/Heading';
2
+ import { Text } from '../../ui-kit/Text/Text';
3
+
4
+ export const renderHeading = (title?: string, lengthItems?: number) => (
5
+ <div className="flex flex-col sm:flex-row gap-xs mb-2xl">
6
+ <Heading headingType="h3">
7
+ <span suppressHydrationWarning={true}>{title}</span>
8
+ {lengthItems ? (
9
+ <Text size="text-h2" color="text-secondary-text">
10
+ <span suppressHydrationWarning={true}>{` (${lengthItems})`}</span>
11
+ </Text>
12
+ ) : null}
13
+ </Heading>
14
+ </div>
15
+ );
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable @typescript-eslint/ban-ts-comment */
3
3
  /* eslint-disable @typescript-eslint/no-unsafe-argument */
4
4
  import type ymaps from 'yandex-maps';
5
- import { type BalloonPoints } from '../../components/OfficesAtmsMap/YandexMapProps'; //! Вынести этот тип в файл YandexMapProps.ts расположенный в корне этого компонента
5
+ import { type BalloonPoints } from '../../components/OfficesAtmsMap/YandexMapProps';
6
6
 
7
7
  const MapMarkerClusterIcon = '/icons/MapMarkerClusterIcon.svg';
8
8
  const MapMarkerClusterYellowIcon = '/icons/MapMarkerClusterYellowIcon.svg';
@@ -18,12 +18,16 @@ export function renderClusterer({
18
18
  points: BalloonPoints[];
19
19
  isLoad: boolean;
20
20
  }) {
21
- if (isLoad || !points?.length) {
21
+ if (isLoad || !points) {
22
22
  return;
23
23
  }
24
24
 
25
25
  map.geoObjects.removeAll();
26
26
 
27
+ if (!points.length) {
28
+ return;
29
+ }
30
+
27
31
  const clusterIconContentLayout = yandexMaps.templateLayoutFactory.createClass(
28
32
  '<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>',
29
33
  );