@redneckz/wildless-cms-uni-blocks 0.14.521 → 0.14.523
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 +30 -26
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/OfficesAtmsMap/AtmsMap.d.ts +1 -1
- package/bundle/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -0
- package/bundle/components/OfficesAtmsMap/useAtms.d.ts +4 -1
- package/bundle/components/OfficesAtmsMap/useOffices.d.ts +5 -2
- package/bundle/ui-kit/YandexMap/YandexMap.d.ts +2 -1
- package/bundle/ui-kit/YandexMap/renderClusterer.d.ts +2 -1
- package/dist/api/FileStorage.js +1 -1
- package/dist/api/FileStorage.js.map +1 -1
- package/dist/components/OfficesAtmsMap/AtmsMap.d.ts +1 -1
- package/dist/components/OfficesAtmsMap/AtmsMap.js +3 -3
- package/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMap.js +1 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMap.js.map +1 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -0
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +3 -3
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/dist/components/OfficesAtmsMap/OfficesMap.js +2 -2
- package/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
- package/dist/components/OfficesAtmsMap/useAtms.d.ts +4 -1
- package/dist/components/OfficesAtmsMap/useAtms.js +3 -2
- package/dist/components/OfficesAtmsMap/useAtms.js.map +1 -1
- package/dist/components/OfficesAtmsMap/useOffices.d.ts +5 -2
- package/dist/components/OfficesAtmsMap/useOffices.js +3 -2
- package/dist/components/OfficesAtmsMap/useOffices.js.map +1 -1
- package/dist/ui-kit/YandexMap/YandexMap.d.ts +2 -1
- package/dist/ui-kit/YandexMap/YandexMap.js +11 -12
- package/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
- package/dist/ui-kit/YandexMap/renderClusterer.d.ts +2 -1
- package/dist/ui-kit/YandexMap/renderClusterer.js +4 -1
- package/dist/ui-kit/YandexMap/renderClusterer.js.map +1 -1
- package/lib/api/FileStorage.js +1 -1
- package/lib/api/FileStorage.js.map +1 -1
- package/lib/components/OfficesAtmsMap/AtmsMap.d.ts +1 -1
- package/lib/components/OfficesAtmsMap/AtmsMap.js +3 -3
- package/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMap.js +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMap.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -0
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +3 -3
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesMap.js +2 -2
- package/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
- package/lib/components/OfficesAtmsMap/useAtms.d.ts +4 -1
- package/lib/components/OfficesAtmsMap/useAtms.js +3 -2
- package/lib/components/OfficesAtmsMap/useAtms.js.map +1 -1
- package/lib/components/OfficesAtmsMap/useOffices.d.ts +5 -2
- package/lib/components/OfficesAtmsMap/useOffices.js +3 -2
- package/lib/components/OfficesAtmsMap/useOffices.js.map +1 -1
- package/lib/ui-kit/YandexMap/YandexMap.d.ts +2 -1
- package/lib/ui-kit/YandexMap/YandexMap.js +11 -12
- package/lib/ui-kit/YandexMap/YandexMap.js.map +1 -1
- package/lib/ui-kit/YandexMap/renderClusterer.d.ts +2 -1
- package/lib/ui-kit/YandexMap/renderClusterer.js +4 -1
- package/lib/ui-kit/YandexMap/renderClusterer.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +30 -26
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/OfficesAtmsMap/AtmsMap.d.ts +1 -1
- package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -0
- package/mobile/bundle/components/OfficesAtmsMap/useAtms.d.ts +4 -1
- package/mobile/bundle/components/OfficesAtmsMap/useOffices.d.ts +5 -2
- package/mobile/bundle/ui-kit/YandexMap/YandexMap.d.ts +2 -1
- package/mobile/bundle/ui-kit/YandexMap/renderClusterer.d.ts +2 -1
- package/mobile/dist/api/FileStorage.js +1 -1
- package/mobile/dist/api/FileStorage.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/AtmsMap.d.ts +1 -1
- package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js +3 -3
- package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMap.js +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMap.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -0
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +3 -3
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js +2 -2
- package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/useAtms.d.ts +4 -1
- package/mobile/dist/components/OfficesAtmsMap/useAtms.js +3 -2
- package/mobile/dist/components/OfficesAtmsMap/useAtms.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/useOffices.d.ts +5 -2
- package/mobile/dist/components/OfficesAtmsMap/useOffices.js +3 -2
- package/mobile/dist/components/OfficesAtmsMap/useOffices.js.map +1 -1
- package/mobile/dist/ui-kit/YandexMap/YandexMap.d.ts +2 -1
- package/mobile/dist/ui-kit/YandexMap/YandexMap.js +11 -12
- package/mobile/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
- package/mobile/dist/ui-kit/YandexMap/renderClusterer.d.ts +2 -1
- package/mobile/dist/ui-kit/YandexMap/renderClusterer.js +4 -1
- package/mobile/dist/ui-kit/YandexMap/renderClusterer.js.map +1 -1
- package/mobile/lib/api/FileStorage.js +1 -1
- package/mobile/lib/api/FileStorage.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/AtmsMap.d.ts +1 -1
- package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js +3 -3
- package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMap.js +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMap.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -0
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +3 -3
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js +2 -2
- package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/useAtms.d.ts +4 -1
- package/mobile/lib/components/OfficesAtmsMap/useAtms.js +3 -2
- package/mobile/lib/components/OfficesAtmsMap/useAtms.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/useOffices.d.ts +5 -2
- package/mobile/lib/components/OfficesAtmsMap/useOffices.js +3 -2
- package/mobile/lib/components/OfficesAtmsMap/useOffices.js.map +1 -1
- package/mobile/lib/ui-kit/YandexMap/YandexMap.d.ts +2 -1
- package/mobile/lib/ui-kit/YandexMap/YandexMap.js +11 -12
- package/mobile/lib/ui-kit/YandexMap/YandexMap.js.map +1 -1
- package/mobile/lib/ui-kit/YandexMap/renderClusterer.d.ts +2 -1
- package/mobile/lib/ui-kit/YandexMap/renderClusterer.js +4 -1
- package/mobile/lib/ui-kit/YandexMap/renderClusterer.js.map +1 -1
- package/mobile/src/api/FileStorage.ts +1 -1
- package/mobile/src/components/OfficesAtmsMap/AtmsMap.tsx +5 -4
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMap.tsx +1 -1
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +17 -13
- package/mobile/src/components/OfficesAtmsMap/OfficesMap.tsx +4 -5
- package/mobile/src/components/OfficesAtmsMap/useAtms.ts +3 -2
- package/mobile/src/components/OfficesAtmsMap/useOffices.ts +3 -2
- package/mobile/src/ui-kit/YandexMap/YandexMap.tsx +14 -13
- package/mobile/src/ui-kit/YandexMap/renderClusterer.ts +6 -0
- package/package.json +1 -1
- package/src/api/FileStorage.ts +1 -1
- package/src/components/OfficesAtmsMap/AtmsMap.tsx +5 -4
- package/src/components/OfficesAtmsMap/OfficesAtmsMap.tsx +1 -1
- package/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +17 -13
- package/src/components/OfficesAtmsMap/OfficesMap.tsx +4 -5
- package/src/components/OfficesAtmsMap/useAtms.ts +3 -2
- package/src/components/OfficesAtmsMap/useOffices.ts +3 -2
- package/src/ui-kit/YandexMap/YandexMap.tsx +14 -13
- package/src/ui-kit/YandexMap/renderClusterer.ts +6 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OfficesMap.js","sourceRoot":"","sources":["../../../src/components/OfficesAtmsMap/OfficesMap.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC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AAC;IAClD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IAEhD,OAAO,CACL,KAAC,oBAAoB,IACnB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EAAE,QAAQ,EACpB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,IAAI,EAAE,gBAAgB,EACxC,eAAe,EAAE,wBAAwB,EACzC,UAAU,EAAE,gBAAgB,EAC5B,yBAAyB,EAAE,yBAAyB,EACpD,UAAU,EAAE,cAAc,EAC1B,0BAA0B,EAAE,uBAAuB,EACnD,KAAK,EAAE,iBAAiB,eAAe,EAAE,IAAI,EAAE,GAC/C,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAClB,IAAkC,EAClC,eAAwC,EACxC,EAAE;IACF,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;IAEzF,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC3F,CAAC,CAAC"}
|
|
@@ -2,8 +2,9 @@ import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
|
2
2
|
import { fetchJSON } from '../../utils/fetchJSON.js';
|
|
3
3
|
const EMPTY_VALUE = [];
|
|
4
4
|
export function useAtms(regionCode) {
|
|
5
|
-
const { data
|
|
6
|
-
|
|
5
|
+
const { data, error } = useAsyncData(`/api/v1/atms?regionCode=${regionCode}`, fetchMap);
|
|
6
|
+
const isLoad = !data && !error;
|
|
7
|
+
return { data: data || EMPTY_VALUE, isLoad };
|
|
7
8
|
}
|
|
8
9
|
const fetchMap = async (url) => {
|
|
9
10
|
const result = await fetchJSON(url, { method: 'GET' });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAtms.js","sourceRoot":"","sources":["../../../src/components/OfficesAtmsMap/useAtms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,MAAM,UAAU,OAAO,CAAC,UAAmB;IACzC,MAAM,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"useAtms.js","sourceRoot":"","sources":["../../../src/components/OfficesAtmsMap/useAtms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,MAAM,UAAU,OAAO,CAAC,UAAmB;IACzC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,YAAY,CAAC,2BAA2B,UAAU,EAAE,EAAE,QAAQ,CAAC,CAAC;IACxF,MAAM,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC;IAE/B,OAAO,EAAE,IAAI,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,EAAE,CAAC;AAC/C,CAAC;AAED,MAAM,QAAQ,GAAG,KAAK,EAAE,GAAW,EAAkB,EAAE;IACrD,MAAM,MAAM,GAAG,MAAM,SAAS,CAAQ,GAAG,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAE9D,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC;AACtD,CAAC,CAAC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type Branch, type RemoteWorkplace } from './OfficesAtmsMapProps';
|
|
2
2
|
export declare function useOffices(regionCode?: string): {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
data: {
|
|
4
|
+
branches: Branch[];
|
|
5
|
+
remoteWorkplaces: RemoteWorkplace[];
|
|
6
|
+
};
|
|
7
|
+
isLoad: boolean;
|
|
5
8
|
};
|
|
@@ -2,8 +2,9 @@ import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
|
2
2
|
import { fetchJSON } from '../../utils/fetchJSON.js';
|
|
3
3
|
const EMPTY_VALUE = { branches: [], remoteWorkplaces: [] };
|
|
4
4
|
export function useOffices(regionCode) {
|
|
5
|
-
const { data
|
|
6
|
-
|
|
5
|
+
const { data, error } = useAsyncData(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${regionCode}`, fetchMap);
|
|
6
|
+
const isLoad = !data && !error;
|
|
7
|
+
return { data: data || EMPTY_VALUE, isLoad };
|
|
7
8
|
}
|
|
8
9
|
const fetchMap = async (url) => {
|
|
9
10
|
const result = await fetchJSON(url, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOffices.js","sourceRoot":"","sources":["../../../src/components/OfficesAtmsMap/useOffices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,MAAM,WAAW,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC;AAE3D,MAAM,UAAU,UAAU,CAAC,UAAmB;IAC5C,MAAM,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"useOffices.js","sourceRoot":"","sources":["../../../src/components/OfficesAtmsMap/useOffices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,MAAM,WAAW,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC;AAE3D,MAAM,UAAU,UAAU,CAAC,UAAmB;IAC5C,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,YAAY,CAClC,kDAAkD,UAAU,EAAE,EAC9D,QAAQ,CACT,CAAC;IACF,MAAM,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC;IAE/B,OAAO,EAAE,IAAI,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,EAAE,CAAC;AAC/C,CAAC;AAED,MAAM,QAAQ,GAAG,KAAK,EACpB,GAAW,EAC2D,EAAE;IACxE,MAAM,MAAM,GAAG,MAAM,SAAS,CAA8D,GAAG,EAAE;QAC/F,MAAM,EAAE,KAAK;KACd,CAAC,CAAC;IAEH,OAAO,MAAM,IAAI,WAAW,CAAC;AAC/B,CAAC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type BalloonPoints } from '../../components/OfficesAtmsMap/YandexMapProps';
|
|
2
2
|
interface YandexMapProps {
|
|
3
|
-
points
|
|
3
|
+
points?: BalloonPoints[];
|
|
4
4
|
className?: string;
|
|
5
5
|
zoom?: number;
|
|
6
|
+
isLoad?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const YandexMap: import("@redneckz/uni-jsx").UNIComponent<YandexMapProps, any, any>;
|
|
8
9
|
export {};
|
|
@@ -4,6 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
4
4
|
import { JSX } from '@redneckz/uni-jsx';
|
|
5
5
|
import { useEffect, useRef } from '@redneckz/uni-jsx/lib/hooks';
|
|
6
6
|
import { style } from '../../utils/style.js';
|
|
7
|
+
import { Loader } from '../Loader/Loader.js';
|
|
7
8
|
import { renderClusterer } from './renderClusterer.js';
|
|
8
9
|
import { renderUserGeolocation } from './renderUserGeolocation.js';
|
|
9
10
|
import { useYandexMaps } from './useYandexMaps.js';
|
|
@@ -13,17 +14,19 @@ const DEFAULT_CENTER_COORDS = [55.753995, 37.614069];
|
|
|
13
14
|
// Сейчас реализован поиск среди тестовых данных
|
|
14
15
|
// TODO: Также выяснить что делать когда ничего не найдено
|
|
15
16
|
// TODO: На макетах также когда есть поле поиска нет кнопки открыть на карте.
|
|
16
|
-
export const YandexMap = JSX(({ points, className = '', zoom = 5 }) => {
|
|
17
|
+
export const YandexMap = JSX(({ points, className = '', zoom = 5, isLoad }) => {
|
|
17
18
|
const map = useRef(null);
|
|
18
19
|
const yandexMaps = useYandexMaps();
|
|
19
20
|
useEffect(() => {
|
|
20
|
-
if (
|
|
21
|
-
|
|
21
|
+
if (map.current) {
|
|
22
|
+
renderClusterer({ yandexMaps, map: map.current, points, isLoad });
|
|
23
|
+
map.current.setCenter(getCenterPoint(points));
|
|
22
24
|
}
|
|
23
|
-
|
|
25
|
+
else {
|
|
24
26
|
yandexMaps?.ready(() => {
|
|
25
27
|
// Ready function may be called few times, but must be called once
|
|
26
28
|
if (map.current) {
|
|
29
|
+
renderClusterer({ yandexMaps, map: map.current, points, isLoad });
|
|
27
30
|
return;
|
|
28
31
|
}
|
|
29
32
|
map.current = new yandexMaps.Map('map', {
|
|
@@ -32,19 +35,15 @@ export const YandexMap = JSX(({ points, className = '', zoom = 5 }) => {
|
|
|
32
35
|
controls: [],
|
|
33
36
|
suppressMapOpenBlock: true,
|
|
34
37
|
});
|
|
35
|
-
renderClusterer({ yandexMaps, map: map.current, points });
|
|
38
|
+
renderClusterer({ yandexMaps, map: map.current, points, isLoad });
|
|
36
39
|
});
|
|
37
40
|
}
|
|
38
|
-
|
|
39
|
-
renderClusterer({ yandexMaps, map: map.current, points });
|
|
40
|
-
map.current.setCenter(getCenterPoint(points));
|
|
41
|
-
}
|
|
42
|
-
}, [yandexMaps, points, zoom]);
|
|
41
|
+
}, [yandexMaps, points, zoom, isLoad]);
|
|
43
42
|
if (!yandexMaps) {
|
|
44
43
|
return null;
|
|
45
44
|
}
|
|
46
45
|
const zIndex = 'z-10';
|
|
47
|
-
return (_jsxs("div", { id: "map", className: style('relative', 'w-full', className), children: [_jsxs("div", { className: style('absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md', zIndex), children: [_jsx(ZoomButton, { yandexMaps: map }), _jsx(ZoomButton, { yandexMaps: map, direction: "out" })] }), renderUserGeolocation(map, yandexMaps, style('right-2 top-80', zIndex))] }));
|
|
46
|
+
return (_jsxs("div", { id: "map", className: style('relative', 'w-full', className), children: [isLoad ? _jsx(Loader, {}) : null, _jsxs("div", { className: style('absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md', zIndex), children: [_jsx(ZoomButton, { yandexMaps: map }), _jsx(ZoomButton, { yandexMaps: map, direction: "out" })] }), renderUserGeolocation(map, yandexMaps, style('right-2 top-80', zIndex))] }));
|
|
48
47
|
});
|
|
49
48
|
const getCenterPoint = (points) => {
|
|
50
49
|
const centerCoords = [
|
|
@@ -53,6 +52,6 @@ const getCenterPoint = (points) => {
|
|
|
53
52
|
];
|
|
54
53
|
return centerCoords.every((_) => _) ? centerCoords : DEFAULT_CENTER_COORDS;
|
|
55
54
|
};
|
|
56
|
-
const mapByIndex = (points, index) => points.map((_) => _.coords[index]);
|
|
55
|
+
const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
|
|
57
56
|
const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
|
|
58
57
|
//# sourceMappingURL=YandexMap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YandexMap.js","sourceRoot":"","sources":["../../../src/ui-kit/YandexMap/YandexMap.tsx"],"names":[],"mappings":";AAAA,6DAA6D;AAC7D,cAAc;AACd,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM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AAE,GAAG,GAAI,EAC/B,KAAC,UAAU,IAAC,UAAU,EAAE,GAAG,EAAE,SAAS,EAAC,KAAK,GAAG,IAC3C,EACL,qBAAqB,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,IACpE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,CAAC,MAAwB,EAAE,EAAE;IAClD,MAAM,YAAY,GAAG;QACnB,qBAAqB,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC5C,qBAAqB,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;KAC7C,CAAC;IAEF,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAC;AAC7E,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,MAAuB,EAAE,KAAa,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AAEpG,MAAM,qBAAqB,GAAG,CAAC,GAAa,EAAE,EAAE,CAC9C,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type ymaps from 'yandex-maps';
|
|
2
2
|
import { type BalloonPoints } from '../../components/OfficesAtmsMap/YandexMapProps';
|
|
3
|
-
export declare function renderClusterer({ yandexMaps, map, points, }: {
|
|
3
|
+
export declare function renderClusterer({ yandexMaps, map, points, isLoad, }: {
|
|
4
4
|
yandexMaps: typeof ymaps;
|
|
5
5
|
map: ymaps.Map;
|
|
6
6
|
points: BalloonPoints[];
|
|
7
|
+
isLoad: boolean;
|
|
7
8
|
}): void;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
const MapMarkerClusterIcon = '/icons/MapMarkerClusterIcon.svg';
|
|
2
2
|
const MapMarkerClusterYellowIcon = '/icons/MapMarkerClusterYellowIcon.svg';
|
|
3
|
-
export function renderClusterer({ yandexMaps, map, points, }) {
|
|
3
|
+
export function renderClusterer({ yandexMaps, map, points, isLoad, }) {
|
|
4
|
+
if (isLoad || !points?.length) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
4
7
|
map.geoObjects.removeAll();
|
|
5
8
|
const clusterIconContentLayout = yandexMaps.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>');
|
|
6
9
|
const officeClusterer = defineClusterer('offices', yandexMaps, clusterIconContentLayout);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderClusterer.js","sourceRoot":"","sources":["../../../src/ui-kit/YandexMap/renderClusterer.ts"],"names":[],"mappings":"AAMA,MAAM,oBAAoB,GAAG,iCAAiC,CAAC;AAC/D,MAAM,0BAA0B,GAAG,uCAAuC,CAAC;AAE3E,MAAM,UAAU,eAAe,CAAC,EAC9B,UAAU,EACV,GAAG,EACH,MAAM,
|
|
1
|
+
{"version":3,"file":"renderClusterer.js","sourceRoot":"","sources":["../../../src/ui-kit/YandexMap/renderClusterer.ts"],"names":[],"mappings":"AAMA,MAAM,oBAAoB,GAAG,iCAAiC,CAAC;AAC/D,MAAM,0BAA0B,GAAG,uCAAuC,CAAC;AAE3E,MAAM,UAAU,eAAe,CAAC,EAC9B,UAAU,EACV,GAAG,EACH,MAAM,EACN,MAAM,GAMP;IACC,IAAI,MAAM,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE;QAC7B,OAAO;KACR;IAED,GAAG,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;IAE3B,MAAM,wBAAwB,GAAG,UAA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AC,EAAE,EAAE,CAAC,EAAE,CAAC;KAC5B,CACF,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -4452,7 +4452,10 @@
|
|
|
4452
4452
|
|
|
4453
4453
|
const MapMarkerClusterIcon = '/icons/MapMarkerClusterIcon.svg';
|
|
4454
4454
|
const MapMarkerClusterYellowIcon = '/icons/MapMarkerClusterYellowIcon.svg';
|
|
4455
|
-
function renderClusterer({ yandexMaps, map, points, }) {
|
|
4455
|
+
function renderClusterer({ yandexMaps, map, points, isLoad, }) {
|
|
4456
|
+
if (isLoad || !points?.length) {
|
|
4457
|
+
return;
|
|
4458
|
+
}
|
|
4456
4459
|
map.geoObjects.removeAll();
|
|
4457
4460
|
const clusterIconContentLayout = yandexMaps.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>');
|
|
4458
4461
|
const officeClusterer = defineClusterer('offices', yandexMaps, clusterIconContentLayout);
|
|
@@ -4619,17 +4622,19 @@
|
|
|
4619
4622
|
// Сейчас реализован поиск среди тестовых данных
|
|
4620
4623
|
// TODO: Также выяснить что делать когда ничего не найдено
|
|
4621
4624
|
// TODO: На макетах также когда есть поле поиска нет кнопки открыть на карте.
|
|
4622
|
-
const YandexMap = JSX(({ points, className = '', zoom = 5 }) => {
|
|
4625
|
+
const YandexMap = JSX(({ points, className = '', zoom = 5, isLoad }) => {
|
|
4623
4626
|
const map = useRef(null);
|
|
4624
4627
|
const yandexMaps = useYandexMaps();
|
|
4625
4628
|
useEffect(() => {
|
|
4626
|
-
if (
|
|
4627
|
-
|
|
4629
|
+
if (map.current) {
|
|
4630
|
+
renderClusterer({ yandexMaps, map: map.current, points, isLoad });
|
|
4631
|
+
map.current.setCenter(getCenterPoint(points));
|
|
4628
4632
|
}
|
|
4629
|
-
|
|
4633
|
+
else {
|
|
4630
4634
|
yandexMaps?.ready(() => {
|
|
4631
4635
|
// Ready function may be called few times, but must be called once
|
|
4632
4636
|
if (map.current) {
|
|
4637
|
+
renderClusterer({ yandexMaps, map: map.current, points, isLoad });
|
|
4633
4638
|
return;
|
|
4634
4639
|
}
|
|
4635
4640
|
map.current = new yandexMaps.Map('map', {
|
|
@@ -4638,19 +4643,15 @@
|
|
|
4638
4643
|
controls: [],
|
|
4639
4644
|
suppressMapOpenBlock: true,
|
|
4640
4645
|
});
|
|
4641
|
-
renderClusterer({ yandexMaps, map: map.current, points });
|
|
4646
|
+
renderClusterer({ yandexMaps, map: map.current, points, isLoad });
|
|
4642
4647
|
});
|
|
4643
4648
|
}
|
|
4644
|
-
|
|
4645
|
-
renderClusterer({ yandexMaps, map: map.current, points });
|
|
4646
|
-
map.current.setCenter(getCenterPoint(points));
|
|
4647
|
-
}
|
|
4648
|
-
}, [yandexMaps, points, zoom]);
|
|
4649
|
+
}, [yandexMaps, points, zoom, isLoad]);
|
|
4649
4650
|
if (!yandexMaps) {
|
|
4650
4651
|
return null;
|
|
4651
4652
|
}
|
|
4652
4653
|
const zIndex = 'z-10';
|
|
4653
|
-
return (jsxs("div", { id: "map", className: style('relative', 'w-full', className), children: [jsxs("div", { className: style('absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md', zIndex), children: [jsx(ZoomButton, { yandexMaps: map }), jsx(ZoomButton, { yandexMaps: map, direction: "out" })] }), renderUserGeolocation(map, yandexMaps, style('right-2 top-80', zIndex))] }));
|
|
4654
|
+
return (jsxs("div", { id: "map", className: style('relative', 'w-full', className), children: [isLoad ? jsx(Loader, {}) : null, jsxs("div", { className: style('absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md', zIndex), children: [jsx(ZoomButton, { yandexMaps: map }), jsx(ZoomButton, { yandexMaps: map, direction: "out" })] }), renderUserGeolocation(map, yandexMaps, style('right-2 top-80', zIndex))] }));
|
|
4654
4655
|
});
|
|
4655
4656
|
const getCenterPoint = (points) => {
|
|
4656
4657
|
const centerCoords = [
|
|
@@ -4659,7 +4660,7 @@
|
|
|
4659
4660
|
];
|
|
4660
4661
|
return centerCoords.every((_) => _) ? centerCoords : DEFAULT_CENTER_COORDS;
|
|
4661
4662
|
};
|
|
4662
|
-
const mapByIndex = (points, index) => points.map((_) => _.coords[index]);
|
|
4663
|
+
const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
|
|
4663
4664
|
const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
|
|
4664
4665
|
|
|
4665
4666
|
const renderDescriptionBlock$1 = ({ __html, list }) => __html || list?.length ? (jsxs("div", { className: "mb-2xl border-b sm:border border-main-divider sm:rounded-md", children: [__html ? (jsx("div", { className: "mb-2xl", children: jsx(RichText, { __html: __html }) })) : null, list?.length ? (jsx("div", { className: "flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl", children: list.map((item, i) => (jsxs("div", { className: "flex gap-xs items-center", children: [item?.image ? jsx(Img, { image: item.image }) : null, item?.text ? (jsx(Text, { size: "text-m", font: "font-light", children: item.text })) : null] }, String(i)))) })) : null] })) : null;
|
|
@@ -4704,7 +4705,7 @@
|
|
|
4704
4705
|
const defaultEmptyFunction = () => void 0;
|
|
4705
4706
|
const defaultFilterItems = () => [];
|
|
4706
4707
|
const filtersVisibleStyles = (activeButton) => activeButton === 'all' ? 'block' : 'hidden';
|
|
4707
|
-
const OfficesAtmsMapLayout = JSX(({ className, data = [], remoteWorkplaces = [], renderCard = defaultEmptyFunction, renderRemoteWorkplaceCard = defaultEmptyFunction, filterItems = defaultFilterItems, getBalloon = defaultEmptyFunction, getBalloonRemoteWorkplaces = defaultEmptyFunction, initFilterState = {}, descriptionData, title, }) => {
|
|
4708
|
+
const OfficesAtmsMapLayout = JSX(({ className, data = [], isLoad, remoteWorkplaces = [], renderCard = defaultEmptyFunction, renderRemoteWorkplaceCard = defaultEmptyFunction, filterItems = defaultFilterItems, getBalloon = defaultEmptyFunction, getBalloonRemoteWorkplaces = defaultEmptyFunction, initFilterState = {}, descriptionData, title, }) => {
|
|
4708
4709
|
const onlyOffice = title?.includes('Офис');
|
|
4709
4710
|
const [filtrationState, { field, reset }] = useForm(initFilterState);
|
|
4710
4711
|
const [filteredItems, points, filteredRemoteWorkplaces, lengthItems] = useMemo(() => {
|
|
@@ -4729,8 +4730,9 @@
|
|
|
4729
4730
|
return [_filteredItems, _points, _filteredRemoteWorkplaces, itemsLength];
|
|
4730
4731
|
}, [data, remoteWorkplaces, filtrationState]);
|
|
4731
4732
|
const [activeButton, setActiveButton] = useState('all');
|
|
4732
|
-
return (jsxs("div", { className: style('space-y-1', className), children: [jsxs("div", { className: "bg-white", children: [jsxs("div", { className: "p-3xl pb-0", children: [
|
|
4733
|
+
return (jsxs("div", { className: style('space-y-1', className), children: [jsxs("div", { className: "bg-white", children: [jsxs("div", { className: "p-3xl pb-0", children: [renderHeading(title, lengthItems), descriptionData ? renderDescriptionBlock$1(descriptionData) : null, onlyOffice && renderButtonsGroup(data, activeButton, setActiveButton), jsx("div", { className: style('pb-3xl', filtersVisibleStyles(activeButton)), children: renderFiltrationForm(Object.keys(initFilterState), { field, reset }, onlyOffice) })] }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, isLoad: isLoad, className: "h-full" }) }) })] }), jsxs(ClientOnly, { children: [filteredItems.map(renderCard), filteredRemoteWorkplaces.map(renderRemoteWorkplaceCard)] })] }));
|
|
4733
4734
|
});
|
|
4735
|
+
const renderHeading = (title, lengthItems) => (jsx("div", { className: "flex flex-col sm:flex-row gap-xs mb-2xl", children: jsxs(Heading, { headingType: "h3", children: [jsx("span", { suppressHydrationWarning: true, children: title }), lengthItems ? (jsx(Text, { size: "text-h2", color: "text-secondary-text", children: jsx("span", { suppressHydrationWarning: true, children: ` (${lengthItems})` }) })) : null] }) }));
|
|
4734
4736
|
const renderButtonsGroup = (data, activeButton, onButtonClick) => {
|
|
4735
4737
|
const allButtonVersion = getVersion(activeButton === 'all');
|
|
4736
4738
|
const businessButtonVersion = getVersion(activeButton === 'business');
|
|
@@ -4804,8 +4806,9 @@
|
|
|
4804
4806
|
|
|
4805
4807
|
const EMPTY_VALUE$2 = [];
|
|
4806
4808
|
function useAtms(regionCode) {
|
|
4807
|
-
const { data
|
|
4808
|
-
|
|
4809
|
+
const { data, error } = useAsyncData(`/api/v1/atms?regionCode=${regionCode}`, fetchMap$1);
|
|
4810
|
+
const isLoad = !data && !error;
|
|
4811
|
+
return { data: data || EMPTY_VALUE$2, isLoad };
|
|
4809
4812
|
}
|
|
4810
4813
|
const fetchMap$1 = async (url) => {
|
|
4811
4814
|
const result = await fetchJSON(url, { method: 'GET' });
|
|
@@ -4828,11 +4831,11 @@
|
|
|
4828
4831
|
locationDisabledPeople: (item) => Boolean(item.locationDisabledPeople),
|
|
4829
4832
|
designDisabledPeople: (item) => Boolean(item.designDisabledPeople),
|
|
4830
4833
|
};
|
|
4831
|
-
const AtmsMap = JSX(({
|
|
4834
|
+
const AtmsMap = JSX(({ descriptionData, className }) => {
|
|
4832
4835
|
const [currentLocation] = useLocation();
|
|
4833
4836
|
const regionCode = currentLocation?.code ?? '000';
|
|
4834
|
-
const officesData = useAtms(regionCode);
|
|
4835
|
-
return (jsx(OfficesAtmsMapLayout, { className: className, filterItems: filterItems$1, data: officesData, initFilterState: INITIAL_FILTRATION_STATE$1, renderCard: renderAtmCard, getBalloon: getAtmPoint, title: `Банкоматы филиала ${currentLocation?.name}`, descriptionData:
|
|
4837
|
+
const { data: officesData, isLoad } = useAtms(regionCode);
|
|
4838
|
+
return (jsx(OfficesAtmsMapLayout, { className: className, filterItems: filterItems$1, data: officesData, isLoad: isLoad, initFilterState: INITIAL_FILTRATION_STATE$1, renderCard: renderAtmCard, getBalloon: getAtmPoint, title: `Банкоматы филиала ${currentLocation?.name}`, descriptionData: descriptionData }));
|
|
4836
4839
|
});
|
|
4837
4840
|
const filterItems$1 = (data, filtrationState) => {
|
|
4838
4841
|
const truthyFilters = Object.keys(filtrationState).filter((key) => filtrationState[key]);
|
|
@@ -5038,8 +5041,9 @@
|
|
|
5038
5041
|
|
|
5039
5042
|
const EMPTY_VALUE$1 = { branches: [], remoteWorkplaces: [] };
|
|
5040
5043
|
function useOffices(regionCode) {
|
|
5041
|
-
const { data
|
|
5042
|
-
|
|
5044
|
+
const { data, error } = useAsyncData(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${regionCode}`, fetchMap);
|
|
5045
|
+
const isLoad = !data && !error;
|
|
5046
|
+
return { data: data || EMPTY_VALUE$1, isLoad };
|
|
5043
5047
|
}
|
|
5044
5048
|
const fetchMap = async (url) => {
|
|
5045
5049
|
const result = await fetchJSON(url, {
|
|
@@ -5075,8 +5079,8 @@
|
|
|
5075
5079
|
const OfficesMap = JSX(({ className }) => {
|
|
5076
5080
|
const [currentLocation] = useLocation();
|
|
5077
5081
|
const regionCode = currentLocation?.code ?? '000';
|
|
5078
|
-
const
|
|
5079
|
-
return (jsx(OfficesAtmsMapLayout, { className: className, filterItems: filterItems, data:
|
|
5082
|
+
const { data, isLoad } = useOffices(regionCode);
|
|
5083
|
+
return (jsx(OfficesAtmsMapLayout, { className: className, filterItems: filterItems, data: data?.branches, isLoad: isLoad, remoteWorkplaces: data?.remoteWorkplaces, initFilterState: INITIAL_FILTRATION_STATE, renderCard: renderOfficeCard, renderRemoteWorkplaceCard: renderRemoteWorkplaceCard, getBalloon: getOfficePoint, getBalloonRemoteWorkplaces: getRemoteWorkplacePoint, title: `Офисы филиала ${currentLocation?.name}` }));
|
|
5080
5084
|
});
|
|
5081
5085
|
const filterItems = (data, filtrationState) => {
|
|
5082
5086
|
const truthyFilters = Object.keys(filtrationState).filter((key) => filtrationState[key]);
|
|
@@ -5085,7 +5089,7 @@
|
|
|
5085
5089
|
|
|
5086
5090
|
const OfficesAtmsMap = JSX(({ data, className, ...rest }) => {
|
|
5087
5091
|
const dataType = data?.dataType ?? 'offices';
|
|
5088
|
-
return (jsx(BlockWrapper, { version: "transparent", className: style(className), defaultPadding: "p-0", ...rest, children: dataType === 'offices' ? jsx(OfficesMap, {}) : jsx(AtmsMap, {
|
|
5092
|
+
return (jsx(BlockWrapper, { version: "transparent", className: style(className), defaultPadding: "p-0", ...rest, children: dataType === 'offices' ? jsx(OfficesMap, {}) : jsx(AtmsMap, { descriptionData: data }) }));
|
|
5089
5093
|
});
|
|
5090
5094
|
|
|
5091
5095
|
const Placeholder = JSX(({ className, title, description = 'Блок в разработке...', ...rest }) => (jsxs(BlockWrapper, { className: style('box-border', className), ...rest, children: [jsx(Headline, { className: "max-w-[600px]", title: title, description: description, headlineVersion: "L", align: "text-left", isEmbedded: true }), jsx(Shimmer, {})] })));
|
|
@@ -6077,7 +6081,7 @@
|
|
|
6077
6081
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
6078
6082
|
});
|
|
6079
6083
|
|
|
6080
|
-
const packageVersion = "0.14.
|
|
6084
|
+
const packageVersion = "0.14.522";
|
|
6081
6085
|
|
|
6082
6086
|
exports.Blocks = Blocks;
|
|
6083
6087
|
exports.ContentPage = ContentPage;
|