@redneckz/wildless-cms-uni-blocks 0.14.672 → 0.14.673

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 (31) hide show
  1. package/bundle/bundle.umd.js +14 -5
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/ui-kit/YandexMap/YandexMap.d.ts +1 -0
  4. package/dist/ui-kit/FormField/Fields/AddressRetailField.js +1 -1
  5. package/dist/ui-kit/FormField/Fields/AddressRetailField.js.map +1 -1
  6. package/dist/ui-kit/YandexMap/YandexMap.d.ts +1 -0
  7. package/dist/ui-kit/YandexMap/YandexMap.js +11 -2
  8. package/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
  9. package/lib/ui-kit/FormField/Fields/AddressRetailField.js +1 -1
  10. package/lib/ui-kit/FormField/Fields/AddressRetailField.js.map +1 -1
  11. package/lib/ui-kit/YandexMap/YandexMap.d.ts +1 -0
  12. package/lib/ui-kit/YandexMap/YandexMap.js +11 -2
  13. package/lib/ui-kit/YandexMap/YandexMap.js.map +1 -1
  14. package/mobile/bundle/bundle.umd.js +14 -5
  15. package/mobile/bundle/bundle.umd.min.js +1 -1
  16. package/mobile/bundle/ui-kit/YandexMap/YandexMap.d.ts +1 -0
  17. package/mobile/dist/ui-kit/FormField/Fields/AddressRetailField.js +1 -1
  18. package/mobile/dist/ui-kit/FormField/Fields/AddressRetailField.js.map +1 -1
  19. package/mobile/dist/ui-kit/YandexMap/YandexMap.d.ts +1 -0
  20. package/mobile/dist/ui-kit/YandexMap/YandexMap.js +11 -2
  21. package/mobile/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
  22. package/mobile/lib/ui-kit/FormField/Fields/AddressRetailField.js +1 -1
  23. package/mobile/lib/ui-kit/FormField/Fields/AddressRetailField.js.map +1 -1
  24. package/mobile/lib/ui-kit/YandexMap/YandexMap.d.ts +1 -0
  25. package/mobile/lib/ui-kit/YandexMap/YandexMap.js +11 -2
  26. package/mobile/lib/ui-kit/YandexMap/YandexMap.js.map +1 -1
  27. package/mobile/src/ui-kit/FormField/Fields/AddressRetailField.tsx +6 -1
  28. package/mobile/src/ui-kit/YandexMap/YandexMap.tsx +58 -45
  29. package/package.json +1 -1
  30. package/src/ui-kit/FormField/Fields/AddressRetailField.tsx +6 -1
  31. package/src/ui-kit/YandexMap/YandexMap.tsx +58 -45
@@ -1975,7 +1975,7 @@
1975
1975
  // Сейчас реализован поиск среди тестовых данных
1976
1976
  // TODO: Также выяснить что делать когда ничего не найдено
1977
1977
  // TODO: На макетах также когда есть поле поиска нет кнопки открыть на карте.
1978
- const YandexMap = JSX(({ points, className = '', zoom = 5, isLoad }) => {
1978
+ const YandexMap = JSX(({ points, className = '', zoom = 5, isLoad, selectedAddress }) => {
1979
1979
  const map = useRef(null);
1980
1980
  const parentDiv = useRef(null);
1981
1981
  const yandexMaps = useYandexMaps();
@@ -1999,7 +1999,16 @@
1999
1999
  renderClusterer({ yandexMaps, map: map.current, points, isLoad });
2000
2000
  });
2001
2001
  }
2002
- }, [yandexMaps, points, zoom, isLoad]);
2002
+ // zoom к выбранному отделению банка в рамках задачи по retail
2003
+ if (map.current && selectedAddress) {
2004
+ yandexMaps?.geocode(selectedAddress).then((res) => {
2005
+ const firstGeoObject = res.geoObjects.get(0);
2006
+ const coords = firstGeoObject.geometry.getCoordinates();
2007
+ map.current.setCenter(coords);
2008
+ map.current.setZoom(18);
2009
+ });
2010
+ }
2011
+ }, [yandexMaps, points, zoom, isLoad, selectedAddress]);
2003
2012
  if (!yandexMaps) {
2004
2013
  return null;
2005
2014
  }
@@ -2475,7 +2484,7 @@
2475
2484
  const { data } = useLeadFormData('REGION_RF');
2476
2485
  const regionValue = field('regionRetail')?.value || {};
2477
2486
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2478
- field('addressRetail');
2487
+ const fieldBranch = field('addressRetail');
2479
2488
  useEffect(() => {
2480
2489
  (async () => {
2481
2490
  const officesList = await fetchRegionOffices(regionValue?.key ?? '');
@@ -2494,7 +2503,7 @@
2494
2503
  return (jsxs("div", { children: [jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u044F", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435", options: offices.map(({ id, address = '' }) => ({
2495
2504
  key: id?.toString() || '',
2496
2505
  text: address,
2497
- })), ...getValidation(field('addressRetail'), validatorObj.addressRetail, input?.required && isRegionSelected), isSearch: true }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, isLoad: !data, className: "h-full" }) }) })] }));
2506
+ })), ...getValidation(field('addressRetail'), validatorObj.addressRetail, input?.required && isRegionSelected), isSearch: true }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, isLoad: !data, className: "h-full", selectedAddress: fieldBranch?.value?.text }) }) })] }));
2498
2507
  });
2499
2508
 
2500
2509
  const useNormalizedInput = (props, { normalize, format }) => {
@@ -10012,7 +10021,7 @@
10012
10021
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
10013
10022
  });
10014
10023
 
10015
- const packageVersion = "0.14.671";
10024
+ const packageVersion = "0.14.672";
10016
10025
 
10017
10026
  exports.Blocks = Blocks;
10018
10027
  exports.ContentPage = ContentPage;