@redneckz/wildless-cms-uni-blocks 0.14.515 → 0.14.517
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +14 -10
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/ui-kit/BaseFiltration/FiltrationSchemaContent.d.ts +2 -2
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/dist/ui-kit/BaseFiltration/FiltrationSchemaContent.d.ts +2 -2
- package/dist/ui-kit/YandexMap/YandexMap.js +12 -8
- package/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/lib/ui-kit/BaseFiltration/FiltrationSchemaContent.d.ts +2 -2
- package/lib/ui-kit/YandexMap/YandexMap.js +12 -8
- package/lib/ui-kit/YandexMap/YandexMap.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +14 -10
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/ui-kit/BaseFiltration/FiltrationSchemaContent.d.ts +2 -2
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/dist/ui-kit/BaseFiltration/FiltrationSchemaContent.d.ts +2 -2
- package/mobile/dist/ui-kit/YandexMap/YandexMap.js +12 -8
- package/mobile/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/lib/ui-kit/BaseFiltration/FiltrationSchemaContent.d.ts +2 -2
- package/mobile/lib/ui-kit/YandexMap/YandexMap.js +12 -8
- package/mobile/lib/ui-kit/YandexMap/YandexMap.js.map +1 -1
- package/mobile/src/components/BankAccountFiltration/BankAccountFiltration.example.json +1 -1
- package/mobile/src/components/BankAccountFiltration/BankAccountFiltration.ui.json +8 -3
- package/mobile/src/components/CalculatorBonus/CalculatorBonus.example.json +6 -1
- package/mobile/src/components/CalculatorBusinessDeposit/CalculatorBusinessDeposit.example.json +6 -0
- package/mobile/src/components/CalculatorCredit/CalculatorCredit.example.json +6 -0
- package/mobile/src/components/CalculatorDeposit/CalculatorDeposit.example.json +6 -0
- package/mobile/src/components/CalculatorRefinancing/CalculatorRefinancing.example.json +6 -0
- package/mobile/src/components/DepositFiltration/DepositFiltration.example.json +1 -1
- package/mobile/src/components/DepositFiltration/DepositFiltration.ui.json +8 -3
- package/mobile/src/components/MortgageFiltration/MortgageFiltration.example.json +1 -1
- package/mobile/src/components/MortgageFiltration/MortgageFiltration.ui.json +8 -3
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +2 -1
- package/mobile/src/ui-kit/BaseFiltration/FiltrationSchemaContent.ts +2 -2
- package/mobile/src/ui-kit/YandexMap/YandexMap.tsx +14 -8
- package/package.json +1 -1
- package/src/components/BankAccountFiltration/BankAccountFiltration.example.json +1 -1
- package/src/components/BankAccountFiltration/BankAccountFiltration.ui.json +8 -3
- package/src/components/CalculatorBonus/CalculatorBonus.example.json +6 -1
- package/src/components/CalculatorBusinessDeposit/CalculatorBusinessDeposit.example.json +6 -0
- package/src/components/CalculatorCredit/CalculatorCredit.example.json +6 -0
- package/src/components/CalculatorDeposit/CalculatorDeposit.example.json +6 -0
- package/src/components/CalculatorRefinancing/CalculatorRefinancing.example.json +6 -0
- package/src/components/DepositFiltration/DepositFiltration.example.json +1 -1
- package/src/components/DepositFiltration/DepositFiltration.ui.json +8 -3
- package/src/components/MortgageFiltration/MortgageFiltration.example.json +1 -1
- package/src/components/MortgageFiltration/MortgageFiltration.ui.json +8 -3
- package/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +2 -1
- package/src/ui-kit/BaseFiltration/FiltrationSchemaContent.ts +2 -2
- package/src/ui-kit/YandexMap/YandexMap.tsx +14 -8
|
@@ -28,6 +28,10 @@ export const YandexMap = JSX<YandexMapProps>(({ points, className = '', zoom = 5
|
|
|
28
28
|
const yandexMaps = useYandexMaps();
|
|
29
29
|
|
|
30
30
|
useEffect(() => {
|
|
31
|
+
if (!points?.length) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
if (!map?.current) {
|
|
32
36
|
yandexMaps?.ready(() => {
|
|
33
37
|
// Ready function may be called few times, but must be called once
|
|
@@ -36,7 +40,7 @@ export const YandexMap = JSX<YandexMapProps>(({ points, className = '', zoom = 5
|
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
map.current = new yandexMaps.Map('map', {
|
|
39
|
-
center:
|
|
43
|
+
center: getCenterPoint(points),
|
|
40
44
|
zoom,
|
|
41
45
|
controls: [],
|
|
42
46
|
suppressMapOpenBlock: true,
|
|
@@ -47,9 +51,7 @@ export const YandexMap = JSX<YandexMapProps>(({ points, className = '', zoom = 5
|
|
|
47
51
|
} else if (yandexMaps) {
|
|
48
52
|
renderClusterer({ yandexMaps, map: map.current, points });
|
|
49
53
|
|
|
50
|
-
|
|
51
|
-
map.current.setCenter(DEFAULT_CENTER_COORDS);
|
|
52
|
-
}
|
|
54
|
+
map.current.setCenter(getCenterPoint(points));
|
|
53
55
|
}
|
|
54
56
|
}, [yandexMaps, points, zoom]);
|
|
55
57
|
|
|
@@ -75,10 +77,14 @@ export const YandexMap = JSX<YandexMapProps>(({ points, className = '', zoom = 5
|
|
|
75
77
|
);
|
|
76
78
|
});
|
|
77
79
|
|
|
78
|
-
const getCenterPoint = (points
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
const getCenterPoint = (points?: BalloonPoints[]) => {
|
|
81
|
+
const centerCoords = [
|
|
82
|
+
getArraySumAndAverage(mapByIndex(points, 0)),
|
|
83
|
+
getArraySumAndAverage(mapByIndex(points, 1)),
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
return centerCoords.every((_) => _) ? centerCoords : DEFAULT_CENTER_COORDS;
|
|
87
|
+
};
|
|
82
88
|
|
|
83
89
|
const mapByIndex = (points: BalloonPoints[], index: number) => points.map((_) => _.coords[index]);
|
|
84
90
|
|