@redneckz/wildless-cms-uni-blocks 0.6.15 → 0.6.17
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 +90 -0
- package/bin/utils.js +2 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +318 -169
- 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/ContentPage/renderContentPageHead.js +7 -7
- package/dist/components/ContentPage/renderContentPageHead.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/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/Foldable/DefaultFoldButton.js +13 -4
- package/dist/ui-kit/Foldable/DefaultFoldButton.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/ContentPage/renderContentPageHead.js +7 -7
- package/lib/components/ContentPage/renderContentPageHead.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/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/Foldable/DefaultFoldButton.js +13 -4
- package/lib/ui-kit/Foldable/DefaultFoldButton.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 +32 -19
- 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/ContentPage/renderContentPageHead.js +7 -7
- package/mobile/dist/components/ContentPage/renderContentPageHead.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/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/Foldable/DefaultFoldButton.js +13 -4
- package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.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/ContentPage/renderContentPageHead.js +7 -7
- package/mobile/lib/components/ContentPage/renderContentPageHead.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/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/Foldable/DefaultFoldButton.js +13 -4
- package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.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/ContentPage/renderContentPageHead.tsx +11 -7
- 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/Button/ButtonProps.ts +5 -1
- package/mobile/src/ui-kit/Button/ButtonSection.tsx +41 -16
- package/mobile/src/ui-kit/Foldable/DefaultFoldButton.tsx +32 -23
- 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/ContentPage/renderContentPageHead.tsx +11 -7
- 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/Button/ButtonProps.ts +5 -1
- package/src/ui-kit/Button/ButtonSection.tsx +41 -16
- package/src/ui-kit/Foldable/DefaultFoldButton.tsx +32 -23
- 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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
2
|
+
import { Icon } from '../Icon/Icon';
|
|
3
|
+
import ymaps from 'yandex-maps';
|
|
4
|
+
|
|
5
|
+
const styles = {
|
|
6
|
+
focus: 'focus:border-primary-focus focus:border',
|
|
7
|
+
hover: 'hover:bg-primary-hover',
|
|
8
|
+
active: 'active:bg-primary-active',
|
|
9
|
+
border: 'border border-transparent rounded-md',
|
|
10
|
+
position: 'absolute flex items-center justify-center',
|
|
11
|
+
font: 'text-center font-sans',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const renderUserGeolocation = (
|
|
15
|
+
map: ymaps.Map,
|
|
16
|
+
yandexMaps: typeof ymaps,
|
|
17
|
+
className: string,
|
|
18
|
+
) => {
|
|
19
|
+
const setUserGeoLocation = () => {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
yandexMaps.geolocation
|
|
23
|
+
.get({
|
|
24
|
+
provider: 'yandex',
|
|
25
|
+
autoReverseGeocode: true,
|
|
26
|
+
mapStateAutoApply: true,
|
|
27
|
+
})
|
|
28
|
+
.then(function (result) {
|
|
29
|
+
map.geoObjects.add(result.geoObjects);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
className={`select-none cursor-pointer py-4 w-12 bg-white ${Object.values(styles).join(
|
|
36
|
+
' ',
|
|
37
|
+
)} ${className}`}
|
|
38
|
+
onClick={setUserGeoLocation}
|
|
39
|
+
>
|
|
40
|
+
<Icon name="UserGeoLocationIcon" width="20" height="16" />
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import ymaps from 'yandex-maps';
|
|
2
|
+
import { useExternalNS } from '../../hooks/useExternalNS';
|
|
3
|
+
import { projectSettings } from '../../ProjectSettings';
|
|
4
|
+
|
|
5
|
+
const YMAPS_NAMESPACE = 'ymaps';
|
|
6
|
+
|
|
7
|
+
export const useYandexMaps = () => {
|
|
8
|
+
const url = `https://api-maps.yandex.ru/2.1/?apikey=${projectSettings.YANDEX_MAP_API_KEY}&lang=ru_RU`;
|
|
9
|
+
|
|
10
|
+
return useExternalNS<typeof ymaps>(YMAPS_NAMESPACE, url);
|
|
11
|
+
};
|
package/package.json
CHANGED
package/src/common.css
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type { IconVersion } from '../../model/IconVersion';
|
|
2
1
|
import type { Picture } from '../../model/Picture';
|
|
3
2
|
import type { ProductColorVersion } from '../../model/ProductColorVersion';
|
|
4
3
|
import { context } from '../../react/setup-fixture';
|
|
5
4
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
6
|
-
import { Img } from '../../ui-kit/Img/Img';
|
|
7
5
|
import { Catalog, CatalogProps } from './Catalog';
|
|
8
6
|
|
|
9
7
|
const payRing: Picture = {
|
|
@@ -23,14 +21,9 @@ const buttonPrimary: ButtonWithIconProps = {
|
|
|
23
21
|
text: 'Подробнее',
|
|
24
22
|
target: '_blank',
|
|
25
23
|
version: 'primary',
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
width="24"
|
|
30
|
-
height="24"
|
|
31
|
-
asSVG
|
|
32
|
-
/>
|
|
33
|
-
),
|
|
24
|
+
icon: {
|
|
25
|
+
icon: 'AppleIcon',
|
|
26
|
+
},
|
|
34
27
|
};
|
|
35
28
|
|
|
36
29
|
const catalogCard = {
|
|
@@ -2,7 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
3
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
4
|
import type { ProductColorVersion } from '../../model/ProductColorVersion';
|
|
5
|
-
import {
|
|
5
|
+
import { renderButton } from '../../ui-kit/Button/ButtonSection';
|
|
6
6
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
7
7
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
8
|
import type { CatalogCardType } from './CatalogContent';
|
|
@@ -35,7 +35,7 @@ export const CatalogCard = JSX<CatalogCardProps>(
|
|
|
35
35
|
</div>
|
|
36
36
|
) : null}
|
|
37
37
|
{price ? <div className="text-h3 text-left">{price} ₽</div> : null}
|
|
38
|
-
{button ?
|
|
38
|
+
{button ? renderButton({ button, buttonClassName: 'mt-5 w-full' }) : null}
|
|
39
39
|
</section>
|
|
40
40
|
);
|
|
41
41
|
},
|
|
@@ -5,15 +5,19 @@ export function renderContentPageHead(data: ContentPageMeta) {
|
|
|
5
5
|
const { description, keywords, canonical, robots } = main || {};
|
|
6
6
|
|
|
7
7
|
return [
|
|
8
|
-
<title>{title}</title>,
|
|
9
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />,
|
|
10
|
-
description ? <meta name="description" content={description} /> : null,
|
|
11
|
-
keywords ? <meta name="keywords" content={keywords.join(',')} /> : null,
|
|
12
|
-
robots ? <meta name="robots" content={robots.join(',')} /> : null,
|
|
8
|
+
<title key="title">{title}</title>,
|
|
9
|
+
<meta key="viewport" name="viewport" content="width=device-width, initial-scale=1" />,
|
|
10
|
+
description ? <meta key="description" name="description" content={description} /> : null,
|
|
11
|
+
keywords ? <meta key="keywords" name="keywords" content={keywords.join(',')} /> : null,
|
|
12
|
+
robots ? <meta key="robots" name="robots" content={robots.join(',')} /> : null,
|
|
13
13
|
renderOpenGraph(og),
|
|
14
14
|
renderTwitter(twitter),
|
|
15
|
-
canonical ? <link rel="canonical" href={canonical} /> : null,
|
|
16
|
-
jsonLd ?
|
|
15
|
+
canonical ? <link key="canonical" rel="canonical" href={canonical} /> : null,
|
|
16
|
+
jsonLd ? (
|
|
17
|
+
<script key="jsonLd" type="application/ld+json">
|
|
18
|
+
{jsonLd}
|
|
19
|
+
</script>
|
|
20
|
+
) : null,
|
|
17
21
|
].filter(Boolean);
|
|
18
22
|
}
|
|
19
23
|
|
|
@@ -31,18 +31,20 @@ export const CurrencyTable = JSX<CurrencyTableProps>(({ className, exchangeCurre
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
const renderCurrencyRow = (exchangeCurrencyItem: ExchangeCurrencyItem) => {
|
|
34
|
-
const
|
|
34
|
+
const currency = exchangeCurrencyItem?.currency?.currency;
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
|
-
<tr key={
|
|
37
|
+
<tr key={currency} className="pb-1 text-h6">
|
|
38
38
|
<td className="pt-4">
|
|
39
39
|
<div className="flex items-center">
|
|
40
|
-
{
|
|
41
|
-
|
|
40
|
+
{currency ? (
|
|
41
|
+
<Img image={{ icon: CURRENCY_ICONS_MAP[currency] }} width="24" height="24" />
|
|
42
|
+
) : null}
|
|
43
|
+
<span className="ml-2">{currency}</span>
|
|
42
44
|
</div>
|
|
43
45
|
</td>
|
|
44
|
-
<td className="pt-4 pl-11">{formatCurrency(exchangeCurrencyItem?.
|
|
45
|
-
<td className="pt-4 pl-11">{formatCurrency(exchangeCurrencyItem?.
|
|
46
|
+
<td className="pt-4 pl-11">{formatCurrency(exchangeCurrencyItem?.saleExchangeRate)}</td>
|
|
47
|
+
<td className="pt-4 pl-11">{formatCurrency(exchangeCurrencyItem?.buyExchangeRate)}</td>
|
|
46
48
|
</tr>
|
|
47
49
|
);
|
|
48
50
|
};
|
|
@@ -4,21 +4,14 @@ import { Img } from '../../ui-kit/Img/Img';
|
|
|
4
4
|
interface CurrentLocationProps {
|
|
5
5
|
className?: string;
|
|
6
6
|
address?: string;
|
|
7
|
-
distance?: string;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
|
-
export const CurrentLocation = JSX<CurrentLocationProps>(
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
{distance ? (
|
|
17
|
-
<p className="text-secondary-text m-0 text-m-light">
|
|
18
|
-
Курс указан для ближайшего офиса - {distance}
|
|
19
|
-
</p>
|
|
20
|
-
) : null}
|
|
21
|
-
</div>
|
|
9
|
+
export const CurrentLocation = JSX<CurrentLocationProps>(({ className = '', address }) => (
|
|
10
|
+
<div className={`flex ${className}`}>
|
|
11
|
+
<Img image={{ icon: 'GpsIcon' }} width="24" height="24" asSVG />
|
|
12
|
+
<div className="ml-3">
|
|
13
|
+
{address ? <p className="text-primary-main m-0 mb-1 text-l">{address}</p> : null}
|
|
14
|
+
<p className="text-secondary-text m-0 text-m">Курс указан для ближайшего офиса</p>
|
|
22
15
|
</div>
|
|
23
|
-
|
|
24
|
-
);
|
|
16
|
+
</div>
|
|
17
|
+
));
|
|
@@ -10,9 +10,13 @@ import { Currency } from './CurrencyProps';
|
|
|
10
10
|
import { renderInput } from './renderInput';
|
|
11
11
|
|
|
12
12
|
export interface ExchangeCurrencyItem {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
currency?: {
|
|
14
|
+
id?: number;
|
|
15
|
+
code?: string;
|
|
16
|
+
currency?: Currency;
|
|
17
|
+
};
|
|
18
|
+
buyExchangeRate?: number;
|
|
19
|
+
saleExchangeRate?: number;
|
|
16
20
|
}
|
|
17
21
|
export interface ExchangeCurrencyCalculatorProps extends UniBlockProps {
|
|
18
22
|
className?: string;
|
|
@@ -35,8 +39,8 @@ export const ExchangeCurrencyCalculator = JSX<ExchangeCurrencyCalculatorProps>(
|
|
|
35
39
|
const [calcState, setCalcState] = useState<CalcState>({
|
|
36
40
|
inputSell: '',
|
|
37
41
|
inputBuy: '',
|
|
38
|
-
selectSell: currencyRatesBuy?.[0]?.
|
|
39
|
-
selectBuy: currencyRatesSell?.[0]?.
|
|
42
|
+
selectSell: currencyRatesBuy?.[0]?.currency?.currency || Currency.RUB,
|
|
43
|
+
selectBuy: currencyRatesSell?.[0]?.currency?.currency || Currency.USD,
|
|
40
44
|
});
|
|
41
45
|
|
|
42
46
|
const handleSetCalcState = (newState: Partial<CalcState>) => {
|
|
@@ -96,8 +100,12 @@ const handleSelectSell =
|
|
|
96
100
|
callbackCurrencySelect({
|
|
97
101
|
value,
|
|
98
102
|
oppositeValue: calcState.selectBuy,
|
|
99
|
-
handleConvert: (
|
|
100
|
-
handleInputSell(setCalcState, currencyRatesSell)(
|
|
103
|
+
handleConvert: (currencyFrom = calcState.selectSell, currencyTo = calcState.selectBuy) => {
|
|
104
|
+
handleInputSell(setCalcState, currencyRatesSell)(
|
|
105
|
+
calcState.inputSell,
|
|
106
|
+
currencyFrom,
|
|
107
|
+
currencyTo,
|
|
108
|
+
);
|
|
101
109
|
},
|
|
102
110
|
});
|
|
103
111
|
};
|
|
@@ -113,35 +121,39 @@ const handleSelectBuy =
|
|
|
113
121
|
callbackCurrencySelect({
|
|
114
122
|
value,
|
|
115
123
|
oppositeValue: calcState.selectSell,
|
|
116
|
-
handleConvert: (
|
|
117
|
-
handleInputBuy(setCalcState, currencyRatesBuy)(
|
|
124
|
+
handleConvert: (currencyTo = calcState.selectBuy, currencyFrom = calcState.selectSell) =>
|
|
125
|
+
handleInputBuy(setCalcState, currencyRatesBuy)(
|
|
126
|
+
calcState.inputBuy,
|
|
127
|
+
currencyTo,
|
|
128
|
+
currencyFrom,
|
|
129
|
+
),
|
|
118
130
|
});
|
|
119
131
|
};
|
|
120
132
|
|
|
121
133
|
const handleInputSell =
|
|
122
134
|
(setCalcState: (state: Partial<CalcState>) => void, currencyRatesSell: ExchangeCurrencyItem[]) =>
|
|
123
|
-
(value: string,
|
|
124
|
-
setCalcState({ inputSell: formatValue(value), selectBuy:
|
|
135
|
+
(value: string, currencyFrom: Currency, currencyTo: Currency) => {
|
|
136
|
+
setCalcState({ inputSell: formatValue(value), selectBuy: currencyTo });
|
|
125
137
|
const rate =
|
|
126
|
-
currencyRatesSell.find((_) => _.
|
|
127
|
-
currencyRatesSell.find((_) => _.
|
|
138
|
+
currencyRatesSell.find((_) => _.currency?.currency === currencyTo)?.buyExchangeRate ||
|
|
139
|
+
currencyRatesSell.find((_) => _.currency?.currency === currencyFrom)?.saleExchangeRate;
|
|
128
140
|
if (rate) {
|
|
129
141
|
setCalcState({
|
|
130
|
-
inputBuy: String(calculateResult(value, rate,
|
|
142
|
+
inputBuy: String(calculateResult(value, rate, currencyFrom === Currency.RUB) || ''),
|
|
131
143
|
});
|
|
132
144
|
}
|
|
133
145
|
};
|
|
134
146
|
|
|
135
147
|
const handleInputBuy =
|
|
136
148
|
(setCalcState: (state: Partial<CalcState>) => void, currencyRatesBuy: ExchangeCurrencyItem[]) =>
|
|
137
|
-
(value: string,
|
|
138
|
-
setCalcState({ inputBuy: formatValue(value), selectSell:
|
|
149
|
+
(value: string, currencyTo: Currency, currencyFrom: Currency) => {
|
|
150
|
+
setCalcState({ inputBuy: formatValue(value), selectSell: currencyFrom });
|
|
139
151
|
const rate =
|
|
140
|
-
currencyRatesBuy.find((_) => _.
|
|
141
|
-
currencyRatesBuy.find((_) => _.
|
|
152
|
+
currencyRatesBuy.find((_) => _.currency?.currency === currencyFrom)?.saleExchangeRate ||
|
|
153
|
+
currencyRatesBuy.find((_) => _.currency?.currency === currencyTo)?.buyExchangeRate;
|
|
142
154
|
if (rate) {
|
|
143
155
|
setCalcState({
|
|
144
|
-
inputSell: String(calculateResult(value, rate,
|
|
156
|
+
inputSell: String(calculateResult(value, rate, currencyTo === Currency.RUB) || ''),
|
|
145
157
|
});
|
|
146
158
|
}
|
|
147
159
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useExchangeRates } from '../../hooks/useExchangeRates';
|
|
3
2
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
3
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
4
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
@@ -7,25 +6,23 @@ import { BaseTile } from '../BaseTile/BaseTile';
|
|
|
7
6
|
import { Currency } from './CurrencyProps';
|
|
8
7
|
import { CurrencyTable } from './CurrencyTable';
|
|
9
8
|
import { CurrentLocation } from './CurrentLocation';
|
|
10
|
-
import { ExchangeCurrencyCalculator } from './ExchangeCurrencyCalculator';
|
|
9
|
+
import { ExchangeCurrencyCalculator, ExchangeCurrencyItem } from './ExchangeCurrencyCalculator';
|
|
11
10
|
import type { ExchangeRateTileContent } from './ExchangeRateTileContent';
|
|
12
|
-
|
|
13
|
-
const DEFAULT_LOCATION = {
|
|
14
|
-
address: 'Москва, ул.Ленина д.28',
|
|
15
|
-
distance: '6км',
|
|
16
|
-
};
|
|
11
|
+
import { useFetchExchangeRateData } from './useFetchExchangeRateData';
|
|
17
12
|
|
|
18
13
|
export interface ExchangeRateTileProps extends ExchangeRateTileContent, UniBlockProps {}
|
|
19
14
|
|
|
20
15
|
export const ExchangeRateTile = JSX<ExchangeRateTileProps>(
|
|
21
16
|
({ className = '', context, title = 'Курсы обмена валют', button, ...rest }) => {
|
|
22
|
-
const
|
|
17
|
+
const { exchangeRates } = useFetchExchangeRateData();
|
|
18
|
+
|
|
19
|
+
const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
|
|
23
20
|
|
|
24
|
-
const currencyRatesBuy = currencyRates.filter((_) => _.
|
|
25
|
-
currencyRatesBuy.unshift({
|
|
21
|
+
const currencyRatesBuy = currencyRates.filter((_) => _.buyExchangeRate);
|
|
22
|
+
currencyRatesBuy.unshift({ currency: { currency: Currency.RUB } });
|
|
26
23
|
|
|
27
|
-
const currencyRatesSell = currencyRates.filter((_) => _.
|
|
28
|
-
currencyRatesSell.push({
|
|
24
|
+
const currencyRatesSell = currencyRates.filter((_) => _.saleExchangeRate);
|
|
25
|
+
currencyRatesSell.push({ currency: { currency: Currency.RUB } });
|
|
29
26
|
|
|
30
27
|
return (
|
|
31
28
|
<BlockWrapper
|
|
@@ -44,7 +41,7 @@ export const ExchangeRateTile = JSX<ExchangeRateTileProps>(
|
|
|
44
41
|
{currencyRates ? (
|
|
45
42
|
<CurrencyTable className="mb-[30px]" exchangeCurrencyItems={currencyRates} />
|
|
46
43
|
) : null}
|
|
47
|
-
<CurrentLocation {
|
|
44
|
+
<CurrentLocation address={exchangeRates?.address} />
|
|
48
45
|
</div>
|
|
49
46
|
{currencyRates.length && currencyRatesBuy.length && currencyRatesSell.length ? (
|
|
50
47
|
<ExchangeCurrencyCalculator
|
|
@@ -61,3 +58,7 @@ export const ExchangeRateTile = JSX<ExchangeRateTileProps>(
|
|
|
61
58
|
);
|
|
62
59
|
},
|
|
63
60
|
);
|
|
61
|
+
|
|
62
|
+
const getCurrencyRates = (currencies?: ExchangeCurrencyItem[]) => {
|
|
63
|
+
return currencies?.filter((_) => _?.currency?.id === 1 || _?.currency?.id === 2) || [];
|
|
64
|
+
};
|
|
@@ -4,7 +4,7 @@ import { Currency } from './CurrencyProps';
|
|
|
4
4
|
interface TableFuncProps {
|
|
5
5
|
value: Currency;
|
|
6
6
|
oppositeValue: Currency;
|
|
7
|
-
handleConvert: (
|
|
7
|
+
handleConvert: (currencyFrom?: Currency, currencyTo?: Currency) => void;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export const callbackCurrencySelect = (props: TableFuncProps) =>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Input } from '../../ui-kit/Input/Input';
|
|
2
|
-
import { Select } from '../../ui-kit/Select/Select';
|
|
3
2
|
import type { OptionProps } from '../../ui-kit/Select/Select';
|
|
3
|
+
import { Select } from '../../ui-kit/Select/Select';
|
|
4
4
|
import type { Currency } from './CurrencyProps';
|
|
5
5
|
import type { ExchangeCurrencyItem } from './ExchangeCurrencyCalculator';
|
|
6
6
|
|
|
@@ -15,7 +15,10 @@ interface InputProps {
|
|
|
15
15
|
|
|
16
16
|
export function renderInput(props: InputProps) {
|
|
17
17
|
const { placeholder, rates, selected, value, setValue, setSelected } = props;
|
|
18
|
-
const ratesOptions: OptionProps[] = rates.map((_) => ({
|
|
18
|
+
const ratesOptions: OptionProps[] = rates.map((_) => ({
|
|
19
|
+
key: _?.currency?.currency ?? '',
|
|
20
|
+
text: _?.currency?.currency ?? '',
|
|
21
|
+
}));
|
|
19
22
|
const selectedValue: OptionProps = { key: selected, text: selected };
|
|
20
23
|
|
|
21
24
|
return (
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
2
|
+
import { ExchangeCurrencyItem } from '../../components/ExchangeRateTile/ExchangeCurrencyCalculator';
|
|
3
|
+
import { fetchJSONUnsafe } from '../../utils/fetchJSON';
|
|
4
|
+
|
|
5
|
+
export interface ExchangeData {
|
|
6
|
+
exchangeRate?: {
|
|
7
|
+
currencies?: ExchangeCurrencyItem[];
|
|
8
|
+
};
|
|
9
|
+
address?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface RegionData {
|
|
13
|
+
id?: number;
|
|
14
|
+
code?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const EXCHANGE_RATES_URL = '/api/v1/exchangerates';
|
|
19
|
+
const REGION_URL = '/api/v1/region';
|
|
20
|
+
|
|
21
|
+
export function useFetchExchangeRateData() {
|
|
22
|
+
const { data } = useAsyncData<{
|
|
23
|
+
region?: RegionData;
|
|
24
|
+
exchangeRates?: ExchangeData;
|
|
25
|
+
}>(EXCHANGE_RATES_URL, fetchData);
|
|
26
|
+
|
|
27
|
+
return data || {};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function useCurrentPosition() {
|
|
31
|
+
const { data } = useAsyncData<RegionData>(REGION_URL, fetchJSONUnsafe);
|
|
32
|
+
|
|
33
|
+
return data || {};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const fetchData = async (
|
|
37
|
+
urlExchangeRates: string,
|
|
38
|
+
): Promise<{
|
|
39
|
+
region: RegionData;
|
|
40
|
+
exchangeRates: ExchangeData;
|
|
41
|
+
}> => {
|
|
42
|
+
const region = await fetchRegion();
|
|
43
|
+
|
|
44
|
+
const regionCode = region?.code || '000';
|
|
45
|
+
|
|
46
|
+
const exchangeRates = await fetchExchangeRates(urlExchangeRates, regionCode);
|
|
47
|
+
|
|
48
|
+
return { region, exchangeRates };
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const fetchRegion = async (): Promise<RegionData> => {
|
|
52
|
+
try {
|
|
53
|
+
return await fetchJSONUnsafe<RegionData>(REGION_URL, { method: 'GET' });
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.log(error);
|
|
56
|
+
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const fetchExchangeRates = async (url: string, regionCode: string): Promise<ExchangeData> => {
|
|
62
|
+
try {
|
|
63
|
+
return await fetchJSONUnsafe<ExchangeData>(url + `?regionCode=${regionCode}`, {
|
|
64
|
+
method: 'GET',
|
|
65
|
+
});
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.log(error);
|
|
68
|
+
|
|
69
|
+
return {};
|
|
70
|
+
}
|
|
71
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Picture } from '../../model/Picture';
|
|
2
2
|
import { context } from '../../react/setup-fixture';
|
|
3
3
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
4
|
-
import { Img } from '../../ui-kit/Img/Img';
|
|
5
4
|
import { Gallery } from './Gallery';
|
|
6
5
|
import type { GalleryProps } from './GalleryProps';
|
|
7
6
|
const isDotted = true;
|
|
@@ -28,7 +27,7 @@ const buttonPrimaryIcon: ButtonWithIconProps = {
|
|
|
28
27
|
text: 'Подробнее',
|
|
29
28
|
target: '_blank',
|
|
30
29
|
version: 'secondary',
|
|
31
|
-
|
|
30
|
+
icon: { icon: 'BankIcon' },
|
|
32
31
|
};
|
|
33
32
|
|
|
34
33
|
const defaultItems = [
|
|
@@ -2,7 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { AlignText } from '../../model/AlignText';
|
|
3
3
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
4
4
|
import type { Picture } from '../../model/Picture';
|
|
5
|
-
import {
|
|
5
|
+
import { renderButton } from '../../ui-kit/Button/ButtonSection';
|
|
6
6
|
import { Img } from '../../ui-kit/Img/Img';
|
|
7
7
|
import { List } from '../../ui-kit/List/List';
|
|
8
8
|
import { HEADLINE_SMALL_VERSION } from '../Headline/constants';
|
|
@@ -30,7 +30,7 @@ export const GalleryCardInner = JSX<GalleryCardProps>(
|
|
|
30
30
|
{items?.length ? renderItems(items, isDotted, version) : null}
|
|
31
31
|
{renderAdditionalDescription(additionalDescription)}
|
|
32
32
|
</div>
|
|
33
|
-
{button?.text ?
|
|
33
|
+
{button?.text ? renderButton({ button, buttonClassName: 'mt-6' }) : null}
|
|
34
34
|
</div>
|
|
35
35
|
);
|
|
36
36
|
},
|
|
@@ -3,11 +3,11 @@ import { useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
3
3
|
import type { GalleryVersion } from '../../model/GalleryVersion';
|
|
4
4
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
5
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
|
+
import { renderButton } from '../../ui-kit/Button/ButtonSection';
|
|
6
7
|
import { renderArrows } from '../../ui-kit/Button/renderArrows';
|
|
7
8
|
import { galleryLengthForScrollMap } from './constants';
|
|
8
9
|
import { GalleryContainer } from './GalleryContainer';
|
|
9
10
|
import type { GalleryContent } from './GalleryContent';
|
|
10
|
-
import { Button } from '../../ui-kit/Button/Button';
|
|
11
11
|
|
|
12
12
|
export interface GalleryInnerProps extends GalleryContent, UniBlockProps {
|
|
13
13
|
version?: GalleryVersion;
|
|
@@ -54,7 +54,7 @@ export const GalleryInner = JSX<GalleryInnerProps>(
|
|
|
54
54
|
</div>
|
|
55
55
|
) : null}
|
|
56
56
|
|
|
57
|
-
{button ?
|
|
57
|
+
{button ? renderButton({ button, buttonClassName: 'mt-8 mx-auto' }) : null}
|
|
58
58
|
</BlockWrapper>
|
|
59
59
|
);
|
|
60
60
|
},
|
|
@@ -67,15 +67,15 @@ const renderDotsSubMenuItems = ({
|
|
|
67
67
|
}: DotsSubMenuItemsProps) => {
|
|
68
68
|
const isActive = (item: LinkProps) => item === activeSubItem;
|
|
69
69
|
|
|
70
|
-
return menuItems?.map((
|
|
70
|
+
return menuItems?.map(({ text, ...rest }) => (
|
|
71
71
|
<a
|
|
72
|
-
key={
|
|
73
|
-
{...useLink({ router, handlerDecorator },
|
|
72
|
+
key={rest.href}
|
|
73
|
+
{...useLink({ router, handlerDecorator }, rest)}
|
|
74
74
|
className={`text-l-light pb-4 hover:text-primary-main ${
|
|
75
|
-
isActive(
|
|
75
|
+
isActive(rest) ? 'text-primary-main' : ''
|
|
76
76
|
}`}
|
|
77
77
|
>
|
|
78
|
-
{
|
|
78
|
+
{text}
|
|
79
79
|
</a>
|
|
80
80
|
));
|
|
81
81
|
};
|