@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,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
|
}, []);
|
|
@@ -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 & {
|
|
@@ -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
|
}
|
|
@@ -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 {
|
|
@@ -1,53 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Router } from '../../hooks/useRouter';
|
|
2
2
|
import type { BlockDef } from '../../model/ContentPageDef';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
anchor: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface BlockIntersectionEvent {
|
|
9
|
-
block: BlockDef;
|
|
10
|
-
intersection: IntersectionObserverEntry;
|
|
11
|
-
}
|
|
4
|
+
const normalizeAnchor = (anchor?: string) => anchor?.replace('#', '') || '';
|
|
12
5
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
intersection: BlockIntersectionEvent;
|
|
6
|
+
export function gotoBlock(router: Router, anchor?: string) {
|
|
7
|
+
router.replace(`#${normalizeAnchor(anchor)}`);
|
|
16
8
|
}
|
|
17
9
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export class BlockRouter {
|
|
23
|
-
public static readonly inst = new BlockRouter();
|
|
24
|
-
|
|
25
|
-
readonly eventBus = new EventBus<EventMap>();
|
|
26
|
-
|
|
27
|
-
constructor() {
|
|
28
|
-
const anchor = normalizeAnchor(globalThis.location?.hash);
|
|
29
|
-
if (anchor) {
|
|
30
|
-
this.eventBus.subject('goto', { anchor });
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
goto(rawAnchor?: string) {
|
|
35
|
-
const anchor = normalizeAnchor(rawAnchor);
|
|
36
|
-
if (anchor) {
|
|
37
|
-
this.push(anchor);
|
|
38
|
-
this.eventBus.fire('goto', { anchor });
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
push(rawAnchor: string) {
|
|
43
|
-
globalThis.history?.pushState(null, '', getURLWithAnchor(rawAnchor));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
replace(rawAnchor: string) {
|
|
47
|
-
globalThis.history?.replaceState(null, '', getURLWithAnchor(rawAnchor));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
reset() {
|
|
51
|
-
globalThis.history?.replaceState(null, '', getURLWithAnchor());
|
|
52
|
-
}
|
|
10
|
+
export function trackBlock(router: Router, block?: BlockDef) {
|
|
11
|
+
router.replace(`#${normalizeAnchor(block?.anchor)}`, undefined, {
|
|
12
|
+
scroll: false,
|
|
13
|
+
});
|
|
53
14
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EventBus } from '../../EventBus/EventBus';
|
|
2
|
+
import type { BlockDef } from '../../model/ContentPageDef';
|
|
3
|
+
|
|
4
|
+
export interface BlockIntersectionEvent {
|
|
5
|
+
block: BlockDef;
|
|
6
|
+
intersection: IntersectionObserverEntry;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface EventMap {
|
|
10
|
+
intersection: BlockIntersectionEvent;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const blockRouterEventBus = new EventBus<EventMap>();
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { useCallback
|
|
1
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
2
|
import { useIntersectionObserver } from '../../hooks/useIntersectionObserver';
|
|
3
3
|
import type { BlockDef } from '../../model/ContentPageDef';
|
|
4
|
-
import {
|
|
4
|
+
import { blockRouterEventBus } from './blockRouterEventBus';
|
|
5
5
|
|
|
6
|
-
export function useBlockIntersectionObserver(
|
|
7
|
-
block?: BlockDef,
|
|
8
|
-
router: BlockRouter = BlockRouter.inst,
|
|
9
|
-
) {
|
|
6
|
+
export function useBlockIntersectionObserver(block?: BlockDef) {
|
|
10
7
|
const observerCallback = useCallback(
|
|
11
8
|
(entries: IntersectionObserverEntry[]) => {
|
|
12
9
|
if (!block || !entries?.length) {
|
|
@@ -14,24 +11,10 @@ export function useBlockIntersectionObserver(
|
|
|
14
11
|
}
|
|
15
12
|
|
|
16
13
|
const intersection = entries[entries.length - 1];
|
|
17
|
-
|
|
14
|
+
blockRouterEventBus.fire('intersection', { block, intersection });
|
|
18
15
|
},
|
|
19
|
-
[block
|
|
16
|
+
[block],
|
|
20
17
|
);
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (!ref.current) {
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return router.eventBus.subscribe('goto', ({ anchor }) => {
|
|
30
|
-
if (ref.current && block?.anchor === anchor) {
|
|
31
|
-
ref.current.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}, [block, router]);
|
|
35
|
-
|
|
36
|
-
return ref;
|
|
19
|
+
return useIntersectionObserver(observerCallback, { sensitivity: 1 });
|
|
37
20
|
}
|
|
@@ -1,41 +1,35 @@
|
|
|
1
1
|
import { useEffect, useRef } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useRouter } from '../../hooks/useRouter';
|
|
2
3
|
import type { BlockDef } from '../../model/ContentPageDef';
|
|
3
4
|
import { debounce } from '../../utils/debounce';
|
|
4
|
-
import {
|
|
5
|
+
import { trackBlock } from './BlockRouter';
|
|
6
|
+
import { blockRouterEventBus } from './blockRouterEventBus';
|
|
5
7
|
import { findActiveBlock } from './findActiveBlock';
|
|
6
8
|
|
|
7
9
|
const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
|
|
8
10
|
|
|
9
|
-
export function useBlockRouterProvider(
|
|
10
|
-
router
|
|
11
|
-
|
|
12
|
-
) {
|
|
11
|
+
export function useBlockRouterProvider(scrollTarget: EventTarget = globalThis) {
|
|
12
|
+
const router = useRouter();
|
|
13
|
+
|
|
13
14
|
const intersectionsMapRef = useRef<Map<BlockDef, IntersectionObserverEntry>>(new Map());
|
|
14
15
|
|
|
15
16
|
useEffect(
|
|
16
17
|
() =>
|
|
17
|
-
|
|
18
|
+
blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
|
|
18
19
|
if (intersectionsMapRef.current) {
|
|
19
20
|
intersectionsMapRef.current.set(block, intersection);
|
|
20
21
|
}
|
|
21
22
|
}),
|
|
22
|
-
[
|
|
23
|
+
[],
|
|
23
24
|
);
|
|
24
25
|
|
|
25
26
|
useEffect(() => {
|
|
26
27
|
const handleScroll = debounce(() => {
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
|
|
34
|
-
|
|
35
|
-
if (activeBlock?.anchor) {
|
|
36
|
-
router.replace(activeBlock.anchor);
|
|
37
|
-
} else if (!activeBlock) {
|
|
38
|
-
router.reset();
|
|
28
|
+
if (isScrolledEnough()) {
|
|
29
|
+
const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
|
|
30
|
+
trackBlock(router, activeBlock);
|
|
31
|
+
} else {
|
|
32
|
+
trackBlock(router);
|
|
39
33
|
}
|
|
40
34
|
}, 100);
|
|
41
35
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
-
import {
|
|
3
|
+
import { defaultEventBus } from '../EventBus/defaultEventBus';
|
|
4
4
|
import type { BlockVersion } from '../model/BlockVersion';
|
|
5
5
|
import type { UniBlockProps } from '../model/JSXBlock';
|
|
6
6
|
import { useBlockIntersectionObserver } from '../services/BlockRouter/useBlockIntersectionObserver';
|
|
@@ -28,7 +28,7 @@ export const BlockWrapper = JSX<BlockWrapperProps>(
|
|
|
28
28
|
const [isVisible, setVisible] = useState(true);
|
|
29
29
|
useEffect(
|
|
30
30
|
() =>
|
|
31
|
-
|
|
31
|
+
defaultEventBus.subscribe('tab', (event) => {
|
|
32
32
|
if (event.type === 'group') {
|
|
33
33
|
const hasSettings = block?.labels?.length || block?.anchor;
|
|
34
34
|
setVisible(
|
package/package.json
CHANGED
package/src/EventBus/EventBus.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type BaseEventMap = Record<string, any>;
|
|
4
|
-
|
|
5
|
-
export class EventBus<EM extends BaseEventMap> {
|
|
6
|
-
public static readonly inst = new EventBus<EventMap>();
|
|
7
|
-
|
|
1
|
+
export class EventBus<EM extends Record<string, any>> {
|
|
8
2
|
private subscribers: Partial<Record<keyof EM, Array<(ev: EM[keyof EM]) => void>>> = {};
|
|
9
3
|
private subjectsStateMap: Partial<EM> = {};
|
|
10
4
|
|
|
@@ -2,10 +2,13 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
3
3
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
4
4
|
import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
5
|
+
import { style } from '../../utils/style';
|
|
5
6
|
import type { ButtonBlockContent } from './ButtonBlockContent';
|
|
6
7
|
|
|
7
8
|
interface ButtonBlockProps extends ButtonBlockContent, UniBlockProps {}
|
|
8
9
|
|
|
9
|
-
export const ButtonBlock = JSX<ButtonBlockProps>(({ button, ...rest }) => (
|
|
10
|
-
<BlockWrapper {...rest}>
|
|
10
|
+
export const ButtonBlock = JSX<ButtonBlockProps>(({ button, className, ...rest }) => (
|
|
11
|
+
<BlockWrapper className={style('!bg-transparent', className)} {...rest}>
|
|
12
|
+
{renderButtonsSection([button])}
|
|
13
|
+
</BlockWrapper>
|
|
11
14
|
));
|
|
@@ -4,6 +4,10 @@ import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
|
4
4
|
* @title Блок Кнопка
|
|
5
5
|
*/
|
|
6
6
|
export interface ButtonBlockContent {
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* @title Кнопка
|
|
9
|
+
* @default {"icon": {"format": "webp", "size": { "width": 24, "height": 24 }},
|
|
10
|
+
* "iconRight": {"format": "webp", "size": { "width": 24, "height": 24 }}}
|
|
11
|
+
*/
|
|
8
12
|
button?: ButtonWithIconProps;
|
|
9
13
|
}
|
|
@@ -54,7 +54,7 @@ export const DEFAULT_DEPOSIT_CALCULATOR_PARAMS: DepositCalculatorSourceBookParam
|
|
|
54
54
|
maxSum: 5000000,
|
|
55
55
|
minMonths: 2,
|
|
56
56
|
maxMonths: 120,
|
|
57
|
-
rate:
|
|
57
|
+
rate: 7,
|
|
58
58
|
isMonthlyInterestPayment: true,
|
|
59
59
|
};
|
|
60
60
|
|
|
@@ -64,7 +64,7 @@ export const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS: BusinessDepositCalculat
|
|
|
64
64
|
maxSum: 500000,
|
|
65
65
|
minDays: BUSINESS_MIN_DAYS,
|
|
66
66
|
maxDays: BUSINESS_MAX_DAYS,
|
|
67
|
-
rate:
|
|
67
|
+
rate: 6.6,
|
|
68
68
|
isMonthlyInterestPayment: true,
|
|
69
69
|
isReplenished: false,
|
|
70
70
|
isPartialWithdrawal: false,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { maxBy } from '../../utils/maxBy';
|
|
2
|
+
import { minBy } from '../../utils/minBy';
|
|
3
|
+
|
|
4
|
+
export const getRangeByKeys = <
|
|
5
|
+
MinKey extends string,
|
|
6
|
+
MaxKey extends string,
|
|
7
|
+
T extends Record<MinKey | MaxKey, number>,
|
|
8
|
+
>(
|
|
9
|
+
[minKey, maxKey]: [MinKey, MaxKey],
|
|
10
|
+
rows: T[] = [],
|
|
11
|
+
) => ({
|
|
12
|
+
[minKey]: rows.length ? minBy()(rows.map((row) => row[minKey])) : 0,
|
|
13
|
+
[maxKey]: rows.length ? maxBy()(rows.map((row) => row[maxKey])) : 0,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const checkRangeByKeys = <
|
|
17
|
+
MinKey extends string,
|
|
18
|
+
MaxKey extends string,
|
|
19
|
+
T extends Record<MinKey | MaxKey, number>,
|
|
20
|
+
>(
|
|
21
|
+
value: number,
|
|
22
|
+
[minKey, maxKey]: [MinKey, MaxKey],
|
|
23
|
+
sourceBookRow: T,
|
|
24
|
+
): boolean => value >= sourceBookRow[minKey] && value < sourceBookRow[maxKey];
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
BUSINESS_RATE_MIN_DAYS,
|
|
6
6
|
DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS,
|
|
7
7
|
} from './constants';
|
|
8
|
+
import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers';
|
|
8
9
|
import { useCalculatorParams } from './useCalculatorParams';
|
|
9
10
|
import type { CommonDepositParams } from './useDepositCalculatorParams';
|
|
10
11
|
|
|
@@ -72,9 +73,9 @@ export const useBusinessDepositCalculatorParams = (
|
|
|
72
73
|
return (
|
|
73
74
|
isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
|
|
74
75
|
isSmallBusiness === _.isSmallBusiness &&
|
|
75
|
-
(isOperatingDeposit
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
checkIsOperatingDeposit(isOperatingDeposit, _) &&
|
|
77
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
78
|
+
checkRangeByKeys(daysValue, ['minDays', 'maxDays'], _)
|
|
78
79
|
);
|
|
79
80
|
}) || DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS;
|
|
80
81
|
|
|
@@ -82,9 +83,12 @@ export const useBusinessDepositCalculatorParams = (
|
|
|
82
83
|
|
|
83
84
|
const income = getDepositIncome(rate, userInputParams);
|
|
84
85
|
const finalSum = moneyValue + income;
|
|
86
|
+
const sourceBookRows = data?.rows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
|
|
85
87
|
|
|
86
88
|
return {
|
|
87
89
|
...businessDepositCalculatorSourceBookParams,
|
|
90
|
+
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
91
|
+
...getRangeByKeys(['minDays', 'maxDays'], sourceBookRows),
|
|
88
92
|
...userInputParams,
|
|
89
93
|
isDisabledOperatingDeposit,
|
|
90
94
|
income,
|
|
@@ -92,6 +96,14 @@ export const useBusinessDepositCalculatorParams = (
|
|
|
92
96
|
};
|
|
93
97
|
};
|
|
94
98
|
|
|
99
|
+
const checkIsOperatingDeposit = (
|
|
100
|
+
isOperatingDeposit: boolean,
|
|
101
|
+
sourceBookRow: BusinessDepositCalculatorSourceBookParams,
|
|
102
|
+
) =>
|
|
103
|
+
isOperatingDeposit
|
|
104
|
+
? sourceBookRow.isReplenished && sourceBookRow.isPartialWithdrawal
|
|
105
|
+
: !sourceBookRow.isReplenished && !sourceBookRow.isPartialWithdrawal;
|
|
106
|
+
|
|
95
107
|
const getDepositIncome = (
|
|
96
108
|
rate: number,
|
|
97
109
|
userInputParams: BusinessDepositCalculatorUserInputParams,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CREDIT_CALC_DEFAULT_DIR, DEFAULT_CREDIT_CALCULATOR_PARAMS } from './constants';
|
|
2
2
|
import { getMonthlyPayment } from './getMonthlyPayment';
|
|
3
|
+
import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers';
|
|
3
4
|
import { useCalculatorParams } from './useCalculatorParams';
|
|
4
5
|
|
|
5
6
|
export interface CommonCreditParams {
|
|
@@ -38,7 +39,7 @@ export const useCreditCalculatorParams = (
|
|
|
38
39
|
userInputParams: CreditCalculatorUserInputParams,
|
|
39
40
|
sourceBookDir?: string,
|
|
40
41
|
): CreditCalculatorParams => {
|
|
41
|
-
const { isInsurance, isSalaryClient, isStateEmployee, moneyValue } = userInputParams;
|
|
42
|
+
const { isInsurance, isSalaryClient, isStateEmployee, moneyValue, monthsValue } = userInputParams;
|
|
42
43
|
|
|
43
44
|
const data = useCalculatorParams<CreditCalculatorData>(sourceBookDir || CREDIT_CALC_DEFAULT_DIR);
|
|
44
45
|
const creditCalculatorSourceBookParams =
|
|
@@ -46,16 +47,21 @@ export const useCreditCalculatorParams = (
|
|
|
46
47
|
return (
|
|
47
48
|
isInsurance === _.isInsurance &&
|
|
48
49
|
isSalaryClient === _.isSalaryClient &&
|
|
49
|
-
isStateEmployee === _.isStateEmployee
|
|
50
|
+
isStateEmployee === _.isStateEmployee &&
|
|
51
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
52
|
+
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _)
|
|
50
53
|
);
|
|
51
54
|
}) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
|
|
52
55
|
|
|
53
56
|
const { rateBottomRange, rateTopRange, sumBorder } = creditCalculatorSourceBookParams;
|
|
54
57
|
const finalRate = moneyValue <= sumBorder ? rateBottomRange : rateTopRange;
|
|
55
58
|
const monthlyPayment = getMonthlyPayment(finalRate, userInputParams);
|
|
59
|
+
const sourceBookRows = data?.rows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
|
|
56
60
|
|
|
57
61
|
return {
|
|
58
62
|
...creditCalculatorSourceBookParams,
|
|
63
|
+
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
64
|
+
...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
|
|
59
65
|
...userInputParams,
|
|
60
66
|
finalRate,
|
|
61
67
|
monthlyPayment,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { DEFAULT_DEPOSIT_CALCULATOR_PARAMS, DEPOSIT_CALC_DEFAULT_DIR } from './constants';
|
|
2
|
+
import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers';
|
|
2
3
|
import { useCalculatorParams } from './useCalculatorParams';
|
|
3
4
|
|
|
4
5
|
export interface CommonDepositParams {
|
|
5
6
|
isMonthlyInterestPayment: boolean;
|
|
6
7
|
}
|
|
8
|
+
|
|
7
9
|
export interface DepositCalculatorSourceBookParams extends CommonDepositParams {
|
|
8
10
|
minSum: number;
|
|
9
11
|
maxSum: number;
|
|
@@ -32,22 +34,34 @@ export const useDepositCalculatorParams = (
|
|
|
32
34
|
userInputParams: DepositCalculatorUserInputParams,
|
|
33
35
|
sourceBookDir?: string,
|
|
34
36
|
): DepositCalculatorParams => {
|
|
35
|
-
const { isMonthlyInterestPayment, moneyValue } = userInputParams;
|
|
37
|
+
const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
|
|
36
38
|
|
|
37
39
|
const data = useCalculatorParams<DepositCalculatorData>(
|
|
38
40
|
sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR,
|
|
39
41
|
);
|
|
40
42
|
|
|
41
43
|
const depositCalculatorSourceBookParams =
|
|
42
|
-
data?.rows?.find(
|
|
43
|
-
|
|
44
|
+
data?.rows?.find(
|
|
45
|
+
(_) =>
|
|
46
|
+
isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
|
|
47
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
48
|
+
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _),
|
|
49
|
+
) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
|
|
44
50
|
|
|
45
51
|
const { rate } = depositCalculatorSourceBookParams;
|
|
46
52
|
|
|
47
53
|
const income = getDepositIncome(rate, userInputParams);
|
|
48
54
|
const finalSum = moneyValue + income;
|
|
55
|
+
const sourceBookRows = data?.rows || [DEFAULT_DEPOSIT_CALCULATOR_PARAMS];
|
|
49
56
|
|
|
50
|
-
return {
|
|
57
|
+
return {
|
|
58
|
+
...depositCalculatorSourceBookParams,
|
|
59
|
+
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
60
|
+
...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
|
|
61
|
+
...userInputParams,
|
|
62
|
+
income,
|
|
63
|
+
finalSum,
|
|
64
|
+
};
|
|
51
65
|
};
|
|
52
66
|
|
|
53
67
|
const getDepositIncome = (rate: number, userInputParams: DepositCalculatorUserInputParams) => {
|
|
@@ -52,10 +52,12 @@ export const Carousel: JSXBlock<CarouselProps> = JSX<CarouselProps>(
|
|
|
52
52
|
gap={ITEMS_GAP}
|
|
53
53
|
onVisibleIndicesChange={scroll.handleVisibleIndicesChange}
|
|
54
54
|
>
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
{isBankHistoryCarousel
|
|
56
|
+
? renderChildren({
|
|
57
|
+
...rest,
|
|
58
|
+
block: { ...rest.block, blocks: buildBlocks(childBlocks, activeIndex) },
|
|
59
|
+
})
|
|
60
|
+
: renderChildren(rest)}
|
|
59
61
|
</SwipeListContainer>
|
|
60
62
|
<CarouselScrollButtons
|
|
61
63
|
scroll={scroll}
|
|
@@ -4,6 +4,7 @@ import type { ComplexBenefitProps } from '../../ui-kit/BenefitItem/BenefitItemPr
|
|
|
4
4
|
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
5
5
|
import { assertUnreachable } from '../../utils/assertUnreachable';
|
|
6
6
|
|
|
7
|
+
// TODO: Create universal function for this case
|
|
7
8
|
export const renderBenefit =
|
|
8
9
|
// Linter doesn't understand that switch processes all cases
|
|
9
10
|
// eslint-disable-next-line consistent-return
|
|
@@ -3,6 +3,7 @@ import { Text } from '../../ui-kit/Text/Text';
|
|
|
3
3
|
import { assertUnreachable } from '../../utils/assertUnreachable';
|
|
4
4
|
import type { Benefit } from './ProductTileContent';
|
|
5
5
|
|
|
6
|
+
// TODO: Create universal function for this case
|
|
6
7
|
export const renderBenefit =
|
|
7
8
|
// Linter doesn't understand that switch processes all cases
|
|
8
9
|
// eslint-disable-next-line consistent-return
|