@redneckz/wildless-cms-uni-blocks 0.14.293 → 0.14.294
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.14.294.js +23 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +104 -89
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/CalculatorContent.d.ts +1 -8
- package/bundle/components/Calculator/EmbeddableCalcBlocks.d.ts +1 -3
- package/bundle/components/Calculator/constants.d.ts +0 -5
- package/bundle/components/CalculatorBonus/CalculatorBonus.d.ts +9 -0
- package/bundle/components/CalculatorBonus/CalculatorBonusContent.d.ts +12 -0
- package/bundle/ui-kit/Calculator/CalculatorLayout.d.ts +5 -0
- package/{mobile/dist/components → bundle/ui-kit}/Calculator/renderRate.d.ts +1 -1
- package/bundle/{components → ui-kit}/Calculator/renderWantedSumInput.d.ts +1 -1
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Blocks.mobile.js +2 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js +4 -4
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/CalculatorContent.d.ts +1 -8
- package/dist/components/Calculator/CreditCalculatorForm.js +4 -4
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.js +4 -4
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/EmbeddableCalcBlocks.d.ts +1 -3
- package/dist/components/Calculator/EmbeddableCalcBlocks.js +0 -2
- package/dist/components/Calculator/EmbeddableCalcBlocks.js.map +1 -1
- package/dist/components/Calculator/RefinancingCalculatorForm.js +4 -4
- package/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/constants.d.ts +0 -5
- package/dist/components/Calculator/constants.js +1 -16
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/CalculatorBonus/CalculatorBonus.d.ts +9 -0
- package/dist/components/CalculatorBonus/CalculatorBonus.js +46 -0
- package/dist/components/CalculatorBonus/CalculatorBonus.js.map +1 -0
- package/dist/components/CalculatorBonus/CalculatorBonusContent.d.ts +12 -0
- package/dist/components/CalculatorBonus/CalculatorBonusContent.js +2 -0
- package/dist/components/CalculatorBonus/CalculatorBonusContent.js.map +1 -0
- package/dist/components/CalculatorBonus/getBonus.js +25 -0
- package/dist/components/CalculatorBonus/getBonus.js.map +1 -0
- package/dist/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.js +13 -2
- package/dist/components/CalculatorBonus/getBonusCalculatorParams.js.map +1 -0
- package/dist/ui-kit/Calculator/CalculatorLayout.d.ts +5 -0
- package/dist/ui-kit/Calculator/CalculatorLayout.js +9 -0
- package/dist/ui-kit/Calculator/CalculatorLayout.js.map +1 -0
- package/dist/{components → ui-kit}/Calculator/CalculatorValueBlock.js +1 -1
- package/dist/ui-kit/Calculator/CalculatorValueBlock.js.map +1 -0
- package/dist/{components → ui-kit}/Calculator/Rate.js +1 -1
- package/dist/ui-kit/Calculator/Rate.js.map +1 -0
- package/{mobile/dist/components → dist/ui-kit}/Calculator/renderFootnote.js +1 -1
- package/dist/ui-kit/Calculator/renderFootnote.js.map +1 -0
- package/dist/{components → ui-kit}/Calculator/renderRate.d.ts +1 -1
- package/{mobile/dist/components → dist/ui-kit}/Calculator/renderRate.js +1 -1
- package/dist/ui-kit/Calculator/renderRate.js.map +1 -0
- package/{lib/components → dist/ui-kit}/Calculator/renderWantedSumInput.d.ts +1 -1
- package/{mobile/dist/components → dist/ui-kit}/Calculator/renderWantedSumInput.js +1 -1
- package/dist/ui-kit/Calculator/renderWantedSumInput.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Blocks.mobile.js +2 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js +4 -4
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/Calculator.fixture.d.ts +0 -1
- package/lib/components/Calculator/Calculator.fixture.mobile.d.ts +0 -1
- package/lib/components/Calculator/CalculatorContent.d.ts +1 -8
- package/lib/components/Calculator/CreditCalculatorForm.js +4 -4
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.js +4 -4
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/EmbeddableCalcBlocks.d.ts +1 -3
- package/lib/components/Calculator/EmbeddableCalcBlocks.js +0 -2
- package/lib/components/Calculator/EmbeddableCalcBlocks.js.map +1 -1
- package/lib/components/Calculator/RefinancingCalculatorForm.js +4 -4
- package/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/constants.d.ts +0 -5
- package/lib/components/Calculator/constants.js +0 -15
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/CalculatorBonus/CalculatorBonus.d.ts +9 -0
- package/lib/components/CalculatorBonus/CalculatorBonus.fixture.d.ts +6 -0
- package/lib/components/CalculatorBonus/CalculatorBonus.js +44 -0
- package/lib/components/CalculatorBonus/CalculatorBonus.js.map +1 -0
- package/lib/components/CalculatorBonus/CalculatorBonusContent.d.ts +12 -0
- package/lib/components/CalculatorBonus/CalculatorBonusContent.js +2 -0
- package/lib/components/CalculatorBonus/CalculatorBonusContent.js.map +1 -0
- package/lib/components/{Calculator → CalculatorBonus}/getBonus.js +13 -1
- package/lib/components/CalculatorBonus/getBonus.js.map +1 -0
- package/{mobile/lib/components/Calculator → lib/components/CalculatorBonus}/getBonusCalculatorParams.js +12 -1
- package/lib/components/CalculatorBonus/getBonusCalculatorParams.js.map +1 -0
- package/lib/ui-kit/Calculator/CalculatorLayout.d.ts +5 -0
- package/lib/ui-kit/Calculator/CalculatorLayout.js +7 -0
- package/lib/ui-kit/Calculator/CalculatorLayout.js.map +1 -0
- package/{mobile/lib/components → lib/ui-kit}/Calculator/CalculatorValueBlock.js +1 -1
- package/lib/ui-kit/Calculator/CalculatorValueBlock.js.map +1 -0
- package/lib/{components → ui-kit}/Calculator/Rate.js +1 -1
- package/lib/ui-kit/Calculator/Rate.js.map +1 -0
- package/{mobile/lib/components → lib/ui-kit}/Calculator/renderFootnote.js +1 -1
- package/lib/ui-kit/Calculator/renderFootnote.js.map +1 -0
- package/lib/{components → ui-kit}/Calculator/renderRate.d.ts +1 -1
- package/{mobile/lib/components → lib/ui-kit}/Calculator/renderRate.js +1 -1
- package/lib/ui-kit/Calculator/renderRate.js.map +1 -0
- package/{dist/components → lib/ui-kit}/Calculator/renderWantedSumInput.d.ts +1 -1
- package/{mobile/lib/components → lib/ui-kit}/Calculator/renderWantedSumInput.js +1 -1
- package/lib/ui-kit/Calculator/renderWantedSumInput.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +104 -89
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +1 -8
- package/mobile/bundle/components/Calculator/EmbeddableCalcBlocks.d.ts +1 -3
- package/mobile/bundle/components/Calculator/constants.d.ts +0 -5
- package/mobile/bundle/components/CalculatorBonus/CalculatorBonus.d.ts +9 -0
- package/mobile/bundle/components/CalculatorBonus/CalculatorBonusContent.d.ts +12 -0
- package/mobile/bundle/ui-kit/Calculator/CalculatorLayout.d.ts +5 -0
- package/mobile/bundle/{components → ui-kit}/Calculator/renderRate.d.ts +1 -1
- package/mobile/bundle/{components → ui-kit}/Calculator/renderWantedSumInput.d.ts +1 -1
- package/mobile/dist/components/Blocks.js +2 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +4 -4
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/CalculatorContent.d.ts +1 -8
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js +4 -4
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +4 -4
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/EmbeddableCalcBlocks.d.ts +1 -3
- package/mobile/dist/components/Calculator/EmbeddableCalcBlocks.js +0 -2
- package/mobile/dist/components/Calculator/EmbeddableCalcBlocks.js.map +1 -1
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js +4 -4
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.d.ts +0 -5
- package/mobile/dist/components/Calculator/constants.js +1 -16
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/CalculatorBonus/CalculatorBonus.d.ts +9 -0
- package/mobile/dist/components/CalculatorBonus/CalculatorBonus.js +46 -0
- package/mobile/dist/components/CalculatorBonus/CalculatorBonus.js.map +1 -0
- package/mobile/dist/components/CalculatorBonus/CalculatorBonusContent.d.ts +12 -0
- package/mobile/dist/components/CalculatorBonus/CalculatorBonusContent.js +2 -0
- package/mobile/dist/components/CalculatorBonus/CalculatorBonusContent.js.map +1 -0
- package/mobile/dist/components/CalculatorBonus/getBonus.js +25 -0
- package/mobile/dist/components/CalculatorBonus/getBonus.js.map +1 -0
- package/mobile/dist/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.js +13 -2
- package/mobile/dist/components/CalculatorBonus/getBonusCalculatorParams.js.map +1 -0
- package/mobile/dist/ui-kit/Calculator/CalculatorLayout.d.ts +5 -0
- package/mobile/dist/ui-kit/Calculator/CalculatorLayout.js +9 -0
- package/mobile/dist/ui-kit/Calculator/CalculatorLayout.js.map +1 -0
- package/mobile/dist/{components → ui-kit}/Calculator/CalculatorValueBlock.js +1 -1
- package/mobile/dist/ui-kit/Calculator/CalculatorValueBlock.js.map +1 -0
- package/mobile/dist/{components → ui-kit}/Calculator/Rate.js +1 -1
- package/mobile/dist/ui-kit/Calculator/Rate.js.map +1 -0
- package/{dist/components → mobile/dist/ui-kit}/Calculator/renderFootnote.js +1 -1
- package/mobile/dist/ui-kit/Calculator/renderFootnote.js.map +1 -0
- package/{bundle/components → mobile/dist/ui-kit}/Calculator/renderRate.d.ts +1 -1
- package/{dist/components → mobile/dist/ui-kit}/Calculator/renderRate.js +1 -1
- package/mobile/dist/ui-kit/Calculator/renderRate.js.map +1 -0
- package/mobile/dist/ui-kit/Calculator/renderWantedSumInput.d.ts +7 -0
- package/{dist/components → mobile/dist/ui-kit}/Calculator/renderWantedSumInput.js +1 -1
- package/mobile/dist/ui-kit/Calculator/renderWantedSumInput.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Blocks.js +2 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +4 -4
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/CalculatorContent.d.ts +1 -8
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js +4 -4
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +4 -4
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/EmbeddableCalcBlocks.d.ts +1 -3
- package/mobile/lib/components/Calculator/EmbeddableCalcBlocks.js +0 -2
- package/mobile/lib/components/Calculator/EmbeddableCalcBlocks.js.map +1 -1
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js +4 -4
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.d.ts +0 -5
- package/mobile/lib/components/Calculator/constants.js +0 -15
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/CalculatorBonus/CalculatorBonus.d.ts +9 -0
- package/mobile/lib/components/CalculatorBonus/CalculatorBonus.js +44 -0
- package/mobile/lib/components/CalculatorBonus/CalculatorBonus.js.map +1 -0
- package/mobile/lib/components/CalculatorBonus/CalculatorBonusContent.d.ts +12 -0
- package/mobile/lib/components/CalculatorBonus/CalculatorBonusContent.js +2 -0
- package/mobile/lib/components/CalculatorBonus/CalculatorBonusContent.js.map +1 -0
- package/mobile/lib/components/{Calculator → CalculatorBonus}/getBonus.js +13 -1
- package/mobile/lib/components/CalculatorBonus/getBonus.js.map +1 -0
- package/{lib/components/Calculator → mobile/lib/components/CalculatorBonus}/getBonusCalculatorParams.js +12 -1
- package/mobile/lib/components/CalculatorBonus/getBonusCalculatorParams.js.map +1 -0
- package/mobile/lib/ui-kit/Calculator/CalculatorLayout.d.ts +5 -0
- package/mobile/lib/ui-kit/Calculator/CalculatorLayout.js +7 -0
- package/mobile/lib/ui-kit/Calculator/CalculatorLayout.js.map +1 -0
- package/{lib/components → mobile/lib/ui-kit}/Calculator/CalculatorValueBlock.js +1 -1
- package/mobile/lib/ui-kit/Calculator/CalculatorValueBlock.js.map +1 -0
- package/mobile/lib/{components → ui-kit}/Calculator/Rate.js +1 -1
- package/mobile/lib/ui-kit/Calculator/Rate.js.map +1 -0
- package/{lib/components → mobile/lib/ui-kit}/Calculator/renderFootnote.js +1 -1
- package/mobile/lib/ui-kit/Calculator/renderFootnote.js.map +1 -0
- package/mobile/lib/ui-kit/Calculator/renderRate.d.ts +8 -0
- package/{lib/components → mobile/lib/ui-kit}/Calculator/renderRate.js +1 -1
- package/mobile/lib/ui-kit/Calculator/renderRate.js.map +1 -0
- package/mobile/lib/ui-kit/Calculator/renderWantedSumInput.d.ts +7 -0
- package/{lib/components → mobile/lib/ui-kit}/Calculator/renderWantedSumInput.js +1 -1
- package/mobile/lib/ui-kit/Calculator/renderWantedSumInput.js.map +1 -0
- package/mobile/src/components/Blocks.ts +2 -0
- package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +4 -4
- package/mobile/src/components/Calculator/CalculatorContent.ts +1 -11
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +4 -4
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +4 -4
- package/mobile/src/components/Calculator/EmbeddableCalcBlocks.tsx +0 -3
- package/mobile/src/components/Calculator/RefinancingCalculatorForm.tsx +4 -4
- package/mobile/src/components/Calculator/constants.ts +0 -18
- package/mobile/src/components/CalculatorBonus/CalculatorBonus.example.json +1 -0
- package/mobile/src/components/CalculatorBonus/CalculatorBonus.tsx +75 -0
- package/mobile/src/components/CalculatorBonus/CalculatorBonus.ui.json +1 -0
- package/mobile/src/components/CalculatorBonus/CalculatorBonusContent.ts +16 -0
- package/mobile/src/components/{Calculator → CalculatorBonus}/getBonus.ts +15 -1
- package/mobile/src/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.ts +13 -1
- package/mobile/src/ui-kit/Calculator/CalculatorLayout.tsx +17 -0
- package/mobile/src/{components → ui-kit}/Calculator/CalculatorValueBlock.tsx +1 -1
- package/mobile/src/{components → ui-kit}/Calculator/Rate.tsx +1 -1
- package/mobile/src/{components → ui-kit}/Calculator/renderFootnote.tsx +1 -1
- package/mobile/src/{components → ui-kit}/Calculator/renderRate.tsx +1 -1
- package/mobile/src/{components → ui-kit}/Calculator/renderWantedSumInput.tsx +2 -2
- package/package.json +1 -1
- package/src/components/Blocks.mobile.ts +2 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +4 -4
- package/src/components/Calculator/Calculator.fixture.mobile.tsx +0 -24
- package/src/components/Calculator/Calculator.fixture.tsx +0 -33
- package/src/components/Calculator/CalculatorContent.ts +1 -11
- package/src/components/Calculator/CreditCalculatorForm.tsx +4 -4
- package/src/components/Calculator/DepositCalculatorForm.tsx +4 -4
- package/src/components/Calculator/EmbeddableCalcBlocks.tsx +0 -3
- package/src/components/Calculator/RefinancingCalculatorForm.tsx +4 -4
- package/src/components/Calculator/constants.ts +0 -18
- package/src/components/CalculatorBonus/CalculatorBonus.example.json +1 -0
- package/src/components/CalculatorBonus/CalculatorBonus.fixture.tsx +34 -0
- package/src/components/CalculatorBonus/CalculatorBonus.tsx +75 -0
- package/src/components/CalculatorBonus/CalculatorBonus.ui.json +1 -0
- package/src/components/CalculatorBonus/CalculatorBonusContent.ts +16 -0
- package/src/components/{Calculator → CalculatorBonus}/getBonus.ts +15 -1
- package/src/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.ts +13 -1
- package/src/ui-kit/Calculator/CalculatorLayout.tsx +17 -0
- package/src/{components → ui-kit}/Calculator/CalculatorValueBlock.tsx +1 -1
- package/src/{components → ui-kit}/Calculator/Rate.tsx +1 -1
- package/src/{components → ui-kit}/Calculator/renderFootnote.tsx +1 -1
- package/src/{components → ui-kit}/Calculator/renderRate.tsx +1 -1
- package/src/{components → ui-kit}/Calculator/renderWantedSumInput.tsx +2 -2
- package/bundle/components/Calculator/BonusCalculatorForm.d.ts +0 -8
- package/dist/components/Calculator/BonusCalculatorForm.d.ts +0 -8
- package/dist/components/Calculator/BonusCalculatorForm.js +0 -44
- package/dist/components/Calculator/BonusCalculatorForm.js.map +0 -1
- package/dist/components/Calculator/CalculatorValueBlock.js.map +0 -1
- package/dist/components/Calculator/Rate.js.map +0 -1
- package/dist/components/Calculator/getBonus.js +0 -13
- package/dist/components/Calculator/getBonus.js.map +0 -1
- package/dist/components/Calculator/getBonusCalculatorParams.js.map +0 -1
- package/dist/components/Calculator/renderFootnote.js.map +0 -1
- package/dist/components/Calculator/renderRate.js.map +0 -1
- package/dist/components/Calculator/renderWantedSumInput.js.map +0 -1
- package/lib/components/Calculator/BonusCalculatorForm.d.ts +0 -8
- package/lib/components/Calculator/BonusCalculatorForm.js +0 -42
- package/lib/components/Calculator/BonusCalculatorForm.js.map +0 -1
- package/lib/components/Calculator/CalculatorValueBlock.js.map +0 -1
- package/lib/components/Calculator/Rate.js.map +0 -1
- package/lib/components/Calculator/getBonus.js.map +0 -1
- package/lib/components/Calculator/getBonusCalculatorParams.js.map +0 -1
- package/lib/components/Calculator/renderFootnote.js.map +0 -1
- package/lib/components/Calculator/renderRate.js.map +0 -1
- package/lib/components/Calculator/renderWantedSumInput.js.map +0 -1
- package/mobile/bundle/components/Calculator/BonusCalculatorForm.d.ts +0 -8
- package/mobile/dist/components/Calculator/BonusCalculatorForm.d.ts +0 -8
- package/mobile/dist/components/Calculator/BonusCalculatorForm.js +0 -44
- package/mobile/dist/components/Calculator/BonusCalculatorForm.js.map +0 -1
- package/mobile/dist/components/Calculator/CalculatorValueBlock.js.map +0 -1
- package/mobile/dist/components/Calculator/Rate.js.map +0 -1
- package/mobile/dist/components/Calculator/getBonus.js +0 -13
- package/mobile/dist/components/Calculator/getBonus.js.map +0 -1
- package/mobile/dist/components/Calculator/getBonusCalculatorParams.js.map +0 -1
- package/mobile/dist/components/Calculator/renderFootnote.js.map +0 -1
- package/mobile/dist/components/Calculator/renderRate.js.map +0 -1
- package/mobile/dist/components/Calculator/renderWantedSumInput.d.ts +0 -7
- package/mobile/dist/components/Calculator/renderWantedSumInput.js.map +0 -1
- package/mobile/lib/components/Calculator/BonusCalculatorForm.d.ts +0 -8
- package/mobile/lib/components/Calculator/BonusCalculatorForm.js +0 -42
- package/mobile/lib/components/Calculator/BonusCalculatorForm.js.map +0 -1
- package/mobile/lib/components/Calculator/CalculatorValueBlock.js.map +0 -1
- package/mobile/lib/components/Calculator/Rate.js.map +0 -1
- package/mobile/lib/components/Calculator/getBonus.js.map +0 -1
- package/mobile/lib/components/Calculator/getBonusCalculatorParams.js.map +0 -1
- package/mobile/lib/components/Calculator/renderFootnote.js.map +0 -1
- package/mobile/lib/components/Calculator/renderRate.d.ts +0 -8
- package/mobile/lib/components/Calculator/renderRate.js.map +0 -1
- package/mobile/lib/components/Calculator/renderWantedSumInput.d.ts +0 -7
- package/mobile/lib/components/Calculator/renderWantedSumInput.js.map +0 -1
- package/mobile/src/components/Calculator/BonusCalculatorForm.tsx +0 -68
- package/src/components/Calculator/BonusCalculatorForm.tsx +0 -68
- /package/bundle/components/{Calculator → CalculatorBonus}/getBonus.d.ts +0 -0
- /package/bundle/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.d.ts +0 -0
- /package/bundle/{components → ui-kit}/Calculator/CalculatorValueBlock.d.ts +0 -0
- /package/bundle/{components → ui-kit}/Calculator/Rate.d.ts +0 -0
- /package/bundle/{components → ui-kit}/Calculator/renderFootnote.d.ts +0 -0
- /package/dist/components/{Calculator → CalculatorBonus}/getBonus.d.ts +0 -0
- /package/dist/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.d.ts +0 -0
- /package/dist/{components → ui-kit}/Calculator/CalculatorValueBlock.d.ts +0 -0
- /package/dist/{components → ui-kit}/Calculator/Rate.d.ts +0 -0
- /package/dist/{components → ui-kit}/Calculator/renderFootnote.d.ts +0 -0
- /package/lib/components/{Calculator → CalculatorBonus}/getBonus.d.ts +0 -0
- /package/lib/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.d.ts +0 -0
- /package/lib/{components → ui-kit}/Calculator/CalculatorValueBlock.d.ts +0 -0
- /package/lib/{components → ui-kit}/Calculator/Rate.d.ts +0 -0
- /package/lib/{components → ui-kit}/Calculator/renderFootnote.d.ts +0 -0
- /package/mobile/bundle/components/{Calculator → CalculatorBonus}/getBonus.d.ts +0 -0
- /package/mobile/bundle/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.d.ts +0 -0
- /package/mobile/bundle/{components → ui-kit}/Calculator/CalculatorValueBlock.d.ts +0 -0
- /package/mobile/bundle/{components → ui-kit}/Calculator/Rate.d.ts +0 -0
- /package/mobile/bundle/{components → ui-kit}/Calculator/renderFootnote.d.ts +0 -0
- /package/mobile/dist/components/{Calculator → CalculatorBonus}/getBonus.d.ts +0 -0
- /package/mobile/dist/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.d.ts +0 -0
- /package/mobile/dist/{components → ui-kit}/Calculator/CalculatorValueBlock.d.ts +0 -0
- /package/mobile/dist/{components → ui-kit}/Calculator/Rate.d.ts +0 -0
- /package/mobile/dist/{components → ui-kit}/Calculator/renderFootnote.d.ts +0 -0
- /package/mobile/lib/components/{Calculator → CalculatorBonus}/getBonus.d.ts +0 -0
- /package/mobile/lib/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.d.ts +0 -0
- /package/mobile/lib/{components → ui-kit}/Calculator/CalculatorValueBlock.d.ts +0 -0
- /package/mobile/lib/{components → ui-kit}/Calculator/Rate.d.ts +0 -0
- /package/mobile/lib/{components → ui-kit}/Calculator/renderFootnote.d.ts +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
2
|
+
import { useForm } from '../../hooks/useForm';
|
|
3
|
+
import { CalculatorLayout } from '../../ui-kit/Calculator/CalculatorLayout';
|
|
4
|
+
import { CalculatorValueBlock } from '../../ui-kit/Calculator/CalculatorValueBlock';
|
|
5
|
+
import { renderFootnote } from '../../ui-kit/Calculator/renderFootnote';
|
|
6
|
+
import { renderRate } from '../../ui-kit/Calculator/renderRate';
|
|
7
|
+
import { renderWantedSumInput } from '../../ui-kit/Calculator/renderWantedSumInput';
|
|
8
|
+
import { renderButtonsSection } from '../../ui-kit/LinkButton/renderButtonsSection';
|
|
9
|
+
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
10
|
+
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
11
|
+
import { style } from '../../utils/style';
|
|
12
|
+
import { type CalculatorBonusContent } from './CalculatorBonusContent';
|
|
13
|
+
import { getBonusCalculatorParams, type BonusCalculatorData } from './getBonusCalculatorParams';
|
|
14
|
+
|
|
15
|
+
const DEFAULT_TRAVEL_MIN_SUM = 6000;
|
|
16
|
+
const DEFAULT_REST_MIN_SUM = 6000;
|
|
17
|
+
|
|
18
|
+
export interface CalculatorBonusProps extends CalculatorBonusContent, UniBlockProps {
|
|
19
|
+
className?: string;
|
|
20
|
+
calcSource?: BonusCalculatorData & JSONRefObject;
|
|
21
|
+
}
|
|
22
|
+
export const CalculatorBonus = UniBlock<CalculatorBonusProps>(
|
|
23
|
+
({ className = '', title, calcSource, buttons, footnote, ...rest }) => {
|
|
24
|
+
const [userInputParams, { field }] = useForm({
|
|
25
|
+
travelExpenseValue: DEFAULT_TRAVEL_MIN_SUM,
|
|
26
|
+
restExpenseValue: DEFAULT_REST_MIN_SUM,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const { minSumTravel, maxSumTravel, minSumOther, maxSumOther, monthBonus, yearBonus } =
|
|
30
|
+
getBonusCalculatorParams(userInputParams, calcSource);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<CalculatorLayout className={className} title={title} {...rest}>
|
|
34
|
+
<section
|
|
35
|
+
className={style('flex flex-col justify-between @4xl:flex-row gap-y-4xl', className)}
|
|
36
|
+
>
|
|
37
|
+
<div className="flex flex-col @xl:max-w-md gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0">
|
|
38
|
+
{renderWantedSumInput({
|
|
39
|
+
title: 'Сумма покупок в категории путешествия, ₽',
|
|
40
|
+
min: minSumTravel,
|
|
41
|
+
max: maxSumTravel,
|
|
42
|
+
step: 500,
|
|
43
|
+
isShowItems: false,
|
|
44
|
+
...field('travelExpenseValue'),
|
|
45
|
+
})}
|
|
46
|
+
{renderWantedSumInput({
|
|
47
|
+
title: 'Сумма покупок в остальных категориях, ₽',
|
|
48
|
+
min: minSumOther,
|
|
49
|
+
max: maxSumOther,
|
|
50
|
+
step: 500,
|
|
51
|
+
isShowItems: false,
|
|
52
|
+
...field('restExpenseValue'),
|
|
53
|
+
})}
|
|
54
|
+
</div>
|
|
55
|
+
{monthBonus >= 0
|
|
56
|
+
? renderRate({
|
|
57
|
+
title: 'Баллов за месяц',
|
|
58
|
+
rate: monthBonus,
|
|
59
|
+
fractionDigits: 0,
|
|
60
|
+
isUnknownRateShown: false,
|
|
61
|
+
unit: '',
|
|
62
|
+
})
|
|
63
|
+
: null}
|
|
64
|
+
<div className="flex flex-col gap-y-xl @xl:w-96">
|
|
65
|
+
{yearBonus >= 0 ? (
|
|
66
|
+
<CalculatorValueBlock title="Баллов за год" value={yearBonus} />
|
|
67
|
+
) : null}
|
|
68
|
+
{renderButtonsSection(buttons, { isVertical: true })}
|
|
69
|
+
{renderFootnote(footnote)}
|
|
70
|
+
</div>
|
|
71
|
+
</section>
|
|
72
|
+
</CalculatorLayout>
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
2
|
+
import { type Footnote } from '../../model/Footnote';
|
|
3
|
+
import { type TitleProps } from '../../model/HeadlineType';
|
|
4
|
+
import { type ButtonsSectionContent } from '../../ui-kit/LinkButton/ButtonsSectionContent';
|
|
5
|
+
import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title Блок кнопок
|
|
9
|
+
*/
|
|
10
|
+
export type CalculatorBonusContent = UniBlockContent &
|
|
11
|
+
TitleProps &
|
|
12
|
+
Footnote &
|
|
13
|
+
ButtonsSectionContent & {
|
|
14
|
+
/** @title Данные калькулятора */
|
|
15
|
+
calcSource?: JSONRefObject;
|
|
16
|
+
};
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
import { DEFAULT_BONUS_CALCULATOR_PARAMS, MONTHS_IN_YEAR } from './constants';
|
|
2
1
|
import { type BonusCalculatorData } from './getBonusCalculatorParams';
|
|
3
2
|
|
|
3
|
+
const DEFAULT_BONUS_CALCULATOR_PARAMS: Required<BonusCalculatorData> = {
|
|
4
|
+
minSumTravel: 6000,
|
|
5
|
+
maxSumTravel: 200000,
|
|
6
|
+
minSumOther: 6000,
|
|
7
|
+
maxSumOther: 200000,
|
|
8
|
+
maxBonus: 5000,
|
|
9
|
+
prefMonthsNum: 2,
|
|
10
|
+
prefTravelBonusRate: 0.015,
|
|
11
|
+
prefRestBonusRate: 0.01,
|
|
12
|
+
travelBonusRate: 0.015,
|
|
13
|
+
restBonusRate: 0.01,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const MONTHS_IN_YEAR = 12;
|
|
17
|
+
|
|
4
18
|
export const getBonus = (
|
|
5
19
|
params: BonusCalculatorData,
|
|
6
20
|
bonusTravelValue: number,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DEFAULT_BONUS_CALCULATOR_PARAMS } from './constants';
|
|
2
1
|
import { getBonus } from './getBonus';
|
|
3
2
|
|
|
4
3
|
export interface BonusCalculatorUserInputParams {
|
|
@@ -6,6 +5,19 @@ export interface BonusCalculatorUserInputParams {
|
|
|
6
5
|
restExpenseValue: number;
|
|
7
6
|
}
|
|
8
7
|
|
|
8
|
+
const DEFAULT_BONUS_CALCULATOR_PARAMS: Required<BonusCalculatorData> = {
|
|
9
|
+
minSumTravel: 6000,
|
|
10
|
+
maxSumTravel: 200000,
|
|
11
|
+
minSumOther: 6000,
|
|
12
|
+
maxSumOther: 200000,
|
|
13
|
+
maxBonus: 5000,
|
|
14
|
+
prefMonthsNum: 2,
|
|
15
|
+
prefTravelBonusRate: 0.015,
|
|
16
|
+
prefRestBonusRate: 0.01,
|
|
17
|
+
travelBonusRate: 0.015,
|
|
18
|
+
restBonusRate: 0.01,
|
|
19
|
+
};
|
|
20
|
+
|
|
9
21
|
export interface BonusCalculatorData {
|
|
10
22
|
minSumTravel?: number;
|
|
11
23
|
maxSumTravel?: number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { type TitleProps } from '../../model/HeadlineType';
|
|
3
|
+
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
4
|
+
import { style } from '../../utils/style';
|
|
5
|
+
import { BlockWrapper } from '../BlockWrapper';
|
|
6
|
+
import { Heading } from '../Heading/Heading';
|
|
7
|
+
|
|
8
|
+
export interface CalculatorLayoutProps extends UniBlockProps, TitleProps {}
|
|
9
|
+
|
|
10
|
+
export const CalculatorLayout = JSX<CalculatorLayoutProps>(
|
|
11
|
+
({ className, title, children, ...rest }) => (
|
|
12
|
+
<BlockWrapper className={style('space-y-xl', className)} defaultPadding="p-4xl" {...rest}>
|
|
13
|
+
{title ? <Heading className="text-center" title={title} /> : null}
|
|
14
|
+
{children}
|
|
15
|
+
</BlockWrapper>
|
|
16
|
+
),
|
|
17
|
+
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { Text } from '../../ui-kit/Text/Text';
|
|
3
2
|
import { style } from '../../utils/style';
|
|
4
3
|
import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
|
|
4
|
+
import { Text } from '../Text/Text';
|
|
5
5
|
|
|
6
6
|
const calculatorValueBlockStyle = 'flex justify-between @xl:flex-col';
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { UnknownRate, type UnknownRateProps } from '../../components/Calculator/UnknownRate';
|
|
1
2
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
2
3
|
import { Rate, type RateProps } from './Rate';
|
|
3
|
-
import { UnknownRate, type UnknownRateProps } from './UnknownRate';
|
|
4
4
|
|
|
5
5
|
interface RenderRateProps extends RateProps, UnknownRateProps {
|
|
6
6
|
isUnknownRateShown?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InputRange } from '../../ui-kit/InputRange/InputRange';
|
|
2
|
-
import { type InputRangeProps } from '../../ui-kit/InputRange/InputRangeProps';
|
|
3
1
|
import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
|
|
2
|
+
import { InputRange } from '../InputRange/InputRange';
|
|
3
|
+
import { type InputRangeProps } from '../InputRange/InputRangeProps';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_MONEY_STEP = 1000;
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import { BenefitsBlock } from './BenefitsBlock/BenefitsBlock';
|
|
|
7
7
|
import { BonusBenefitsBlock } from './BonusBenefitsBlock/BonusBenefitsBlock';
|
|
8
8
|
import { ButtonsBlock } from './ButtonsBlock/ButtonsBlock';
|
|
9
9
|
import { Calculator } from './Calculator/Calculator';
|
|
10
|
+
import { CalculatorBonus } from './CalculatorBonus/CalculatorBonus';
|
|
10
11
|
import { CardTransfer } from './CardTransfer/CardTransfer';
|
|
11
12
|
import { Carousel } from './Carousel/Carousel';
|
|
12
13
|
import { CarouselBankHistoryCard } from './CarouselBankHistoryCard/CarouselBankHistoryCard';
|
|
@@ -52,6 +53,7 @@ export const Blocks: BlocksRegistry = {
|
|
|
52
53
|
BonusBenefitsBlock,
|
|
53
54
|
ButtonsBlock,
|
|
54
55
|
Calculator,
|
|
56
|
+
CalculatorBonus,
|
|
55
57
|
CardTransfer,
|
|
56
58
|
Carousel,
|
|
57
59
|
CarouselBankHistoryCard,
|
package/src/components/Blocks.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { BenefitsBlock } from './BenefitsBlock/BenefitsBlock';
|
|
|
8
8
|
import { BonusBenefitsBlock } from './BonusBenefitsBlock/BonusBenefitsBlock';
|
|
9
9
|
import { ButtonsBlock } from './ButtonsBlock/ButtonsBlock';
|
|
10
10
|
import { Calculator } from './Calculator/Calculator';
|
|
11
|
+
import { CalculatorBonus } from './CalculatorBonus/CalculatorBonus';
|
|
11
12
|
import { CardTransfer } from './CardTransfer/CardTransfer';
|
|
12
13
|
import { Carousel } from './Carousel/Carousel';
|
|
13
14
|
import { CarouselBankHistoryCard } from './CarouselBankHistoryCard/CarouselBankHistoryCard';
|
|
@@ -61,6 +62,7 @@ export const Blocks: BlocksRegistry = {
|
|
|
61
62
|
BonusBenefitsBlock,
|
|
62
63
|
ButtonsBlock,
|
|
63
64
|
Calculator,
|
|
65
|
+
CalculatorBonus,
|
|
64
66
|
CardTransfer,
|
|
65
67
|
Carousel,
|
|
66
68
|
CarouselBankHistoryCard,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useForm, type FormFieldRegisterer } from '../../hooks/useForm';
|
|
3
|
+
import { CalculatorValueBlock } from '../../ui-kit/Calculator/CalculatorValueBlock';
|
|
4
|
+
import { renderFootnote } from '../../ui-kit/Calculator/renderFootnote';
|
|
5
|
+
import { renderRate } from '../../ui-kit/Calculator/renderRate';
|
|
6
|
+
import { renderWantedSumInput } from '../../ui-kit/Calculator/renderWantedSumInput';
|
|
3
7
|
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
4
8
|
import { renderButtonsSection } from '../../ui-kit/LinkButton/renderButtonsSection';
|
|
5
9
|
import { Text } from '../../ui-kit/Text/Text';
|
|
6
10
|
import { type BusinessDepositCalculatorProps } from './CalculatorContent';
|
|
7
11
|
import { CalculatorFormLayout } from './CalculatorFormLayout';
|
|
8
|
-
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
9
12
|
import { BUSINESS_DEFAULT_DAYS, BUSINESS_DEFAULT_SUM } from './constants';
|
|
10
13
|
import { getMoneyDefaultValue, getMonthsDefaultValue } from './getDefaultValues';
|
|
11
14
|
import { renderDaysInput } from './renderDaysInput';
|
|
12
|
-
import { renderFootnote } from './renderFootnote';
|
|
13
15
|
import { renderInterestPayment } from './renderInterestPayment';
|
|
14
|
-
import { renderRate } from './renderRate';
|
|
15
|
-
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
16
16
|
import {
|
|
17
17
|
useBusinessDepositCalculatorParams,
|
|
18
18
|
type BusinessDepositCalculatorParams,
|
|
@@ -74,17 +74,6 @@ export default {
|
|
|
74
74
|
'Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.',
|
|
75
75
|
},
|
|
76
76
|
},
|
|
77
|
-
{
|
|
78
|
-
nav: {
|
|
79
|
-
title: 'Обменивайте баллы на путешествия',
|
|
80
|
-
icon: { icon: 'PercentageRoundIcon' },
|
|
81
|
-
},
|
|
82
|
-
calculatorBlock: {
|
|
83
|
-
title: 'Обменивайте баллы на путешествия',
|
|
84
|
-
calcType: 'BonusCalculatorForm',
|
|
85
|
-
buttons: [sendRequestButton, detailsButton],
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
77
|
{
|
|
89
78
|
nav: {
|
|
90
79
|
title: 'Рефинансирование',
|
|
@@ -137,17 +126,4 @@ export default {
|
|
|
137
126
|
]}
|
|
138
127
|
/>
|
|
139
128
|
),
|
|
140
|
-
bonus: (
|
|
141
|
-
<Calculator
|
|
142
|
-
calculatorTabs={[
|
|
143
|
-
{
|
|
144
|
-
calculatorBlock: {
|
|
145
|
-
title: 'Обменивайте баллы на путешествия',
|
|
146
|
-
calcType: 'BonusCalculatorForm',
|
|
147
|
-
buttons: [sendRequestButton, detailsButton],
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
]}
|
|
151
|
-
/>
|
|
152
|
-
),
|
|
153
129
|
};
|
|
@@ -3,7 +3,6 @@ import '../../setup-fixture';
|
|
|
3
3
|
import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
4
4
|
import { Calculator } from './Calculator';
|
|
5
5
|
import {
|
|
6
|
-
type BonusCalculatorParamsDef,
|
|
7
6
|
type BusinessDepositCalculatorParamsDef,
|
|
8
7
|
type CreditCalculatorParamsDef,
|
|
9
8
|
type DepositCalculatorParamsDef,
|
|
@@ -97,15 +96,6 @@ const REFINANCING_CALCULATOR_BLOCK: RefinancingCalculatorParamsDef = {
|
|
|
97
96
|
},
|
|
98
97
|
};
|
|
99
98
|
|
|
100
|
-
const BONUS_CALCULATOR_BLOCK: BonusCalculatorParamsDef = {
|
|
101
|
-
title: 'Обменивайте баллы на путешествия',
|
|
102
|
-
calcType: 'BonusCalculatorForm',
|
|
103
|
-
buttons: buttons,
|
|
104
|
-
calcSource: {
|
|
105
|
-
$ref: '/wcms-resources/bonus-calculator-data.json',
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
|
|
109
99
|
export default {
|
|
110
100
|
default: (
|
|
111
101
|
<div className="container grid grid-cols-12">
|
|
@@ -128,13 +118,6 @@ export default {
|
|
|
128
118
|
},
|
|
129
119
|
calculatorBlock: DEPOSIT_CALCULATOR_BLOCK,
|
|
130
120
|
},
|
|
131
|
-
{
|
|
132
|
-
nav: {
|
|
133
|
-
title: 'Обменивайте баллы на путешествия',
|
|
134
|
-
icon: { icon: 'PercentageRoundIcon' },
|
|
135
|
-
},
|
|
136
|
-
calculatorBlock: BONUS_CALCULATOR_BLOCK,
|
|
137
|
-
},
|
|
138
121
|
{
|
|
139
122
|
nav: {
|
|
140
123
|
title: 'Рефинансирование',
|
|
@@ -194,20 +177,4 @@ export default {
|
|
|
194
177
|
/>
|
|
195
178
|
</div>
|
|
196
179
|
),
|
|
197
|
-
bonus: (
|
|
198
|
-
<div className="container grid grid-cols-12">
|
|
199
|
-
<Calculator
|
|
200
|
-
className="col-span-12"
|
|
201
|
-
calculatorTabs={[
|
|
202
|
-
{
|
|
203
|
-
nav: {
|
|
204
|
-
title: 'Обменивайте баллы на путешествия',
|
|
205
|
-
icon: { icon: 'PercentageRoundIcon' },
|
|
206
|
-
},
|
|
207
|
-
calculatorBlock: BONUS_CALCULATOR_BLOCK,
|
|
208
|
-
},
|
|
209
|
-
]}
|
|
210
|
-
/>
|
|
211
|
-
</div>
|
|
212
|
-
),
|
|
213
180
|
};
|
|
@@ -178,15 +178,6 @@ export type BusinessDepositCalculatorParamsDef = TitleProps &
|
|
|
178
178
|
calcType: 'BusinessDepositCalculatorForm';
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
-
/**
|
|
182
|
-
* @title Калькулятор бонусов
|
|
183
|
-
* @default {"calcType": "BonusCalculatorForm"}
|
|
184
|
-
*/
|
|
185
|
-
export type BonusCalculatorParamsDef = TitleProps &
|
|
186
|
-
CommonCalculatorProps & {
|
|
187
|
-
calcType: 'BonusCalculatorForm';
|
|
188
|
-
};
|
|
189
|
-
|
|
190
181
|
/**
|
|
191
182
|
* @title Калькулятор рефинансирования
|
|
192
183
|
* @default {"calcType": "RefinancingCalculatorForm"}
|
|
@@ -211,8 +202,7 @@ export type CalculatorBlockDef =
|
|
|
211
202
|
| CreditCalculatorParamsDef
|
|
212
203
|
| RefinancingCalculatorParamsDef
|
|
213
204
|
| DepositCalculatorParamsDef
|
|
214
|
-
| BusinessDepositCalculatorParamsDef
|
|
215
|
-
| BonusCalculatorParamsDef;
|
|
205
|
+
| BusinessDepositCalculatorParamsDef;
|
|
216
206
|
|
|
217
207
|
/**
|
|
218
208
|
* @title Кнопка навигации
|
|
@@ -3,6 +3,10 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
3
3
|
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
4
|
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
5
5
|
import { useForm, type FormFieldRegisterer } from '../../hooks/useForm';
|
|
6
|
+
import { CalculatorValueBlock } from '../../ui-kit/Calculator/CalculatorValueBlock';
|
|
7
|
+
import { renderFootnote } from '../../ui-kit/Calculator/renderFootnote';
|
|
8
|
+
import { renderRate } from '../../ui-kit/Calculator/renderRate';
|
|
9
|
+
import { renderWantedSumInput } from '../../ui-kit/Calculator/renderWantedSumInput';
|
|
6
10
|
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
7
11
|
import { renderButtonsSection } from '../../ui-kit/LinkButton/renderButtonsSection';
|
|
8
12
|
import { clamp } from '../../utils/clamp';
|
|
@@ -11,7 +15,6 @@ import {
|
|
|
11
15
|
type CreditCalculatorProps,
|
|
12
16
|
} from './CalculatorContent';
|
|
13
17
|
import { CalculatorFormLayout } from './CalculatorFormLayout';
|
|
14
|
-
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
15
18
|
import { CREDIT_DEFAULT_SUM, DEFAULT_MONTHS } from './constants';
|
|
16
19
|
import {
|
|
17
20
|
getCreditCalculatorParams,
|
|
@@ -19,11 +22,8 @@ import {
|
|
|
19
22
|
type CreditCalculatorParams,
|
|
20
23
|
} from './getCreditCalculatorParams';
|
|
21
24
|
import { getMoneyDefaultValue, getMonthsDefaultValue } from './getDefaultValues';
|
|
22
|
-
import { renderFootnote } from './renderFootnote';
|
|
23
25
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
24
26
|
import { renderPaymentType } from './renderPaymentType';
|
|
25
|
-
import { renderRate } from './renderRate';
|
|
26
|
-
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
27
27
|
|
|
28
28
|
export interface CreditCalculatorProp extends CreditCalculatorProps {
|
|
29
29
|
className?: string;
|
|
@@ -2,6 +2,10 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
4
4
|
import { useForm, type FormFieldRegisterer } from '../../hooks/useForm';
|
|
5
|
+
import { CalculatorValueBlock } from '../../ui-kit/Calculator/CalculatorValueBlock';
|
|
6
|
+
import { renderFootnote } from '../../ui-kit/Calculator/renderFootnote';
|
|
7
|
+
import { renderRate } from '../../ui-kit/Calculator/renderRate';
|
|
8
|
+
import { renderWantedSumInput } from '../../ui-kit/Calculator/renderWantedSumInput';
|
|
5
9
|
import { renderButtonsSection } from '../../ui-kit/LinkButton/renderButtonsSection';
|
|
6
10
|
import { clamp } from '../../utils/clamp';
|
|
7
11
|
import {
|
|
@@ -9,7 +13,6 @@ import {
|
|
|
9
13
|
type DepositCalculatorProps,
|
|
10
14
|
} from './CalculatorContent';
|
|
11
15
|
import { CalculatorFormLayout } from './CalculatorFormLayout';
|
|
12
|
-
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
13
16
|
import { DEPOSIT_DEFAULT_SUM } from './constants';
|
|
14
17
|
import { getMoneyDefaultValue, getMonthsDefaultValue } from './getDefaultValues';
|
|
15
18
|
import {
|
|
@@ -17,12 +20,9 @@ import {
|
|
|
17
20
|
type DepositCalculatorData,
|
|
18
21
|
type DepositCalculatorParams,
|
|
19
22
|
} from './getDepositCalculatorParams';
|
|
20
|
-
import { renderFootnote } from './renderFootnote';
|
|
21
23
|
import { renderInterestPayment } from './renderInterestPayment';
|
|
22
24
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
23
|
-
import { renderRate } from './renderRate';
|
|
24
25
|
import { renderRegistrationType } from './renderRegistrationType';
|
|
25
|
-
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
26
26
|
|
|
27
27
|
export interface DepositCalculatorProp extends DepositCalculatorProps {
|
|
28
28
|
className?: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BonusCalculatorForm, type BonusCalculatorProps } from './BonusCalculatorForm';
|
|
2
1
|
import {
|
|
3
2
|
BusinessDepositCalculatorForm,
|
|
4
3
|
type BusinessDepositCalculatorProp,
|
|
@@ -14,13 +13,11 @@ export type EmbeddableCalcProps =
|
|
|
14
13
|
| CreditCalculatorProp
|
|
15
14
|
| DepositCalculatorProp
|
|
16
15
|
| BusinessDepositCalculatorProp
|
|
17
|
-
| BonusCalculatorProps
|
|
18
16
|
| RefinancingCalculatorProp;
|
|
19
17
|
|
|
20
18
|
export const EmbeddableCalcBlocks = {
|
|
21
19
|
CreditCalculatorForm,
|
|
22
20
|
DepositCalculatorForm,
|
|
23
21
|
BusinessDepositCalculatorForm,
|
|
24
|
-
BonusCalculatorForm,
|
|
25
22
|
RefinancingCalculatorForm,
|
|
26
23
|
};
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
4
4
|
import { useForm, type FormFieldRegisterer } from '../../hooks/useForm';
|
|
5
|
+
import { CalculatorValueBlock } from '../../ui-kit/Calculator/CalculatorValueBlock';
|
|
6
|
+
import { renderFootnote } from '../../ui-kit/Calculator/renderFootnote';
|
|
7
|
+
import { renderRate } from '../../ui-kit/Calculator/renderRate';
|
|
8
|
+
import { renderWantedSumInput } from '../../ui-kit/Calculator/renderWantedSumInput';
|
|
5
9
|
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
6
10
|
import { renderButtonsSection } from '../../ui-kit/LinkButton/renderButtonsSection';
|
|
7
11
|
import {
|
|
@@ -9,7 +13,6 @@ import {
|
|
|
9
13
|
type RefinancingCalculatorProps,
|
|
10
14
|
} from './CalculatorContent';
|
|
11
15
|
import { CalculatorFormLayout } from './CalculatorFormLayout';
|
|
12
|
-
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
13
16
|
import {
|
|
14
17
|
DEFAULT_REFINANCING_MONTHS,
|
|
15
18
|
REFINANCING_DEFAULT_SUM,
|
|
@@ -20,11 +23,8 @@ import {
|
|
|
20
23
|
type RefinancingCalculatorData,
|
|
21
24
|
type RefinancingCalculatorParams,
|
|
22
25
|
} from './getRefinancingCalculatorParams';
|
|
23
|
-
import { renderFootnote } from './renderFootnote';
|
|
24
26
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
25
27
|
import { renderPaymentType } from './renderPaymentType';
|
|
26
|
-
import { renderRate } from './renderRate';
|
|
27
|
-
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
28
28
|
|
|
29
29
|
export interface RefinancingCalculatorProp extends RefinancingCalculatorProps {
|
|
30
30
|
className?: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type BonusCalculatorData } from './getBonusCalculatorParams';
|
|
2
1
|
import { type CreditCalculatorSourceBookRateParams } from './getCreditCalculatorParams';
|
|
3
2
|
import { type DepositCalculatorSourceBookParams } from './getDepositCalculatorParams';
|
|
4
3
|
import { type RefinancingCalculatorSourceBookRateParams } from './getRefinancingCalculatorParams';
|
|
@@ -58,22 +57,6 @@ export const DEFAULT_REFINANCING_CALCULATOR_PARAMS: RefinancingCalculatorSourceB
|
|
|
58
57
|
isInsurance: true,
|
|
59
58
|
};
|
|
60
59
|
|
|
61
|
-
export const DEFAULT_TRAVEL_MIN_SUM = 6000;
|
|
62
|
-
export const DEFAULT_REST_MIN_SUM = 6000;
|
|
63
|
-
|
|
64
|
-
export const DEFAULT_BONUS_CALCULATOR_PARAMS: Required<BonusCalculatorData> = {
|
|
65
|
-
minSumTravel: 6000,
|
|
66
|
-
maxSumTravel: 200000,
|
|
67
|
-
minSumOther: 6000,
|
|
68
|
-
maxSumOther: 200000,
|
|
69
|
-
maxBonus: 5000,
|
|
70
|
-
prefMonthsNum: 2,
|
|
71
|
-
prefTravelBonusRate: 0.015,
|
|
72
|
-
prefRestBonusRate: 0.01,
|
|
73
|
-
travelBonusRate: 0.015,
|
|
74
|
-
restBonusRate: 0.01,
|
|
75
|
-
};
|
|
76
|
-
|
|
77
60
|
export const DEFAULT_DEPOSIT_CALCULATOR_PARAMS: DepositCalculatorSourceBookParams = {
|
|
78
61
|
minSum: 50000,
|
|
79
62
|
maxSum: 100000001,
|
|
@@ -98,7 +81,6 @@ export const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS: BusinessDepositCalculat
|
|
|
98
81
|
};
|
|
99
82
|
|
|
100
83
|
export const CREDIT_CALC_DEFAULT_DIR = 'credit-calculator-data';
|
|
101
|
-
export const BONUS_CALC_DEFAULT_DIR = 'bonus-calculator-data';
|
|
102
84
|
export const DEPOSIT_CALC_DEFAULT_DIR = 'deposit-calculator-data';
|
|
103
85
|
export const BUSINESS_DEPOSIT_CALC_DEFAULT_DIR = 'business-calculator-data';
|
|
104
86
|
export const REFINANCING_CALC_DEFAULT_DIR = 'refinancing-calculator-data';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import '../../setup-fixture';
|
|
2
|
+
import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
3
|
+
|
|
4
|
+
import { CalculatorBonus } from './CalculatorBonus';
|
|
5
|
+
|
|
6
|
+
const buttons: LinkButtonContent[] = [
|
|
7
|
+
{
|
|
8
|
+
href: 'https://rshb.ru',
|
|
9
|
+
text: 'Отправить заявку',
|
|
10
|
+
target: '_blank',
|
|
11
|
+
version: 'primary',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
href: 'https://rshb.ru',
|
|
15
|
+
text: 'Подробные условия',
|
|
16
|
+
target: '_blank',
|
|
17
|
+
version: 'secondary',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
default: (
|
|
23
|
+
<div className="container grid grid-cols-12">
|
|
24
|
+
<CalculatorBonus
|
|
25
|
+
className="col-span-12"
|
|
26
|
+
title={'Обменивайте баллы на путешествия'}
|
|
27
|
+
buttons={buttons}
|
|
28
|
+
calcSource={{
|
|
29
|
+
$ref: '/wcms-resources/bonus-calculator-data.json',
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
),
|
|
34
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
2
|
+
import { useForm } from '../../hooks/useForm';
|
|
3
|
+
import { CalculatorLayout } from '../../ui-kit/Calculator/CalculatorLayout';
|
|
4
|
+
import { CalculatorValueBlock } from '../../ui-kit/Calculator/CalculatorValueBlock';
|
|
5
|
+
import { renderFootnote } from '../../ui-kit/Calculator/renderFootnote';
|
|
6
|
+
import { renderRate } from '../../ui-kit/Calculator/renderRate';
|
|
7
|
+
import { renderWantedSumInput } from '../../ui-kit/Calculator/renderWantedSumInput';
|
|
8
|
+
import { renderButtonsSection } from '../../ui-kit/LinkButton/renderButtonsSection';
|
|
9
|
+
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
10
|
+
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
11
|
+
import { style } from '../../utils/style';
|
|
12
|
+
import { type CalculatorBonusContent } from './CalculatorBonusContent';
|
|
13
|
+
import { getBonusCalculatorParams, type BonusCalculatorData } from './getBonusCalculatorParams';
|
|
14
|
+
|
|
15
|
+
const DEFAULT_TRAVEL_MIN_SUM = 6000;
|
|
16
|
+
const DEFAULT_REST_MIN_SUM = 6000;
|
|
17
|
+
|
|
18
|
+
export interface CalculatorBonusProps extends CalculatorBonusContent, UniBlockProps {
|
|
19
|
+
className?: string;
|
|
20
|
+
calcSource?: BonusCalculatorData & JSONRefObject;
|
|
21
|
+
}
|
|
22
|
+
export const CalculatorBonus = UniBlock<CalculatorBonusProps>(
|
|
23
|
+
({ className = '', title, calcSource, buttons, footnote, ...rest }) => {
|
|
24
|
+
const [userInputParams, { field }] = useForm({
|
|
25
|
+
travelExpenseValue: DEFAULT_TRAVEL_MIN_SUM,
|
|
26
|
+
restExpenseValue: DEFAULT_REST_MIN_SUM,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const { minSumTravel, maxSumTravel, minSumOther, maxSumOther, monthBonus, yearBonus } =
|
|
30
|
+
getBonusCalculatorParams(userInputParams, calcSource);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<CalculatorLayout className={className} title={title} {...rest}>
|
|
34
|
+
<section
|
|
35
|
+
className={style('flex flex-col justify-between @4xl:flex-row gap-y-4xl', className)}
|
|
36
|
+
>
|
|
37
|
+
<div className="flex flex-col @xl:max-w-md gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0">
|
|
38
|
+
{renderWantedSumInput({
|
|
39
|
+
title: 'Сумма покупок в категории путешествия, ₽',
|
|
40
|
+
min: minSumTravel,
|
|
41
|
+
max: maxSumTravel,
|
|
42
|
+
step: 500,
|
|
43
|
+
isShowItems: false,
|
|
44
|
+
...field('travelExpenseValue'),
|
|
45
|
+
})}
|
|
46
|
+
{renderWantedSumInput({
|
|
47
|
+
title: 'Сумма покупок в остальных категориях, ₽',
|
|
48
|
+
min: minSumOther,
|
|
49
|
+
max: maxSumOther,
|
|
50
|
+
step: 500,
|
|
51
|
+
isShowItems: false,
|
|
52
|
+
...field('restExpenseValue'),
|
|
53
|
+
})}
|
|
54
|
+
</div>
|
|
55
|
+
{monthBonus >= 0
|
|
56
|
+
? renderRate({
|
|
57
|
+
title: 'Баллов за месяц',
|
|
58
|
+
rate: monthBonus,
|
|
59
|
+
fractionDigits: 0,
|
|
60
|
+
isUnknownRateShown: false,
|
|
61
|
+
unit: '',
|
|
62
|
+
})
|
|
63
|
+
: null}
|
|
64
|
+
<div className="flex flex-col gap-y-xl @xl:w-96">
|
|
65
|
+
{yearBonus >= 0 ? (
|
|
66
|
+
<CalculatorValueBlock title="Баллов за год" value={yearBonus} />
|
|
67
|
+
) : null}
|
|
68
|
+
{renderButtonsSection(buttons, { isVertical: true })}
|
|
69
|
+
{renderFootnote(footnote)}
|
|
70
|
+
</div>
|
|
71
|
+
</section>
|
|
72
|
+
</CalculatorLayout>
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
);
|