@redneckz/wildless-cms-uni-blocks 0.3.57 → 0.3.59
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/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +370 -96
- package/bundle/bundle.umd.min.js +1 -1
- package/cosmos-static/icons/SafeIcon.svg +1 -1
- package/dist/components/Blocks.d.ts +1 -1
- package/dist/components/Blocks.js +2 -2
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Calculator/BonusCalculatorForm.d.ts +5 -0
- package/dist/components/Calculator/BonusCalculatorForm.js +40 -0
- package/dist/components/Calculator/BonusCalculatorForm.js.map +1 -0
- package/dist/components/Calculator/Calculator.d.ts +5 -0
- package/dist/components/Calculator/Calculator.js +46 -0
- package/dist/components/Calculator/Calculator.js.map +1 -0
- package/dist/components/Calculator/CalculatorContent.d.ts +110 -0
- package/dist/components/{ProductGalleryGreen/ProductGalleryGreenContent.js → Calculator/CalculatorContent.js} +1 -1
- package/dist/components/Calculator/CalculatorContent.js.map +1 -0
- package/dist/components/Calculator/CalculatorValueBlock.d.ts +8 -0
- package/dist/components/Calculator/CalculatorValueBlock.js +9 -0
- package/dist/components/Calculator/CalculatorValueBlock.js.map +1 -0
- package/dist/components/Calculator/CreditCalculatorForm.d.ts +5 -0
- package/dist/components/Calculator/CreditCalculatorForm.js +51 -0
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -0
- package/dist/components/Calculator/DepositCalculatorForm.d.ts +5 -0
- package/dist/components/Calculator/DepositCalculatorForm.js +41 -0
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -0
- package/dist/components/Calculator/EmbeddableCalcBlocks.d.ts +11 -0
- package/dist/components/Calculator/EmbeddableCalcBlocks.js +13 -0
- package/dist/components/Calculator/EmbeddableCalcBlocks.js.map +1 -0
- package/dist/components/Calculator/MortgageCalculatorForm.d.ts +5 -0
- package/dist/components/Calculator/MortgageCalculatorForm.js +49 -0
- package/dist/components/Calculator/MortgageCalculatorForm.js.map +1 -0
- package/dist/components/Calculator/constants.d.ts +7 -0
- package/dist/components/Calculator/constants.js +10 -0
- package/dist/components/Calculator/constants.js.map +1 -0
- package/dist/components/Calculator/getCalculatorParams.d.ts +7 -0
- package/dist/components/Calculator/getCalculatorParams.js +11 -0
- package/dist/components/Calculator/getCalculatorParams.js.map +1 -0
- package/dist/components/Calculator/getCreditRate.d.ts +7 -0
- package/dist/components/Calculator/getCreditRate.js +13 -0
- package/dist/components/Calculator/getCreditRate.js.map +1 -0
- package/dist/components/Calculator/getDefaultMonths.d.ts +2 -0
- package/dist/components/Calculator/getDefaultMonths.js +8 -0
- package/dist/components/Calculator/getDefaultMonths.js.map +1 -0
- package/dist/components/Calculator/getDefaultSum.d.ts +2 -0
- package/dist/components/Calculator/getDefaultSum.js +8 -0
- package/dist/components/Calculator/getDefaultSum.js.map +1 -0
- package/dist/components/Calculator/getMonthlyPayment.d.ts +11 -0
- package/dist/components/Calculator/getMonthlyPayment.js +19 -0
- package/dist/components/Calculator/getMonthlyPayment.js.map +1 -0
- package/dist/components/Calculator/renderButtonSection.d.ts +1 -0
- package/dist/components/Calculator/renderButtonSection.js +9 -0
- package/dist/components/Calculator/renderButtonSection.js.map +1 -0
- package/dist/components/Calculator/renderCalculatorList.d.ts +10 -0
- package/dist/components/Calculator/renderCalculatorList.js +17 -0
- package/dist/components/Calculator/renderCalculatorList.js.map +1 -0
- package/dist/components/Calculator/renderInitialFeeInput.d.ts +10 -0
- package/dist/components/Calculator/renderInitialFeeInput.js +18 -0
- package/dist/components/Calculator/renderInitialFeeInput.js.map +1 -0
- package/dist/components/Calculator/renderMonthsInput.d.ts +11 -0
- package/dist/components/Calculator/renderMonthsInput.js +15 -0
- package/dist/components/Calculator/renderMonthsInput.js.map +1 -0
- package/dist/components/Calculator/renderProposal.d.ts +1 -0
- package/dist/components/Calculator/renderProposal.js +10 -0
- package/dist/components/Calculator/renderProposal.js.map +1 -0
- package/dist/components/Calculator/renderProposalMortgage.d.ts +7 -0
- package/dist/components/Calculator/renderProposalMortgage.js +9 -0
- package/dist/components/Calculator/renderProposalMortgage.js.map +1 -0
- package/dist/components/Calculator/renderRate.d.ts +8 -0
- package/dist/components/Calculator/renderRate.js +9 -0
- package/dist/components/Calculator/renderRate.js.map +1 -0
- package/dist/components/Calculator/renderRealEstateValue.d.ts +10 -0
- package/dist/components/Calculator/renderRealEstateValue.js +15 -0
- package/dist/components/Calculator/renderRealEstateValue.js.map +1 -0
- package/dist/components/Calculator/renderWantedSumInput.d.ts +13 -0
- package/dist/components/Calculator/renderWantedSumInput.js +19 -0
- package/dist/components/Calculator/renderWantedSumInput.js.map +1 -0
- package/dist/components/ContentPage/ContentPage.d.ts +1 -1
- package/dist/components/Header/Header.js +2 -2
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/HeaderContent.d.ts +6 -0
- package/dist/components/Header/HeaderSubMenu.js +7 -4
- package/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/dist/components/ProductGallery/ProductGallery.js +37 -8
- package/dist/components/ProductGallery/ProductGallery.js.map +1 -1
- package/dist/components/ProductGallery/ProductGalleryContent.d.ts +3 -6
- package/dist/components/ProductTile/ProductTile.js +14 -2
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/dist/components/Tile/Tile.js +1 -1
- package/dist/components/Tile/Tile.js.map +1 -1
- package/dist/types.d.ts +1 -5
- package/dist/ui-kit/BlocksList/renderBlocksList.d.ts +0 -1
- package/dist/ui-kit/BlocksList/renderBlocksList.js +2 -3
- package/dist/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
- package/dist/ui-kit/Button/Button.js +2 -2
- package/dist/ui-kit/Button/Button.js.map +1 -1
- package/dist/ui-kit/Button/ButtonInner.js +2 -2
- package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/dist/ui-kit/Button/ButtonProps.d.ts +2 -0
- package/dist/ui-kit/Button/ButtonSection.js +1 -1
- package/dist/ui-kit/Button/ButtonSection.js.map +1 -1
- package/dist/ui-kit/Checkbox/Checkbox.js +1 -1
- package/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
- package/dist/ui-kit/InputRange/InputRange.js +2 -2
- package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
- package/dist/ui-kit/InputRange/InputRangeProps.d.ts +2 -1
- package/dist/ui-kit/Tabs/TabsProps.d.ts +2 -1
- package/lib/common.css +1 -1
- package/lib/components/Blocks.d.ts +1 -1
- package/lib/components/Blocks.js +2 -2
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Calculator/BonusCalculatorForm.d.ts +5 -0
- package/lib/components/Calculator/BonusCalculatorForm.js +38 -0
- package/lib/components/Calculator/BonusCalculatorForm.js.map +1 -0
- package/lib/components/Calculator/Calculator.d.ts +5 -0
- package/lib/components/{ProductGalleryGreen/ProductGalleryGreen.fixture.d.ts → Calculator/Calculator.fixture.d.ts} +1 -1
- package/lib/components/Calculator/Calculator.js +44 -0
- package/lib/components/Calculator/Calculator.js.map +1 -0
- package/lib/components/Calculator/CalculatorContent.d.ts +110 -0
- package/lib/components/Calculator/CalculatorContent.js +2 -0
- package/lib/components/Calculator/CalculatorContent.js.map +1 -0
- package/lib/components/Calculator/CalculatorValueBlock.d.ts +8 -0
- package/lib/components/Calculator/CalculatorValueBlock.js +7 -0
- package/lib/components/Calculator/CalculatorValueBlock.js.map +1 -0
- package/lib/components/Calculator/CreditCalculatorForm.d.ts +5 -0
- package/lib/components/Calculator/CreditCalculatorForm.js +49 -0
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -0
- package/lib/components/Calculator/DepositCalculatorForm.d.ts +5 -0
- package/lib/components/Calculator/DepositCalculatorForm.js +39 -0
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -0
- package/lib/components/Calculator/EmbeddableCalcBlocks.d.ts +11 -0
- package/lib/components/Calculator/EmbeddableCalcBlocks.js +11 -0
- package/lib/components/Calculator/EmbeddableCalcBlocks.js.map +1 -0
- package/lib/components/Calculator/MortgageCalculatorForm.d.ts +5 -0
- package/lib/components/Calculator/MortgageCalculatorForm.js +47 -0
- package/lib/components/Calculator/MortgageCalculatorForm.js.map +1 -0
- package/lib/components/Calculator/constants.d.ts +7 -0
- package/lib/components/Calculator/constants.js +8 -0
- package/lib/components/Calculator/constants.js.map +1 -0
- package/lib/components/Calculator/getCalculatorParams.d.ts +7 -0
- package/lib/components/Calculator/getCalculatorParams.js +8 -0
- package/lib/components/Calculator/getCalculatorParams.js.map +1 -0
- package/lib/components/Calculator/getCreditRate.d.ts +7 -0
- package/lib/components/Calculator/getCreditRate.js +10 -0
- package/lib/components/Calculator/getCreditRate.js.map +1 -0
- package/lib/components/Calculator/getDefaultMonths.d.ts +2 -0
- package/lib/components/Calculator/getDefaultMonths.js +5 -0
- package/lib/components/Calculator/getDefaultMonths.js.map +1 -0
- package/lib/components/Calculator/getDefaultSum.d.ts +2 -0
- package/lib/components/Calculator/getDefaultSum.js +5 -0
- package/lib/components/Calculator/getDefaultSum.js.map +1 -0
- package/lib/components/Calculator/getMonthlyPayment.d.ts +11 -0
- package/lib/components/Calculator/getMonthlyPayment.js +16 -0
- package/lib/components/Calculator/getMonthlyPayment.js.map +1 -0
- package/lib/components/Calculator/renderButtonSection.d.ts +1 -0
- package/lib/components/Calculator/renderButtonSection.js +6 -0
- package/lib/components/Calculator/renderButtonSection.js.map +1 -0
- package/lib/components/Calculator/renderCalculatorList.d.ts +10 -0
- package/lib/components/Calculator/renderCalculatorList.js +14 -0
- package/lib/components/Calculator/renderCalculatorList.js.map +1 -0
- package/lib/components/Calculator/renderInitialFeeInput.d.ts +10 -0
- package/lib/components/Calculator/renderInitialFeeInput.js +15 -0
- package/lib/components/Calculator/renderInitialFeeInput.js.map +1 -0
- package/lib/components/Calculator/renderMonthsInput.d.ts +11 -0
- package/lib/components/Calculator/renderMonthsInput.js +12 -0
- package/lib/components/Calculator/renderMonthsInput.js.map +1 -0
- package/lib/components/Calculator/renderProposal.d.ts +1 -0
- package/lib/components/Calculator/renderProposal.js +7 -0
- package/lib/components/Calculator/renderProposal.js.map +1 -0
- package/lib/components/Calculator/renderProposalMortgage.d.ts +7 -0
- package/lib/components/Calculator/renderProposalMortgage.js +6 -0
- package/lib/components/Calculator/renderProposalMortgage.js.map +1 -0
- package/lib/components/Calculator/renderRate.d.ts +8 -0
- package/lib/components/Calculator/renderRate.js +6 -0
- package/lib/components/Calculator/renderRate.js.map +1 -0
- package/lib/components/Calculator/renderRealEstateValue.d.ts +10 -0
- package/lib/components/Calculator/renderRealEstateValue.js +12 -0
- package/lib/components/Calculator/renderRealEstateValue.js.map +1 -0
- package/lib/components/Calculator/renderWantedSumInput.d.ts +13 -0
- package/lib/components/Calculator/renderWantedSumInput.js +16 -0
- package/lib/components/Calculator/renderWantedSumInput.js.map +1 -0
- package/lib/components/ContentPage/ContentPage.d.ts +1 -1
- package/lib/components/Header/Header.fixture.d.ts +1 -0
- package/lib/components/Header/Header.js +2 -2
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/HeaderContent.d.ts +6 -0
- package/lib/components/Header/HeaderSubMenu.js +7 -4
- package/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/lib/components/ProductGallery/ProductGallery.fixture.d.ts +1 -0
- package/lib/components/ProductGallery/ProductGallery.js +37 -8
- package/lib/components/ProductGallery/ProductGallery.js.map +1 -1
- package/lib/components/ProductGallery/ProductGalleryContent.d.ts +3 -6
- package/lib/components/ProductTile/ProductTile.fixture.d.ts +1 -0
- package/lib/components/ProductTile/ProductTile.js +14 -2
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/lib/components/Tile/Tile.js +1 -1
- package/lib/components/Tile/Tile.js.map +1 -1
- package/lib/types.d.ts +1 -5
- package/lib/ui-kit/BlocksList/renderBlocksList.d.ts +0 -1
- package/lib/ui-kit/BlocksList/renderBlocksList.js +1 -1
- package/lib/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
- package/lib/ui-kit/Button/Button.js +2 -2
- package/lib/ui-kit/Button/Button.js.map +1 -1
- package/lib/ui-kit/Button/ButtonInner.js +2 -2
- package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/lib/ui-kit/Button/ButtonProps.d.ts +2 -0
- package/lib/ui-kit/Button/ButtonSection.js +1 -1
- package/lib/ui-kit/Button/ButtonSection.js.map +1 -1
- package/lib/ui-kit/Checkbox/Checkbox.js +1 -1
- package/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
- package/lib/ui-kit/InputRange/InputRange.js +2 -2
- package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
- package/lib/ui-kit/InputRange/InputRangeProps.d.ts +2 -1
- package/lib/ui-kit/Tabs/TabsProps.d.ts +2 -1
- package/mobile/bundle/bundle.umd.js +3 -3
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/Calculator/BonusCalculatorForm.d.ts +5 -0
- package/mobile/dist/components/Calculator/BonusCalculatorForm.js +40 -0
- package/mobile/dist/components/Calculator/BonusCalculatorForm.js.map +1 -0
- package/mobile/dist/components/Calculator/Calculator.d.ts +5 -0
- package/mobile/dist/components/Calculator/Calculator.js +46 -0
- package/mobile/dist/components/Calculator/Calculator.js.map +1 -0
- package/mobile/dist/components/Calculator/CalculatorContent.d.ts +110 -0
- package/mobile/dist/components/{ProductGalleryGreen/ProductGalleryGreenContent.js → Calculator/CalculatorContent.js} +1 -1
- package/mobile/dist/components/Calculator/CalculatorContent.js.map +1 -0
- package/mobile/dist/components/Calculator/CalculatorValueBlock.d.ts +8 -0
- package/mobile/dist/components/Calculator/CalculatorValueBlock.js +9 -0
- package/mobile/dist/components/Calculator/CalculatorValueBlock.js.map +1 -0
- package/mobile/dist/components/Calculator/CreditCalculatorForm.d.ts +5 -0
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js +51 -0
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -0
- package/mobile/dist/components/Calculator/DepositCalculatorForm.d.ts +5 -0
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +41 -0
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -0
- package/mobile/dist/components/Calculator/EmbeddableCalcBlocks.d.ts +11 -0
- package/mobile/dist/components/Calculator/EmbeddableCalcBlocks.js +13 -0
- package/mobile/dist/components/Calculator/EmbeddableCalcBlocks.js.map +1 -0
- package/mobile/dist/components/Calculator/MortgageCalculatorForm.d.ts +5 -0
- package/mobile/dist/components/Calculator/MortgageCalculatorForm.js +49 -0
- package/mobile/dist/components/Calculator/MortgageCalculatorForm.js.map +1 -0
- package/mobile/dist/components/Calculator/constants.d.ts +7 -0
- package/mobile/dist/components/Calculator/constants.js +10 -0
- package/mobile/dist/components/Calculator/constants.js.map +1 -0
- package/mobile/dist/components/Calculator/getCalculatorParams.d.ts +7 -0
- package/mobile/dist/components/Calculator/getCalculatorParams.js +11 -0
- package/mobile/dist/components/Calculator/getCalculatorParams.js.map +1 -0
- package/mobile/dist/components/Calculator/getCreditRate.d.ts +7 -0
- package/mobile/dist/components/Calculator/getCreditRate.js +13 -0
- package/mobile/dist/components/Calculator/getCreditRate.js.map +1 -0
- package/mobile/dist/components/Calculator/getDefaultMonths.d.ts +2 -0
- package/mobile/dist/components/Calculator/getDefaultMonths.js +8 -0
- package/mobile/dist/components/Calculator/getDefaultMonths.js.map +1 -0
- package/mobile/dist/components/Calculator/getDefaultSum.d.ts +2 -0
- package/mobile/dist/components/Calculator/getDefaultSum.js +8 -0
- package/mobile/dist/components/Calculator/getDefaultSum.js.map +1 -0
- package/mobile/dist/components/Calculator/getMonthlyPayment.d.ts +11 -0
- package/mobile/dist/components/Calculator/getMonthlyPayment.js +19 -0
- package/mobile/dist/components/Calculator/getMonthlyPayment.js.map +1 -0
- package/mobile/dist/components/Calculator/renderButtonSection.d.ts +1 -0
- package/mobile/dist/components/Calculator/renderButtonSection.js +9 -0
- package/mobile/dist/components/Calculator/renderButtonSection.js.map +1 -0
- package/mobile/dist/components/Calculator/renderCalculatorList.d.ts +10 -0
- package/mobile/dist/components/Calculator/renderCalculatorList.js +17 -0
- package/mobile/dist/components/Calculator/renderCalculatorList.js.map +1 -0
- package/mobile/dist/components/Calculator/renderInitialFeeInput.d.ts +10 -0
- package/mobile/dist/components/Calculator/renderInitialFeeInput.js +18 -0
- package/mobile/dist/components/Calculator/renderInitialFeeInput.js.map +1 -0
- package/mobile/dist/components/Calculator/renderMonthsInput.d.ts +11 -0
- package/mobile/dist/components/Calculator/renderMonthsInput.js +15 -0
- package/mobile/dist/components/Calculator/renderMonthsInput.js.map +1 -0
- package/mobile/dist/components/Calculator/renderProposal.d.ts +1 -0
- package/mobile/dist/components/Calculator/renderProposal.js +10 -0
- package/mobile/dist/components/Calculator/renderProposal.js.map +1 -0
- package/mobile/dist/components/Calculator/renderProposalMortgage.d.ts +7 -0
- package/mobile/dist/components/Calculator/renderProposalMortgage.js +9 -0
- package/mobile/dist/components/Calculator/renderProposalMortgage.js.map +1 -0
- package/mobile/dist/components/Calculator/renderRate.d.ts +8 -0
- package/mobile/dist/components/Calculator/renderRate.js +9 -0
- package/mobile/dist/components/Calculator/renderRate.js.map +1 -0
- package/mobile/dist/components/Calculator/renderRealEstateValue.d.ts +10 -0
- package/mobile/dist/components/Calculator/renderRealEstateValue.js +15 -0
- package/mobile/dist/components/Calculator/renderRealEstateValue.js.map +1 -0
- package/mobile/dist/components/Calculator/renderWantedSumInput.d.ts +13 -0
- package/mobile/dist/components/Calculator/renderWantedSumInput.js +19 -0
- package/mobile/dist/components/Calculator/renderWantedSumInput.js.map +1 -0
- package/mobile/dist/components/ContentPage/ContentPage.d.ts +1 -1
- package/mobile/dist/components/Header/HeaderContent.d.ts +6 -0
- package/mobile/dist/components/Header/HeaderSubMenu.js +7 -4
- package/mobile/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/dist/components/ProductGallery/ProductGalleryContent.d.ts +3 -6
- package/mobile/dist/components/ProductTile/ProductTile.js +14 -2
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/mobile/dist/components/Tile/Tile.js +1 -1
- package/mobile/dist/components/Tile/Tile.js.map +1 -1
- package/mobile/dist/types.d.ts +1 -5
- package/mobile/dist/ui-kit/BlocksList/renderBlocksList.d.ts +0 -1
- package/mobile/dist/ui-kit/BlocksList/renderBlocksList.js +2 -3
- package/mobile/dist/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonInner.js +2 -2
- package/mobile/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonProps.d.ts +2 -0
- package/mobile/dist/ui-kit/Button/ButtonSection.js +1 -1
- package/mobile/dist/ui-kit/Button/ButtonSection.js.map +1 -1
- package/mobile/dist/ui-kit/Checkbox/Checkbox.js +1 -1
- package/mobile/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
- package/mobile/dist/ui-kit/InputRange/InputRange.js +2 -2
- package/mobile/dist/ui-kit/InputRange/InputRange.js.map +1 -1
- package/mobile/dist/ui-kit/InputRange/InputRangeProps.d.ts +2 -1
- package/mobile/dist/ui-kit/Tabs/TabsProps.d.ts +2 -1
- package/mobile/lib/components/Calculator/BonusCalculatorForm.d.ts +5 -0
- package/mobile/lib/components/Calculator/BonusCalculatorForm.js +38 -0
- package/mobile/lib/components/Calculator/BonusCalculatorForm.js.map +1 -0
- package/mobile/lib/components/Calculator/Calculator.d.ts +5 -0
- package/mobile/lib/components/Calculator/Calculator.js +44 -0
- package/mobile/lib/components/Calculator/Calculator.js.map +1 -0
- package/mobile/lib/components/Calculator/CalculatorContent.d.ts +110 -0
- package/mobile/lib/components/Calculator/CalculatorContent.js +2 -0
- package/mobile/lib/components/Calculator/CalculatorContent.js.map +1 -0
- package/mobile/lib/components/Calculator/CalculatorValueBlock.d.ts +8 -0
- package/mobile/lib/components/Calculator/CalculatorValueBlock.js +7 -0
- package/mobile/lib/components/Calculator/CalculatorValueBlock.js.map +1 -0
- package/mobile/lib/components/Calculator/CreditCalculatorForm.d.ts +5 -0
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js +49 -0
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -0
- package/mobile/lib/components/Calculator/DepositCalculatorForm.d.ts +5 -0
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +39 -0
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -0
- package/mobile/lib/components/Calculator/EmbeddableCalcBlocks.d.ts +11 -0
- package/mobile/lib/components/Calculator/EmbeddableCalcBlocks.js +11 -0
- package/mobile/lib/components/Calculator/EmbeddableCalcBlocks.js.map +1 -0
- package/mobile/lib/components/Calculator/MortgageCalculatorForm.d.ts +5 -0
- package/mobile/lib/components/Calculator/MortgageCalculatorForm.js +47 -0
- package/mobile/lib/components/Calculator/MortgageCalculatorForm.js.map +1 -0
- package/mobile/lib/components/Calculator/constants.d.ts +7 -0
- package/mobile/lib/components/Calculator/constants.js +8 -0
- package/mobile/lib/components/Calculator/constants.js.map +1 -0
- package/mobile/lib/components/Calculator/getCalculatorParams.d.ts +7 -0
- package/mobile/lib/components/Calculator/getCalculatorParams.js +8 -0
- package/mobile/lib/components/Calculator/getCalculatorParams.js.map +1 -0
- package/mobile/lib/components/Calculator/getCreditRate.d.ts +7 -0
- package/mobile/lib/components/Calculator/getCreditRate.js +10 -0
- package/mobile/lib/components/Calculator/getCreditRate.js.map +1 -0
- package/mobile/lib/components/Calculator/getDefaultMonths.d.ts +2 -0
- package/mobile/lib/components/Calculator/getDefaultMonths.js +5 -0
- package/mobile/lib/components/Calculator/getDefaultMonths.js.map +1 -0
- package/mobile/lib/components/Calculator/getDefaultSum.d.ts +2 -0
- package/mobile/lib/components/Calculator/getDefaultSum.js +5 -0
- package/mobile/lib/components/Calculator/getDefaultSum.js.map +1 -0
- package/mobile/lib/components/Calculator/getMonthlyPayment.d.ts +11 -0
- package/mobile/lib/components/Calculator/getMonthlyPayment.js +16 -0
- package/mobile/lib/components/Calculator/getMonthlyPayment.js.map +1 -0
- package/mobile/lib/components/Calculator/renderButtonSection.d.ts +1 -0
- package/mobile/lib/components/Calculator/renderButtonSection.js +6 -0
- package/mobile/lib/components/Calculator/renderButtonSection.js.map +1 -0
- package/mobile/lib/components/Calculator/renderCalculatorList.d.ts +10 -0
- package/mobile/lib/components/Calculator/renderCalculatorList.js +14 -0
- package/mobile/lib/components/Calculator/renderCalculatorList.js.map +1 -0
- package/mobile/lib/components/Calculator/renderInitialFeeInput.d.ts +10 -0
- package/mobile/lib/components/Calculator/renderInitialFeeInput.js +15 -0
- package/mobile/lib/components/Calculator/renderInitialFeeInput.js.map +1 -0
- package/mobile/lib/components/Calculator/renderMonthsInput.d.ts +11 -0
- package/mobile/lib/components/Calculator/renderMonthsInput.js +12 -0
- package/mobile/lib/components/Calculator/renderMonthsInput.js.map +1 -0
- package/mobile/lib/components/Calculator/renderProposal.d.ts +1 -0
- package/mobile/lib/components/Calculator/renderProposal.js +7 -0
- package/mobile/lib/components/Calculator/renderProposal.js.map +1 -0
- package/mobile/lib/components/Calculator/renderProposalMortgage.d.ts +7 -0
- package/mobile/lib/components/Calculator/renderProposalMortgage.js +6 -0
- package/mobile/lib/components/Calculator/renderProposalMortgage.js.map +1 -0
- package/mobile/lib/components/Calculator/renderRate.d.ts +8 -0
- package/mobile/lib/components/Calculator/renderRate.js +6 -0
- package/mobile/lib/components/Calculator/renderRate.js.map +1 -0
- package/mobile/lib/components/Calculator/renderRealEstateValue.d.ts +10 -0
- package/mobile/lib/components/Calculator/renderRealEstateValue.js +12 -0
- package/mobile/lib/components/Calculator/renderRealEstateValue.js.map +1 -0
- package/mobile/lib/components/Calculator/renderWantedSumInput.d.ts +13 -0
- package/mobile/lib/components/Calculator/renderWantedSumInput.js +16 -0
- package/mobile/lib/components/Calculator/renderWantedSumInput.js.map +1 -0
- package/mobile/lib/components/ContentPage/ContentPage.d.ts +1 -1
- package/mobile/lib/components/Header/HeaderContent.d.ts +6 -0
- package/mobile/lib/components/Header/HeaderSubMenu.js +7 -4
- package/mobile/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/lib/components/ProductGallery/ProductGalleryContent.d.ts +3 -6
- package/mobile/lib/components/ProductTile/ProductTile.js +14 -2
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +2 -0
- package/mobile/lib/components/Tile/Tile.js +1 -1
- package/mobile/lib/components/Tile/Tile.js.map +1 -1
- package/mobile/lib/types.d.ts +1 -5
- package/mobile/lib/ui-kit/BlocksList/renderBlocksList.d.ts +0 -1
- package/mobile/lib/ui-kit/BlocksList/renderBlocksList.js +1 -1
- package/mobile/lib/ui-kit/BlocksList/renderBlocksList.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonInner.js +2 -2
- package/mobile/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonProps.d.ts +2 -0
- package/mobile/lib/ui-kit/Button/ButtonSection.js +1 -1
- package/mobile/lib/ui-kit/Button/ButtonSection.js.map +1 -1
- package/mobile/lib/ui-kit/Checkbox/Checkbox.js +1 -1
- package/mobile/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
- package/mobile/lib/ui-kit/InputRange/InputRange.js +2 -2
- package/mobile/lib/ui-kit/InputRange/InputRange.js.map +1 -1
- package/mobile/lib/ui-kit/InputRange/InputRangeProps.d.ts +2 -1
- package/mobile/lib/ui-kit/Tabs/TabsProps.d.ts +2 -1
- package/mobile/src/common.css +7 -0
- package/mobile/src/components/Calculator/BonusCalculatorForm.tsx +71 -0
- package/mobile/src/components/Calculator/Calculator.tsx +141 -0
- package/mobile/src/components/Calculator/CalculatorContent.ts +134 -0
- package/mobile/src/components/Calculator/CalculatorValueBlock.tsx +25 -0
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +99 -0
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +69 -0
- package/mobile/src/components/Calculator/EmbeddableCalcBlocks.tsx +17 -0
- package/mobile/src/components/Calculator/MortgageCalculatorForm.tsx +88 -0
- package/mobile/src/components/Calculator/constants.ts +8 -0
- package/mobile/src/components/Calculator/getCalculatorParams.ts +16 -0
- package/mobile/src/components/Calculator/getCreditRate.ts +18 -0
- package/mobile/src/components/Calculator/getDefaultMonths.ts +7 -0
- package/mobile/src/components/Calculator/getDefaultSum.ts +7 -0
- package/mobile/src/components/Calculator/getMonthlyPayment.ts +32 -0
- package/mobile/src/components/Calculator/renderButtonSection.tsx +7 -0
- package/mobile/src/components/Calculator/renderCalculatorList.tsx +43 -0
- package/mobile/src/components/Calculator/renderInitialFeeInput.tsx +37 -0
- package/mobile/src/components/Calculator/renderMonthsInput.tsx +34 -0
- package/mobile/src/components/Calculator/renderProposal.tsx +14 -0
- package/mobile/src/components/Calculator/renderProposalMortgage.tsx +17 -0
- package/mobile/src/components/Calculator/renderRate.tsx +23 -0
- package/mobile/src/components/Calculator/renderRealEstateValue.tsx +33 -0
- package/mobile/src/components/Calculator/renderWantedSumInput.tsx +49 -0
- package/mobile/src/components/ContentPage/ContentPage.page.json +9 -8
- package/mobile/src/components/ContentPage/ContentPage.tsx +2 -2
- package/mobile/src/components/Header/HeaderContent.ts +6 -0
- package/mobile/src/components/Header/HeaderSubMenu.tsx +10 -5
- package/mobile/src/components/ProductGallery/ProductGallery.example.json +8 -10
- package/mobile/src/components/ProductGallery/ProductGalleryContent.ts +3 -6
- package/mobile/src/components/ProductTile/ProductTile.tsx +30 -13
- package/mobile/src/components/ProductTile/ProductTileContent.ts +2 -0
- package/mobile/src/components/Tile/Tile.tsx +5 -1
- package/mobile/src/icons/SafeIcon.svg +7 -1
- package/mobile/src/types.ts +2 -6
- package/mobile/src/ui-kit/BlocksList/renderBlocksList.tsx +1 -1
- package/mobile/src/ui-kit/Button/ButtonInner.tsx +2 -1
- package/mobile/src/ui-kit/Button/ButtonProps.ts +2 -0
- package/mobile/src/ui-kit/Button/ButtonSection.tsx +1 -1
- package/mobile/src/ui-kit/Checkbox/Checkbox.tsx +1 -3
- package/mobile/src/ui-kit/InputRange/InputRange.tsx +7 -9
- package/mobile/src/ui-kit/InputRange/InputRangeProps.ts +3 -1
- package/mobile/src/ui-kit/Tabs/TabsProps.ts +2 -1
- package/package.json +1 -1
- package/src/common.css +7 -0
- package/src/components/Blocks.ts +2 -2
- package/src/components/Calculator/BonusCalculatorForm.tsx +71 -0
- package/src/components/Calculator/Calculator.fixture.tsx +131 -0
- package/src/components/Calculator/Calculator.tsx +141 -0
- package/src/components/Calculator/CalculatorContent.ts +134 -0
- package/src/components/Calculator/CalculatorValueBlock.tsx +25 -0
- package/src/components/Calculator/CreditCalculatorForm.tsx +99 -0
- package/src/components/Calculator/DepositCalculatorForm.tsx +69 -0
- package/src/components/Calculator/EmbeddableCalcBlocks.tsx +17 -0
- package/src/components/Calculator/MortgageCalculatorForm.tsx +88 -0
- package/src/components/Calculator/constants.ts +8 -0
- package/src/components/Calculator/getCalculatorParams.ts +16 -0
- package/src/components/Calculator/getCreditRate.ts +18 -0
- package/src/components/Calculator/getDefaultMonths.ts +7 -0
- package/src/components/Calculator/getDefaultSum.ts +7 -0
- package/src/components/Calculator/getMonthlyPayment.ts +32 -0
- package/src/components/Calculator/renderButtonSection.tsx +7 -0
- package/src/components/Calculator/renderCalculatorList.tsx +43 -0
- package/src/components/Calculator/renderInitialFeeInput.tsx +37 -0
- package/src/components/Calculator/renderMonthsInput.tsx +34 -0
- package/src/components/Calculator/renderProposal.tsx +14 -0
- package/src/components/Calculator/renderProposalMortgage.tsx +17 -0
- package/src/components/Calculator/renderRate.tsx +23 -0
- package/src/components/Calculator/renderRealEstateValue.tsx +33 -0
- package/src/components/Calculator/renderWantedSumInput.tsx +49 -0
- package/src/components/ContentPage/ContentPage.page.json +9 -8
- package/src/components/ContentPage/ContentPage.tsx +2 -2
- package/src/components/Header/Header.fixture.tsx +1 -0
- package/src/components/Header/Header.tsx +4 -1
- package/src/components/Header/HeaderContent.ts +6 -0
- package/src/components/Header/HeaderSubMenu.tsx +10 -5
- package/src/components/ProductBlock/ProductBlock.fixture.mobile.tsx +1 -1
- package/src/components/ProductGallery/ProductGallery.example.json +8 -10
- package/src/components/ProductGallery/ProductGallery.fixture.tsx +146 -104
- package/src/components/ProductGallery/ProductGallery.tsx +73 -24
- package/src/components/ProductGallery/ProductGalleryContent.ts +3 -6
- package/src/components/ProductTile/ProductTile.fixture.tsx +50 -5
- package/src/components/ProductTile/ProductTile.tsx +30 -13
- package/src/components/ProductTile/ProductTileContent.ts +2 -0
- package/src/components/Tile/Tile.tsx +5 -1
- package/src/icons/SafeIcon.svg +7 -1
- package/src/types.ts +2 -6
- package/src/ui-kit/BlocksList/renderBlocksList.tsx +1 -1
- package/src/ui-kit/Button/Button.fixture.tsx +12 -0
- package/src/ui-kit/Button/Button.tsx +8 -2
- package/src/ui-kit/Button/ButtonInner.tsx +2 -1
- package/src/ui-kit/Button/ButtonProps.ts +2 -0
- package/src/ui-kit/Button/ButtonSection.tsx +1 -1
- package/src/ui-kit/Checkbox/Checkbox.tsx +1 -3
- package/src/ui-kit/InputRange/InputRange.tsx +7 -9
- package/src/ui-kit/InputRange/InputRangeProps.ts +3 -1
- package/src/ui-kit/Tabs/TabsProps.ts +2 -1
- package/dist/components/ContentPage/CustomContentPage.d.ts +0 -30
- package/dist/components/ContentPage/CustomContentPage.js +0 -33
- package/dist/components/ContentPage/CustomContentPage.js.map +0 -1
- package/dist/components/ProductGalleryGreen/ProductGalleryGreen.d.ts +0 -5
- package/dist/components/ProductGalleryGreen/ProductGalleryGreen.js +0 -53
- package/dist/components/ProductGalleryGreen/ProductGalleryGreen.js.map +0 -1
- package/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +0 -32
- package/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.js.map +0 -1
- package/lib/components/ContentPage/CustomContentPage.d.ts +0 -30
- package/lib/components/ContentPage/CustomContentPage.js +0 -31
- package/lib/components/ContentPage/CustomContentPage.js.map +0 -1
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.d.ts +0 -5
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.js +0 -51
- package/lib/components/ProductGalleryGreen/ProductGalleryGreen.js.map +0 -1
- package/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +0 -32
- package/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.js +0 -2
- package/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.js.map +0 -1
- package/mobile/dist/components/ContentPage/CustomContentPage.d.ts +0 -30
- package/mobile/dist/components/ContentPage/CustomContentPage.js +0 -33
- package/mobile/dist/components/ContentPage/CustomContentPage.js.map +0 -1
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.d.ts +0 -5
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.js +0 -53
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreen.js.map +0 -1
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +0 -32
- package/mobile/dist/components/ProductGalleryGreen/ProductGalleryGreenContent.js.map +0 -1
- package/mobile/lib/components/ContentPage/CustomContentPage.d.ts +0 -30
- package/mobile/lib/components/ContentPage/CustomContentPage.js +0 -31
- package/mobile/lib/components/ContentPage/CustomContentPage.js.map +0 -1
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.d.ts +0 -5
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.js +0 -51
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreen.js.map +0 -1
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.d.ts +0 -32
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.js +0 -2
- package/mobile/lib/components/ProductGalleryGreen/ProductGalleryGreenContent.js.map +0 -1
- package/mobile/src/components/ContentPage/CustomContentPage.tsx +0 -82
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreen.example.json +0 -23
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreen.tsx +0 -120
- package/mobile/src/components/ProductGalleryGreen/ProductGalleryGreenContent.ts +0 -34
- package/src/components/ContentPage/CustomContentPage.tsx +0 -82
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.example.json +0 -23
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.fixture.tsx +0 -186
- package/src/components/ProductGalleryGreen/ProductGalleryGreen.tsx +0 -120
- package/src/components/ProductGalleryGreen/ProductGalleryGreenContent.ts +0 -34
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { UniBlockProps } from '../../types';
|
|
3
|
+
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
4
|
+
import { getDefaultSum } from './getDefaultSum';
|
|
5
|
+
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
6
|
+
import { renderRate } from './renderRate';
|
|
7
|
+
import { renderButtonSection } from './renderButtonSection';
|
|
8
|
+
import { BonusCalculatorParams, CommonCalculatorProps } from './CalculatorContent';
|
|
9
|
+
|
|
10
|
+
export interface BonusCalculatorProp
|
|
11
|
+
extends BonusCalculatorParams,
|
|
12
|
+
CommonCalculatorProps,
|
|
13
|
+
UniBlockProps {}
|
|
14
|
+
|
|
15
|
+
export const BonusCalculatorForm = JSX<BonusCalculatorProp>(
|
|
16
|
+
({
|
|
17
|
+
context,
|
|
18
|
+
className = '',
|
|
19
|
+
buttons,
|
|
20
|
+
bonus,
|
|
21
|
+
minSumTrip,
|
|
22
|
+
maxSumTrip,
|
|
23
|
+
minSumOther,
|
|
24
|
+
maxSumOther,
|
|
25
|
+
}) => {
|
|
26
|
+
const [bonusTripValue, setBonusTripValue] = context.useState<number | undefined>(undefined);
|
|
27
|
+
const [bonusOtherValue, setBonusOtherValue] = context.useState<number | undefined>(undefined);
|
|
28
|
+
const calculatorTripParams = { minSum: minSumTrip, maxSum: maxSumTrip };
|
|
29
|
+
const calculatorOtherParams = { minSum: minSumOther, maxSum: maxSumOther };
|
|
30
|
+
|
|
31
|
+
const incomeBonus = 948841;
|
|
32
|
+
const bonusOrDef = bonus || 2528;
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<section className={className}>
|
|
36
|
+
<div className="w-[468px]">
|
|
37
|
+
{renderWantedSumInput({
|
|
38
|
+
title: 'Сумма покупок в категории путешествия, ₽',
|
|
39
|
+
calculatorParams: calculatorTripParams,
|
|
40
|
+
moneyValue: bonusTripValue,
|
|
41
|
+
defaultSum: getDefaultSum(calculatorTripParams),
|
|
42
|
+
setMoneyValue: setBonusTripValue,
|
|
43
|
+
isShowItems: false,
|
|
44
|
+
})}
|
|
45
|
+
{renderWantedSumInput({
|
|
46
|
+
className: 'mt-6',
|
|
47
|
+
title: 'Сумма покупок в остальных категориях, ₽',
|
|
48
|
+
calculatorParams: calculatorOtherParams,
|
|
49
|
+
moneyValue: bonusOtherValue,
|
|
50
|
+
defaultSum: getDefaultSum(calculatorOtherParams),
|
|
51
|
+
setMoneyValue: setBonusOtherValue,
|
|
52
|
+
isShowItems: false,
|
|
53
|
+
})}
|
|
54
|
+
</div>
|
|
55
|
+
<div>
|
|
56
|
+
{bonusOrDef
|
|
57
|
+
? renderRate({
|
|
58
|
+
rate: bonusOrDef,
|
|
59
|
+
title: 'Баллов за месяц',
|
|
60
|
+
className: 'tracking-[-14px]',
|
|
61
|
+
})
|
|
62
|
+
: null}
|
|
63
|
+
</div>
|
|
64
|
+
<div className="w-[240px]">
|
|
65
|
+
{incomeBonus ? <CalculatorValueBlock title="Баллов за год" value={incomeBonus} /> : null}
|
|
66
|
+
{renderButtonSection(context, buttons)}
|
|
67
|
+
</div>
|
|
68
|
+
</section>
|
|
69
|
+
);
|
|
70
|
+
},
|
|
71
|
+
);
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { UniBlockProps } from '../../types';
|
|
3
|
+
import type { CalculatorContent, CalculatorBlockDef } from './CalculatorContent';
|
|
4
|
+
import { ArrowButton } from '../../ui-kit/Button/ArrowButton';
|
|
5
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
+
import { renderCalculatorList } from './renderCalculatorList';
|
|
7
|
+
import { CalculatorNav } from './CalculatorContent';
|
|
8
|
+
|
|
9
|
+
export interface CalculatorProps extends CalculatorContent, UniBlockProps {}
|
|
10
|
+
|
|
11
|
+
type TabsProps = {
|
|
12
|
+
tabsShift: number;
|
|
13
|
+
tabsNav: CalculatorNav[];
|
|
14
|
+
activeSlideIndex: number;
|
|
15
|
+
setActiveSlideIndex: (i: number) => void;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type NavButtonProps = {
|
|
19
|
+
tab: CalculatorNav;
|
|
20
|
+
i: number;
|
|
21
|
+
activeSlideIndex: number;
|
|
22
|
+
onClick: (ev: MouseEvent) => void;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const arrowBtnStyle =
|
|
26
|
+
'absolute w-[56px] h-[56px] min-h-[56px] max-h-[56px] top-1 z-10 mt-[25px] bg-white rounded-full';
|
|
27
|
+
|
|
28
|
+
export const Calculator = JSX<CalculatorProps>(
|
|
29
|
+
({ className = '', context, calcTabs = [], anchor = null }) => {
|
|
30
|
+
const tabsNav = calcTabs.map((_) => _.nav || ({} as CalculatorNav));
|
|
31
|
+
const blockCalcTabs = calcTabs.map(
|
|
32
|
+
({ calculatorBlock }) => calculatorBlock || ({} as CalculatorBlockDef),
|
|
33
|
+
);
|
|
34
|
+
const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
|
|
35
|
+
const [tabsShift, setTabsShift] = context.useState(0);
|
|
36
|
+
|
|
37
|
+
const handleNextClick = () => setTabsShift(tabsShift + 1);
|
|
38
|
+
const handlePrevClick = () => setTabsShift(tabsShift - 1);
|
|
39
|
+
|
|
40
|
+
const isGalleryScrollAvailable = calcTabs?.length > 3;
|
|
41
|
+
const showNextButton = isGalleryScrollAvailable && calcTabs?.length > tabsShift + 3;
|
|
42
|
+
const showPrevButton = tabsShift > 0;
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<section
|
|
46
|
+
id={anchor}
|
|
47
|
+
className={`box-border overflow-hidden relative font-sans w-100 bg-white text-primary-text ${className}`}
|
|
48
|
+
>
|
|
49
|
+
<div>
|
|
50
|
+
{tabsNav.length > 1
|
|
51
|
+
? renderTabs({ tabsShift, tabsNav, activeSlideIndex, setActiveSlideIndex })
|
|
52
|
+
: null}
|
|
53
|
+
{showPrevButton ? (
|
|
54
|
+
<ArrowButton
|
|
55
|
+
className={`${arrowBtnStyle} left-3 top-3`}
|
|
56
|
+
onClick={handlePrevClick}
|
|
57
|
+
ariaLabel="Пролистать влево"
|
|
58
|
+
data-block-control="scroll-left"
|
|
59
|
+
/>
|
|
60
|
+
) : null}
|
|
61
|
+
{showNextButton ? (
|
|
62
|
+
<ArrowButton
|
|
63
|
+
className={`${arrowBtnStyle} right-3 top-3 rotate-180`}
|
|
64
|
+
onClick={handleNextClick}
|
|
65
|
+
ariaLabel="Пролистать вправо"
|
|
66
|
+
data-block-control="scroll-right"
|
|
67
|
+
/>
|
|
68
|
+
) : null}
|
|
69
|
+
</div>
|
|
70
|
+
<div
|
|
71
|
+
className="flex"
|
|
72
|
+
style={{ transform: `translateX(-${activeSlideIndex}00%)` }}
|
|
73
|
+
role="list"
|
|
74
|
+
>
|
|
75
|
+
{renderCalculatorList({
|
|
76
|
+
context,
|
|
77
|
+
className,
|
|
78
|
+
blockCalcTabs,
|
|
79
|
+
})}
|
|
80
|
+
</div>
|
|
81
|
+
</section>
|
|
82
|
+
);
|
|
83
|
+
},
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
function renderNavButton({ tab, i, activeSlideIndex, onClick }: NavButtonProps) {
|
|
87
|
+
const isActiveBtn = i === activeSlideIndex;
|
|
88
|
+
|
|
89
|
+
const btnClassName = isActiveBtn
|
|
90
|
+
? 'h-[88px] w-[387px] min-w-[387px] p-5 border-none bg-primary-main text-white'
|
|
91
|
+
: `h-[77px] w-[322px] min-w-[322px] px-5 py-4 ease-in duration-300 bg-white text-primary-text`;
|
|
92
|
+
const btnTitleClassName = isActiveBtn ? 'text-md-new mb-1.5' : `text-base mb-[3px]`;
|
|
93
|
+
const btnDescClassName = isActiveBtn ? 'text-base text-white' : `text-m-md`;
|
|
94
|
+
const iconClassName = isActiveBtn ? '' : `text-primary-main`;
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<button
|
|
98
|
+
type="button"
|
|
99
|
+
key={String(i)}
|
|
100
|
+
onClick={onClick}
|
|
101
|
+
aria-label={tab?.title}
|
|
102
|
+
className={`box-border font-sans relative border-[1px] border-main-stroke cursor-pointer text-left border-b-0 flex
|
|
103
|
+
${btnClassName}`}
|
|
104
|
+
>
|
|
105
|
+
<Img
|
|
106
|
+
className={`h-[24px] w-[24px] min-w-[24px] min-h-[24px] mr-4 ${iconClassName}`}
|
|
107
|
+
image={{ ...tab?.icon, iconVersion: isActiveBtn ? 'white' : 'normal' }}
|
|
108
|
+
width="24"
|
|
109
|
+
height="24"
|
|
110
|
+
asSVG
|
|
111
|
+
/>
|
|
112
|
+
<div className="border-0">
|
|
113
|
+
<div className={`font-medium ${btnTitleClassName}`}>{tab?.title}</div>
|
|
114
|
+
<div className={`text-secondary-text ${btnDescClassName}`}>{tab.description}</div>
|
|
115
|
+
</div>
|
|
116
|
+
</button>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function renderTabs({ tabsShift, tabsNav, activeSlideIndex, setActiveSlideIndex }: TabsProps) {
|
|
121
|
+
return (
|
|
122
|
+
<div>
|
|
123
|
+
<div
|
|
124
|
+
style={{ transform: `translateX(-${tabsShift * 388}px)` }}
|
|
125
|
+
className="flex flex-col justify-end items-center h-[126px] pt-[38px] box-border duration-1000"
|
|
126
|
+
>
|
|
127
|
+
<div className="w-full flex flex-nowrap items-end gap-2">
|
|
128
|
+
{tabsNav.map((tab, i) =>
|
|
129
|
+
renderNavButton({
|
|
130
|
+
tab,
|
|
131
|
+
i,
|
|
132
|
+
activeSlideIndex,
|
|
133
|
+
onClick: () => setActiveSlideIndex(i),
|
|
134
|
+
}),
|
|
135
|
+
)}
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
<div className="w-full h-2 bg-primary-main" />
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Picture } from '../../model/Picture';
|
|
2
|
+
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
3
|
+
|
|
4
|
+
export interface CommonCalculatorProps {
|
|
5
|
+
buttons?: ButtonWithIconProps[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface CreditCalculatorParams {
|
|
9
|
+
isSalary?: boolean;
|
|
10
|
+
isInsurance?: boolean;
|
|
11
|
+
isAnnuity?: boolean;
|
|
12
|
+
minSum?: number;
|
|
13
|
+
maxSum?: number;
|
|
14
|
+
minMonths?: number;
|
|
15
|
+
maxMonths?: number;
|
|
16
|
+
rateWithInsurance?: number;
|
|
17
|
+
rateWithoutInsurance?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface MortgageCalculatorParams {
|
|
21
|
+
isAnnuity?: boolean;
|
|
22
|
+
minInitialContribution?: number;
|
|
23
|
+
minSum?: number;
|
|
24
|
+
maxSum?: number;
|
|
25
|
+
minMonths?: number;
|
|
26
|
+
maxMonths?: number;
|
|
27
|
+
rateWithInsurance?: number;
|
|
28
|
+
rateWithoutInsurance?: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface DepositCalculatorParams {
|
|
32
|
+
minSum?: number;
|
|
33
|
+
maxSum?: number;
|
|
34
|
+
minMonths?: number;
|
|
35
|
+
maxMonths?: number;
|
|
36
|
+
rate?: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface BonusCalculatorParams {
|
|
40
|
+
bonus?: number;
|
|
41
|
+
minSumTrip?: number;
|
|
42
|
+
maxSumTrip?: number;
|
|
43
|
+
minSumOther?: number;
|
|
44
|
+
maxSumOther?: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface CalculatorParams {
|
|
48
|
+
isAnnuity?: boolean;
|
|
49
|
+
minSum?: number;
|
|
50
|
+
maxSum?: number;
|
|
51
|
+
minMonths?: number;
|
|
52
|
+
maxMonths?: number;
|
|
53
|
+
rateWithInsurance?: number;
|
|
54
|
+
rateWithoutInsurance?: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @title Заголовок
|
|
59
|
+
* @default {"calcType": "CreditCalculatorForm"}
|
|
60
|
+
*/
|
|
61
|
+
export type CreditCalculatorParamsDef = CreditCalculatorParams &
|
|
62
|
+
CommonCalculatorProps & {
|
|
63
|
+
calcType: 'CreditCalculatorForm';
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @title Заголовок
|
|
68
|
+
* @default {"calcType": "MortgageCalculatorForm"}
|
|
69
|
+
*/
|
|
70
|
+
export type MortgageCalculatorParamsDef = MortgageCalculatorParams &
|
|
71
|
+
CommonCalculatorProps & {
|
|
72
|
+
calcType: 'MortgageCalculatorForm';
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @title Заголовок
|
|
77
|
+
* @default {"calcType": "DepositCalculatorForm"}
|
|
78
|
+
*/
|
|
79
|
+
export type DepositCalculatorParamsDef = DepositCalculatorParams &
|
|
80
|
+
CommonCalculatorProps & {
|
|
81
|
+
calcType: 'DepositCalculatorForm';
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @title Заголовок
|
|
86
|
+
* @default {"calcType": "BonusCalculatorForm"}
|
|
87
|
+
*/
|
|
88
|
+
export type BonusCalculatorParamsDef = BonusCalculatorParams &
|
|
89
|
+
CommonCalculatorProps & {
|
|
90
|
+
calcType: 'BonusCalculatorForm';
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @title Выберите калькулятор
|
|
95
|
+
*/
|
|
96
|
+
export type EmptyOption = null;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @title Калькулятор
|
|
100
|
+
*/
|
|
101
|
+
export type CalculatorBlockDef =
|
|
102
|
+
| EmptyOption
|
|
103
|
+
| CreditCalculatorParamsDef
|
|
104
|
+
| MortgageCalculatorParamsDef
|
|
105
|
+
| DepositCalculatorParamsDef
|
|
106
|
+
| BonusCalculatorParamsDef;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @title Кнопка навигации
|
|
110
|
+
*/
|
|
111
|
+
export interface CalculatorNav {
|
|
112
|
+
/** @title Заголовок */
|
|
113
|
+
title?: string;
|
|
114
|
+
/** @title Описание */
|
|
115
|
+
description?: string;
|
|
116
|
+
icon?: Picture;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @title Вкладка
|
|
121
|
+
*/
|
|
122
|
+
export interface CalculatorTab {
|
|
123
|
+
nav?: CalculatorNav;
|
|
124
|
+
/** @title Настройки калькулятора */
|
|
125
|
+
calculatorBlock?: CalculatorBlockDef;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @title Калькулятор
|
|
130
|
+
*/
|
|
131
|
+
export interface CalculatorContent {
|
|
132
|
+
/** @title Вкладки */
|
|
133
|
+
calcTabs?: CalculatorTab[];
|
|
134
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
|
|
3
|
+
|
|
4
|
+
export interface CalculatorValueBlockProps {
|
|
5
|
+
title?: string;
|
|
6
|
+
value?: number;
|
|
7
|
+
postfix?: string;
|
|
8
|
+
prefix?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const CalculatorValueBlock = JSX<CalculatorValueBlockProps>(
|
|
13
|
+
({ title, value, postfix = '', prefix, className = '' }) => {
|
|
14
|
+
return (
|
|
15
|
+
<div className={`mb-5 ${className}`}>
|
|
16
|
+
{title ? <div className="text-base font-light">{title}</div> : null}
|
|
17
|
+
{value ? (
|
|
18
|
+
<div className="text-title font-normal">
|
|
19
|
+
{prefix} {addSpacesBetweenNumbers(Math.round(value))} {postfix}
|
|
20
|
+
</div>
|
|
21
|
+
) : null}
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
},
|
|
25
|
+
);
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCreditCalculatorData } from '../../hooks/useCreditCalculatorData';
|
|
3
|
+
import type { UniBlockProps } from '../../types';
|
|
4
|
+
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
5
|
+
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
6
|
+
import { DEFAULT_MAX_MONTHS, DEFAULT_MIN_MONTHS } from './constants';
|
|
7
|
+
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
8
|
+
import { getCreditRate } from './getCreditRate';
|
|
9
|
+
import { getCalculatorParams } from './getCalculatorParams';
|
|
10
|
+
import { getDefaultSum } from './getDefaultSum';
|
|
11
|
+
import { getDefaultMonths } from './getDefaultMonths';
|
|
12
|
+
import { getMonthlyPayment } from './getMonthlyPayment';
|
|
13
|
+
import { renderMonthsInput } from './renderMonthsInput';
|
|
14
|
+
import { renderButtonSection } from './renderButtonSection';
|
|
15
|
+
import { renderRate } from './renderRate';
|
|
16
|
+
import { CommonCalculatorProps, CreditCalculatorParams } from './CalculatorContent';
|
|
17
|
+
|
|
18
|
+
const DEFAULT_PAYMENT_TYPE = 'annuity';
|
|
19
|
+
|
|
20
|
+
export interface CreditCalculatorProp
|
|
21
|
+
extends CreditCalculatorParams,
|
|
22
|
+
CommonCalculatorProps,
|
|
23
|
+
UniBlockProps {}
|
|
24
|
+
|
|
25
|
+
export const CreditCalculatorForm = JSX<CreditCalculatorProp>(
|
|
26
|
+
({ context, className = '', buttons }) => {
|
|
27
|
+
const [moneyValue, setMoneyValue] = context.useState<number | undefined>(undefined);
|
|
28
|
+
const [monthsValue, setMonthsValue] = context.useState<number | undefined>(undefined);
|
|
29
|
+
const [isAnnuity, toggleIsAnnuity] = context.useState(false);
|
|
30
|
+
const [isBudgetary, toggleIsBudgetary] = context.useState(false);
|
|
31
|
+
const [isInsurance, toggleIsInsurance] = context.useState(false);
|
|
32
|
+
const tableRows = useCreditCalculatorData(context.useAsyncData, 'directoryName').rows;
|
|
33
|
+
const calculatorParams = getCalculatorParams({ tableRows, isAnnuity: isAnnuity });
|
|
34
|
+
|
|
35
|
+
const defaultSum = getDefaultSum(calculatorParams);
|
|
36
|
+
const defaultMonths = getDefaultMonths(calculatorParams);
|
|
37
|
+
|
|
38
|
+
const minMonths = calculatorParams?.minMonths || DEFAULT_MIN_MONTHS;
|
|
39
|
+
const maxMonths = calculatorParams?.maxMonths || DEFAULT_MAX_MONTHS;
|
|
40
|
+
|
|
41
|
+
const rate = getCreditRate({ calculatorParams, isInsurance: isInsurance });
|
|
42
|
+
|
|
43
|
+
const monthlyPayment = getMonthlyPayment({
|
|
44
|
+
calculatorParams,
|
|
45
|
+
paymentType: DEFAULT_PAYMENT_TYPE,
|
|
46
|
+
rate,
|
|
47
|
+
sum: moneyValue || defaultSum,
|
|
48
|
+
months: monthsValue || defaultMonths,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const title = 'Сумма кредита, ₽';
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<section className={className}>
|
|
55
|
+
<div className="w-[468px]">
|
|
56
|
+
{renderWantedSumInput({ title, calculatorParams, moneyValue, defaultSum, setMoneyValue })}
|
|
57
|
+
{renderMonthsInput({
|
|
58
|
+
title: 'Сумма кредита, ₽',
|
|
59
|
+
minMonths,
|
|
60
|
+
maxMonths,
|
|
61
|
+
monthsValue,
|
|
62
|
+
defaultMonths,
|
|
63
|
+
setMonthsValue,
|
|
64
|
+
})}
|
|
65
|
+
<div className="pt-7">
|
|
66
|
+
<Checkbox
|
|
67
|
+
text="Получаю зарплату на счёт в Россельхозбанке"
|
|
68
|
+
checked={isAnnuity}
|
|
69
|
+
onChange={toggleIsAnnuity}
|
|
70
|
+
/>
|
|
71
|
+
<Checkbox
|
|
72
|
+
className="mt-3"
|
|
73
|
+
text="Работаю в бюджетной организации"
|
|
74
|
+
checked={isBudgetary}
|
|
75
|
+
onChange={toggleIsBudgetary}
|
|
76
|
+
/>
|
|
77
|
+
<Checkbox
|
|
78
|
+
className="mt-3"
|
|
79
|
+
text="Комплексная страховая защита"
|
|
80
|
+
checked={isInsurance}
|
|
81
|
+
onChange={toggleIsInsurance}
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
<div>
|
|
86
|
+
{rate
|
|
87
|
+
? renderRate({ rate: rate, title: 'Ставка', sup: '%', className: 'tracking-[-25px]' })
|
|
88
|
+
: null}
|
|
89
|
+
</div>
|
|
90
|
+
<div className="w-[351px]">
|
|
91
|
+
{monthlyPayment ? (
|
|
92
|
+
<CalculatorValueBlock title="Ежемесячный платеж" value={monthlyPayment} postfix="₽" />
|
|
93
|
+
) : null}
|
|
94
|
+
{renderButtonSection(context, buttons)}
|
|
95
|
+
</div>
|
|
96
|
+
</section>
|
|
97
|
+
);
|
|
98
|
+
},
|
|
99
|
+
);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCreditCalculatorData } from '../../hooks/useCreditCalculatorData';
|
|
3
|
+
import type { UniBlockProps } from '../../types';
|
|
4
|
+
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
5
|
+
import { DEFAULT_MAX_MONTHS, DEFAULT_MIN_MONTHS } from './constants';
|
|
6
|
+
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
7
|
+
import { getCalculatorParams } from './getCalculatorParams';
|
|
8
|
+
import { getDefaultSum } from './getDefaultSum';
|
|
9
|
+
import { getDefaultMonths } from './getDefaultMonths';
|
|
10
|
+
import { renderMonthsInput } from './renderMonthsInput';
|
|
11
|
+
import { renderButtonSection } from './renderButtonSection';
|
|
12
|
+
import { renderRate } from './renderRate';
|
|
13
|
+
import { CommonCalculatorProps, DepositCalculatorParams } from './CalculatorContent';
|
|
14
|
+
|
|
15
|
+
export interface DepositCalculatorProp
|
|
16
|
+
extends DepositCalculatorParams,
|
|
17
|
+
CommonCalculatorProps,
|
|
18
|
+
UniBlockProps {}
|
|
19
|
+
|
|
20
|
+
export const DepositCalculatorForm = JSX<DepositCalculatorProp>(
|
|
21
|
+
({ context, className = '', buttons, rate, minSum, maxSum, minMonths, maxMonths }) => {
|
|
22
|
+
const [moneyValue, setMoneyValue] = context.useState<number | undefined>(undefined);
|
|
23
|
+
const [monthsValue, setMonthsValue] = context.useState<number | undefined>(undefined);
|
|
24
|
+
const tableRows = useCreditCalculatorData(context.useAsyncData, 'directoryName').rows;
|
|
25
|
+
const calculatorParams = getCalculatorParams({ tableRows, isAnnuity: false });
|
|
26
|
+
|
|
27
|
+
const defaultSum = getDefaultSum(calculatorParams);
|
|
28
|
+
const defaultMonths = getDefaultMonths(calculatorParams);
|
|
29
|
+
|
|
30
|
+
const income = 948841;
|
|
31
|
+
const finallySum = 1218841;
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<section className={className}>
|
|
35
|
+
<div className="w-[468px]">
|
|
36
|
+
{renderWantedSumInput({
|
|
37
|
+
title: 'Сумма вклада, ₽',
|
|
38
|
+
calculatorParams: { minSum, maxSum },
|
|
39
|
+
moneyValue,
|
|
40
|
+
defaultSum,
|
|
41
|
+
setMoneyValue,
|
|
42
|
+
})}
|
|
43
|
+
{renderMonthsInput({
|
|
44
|
+
title: 'Срок вклада, месяцев',
|
|
45
|
+
minMonths: minMonths || DEFAULT_MIN_MONTHS,
|
|
46
|
+
maxMonths: maxMonths || DEFAULT_MAX_MONTHS,
|
|
47
|
+
monthsValue,
|
|
48
|
+
defaultMonths,
|
|
49
|
+
setMonthsValue,
|
|
50
|
+
})}
|
|
51
|
+
</div>
|
|
52
|
+
<div>
|
|
53
|
+
{rate
|
|
54
|
+
? renderRate({ rate: rate, title: 'Ставка', sup: '%', className: 'tracking-[-25px]' })
|
|
55
|
+
: null}
|
|
56
|
+
</div>
|
|
57
|
+
<div className="w-[351px]">
|
|
58
|
+
{income ? (
|
|
59
|
+
<CalculatorValueBlock title="Доход по вкладу" value={income} postfix="₽" prefix="+" />
|
|
60
|
+
) : null}
|
|
61
|
+
{finallySum ? (
|
|
62
|
+
<CalculatorValueBlock title="Сумма в конце срока" value={finallySum} postfix="₽" />
|
|
63
|
+
) : null}
|
|
64
|
+
{renderButtonSection(context, buttons)}
|
|
65
|
+
</div>
|
|
66
|
+
</section>
|
|
67
|
+
);
|
|
68
|
+
},
|
|
69
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CreditCalculatorForm, CreditCalculatorProp } from './CreditCalculatorForm';
|
|
2
|
+
import { MortgageCalculatorForm, MortgageCalculatorProp } from './MortgageCalculatorForm';
|
|
3
|
+
import { DepositCalculatorForm, DepositCalculatorProp } from './DepositCalculatorForm';
|
|
4
|
+
import { BonusCalculatorForm, BonusCalculatorProp } from './BonusCalculatorForm';
|
|
5
|
+
|
|
6
|
+
export type EmbeddableCalcProps =
|
|
7
|
+
| CreditCalculatorProp
|
|
8
|
+
| MortgageCalculatorProp
|
|
9
|
+
| DepositCalculatorProp
|
|
10
|
+
| BonusCalculatorProp;
|
|
11
|
+
|
|
12
|
+
export const EmbeddableCalcBlocks = {
|
|
13
|
+
CreditCalculatorForm,
|
|
14
|
+
MortgageCalculatorForm,
|
|
15
|
+
DepositCalculatorForm,
|
|
16
|
+
BonusCalculatorForm,
|
|
17
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCreditCalculatorData } from '../../hooks/useCreditCalculatorData';
|
|
3
|
+
import type { UniBlockProps } from '../../types';
|
|
4
|
+
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
5
|
+
import { DEFAULT_MAX_MONTHS, DEFAULT_MIN_MONTHS } from './constants';
|
|
6
|
+
import { renderRealEstateValue } from './renderRealEstateValue';
|
|
7
|
+
import { renderInitialFeeInput } from './renderInitialFeeInput';
|
|
8
|
+
import { getCreditRate } from './getCreditRate';
|
|
9
|
+
import { getCalculatorParams } from './getCalculatorParams';
|
|
10
|
+
import { getDefaultSum } from './getDefaultSum';
|
|
11
|
+
import { getDefaultMonths } from './getDefaultMonths';
|
|
12
|
+
import { renderMonthsInput } from './renderMonthsInput';
|
|
13
|
+
import { renderButtonSection } from './renderButtonSection';
|
|
14
|
+
import { renderProposalMortgage } from './renderProposalMortgage';
|
|
15
|
+
import { renderRate } from './renderRate';
|
|
16
|
+
import { CommonCalculatorProps, MortgageCalculatorParams } from './CalculatorContent';
|
|
17
|
+
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
18
|
+
|
|
19
|
+
export interface MortgageCalculatorProp
|
|
20
|
+
extends MortgageCalculatorParams,
|
|
21
|
+
CommonCalculatorProps,
|
|
22
|
+
UniBlockProps {}
|
|
23
|
+
|
|
24
|
+
export const MortgageCalculatorForm = JSX<MortgageCalculatorProp>(
|
|
25
|
+
({ context, className = '', buttons }) => {
|
|
26
|
+
const [moneyValue, setMoneyValue] = context.useState<number | undefined>(undefined);
|
|
27
|
+
const [monthsValue, setMonthsValue] = context.useState<number | undefined>(undefined);
|
|
28
|
+
const [isInsurance, toggleIsInsurance] = context.useState(false);
|
|
29
|
+
const [isFullInsurance, toggleIsFullInsurance] = context.useState(false);
|
|
30
|
+
|
|
31
|
+
const tableRows = useCreditCalculatorData(context.useAsyncData, 'directoryName').rows;
|
|
32
|
+
const calculatorParams = getCalculatorParams({ tableRows, isAnnuity: isInsurance });
|
|
33
|
+
|
|
34
|
+
const defaultSum = getDefaultSum(calculatorParams);
|
|
35
|
+
const defaultMonths = getDefaultMonths(calculatorParams);
|
|
36
|
+
|
|
37
|
+
const minMonths = calculatorParams?.minMonths || DEFAULT_MIN_MONTHS;
|
|
38
|
+
const maxMonths = calculatorParams?.maxMonths || DEFAULT_MAX_MONTHS;
|
|
39
|
+
|
|
40
|
+
const rate = getCreditRate({ calculatorParams, isInsurance: isInsurance });
|
|
41
|
+
|
|
42
|
+
const monthlyPayment = 777777; // TODO: hardcode
|
|
43
|
+
const proposalMortgageValue = { credit: 3892000, period: 15, taxRefund: 650000 }; // TODO: hardcode
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<section className={className}>
|
|
47
|
+
<div className="w-[468px]">
|
|
48
|
+
{renderRealEstateValue({ calculatorParams, moneyValue, defaultSum, setMoneyValue })}
|
|
49
|
+
{renderInitialFeeInput({
|
|
50
|
+
calculatorParams,
|
|
51
|
+
moneyValue,
|
|
52
|
+
defaultSum,
|
|
53
|
+
setMoneyValue,
|
|
54
|
+
})}
|
|
55
|
+
{renderMonthsInput({
|
|
56
|
+
title: 'Срок ипотеки, месяцев',
|
|
57
|
+
minMonths,
|
|
58
|
+
maxMonths,
|
|
59
|
+
monthsValue,
|
|
60
|
+
defaultMonths,
|
|
61
|
+
setMonthsValue,
|
|
62
|
+
})}
|
|
63
|
+
<div className="mt-7">
|
|
64
|
+
<Checkbox text="Страхование жизни" checked={isInsurance} onChange={toggleIsInsurance} />
|
|
65
|
+
<Checkbox
|
|
66
|
+
className="mt-4"
|
|
67
|
+
text="Страхование жизни, злоровья и временной утраты трудоспособности"
|
|
68
|
+
checked={isFullInsurance}
|
|
69
|
+
onChange={toggleIsFullInsurance}
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
<div>
|
|
74
|
+
<div>
|
|
75
|
+
{rate
|
|
76
|
+
? renderRate({ rate: rate, title: 'Ставка', sup: '%', className: 'tracking-[-25px]' })
|
|
77
|
+
: null}
|
|
78
|
+
</div>
|
|
79
|
+
<CalculatorValueBlock title="Ежемесячный платеж" value={monthlyPayment} postfix="₽" />
|
|
80
|
+
</div>
|
|
81
|
+
<div>
|
|
82
|
+
<div className="w-[351px]">{renderProposalMortgage(proposalMortgageValue)}</div>
|
|
83
|
+
{renderButtonSection(context, buttons)}
|
|
84
|
+
</div>
|
|
85
|
+
</section>
|
|
86
|
+
);
|
|
87
|
+
},
|
|
88
|
+
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const DEFAULT_MIN_SUM = 30000;
|
|
2
|
+
export const DEFAULT_MAX_SUM = 3000000;
|
|
3
|
+
export const DEFAULT_SUM = (DEFAULT_MAX_SUM - DEFAULT_MIN_SUM) / 2;
|
|
4
|
+
export const DEFAULT_MIN_MONTHS = 1;
|
|
5
|
+
export const DEFAULT_MAX_MONTHS = 84;
|
|
6
|
+
export const DEFAULT_MONTHS = Math.round((DEFAULT_MAX_MONTHS - DEFAULT_MIN_MONTHS) / 2);
|
|
7
|
+
|
|
8
|
+
export const MONTHS_IN_YEAR = 12;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CalculatorParams } from './CalculatorContent';
|
|
2
|
+
|
|
3
|
+
interface GetCalculatorParamsParams {
|
|
4
|
+
tableRows?: CalculatorParams[];
|
|
5
|
+
isAnnuity?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const getCalculatorParams = (params: GetCalculatorParamsParams) => {
|
|
9
|
+
const { tableRows, isAnnuity = false } = params;
|
|
10
|
+
|
|
11
|
+
if (!tableRows) return {};
|
|
12
|
+
|
|
13
|
+
const calculatorParams = tableRows.find((row) => row.isAnnuity === isAnnuity);
|
|
14
|
+
|
|
15
|
+
return calculatorParams || {};
|
|
16
|
+
};
|