@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,25 +1,14 @@
|
|
|
1
|
-
import { useCallback
|
|
1
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
2
|
import { useIntersectionObserver } from '../../hooks/useIntersectionObserver.js';
|
|
3
|
-
import {
|
|
4
|
-
export function useBlockIntersectionObserver(block
|
|
3
|
+
import { blockRouterEventBus } from './blockRouterEventBus.js';
|
|
4
|
+
export function useBlockIntersectionObserver(block) {
|
|
5
5
|
const observerCallback = useCallback((entries) => {
|
|
6
6
|
if (!block || !entries?.length) {
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
9
|
const intersection = entries[entries.length - 1];
|
|
10
|
-
|
|
11
|
-
}, [block
|
|
12
|
-
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (!ref.current) {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
return router.eventBus.subscribe('goto', ({ anchor }) => {
|
|
18
|
-
if (ref.current && block?.anchor === anchor) {
|
|
19
|
-
ref.current.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}, [block, router]);
|
|
23
|
-
return ref;
|
|
10
|
+
blockRouterEventBus.fire('intersection', { block, intersection });
|
|
11
|
+
}, [block]);
|
|
12
|
+
return useIntersectionObserver(observerCallback, { sensitivity: 1 });
|
|
24
13
|
}
|
|
25
14
|
//# sourceMappingURL=useBlockIntersectionObserver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBlockIntersectionObserver.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockIntersectionObserver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"useBlockIntersectionObserver.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockIntersectionObserver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,4BAA4B,CAAC,KAAgB;IAC3D,MAAM,gBAAgB,GAAG,WAAW,CAClC,CAAC,OAAoC,EAAE,EAAE;QACvC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE;YAC9B,OAAO;SACR;QAED,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjD,mBAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;IACpE,CAAC,EACD,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function useBlockRouterProvider(router?: BlockRouter, scrollTarget?: EventTarget): void;
|
|
1
|
+
export declare function useBlockRouterProvider(scrollTarget?: EventTarget): void;
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { useEffect, useRef } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useRouter } from '../../hooks/useRouter.js';
|
|
2
3
|
import { debounce } from '../../utils/debounce.js';
|
|
3
|
-
import {
|
|
4
|
+
import { trackBlock } from './BlockRouter.js';
|
|
5
|
+
import { blockRouterEventBus } from './blockRouterEventBus.js';
|
|
4
6
|
import { findActiveBlock } from './findActiveBlock.js';
|
|
5
7
|
const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
|
|
6
|
-
export function useBlockRouterProvider(
|
|
8
|
+
export function useBlockRouterProvider(scrollTarget = globalThis) {
|
|
9
|
+
const router = useRouter();
|
|
7
10
|
const intersectionsMapRef = useRef(new Map());
|
|
8
|
-
useEffect(() =>
|
|
11
|
+
useEffect(() => blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
|
|
9
12
|
if (intersectionsMapRef.current) {
|
|
10
13
|
intersectionsMapRef.current.set(block, intersection);
|
|
11
14
|
}
|
|
12
|
-
}), [
|
|
15
|
+
}), []);
|
|
13
16
|
useEffect(() => {
|
|
14
17
|
const handleScroll = debounce(() => {
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
if (isScrolledEnough()) {
|
|
19
|
+
const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
|
|
20
|
+
trackBlock(router, activeBlock);
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
router.replace(activeBlock.anchor);
|
|
22
|
-
}
|
|
23
|
-
else if (!activeBlock) {
|
|
24
|
-
router.reset();
|
|
22
|
+
else {
|
|
23
|
+
trackBlock(router);
|
|
25
24
|
}
|
|
26
25
|
}, 100);
|
|
27
26
|
scrollTarget.addEventListener('scroll', handleScroll);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBlockRouterProvider.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockRouterProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"useBlockRouterProvider.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockRouterProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,UAAU,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAErF,MAAM,UAAU,sBAAsB,CAAC,eAA4B,UAAU;IAC3E,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,MAAM,mBAAmB,GAAG,MAAM,CAA2C,IAAI,GAAG,EAAE,CAAC,CAAC;IAExF,SAAS,CACP,GAAG,EAAE,CACH,mBAAmB,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE;QACxE,IAAI,mBAAmB,CAAC,OAAO,EAAE;YAC/B,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;SACtD;IACH,CAAC,CAAC,EACJ,EAAE,CACH,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,EAAE;YACjC,IAAI,gBAAgB,EAAE,EAAE;gBACtB,MAAM,WAAW,GAAG,eAAe,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;gBAC9E,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;aACjC;iBAAM;gBACL,UAAU,CAAC,MAAM,CAAC,CAAC;aACpB;QACH,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,YAAY,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAEtD,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,EAAE,CAAC;YACvB,YAAY,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
|
-
import {
|
|
4
|
+
import { defaultEventBus } from '../EventBus/defaultEventBus.js';
|
|
5
5
|
import { useBlockIntersectionObserver } from '../services/BlockRouter/useBlockIntersectionObserver.js';
|
|
6
6
|
import { style } from '../utils/style.js';
|
|
7
7
|
export const blockStyles = {
|
|
@@ -15,7 +15,7 @@ export const BlockWrapper = JSX(({ className = '', version = 'primary', block, t
|
|
|
15
15
|
const Tag = tag;
|
|
16
16
|
const ref = useBlockIntersectionObserver(block);
|
|
17
17
|
const [isVisible, setVisible] = useState(true);
|
|
18
|
-
useEffect(() =>
|
|
18
|
+
useEffect(() => defaultEventBus.subscribe('tab', (event) => {
|
|
19
19
|
if (event.type === 'group') {
|
|
20
20
|
const hasSettings = block?.labels?.length || block?.anchor;
|
|
21
21
|
setVisible(event.label ? !hasSettings || Boolean(block?.labels?.includes(event.label)) : true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AACpG,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAOvC,MAAM,CAAC,MAAM,WAAW,GAAiC;IACvD,OAAO,EAAE,4BAA4B;IACrC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,mCAAmC;IACzC,WAAW,EAAE,kCAAkC;IAC/C,EAAE,EAAE,EAAE;CACP,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAC7B,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,GAAG,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAClF,MAAM,GAAG,GAAQ,GAAG,CAAC;IAErB,MAAM,GAAG,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAC;IAEhD,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/C,SAAS,CACP,GAAG,EAAE,CACH,eAAe,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QACzC,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;YAC1B,MAAM,WAAW,GAAG,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,EAAE,MAAM,CAAC;YAC3D,UAAU,CACR,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CACnF,CAAC;SACH;aAAM;YACL,UAAU,CAAC,IAAI,CAAC,CAAC;SAClB;IACH,CAAC,CAAC,EACJ,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,SAAS,CAAC,CAAC,CAAC,CACjB,KAAC,GAAG,IACF,SAAS,EAAE,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,KACtD,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KACxC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EACpD,IAAI,EAAE,IAAI,YAET,QAAQ,GACL,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CACF,CAAC"}
|
|
@@ -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
|
|
@@ -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}
|
|
@@ -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]');
|