@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
package/bundle/bundle.umd.js
CHANGED
|
@@ -290,7 +290,6 @@
|
|
|
290
290
|
};
|
|
291
291
|
|
|
292
292
|
class EventBus {
|
|
293
|
-
static inst = new EventBus();
|
|
294
293
|
subscribers = {};
|
|
295
294
|
subjectsStateMap = {};
|
|
296
295
|
subscribe(type, listener) {
|
|
@@ -318,6 +317,8 @@
|
|
|
318
317
|
}
|
|
319
318
|
}
|
|
320
319
|
|
|
320
|
+
const defaultEventBus = new EventBus();
|
|
321
|
+
|
|
321
322
|
const SENSITIVITY_SCALE = 10;
|
|
322
323
|
function useIntersectionObserver(observerCallback, { sensitivity, rootRef } = {}) {
|
|
323
324
|
const ref = useRef(null);
|
|
@@ -342,55 +343,17 @@
|
|
|
342
343
|
.concat(1);
|
|
343
344
|
}
|
|
344
345
|
|
|
345
|
-
const
|
|
346
|
-
const getURLWithAnchor = (rawAnchor) => `${globalThis.location?.pathname}#${normalizeAnchor(rawAnchor)}`;
|
|
347
|
-
class BlockRouter {
|
|
348
|
-
static inst = new BlockRouter();
|
|
349
|
-
eventBus = new EventBus();
|
|
350
|
-
constructor() {
|
|
351
|
-
const anchor = normalizeAnchor(globalThis.location?.hash);
|
|
352
|
-
if (anchor) {
|
|
353
|
-
this.eventBus.subject('goto', { anchor });
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
goto(rawAnchor) {
|
|
357
|
-
const anchor = normalizeAnchor(rawAnchor);
|
|
358
|
-
if (anchor) {
|
|
359
|
-
this.push(anchor);
|
|
360
|
-
this.eventBus.fire('goto', { anchor });
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
push(rawAnchor) {
|
|
364
|
-
globalThis.history?.pushState(null, '', getURLWithAnchor(rawAnchor));
|
|
365
|
-
}
|
|
366
|
-
replace(rawAnchor) {
|
|
367
|
-
globalThis.history?.replaceState(null, '', getURLWithAnchor(rawAnchor));
|
|
368
|
-
}
|
|
369
|
-
reset() {
|
|
370
|
-
globalThis.history?.replaceState(null, '', getURLWithAnchor());
|
|
371
|
-
}
|
|
372
|
-
}
|
|
346
|
+
const blockRouterEventBus = new EventBus();
|
|
373
347
|
|
|
374
|
-
function useBlockIntersectionObserver(block
|
|
348
|
+
function useBlockIntersectionObserver(block) {
|
|
375
349
|
const observerCallback = useCallback((entries) => {
|
|
376
350
|
if (!block || !entries?.length) {
|
|
377
351
|
return;
|
|
378
352
|
}
|
|
379
353
|
const intersection = entries[entries.length - 1];
|
|
380
|
-
|
|
381
|
-
}, [block
|
|
382
|
-
|
|
383
|
-
useEffect(() => {
|
|
384
|
-
if (!ref.current) {
|
|
385
|
-
return undefined;
|
|
386
|
-
}
|
|
387
|
-
return router.eventBus.subscribe('goto', ({ anchor }) => {
|
|
388
|
-
if (ref.current && block?.anchor === anchor) {
|
|
389
|
-
ref.current.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
}, [block, router]);
|
|
393
|
-
return ref;
|
|
354
|
+
blockRouterEventBus.fire('intersection', { block, intersection });
|
|
355
|
+
}, [block]);
|
|
356
|
+
return useIntersectionObserver(observerCallback, { sensitivity: 1 });
|
|
394
357
|
}
|
|
395
358
|
|
|
396
359
|
const blockStyles = {
|
|
@@ -404,7 +367,7 @@
|
|
|
404
367
|
const Tag = tag;
|
|
405
368
|
const ref = useBlockIntersectionObserver(block);
|
|
406
369
|
const [isVisible, setVisible] = useState(true);
|
|
407
|
-
useEffect(() =>
|
|
370
|
+
useEffect(() => defaultEventBus.subscribe('tab', (event) => {
|
|
408
371
|
if (event.type === 'group') {
|
|
409
372
|
const hasSettings = block?.labels?.length || block?.anchor;
|
|
410
373
|
setVisible(event.label ? !hasSettings || Boolean(block?.labels?.includes(event.label)) : true);
|
|
@@ -651,8 +614,14 @@
|
|
|
651
614
|
},
|
|
652
615
|
];
|
|
653
616
|
|
|
654
|
-
|
|
655
|
-
|
|
617
|
+
const normalizeAnchor = (anchor) => anchor?.replace('#', '') || '';
|
|
618
|
+
function gotoBlock(router, anchor) {
|
|
619
|
+
router.replace(`#${normalizeAnchor(anchor)}`);
|
|
620
|
+
}
|
|
621
|
+
function trackBlock(router, block) {
|
|
622
|
+
router.replace(`#${normalizeAnchor(block?.anchor)}`, undefined, {
|
|
623
|
+
scroll: false,
|
|
624
|
+
});
|
|
656
625
|
}
|
|
657
626
|
|
|
658
627
|
const isURL = (href) => Boolean(href?.includes('//'));
|
|
@@ -699,7 +668,6 @@
|
|
|
699
668
|
|
|
700
669
|
function useLink(isRemote) {
|
|
701
670
|
const router = useRouter();
|
|
702
|
-
const blockRouter = useBlockRouter();
|
|
703
671
|
return (props) => ({
|
|
704
672
|
...props,
|
|
705
673
|
href: adjustHref(props.href),
|
|
@@ -722,7 +690,7 @@
|
|
|
722
690
|
// Client routing
|
|
723
691
|
ev?.preventDefault();
|
|
724
692
|
if (isHash(href)) {
|
|
725
|
-
|
|
693
|
+
gotoBlock(router, href);
|
|
726
694
|
}
|
|
727
695
|
else if (href) {
|
|
728
696
|
router.push(href);
|
|
@@ -1143,8 +1111,8 @@
|
|
|
1143
1111
|
return (jsx(BlockWrapper, { className: `font-sans bg-white p-[50px] pb-9 ${className}`, ...rest, children: jsxs("div", { className: "container max-w-[978px]", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "text-center mb-8" }) : null, COMPONENTS_MAP[typeForm]({ button, link, handleSubmit }), responceType ? jsx(ResponseNotification, { responceType: responceType }) : null] }) }));
|
|
1144
1112
|
});
|
|
1145
1113
|
|
|
1146
|
-
const BenefitsBlock = JSX(({ className = '', title, benefitList, ...rest }) => (jsxs(BlockWrapper, { className: `p-12 flex flex-col items-center ${className}`, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", as: "h2", className: "max-w-[47rem] text-center", title: title })) : null, benefitList?.length ? (jsx("div", { className: "flex flex-wrap w-full justify-center gap-x-20 mt-8", children: benefitList.map(renderStep) })) : null] })));
|
|
1147
|
-
const renderStep = (benefit, i) => {
|
|
1114
|
+
const BenefitsBlock = JSX(({ className = '', title, benefitList, ...rest }) => (jsxs(BlockWrapper, { className: `p-12 flex flex-col items-center ${className}`, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", as: "h2", className: "max-w-[47rem] text-center", title: title })) : null, benefitList?.length ? (jsx("div", { className: "flex flex-wrap w-full justify-center gap-x-20 mt-8", children: benefitList.map(renderStep$1) })) : null] })));
|
|
1115
|
+
const renderStep$1 = (benefit, i) => {
|
|
1148
1116
|
const description = benefit.description;
|
|
1149
1117
|
return (jsxs("div", { className: "flex items-center basis-1/2 max-w-[500px] mb-14", children: [benefit?.icon?.icon ? (jsx(ImgInner, { className: "w-12 h-12 min-w-12 p-3 rounded-full bg-main-divider text-primary-main group-data-secondary:bg-white/30 group-data-secondary:text-black", image: benefit.icon, asSVG: true })) : null, benefit?.icon?.src ? jsx(ImgInner, { image: benefit.icon }) : null, jsxs("div", { className: "ml-5", children: [benefit?.label ? jsx(Heading, { headingType: "h6", children: benefit.label }) : null, renderDescription$5(description)] })] }, String(i)));
|
|
1150
1118
|
};
|
|
@@ -1260,7 +1228,7 @@
|
|
|
1260
1228
|
|
|
1261
1229
|
const BusinessBlock = JSX(({ className = '', title, cards, ...rest }) => (jsxs(BlockWrapper, { className: `p-12 pb-9 ${className}`, ...rest, children: [jsx(Heading, { headingType: "h3", title: title, className: "text-center mb-8" }), jsx("div", { className: "flex gap-5", children: cards?.length ? cards.map((_, i) => jsx(BusinessCard, { ..._ }, String(i))) : null })] })));
|
|
1262
1230
|
|
|
1263
|
-
const ButtonBlock = JSX(({ button, ...rest }) => (jsx(BlockWrapper, { ...rest, children: renderButtonsSection([button]) })));
|
|
1231
|
+
const ButtonBlock = JSX(({ button, className, ...rest }) => (jsx(BlockWrapper, { className: style('!bg-transparent', className), ...rest, children: renderButtonsSection([button]) })));
|
|
1264
1232
|
|
|
1265
1233
|
const useCarouselControls = (props) => {
|
|
1266
1234
|
const { itemCount, visibleItemCount, isCyclic } = props;
|
|
@@ -1352,7 +1320,7 @@
|
|
|
1352
1320
|
maxSum: 5000000,
|
|
1353
1321
|
minMonths: 2,
|
|
1354
1322
|
maxMonths: 120,
|
|
1355
|
-
rate:
|
|
1323
|
+
rate: 7,
|
|
1356
1324
|
isMonthlyInterestPayment: true,
|
|
1357
1325
|
};
|
|
1358
1326
|
const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS = {
|
|
@@ -1360,7 +1328,7 @@
|
|
|
1360
1328
|
maxSum: 500000,
|
|
1361
1329
|
minDays: BUSINESS_MIN_DAYS,
|
|
1362
1330
|
maxDays: BUSINESS_MAX_DAYS,
|
|
1363
|
-
rate:
|
|
1331
|
+
rate: 6.6,
|
|
1364
1332
|
isMonthlyInterestPayment: true,
|
|
1365
1333
|
isReplenished: false,
|
|
1366
1334
|
isPartialWithdrawal: false,
|
|
@@ -1372,7 +1340,7 @@
|
|
|
1372
1340
|
const DEPOSIT_CALC_DEFAULT_DIR = 'deposit-calculator-data';
|
|
1373
1341
|
const BUSINESS_DEPOSIT_CALC_DEFAULT_DIR = 'business-calculator-data';
|
|
1374
1342
|
|
|
1375
|
-
const Rate = JSX(({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, rateBlockClassName }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsxs("div", { className: "relative", children: [jsxs("div", { className: "flex justify-start", children: [jsx("span", { className: style('block gradient-color-text font-mohave text-title-huge pr-6 -mt-4', rateBlockClassName), children: String(rate).replace('.', ',') }), unit ? (jsx("span", { className: "gradient-color-text text-[65px] leading-[75px]", children: unit })) : ('')] }), depositeName && isShowDepositeName ? (jsx("div", { className: "absolute bottom-7 w-full text-center whitespace-nowrap", children: depositeName })) : null] })] })));
|
|
1343
|
+
const Rate = JSX(({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, rateBlockClassName }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsxs("div", { className: "relative", children: [jsxs("div", { className: "flex justify-start", children: [jsx("span", { className: style('block gradient-color-text font-mohave text-title-huge pr-6 -mt-4', rateBlockClassName), children: String(rate.toFixed(2)).replace('.', ',') }), unit ? (jsx("span", { className: "gradient-color-text text-[65px] leading-[75px]", children: unit })) : ('')] }), depositeName && isShowDepositeName ? (jsx("div", { className: "absolute bottom-7 w-full text-center whitespace-nowrap", children: depositeName })) : null] })] })));
|
|
1376
1344
|
|
|
1377
1345
|
const renderFootnote = (text) => text ? (jsx(Paragraph, { size: "text-s-light", color: "text-secondary-text", children: text })) : null;
|
|
1378
1346
|
|
|
@@ -1472,6 +1440,17 @@
|
|
|
1472
1440
|
|
|
1473
1441
|
const UnknownRate = JSX(({ title = 'Ставка' }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsx("div", { className: "mt-1 pt-1 pl-5 pb-1.5", children: jsx(ImgInner, { image: { icon: 'PercentIcon' }, width: "90", height: "85", asSVG: true }) }), jsx("div", { className: "w-[250px] mt-3.5", children: jsxs(Paragraph, { size: "text-xl-light", color: "text-primary-text", children: ["\u041F\u0440\u043E\u0446\u0435\u043D\u0442\u043D\u0430\u044F \u0441\u0442\u0430\u0432\u043A\u0430 \u0434\u043B\u044F \u0441\u0440\u043E\u043A\u0430 ", jsx("strong", { children: "1-30 \u0434\u043D\u0435\u0439" }), " \u0443\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0438 \u0432 \u0411\u0430\u043D\u043A"] }) })] })));
|
|
1474
1442
|
|
|
1443
|
+
const defaultDiscriminator = (_) => _;
|
|
1444
|
+
const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
|
|
1445
|
+
|
|
1446
|
+
const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
|
|
1447
|
+
|
|
1448
|
+
const getRangeByKeys = ([minKey, maxKey], rows = []) => ({
|
|
1449
|
+
[minKey]: rows.length ? minBy()(rows.map((row) => row[minKey])) : 0,
|
|
1450
|
+
[maxKey]: rows.length ? maxBy()(rows.map((row) => row[maxKey])) : 0,
|
|
1451
|
+
});
|
|
1452
|
+
const checkRangeByKeys = (value, [minKey, maxKey], sourceBookRow) => value >= sourceBookRow[minKey] && value < sourceBookRow[maxKey];
|
|
1453
|
+
|
|
1475
1454
|
const useBusinessDepositCalculatorParams = (userInputParams, sourceBookDir) => {
|
|
1476
1455
|
const { daysValue, moneyValue, isPartialWithdrawal, isReplenished, isSmallBusiness, isMonthlyInterestPayment, } = userInputParams;
|
|
1477
1456
|
const data = useCalculatorParams(sourceBookDir || BUSINESS_DEPOSIT_CALC_DEFAULT_DIR);
|
|
@@ -1488,21 +1467,27 @@
|
|
|
1488
1467
|
const businessDepositCalculatorSourceBookParams = data?.rows?.find((_) => {
|
|
1489
1468
|
return (isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
|
|
1490
1469
|
isSmallBusiness === _.isSmallBusiness &&
|
|
1491
|
-
(isOperatingDeposit
|
|
1492
|
-
|
|
1493
|
-
|
|
1470
|
+
checkIsOperatingDeposit(isOperatingDeposit, _) &&
|
|
1471
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
1472
|
+
checkRangeByKeys(daysValue, ['minDays', 'maxDays'], _));
|
|
1494
1473
|
}) || DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS;
|
|
1495
1474
|
const { rate } = businessDepositCalculatorSourceBookParams;
|
|
1496
1475
|
const income = getDepositIncome$1(rate, userInputParams);
|
|
1497
1476
|
const finalSum = moneyValue + income;
|
|
1477
|
+
const sourceBookRows = data?.rows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
|
|
1498
1478
|
return {
|
|
1499
1479
|
...businessDepositCalculatorSourceBookParams,
|
|
1480
|
+
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
1481
|
+
...getRangeByKeys(['minDays', 'maxDays'], sourceBookRows),
|
|
1500
1482
|
...userInputParams,
|
|
1501
1483
|
isDisabledOperatingDeposit,
|
|
1502
1484
|
income,
|
|
1503
1485
|
finalSum,
|
|
1504
1486
|
};
|
|
1505
1487
|
};
|
|
1488
|
+
const checkIsOperatingDeposit = (isOperatingDeposit, sourceBookRow) => isOperatingDeposit
|
|
1489
|
+
? sourceBookRow.isReplenished && sourceBookRow.isPartialWithdrawal
|
|
1490
|
+
: !sourceBookRow.isReplenished && !sourceBookRow.isPartialWithdrawal;
|
|
1506
1491
|
const getDepositIncome$1 = (rate, userInputParams) => {
|
|
1507
1492
|
const { isMonthlyInterestPayment, moneyValue, daysValue } = userInputParams;
|
|
1508
1493
|
/*
|
|
@@ -1574,18 +1559,23 @@
|
|
|
1574
1559
|
};
|
|
1575
1560
|
|
|
1576
1561
|
const useCreditCalculatorParams = (userInputParams, sourceBookDir) => {
|
|
1577
|
-
const { isInsurance, isSalaryClient, isStateEmployee, moneyValue } = userInputParams;
|
|
1562
|
+
const { isInsurance, isSalaryClient, isStateEmployee, moneyValue, monthsValue } = userInputParams;
|
|
1578
1563
|
const data = useCalculatorParams(sourceBookDir || CREDIT_CALC_DEFAULT_DIR);
|
|
1579
1564
|
const creditCalculatorSourceBookParams = data?.rows?.find((_) => {
|
|
1580
1565
|
return (isInsurance === _.isInsurance &&
|
|
1581
1566
|
isSalaryClient === _.isSalaryClient &&
|
|
1582
|
-
isStateEmployee === _.isStateEmployee
|
|
1567
|
+
isStateEmployee === _.isStateEmployee &&
|
|
1568
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
1569
|
+
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _));
|
|
1583
1570
|
}) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
|
|
1584
1571
|
const { rateBottomRange, rateTopRange, sumBorder } = creditCalculatorSourceBookParams;
|
|
1585
1572
|
const finalRate = moneyValue <= sumBorder ? rateBottomRange : rateTopRange;
|
|
1586
1573
|
const monthlyPayment = getMonthlyPayment(finalRate, userInputParams);
|
|
1574
|
+
const sourceBookRows = data?.rows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
|
|
1587
1575
|
return {
|
|
1588
1576
|
...creditCalculatorSourceBookParams,
|
|
1577
|
+
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
1578
|
+
...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
|
|
1589
1579
|
...userInputParams,
|
|
1590
1580
|
finalRate,
|
|
1591
1581
|
monthlyPayment,
|
|
@@ -1626,14 +1616,23 @@
|
|
|
1626
1616
|
});
|
|
1627
1617
|
|
|
1628
1618
|
const useDepositCalculatorParams = (userInputParams, sourceBookDir) => {
|
|
1629
|
-
const { isMonthlyInterestPayment, moneyValue } = userInputParams;
|
|
1619
|
+
const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
|
|
1630
1620
|
const data = useCalculatorParams(sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR);
|
|
1631
|
-
const depositCalculatorSourceBookParams = data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment
|
|
1632
|
-
|
|
1621
|
+
const depositCalculatorSourceBookParams = data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
|
|
1622
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
1623
|
+
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _)) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
|
|
1633
1624
|
const { rate } = depositCalculatorSourceBookParams;
|
|
1634
1625
|
const income = getDepositIncome(rate, userInputParams);
|
|
1635
1626
|
const finalSum = moneyValue + income;
|
|
1636
|
-
|
|
1627
|
+
const sourceBookRows = data?.rows || [DEFAULT_DEPOSIT_CALCULATOR_PARAMS];
|
|
1628
|
+
return {
|
|
1629
|
+
...depositCalculatorSourceBookParams,
|
|
1630
|
+
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
1631
|
+
...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
|
|
1632
|
+
...userInputParams,
|
|
1633
|
+
income,
|
|
1634
|
+
finalSum,
|
|
1635
|
+
};
|
|
1637
1636
|
};
|
|
1638
1637
|
const getDepositIncome = (rate, userInputParams) => {
|
|
1639
1638
|
const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
|
|
@@ -1843,11 +1842,6 @@
|
|
|
1843
1842
|
|
|
1844
1843
|
const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
|
|
1845
1844
|
|
|
1846
|
-
const defaultDiscriminator = (_) => _;
|
|
1847
|
-
const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
|
|
1848
|
-
|
|
1849
|
-
const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
|
|
1850
|
-
|
|
1851
1845
|
const getItemWidth = (container) => (itemCount) => container.scrollWidth / itemCount;
|
|
1852
1846
|
const scrollBy = (container) => (itemCount, delta) => {
|
|
1853
1847
|
container.scrollBy({ left: delta * getItemWidth(container)(itemCount), behavior: 'smooth' });
|
|
@@ -1948,10 +1942,12 @@
|
|
|
1948
1942
|
isCyclic,
|
|
1949
1943
|
});
|
|
1950
1944
|
const isBankHistoryCarousel = childBlocks && childBlocks[0]?.type === 'CarouselBankHistoryCard';
|
|
1951
|
-
return (jsx(BlockWrapper, { className: style(getPaddingStyle(isPadding), className), ...rest, children: jsxs("div", { className: "relative max-w-full", children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children:
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1945
|
+
return (jsx(BlockWrapper, { className: style(getPaddingStyle(isPadding), className), ...rest, children: jsxs("div", { className: "relative max-w-full", children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: isBankHistoryCarousel
|
|
1946
|
+
? renderChildren({
|
|
1947
|
+
...rest,
|
|
1948
|
+
block: { ...rest.block, blocks: buildBlocks(childBlocks, activeIndex) },
|
|
1949
|
+
})
|
|
1950
|
+
: renderChildren(rest) }), jsx(CarouselScrollButtons, { scroll: scroll, isBlur: isBlur, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count })] }) }));
|
|
1955
1951
|
});
|
|
1956
1952
|
Carousel.childrenTypes = [
|
|
1957
1953
|
'CarouselCard',
|
|
@@ -3536,6 +3532,7 @@
|
|
|
3536
3532
|
throw new Error(x);
|
|
3537
3533
|
}
|
|
3538
3534
|
|
|
3535
|
+
// TODO: Create universal function for this case
|
|
3539
3536
|
const renderBenefit$2 =
|
|
3540
3537
|
// Linter doesn't understand that switch processes all cases
|
|
3541
3538
|
// eslint-disable-next-line consistent-return
|
|
@@ -3672,6 +3669,7 @@
|
|
|
3672
3669
|
return (jsx("div", { className: `mt-2.5 z-10 ${descriptionWidth}`, children: jsx(Paragraph, { size: "text-m", font: "font-light", color: "group-data-primary:text-secondary-text", children: additionalDescription }) }));
|
|
3673
3670
|
}
|
|
3674
3671
|
|
|
3672
|
+
// TODO: Create universal function for this case
|
|
3675
3673
|
const renderBenefit =
|
|
3676
3674
|
// Linter doesn't understand that switch processes all cases
|
|
3677
3675
|
// eslint-disable-next-line consistent-return
|
|
@@ -3874,19 +3872,30 @@
|
|
|
3874
3872
|
});
|
|
3875
3873
|
const normalizeSelectedRegion = (selectedRegion, regions) => !selectedRegion && regions?.length && regions[0]?.code ? regions[0].code : selectedRegion;
|
|
3876
3874
|
|
|
3877
|
-
const
|
|
3875
|
+
const checkCanRenderIcon = (icon) => Boolean(icon?.icon || icon?.src);
|
|
3878
3876
|
|
|
3879
|
-
|
|
3877
|
+
// TODO: Create universal function for this case
|
|
3878
|
+
const renderStep = (props) =>
|
|
3879
|
+
// Linter doesn't understand that switch processes all cases
|
|
3880
|
+
// eslint-disable-next-line consistent-return
|
|
3881
|
+
(step, i, arr) => {
|
|
3882
|
+
const { type } = step;
|
|
3883
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
3884
|
+
return null;
|
|
3885
|
+
}
|
|
3886
|
+
switch (type) {
|
|
3887
|
+
case 'default':
|
|
3888
|
+
return renderDefaultStep(props)(step, i, arr);
|
|
3889
|
+
case 'rte':
|
|
3890
|
+
return jsx(RichText, { __html: step.__html });
|
|
3891
|
+
default:
|
|
3892
|
+
assertUnreachable(step);
|
|
3893
|
+
}
|
|
3894
|
+
};
|
|
3895
|
+
const renderDefaultStep = ({ styleMap, isMainButton, version }) => (step, i, arr) => {
|
|
3880
3896
|
const { label, description, button, items, isDotted } = step;
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
description,
|
|
3884
|
-
className: styleMap.description,
|
|
3885
|
-
}), jsx(List, { className: getItemsClasses({ className: 'text-left', description, styleMap }), items: items, listItemSize: "M", isDotted: isDotted })] })] }), button?.text && !isMainButton ? (jsx(Button, { className: "box-border py-3 h-12 w-full max-w-[240px] mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
|
|
3886
|
-
};
|
|
3887
|
-
const renderStepLabel = (label) => label ? jsx("div", { className: "text-h6", children: label }) : null;
|
|
3888
|
-
const renderStepDescription = ({ description, className = '', }) => (description ? jsx("div", { className: className, children: description }) : null);
|
|
3889
|
-
const getItemsClasses = ({ className, description, styleMap, }) => [description ? styleMap.description : 'text-h6', description ? 'mt-0.5' : '', className].join(' ');
|
|
3897
|
+
return (jsxs("div", { className: style('relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden', getContainerWidth(arr.length)), children: [jsxs("div", { className: style(button?.text ? 'mb-8' : '', 'text-center'), children: [label ? (jsx("div", { className: "mb-2", children: jsx(Text, { size: "text-h6", children: label }) })) : null, jsxs("div", { className: "flex flex-col items-center", children: [description ? jsx("div", { className: styleMap.description, children: description }) : null, jsx(List, { className: style(description ? `${styleMap.description} mt-0.5` : 'text-h6'), items: items, listItemSize: "M", isDotted: isDotted })] })] }), button?.text && !isMainButton ? (jsx(Button, { className: "box-border py-3 h-12 w-full max-w-[240px] mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
|
|
3898
|
+
};
|
|
3890
3899
|
const getContainerWidth = (length) => (length < 5 ? 'w-[276px]' : 'w-[210px]');
|
|
3891
3900
|
|
|
3892
3901
|
const STEPS_BLOCK_STYLE_MAPS = {
|
|
@@ -3931,21 +3940,14 @@
|
|
|
3931
3940
|
|
|
3932
3941
|
const getLineOpacity = (showLines) => (showLines ? '' : 'opacity-0');
|
|
3933
3942
|
const getPaddingX = (steps) => (steps < 5 ? 'px-[88px]' : 'px-[55px]');
|
|
3934
|
-
const StepsBlock = JSX(({ className = '', showLines = true, steps = [], button, version = 'primary', ...rest }) => {
|
|
3935
|
-
const { title } = rest;
|
|
3936
|
-
const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
|
|
3943
|
+
const StepsBlock = JSX(({ className = '', showLines = true, steps = [], button, version = 'primary', title, ...rest }) => {
|
|
3937
3944
|
const shortGaps = steps.length > 3;
|
|
3945
|
+
const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
|
|
3938
3946
|
const lineOpacity = getLineOpacity(showLines);
|
|
3939
|
-
const titleMargin = title ? 'mt-9' : '';
|
|
3940
3947
|
const paddingX = getPaddingX(steps.length);
|
|
3941
|
-
return (jsxs(BlockWrapper, { className: [
|
|
3942
|
-
'box-border py-12',
|
|
3943
|
-
shortGaps ? 'px-20' : 'px-[70px]',
|
|
3944
|
-
'flex flex-col items-center overflow-hidden',
|
|
3945
|
-
className,
|
|
3946
|
-
].join(' '), version: version, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", className: "max-w-[752px] text-center", title: title })) : null, steps?.length ? (jsxs("div", { className: `box-border ${titleMargin}`, children: [jsx("div", { className: `flex items-center ${paddingX}`, children: joinList(jsx("div", { className: `h-0.5 w-full bg-secondary-light ${lineOpacity}` }))(steps.map(renderStepIcon(styleMap, version))) }), jsx("div", { className: `flex justify-between mt-4 ${shortGaps ? 'gap-x-3' : 'gap-x-[101px]'}`, children: steps.map(renderStepContent({ styleMap, isMainButton: Boolean(button?.text), version })) })] })) : null, button?.text ? jsx(Button, { className: "mt-8 min-w-60", version: "primary", ...button }) : null] }));
|
|
3948
|
+
return (jsxs(BlockWrapper, { className: style('box-border py-12', shortGaps ? 'px-20' : 'px-[70px]', 'flex flex-col items-center overflow-hidden', className), version: version, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", className: "max-w-[752px] text-center mb-9", title: title })) : null, steps?.length ? (jsxs("div", { className: "box-border", children: [jsx("div", { className: style('flex items-center', paddingX), children: joinList(jsx("div", { className: style('h-0.5 w-full bg-secondary-light', lineOpacity) }))(steps.map(renderStepIcon(styleMap, version))) }), jsx("div", { className: style('flex justify-between mt-4', shortGaps ? 'gap-x-3' : 'gap-x-[101px]'), children: steps.map(renderStep({ styleMap, isMainButton: Boolean(button?.text), version })) })] })) : null, button?.text ? jsx(Button, { className: "mt-8 min-w-60", version: "primary", ...button }) : null] }));
|
|
3947
3949
|
});
|
|
3948
|
-
const renderStepIcon = (styleMap, version) => ({ icon }, i) => (jsx("div", { className: "flex flex-col items-center text-center", children: jsx("div", { className: `h-[100px] w-[100px] min-w-[100px] min-h-[100px] rounded-full p-[26px] box-border z-10 flex justify-center items-center ${styleMap.iconBackground}`, children:
|
|
3950
|
+
const renderStepIcon = (styleMap, version) => ({ icon }, i) => (jsx("div", { className: "flex flex-col items-center text-center", children: jsx("div", { className: `h-[100px] w-[100px] min-w-[100px] min-h-[100px] rounded-full p-[26px] box-border z-10 flex justify-center items-center ${styleMap.iconBackground}`, children: checkCanRenderIcon(icon) ? (jsx(ImgInner, { image: getIconWithVersion(icon || {}, version), width: "48", height: "48", asSVG: true })) : (jsx("span", { className: `text-h4 ${styleMap.iconText}`, children: i + 1 })) }) }, String(i)));
|
|
3949
3951
|
|
|
3950
3952
|
const containerStyles = {
|
|
3951
3953
|
'horizontal-list': 'mx-auto mt-5 w-fit',
|
|
@@ -4121,7 +4123,7 @@
|
|
|
4121
4123
|
const Tabs = JSX((props) => {
|
|
4122
4124
|
const { className = '', tabs, showCounter, isSticky, tabsMode, ...rest } = props;
|
|
4123
4125
|
const [currentTab, setCurrentTab] = useState(tabs ? tabs[0] : undefined);
|
|
4124
|
-
useEffect(() =>
|
|
4126
|
+
useEffect(() => defaultEventBus.subscribe('tab', (event) => {
|
|
4125
4127
|
const tab = tabs?.find(checkTab(event));
|
|
4126
4128
|
if (event.type === 'link' && tab) {
|
|
4127
4129
|
setCurrentTab(tab);
|
|
@@ -4129,11 +4131,11 @@
|
|
|
4129
4131
|
return [];
|
|
4130
4132
|
}), [tabs]);
|
|
4131
4133
|
useEffect(() => currentTab?.type === 'group'
|
|
4132
|
-
?
|
|
4134
|
+
? defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref })
|
|
4133
4135
|
: undefined, [currentTab]);
|
|
4134
4136
|
const handleClick = useCallback((selectedTab) => {
|
|
4135
4137
|
if (selectedTab?.type === 'group') {
|
|
4136
|
-
|
|
4138
|
+
defaultEventBus.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
|
|
4137
4139
|
}
|
|
4138
4140
|
setCurrentTab(selectedTab);
|
|
4139
4141
|
}, []);
|
|
@@ -4347,10 +4349,10 @@
|
|
|
4347
4349
|
});
|
|
4348
4350
|
const renderTag = (tag, key) => (jsx("span", { className: "text-m-light py-2 px-2.5 border-solid border rounded-md border-gray", children: tag }, String(key)));
|
|
4349
4351
|
|
|
4350
|
-
const Tile = JSX(({ title, headingType = 'h3',
|
|
4352
|
+
const Tile = JSX(({ title, headingType = 'h3', __html, items, buttons, image, isDotted = true, listItemSize = 'M', className = '', tags, children, ...rest }) => (jsx(BlockWrapper, { className: `overflow-hidden p-9 pr-3 box-border ${getTileRightPadding(className)} ${getTileMinHeight(className)} ${className}`, ...rest, children: jsxs(BaseTile, { title: title ? (jsx(Heading, { headingType: headingType, as: "h2", title: title, className: `whitespace-pre-wrap max-w-[600px]` })) : null, buttons: renderButtonsSection(buttons, {
|
|
4351
4353
|
className: 'mt-8',
|
|
4352
4354
|
buttonClassName: 'min-w-[158px]',
|
|
4353
|
-
}), image: image?.src ? jsx(ImgInner, { className: "mt-auto ml-7", image: image }) : null, children: [
|
|
4355
|
+
}), image: image?.src ? jsx(ImgInner, { className: "mt-auto ml-7", image: image }) : null, children: [__html ? (jsx("div", { className: "max-w-[600px] mt-2.5", children: jsx(RichText, { __html: __html }) })) : null, children, jsx(List, { className: "mt-2.5", itemClassName: "mb-1.5", items: items, isDotted: isDotted, listItemSize: listItemSize }), tags?.length ? jsx(Tags, { tags: tags, className: "mt-5" }) : null] }) })));
|
|
4354
4356
|
|
|
4355
4357
|
const alignStyle = {
|
|
4356
4358
|
left: 'items-start',
|
|
@@ -4459,25 +4461,22 @@
|
|
|
4459
4461
|
}
|
|
4460
4462
|
|
|
4461
4463
|
const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
|
|
4462
|
-
function useBlockRouterProvider(
|
|
4464
|
+
function useBlockRouterProvider(scrollTarget = globalThis) {
|
|
4465
|
+
const router = useRouter();
|
|
4463
4466
|
const intersectionsMapRef = useRef(new Map());
|
|
4464
|
-
useEffect(() =>
|
|
4467
|
+
useEffect(() => blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
|
|
4465
4468
|
if (intersectionsMapRef.current) {
|
|
4466
4469
|
intersectionsMapRef.current.set(block, intersection);
|
|
4467
4470
|
}
|
|
4468
|
-
}), [
|
|
4471
|
+
}), []);
|
|
4469
4472
|
useEffect(() => {
|
|
4470
4473
|
const handleScroll = debounce(() => {
|
|
4471
|
-
if (
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
}
|
|
4475
|
-
const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
|
|
4476
|
-
if (activeBlock?.anchor) {
|
|
4477
|
-
router.replace(activeBlock.anchor);
|
|
4474
|
+
if (isScrolledEnough()) {
|
|
4475
|
+
const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
|
|
4476
|
+
trackBlock(router, activeBlock);
|
|
4478
4477
|
}
|
|
4479
|
-
else
|
|
4480
|
-
router
|
|
4478
|
+
else {
|
|
4479
|
+
trackBlock(router);
|
|
4481
4480
|
}
|
|
4482
4481
|
}, 100);
|
|
4483
4482
|
scrollTarget.addEventListener('scroll', handleScroll);
|
|
@@ -4556,7 +4555,7 @@
|
|
|
4556
4555
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
|
|
4557
4556
|
}
|
|
4558
4557
|
|
|
4559
|
-
const packageVersion = "0.8.
|
|
4558
|
+
const packageVersion = "0.8.10";
|
|
4560
4559
|
|
|
4561
4560
|
exports.Blocks = Blocks;
|
|
4562
4561
|
exports.ContentPage = ContentPage;
|