@redneckz/wildless-cms-uni-blocks 0.12.14 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/migration-scripts/0.12.12.js +19 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +252 -231
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/Calculator.mobile.d.ts +5 -0
- package/bundle/components/Calculator/CreditCalculatorForm.d.ts +1 -0
- package/bundle/components/Calculator/DepositCalculatorForm.d.ts +1 -1
- package/bundle/components/Calculator/RefinancingCalculatorForm.d.ts +1 -1
- package/bundle/components/Calculator/renderBinaryRadioButtonGroup.d.ts +2 -1
- package/bundle/components/Calculator/renderRate.d.ts +9 -0
- package/bundle/components/MortgageFiltration/HotFilterRecord.d.ts +11 -0
- package/bundle/components/MortgageFiltration/MortgageFiltrationContent.d.ts +12 -0
- package/bundle/components/RollupItem/rollupIconVersion.mobile.d.ts +1 -1
- package/bundle/components/Tabs/renderTabs.d.ts +12 -0
- package/bundle/hooks/useForm.d.ts +1 -0
- package/bundle/icons/IconName.d.ts +3 -3
- package/bundle/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
- package/bundle/ui-kit/ListControlProps.d.ts +4 -0
- package/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +1 -0
- package/bundle/ui-kit/TabsControl/ScrollableTabsControl.d.ts +2 -0
- package/bundle/ui-kit/TabsControl/TabItem.d.ts +11 -0
- package/bundle/ui-kit/TabsControl/TabsControl.d.ts +2 -0
- package/bundle/ui-kit/TabsControl/TabsControlProps.d.ts +6 -0
- package/bundle/ui-kit/TabsControl/renderTab.d.ts +4 -0
- package/bundle/utils/BoolComparator.d.ts +11 -0
- package/cosmos-static/icons/ArrowDownSolidIcon.svg +1 -1
- package/cosmos-static/icons/ArrowUpSolidIcon.svg +1 -1
- package/dist/components/Blocks.mobile.js +2 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js +19 -13
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/Calculator.mobile.d.ts +5 -0
- package/dist/components/Calculator/Calculator.mobile.js +33 -0
- package/dist/components/Calculator/Calculator.mobile.js.map +1 -0
- package/dist/components/Calculator/CalculatorValueBlock.js +2 -1
- package/dist/components/Calculator/CalculatorValueBlock.js.map +1 -1
- package/dist/components/Calculator/CreditCalculatorForm.d.ts +1 -0
- package/dist/components/Calculator/CreditCalculatorForm.js +18 -11
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.d.ts +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.js +13 -11
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/RefinancingCalculatorForm.d.ts +1 -1
- package/dist/components/Calculator/RefinancingCalculatorForm.js +1 -0
- package/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/renderBinaryRadioButtonGroup.d.ts +2 -1
- package/dist/components/Calculator/renderBinaryRadioButtonGroup.js +2 -1
- package/dist/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/dist/components/Calculator/renderDaysInput.js +1 -1
- package/dist/components/Calculator/renderDaysInput.js.map +1 -1
- package/dist/components/Calculator/renderMonthsInput.js +1 -1
- package/dist/components/Calculator/renderMonthsInput.js.map +1 -1
- package/dist/components/Calculator/renderPaymentType.js +1 -0
- package/dist/components/Calculator/renderPaymentType.js.map +1 -1
- package/dist/components/Calculator/renderRate.d.ts +9 -0
- package/dist/components/Calculator/renderRate.js +16 -0
- package/dist/components/Calculator/renderRate.js.map +1 -0
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +6 -7
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/dist/components/Header/Header.mobile.js +1 -1
- package/dist/components/Header/HeaderTop.js +9 -6
- package/dist/components/Header/HeaderTop.js.map +1 -1
- package/dist/components/MobileAppTile/MobileAppTile.js +1 -1
- package/dist/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/dist/components/MortgageFiltration/HotFilterRecord.d.ts +11 -0
- package/dist/components/MortgageFiltration/HotFilterRecord.js +5 -0
- package/dist/components/MortgageFiltration/HotFilterRecord.js.map +1 -0
- package/dist/components/MortgageFiltration/MortgageFiltration.js +24 -4
- package/dist/components/MortgageFiltration/MortgageFiltration.js.map +1 -1
- package/dist/components/MortgageFiltration/MortgageFiltrationContent.d.ts +12 -0
- package/dist/components/RollupItem/RollupItem.js +1 -1
- package/dist/components/RollupItem/RollupItem.js.map +1 -1
- package/dist/components/RollupItem/renderRoundedIcon.mobile.js +1 -1
- package/dist/components/RollupItem/renderRoundedIcon.mobile.js.map +1 -1
- package/dist/components/RollupItem/rollupIconVersion.mobile.d.ts +1 -1
- package/dist/components/RollupItem/rollupIconVersion.mobile.js +1 -1
- package/dist/components/RollupItem/rollupIconVersion.mobile.js.map +1 -1
- package/dist/components/Tabs/Tabs.js +19 -24
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/renderTabs.d.ts +12 -0
- package/dist/components/Tabs/renderTabs.js +19 -0
- package/dist/components/Tabs/renderTabs.js.map +1 -0
- package/dist/hooks/useForm.d.ts +1 -0
- package/dist/hooks/useForm.js +5 -0
- package/dist/hooks/useForm.js.map +1 -1
- package/dist/icons/IconName.d.ts +3 -3
- package/dist/icons/IconName.js +3 -3
- package/dist/icons/IconName.js.map +1 -1
- package/dist/ui-kit/BaseFiltration/BaseFiltrationInner.js +2 -2
- package/dist/ui-kit/BaseFiltration/BaseFiltrationInner.js.map +1 -1
- package/dist/ui-kit/BaseFiltration/renderFiltrationForm.js +2 -2
- package/dist/ui-kit/BaseFiltration/renderFiltrationForm.js.map +1 -1
- package/dist/ui-kit/BaseTile/BaseTile.js +1 -1
- package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/dist/ui-kit/BenefitsList/DefaultBenefitsList.js +5 -3
- package/dist/ui-kit/BenefitsList/DefaultBenefitsList.js.map +1 -1
- package/dist/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
- package/dist/ui-kit/ListControlProps.d.ts +4 -0
- package/dist/ui-kit/ListControlProps.js +2 -0
- package/dist/ui-kit/ListControlProps.js.map +1 -0
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +1 -0
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +2 -1
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/dist/ui-kit/TabsControl/ScrollableTabsControl.d.ts +2 -0
- package/dist/ui-kit/TabsControl/ScrollableTabsControl.js +17 -0
- package/dist/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -0
- package/dist/ui-kit/TabsControl/TabItem.d.ts +11 -0
- package/dist/ui-kit/TabsControl/TabItem.js +38 -0
- package/dist/ui-kit/TabsControl/TabItem.js.map +1 -0
- package/dist/ui-kit/TabsControl/TabsControl.d.ts +2 -0
- package/dist/ui-kit/TabsControl/TabsControl.js +8 -0
- package/dist/ui-kit/TabsControl/TabsControl.js.map +1 -0
- package/dist/ui-kit/TabsControl/TabsControlProps.d.ts +6 -0
- package/dist/ui-kit/TabsControl/TabsControlProps.js +2 -0
- package/dist/ui-kit/TabsControl/TabsControlProps.js.map +1 -0
- package/dist/ui-kit/TabsControl/renderTab.d.ts +4 -0
- package/dist/ui-kit/TabsControl/renderTab.js +7 -0
- package/dist/ui-kit/TabsControl/renderTab.js.map +1 -0
- package/dist/utils/BoolComparator.d.ts +11 -0
- package/dist/utils/BoolComparator.js +19 -0
- package/dist/utils/BoolComparator.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.mobile.js +2 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js +19 -13
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/Calculator.fixture.mobile.d.ts +8 -0
- package/lib/components/Calculator/Calculator.mobile.d.ts +5 -0
- package/lib/components/Calculator/Calculator.mobile.js +31 -0
- package/lib/components/Calculator/Calculator.mobile.js.map +1 -0
- package/lib/components/Calculator/CalculatorValueBlock.js +2 -1
- package/lib/components/Calculator/CalculatorValueBlock.js.map +1 -1
- package/lib/components/Calculator/CreditCalculatorForm.d.ts +1 -0
- package/lib/components/Calculator/CreditCalculatorForm.js +18 -11
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.d.ts +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.js +13 -11
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/RefinancingCalculatorForm.d.ts +1 -1
- package/lib/components/Calculator/RefinancingCalculatorForm.js +1 -0
- package/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/renderBinaryRadioButtonGroup.d.ts +2 -2
- package/lib/components/Calculator/renderBinaryRadioButtonGroup.js +2 -1
- package/lib/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/lib/components/Calculator/renderDaysInput.d.ts +0 -1
- package/lib/components/Calculator/renderDaysInput.js +1 -1
- package/lib/components/Calculator/renderDaysInput.js.map +1 -1
- package/lib/components/Calculator/renderFootnote.d.ts +0 -1
- package/lib/components/Calculator/renderInterestPayment.d.ts +0 -1
- package/lib/components/Calculator/renderMonthsInput.d.ts +0 -1
- package/lib/components/Calculator/renderMonthsInput.js +1 -1
- package/lib/components/Calculator/renderMonthsInput.js.map +1 -1
- package/lib/components/Calculator/renderPaymentType.d.ts +0 -1
- package/lib/components/Calculator/renderPaymentType.js +1 -0
- package/lib/components/Calculator/renderPaymentType.js.map +1 -1
- package/lib/components/Calculator/renderRate.d.ts +8 -0
- package/lib/components/Calculator/renderRate.js +13 -0
- package/lib/components/Calculator/renderRate.js.map +1 -0
- package/lib/components/Calculator/renderRegistrationType.d.ts +0 -1
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +7 -8
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/lib/components/Header/Header.mobile.js +1 -1
- package/lib/components/Header/HeaderTop.js +9 -6
- package/lib/components/Header/HeaderTop.js.map +1 -1
- package/lib/components/MobileAppTile/MobileAppTile.js +1 -1
- package/lib/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/lib/components/MortgageFiltration/HotFilterRecord.d.ts +11 -0
- package/lib/components/MortgageFiltration/HotFilterRecord.js +3 -0
- package/lib/components/MortgageFiltration/HotFilterRecord.js.map +1 -0
- package/lib/components/MortgageFiltration/MortgageFiltration.js +24 -4
- package/lib/components/MortgageFiltration/MortgageFiltration.js.map +1 -1
- package/lib/components/MortgageFiltration/MortgageFiltrationContent.d.ts +12 -0
- package/lib/components/RollupItem/RollupItem.js +1 -1
- package/lib/components/RollupItem/RollupItem.js.map +1 -1
- package/lib/components/RollupItem/renderRoundedIcon.mobile.js +1 -1
- package/lib/components/RollupItem/renderRoundedIcon.mobile.js.map +1 -1
- package/lib/components/RollupItem/rollupIconVersion.mobile.d.ts +1 -1
- package/lib/components/RollupItem/rollupIconVersion.mobile.js +1 -1
- package/lib/components/RollupItem/rollupIconVersion.mobile.js.map +1 -1
- package/lib/components/Tabs/Tabs.js +20 -25
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/renderTabs.d.ts +11 -0
- package/lib/components/Tabs/renderTabs.js +16 -0
- package/lib/components/Tabs/renderTabs.js.map +1 -0
- package/lib/hooks/useForm.d.ts +1 -0
- package/lib/hooks/useForm.js +5 -0
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/icons/IconName.d.ts +3 -3
- package/lib/icons/IconName.js +3 -3
- package/lib/icons/IconName.js.map +1 -1
- package/lib/ui-kit/BaseFiltration/BaseFiltrationInner.js +2 -2
- package/lib/ui-kit/BaseFiltration/BaseFiltrationInner.js.map +1 -1
- package/lib/ui-kit/BaseFiltration/renderFiltrationForm.js +2 -2
- package/lib/ui-kit/BaseFiltration/renderFiltrationForm.js.map +1 -1
- package/lib/ui-kit/BaseTile/BaseTile.js +1 -1
- package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/lib/ui-kit/BenefitsList/DefaultBenefitsList.js +5 -3
- package/lib/ui-kit/BenefitsList/DefaultBenefitsList.js.map +1 -1
- package/lib/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
- package/lib/ui-kit/ListControlProps.d.ts +4 -0
- package/lib/ui-kit/ListControlProps.js +2 -0
- package/lib/ui-kit/ListControlProps.js.map +1 -0
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +1 -0
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +2 -1
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/lib/ui-kit/TabsControl/ScrollableTabsControl.d.ts +2 -0
- package/lib/ui-kit/TabsControl/ScrollableTabsControl.js +15 -0
- package/lib/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -0
- package/lib/ui-kit/TabsControl/TabItem.d.ts +11 -0
- package/lib/ui-kit/TabsControl/TabItem.js +36 -0
- package/lib/ui-kit/TabsControl/TabItem.js.map +1 -0
- package/lib/ui-kit/TabsControl/TabsControl.d.ts +2 -0
- package/lib/ui-kit/TabsControl/TabsControl.fixture.d.ts +8 -0
- package/lib/ui-kit/TabsControl/TabsControl.js +6 -0
- package/lib/ui-kit/TabsControl/TabsControl.js.map +1 -0
- package/lib/ui-kit/TabsControl/TabsControlProps.d.ts +6 -0
- package/lib/ui-kit/TabsControl/TabsControlProps.js +2 -0
- package/lib/ui-kit/TabsControl/TabsControlProps.js.map +1 -0
- package/lib/ui-kit/TabsControl/renderTab.d.ts +3 -0
- package/lib/ui-kit/TabsControl/renderTab.js +4 -0
- package/lib/ui-kit/TabsControl/renderTab.js.map +1 -0
- package/lib/utils/BoolComparator.d.ts +11 -0
- package/lib/utils/BoolComparator.js +12 -0
- package/lib/utils/BoolComparator.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +898 -205
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/CreditCalculatorForm.d.ts +1 -0
- package/mobile/bundle/components/Calculator/DepositCalculatorForm.d.ts +1 -1
- package/mobile/bundle/components/Calculator/RefinancingCalculatorForm.d.ts +1 -1
- package/mobile/bundle/components/Calculator/renderBinaryRadioButtonGroup.d.ts +2 -1
- package/mobile/bundle/components/Calculator/renderRate.d.ts +9 -0
- package/mobile/bundle/components/MortgageFiltration/HotFilterRecord.d.ts +11 -0
- package/mobile/bundle/components/MortgageFiltration/MortgageFiltrationContent.d.ts +12 -0
- package/mobile/bundle/components/RollupItem/rollupIconVersion.d.ts +1 -1
- package/mobile/bundle/components/Tabs/renderTabs.d.ts +12 -0
- package/mobile/bundle/hooks/useForm.d.ts +1 -0
- package/mobile/bundle/icons/IconName.d.ts +3 -3
- package/mobile/bundle/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
- package/mobile/bundle/ui-kit/ListControlProps.d.ts +4 -0
- package/mobile/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +1 -0
- package/mobile/bundle/ui-kit/TabsControl/ScrollableTabsControl.d.ts +2 -0
- package/mobile/bundle/ui-kit/TabsControl/TabItem.d.ts +11 -0
- package/mobile/bundle/ui-kit/TabsControl/TabsControl.d.ts +2 -0
- package/mobile/bundle/ui-kit/TabsControl/TabsControlProps.d.ts +6 -0
- package/mobile/bundle/ui-kit/TabsControl/renderTab.d.ts +4 -0
- package/mobile/bundle/utils/BoolComparator.d.ts +11 -0
- package/mobile/dist/components/Blocks.js +2 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +19 -13
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/Calculator.js +27 -49
- package/mobile/dist/components/Calculator/Calculator.js.map +1 -1
- package/mobile/dist/components/Calculator/CalculatorValueBlock.js +2 -1
- package/mobile/dist/components/Calculator/CalculatorValueBlock.js.map +1 -1
- package/mobile/dist/components/Calculator/CreditCalculatorForm.d.ts +1 -0
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js +18 -11
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.d.ts +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +13 -11
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.d.ts +1 -1
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js +1 -0
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.d.ts +2 -1
- package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.js +2 -1
- package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/mobile/dist/components/Calculator/renderDaysInput.js +1 -1
- package/mobile/dist/components/Calculator/renderDaysInput.js.map +1 -1
- package/mobile/dist/components/Calculator/renderMonthsInput.js +1 -1
- package/mobile/dist/components/Calculator/renderMonthsInput.js.map +1 -1
- package/mobile/dist/components/Calculator/renderPaymentType.js +1 -0
- package/mobile/dist/components/Calculator/renderPaymentType.js.map +1 -1
- package/mobile/dist/components/Calculator/renderRate.d.ts +9 -0
- package/mobile/dist/components/Calculator/renderRate.js +16 -0
- package/mobile/dist/components/Calculator/renderRate.js.map +1 -0
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +6 -7
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/dist/components/Header/Header.js +1 -1
- package/mobile/dist/components/Header/HeaderTop.js +9 -6
- package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
- package/mobile/dist/components/MobileAppTile/MobileAppTile.js +1 -1
- package/mobile/dist/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/mobile/dist/components/MortgageFiltration/HotFilterRecord.d.ts +11 -0
- package/mobile/dist/components/MortgageFiltration/HotFilterRecord.js +5 -0
- package/mobile/dist/components/MortgageFiltration/HotFilterRecord.js.map +1 -0
- package/mobile/dist/components/MortgageFiltration/MortgageFiltration.js +24 -4
- package/mobile/dist/components/MortgageFiltration/MortgageFiltration.js.map +1 -1
- package/mobile/dist/components/MortgageFiltration/MortgageFiltrationContent.d.ts +12 -0
- package/mobile/dist/components/RollupItem/RollupItem.js +1 -1
- package/mobile/dist/components/RollupItem/RollupItem.js.map +1 -1
- package/mobile/dist/components/RollupItem/renderRoundedIcon.js +1 -1
- package/mobile/dist/components/RollupItem/renderRoundedIcon.js.map +1 -1
- package/mobile/dist/components/RollupItem/rollupIconVersion.d.ts +1 -1
- package/mobile/dist/components/RollupItem/rollupIconVersion.js +1 -1
- package/mobile/dist/components/RollupItem/rollupIconVersion.js.map +1 -1
- package/mobile/dist/components/Tabs/Tabs.js +19 -24
- package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
- package/mobile/dist/components/Tabs/renderTabs.d.ts +12 -0
- package/mobile/dist/components/Tabs/renderTabs.js +19 -0
- package/mobile/dist/components/Tabs/renderTabs.js.map +1 -0
- package/mobile/dist/hooks/useForm.d.ts +1 -0
- package/mobile/dist/hooks/useForm.js +5 -0
- package/mobile/dist/hooks/useForm.js.map +1 -1
- package/mobile/dist/icons/IconName.d.ts +3 -3
- package/mobile/dist/icons/IconName.js +3 -3
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/ui-kit/BaseFiltration/BaseFiltrationInner.js +2 -2
- package/mobile/dist/ui-kit/BaseFiltration/BaseFiltrationInner.js.map +1 -1
- package/mobile/dist/ui-kit/BaseFiltration/renderFiltrationForm.js +2 -2
- package/mobile/dist/ui-kit/BaseFiltration/renderFiltrationForm.js.map +1 -1
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js +1 -1
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/dist/ui-kit/BenefitsList/DefaultBenefitsList.js +5 -3
- package/mobile/dist/ui-kit/BenefitsList/DefaultBenefitsList.js.map +1 -1
- package/mobile/dist/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
- package/mobile/dist/ui-kit/ListControlProps.d.ts +4 -0
- package/mobile/dist/ui-kit/ListControlProps.js +2 -0
- package/mobile/dist/ui-kit/ListControlProps.js.map +1 -0
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +1 -0
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +2 -1
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/ScrollableTabsControl.d.ts +2 -0
- package/mobile/dist/ui-kit/TabsControl/ScrollableTabsControl.js +17 -0
- package/mobile/dist/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -0
- package/mobile/dist/ui-kit/TabsControl/TabItem.d.ts +11 -0
- package/mobile/dist/ui-kit/TabsControl/TabItem.js +38 -0
- package/mobile/dist/ui-kit/TabsControl/TabItem.js.map +1 -0
- package/mobile/dist/ui-kit/TabsControl/TabsControl.d.ts +2 -0
- package/mobile/dist/ui-kit/TabsControl/TabsControl.js +8 -0
- package/mobile/dist/ui-kit/TabsControl/TabsControl.js.map +1 -0
- package/mobile/dist/ui-kit/TabsControl/TabsControlProps.d.ts +6 -0
- package/mobile/dist/ui-kit/TabsControl/TabsControlProps.js +2 -0
- package/mobile/dist/ui-kit/TabsControl/TabsControlProps.js.map +1 -0
- package/mobile/dist/ui-kit/TabsControl/renderTab.d.ts +4 -0
- package/mobile/dist/ui-kit/TabsControl/renderTab.js +7 -0
- package/mobile/dist/ui-kit/TabsControl/renderTab.js.map +1 -0
- package/mobile/dist/utils/BoolComparator.d.ts +11 -0
- package/mobile/dist/utils/BoolComparator.js +19 -0
- package/mobile/dist/utils/BoolComparator.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Blocks.js +2 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +19 -13
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/Calculator.js +28 -50
- package/mobile/lib/components/Calculator/Calculator.js.map +1 -1
- package/mobile/lib/components/Calculator/CalculatorValueBlock.js +2 -1
- package/mobile/lib/components/Calculator/CalculatorValueBlock.js.map +1 -1
- package/mobile/lib/components/Calculator/CreditCalculatorForm.d.ts +1 -0
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js +18 -11
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.d.ts +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +13 -11
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.d.ts +1 -1
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js +1 -0
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.d.ts +2 -1
- package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.js +2 -1
- package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/mobile/lib/components/Calculator/renderDaysInput.js +1 -1
- package/mobile/lib/components/Calculator/renderDaysInput.js.map +1 -1
- package/mobile/lib/components/Calculator/renderMonthsInput.js +1 -1
- package/mobile/lib/components/Calculator/renderMonthsInput.js.map +1 -1
- package/mobile/lib/components/Calculator/renderPaymentType.js +1 -0
- package/mobile/lib/components/Calculator/renderPaymentType.js.map +1 -1
- package/mobile/lib/components/Calculator/renderRate.d.ts +9 -0
- package/mobile/lib/components/Calculator/renderRate.js +13 -0
- package/mobile/lib/components/Calculator/renderRate.js.map +1 -0
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +7 -8
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/lib/components/Header/Header.js +1 -1
- package/mobile/lib/components/Header/HeaderTop.js +9 -6
- package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
- package/mobile/lib/components/MobileAppTile/MobileAppTile.js +1 -1
- package/mobile/lib/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/mobile/lib/components/MortgageFiltration/HotFilterRecord.d.ts +11 -0
- package/mobile/lib/components/MortgageFiltration/HotFilterRecord.js +3 -0
- package/mobile/lib/components/MortgageFiltration/HotFilterRecord.js.map +1 -0
- package/mobile/lib/components/MortgageFiltration/MortgageFiltration.js +24 -4
- package/mobile/lib/components/MortgageFiltration/MortgageFiltration.js.map +1 -1
- package/mobile/lib/components/MortgageFiltration/MortgageFiltrationContent.d.ts +12 -0
- package/mobile/lib/components/RollupItem/RollupItem.js +1 -1
- package/mobile/lib/components/RollupItem/RollupItem.js.map +1 -1
- package/mobile/lib/components/RollupItem/renderRoundedIcon.js +1 -1
- package/mobile/lib/components/RollupItem/renderRoundedIcon.js.map +1 -1
- package/mobile/lib/components/RollupItem/rollupIconVersion.d.ts +1 -1
- package/mobile/lib/components/RollupItem/rollupIconVersion.js +1 -1
- package/mobile/lib/components/RollupItem/rollupIconVersion.js.map +1 -1
- package/mobile/lib/components/Tabs/Tabs.js +20 -25
- package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/components/Tabs/renderTabs.d.ts +12 -0
- package/mobile/lib/components/Tabs/renderTabs.js +16 -0
- package/mobile/lib/components/Tabs/renderTabs.js.map +1 -0
- package/mobile/lib/hooks/useForm.d.ts +1 -0
- package/mobile/lib/hooks/useForm.js +5 -0
- package/mobile/lib/hooks/useForm.js.map +1 -1
- package/mobile/lib/icons/IconName.d.ts +3 -3
- package/mobile/lib/icons/IconName.js +3 -3
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/ui-kit/BaseFiltration/BaseFiltrationInner.js +2 -2
- package/mobile/lib/ui-kit/BaseFiltration/BaseFiltrationInner.js.map +1 -1
- package/mobile/lib/ui-kit/BaseFiltration/renderFiltrationForm.js +2 -2
- package/mobile/lib/ui-kit/BaseFiltration/renderFiltrationForm.js.map +1 -1
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js +1 -1
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/lib/ui-kit/BenefitsList/DefaultBenefitsList.js +5 -3
- package/mobile/lib/ui-kit/BenefitsList/DefaultBenefitsList.js.map +1 -1
- package/mobile/lib/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
- package/mobile/lib/ui-kit/ListControlProps.d.ts +4 -0
- package/mobile/lib/ui-kit/ListControlProps.js +2 -0
- package/mobile/lib/ui-kit/ListControlProps.js.map +1 -0
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +1 -0
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +2 -1
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/ScrollableTabsControl.d.ts +2 -0
- package/mobile/lib/ui-kit/TabsControl/ScrollableTabsControl.js +15 -0
- package/mobile/lib/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -0
- package/mobile/lib/ui-kit/TabsControl/TabItem.d.ts +11 -0
- package/mobile/lib/ui-kit/TabsControl/TabItem.js +36 -0
- package/mobile/lib/ui-kit/TabsControl/TabItem.js.map +1 -0
- package/mobile/lib/ui-kit/TabsControl/TabsControl.d.ts +2 -0
- package/mobile/lib/ui-kit/TabsControl/TabsControl.js +6 -0
- package/mobile/lib/ui-kit/TabsControl/TabsControl.js.map +1 -0
- package/mobile/lib/ui-kit/TabsControl/TabsControlProps.d.ts +6 -0
- package/mobile/lib/ui-kit/TabsControl/TabsControlProps.js +2 -0
- package/mobile/lib/ui-kit/TabsControl/TabsControlProps.js.map +1 -0
- package/mobile/lib/ui-kit/TabsControl/renderTab.d.ts +4 -0
- package/mobile/lib/ui-kit/TabsControl/renderTab.js +4 -0
- package/mobile/lib/ui-kit/TabsControl/renderTab.js.map +1 -0
- package/mobile/lib/utils/BoolComparator.d.ts +11 -0
- package/mobile/lib/utils/BoolComparator.js +12 -0
- package/mobile/lib/utils/BoolComparator.js.map +1 -0
- package/mobile/src/components/Blocks.ts +2 -0
- package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +35 -40
- package/mobile/src/components/Calculator/Calculator.tsx +69 -118
- package/mobile/src/components/Calculator/CalculatorValueBlock.tsx +3 -1
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +29 -27
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +23 -16
- package/mobile/src/components/Calculator/RefinancingCalculatorForm.tsx +5 -2
- package/mobile/src/components/Calculator/renderBinaryRadioButtonGroup.tsx +4 -0
- package/mobile/src/components/Calculator/renderDaysInput.tsx +0 -1
- package/mobile/src/components/Calculator/renderMonthsInput.tsx +0 -1
- package/mobile/src/components/Calculator/renderPaymentType.tsx +1 -0
- package/mobile/src/components/Calculator/renderRate.tsx +37 -0
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +15 -33
- package/mobile/src/components/Header/Header.tsx +1 -1
- package/mobile/src/components/Header/HeaderTop.tsx +27 -14
- package/mobile/src/components/MobileAppTile/MobileAppTile.tsx +2 -1
- package/mobile/src/components/MortgageFiltration/HotFilterRecord.ts +14 -0
- package/mobile/src/components/MortgageFiltration/MortgageFiltration.example.json +54 -4
- package/mobile/src/components/MortgageFiltration/MortgageFiltration.tsx +51 -4
- package/mobile/src/components/MortgageFiltration/MortgageFiltrationContent.ts +13 -0
- package/mobile/src/components/RollupItem/RollupItem.tsx +1 -1
- package/mobile/src/components/RollupItem/renderRoundedIcon.tsx +1 -1
- package/mobile/src/components/RollupItem/rollupIconVersion.tsx +1 -1
- package/mobile/src/components/Tabs/Tabs.tsx +42 -53
- package/mobile/src/components/Tabs/renderTabs.tsx +37 -0
- package/mobile/src/hooks/useForm.ts +7 -0
- package/mobile/src/icons/ArrowDownSolidIcon.svg +1 -1
- package/mobile/src/icons/ArrowUpSolidIcon.svg +1 -1
- package/mobile/src/icons/IconName.ts +4 -4
- package/mobile/src/ui-kit/BaseFiltration/BaseFiltrationInner.tsx +2 -2
- package/mobile/src/ui-kit/BaseFiltration/renderFiltrationForm.tsx +4 -4
- package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
- package/mobile/src/ui-kit/BenefitsList/DefaultBenefitsList.tsx +8 -3
- package/mobile/src/ui-kit/InputRange/InputRangeProps.ts +1 -0
- package/mobile/src/ui-kit/ListControlProps.ts +5 -0
- package/mobile/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +10 -2
- package/mobile/src/ui-kit/TabsControl/ScrollableTabsControl.tsx +41 -0
- package/mobile/src/ui-kit/TabsControl/TabItem.tsx +81 -0
- package/mobile/src/ui-kit/TabsControl/TabsControl.tsx +12 -0
- package/mobile/src/ui-kit/TabsControl/TabsControlProps.ts +7 -0
- package/mobile/src/ui-kit/TabsControl/renderTab.tsx +15 -0
- package/mobile/src/utils/BoolComparator.ts +47 -0
- package/package.json +1 -1
- package/src/components/Blocks.mobile.ts +2 -0
- package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +35 -40
- package/src/components/Calculator/Calculator.fixture.mobile.tsx +114 -0
- package/src/components/Calculator/Calculator.mobile.tsx +85 -0
- package/src/components/Calculator/CalculatorValueBlock.tsx +3 -1
- package/src/components/Calculator/CreditCalculatorForm.tsx +29 -27
- package/src/components/Calculator/DepositCalculatorForm.tsx +23 -16
- package/src/components/Calculator/RefinancingCalculatorForm.tsx +5 -2
- package/src/components/Calculator/renderBinaryRadioButtonGroup.tsx +4 -0
- package/src/components/Calculator/renderDaysInput.tsx +0 -1
- package/src/components/Calculator/renderMonthsInput.tsx +0 -1
- package/src/components/Calculator/renderPaymentType.tsx +1 -0
- package/src/components/Calculator/renderRate.tsx +37 -0
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +15 -33
- package/src/components/Header/Header.mobile.tsx +1 -1
- package/src/components/Header/HeaderTop.tsx +27 -14
- package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +1 -3
- package/src/components/MobileAppTile/MobileAppTile.tsx +2 -1
- package/src/components/MortgageFiltration/HotFilterRecord.ts +14 -0
- package/src/components/MortgageFiltration/MortgageFiltration.example.json +54 -4
- package/src/components/MortgageFiltration/MortgageFiltration.fixture.tsx +51 -14
- package/src/components/MortgageFiltration/MortgageFiltration.tsx +51 -4
- package/src/components/MortgageFiltration/MortgageFiltrationContent.ts +13 -0
- package/src/components/RollupItem/RollupItem.tsx +1 -1
- package/src/components/RollupItem/renderRoundedIcon.mobile.tsx +1 -1
- package/src/components/RollupItem/rollupIconVersion.mobile.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +42 -53
- package/src/components/Tabs/renderTabs.tsx +37 -0
- package/src/hooks/useForm.ts +7 -0
- package/src/icons/ArrowDownSolidIcon.svg +1 -1
- package/src/icons/ArrowUpSolidIcon.svg +1 -1
- package/src/icons/IconName.ts +4 -4
- package/src/ui-kit/BaseFiltration/BaseFiltrationInner.tsx +2 -2
- package/src/ui-kit/BaseFiltration/renderFiltrationForm.tsx +4 -4
- package/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
- package/src/ui-kit/BenefitsList/DefaultBenefitsList.tsx +8 -3
- package/src/ui-kit/InputRange/InputRangeProps.ts +1 -0
- package/src/ui-kit/ListControlProps.ts +5 -0
- package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +10 -2
- package/src/ui-kit/TabsControl/ScrollableTabsControl.tsx +41 -0
- package/src/ui-kit/TabsControl/TabItem.tsx +81 -0
- package/src/ui-kit/TabsControl/TabsControl.fixture.tsx +103 -0
- package/src/ui-kit/TabsControl/TabsControl.tsx +12 -0
- package/src/ui-kit/TabsControl/TabsControlProps.ts +7 -0
- package/src/ui-kit/TabsControl/renderTab.tsx +15 -0
- package/src/utils/BoolComparator.ts +47 -0
- package/bundle/components/CarouselProgramsCard/programCardStyles.d.ts +0 -2
- package/bundle/components/CarouselProgramsCard/programCardStyles.mobile.d.ts +0 -2
- package/bundle/components/Tabs/CenteredTabs.d.ts +0 -7
- package/bundle/components/Tabs/LinkTab.d.ts +0 -9
- package/bundle/components/Tabs/ScrollableTabs.d.ts +0 -8
- package/bundle/components/Tabs/renderGroupTab.d.ts +0 -4
- package/bundle/components/Tabs/renderTab.d.ts +0 -11
- package/bundle/components/Tabs/tabItemClasses.d.ts +0 -11
- package/bundle/ui-kit/BaseTile/getTileRightPadding.d.ts +0 -1
- package/dist/components/CarouselProgramsCard/programCardStyles.d.ts +0 -2
- package/dist/components/CarouselProgramsCard/programCardStyles.js +0 -5
- package/dist/components/CarouselProgramsCard/programCardStyles.js.map +0 -1
- package/dist/components/CarouselProgramsCard/programCardStyles.mobile.d.ts +0 -2
- package/dist/components/CarouselProgramsCard/programCardStyles.mobile.js +0 -5
- package/dist/components/CarouselProgramsCard/programCardStyles.mobile.js.map +0 -1
- package/dist/components/Tabs/CenteredTabs.d.ts +0 -7
- package/dist/components/Tabs/CenteredTabs.js +0 -7
- package/dist/components/Tabs/CenteredTabs.js.map +0 -1
- package/dist/components/Tabs/LinkTab.d.ts +0 -9
- package/dist/components/Tabs/LinkTab.js +0 -19
- package/dist/components/Tabs/LinkTab.js.map +0 -1
- package/dist/components/Tabs/ScrollableTabs.d.ts +0 -8
- package/dist/components/Tabs/ScrollableTabs.js +0 -17
- package/dist/components/Tabs/ScrollableTabs.js.map +0 -1
- package/dist/components/Tabs/renderGroupTab.d.ts +0 -4
- package/dist/components/Tabs/renderGroupTab.js +0 -20
- package/dist/components/Tabs/renderGroupTab.js.map +0 -1
- package/dist/components/Tabs/renderTab.d.ts +0 -11
- package/dist/components/Tabs/renderTab.js +0 -24
- package/dist/components/Tabs/renderTab.js.map +0 -1
- package/dist/components/Tabs/tabItemClasses.d.ts +0 -11
- package/dist/components/Tabs/tabItemClasses.js +0 -48
- package/dist/components/Tabs/tabItemClasses.js.map +0 -1
- package/dist/ui-kit/BaseTile/getTileRightPadding.d.ts +0 -1
- package/dist/ui-kit/BaseTile/getTileRightPadding.js +0 -17
- package/dist/ui-kit/BaseTile/getTileRightPadding.js.map +0 -1
- package/lib/components/CarouselProgramsCard/programCardStyles.d.ts +0 -2
- package/lib/components/CarouselProgramsCard/programCardStyles.js +0 -3
- package/lib/components/CarouselProgramsCard/programCardStyles.js.map +0 -1
- package/lib/components/CarouselProgramsCard/programCardStyles.mobile.d.ts +0 -2
- package/lib/components/CarouselProgramsCard/programCardStyles.mobile.js +0 -3
- package/lib/components/CarouselProgramsCard/programCardStyles.mobile.js.map +0 -1
- package/lib/components/Tabs/CenteredTabs.d.ts +0 -7
- package/lib/components/Tabs/CenteredTabs.js +0 -5
- package/lib/components/Tabs/CenteredTabs.js.map +0 -1
- package/lib/components/Tabs/LinkTab.d.ts +0 -9
- package/lib/components/Tabs/LinkTab.js +0 -17
- package/lib/components/Tabs/LinkTab.js.map +0 -1
- package/lib/components/Tabs/ScrollableTabs.d.ts +0 -8
- package/lib/components/Tabs/ScrollableTabs.js +0 -15
- package/lib/components/Tabs/ScrollableTabs.js.map +0 -1
- package/lib/components/Tabs/renderGroupTab.d.ts +0 -3
- package/lib/components/Tabs/renderGroupTab.js +0 -17
- package/lib/components/Tabs/renderGroupTab.js.map +0 -1
- package/lib/components/Tabs/renderTab.d.ts +0 -10
- package/lib/components/Tabs/renderTab.js +0 -21
- package/lib/components/Tabs/renderTab.js.map +0 -1
- package/lib/components/Tabs/tabItemClasses.d.ts +0 -11
- package/lib/components/Tabs/tabItemClasses.js +0 -45
- package/lib/components/Tabs/tabItemClasses.js.map +0 -1
- package/lib/ui-kit/BaseTile/getTileRightPadding.d.ts +0 -1
- package/lib/ui-kit/BaseTile/getTileRightPadding.js +0 -14
- package/lib/ui-kit/BaseTile/getTileRightPadding.js.map +0 -1
- package/mobile/bundle/components/CarouselProgramsCard/programCardStyles.d.ts +0 -2
- package/mobile/bundle/components/Tabs/CenteredTabs.d.ts +0 -7
- package/mobile/bundle/components/Tabs/LinkTab.d.ts +0 -9
- package/mobile/bundle/components/Tabs/ScrollableTabs.d.ts +0 -8
- package/mobile/bundle/components/Tabs/renderGroupTab.d.ts +0 -4
- package/mobile/bundle/components/Tabs/renderTab.d.ts +0 -11
- package/mobile/bundle/components/Tabs/tabItemClasses.d.ts +0 -11
- package/mobile/bundle/ui-kit/BaseTile/getTileRightPadding.d.ts +0 -1
- package/mobile/dist/components/CarouselProgramsCard/programCardStyles.d.ts +0 -2
- package/mobile/dist/components/CarouselProgramsCard/programCardStyles.js +0 -5
- package/mobile/dist/components/CarouselProgramsCard/programCardStyles.js.map +0 -1
- package/mobile/dist/components/Tabs/CenteredTabs.d.ts +0 -7
- package/mobile/dist/components/Tabs/CenteredTabs.js +0 -7
- package/mobile/dist/components/Tabs/CenteredTabs.js.map +0 -1
- package/mobile/dist/components/Tabs/LinkTab.d.ts +0 -9
- package/mobile/dist/components/Tabs/LinkTab.js +0 -19
- package/mobile/dist/components/Tabs/LinkTab.js.map +0 -1
- package/mobile/dist/components/Tabs/ScrollableTabs.d.ts +0 -8
- package/mobile/dist/components/Tabs/ScrollableTabs.js +0 -17
- package/mobile/dist/components/Tabs/ScrollableTabs.js.map +0 -1
- package/mobile/dist/components/Tabs/renderGroupTab.d.ts +0 -4
- package/mobile/dist/components/Tabs/renderGroupTab.js +0 -20
- package/mobile/dist/components/Tabs/renderGroupTab.js.map +0 -1
- package/mobile/dist/components/Tabs/renderTab.d.ts +0 -11
- package/mobile/dist/components/Tabs/renderTab.js +0 -24
- package/mobile/dist/components/Tabs/renderTab.js.map +0 -1
- package/mobile/dist/components/Tabs/tabItemClasses.d.ts +0 -11
- package/mobile/dist/components/Tabs/tabItemClasses.js +0 -48
- package/mobile/dist/components/Tabs/tabItemClasses.js.map +0 -1
- package/mobile/dist/ui-kit/BaseTile/getTileRightPadding.d.ts +0 -1
- package/mobile/dist/ui-kit/BaseTile/getTileRightPadding.js +0 -17
- package/mobile/dist/ui-kit/BaseTile/getTileRightPadding.js.map +0 -1
- package/mobile/lib/components/CarouselProgramsCard/programCardStyles.d.ts +0 -2
- package/mobile/lib/components/CarouselProgramsCard/programCardStyles.js +0 -3
- package/mobile/lib/components/CarouselProgramsCard/programCardStyles.js.map +0 -1
- package/mobile/lib/components/Tabs/CenteredTabs.d.ts +0 -7
- package/mobile/lib/components/Tabs/CenteredTabs.js +0 -5
- package/mobile/lib/components/Tabs/CenteredTabs.js.map +0 -1
- package/mobile/lib/components/Tabs/LinkTab.d.ts +0 -9
- package/mobile/lib/components/Tabs/LinkTab.js +0 -17
- package/mobile/lib/components/Tabs/LinkTab.js.map +0 -1
- package/mobile/lib/components/Tabs/ScrollableTabs.d.ts +0 -8
- package/mobile/lib/components/Tabs/ScrollableTabs.js +0 -15
- package/mobile/lib/components/Tabs/ScrollableTabs.js.map +0 -1
- package/mobile/lib/components/Tabs/renderGroupTab.d.ts +0 -4
- package/mobile/lib/components/Tabs/renderGroupTab.js +0 -17
- package/mobile/lib/components/Tabs/renderGroupTab.js.map +0 -1
- package/mobile/lib/components/Tabs/renderTab.d.ts +0 -11
- package/mobile/lib/components/Tabs/renderTab.js +0 -21
- package/mobile/lib/components/Tabs/renderTab.js.map +0 -1
- package/mobile/lib/components/Tabs/tabItemClasses.d.ts +0 -11
- package/mobile/lib/components/Tabs/tabItemClasses.js +0 -45
- package/mobile/lib/components/Tabs/tabItemClasses.js.map +0 -1
- package/mobile/lib/ui-kit/BaseTile/getTileRightPadding.d.ts +0 -1
- package/mobile/lib/ui-kit/BaseTile/getTileRightPadding.js +0 -14
- package/mobile/lib/ui-kit/BaseTile/getTileRightPadding.js.map +0 -1
- package/mobile/src/components/CarouselProgramsCard/programCardStyles.ts +0 -2
- package/mobile/src/components/Tabs/CenteredTabs.tsx +0 -12
- package/mobile/src/components/Tabs/LinkTab.tsx +0 -47
- package/mobile/src/components/Tabs/ScrollableTabs.tsx +0 -46
- package/mobile/src/components/Tabs/renderGroupTab.tsx +0 -53
- package/mobile/src/components/Tabs/renderTab.tsx +0 -35
- package/mobile/src/components/Tabs/tabItemClasses.ts +0 -56
- package/mobile/src/ui-kit/BaseTile/getTileRightPadding.ts +0 -12
- package/src/components/CarouselProgramsCard/programCardStyles.mobile.ts +0 -2
- package/src/components/CarouselProgramsCard/programCardStyles.ts +0 -2
- package/src/components/Tabs/CenteredTabs.tsx +0 -12
- package/src/components/Tabs/LinkTab.tsx +0 -47
- package/src/components/Tabs/ScrollableTabs.tsx +0 -46
- package/src/components/Tabs/renderGroupTab.tsx +0 -53
- package/src/components/Tabs/renderTab.tsx +0 -35
- package/src/components/Tabs/tabItemClasses.ts +0 -56
- package/src/ui-kit/BaseTile/getTileRightPadding.ts +0 -12
- /package/cosmos-static/icons/{ChevronLeft.svg → ChevronLeftIcon.svg} +0 -0
- /package/mobile/src/icons/{ChevronLeft.svg → ChevronLeftIcon.svg} +0 -0
- /package/src/icons/{ChevronLeft.svg → ChevronLeftIcon.svg} +0 -0
|
@@ -394,6 +394,10 @@
|
|
|
394
394
|
onChange: handlersMap.current[fieldName],
|
|
395
395
|
};
|
|
396
396
|
}, [formState, isDirtyForm, dirtyFieldsMap]);
|
|
397
|
+
const update = useCallback((_) => {
|
|
398
|
+
setFormState(_);
|
|
399
|
+
setDirtyFieldsMap(_);
|
|
400
|
+
}, []);
|
|
397
401
|
const reset = useCallback(() => {
|
|
398
402
|
setFormState(initialState);
|
|
399
403
|
setDirtyForm(false);
|
|
@@ -409,6 +413,7 @@
|
|
|
409
413
|
{
|
|
410
414
|
isDirty: isDirtyForm || Object.values(dirtyFieldsMap).some(Boolean),
|
|
411
415
|
field,
|
|
416
|
+
update,
|
|
412
417
|
reset,
|
|
413
418
|
onSubmit: handleSubmit,
|
|
414
419
|
},
|
|
@@ -1382,8 +1387,10 @@
|
|
|
1382
1387
|
|
|
1383
1388
|
const defaultDiscriminator = (_) => _;
|
|
1384
1389
|
const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
|
|
1390
|
+
const max = maxBy();
|
|
1385
1391
|
|
|
1386
1392
|
const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
|
|
1393
|
+
const min = minBy();
|
|
1387
1394
|
|
|
1388
1395
|
const getItemWidth = (container) => (itemCount) => container.scrollWidth / itemCount;
|
|
1389
1396
|
const scrollBy = (container) => (itemCount, delta) => {
|
|
@@ -1486,6 +1493,753 @@
|
|
|
1486
1493
|
|
|
1487
1494
|
const ButtonsBlock = JSX(({ buttons, className, ...rest }) => (jsx(BlockWrapper, { className: style('!bg-transparent', className), defaultPadding: "p-0", ...rest, children: renderButtonsSection(buttons) })));
|
|
1488
1495
|
|
|
1496
|
+
const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
|
|
1497
|
+
const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
|
|
1498
|
+
const onToggle = useCallback(() => {
|
|
1499
|
+
setIsUnfolded((_) => !_);
|
|
1500
|
+
}, []);
|
|
1501
|
+
const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
|
|
1502
|
+
const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
|
|
1503
|
+
return isFoldButtonOnTop ? (jsxs("div", { className: className, children: [buttonNode, sectionNode] })) : (jsxs("div", { className: className, children: [sectionNode, buttonNode] }));
|
|
1504
|
+
});
|
|
1505
|
+
|
|
1506
|
+
const FoldableSection = JSX(({ className = '', isUnfolded, children }) => {
|
|
1507
|
+
const containerRef = useRef(null);
|
|
1508
|
+
useEffect(() => {
|
|
1509
|
+
if (containerRef.current) {
|
|
1510
|
+
containerRef.current.style.maxHeight = isUnfolded
|
|
1511
|
+
? `${containerRef.current.scrollHeight}px`
|
|
1512
|
+
: '';
|
|
1513
|
+
}
|
|
1514
|
+
}, [isUnfolded, children?.length]);
|
|
1515
|
+
return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} ${className}`, children: children }));
|
|
1516
|
+
});
|
|
1517
|
+
|
|
1518
|
+
const calculatorValueBlockStyle = 'flex justify-between md:mb-7 md:flex-col';
|
|
1519
|
+
const CalculatorValueBlock = JSX(({ title, value, postfix = '', prefix, className = '' }) => (jsxs("div", { className: style(calculatorValueBlockStyle, className), children: [title ? (jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: title })) : null, value ? (jsx("div", { children: jsxs(Text, { size: "text-h3", children: [prefix, " ", toLocalNumberFormat(2)(Math.round(value)), " ", postfix] }) })) : (jsx("div", { children: jsx(Text, { size: "text-h3", children: "-" }) }))] })));
|
|
1520
|
+
|
|
1521
|
+
const DEFAULT_MIN_SUM = 10000;
|
|
1522
|
+
const DEFAULT_MAX_SUM = 5000000;
|
|
1523
|
+
const CREDIT_DEFAULT_SUM = 200000;
|
|
1524
|
+
const REFINANCING_DEFAULT_SUM = 700000;
|
|
1525
|
+
const REFINANCING_DEFAULT_MAX_SUM = 3000000;
|
|
1526
|
+
const REFINANCING_OLD_MIN_SUM = 0;
|
|
1527
|
+
const REFINANCING_OLD_DEFAULT_SUM = 0;
|
|
1528
|
+
const REFINANCING_OLD_MAX_SUM = 2500000;
|
|
1529
|
+
const REFINANCING_EXTRA_MIN_SUM = 0;
|
|
1530
|
+
const REFINANCING_EXTRA_MAX_SUM = 500000;
|
|
1531
|
+
const DEPOSIT_DEFAULT_SUM = 20000;
|
|
1532
|
+
const DEFAULT_MIN_MONTHS = 13;
|
|
1533
|
+
const DEFAULT_REFINANCING_MIN_MONTHS = 13;
|
|
1534
|
+
const DEFAULT_REFINANCING_MONTHS = 48;
|
|
1535
|
+
const DEFAULT_MAX_MONTHS = 60;
|
|
1536
|
+
const DEFAULT_MONTHS = Math.round((DEFAULT_MAX_MONTHS - DEFAULT_MIN_MONTHS) / 2);
|
|
1537
|
+
const BUSINESS_DEFAULT_SUM = 100000;
|
|
1538
|
+
const BUSINESS_MIN_DAYS = 1;
|
|
1539
|
+
const BUSINESS_MAX_DAYS = 1095;
|
|
1540
|
+
const BUSINESS_RATE_MIN_DAYS = 30; // порог количества дней, при которых ставка не доступна
|
|
1541
|
+
const BUSINESS_OPERATING_MIN_DAYS = 90;
|
|
1542
|
+
const BUSINESS_OPERATING_MAX_DAYS = 730;
|
|
1543
|
+
const BUSINESS_DEFAULT_DAYS = 90;
|
|
1544
|
+
const MONTHS_IN_YEAR = 12;
|
|
1545
|
+
const MONTHLY_INTEREST_RATE = MONTHS_IN_YEAR * 100;
|
|
1546
|
+
const DEFAULT_CREDIT_CALCULATOR_PARAMS = {
|
|
1547
|
+
minSum: DEFAULT_MIN_SUM,
|
|
1548
|
+
maxSum: DEFAULT_MAX_SUM,
|
|
1549
|
+
minMonths: DEFAULT_MIN_MONTHS,
|
|
1550
|
+
maxMonths: DEFAULT_MAX_MONTHS,
|
|
1551
|
+
rate: 12.5,
|
|
1552
|
+
isSalaryClient: false,
|
|
1553
|
+
isPensionClient: false,
|
|
1554
|
+
isStateEmployee: false,
|
|
1555
|
+
isInsurance: true,
|
|
1556
|
+
};
|
|
1557
|
+
const DEFAULT_REFINANCING_CALCULATOR_PARAMS = {
|
|
1558
|
+
minSum: DEFAULT_MIN_SUM,
|
|
1559
|
+
maxSum: REFINANCING_DEFAULT_MAX_SUM,
|
|
1560
|
+
minSumOld: REFINANCING_OLD_MIN_SUM,
|
|
1561
|
+
maxSumOld: REFINANCING_OLD_MAX_SUM,
|
|
1562
|
+
minSumExtra: REFINANCING_EXTRA_MIN_SUM,
|
|
1563
|
+
maxSumExtra: REFINANCING_EXTRA_MAX_SUM,
|
|
1564
|
+
minMonths: DEFAULT_REFINANCING_MIN_MONTHS,
|
|
1565
|
+
maxMonths: DEFAULT_MAX_MONTHS,
|
|
1566
|
+
rate: 7.5,
|
|
1567
|
+
isExtraMoney: false,
|
|
1568
|
+
isSalaryClient: false,
|
|
1569
|
+
isInsurance: true,
|
|
1570
|
+
};
|
|
1571
|
+
const DEFAULT_TRAVEL_MIN_SUM = 6000;
|
|
1572
|
+
const DEFAULT_REST_MIN_SUM = 6000;
|
|
1573
|
+
const DEFAULT_BONUS_CALCULATOR_PARAMS = {
|
|
1574
|
+
minSumTravel: 6000,
|
|
1575
|
+
maxSumTravel: 200000,
|
|
1576
|
+
minSumOther: 6000,
|
|
1577
|
+
maxSumOther: 200000,
|
|
1578
|
+
maxBonus: 5000,
|
|
1579
|
+
prefMonthsNum: 2,
|
|
1580
|
+
prefTravelBonusRate: 0.015,
|
|
1581
|
+
prefRestBonusRate: 0.01,
|
|
1582
|
+
travelBonusRate: 0.015,
|
|
1583
|
+
restBonusRate: 0.01,
|
|
1584
|
+
};
|
|
1585
|
+
const DEFAULT_DEPOSIT_CALCULATOR_PARAMS = {
|
|
1586
|
+
minSum: 50000,
|
|
1587
|
+
maxSum: 5000000,
|
|
1588
|
+
minMonths: 2,
|
|
1589
|
+
maxMonths: 10,
|
|
1590
|
+
rate: 0,
|
|
1591
|
+
isMonthlyInterestPayment: true,
|
|
1592
|
+
isRemoteRegistration: true,
|
|
1593
|
+
};
|
|
1594
|
+
const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS = {
|
|
1595
|
+
minSum: 1000,
|
|
1596
|
+
maxSum: 500000,
|
|
1597
|
+
minDays: BUSINESS_MIN_DAYS,
|
|
1598
|
+
maxDays: BUSINESS_MAX_DAYS,
|
|
1599
|
+
rate: 0,
|
|
1600
|
+
isMonthlyInterestPayment: true,
|
|
1601
|
+
isReplenished: false,
|
|
1602
|
+
isPartialWithdrawal: false,
|
|
1603
|
+
isSmallBusiness: false,
|
|
1604
|
+
depositeName: "Депозит 'Стабильный'",
|
|
1605
|
+
};
|
|
1606
|
+
const CREDIT_CALC_DEFAULT_DIR = 'credit-calculator-data';
|
|
1607
|
+
const BONUS_CALC_DEFAULT_DIR = 'bonus-calculator-data';
|
|
1608
|
+
const DEPOSIT_CALC_DEFAULT_DIR = 'deposit-calculator-data';
|
|
1609
|
+
const BUSINESS_DEPOSIT_CALC_DEFAULT_DIR = 'business-calculator-data';
|
|
1610
|
+
const REFINANCING_CALC_DEFAULT_DIR = 'refinancing-calculator-data';
|
|
1611
|
+
|
|
1612
|
+
const Rate = JSX(({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, rateBlockClassName, fractionDigits = 2, }) => (jsxs("div", { children: [jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: title }), jsxs("div", { className: "relative", children: [jsxs("div", { className: "flex justify-start gradient-color-text", children: [jsx("span", { className: style('font-mohave text-title-huge pr-6 -mt-4', rateBlockClassName), children: String(rate.toFixed(fractionDigits)).replace('.', ',') }), unit ? jsx("span", { className: "text-7xl", children: unit }) : null] }), depositeName && isShowDepositeName ? (jsx("div", { className: "absolute bottom-7 w-full text-center whitespace-nowrap", children: depositeName })) : null] })] })));
|
|
1613
|
+
|
|
1614
|
+
const renderFootnote = (text) => text ? (jsx(Paragraph, { size: "text-s", font: "font-light", color: "text-secondary-text", children: text })) : null;
|
|
1615
|
+
|
|
1616
|
+
const DEFAULT_MONEY_STEP = 1000;
|
|
1617
|
+
function renderWantedSumInput({ isShowItems = true, step = DEFAULT_MONEY_STEP, ...rest }) {
|
|
1618
|
+
const items = [
|
|
1619
|
+
`От ${toLocalNumberFormat(2)(rest.min || 0)} ₽`,
|
|
1620
|
+
`До ${toLocalNumberFormat(2)(rest.max || 0)} ₽`,
|
|
1621
|
+
];
|
|
1622
|
+
return jsx(InputRange, { items: isShowItems ? items : [], step: step, ...rest });
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
const getBonus = (params, bonusTravelValue, bonusOtherValue) => {
|
|
1626
|
+
const { minSumTravel, minSumOther, maxBonus, prefMonthsNum, prefTravelBonusRate, prefRestBonusRate, travelBonusRate, restBonusRate, } = params;
|
|
1627
|
+
if (bonusTravelValue === minSumTravel && bonusOtherValue === minSumOther) {
|
|
1628
|
+
return [0, 0];
|
|
1629
|
+
}
|
|
1630
|
+
const prefBonus = Math.min(Math.round(prefTravelBonusRate * bonusTravelValue) +
|
|
1631
|
+
Math.round(prefRestBonusRate * bonusOtherValue), maxBonus);
|
|
1632
|
+
const bonus = Math.min(Math.round(travelBonusRate * bonusTravelValue) + Math.round(restBonusRate * bonusOtherValue), maxBonus);
|
|
1633
|
+
const yearBonus = prefBonus * prefMonthsNum + bonus * (MONTHS_IN_YEAR - prefMonthsNum);
|
|
1634
|
+
return [prefBonus, yearBonus];
|
|
1635
|
+
};
|
|
1636
|
+
|
|
1637
|
+
function useCalculatorParams(dir) {
|
|
1638
|
+
const { data } = useAsyncData(`/wcms-resources/${dir}.json`, fetchJSONUnsafe);
|
|
1639
|
+
return data;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
const useBonusCalculatorParams = (userInputParams, sourceBookDir) => {
|
|
1643
|
+
const { travelExpenseValue, restExpenseValue } = userInputParams;
|
|
1644
|
+
const bonusCalculatorSourceBookParams = useCalculatorParams(sourceBookDir || BONUS_CALC_DEFAULT_DIR) ||
|
|
1645
|
+
DEFAULT_BONUS_CALCULATOR_PARAMS;
|
|
1646
|
+
const [monthBonus, yearBonus] = getBonus(bonusCalculatorSourceBookParams, travelExpenseValue, restExpenseValue);
|
|
1647
|
+
return {
|
|
1648
|
+
...bonusCalculatorSourceBookParams,
|
|
1649
|
+
...userInputParams,
|
|
1650
|
+
monthBonus,
|
|
1651
|
+
yearBonus,
|
|
1652
|
+
};
|
|
1653
|
+
};
|
|
1654
|
+
|
|
1655
|
+
const BonusCalculatorForm = JSX(({ className = '', sourceBookDir = '', buttons, footnote }) => {
|
|
1656
|
+
const [userInputParams, { field }] = useForm({
|
|
1657
|
+
travelExpenseValue: DEFAULT_TRAVEL_MIN_SUM,
|
|
1658
|
+
restExpenseValue: DEFAULT_REST_MIN_SUM,
|
|
1659
|
+
});
|
|
1660
|
+
const { minSumTravel, maxSumTravel, minSumOther, maxSumOther, monthBonus, yearBonus } = useBonusCalculatorParams(userInputParams, sourceBookDir);
|
|
1661
|
+
return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-2/5", children: [renderWantedSumInput({
|
|
1662
|
+
title: 'Сумма покупок в категории путешествия, ₽',
|
|
1663
|
+
min: minSumTravel,
|
|
1664
|
+
max: maxSumTravel,
|
|
1665
|
+
step: 500,
|
|
1666
|
+
isShowItems: false,
|
|
1667
|
+
...field('travelExpenseValue'),
|
|
1668
|
+
}), renderWantedSumInput({
|
|
1669
|
+
title: 'Сумма покупок в остальных категориях, ₽',
|
|
1670
|
+
className: 'mt-7',
|
|
1671
|
+
min: minSumOther,
|
|
1672
|
+
max: maxSumOther,
|
|
1673
|
+
step: 500,
|
|
1674
|
+
isShowItems: false,
|
|
1675
|
+
...field('restExpenseValue'),
|
|
1676
|
+
})] }), jsx("div", { children: monthBonus >= 0 ? (jsx(Rate, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u043C\u0435\u0441\u044F\u0446", rate: monthBonus, rateBlockClassName: "tracking-[-14px]", fractionDigits: 0 })) : null }), jsxs("div", { className: "w-96", children: [yearBonus >= 0 ? jsx(CalculatorValueBlock, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u0433\u043E\u0434", value: yearBonus }) : null, renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
|
|
1677
|
+
});
|
|
1678
|
+
|
|
1679
|
+
const mergeIntervals = (intervals) => {
|
|
1680
|
+
const result = [...intervals];
|
|
1681
|
+
result.sort(([a], [c]) => a - c);
|
|
1682
|
+
let i = 1;
|
|
1683
|
+
while (i < result.length) {
|
|
1684
|
+
const [a, b] = result[i - 1];
|
|
1685
|
+
const [c, d] = result[i];
|
|
1686
|
+
if (b >= c) {
|
|
1687
|
+
result.splice(i - 1, 2, [a, Math.max(b, d)]);
|
|
1688
|
+
}
|
|
1689
|
+
else {
|
|
1690
|
+
i++;
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
return result;
|
|
1694
|
+
};
|
|
1695
|
+
|
|
1696
|
+
const getLimitRangeByKeys = ([minKey, maxKey], limitParams, rateRows = []) => limitParams && limitParams[minKey] && limitParams[maxKey]
|
|
1697
|
+
? {
|
|
1698
|
+
[minKey]: limitParams[minKey],
|
|
1699
|
+
[maxKey]: limitParams[maxKey],
|
|
1700
|
+
}
|
|
1701
|
+
: getRangeByKeys([minKey, maxKey], rateRows);
|
|
1702
|
+
const getRangeByKeys = ([minKey, maxKey], rows = []) => ({
|
|
1703
|
+
[minKey]: rows.length
|
|
1704
|
+
? min(rows.filter((row) => typeof row[minKey] === 'number').map((row) => row[minKey]))
|
|
1705
|
+
: 0,
|
|
1706
|
+
[maxKey]: rows.length
|
|
1707
|
+
? max(rows.filter((row) => typeof row[minKey] === 'number').map((row) => row[maxKey]))
|
|
1708
|
+
: 0,
|
|
1709
|
+
});
|
|
1710
|
+
const checkRangeByKeys = (value, [minKey, maxKey], sourceBookRow) => value >= sourceBookRow[minKey] && value <= sourceBookRow[maxKey];
|
|
1711
|
+
|
|
1712
|
+
const useBusinessDepositCalculatorParams = (userInputParams, sourceBookDir) => {
|
|
1713
|
+
const { daysValue, moneyValue, isPartialWithdrawal, isReplenished, isSmallBusiness, isMonthlyInterestPayment, } = userInputParams;
|
|
1714
|
+
const data = useCalculatorParams(sourceBookDir || BUSINESS_DEPOSIT_CALC_DEFAULT_DIR);
|
|
1715
|
+
const isOperatingDeposit = isReplenished || isPartialWithdrawal;
|
|
1716
|
+
const isDisabledOperatingDeposit = daysValue < BUSINESS_OPERATING_MIN_DAYS || daysValue > BUSINESS_OPERATING_MAX_DAYS;
|
|
1717
|
+
if (daysValue <= BUSINESS_RATE_MIN_DAYS) {
|
|
1718
|
+
return {
|
|
1719
|
+
...DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS,
|
|
1720
|
+
...userInputParams,
|
|
1721
|
+
isDisabledOperatingDeposit,
|
|
1722
|
+
isShowUnknownRate: true,
|
|
1723
|
+
};
|
|
1724
|
+
}
|
|
1725
|
+
const businessDepositCalculatorSourceBookParams = data?.rateRows?.find((_) => {
|
|
1726
|
+
return (isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
|
|
1727
|
+
isSmallBusiness === _.isSmallBusiness &&
|
|
1728
|
+
checkIsOperatingDeposit(isOperatingDeposit, _) &&
|
|
1729
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
1730
|
+
checkRangeByKeys(daysValue, ['minDays', 'maxDays'], _));
|
|
1731
|
+
}) || DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS;
|
|
1732
|
+
const { rate } = businessDepositCalculatorSourceBookParams;
|
|
1733
|
+
const income = getDepositIncome$1(rate, userInputParams);
|
|
1734
|
+
const finalSum = moneyValue + income;
|
|
1735
|
+
const sourceBookRows = data?.rateRows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
|
|
1736
|
+
return {
|
|
1737
|
+
...businessDepositCalculatorSourceBookParams,
|
|
1738
|
+
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
1739
|
+
...getRangeByKeys(['minDays', 'maxDays'], sourceBookRows),
|
|
1740
|
+
...userInputParams,
|
|
1741
|
+
isDisabledOperatingDeposit,
|
|
1742
|
+
income,
|
|
1743
|
+
finalSum,
|
|
1744
|
+
};
|
|
1745
|
+
};
|
|
1746
|
+
const checkIsOperatingDeposit = (isOperatingDeposit, sourceBookRow) => isOperatingDeposit
|
|
1747
|
+
? sourceBookRow.isReplenished && sourceBookRow.isPartialWithdrawal
|
|
1748
|
+
: !sourceBookRow.isReplenished && !sourceBookRow.isPartialWithdrawal;
|
|
1749
|
+
const getDepositIncome$1 = (rate, userInputParams) => {
|
|
1750
|
+
const { isMonthlyInterestPayment, moneyValue, daysValue } = userInputParams;
|
|
1751
|
+
/*
|
|
1752
|
+
Приблизительный расчёт, не учитывающий разницу в количестве дней в месяцах. Месяц принят за 30 дней, год за 365 дней.
|
|
1753
|
+
*/
|
|
1754
|
+
if (isMonthlyInterestPayment) {
|
|
1755
|
+
return Math.round(moneyValue * Math.pow((1200 + rate) / 1200, daysValue / 30) - moneyValue);
|
|
1756
|
+
}
|
|
1757
|
+
else {
|
|
1758
|
+
return Math.round((moneyValue * rate * daysValue) / 365 / 100);
|
|
1759
|
+
}
|
|
1760
|
+
};
|
|
1761
|
+
|
|
1762
|
+
const STEP_DAYS = 1;
|
|
1763
|
+
const renderDaysInput = (props) => (jsx(InputRange, { items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
|
|
1764
|
+
const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
|
|
1765
|
+
|
|
1766
|
+
const orientationStyleMap = {
|
|
1767
|
+
horizontal: 'gap-10',
|
|
1768
|
+
vertical: 'flex-col gap-3',
|
|
1769
|
+
};
|
|
1770
|
+
const RadioButtonGroup = JSX(({ items, checkedItem, className, onChange: onChangeCheckedItem, orientation = 'horizontal', }) => (jsx("div", { className: style(`flex ${orientationStyleMap[orientation]}`, className), children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: checkedItem === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id) }, String(id)))) })));
|
|
1771
|
+
|
|
1772
|
+
const renderBinaryRadioButtonGroup = ({ items, title, orientation = 'horizontal', value, radioGroupClassName, onChange, }) => (jsxs("div", { children: [title ? (jsx("div", { className: "mb-3", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items, checkedItem: items[value ? 0 : 1].id, className: style('flex-col sm:flex-row', radioGroupClassName), onChange: (_) => onChange && onChange(_ === items[0].id) })] }));
|
|
1773
|
+
|
|
1774
|
+
const renderInterestPayment = (props) => renderBinaryRadioButtonGroup({
|
|
1775
|
+
...props,
|
|
1776
|
+
items: [
|
|
1777
|
+
{ id: 'everyMonth', text: 'Ежемесячно' },
|
|
1778
|
+
{ id: 'atEndTerm', text: 'В конце срока' },
|
|
1779
|
+
],
|
|
1780
|
+
});
|
|
1781
|
+
|
|
1782
|
+
const UnknownRate = JSX(({ title = 'Ставка' }) => (jsxs("div", { children: [jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: title }), jsx("div", { className: "mt-2xs pt-2xs pl-lg pb-xs", children: jsx(Icon, { name: "PercentIcon", width: "90", height: "85" }) }), jsx("div", { className: "w-64 mt-m", children: jsxs(Paragraph, { size: "text-xl", font: "font-light", color: "text-primary-text", children: ["\u041F\u0440\u043E\u0446\u0435\u043D\u0442\u043D\u0430\u044F \u0441\u0442\u0430\u0432\u043A\u0430 \u0434\u043B\u044F \u0441\u0440\u043E\u043A\u0430 ", jsx("strong", { children: "1-30 \u0434\u043D\u0435\u0439" }), " \u0443\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0438 \u0432 \u0411\u0430\u043D\u043A"] }) })] })));
|
|
1783
|
+
|
|
1784
|
+
const renderDesktopRate = ({ rate, depositeName, isShowDepositeName }) => (jsx(Rate, { rate: rate, depositeName: depositeName, isShowDepositeName: isShowDepositeName, rateBlockClassName: "tracking-[-25px]", unit: "%" }));
|
|
1785
|
+
const renderMobileRate = ({ rate }) => (jsx(CalculatorValueBlock, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", value: rate, postfix: "%" }));
|
|
1786
|
+
const renderRate = (props) => {
|
|
1787
|
+
if (props.isShowUnknownRate) {
|
|
1788
|
+
return jsx(UnknownRate, {});
|
|
1789
|
+
}
|
|
1790
|
+
return (jsxs("div", { children: [jsx("div", { className: "hidden md:block", children: renderDesktopRate(props) }), jsx("div", { className: "md:hidden", children: renderMobileRate(props) })] }));
|
|
1791
|
+
};
|
|
1792
|
+
|
|
1793
|
+
const BusinessDepositCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote, bottomFootnote, isShowDepositeName }) => {
|
|
1794
|
+
const [userInputParams, { field }] = useForm({
|
|
1795
|
+
moneyValue: BUSINESS_DEFAULT_SUM,
|
|
1796
|
+
daysValue: BUSINESS_DEFAULT_DAYS,
|
|
1797
|
+
isReplenished: false,
|
|
1798
|
+
isPartialWithdrawal: false,
|
|
1799
|
+
isSmallBusiness: false,
|
|
1800
|
+
isMonthlyInterestPayment: false,
|
|
1801
|
+
});
|
|
1802
|
+
const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, sourceBookDir);
|
|
1803
|
+
const { income, finalSum, rate, isShowUnknownRate, depositeName } = calculatorParams;
|
|
1804
|
+
return (jsxs("section", { className: className, children: [jsxs("div", { className: "flex flex-col justify-between sm:flex-row", children: [jsxs("div", { className: "flex flex-col gap-y-m sm:w-2/5 sm:gap-y-lg", children: [renderWantedSumInput({
|
|
1805
|
+
title: 'Сумма, ₽',
|
|
1806
|
+
min: calculatorParams.minSum,
|
|
1807
|
+
max: calculatorParams.maxSum,
|
|
1808
|
+
...field('moneyValue'),
|
|
1809
|
+
value: calculatorParams.moneyValue,
|
|
1810
|
+
}), renderDaysInput({
|
|
1811
|
+
title: 'Срок, дней',
|
|
1812
|
+
min: calculatorParams.minDays,
|
|
1813
|
+
max: calculatorParams.maxDays,
|
|
1814
|
+
...field('daysValue'),
|
|
1815
|
+
value: calculatorParams.daysValue,
|
|
1816
|
+
}), jsxs("div", { className: "flex flex-col gap-xl justify-between sm:flex-row sm:gap-0", children: [renderBusinessDepositParamsForm(calculatorParams, field), renderInterestPayment({
|
|
1817
|
+
title: 'Выплата процентов',
|
|
1818
|
+
orientation: 'vertical',
|
|
1819
|
+
...field('isMonthlyInterestPayment'),
|
|
1820
|
+
radioGroupClassName: 'sm:flex-col',
|
|
1821
|
+
})] })] }), jsx("div", { className: "border-b border-main-divider my-xl sm:hidden" }), renderRate({
|
|
1822
|
+
rate,
|
|
1823
|
+
depositeName,
|
|
1824
|
+
isShowDepositeName,
|
|
1825
|
+
isShowUnknownRate,
|
|
1826
|
+
}), jsxs("div", { className: "flex flex-col gap-y-xl mt-3xl sm:gap-0 sm:w-96 sm:mt-0", children: [renderDepositResults(finalSum, income), renderButtonsSection(buttons, { isVertical: true }), jsx("div", { className: "sm:mt-2xl", children: renderFootnote(footnote) })] })] }), jsx("div", { className: "mt-lg", children: renderFootnote(bottomFootnote) })] }));
|
|
1827
|
+
});
|
|
1828
|
+
const renderBusinessDepositParamsForm = (calculatorParams, field) => (jsxs("div", { className: "flex flex-col gap-y-xl sm:gap-y-s", children: [jsx(Checkbox, { text: "\u041F\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435", disabled: calculatorParams.isDisabledOperatingDeposit, ...field('isReplenished'), value: calculatorParams.isReplenished }), jsx(Checkbox, { disabled: calculatorParams.isDisabledOperatingDeposit, text: "\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u043E\u0435 \u0441\u043D\u044F\u0442\u0438\u0435", ...field('isPartialWithdrawal'), value: calculatorParams.isPartialWithdrawal }), jsx(Checkbox, { text: "\u0418\u041F / \u043C\u0430\u043B\u043E\u0435 \u043F\u0440\u0435\u0434\u043F\u0440\u0438\u044F\u0442\u0438\u0435", ...field('isSmallBusiness'), value: calculatorParams.isSmallBusiness })] }));
|
|
1829
|
+
const renderDepositResults = (finalSum, income) => (jsxs("div", { className: "flex flex-col gap-2xl sm:gap-0", children: [jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", 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: finalSum, postfix: "\u20BD" })] }));
|
|
1830
|
+
|
|
1831
|
+
const STEP_MONTHS = 1;
|
|
1832
|
+
const renderMonthsInput = ({ min = 0, max = 0, availableMonths, ...rest }) => (jsx(InputRange, { items: [`От ${monthText(min)}`, `До ${monthText(max)}`], step: STEP_MONTHS, ...(availableMonths?.length ? { list: availableMonths } : { min, max }), ...rest }));
|
|
1833
|
+
const monthText = (month) => `${month} ${Number(month) % 10 === 1 ? 'месяца' : 'месяцев'}`;
|
|
1834
|
+
|
|
1835
|
+
const checkCreditSourceBookRowCommonParams = (props) => checkRowParam$1({
|
|
1836
|
+
...props,
|
|
1837
|
+
fieldKey: 'isSalaryClient',
|
|
1838
|
+
viewSettingFieldKey: 'isShowSalaryClient',
|
|
1839
|
+
}) &&
|
|
1840
|
+
checkRowParam$1({
|
|
1841
|
+
...props,
|
|
1842
|
+
fieldKey: 'isStateEmployee',
|
|
1843
|
+
viewSettingFieldKey: 'isShowStateEmployee',
|
|
1844
|
+
}) &&
|
|
1845
|
+
checkRowParam$1({
|
|
1846
|
+
...props,
|
|
1847
|
+
fieldKey: 'isPensionClient',
|
|
1848
|
+
viewSettingFieldKey: 'isShowPensionClient',
|
|
1849
|
+
}) &&
|
|
1850
|
+
checkRowParam$1({
|
|
1851
|
+
...props,
|
|
1852
|
+
fieldKey: 'isInsurance',
|
|
1853
|
+
viewSettingFieldKey: 'isShowInsurance',
|
|
1854
|
+
});
|
|
1855
|
+
const checkRowParam$1 = ({ row, userInputParams, paramsViewSettings, fieldKey, viewSettingFieldKey, }) => {
|
|
1856
|
+
const isExclude = paramsViewSettings ? !paramsViewSettings[viewSettingFieldKey] : false;
|
|
1857
|
+
return isExclude || userInputParams[fieldKey] === row[fieldKey];
|
|
1858
|
+
};
|
|
1859
|
+
|
|
1860
|
+
const getCreditCalculatorLimitParams = ({ limitRows, userInputParams, paramsViewSettings, }) => limitRows?.find((row) => checkCreditSourceBookRowCommonParams({
|
|
1861
|
+
row,
|
|
1862
|
+
userInputParams,
|
|
1863
|
+
paramsViewSettings,
|
|
1864
|
+
}));
|
|
1865
|
+
|
|
1866
|
+
const getCreditCalculatorRateParams = ({ rateRows = [], userInputParams, paramsViewSettings, moneyValue, monthsValue, }) => rateRows?.find((row) => checkCreditSourceBookRowCommonParams({
|
|
1867
|
+
row,
|
|
1868
|
+
userInputParams,
|
|
1869
|
+
paramsViewSettings,
|
|
1870
|
+
}) &&
|
|
1871
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
|
|
1872
|
+
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], row)) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* Формулы расчёта аннуитетных и дифференцированных платежей:
|
|
1876
|
+
* https://finuslugi.ru/potrebitelskie_kredity/stat_annuitetnye_i_differentsirovannye_platezhi
|
|
1877
|
+
*/
|
|
1878
|
+
const getMonthlyPayment = (rate, params) => {
|
|
1879
|
+
const { isAnnuity, moneyValue, monthsValue, moneyExtra } = params;
|
|
1880
|
+
if (rate === 0) {
|
|
1881
|
+
return 0;
|
|
1882
|
+
}
|
|
1883
|
+
else if (isAnnuity) {
|
|
1884
|
+
const i = rate / MONTHLY_INTEREST_RATE; // Используется значение ставки в процентах
|
|
1885
|
+
if (moneyExtra) {
|
|
1886
|
+
return (moneyValue + moneyExtra) * (i + i / (Math.pow(1 + i, monthsValue) - 1));
|
|
1887
|
+
}
|
|
1888
|
+
else {
|
|
1889
|
+
return moneyValue * (i + i / (Math.pow(1 + i, monthsValue) - 1));
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
else {
|
|
1893
|
+
return Math.round(moneyValue / monthsValue) + moneyValue * (rate / (MONTHS_IN_YEAR * 100)); // Используется значение ставки (rate) в процентах, делённое на сто.
|
|
1894
|
+
}
|
|
1895
|
+
};
|
|
1896
|
+
|
|
1897
|
+
const useCreditCalculatorParams = (userInputParams, sourceBookDir, paramsViewSettings) => {
|
|
1898
|
+
let { moneyValue, monthsValue } = userInputParams;
|
|
1899
|
+
const data = useCalculatorParams(sourceBookDir || CREDIT_CALC_DEFAULT_DIR);
|
|
1900
|
+
const rateRows = data?.rateRows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
|
|
1901
|
+
const limitRows = data?.limitRows || [];
|
|
1902
|
+
const creditCalculatorSourceBookLimitParams = getCreditCalculatorLimitParams({
|
|
1903
|
+
limitRows,
|
|
1904
|
+
userInputParams,
|
|
1905
|
+
paramsViewSettings,
|
|
1906
|
+
});
|
|
1907
|
+
const { minSum, maxSum } = getLimitRangeByKeys(['minSum', 'maxSum'], creditCalculatorSourceBookLimitParams, rateRows);
|
|
1908
|
+
const { minMonths, maxMonths } = getLimitRangeByKeys(['minMonths', 'maxMonths'], creditCalculatorSourceBookLimitParams, rateRows);
|
|
1909
|
+
moneyValue = clamp(moneyValue, minSum, maxSum);
|
|
1910
|
+
monthsValue = clamp(monthsValue, minMonths, maxMonths);
|
|
1911
|
+
const creditCalculatorRateParams = getCreditCalculatorRateParams({
|
|
1912
|
+
rateRows,
|
|
1913
|
+
userInputParams,
|
|
1914
|
+
paramsViewSettings,
|
|
1915
|
+
moneyValue,
|
|
1916
|
+
monthsValue,
|
|
1917
|
+
});
|
|
1918
|
+
const { rate } = creditCalculatorRateParams;
|
|
1919
|
+
const monthlyPayment = getMonthlyPayment(rate, userInputParams);
|
|
1920
|
+
return useMemo(() => ({
|
|
1921
|
+
...creditCalculatorRateParams,
|
|
1922
|
+
...userInputParams,
|
|
1923
|
+
minSum,
|
|
1924
|
+
maxSum,
|
|
1925
|
+
minMonths,
|
|
1926
|
+
maxMonths,
|
|
1927
|
+
moneyValue,
|
|
1928
|
+
monthsValue,
|
|
1929
|
+
monthlyPayment,
|
|
1930
|
+
}), [userInputParams, data]);
|
|
1931
|
+
};
|
|
1932
|
+
|
|
1933
|
+
const renderPaymentType = (props) => renderBinaryRadioButtonGroup({
|
|
1934
|
+
...props,
|
|
1935
|
+
radioGroupClassName: 'sm:flex-col',
|
|
1936
|
+
items: [
|
|
1937
|
+
{ id: 'annuity', text: 'Аннуитетный' },
|
|
1938
|
+
{ id: 'differential', text: 'Дифференцированный' },
|
|
1939
|
+
],
|
|
1940
|
+
});
|
|
1941
|
+
|
|
1942
|
+
const CreditCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings, isMobile }) => {
|
|
1943
|
+
const [userInputParams, { field }] = useForm({
|
|
1944
|
+
isAnnuity: true,
|
|
1945
|
+
isInsurance: true,
|
|
1946
|
+
isSalaryClient: false,
|
|
1947
|
+
isPensionClient: false,
|
|
1948
|
+
isStateEmployee: false,
|
|
1949
|
+
moneyValue: CREDIT_DEFAULT_SUM,
|
|
1950
|
+
monthsValue: DEFAULT_MONTHS,
|
|
1951
|
+
});
|
|
1952
|
+
const calculatorParams = useCreditCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
|
|
1953
|
+
const paymentTypeElement = renderPaymentType({
|
|
1954
|
+
title: isMobile ? 'Тип платежа' : '',
|
|
1955
|
+
orientation: 'vertical',
|
|
1956
|
+
...field('isAnnuity'),
|
|
1957
|
+
});
|
|
1958
|
+
return (jsxs("section", { className: style('flex flex-col justify-between sm:flex-row', className), children: [jsxs("div", { className: "flex flex-col gap-y-m sm:w-2/5 sm:gap-y-lg", children: [renderWantedSumInput({
|
|
1959
|
+
title: 'Сумма кредита, ₽',
|
|
1960
|
+
step: 500,
|
|
1961
|
+
min: calculatorParams.minSum,
|
|
1962
|
+
max: calculatorParams.maxSum,
|
|
1963
|
+
...field('moneyValue'),
|
|
1964
|
+
value: calculatorParams.moneyValue,
|
|
1965
|
+
}), renderMonthsInput({
|
|
1966
|
+
title: 'Срок кредита, месяцев',
|
|
1967
|
+
min: calculatorParams.minMonths,
|
|
1968
|
+
max: calculatorParams.maxMonths,
|
|
1969
|
+
...field('monthsValue'),
|
|
1970
|
+
value: calculatorParams.monthsValue,
|
|
1971
|
+
}), renderCreditParamsForm$1({ ...calculatorParams, ...paramsViewSettings }, field), jsx("div", { className: "mt-s sm:hidden", children: paymentTypeElement })] }), jsx("div", { className: "border-b border-main-divider mt-xl mb-3xl sm:hidden" }), renderRate({
|
|
1972
|
+
rate: calculatorParams.rate,
|
|
1973
|
+
}), jsxs("div", { className: "mt-6xl flex flex-col gap-lg sm:w-96 sm:mt-0 sm:gap-0", children: [jsx(CalculatorValueBlock, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0435\u0436", value: calculatorParams.monthlyPayment, postfix: "\u20BD" }), jsx("div", { className: "hidden sm:block", children: paymentTypeElement }), renderButtonsSection(buttons, { className: 'mt-2xl', isVertical: true }), renderFootnote(footnote)] })] }));
|
|
1974
|
+
});
|
|
1975
|
+
const renderCreditParamsForm$1 = (params, field) => (jsxs("div", { className: "gap-xl flex flex-col sm:gap-s", children: [params.isShowSalaryClient ? (jsx(Checkbox, { text: `Получаю зарплату на счёт\nв Россельхозбанке`, ...field('isSalaryClient'), value: params.isSalaryClient, className: "whitespace-pre-line sm:whitespace-normal" })) : null, params.isShowStateEmployee ? (jsx(Checkbox, { 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", ...field('isStateEmployee'), value: params.isStateEmployee })) : null, params.isShowPensionClient ? (jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", ...field('isPensionClient'), value: params.isPensionClient })) : null, params.isShowInsurance ? (jsx(Checkbox, { 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", ...field('isInsurance'), value: params.isInsurance })) : null] }));
|
|
1976
|
+
|
|
1977
|
+
const arrayByRange = (start, stop, step = 1) => Array.from({ length: Math.abs(stop - start) / step + 1 }, (value, index) => stop >= start ? start + index * step : start - index * step);
|
|
1978
|
+
|
|
1979
|
+
const useDepositCalculatorParams = (userInputParams, sourceBookDir, paramsViewSettings) => {
|
|
1980
|
+
const { moneyValue, monthsValue } = userInputParams;
|
|
1981
|
+
const data = useCalculatorParams(sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR);
|
|
1982
|
+
const defaultMonth = data?.rateRows?.[0]
|
|
1983
|
+
? getMiddleMonth(data.rateRows[0].minMonths, data.rateRows[0].maxMonths)
|
|
1984
|
+
: 1;
|
|
1985
|
+
const isExcludeMonthlyInterestPayment = !paramsViewSettings?.isShowMonthlyInterestPayment;
|
|
1986
|
+
const isExcludeRemoteRegistration = !paramsViewSettings?.isShowRemoteRegistration;
|
|
1987
|
+
const depositCalculatorSourceBookParams = data?.rateRows?.find((row) => checkRowByParam({
|
|
1988
|
+
row,
|
|
1989
|
+
userInputParams,
|
|
1990
|
+
paramKey: 'isMonthlyInterestPayment',
|
|
1991
|
+
isExclude: isExcludeMonthlyInterestPayment,
|
|
1992
|
+
}) &&
|
|
1993
|
+
checkRowByParam({
|
|
1994
|
+
row,
|
|
1995
|
+
userInputParams,
|
|
1996
|
+
paramKey: 'isRemoteRegistration',
|
|
1997
|
+
isExclude: isExcludeRemoteRegistration,
|
|
1998
|
+
}) &&
|
|
1999
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
|
|
2000
|
+
checkRangeByKeys(monthsValue || defaultMonth, ['minMonths', 'maxMonths'], row)) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
|
|
2001
|
+
const { rate } = depositCalculatorSourceBookParams;
|
|
2002
|
+
const income = getDepositIncome(rate, userInputParams);
|
|
2003
|
+
const finalSum = moneyValue + income;
|
|
2004
|
+
const sourceBookRows = data?.rateRows || [DEFAULT_DEPOSIT_CALCULATOR_PARAMS];
|
|
2005
|
+
return {
|
|
2006
|
+
...depositCalculatorSourceBookParams,
|
|
2007
|
+
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
2008
|
+
...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
|
|
2009
|
+
availableMonths: mergeIntervals(sourceBookRows.map((row) => [row['minMonths'], row['maxMonths']])).flatMap(([start, end]) => arrayByRange(start, end)),
|
|
2010
|
+
...userInputParams,
|
|
2011
|
+
defaultMonth,
|
|
2012
|
+
income,
|
|
2013
|
+
finalSum,
|
|
2014
|
+
};
|
|
2015
|
+
};
|
|
2016
|
+
const getDepositIncome = (rate, userInputParams) => {
|
|
2017
|
+
const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
|
|
2018
|
+
if (isMonthlyInterestPayment) {
|
|
2019
|
+
return Math.round(moneyValue * Math.pow((1200 + rate) / 1200, monthsValue) - moneyValue);
|
|
2020
|
+
}
|
|
2021
|
+
else {
|
|
2022
|
+
/*
|
|
2023
|
+
Приблизительный расчёт, не учитывающий разницу в количестве дней в месяцах. Месяц принят за 30 дней, год за 365 дней.
|
|
2024
|
+
*/
|
|
2025
|
+
return Math.round((moneyValue * rate * 30 * monthsValue) / 365 / 100);
|
|
2026
|
+
}
|
|
2027
|
+
};
|
|
2028
|
+
const checkRowByParam = ({ row, userInputParams, paramKey, isExclude }) => isExclude || userInputParams[paramKey] === row[paramKey];
|
|
2029
|
+
const getMiddleMonth = (minMonths, maxMonths) => minMonths + Math.round((maxMonths - minMonths) / 2);
|
|
2030
|
+
|
|
2031
|
+
const renderRegistrationType = (props) => renderBinaryRadioButtonGroup({
|
|
2032
|
+
...props,
|
|
2033
|
+
items: [
|
|
2034
|
+
{ id: 'remote', text: 'Дистанционно' },
|
|
2035
|
+
{ id: 'office', text: 'Офис Банка' },
|
|
2036
|
+
],
|
|
2037
|
+
});
|
|
2038
|
+
|
|
2039
|
+
const DepositCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
2040
|
+
const [userInputParams, { field }] = useForm({
|
|
2041
|
+
moneyValue: DEPOSIT_DEFAULT_SUM,
|
|
2042
|
+
monthsValue: 0,
|
|
2043
|
+
isMonthlyInterestPayment: false,
|
|
2044
|
+
isRemoteRegistration: false,
|
|
2045
|
+
});
|
|
2046
|
+
const calculatorParams = useDepositCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
|
|
2047
|
+
const { defaultMonth, rate, income, finalSum } = calculatorParams;
|
|
2048
|
+
const { onChange: setMonthsValue } = field('monthsValue');
|
|
2049
|
+
useEffect(() => {
|
|
2050
|
+
setMonthsValue && setMonthsValue(defaultMonth);
|
|
2051
|
+
}, [defaultMonth]);
|
|
2052
|
+
return (jsxs("section", { className: style('flex flex-col justify-between sm:flex-row', className), children: [jsxs("div", { className: "flex flex-col gap-lg sm:w-2/5", children: [renderWantedSumInput({
|
|
2053
|
+
title: 'Сумма, ₽',
|
|
2054
|
+
min: calculatorParams.minSum,
|
|
2055
|
+
max: calculatorParams.maxSum,
|
|
2056
|
+
...field('moneyValue'),
|
|
2057
|
+
value: calculatorParams.moneyValue,
|
|
2058
|
+
}), renderMonthsInput({
|
|
2059
|
+
title: 'Срок, месяцев',
|
|
2060
|
+
min: calculatorParams.minMonths,
|
|
2061
|
+
max: calculatorParams.maxMonths,
|
|
2062
|
+
availableMonths: calculatorParams.availableMonths,
|
|
2063
|
+
...field('monthsValue'),
|
|
2064
|
+
value: calculatorParams.monthsValue,
|
|
2065
|
+
}), jsx("div", { className: "flex flex-col gap-y-2xl", children: renderDepositParamsForm({ ...calculatorParams, ...paramsViewSettings }, field) })] }), jsx("div", { className: "border-b border-main-divider mt-lg mb-2xl md:hidden" }), renderRate({
|
|
2066
|
+
rate,
|
|
2067
|
+
}), jsxs("div", { className: "mt-2xl flex flex-col gap-y-2xl sm:w-96 sm:gap-y-0 sm:mt-0", children: [jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", 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: finalSum, postfix: "\u20BD" }), renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }));
|
|
2068
|
+
});
|
|
2069
|
+
const renderDepositParamsForm = (params, field) => (jsxs("div", { className: "flex flex-col gap-y-2xl", children: [params.isShowMonthlyInterestPayment
|
|
2070
|
+
? renderInterestPayment({
|
|
2071
|
+
title: 'Выплата процентов',
|
|
2072
|
+
...field('isMonthlyInterestPayment'),
|
|
2073
|
+
value: params.isMonthlyInterestPayment,
|
|
2074
|
+
})
|
|
2075
|
+
: null, params.isShowRemoteRegistration
|
|
2076
|
+
? renderRegistrationType({
|
|
2077
|
+
title: 'Оформление',
|
|
2078
|
+
...field('isRemoteRegistration'),
|
|
2079
|
+
value: params.isRemoteRegistration,
|
|
2080
|
+
})
|
|
2081
|
+
: null] }));
|
|
2082
|
+
|
|
2083
|
+
const checkRefinancingSourceBookRowCommonParams = (props) => checkRowParam({
|
|
2084
|
+
...props,
|
|
2085
|
+
fieldKey: 'isSalaryClient',
|
|
2086
|
+
viewSettingFieldKey: 'isShowSalaryClient',
|
|
2087
|
+
}) &&
|
|
2088
|
+
checkRowParam({
|
|
2089
|
+
...props,
|
|
2090
|
+
fieldKey: 'isInsurance',
|
|
2091
|
+
viewSettingFieldKey: 'isShowInsurance',
|
|
2092
|
+
}) &&
|
|
2093
|
+
checkRowParam({
|
|
2094
|
+
...props,
|
|
2095
|
+
fieldKey: 'isExtraMoney',
|
|
2096
|
+
viewSettingFieldKey: 'isShowExtraMoney',
|
|
2097
|
+
});
|
|
2098
|
+
const checkRowParam = ({ row, userInputParams, paramsViewSettings, fieldKey, viewSettingFieldKey, }) => {
|
|
2099
|
+
const isExclude = paramsViewSettings ? !paramsViewSettings[viewSettingFieldKey] : false;
|
|
2100
|
+
return isExclude || userInputParams[fieldKey] === row[fieldKey];
|
|
2101
|
+
};
|
|
2102
|
+
|
|
2103
|
+
const getRefinancingCalculatorLimitParams = ({ limitRows, userInputParams, paramsViewSettings, }) => limitRows?.find((row) => checkRefinancingSourceBookRowCommonParams({
|
|
2104
|
+
row,
|
|
2105
|
+
userInputParams,
|
|
2106
|
+
paramsViewSettings,
|
|
2107
|
+
}));
|
|
2108
|
+
|
|
2109
|
+
const getRefinancingCalculatorRateParams = ({ rateRows = [], userInputParams, paramsViewSettings, moneyValue, monthsValue, oldMonthlyPayment, moneyExtra, }) => rateRows?.find((row) => checkRefinancingSourceBookRowCommonParams({
|
|
2110
|
+
row,
|
|
2111
|
+
userInputParams,
|
|
2112
|
+
paramsViewSettings,
|
|
2113
|
+
}) &&
|
|
2114
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
|
|
2115
|
+
checkRangeByKeys(oldMonthlyPayment, ['minSumOld', 'maxSumOld'], row) &&
|
|
2116
|
+
checkRangeByKeys(moneyExtra, ['minSumExtra', 'maxSumExtra'], row) &&
|
|
2117
|
+
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], row)) || DEFAULT_REFINANCING_CALCULATOR_PARAMS;
|
|
2118
|
+
|
|
2119
|
+
const useRefinancingCalculatorParams = (userInputParams, sourceBookDir, paramsViewSettings) => {
|
|
2120
|
+
let { moneyValue, monthsValue, oldMonthlyPayment, moneyExtra } = userInputParams;
|
|
2121
|
+
const data = useCalculatorParams(sourceBookDir || REFINANCING_CALC_DEFAULT_DIR);
|
|
2122
|
+
const rateRows = data?.rateRows || [DEFAULT_REFINANCING_CALCULATOR_PARAMS];
|
|
2123
|
+
const limitRows = data?.limitRows || [];
|
|
2124
|
+
const sourceBookLimitParams = getRefinancingCalculatorLimitParams({
|
|
2125
|
+
limitRows,
|
|
2126
|
+
userInputParams,
|
|
2127
|
+
paramsViewSettings,
|
|
2128
|
+
});
|
|
2129
|
+
const { minSum, maxSum } = getLimitRangeByKeys(['minSum', 'maxSum'], sourceBookLimitParams, rateRows);
|
|
2130
|
+
const { minSumOld, maxSumOld } = getLimitRangeByKeys(['minSumOld', 'maxSumOld'], sourceBookLimitParams, rateRows);
|
|
2131
|
+
const { minSumExtra, maxSumExtra } = getLimitRangeByKeys(['minSumExtra', 'maxSumExtra'], sourceBookLimitParams, rateRows);
|
|
2132
|
+
const { minMonths, maxMonths } = getLimitRangeByKeys(['minMonths', 'maxMonths'], sourceBookLimitParams, rateRows);
|
|
2133
|
+
moneyValue = clamp(moneyValue, minSum, maxSum);
|
|
2134
|
+
oldMonthlyPayment = clamp(oldMonthlyPayment, minSumOld, maxSumOld);
|
|
2135
|
+
moneyExtra = clamp(moneyExtra, minSumExtra, maxSumExtra);
|
|
2136
|
+
monthsValue = clamp(monthsValue, minMonths, maxMonths);
|
|
2137
|
+
const refinancingCalculatorSourceBookRateParams = getRefinancingCalculatorRateParams({
|
|
2138
|
+
rateRows,
|
|
2139
|
+
userInputParams,
|
|
2140
|
+
paramsViewSettings,
|
|
2141
|
+
moneyValue,
|
|
2142
|
+
monthsValue,
|
|
2143
|
+
oldMonthlyPayment,
|
|
2144
|
+
moneyExtra,
|
|
2145
|
+
});
|
|
2146
|
+
const { rate } = refinancingCalculatorSourceBookRateParams;
|
|
2147
|
+
const monthlyPayment = getMonthlyPayment(rate, userInputParams);
|
|
2148
|
+
const benefit = userInputParams.oldMonthlyPayment - monthlyPayment;
|
|
2149
|
+
return useMemo(() => ({
|
|
2150
|
+
...refinancingCalculatorSourceBookRateParams,
|
|
2151
|
+
...userInputParams,
|
|
2152
|
+
minSum,
|
|
2153
|
+
maxSum,
|
|
2154
|
+
minMonths,
|
|
2155
|
+
maxMonths,
|
|
2156
|
+
moneyValue,
|
|
2157
|
+
monthsValue,
|
|
2158
|
+
oldMonthlyPayment,
|
|
2159
|
+
moneyExtra,
|
|
2160
|
+
monthlyPayment,
|
|
2161
|
+
benefit,
|
|
2162
|
+
}), [userInputParams, data]);
|
|
2163
|
+
};
|
|
2164
|
+
|
|
2165
|
+
const RefinancingCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
2166
|
+
const [userInputParams, { field }] = useForm({
|
|
2167
|
+
isAnnuity: true,
|
|
2168
|
+
isInsurance: true,
|
|
2169
|
+
isSalaryClient: false,
|
|
2170
|
+
isExtraMoney: false,
|
|
2171
|
+
moneyValue: REFINANCING_DEFAULT_SUM,
|
|
2172
|
+
oldMonthlyPayment: REFINANCING_OLD_DEFAULT_SUM,
|
|
2173
|
+
monthsValue: DEFAULT_REFINANCING_MONTHS,
|
|
2174
|
+
moneyExtra: REFINANCING_OLD_DEFAULT_SUM,
|
|
2175
|
+
});
|
|
2176
|
+
const calculatorParams = useRefinancingCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
|
|
2177
|
+
return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-2/5", children: [renderWantedSumInput({
|
|
2178
|
+
title: 'Остаток долга в других банках, ₽ ',
|
|
2179
|
+
step: 500,
|
|
2180
|
+
min: calculatorParams.minSum,
|
|
2181
|
+
max: calculatorParams.maxSum,
|
|
2182
|
+
...field('moneyValue'),
|
|
2183
|
+
value: calculatorParams.moneyValue,
|
|
2184
|
+
}), renderWantedSumInput({
|
|
2185
|
+
title: 'Ежемесячный платеж в других банках, ₽',
|
|
2186
|
+
isShowItems: false,
|
|
2187
|
+
step: 500,
|
|
2188
|
+
min: calculatorParams.minSumOld,
|
|
2189
|
+
max: calculatorParams.maxSumOld,
|
|
2190
|
+
...field('oldMonthlyPayment'),
|
|
2191
|
+
value: calculatorParams.oldMonthlyPayment,
|
|
2192
|
+
}), renderMonthsInput({
|
|
2193
|
+
title: 'Новый срок кредита, месяцев',
|
|
2194
|
+
min: calculatorParams.minMonths,
|
|
2195
|
+
max: calculatorParams.maxMonths,
|
|
2196
|
+
...field('monthsValue'),
|
|
2197
|
+
value: calculatorParams.monthsValue,
|
|
2198
|
+
className: 'mt-2xl',
|
|
2199
|
+
}), jsx("div", { className: style('mt-7', calculatorParams.isExtraMoney ? 'mb-3' : ''), children: renderCreditParamsForm({ ...calculatorParams, ...paramsViewSettings }, field) }), calculatorParams.isExtraMoney
|
|
2200
|
+
? renderWantedSumInput({
|
|
2201
|
+
title: 'Дополнительная сумма, ₽ ',
|
|
2202
|
+
step: 500,
|
|
2203
|
+
min: calculatorParams.minSumExtra,
|
|
2204
|
+
max: calculatorParams.maxSumExtra,
|
|
2205
|
+
...field('moneyExtra'),
|
|
2206
|
+
value: calculatorParams.moneyExtra,
|
|
2207
|
+
})
|
|
2208
|
+
: null] }), jsx(Rate, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", rate: calculatorParams.rate, fractionDigits: 1, rateBlockClassName: "tracking-[-25px]", unit: "%" }), jsxs("div", { className: "w-96", children: [jsx(CalculatorValueBlock, { title: 'Ежемесячный платеж', value: calculatorParams.monthlyPayment, postfix: "\u20BD" }), calculatorParams.benefit > 0 ? (jsx(CalculatorValueBlock, { title: 'Выгода в месяц', value: calculatorParams.benefit, postfix: "\u20BD" })) : null, renderPaymentType({ orientation: 'vertical', ...field('isAnnuity') }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
|
|
2209
|
+
});
|
|
2210
|
+
const renderCreditParamsForm = (params, field) => (jsxs("div", { children: [params.isShowSalaryClient ? (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", ...field('isSalaryClient'), value: params.isSalaryClient })) : null, params.isShowInsurance ? (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", ...field('isInsurance'), value: params.isInsurance })) : null, params.isShowExtraMoney ? (jsx(Checkbox, { className: "mt-3", text: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0443\u044E \u0441\u0443\u043C\u043C\u0443", ...field('isExtraMoney'), value: params.isExtraMoney })) : null] }));
|
|
2211
|
+
|
|
2212
|
+
const EmbeddableCalcBlocks = {
|
|
2213
|
+
CreditCalculatorForm,
|
|
2214
|
+
DepositCalculatorForm,
|
|
2215
|
+
BusinessDepositCalculatorForm,
|
|
2216
|
+
BonusCalculatorForm,
|
|
2217
|
+
RefinancingCalculatorForm,
|
|
2218
|
+
};
|
|
2219
|
+
|
|
2220
|
+
const Calculator = JSX(({ className, calculatorTabs = [] }) => (jsx(BlockWrapper, { className: className, defaultPadding: "p-0", children: renderTabs$1(calculatorTabs) })));
|
|
2221
|
+
const renderCalculator = (tab) => {
|
|
2222
|
+
const type = tab.calculatorBlock?.calcType;
|
|
2223
|
+
if (!type || !(type in EmbeddableCalcBlocks)) {
|
|
2224
|
+
return null;
|
|
2225
|
+
}
|
|
2226
|
+
const EmbeddedBlock = EmbeddableCalcBlocks[type];
|
|
2227
|
+
return jsx(EmbeddedBlock, { ...tab.calculatorBlock, isMobile: true });
|
|
2228
|
+
};
|
|
2229
|
+
const renderTabs$1 = (tabs) => {
|
|
2230
|
+
if (!tabs || !tabs.length) {
|
|
2231
|
+
return null;
|
|
2232
|
+
}
|
|
2233
|
+
const isSingleTab = tabs.length === 1;
|
|
2234
|
+
if (isSingleTab) {
|
|
2235
|
+
return jsx(BlockWrapper, { children: renderCalculator(tabs[0]) });
|
|
2236
|
+
}
|
|
2237
|
+
return tabs.map((tab, index) => (jsx(Foldable, { isFoldButtonOnTop: true, unfoldedByDefault: index === 0, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { isUnfolded: isUnfolded, children: jsx(BlockWrapper, { children: renderCalculator(tab) }) })), renderFoldButton: renderFoldButton$2(tab) }, index.toString())));
|
|
2238
|
+
};
|
|
2239
|
+
const renderFoldButton$2 = (tab) => ({ isUnfolded, onToggle }) => {
|
|
2240
|
+
return (jsxs("button", { onClick: onToggle, className: "w-full p-xl bg-green flex items-center border-b border-white", children: [jsx("div", { className: "w-11 h-11 bg-white rounded-md flex justify-center items-center", children: jsx(Icon, { name: tab.nav?.icon?.icon, iconVersion: "color", width: "24", height: "24" }) }), jsxs("div", { className: "flex-1 flex flex-col pl-s", children: [jsx(Text, { align: "text-left", color: "text-white", children: tab.nav?.title }), jsx(Text, { align: "text-left", size: "text-s", color: "text-white", font: "font-light", children: tab.nav?.description })] }), jsx(Icon, { name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', iconVersion: "white", width: "24", height: "24" })] }));
|
|
2241
|
+
};
|
|
2242
|
+
|
|
1489
2243
|
const NumberInput = JSX((props) => {
|
|
1490
2244
|
const { onChange, min, max, defaultValue = '0', fractionDigits = 0, ...inputProps } = props;
|
|
1491
2245
|
const normalizedProps = useNormalizedInput(props, {
|
|
@@ -1663,18 +2417,52 @@
|
|
|
1663
2417
|
|
|
1664
2418
|
const CarouselBankHistoryCard = JSX(({ title, description, className }) => (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", children: jsx(Headline, { headlineVersion: "XS", title: title, description: description, align: "text-left", className: "text-primary-text", isPadding: false }) })));
|
|
1665
2419
|
|
|
1666
|
-
const
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
2420
|
+
const imageAlignmentMap = {
|
|
2421
|
+
start: 'self-start',
|
|
2422
|
+
center: 'self-center',
|
|
2423
|
+
end: 'self-end',
|
|
2424
|
+
};
|
|
2425
|
+
const BaseTile = JSX(({ className, defaultPadding, padding, title = '', insetTitle = '', buttons, leftImage, rightImage, imageAlign, backImage, children, }) => (jsxs("div", { className: style('relative flex flex-col gap-3xl font-sans overflow-hidden', padding || defaultPadding, className), children: [title ? jsx("div", { className: "relative", children: title }) : null, jsxs("div", { className: "grow relative flex flex-wrap @xl:flex-nowrap justify-around @xl:justify-between items-stretch gap-3xl", children: [renderImageContainer(leftImage, { imageAlign }), jsxs("div", { className: style('flex flex-col gap-3xl max-w-[600px] xl:max-w-[728px]', leftImage ? '' : 'grow'), children: [insetTitle, jsx("div", { className: "grow", children: children }), backImage ? (jsx("div", { className: "mx-auto sm:absolute sm:-z-10 sm:-bottom-4 sm:-right-4", children: backImage })) : null, buttons] }), renderImageContainer(rightImage, { className: '-order-1 @xl:order-1', imageAlign })] })] })));
|
|
2426
|
+
const renderImageContainer = (image, { className, imageAlign }) => image ? (jsx("div", { className: style('flex-shrink-0', imageAlign && imageAlignmentMap[imageAlign], className), children: image })) : null;
|
|
2427
|
+
|
|
2428
|
+
const sum = (list = []) => list.reduce((a, b) => a + b, 0);
|
|
2429
|
+
|
|
2430
|
+
const avg = (items = []) => (items?.length ? sum(items) / items.length : 0);
|
|
2431
|
+
|
|
2432
|
+
const deviation = (items) => items?.length ? Math.sqrt(Math.abs(avg(items.map((_) => _ ** 2)) - avg(items) ** 2)) : 0;
|
|
2433
|
+
|
|
2434
|
+
const renderBenefitIcon = (icon, benefitsVersion = 'normal') => icon ? (jsx("div", { className: style('w-12 h-12 min-w-12 box-border flex items-center justify-center rounded-icon', benefitsVersion === 'normal'
|
|
2435
|
+
? 'bg-secondary-light text-primary-main'
|
|
2436
|
+
: 'bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black'), children: jsx(Img, { className: "w-6 h-6", image: { ...icon, iconVersion: icon.iconVersion || benefitsVersion } }) })) : null;
|
|
2437
|
+
|
|
2438
|
+
const RichText = JSX((props) => {
|
|
2439
|
+
const { __html = '', richVersion = '' } = props;
|
|
2440
|
+
return (jsx("div", { className: style(richVersion, 'md-container'), dangerouslySetInnerHTML: { __html } }));
|
|
1671
2441
|
});
|
|
1672
2442
|
|
|
1673
|
-
const
|
|
1674
|
-
|
|
2443
|
+
const renderBenefitDescription = (description, i) => description ? (jsx(Paragraph, { font: "font-light", size: "text-m", color: "text-secondary-text group-data-secondary:text-white", children: description }, `description-${i}`)) : null;
|
|
2444
|
+
|
|
2445
|
+
const renderBenefitLabel = (label, i) => label ? (jsx(Text, { color: "text-primary-text group-data-secondary:text-white", size: "text-h6", children: label }, `label-${i}`)) : null;
|
|
2446
|
+
|
|
2447
|
+
const renderBenefitText = (_, i) => _.type === 'rte' && '__html' in _ && _.__html ? (jsx(RichText, { ..._ }, `rte-${i}`)) : ([
|
|
2448
|
+
'label' in _ ? renderBenefitLabel(_.label, i) : null,
|
|
2449
|
+
'description' in _ ? renderBenefitDescription(_.description, i) : null,
|
|
2450
|
+
]);
|
|
1675
2451
|
|
|
1676
|
-
const
|
|
1677
|
-
|
|
2452
|
+
const BenefitItem = JSX(({ className, benefitsVersion, ..._ }) => (jsxs("div", { className: style('flex gap-m', 'description' in _ && _.description ? 'items-start' : 'items-center', className), children: ['icon' in _ ? renderBenefitIcon(_.icon, benefitsVersion) : null, jsx("div", { children: renderBenefitText(_) })] })));
|
|
2453
|
+
|
|
2454
|
+
const MAX_BENEFITS_LEN_DEVIATION = 16;
|
|
2455
|
+
const benefitLength = (_) => _.type === 'rte'
|
|
2456
|
+
? _?.__html?.length || 0
|
|
2457
|
+
: Math.max(_?.label?.length || 0, _?.description?.length || 0);
|
|
2458
|
+
const isDistortedBenefits = (benefits) => deviation(benefits.map(benefitLength)) > MAX_BENEFITS_LEN_DEVIATION;
|
|
2459
|
+
const hasIcon = (_) => _ && 'icon' in _ && _.icon && (_.icon.icon || _.icon.src);
|
|
2460
|
+
const isTextualBenefits = (benefits) => !benefits.some(hasIcon);
|
|
2461
|
+
const DefaultBenefitsList = JSX(({ className, benefitsVersion = 'normal', benefits }) => benefits?.length ? (jsx("div", { className: style('flex gap-x-m gap-y-s', isDistortedBenefits(benefits) || isTextualBenefits(benefits) ? 'flex-col' : 'flex-wrap', className), children: benefits.map((_, i) => (jsx(BenefitItem, { benefitsVersion: benefitsVersion, ..._ }, String(i)))) })) : null);
|
|
2462
|
+
|
|
2463
|
+
const TabularBenefitsList = JSX(({ className, benefits }) => benefits?.length ? (jsx("div", { className: style('grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs', className), children: benefits.flatMap(renderBenefitText) })) : null);
|
|
2464
|
+
|
|
2465
|
+
const BenefitsList = JSX(({ isTabularBenefits, ...rest }) => isTabularBenefits ? jsx(TabularBenefitsList, { ...rest }) : jsx(DefaultBenefitsList, { ...rest }));
|
|
1678
2466
|
|
|
1679
2467
|
const DOT_SIZE_MAP = {
|
|
1680
2468
|
L: 'w-1.5 h-1.5 mr-m',
|
|
@@ -1695,6 +2483,29 @@
|
|
|
1695
2483
|
};
|
|
1696
2484
|
const List = JSX(({ className, hasIndent, isDotted, items, listItemSize = 'M' }) => items?.length ? (jsx("section", { className: style('flex flex-col gap-xs text-left text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text', TEXT_SIZE_MAP[listItemSize], hasIndent ? ITEM_INDENT_MAP[listItemSize] : '', className), role: "list", children: items.map((item, i) => (jsx(ListItem, { isDotted: isDotted, size: listItemSize, children: item }, String(i)))) })) : null);
|
|
1697
2485
|
|
|
2486
|
+
const Tags = JSX(({ className, tags }) => tags?.length ? (jsx("div", { className: style('flex flex-wrap gap-xs', className), role: "list", children: tags.map(renderTag) })) : null);
|
|
2487
|
+
const renderTag = (tag, key) => (jsx("div", { className: "py-2 px-2.5 border-solid border rounded-md border-gray", role: "listitem", children: jsx(Text, { size: "text-m", font: "font-light", children: tag }) }, String(key)));
|
|
2488
|
+
|
|
2489
|
+
const BaseProductTile = JSX(({ className, padding, defaultPadding, title, description, headlineVersion = 'L', align = 'text-left', isInsetTitle = true, benefitsVersion, isTabularBenefits, benefits, __html, items, isDotted = true, listItemSize, tags, buttons, image, imageOptions: { imageAlign = 'end', directionRight = true, isBackground } = {}, children, }) => {
|
|
2490
|
+
const img = image?.src ? jsx(Img, { image: image }) : null;
|
|
2491
|
+
const headline = (jsx(Headline, { title: title, description: description, headlineVersion: headlineVersion, align: align, isPadding: false }));
|
|
2492
|
+
return (jsx(BaseTile, { className: className, padding: padding, defaultPadding: defaultPadding, ...(isInsetTitle ? { insetTitle: headline } : { title: headline }), ...(isBackground ? { backImage: img } : leftOrRightImage(img, directionRight)), imageAlign: imageAlign, buttons: renderButtonsSection(buttons), children: jsxs("div", { className: "flex flex-col gap-xl", children: [jsx(BenefitsList, { benefitsVersion: benefitsVersion, isTabularBenefits: isTabularBenefits, benefits: benefits }), __html ? jsx(RichText, { __html: __html }) : null, items?.length ? (jsx(List, { items: items, isDotted: isDotted, listItemSize: listItemSize })) : null, children, tags?.length ? jsx(Tags, { tags: tags }) : null] }) }));
|
|
2493
|
+
});
|
|
2494
|
+
const leftOrRightImage = (img, directionRight) => directionRight ? { rightImage: img } : { leftImage: img };
|
|
2495
|
+
|
|
2496
|
+
const LinkWrapper = JSX(({ className = '', href, target, isRemote = false, children }) => {
|
|
2497
|
+
const link = useLink({ isRemote });
|
|
2498
|
+
const linkProps = link({ href, target });
|
|
2499
|
+
const Tag = href ? 'a' : 'div';
|
|
2500
|
+
return (jsx(Tag, { className: style('block', className), ...(href ? linkProps : {}), children: children }));
|
|
2501
|
+
});
|
|
2502
|
+
|
|
2503
|
+
const CarouselProgramsCard = JSX(({ className, title, icon, list, href, target, ...rest }) => (jsx(BlockWrapper, { className: className, defaultPadding: "p-3xl", ...rest, children: jsx(LinkWrapper, { className: "flex items-center h-full", href: href, target: target, children: jsx(BaseProductTile, { title: title, headlineVersion: "XS", image: icon, imageOptions: { directionRight: false, imageAlign: 'center' }, benefits: list?.map((_) => ({
|
|
2504
|
+
type: 'default',
|
|
2505
|
+
label: _.title,
|
|
2506
|
+
description: _.description,
|
|
2507
|
+
})) }) }) })));
|
|
2508
|
+
|
|
1698
2509
|
const buttonSizeStyles = {
|
|
1699
2510
|
default: 'w-24 h-14',
|
|
1700
2511
|
stretched: 'flex-1 h-14',
|
|
@@ -1754,28 +2565,6 @@
|
|
|
1754
2565
|
});
|
|
1755
2566
|
const renderIcon$1 = (icon) => icon?.src || icon?.icon ? (jsx("div", { children: jsx(Img, { image: icon }) })) : null;
|
|
1756
2567
|
|
|
1757
|
-
const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
|
|
1758
|
-
const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
|
|
1759
|
-
const onToggle = useCallback(() => {
|
|
1760
|
-
setIsUnfolded((_) => !_);
|
|
1761
|
-
}, []);
|
|
1762
|
-
const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
|
|
1763
|
-
const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
|
|
1764
|
-
return isFoldButtonOnTop ? (jsxs("div", { className: className, children: [buttonNode, sectionNode] })) : (jsxs("div", { className: className, children: [sectionNode, buttonNode] }));
|
|
1765
|
-
});
|
|
1766
|
-
|
|
1767
|
-
const FoldableSection = JSX(({ className = '', isUnfolded, children }) => {
|
|
1768
|
-
const containerRef = useRef(null);
|
|
1769
|
-
useEffect(() => {
|
|
1770
|
-
if (containerRef.current) {
|
|
1771
|
-
containerRef.current.style.maxHeight = isUnfolded
|
|
1772
|
-
? `${containerRef.current.scrollHeight}px`
|
|
1773
|
-
: '';
|
|
1774
|
-
}
|
|
1775
|
-
}, [isUnfolded, children?.length]);
|
|
1776
|
-
return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} ${className}`, children: children }));
|
|
1777
|
-
});
|
|
1778
|
-
|
|
1779
2568
|
const getPaddingStyle = (isHighlighting = false) => isHighlighting ? 'p-6xl mt-6' : 'mt-6 p-6xl'; // Хак для мобильной версии т.к. контракт должен быть идентичный
|
|
1780
2569
|
|
|
1781
2570
|
const renderCardInfo = (cell, i) => {
|
|
@@ -1864,14 +2653,6 @@
|
|
|
1864
2653
|
return orientation === 'horizontal' ? (jsx(SwipeListControl, { onVisibleIndicesChange: handleSlideChange, children: tableColumns })) : (tableColumns);
|
|
1865
2654
|
});
|
|
1866
2655
|
|
|
1867
|
-
const imageAlignmentMap = {
|
|
1868
|
-
start: 'self-start',
|
|
1869
|
-
center: 'self-center',
|
|
1870
|
-
end: 'self-end',
|
|
1871
|
-
};
|
|
1872
|
-
const BaseTile = JSX(({ className, defaultPadding, padding, title = '', insetTitle = '', buttons, leftImage, rightImage, imageAlign, backImage, children, }) => (jsxs("div", { className: style('relative flex flex-col gap-3xl font-sans overflow-hidden', padding || defaultPadding, className), children: [title ? jsx("div", { className: "relative", children: title }) : null, jsxs("div", { className: "grow relative flex flex-wrap @xl:flex-nowrap justify-between items-stretch gap-3xl", children: [renderImageContainer(leftImage, { imageAlign }), jsxs("div", { className: style('flex flex-col gap-3xl max-w-[600px] xl:max-w-[728px]', leftImage ? '' : 'grow'), children: [insetTitle, jsx("div", { className: "grow", children: children }), backImage ? (jsx("div", { className: "mx-auto sm:absolute sm:-z-10 sm:-bottom-4 sm:-right-4", children: backImage })) : null, buttons] }), renderImageContainer(rightImage, { className: '-order-1 @xl:order-1', imageAlign })] })] })));
|
|
1873
|
-
const renderImageContainer = (image, { className, imageAlign }) => image ? (jsx("div", { className: style('flex-shrink-0', imageAlign && imageAlignmentMap[imageAlign], className), children: image })) : null;
|
|
1874
|
-
|
|
1875
2656
|
var Currency;
|
|
1876
2657
|
(function (Currency) {
|
|
1877
2658
|
Currency["RUB"] = "RUB";
|
|
@@ -2070,9 +2851,9 @@
|
|
|
2070
2851
|
|
|
2071
2852
|
const getIconName = (isUnfolded) => isUnfolded ? 'ArrowUpSolidIcon' : 'ArrowDownSolidIcon';
|
|
2072
2853
|
|
|
2073
|
-
const renderRoundedIcon = (icon, iconBgVersion) => (jsx(RoundedIcon, { ...icon, iconBgVersion: iconBgVersion }));
|
|
2854
|
+
const renderRoundedIcon = (icon, iconBgVersion) => (jsx(RoundedIcon, { ...icon, iconBgVersion: iconBgVersion, className: "shrink-0" }));
|
|
2074
2855
|
|
|
2075
|
-
const rollupIconVersion = '
|
|
2856
|
+
const rollupIconVersion = 'black';
|
|
2076
2857
|
|
|
2077
2858
|
const rollupItemStyles = '';
|
|
2078
2859
|
|
|
@@ -2103,7 +2884,7 @@
|
|
|
2103
2884
|
})) : (jsx(DefaultFoldButton, { label: label, icon: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', onClick: onToggle }));
|
|
2104
2885
|
};
|
|
2105
2886
|
const renderPrimaryFoldButton = ({ label, labelIconBgVersion, icon, onToggle, labelIcon, }) => {
|
|
2106
|
-
return (jsxs("button", { className: style('border-none bg-transparent flex justify-between items-center w-full group/button', labelIcon?.icon ? 'py-xs' : 'py-lg'), onClick: onToggle, children: [jsxs("div", { className: "flex items-center group-hover/button:text-primary-main gap-s", children: [renderRoundedIcon(labelIcon, labelIconBgVersion), label ? (jsx(Text, { size: "text-h6", font: "font-normal", children: label })) : null] }), icon ? jsx(Icon, { name: icon, iconVersion: rollupIconVersion, width: "24", height: "24" }) : null] }));
|
|
2887
|
+
return (jsxs("button", { className: style('border-none bg-transparent flex justify-between items-center w-full group/button', labelIcon?.icon ? 'py-xs' : 'py-lg'), onClick: onToggle, children: [jsxs("div", { className: "flex items-center text-start group-hover/button:text-primary-main gap-s", children: [renderRoundedIcon(labelIcon, labelIconBgVersion), label ? (jsx(Text, { size: "text-h6", font: "font-normal", children: label })) : null] }), icon ? jsx(Icon, { name: icon, iconVersion: rollupIconVersion, width: "24", height: "24" }) : null] }));
|
|
2107
2888
|
};
|
|
2108
2889
|
|
|
2109
2890
|
const Contacts = JSX(({ className = '', items }) => (jsxs("div", { className: className, children: [items?.length ? items.map(renderContactsGroup) : null, jsx(Button, { version: "primary", className: "w-full", href: "https://www.rshb.ru/feedback/question/", target: "_blank", ariaLabel: "\u041E\u0431\u0440\u0430\u0442\u043D\u0430\u044F \u0441\u0432\u044F\u0437\u044C", text: "\u041E\u0431\u0440\u0430\u0442\u043D\u0430\u044F \u0441\u0432\u044F\u0437\u044C" })] })));
|
|
@@ -2183,15 +2964,17 @@
|
|
|
2183
2964
|
};
|
|
2184
2965
|
const HeaderTop = JSX(({ bgColor, logo, internetBankUrl, version }) => {
|
|
2185
2966
|
const router = useRouter();
|
|
2186
|
-
const isRootLocation = router.pathname
|
|
2187
|
-
const onClick = useCallback(() => {
|
|
2967
|
+
const isRootLocation = projectSettings.BASE_PATH?.startsWith(router.pathname);
|
|
2968
|
+
const onClick = useCallback((e) => {
|
|
2969
|
+
e.preventDefault();
|
|
2188
2970
|
router.back();
|
|
2189
2971
|
}, []);
|
|
2190
|
-
return (jsxs("div", { className: "flex items-center justify-between w-full", children: [isRootLocation ? (jsx(Logo, { bgColor: bgColor, logo: logo })) : (
|
|
2191
|
-
icon: 'ChevronLeft',
|
|
2192
|
-
iconVersion: 'black',
|
|
2193
|
-
} }), "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430\u0437\u0430\u0434"] })), internetBankUrl ? (jsx(Button, { href: internetBankUrl, ariaLabel: "\u0412\u043E\u0439\u0442\u0438", target: "_blank", className: style('p-s my-2xs text-s whitespace-nowrap text-primary-main hover:text-primary-hover', BUTTON_STYLE[version === 'transparent' ? 'transparent' : 'default']), children: "\u0412\u043E\u0439\u0442\u0438" })) : null] }));
|
|
2972
|
+
return (jsxs("div", { className: "flex items-center justify-between w-full", children: [isRootLocation ? (jsx(Logo, { className: "mt-2xs", bgColor: bgColor, logo: logo })) : (renderBackButton(onClick)), internetBankUrl ? (jsx(Button, { href: internetBankUrl, ariaLabel: "\u0412\u043E\u0439\u0442\u0438", target: "_blank", className: style('p-s text-s whitespace-nowrap text-primary-main hover:text-primary-hover', BUTTON_STYLE[version === 'transparent' ? 'transparent' : 'default']), children: "\u0412\u043E\u0439\u0442\u0438" })) : null] }));
|
|
2194
2973
|
});
|
|
2974
|
+
const renderBackButton = (onClick) => (jsxs("button", { className: "flex items-center text-l mt-2xs", "aria-label": "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430\u0437\u0430\u0434", onClick: onClick, children: [jsx(Img, { className: "w-6 h-6", image: {
|
|
2975
|
+
icon: 'ChevronLeftIcon',
|
|
2976
|
+
iconVersion: 'black',
|
|
2977
|
+
}, width: "24", height: "24" }), "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430\u0437\u0430\u0434"] }));
|
|
2195
2978
|
|
|
2196
2979
|
const BG_COLOR_TO_BLOCK_VERSION = {
|
|
2197
2980
|
'bg-white': 'primary',
|
|
@@ -2199,7 +2982,7 @@
|
|
|
2199
2982
|
};
|
|
2200
2983
|
const Header = JSX(({ bgColor = 'bg-white', version = BG_COLOR_TO_BLOCK_VERSION[bgColor], ...rest }) => {
|
|
2201
2984
|
const { logo, internetBankUrl } = useSitemap(rest.options?.page?.fallback);
|
|
2202
|
-
return (jsx(BlockWrapper, { tag: "header", defaultPadding: "", version: version, ...rest, children: jsx("div", { className: "container px-
|
|
2985
|
+
return (jsx(BlockWrapper, { tag: "header", defaultPadding: "", version: version, ...rest, children: jsx("div", { className: "container px-5 py-2xs box-border", children: jsx(HeaderTop, { bgColor: bgColor, logo: logo, internetBankUrl: internetBankUrl, version: version, ...rest }) }) }));
|
|
2203
2986
|
});
|
|
2204
2987
|
|
|
2205
2988
|
const gapStyles = {
|
|
@@ -2288,55 +3071,8 @@
|
|
|
2288
3071
|
|
|
2289
3072
|
const MobileAppTile = JSX(({ className, padding, alignTitle = 'left', buttons = [], description, headingType = 'h4', image, items, qr, title = 'Мобильное приложение', version = 'primary', ...rest }) => {
|
|
2290
3073
|
const containerStyle = version === 'secondary' ? 'p-m min-w-32' : 'min-w-24';
|
|
2291
|
-
return (jsx(BlockWrapper, { className: style('min-h-80', className), padding: "p-0", version: version, ...rest, children: jsxs(BaseTile, { className: "h-full", padding: padding, defaultPadding: "p-6xl", title: title ? (jsx(Heading, { headingType: headingType, title: title, className: style('whitespace-pre-wrap', AlignText[alignTitle]) })) : null, buttons: renderButtonsSection(buttons, { isVertical: buttons.length > 4 }), children: [renderDescription$1(description), jsxs("div", { className: "flex flex-1 flex-wrap gap-m items-center", children: [qr?.src ? (jsx("div", { className: style('flex justify-center bg-white rounded-md', containerStyle), children: jsx(Img, { className: "w-fit", image: qr }) })) : null, renderList$1(items), image?.src ? jsx(Img, { image: image }) : null] })] }) }));
|
|
2292
|
-
});
|
|
2293
|
-
|
|
2294
|
-
const sum = (list = []) => list.reduce((a, b) => a + b, 0);
|
|
2295
|
-
|
|
2296
|
-
const avg = (items = []) => (items?.length ? sum(items) / items.length : 0);
|
|
2297
|
-
|
|
2298
|
-
const deviation = (items) => items?.length ? Math.sqrt(Math.abs(avg(items.map((_) => _ ** 2)) - avg(items) ** 2)) : 0;
|
|
2299
|
-
|
|
2300
|
-
const renderBenefitIcon = (icon, benefitsVersion = 'normal') => icon ? (jsx("div", { className: style('w-12 h-12 min-w-12 box-border flex items-center justify-center rounded-icon', benefitsVersion === 'normal'
|
|
2301
|
-
? 'bg-secondary-light text-primary-main'
|
|
2302
|
-
: 'bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black'), children: jsx(Img, { className: "w-6 h-6", image: { ...icon, iconVersion: icon.iconVersion || benefitsVersion } }) })) : null;
|
|
2303
|
-
|
|
2304
|
-
const RichText = JSX((props) => {
|
|
2305
|
-
const { __html = '', richVersion = '' } = props;
|
|
2306
|
-
return (jsx("div", { className: style(richVersion, 'md-container'), dangerouslySetInnerHTML: { __html } }));
|
|
2307
|
-
});
|
|
2308
|
-
|
|
2309
|
-
const renderBenefitDescription = (description, i) => description ? (jsx(Paragraph, { font: "font-light", size: "text-m", color: "text-secondary-text group-data-secondary:text-white", children: description }, `description-${i}`)) : null;
|
|
2310
|
-
|
|
2311
|
-
const renderBenefitLabel = (label, i) => label ? (jsx(Text, { color: "text-primary-text group-data-secondary:text-white", size: "text-h6", children: label }, `label-${i}`)) : null;
|
|
2312
|
-
|
|
2313
|
-
const renderBenefitText = (_, i) => _.type === 'rte' && '__html' in _ && _.__html ? (jsx(RichText, { ..._ }, `rte-${i}`)) : ([
|
|
2314
|
-
'label' in _ ? renderBenefitLabel(_.label, i) : null,
|
|
2315
|
-
'description' in _ ? renderBenefitDescription(_.description, i) : null,
|
|
2316
|
-
]);
|
|
2317
|
-
|
|
2318
|
-
const BenefitItem = JSX(({ className, benefitsVersion, ..._ }) => (jsxs("div", { className: style('flex gap-m', 'description' in _ && _.description ? 'items-start' : 'items-center', className), children: ['icon' in _ ? renderBenefitIcon(_.icon, benefitsVersion) : null, jsx("div", { children: renderBenefitText(_) })] })));
|
|
2319
|
-
|
|
2320
|
-
const MAX_BENEFITS_LEN_DEVIATION = 16;
|
|
2321
|
-
const benefitLength = (_) => _.type === 'rte'
|
|
2322
|
-
? _.__html?.length || 0
|
|
2323
|
-
: Math.max(_.label?.length || 0, _.description?.length || 0);
|
|
2324
|
-
const isDistortedBenefits = (benefits) => deviation(benefits.map(benefitLength)) > MAX_BENEFITS_LEN_DEVIATION;
|
|
2325
|
-
const DefaultBenefitsList = JSX(({ className, benefitsVersion = 'normal', benefits }) => benefits?.length ? (jsx("div", { className: style('flex gap-x-m gap-y-s', isDistortedBenefits(benefits) ? 'flex-col' : 'flex-wrap', className), children: benefits.map((_, i) => (jsx(BenefitItem, { benefitsVersion: benefitsVersion, ..._ }, String(i)))) })) : null);
|
|
2326
|
-
|
|
2327
|
-
const TabularBenefitsList = JSX(({ className, benefits }) => benefits?.length ? (jsx("div", { className: style('grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs', className), children: benefits.flatMap(renderBenefitText) })) : null);
|
|
2328
|
-
|
|
2329
|
-
const BenefitsList = JSX(({ isTabularBenefits, ...rest }) => isTabularBenefits ? jsx(TabularBenefitsList, { ...rest }) : jsx(DefaultBenefitsList, { ...rest }));
|
|
2330
|
-
|
|
2331
|
-
const Tags = JSX(({ className, tags }) => tags?.length ? (jsx("div", { className: style('flex flex-wrap gap-xs', className), role: "list", children: tags.map(renderTag) })) : null);
|
|
2332
|
-
const renderTag = (tag, key) => (jsx("div", { className: "py-2 px-2.5 border-solid border rounded-md border-gray", role: "listitem", children: jsx(Text, { size: "text-m", font: "font-light", children: tag }) }, String(key)));
|
|
2333
|
-
|
|
2334
|
-
const BaseProductTile = JSX(({ className, padding, defaultPadding, title, description, headlineVersion = 'L', align = 'text-left', isInsetTitle = true, benefitsVersion, isTabularBenefits, benefits, __html, items, isDotted = true, listItemSize, tags, buttons, image, imageOptions: { imageAlign = 'end', directionRight = true, isBackground } = {}, children, }) => {
|
|
2335
|
-
const img = image?.src ? jsx(Img, { image: image }) : null;
|
|
2336
|
-
const headline = (jsx(Headline, { title: title, description: description, headlineVersion: headlineVersion, align: align, isPadding: false }));
|
|
2337
|
-
return (jsx(BaseTile, { className: className, padding: padding, defaultPadding: defaultPadding, ...(isInsetTitle ? { insetTitle: headline } : { title: headline }), ...(isBackground ? { backImage: img } : leftOrRightImage(img, directionRight)), imageAlign: imageAlign, buttons: renderButtonsSection(buttons), children: jsxs("div", { className: "flex flex-col gap-xl", children: [jsx(BenefitsList, { benefitsVersion: benefitsVersion, isTabularBenefits: isTabularBenefits, benefits: benefits }), __html ? jsx(RichText, { __html: __html }) : null, items?.length ? (jsx(List, { items: items, isDotted: isDotted, listItemSize: listItemSize })) : null, children, tags?.length ? jsx(Tags, { tags: tags }) : null] }) }));
|
|
3074
|
+
return (jsx(BlockWrapper, { className: style('min-h-80', className), padding: "p-0", version: version, ...rest, children: jsxs(BaseTile, { className: "h-full", padding: padding, defaultPadding: "p-6xl", title: title ? (jsx(Heading, { headingType: headingType, title: title, className: style('whitespace-pre-wrap', AlignText[alignTitle]) })) : null, rightImage: image?.src ? jsx(Img, { className: "hidden lg:block", image: image }) : null, buttons: renderButtonsSection(buttons, { isVertical: buttons.length > 4 }), children: [renderDescription$1(description), jsxs("div", { className: "flex flex-1 flex-wrap gap-m items-center", children: [qr?.src ? (jsx("div", { className: style('flex justify-center bg-white rounded-md', containerStyle), children: jsx(Img, { className: "w-fit", image: qr }) })) : null, renderList$1(items), image?.src ? jsx(Img, { className: "lg:hidden", image: image }) : null] })] }) }));
|
|
2338
3075
|
});
|
|
2339
|
-
const leftOrRightImage = (img, directionRight) => directionRight ? { rightImage: img } : { leftImage: img };
|
|
2340
3076
|
|
|
2341
3077
|
const renderInsuranceSumMonth = (sum, monthLimit) => sum || monthLimit ? (jsxs("div", { className: "flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl", children: [Number(sum) > 0 ? renderValueBlock('Страховая сумма:', sum) : null, Number(monthLimit) > 0 ? renderValueBlock('Ежемесячный лимит:', monthLimit) : null] })) : null;
|
|
2342
3078
|
const renderValueBlock = (title, value = 0) => (jsxs("div", { className: "basis-full flex flex-col-reverse sm:flex-row sm:justify-between items-baseline whitespace-pre", children: [jsx(Text, { font: "font-light", size: "text-l", children: title }), jsxs(Text, { size: "text-h6", color: "text-primary-text", children: [toLocalNumberFormat(2)(value), " \u20BD"] })] }));
|
|
@@ -2807,106 +3543,65 @@
|
|
|
2807
3543
|
return (jsx("div", { className: style(iconAreaSize, containerStyle, 'z-10 mr-s flex justify-center content-center'), children: jsx("span", { className: "flex self-center text-h4 text-secondary-text group-data-secondary:text-white", children: checkCanRenderIcon(step?.icon) ? (jsx(Img, { image: { ...step.icon, iconVersion: step.icon?.iconVersion || iconVersion }, width: iconSize, height: iconSize })) : (jsx("span", { children: i + 1 })) }) }));
|
|
2808
3544
|
};
|
|
2809
3545
|
|
|
2810
|
-
const
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
const TEXT_CLASSES = 'font-sans text-m text-center';
|
|
2815
|
-
const ACTIVE_TEXT_CLASSES = 'text-white';
|
|
2816
|
-
const INACTIVE_TEXT_CLASSES = 'text-secondary-text sm:group-hover/btn:text-primary-main';
|
|
2817
|
-
const TAB_CLASSES = {
|
|
2818
|
-
block: {
|
|
2819
|
-
scrollable: {
|
|
2820
|
-
active: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${SCROLLABLE_ACTIVE_LINK_CLASSES}`,
|
|
2821
|
-
default: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${INACTIVE_LINK_CLASSES}`,
|
|
2822
|
-
},
|
|
2823
|
-
centered: {
|
|
2824
|
-
active: `px-4 rounded-md ${LINK_CLASSES} ${WIDESCREEN_ACTIVE_LINK_CLASSES} whitespace-nowrap`,
|
|
2825
|
-
default: `px-4 rounded-md ${LINK_CLASSES} group/btn bg-transparent whitespace-nowrap`,
|
|
2826
|
-
},
|
|
2827
|
-
wideScreen: {
|
|
2828
|
-
active: `${LINK_CLASSES} ${WIDESCREEN_ACTIVE_LINK_CLASSES} whitespace-nowrap`,
|
|
2829
|
-
default: `${LINK_CLASSES} ${INACTIVE_LINK_CLASSES} whitespace-nowrap`,
|
|
2830
|
-
},
|
|
2831
|
-
},
|
|
2832
|
-
text: {
|
|
2833
|
-
scrollable: {
|
|
2834
|
-
active: `${TEXT_CLASSES} flex items-center h-full border-0 border-b-2`,
|
|
2835
|
-
default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES}`,
|
|
2836
|
-
},
|
|
2837
|
-
centered: {
|
|
2838
|
-
active: `${TEXT_CLASSES} ${ACTIVE_TEXT_CLASSES}`,
|
|
2839
|
-
default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES}`,
|
|
2840
|
-
},
|
|
2841
|
-
wideScreen: {
|
|
2842
|
-
active: `${TEXT_CLASSES} ${ACTIVE_TEXT_CLASSES} text-black px-2.5 bg-white sm:bg-primary-main sm:text-white`,
|
|
2843
|
-
default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES} px-2.5 bg-white`,
|
|
2844
|
-
},
|
|
2845
|
-
},
|
|
3546
|
+
const tabPaddingStyleMap = {
|
|
3547
|
+
default: 'px-xs',
|
|
3548
|
+
underlined: 'px-m',
|
|
3549
|
+
rounded: 'px-lg rounded-md',
|
|
2846
3550
|
};
|
|
2847
|
-
const
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
3551
|
+
const tabTextStyle = 'text-secondary-text hover:text-primary-main';
|
|
3552
|
+
const activeTabTextStyleMap = {
|
|
3553
|
+
default: 'text-black sm:text-white',
|
|
3554
|
+
underlined: 'text-primary-main border-b-2',
|
|
3555
|
+
rounded: 'text-white',
|
|
2851
3556
|
};
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
3557
|
+
const tabBgStyleMap = {
|
|
3558
|
+
default: 'bg-white',
|
|
3559
|
+
underlined: 'bg-white',
|
|
3560
|
+
rounded: 'bg-transparent',
|
|
3561
|
+
};
|
|
3562
|
+
const activeTabBgStyleMap = {
|
|
3563
|
+
default: 'sm:bg-primary-main',
|
|
3564
|
+
underlined: 'bg-white',
|
|
3565
|
+
rounded: 'bg-primary-main',
|
|
3566
|
+
};
|
|
3567
|
+
const TabItem = JSX(({ item = {}, isActive, onClick, type = 'default' }) => {
|
|
2856
3568
|
const link = useLink();
|
|
2857
|
-
const
|
|
2858
|
-
|
|
2859
|
-
adjustedProps.onClick(ev);
|
|
2860
|
-
onClick(tab);
|
|
3569
|
+
const handleClick = () => {
|
|
3570
|
+
onClick && onClick(item);
|
|
2861
3571
|
};
|
|
2862
|
-
|
|
3572
|
+
const { text, ...linkProps } = link({ ...item, onClick: handleClick });
|
|
3573
|
+
const Tag = item.href ? 'a' : 'div';
|
|
3574
|
+
return (jsx(Tag, { className: style('h-12', 'block flex-1', 'cursor-pointer', tabPaddingStyleMap[type], isActive ? activeTabBgStyleMap[type] : tabBgStyleMap[type]), role: "tab", "aria-selected": isActive, ...linkProps, children: jsx("div", { className: style('h-full', 'flex justify-center items-center', 'text-center whitespace-nowrap', isActive ? activeTabTextStyleMap[type] : tabTextStyle), children: jsx(Text, { size: "text-m", children: text }) }) }));
|
|
2863
3575
|
});
|
|
2864
3576
|
|
|
2865
|
-
const
|
|
2866
|
-
const LIGHT_BADGE_CLASSES = 'bg-white/30 text-white';
|
|
2867
|
-
const DARK_BADGE_CLASSES = 'text-secondary-text group-hover/btn:text-primary-main';
|
|
2868
|
-
const renderGroupTab = ({ page, currentTab, showCounter, onClick, tabsMode }) => (tab, i) => {
|
|
2869
|
-
const active = currentTab === tab;
|
|
2870
|
-
const count = tab.ref && page?.blocks
|
|
2871
|
-
? page.blocks.filter((block) => block?.labels?.includes(tab.ref)).length
|
|
2872
|
-
: 0;
|
|
2873
|
-
return (jsx("div", { className: getTabClassName('block', active, tabsMode), role: "tab", "aria-selected": active, onClick: () => onClick(tab), children: jsxs("div", { className: style('flex flex-1 items-center justify-center h-full', getTabClassName('text', active, tabsMode)), children: [jsx("span", { children: tab.title }), showCounter && count ? renderCount(tabsMode, count, active) : null] }) }, `group-${String(i)}`));
|
|
2874
|
-
};
|
|
2875
|
-
const renderCount = (tabsMode, count, active) => {
|
|
2876
|
-
return (jsx("div", { className: style(BADGE_CLASSES, active && tabsMode !== 'scrollable' ? LIGHT_BADGE_CLASSES : DARK_BADGE_CLASSES), children: count }));
|
|
2877
|
-
};
|
|
2878
|
-
|
|
2879
|
-
const renderTab = ({ page, showCounter, ...rest }) => (tab, i) => {
|
|
2880
|
-
const type = tab.type;
|
|
2881
|
-
if (!(type === 'group' || type === 'link')) {
|
|
2882
|
-
return null;
|
|
2883
|
-
}
|
|
2884
|
-
switch (type) {
|
|
2885
|
-
case 'group':
|
|
2886
|
-
return renderGroupTab({ page, showCounter, ...rest })(tab, i);
|
|
2887
|
-
case 'link': {
|
|
2888
|
-
return jsx(LinkTab, { tab: tab, ...rest }, String(i));
|
|
2889
|
-
}
|
|
2890
|
-
default:
|
|
2891
|
-
assertUnreachable(type);
|
|
2892
|
-
}
|
|
2893
|
-
return null;
|
|
2894
|
-
};
|
|
3577
|
+
const renderTab = (activeTab, onClick, type) => (tab, i) => (jsx(TabItem, { isActive: tab === activeTab, onClick: onClick, type: type, item: tab }, String(i)));
|
|
2895
3578
|
|
|
2896
|
-
const
|
|
2897
|
-
|
|
2898
|
-
const scrollButtonStyle = 'absolute z-40 top-0';
|
|
2899
|
-
const ScrollableTabs = JSX((props) => {
|
|
2900
|
-
const { tabs, ...rest } = props;
|
|
3579
|
+
const scrollButtonStyle = 'hidden sm:flex absolute z-40 top-0';
|
|
3580
|
+
const ScrollableTabsControl = JSX(({ className, items = [], value, onChange, tabsType }) => {
|
|
2901
3581
|
const [containerRef, scroll] = useSwipeListScroll({
|
|
2902
|
-
itemCount:
|
|
3582
|
+
itemCount: items?.length || 0,
|
|
2903
3583
|
});
|
|
2904
|
-
return (jsxs("div", { className:
|
|
3584
|
+
return (jsxs("div", { className: style('relative overflow-x-auto no-scrollbar', className), role: "tablist", children: [jsx(SwipeListContainer, { containerRef: containerRef, snapAlign: "snap-start", onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: items.map(renderTab(value, onChange, tabsType)) }), scroll.canScrollLeft ? (jsx(ScrollLeftButton, { className: style('left-6', scrollButtonStyle), onClick: scroll.scrollLeft })) : null, scroll.canScrollRight ? (jsx(ScrollRightButton, { className: style('right-6', scrollButtonStyle), onClick: scroll.scrollRight })) : null] }));
|
|
2905
3585
|
});
|
|
2906
3586
|
|
|
2907
|
-
const
|
|
2908
|
-
|
|
2909
|
-
|
|
3587
|
+
const TabsControl = JSX(({ className, tabsType = 'default', items = [], value, onChange }) => (jsx("div", { className: style('flex gap-x-2xs overflow-x-auto no-scrollbar', className), role: "tablist", children: items.map(renderTab(value, onChange, tabsType)) })));
|
|
3588
|
+
|
|
3589
|
+
const renderTabs = ({ tabsMode, ...props }) => {
|
|
3590
|
+
switch (tabsMode) {
|
|
3591
|
+
case 'wideScreen':
|
|
3592
|
+
return jsx(TabsControl, { ...props });
|
|
3593
|
+
case 'centered':
|
|
3594
|
+
return (jsx("div", { className: "flex", children: jsx(TabsControl, { className: "m-auto p-xs rounded-md bg-main-gray", tabsType: "rounded", ...props }) }));
|
|
3595
|
+
case 'scrollable':
|
|
3596
|
+
return (jsx("div", { className: "flex", children: jsx(ScrollableTabsControl, { className: "m-auto", tabsType: "underlined", ...props }) }));
|
|
3597
|
+
default:
|
|
3598
|
+
return null;
|
|
3599
|
+
}
|
|
3600
|
+
};
|
|
3601
|
+
|
|
3602
|
+
const Tabs = JSX(({ className = '', isSticky, tabs = [], tabsMode, ...rest }) => {
|
|
3603
|
+
const normalizedTabs = useMemo(() => tabs.map(normalizeTab), [tabs]);
|
|
3604
|
+
const [activeTabIndex, setActiveTabIndex] = useState(0);
|
|
2910
3605
|
useEffect(() => {
|
|
2911
3606
|
if (!tabs || !tabs[0]) {
|
|
2912
3607
|
return;
|
|
@@ -2914,27 +3609,23 @@
|
|
|
2914
3609
|
fireTabEvent(tabs[0]);
|
|
2915
3610
|
}, []);
|
|
2916
3611
|
useEffect(() => {
|
|
2917
|
-
|
|
2918
|
-
|
|
3612
|
+
const activeTab = tabs[activeTabIndex];
|
|
3613
|
+
if (activeTab?.type === 'group') {
|
|
3614
|
+
defaultEventBus.subject('tab', { type: activeTab.type, label: activeTab.ref });
|
|
2919
3615
|
}
|
|
2920
|
-
}, [
|
|
2921
|
-
const
|
|
2922
|
-
|
|
2923
|
-
|
|
3616
|
+
}, [tabs, activeTabIndex]);
|
|
3617
|
+
const handleChange = useCallback((_) => {
|
|
3618
|
+
const index = normalizedTabs.indexOf(_);
|
|
3619
|
+
setActiveTabIndex(index);
|
|
3620
|
+
fireTabEvent(tabs[index]);
|
|
2924
3621
|
}, []);
|
|
2925
|
-
return (jsx(BlockWrapper, { className: style(
|
|
3622
|
+
return (jsx(BlockWrapper, { className: style(isSticky ? 'sticky top-1 z-20' : '', className), defaultPadding: "p-0", ...rest, children: renderTabs({
|
|
3623
|
+
items: normalizedTabs,
|
|
3624
|
+
onChange: handleChange,
|
|
3625
|
+
value: normalizedTabs[activeTabIndex],
|
|
3626
|
+
tabsMode,
|
|
3627
|
+
}) }));
|
|
2926
3628
|
});
|
|
2927
|
-
const renderTabs = ({ tabsMode, tabs, ...rest }) => {
|
|
2928
|
-
switch (tabsMode) {
|
|
2929
|
-
case 'wideScreen':
|
|
2930
|
-
return tabs?.map(renderTab({ tabsMode, ...rest }));
|
|
2931
|
-
case 'centered':
|
|
2932
|
-
return jsx(CenteredTabs, { tabs: tabs, tabsMode: tabsMode, ...rest });
|
|
2933
|
-
case 'scrollable':
|
|
2934
|
-
return jsx(ScrollableTabs, { tabs: tabs, tabsMode: tabsMode, ...rest });
|
|
2935
|
-
}
|
|
2936
|
-
return null;
|
|
2937
|
-
};
|
|
2938
3629
|
const fireTabEvent = (tab) => {
|
|
2939
3630
|
if (tab.type === 'group') {
|
|
2940
3631
|
defaultEventBus.fire('tab', { type: tab.type, label: tab.ref });
|
|
@@ -2943,6 +3634,7 @@
|
|
|
2943
3634
|
defaultEventBus.fire('tab', { type: tab.type, label: tab.href });
|
|
2944
3635
|
}
|
|
2945
3636
|
};
|
|
3637
|
+
const normalizeTab = (_) => (_?.type === 'group' ? { text: _.title } : _);
|
|
2946
3638
|
|
|
2947
3639
|
const renderButtonsCellData = ({ buttons }) => renderButtonsSection(buttons, {
|
|
2948
3640
|
className: 'mt-3',
|
|
@@ -2999,6 +3691,7 @@
|
|
|
2999
3691
|
ApplicationForm,
|
|
3000
3692
|
ButtonsBlock,
|
|
3001
3693
|
BonusBenefitsBlock,
|
|
3694
|
+
Calculator,
|
|
3002
3695
|
CardTransfer,
|
|
3003
3696
|
Carousel,
|
|
3004
3697
|
CarouselCard,
|
|
@@ -3235,7 +3928,7 @@
|
|
|
3235
3928
|
|
|
3236
3929
|
const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
|
|
3237
3930
|
|
|
3238
|
-
const packageVersion = "0.
|
|
3931
|
+
const packageVersion = "0.13.0";
|
|
3239
3932
|
|
|
3240
3933
|
exports.Blocks = Blocks;
|
|
3241
3934
|
exports.ContentPage = ContentPage;
|