@redneckz/wildless-cms-uni-blocks 0.8.8 → 0.8.10
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.8.10.js +31 -0
- package/bundle/EventBus/EventBus.d.ts +1 -4
- package/bundle/EventBus/defaultEventBus.d.ts +7 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +112 -113
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
- package/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/{dist/components/StepsBlock/renderStepContent.d.ts → bundle/components/StepsBlock/renderStep.d.ts} +5 -5
- package/bundle/components/Tile/TileContent.d.ts +2 -2
- package/bundle/hooks/useRouter.d.ts +6 -2
- package/bundle/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/bundle/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/dist/EventBus/EventBus.d.ts +1 -4
- package/dist/EventBus/EventBus.js +0 -1
- package/dist/EventBus/EventBus.js.map +1 -1
- package/dist/EventBus/defaultEventBus.d.ts +7 -0
- package/dist/EventBus/defaultEventBus.js +5 -0
- package/dist/EventBus/defaultEventBus.js.map +1 -0
- package/dist/components/ButtonBlock/ButtonBlock.js +2 -1
- package/dist/components/ButtonBlock/ButtonBlock.js.map +1 -1
- package/dist/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/dist/components/Calculator/Rate.js +1 -1
- package/dist/components/Calculator/Rate.js.map +1 -1
- package/dist/components/Calculator/constants.js +2 -2
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/Calculator/rangeHelpers.d.ts +4 -0
- package/dist/components/Calculator/rangeHelpers.js +12 -0
- package/dist/components/Calculator/rangeHelpers.js.map +1 -0
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/dist/components/Carousel/Carousel.js +6 -4
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/PictureText/renderBenefit.js +1 -0
- package/dist/components/PictureText/renderBenefit.js.map +1 -1
- package/dist/components/ProductTile/renderBenefit.js +1 -0
- package/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +7 -13
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +24 -4
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
- package/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/{bundle/components/StepsBlock/renderStepContent.d.ts → dist/components/StepsBlock/renderStep.d.ts} +5 -5
- package/dist/components/StepsBlock/renderStep.js +34 -0
- package/dist/components/StepsBlock/renderStep.js.map +1 -0
- package/dist/components/Tabs/Tabs.js +4 -4
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tile/Tile.js +3 -3
- package/dist/components/Tile/Tile.js.map +1 -1
- package/dist/components/Tile/TileContent.d.ts +2 -2
- package/dist/hooks/useLink.js +2 -3
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/hooks/useRouter.d.ts +6 -2
- package/dist/hooks/useRouter.js.map +1 -1
- package/dist/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/dist/services/BlockRouter/BlockRouter.js +11 -30
- package/dist/services/BlockRouter/BlockRouter.js.map +1 -1
- package/dist/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/dist/services/BlockRouter/blockRouterEventBus.js +5 -0
- package/dist/services/BlockRouter/blockRouterEventBus.js.map +1 -0
- package/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/dist/services/BlockRouter/useBlockIntersectionObserver.js +5 -16
- package/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
- package/dist/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/dist/services/BlockRouter/useBlockRouterProvider.js +11 -12
- package/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/dist/ui-kit/BlockWrapper.js +2 -2
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/EventBus/EventBus.d.ts +1 -4
- package/lib/EventBus/EventBus.js +0 -1
- package/lib/EventBus/EventBus.js.map +1 -1
- package/lib/EventBus/defaultEventBus.d.ts +7 -0
- package/lib/EventBus/defaultEventBus.js +3 -0
- package/lib/EventBus/defaultEventBus.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/ButtonBlock/ButtonBlock.js +2 -1
- package/lib/components/ButtonBlock/ButtonBlock.js.map +1 -1
- package/lib/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/lib/components/Calculator/Rate.js +1 -1
- package/lib/components/Calculator/Rate.js.map +1 -1
- package/lib/components/Calculator/constants.js +2 -2
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/Calculator/rangeHelpers.d.ts +4 -0
- package/lib/components/Calculator/rangeHelpers.js +8 -0
- package/lib/components/Calculator/rangeHelpers.js.map +1 -0
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/lib/components/Carousel/Carousel.js +6 -4
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/PictureText/renderBenefit.js +1 -0
- package/lib/components/PictureText/renderBenefit.js.map +1 -1
- package/lib/components/ProductTile/renderBenefit.js +1 -0
- package/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.js +7 -13
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +24 -4
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
- package/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/{mobile/bundle/components/StepsBlock/renderStepContent.d.ts → lib/components/StepsBlock/renderStep.d.ts} +5 -5
- package/lib/components/StepsBlock/renderStep.js +31 -0
- package/lib/components/StepsBlock/renderStep.js.map +1 -0
- package/lib/components/Tabs/Tabs.js +4 -4
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tile/Tile.js +3 -3
- package/lib/components/Tile/Tile.js.map +1 -1
- package/lib/components/Tile/TileContent.d.ts +2 -2
- package/lib/hooks/useLink.js +2 -3
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/hooks/useRouter.d.ts +6 -2
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/lib/services/BlockRouter/BlockRouter.js +8 -28
- package/lib/services/BlockRouter/BlockRouter.js.map +1 -1
- package/lib/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/lib/services/BlockRouter/blockRouterEventBus.js +3 -0
- package/lib/services/BlockRouter/blockRouterEventBus.js.map +1 -0
- package/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/lib/services/BlockRouter/useBlockIntersectionObserver.js +6 -17
- package/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
- package/lib/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/lib/services/BlockRouter/useBlockRouterProvider.js +12 -13
- package/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/lib/ui-kit/BlockWrapper.js +2 -2
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/bundle/EventBus/EventBus.d.ts +1 -4
- package/mobile/bundle/EventBus/defaultEventBus.d.ts +7 -0
- package/mobile/bundle/bundle.umd.js +58 -66
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
- package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/mobile/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/{lib/components/StepsBlock/renderStepContent.d.ts → mobile/bundle/components/StepsBlock/renderStep.d.ts} +5 -5
- package/mobile/bundle/components/Tile/TileContent.d.ts +2 -2
- package/mobile/bundle/hooks/useRouter.d.ts +6 -2
- package/mobile/bundle/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/mobile/bundle/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/mobile/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/mobile/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/mobile/dist/EventBus/EventBus.d.ts +1 -4
- package/mobile/dist/EventBus/EventBus.js +0 -1
- package/mobile/dist/EventBus/EventBus.js.map +1 -1
- package/mobile/dist/EventBus/defaultEventBus.d.ts +7 -0
- package/mobile/dist/EventBus/defaultEventBus.js +5 -0
- package/mobile/dist/EventBus/defaultEventBus.js.map +1 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlock.js +2 -1
- package/mobile/dist/components/ButtonBlock/ButtonBlock.js.map +1 -1
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/mobile/dist/components/Calculator/Rate.js +1 -1
- package/mobile/dist/components/Calculator/Rate.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.js +2 -2
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/Calculator/rangeHelpers.d.ts +4 -0
- package/mobile/dist/components/Calculator/rangeHelpers.js +12 -0
- package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -0
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Carousel/Carousel.js +6 -4
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/PictureText/renderBenefit.js +1 -0
- package/mobile/dist/components/PictureText/renderBenefit.js.map +1 -1
- package/mobile/dist/components/ProductTile/renderBenefit.js +1 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js +24 -4
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/mobile/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
- package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/mobile/dist/components/StepsBlock/renderStep.d.ts +11 -0
- package/mobile/dist/components/StepsBlock/renderStep.js +34 -0
- package/mobile/dist/components/StepsBlock/renderStep.js.map +1 -0
- package/mobile/dist/components/Tabs/Tabs.js +4 -4
- package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
- package/mobile/dist/components/Tile/Tile.js +3 -3
- package/mobile/dist/components/Tile/Tile.js.map +1 -1
- package/mobile/dist/components/Tile/TileContent.d.ts +2 -2
- package/mobile/dist/hooks/useLink.js +2 -3
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/hooks/useRouter.d.ts +6 -2
- package/mobile/dist/hooks/useRouter.js.map +1 -1
- package/mobile/dist/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/mobile/dist/services/BlockRouter/BlockRouter.js +11 -30
- package/mobile/dist/services/BlockRouter/BlockRouter.js.map +1 -1
- package/mobile/dist/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/mobile/dist/services/BlockRouter/blockRouterEventBus.js +5 -0
- package/mobile/dist/services/BlockRouter/blockRouterEventBus.js.map +1 -0
- package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js +5 -16
- package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
- package/mobile/dist/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js +11 -12
- package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/mobile/dist/ui-kit/BlockWrapper.js +2 -2
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/EventBus/EventBus.d.ts +1 -4
- package/mobile/lib/EventBus/EventBus.js +0 -1
- package/mobile/lib/EventBus/EventBus.js.map +1 -1
- package/mobile/lib/EventBus/defaultEventBus.d.ts +7 -0
- package/mobile/lib/EventBus/defaultEventBus.js +3 -0
- package/mobile/lib/EventBus/defaultEventBus.js.map +1 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlock.js +2 -1
- package/mobile/lib/components/ButtonBlock/ButtonBlock.js.map +1 -1
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/mobile/lib/components/Calculator/Rate.js +1 -1
- package/mobile/lib/components/Calculator/Rate.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.js +2 -2
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/Calculator/rangeHelpers.d.ts +4 -0
- package/mobile/lib/components/Calculator/rangeHelpers.js +8 -0
- package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -0
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Carousel/Carousel.js +6 -4
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/PictureText/renderBenefit.js +1 -0
- package/mobile/lib/components/PictureText/renderBenefit.js.map +1 -1
- package/mobile/lib/components/ProductTile/renderBenefit.js +1 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js +24 -4
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/mobile/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
- package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/mobile/lib/components/StepsBlock/renderStep.d.ts +11 -0
- package/mobile/lib/components/StepsBlock/renderStep.js +31 -0
- package/mobile/lib/components/StepsBlock/renderStep.js.map +1 -0
- package/mobile/lib/components/Tabs/Tabs.js +4 -4
- package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/components/Tile/Tile.js +3 -3
- package/mobile/lib/components/Tile/Tile.js.map +1 -1
- package/mobile/lib/components/Tile/TileContent.d.ts +2 -2
- package/mobile/lib/hooks/useLink.js +2 -3
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/hooks/useRouter.d.ts +6 -2
- package/mobile/lib/hooks/useRouter.js.map +1 -1
- package/mobile/lib/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/mobile/lib/services/BlockRouter/BlockRouter.js +8 -28
- package/mobile/lib/services/BlockRouter/BlockRouter.js.map +1 -1
- package/mobile/lib/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/mobile/lib/services/BlockRouter/blockRouterEventBus.js +3 -0
- package/mobile/lib/services/BlockRouter/blockRouterEventBus.js.map +1 -0
- package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js +6 -17
- package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
- package/mobile/lib/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js +12 -13
- package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/mobile/lib/ui-kit/BlockWrapper.js +2 -2
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/src/EventBus/EventBus.ts +1 -7
- package/mobile/src/EventBus/defaultEventBus.ts +8 -0
- package/mobile/src/components/ButtonBlock/ButtonBlock.example.json +2 -2
- package/mobile/src/components/ButtonBlock/ButtonBlock.tsx +5 -2
- package/mobile/src/components/ButtonBlock/ButtonBlockContent.ts +5 -1
- package/mobile/src/components/Calculator/Rate.tsx +1 -1
- package/mobile/src/components/Calculator/constants.ts +2 -2
- package/mobile/src/components/Calculator/rangeHelpers.ts +24 -0
- package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
- package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
- package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
- package/mobile/src/components/Carousel/Carousel.tsx +6 -4
- package/mobile/src/components/PictureText/renderBenefit.tsx +1 -0
- package/mobile/src/components/ProductTile/renderBenefit.tsx +1 -0
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +29 -5
- package/mobile/src/components/StepsBlock/StepsBlock.ui.json +6 -0
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +13 -1
- package/mobile/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
- package/mobile/src/components/StepsBlock/renderStep.tsx +83 -0
- package/mobile/src/components/Tabs/Tabs.tsx +4 -4
- package/mobile/src/components/Tile/Tile.example.json +1 -1
- package/mobile/src/components/Tile/Tile.tsx +4 -4
- package/mobile/src/components/Tile/Tile.ui.json +7 -1
- package/mobile/src/components/Tile/TileContent.ts +2 -2
- package/mobile/src/hooks/useLink.ts +2 -3
- package/mobile/src/hooks/useRouter.ts +6 -2
- package/mobile/src/services/BlockRouter/BlockRouter.ts +8 -47
- package/mobile/src/services/BlockRouter/blockRouterEventBus.ts +13 -0
- package/mobile/src/services/BlockRouter/useBlockIntersectionObserver.ts +6 -23
- package/mobile/src/services/BlockRouter/useBlockRouterProvider.ts +13 -19
- package/mobile/src/ui-kit/BlockWrapper.tsx +2 -2
- package/package.json +1 -1
- package/src/EventBus/EventBus.ts +1 -7
- package/src/EventBus/defaultEventBus.ts +8 -0
- package/src/components/ButtonBlock/ButtonBlock.example.json +2 -2
- package/src/components/ButtonBlock/ButtonBlock.tsx +5 -2
- package/src/components/ButtonBlock/ButtonBlockContent.ts +5 -1
- package/src/components/Calculator/Rate.tsx +1 -1
- package/src/components/Calculator/constants.ts +2 -2
- package/src/components/Calculator/rangeHelpers.ts +24 -0
- package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
- package/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
- package/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
- package/src/components/Carousel/Carousel.tsx +6 -4
- package/src/components/PictureText/renderBenefit.tsx +1 -0
- package/src/components/ProductTile/renderBenefit.tsx +1 -0
- package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +19 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +10 -3
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +29 -5
- package/src/components/StepsBlock/StepsBlock.tsx +28 -16
- package/src/components/StepsBlock/StepsBlock.ui.json +6 -0
- package/src/components/StepsBlock/StepsBlockContent.ts +13 -1
- package/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
- package/src/components/StepsBlock/renderStep.tsx +83 -0
- package/src/components/Tabs/Tabs.tsx +4 -4
- package/src/components/Tile/Tile.example.json +1 -1
- package/src/components/Tile/Tile.fixture.tsx +2 -2
- package/src/components/Tile/Tile.tsx +4 -4
- package/src/components/Tile/Tile.ui.json +7 -1
- package/src/components/Tile/TileContent.ts +2 -2
- package/src/hooks/useLink.ts +2 -3
- package/src/hooks/useRouter.ts +6 -2
- package/src/services/BlockRouter/BlockRouter.ts +8 -47
- package/src/services/BlockRouter/blockRouterEventBus.ts +13 -0
- package/src/services/BlockRouter/useBlockIntersectionObserver.ts +6 -23
- package/src/services/BlockRouter/useBlockRouterProvider.ts +13 -19
- package/src/ui-kit/BlockWrapper.tsx +2 -2
- package/bundle/EventBus/EventMap.d.ts +0 -4
- package/bundle/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/bundle/utils/checkIsIconRenderable.d.ts +0 -2
- package/dist/EventBus/EventMap.d.ts +0 -4
- package/dist/EventBus/EventMap.js +0 -2
- package/dist/EventBus/EventMap.js.map +0 -1
- package/dist/components/StepsBlock/renderStepContent.js +0 -19
- package/dist/components/StepsBlock/renderStepContent.js.map +0 -1
- package/dist/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/dist/services/BlockRouter/useBlockRouter.js +0 -8
- package/dist/services/BlockRouter/useBlockRouter.js.map +0 -1
- package/dist/utils/checkIsIconRenderable.d.ts +0 -2
- package/dist/utils/checkIsIconRenderable.js +0 -5
- package/dist/utils/checkIsIconRenderable.js.map +0 -1
- package/lib/EventBus/EventMap.d.ts +0 -4
- package/lib/EventBus/EventMap.js +0 -2
- package/lib/EventBus/EventMap.js.map +0 -1
- package/lib/components/StepsBlock/renderStepContent.js +0 -16
- package/lib/components/StepsBlock/renderStepContent.js.map +0 -1
- package/lib/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/lib/services/BlockRouter/useBlockRouter.js +0 -5
- package/lib/services/BlockRouter/useBlockRouter.js.map +0 -1
- package/lib/utils/checkIsIconRenderable.d.ts +0 -2
- package/lib/utils/checkIsIconRenderable.js +0 -2
- package/lib/utils/checkIsIconRenderable.js.map +0 -1
- package/mobile/bundle/EventBus/EventMap.d.ts +0 -4
- package/mobile/bundle/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/mobile/bundle/utils/checkIsIconRenderable.d.ts +0 -2
- package/mobile/dist/EventBus/EventMap.d.ts +0 -4
- package/mobile/dist/EventBus/EventMap.js +0 -2
- package/mobile/dist/EventBus/EventMap.js.map +0 -1
- package/mobile/dist/components/StepsBlock/renderStepContent.d.ts +0 -11
- package/mobile/dist/components/StepsBlock/renderStepContent.js +0 -19
- package/mobile/dist/components/StepsBlock/renderStepContent.js.map +0 -1
- package/mobile/dist/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/mobile/dist/services/BlockRouter/useBlockRouter.js +0 -8
- package/mobile/dist/services/BlockRouter/useBlockRouter.js.map +0 -1
- package/mobile/dist/utils/checkIsIconRenderable.d.ts +0 -2
- package/mobile/dist/utils/checkIsIconRenderable.js +0 -5
- package/mobile/dist/utils/checkIsIconRenderable.js.map +0 -1
- package/mobile/lib/EventBus/EventMap.d.ts +0 -4
- package/mobile/lib/EventBus/EventMap.js +0 -2
- package/mobile/lib/EventBus/EventMap.js.map +0 -1
- package/mobile/lib/components/StepsBlock/renderStepContent.d.ts +0 -11
- package/mobile/lib/components/StepsBlock/renderStepContent.js +0 -16
- package/mobile/lib/components/StepsBlock/renderStepContent.js.map +0 -1
- package/mobile/lib/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/mobile/lib/services/BlockRouter/useBlockRouter.js +0 -5
- package/mobile/lib/services/BlockRouter/useBlockRouter.js.map +0 -1
- package/mobile/lib/utils/checkIsIconRenderable.d.ts +0 -2
- package/mobile/lib/utils/checkIsIconRenderable.js +0 -2
- package/mobile/lib/utils/checkIsIconRenderable.js.map +0 -1
- package/mobile/src/EventBus/EventMap.ts +0 -5
- package/mobile/src/components/StepsBlock/renderStepContent.tsx +0 -83
- package/mobile/src/services/BlockRouter/useBlockRouter.ts +0 -5
- package/mobile/src/utils/checkIsIconRenderable.tsx +0 -3
- package/src/EventBus/EventMap.ts +0 -5
- package/src/components/StepsBlock/renderStepContent.tsx +0 -83
- package/src/services/BlockRouter/useBlockRouter.ts +0 -5
- package/src/utils/checkIsIconRenderable.tsx +0 -3
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import '../../setup-fixture';
|
|
2
2
|
import { StepsBlock } from './StepsBlock';
|
|
3
|
+
import type { Step } from './StepsBlockContent';
|
|
3
4
|
|
|
4
|
-
const steps = [
|
|
5
|
+
const steps: Step[] = [
|
|
5
6
|
{
|
|
7
|
+
type: 'default',
|
|
6
8
|
label: 'Заявка на кредит',
|
|
7
9
|
description: 'Оставьте онлайн-заявку на потребительский кредит',
|
|
8
10
|
},
|
|
9
11
|
{
|
|
12
|
+
type: 'default',
|
|
10
13
|
label: 'В случае одобрения',
|
|
11
14
|
description: 'Менеджер свяжется с вами и согласует встречу',
|
|
12
15
|
},
|
|
13
16
|
{
|
|
17
|
+
type: 'default',
|
|
14
18
|
label: 'Получение наличных',
|
|
15
19
|
description: 'Получите наличные в отделении банка',
|
|
16
20
|
},
|
|
@@ -49,19 +53,23 @@ export default {
|
|
|
49
53
|
size="small"
|
|
50
54
|
steps={[
|
|
51
55
|
{
|
|
56
|
+
type: 'default',
|
|
52
57
|
description: 'Оставьте онлайн-заявку на потребительский кредит',
|
|
53
58
|
icon: { icon: 'ClockIcon' },
|
|
54
59
|
},
|
|
55
60
|
{
|
|
61
|
+
type: 'default',
|
|
56
62
|
label: 'В случае одобрения',
|
|
57
63
|
icon: { icon: 'SignDocsIcon' },
|
|
58
64
|
},
|
|
59
65
|
{
|
|
66
|
+
type: 'default',
|
|
60
67
|
label: 'Заявка на кредит',
|
|
61
68
|
description: 'Оставьте онлайн-заявку на потребительский кредит',
|
|
62
69
|
icon: { icon: 'ComfortableCompIcon' },
|
|
63
70
|
},
|
|
64
71
|
{
|
|
72
|
+
type: 'default',
|
|
65
73
|
label: 'Получение наличных',
|
|
66
74
|
icon: { icon: 'ClockIcon' },
|
|
67
75
|
},
|
|
@@ -78,14 +86,17 @@ export default {
|
|
|
78
86
|
size="small"
|
|
79
87
|
steps={[
|
|
80
88
|
{
|
|
89
|
+
type: 'default',
|
|
81
90
|
label: 'Заявка на кредит',
|
|
82
91
|
icon: { icon: 'EmptyWalletIcon' },
|
|
83
92
|
},
|
|
84
93
|
{
|
|
94
|
+
type: 'default',
|
|
85
95
|
label: 'В случае одобрения',
|
|
86
96
|
icon: { icon: 'PercentageSquareIcon' },
|
|
87
97
|
},
|
|
88
98
|
{
|
|
99
|
+
type: 'default',
|
|
89
100
|
label: 'Получение наличных',
|
|
90
101
|
icon: { icon: 'CalendarIcon' },
|
|
91
102
|
},
|
|
@@ -128,19 +139,23 @@ export default {
|
|
|
128
139
|
size="small"
|
|
129
140
|
steps={[
|
|
130
141
|
{
|
|
142
|
+
type: 'default',
|
|
131
143
|
description: 'Оставьте онлайн-заявку на потребительский кредит',
|
|
132
144
|
icon: { icon: 'ClockIcon', iconVersion: 'normal' },
|
|
133
145
|
},
|
|
134
146
|
{
|
|
147
|
+
type: 'default',
|
|
135
148
|
label: 'В случае одобрения',
|
|
136
149
|
icon: { icon: 'SignDocsIcon', iconVersion: 'normal' },
|
|
137
150
|
},
|
|
138
151
|
{
|
|
152
|
+
type: 'default',
|
|
139
153
|
label: 'Заявка на кредит',
|
|
140
154
|
description: 'Оставьте онлайн-заявку на потребительский кредит',
|
|
141
155
|
icon: { icon: 'ComfortableCompIcon', iconVersion: 'normal' },
|
|
142
156
|
},
|
|
143
157
|
{
|
|
158
|
+
type: 'default',
|
|
144
159
|
label: 'Получение наличных',
|
|
145
160
|
icon: { icon: 'ClockIcon', iconVersion: 'normal' },
|
|
146
161
|
},
|
|
@@ -158,14 +173,17 @@ export default {
|
|
|
158
173
|
size="small"
|
|
159
174
|
steps={[
|
|
160
175
|
{
|
|
176
|
+
type: 'default',
|
|
161
177
|
label: 'Заявка на кредит',
|
|
162
178
|
icon: { icon: 'EmptyWalletIcon' },
|
|
163
179
|
},
|
|
164
180
|
{
|
|
181
|
+
type: 'default',
|
|
165
182
|
label: 'В случае одобрения',
|
|
166
183
|
icon: { icon: 'PercentageSquareIcon' },
|
|
167
184
|
},
|
|
168
185
|
{
|
|
186
|
+
type: 'default',
|
|
169
187
|
label: 'Получение наличных',
|
|
170
188
|
icon: { icon: 'CalendarIcon' },
|
|
171
189
|
},
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import '../../setup-fixture';
|
|
2
2
|
import type { StepsBlockProps } from './StepsBlock';
|
|
3
3
|
import { StepsBlock } from './StepsBlock';
|
|
4
|
-
import type { Step } from './StepsBlockContent';
|
|
4
|
+
import type { DefaultStep, Step } from './StepsBlockContent';
|
|
5
5
|
|
|
6
6
|
const TITLE =
|
|
7
7
|
'Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит';
|
|
8
8
|
|
|
9
|
-
const ITEMS:
|
|
9
|
+
const ITEMS: DefaultStep['items'] = ['item1', 'item2', 'item3', 'item4', 'item5'];
|
|
10
10
|
const COMMON_PROPS: StepsBlockProps = {
|
|
11
11
|
className: 'col-span-12',
|
|
12
12
|
title: TITLE,
|
|
@@ -14,18 +14,22 @@ const COMMON_PROPS: StepsBlockProps = {
|
|
|
14
14
|
|
|
15
15
|
const STEPS: Step[] = [
|
|
16
16
|
{
|
|
17
|
+
type: 'default',
|
|
17
18
|
label: 'Заявка на кредит',
|
|
18
19
|
description: 'Оставьте онлайн-заявку на потребительский кредит',
|
|
19
20
|
},
|
|
20
21
|
{
|
|
22
|
+
type: 'default',
|
|
21
23
|
label: 'В случае одобрения',
|
|
22
24
|
description: 'Менеджер свяжется с вами и согласует встречу',
|
|
23
25
|
},
|
|
24
26
|
{
|
|
27
|
+
type: 'default',
|
|
25
28
|
label: 'Получение наличных',
|
|
26
29
|
description: 'Получите наличные в отделении банка',
|
|
27
30
|
},
|
|
28
31
|
{
|
|
32
|
+
type: 'default',
|
|
29
33
|
label: 'Последний шаг!',
|
|
30
34
|
description: 'Получите наличные в отделении банка',
|
|
31
35
|
},
|
|
@@ -33,23 +37,26 @@ const STEPS: Step[] = [
|
|
|
33
37
|
|
|
34
38
|
const STEPS_WITH_ICONS: Step[] = [
|
|
35
39
|
{
|
|
40
|
+
type: 'default',
|
|
36
41
|
label: 'В мобильном приложении или интернет-банке',
|
|
37
42
|
description: 'Для всех клиентов Россельхозбанка',
|
|
38
43
|
icon: { icon: 'SignDocsIcon', iconVersion: 'normal' },
|
|
39
44
|
},
|
|
40
45
|
{
|
|
46
|
+
type: 'default',
|
|
41
47
|
label: 'Через Госуслуги',
|
|
42
48
|
description: 'При наличии данных в Единой биометрической системе',
|
|
43
49
|
icon: { icon: 'ClockIcon', iconVersion: 'normal' },
|
|
44
50
|
},
|
|
45
51
|
{
|
|
52
|
+
type: 'default',
|
|
46
53
|
label: 'В офисах Россельхозбанка',
|
|
47
54
|
description: 'Откройте вклад',
|
|
48
55
|
icon: { icon: 'ComfortableCompIcon', iconVersion: 'normal' },
|
|
49
56
|
},
|
|
50
57
|
];
|
|
51
58
|
|
|
52
|
-
const BUTTONS:
|
|
59
|
+
const BUTTONS: DefaultStep['button'][] = [
|
|
53
60
|
{ text: 'Войти в интернет-банк' },
|
|
54
61
|
{ text: 'Оформить' },
|
|
55
62
|
{ text: 'Офисы на карте' },
|
|
@@ -5,9 +5,11 @@ import type { SizeVersion } from '../../model/SizeVersion';
|
|
|
5
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
6
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
7
7
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
|
-
import {
|
|
8
|
+
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
9
|
+
import { assertUnreachable } from '../../utils/assertUnreachable';
|
|
9
10
|
import { getIconWithVersion } from '../../utils/getIconWithVersion';
|
|
10
|
-
import
|
|
11
|
+
import { checkCanRenderIcon } from './checkCanRenderIcon';
|
|
12
|
+
import type { DefaultStep, Step, StepsBlockContent } from './StepsBlockContent';
|
|
11
13
|
import { STEPS_BLOCK_STYLE_MAPS } from './StepsBlockStyleMaps';
|
|
12
14
|
|
|
13
15
|
export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
|
|
@@ -50,7 +52,7 @@ export const StepsBlock = JSX<StepsBlockProps>(
|
|
|
50
52
|
{steps?.length ? (
|
|
51
53
|
<div className={`box-border py-0.5 mb-0.5 mt-5`}>
|
|
52
54
|
<div className="flex flex-col justify-between gap-x-[101px]">
|
|
53
|
-
{steps.map(
|
|
55
|
+
{steps.map(renderStep(size, version, showLines))}
|
|
54
56
|
</div>
|
|
55
57
|
</div>
|
|
56
58
|
) : null}
|
|
@@ -59,9 +61,31 @@ export const StepsBlock = JSX<StepsBlockProps>(
|
|
|
59
61
|
},
|
|
60
62
|
);
|
|
61
63
|
|
|
62
|
-
|
|
64
|
+
// TODO: Create universal function for this case
|
|
65
|
+
const renderStep =
|
|
63
66
|
(size: SizeVersion, version: BlockVersion, showLines: boolean) =>
|
|
67
|
+
// Linter doesn't understand that switch processes all cases
|
|
68
|
+
// eslint-disable-next-line consistent-return
|
|
64
69
|
(step: Step, i: number, steps: Step[]) => {
|
|
70
|
+
const { type } = step;
|
|
71
|
+
|
|
72
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
switch (type) {
|
|
77
|
+
case 'default':
|
|
78
|
+
return renderDefaultStep(size, version, showLines)(step, i, steps);
|
|
79
|
+
case 'rte':
|
|
80
|
+
return <RichText __html={step.__html} />;
|
|
81
|
+
default:
|
|
82
|
+
assertUnreachable(step);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const renderDefaultStep =
|
|
87
|
+
(size: SizeVersion, version: BlockVersion, showLines: boolean) =>
|
|
88
|
+
(step: DefaultStep, i: number, steps: Step[]) => {
|
|
65
89
|
const isLastStep = steps.length - 1 === i;
|
|
66
90
|
const margin = size === 'normal' ? 'ml-[34px]' : 'ml-6';
|
|
67
91
|
const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
|
|
@@ -106,7 +130,7 @@ const renderIconArea = (size: SizeVersion, version: BlockVersion) => (step: Step
|
|
|
106
130
|
className={`${iconAreaSize} ${styleMap.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`}
|
|
107
131
|
>
|
|
108
132
|
<span className={`font-medium flex self-center ${iconTextSize}`}>
|
|
109
|
-
{
|
|
133
|
+
{checkCanRenderIcon(step?.icon) ? (
|
|
110
134
|
<Img
|
|
111
135
|
image={getIconWithVersion({ ...step.icon }, version)}
|
|
112
136
|
width={iconSize}
|
|
@@ -5,10 +5,11 @@ import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
|
5
5
|
import { Button } from '../../ui-kit/Button/Button';
|
|
6
6
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
7
7
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
|
-
import { checkIsIconRenderable } from '../../utils/checkIsIconRenderable';
|
|
9
8
|
import { getIconWithVersion } from '../../utils/getIconWithVersion';
|
|
10
9
|
import { joinList } from '../../utils/joinList';
|
|
11
|
-
import {
|
|
10
|
+
import { style } from '../../utils/style';
|
|
11
|
+
import { checkCanRenderIcon } from './checkCanRenderIcon';
|
|
12
|
+
import { renderStep } from './renderStep';
|
|
12
13
|
import type { Step, StepsBlockContent } from './StepsBlockContent';
|
|
13
14
|
import type { StyleType } from './StepsBlockStyleMaps';
|
|
14
15
|
import { STEPS_BLOCK_STYLE_MAPS } from './StepsBlockStyleMaps';
|
|
@@ -20,39 +21,50 @@ const getLineOpacity = (showLines: boolean) => (showLines ? '' : 'opacity-0');
|
|
|
20
21
|
const getPaddingX = (steps: number) => (steps < 5 ? 'px-[88px]' : 'px-[55px]');
|
|
21
22
|
|
|
22
23
|
export const StepsBlock = JSX<StepsBlockProps>(
|
|
23
|
-
({
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
({
|
|
25
|
+
className = '',
|
|
26
|
+
showLines = true,
|
|
27
|
+
steps = [],
|
|
28
|
+
button,
|
|
29
|
+
version = 'primary',
|
|
30
|
+
title,
|
|
31
|
+
...rest
|
|
32
|
+
}) => {
|
|
26
33
|
const shortGaps = steps.length > 3;
|
|
34
|
+
|
|
35
|
+
const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
|
|
36
|
+
|
|
27
37
|
const lineOpacity = getLineOpacity(showLines);
|
|
28
|
-
const titleMargin = title ? 'mt-9' : '';
|
|
29
38
|
const paddingX = getPaddingX(steps.length);
|
|
30
39
|
|
|
31
40
|
return (
|
|
32
41
|
<BlockWrapper
|
|
33
|
-
className={
|
|
42
|
+
className={style(
|
|
34
43
|
'box-border py-12',
|
|
35
44
|
shortGaps ? 'px-20' : 'px-[70px]',
|
|
36
45
|
'flex flex-col items-center overflow-hidden',
|
|
37
46
|
className,
|
|
38
|
-
|
|
47
|
+
)}
|
|
39
48
|
version={version}
|
|
40
49
|
{...rest}
|
|
41
50
|
>
|
|
42
51
|
{title ? (
|
|
43
|
-
<Heading headingType="h3" className="max-w-[752px] text-center" title={title} />
|
|
52
|
+
<Heading headingType="h3" className="max-w-[752px] text-center mb-9" title={title} />
|
|
44
53
|
) : null}
|
|
45
54
|
{steps?.length ? (
|
|
46
|
-
<div className=
|
|
47
|
-
<div className={
|
|
48
|
-
{joinList(<div className={
|
|
55
|
+
<div className="box-border">
|
|
56
|
+
<div className={style('flex items-center', paddingX)}>
|
|
57
|
+
{joinList(<div className={style('h-0.5 w-full bg-secondary-light', lineOpacity)} />)(
|
|
49
58
|
steps.map(renderStepIcon(styleMap, version)),
|
|
50
59
|
)}
|
|
51
60
|
</div>
|
|
52
|
-
<div
|
|
53
|
-
{
|
|
54
|
-
|
|
61
|
+
<div
|
|
62
|
+
className={style(
|
|
63
|
+
'flex justify-between mt-4',
|
|
64
|
+
shortGaps ? 'gap-x-3' : 'gap-x-[101px]',
|
|
55
65
|
)}
|
|
66
|
+
>
|
|
67
|
+
{steps.map(renderStep({ styleMap, isMainButton: Boolean(button?.text), version }))}
|
|
56
68
|
</div>
|
|
57
69
|
</div>
|
|
58
70
|
) : null}
|
|
@@ -70,7 +82,7 @@ const renderStepIcon =
|
|
|
70
82
|
<div
|
|
71
83
|
className={`h-[100px] w-[100px] min-w-[100px] min-h-[100px] rounded-full p-[26px] box-border z-10 flex justify-center items-center ${styleMap.iconBackground}`}
|
|
72
84
|
>
|
|
73
|
-
{
|
|
85
|
+
{checkCanRenderIcon(icon) ? (
|
|
74
86
|
<Img image={getIconWithVersion(icon || {}, version)} width="48" height="48" asSVG />
|
|
75
87
|
) : (
|
|
76
88
|
<span className={`text-h4 ${styleMap.iconText}`}>{i + 1}</span>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { DefaultListItemType } from '../../model/DefaultListItemType';
|
|
2
3
|
import type { DescriptionProps, HeadlineCommonProps, LabelProps } from '../../model/HeadlineType';
|
|
3
4
|
import type { IconProps } from '../../model/Picture';
|
|
5
|
+
import type { RichTextItem } from '../../model/RichTextItem';
|
|
4
6
|
import type { SizeVersion } from '../../model/SizeVersion';
|
|
5
7
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
6
8
|
|
|
@@ -16,10 +18,20 @@ type StepCommonProps = IconProps & {
|
|
|
16
18
|
items?: string[];
|
|
17
19
|
};
|
|
18
20
|
|
|
21
|
+
/**
|
|
22
|
+
* @title Стандартный
|
|
23
|
+
*/
|
|
24
|
+
export type DefaultStep = DescriptionProps & LabelProps & StepCommonProps & DefaultListItemType;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @title Форматированный текст
|
|
28
|
+
*/
|
|
29
|
+
type RichTextStep = RichTextItem & IconProps;
|
|
30
|
+
|
|
19
31
|
/**
|
|
20
32
|
* @title Шаг
|
|
21
33
|
*/
|
|
22
|
-
export type Step =
|
|
34
|
+
export type Step = DefaultStep | RichTextStep;
|
|
23
35
|
|
|
24
36
|
/**
|
|
25
37
|
* @title Блок шаги
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { ButtonVersion } from '../../model/ButtonVersion';
|
|
3
|
+
import type { VNode } from '../../model/VNode';
|
|
4
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
5
|
+
import { List } from '../../ui-kit/List/List';
|
|
6
|
+
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
7
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
8
|
+
import { assertUnreachable } from '../../utils/assertUnreachable';
|
|
9
|
+
import { style } from '../../utils/style';
|
|
10
|
+
import type { DefaultStep, Step } from './StepsBlockContent';
|
|
11
|
+
import type { StyleType } from './StepsBlockStyleMaps';
|
|
12
|
+
|
|
13
|
+
interface RenderStepProps {
|
|
14
|
+
styleMap: StyleType;
|
|
15
|
+
isMainButton: boolean;
|
|
16
|
+
version?: BlockVersion;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// TODO: Create universal function for this case
|
|
20
|
+
export const renderStep =
|
|
21
|
+
(props: RenderStepProps) =>
|
|
22
|
+
// Linter doesn't understand that switch processes all cases
|
|
23
|
+
// eslint-disable-next-line consistent-return
|
|
24
|
+
(step: Step, i: number, arr: Step[]): VNode => {
|
|
25
|
+
const { type } = step;
|
|
26
|
+
|
|
27
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
switch (type) {
|
|
32
|
+
case 'default':
|
|
33
|
+
return renderDefaultStep(props)(step, i, arr);
|
|
34
|
+
case 'rte':
|
|
35
|
+
return <RichText __html={step.__html} />;
|
|
36
|
+
default:
|
|
37
|
+
assertUnreachable(step);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const renderDefaultStep =
|
|
42
|
+
({ styleMap, isMainButton, version }: RenderStepProps) =>
|
|
43
|
+
(step: DefaultStep, i: number, arr: Step[]) => {
|
|
44
|
+
const { label, description, button, items, isDotted } = step;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div
|
|
48
|
+
key={String(i)}
|
|
49
|
+
className={style(
|
|
50
|
+
'relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden',
|
|
51
|
+
getContainerWidth(arr.length),
|
|
52
|
+
)}
|
|
53
|
+
>
|
|
54
|
+
<div className={style(button?.text ? 'mb-8' : '', 'text-center')}>
|
|
55
|
+
{label ? (
|
|
56
|
+
<div className="mb-2">
|
|
57
|
+
<Text size="text-h6">{label}</Text>
|
|
58
|
+
</div>
|
|
59
|
+
) : null}
|
|
60
|
+
<div className="flex flex-col items-center">
|
|
61
|
+
{description ? <div className={styleMap.description}>{description}</div> : null}
|
|
62
|
+
<List
|
|
63
|
+
className={style(description ? `${styleMap.description} mt-0.5` : 'text-h6')}
|
|
64
|
+
items={items}
|
|
65
|
+
listItemSize="M"
|
|
66
|
+
isDotted={isDotted}
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
{button?.text && !isMainButton ? (
|
|
71
|
+
<Button
|
|
72
|
+
className="box-border py-3 h-12 w-full max-w-[240px] mt-auto"
|
|
73
|
+
version={version as ButtonVersion}
|
|
74
|
+
{...button}
|
|
75
|
+
>
|
|
76
|
+
{button?.text}
|
|
77
|
+
</Button>
|
|
78
|
+
) : null}
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const getContainerWidth = (length: number): string => (length < 5 ? 'w-[276px]' : 'w-[210px]');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
-
import {
|
|
3
|
+
import { defaultEventBus } from '../../EventBus/defaultEventBus';
|
|
4
4
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
5
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
6
|
import { renderTab } from './renderTab';
|
|
@@ -21,7 +21,7 @@ export const Tabs = JSX<TabsBlockProps>((props) => {
|
|
|
21
21
|
|
|
22
22
|
useEffect(
|
|
23
23
|
() =>
|
|
24
|
-
|
|
24
|
+
defaultEventBus.subscribe('tab', (event) => {
|
|
25
25
|
const tab = tabs?.find(checkTab(event));
|
|
26
26
|
if (event.type === 'link' && tab) {
|
|
27
27
|
setCurrentTab(tab);
|
|
@@ -35,14 +35,14 @@ export const Tabs = JSX<TabsBlockProps>((props) => {
|
|
|
35
35
|
useEffect(
|
|
36
36
|
() =>
|
|
37
37
|
currentTab?.type === 'group'
|
|
38
|
-
?
|
|
38
|
+
? defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref })
|
|
39
39
|
: undefined,
|
|
40
40
|
[currentTab],
|
|
41
41
|
);
|
|
42
42
|
|
|
43
43
|
const handleClick = useCallback((selectedTab: TabData) => {
|
|
44
44
|
if (selectedTab?.type === 'group') {
|
|
45
|
-
|
|
45
|
+
defaultEventBus.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
|
|
46
46
|
}
|
|
47
47
|
setCurrentTab(selectedTab);
|
|
48
48
|
}, []);
|
|
@@ -46,8 +46,8 @@ export const TILE: TileContent = {
|
|
|
46
46
|
export const TILE_PREMIUM: TileContent = {
|
|
47
47
|
title: 'Премиальные продукты',
|
|
48
48
|
headingType: 'h4',
|
|
49
|
-
|
|
50
|
-
'
|
|
49
|
+
__html:
|
|
50
|
+
'<p>Выделенные зоны обслуживания и персональный финансовый консультант. <strong>Полный спектр</strong> премиальных продуктов, <u>подчеркивающих</u> ваш статус</p>',
|
|
51
51
|
buttons: [
|
|
52
52
|
{
|
|
53
53
|
href: 'https://rshb.ru',
|
|
@@ -5,7 +5,7 @@ import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
|
5
5
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
6
|
import { Img } from '../../ui-kit/Img/Img';
|
|
7
7
|
import { List } from '../../ui-kit/List/List';
|
|
8
|
-
import {
|
|
8
|
+
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
9
9
|
import { Tags } from '../../ui-kit/Tags/Tags';
|
|
10
10
|
import { BaseTile } from '../BaseTile/BaseTile';
|
|
11
11
|
import { getTileMinHeight } from '../BaseTile/getTileMinHeight';
|
|
@@ -18,7 +18,7 @@ export const Tile = JSX<TileProps>(
|
|
|
18
18
|
({
|
|
19
19
|
title,
|
|
20
20
|
headingType = 'h3',
|
|
21
|
-
|
|
21
|
+
__html,
|
|
22
22
|
items,
|
|
23
23
|
buttons,
|
|
24
24
|
image,
|
|
@@ -52,9 +52,9 @@ export const Tile = JSX<TileProps>(
|
|
|
52
52
|
})}
|
|
53
53
|
image={image?.src ? <Img className="mt-auto ml-7" image={image} /> : null}
|
|
54
54
|
>
|
|
55
|
-
{
|
|
55
|
+
{__html ? (
|
|
56
56
|
<div className="max-w-[600px] mt-2.5">
|
|
57
|
-
<
|
|
57
|
+
<RichText __html={__html} />
|
|
58
58
|
</div>
|
|
59
59
|
) : null}
|
|
60
60
|
{children}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
-
import type { DescriptionProps } from '../../model/HeadlineType';
|
|
3
2
|
import type { Picture } from '../../model/Picture';
|
|
4
3
|
import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
|
|
5
4
|
import type { HeadingCommonProps } from '../../ui-kit/Heading/HeadingProps';
|
|
6
5
|
import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
7
6
|
import type { ListItemSize } from '../../ui-kit/List/ListProps';
|
|
7
|
+
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
8
8
|
import type { TagsContent } from '../../ui-kit/Tags/TagsContent';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @title Плитка
|
|
12
12
|
*/
|
|
13
13
|
export type TileContent = HeadingCommonProps &
|
|
14
|
-
|
|
14
|
+
RichTextProps &
|
|
15
15
|
ListContent &
|
|
16
16
|
ButtonContent &
|
|
17
17
|
TagsContent & {
|
package/src/hooks/useLink.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LinkProps } from '../model/LinkProps';
|
|
2
2
|
import { projectSettings } from '../ProjectSettings';
|
|
3
|
-
import {
|
|
3
|
+
import { gotoBlock } from '../services/BlockRouter/BlockRouter';
|
|
4
4
|
import { isHash, isLocalURL, joinPath } from '../utils/url';
|
|
5
5
|
import { handlerDecorator } from './handlerDecorator';
|
|
6
6
|
import { useRouter } from './useRouter';
|
|
@@ -15,7 +15,6 @@ interface Clickable {
|
|
|
15
15
|
|
|
16
16
|
export function useLink(isRemote?: boolean) {
|
|
17
17
|
const router = useRouter();
|
|
18
|
-
const blockRouter = useBlockRouter();
|
|
19
18
|
|
|
20
19
|
return <L extends Partial<LinkProps & Clickable>>(props: L): L & Clickable => ({
|
|
21
20
|
...props,
|
|
@@ -44,7 +43,7 @@ export function useLink(isRemote?: boolean) {
|
|
|
44
43
|
// Client routing
|
|
45
44
|
ev?.preventDefault();
|
|
46
45
|
if (isHash(href)) {
|
|
47
|
-
|
|
46
|
+
gotoBlock(router, href);
|
|
48
47
|
} else if (href) {
|
|
49
48
|
router.push(href);
|
|
50
49
|
}
|
package/src/hooks/useRouter.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
interface RouterOptions {
|
|
2
|
+
scroll?: boolean;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
export interface Router {
|
|
2
6
|
pathname: string;
|
|
3
7
|
query: Record<string, string | string[] | undefined>;
|
|
4
8
|
href?: string;
|
|
5
9
|
basePath?: string;
|
|
6
|
-
push: (url: string) => void;
|
|
7
|
-
replace: (url: string) => void;
|
|
10
|
+
push: (url: string, as?: string, options?: RouterOptions) => void;
|
|
11
|
+
replace: (url: string, as?: string, options?: RouterOptions) => void;
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
export function useRouter(): Router {
|