@redneckz/wildless-cms-uni-blocks 0.3.57 → 0.3.58
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 +341 -82
- 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/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/types.d.ts +1 -0
- 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/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/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/types.d.ts +1 -0
- 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/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/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/ProductGallery/ProductGalleryContent.d.ts +3 -6
- package/mobile/dist/types.d.ts +1 -0
- 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/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/ProductGallery/ProductGalleryContent.d.ts +3 -6
- package/mobile/lib/types.d.ts +1 -0
- 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/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/ProductGallery/ProductGallery.example.json +8 -10
- package/mobile/src/components/ProductGallery/ProductGalleryContent.ts +3 -6
- package/mobile/src/icons/SafeIcon.svg +7 -1
- package/mobile/src/types.ts +2 -0
- package/mobile/src/ui-kit/BlocksList/renderBlocksList.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/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/icons/SafeIcon.svg +7 -1
- package/src/types.ts +2 -0
- package/src/ui-kit/BlocksList/renderBlocksList.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/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/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/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/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/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/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
package/bundle/bundle.umd.js
CHANGED
|
@@ -933,8 +933,8 @@
|
|
|
933
933
|
LinkList,
|
|
934
934
|
};
|
|
935
935
|
|
|
936
|
-
const renderBlocksList = ({ blocks, context, className, columns }) => blocks?.length ? blocks.map(renderBlock$
|
|
937
|
-
const renderBlock$
|
|
936
|
+
const renderBlocksList = ({ blocks, context, className, columns }) => blocks?.length ? blocks.map(renderBlock$3({ context, className, columns })) : null;
|
|
937
|
+
const renderBlock$3 = ({ context, columns, className }) => (block, i) => {
|
|
938
938
|
const type = block?.blockListType;
|
|
939
939
|
if (!type || !(type in EmbeddableBlocks)) {
|
|
940
940
|
return null;
|
|
@@ -1078,30 +1078,6 @@
|
|
|
1078
1078
|
return (jsx("div", { className: "pr-[50px]", children: jsxs("div", { className: "flex w-full", children: [jsx("div", { className: FIRST_CELL_CLASSES$1 }), jsx("button", { onClick: onClick, className: "mt-5 flex-1 border-main-stroke border-solid border text-primary-text bg-white hover:border-primary-main hover:text-primary-main", children: jsx("div", { className: "font-sans font-medium text-xs py-[11px]", children: !isShowAllRow ? 'Показать все параметры' : 'Скрыть' }) })] }) }));
|
|
1079
1079
|
};
|
|
1080
1080
|
|
|
1081
|
-
const TAB_STYLE = 'px-2 h-14 pb-2 pt-3 border border-b-0 border-main-stroke';
|
|
1082
|
-
const ACTIVE_TAB_STYLE = 'px-2 h-16 pt-4 pb-2 text-white bg-primary-main';
|
|
1083
|
-
const Tabs = JSX(({ tabs, currentTabIndex, onTabClick }) => {
|
|
1084
|
-
return (jsx("div", { className: "flex items-end border-b border-main-stroke", role: "tablist", children: tabs?.map(renderTab$2(currentTabIndex, onTabClick)) }));
|
|
1085
|
-
});
|
|
1086
|
-
const renderTab$2 = (currentTabIndex, onTabClick) => (tab, index) => {
|
|
1087
|
-
const isActive = currentTabIndex === index;
|
|
1088
|
-
return (jsxs("div", { className: `flex h-full flex-1 cursor-pointer mr-2 last:mr-0 box-content ${isActive ? ACTIVE_TAB_STYLE : TAB_STYLE}`, role: "tab", onClick: () => onTabClick(index), "aria-selected": String(isActive), children: [tab?.icon ? renderIcon(tab, isActive) : null, jsxs("div", { children: [tab?.title ? jsx("h3", { className: "font-medium m-0 text-base", children: tab?.title }) : null, tab?.description ? (jsx("span", { className: `font-light text-xs ${isActive ? '' : 'text-secondary-text'}`, children: tab?.description })) : null] })] }, String(index)));
|
|
1089
|
-
};
|
|
1090
|
-
const renderIcon = (tab, isActive) => (jsx("div", { className: "h-full mt-1", children: jsx(Img, { className: `w-5 h-5 mr-3 ${isActive ? 'invert' : ''}`, image: tab?.icon || 'CardIcon', asSVG: !isActive }) }));
|
|
1091
|
-
|
|
1092
|
-
function getTileHeadingType(className = '') {
|
|
1093
|
-
const colSpan = getColSpan(className);
|
|
1094
|
-
if (colSpan <= 4) {
|
|
1095
|
-
return 'h4';
|
|
1096
|
-
}
|
|
1097
|
-
else if (colSpan <= 8) {
|
|
1098
|
-
return 'h3';
|
|
1099
|
-
}
|
|
1100
|
-
else {
|
|
1101
|
-
return 'h2';
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
1081
|
function useCreditCalculatorData(useAsyncData, directoryName) {
|
|
1106
1082
|
const { data } = useAsyncData(creditCalculatorUrl(directoryName), fetchCreditCalculatorData);
|
|
1107
1083
|
return data || {};
|
|
@@ -1128,10 +1104,345 @@
|
|
|
1128
1104
|
];
|
|
1129
1105
|
const Checkbox = JSX(({ text, checked, onChange, className }) => (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center cursor-pointer relative", children: [jsx("input", { className: `peer appearance-none w-5 h-5 border-solid border ${checked ? 'border-black' : 'border-main-stroke'} rounded checked:bg-primary-main checked:border-primary-main m-0`, type: "checkbox", onChange: (e) => {
|
|
1130
1106
|
onChange(e.target.checked);
|
|
1131
|
-
}, checked: checked }), jsx(SVG, { paths: CHECK_PATHS, className: "hidden absolute left-1 ml-px peer-checked:block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }), text ?
|
|
1107
|
+
}, checked: checked }), jsx(SVG, { paths: CHECK_PATHS, className: "hidden absolute left-1 ml-px peer-checked:block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }), text ? jsx("span", { className: "font-sans ml-3 text-m-base cursor-pointer", children: text }) : null] }) })));
|
|
1108
|
+
|
|
1109
|
+
const addSpacesBetweenNumbers = (number) => new Intl.NumberFormat('ru-RU', { maximumSignificantDigits: 3 }).format(number);
|
|
1110
|
+
|
|
1111
|
+
const CalculatorValueBlock = JSX(({ title, value, postfix = '', prefix, className = '' }) => {
|
|
1112
|
+
return (jsxs("div", { className: `mb-5 ${className}`, children: [title ? jsx("div", { className: "text-base font-light", children: title }) : null, value ? (jsxs("div", { className: "text-title font-normal", children: [prefix, " ", addSpacesBetweenNumbers(Math.round(value)), " ", postfix] })) : null] }));
|
|
1113
|
+
});
|
|
1114
|
+
|
|
1115
|
+
const DEFAULT_MIN_SUM$1 = 30000;
|
|
1116
|
+
const DEFAULT_MAX_SUM$1 = 3000000;
|
|
1117
|
+
const DEFAULT_SUM$1 = (DEFAULT_MAX_SUM$1 - DEFAULT_MIN_SUM$1) / 2;
|
|
1118
|
+
const DEFAULT_MIN_MONTHS$1 = 1;
|
|
1119
|
+
const DEFAULT_MAX_MONTHS$1 = 84;
|
|
1120
|
+
const DEFAULT_MONTHS$1 = Math.round((DEFAULT_MAX_MONTHS$1 - DEFAULT_MIN_MONTHS$1) / 2);
|
|
1121
|
+
const MONTHS_IN_YEAR$1 = 12;
|
|
1122
|
+
|
|
1123
|
+
const InputRange = JSX(({ className, title, items = [], min = 1, max = 100, step = 1, value = min, onChange }) => {
|
|
1124
|
+
const handleChange = (value) => {
|
|
1125
|
+
if (!onChange)
|
|
1126
|
+
return;
|
|
1127
|
+
const sanitizedValue = Number(value.replace(/\D/g, ''));
|
|
1128
|
+
onChange(sanitizedValue);
|
|
1129
|
+
};
|
|
1130
|
+
const inputStyle = {
|
|
1131
|
+
backgroundSize: `${(((value - min) * 100) / (max - min)).toFixed(2)}% 100%`,
|
|
1132
|
+
};
|
|
1133
|
+
const handleBlur = () => {
|
|
1134
|
+
if (!onChange)
|
|
1135
|
+
return;
|
|
1136
|
+
if (value < min)
|
|
1137
|
+
onChange(min);
|
|
1138
|
+
if (value > max)
|
|
1139
|
+
onChange(max);
|
|
1140
|
+
};
|
|
1141
|
+
return (jsxs("div", { className: className, children: [jsxs("label", { className: "block relative", children: [title ? jsx("span", { className: "text-base text-secondary-text pl-4", children: title }) : null, jsx("input", { className: `m-0 mt-[5px] font-sans text-title w-full h-14 border border-solid border-main-stroke rounded-md
|
|
1142
|
+
outline-none p-0 pl-4 box-border text-primary-text`, value: addSpacesBetweenNumbers(value), onChange: (e) => handleChange(e.target.value), onBlur: handleBlur }), jsx("div", { className: "absolute inset-x-0 bottom-[-4px] px-4 leading-[18px]", children: jsx("input", { className: "box-border w-full m-0 cursor-pointer slider", type: "range", min: min, max: max, step: step, value: value, onChange: (e) => handleChange(e.target.value), style: inputStyle }) })] }), jsx("div", { className: "flex justify-between my-3", children: items.map((item, i) => (jsx("span", { className: "text-sm leading-[14px] text-secondary-text pl-4", children: item }, String(i)))) })] }));
|
|
1143
|
+
});
|
|
1144
|
+
|
|
1145
|
+
const STEP_MONEY$3 = 1000;
|
|
1146
|
+
function renderWantedSumInput$1(props) {
|
|
1147
|
+
const { title, className = '', calculatorParams, moneyValue, defaultSum, setMoneyValue, isShowItems = true, } = props;
|
|
1148
|
+
const minSum = calculatorParams?.minSum || DEFAULT_MIN_SUM$1;
|
|
1149
|
+
const maxSum = calculatorParams?.maxSum || DEFAULT_MAX_SUM$1;
|
|
1150
|
+
const items = [
|
|
1151
|
+
`От ${addSpacesBetweenNumbers(minSum)} ₽`,
|
|
1152
|
+
`До ${addSpacesBetweenNumbers(maxSum)} ₽`,
|
|
1153
|
+
];
|
|
1154
|
+
return (jsx(InputRange, { className: className, title: title, items: isShowItems ? items : [], min: minSum, max: maxSum, step: STEP_MONEY$3, value: moneyValue || defaultSum, onChange: setMoneyValue }));
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
const DEFAULT_RATE$1 = 10.2;
|
|
1158
|
+
const getCreditRate$1 = (params) => {
|
|
1159
|
+
const { calculatorParams, isInsurance } = params;
|
|
1160
|
+
if (!calculatorParams)
|
|
1161
|
+
return DEFAULT_RATE$1;
|
|
1162
|
+
return isInsurance
|
|
1163
|
+
? calculatorParams?.rateWithInsurance || DEFAULT_RATE$1
|
|
1164
|
+
: calculatorParams?.rateWithoutInsurance || DEFAULT_RATE$1;
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
const getCalculatorParams$1 = (params) => {
|
|
1168
|
+
const { tableRows, isAnnuity = false } = params;
|
|
1169
|
+
if (!tableRows)
|
|
1170
|
+
return {};
|
|
1171
|
+
const calculatorParams = tableRows.find((row) => row.isAnnuity === isAnnuity);
|
|
1172
|
+
return calculatorParams || {};
|
|
1173
|
+
};
|
|
1174
|
+
|
|
1175
|
+
const getDefaultSum$1 = (calculatorParams) => calculatorParams.maxSum && calculatorParams.minSum
|
|
1176
|
+
? (calculatorParams.maxSum - calculatorParams.minSum) / 2
|
|
1177
|
+
: DEFAULT_SUM$1;
|
|
1178
|
+
|
|
1179
|
+
const getDefaultMonths$1 = (calculatorParams) => calculatorParams.maxMonths && calculatorParams.minMonths
|
|
1180
|
+
? Math.round((calculatorParams.maxMonths - calculatorParams.minMonths) / 2)
|
|
1181
|
+
: DEFAULT_MONTHS$1;
|
|
1132
1182
|
|
|
1133
1183
|
const clamp = (value, min, max) => Math.max(min, Math.min(value, max));
|
|
1134
1184
|
|
|
1185
|
+
const getMonthlyPayment$1 = (params) => {
|
|
1186
|
+
const { calculatorParams, paymentType, rate, sum, months } = params;
|
|
1187
|
+
if (!calculatorParams)
|
|
1188
|
+
return 0;
|
|
1189
|
+
const finalSum = clamp(sum, calculatorParams.minSum || DEFAULT_MIN_SUM$1, calculatorParams.maxSum || DEFAULT_MAX_SUM$1);
|
|
1190
|
+
if (paymentType === 'annuity') {
|
|
1191
|
+
const annuityCoef = Number(rate) / (MONTHS_IN_YEAR$1 * 100);
|
|
1192
|
+
return finalSum * (annuityCoef + annuityCoef / (Math.pow(1 + annuityCoef, months) - 1));
|
|
1193
|
+
}
|
|
1194
|
+
else {
|
|
1195
|
+
return finalSum / months + finalSum * (Number(rate) / 12);
|
|
1196
|
+
}
|
|
1197
|
+
};
|
|
1198
|
+
|
|
1199
|
+
const STEP_MONTHS$1 = 1;
|
|
1200
|
+
function renderMonthsInput$1(props) {
|
|
1201
|
+
const { title, minMonths, maxMonths, monthsValue, defaultMonths, setMonthsValue } = props;
|
|
1202
|
+
const monthText = (month) => {
|
|
1203
|
+
const text = Number(month) % 10 === 1 ? 'месяца' : 'месяцев';
|
|
1204
|
+
return `${month} ${text}`;
|
|
1205
|
+
};
|
|
1206
|
+
return (jsx(InputRange, { className: "mt-6", title: title, items: [`От ${monthText(minMonths)}`, `До ${monthText(maxMonths)}`], min: minMonths, max: maxMonths, step: STEP_MONTHS$1, value: monthsValue || defaultMonths, onChange: setMonthsValue }));
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
function renderButtonSection(context, buttons) {
|
|
1210
|
+
return buttons?.length ? (jsx(ButtonSection, { context: context, buttons: buttons, className: "flex flex-col mt-7 gap-2" })) : null;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
function renderRate({ rate, title, sup, className = '' }) {
|
|
1214
|
+
const rateFormat = String(rate).replace('.', ',');
|
|
1215
|
+
return (jsxs("div", { children: [jsx("div", { className: "text-sm font-light ml-3", children: title }), jsxs("div", { className: "flex justify-start", children: [jsx("span", { className: `calc-rate-text font-mohave text-[200px] leading-[250px] pr-4 mt-[-16px] ${className}`, children: rateFormat }), sup ? jsx("span", { className: "calc-rate-text text-[65px] leading-[75px]", children: sup }) : ''] })] }));
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
const DEFAULT_PAYMENT_TYPE$1 = 'annuity';
|
|
1219
|
+
const CreditCalculatorForm$1 = JSX(({ context, className = '', buttons }) => {
|
|
1220
|
+
const [moneyValue, setMoneyValue] = context.useState(undefined);
|
|
1221
|
+
const [monthsValue, setMonthsValue] = context.useState(undefined);
|
|
1222
|
+
const [isAnnuity, toggleIsAnnuity] = context.useState(false);
|
|
1223
|
+
const [isBudgetary, toggleIsBudgetary] = context.useState(false);
|
|
1224
|
+
const [isInsurance, toggleIsInsurance] = context.useState(false);
|
|
1225
|
+
const tableRows = useCreditCalculatorData(context.useAsyncData, 'directoryName').rows;
|
|
1226
|
+
const calculatorParams = getCalculatorParams$1({ tableRows, isAnnuity: isAnnuity });
|
|
1227
|
+
const defaultSum = getDefaultSum$1(calculatorParams);
|
|
1228
|
+
const defaultMonths = getDefaultMonths$1(calculatorParams);
|
|
1229
|
+
const minMonths = calculatorParams?.minMonths || DEFAULT_MIN_MONTHS$1;
|
|
1230
|
+
const maxMonths = calculatorParams?.maxMonths || DEFAULT_MAX_MONTHS$1;
|
|
1231
|
+
const rate = getCreditRate$1({ calculatorParams, isInsurance: isInsurance });
|
|
1232
|
+
const monthlyPayment = getMonthlyPayment$1({
|
|
1233
|
+
calculatorParams,
|
|
1234
|
+
paymentType: DEFAULT_PAYMENT_TYPE$1,
|
|
1235
|
+
rate,
|
|
1236
|
+
sum: moneyValue || defaultSum,
|
|
1237
|
+
months: monthsValue || defaultMonths,
|
|
1238
|
+
});
|
|
1239
|
+
const title = 'Сумма кредита, ₽';
|
|
1240
|
+
return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput$1({ title, calculatorParams, moneyValue, defaultSum, setMoneyValue }), renderMonthsInput$1({
|
|
1241
|
+
title: 'Сумма кредита, ₽',
|
|
1242
|
+
minMonths,
|
|
1243
|
+
maxMonths,
|
|
1244
|
+
monthsValue,
|
|
1245
|
+
defaultMonths,
|
|
1246
|
+
setMonthsValue,
|
|
1247
|
+
}), jsxs("div", { className: "pt-7", children: [jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0443 \u043D\u0430 \u0441\u0447\u0451\u0442 \u0432 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0435", checked: isAnnuity, onChange: toggleIsAnnuity }), jsx(Checkbox, { className: "mt-3", text: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E \u0432 \u0431\u044E\u0434\u0436\u0435\u0442\u043D\u043E\u0439 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", checked: isBudgetary, onChange: toggleIsBudgetary }), jsx(Checkbox, { className: "mt-3", text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", checked: isInsurance, onChange: toggleIsInsurance })] })] }), jsx("div", { children: rate
|
|
1248
|
+
? renderRate({ rate: rate, title: 'Ставка', sup: '%', className: 'tracking-[-25px]' })
|
|
1249
|
+
: null }), jsxs("div", { className: "w-[351px]", children: [monthlyPayment ? (jsx(CalculatorValueBlock, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0435\u0436", value: monthlyPayment, postfix: "\u20BD" })) : null, renderButtonSection(context, buttons)] })] }));
|
|
1250
|
+
});
|
|
1251
|
+
|
|
1252
|
+
const STEP_MONEY$2 = 1000;
|
|
1253
|
+
function renderRealEstateValue(props) {
|
|
1254
|
+
const { calculatorParams, moneyValue, defaultSum, setMoneyValue } = props;
|
|
1255
|
+
const minSum = calculatorParams?.minSum || DEFAULT_MIN_SUM$1;
|
|
1256
|
+
const maxSum = calculatorParams?.maxSum || DEFAULT_MAX_SUM$1;
|
|
1257
|
+
return (jsx(InputRange, { title: "\u0421\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C \u043D\u0435\u0434\u0432\u0438\u0436\u0438\u043C\u043E\u0441\u0442\u0438, \u20BD ", items: [`От ${addSpacesBetweenNumbers(minSum)} ₽`, `До ${addSpacesBetweenNumbers(maxSum)} ₽`], min: minSum, max: maxSum, step: STEP_MONEY$2, value: moneyValue || defaultSum, onChange: setMoneyValue }));
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
const STEP_MONEY$1 = 1000;
|
|
1261
|
+
function renderInitialFeeInput(props) {
|
|
1262
|
+
const { calculatorParams, moneyValue, defaultSum, setMoneyValue } = props;
|
|
1263
|
+
const minSum = calculatorParams?.minSum || DEFAULT_MIN_SUM$1;
|
|
1264
|
+
const maxSum = calculatorParams?.maxSum || DEFAULT_MAX_SUM$1;
|
|
1265
|
+
return (jsx(InputRange, { className: "mt-6", title: "\u041F\u0435\u0440\u0432\u043E\u043D\u0430\u0447\u0430\u043B\u044C\u043D\u044B\u0439 \u0432\u0437\u043D\u043E\u0441, \u20BD ", items: [
|
|
1266
|
+
`От ${addSpacesBetweenNumbers(minSum)} рублей`,
|
|
1267
|
+
`До ${addSpacesBetweenNumbers(maxSum)} рублей`,
|
|
1268
|
+
], min: minSum, max: maxSum, step: STEP_MONEY$1, value: moneyValue || defaultSum, onChange: setMoneyValue }));
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
function renderProposalMortgage({ credit, period, taxRefund }) {
|
|
1272
|
+
return (jsxs("div", { children: [jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u0430", value: credit, postfix: "\u20BD" }), jsx(CalculatorValueBlock, { title: "\u0421\u0440\u043E\u043A", value: period, postfix: "\u043B\u0435\u0442" }), jsx(CalculatorValueBlock, { title: "\u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u0432\u044B\u0447\u0435\u0442", value: taxRefund, postfix: "\u20BD" })] }));
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
const MortgageCalculatorForm = JSX(({ context, className = '', buttons }) => {
|
|
1276
|
+
const [moneyValue, setMoneyValue] = context.useState(undefined);
|
|
1277
|
+
const [monthsValue, setMonthsValue] = context.useState(undefined);
|
|
1278
|
+
const [isInsurance, toggleIsInsurance] = context.useState(false);
|
|
1279
|
+
const [isFullInsurance, toggleIsFullInsurance] = context.useState(false);
|
|
1280
|
+
const tableRows = useCreditCalculatorData(context.useAsyncData, 'directoryName').rows;
|
|
1281
|
+
const calculatorParams = getCalculatorParams$1({ tableRows, isAnnuity: isInsurance });
|
|
1282
|
+
const defaultSum = getDefaultSum$1(calculatorParams);
|
|
1283
|
+
const defaultMonths = getDefaultMonths$1(calculatorParams);
|
|
1284
|
+
const minMonths = calculatorParams?.minMonths || DEFAULT_MIN_MONTHS$1;
|
|
1285
|
+
const maxMonths = calculatorParams?.maxMonths || DEFAULT_MAX_MONTHS$1;
|
|
1286
|
+
const rate = getCreditRate$1({ calculatorParams, isInsurance: isInsurance });
|
|
1287
|
+
const monthlyPayment = 777777; // TODO: hardcode
|
|
1288
|
+
const proposalMortgageValue = { credit: 3892000, period: 15, taxRefund: 650000 }; // TODO: hardcode
|
|
1289
|
+
return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderRealEstateValue({ calculatorParams, moneyValue, defaultSum, setMoneyValue }), renderInitialFeeInput({
|
|
1290
|
+
calculatorParams,
|
|
1291
|
+
moneyValue,
|
|
1292
|
+
defaultSum,
|
|
1293
|
+
setMoneyValue,
|
|
1294
|
+
}), renderMonthsInput$1({
|
|
1295
|
+
title: 'Срок ипотеки, месяцев',
|
|
1296
|
+
minMonths,
|
|
1297
|
+
maxMonths,
|
|
1298
|
+
monthsValue,
|
|
1299
|
+
defaultMonths,
|
|
1300
|
+
setMonthsValue,
|
|
1301
|
+
}), jsxs("div", { className: "mt-7", children: [jsx(Checkbox, { text: "\u0421\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u043D\u0438\u0435 \u0436\u0438\u0437\u043D\u0438", checked: isInsurance, onChange: toggleIsInsurance }), jsx(Checkbox, { className: "mt-4", text: "\u0421\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u043D\u0438\u0435 \u0436\u0438\u0437\u043D\u0438, \u0437\u043B\u043E\u0440\u043E\u0432\u044C\u044F \u0438 \u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 \u0443\u0442\u0440\u0430\u0442\u044B \u0442\u0440\u0443\u0434\u043E\u0441\u043F\u043E\u0441\u043E\u0431\u043D\u043E\u0441\u0442\u0438", checked: isFullInsurance, onChange: toggleIsFullInsurance })] })] }), jsxs("div", { children: [jsx("div", { children: rate
|
|
1302
|
+
? renderRate({ rate: rate, title: 'Ставка', sup: '%', className: 'tracking-[-25px]' })
|
|
1303
|
+
: null }), jsx(CalculatorValueBlock, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0435\u0436", value: monthlyPayment, postfix: "\u20BD" })] }), jsxs("div", { children: [jsx("div", { className: "w-[351px]", children: renderProposalMortgage(proposalMortgageValue) }), renderButtonSection(context, buttons)] })] }));
|
|
1304
|
+
});
|
|
1305
|
+
|
|
1306
|
+
const DepositCalculatorForm = JSX(({ context, className = '', buttons, rate, minSum, maxSum, minMonths, maxMonths }) => {
|
|
1307
|
+
const [moneyValue, setMoneyValue] = context.useState(undefined);
|
|
1308
|
+
const [monthsValue, setMonthsValue] = context.useState(undefined);
|
|
1309
|
+
const tableRows = useCreditCalculatorData(context.useAsyncData, 'directoryName').rows;
|
|
1310
|
+
const calculatorParams = getCalculatorParams$1({ tableRows, isAnnuity: false });
|
|
1311
|
+
const defaultSum = getDefaultSum$1(calculatorParams);
|
|
1312
|
+
const defaultMonths = getDefaultMonths$1(calculatorParams);
|
|
1313
|
+
const income = 948841;
|
|
1314
|
+
const finallySum = 1218841;
|
|
1315
|
+
return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput$1({
|
|
1316
|
+
title: 'Сумма вклада, ₽',
|
|
1317
|
+
calculatorParams: { minSum, maxSum },
|
|
1318
|
+
moneyValue,
|
|
1319
|
+
defaultSum,
|
|
1320
|
+
setMoneyValue,
|
|
1321
|
+
}), renderMonthsInput$1({
|
|
1322
|
+
title: 'Срок вклада, месяцев',
|
|
1323
|
+
minMonths: minMonths || DEFAULT_MIN_MONTHS$1,
|
|
1324
|
+
maxMonths: maxMonths || DEFAULT_MAX_MONTHS$1,
|
|
1325
|
+
monthsValue,
|
|
1326
|
+
defaultMonths,
|
|
1327
|
+
setMonthsValue,
|
|
1328
|
+
})] }), jsx("div", { children: rate
|
|
1329
|
+
? renderRate({ rate: rate, title: 'Ставка', sup: '%', className: 'tracking-[-25px]' })
|
|
1330
|
+
: null }), jsxs("div", { className: "w-[351px]", children: [(jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u043F\u043E \u0432\u043A\u043B\u0430\u0434\u0443", value: income, postfix: "\u20BD", prefix: "+" })) , (jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: finallySum, postfix: "\u20BD" })) , renderButtonSection(context, buttons)] })] }));
|
|
1331
|
+
});
|
|
1332
|
+
|
|
1333
|
+
const BonusCalculatorForm = JSX(({ context, className = '', buttons, bonus, minSumTrip, maxSumTrip, minSumOther, maxSumOther, }) => {
|
|
1334
|
+
const [bonusTripValue, setBonusTripValue] = context.useState(undefined);
|
|
1335
|
+
const [bonusOtherValue, setBonusOtherValue] = context.useState(undefined);
|
|
1336
|
+
const calculatorTripParams = { minSum: minSumTrip, maxSum: maxSumTrip };
|
|
1337
|
+
const calculatorOtherParams = { minSum: minSumOther, maxSum: maxSumOther };
|
|
1338
|
+
const incomeBonus = 948841;
|
|
1339
|
+
const bonusOrDef = bonus || 2528;
|
|
1340
|
+
return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput$1({
|
|
1341
|
+
title: 'Сумма покупок в категории путешествия, ₽',
|
|
1342
|
+
calculatorParams: calculatorTripParams,
|
|
1343
|
+
moneyValue: bonusTripValue,
|
|
1344
|
+
defaultSum: getDefaultSum$1(calculatorTripParams),
|
|
1345
|
+
setMoneyValue: setBonusTripValue,
|
|
1346
|
+
isShowItems: false,
|
|
1347
|
+
}), renderWantedSumInput$1({
|
|
1348
|
+
className: 'mt-6',
|
|
1349
|
+
title: 'Сумма покупок в остальных категориях, ₽',
|
|
1350
|
+
calculatorParams: calculatorOtherParams,
|
|
1351
|
+
moneyValue: bonusOtherValue,
|
|
1352
|
+
defaultSum: getDefaultSum$1(calculatorOtherParams),
|
|
1353
|
+
setMoneyValue: setBonusOtherValue,
|
|
1354
|
+
isShowItems: false,
|
|
1355
|
+
})] }), jsx("div", { children: bonusOrDef
|
|
1356
|
+
? renderRate({
|
|
1357
|
+
rate: bonusOrDef,
|
|
1358
|
+
title: 'Баллов за месяц',
|
|
1359
|
+
className: 'tracking-[-14px]',
|
|
1360
|
+
})
|
|
1361
|
+
: null }), jsxs("div", { className: "w-[240px]", children: [jsx(CalculatorValueBlock, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u0433\u043E\u0434", value: incomeBonus }) , renderButtonSection(context, buttons)] })] }));
|
|
1362
|
+
});
|
|
1363
|
+
|
|
1364
|
+
const EmbeddableCalcBlocks = {
|
|
1365
|
+
CreditCalculatorForm: CreditCalculatorForm$1,
|
|
1366
|
+
MortgageCalculatorForm,
|
|
1367
|
+
DepositCalculatorForm,
|
|
1368
|
+
BonusCalculatorForm,
|
|
1369
|
+
};
|
|
1370
|
+
|
|
1371
|
+
const renderCalculatorList = ({ blockCalcTabs, context, className, }) => {
|
|
1372
|
+
return blockCalcTabs?.length ? blockCalcTabs.map(renderBlock$2({ context, className })) : null;
|
|
1373
|
+
};
|
|
1374
|
+
const renderBlock$2 = ({ context, className }) => (blockCalcTabs, i) => {
|
|
1375
|
+
const type = blockCalcTabs?.calcType;
|
|
1376
|
+
if (!type || !(type in EmbeddableCalcBlocks)) {
|
|
1377
|
+
return null;
|
|
1378
|
+
}
|
|
1379
|
+
const EmbeddedBlock = EmbeddableCalcBlocks[type];
|
|
1380
|
+
return (jsx("section", { className: `box-border relative flex grow-0 shrink-0 basis-full ${className}`, role: "listitem", children: jsx("div", { className: `box-border p-9 w-full`, children: jsx(EmbeddedBlock, { context: context, ...blockCalcTabs, className: "!p-0 flex justify-between" }) }) }, `${String(i)}`));
|
|
1381
|
+
};
|
|
1382
|
+
|
|
1383
|
+
const arrowBtnStyle = 'absolute w-[56px] h-[56px] min-h-[56px] max-h-[56px] top-1 z-10 mt-[25px] bg-white rounded-full';
|
|
1384
|
+
const Calculator = JSX(({ className = '', context, calcTabs = [], anchor = null }) => {
|
|
1385
|
+
const tabsNav = calcTabs.map((_) => _.nav || {});
|
|
1386
|
+
const blockCalcTabs = calcTabs.map(({ calculatorBlock }) => calculatorBlock || {});
|
|
1387
|
+
const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
|
|
1388
|
+
const [tabsShift, setTabsShift] = context.useState(0);
|
|
1389
|
+
const handleNextClick = () => setTabsShift(tabsShift + 1);
|
|
1390
|
+
const handlePrevClick = () => setTabsShift(tabsShift - 1);
|
|
1391
|
+
const isGalleryScrollAvailable = calcTabs?.length > 3;
|
|
1392
|
+
const showNextButton = isGalleryScrollAvailable && calcTabs?.length > tabsShift + 3;
|
|
1393
|
+
const showPrevButton = tabsShift > 0;
|
|
1394
|
+
return (jsxs("section", { id: anchor, className: `box-border overflow-hidden relative font-sans w-100 bg-white text-primary-text ${className}`, children: [jsxs("div", { children: [tabsNav.length > 1
|
|
1395
|
+
? renderTabs({ tabsShift, tabsNav, activeSlideIndex, setActiveSlideIndex })
|
|
1396
|
+
: null, showPrevButton ? (jsx(ArrowButton, { className: `${arrowBtnStyle} left-3 top-3`, onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E", "data-block-control": "scroll-left" })) : null, showNextButton ? (jsx(ArrowButton, { className: `${arrowBtnStyle} right-3 top-3 rotate-180`, onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E", "data-block-control": "scroll-right" })) : null] }), jsx("div", { className: "flex", style: { transform: `translateX(-${activeSlideIndex}00%)` }, role: "list", children: renderCalculatorList({
|
|
1397
|
+
context,
|
|
1398
|
+
className,
|
|
1399
|
+
blockCalcTabs,
|
|
1400
|
+
}) })] }));
|
|
1401
|
+
});
|
|
1402
|
+
function renderNavButton$1({ tab, i, activeSlideIndex, onClick }) {
|
|
1403
|
+
const isActiveBtn = i === activeSlideIndex;
|
|
1404
|
+
const btnClassName = isActiveBtn
|
|
1405
|
+
? 'h-[88px] w-[387px] min-w-[387px] p-5 border-none bg-primary-main text-white'
|
|
1406
|
+
: `h-[77px] w-[322px] min-w-[322px] px-5 py-4 ease-in duration-300 bg-white text-primary-text`;
|
|
1407
|
+
const btnTitleClassName = isActiveBtn ? 'text-md-new mb-1.5' : `text-base mb-[3px]`;
|
|
1408
|
+
const btnDescClassName = isActiveBtn ? 'text-base text-white' : `text-m-md`;
|
|
1409
|
+
const iconClassName = isActiveBtn ? '' : `text-primary-main`;
|
|
1410
|
+
return (jsxs("button", { type: "button", onClick: onClick, "aria-label": tab?.title, className: `box-border font-sans relative border-[1px] border-main-stroke cursor-pointer text-left border-b-0 flex
|
|
1411
|
+
${btnClassName}`, children: [jsx(Img, { className: `h-[24px] w-[24px] min-w-[24px] min-h-[24px] mr-4 ${iconClassName}`, image: { ...tab?.icon, iconVersion: isActiveBtn ? 'white' : 'normal' }, width: "24", height: "24", asSVG: true }), jsxs("div", { className: "border-0", children: [jsx("div", { className: `font-medium ${btnTitleClassName}`, children: tab?.title }), jsx("div", { className: `text-secondary-text ${btnDescClassName}`, children: tab.description })] })] }, String(i)));
|
|
1412
|
+
}
|
|
1413
|
+
function renderTabs({ tabsShift, tabsNav, activeSlideIndex, setActiveSlideIndex }) {
|
|
1414
|
+
return (jsxs("div", { children: [jsx("div", { style: { transform: `translateX(-${tabsShift * 388}px)` }, className: "flex flex-col justify-end items-center h-[126px] pt-[38px] box-border duration-1000", children: jsx("div", { className: "w-full flex flex-nowrap items-end gap-2", children: tabsNav.map((tab, i) => renderNavButton$1({
|
|
1415
|
+
tab,
|
|
1416
|
+
i,
|
|
1417
|
+
activeSlideIndex,
|
|
1418
|
+
onClick: () => setActiveSlideIndex(i),
|
|
1419
|
+
})) }) }), jsx("div", { className: "w-full h-2 bg-primary-main" })] }));
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
const TAB_STYLE = 'px-2 h-14 pb-2 pt-3 border border-b-0 border-main-stroke';
|
|
1423
|
+
const ACTIVE_TAB_STYLE = 'px-2 h-16 pt-4 pb-2 text-white bg-primary-main';
|
|
1424
|
+
const Tabs = JSX(({ tabs, currentTabIndex, onTabClick }) => {
|
|
1425
|
+
return (jsx("div", { className: "flex items-end border-b border-main-stroke", role: "tablist", children: tabs?.map(renderTab$2(currentTabIndex, onTabClick)) }));
|
|
1426
|
+
});
|
|
1427
|
+
const renderTab$2 = (currentTabIndex, onTabClick) => (tab, index) => {
|
|
1428
|
+
const isActive = currentTabIndex === index;
|
|
1429
|
+
return (jsxs("div", { className: `flex h-full flex-1 cursor-pointer mr-2 last:mr-0 box-content ${isActive ? ACTIVE_TAB_STYLE : TAB_STYLE}`, role: "tab", onClick: () => onTabClick(index), "aria-selected": String(isActive), children: [tab?.icon ? renderIcon(tab, isActive) : null, jsxs("div", { children: [tab?.title ? jsx("h3", { className: "font-medium m-0 text-base", children: tab?.title }) : null, tab?.description ? (jsx("span", { className: `font-light text-xs ${isActive ? '' : 'text-secondary-text'}`, children: tab?.description })) : null] })] }, String(index)));
|
|
1430
|
+
};
|
|
1431
|
+
const renderIcon = (tab, isActive) => (jsx("div", { className: "h-full mt-1", children: jsx(Img, { className: `w-5 h-5 mr-3 ${isActive ? 'invert' : ''}`, image: tab?.icon || 'CardIcon', asSVG: !isActive }) }));
|
|
1432
|
+
|
|
1433
|
+
function getTileHeadingType(className = '') {
|
|
1434
|
+
const colSpan = getColSpan(className);
|
|
1435
|
+
if (colSpan <= 4) {
|
|
1436
|
+
return 'h4';
|
|
1437
|
+
}
|
|
1438
|
+
else if (colSpan <= 8) {
|
|
1439
|
+
return 'h3';
|
|
1440
|
+
}
|
|
1441
|
+
else {
|
|
1442
|
+
return 'h2';
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1135
1446
|
const DEFAULT_MIN_SUM = 30000;
|
|
1136
1447
|
const DEFAULT_MAX_SUM = 3000000;
|
|
1137
1448
|
const DEFAULT_SUM = (DEFAULT_MAX_SUM - DEFAULT_MIN_SUM) / 2;
|
|
@@ -1206,30 +1517,6 @@
|
|
|
1206
1517
|
return (jsx("button", { className: "bg-secondary-light rounded-3xl h-10 w-[75px] box-border mr-2 flex items-center justify-center cursor-pointer border-none", onClick: () => handleClick(number), children: jsxs("span", { className: "font-semibold text-sm", children: [number, " ", string] }) }, String(i)));
|
|
1207
1518
|
}
|
|
1208
1519
|
|
|
1209
|
-
const addSpacesBetweenNumbers = (number) => new Intl.NumberFormat('ru-RU', { maximumSignificantDigits: 3 }).format(number);
|
|
1210
|
-
|
|
1211
|
-
const InputRange = JSX(({ className, title, items = [], min = 1, max = 100, step = 1, value = min, onChange }) => {
|
|
1212
|
-
const handleChange = (value) => {
|
|
1213
|
-
if (!onChange)
|
|
1214
|
-
return;
|
|
1215
|
-
const sanitizedValue = Number(value.replace(/\D/g, ''));
|
|
1216
|
-
onChange(sanitizedValue);
|
|
1217
|
-
};
|
|
1218
|
-
const inputStyle = {
|
|
1219
|
-
backgroundSize: `${(((value - min) * 100) / (max - min)).toFixed(2)}% 100%`,
|
|
1220
|
-
};
|
|
1221
|
-
const handleBlur = () => {
|
|
1222
|
-
if (!onChange)
|
|
1223
|
-
return;
|
|
1224
|
-
if (value < min)
|
|
1225
|
-
onChange(min);
|
|
1226
|
-
if (value > max)
|
|
1227
|
-
onChange(max);
|
|
1228
|
-
};
|
|
1229
|
-
return (jsxs("div", { className: className, children: [jsxs("label", { className: "block relative", children: [title ? (jsx("span", { className: "absolute text-xs text-secondary-text top-1 mt-0.5 pl-4 ml-0.5", children: title })) : null, jsx("input", { className: `m-0 font-sans text-sm w-full h-12 border border-solid border-main-stroke rounded-md
|
|
1230
|
-
outline-none p-0 pl-4 m-0 box-border text-primary-text ${title ? 'pt-4' : ''}`, value: addSpacesBetweenNumbers(value), onChange: (e) => handleChange(e.target.value), onBlur: handleBlur }), jsx("div", { className: "absolute inset-x-0 top-[35px] px-4 leading-[18px]", children: jsx("input", { className: "box-border w-full m-0 cursor-pointer slider", type: "range", min: min, max: max, step: step, value: value, onChange: (e) => handleChange(e.target.value), style: inputStyle }) })] }), jsx("div", { className: "flex justify-between my-3", children: items.map((item, i) => (jsxs("span", { className: "text-xs leading-[14px] text-secondary-text pl-4", children: [" ", item, " "] }, String(i)))) })] }));
|
|
1231
|
-
});
|
|
1232
|
-
|
|
1233
1520
|
const STEP_MONTHS = 1;
|
|
1234
1521
|
function renderMonthsInput(props) {
|
|
1235
1522
|
const { minMonths, maxMonths, monthsValue, defaultMonths, setMonthsValue } = props;
|
|
@@ -1814,34 +2101,6 @@
|
|
|
1814
2101
|
primary: 'bg-white text-primary-text',
|
|
1815
2102
|
secondary: 'bg-primary-main text-white',
|
|
1816
2103
|
};
|
|
1817
|
-
const ProductGalleryBlock = JSX(({ block, headingType, context, className = '' }) => {
|
|
1818
|
-
const version = block?.version ?? 'primary';
|
|
1819
|
-
return (jsx("section", { className: `flex grow-0 shrink-0 basis-full ${productGalleryStyleMap[version]} ${className}`, role: "listitem", children: jsx("div", { className: "p-10 flex grow", children: jsx(ProductBlockInner, { className: "pl-2.5 pt-2.5 pb-1.5 pr-[6.25rem]", context: context, headingType: headingType || 'h2', ...block }) }) }));
|
|
1820
|
-
});
|
|
1821
|
-
|
|
1822
|
-
const ProductGallery = JSX(({ className, context, duration = 0, slides = [], anchor = null }) => {
|
|
1823
|
-
const galleryNav = slides.map((s) => s.nav);
|
|
1824
|
-
const galleryBlocks = slides.map((s) => s.productBlock);
|
|
1825
|
-
const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
|
|
1826
|
-
return (jsxs("section", { className: `font-sans bg-white overflow-hidden w-100 ${className || ''}`, id: anchor, children: [jsx("div", { className: `flex duration-1000`, style: { transform: `translateX(-${activeSlideIndex}00%)` }, role: "list", children: galleryBlocks.map((_, i) => (jsx(ProductGalleryBlock, { context: context, block: _ }, String(i)))) }), jsx("div", { className: "flex", children: galleryNav.map((slide, i) => renderNavButton$1({
|
|
1827
|
-
slide,
|
|
1828
|
-
i,
|
|
1829
|
-
activeSlideIndex,
|
|
1830
|
-
onClick: () => setActiveSlideIndex(i),
|
|
1831
|
-
duration,
|
|
1832
|
-
})) })] }));
|
|
1833
|
-
});
|
|
1834
|
-
function renderNavButton$1({ slide, i, activeSlideIndex, onClick, duration }) {
|
|
1835
|
-
const isActiveBtn = i === activeSlideIndex;
|
|
1836
|
-
const progressBarClassName = isActiveBtn ? 'animate-slide' : '';
|
|
1837
|
-
const btnTitleClassName = isActiveBtn ? 'text-primary-text' : 'text-secondary-text';
|
|
1838
|
-
return (jsxs("button", { type: "button", onClick: onClick, "aria-label": slide?.title, className: `font-sans group relative overflow-hidden border-0 bg-inherit cursor-pointer text-left px-0 pt-4 pb-[23px] grow basis-0`, children: [jsxs("div", { className: "border-0 border-r border-solid border-main-divider px-6", children: [jsx("div", { className: `text-sm font-medium pb-[3px] group-hover:text-primary-text ${btnTitleClassName}`, children: slide?.title }), jsx("div", { className: "text-xs text-secondary-text", children: slide.desc })] }), jsx("div", { className: `absolute bottom-0 left-0 w-full h-[3px] bg-primary-main -translate-x-full ${progressBarClassName}`, style: { animationDuration: `${duration}s`, animationFillMode: 'forwards' } })] }, String(i)));
|
|
1839
|
-
}
|
|
1840
|
-
|
|
1841
|
-
const productGalleryGreenStyleMap = {
|
|
1842
|
-
primary: 'bg-white text-primary-text',
|
|
1843
|
-
secondary: 'bg-primary-main text-white',
|
|
1844
|
-
};
|
|
1845
2104
|
const productBlockStyleMap = {
|
|
1846
2105
|
primary: { title: 'text-secondary-text', text: 'text-secondary-text' },
|
|
1847
2106
|
secondary: { title: 'text-white', text: 'text-white/80' },
|
|
@@ -1850,12 +2109,12 @@
|
|
|
1850
2109
|
primary: 'bg-white text-primary-text',
|
|
1851
2110
|
secondary: 'bg-primary-main text-white',
|
|
1852
2111
|
};
|
|
1853
|
-
const
|
|
2112
|
+
const ProductGallery = JSX(({ className = '', context, slides = [], version = 'primary', anchor = null }) => {
|
|
1854
2113
|
const galleryNav = slides.map((s) => s.nav);
|
|
1855
2114
|
const galleryBlocks = slides.map((s) => s.productBlock);
|
|
1856
2115
|
const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
|
|
1857
2116
|
return (jsxs("section", { id: anchor, className: `box-border pt-[50px] overflow-hidden relative font-sans w-100 ${className}
|
|
1858
|
-
${
|
|
2117
|
+
${productGalleryStyleMap[version]}`, children: [jsx("div", { className: "flex duration-1000 pb-14", style: { transform: `translateX(-${activeSlideIndex}00%)` }, role: "list", children: galleryBlocks.map((_, i) => renderProductBlock({ ..._, version }, i, context)) }), jsx("div", { className: "flex items-center absolute bottom-6 left-0 right-0 px-[26px] box-border", children: galleryNav.map((slide, i) => renderNavButton({
|
|
1859
2118
|
slide,
|
|
1860
2119
|
i,
|
|
1861
2120
|
activeSlideIndex,
|
|
@@ -2045,6 +2304,7 @@
|
|
|
2045
2304
|
BenefitsBlock,
|
|
2046
2305
|
Bonus,
|
|
2047
2306
|
ComparisonTable,
|
|
2307
|
+
Calculator,
|
|
2048
2308
|
CreditCalculator,
|
|
2049
2309
|
ExchangeRateTile,
|
|
2050
2310
|
Footer,
|
|
@@ -2059,7 +2319,6 @@
|
|
|
2059
2319
|
PictureText,
|
|
2060
2320
|
ProductBlock,
|
|
2061
2321
|
ProductGallery,
|
|
2062
|
-
ProductGalleryGreen,
|
|
2063
2322
|
ProductTile,
|
|
2064
2323
|
PromoTile,
|
|
2065
2324
|
OtherProducts,
|