@redneckz/wildless-cms-uni-blocks 0.8.9 → 0.8.11
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +154 -138
- package/bundle/bundle.umd.min.js +1 -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/bundle/components/StepsBlock/{renderStepContent.d.ts → renderStep.d.ts} +5 -5
- package/bundle/components/Tile/TileContent.d.ts +2 -2
- package/bundle/services/BlockRouter/BlockRouter.d.ts +1 -3
- package/bundle/ui-kit/Img/ImgAsPicture.d.ts +0 -2
- package/bundle/utils/adjustHref.d.ts +3 -0
- package/bundle/utils/dirname.d.ts +1 -0
- package/bundle/utils/url.d.ts +2 -2
- package/dist/ProjectSettings.js +3 -4
- package/dist/ProjectSettings.js.map +1 -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/{lib/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/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 +4 -16
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/services/BlockRouter/BlockRouter.d.ts +1 -3
- package/dist/services/BlockRouter/BlockRouter.js +3 -9
- package/dist/services/BlockRouter/BlockRouter.js.map +1 -1
- package/dist/services/BlockRouter/useBlockRouterProvider.js +2 -10
- package/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/dist/setup-fixture.js +3 -4
- package/dist/setup-fixture.js.map +1 -1
- package/dist/ui-kit/Icon/Icon.js +5 -1
- package/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/dist/ui-kit/Img/ImgAsPicture.d.ts +0 -2
- package/dist/ui-kit/Img/ImgAsPicture.js +18 -21
- package/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/dist/utils/adjustHref.d.ts +3 -0
- package/dist/utils/adjustHref.js +14 -0
- package/dist/utils/adjustHref.js.map +1 -0
- package/dist/utils/dirname.d.ts +1 -0
- package/dist/utils/dirname.js +5 -0
- package/dist/utils/dirname.js.map +1 -0
- package/dist/utils/url.d.ts +2 -2
- package/dist/utils/url.js +1 -1
- package/dist/utils/url.js.map +1 -1
- package/dist/wlc.json +0 -1
- package/lib/ProjectSettings.js +3 -4
- package/lib/ProjectSettings.js.map +1 -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/{dist/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/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 +5 -17
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/services/BlockRouter/BlockRouter.d.ts +1 -3
- package/lib/services/BlockRouter/BlockRouter.js +2 -7
- package/lib/services/BlockRouter/BlockRouter.js.map +1 -1
- package/lib/services/BlockRouter/useBlockRouterProvider.js +2 -10
- package/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/lib/setup-fixture.js +3 -4
- package/lib/setup-fixture.js.map +1 -1
- package/lib/ui-kit/Icon/Icon.js +5 -1
- package/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/lib/ui-kit/Img/ImgAsPicture.d.ts +0 -2
- package/lib/ui-kit/Img/ImgAsPicture.js +17 -19
- package/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/lib/utils/adjustHref.d.ts +3 -0
- package/lib/utils/adjustHref.js +11 -0
- package/lib/utils/adjustHref.js.map +1 -0
- package/lib/utils/dirname.d.ts +1 -0
- package/lib/utils/dirname.js +2 -0
- package/lib/utils/dirname.js.map +1 -0
- package/lib/utils/url.d.ts +2 -2
- package/lib/utils/url.js +1 -1
- package/lib/utils/url.js.map +1 -1
- package/lib/wlc.json +0 -1
- package/mobile/bundle/bundle.umd.js +104 -95
- package/mobile/bundle/bundle.umd.min.js +1 -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/mobile/bundle/components/StepsBlock/{renderStepContent.d.ts → renderStep.d.ts} +5 -5
- package/mobile/bundle/components/Tile/TileContent.d.ts +2 -2
- package/mobile/bundle/services/BlockRouter/BlockRouter.d.ts +1 -3
- package/mobile/bundle/ui-kit/Img/ImgAsPicture.d.ts +0 -2
- package/mobile/bundle/utils/adjustHref.d.ts +3 -0
- package/mobile/bundle/utils/dirname.d.ts +1 -0
- package/mobile/bundle/utils/url.d.ts +2 -2
- package/mobile/dist/ProjectSettings.js +3 -4
- package/mobile/dist/ProjectSettings.js.map +1 -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/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 +4 -16
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/services/BlockRouter/BlockRouter.d.ts +1 -3
- package/mobile/dist/services/BlockRouter/BlockRouter.js +3 -9
- package/mobile/dist/services/BlockRouter/BlockRouter.js.map +1 -1
- package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js +2 -10
- package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/mobile/dist/setup-fixture.js +3 -4
- package/mobile/dist/setup-fixture.js.map +1 -1
- package/mobile/dist/ui-kit/Icon/Icon.js +5 -1
- package/mobile/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/mobile/dist/ui-kit/Img/ImgAsPicture.d.ts +0 -2
- package/mobile/dist/ui-kit/Img/ImgAsPicture.js +18 -21
- package/mobile/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/mobile/dist/utils/adjustHref.d.ts +3 -0
- package/mobile/dist/utils/adjustHref.js +14 -0
- package/mobile/dist/utils/adjustHref.js.map +1 -0
- package/mobile/dist/utils/dirname.d.ts +1 -0
- package/mobile/dist/utils/dirname.js +5 -0
- package/mobile/dist/utils/dirname.js.map +1 -0
- package/mobile/dist/utils/url.d.ts +2 -2
- package/mobile/dist/utils/url.js +1 -1
- package/mobile/dist/utils/url.js.map +1 -1
- package/mobile/dist/wlc.json +0 -1
- package/mobile/lib/ProjectSettings.js +3 -4
- package/mobile/lib/ProjectSettings.js.map +1 -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/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 +5 -17
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/services/BlockRouter/BlockRouter.d.ts +1 -3
- package/mobile/lib/services/BlockRouter/BlockRouter.js +2 -7
- package/mobile/lib/services/BlockRouter/BlockRouter.js.map +1 -1
- package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js +2 -10
- package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/mobile/lib/setup-fixture.js +3 -4
- package/mobile/lib/setup-fixture.js.map +1 -1
- package/mobile/lib/ui-kit/Icon/Icon.js +5 -1
- package/mobile/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/mobile/lib/ui-kit/Img/ImgAsPicture.d.ts +0 -2
- package/mobile/lib/ui-kit/Img/ImgAsPicture.js +17 -19
- package/mobile/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
- package/mobile/lib/utils/adjustHref.d.ts +3 -0
- package/mobile/lib/utils/adjustHref.js +11 -0
- package/mobile/lib/utils/adjustHref.js.map +1 -0
- package/mobile/lib/utils/dirname.d.ts +1 -0
- package/mobile/lib/utils/dirname.js +2 -0
- package/mobile/lib/utils/dirname.js.map +1 -0
- package/mobile/lib/utils/url.d.ts +2 -2
- package/mobile/lib/utils/url.js +1 -1
- package/mobile/lib/utils/url.js.map +1 -1
- package/mobile/lib/wlc.json +0 -1
- package/mobile/src/ProjectSettings.ts +4 -4
- 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/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 +5 -18
- package/mobile/src/services/BlockRouter/BlockRouter.ts +6 -9
- package/mobile/src/services/BlockRouter/useBlockRouterProvider.ts +4 -10
- package/mobile/src/setup-fixture.ts +5 -4
- package/mobile/src/ui-kit/Icon/Icon.tsx +5 -1
- package/mobile/src/ui-kit/Img/ImgAsPicture.tsx +23 -28
- package/mobile/src/utils/adjustHref.ts +17 -0
- package/mobile/src/utils/dirname.ts +1 -0
- package/mobile/src/utils/url.ts +2 -3
- package/mobile/src/wlc.json +0 -1
- package/package.json +1 -1
- package/src/ProjectSettings.ts +4 -4
- 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/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 +5 -18
- package/src/services/BlockRouter/BlockRouter.ts +6 -9
- package/src/services/BlockRouter/useBlockRouterProvider.ts +4 -10
- package/src/setup-fixture.ts +5 -4
- package/src/ui-kit/Icon/Icon.tsx +5 -1
- package/src/ui-kit/Img/ImgAsPicture.tsx +23 -28
- package/src/utils/adjustHref.ts +17 -0
- package/src/utils/dirname.ts +1 -0
- package/src/utils/url.ts +2 -3
- package/src/wlc.json +0 -1
- package/bundle/utils/checkIsIconRenderable.d.ts +0 -2
- package/dist/components/StepsBlock/renderStepContent.js +0 -19
- package/dist/components/StepsBlock/renderStepContent.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/components/StepsBlock/renderStepContent.js +0 -16
- package/lib/components/StepsBlock/renderStepContent.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/utils/checkIsIconRenderable.d.ts +0 -2
- 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/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/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/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/components/StepsBlock/renderStepContent.tsx +0 -83
- package/mobile/src/utils/checkIsIconRenderable.tsx +0 -3
- package/src/components/StepsBlock/renderStepContent.tsx +0 -83
- package/src/utils/checkIsIconRenderable.tsx +0 -3
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { Button } from '../../ui-kit/Button/Button.js';
|
|
3
|
+
import { List } from '../../ui-kit/List/List.js';
|
|
4
|
+
import { RichText } from '../../ui-kit/RichText/RichText.js';
|
|
5
|
+
import { Text } from '../../ui-kit/Text/Text.js';
|
|
6
|
+
import { assertUnreachable } from '../../utils/assertUnreachable.js';
|
|
7
|
+
import { style } from '../../utils/style.js';
|
|
8
|
+
// TODO: Create universal function for this case
|
|
9
|
+
export const renderStep = (props) =>
|
|
10
|
+
// Linter doesn't understand that switch processes all cases
|
|
11
|
+
// eslint-disable-next-line consistent-return
|
|
12
|
+
(step, i, arr) => {
|
|
13
|
+
const { type } = step;
|
|
14
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
switch (type) {
|
|
18
|
+
case 'default':
|
|
19
|
+
return renderDefaultStep(props)(step, i, arr);
|
|
20
|
+
case 'rte':
|
|
21
|
+
return _jsx(RichText, { __html: step.__html });
|
|
22
|
+
default:
|
|
23
|
+
assertUnreachable(step);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const renderDefaultStep = ({ styleMap, isMainButton, version }) => (step, i, arr) => {
|
|
27
|
+
const { label, description, button, items, isDotted } = step;
|
|
28
|
+
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)));
|
|
29
|
+
};
|
|
30
|
+
const getContainerWidth = (length) => (length < 5 ? 'w-[276px]' : 'w-[210px]');
|
|
31
|
+
//# sourceMappingURL=renderStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderStep.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStep.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAU1C,gDAAgD;AAChD,MAAM,CAAC,MAAM,UAAU,GACrB,CAAC,KAAsB,EAAE,EAAE;AAC3B,4DAA4D;AAC5D,6CAA6C;AAC7C,CAAC,IAAU,EAAE,CAAS,EAAE,GAAW,EAAS,EAAE;IAC5C,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEtB,IAAI,CAAC,CAAC,IAAI,KAAK,SAA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C,CAAC,CAAC,SAAS,CAAC,EAC5E,KAAK,EAAE,KAAK,EACZ,YAAY,EAAC,GAAG,EAChB,QAAQ,EAAE,QAAQ,GAClB,IACE,IACF,EACL,MAAM,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAC/B,KAAC,MAAM,IACL,SAAS,EAAC,mDAAmD,EAC7D,OAAO,EAAE,OAAwB,KAC7B,MAAM,YAET,MAAM,EAAE,IAAI,GACN,CACV,CAAC,CAAC,CAAC,IAAI,KA9BH,MAAM,CAAC,CAAC,CAAC,CA+BV,CACP,CAAC;AACJ,CAAC,CAAC;AAEJ,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -5,13 +5,13 @@ import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection.j
|
|
|
5
5
|
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
6
6
|
import { Img } from '../../ui-kit/Img/Img.js';
|
|
7
7
|
import { List } from '../../ui-kit/List/List.js';
|
|
8
|
-
import {
|
|
8
|
+
import { RichText } from '../../ui-kit/RichText/RichText.js';
|
|
9
9
|
import { Tags } from '../../ui-kit/Tags/Tags.js';
|
|
10
10
|
import { BaseTile } from '../BaseTile/BaseTile.js';
|
|
11
11
|
import { getTileMinHeight } from '../BaseTile/getTileMinHeight.js';
|
|
12
12
|
import { getTileRightPadding } from '../BaseTile/getTileRightPadding.js';
|
|
13
|
-
export const Tile = JSX(({ title, headingType = 'h3',
|
|
13
|
+
export 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, {
|
|
14
14
|
className: 'mt-8',
|
|
15
15
|
buttonClassName: 'min-w-[158px]',
|
|
16
|
-
}), image: image?.src ? _jsx(Img, { className: "mt-auto ml-7", image: image }) : null, children: [
|
|
16
|
+
}), image: image?.src ? _jsx(Img, { 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] }) })));
|
|
17
17
|
//# sourceMappingURL=Tile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tile.js","sourceRoot":"","sources":["../../../src/components/Tile/Tile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Tile.js","sourceRoot":"","sources":["../../../src/components/Tile/Tile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,GA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ACR,cAAK,SAAS,EAAC,sBAAsB,YACnC,KAAC,QAAQ,IAAC,MAAM,EAAE,MAAM,GAAI,GACxB,CACP,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,EACT,KAAC,IAAI,IACH,SAAS,EAAC,QAAQ,EAClB,aAAa,EAAC,QAAQ,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,GAC1B,EACD,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,IACnD,GACE,CAChB,CACF,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
-
import type { DescriptionProps } from '../../model/HeadlineType';
|
|
3
2
|
import type { Picture } from '../../model/Picture';
|
|
4
3
|
import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
|
|
5
4
|
import type { HeadingCommonProps } from '../../ui-kit/Heading/HeadingProps';
|
|
6
5
|
import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
7
6
|
import type { ListItemSize } from '../../ui-kit/List/ListProps';
|
|
7
|
+
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
8
8
|
import type { TagsContent } from '../../ui-kit/Tags/TagsContent';
|
|
9
9
|
/**
|
|
10
10
|
* @title Плитка
|
|
11
11
|
*/
|
|
12
|
-
export declare type TileContent = HeadingCommonProps &
|
|
12
|
+
export declare type TileContent = HeadingCommonProps & RichTextProps & ListContent & ButtonContent & TagsContent & {
|
|
13
13
|
/**
|
|
14
14
|
* @default {
|
|
15
15
|
* "format": "webp",
|
|
@@ -1,37 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { isHash, isLocalURL, joinPath } from '../utils/url.js';
|
|
1
|
+
import { adjustHref } from '../utils/adjustHref.js';
|
|
2
|
+
import { isLocalURL } from '../utils/url.js';
|
|
4
3
|
import { handlerDecorator } from './handlerDecorator.js';
|
|
5
4
|
import { useRouter } from './useRouter.js';
|
|
6
5
|
export function useLink(isRemote) {
|
|
7
6
|
const router = useRouter();
|
|
8
7
|
return (props) => ({
|
|
9
8
|
...props,
|
|
10
|
-
href: adjustHref(props.href),
|
|
9
|
+
href: isRemote ? props.href : adjustHref(router)(props.href),
|
|
11
10
|
'aria-label': props.text,
|
|
12
11
|
onClick: handlerDecorator(handleHref(props), props),
|
|
13
12
|
});
|
|
14
|
-
function adjustHref(href) {
|
|
15
|
-
const isRelativeToBase = !isRemote && href?.startsWith('/');
|
|
16
|
-
return projectSettings.BASE_PATH && href && isRelativeToBase
|
|
17
|
-
? joinPath(projectSettings.BASE_PATH, href)
|
|
18
|
-
: href;
|
|
19
|
-
}
|
|
20
13
|
function handleHref({ href, target, onClick }) {
|
|
21
14
|
return (ev) => {
|
|
22
15
|
onClick && onClick(ev);
|
|
23
|
-
if (isRemote || !isLocalURL(href, target)) {
|
|
16
|
+
if (!href || isRemote || !isLocalURL(href, target)) {
|
|
24
17
|
// Default routing
|
|
25
18
|
return;
|
|
26
19
|
}
|
|
27
20
|
// Client routing
|
|
28
21
|
ev?.preventDefault();
|
|
29
|
-
|
|
30
|
-
gotoBlock(router, href);
|
|
31
|
-
}
|
|
32
|
-
else if (href) {
|
|
33
|
-
router.push(href);
|
|
34
|
-
}
|
|
22
|
+
router.push(href);
|
|
35
23
|
};
|
|
36
24
|
}
|
|
37
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLink.js","sourceRoot":"","sources":["../../src/hooks/useLink.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useLink.js","sourceRoot":"","sources":["../../src/hooks/useLink.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAUxC,MAAM,UAAU,OAAO,CAAC,QAAkB;IACxC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,OAAO,CAA2C,KAAQ,EAAiB,EAAE,CAAC,CAAC;QAC7E,GAAG,KAAK;QACR,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5D,YAAY,EAAE,KAAK,CAAC,IAAI;QACxB,OAAO,EAAE,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;KACpD,CAAC,CAAC;IAEH,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAkC;QAC3E,OAAO,CAAC,EAAqB,EAAE,EAAE;YAC/B,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC;YAEvB,IAAI,CAAC,IAAI,IAAI,QAAQ,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE;gBAClD,kBAAkB;gBAClB,OAAO;aACR;YAED,iBAAiB;YACjB,EAAE,EAAE,cAAc,EAAE,CAAC;YACrB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import type { Router } from '../../hooks/useRouter';
|
|
2
1
|
import type { BlockDef } from '../../model/ContentPageDef';
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function trackBlock(router: Router, block?: BlockDef): void;
|
|
2
|
+
export declare function trackBlock(block?: BlockDef): void;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
const normalizeAnchor = (anchor) => anchor?.replace('#', '') || '';
|
|
2
|
-
export function
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export function trackBlock(router, block) {
|
|
6
|
-
router.replace(`#${normalizeAnchor(block?.anchor)}`, undefined, {
|
|
7
|
-
scroll: false,
|
|
8
|
-
});
|
|
2
|
+
export function trackBlock(block) {
|
|
3
|
+
globalThis.history?.replaceState(globalThis.history?.state, '', `#${normalizeAnchor(block?.anchor)}`);
|
|
9
4
|
}
|
|
10
5
|
//# sourceMappingURL=BlockRouter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockRouter.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/BlockRouter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BlockRouter.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/BlockRouter.ts"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG,CAAC,MAAe,EAAE,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAE5E,MAAM,UAAU,UAAU,CAAC,KAAgB;IACzC,UAAU,CAAC,OAAO,EAAE,YAAY,CAC9B,UAAU,CAAC,OAAO,EAAE,KAAK,EACzB,EAAE,EACF,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CACrC,CAAC;AACJ,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { useEffect, useRef } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
import { useRouter } from '../../hooks/useRouter.js';
|
|
3
2
|
import { debounce } from '../../utils/debounce.js';
|
|
4
3
|
import { trackBlock } from './BlockRouter.js';
|
|
5
4
|
import { blockRouterEventBus } from './blockRouterEventBus.js';
|
|
6
5
|
import { findActiveBlock } from './findActiveBlock.js';
|
|
7
6
|
const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
|
|
8
7
|
export function useBlockRouterProvider(scrollTarget = globalThis) {
|
|
9
|
-
const router = useRouter();
|
|
10
8
|
const intersectionsMapRef = useRef(new Map());
|
|
11
9
|
useEffect(() => blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
|
|
12
10
|
if (intersectionsMapRef.current) {
|
|
@@ -15,19 +13,13 @@ export function useBlockRouterProvider(scrollTarget = globalThis) {
|
|
|
15
13
|
}), []);
|
|
16
14
|
useEffect(() => {
|
|
17
15
|
const handleScroll = debounce(() => {
|
|
18
|
-
|
|
19
|
-
const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
|
|
20
|
-
trackBlock(router, activeBlock);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
trackBlock(router);
|
|
24
|
-
}
|
|
16
|
+
trackBlock(isScrolledEnough() ? findActiveBlock([...(intersectionsMapRef.current || [])]) : undefined);
|
|
25
17
|
}, 100);
|
|
26
18
|
scrollTarget.addEventListener('scroll', handleScroll);
|
|
27
19
|
return () => {
|
|
28
20
|
handleScroll.dispose();
|
|
29
21
|
scrollTarget.removeEventListener('scroll', handleScroll);
|
|
30
22
|
};
|
|
31
|
-
}, [
|
|
23
|
+
}, [scrollTarget]);
|
|
32
24
|
}
|
|
33
25
|
//# sourceMappingURL=useBlockRouterProvider.js.map
|
|
@@ -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;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC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3
|
import { handlerDecorator } from './hooks/handlerDecorator.js';
|
|
4
4
|
import { useRouter } from './hooks/useRouter.js';
|
|
5
5
|
import { projectSettings } from './ProjectSettings.js';
|
|
6
|
+
import { joinPath } from './utils/url.js';
|
|
6
7
|
import wlc from './wlc.json.js';
|
|
7
8
|
projectSettings.setup(wlc);
|
|
8
9
|
useRouter.setup(() => {
|
|
9
|
-
const [href, setHref] = useState(
|
|
10
|
+
const [href, setHref] = useState(joinPath(globalThis.location.origin, projectSettings.BASE_PATH, 'cards-credit'));
|
|
10
11
|
useEffect(() => {
|
|
11
12
|
const handleHistoryChange = () => {
|
|
12
13
|
setHref(globalThis.location.href);
|
|
@@ -18,9 +19,7 @@ useRouter.setup(() => {
|
|
|
18
19
|
}, []);
|
|
19
20
|
return {
|
|
20
21
|
href,
|
|
21
|
-
pathname: projectSettings.BASE_PATH
|
|
22
|
-
? new URL(href).pathname.substring(projectSettings.BASE_PATH.length - 1)
|
|
23
|
-
: '',
|
|
22
|
+
pathname: new URL(href).pathname.substring(projectSettings.BASE_PATH ? projectSettings.BASE_PATH.length - 1 : 0),
|
|
24
23
|
query: {},
|
|
25
24
|
push: (url) => {
|
|
26
25
|
globalThis.history.pushState(null, '', url);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-fixture.js","sourceRoot":"","sources":["../src/setup-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAE3B,SAAS,CAAC,KAAK,CAAC,GAAG,EA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Ae,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CACrE;QACD,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;YACpB,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE;YACvB,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;QACjD,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,KAAK,CAAC,CAAC,OAAO,EAAO,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE;IAC9C,EAAE,CAAC,cAAc,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,CAAC;AACd,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { useRouter } from '../../hooks/useRouter.js';
|
|
3
4
|
import { projectSettings } from '../../ProjectSettings.js';
|
|
5
|
+
import { adjustHref } from '../../utils/adjustHref.js';
|
|
4
6
|
import { style } from '../../utils/style.js';
|
|
7
|
+
import { joinPath } from '../../utils/url.js';
|
|
5
8
|
const svgUseStyleMap = {
|
|
6
9
|
normal: '',
|
|
7
10
|
color: 'text-primary-main',
|
|
@@ -9,7 +12,8 @@ const svgUseStyleMap = {
|
|
|
9
12
|
white: 'text-black',
|
|
10
13
|
};
|
|
11
14
|
export const Icon = JSX(({ className = '', imageClassName = '', name = '', alt = `Иконка ${name}`, title = alt, iconVersion = 'color', asSVG, ...imgProps }) => {
|
|
12
|
-
const
|
|
15
|
+
const router = useRouter();
|
|
16
|
+
const href = adjustHref(router)(joinPath(projectSettings.CDN, '/icons', `${name}.svg`));
|
|
13
17
|
if (asSVG && iconVersion !== 'normal') {
|
|
14
18
|
return (_jsx(Background, { className: className, children: _jsxs("svg", { className: style(getSvgSize(imgProps.width), svgUseStyleMap[iconVersion], iconVersion === 'white' ? 'invert' : '', imageClassName), ...imgProps, "aria-hidden": "true", children: [title ? _jsx("title", { children: title }) : null, alt ? _jsx("desc", { children: alt }) : null, _jsx("use", { href: `${href}#icon`, xlinkHref: `${href}#icon` })] }) }));
|
|
15
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/ui-kit/Icon/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/ui-kit/Icon/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,MAAM,cAAc,GAAgC;IAClD,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,mBAAmB;IAC1B,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,YAAY;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CACrB,CAAC,EACC,SAAS,GAAG,EAAE,EACd,cAAc,GAAG,EAAE,EACnB,IAAI,GAAG,EAAE,EACT,GAAG,GAAG,UAAU,IAAI,EAAE,EACtB,KAAK,GAAG,GAAG,EACX,WAAW,GAAG,OAAO,EACrB,KAAK,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AE,SAAS,YAAG,QAAQ,GAAO,CAAC,CAAC,CAAC,QAAQ,CACnE,CAAC"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import type { ImgSource } from '../../model/Picture';
|
|
2
1
|
import type { ImageProps } from './ImgProps';
|
|
3
2
|
export declare const ImgAsPicture: import("@redneckz/uni-jsx").UNIComponent<ImageProps, any, any>;
|
|
4
|
-
export declare function formatToMimeType(format: ImgSource['format']): string | undefined;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return 0;
|
|
8
|
-
};
|
|
3
|
+
import { useRouter } from '../../hooks/useRouter.js';
|
|
4
|
+
import { adjustHref } from '../../utils/adjustHref.js';
|
|
5
|
+
import { isURL, joinPath } from '../../utils/url.js';
|
|
6
|
+
const sourcesComparator = (a, b) => a?.media && b?.media ? a.media - b.media : 0;
|
|
9
7
|
export const ImgAsPicture = JSX(({ className = '', image, imageClassName = '', isMobile = false, pathPrefix }) => {
|
|
10
|
-
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
8
|
+
const router = useRouter();
|
|
13
9
|
const pictureStyles = isMobile ? 'flex' : 'flex-none';
|
|
14
10
|
return (_jsxs("picture", { className: `${pictureStyles} ${className}`, children: [image?.sources?.length
|
|
15
11
|
? image.sources
|
|
12
|
+
.filter((_) => _?.src)
|
|
16
13
|
.sort(sourcesComparator)
|
|
17
|
-
.map(({ src, format, media }, index) => (_jsx("source", { srcSet:
|
|
18
|
-
: null,
|
|
14
|
+
.map(({ src, format, media }, index) => (_jsx("source", { srcSet: adjustSrcset(router, pathPrefix)(src), type: formatToMimeType(format), media: media ? `(max-width: ${media}px)` : '', ...image.size }, `${index}_${src}`)))
|
|
15
|
+
: null, image?.src
|
|
16
|
+
? renderImg({ ...image, src: adjustSrcset(router, pathPrefix)(image.src) }, imageClassName, isMobile)
|
|
17
|
+
: null] }));
|
|
19
18
|
});
|
|
20
19
|
const renderImg = (image, imageClassName = '', isMobile = false) => {
|
|
21
20
|
const style = {
|
|
@@ -27,13 +26,12 @@ const renderImg = (image, imageClassName = '', isMobile = false) => {
|
|
|
27
26
|
const imgStyle = isMobile ? 'm-auto' : 'm-0';
|
|
28
27
|
return (_jsx("img", { src: image.src, className: `${imgStyle} ${imageClassName}`, alt: alt, title: title, style: style, ...image.size }));
|
|
29
28
|
};
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
.map((src) =>
|
|
29
|
+
const adjustSrcset = (router, pathPrefix) => (srcset) => srcset
|
|
30
|
+
?.split(/\s*,\s*/)
|
|
31
|
+
.map((src) => src.trim())
|
|
32
|
+
.filter(Boolean)
|
|
33
|
+
.map((src) => (isURL(src) ? src : joinPath(pathPrefix, src)))
|
|
34
|
+
.map(adjustHref(router))
|
|
35
35
|
.join(', ');
|
|
36
|
-
|
|
37
|
-
return format ? `image/${String(format)}` : undefined;
|
|
38
|
-
}
|
|
36
|
+
const formatToMimeType = (format) => format ? `image/${String(format)}` : undefined;
|
|
39
37
|
//# sourceMappingURL=ImgAsPicture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImgAsPicture.js","sourceRoot":"","sources":["../../../src/ui-kit/Img/ImgAsPicture.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ImgAsPicture.js","sourceRoot":"","sources":["../../../src/ui-kit/Img/ImgAsPicture.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAU,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD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;KACjB,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;KACxB,MAAM,CAAC,OAAO,CAAC;KACf,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;KAC5D,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;KACvB,IAAI,CAAC,IAAI,CAAC,CAAC;AAEhB,MAAM,gBAAgB,GAAG,CAAC,MAA2B,EAAE,EAAE,CACvD,MAAM,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { projectSettings } from '../ProjectSettings.js';
|
|
2
|
+
import { dirname } from './dirname.js';
|
|
3
|
+
import { isURL, joinPath } from './url.js';
|
|
4
|
+
export const adjustHref = (router) => (href) => {
|
|
5
|
+
if (!href || isURL(href) || (projectSettings.CDN && href.startsWith(projectSettings.CDN))) {
|
|
6
|
+
return href;
|
|
7
|
+
}
|
|
8
|
+
const isRelativeToBase = href.startsWith('/');
|
|
9
|
+
return joinPath(projectSettings.BASE_PATH, isRelativeToBase ? '/' : dirname(router.pathname), href);
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=adjustHref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjustHref.js","sourceRoot":"","sources":["../../src/utils/adjustHref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAA4B,EAAE,EAAE,CAAC,CAAC,IAAwB,EAAE,EAAE;IACvF,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE;QACzF,OAAO,IAAI,CAAC;KACb;IAED,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAE9C,OAAO,QAAQ,CACb,eAAe,CAAC,SAAS,EACzB,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EACjD,IAAI,CACL,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dirname: (path: string | undefined) => string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dirname.js","sourceRoot":"","sources":["../../src/utils/dirname.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAwB,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Target } from '../model/LinkProps';
|
|
2
|
-
export declare const isURL: (href?: string) => href is `${string}
|
|
2
|
+
export declare const isURL: (href?: string) => href is `${string}:${string}`;
|
|
3
3
|
export declare const isLocalURL: (href: string | undefined, target?: Target) => boolean;
|
|
4
4
|
export declare const isHash: (href?: string) => href is `#${string}`;
|
|
5
5
|
export declare const withoutQuery: (href?: string) => string;
|
|
6
|
-
export declare const joinPath: (...path: string[]) => string;
|
|
6
|
+
export declare const joinPath: (...path: (string | undefined)[]) => string;
|
package/mobile/lib/utils/url.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const isURL = (href) => Boolean(href?.includes('
|
|
1
|
+
export const isURL = (href) => Boolean(href?.includes(':'));
|
|
2
2
|
export const isLocalURL = (href, target) => Boolean(href && !isURL(href) && (!target || target === '_self'));
|
|
3
3
|
export const isHash = (href) => Boolean(href?.startsWith('#'));
|
|
4
4
|
export const withoutQuery = (href) => (href || '').replace(/\?.*/, '').replace(/\/$/, '');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAa,
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAa,EAAiC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAEpG,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAwB,EAAE,MAAe,EAAE,EAAE,CACtE,OAAO,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,IAAa,EAAwB,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AAE9F,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAa,EAAU,EAAE,CACpD,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAEtD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAG,IAA4B,EAAU,EAAE,CAClE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"}
|
package/mobile/lib/wlc.json
CHANGED
|
@@ -43,12 +43,10 @@ export const projectSettings = new (class implements ProjectSettings {
|
|
|
43
43
|
return this._.FOOTER;
|
|
44
44
|
}
|
|
45
45
|
get CDN() {
|
|
46
|
-
return this._.CDN;
|
|
46
|
+
return appendSlash(this._.CDN);
|
|
47
47
|
}
|
|
48
48
|
get BASE_PATH() {
|
|
49
|
-
return this._.BASE_PATH
|
|
50
|
-
? `${this._.BASE_PATH}/`
|
|
51
|
-
: this._.BASE_PATH;
|
|
49
|
+
return appendSlash(this._.BASE_PATH);
|
|
52
50
|
}
|
|
53
51
|
get YANDEX_MAP_API_KEY() {
|
|
54
52
|
return this._.YANDEX_MAP_API_KEY;
|
|
@@ -57,3 +55,5 @@ export const projectSettings = new (class implements ProjectSettings {
|
|
|
57
55
|
return this._.YANDEX_METRIKA_ID;
|
|
58
56
|
}
|
|
59
57
|
})();
|
|
58
|
+
|
|
59
|
+
const appendSlash = (url: string | undefined) => (url && !url.endsWith('/') ? `${url}/` : url);
|
|
@@ -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,
|