@redneckz/wildless-cms-uni-blocks 0.6.40 → 0.6.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +161 -47
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/bundle/components/Header/HeaderTop.d.ts +2 -0
- package/bundle/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/bundle/hooks/useCachedAsyncData.d.ts +2 -0
- package/bundle/hooks/useLocation.d.ts +6 -0
- package/bundle/hooks/useRegions.d.ts +6 -0
- package/bundle/model/LogoType.d.ts +5 -0
- package/bundle/services/sitemap/SitemapProps.d.ts +10 -4
- package/bundle/ui-kit/Location/Location.d.ts +19 -0
- package/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
- package/bundle/ui-kit/Logo/Logo.d.ts +2 -5
- package/bundle/ui-kit/Logo/Logo.mobile.d.ts +2 -0
- package/bundle/ui-kit/Logo/renderImage.d.ts +6 -0
- package/bundle/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/bundle/utils/groupBy.d.ts +1 -0
- package/dist/components/Blocks.js +6 -2
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/dist/components/ButtonBlock/ButtonBlock.js +11 -0
- package/dist/components/ButtonBlock/ButtonBlock.js.map +1 -0
- package/dist/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/dist/components/ButtonBlock/ButtonBlockContent.js +2 -0
- package/dist/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
- package/dist/components/Calculator/constants.js +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/dist/components/Header/Header.js +2 -2
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/Header.mobile.js +2 -2
- package/dist/components/Header/Header.mobile.js.map +1 -1
- package/dist/components/Header/HeaderBurger.js +4 -3
- package/dist/components/Header/HeaderBurger.js.map +1 -1
- package/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/dist/components/Header/HeaderSecondaryMenu.js +13 -4
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/Header/HeaderTop.d.ts +2 -0
- package/dist/components/Header/HeaderTop.js +1 -1
- package/dist/components/Header/HeaderTop.js.map +1 -1
- package/dist/components/ProductTile/ProductTile.js +8 -2
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/dist/hooks/useCachedAsyncData.d.ts +2 -0
- package/dist/hooks/useCachedAsyncData.js +25 -0
- package/dist/hooks/useCachedAsyncData.js.map +1 -0
- package/dist/hooks/useLocation.d.ts +6 -0
- package/dist/hooks/useLocation.js +26 -0
- package/dist/hooks/useLocation.js.map +1 -0
- package/dist/hooks/useRegions.d.ts +6 -0
- package/dist/hooks/useRegions.js +11 -0
- package/dist/hooks/useRegions.js.map +1 -0
- package/dist/model/LogoType.d.ts +5 -0
- package/dist/model/LogoType.js +2 -0
- package/dist/model/LogoType.js.map +1 -0
- package/dist/services/sitemap/SitemapProps.d.ts +10 -4
- package/dist/ui-kit/Location/Location.d.ts +19 -0
- package/dist/ui-kit/Location/Location.js +44 -0
- package/dist/ui-kit/Location/Location.js.map +1 -0
- package/dist/ui-kit/Location/SearchBar.d.ts +6 -0
- package/dist/ui-kit/Location/SearchBar.js +9 -0
- package/dist/ui-kit/Location/SearchBar.js.map +1 -0
- package/dist/ui-kit/Logo/Logo.d.ts +2 -5
- package/dist/ui-kit/Logo/Logo.js +3 -21
- package/dist/ui-kit/Logo/Logo.js.map +1 -1
- package/dist/ui-kit/Logo/Logo.mobile.d.ts +2 -0
- package/dist/ui-kit/Logo/Logo.mobile.js +4 -15
- package/dist/ui-kit/Logo/Logo.mobile.js.map +1 -1
- package/dist/ui-kit/Logo/renderImage.d.ts +6 -0
- package/dist/ui-kit/Logo/renderImage.js +20 -0
- package/dist/ui-kit/Logo/renderImage.js.map +1 -0
- package/dist/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/dist/ui-kit/Logo/renderTitle.js +12 -0
- package/dist/ui-kit/Logo/renderTitle.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/dist/utils/groupBy.d.ts +1 -0
- package/dist/utils/groupBy.js +13 -0
- package/dist/utils/groupBy.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +6 -2
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/lib/components/ButtonBlock/ButtonBlock.fixture.d.ts +6 -0
- package/lib/components/ButtonBlock/ButtonBlock.js +9 -0
- package/lib/components/ButtonBlock/ButtonBlock.js.map +1 -0
- package/lib/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/lib/components/ButtonBlock/ButtonBlockContent.js +2 -0
- package/lib/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
- package/lib/components/Calculator/constants.js +1 -1
- package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.d.ts +9 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/lib/components/Header/Header.js +2 -2
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/Header.mobile.js +2 -2
- package/lib/components/Header/Header.mobile.js.map +1 -1
- package/lib/components/Header/HeaderBurger.js +4 -3
- package/lib/components/Header/HeaderBurger.js.map +1 -1
- package/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/lib/components/Header/HeaderSecondaryMenu.js +13 -4
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/Header/HeaderTop.d.ts +2 -0
- package/lib/components/Header/HeaderTop.js +1 -1
- package/lib/components/Header/HeaderTop.js.map +1 -1
- package/lib/components/ProductTile/ProductTile.fixture.d.ts +1 -0
- package/lib/components/ProductTile/ProductTile.js +8 -2
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/lib/components/Recommendation/Recommendation.fixture.d.ts +1 -1
- package/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/lib/hooks/useCachedAsyncData.d.ts +2 -0
- package/lib/hooks/useCachedAsyncData.js +22 -0
- package/lib/hooks/useCachedAsyncData.js.map +1 -0
- package/lib/hooks/useLocation.d.ts +6 -0
- package/lib/hooks/useLocation.js +23 -0
- package/lib/hooks/useLocation.js.map +1 -0
- package/lib/hooks/useRegions.d.ts +6 -0
- package/lib/hooks/useRegions.js +8 -0
- package/lib/hooks/useRegions.js.map +1 -0
- package/lib/model/LogoType.d.ts +5 -0
- package/lib/model/LogoType.js +2 -0
- package/lib/model/LogoType.js.map +1 -0
- package/lib/services/sitemap/SitemapProps.d.ts +10 -4
- package/lib/ui-kit/Location/Location.d.ts +19 -0
- package/lib/ui-kit/Location/Location.fixture.d.ts +6 -0
- package/lib/ui-kit/Location/Location.js +42 -0
- package/lib/ui-kit/Location/Location.js.map +1 -0
- package/lib/ui-kit/Location/SearchBar.d.ts +6 -0
- package/lib/ui-kit/Location/SearchBar.js +7 -0
- package/lib/ui-kit/Location/SearchBar.js.map +1 -0
- package/lib/ui-kit/Logo/Logo.d.ts +2 -5
- package/lib/ui-kit/Logo/Logo.js +4 -22
- package/lib/ui-kit/Logo/Logo.js.map +1 -1
- package/lib/ui-kit/Logo/Logo.mobile.d.ts +2 -0
- package/lib/ui-kit/Logo/Logo.mobile.js +5 -16
- package/lib/ui-kit/Logo/Logo.mobile.js.map +1 -1
- package/lib/ui-kit/Logo/renderImage.d.ts +5 -0
- package/lib/ui-kit/Logo/renderImage.js +17 -0
- package/lib/ui-kit/Logo/renderImage.js.map +1 -0
- package/lib/ui-kit/Logo/renderTitle.d.ts +2 -0
- package/lib/ui-kit/Logo/renderTitle.js +9 -0
- package/lib/ui-kit/Logo/renderTitle.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/lib/utils/groupBy.d.ts +1 -0
- package/lib/utils/groupBy.js +10 -0
- package/lib/utils/groupBy.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +65 -26
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/mobile/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/mobile/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/bundle/components/Header/HeaderTop.d.ts +2 -0
- package/mobile/bundle/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/mobile/bundle/hooks/useCachedAsyncData.d.ts +2 -0
- package/mobile/bundle/hooks/useLocation.d.ts +6 -0
- package/mobile/bundle/hooks/useRegions.d.ts +6 -0
- package/mobile/bundle/model/LogoType.d.ts +5 -0
- package/mobile/bundle/services/sitemap/SitemapProps.d.ts +10 -4
- package/mobile/bundle/ui-kit/Location/Location.d.ts +19 -0
- package/mobile/bundle/ui-kit/Location/SearchBar.d.ts +6 -0
- package/mobile/bundle/ui-kit/Logo/Logo.d.ts +2 -0
- package/mobile/bundle/ui-kit/Logo/renderImage.d.ts +6 -0
- package/mobile/bundle/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/mobile/bundle/utils/groupBy.d.ts +1 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlock.js +11 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlock.js.map +1 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.js +2 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
- package/mobile/dist/components/Calculator/constants.js +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +22 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/mobile/dist/components/Header/Header.js +2 -2
- package/mobile/dist/components/Header/Header.js.map +1 -1
- package/mobile/dist/components/Header/HeaderBurger.js +4 -3
- package/mobile/dist/components/Header/HeaderBurger.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js +13 -4
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/dist/components/Header/HeaderTop.d.ts +2 -0
- package/mobile/dist/components/Header/HeaderTop.js +1 -1
- package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTile.js +8 -2
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/mobile/dist/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/dist/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/dist/hooks/useCachedAsyncData.d.ts +2 -0
- package/mobile/dist/hooks/useCachedAsyncData.js +25 -0
- package/mobile/dist/hooks/useCachedAsyncData.js.map +1 -0
- package/mobile/dist/hooks/useLocation.d.ts +6 -0
- package/mobile/dist/hooks/useLocation.js +26 -0
- package/mobile/dist/hooks/useLocation.js.map +1 -0
- package/mobile/dist/hooks/useRegions.d.ts +6 -0
- package/mobile/dist/hooks/useRegions.js +11 -0
- package/mobile/dist/hooks/useRegions.js.map +1 -0
- package/mobile/dist/model/LogoType.d.ts +5 -0
- package/mobile/dist/model/LogoType.js +2 -0
- package/mobile/dist/model/LogoType.js.map +1 -0
- package/mobile/dist/services/sitemap/SitemapProps.d.ts +10 -4
- package/mobile/dist/ui-kit/Location/Location.d.ts +19 -0
- package/mobile/dist/ui-kit/Location/Location.js +44 -0
- package/mobile/dist/ui-kit/Location/Location.js.map +1 -0
- package/mobile/dist/ui-kit/Location/SearchBar.d.ts +6 -0
- package/mobile/dist/ui-kit/Location/SearchBar.js +9 -0
- package/mobile/dist/ui-kit/Location/SearchBar.js.map +1 -0
- package/mobile/dist/ui-kit/Logo/Logo.d.ts +2 -0
- package/mobile/dist/ui-kit/Logo/Logo.js +4 -15
- package/mobile/dist/ui-kit/Logo/Logo.js.map +1 -1
- package/mobile/dist/ui-kit/Logo/renderImage.d.ts +6 -0
- package/mobile/dist/ui-kit/Logo/renderImage.js +20 -0
- package/mobile/dist/ui-kit/Logo/renderImage.js.map +1 -0
- package/mobile/dist/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/mobile/dist/ui-kit/Logo/renderTitle.js +12 -0
- package/mobile/dist/ui-kit/Logo/renderTitle.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/dist/utils/groupBy.d.ts +1 -0
- package/mobile/dist/utils/groupBy.js +13 -0
- package/mobile/dist/utils/groupBy.js.map +1 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlock.d.ts +6 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlock.js +9 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlock.js.map +1 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.d.ts +8 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js +2 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.js.map +1 -0
- package/mobile/lib/components/Calculator/constants.js +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +5 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +20 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +44 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js +2 -0
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.js.map +1 -0
- package/mobile/lib/components/Header/Header.js +2 -2
- package/mobile/lib/components/Header/Header.js.map +1 -1
- package/mobile/lib/components/Header/HeaderBurger.js +4 -3
- package/mobile/lib/components/Header/HeaderBurger.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js +13 -4
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/lib/components/Header/HeaderTop.d.ts +2 -0
- package/mobile/lib/components/Header/HeaderTop.js +1 -1
- package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTile.js +8 -2
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/mobile/lib/components/Recommendation/RecommendationCard.js +1 -1
- package/mobile/lib/components/Recommendation/RecommendationCard.js.map +1 -1
- package/mobile/lib/hooks/useCachedAsyncData.d.ts +2 -0
- package/mobile/lib/hooks/useCachedAsyncData.js +22 -0
- package/mobile/lib/hooks/useCachedAsyncData.js.map +1 -0
- package/mobile/lib/hooks/useLocation.d.ts +6 -0
- package/mobile/lib/hooks/useLocation.js +23 -0
- package/mobile/lib/hooks/useLocation.js.map +1 -0
- package/mobile/lib/hooks/useRegions.d.ts +6 -0
- package/mobile/lib/hooks/useRegions.js +8 -0
- package/mobile/lib/hooks/useRegions.js.map +1 -0
- package/mobile/lib/model/LogoType.d.ts +5 -0
- package/mobile/lib/model/LogoType.js +2 -0
- package/mobile/lib/model/LogoType.js.map +1 -0
- package/mobile/lib/services/sitemap/SitemapProps.d.ts +10 -4
- package/mobile/lib/ui-kit/Location/Location.d.ts +19 -0
- package/mobile/lib/ui-kit/Location/Location.js +42 -0
- package/mobile/lib/ui-kit/Location/Location.js.map +1 -0
- package/mobile/lib/ui-kit/Location/SearchBar.d.ts +6 -0
- package/mobile/lib/ui-kit/Location/SearchBar.js +7 -0
- package/mobile/lib/ui-kit/Location/SearchBar.js.map +1 -0
- package/mobile/lib/ui-kit/Logo/Logo.d.ts +2 -0
- package/mobile/lib/ui-kit/Logo/Logo.js +5 -16
- package/mobile/lib/ui-kit/Logo/Logo.js.map +1 -1
- package/mobile/lib/ui-kit/Logo/renderImage.d.ts +6 -0
- package/mobile/lib/ui-kit/Logo/renderImage.js +17 -0
- package/mobile/lib/ui-kit/Logo/renderImage.js.map +1 -0
- package/mobile/lib/ui-kit/Logo/renderTitle.d.ts +3 -0
- package/mobile/lib/ui-kit/Logo/renderTitle.js +9 -0
- package/mobile/lib/ui-kit/Logo/renderTitle.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -4
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/lib/utils/groupBy.d.ts +1 -0
- package/mobile/lib/utils/groupBy.js +10 -0
- package/mobile/lib/utils/groupBy.js.map +1 -0
- package/mobile/src/components/ButtonBlock/ButtonBlock.example.json +10 -0
- package/mobile/src/components/ButtonBlock/ButtonBlock.tsx +17 -0
- package/mobile/src/components/ButtonBlock/ButtonBlock.ui.json +12 -0
- package/mobile/src/components/ButtonBlock/ButtonBlockContent.ts +9 -0
- package/mobile/src/components/Calculator/constants.ts +1 -1
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
- package/mobile/src/components/Header/Header.tsx +2 -2
- package/mobile/src/components/Header/HeaderBurger.tsx +5 -7
- package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
- package/mobile/src/components/Header/HeaderTop.tsx +4 -2
- package/mobile/src/components/MiniGallery/MiniGallery.ui.json +1 -1
- package/mobile/src/components/ProductTile/ProductTile.example.json +2 -1
- package/mobile/src/components/ProductTile/ProductTile.tsx +34 -18
- package/mobile/src/components/ProductTile/ProductTileContent.ts +2 -0
- package/mobile/src/components/Recommendation/Recommendation.example.json +6 -5
- package/mobile/src/components/Recommendation/Recommendation.ui.json +8 -0
- package/mobile/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/mobile/src/hooks/useCachedAsyncData.ts +37 -0
- package/mobile/src/hooks/useLocation.ts +48 -0
- package/mobile/src/hooks/useRegions.ts +16 -0
- package/mobile/src/model/LogoType.ts +6 -0
- package/mobile/src/services/sitemap/SitemapProps.ts +11 -4
- package/mobile/src/ui-kit/Location/Location.tsx +168 -0
- package/mobile/src/ui-kit/Location/SearchBar.tsx +30 -0
- package/mobile/src/ui-kit/Logo/Logo.tsx +16 -31
- package/mobile/src/ui-kit/Logo/renderImage.tsx +40 -0
- package/mobile/src/ui-kit/Logo/renderTitle.tsx +15 -0
- package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
- package/mobile/src/utils/groupBy.ts +10 -0
- package/package.json +2 -2
- package/src/components/Blocks.ts +6 -2
- package/src/components/ButtonBlock/ButtonBlock.example.json +10 -0
- package/src/components/ButtonBlock/ButtonBlock.fixture.tsx +18 -0
- package/src/components/ButtonBlock/ButtonBlock.tsx +17 -0
- package/src/components/ButtonBlock/ButtonBlock.ui.json +12 -0
- package/src/components/ButtonBlock/ButtonBlockContent.ts +9 -0
- package/src/components/Calculator/constants.ts +1 -1
- package/src/components/Carousel/Carousel.fixture.tsx +22 -4
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +19 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +47 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +62 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +9 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +45 -0
- package/src/components/Header/Header.mobile.tsx +2 -2
- package/src/components/Header/Header.tsx +6 -4
- package/src/components/Header/HeaderBurger.tsx +5 -7
- package/src/components/Header/HeaderSecondaryMenu.tsx +32 -5
- package/src/components/Header/HeaderTop.tsx +4 -2
- package/src/components/MiniGallery/MiniGallery.ui.json +1 -1
- package/src/components/ProductTile/ProductTile.example.json +2 -1
- package/src/components/ProductTile/ProductTile.fixture.tsx +13 -0
- package/src/components/ProductTile/ProductTile.tsx +34 -18
- package/src/components/ProductTile/ProductTileContent.ts +2 -0
- package/src/components/Recommendation/Recommendation.example.json +6 -5
- package/src/components/Recommendation/Recommendation.fixture.tsx +11 -10
- package/src/components/Recommendation/Recommendation.ui.json +8 -0
- package/src/components/Recommendation/RecommendationCard.tsx +1 -1
- package/src/hooks/useCachedAsyncData.ts +37 -0
- package/src/hooks/useLocation.ts +48 -0
- package/src/hooks/useRegions.ts +16 -0
- package/src/model/LogoType.ts +6 -0
- package/src/services/sitemap/SitemapProps.ts +11 -4
- package/src/ui-kit/Location/Location.fixture.tsx +81 -0
- package/src/ui-kit/Location/Location.tsx +168 -0
- package/src/ui-kit/Location/SearchBar.tsx +30 -0
- package/src/ui-kit/Logo/Logo.mobile.tsx +16 -31
- package/src/ui-kit/Logo/Logo.tsx +6 -43
- package/src/ui-kit/Logo/renderImage.tsx +40 -0
- package/src/ui-kit/Logo/renderTitle.tsx +15 -0
- package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +8 -4
- package/src/utils/groupBy.ts +10 -0
- package/bundle/hooks/useGeolocation.d.ts +0 -1
- package/dist/hooks/useGeolocation.d.ts +0 -1
- package/dist/hooks/useGeolocation.js +0 -21
- package/dist/hooks/useGeolocation.js.map +0 -1
- package/lib/hooks/useGeolocation.d.ts +0 -1
- package/lib/hooks/useGeolocation.js +0 -18
- package/lib/hooks/useGeolocation.js.map +0 -1
- package/mobile/bundle/hooks/useGeolocation.d.ts +0 -1
- package/mobile/dist/hooks/useGeolocation.d.ts +0 -1
- package/mobile/dist/hooks/useGeolocation.js +0 -21
- package/mobile/dist/hooks/useGeolocation.js.map +0 -1
- package/mobile/lib/hooks/useGeolocation.d.ts +0 -1
- package/mobile/lib/hooks/useGeolocation.js +0 -18
- package/mobile/lib/hooks/useGeolocation.js.map +0 -1
- package/mobile/src/hooks/useGeolocation.ts +0 -22
- package/src/hooks/useGeolocation.ts +0 -22
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Picture } from '../../model/Picture';
|
|
2
|
+
import type { ForeignOffice } from '../../services/sitemap/SitemapProps';
|
|
3
|
+
import '../../setup-fixture';
|
|
4
|
+
import { Location } from './Location';
|
|
5
|
+
|
|
6
|
+
const belarus: Picture = {
|
|
7
|
+
src: 'belarus.png',
|
|
8
|
+
format: 'webp',
|
|
9
|
+
size: {
|
|
10
|
+
width: 24,
|
|
11
|
+
height: 24,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const kazakhstan: Picture = {
|
|
16
|
+
src: 'kazakhstan.png',
|
|
17
|
+
format: 'webp',
|
|
18
|
+
size: {
|
|
19
|
+
width: 24,
|
|
20
|
+
height: 24,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const armenia: Picture = {
|
|
25
|
+
src: 'armenia.png',
|
|
26
|
+
format: 'webp',
|
|
27
|
+
size: {
|
|
28
|
+
width: 24,
|
|
29
|
+
height: 24,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const china: Picture = {
|
|
34
|
+
src: 'china.png',
|
|
35
|
+
format: 'webp',
|
|
36
|
+
size: {
|
|
37
|
+
width: 24,
|
|
38
|
+
height: 24,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const FOREIGN_OFFICES: ForeignOffice[] = [
|
|
43
|
+
{
|
|
44
|
+
text: 'Республика Беларусь',
|
|
45
|
+
href: '#',
|
|
46
|
+
icon: belarus,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
text: 'Республика Казахстан',
|
|
50
|
+
href: '#',
|
|
51
|
+
icon: kazakhstan,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
text: 'Республика Армения',
|
|
55
|
+
href: '#',
|
|
56
|
+
icon: armenia,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
text: 'Китайская Народная Республика',
|
|
60
|
+
href: '#',
|
|
61
|
+
icon: china,
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
const close = () => ({});
|
|
66
|
+
const onChangeLocation = () => ({});
|
|
67
|
+
|
|
68
|
+
const currentLocation = {
|
|
69
|
+
name: 'Москва',
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default {
|
|
73
|
+
default: (
|
|
74
|
+
<Location
|
|
75
|
+
close={close}
|
|
76
|
+
onChangeLocation={onChangeLocation}
|
|
77
|
+
currentLocation={currentLocation}
|
|
78
|
+
foreignOffices={FOREIGN_OFFICES}
|
|
79
|
+
/>
|
|
80
|
+
),
|
|
81
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { useLink } from '../../hooks/useLink';
|
|
4
|
+
import type { Region } from '../../hooks/useRegions';
|
|
5
|
+
import { useRegions } from '../../hooks/useRegions';
|
|
6
|
+
import { useSearch } from '../../hooks/useSearch';
|
|
7
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
8
|
+
import type { ForeignOffice } from '../../services/sitemap/SitemapProps';
|
|
9
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
10
|
+
import { groupBy } from '../../utils/groupBy';
|
|
11
|
+
import { Img } from '../Img/Img';
|
|
12
|
+
import { SearchBar } from './SearchBar';
|
|
13
|
+
|
|
14
|
+
const SEARCH_TERM_MIN_LENGTH = 3;
|
|
15
|
+
|
|
16
|
+
interface RegionLinkProps {
|
|
17
|
+
onChangeLocation?: (region: Region) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface CloseButtonProps {
|
|
21
|
+
close?: () => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface CurrentLocationProps {
|
|
25
|
+
currentLocation?: Region;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface ForeignOfficeProps {
|
|
29
|
+
foreignOffices?: ForeignOffice[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type LocationProps = ForeignOfficeProps &
|
|
33
|
+
CloseButtonProps &
|
|
34
|
+
RegionLinkProps &
|
|
35
|
+
CurrentLocationProps &
|
|
36
|
+
UniBlockProps;
|
|
37
|
+
|
|
38
|
+
export const Location = JSX<LocationProps>(
|
|
39
|
+
({ currentLocation, onChangeLocation, close, foreignOffices }) => {
|
|
40
|
+
const { term, setTerm } = useSearch();
|
|
41
|
+
|
|
42
|
+
const handleSearch = useCallback((_: string) => setTerm(_), []);
|
|
43
|
+
|
|
44
|
+
const regions: Region[] = cleanUpRegions(useRegions()).sort((a, b) =>
|
|
45
|
+
a.name.localeCompare(b.name),
|
|
46
|
+
);
|
|
47
|
+
const regionsGroupByLetter: Map<string, Region[]> = groupBy(regions, regionFirstLetter);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div className="absolute h-full w-full inset-0 bg-white text-l-light z-50">
|
|
51
|
+
<CloseButton close={close} />
|
|
52
|
+
<div className="container py-12">
|
|
53
|
+
<CurrentLocation currentLocation={currentLocation} />
|
|
54
|
+
<SearchBar onSearch={handleSearch} searchTerm={term} className="mb-7" />
|
|
55
|
+
|
|
56
|
+
{term && term.length >= SEARCH_TERM_MIN_LENGTH ? (
|
|
57
|
+
<div>
|
|
58
|
+
{regions
|
|
59
|
+
.filter((region) => region.name?.startsWith(term))
|
|
60
|
+
.map(renderRegion({ onChangeLocation, close }))}
|
|
61
|
+
</div>
|
|
62
|
+
) : (
|
|
63
|
+
<div className="columns-5">
|
|
64
|
+
{Array.from(regionsGroupByLetter.entries()).map(
|
|
65
|
+
renderRegionGroup({ onChangeLocation, close }),
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
)}
|
|
69
|
+
|
|
70
|
+
<ForeignOffices foreignOffices={foreignOffices} />
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const regionFirstLetter = (region: Region) => region.name?.charAt(0) || '';
|
|
78
|
+
|
|
79
|
+
const cleanUpRegions = (regions: Region[]) =>
|
|
80
|
+
regions.map((region) => ({
|
|
81
|
+
...region,
|
|
82
|
+
name: region.name?.replace(/республика|область|край'/gi, '').trim() || '',
|
|
83
|
+
}));
|
|
84
|
+
|
|
85
|
+
const CurrentLocation = JSX<CurrentLocationProps>(({ currentLocation }) =>
|
|
86
|
+
currentLocation ? (
|
|
87
|
+
<div className="mb-4">
|
|
88
|
+
<Text size="text-l" font="font-light">
|
|
89
|
+
Сейчас выбран:
|
|
90
|
+
</Text>
|
|
91
|
+
<button className="cursor-pointer" onClick={close}>
|
|
92
|
+
<Text color="text-green">{currentLocation.name}</Text>
|
|
93
|
+
</button>
|
|
94
|
+
</div>
|
|
95
|
+
) : null,
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
const CloseButton = JSX<CloseButtonProps>(({ close }) => (
|
|
99
|
+
<button
|
|
100
|
+
className="visible peer-placeholder-shown:invisible absolute top-6 right-6 w-6 h-6 p-1 bg-transparent cursor-pointer border-none"
|
|
101
|
+
onClick={(e) => {
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
close && close();
|
|
104
|
+
}}
|
|
105
|
+
>
|
|
106
|
+
<Img image="CloseIcon" width="24" height="24" />
|
|
107
|
+
</button>
|
|
108
|
+
));
|
|
109
|
+
|
|
110
|
+
const renderRegionGroup =
|
|
111
|
+
({ onChangeLocation, close }: RegionLinkProps & CloseButtonProps) =>
|
|
112
|
+
([letter, regions]: [string, Region[]]) =>
|
|
113
|
+
(
|
|
114
|
+
<div key={letter} className="break-inside-avoid mb-7 w-[224px]">
|
|
115
|
+
<div className="mb-2.5">
|
|
116
|
+
<Text size="text-h6">{letter}</Text>
|
|
117
|
+
</div>
|
|
118
|
+
{regions.map(renderRegion({ onChangeLocation, close }))}
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
const renderRegion =
|
|
123
|
+
({ onChangeLocation, close }: RegionLinkProps & CloseButtonProps) =>
|
|
124
|
+
(region: Region) =>
|
|
125
|
+
(
|
|
126
|
+
<div key={region.id} className="mb-1">
|
|
127
|
+
<button
|
|
128
|
+
className="cursor-pointer hover:text-primary-hover"
|
|
129
|
+
onClick={() => {
|
|
130
|
+
onChangeLocation && onChangeLocation(region);
|
|
131
|
+
close && close();
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
{region.name}
|
|
135
|
+
</button>
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
const ForeignOffices = JSX<ForeignOfficeProps>(({ foreignOffices }) =>
|
|
140
|
+
foreignOffices?.length ? (
|
|
141
|
+
<div className="border-t border-main-divider mt-7 pt-7">
|
|
142
|
+
<div className="mb-4">
|
|
143
|
+
<Text size="text-m-light" color="text-secondary-text">
|
|
144
|
+
Представительства за рубежом:
|
|
145
|
+
</Text>
|
|
146
|
+
</div>
|
|
147
|
+
<div className="flex gap-10">
|
|
148
|
+
{foreignOffices.map((office, i: number) => (
|
|
149
|
+
<ForeignOffice key={String(i)} {...office} />
|
|
150
|
+
))}
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
) : null,
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
const ForeignOffice = JSX<ForeignOffice>(({ icon, ...rest }) => {
|
|
157
|
+
const link = useLink();
|
|
158
|
+
const { text, target, href, onClick } = link(rest);
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
<div className="flex gap-x-3">
|
|
162
|
+
<Img image={icon} />
|
|
163
|
+
<a className="hover:text-primary-hover" href={href} target={target} onClick={onClick}>
|
|
164
|
+
{text}
|
|
165
|
+
</a>
|
|
166
|
+
</div>
|
|
167
|
+
);
|
|
168
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
|
|
3
|
+
export interface SearchBarInnerProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
searchTerm?: string;
|
|
6
|
+
onSearch: (_: string) => void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const SearchBar = JSX<SearchBarInnerProps>(({ className, searchTerm, onSearch }) => {
|
|
10
|
+
return (
|
|
11
|
+
<form className={`font-sans relative ${className}`}>
|
|
12
|
+
<div className="absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none">
|
|
13
|
+
{searchTerm ? null : (
|
|
14
|
+
<label htmlFor="search-bar-input" className={`text-secondary-text `}>
|
|
15
|
+
Поиск по филиалам
|
|
16
|
+
</label>
|
|
17
|
+
)}
|
|
18
|
+
</div>
|
|
19
|
+
<input
|
|
20
|
+
id="search-bar-input"
|
|
21
|
+
className={`h-12 pl-4 w-full peer text-l text-black border border-solid rounded-md box-border
|
|
22
|
+
outline-none border-main-stroke hover:border-primary-hover active:border-primary-text focus:border-primary-text`}
|
|
23
|
+
value={searchTerm}
|
|
24
|
+
onChange={(e) => onSearch(e.target.value as string)}
|
|
25
|
+
type="text"
|
|
26
|
+
name="location-search-bar-input"
|
|
27
|
+
/>
|
|
28
|
+
</form>
|
|
29
|
+
);
|
|
30
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
2
|
+
import type { LogoType } from '../../model/LogoType';
|
|
3
|
+
import { renderImage } from './renderImage';
|
|
4
|
+
import { renderTitle } from './renderTitle';
|
|
4
5
|
|
|
5
6
|
export interface LogoProps {
|
|
6
7
|
className: string;
|
|
@@ -8,44 +9,28 @@ export interface LogoProps {
|
|
|
8
9
|
targetBlank: boolean;
|
|
9
10
|
bgColor?: string;
|
|
10
11
|
showTitle?: boolean;
|
|
12
|
+
logo?: LogoType;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
const ICON_VERSION_MAP: Record<BgColorVersion, string> = {
|
|
14
|
-
'bg-white': 'color',
|
|
15
|
-
transparent: 'white',
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const SVG_COLOR: Record<BgColorVersion, string> = {
|
|
19
|
-
'bg-white': 'text-primary-main',
|
|
20
|
-
transparent: 'text-white',
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const TEXT_COLOR: Record<BgColorVersion, string> = {
|
|
24
|
-
'bg-white': 'text-black',
|
|
25
|
-
transparent: 'text-white',
|
|
26
|
-
};
|
|
27
|
-
|
|
28
15
|
export const Logo = JSX<Partial<LogoProps>>(
|
|
29
|
-
({
|
|
16
|
+
({
|
|
17
|
+
bgColor = 'bg-white',
|
|
18
|
+
children,
|
|
19
|
+
className = '',
|
|
20
|
+
href,
|
|
21
|
+
logo,
|
|
22
|
+
showTitle = true,
|
|
23
|
+
targetBlank,
|
|
24
|
+
}) => {
|
|
30
25
|
return (
|
|
31
26
|
<a
|
|
32
27
|
className={`inline-flex items-center font-sans no-underline ${className}`}
|
|
33
28
|
href={href || 'https://rshb.ru/'}
|
|
34
29
|
target={targetBlank ? '_blank' : '_self'}
|
|
35
|
-
aria-label=
|
|
30
|
+
aria-label={logo?.title || 'Россельхозбанк'}
|
|
36
31
|
>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
className={`${SVG_COLOR[bgColor]}`}
|
|
40
|
-
width="34"
|
|
41
|
-
height="34"
|
|
42
|
-
asSVG
|
|
43
|
-
/>
|
|
44
|
-
{showTitle ? (
|
|
45
|
-
<span className={`${TEXT_COLOR[bgColor]} text-s font-medium ml-2.5`}>
|
|
46
|
-
{children || 'Россельхозбанк'}
|
|
47
|
-
</span>
|
|
48
|
-
) : null}
|
|
32
|
+
{renderImage(bgColor, logo?.image, { width: '34', height: '34' })}
|
|
33
|
+
{showTitle ? renderTitle(children || logo?.title, bgColor, 'text-s') : null}
|
|
49
34
|
</a>
|
|
50
35
|
);
|
|
51
36
|
},
|
package/src/ui-kit/Logo/Logo.tsx
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Img } from '../Img/Img';
|
|
2
|
+
import type { LogoType } from '../../model/LogoType';
|
|
3
|
+
import { renderImage } from './renderImage';
|
|
4
|
+
import { renderTitle } from './renderTitle';
|
|
6
5
|
|
|
7
6
|
export interface LogoProps {
|
|
8
7
|
className: string;
|
|
@@ -10,26 +9,9 @@ export interface LogoProps {
|
|
|
10
9
|
targetBlank: boolean;
|
|
11
10
|
bgColor?: string;
|
|
12
11
|
showTitle?: boolean;
|
|
13
|
-
logo?:
|
|
14
|
-
image?: Picture;
|
|
15
|
-
title?: string;
|
|
16
|
-
};
|
|
12
|
+
logo?: LogoType;
|
|
17
13
|
}
|
|
18
14
|
|
|
19
|
-
const ICON_VERSION_MAP: Record<BgColorVersion, string> = {
|
|
20
|
-
'bg-white': 'color',
|
|
21
|
-
transparent: 'white',
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const SVG_COLOR: Record<BgColorVersion, string> = {
|
|
25
|
-
'bg-white': 'text-primary-main',
|
|
26
|
-
transparent: 'text-white',
|
|
27
|
-
};
|
|
28
|
-
const TEXT_COLOR: Record<BgColorVersion, string> = {
|
|
29
|
-
'bg-white': 'text-primary-text',
|
|
30
|
-
transparent: 'text-white',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
15
|
export const Logo = JSX<Partial<LogoProps>>(
|
|
34
16
|
({
|
|
35
17
|
className = '',
|
|
@@ -47,28 +29,9 @@ export const Logo = JSX<Partial<LogoProps>>(
|
|
|
47
29
|
target={targetBlank ? '_blank' : '_self'}
|
|
48
30
|
aria-label={logo?.title || 'Россельхозбанк'}
|
|
49
31
|
>
|
|
50
|
-
{logo?.image
|
|
51
|
-
|
|
52
|
-
) : (
|
|
53
|
-
<Img
|
|
54
|
-
image={{
|
|
55
|
-
icon: logo?.image?.icon || 'LogoIcon',
|
|
56
|
-
iconVersion: ICON_VERSION_MAP[bgColor],
|
|
57
|
-
}}
|
|
58
|
-
className={`${SVG_COLOR[bgColor]} w-10`}
|
|
59
|
-
width="40"
|
|
60
|
-
height="45"
|
|
61
|
-
asSVG
|
|
62
|
-
/>
|
|
63
|
-
)}
|
|
64
|
-
{showTitle ? renderTitle(children, bgColor, logo?.title) : null}
|
|
32
|
+
{renderImage(bgColor, logo?.image, { width: '40', height: '45' })}
|
|
33
|
+
{showTitle ? renderTitle(children || logo?.title, bgColor) : null}
|
|
65
34
|
</a>
|
|
66
35
|
);
|
|
67
36
|
},
|
|
68
37
|
);
|
|
69
|
-
|
|
70
|
-
const renderTitle = (children: VNode, bgColor: string, title?: string) => {
|
|
71
|
-
const text = children || title || 'Россельхозбанк';
|
|
72
|
-
|
|
73
|
-
return <span className={`${TEXT_COLOR[bgColor]} font-medium ml-2.5`}>{text}</span>;
|
|
74
|
-
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BgColorVersion } from '../../model/BgColorVersion';
|
|
2
|
+
import type { Picture } from '../../model/Picture';
|
|
3
|
+
import { Img } from '../Img/Img';
|
|
4
|
+
|
|
5
|
+
const ICON_VERSION_MAP: Record<BgColorVersion, string> = {
|
|
6
|
+
'bg-white': 'color',
|
|
7
|
+
transparent: 'white',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const SVG_COLOR: Record<BgColorVersion, string> = {
|
|
11
|
+
'bg-white': 'text-primary-main',
|
|
12
|
+
transparent: 'text-white',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const renderImage = (
|
|
16
|
+
bgColor: string,
|
|
17
|
+
image?: Picture,
|
|
18
|
+
size?: { width: string; height: string },
|
|
19
|
+
) => {
|
|
20
|
+
return image?.src ? (
|
|
21
|
+
<Img
|
|
22
|
+
image={image}
|
|
23
|
+
className={SVG_COLOR[bgColor]}
|
|
24
|
+
width={size?.width}
|
|
25
|
+
height={size?.height}
|
|
26
|
+
asSVG
|
|
27
|
+
/>
|
|
28
|
+
) : (
|
|
29
|
+
<Img
|
|
30
|
+
image={{
|
|
31
|
+
icon: image?.icon || 'LogoIcon',
|
|
32
|
+
iconVersion: ICON_VERSION_MAP[bgColor],
|
|
33
|
+
}}
|
|
34
|
+
className={SVG_COLOR[bgColor]}
|
|
35
|
+
width={size?.width}
|
|
36
|
+
height={size?.height}
|
|
37
|
+
asSVG
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
2
|
+
import type { VNode } from '../../model/VNode';
|
|
3
|
+
|
|
4
|
+
const TEXT_COLOR: Record<BgColorVersion, string> = {
|
|
5
|
+
'bg-white': 'text-primary-text',
|
|
6
|
+
transparent: 'text-white',
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const renderTitle = (title: VNode, bgColor: string, className?: string) => {
|
|
10
|
+
return (
|
|
11
|
+
<span className={`${TEXT_COLOR[bgColor]} ml-2.5 font-medium ${className || ''}`}>
|
|
12
|
+
{title || 'Россельхозбанк'}
|
|
13
|
+
</span>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -29,7 +29,7 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
|
29
29
|
className = '',
|
|
30
30
|
containerRef,
|
|
31
31
|
activeIndex,
|
|
32
|
-
visibleItemCount,
|
|
32
|
+
visibleItemCount = 0,
|
|
33
33
|
gap = 0,
|
|
34
34
|
padding = 0,
|
|
35
35
|
snapAlign = 'snap-center',
|
|
@@ -54,11 +54,15 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
|
54
54
|
},
|
|
55
55
|
[onVisibleItemsChange, onVisibleIndicesChange],
|
|
56
56
|
);
|
|
57
|
+
const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
|
|
57
58
|
|
|
58
59
|
return (
|
|
59
60
|
<div
|
|
60
61
|
className={`box-border overflow-auto flex horizontal-list no-scrollbar ${className}`}
|
|
61
|
-
style={{
|
|
62
|
+
style={{
|
|
63
|
+
...getContainerStyle(padding, additionPadding),
|
|
64
|
+
gap: `${gap}px`,
|
|
65
|
+
}}
|
|
62
66
|
role="list"
|
|
63
67
|
ref={containerRef}
|
|
64
68
|
>
|
|
@@ -83,11 +87,11 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
|
83
87
|
);
|
|
84
88
|
|
|
85
89
|
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
86
|
-
const getContainerStyle = (padding: number): Record<string, string> => ({
|
|
90
|
+
const getContainerStyle = (padding: number, additionalPadding = 0): Record<string, string> => ({
|
|
87
91
|
marginLeft: `${-padding}px`,
|
|
88
92
|
marginRight: `${-padding}px`,
|
|
89
93
|
paddingLeft: `${padding}px`,
|
|
90
|
-
paddingRight: `${padding}px`,
|
|
94
|
+
paddingRight: `${padding + additionalPadding}px`,
|
|
91
95
|
});
|
|
92
96
|
|
|
93
97
|
const getVisibleIndices = (itemsVisibilityList: ItemsVisibilityList) =>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const groupBy = <K, V>(list: Array<V>, keyGetter: (input: V) => K): Map<K, Array<V>> => {
|
|
2
|
+
const map = new Map<K, Array<V>>();
|
|
3
|
+
list.forEach((item) => {
|
|
4
|
+
const key = keyGetter(item);
|
|
5
|
+
const collection = map.get(key);
|
|
6
|
+
map.set(key, [...(collection || []), item]);
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
return map;
|
|
10
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useGeolocation(defaultLocation: string): [string, () => void];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useGeolocation(defaultLocation: string): [string, () => void];
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.useGeolocation = void 0;
|
|
3
|
-
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
4
|
-
const DaDataAPI_1 = require("../api/DaDataAPI");
|
|
5
|
-
const DaData = (0, DaDataAPI_1.DaDataAPI)('https://10.80.4.9');
|
|
6
|
-
function useGeolocation(defaultLocation) {
|
|
7
|
-
const [city, setCity] = (0, hooks_1.useState)(defaultLocation);
|
|
8
|
-
(0, hooks_1.useEffect)(() => {
|
|
9
|
-
setCity(globalThis?.localStorage.getItem('location') || defaultLocation);
|
|
10
|
-
}, [defaultLocation]);
|
|
11
|
-
const getCity = (0, hooks_1.useCallback)(() => {
|
|
12
|
-
DaData.getFetcherAddress().then((_) => {
|
|
13
|
-
const location = _ || defaultLocation;
|
|
14
|
-
globalThis?.localStorage.setItem('location', location);
|
|
15
|
-
setCity(location);
|
|
16
|
-
});
|
|
17
|
-
}, [defaultLocation]);
|
|
18
|
-
return [city, getCity];
|
|
19
|
-
}
|
|
20
|
-
exports.useGeolocation = useGeolocation;
|
|
21
|
-
//# sourceMappingURL=useGeolocation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGeolocation.js","sourceRoot":"","sources":["../../src/hooks/useGeolocation.ts"],"names":[],"mappings":";;AAAA,uDAA+E;AAC/E,gDAA6C;AAE7C,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,mBAAmB,CAAC,CAAC;AAE9C,SAAgB,cAAc,CAAC,eAAuB;IACpD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAC,eAAe,CAAC,CAAC;IAElD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,eAAe,CAAC,CAAC;IAC3E,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,MAAM,OAAO,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC/B,MAAM,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YACpC,MAAM,QAAQ,GAAG,CAAC,IAAI,eAAe,CAAC;YACtC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YACvD,OAAO,CAAC,QAAQ,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACzB,CAAC;AAhBD,wCAgBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useGeolocation(defaultLocation: string): [string, () => void];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
import { DaDataAPI } from '../api/DaDataAPI.js';
|
|
3
|
-
const DaData = DaDataAPI('https://10.80.4.9');
|
|
4
|
-
export function useGeolocation(defaultLocation) {
|
|
5
|
-
const [city, setCity] = useState(defaultLocation);
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
setCity(globalThis?.localStorage.getItem('location') || defaultLocation);
|
|
8
|
-
}, [defaultLocation]);
|
|
9
|
-
const getCity = useCallback(() => {
|
|
10
|
-
DaData.getFetcherAddress().then((_) => {
|
|
11
|
-
const location = _ || defaultLocation;
|
|
12
|
-
globalThis?.localStorage.setItem('location', location);
|
|
13
|
-
setCity(location);
|
|
14
|
-
});
|
|
15
|
-
}, [defaultLocation]);
|
|
16
|
-
return [city, getCity];
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=useGeolocation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGeolocation.js","sourceRoot":"","sources":["../../src/hooks/useGeolocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,MAAM,GAAG,SAAS,CAAC,mBAAmB,CAAC,CAAC;AAE9C,MAAM,UAAU,cAAc,CAAC,eAAuB;IACpD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;IAElD,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,eAAe,CAAC,CAAC;IAC3E,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/B,MAAM,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YACpC,MAAM,QAAQ,GAAG,CAAC,IAAI,eAAe,CAAC;YACtC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YACvD,OAAO,CAAC,QAAQ,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useGeolocation(defaultLocation: string): [string, () => void];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useGeolocation(defaultLocation: string): [string, () => void];
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.useGeolocation = void 0;
|
|
3
|
-
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
4
|
-
const DaDataAPI_1 = require("../api/DaDataAPI");
|
|
5
|
-
const DaData = (0, DaDataAPI_1.DaDataAPI)('https://10.80.4.9');
|
|
6
|
-
function useGeolocation(defaultLocation) {
|
|
7
|
-
const [city, setCity] = (0, hooks_1.useState)(defaultLocation);
|
|
8
|
-
(0, hooks_1.useEffect)(() => {
|
|
9
|
-
setCity(globalThis?.localStorage.getItem('location') || defaultLocation);
|
|
10
|
-
}, [defaultLocation]);
|
|
11
|
-
const getCity = (0, hooks_1.useCallback)(() => {
|
|
12
|
-
DaData.getFetcherAddress().then((_) => {
|
|
13
|
-
const location = _ || defaultLocation;
|
|
14
|
-
globalThis?.localStorage.setItem('location', location);
|
|
15
|
-
setCity(location);
|
|
16
|
-
});
|
|
17
|
-
}, [defaultLocation]);
|
|
18
|
-
return [city, getCity];
|
|
19
|
-
}
|
|
20
|
-
exports.useGeolocation = useGeolocation;
|
|
21
|
-
//# sourceMappingURL=useGeolocation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGeolocation.js","sourceRoot":"","sources":["../../src/hooks/useGeolocation.ts"],"names":[],"mappings":";;AAAA,uDAA+E;AAC/E,gDAA6C;AAE7C,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,mBAAmB,CAAC,CAAC;AAE9C,SAAgB,cAAc,CAAC,eAAuB;IACpD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAC,eAAe,CAAC,CAAC;IAElD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,eAAe,CAAC,CAAC;IAC3E,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,MAAM,OAAO,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC/B,MAAM,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YACpC,MAAM,QAAQ,GAAG,CAAC,IAAI,eAAe,CAAC;YACtC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YACvD,OAAO,CAAC,QAAQ,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACzB,CAAC;AAhBD,wCAgBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useGeolocation(defaultLocation: string): [string, () => void];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
import { DaDataAPI } from '../api/DaDataAPI.js';
|
|
3
|
-
const DaData = DaDataAPI('https://10.80.4.9');
|
|
4
|
-
export function useGeolocation(defaultLocation) {
|
|
5
|
-
const [city, setCity] = useState(defaultLocation);
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
setCity(globalThis?.localStorage.getItem('location') || defaultLocation);
|
|
8
|
-
}, [defaultLocation]);
|
|
9
|
-
const getCity = useCallback(() => {
|
|
10
|
-
DaData.getFetcherAddress().then((_) => {
|
|
11
|
-
const location = _ || defaultLocation;
|
|
12
|
-
globalThis?.localStorage.setItem('location', location);
|
|
13
|
-
setCity(location);
|
|
14
|
-
});
|
|
15
|
-
}, [defaultLocation]);
|
|
16
|
-
return [city, getCity];
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=useGeolocation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGeolocation.js","sourceRoot":"","sources":["../../src/hooks/useGeolocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,MAAM,GAAG,SAAS,CAAC,mBAAmB,CAAC,CAAC;AAE9C,MAAM,UAAU,cAAc,CAAC,eAAuB;IACpD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;IAElD,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,eAAe,CAAC,CAAC;IAC3E,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/B,MAAM,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YACpC,MAAM,QAAQ,GAAG,CAAC,IAAI,eAAe,CAAC;YACtC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YACvD,OAAO,CAAC,QAAQ,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
import { DaDataAPI } from '../api/DaDataAPI';
|
|
3
|
-
|
|
4
|
-
const DaData = DaDataAPI('https://10.80.4.9');
|
|
5
|
-
|
|
6
|
-
export function useGeolocation(defaultLocation: string): [string, () => void] {
|
|
7
|
-
const [city, setCity] = useState(defaultLocation);
|
|
8
|
-
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
setCity(globalThis?.localStorage.getItem('location') || defaultLocation);
|
|
11
|
-
}, [defaultLocation]);
|
|
12
|
-
|
|
13
|
-
const getCity = useCallback(() => {
|
|
14
|
-
DaData.getFetcherAddress().then((_) => {
|
|
15
|
-
const location = _ || defaultLocation;
|
|
16
|
-
globalThis?.localStorage.setItem('location', location);
|
|
17
|
-
setCity(location);
|
|
18
|
-
});
|
|
19
|
-
}, [defaultLocation]);
|
|
20
|
-
|
|
21
|
-
return [city, getCity];
|
|
22
|
-
}
|