@redneckz/wildless-cms-uni-blocks 0.6.16 → 0.6.18
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/bin/migration-scripts/0.6.16.js +1 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +309 -168
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Bonus/BonusContent.d.ts +1 -0
- package/bundle/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
- package/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
- package/bundle/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
- package/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
- package/bundle/components/OfficeMap/nearbyOffices.d.ts +2 -0
- package/bundle/components/OfficeMap/renderFunctions.d.ts +1 -1
- package/bundle/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
- package/bundle/icons/IconName.d.ts +6 -2
- package/bundle/ui-kit/Button/ButtonProps.d.ts +5 -1
- package/bundle/ui-kit/Button/ButtonSection.d.ts +9 -1
- package/bundle/{components/OfficeMap → ui-kit/YandexMap}/YandexMap.d.ts +4 -1
- package/bundle/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
- package/bundle/ui-kit/YandexMap/mockPoints.d.ts +5 -0
- package/bundle/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
- package/bundle/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
- package/bundle/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
- package/bundle/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
- package/bundle/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
- package/cosmos-static/icons/FullScreenIcon.svg +1 -0
- package/cosmos-static/icons/UserGeoLocationIcon.svg +1 -0
- package/dist/components/Bonus/BonusContent.d.ts +1 -0
- package/dist/components/Catalog/CatalogCard.js +2 -2
- package/dist/components/Catalog/CatalogCard.js.map +1 -1
- package/dist/components/ExchangeRateTile/CurrencyTable.js +2 -2
- package/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
- package/dist/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
- package/dist/components/ExchangeRateTile/CurrentLocation.js +1 -1
- package/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -1
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -15
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js +11 -11
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
- package/dist/components/ExchangeRateTile/renderInput.js +4 -1
- package/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
- package/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
- package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js +43 -0
- package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
- package/dist/components/Gallery/GalleryCardInner.js +2 -2
- package/dist/components/Gallery/GalleryCardInner.js.map +1 -1
- package/dist/components/Gallery/GalleryInner.js +2 -2
- package/dist/components/Gallery/GalleryInner.js.map +1 -1
- package/dist/components/Header/DropdownMenu.js +1 -1
- package/dist/components/Header/DropdownMenu.js.map +1 -1
- package/dist/components/Header/HeaderSubMenu.js +16 -11
- package/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/dist/components/OfficeMap/OfficeMap.js +6 -10
- package/dist/components/OfficeMap/OfficeMap.js.map +1 -1
- package/dist/components/OfficeMap/nearbyOffices.d.ts +2 -0
- package/dist/components/OfficeMap/nearbyOffices.js +9 -0
- package/dist/components/OfficeMap/nearbyOffices.js.map +1 -0
- package/dist/components/OfficeMap/renderFunctions.d.ts +1 -1
- package/dist/components/OfficeMap/renderFunctions.js +1 -1
- package/dist/components/OfficeMap/renderFunctions.js.map +1 -1
- package/dist/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
- package/{mobile/dist/hooks → dist/components/OfficeMap}/useOfficeMap.js +1 -1
- package/dist/components/OfficeMap/useOfficeMap.js.map +1 -0
- package/dist/components/PictureText/PictureText.js +1 -1
- package/dist/components/PictureText/PictureText.js.map +1 -1
- package/dist/components/SafeDepositRental/SafeDepositRental.js +2 -2
- package/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/dist/components/TariffsTable/EmbeddableCellData.js +5 -2
- package/dist/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/dist/components/TariffsTable/EmbeddableCellData.mobile.js +5 -2
- package/dist/components/TariffsTable/EmbeddableCellData.mobile.js.map +1 -1
- package/dist/components/TariffsTable/dataFixture.js +2 -4
- package/dist/components/TariffsTable/dataFixture.js.map +1 -1
- package/dist/icons/IconName.d.ts +6 -2
- package/dist/icons/IconName.js +5 -1
- package/dist/icons/IconName.js.map +1 -1
- package/dist/ui-kit/BlockWrapper.js +4 -3
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/dist/ui-kit/Button/ButtonProps.d.ts +5 -1
- package/dist/ui-kit/Button/ButtonSection.d.ts +9 -1
- package/dist/ui-kit/Button/ButtonSection.js +18 -6
- package/dist/ui-kit/Button/ButtonSection.js.map +1 -1
- package/dist/ui-kit/IntersectionObserverTag.js +10 -10
- package/dist/ui-kit/IntersectionObserverTag.js.map +1 -1
- package/{lib/components/OfficeMap → dist/ui-kit/YandexMap}/YandexMap.d.ts +4 -1
- package/dist/ui-kit/YandexMap/YandexMap.js +86 -0
- package/dist/ui-kit/YandexMap/YandexMap.js.map +1 -0
- package/dist/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
- package/dist/ui-kit/YandexMap/ZoomButton.js +26 -0
- package/dist/ui-kit/YandexMap/ZoomButton.js.map +1 -0
- package/dist/ui-kit/YandexMap/mockPoints.d.ts +5 -0
- package/dist/ui-kit/YandexMap/mockPoints.js +28 -0
- package/dist/ui-kit/YandexMap/mockPoints.js.map +1 -0
- package/dist/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
- package/dist/ui-kit/YandexMap/renderClusterer.js +35 -0
- package/dist/ui-kit/YandexMap/renderClusterer.js.map +1 -0
- package/dist/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
- package/dist/ui-kit/YandexMap/renderOpenMap.js +19 -0
- package/dist/ui-kit/YandexMap/renderOpenMap.js.map +1 -0
- package/dist/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
- package/dist/ui-kit/YandexMap/renderSearchField.js +31 -0
- package/dist/ui-kit/YandexMap/renderSearchField.js.map +1 -0
- package/dist/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
- package/dist/ui-kit/YandexMap/renderUserGeolocation.js +31 -0
- package/dist/ui-kit/YandexMap/renderUserGeolocation.js.map +1 -0
- package/dist/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
- package/dist/ui-kit/YandexMap/useYandexMaps.js +11 -0
- package/dist/ui-kit/YandexMap/useYandexMaps.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Bonus/BonusContent.d.ts +1 -0
- package/lib/components/Catalog/CatalogCard.js +2 -2
- package/lib/components/Catalog/CatalogCard.js.map +1 -1
- package/lib/components/ExchangeRateTile/CurrencyTable.js +2 -2
- package/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
- package/lib/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
- package/lib/components/ExchangeRateTile/CurrentLocation.js +1 -1
- package/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -1
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -15
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js +11 -11
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
- package/lib/components/ExchangeRateTile/renderInput.js +4 -1
- package/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
- package/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
- package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js +39 -0
- package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
- package/lib/components/Gallery/GalleryCardInner.js +2 -2
- package/lib/components/Gallery/GalleryCardInner.js.map +1 -1
- package/lib/components/Gallery/GalleryInner.js +2 -2
- package/lib/components/Gallery/GalleryInner.js.map +1 -1
- package/lib/components/Header/DropdownMenu.js +1 -1
- package/lib/components/Header/DropdownMenu.js.map +1 -1
- package/lib/components/Header/HeaderSubMenu.js +17 -12
- package/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/lib/components/OfficeMap/OfficeMap.js +6 -10
- package/lib/components/OfficeMap/OfficeMap.js.map +1 -1
- package/lib/components/OfficeMap/nearbyOffices.d.ts +2 -0
- package/lib/components/OfficeMap/nearbyOffices.js +7 -0
- package/lib/components/OfficeMap/nearbyOffices.js.map +1 -0
- package/lib/components/OfficeMap/renderFunctions.d.ts +1 -1
- package/lib/components/OfficeMap/renderFunctions.js +1 -1
- package/lib/components/OfficeMap/renderFunctions.js.map +1 -1
- package/lib/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
- package/{mobile/lib/hooks → lib/components/OfficeMap}/useOfficeMap.js +1 -1
- package/lib/components/OfficeMap/useOfficeMap.js.map +1 -0
- package/lib/components/PictureText/PictureText.js +1 -1
- package/lib/components/PictureText/PictureText.js.map +1 -1
- package/lib/components/SafeDepositRental/SafeDepositRental.js +2 -2
- package/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/lib/components/TariffsTable/EmbeddableCellData.js +5 -2
- package/lib/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/lib/components/TariffsTable/EmbeddableCellData.mobile.js +5 -2
- package/lib/components/TariffsTable/EmbeddableCellData.mobile.js.map +1 -1
- package/lib/components/TariffsTable/dataFixture.js +2 -4
- package/lib/components/TariffsTable/dataFixture.js.map +1 -1
- package/lib/icons/IconName.d.ts +6 -2
- package/lib/icons/IconName.js +5 -1
- package/lib/icons/IconName.js.map +1 -1
- package/lib/ui-kit/BlockWrapper.js +4 -3
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/ui-kit/Button/ButtonProps.d.ts +5 -1
- package/lib/ui-kit/Button/ButtonSection.d.ts +9 -1
- package/lib/ui-kit/Button/ButtonSection.js +16 -5
- package/lib/ui-kit/Button/ButtonSection.js.map +1 -1
- package/lib/ui-kit/IntersectionObserverTag.js +11 -11
- package/lib/ui-kit/IntersectionObserverTag.js.map +1 -1
- package/{mobile/bundle/components/OfficeMap → lib/ui-kit/YandexMap}/YandexMap.d.ts +4 -1
- package/lib/ui-kit/YandexMap/YandexMap.js +84 -0
- package/lib/ui-kit/YandexMap/YandexMap.js.map +1 -0
- package/lib/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
- package/lib/ui-kit/YandexMap/ZoomButton.js +24 -0
- package/lib/ui-kit/YandexMap/ZoomButton.js.map +1 -0
- package/lib/ui-kit/YandexMap/mockPoints.d.ts +5 -0
- package/lib/ui-kit/YandexMap/mockPoints.js +26 -0
- package/lib/ui-kit/YandexMap/mockPoints.js.map +1 -0
- package/lib/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
- package/lib/ui-kit/YandexMap/renderClusterer.js +32 -0
- package/lib/ui-kit/YandexMap/renderClusterer.js.map +1 -0
- package/lib/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
- package/lib/ui-kit/YandexMap/renderOpenMap.js +16 -0
- package/lib/ui-kit/YandexMap/renderOpenMap.js.map +1 -0
- package/lib/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
- package/lib/ui-kit/YandexMap/renderSearchField.js +28 -0
- package/lib/ui-kit/YandexMap/renderSearchField.js.map +1 -0
- package/lib/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
- package/lib/ui-kit/YandexMap/renderUserGeolocation.js +28 -0
- package/lib/ui-kit/YandexMap/renderUserGeolocation.js.map +1 -0
- package/lib/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
- package/lib/ui-kit/YandexMap/useYandexMaps.js +8 -0
- package/lib/ui-kit/YandexMap/useYandexMaps.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +36 -22
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Bonus/BonusContent.d.ts +1 -0
- package/mobile/bundle/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
- package/mobile/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
- package/mobile/bundle/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
- package/mobile/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
- package/mobile/bundle/components/OfficeMap/nearbyOffices.d.ts +2 -0
- package/mobile/bundle/components/OfficeMap/renderFunctions.d.ts +1 -1
- package/mobile/bundle/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
- package/mobile/bundle/icons/IconName.d.ts +6 -2
- package/mobile/bundle/ui-kit/Button/ButtonProps.d.ts +5 -1
- package/mobile/bundle/ui-kit/Button/ButtonSection.d.ts +9 -1
- package/{dist/components/OfficeMap → mobile/bundle/ui-kit/YandexMap}/YandexMap.d.ts +4 -1
- package/mobile/bundle/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
- package/mobile/bundle/ui-kit/YandexMap/mockPoints.d.ts +5 -0
- package/mobile/bundle/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
- package/mobile/bundle/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
- package/mobile/bundle/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
- package/mobile/bundle/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
- package/mobile/bundle/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
- package/mobile/dist/components/Bonus/BonusContent.d.ts +1 -0
- package/mobile/dist/components/Catalog/CatalogCard.js +2 -2
- package/mobile/dist/components/Catalog/CatalogCard.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js +2 -2
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
- package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js +1 -1
- package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -15
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +11 -11
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
- package/mobile/dist/components/ExchangeRateTile/renderInput.js +4 -1
- package/mobile/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
- package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js +43 -0
- package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
- package/mobile/dist/components/Gallery/GalleryCardInner.js +2 -2
- package/mobile/dist/components/Gallery/GalleryCardInner.js.map +1 -1
- package/mobile/dist/components/Gallery/GalleryInner.js +2 -2
- package/mobile/dist/components/Gallery/GalleryInner.js.map +1 -1
- package/mobile/dist/components/Header/DropdownMenu.js +1 -1
- package/mobile/dist/components/Header/DropdownMenu.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js +16 -11
- package/mobile/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/dist/components/OfficeMap/OfficeMap.js +6 -10
- package/mobile/dist/components/OfficeMap/OfficeMap.js.map +1 -1
- package/mobile/dist/components/OfficeMap/nearbyOffices.d.ts +2 -0
- package/mobile/dist/components/OfficeMap/nearbyOffices.js +9 -0
- package/mobile/dist/components/OfficeMap/nearbyOffices.js.map +1 -0
- package/mobile/dist/components/OfficeMap/renderFunctions.d.ts +1 -1
- package/mobile/dist/components/OfficeMap/renderFunctions.js +1 -1
- package/mobile/dist/components/OfficeMap/renderFunctions.js.map +1 -1
- package/mobile/dist/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
- package/{dist/hooks → mobile/dist/components/OfficeMap}/useOfficeMap.js +1 -1
- package/mobile/dist/components/OfficeMap/useOfficeMap.js.map +1 -0
- package/mobile/dist/components/PictureText/PictureText.js +1 -1
- package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
- package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js +2 -2
- package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/mobile/dist/components/TariffsTable/EmbeddableCellData.js +5 -2
- package/mobile/dist/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/mobile/dist/components/TariffsTable/dataFixture.js +2 -4
- package/mobile/dist/components/TariffsTable/dataFixture.js.map +1 -1
- package/mobile/dist/icons/IconName.d.ts +6 -2
- package/mobile/dist/icons/IconName.js +5 -1
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/ui-kit/BlockWrapper.js +4 -3
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonProps.d.ts +5 -1
- package/mobile/dist/ui-kit/Button/ButtonSection.d.ts +9 -1
- package/mobile/dist/ui-kit/Button/ButtonSection.js +18 -6
- package/mobile/dist/ui-kit/Button/ButtonSection.js.map +1 -1
- package/mobile/dist/ui-kit/IntersectionObserverTag.js +10 -10
- package/mobile/dist/ui-kit/IntersectionObserverTag.js.map +1 -1
- package/mobile/dist/ui-kit/YandexMap/YandexMap.d.ts +8 -0
- package/mobile/dist/ui-kit/YandexMap/YandexMap.js +86 -0
- package/mobile/dist/ui-kit/YandexMap/YandexMap.js.map +1 -0
- package/mobile/dist/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
- package/mobile/dist/ui-kit/YandexMap/ZoomButton.js +26 -0
- package/mobile/dist/ui-kit/YandexMap/ZoomButton.js.map +1 -0
- package/mobile/dist/ui-kit/YandexMap/mockPoints.d.ts +5 -0
- package/mobile/dist/ui-kit/YandexMap/mockPoints.js +28 -0
- package/mobile/dist/ui-kit/YandexMap/mockPoints.js.map +1 -0
- package/mobile/dist/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
- package/mobile/dist/ui-kit/YandexMap/renderClusterer.js +35 -0
- package/mobile/dist/ui-kit/YandexMap/renderClusterer.js.map +1 -0
- package/mobile/dist/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
- package/mobile/dist/ui-kit/YandexMap/renderOpenMap.js +19 -0
- package/mobile/dist/ui-kit/YandexMap/renderOpenMap.js.map +1 -0
- package/mobile/dist/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
- package/mobile/dist/ui-kit/YandexMap/renderSearchField.js +31 -0
- package/mobile/dist/ui-kit/YandexMap/renderSearchField.js.map +1 -0
- package/mobile/dist/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
- package/mobile/dist/ui-kit/YandexMap/renderUserGeolocation.js +31 -0
- package/mobile/dist/ui-kit/YandexMap/renderUserGeolocation.js.map +1 -0
- package/mobile/dist/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
- package/mobile/dist/ui-kit/YandexMap/useYandexMaps.js +11 -0
- package/mobile/dist/ui-kit/YandexMap/useYandexMaps.js.map +1 -0
- package/mobile/lib/components/Bonus/BonusContent.d.ts +1 -0
- package/mobile/lib/components/Catalog/CatalogCard.js +2 -2
- package/mobile/lib/components/Catalog/CatalogCard.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js +2 -2
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/CurrentLocation.d.ts +0 -1
- package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js +1 -1
- package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -3
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -15
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +11 -11
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +1 -1
- package/mobile/lib/components/ExchangeRateTile/renderInput.js +4 -1
- package/mobile/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +17 -0
- package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js +39 -0
- package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
- package/mobile/lib/components/Gallery/GalleryCardInner.js +2 -2
- package/mobile/lib/components/Gallery/GalleryCardInner.js.map +1 -1
- package/mobile/lib/components/Gallery/GalleryInner.js +2 -2
- package/mobile/lib/components/Gallery/GalleryInner.js.map +1 -1
- package/mobile/lib/components/Header/DropdownMenu.js +1 -1
- package/mobile/lib/components/Header/DropdownMenu.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js +17 -12
- package/mobile/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/lib/components/OfficeMap/OfficeMap.js +6 -10
- package/mobile/lib/components/OfficeMap/OfficeMap.js.map +1 -1
- package/mobile/lib/components/OfficeMap/nearbyOffices.d.ts +2 -0
- package/mobile/lib/components/OfficeMap/nearbyOffices.js +7 -0
- package/mobile/lib/components/OfficeMap/nearbyOffices.js.map +1 -0
- package/mobile/lib/components/OfficeMap/renderFunctions.d.ts +1 -1
- package/mobile/lib/components/OfficeMap/renderFunctions.js +1 -1
- package/mobile/lib/components/OfficeMap/renderFunctions.js.map +1 -1
- package/mobile/lib/{hooks → components/OfficeMap}/useOfficeMap.d.ts +0 -0
- package/{lib/hooks → mobile/lib/components/OfficeMap}/useOfficeMap.js +1 -1
- package/mobile/lib/components/OfficeMap/useOfficeMap.js.map +1 -0
- package/mobile/lib/components/PictureText/PictureText.js +1 -1
- package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
- package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js +2 -2
- package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/mobile/lib/components/TariffsTable/EmbeddableCellData.js +5 -2
- package/mobile/lib/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/mobile/lib/components/TariffsTable/dataFixture.js +2 -4
- package/mobile/lib/components/TariffsTable/dataFixture.js.map +1 -1
- package/mobile/lib/icons/IconName.d.ts +6 -2
- package/mobile/lib/icons/IconName.js +5 -1
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/ui-kit/BlockWrapper.js +4 -3
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonProps.d.ts +5 -1
- package/mobile/lib/ui-kit/Button/ButtonSection.d.ts +9 -1
- package/mobile/lib/ui-kit/Button/ButtonSection.js +16 -5
- package/mobile/lib/ui-kit/Button/ButtonSection.js.map +1 -1
- package/mobile/lib/ui-kit/IntersectionObserverTag.js +11 -11
- package/mobile/lib/ui-kit/IntersectionObserverTag.js.map +1 -1
- package/mobile/lib/ui-kit/YandexMap/YandexMap.d.ts +8 -0
- package/mobile/lib/ui-kit/YandexMap/YandexMap.js +84 -0
- package/mobile/lib/ui-kit/YandexMap/YandexMap.js.map +1 -0
- package/mobile/lib/ui-kit/YandexMap/ZoomButton.d.ts +7 -0
- package/mobile/lib/ui-kit/YandexMap/ZoomButton.js +24 -0
- package/mobile/lib/ui-kit/YandexMap/ZoomButton.js.map +1 -0
- package/mobile/lib/ui-kit/YandexMap/mockPoints.d.ts +5 -0
- package/mobile/lib/ui-kit/YandexMap/mockPoints.js +26 -0
- package/mobile/lib/ui-kit/YandexMap/mockPoints.js.map +1 -0
- package/mobile/lib/ui-kit/YandexMap/renderClusterer.d.ts +2 -0
- package/mobile/lib/ui-kit/YandexMap/renderClusterer.js +32 -0
- package/mobile/lib/ui-kit/YandexMap/renderClusterer.js.map +1 -0
- package/mobile/lib/ui-kit/YandexMap/renderOpenMap.d.ts +2 -0
- package/mobile/lib/ui-kit/YandexMap/renderOpenMap.js +16 -0
- package/mobile/lib/ui-kit/YandexMap/renderOpenMap.js.map +1 -0
- package/mobile/lib/ui-kit/YandexMap/renderSearchField.d.ts +4 -0
- package/mobile/lib/ui-kit/YandexMap/renderSearchField.js +28 -0
- package/mobile/lib/ui-kit/YandexMap/renderSearchField.js.map +1 -0
- package/mobile/lib/ui-kit/YandexMap/renderUserGeolocation.d.ts +3 -0
- package/mobile/lib/ui-kit/YandexMap/renderUserGeolocation.js +28 -0
- package/mobile/lib/ui-kit/YandexMap/renderUserGeolocation.js.map +1 -0
- package/mobile/lib/ui-kit/YandexMap/useYandexMaps.d.ts +2 -0
- package/mobile/lib/ui-kit/YandexMap/useYandexMaps.js +8 -0
- package/mobile/lib/ui-kit/YandexMap/useYandexMaps.js.map +1 -0
- package/mobile/src/common.css +9 -0
- package/mobile/src/components/Bonus/Bonus.example.json +1 -6
- package/mobile/src/components/Bonus/BonusContent.ts +1 -0
- package/mobile/src/components/Catalog/CatalogCard.tsx +2 -2
- package/mobile/src/components/ExchangeRateTile/CurrencyTable.tsx +8 -6
- package/mobile/src/components/ExchangeRateTile/CurrentLocation.tsx +8 -15
- package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +31 -19
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +14 -13
- package/mobile/src/components/ExchangeRateTile/callbackCurrencySelect.ts +1 -1
- package/mobile/src/components/ExchangeRateTile/renderInput.tsx +5 -2
- package/mobile/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +71 -0
- package/mobile/src/components/Gallery/GalleryCardInner.tsx +2 -2
- package/mobile/src/components/Gallery/GalleryInner.tsx +2 -2
- package/mobile/src/components/Header/DropdownMenu.tsx +5 -5
- package/mobile/src/components/Header/HeaderSubMenu.tsx +36 -20
- package/mobile/src/components/OfficeMap/OfficeMap.tsx +10 -17
- package/mobile/src/components/OfficeMap/nearbyOffices.ts +8 -0
- package/mobile/src/components/OfficeMap/renderFunctions.tsx +5 -2
- package/mobile/src/{hooks → components/OfficeMap}/useOfficeMap.ts +1 -1
- package/mobile/src/components/PictureText/PictureText.tsx +1 -1
- package/mobile/src/components/SafeDepositRental/SafeDepositRental.tsx +2 -2
- package/mobile/src/components/TariffsTable/EmbeddableCellData.tsx +7 -11
- package/mobile/src/components/TariffsTable/dataFixture.tsx +2 -3
- package/mobile/src/icons/FullScreenIcon.svg +8 -0
- package/mobile/src/icons/IconName.ts +5 -5
- package/mobile/src/icons/UserGeoLocationIcon.svg +3 -0
- package/mobile/src/ui-kit/BlockWrapper.tsx +5 -3
- package/mobile/src/ui-kit/Button/ButtonProps.ts +5 -1
- package/mobile/src/ui-kit/Button/ButtonSection.tsx +41 -16
- package/mobile/src/ui-kit/IntersectionObserverTag.tsx +13 -17
- package/mobile/src/ui-kit/YandexMap/YandexMap.tsx +128 -0
- package/mobile/src/ui-kit/YandexMap/ZoomButton.tsx +38 -0
- package/mobile/src/ui-kit/YandexMap/mockPoints.ts +30 -0
- package/mobile/src/ui-kit/YandexMap/renderClusterer.ts +51 -0
- package/mobile/src/ui-kit/YandexMap/renderOpenMap.tsx +26 -0
- package/mobile/src/ui-kit/YandexMap/renderSearchField.tsx +51 -0
- package/mobile/src/ui-kit/YandexMap/renderUserGeolocation.tsx +43 -0
- package/mobile/src/ui-kit/YandexMap/useYandexMaps.ts +11 -0
- package/package.json +1 -1
- package/src/common.css +9 -0
- package/src/components/Bonus/Bonus.example.json +1 -6
- package/src/components/Bonus/BonusContent.ts +1 -0
- package/src/components/Catalog/Catalog.fixture.tsx +3 -10
- package/src/components/Catalog/CatalogCard.tsx +2 -2
- package/src/components/ExchangeRateTile/CurrencyTable.tsx +8 -6
- package/src/components/ExchangeRateTile/CurrentLocation.tsx +8 -15
- package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +31 -19
- package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +14 -13
- package/src/components/ExchangeRateTile/callbackCurrencySelect.ts +1 -1
- package/src/components/ExchangeRateTile/renderInput.tsx +5 -2
- package/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +71 -0
- package/src/components/Gallery/Gallery.fixture.tsx +1 -2
- package/src/components/Gallery/GalleryCardInner.tsx +2 -2
- package/src/components/Gallery/GalleryInner.tsx +2 -2
- package/src/components/Header/DropdownMenu.tsx +5 -5
- package/src/components/Header/HeaderSubMenu.tsx +36 -20
- package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +3 -14
- package/src/components/OfficeMap/OfficeMap.tsx +10 -17
- package/src/components/OfficeMap/nearbyOffices.ts +8 -0
- package/src/components/OfficeMap/renderFunctions.tsx +5 -2
- package/src/{hooks → components/OfficeMap}/useOfficeMap.ts +1 -1
- package/src/components/PictureText/PictureText.tsx +1 -1
- package/src/components/SafeDepositRental/SafeDepositRental.tsx +2 -2
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +2 -0
- package/src/components/TariffsTable/EmbeddableCellData.mobile.tsx +7 -11
- package/src/components/TariffsTable/EmbeddableCellData.tsx +7 -9
- package/src/components/TariffsTable/dataFixture.tsx +2 -3
- package/src/icons/FullScreenIcon.svg +8 -0
- package/src/icons/IconName.ts +9 -1
- package/src/icons/UserGeoLocationIcon.svg +3 -0
- package/src/ui-kit/BlockWrapper.tsx +5 -3
- package/src/ui-kit/Button/ButtonProps.ts +5 -1
- package/src/ui-kit/Button/ButtonSection.tsx +41 -16
- package/src/ui-kit/IntersectionObserverTag.tsx +13 -17
- package/src/ui-kit/YandexMap/YandexMap.tsx +128 -0
- package/src/ui-kit/YandexMap/ZoomButton.tsx +38 -0
- package/src/ui-kit/YandexMap/mockPoints.ts +30 -0
- package/src/ui-kit/YandexMap/renderClusterer.ts +51 -0
- package/src/ui-kit/YandexMap/renderOpenMap.tsx +26 -0
- package/src/ui-kit/YandexMap/renderSearchField.tsx +51 -0
- package/src/ui-kit/YandexMap/renderUserGeolocation.tsx +43 -0
- package/src/ui-kit/YandexMap/useYandexMaps.ts +11 -0
- package/bundle/hooks/useExchangeRates.d.ts +0 -2
- package/dist/components/OfficeMap/YandexMap.js +0 -30
- package/dist/components/OfficeMap/YandexMap.js.map +0 -1
- package/dist/hooks/useExchangeRates.d.ts +0 -2
- package/dist/hooks/useExchangeRates.js +0 -57
- package/dist/hooks/useExchangeRates.js.map +0 -1
- package/dist/hooks/useOfficeMap.js.map +0 -1
- package/lib/components/OfficeMap/YandexMap.js +0 -28
- package/lib/components/OfficeMap/YandexMap.js.map +0 -1
- package/lib/hooks/useExchangeRates.d.ts +0 -2
- package/lib/hooks/useExchangeRates.js +0 -54
- package/lib/hooks/useExchangeRates.js.map +0 -1
- package/lib/hooks/useOfficeMap.js.map +0 -1
- package/mobile/bundle/hooks/useExchangeRates.d.ts +0 -2
- package/mobile/dist/components/OfficeMap/YandexMap.d.ts +0 -5
- package/mobile/dist/components/OfficeMap/YandexMap.js +0 -30
- package/mobile/dist/components/OfficeMap/YandexMap.js.map +0 -1
- package/mobile/dist/hooks/useExchangeRates.d.ts +0 -2
- package/mobile/dist/hooks/useExchangeRates.js +0 -57
- package/mobile/dist/hooks/useExchangeRates.js.map +0 -1
- package/mobile/dist/hooks/useOfficeMap.js.map +0 -1
- package/mobile/lib/components/OfficeMap/YandexMap.d.ts +0 -5
- package/mobile/lib/components/OfficeMap/YandexMap.js +0 -28
- package/mobile/lib/components/OfficeMap/YandexMap.js.map +0 -1
- package/mobile/lib/hooks/useExchangeRates.d.ts +0 -2
- package/mobile/lib/hooks/useExchangeRates.js +0 -54
- package/mobile/lib/hooks/useExchangeRates.js.map +0 -1
- package/mobile/lib/hooks/useOfficeMap.js.map +0 -1
- package/mobile/src/components/OfficeMap/YandexMap.tsx +0 -41
- package/mobile/src/hooks/useExchangeRates.ts +0 -76
- package/src/components/OfficeMap/YandexMap.tsx +0 -41
- package/src/hooks/useExchangeRates.ts +0 -76
package/bundle/bundle.umd.js
CHANGED
|
@@ -280,24 +280,27 @@
|
|
|
280
280
|
|
|
281
281
|
const IntersectionObserverTag = JSX((props) => {
|
|
282
282
|
const { tag = 'section', observerCallback, observerOptions, className = '', anchor = null, children, } = props;
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
if (!
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
if (intersectionObserver.current) {
|
|
289
|
-
intersectionObserver.current.disconnect();
|
|
283
|
+
const tagRef = useRef(null);
|
|
284
|
+
useEffect(() => {
|
|
285
|
+
if (!tagRef.current) {
|
|
286
|
+
return undefined;
|
|
290
287
|
}
|
|
291
|
-
intersectionObserver
|
|
292
|
-
intersectionObserver.
|
|
288
|
+
const intersectionObserver = new IntersectionObserver(observerCallback, observerOptions);
|
|
289
|
+
intersectionObserver.observe(tagRef.current);
|
|
290
|
+
return () => {
|
|
291
|
+
intersectionObserver.disconnect();
|
|
292
|
+
};
|
|
293
293
|
}, [observerCallback, observerOptions]);
|
|
294
294
|
const Tag = tag;
|
|
295
|
-
return (jsx(Tag, { ref:
|
|
295
|
+
return (jsx(Tag, { ref: tagRef, className: className, id: anchor, children: children }));
|
|
296
296
|
});
|
|
297
297
|
|
|
298
298
|
const THRESHOLD_ACCURACY = 100; // Decimals number (100 is for two decimals number, 0.**)
|
|
299
299
|
const THRESHOLD_ARRAY_LENGTH = 18;
|
|
300
300
|
const THRESHOLD_ARRAY_START_VALUE = (THRESHOLD_ACCURACY - THRESHOLD_ARRAY_LENGTH) / THRESHOLD_ACCURACY;
|
|
301
|
+
const OBSERVER_OPTIONS = {
|
|
302
|
+
threshold: new Array(THRESHOLD_ARRAY_LENGTH).fill(0).map(getIntersectionThreshold),
|
|
303
|
+
};
|
|
301
304
|
const BlockWrapper = JSX(({ anchor, className, children, tag = 'section', labels }) => {
|
|
302
305
|
const Tag = tag;
|
|
303
306
|
const [shouldRenderBlock, setShouldRenderBlock] = useState(true);
|
|
@@ -326,9 +329,7 @@
|
|
|
326
329
|
if (!shouldRenderBlock) {
|
|
327
330
|
return null;
|
|
328
331
|
}
|
|
329
|
-
return anchor ? (jsx(IntersectionObserverTag, { tag: tag, className: className, observerCallback: observerCallback, observerOptions: {
|
|
330
|
-
threshold: new Array(THRESHOLD_ARRAY_LENGTH).fill(0).map(getIntersectionThreshold),
|
|
331
|
-
}, anchor: anchor, children: children })) : (jsx(Tag, { className: className, children: children }));
|
|
332
|
+
return anchor ? (jsx(IntersectionObserverTag, { tag: tag, className: className, observerCallback: observerCallback, observerOptions: OBSERVER_OPTIONS, anchor: anchor, children: children })) : (jsx(Tag, { className: className, children: children }));
|
|
332
333
|
});
|
|
333
334
|
function getIntersectionThreshold(_, i) {
|
|
334
335
|
const value = (i + 1) / THRESHOLD_ACCURACY + THRESHOLD_ARRAY_START_VALUE;
|
|
@@ -639,12 +640,22 @@
|
|
|
639
640
|
const ButtonSection = JSX(({ context, className = '', buttons }) => {
|
|
640
641
|
const { handlerDecorator } = context;
|
|
641
642
|
const router = context.useRouter();
|
|
642
|
-
return buttons && buttons?.length ? (jsx("div", { className: className, children: buttons.map((button, index) => (
|
|
643
|
-
});
|
|
644
|
-
const ButtonSectionItem = JSX(({ router, handlerDecorator, button }) => {
|
|
645
|
-
const buttonProps = useLink({ router, handlerDecorator }, button);
|
|
646
|
-
return jsx(Button, { ...button, ...buttonProps });
|
|
643
|
+
return buttons && buttons?.length ? (jsx("div", { className: className, children: buttons.map((button, index) => renderButton({ button: useLink({ router, handlerDecorator }, button), index })) })) : null;
|
|
647
644
|
});
|
|
645
|
+
function renderButton({ button, buttonClassName, index }) {
|
|
646
|
+
const { icon, iconRight, version, ...rest } = button;
|
|
647
|
+
const iconVersion = version === 'secondary' ? 'normal' : 'white';
|
|
648
|
+
const leftIcon = renderButtonIcon({ icon, iconVersion });
|
|
649
|
+
const rightIcon = renderButtonIcon({ icon: iconRight, iconVersion });
|
|
650
|
+
return (jsx(Button, { className: buttonClassName, appendLeft: leftIcon, appendRight: rightIcon, version: version, ...rest }, index ? String(index) : ''));
|
|
651
|
+
}
|
|
652
|
+
const renderButtonIcon = ({ icon, iconVersion }) => {
|
|
653
|
+
if (!icon?.icon && !icon?.src) {
|
|
654
|
+
return null;
|
|
655
|
+
}
|
|
656
|
+
const iconWidth = icon?.size?.width ? `${icon.size.width}` : '24';
|
|
657
|
+
return jsx(ImgInner, { image: { ...icon, iconVersion: iconVersion }, width: iconWidth, height: "24", asSVG: true });
|
|
658
|
+
};
|
|
648
659
|
|
|
649
660
|
const Description = JSX((props) => {
|
|
650
661
|
const { className = '', description } = props;
|
|
@@ -1242,7 +1253,7 @@
|
|
|
1242
1253
|
white: 'bg-white',
|
|
1243
1254
|
};
|
|
1244
1255
|
const CatalogCard = JSX(({ className = '', title, description, image, price, button, colors }) => {
|
|
1245
|
-
return (jsxs("section", { className: `border border-solid box-border border-main-stroke p-[30px] min-w-[402px] flex flex-col justify-left ${className}`, role: "listitem", children: [image?.src ? jsx(ImgInner, { className: "mb-5 flex justify-center", image: image }) : null, title ? (jsx(Heading, { headingType: "h6", as: "h4", className: "text-left mb-1.5", title: title })) : null, description ? jsx("div", { className: "text-m-light text-left mb-4", children: description }) : null, colors?.length ? (jsxs("div", { className: "flex mb-4 text-m-light text-secondary-text", children: [jsx("div", { className: "mr-1.5", children: "\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 \u0446\u0432\u0435\u0442\u0430: " }), colors.map(renderColorOption)] })) : null, price ? jsxs("div", { className: "text-h3 text-left", children: [price, "\u00A0\u20BD"] }) : null, button ?
|
|
1256
|
+
return (jsxs("section", { className: `border border-solid box-border border-main-stroke p-[30px] min-w-[402px] flex flex-col justify-left ${className}`, role: "listitem", children: [image?.src ? jsx(ImgInner, { className: "mb-5 flex justify-center", image: image }) : null, title ? (jsx(Heading, { headingType: "h6", as: "h4", className: "text-left mb-1.5", title: title })) : null, description ? jsx("div", { className: "text-m-light text-left mb-4", children: description }) : null, colors?.length ? (jsxs("div", { className: "flex mb-4 text-m-light text-secondary-text", children: [jsx("div", { className: "mr-1.5", children: "\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 \u0446\u0432\u0435\u0442\u0430: " }), colors.map(renderColorOption)] })) : null, price ? jsxs("div", { className: "text-h3 text-left", children: [price, "\u00A0\u20BD"] }) : null, button ? renderButton({ button, buttonClassName: 'mt-5 w-full' }) : null] }));
|
|
1246
1257
|
});
|
|
1247
1258
|
const renderColorOption = (color, i) => (jsx("span", { className: `w-6 h-6 ml-3 border border-solid border-main-divider rounded-full ${cardStyleMap$1[color]}` }, String(i)));
|
|
1248
1259
|
|
|
@@ -1389,62 +1400,6 @@
|
|
|
1389
1400
|
return (jsxs("section", { className: `flex flex-col justify-center items-center mt-12 ${className}`, role: "listitem", children: [jsx("div", { className: "flex justify-center py-20", children: renderErrorContent(error) }), title ? jsx(Heading, { headingType: "h1", className: "text-left mb-4", title: title }) : null, subtitle ? (jsx("div", { className: "font-sans text-xl-light mb-7 max-w-[613px] text-center", children: subtitle })) : null, button?.text ? (jsx(Button, { className: "py-4 px-9", version: button?.version, ...useLink({ router, handlerDecorator }, button), children: button.text })) : null] }));
|
|
1390
1401
|
});
|
|
1391
1402
|
|
|
1392
|
-
const roundTo = (value, precision = 2) => {
|
|
1393
|
-
const factor = 10 ** precision;
|
|
1394
|
-
return Math.round(parseFloat(String(value)) * factor) / factor;
|
|
1395
|
-
};
|
|
1396
|
-
|
|
1397
|
-
function useExchangeRates() {
|
|
1398
|
-
const { data } = useAsyncData(EXCHANGE_RATES_URL, fetchExchangeRates);
|
|
1399
|
-
const result = data?.hits?.hits?.map((_) => _._source) || [];
|
|
1400
|
-
return result.length ? getCurrencyListByRate(result) : result;
|
|
1401
|
-
}
|
|
1402
|
-
function fetchExchangeRates() {
|
|
1403
|
-
return fetchJSON(EXCHANGE_RATES_URL, {
|
|
1404
|
-
method: 'POST',
|
|
1405
|
-
body: JSON.stringify(EXCHANGE_RATES_BODY),
|
|
1406
|
-
});
|
|
1407
|
-
}
|
|
1408
|
-
const EXCHANGE_RATES_URL = 'https://coins.rshb.ru/api/catalog/vue_storefront_magento_1_currency_rates_average/currency_rates_average/_search?size=10000';
|
|
1409
|
-
const EXCHANGE_RATES_BODY = {
|
|
1410
|
-
query: {
|
|
1411
|
-
bool: {
|
|
1412
|
-
must: [
|
|
1413
|
-
{
|
|
1414
|
-
term: {
|
|
1415
|
-
// eslint-disable-next-line camelcase
|
|
1416
|
-
russian_region_code: '77',
|
|
1417
|
-
},
|
|
1418
|
-
},
|
|
1419
|
-
{
|
|
1420
|
-
term: {
|
|
1421
|
-
// eslint-disable-next-line camelcase
|
|
1422
|
-
from_volume: '0',
|
|
1423
|
-
},
|
|
1424
|
-
},
|
|
1425
|
-
{
|
|
1426
|
-
terms: {
|
|
1427
|
-
// eslint-disable-next-line camelcase
|
|
1428
|
-
currency_pair: ['USD/RUB', 'EUR/RUB'],
|
|
1429
|
-
},
|
|
1430
|
-
},
|
|
1431
|
-
],
|
|
1432
|
-
},
|
|
1433
|
-
},
|
|
1434
|
-
};
|
|
1435
|
-
const getCurrencyListByRate = (currencyRates) => currencyRates.reduce((result, _) => {
|
|
1436
|
-
const currencyInfo = _['currency_first'];
|
|
1437
|
-
const currencyCode = currencyInfo?.code;
|
|
1438
|
-
if (!result.some((i) => i.code === currencyCode)) {
|
|
1439
|
-
result.push({
|
|
1440
|
-
code: currencyCode,
|
|
1441
|
-
buy: roundTo(Number(_.rate_buy), 3),
|
|
1442
|
-
sell: roundTo(Number(_.rate_sell), 3),
|
|
1443
|
-
});
|
|
1444
|
-
}
|
|
1445
|
-
return result;
|
|
1446
|
-
}, []);
|
|
1447
|
-
|
|
1448
1403
|
const BaseTile = JSX(({ className = '', title = '', children, buttons, image }) => {
|
|
1449
1404
|
return (jsxs("div", { className: `font-sans flex flex-col grow h-full items-start ${className}`, children: [title, jsxs("div", { className: "flex grow w-full justify-between", children: [jsxs("div", { className: "flex flex-col justify-between w-full", children: [jsx("div", { className: "h-full", children: children }), buttons ? jsx("div", { className: "mt-auto pt-8", children: buttons }) : null] }), image] })] }));
|
|
1450
1405
|
});
|
|
@@ -1471,11 +1426,16 @@
|
|
|
1471
1426
|
return (jsxs("table", { className: `h-fit w-fit ${className}`, children: [jsx("thead", { children: jsxs("tr", { children: [jsx("th", { className: TABLE_HEAD_STYLE, children: "\u0412\u0430\u043B\u044E\u0442\u0430" }), jsx("th", { className: `${TABLE_HEAD_STYLE} pl-11`, children: "\u041A\u0443\u043F\u0438\u0442\u044C" }), jsx("th", { className: `${TABLE_HEAD_STYLE} pl-11`, children: "\u041F\u0440\u043E\u0434\u0430\u0442\u044C" })] }) }), jsx("tbody", { children: exchangeCurrencyItems.map((item) => renderCurrencyRow(item)) })] }));
|
|
1472
1427
|
});
|
|
1473
1428
|
const renderCurrencyRow = (exchangeCurrencyItem) => {
|
|
1474
|
-
const
|
|
1475
|
-
return (jsxs("tr", { className: "pb-1 text-h6", children: [jsx("td", { className: "pt-4", children: jsxs("div", { className: "flex items-center", children: [
|
|
1429
|
+
const currency = exchangeCurrencyItem?.currency?.currency;
|
|
1430
|
+
return (jsxs("tr", { className: "pb-1 text-h6", children: [jsx("td", { className: "pt-4", children: jsxs("div", { className: "flex items-center", children: [currency ? (jsx(ImgInner, { image: { icon: CURRENCY_ICONS_MAP[currency] }, width: "24", height: "24" })) : null, jsx("span", { className: "ml-2", children: currency })] }) }), jsx("td", { className: "pt-4 pl-11", children: formatCurrency(exchangeCurrencyItem?.saleExchangeRate) }), jsx("td", { className: "pt-4 pl-11", children: formatCurrency(exchangeCurrencyItem?.buyExchangeRate) })] }, currency));
|
|
1476
1431
|
};
|
|
1477
1432
|
|
|
1478
|
-
const CurrentLocation = JSX(({ className = '', address
|
|
1433
|
+
const CurrentLocation = JSX(({ className = '', address }) => (jsxs("div", { className: `flex ${className}`, children: [jsx(ImgInner, { image: { icon: 'GpsIcon' }, width: "24", height: "24", asSVG: true }), jsxs("div", { className: "ml-3", children: [address ? jsx("p", { className: "text-primary-main m-0 mb-1 text-l", children: address }) : null, jsx("p", { className: "text-secondary-text m-0 text-m", children: "\u041A\u0443\u0440\u0441 \u0443\u043A\u0430\u0437\u0430\u043D \u0434\u043B\u044F \u0431\u043B\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043E \u043E\u0444\u0438\u0441\u0430" })] })] })));
|
|
1434
|
+
|
|
1435
|
+
const roundTo = (value, precision = 2) => {
|
|
1436
|
+
const factor = 10 ** precision;
|
|
1437
|
+
return Math.round(parseFloat(String(value)) * factor) / factor;
|
|
1438
|
+
};
|
|
1479
1439
|
|
|
1480
1440
|
const calculateResult = (value, rate, precision) => {
|
|
1481
1441
|
const result = Number(formatValue(value)) * Math.pow(rate, precision ? -1 : 1);
|
|
@@ -1544,7 +1504,10 @@
|
|
|
1544
1504
|
|
|
1545
1505
|
function renderInput(props) {
|
|
1546
1506
|
const { placeholder, rates, selected, value, setValue, setSelected } = props;
|
|
1547
|
-
const ratesOptions = rates.map((_) => ({
|
|
1507
|
+
const ratesOptions = rates.map((_) => ({
|
|
1508
|
+
key: _?.currency?.currency ?? '',
|
|
1509
|
+
text: _?.currency?.currency ?? '',
|
|
1510
|
+
}));
|
|
1548
1511
|
const selectedValue = { key: selected, text: selected };
|
|
1549
1512
|
return (jsxs("div", { className: "relative flex", children: [jsx(Input, { className: "shrink-0 text-l w-full appearance-none mr-[-90px]", placeholder: placeholder, type: "text", value: value, onChange: setValue }), ratesOptions.length ? (jsx(Select, { isBorder: false, onChange: (_) => setSelected(_.key), options: ratesOptions, value: selectedValue })) : null] }));
|
|
1550
1513
|
}
|
|
@@ -1555,8 +1518,8 @@
|
|
|
1555
1518
|
const [calcState, setCalcState] = useState({
|
|
1556
1519
|
inputSell: '',
|
|
1557
1520
|
inputBuy: '',
|
|
1558
|
-
selectSell: currencyRatesBuy?.[0]?.
|
|
1559
|
-
selectBuy: currencyRatesSell?.[0]?.
|
|
1521
|
+
selectSell: currencyRatesBuy?.[0]?.currency?.currency || Currency.RUB,
|
|
1522
|
+
selectBuy: currencyRatesSell?.[0]?.currency?.currency || Currency.USD,
|
|
1560
1523
|
});
|
|
1561
1524
|
const handleSetCalcState = (newState) => {
|
|
1562
1525
|
setCalcState((oldState) => ({ ...oldState, ...newState }));
|
|
@@ -1582,8 +1545,8 @@
|
|
|
1582
1545
|
callbackCurrencySelect({
|
|
1583
1546
|
value,
|
|
1584
1547
|
oppositeValue: calcState.selectBuy,
|
|
1585
|
-
handleConvert: (
|
|
1586
|
-
handleInputSell(setCalcState, currencyRatesSell)(calcState.inputSell,
|
|
1548
|
+
handleConvert: (currencyFrom = calcState.selectSell, currencyTo = calcState.selectBuy) => {
|
|
1549
|
+
handleInputSell(setCalcState, currencyRatesSell)(calcState.inputSell, currencyFrom, currencyTo);
|
|
1587
1550
|
},
|
|
1588
1551
|
});
|
|
1589
1552
|
};
|
|
@@ -1592,42 +1555,75 @@
|
|
|
1592
1555
|
callbackCurrencySelect({
|
|
1593
1556
|
value,
|
|
1594
1557
|
oppositeValue: calcState.selectSell,
|
|
1595
|
-
handleConvert: (
|
|
1558
|
+
handleConvert: (currencyTo = calcState.selectBuy, currencyFrom = calcState.selectSell) => handleInputBuy(setCalcState, currencyRatesBuy)(calcState.inputBuy, currencyTo, currencyFrom),
|
|
1596
1559
|
});
|
|
1597
1560
|
};
|
|
1598
|
-
const handleInputSell = (setCalcState, currencyRatesSell) => (value,
|
|
1599
|
-
setCalcState({ inputSell: formatValue(value), selectBuy:
|
|
1600
|
-
const rate = currencyRatesSell.find((_) => _.
|
|
1601
|
-
currencyRatesSell.find((_) => _.
|
|
1561
|
+
const handleInputSell = (setCalcState, currencyRatesSell) => (value, currencyFrom, currencyTo) => {
|
|
1562
|
+
setCalcState({ inputSell: formatValue(value), selectBuy: currencyTo });
|
|
1563
|
+
const rate = currencyRatesSell.find((_) => _.currency?.currency === currencyTo)?.buyExchangeRate ||
|
|
1564
|
+
currencyRatesSell.find((_) => _.currency?.currency === currencyFrom)?.saleExchangeRate;
|
|
1602
1565
|
if (rate) {
|
|
1603
1566
|
setCalcState({
|
|
1604
|
-
inputBuy: String(calculateResult(value, rate,
|
|
1567
|
+
inputBuy: String(calculateResult(value, rate, currencyFrom === Currency.RUB) || ''),
|
|
1605
1568
|
});
|
|
1606
1569
|
}
|
|
1607
1570
|
};
|
|
1608
|
-
const handleInputBuy = (setCalcState, currencyRatesBuy) => (value,
|
|
1609
|
-
setCalcState({ inputBuy: formatValue(value), selectSell:
|
|
1610
|
-
const rate = currencyRatesBuy.find((_) => _.
|
|
1611
|
-
currencyRatesBuy.find((_) => _.
|
|
1571
|
+
const handleInputBuy = (setCalcState, currencyRatesBuy) => (value, currencyTo, currencyFrom) => {
|
|
1572
|
+
setCalcState({ inputBuy: formatValue(value), selectSell: currencyFrom });
|
|
1573
|
+
const rate = currencyRatesBuy.find((_) => _.currency?.currency === currencyFrom)?.saleExchangeRate ||
|
|
1574
|
+
currencyRatesBuy.find((_) => _.currency?.currency === currencyTo)?.buyExchangeRate;
|
|
1612
1575
|
if (rate) {
|
|
1613
1576
|
setCalcState({
|
|
1614
|
-
inputSell: String(calculateResult(value, rate,
|
|
1577
|
+
inputSell: String(calculateResult(value, rate, currencyTo === Currency.RUB) || ''),
|
|
1615
1578
|
});
|
|
1616
1579
|
}
|
|
1617
1580
|
};
|
|
1618
1581
|
|
|
1619
|
-
const
|
|
1620
|
-
|
|
1621
|
-
|
|
1582
|
+
const EXCHANGE_RATES_URL = '/api/v1/exchangerates';
|
|
1583
|
+
const REGION_URL = '/api/v1/region';
|
|
1584
|
+
function useFetchExchangeRateData() {
|
|
1585
|
+
const { data } = useAsyncData(EXCHANGE_RATES_URL, fetchData);
|
|
1586
|
+
return data || {};
|
|
1587
|
+
}
|
|
1588
|
+
const fetchData = async (urlExchangeRates) => {
|
|
1589
|
+
const region = await fetchRegion();
|
|
1590
|
+
const regionCode = region?.code || '000';
|
|
1591
|
+
const exchangeRates = await fetchExchangeRates(urlExchangeRates, regionCode);
|
|
1592
|
+
return { region, exchangeRates };
|
|
1622
1593
|
};
|
|
1594
|
+
const fetchRegion = async () => {
|
|
1595
|
+
try {
|
|
1596
|
+
return await fetchJSONUnsafe(REGION_URL, { method: 'GET' });
|
|
1597
|
+
}
|
|
1598
|
+
catch (error) {
|
|
1599
|
+
console.log(error);
|
|
1600
|
+
return {};
|
|
1601
|
+
}
|
|
1602
|
+
};
|
|
1603
|
+
const fetchExchangeRates = async (url, regionCode) => {
|
|
1604
|
+
try {
|
|
1605
|
+
return await fetchJSONUnsafe(url + `?regionCode=${regionCode}`, {
|
|
1606
|
+
method: 'GET',
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
1609
|
+
catch (error) {
|
|
1610
|
+
console.log(error);
|
|
1611
|
+
return {};
|
|
1612
|
+
}
|
|
1613
|
+
};
|
|
1614
|
+
|
|
1623
1615
|
const ExchangeRateTile = JSX(({ className = '', context, title = 'Курсы обмена валют', button, ...rest }) => {
|
|
1624
|
-
const
|
|
1625
|
-
const
|
|
1626
|
-
currencyRatesBuy.
|
|
1627
|
-
|
|
1628
|
-
currencyRatesSell.
|
|
1629
|
-
|
|
1616
|
+
const { exchangeRates } = useFetchExchangeRateData();
|
|
1617
|
+
const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
|
|
1618
|
+
const currencyRatesBuy = currencyRates.filter((_) => _.buyExchangeRate);
|
|
1619
|
+
currencyRatesBuy.unshift({ currency: { currency: Currency.RUB } });
|
|
1620
|
+
const currencyRatesSell = currencyRates.filter((_) => _.saleExchangeRate);
|
|
1621
|
+
currencyRatesSell.push({ currency: { currency: Currency.RUB } });
|
|
1622
|
+
return (jsx(BlockWrapper, { context: context, className: `bg-white text-primary-text font-sans p-9 box-border min-h-[320px] ${className}`, ...rest, children: jsx(BaseTile, { context: context, title: jsx(Heading, { headingType: "h4", title: title, className: "whitespace-pre-wrap text-h4 mb-5" }), children: jsxs("div", { className: "flex", children: [jsxs("div", { className: "mr-14 pt-4", children: [currencyRates ? (jsx(CurrencyTable, { className: "mb-[30px]", exchangeCurrencyItems: currencyRates })) : null, jsx(CurrentLocation, { address: exchangeRates?.address })] }), currencyRates.length && currencyRatesBuy.length && currencyRatesSell.length ? (jsx(ExchangeCurrencyCalculator, { className: "grow", context: context, currencyRatesBuy: currencyRatesBuy, currencyRatesSell: currencyRatesSell, button: button })) : null] }) }) }));
|
|
1630
1623
|
});
|
|
1624
|
+
const getCurrencyRates = (currencies) => {
|
|
1625
|
+
return currencies?.filter((_) => _?.currency?.id === 1 || _?.currency?.id === 2) || [];
|
|
1626
|
+
};
|
|
1631
1627
|
|
|
1632
1628
|
const ICON_VERSION_MAP = {
|
|
1633
1629
|
'bg-white': 'normal',
|
|
@@ -1850,7 +1846,7 @@
|
|
|
1850
1846
|
});
|
|
1851
1847
|
|
|
1852
1848
|
const GalleryCardInner = JSX(({ title, headlineSmallVersion = 'H6', description, additionalDescription, icon, items, button, version, isDotted = true, align = 'center', }) => {
|
|
1853
|
-
return (jsxs("div", { className: `h-full flex flex-col justify-between ${AlignText[align]}`, children: [jsxs("div", { className: "flex flex-col h-full", children: [renderImage$1(icon), renderCardTitle(headlineSmallVersion, title), renderDescription$2(description, title), items?.length ? renderItems$1(items, isDotted, version) : null, renderAdditionalDescription$1(additionalDescription)] }), button?.text ?
|
|
1849
|
+
return (jsxs("div", { className: `h-full flex flex-col justify-between ${AlignText[align]}`, children: [jsxs("div", { className: "flex flex-col h-full", children: [renderImage$1(icon), renderCardTitle(headlineSmallVersion, title), renderDescription$2(description, title), items?.length ? renderItems$1(items, isDotted, version) : null, renderAdditionalDescription$1(additionalDescription)] }), button?.text ? renderButton({ button, buttonClassName: 'mt-6' }) : null] }));
|
|
1854
1850
|
});
|
|
1855
1851
|
const renderImage$1 = (image) => (jsxs("div", { className: "flex justify-center", children: [image?.src ? jsx(ImgInner, { className: "mb-5", image: image }) : null, image?.icon ? (jsx(ImgInner, { className: `w-[32px] h-[32px] min-w-[32px] mb-5 rounded-full`, image: image, asSVG: true })) : null] }));
|
|
1856
1852
|
const renderCardTitle = (headlineSmallVersion, title) => title ? jsx("div", { className: HEADLINE_SMALL_VERSION[headlineSmallVersion], children: title }) : null;
|
|
@@ -1879,7 +1875,7 @@
|
|
|
1879
1875
|
isShown: [showPrevButton, showNextButton],
|
|
1880
1876
|
btnClass: ['left-8', 'right-8'],
|
|
1881
1877
|
className: 'top-1/2',
|
|
1882
|
-
}), isGalleryScrollAvailable ? (jsxs("div", { children: [jsx("div", { className: "absolute top-0 left-0 bottom-0 w-[82px] bg-opacity-from-white" }), jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[82px] bg-opacity-to-white" })] })) : null, button ?
|
|
1878
|
+
}), isGalleryScrollAvailable ? (jsxs("div", { children: [jsx("div", { className: "absolute top-0 left-0 bottom-0 w-[82px] bg-opacity-from-white" }), jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[82px] bg-opacity-to-white" })] })) : null, button ? renderButton({ button, buttonClassName: 'mt-8 mx-auto' }) : null] }));
|
|
1883
1879
|
});
|
|
1884
1880
|
|
|
1885
1881
|
const Gallery = JSX((props) => jsx(GalleryInner, { ...props, version: "normal" }));
|
|
@@ -2005,32 +2001,37 @@
|
|
|
2005
2001
|
});
|
|
2006
2002
|
const renderDotsSubMenuItems = ({ menuItems, router, handlerDecorator, activeSubItem, }) => {
|
|
2007
2003
|
const isActive = (item) => item === activeSubItem;
|
|
2008
|
-
return menuItems?.map((
|
|
2004
|
+
return menuItems?.map(({ text, ...rest }) => (jsx("a", { ...useLink({ router, handlerDecorator }, rest), className: `text-l-light pb-4 hover:text-primary-main ${isActive(rest) ? 'text-primary-main' : ''}`, children: text }, rest.href)));
|
|
2009
2005
|
};
|
|
2010
2006
|
const renderDot = (bgColor, i) => (jsx("div", { className: `w-[3px] h-[3px] rounded mr-1 ${DOT_BG_COLORS_MAP[bgColor]}` }, String(i)));
|
|
2011
2007
|
|
|
2012
2008
|
const HeaderSubMenu = JSX(({ context, subItems = [], bgColor }) => {
|
|
2013
|
-
const [menuVisible, setMenuVisible] = useState(false);
|
|
2014
|
-
const router = context.useRouter();
|
|
2015
2009
|
const { handlerDecorator } = context;
|
|
2010
|
+
const router = context.useRouter();
|
|
2011
|
+
const subItemsListRef = useRef(null);
|
|
2012
|
+
const [menuVisible, setMenuVisible] = useState(false);
|
|
2016
2013
|
const [visibleItemsCount, setVisibleItemsCount] = useState(subItems.length);
|
|
2017
2014
|
const dropDownMenuItems = subItems.slice(visibleItemsCount);
|
|
2018
|
-
const
|
|
2019
|
-
const
|
|
2020
|
-
const observerCallback = (itemIndex) => (entries) => {
|
|
2015
|
+
const observerOptions = useMemo(() => ({ threshold: 1, root: subItemsListRef.current }), [subItemsListRef.current]);
|
|
2016
|
+
const observerCallbacks = useMemo(() => subItems.map((_, index) => (entries) => {
|
|
2021
2017
|
if (!entries.length) {
|
|
2022
2018
|
return;
|
|
2023
2019
|
}
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2020
|
+
// Assumption about sorting entries by time
|
|
2021
|
+
const entry = entries[entries.length - 1];
|
|
2022
|
+
if (entry.isIntersecting) {
|
|
2023
|
+
setVisibleItemsCount(handleIntersectionActivation(index));
|
|
2027
2024
|
}
|
|
2028
2025
|
else {
|
|
2029
|
-
setVisibleItemsCount((
|
|
2026
|
+
setVisibleItemsCount(handleIntersectionDeactivation(index));
|
|
2030
2027
|
}
|
|
2031
|
-
};
|
|
2032
|
-
|
|
2028
|
+
}), [subItems]);
|
|
2029
|
+
const activeSubItem = findActiveSubItem(router)(subItems);
|
|
2030
|
+
const toggleMenu = () => setMenuVisible(!menuVisible);
|
|
2031
|
+
return (jsxs("nav", { className: "relative mt-6", children: [jsx("div", { ref: subItemsListRef, className: "overflow-hidden whitespace-nowrap mr-52 pb-3", children: subItems.map((_, i) => (jsx(IntersectionObserverTag, { tag: "span", observerCallback: observerCallbacks[i], observerOptions: observerOptions, children: jsx(HeaderItem, { className: `mr-8 ${visibleItemsCount - 1 < i ? 'invisible' : ''}`, active: _ === activeSubItem, ...useLink({ router, handlerDecorator }, _), bgColor: bgColor }) }, String(i)))) }), dropDownMenuItems.length ? (jsx(DropdownMenu, { context: context, activeSubItem: activeSubItem, menuVisible: menuVisible, toggleMenu: toggleMenu, menuItems: dropDownMenuItems, bgColor: bgColor })) : null] }));
|
|
2033
2032
|
});
|
|
2033
|
+
const handleIntersectionActivation = (index) => (prev) => Math.max(prev, index + 1);
|
|
2034
|
+
const handleIntersectionDeactivation = (index) => (prev) => Math.min(prev, index);
|
|
2034
2035
|
|
|
2035
2036
|
const BORDER_COLORS = {
|
|
2036
2037
|
'bg-white': 'bg-main-divider',
|
|
@@ -2341,7 +2342,7 @@
|
|
|
2341
2342
|
const lunchHourText = hasTime ? `Перерыв ${lunchHour}` : lunchHour;
|
|
2342
2343
|
return status ? (jsxs("div", { className: "flex", children: [jsx("div", { className: "p-3 border rounded-md text-m flex items-center cursor-pointer text-primary-main border-green-light mr-4", children: workTime ? workTime : null }), jsx("div", { className: "p-3 border rounded-md text-m flex items-center cursor-pointer text-golden border-golden", children: lunchHour ? lunchHourText : null })] })) : (jsx("div", { className: "flex", children: jsx("div", { className: "p-3 border rounded-md text-m flex items-center cursor-pointer text-error border-error", children: "\u0412\u044B\u0445\u043E\u0434\u043D\u043E\u0439" }) }));
|
|
2343
2344
|
};
|
|
2344
|
-
const renderNearbyOffice = ({ icon, title, distance, time },
|
|
2345
|
+
const renderNearbyOffice = ({ icon, title, distance, time }, index) => (jsxs("div", { className: "flex mr-4", children: [jsx(Icon, { name: icon, width: "16", height: "16", asSVG: true, className: "mr-1" }), title ? jsxs("span", { className: "text-m", children: [title, "\u00A0"] }) : null, jsxs("span", { className: "text-m-light", children: [distance ? ` (${distance})` : null, time ? `, ${time}` : null] })] }, `nearbyOffice${index}`));
|
|
2345
2346
|
const renderDay = ({ title, status, workTime, lunchHour, description }, inx) => (jsxs("div", { className: "flex flex-col pb-3 border-b border-solid border-main-divider mb-3 last:border-0", children: [jsxs("div", { className: "flex justify-between items-center w-full pb-1 text-l text-primary-text", children: [jsx("div", { children: title }), status ? null : jsx("div", { className: "text-m-light text-error", children: "\u0412\u044B\u0445\u043E\u0434\u043D\u043E\u0439" }), status && workTime ? jsx("div", { children: workTime }) : null] }), status && lunchHour ? renderLunchHour(lunchHour) : null, description ? (jsx("div", { className: "pb-1 text-s-light text-secondary-text", children: description })) : null] }, `day${inx}`));
|
|
2346
2347
|
const renderLunchHour = (lunchHour) => {
|
|
2347
2348
|
const hasTime = /\d+/gi.test(lunchHour);
|
|
@@ -2380,6 +2381,72 @@
|
|
|
2380
2381
|
});
|
|
2381
2382
|
}
|
|
2382
2383
|
|
|
2384
|
+
const styles$3 = {
|
|
2385
|
+
focus: 'focus:border-primary-focus focus:border',
|
|
2386
|
+
hover: 'hover:bg-primary-hover',
|
|
2387
|
+
active: 'active:bg-primary-active',
|
|
2388
|
+
border: 'border border-transparent rounded-md',
|
|
2389
|
+
position: 'flex items-center justify-center',
|
|
2390
|
+
font: 'text-center font-sans',
|
|
2391
|
+
};
|
|
2392
|
+
const renderOpenMap = (pointsCenter) => {
|
|
2393
|
+
const getYandexMapUrl = () => {
|
|
2394
|
+
return `https://yandex.ru/maps/?ll=${[pointsCenter[1], pointsCenter[0]]}&z=10&l=map`;
|
|
2395
|
+
};
|
|
2396
|
+
return (jsx("a", { className: `select-none cursor-pointer px-9 h-12 bg-white bg-primary-main text-white ${Object.values(styles$3).join(' ')}`, href: getYandexMapUrl(), target: "_blank", children: "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043D\u0430 \u043A\u0430\u0440\u0442\u0435" }));
|
|
2397
|
+
};
|
|
2398
|
+
|
|
2399
|
+
const styles$2 = {
|
|
2400
|
+
border: 'border border-transparent rounded-md',
|
|
2401
|
+
position: 'relative flex items-center',
|
|
2402
|
+
font: 'text-center font-sans',
|
|
2403
|
+
shadow: 'shadow-[0_4px_25px_rgba(0,0,0,0.07)]',
|
|
2404
|
+
};
|
|
2405
|
+
const renderSearchField = (points, yandexMaps, updatePointsToRender) => {
|
|
2406
|
+
const onChange = (e) => {
|
|
2407
|
+
const value = e.target?.value ? e.target?.value.toLowerCase() : '';
|
|
2408
|
+
if (value) {
|
|
2409
|
+
const searchResult = points.filter((_) => {
|
|
2410
|
+
const textLowerCase = _.text.toLowerCase();
|
|
2411
|
+
if (textLowerCase.indexOf(value) > -1) {
|
|
2412
|
+
return _;
|
|
2413
|
+
}
|
|
2414
|
+
return null;
|
|
2415
|
+
});
|
|
2416
|
+
updatePointsToRender(searchResult);
|
|
2417
|
+
}
|
|
2418
|
+
else {
|
|
2419
|
+
updatePointsToRender(null);
|
|
2420
|
+
}
|
|
2421
|
+
};
|
|
2422
|
+
return (jsxs("div", { className: `${Object.values(styles$2).join(' ')} bg-white py-3 pl-11 pr-4 w-full`, children: [jsx(Icon, { name: "LoupeIcon", iconVersion: "black", width: "20", height: "20", asSVG: true, className: "absolute left-4" }), jsx("input", { type: "text", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u0438\u043B\u0438 \u043C\u0435\u0442\u0440\u043E", onChange: onChange, className: "border-0 focus:border-0 outline-0 w-full" })] }));
|
|
2423
|
+
};
|
|
2424
|
+
|
|
2425
|
+
const styles$1 = {
|
|
2426
|
+
focus: 'focus:border-primary-focus focus:border',
|
|
2427
|
+
hover: 'hover:bg-primary-hover',
|
|
2428
|
+
active: 'active:bg-primary-active',
|
|
2429
|
+
border: 'border border-transparent rounded-md',
|
|
2430
|
+
position: 'absolute flex items-center justify-center',
|
|
2431
|
+
font: 'text-center font-sans',
|
|
2432
|
+
};
|
|
2433
|
+
const renderUserGeolocation = (map, yandexMaps, className) => {
|
|
2434
|
+
const setUserGeoLocation = () => {
|
|
2435
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2436
|
+
// @ts-ignore
|
|
2437
|
+
yandexMaps.geolocation
|
|
2438
|
+
.get({
|
|
2439
|
+
provider: 'yandex',
|
|
2440
|
+
autoReverseGeocode: true,
|
|
2441
|
+
mapStateAutoApply: true,
|
|
2442
|
+
})
|
|
2443
|
+
.then(function (result) {
|
|
2444
|
+
map.geoObjects.add(result.geoObjects);
|
|
2445
|
+
});
|
|
2446
|
+
};
|
|
2447
|
+
return (jsx("div", { className: `select-none cursor-pointer py-4 w-12 bg-white ${Object.values(styles$1).join(' ')} ${className}`, onClick: setUserGeoLocation, children: jsx(Icon, { name: "UserGeoLocationIcon", width: "20", height: "16" }) }));
|
|
2448
|
+
};
|
|
2449
|
+
|
|
2383
2450
|
const getNS = (_) => globalThis[_];
|
|
2384
2451
|
function useExternalNS(namespaceName, url) {
|
|
2385
2452
|
const [externalNS, setExternalNS] = useState();
|
|
@@ -2417,37 +2484,137 @@
|
|
|
2417
2484
|
const YMAPS_NAMESPACE = 'ymaps';
|
|
2418
2485
|
const useYandexMaps = () => {
|
|
2419
2486
|
const url = `https://api-maps.yandex.ru/2.1/?apikey=${projectSettings.YANDEX_MAP_API_KEY}&lang=ru_RU`;
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2487
|
+
return useExternalNS(YMAPS_NAMESPACE, url);
|
|
2488
|
+
};
|
|
2489
|
+
|
|
2490
|
+
const styles = {
|
|
2491
|
+
focus: 'focus:border-primary-focus focus:border',
|
|
2492
|
+
hover: 'hover:bg-primary-hover',
|
|
2493
|
+
active: 'active:bg-primary-active',
|
|
2494
|
+
border: 'border-b border-b-2 border-gray last:border-0',
|
|
2495
|
+
position: 'relative flex items-center justify-center',
|
|
2496
|
+
font: 'text-center font-sans text-l',
|
|
2497
|
+
};
|
|
2498
|
+
// TODO: Добавить метод определения центральной точки
|
|
2499
|
+
const ZoomButton = JSX(({ yandexMaps, direction = 'in' }) => {
|
|
2500
|
+
const iconName = direction === 'in' ? 'PlusIcon' : 'MinusIcon';
|
|
2501
|
+
const changeZoom = () => {
|
|
2502
|
+
const currentZoom = yandexMaps.current.getZoom();
|
|
2503
|
+
const newZoom = direction === 'in' ? currentZoom + 1 : currentZoom - 1;
|
|
2504
|
+
yandexMaps.current.setZoom(newZoom, { checkZoomRange: true });
|
|
2505
|
+
};
|
|
2506
|
+
return (jsx("div", { onClick: changeZoom, className: `${Object.values(styles).join(' ')} bg-white select-none cursor-pointer w-12 h-12`, children: jsx(Icon, { name: iconName, width: "20", height: "16" }) }));
|
|
2507
|
+
});
|
|
2508
|
+
|
|
2509
|
+
const mockPoints = [
|
|
2510
|
+
{ coords: [55.77, 37.46], text: 'Трактир' },
|
|
2511
|
+
{ coords: [55.66, 37.48], text: 'Трактор' },
|
|
2512
|
+
{ coords: [55.65, 37.42], text: 'Ресторан' },
|
|
2513
|
+
{ coords: [55.64, 37.54], text: 'Музей' },
|
|
2514
|
+
{ coords: [55.54, 37.52], text: 'Библиотека' },
|
|
2515
|
+
{ coords: [55.53, 37.56], text: 'Школа' },
|
|
2516
|
+
{ coords: [55.61, 37.61], text: 'Аптека' },
|
|
2517
|
+
{ coords: [55.8, 37.58], text: 'Бар' },
|
|
2518
|
+
{ coords: [55.71, 37.35], text: 'Институт' },
|
|
2519
|
+
{ coords: [55.74, 37.57], text: 'Университет' },
|
|
2520
|
+
{ coords: [55.58, 37.69], text: 'Больница' },
|
|
2521
|
+
{ coords: [55.57, 37.7], text: 'Цирк' },
|
|
2522
|
+
{ coords: [55.55, 37.64], text: 'Магазин' },
|
|
2523
|
+
{ coords: [55.5, 37.75], text: 'Булочная' },
|
|
2524
|
+
{ coords: [55.81, 37.73], text: 'Полиция' },
|
|
2525
|
+
{ coords: [55.73, 37.68], text: 'Салон красоты' },
|
|
2526
|
+
{ coords: [55.86, 37.76], text: 'Баня' },
|
|
2527
|
+
{ coords: [55.38, 37.69], text: 'Гараж' },
|
|
2528
|
+
{ coords: [55.91, 37.5], text: 'Дом' },
|
|
2529
|
+
{ coords: [55.62, 37.32], text: 'Прачечная' },
|
|
2530
|
+
{ coords: [55.85, 37.41], text: 'Стадион' },
|
|
2531
|
+
{ coords: [55.67, 37.24], text: 'Вокзал' },
|
|
2532
|
+
{ coords: [55.79, 37.41], text: 'Кафе' },
|
|
2533
|
+
];
|
|
2423
2534
|
|
|
2424
|
-
const
|
|
2535
|
+
const FULLSCREEN_STYLES = {
|
|
2536
|
+
border: 'border border-transparent rounded-md ',
|
|
2537
|
+
position: 'absolute flex items-center justify-center',
|
|
2538
|
+
size: 'w-12 h-12',
|
|
2539
|
+
focus: 'focus:border-primary-focus focus:border',
|
|
2540
|
+
font: 'text-center font-sans',
|
|
2541
|
+
active: 'active:bg-primary-active',
|
|
2542
|
+
hover: 'hover:bg-primary-hover',
|
|
2543
|
+
other: 'select-none cursor-pointer',
|
|
2544
|
+
};
|
|
2545
|
+
// TODO: Поле для поиска: невыяснено среди каких данных делать поиск (искать в имени офиса, в адресе, метро и т.д.).
|
|
2546
|
+
// Сейчас реализован поиск среди тестовых данных
|
|
2547
|
+
// TODO: Также выяснить что делать когда ничего не найдено
|
|
2548
|
+
// TODO: На макетах также когда есть поле поиска нет кнопки открыть на карте.
|
|
2549
|
+
const YandexMap = JSX(({ points, className = '', zoom = 5, showSearchField = false }) => {
|
|
2425
2550
|
const map = useRef(null);
|
|
2426
2551
|
const yandexMaps = useYandexMaps();
|
|
2552
|
+
const [isFullScreen, setIsFullScreen] = useState();
|
|
2553
|
+
const [pointsToRender, setPointsToRender] = useState(normalizePoints(mockPoints));
|
|
2554
|
+
const pointsCenter = getCenterPoint(points);
|
|
2427
2555
|
useEffect(() => {
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2556
|
+
if (!map?.current) {
|
|
2557
|
+
yandexMaps?.ready(() => {
|
|
2558
|
+
map.current = new yandexMaps.Map('map', {
|
|
2559
|
+
center: pointsCenter,
|
|
2560
|
+
zoom,
|
|
2561
|
+
controls: [],
|
|
2562
|
+
suppressMapOpenBlock: true,
|
|
2563
|
+
});
|
|
2564
|
+
renderClusterer(yandexMaps, map.current, pointsToRender);
|
|
2432
2565
|
});
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
}, [map, point, yandexMaps]);
|
|
2566
|
+
}
|
|
2567
|
+
}, [yandexMaps, map, pointsToRender]);
|
|
2436
2568
|
useEffect(() => {
|
|
2437
|
-
if (map.current &&
|
|
2438
|
-
|
|
2569
|
+
if (map.current && pointsToRender && yandexMaps) {
|
|
2570
|
+
const newPoints = pointsToRender.length < 1 ? normalizePoints(mockPoints) : pointsToRender;
|
|
2571
|
+
renderClusterer(yandexMaps, map.current, newPoints);
|
|
2439
2572
|
}
|
|
2440
|
-
}, [map,
|
|
2573
|
+
}, [map, pointsToRender, yandexMaps]);
|
|
2441
2574
|
if (!yandexMaps) {
|
|
2442
2575
|
return null;
|
|
2443
2576
|
}
|
|
2444
|
-
|
|
2577
|
+
const toggleFullscreen = () => {
|
|
2578
|
+
const container = map.current.container;
|
|
2579
|
+
if (!isFullScreen) {
|
|
2580
|
+
container.enterFullscreen();
|
|
2581
|
+
}
|
|
2582
|
+
else {
|
|
2583
|
+
container.exitFullscreen();
|
|
2584
|
+
}
|
|
2585
|
+
setIsFullScreen(container.isFullscreen());
|
|
2586
|
+
};
|
|
2587
|
+
const zIndex = isFullScreen ? 'z-[100000]' : 'z-10';
|
|
2588
|
+
const updatePointsToRender = (newPoints) => {
|
|
2589
|
+
if (newPoints) {
|
|
2590
|
+
const normalizedPoints = normalizePoints(newPoints);
|
|
2591
|
+
setPointsToRender(normalizedPoints);
|
|
2592
|
+
}
|
|
2593
|
+
};
|
|
2594
|
+
return (jsxs("div", { id: "map", className: `${isFullScreen ? '' : 'relative'} w-full ${className}`, children: [jsx("div", { className: `absolute flex left-2 top-4 w-[50%] ${zIndex}`, children: showSearchField
|
|
2595
|
+
? renderSearchField(mockPoints, yandexMaps, updatePointsToRender)
|
|
2596
|
+
: renderOpenMap(pointsCenter) }), jsx("div", { className: `${Object.values(FULLSCREEN_STYLES).join(' ')} ${zIndex} right-2 top-4 bg-white`, onClick: toggleFullscreen, children: jsx(Icon, { name: "FullScreenIcon", width: "16", height: "16" }) }), jsxs("div", { className: `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.current, yandexMaps, `right-2 top-80 ${zIndex}`)] }));
|
|
2445
2597
|
});
|
|
2598
|
+
const getCenterPoint = (points) => [
|
|
2599
|
+
getArraySumAndAverage(mapByIndex(points, 0)),
|
|
2600
|
+
getArraySumAndAverage(mapByIndex(points, 1)),
|
|
2601
|
+
];
|
|
2602
|
+
const mapByIndex = (arr, index) => arr.map((a) => a[index]);
|
|
2603
|
+
const getArraySumAndAverage = (arr) => arr.reduce((a, b) => a + b) / arr.length;
|
|
2604
|
+
const normalizePoints = (points) => (points ? points.map((_) => _.coords) : null);
|
|
2605
|
+
|
|
2606
|
+
// Добавлено для проверки
|
|
2607
|
+
const nearbyOffices = [
|
|
2608
|
+
{ title: 'Деловой центр', time: '1 мин', distance: '~30 м.', icon: 'MetroIcon' },
|
|
2609
|
+
{ title: 'Выставочная', time: '5 мин', distance: '~120 м.', icon: 'MetroIcon' },
|
|
2610
|
+
{ title: 'Деловой центр', time: '8 мин', distance: '~350 м.', icon: 'MetroIcon' },
|
|
2611
|
+
];
|
|
2446
2612
|
|
|
2447
2613
|
const OfficeMap = JSX(({ className = '' }) => {
|
|
2448
2614
|
const resultOfficeMap = useOfficeMap('063') || OFFICE_MAP;
|
|
2449
2615
|
const { name, address, gpsLatitude, gpsLongitude, workSchedule } = resultOfficeMap;
|
|
2450
|
-
const {
|
|
2616
|
+
const { workingMonday, workingTuesday, workingWednesday, workingThursday, workingFriday, workingSaturday, workingSunday, } = workSchedule;
|
|
2617
|
+
const { workTime, lunchHour, workTimeSaturday, lunchHourSaturday } = workSchedule;
|
|
2451
2618
|
const point = gpsLatitude && gpsLongitude ? [gpsLatitude, gpsLongitude] : null;
|
|
2452
2619
|
const workScheduleWeek = [
|
|
2453
2620
|
{ title: 'Понедельник', status: workingMonday, workTime, lunchHour },
|
|
@@ -2469,15 +2636,9 @@
|
|
|
2469
2636
|
},
|
|
2470
2637
|
{ title: 'Воскресенье', status: workingSunday },
|
|
2471
2638
|
];
|
|
2472
|
-
// Добавлено для проверки
|
|
2473
|
-
const nearbyOffices = [
|
|
2474
|
-
{ title: 'Деловой центр', time: '1 мин', distance: '~30 м.', icon: 'MetroIcon' },
|
|
2475
|
-
{ title: 'Выставочная', time: '5 мин', distance: '~120 м.', icon: 'MetroIcon' },
|
|
2476
|
-
{ title: 'Деловой центр', time: '8 мин', distance: '~350 м.', icon: 'MetroIcon' },
|
|
2477
|
-
];
|
|
2478
2639
|
const currentWeekDayInd = new Date().getDay();
|
|
2479
2640
|
const currentWeekDay = currentWeekDayInd > 0 ? workScheduleWeek[currentWeekDayInd - 1] : workScheduleWeek[6];
|
|
2480
|
-
return (jsxs("div", { className: `flex flex-col font-sans bg-white w-full ${className}`, children: [jsxs("div", { className: "flex flex-col px-12 pt-12", children: [jsxs("div", { className: "flex justify-between", children: [jsx("div", { className: "text-h2", children: name }), renderCurrentDaySchedule(currentWeekDay)] }), jsxs("div", { className: "flex text-l-light pt-4", children: [jsx(Icon, { name: "GeolocationIcon", width: "24", height: "24", asSVG: true, className: "pr-1" }), address] }), jsx("div", { className: "flex pt-4", children: nearbyOffices.map(renderNearbyOffice) })] }), jsxs("div", { className: "flex justify-between pt-8", children: [jsx("div", { className: "flex-grow h-full
|
|
2641
|
+
return (jsxs("div", { className: `flex flex-col font-sans bg-white w-full ${className}`, children: [jsxs("div", { className: "flex flex-col px-12 pt-12", children: [jsxs("div", { className: "flex justify-between", children: [jsx("div", { className: "text-h2", children: name }), renderCurrentDaySchedule(currentWeekDay)] }), jsxs("div", { className: "flex text-l-light pt-4", children: [jsx(Icon, { name: "GeolocationIcon", width: "24", height: "24", asSVG: true, className: "pr-1" }), address] }), jsx("div", { className: "flex pt-4", children: nearbyOffices.map(renderNearbyOffice) })] }), jsxs("div", { className: "flex justify-between pt-8", children: [jsx("div", { className: "flex-grow h-full w-full overflow-hidden", children: point ? jsx(YandexMap, { points: [point], className: "h-full" }) : null }), jsx("div", { className: "w-[434px] min-w-[434px] pl-9 pr-12 pb-14 flex flex-col", children: workScheduleWeek.map(renderDay) })] })] }));
|
|
2481
2642
|
});
|
|
2482
2643
|
|
|
2483
2644
|
const OfficeServicesBlock = JSX(({ className = '', context, title, servicesList, anchor = '', ...rest }) => {
|
|
@@ -2552,7 +2713,7 @@
|
|
|
2552
2713
|
const getIconVersion = (isIconWhite, icon) => icon?.iconVersion || isIconWhite ? 'white' : 'normal';
|
|
2553
2714
|
|
|
2554
2715
|
const PictureText = JSX(({ className = '', context, title, description, image, benefits, version = 'primary', sum, monthLimit, directionRight = false, ...rest }) => {
|
|
2555
|
-
return (jsxs(BlockWrapper, { className: `relative font-sans py-12 px-24 ${VersionStyleMap[version]} ${className}`, context: context, ...rest, children: [jsx(Headline, { context: context, className: "!p-0", title: title, description: description, headlineVersion: "M", bgColorHeadline: version, align: "center" }), jsxs("div", { className: 'flex justify-center gap-[122px] mt-[30px]', children: [image?.src ? jsx(ImgInner, { className: directionRight ? 'order-2' : '', image: image }) : null, jsxs("div", { className: "w-[558px] m-auto", children: [benefits?.length ? (jsx("div", { className: "flex flex-col gap-4", children: benefits.map(renderBenefit$2(version)) })) : null, renderInsuranceSumMonth(sum, monthLimit)] })] })] }));
|
|
2716
|
+
return (jsxs(BlockWrapper, { className: `relative font-sans py-12 px-24 ${VersionStyleMap[version]} ${className}`, context: context, ...rest, children: [jsx(Headline, { context: context, className: "!p-0", title: title, description: description, headlineVersion: "M", bgColorHeadline: version, align: "center" }), jsxs("div", { className: 'flex justify-center gap-[122px] mt-[30px]', children: [image?.src ? jsx(ImgInner, { className: directionRight ? 'order-2' : '', image: image }) : null, jsxs("div", { className: "w-[558px] m-auto", children: [benefits?.length ? (jsx("div", { className: "flex flex-col gap-4", children: benefits.map(renderBenefit$2(version)) })) : null, renderInsuranceSumMonth(Number(sum), Number(monthLimit))] })] })] }));
|
|
2556
2717
|
});
|
|
2557
2718
|
const renderBenefit$2 = (version) => (benefit, i) => (jsx(BenefitItem, { icon: benefit.icon, label: benefit.label, description: benefit.description, version: version }, String(i)));
|
|
2558
2719
|
function renderInsuranceSumMonth(sum, monthLimit) {
|
|
@@ -2884,29 +3045,6 @@
|
|
|
2884
3045
|
return data || [];
|
|
2885
3046
|
}
|
|
2886
3047
|
|
|
2887
|
-
const YandexMap = JSX(({ points }) => {
|
|
2888
|
-
const map = useRef(null);
|
|
2889
|
-
const yandexMaps = useYandexMaps();
|
|
2890
|
-
useEffect(() => {
|
|
2891
|
-
yandexMaps?.ready(() => {
|
|
2892
|
-
map.current = new yandexMaps.Map('map', {
|
|
2893
|
-
center: points[0],
|
|
2894
|
-
zoom: 10,
|
|
2895
|
-
});
|
|
2896
|
-
renderClusterer(yandexMaps, map.current, points);
|
|
2897
|
-
});
|
|
2898
|
-
}, [yandexMaps]);
|
|
2899
|
-
useEffect(() => {
|
|
2900
|
-
if (map.current && points && yandexMaps) {
|
|
2901
|
-
renderClusterer(yandexMaps, map.current, points);
|
|
2902
|
-
}
|
|
2903
|
-
}, [map, points, yandexMaps]);
|
|
2904
|
-
if (!yandexMaps) {
|
|
2905
|
-
return null;
|
|
2906
|
-
}
|
|
2907
|
-
return (jsxs("div", { className: "pt-12 mt-1 bg-white", children: [jsx(Heading, { title: "\u041E\u0444\u0438\u0441\u044B \u043D\u0430 \u043A\u0430\u0440\u0442\u0435", headingType: "h3", className: "mb-8 text-center" }), jsx("div", { id: "map", className: "h-[640px]" })] }));
|
|
2908
|
-
});
|
|
2909
|
-
|
|
2910
3048
|
const DEFAULT_DAYS = 26;
|
|
2911
3049
|
const SafeDepositRental = JSX(({ title, footnote, context, className = '', ...rest }) => {
|
|
2912
3050
|
const [showMap, setShowMap] = useState(false);
|
|
@@ -2925,7 +3063,7 @@
|
|
|
2925
3063
|
setShowMap(!showMap);
|
|
2926
3064
|
};
|
|
2927
3065
|
const points = getCoordinates(getBranch(branches, safeDepositState.selectedBranch) || branches);
|
|
2928
|
-
return (jsxs(BlockWrapper, { context: context, className: className, ...rest, children: [jsxs("div", { className: "font-sans bg-white px-8 py-12", children: [title ? (jsx(Heading, { title: title, headingType: "h3", as: "h2", className: "mb-2.5 text-center" })) : null, jsx(SafeDepositRentalForm, { regions: regions, branches: branches, data: { ...safeDepositState, selectedRegion }, onShowMapToggle: onShowMapToggle, onChange: handleChangeSafeDepositState }), footnote ? jsx("p", { className: "text-s-light text-secondary-text", children: footnote }) : null] }), points.length && showMap ? jsx(YandexMap, { points: points }) : null] }));
|
|
3066
|
+
return (jsxs(BlockWrapper, { context: context, className: className, ...rest, children: [jsxs("div", { className: "font-sans bg-white px-8 py-12", children: [title ? (jsx(Heading, { title: title, headingType: "h3", as: "h2", className: "mb-2.5 text-center" })) : null, jsx(SafeDepositRentalForm, { regions: regions, branches: branches, data: { ...safeDepositState, selectedRegion }, onShowMapToggle: onShowMapToggle, onChange: handleChangeSafeDepositState }), footnote ? jsx("p", { className: "text-s-light text-secondary-text", children: footnote }) : null] }), points.length && showMap ? jsx(YandexMap, { points: points, className: "h-[640px]" }) : null] }));
|
|
2929
3067
|
});
|
|
2930
3068
|
const normalizeSelectedRegion = (selectedRegion, regions) => !selectedRegion && regions?.length && regions[0]?.code ? regions[0].code : selectedRegion;
|
|
2931
3069
|
|
|
@@ -3102,7 +3240,10 @@
|
|
|
3102
3240
|
return (jsxs(Button, { version: "primary", onClick: handleClick, className: "w-full flex items-center justify-center rounded-none py-5", children: [jsx("div", { className: "text-h4", children: isOpen ? 'Скрыть' : 'Показать ставки по вкладу' }), jsx(Icon, { name: isOpen ? 'ArrowUpIcon' : 'ArrowDownIcon', className: "ml-3", iconVersion: "white", width: "20", height: "20", asSVG: true })] }));
|
|
3103
3241
|
});
|
|
3104
3242
|
|
|
3105
|
-
const renderButtonsCellData = ({ buttons }) => buttons && buttons?.length ? (jsx("div", { children: buttons.map(({ rounded, ...buttonProps }, idx) => (
|
|
3243
|
+
const renderButtonsCellData = ({ buttons }) => buttons && buttons?.length ? (jsx("div", { children: buttons.map(({ rounded, ...buttonProps }, idx) => renderButton({
|
|
3244
|
+
button: { rounded, ...buttonProps },
|
|
3245
|
+
buttonClassName: `${idx > 0 && rounded ? 'ml-3' : ''} w-12 h-12`,
|
|
3246
|
+
})) })) : null;
|
|
3106
3247
|
const renderLabelDescriptionCellData = ({ label, description }) => {
|
|
3107
3248
|
const labelClassName = `text-h6 m-0 ${description ? 'mb-1' : ''}`;
|
|
3108
3249
|
return (jsxs("div", { children: [label ? jsx("div", { className: labelClassName, children: label }) : null, description ? jsx("div", { className: "text-secondary-text text-l-light", children: description }) : null] }));
|
|
@@ -3425,7 +3566,7 @@
|
|
|
3425
3566
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto", context: context }, "LikeControl") }));
|
|
3426
3567
|
}
|
|
3427
3568
|
|
|
3428
|
-
const packageVersion = "0.6.
|
|
3569
|
+
const packageVersion = "0.6.18";
|
|
3429
3570
|
|
|
3430
3571
|
exports.Blocks = Blocks;
|
|
3431
3572
|
exports.ContentPage = ContentPage;
|