@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
package/bundle/bundle.umd.js
CHANGED
|
@@ -5186,6 +5186,9 @@
|
|
|
5186
5186
|
const map = useRef(null);
|
|
5187
5187
|
const yandexMaps = useYandexMaps();
|
|
5188
5188
|
useEffect(() => {
|
|
5189
|
+
if (!points?.length) {
|
|
5190
|
+
return;
|
|
5191
|
+
}
|
|
5189
5192
|
if (!map?.current) {
|
|
5190
5193
|
yandexMaps?.ready(() => {
|
|
5191
5194
|
// Ready function may be called few times, but must be called once
|
|
@@ -5193,7 +5196,7 @@
|
|
|
5193
5196
|
return;
|
|
5194
5197
|
}
|
|
5195
5198
|
map.current = new yandexMaps.Map('map', {
|
|
5196
|
-
center:
|
|
5199
|
+
center: getCenterPoint(points),
|
|
5197
5200
|
zoom,
|
|
5198
5201
|
controls: [],
|
|
5199
5202
|
suppressMapOpenBlock: true,
|
|
@@ -5203,9 +5206,7 @@
|
|
|
5203
5206
|
}
|
|
5204
5207
|
else if (yandexMaps) {
|
|
5205
5208
|
renderClusterer({ yandexMaps, map: map.current, points });
|
|
5206
|
-
|
|
5207
|
-
map.current.setCenter(DEFAULT_CENTER_COORDS);
|
|
5208
|
-
}
|
|
5209
|
+
map.current.setCenter(getCenterPoint(points));
|
|
5209
5210
|
}
|
|
5210
5211
|
}, [yandexMaps, points, zoom]);
|
|
5211
5212
|
if (!yandexMaps) {
|
|
@@ -5214,10 +5215,13 @@
|
|
|
5214
5215
|
const zIndex = 'z-10';
|
|
5215
5216
|
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))] }));
|
|
5216
5217
|
});
|
|
5217
|
-
const getCenterPoint = (points) =>
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5218
|
+
const getCenterPoint = (points) => {
|
|
5219
|
+
const centerCoords = [
|
|
5220
|
+
getArraySumAndAverage(mapByIndex(points, 0)),
|
|
5221
|
+
getArraySumAndAverage(mapByIndex(points, 1)),
|
|
5222
|
+
];
|
|
5223
|
+
return centerCoords.every((_) => _) ? centerCoords : DEFAULT_CENTER_COORDS;
|
|
5224
|
+
};
|
|
5221
5225
|
const mapByIndex = (points, index) => points.map((_) => _.coords[index]);
|
|
5222
5226
|
const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
|
|
5223
5227
|
|
|
@@ -5288,7 +5292,7 @@
|
|
|
5288
5292
|
return [_filteredItems, _points, _filteredRemoteWorkplaces, itemsLength];
|
|
5289
5293
|
}, [data, remoteWorkplaces, filtrationState]);
|
|
5290
5294
|
const [activeButton, setActiveButton] = useState('all');
|
|
5291
|
-
return (jsxs("div", { className: style('space-y-1', className), children: [jsxs("div", { className: "bg-white", children: [jsxs("div", { className: "p-3xl pb-0", children: [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] }) }), 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, className: "h-full" }) }) })] }), jsxs(ClientOnly, { children: [filteredItems.map(renderCard), filteredRemoteWorkplaces.map(renderRemoteWorkplaceCard)] })] }));
|
|
5295
|
+
return (jsxs("div", { className: style('space-y-1', className), children: [jsxs("div", { className: "bg-white", children: [jsxs("div", { className: "p-3xl pb-0", children: [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] }) }), 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: points?.length ? jsx(YandexMap, { points: points, className: "h-full" }) : jsx(Shimmer, {}) }) })] }), jsxs(ClientOnly, { children: [filteredItems.map(renderCard), filteredRemoteWorkplaces.map(renderRemoteWorkplaceCard)] })] }));
|
|
5292
5296
|
});
|
|
5293
5297
|
const renderButtonsGroup = (data, activeButton, onButtonClick) => {
|
|
5294
5298
|
const allButtonVersion = getVersion(activeButton === 'all');
|
|
@@ -6452,7 +6456,7 @@
|
|
|
6452
6456
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
6453
6457
|
});
|
|
6454
6458
|
|
|
6455
|
-
const packageVersion = "0.14.
|
|
6459
|
+
const packageVersion = "0.14.516";
|
|
6456
6460
|
|
|
6457
6461
|
exports.Blocks = Blocks;
|
|
6458
6462
|
exports.ContentPage = ContentPage;
|