@redneckz/wildless-cms-uni-blocks 0.12.13 → 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 +48 -0
- package/bundle/EventBus/defaultEventBus.d.ts +4 -2
- package/bundle/EventBus/useLatestEvent.d.ts +2 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +450 -422
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
- package/bundle/components/Bonus/BonusContent.d.ts +2 -7
- package/bundle/components/BusinessBlock/BusinessBlockContent.d.ts +3 -2
- package/bundle/components/ButtonsBlock/ButtonsBlockContent.d.ts +2 -2
- package/bundle/components/Calculator/Calculator.mobile.d.ts +5 -0
- package/bundle/components/Calculator/CalculatorContent.d.ts +2 -2
- 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/CardTransfer/CardTransferContent.d.ts +2 -2
- package/bundle/components/CarouselCard/CarouselCardContent.d.ts +3 -2
- package/bundle/components/CarouselCatalogCard/CarouselCatalogCardContent.d.ts +3 -2
- package/bundle/components/CarouselCatalogCard/CatalogCard.d.ts +2 -2
- package/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +3 -2
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -2
- package/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +4 -9
- package/bundle/components/ContactsBlock/ContactsBlockContent.d.ts +2 -2
- package/bundle/components/ContentPage/computeAPIFallback.d.ts +2 -2
- package/bundle/components/ErrorBlock/ErrorBlockContent.d.ts +2 -2
- package/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +2 -2
- package/bundle/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +2 -2
- package/bundle/components/Footer/FooterProps.d.ts +0 -2
- package/bundle/components/Footer/SocialMedia.d.ts +2 -2
- package/bundle/components/Header/HeaderProps.d.ts +0 -4
- package/bundle/components/Header/HeaderSecondaryMenu.d.ts +1 -1
- package/bundle/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +2 -2
- package/bundle/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +2 -2
- package/bundle/components/MobileAppTile/MobileAppTileContent.d.ts +2 -2
- package/bundle/components/MortgageFiltration/HotFilterRecord.d.ts +11 -0
- package/bundle/components/MortgageFiltration/MortgageFiltrationContent.d.ts +12 -0
- package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/bundle/components/ProductBlock/renderBackwardButton.d.ts +2 -2
- package/bundle/components/PromoTile/PromoTileContent.d.ts +2 -2
- package/bundle/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.d.ts +2 -2
- package/bundle/components/RollupItem/rollupIconVersion.mobile.d.ts +1 -1
- package/bundle/components/StepsBlock/StepsBlockContent.d.ts +6 -9
- package/bundle/components/Tabs/renderTabs.d.ts +12 -0
- package/bundle/components/TariffsTable/EmbeddableCellData.d.ts +3 -2
- package/bundle/components/TariffsTable/EmbeddableCellData.mobile.d.ts +3 -2
- package/bundle/components/TariffsTable/TariffsTableContent.d.ts +2 -2
- package/bundle/hooks/useForm.d.ts +1 -0
- package/bundle/hooks/useList.d.ts +10 -0
- package/bundle/hooks/useLocation.d.ts +1 -1
- package/bundle/hooks/useSWRResource.d.ts +1 -1
- package/bundle/icons/IconName.d.ts +3 -3
- package/bundle/services/sitemap/useSitemap.d.ts +3 -0
- package/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -2
- package/bundle/ui-kit/Button/Button.d.ts +2 -2
- package/bundle/ui-kit/Button/ButtonContent.d.ts +19 -0
- package/bundle/ui-kit/Button/ButtonInner.d.ts +2 -7
- package/bundle/ui-kit/Button/ButtonProps.d.ts +4 -44
- package/bundle/ui-kit/Button/ButtonsSectionContent.d.ts +7 -0
- package/bundle/ui-kit/Button/renderButtonsSection.d.ts +2 -2
- package/{lib/ui-kit/Dialog → bundle/ui-kit/DialogManager}/CloseButton.d.ts +1 -1
- package/bundle/ui-kit/{Dialog → DialogManager}/Dialog.d.ts +0 -1
- package/bundle/ui-kit/DialogManager/DialogAction.d.ts +12 -0
- package/bundle/ui-kit/DialogManager/DialogManager.d.ts +2 -0
- package/bundle/ui-kit/DialogManager/useDialogManager.d.ts +10 -0
- package/bundle/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
- package/bundle/ui-kit/ListControlProps.d.ts +4 -0
- package/bundle/ui-kit/LocationDialog/LocationDialog.d.ts +2 -3
- package/bundle/ui-kit/LocationDialog/renderForeignOffices.d.ts +5 -0
- package/bundle/ui-kit/LocationDialog/renderRegion.d.ts +3 -0
- package/bundle/ui-kit/LocationDialog/renderRegionGroup.d.ts +3 -0
- package/bundle/ui-kit/LocationDialog/useLocationDialog.d.ts +5 -0
- package/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +1 -0
- package/bundle/ui-kit/SearchDialog/SearchDialog.d.ts +1 -3
- package/bundle/ui-kit/SearchDialog/useSearchDialog.d.ts +6 -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/EventBus/defaultEventBus.d.ts +4 -2
- package/dist/EventBus/defaultEventBus.js.map +1 -1
- package/dist/EventBus/useLatestEvent.d.ts +2 -0
- package/dist/EventBus/useLatestEvent.js +11 -0
- package/dist/EventBus/useLatestEvent.js.map +1 -0
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
- package/dist/components/Blocks.mobile.js +2 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/Bonus/BonusContent.d.ts +2 -7
- package/dist/components/BusinessBlock/BusinessBlockContent.d.ts +3 -2
- package/dist/components/ButtonsBlock/ButtonsBlockContent.d.ts +2 -2
- 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/CalculatorContent.d.ts +2 -2
- 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/CardTransfer/CardTransferContent.d.ts +2 -2
- package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.mobile.js +1 -1
- package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.mobile.js.map +1 -1
- package/dist/components/CarouselCard/CarouselCardContent.d.ts +3 -2
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +2 -2
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/dist/components/CarouselCatalogCard/CarouselCatalogCardContent.d.ts +3 -2
- package/dist/components/CarouselCatalogCard/CatalogCard.d.ts +2 -2
- package/dist/components/CarouselCatalogCard/CatalogCard.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +3 -2
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +6 -7
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -2
- package/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +4 -9
- package/dist/components/ContactsBlock/ContactsBlockContent.d.ts +2 -2
- package/dist/components/ContentPage/ContentPage.js +2 -23
- package/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/dist/components/ContentPage/computeAPIFallback.d.ts +2 -2
- package/dist/components/ContentPage/computeAPIFallback.js +10 -27
- package/dist/components/ContentPage/computeAPIFallback.js.map +1 -1
- package/dist/components/ErrorBlock/ErrorBlockContent.d.ts +2 -2
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +2 -2
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +2 -2
- package/dist/components/Footer/Footer.js +4 -2
- package/dist/components/Footer/Footer.js.map +1 -1
- package/dist/components/Footer/Footer.mobile.js +7 -4
- package/dist/components/Footer/Footer.mobile.js.map +1 -1
- package/dist/components/Footer/FooterProps.d.ts +0 -2
- package/dist/components/Footer/SocialMedia.d.ts +2 -2
- package/dist/components/Header/Header.js +5 -4
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/Header.mobile.js +4 -3
- package/dist/components/Header/Header.mobile.js.map +1 -1
- package/dist/components/Header/HeaderProps.d.ts +0 -4
- package/dist/components/Header/HeaderSecondaryMenu.d.ts +1 -1
- package/dist/components/Header/HeaderSecondaryMenu.js +10 -9
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/Header/HeaderSubMenu.js +1 -1
- package/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/dist/components/Header/HeaderTop.js +9 -6
- package/dist/components/Header/HeaderTop.js.map +1 -1
- package/dist/components/Header/findActiveSubItem.js.map +1 -0
- package/dist/components/Header/isHrefActive.js.map +1 -0
- package/dist/components/Header/isTopItemActive.js.map +1 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +2 -2
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +2 -2
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -1
- package/dist/components/MobileAppTile/MobileAppTile.js +1 -1
- package/dist/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/dist/components/MobileAppTile/MobileAppTileContent.d.ts +2 -2
- 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/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/dist/components/ProductBlock/renderBackwardButton.d.ts +2 -2
- package/dist/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/dist/components/PromoTile/PromoTileContent.d.ts +2 -2
- package/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.d.ts +2 -2
- 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/StepsBlock/StepsBlockContent.d.ts +6 -9
- 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/components/TariffsTable/EmbeddableCellData.d.ts +3 -2
- package/dist/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/dist/components/TariffsTable/EmbeddableCellData.mobile.d.ts +3 -2
- package/dist/components/TariffsTable/EmbeddableCellData.mobile.js.map +1 -1
- package/dist/components/TariffsTable/TariffsTableContent.d.ts +2 -2
- 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/hooks/useLink.js +3 -3
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/hooks/useList.d.ts +10 -0
- package/dist/hooks/useList.js +13 -0
- package/dist/hooks/useList.js.map +1 -0
- package/dist/hooks/useLocation.d.ts +1 -1
- package/dist/hooks/useLocation.js +27 -16
- package/dist/hooks/useLocation.js.map +1 -1
- package/dist/hooks/useSWRResource.d.ts +1 -1
- package/dist/hooks/useSWRResource.js +2 -4
- package/dist/hooks/useSWRResource.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/services/sitemap/useSitemap.d.ts +3 -0
- package/dist/services/sitemap/useSitemap.js +7 -0
- package/dist/services/sitemap/useSitemap.js.map +1 -0
- 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/BaseProductTile/BaseProductTileContent.d.ts +2 -2
- 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/Button/Button.d.ts +2 -2
- package/dist/ui-kit/Button/Button.js.map +1 -1
- package/dist/ui-kit/Button/ButtonContent.d.ts +19 -0
- package/dist/{model/Button.js → ui-kit/Button/ButtonContent.js} +1 -1
- package/dist/ui-kit/Button/ButtonContent.js.map +1 -0
- package/dist/ui-kit/Button/ButtonInner.d.ts +2 -7
- package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/dist/ui-kit/Button/ButtonProps.d.ts +4 -44
- package/dist/ui-kit/Button/ButtonsSectionContent.d.ts +7 -0
- package/dist/ui-kit/{LocationDialog/LocationDialogProps.js → Button/ButtonsSectionContent.js} +1 -1
- package/dist/ui-kit/Button/ButtonsSectionContent.js.map +1 -0
- package/dist/ui-kit/Button/renderButtonsSection.d.ts +2 -2
- package/dist/ui-kit/Button/renderButtonsSection.js.map +1 -1
- package/dist/ui-kit/CookiePopup/CookiePopup.js +6 -6
- package/dist/ui-kit/CookiePopup/CookiePopup.js.map +1 -1
- package/{bundle/ui-kit/Dialog → dist/ui-kit/DialogManager}/CloseButton.d.ts +1 -1
- package/{mobile/dist/ui-kit/Dialog → dist/ui-kit/DialogManager}/CloseButton.js +1 -1
- package/dist/ui-kit/DialogManager/CloseButton.js.map +1 -0
- package/dist/ui-kit/{Dialog → DialogManager}/Dialog.d.ts +0 -1
- package/dist/ui-kit/DialogManager/Dialog.js +17 -0
- package/dist/ui-kit/DialogManager/Dialog.js.map +1 -0
- package/dist/ui-kit/DialogManager/DialogAction.d.ts +12 -0
- package/dist/ui-kit/DialogManager/DialogAction.js.map +1 -0
- package/dist/ui-kit/DialogManager/DialogManager.d.ts +2 -0
- package/dist/ui-kit/DialogManager/DialogManager.js +61 -0
- package/dist/ui-kit/DialogManager/DialogManager.js.map +1 -0
- package/dist/ui-kit/DialogManager/useDialogManager.d.ts +10 -0
- package/dist/ui-kit/DialogManager/useDialogManager.js +10 -0
- package/dist/ui-kit/DialogManager/useDialogManager.js.map +1 -0
- 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/LocationDialog/LocationDialog.d.ts +2 -3
- package/dist/ui-kit/LocationDialog/LocationDialog.js +17 -26
- package/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/dist/ui-kit/LocationDialog/renderForeignOffices.d.ts +5 -0
- package/dist/ui-kit/LocationDialog/renderForeignOffices.js +15 -0
- package/dist/ui-kit/LocationDialog/renderForeignOffices.js.map +1 -0
- package/dist/ui-kit/LocationDialog/renderRegion.d.ts +3 -0
- package/dist/ui-kit/LocationDialog/renderRegion.js +8 -0
- package/dist/ui-kit/LocationDialog/renderRegion.js.map +1 -0
- package/dist/ui-kit/LocationDialog/renderRegionGroup.d.ts +3 -0
- package/dist/ui-kit/LocationDialog/renderRegionGroup.js +8 -0
- package/dist/ui-kit/LocationDialog/renderRegionGroup.js.map +1 -0
- package/dist/ui-kit/LocationDialog/useLocationDialog.d.ts +5 -0
- package/dist/ui-kit/LocationDialog/useLocationDialog.js +14 -0
- package/dist/ui-kit/LocationDialog/useLocationDialog.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/SearchBar/SearchBar.js +6 -9
- package/dist/ui-kit/SearchBar/SearchBar.js.map +1 -1
- package/dist/ui-kit/SearchDialog/SearchDialog.d.ts +1 -3
- package/dist/ui-kit/SearchDialog/SearchDialog.js +8 -9
- package/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/dist/ui-kit/SearchDialog/useSearchDialog.d.ts +6 -0
- package/dist/ui-kit/SearchDialog/useSearchDialog.js +14 -0
- package/dist/ui-kit/SearchDialog/useSearchDialog.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.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/EventBus/defaultEventBus.d.ts +4 -2
- package/lib/EventBus/defaultEventBus.js.map +1 -1
- package/lib/EventBus/useLatestEvent.d.ts +2 -0
- package/lib/EventBus/useLatestEvent.js +8 -0
- package/lib/EventBus/useLatestEvent.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
- package/lib/components/Blocks.mobile.js +2 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/Bonus/BonusContent.d.ts +2 -7
- package/lib/components/BusinessBlock/BusinessBlockContent.d.ts +3 -2
- package/lib/components/ButtonsBlock/ButtonsBlockContent.d.ts +2 -2
- 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/CalculatorContent.d.ts +2 -2
- 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/CardTransfer/CardTransferContent.d.ts +2 -2
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.mobile.js +1 -1
- package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.mobile.js.map +1 -1
- package/lib/components/CarouselCard/CarouselCardContent.d.ts +3 -2
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +2 -2
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/lib/components/CarouselCatalogCard/CarouselCatalogCardContent.d.ts +3 -2
- package/lib/components/CarouselCatalogCard/CatalogCard.d.ts +2 -2
- package/lib/components/CarouselCatalogCard/CatalogCard.js.map +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +3 -2
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +7 -8
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -2
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +4 -9
- package/lib/components/ContactsBlock/ContactsBlockContent.d.ts +2 -2
- package/lib/components/ContentPage/ContentPage.js +2 -23
- package/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/lib/components/ContentPage/computeAPIFallback.d.ts +2 -2
- package/lib/components/ContentPage/computeAPIFallback.js +8 -25
- package/lib/components/ContentPage/computeAPIFallback.js.map +1 -1
- package/lib/components/ErrorBlock/ErrorBlockContent.d.ts +2 -2
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +2 -2
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +2 -2
- package/lib/components/Footer/Footer.js +4 -2
- package/lib/components/Footer/Footer.js.map +1 -1
- package/lib/components/Footer/Footer.mobile.js +7 -4
- package/lib/components/Footer/Footer.mobile.js.map +1 -1
- package/lib/components/Footer/FooterProps.d.ts +0 -2
- package/lib/components/Footer/SocialMedia.d.ts +2 -2
- package/lib/components/Header/Header.js +5 -4
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/Header.mobile.js +4 -3
- package/lib/components/Header/Header.mobile.js.map +1 -1
- package/lib/components/Header/HeaderProps.d.ts +0 -4
- package/lib/components/Header/HeaderSecondaryMenu.d.ts +1 -1
- package/lib/components/Header/HeaderSecondaryMenu.js +10 -9
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/Header/HeaderSubMenu.js +1 -1
- package/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/lib/components/Header/HeaderTop.js +9 -6
- package/lib/components/Header/HeaderTop.js.map +1 -1
- package/lib/components/Header/findActiveSubItem.js.map +1 -0
- package/lib/components/Header/isHrefActive.js.map +1 -0
- package/lib/components/Header/isTopItemActive.js.map +1 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +2 -2
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +2 -2
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -1
- package/lib/components/MobileAppTile/MobileAppTile.js +1 -1
- package/lib/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/lib/components/MobileAppTile/MobileAppTileContent.d.ts +2 -2
- 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/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/lib/components/ProductBlock/renderBackwardButton.d.ts +2 -2
- package/lib/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/lib/components/PromoTile/PromoTileContent.d.ts +2 -2
- package/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.d.ts +2 -2
- 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/StepsBlock/StepsBlockContent.d.ts +6 -9
- 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/components/TariffsTable/EmbeddableCellData.d.ts +3 -2
- package/lib/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/lib/components/TariffsTable/EmbeddableCellData.mobile.d.ts +3 -2
- package/lib/components/TariffsTable/EmbeddableCellData.mobile.js.map +1 -1
- package/lib/components/TariffsTable/TariffsTableContent.d.ts +2 -2
- 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/hooks/useLink.js +3 -3
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/hooks/useList.d.ts +10 -0
- package/lib/hooks/useList.js +10 -0
- package/lib/hooks/useList.js.map +1 -0
- package/lib/hooks/useLocation.d.ts +1 -1
- package/lib/hooks/useLocation.js +28 -17
- package/lib/hooks/useLocation.js.map +1 -1
- package/lib/hooks/useSWRResource.d.ts +1 -1
- package/lib/hooks/useSWRResource.js +2 -4
- package/lib/hooks/useSWRResource.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/services/sitemap/useSitemap.d.ts +3 -0
- package/lib/services/sitemap/useSitemap.js +4 -0
- package/lib/services/sitemap/useSitemap.js.map +1 -0
- 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/BaseProductTile/BaseProductTileContent.d.ts +2 -2
- 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/Button/Button.d.ts +2 -2
- package/lib/ui-kit/Button/Button.js.map +1 -1
- package/lib/ui-kit/Button/ButtonContent.d.ts +19 -0
- package/lib/ui-kit/Button/ButtonContent.js +2 -0
- package/lib/ui-kit/Button/ButtonContent.js.map +1 -0
- package/lib/ui-kit/Button/ButtonInner.d.ts +2 -7
- package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/lib/ui-kit/Button/ButtonProps.d.ts +4 -44
- package/lib/ui-kit/Button/ButtonsSectionContent.d.ts +7 -0
- package/lib/ui-kit/Button/ButtonsSectionContent.js +2 -0
- package/lib/ui-kit/Button/ButtonsSectionContent.js.map +1 -0
- package/lib/ui-kit/Button/renderButtonsSection.d.ts +2 -2
- package/lib/ui-kit/Button/renderButtonsSection.js.map +1 -1
- package/lib/ui-kit/CookiePopup/CookiePopup.js +6 -6
- package/lib/ui-kit/CookiePopup/CookiePopup.js.map +1 -1
- package/{dist/ui-kit/Dialog → lib/ui-kit/DialogManager}/CloseButton.d.ts +1 -1
- package/lib/ui-kit/{Dialog → DialogManager}/CloseButton.js +1 -1
- package/lib/ui-kit/DialogManager/CloseButton.js.map +1 -0
- package/lib/ui-kit/{Dialog → DialogManager}/Dialog.d.ts +0 -1
- package/lib/ui-kit/DialogManager/Dialog.js +15 -0
- package/lib/ui-kit/DialogManager/Dialog.js.map +1 -0
- package/lib/ui-kit/DialogManager/DialogAction.d.ts +12 -0
- package/lib/ui-kit/DialogManager/DialogAction.js.map +1 -0
- package/lib/ui-kit/DialogManager/DialogManager.d.ts +2 -0
- package/lib/ui-kit/DialogManager/DialogManager.js +59 -0
- package/lib/ui-kit/DialogManager/DialogManager.js.map +1 -0
- package/lib/ui-kit/DialogManager/useDialogManager.d.ts +10 -0
- package/lib/ui-kit/DialogManager/useDialogManager.js +7 -0
- package/lib/ui-kit/DialogManager/useDialogManager.js.map +1 -0
- 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/LocationDialog/LocationDialog.d.ts +2 -3
- package/lib/ui-kit/LocationDialog/LocationDialog.js +16 -25
- package/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/lib/ui-kit/LocationDialog/renderForeignOffices.d.ts +5 -0
- package/lib/ui-kit/LocationDialog/renderForeignOffices.js +12 -0
- package/lib/ui-kit/LocationDialog/renderForeignOffices.js.map +1 -0
- package/lib/ui-kit/LocationDialog/renderRegion.d.ts +3 -0
- package/lib/ui-kit/LocationDialog/renderRegion.js +5 -0
- package/lib/ui-kit/LocationDialog/renderRegion.js.map +1 -0
- package/lib/ui-kit/LocationDialog/renderRegionGroup.d.ts +3 -0
- package/lib/ui-kit/LocationDialog/renderRegionGroup.js +5 -0
- package/lib/ui-kit/LocationDialog/renderRegionGroup.js.map +1 -0
- package/lib/ui-kit/LocationDialog/useLocationDialog.d.ts +5 -0
- package/lib/ui-kit/LocationDialog/useLocationDialog.js +11 -0
- package/lib/ui-kit/LocationDialog/useLocationDialog.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/SearchBar/SearchBar.js +6 -9
- package/lib/ui-kit/SearchBar/SearchBar.js.map +1 -1
- package/lib/ui-kit/SearchDialog/SearchDialog.d.ts +1 -3
- package/lib/ui-kit/SearchDialog/SearchDialog.js +7 -8
- package/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/lib/ui-kit/SearchDialog/useSearchDialog.d.ts +6 -0
- package/lib/ui-kit/SearchDialog/useSearchDialog.js +11 -0
- package/lib/ui-kit/SearchDialog/useSearchDialog.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.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/EventBus/defaultEventBus.d.ts +4 -2
- package/mobile/bundle/EventBus/useLatestEvent.d.ts +2 -0
- package/mobile/bundle/bundle.umd.js +975 -590
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
- package/mobile/bundle/components/Bonus/BonusContent.d.ts +2 -7
- package/mobile/bundle/components/BusinessBlock/BusinessBlockContent.d.ts +3 -2
- package/mobile/bundle/components/ButtonsBlock/ButtonsBlockContent.d.ts +2 -2
- package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +2 -2
- 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/CardTransfer/CardTransferContent.d.ts +2 -2
- package/mobile/bundle/components/CarouselCard/CarouselCardContent.d.ts +3 -2
- package/mobile/bundle/components/CarouselCatalogCard/CarouselCatalogCardContent.d.ts +3 -2
- package/mobile/bundle/components/CarouselCatalogCard/CatalogCard.d.ts +2 -2
- package/mobile/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +3 -2
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -2
- package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +4 -9
- package/mobile/bundle/components/ContactsBlock/ContactsBlockContent.d.ts +2 -2
- package/mobile/bundle/components/ContentPage/computeAPIFallback.d.ts +2 -2
- package/mobile/bundle/components/ErrorBlock/ErrorBlockContent.d.ts +2 -2
- package/mobile/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +2 -2
- package/mobile/bundle/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +2 -2
- package/mobile/bundle/components/Footer/FooterProps.d.ts +0 -2
- package/mobile/bundle/components/Footer/SocialMedia.d.ts +2 -2
- package/mobile/bundle/components/Header/HeaderProps.d.ts +0 -4
- package/mobile/bundle/components/Header/HeaderSecondaryMenu.d.ts +1 -1
- package/mobile/bundle/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +2 -2
- package/mobile/bundle/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +2 -2
- package/mobile/bundle/components/MobileAppTile/MobileAppTileContent.d.ts +2 -2
- package/mobile/bundle/components/MortgageFiltration/HotFilterRecord.d.ts +11 -0
- package/mobile/bundle/components/MortgageFiltration/MortgageFiltrationContent.d.ts +12 -0
- package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/bundle/components/ProductBlock/renderBackwardButton.d.ts +2 -2
- package/mobile/bundle/components/PromoTile/PromoTileContent.d.ts +2 -2
- package/mobile/bundle/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.d.ts +2 -2
- package/mobile/bundle/components/RollupItem/rollupIconVersion.d.ts +1 -1
- package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +6 -9
- package/mobile/bundle/components/Tabs/renderTabs.d.ts +12 -0
- package/mobile/bundle/components/TariffsTable/EmbeddableCellData.d.ts +3 -2
- package/mobile/bundle/components/TariffsTable/TariffsTableContent.d.ts +2 -2
- package/mobile/bundle/hooks/useForm.d.ts +1 -0
- package/mobile/bundle/hooks/useList.d.ts +10 -0
- package/mobile/bundle/hooks/useLocation.d.ts +1 -1
- package/mobile/bundle/hooks/useSWRResource.d.ts +1 -1
- package/mobile/bundle/icons/IconName.d.ts +3 -3
- package/mobile/bundle/services/sitemap/useSitemap.d.ts +3 -0
- package/mobile/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -2
- package/mobile/bundle/ui-kit/Button/Button.d.ts +2 -2
- package/mobile/bundle/ui-kit/Button/ButtonContent.d.ts +19 -0
- package/mobile/bundle/ui-kit/Button/ButtonInner.d.ts +2 -7
- package/mobile/bundle/ui-kit/Button/ButtonProps.d.ts +4 -44
- package/mobile/bundle/ui-kit/Button/ButtonsSectionContent.d.ts +7 -0
- package/mobile/bundle/ui-kit/Button/renderButtonsSection.d.ts +2 -2
- package/mobile/bundle/ui-kit/{Dialog → DialogManager}/CloseButton.d.ts +1 -1
- package/mobile/bundle/ui-kit/{Dialog → DialogManager}/Dialog.d.ts +0 -1
- package/mobile/bundle/ui-kit/DialogManager/DialogAction.d.ts +12 -0
- package/mobile/bundle/ui-kit/DialogManager/DialogManager.d.ts +2 -0
- package/mobile/bundle/ui-kit/DialogManager/useDialogManager.d.ts +10 -0
- 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/LocationDialog/LocationDialog.d.ts +2 -3
- package/mobile/bundle/ui-kit/LocationDialog/renderForeignOffices.d.ts +5 -0
- package/mobile/bundle/ui-kit/LocationDialog/renderRegion.d.ts +3 -0
- package/mobile/bundle/ui-kit/LocationDialog/renderRegionGroup.d.ts +3 -0
- package/mobile/bundle/ui-kit/LocationDialog/useLocationDialog.d.ts +5 -0
- package/mobile/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +1 -0
- package/mobile/bundle/ui-kit/SearchDialog/SearchDialog.d.ts +1 -3
- package/mobile/bundle/ui-kit/SearchDialog/useSearchDialog.d.ts +6 -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/EventBus/defaultEventBus.d.ts +4 -2
- package/mobile/dist/EventBus/defaultEventBus.js.map +1 -1
- package/mobile/dist/EventBus/useLatestEvent.d.ts +2 -0
- package/mobile/dist/EventBus/useLatestEvent.js +11 -0
- package/mobile/dist/EventBus/useLatestEvent.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
- package/mobile/dist/components/Blocks.js +2 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/Bonus/BonusContent.d.ts +2 -7
- package/mobile/dist/components/BusinessBlock/BusinessBlockContent.d.ts +3 -2
- package/mobile/dist/components/ButtonsBlock/ButtonsBlockContent.d.ts +2 -2
- 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/CalculatorContent.d.ts +2 -2
- 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/CardTransfer/CardTransferContent.d.ts +2 -2
- package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
- package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
- package/mobile/dist/components/CarouselCard/CarouselCardContent.d.ts +3 -2
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +2 -2
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCardContent.d.ts +3 -2
- package/mobile/dist/components/CarouselCatalogCard/CatalogCard.d.ts +2 -2
- package/mobile/dist/components/CarouselCatalogCard/CatalogCard.js.map +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +3 -2
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +6 -7
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -2
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +4 -9
- package/mobile/dist/components/ContactsBlock/ContactsBlockContent.d.ts +2 -2
- package/mobile/dist/components/ContentPage/ContentPage.js +2 -23
- package/mobile/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/mobile/dist/components/ContentPage/computeAPIFallback.d.ts +2 -2
- package/mobile/dist/components/ContentPage/computeAPIFallback.js +10 -27
- package/mobile/dist/components/ContentPage/computeAPIFallback.js.map +1 -1
- package/mobile/dist/components/ErrorBlock/ErrorBlockContent.d.ts +2 -2
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +2 -2
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +2 -2
- package/mobile/dist/components/Footer/Footer.js +7 -4
- package/mobile/dist/components/Footer/Footer.js.map +1 -1
- package/mobile/dist/components/Footer/FooterProps.d.ts +0 -2
- package/mobile/dist/components/Footer/SocialMedia.d.ts +2 -2
- package/mobile/dist/components/Header/Header.js +4 -3
- package/mobile/dist/components/Header/Header.js.map +1 -1
- package/mobile/dist/components/Header/HeaderProps.d.ts +0 -4
- package/mobile/dist/components/Header/HeaderSecondaryMenu.d.ts +1 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js +10 -9
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js +1 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js.map +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/Header/findActiveSubItem.js.map +1 -0
- package/mobile/dist/components/Header/isHrefActive.js.map +1 -0
- package/mobile/dist/components/Header/isTopItemActive.js.map +1 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +2 -2
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +2 -2
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.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/MobileAppTile/MobileAppTileContent.d.ts +2 -2
- 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/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/dist/components/ProductBlock/renderBackwardButton.d.ts +2 -2
- package/mobile/dist/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/mobile/dist/components/PromoTile/PromoTileContent.d.ts +2 -2
- package/mobile/dist/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.d.ts +2 -2
- 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/StepsBlock/StepsBlockContent.d.ts +6 -9
- 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/components/TariffsTable/EmbeddableCellData.d.ts +3 -2
- package/mobile/dist/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/mobile/dist/components/TariffsTable/TariffsTableContent.d.ts +2 -2
- 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/hooks/useLink.js +3 -3
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/hooks/useList.d.ts +10 -0
- package/mobile/dist/hooks/useList.js +13 -0
- package/mobile/dist/hooks/useList.js.map +1 -0
- package/mobile/dist/hooks/useLocation.d.ts +1 -1
- package/mobile/dist/hooks/useLocation.js +27 -16
- package/mobile/dist/hooks/useLocation.js.map +1 -1
- package/mobile/dist/hooks/useSWRResource.d.ts +1 -1
- package/mobile/dist/hooks/useSWRResource.js +2 -4
- package/mobile/dist/hooks/useSWRResource.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/services/sitemap/useSitemap.d.ts +3 -0
- package/mobile/dist/services/sitemap/useSitemap.js +7 -0
- package/mobile/dist/services/sitemap/useSitemap.js.map +1 -0
- 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/BaseProductTile/BaseProductTileContent.d.ts +2 -2
- 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/Button/Button.d.ts +2 -2
- package/mobile/dist/ui-kit/Button/Button.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonContent.d.ts +19 -0
- package/mobile/dist/{model/Button.js → ui-kit/Button/ButtonContent.js} +1 -1
- package/mobile/dist/ui-kit/Button/ButtonContent.js.map +1 -0
- package/mobile/dist/ui-kit/Button/ButtonInner.d.ts +2 -7
- package/mobile/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonProps.d.ts +4 -44
- package/mobile/dist/ui-kit/Button/ButtonsSectionContent.d.ts +7 -0
- package/mobile/dist/ui-kit/Button/ButtonsSectionContent.js +2 -0
- package/mobile/dist/ui-kit/Button/ButtonsSectionContent.js.map +1 -0
- package/mobile/dist/ui-kit/Button/renderButtonsSection.d.ts +2 -2
- package/mobile/dist/ui-kit/Button/renderButtonsSection.js.map +1 -1
- package/mobile/dist/ui-kit/CookiePopup/CookiePopup.js +6 -6
- package/mobile/dist/ui-kit/CookiePopup/CookiePopup.js.map +1 -1
- package/mobile/dist/ui-kit/DialogManager/CloseButton.d.ts +7 -0
- package/{dist/ui-kit/Dialog → mobile/dist/ui-kit/DialogManager}/CloseButton.js +1 -1
- package/mobile/dist/ui-kit/DialogManager/CloseButton.js.map +1 -0
- package/mobile/dist/ui-kit/DialogManager/Dialog.d.ts +7 -0
- package/mobile/dist/ui-kit/DialogManager/Dialog.js +17 -0
- package/mobile/dist/ui-kit/DialogManager/Dialog.js.map +1 -0
- package/mobile/dist/ui-kit/DialogManager/DialogAction.d.ts +12 -0
- package/mobile/dist/ui-kit/DialogManager/DialogAction.js.map +1 -0
- package/mobile/dist/ui-kit/DialogManager/DialogManager.d.ts +2 -0
- package/mobile/dist/ui-kit/DialogManager/DialogManager.js +61 -0
- package/mobile/dist/ui-kit/DialogManager/DialogManager.js.map +1 -0
- package/mobile/dist/ui-kit/DialogManager/useDialogManager.d.ts +10 -0
- package/mobile/dist/ui-kit/DialogManager/useDialogManager.js +10 -0
- package/mobile/dist/ui-kit/DialogManager/useDialogManager.js.map +1 -0
- 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/LocationDialog/LocationDialog.d.ts +2 -3
- package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js +17 -26
- package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/mobile/dist/ui-kit/LocationDialog/renderForeignOffices.d.ts +5 -0
- package/mobile/dist/ui-kit/LocationDialog/renderForeignOffices.js +15 -0
- package/mobile/dist/ui-kit/LocationDialog/renderForeignOffices.js.map +1 -0
- package/mobile/dist/ui-kit/LocationDialog/renderRegion.d.ts +3 -0
- package/mobile/dist/ui-kit/LocationDialog/renderRegion.js +8 -0
- package/mobile/dist/ui-kit/LocationDialog/renderRegion.js.map +1 -0
- package/mobile/dist/ui-kit/LocationDialog/renderRegionGroup.d.ts +3 -0
- package/mobile/dist/ui-kit/LocationDialog/renderRegionGroup.js +8 -0
- package/mobile/dist/ui-kit/LocationDialog/renderRegionGroup.js.map +1 -0
- package/mobile/dist/ui-kit/LocationDialog/useLocationDialog.d.ts +5 -0
- package/mobile/dist/ui-kit/LocationDialog/useLocationDialog.js +14 -0
- package/mobile/dist/ui-kit/LocationDialog/useLocationDialog.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/SearchBar/SearchBar.js +6 -9
- package/mobile/dist/ui-kit/SearchBar/SearchBar.js.map +1 -1
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.d.ts +1 -3
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js +8 -9
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/dist/ui-kit/SearchDialog/useSearchDialog.d.ts +6 -0
- package/mobile/dist/ui-kit/SearchDialog/useSearchDialog.js +14 -0
- package/mobile/dist/ui-kit/SearchDialog/useSearchDialog.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.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/EventBus/defaultEventBus.d.ts +4 -2
- package/mobile/lib/EventBus/defaultEventBus.js.map +1 -1
- package/mobile/lib/EventBus/useLatestEvent.d.ts +2 -0
- package/mobile/lib/EventBus/useLatestEvent.js +8 -0
- package/mobile/lib/EventBus/useLatestEvent.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
- package/mobile/lib/components/Blocks.js +2 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/Bonus/BonusContent.d.ts +2 -7
- package/mobile/lib/components/BusinessBlock/BusinessBlockContent.d.ts +3 -2
- package/mobile/lib/components/ButtonsBlock/ButtonsBlockContent.d.ts +2 -2
- 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/CalculatorContent.d.ts +2 -2
- 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/CardTransfer/CardTransferContent.d.ts +2 -2
- package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +1 -1
- package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -1
- package/mobile/lib/components/CarouselCard/CarouselCardContent.d.ts +3 -2
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +2 -2
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCardContent.d.ts +3 -2
- package/mobile/lib/components/CarouselCatalogCard/CatalogCard.d.ts +2 -2
- package/mobile/lib/components/CarouselCatalogCard/CatalogCard.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +3 -2
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +7 -8
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -2
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +4 -9
- package/mobile/lib/components/ContactsBlock/ContactsBlockContent.d.ts +2 -2
- package/mobile/lib/components/ContentPage/ContentPage.js +2 -23
- package/mobile/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/mobile/lib/components/ContentPage/computeAPIFallback.d.ts +2 -2
- package/mobile/lib/components/ContentPage/computeAPIFallback.js +8 -25
- package/mobile/lib/components/ContentPage/computeAPIFallback.js.map +1 -1
- package/mobile/lib/components/ErrorBlock/ErrorBlockContent.d.ts +2 -2
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +2 -2
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +2 -2
- package/mobile/lib/components/Footer/Footer.js +7 -4
- package/mobile/lib/components/Footer/Footer.js.map +1 -1
- package/mobile/lib/components/Footer/FooterProps.d.ts +0 -2
- package/mobile/lib/components/Footer/SocialMedia.d.ts +2 -2
- package/mobile/lib/components/Header/Header.js +4 -3
- package/mobile/lib/components/Header/Header.js.map +1 -1
- package/mobile/lib/components/Header/HeaderProps.d.ts +0 -4
- package/mobile/lib/components/Header/HeaderSecondaryMenu.d.ts +1 -1
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js +10 -9
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js +1 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js.map +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/Header/findActiveSubItem.js.map +1 -0
- package/mobile/lib/components/Header/isHrefActive.js.map +1 -0
- package/mobile/lib/components/Header/isTopItemActive.js.map +1 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +2 -2
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +2 -2
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.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/MobileAppTile/MobileAppTileContent.d.ts +2 -2
- 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/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/lib/components/ProductBlock/renderBackwardButton.d.ts +2 -2
- package/mobile/lib/components/ProductBlock/renderBackwardButton.js.map +1 -1
- package/mobile/lib/components/PromoTile/PromoTileContent.d.ts +2 -2
- package/mobile/lib/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.d.ts +2 -2
- 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/StepsBlock/StepsBlockContent.d.ts +6 -9
- 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/components/TariffsTable/EmbeddableCellData.d.ts +3 -2
- package/mobile/lib/components/TariffsTable/EmbeddableCellData.js.map +1 -1
- package/mobile/lib/components/TariffsTable/TariffsTableContent.d.ts +2 -2
- 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/hooks/useLink.js +3 -3
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/hooks/useList.d.ts +10 -0
- package/mobile/lib/hooks/useList.js +10 -0
- package/mobile/lib/hooks/useList.js.map +1 -0
- package/mobile/lib/hooks/useLocation.d.ts +1 -1
- package/mobile/lib/hooks/useLocation.js +28 -17
- package/mobile/lib/hooks/useLocation.js.map +1 -1
- package/mobile/lib/hooks/useSWRResource.d.ts +1 -1
- package/mobile/lib/hooks/useSWRResource.js +2 -4
- package/mobile/lib/hooks/useSWRResource.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/services/sitemap/useSitemap.d.ts +3 -0
- package/mobile/lib/services/sitemap/useSitemap.js +4 -0
- package/mobile/lib/services/sitemap/useSitemap.js.map +1 -0
- 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/BaseProductTile/BaseProductTileContent.d.ts +2 -2
- 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/Button/Button.d.ts +2 -2
- package/mobile/lib/ui-kit/Button/Button.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonContent.d.ts +19 -0
- package/mobile/lib/ui-kit/Button/ButtonContent.js +2 -0
- package/mobile/lib/ui-kit/Button/ButtonContent.js.map +1 -0
- package/mobile/lib/ui-kit/Button/ButtonInner.d.ts +2 -7
- package/mobile/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonProps.d.ts +4 -44
- package/mobile/lib/ui-kit/Button/ButtonsSectionContent.d.ts +7 -0
- package/mobile/lib/ui-kit/Button/ButtonsSectionContent.js +2 -0
- package/mobile/lib/ui-kit/Button/ButtonsSectionContent.js.map +1 -0
- package/mobile/lib/ui-kit/Button/renderButtonsSection.d.ts +2 -2
- package/mobile/lib/ui-kit/Button/renderButtonsSection.js.map +1 -1
- package/mobile/lib/ui-kit/CookiePopup/CookiePopup.js +6 -6
- package/mobile/lib/ui-kit/CookiePopup/CookiePopup.js.map +1 -1
- package/mobile/lib/ui-kit/DialogManager/CloseButton.d.ts +7 -0
- package/mobile/lib/ui-kit/{Dialog → DialogManager}/CloseButton.js +1 -1
- package/mobile/lib/ui-kit/DialogManager/CloseButton.js.map +1 -0
- package/mobile/lib/ui-kit/DialogManager/Dialog.d.ts +7 -0
- package/mobile/lib/ui-kit/DialogManager/Dialog.js +15 -0
- package/mobile/lib/ui-kit/DialogManager/Dialog.js.map +1 -0
- package/mobile/lib/ui-kit/DialogManager/DialogAction.d.ts +12 -0
- package/mobile/lib/ui-kit/DialogManager/DialogAction.js.map +1 -0
- package/mobile/lib/ui-kit/DialogManager/DialogManager.d.ts +2 -0
- package/mobile/lib/ui-kit/DialogManager/DialogManager.js +59 -0
- package/mobile/lib/ui-kit/DialogManager/DialogManager.js.map +1 -0
- package/mobile/lib/ui-kit/DialogManager/useDialogManager.d.ts +10 -0
- package/mobile/lib/ui-kit/DialogManager/useDialogManager.js +7 -0
- package/mobile/lib/ui-kit/DialogManager/useDialogManager.js.map +1 -0
- 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/LocationDialog/LocationDialog.d.ts +2 -3
- package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js +16 -25
- package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/mobile/lib/ui-kit/LocationDialog/renderForeignOffices.d.ts +5 -0
- package/mobile/lib/ui-kit/LocationDialog/renderForeignOffices.js +12 -0
- package/mobile/lib/ui-kit/LocationDialog/renderForeignOffices.js.map +1 -0
- package/mobile/lib/ui-kit/LocationDialog/renderRegion.d.ts +3 -0
- package/mobile/lib/ui-kit/LocationDialog/renderRegion.js +5 -0
- package/mobile/lib/ui-kit/LocationDialog/renderRegion.js.map +1 -0
- package/mobile/lib/ui-kit/LocationDialog/renderRegionGroup.d.ts +3 -0
- package/mobile/lib/ui-kit/LocationDialog/renderRegionGroup.js +5 -0
- package/mobile/lib/ui-kit/LocationDialog/renderRegionGroup.js.map +1 -0
- package/mobile/lib/ui-kit/LocationDialog/useLocationDialog.d.ts +5 -0
- package/mobile/lib/ui-kit/LocationDialog/useLocationDialog.js +11 -0
- package/mobile/lib/ui-kit/LocationDialog/useLocationDialog.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/SearchBar/SearchBar.js +6 -9
- package/mobile/lib/ui-kit/SearchBar/SearchBar.js.map +1 -1
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.d.ts +1 -3
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js +7 -8
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/lib/ui-kit/SearchDialog/useSearchDialog.d.ts +6 -0
- package/mobile/lib/ui-kit/SearchDialog/useSearchDialog.js +11 -0
- package/mobile/lib/ui-kit/SearchDialog/useSearchDialog.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.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/EventBus/defaultEventBus.ts +4 -2
- package/mobile/src/EventBus/useLatestEvent.ts +16 -0
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +2 -2
- package/mobile/src/components/Blocks.ts +2 -0
- package/mobile/src/components/Bonus/BonusContent.ts +5 -9
- package/mobile/src/components/BusinessBlock/BusinessBlockContent.ts +3 -3
- package/mobile/src/components/ButtonsBlock/ButtonsBlockContent.ts +2 -2
- package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +36 -41
- package/mobile/src/components/Calculator/Calculator.tsx +69 -118
- package/mobile/src/components/Calculator/CalculatorContent.ts +2 -2
- 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/CardTransfer/CardTransferContent.ts +2 -2
- package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.tsx +1 -1
- package/mobile/src/components/CarouselCard/CarouselCardContent.ts +3 -3
- package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +7 -6
- package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCardContent.ts +3 -3
- package/mobile/src/components/CarouselCatalogCard/CatalogCard.ts +2 -2
- package/mobile/src/components/CarouselProductCard/CarouselProductCardContent.ts +2 -2
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +15 -33
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -2
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +4 -9
- package/mobile/src/components/ContactsBlock/ContactsBlockContent.ts +2 -2
- package/mobile/src/components/ContentPage/ContentPage.tsx +18 -54
- package/mobile/src/components/ContentPage/computeAPIFallback.ts +10 -27
- package/mobile/src/components/ErrorBlock/ErrorBlockContent.ts +2 -2
- package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +2 -2
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +2 -2
- package/mobile/src/components/Footer/Footer.tsx +8 -8
- package/mobile/src/components/Footer/FooterProps.ts +1 -4
- package/mobile/src/components/Footer/SocialMedia.tsx +2 -2
- package/mobile/src/components/Header/Header.tsx +4 -3
- package/mobile/src/components/Header/HeaderProps.ts +1 -6
- package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +13 -11
- package/mobile/src/components/Header/HeaderSubMenu.tsx +1 -1
- package/mobile/src/components/Header/HeaderTop.tsx +27 -14
- package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlockContent.ts +2 -2
- package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlockInner.tsx +2 -2
- package/mobile/src/components/MobileAppTile/MobileAppTile.tsx +2 -1
- package/mobile/src/components/MobileAppTile/MobileAppTileContent.ts +2 -2
- 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/ProductBlock/ProductBlockContent.ts +2 -2
- package/mobile/src/components/ProductBlock/renderBackwardButton.tsx +2 -2
- package/mobile/src/components/PromoTile/PromoTileContent.ts +2 -2
- package/mobile/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.ts +2 -2
- 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/StepsBlock/StepsBlockContent.ts +9 -9
- package/mobile/src/components/Tabs/Tabs.tsx +42 -53
- package/mobile/src/components/Tabs/renderTabs.tsx +37 -0
- package/mobile/src/components/TariffsTable/EmbeddableCellData.tsx +3 -2
- package/mobile/src/components/TariffsTable/TariffsTableContent.ts +2 -2
- package/mobile/src/hooks/useForm.ts +7 -0
- package/mobile/src/hooks/useLink.ts +3 -3
- package/mobile/src/hooks/useList.ts +24 -0
- package/mobile/src/hooks/useLocation.ts +34 -28
- package/mobile/src/hooks/useSWRResource.ts +9 -4
- 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/services/sitemap/useSitemap.ts +7 -0
- 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/BaseProductTile/BaseProductTileContent.ts +2 -2
- 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/Button/Button.tsx +14 -16
- package/mobile/src/ui-kit/Button/ButtonContent.ts +21 -0
- package/mobile/src/ui-kit/Button/ButtonInner.tsx +5 -9
- package/mobile/src/ui-kit/Button/ButtonProps.ts +4 -49
- package/mobile/src/ui-kit/Button/ButtonsSectionContent.ts +8 -0
- package/mobile/src/ui-kit/Button/renderButtonsSection.tsx +3 -3
- package/mobile/src/ui-kit/CookiePopup/CookiePopup.tsx +12 -17
- package/mobile/src/ui-kit/{Dialog → DialogManager}/CloseButton.tsx +3 -3
- package/mobile/src/ui-kit/DialogManager/Dialog.tsx +31 -0
- package/mobile/src/ui-kit/DialogManager/DialogAction.ts +15 -0
- package/mobile/src/ui-kit/DialogManager/DialogManager.tsx +85 -0
- package/mobile/src/ui-kit/DialogManager/useDialogManager.ts +14 -0
- package/mobile/src/ui-kit/InputRange/InputRangeProps.ts +1 -0
- package/mobile/src/ui-kit/ListControlProps.ts +5 -0
- package/mobile/src/ui-kit/LocationDialog/LocationDialog.tsx +57 -138
- package/mobile/src/ui-kit/LocationDialog/renderForeignOffices.tsx +37 -0
- package/mobile/src/ui-kit/LocationDialog/renderRegion.tsx +15 -0
- package/mobile/src/ui-kit/LocationDialog/renderRegionGroup.tsx +15 -0
- package/mobile/src/ui-kit/LocationDialog/useLocationDialog.tsx +11 -0
- package/mobile/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +10 -2
- package/mobile/src/ui-kit/SearchBar/SearchBar.tsx +14 -15
- package/mobile/src/ui-kit/SearchDialog/SearchDialog.tsx +8 -10
- package/mobile/src/ui-kit/SearchDialog/useSearchDialog.tsx +12 -0
- package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +1 -1
- 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/EventBus/defaultEventBus.ts +4 -2
- package/src/EventBus/useLatestEvent.ts +16 -0
- package/src/components/ApplicationForm/ApplicationFormContent.ts +2 -2
- package/src/components/Blocks.mobile.ts +2 -0
- package/src/components/Bonus/BonusContent.ts +5 -9
- package/src/components/BusinessBlock/BusinessBlock.fixture.tsx +2 -3
- package/src/components/BusinessBlock/BusinessBlockContent.ts +3 -3
- package/src/components/ButtonsBlock/ButtonsBlock.fixture.mobile.tsx +2 -2
- package/src/components/ButtonsBlock/ButtonsBlock.fixture.tsx +2 -2
- package/src/components/ButtonsBlock/ButtonsBlockContent.ts +2 -2
- package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +36 -41
- package/src/components/Calculator/Calculator.fixture.mobile.tsx +114 -0
- package/src/components/Calculator/Calculator.fixture.tsx +2 -2
- package/src/components/Calculator/Calculator.mobile.tsx +85 -0
- package/src/components/Calculator/CalculatorContent.ts +2 -2
- 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/CardTransfer/CardTransferContent.ts +2 -2
- package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.mobile.tsx +1 -1
- package/src/components/CarouselCard/CarouselCardContent.ts +3 -3
- package/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +7 -6
- package/src/components/CarouselCatalogCard/CarouselCatalogCardContent.ts +3 -3
- package/src/components/CarouselCatalogCard/CatalogCard.ts +2 -2
- package/src/components/CarouselProductCard/CarouselProductCard.fixture.tsx +3 -3
- package/src/components/CarouselProductCard/CarouselProductCardContent.ts +2 -2
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +15 -33
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -2
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.mobile.tsx +3 -2
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.tsx +4 -4
- package/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +4 -9
- package/src/components/ContactsBlock/ContactsBlockContent.ts +2 -2
- package/src/components/ContentPage/ContentPage.tsx +18 -54
- package/src/components/ContentPage/computeAPIFallback.ts +10 -27
- package/src/components/ErrorBlock/ErrorBlockContent.ts +2 -2
- package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +2 -2
- package/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +2 -2
- package/src/components/Footer/Footer.fixture.mobile.tsx +3 -3
- package/src/components/Footer/Footer.fixture.tsx +3 -5
- package/src/components/Footer/Footer.mobile.tsx +8 -8
- package/src/components/Footer/Footer.tsx +5 -3
- package/src/components/Footer/FooterProps.ts +1 -4
- package/src/components/Footer/SocialMedia.tsx +2 -2
- package/src/components/Header/Header.fixture.mobile.tsx +14 -5
- package/src/components/Header/Header.fixture.tsx +13 -4
- package/src/components/Header/Header.mobile.tsx +4 -3
- package/src/components/Header/Header.tsx +7 -11
- package/src/components/Header/HeaderProps.ts +1 -6
- package/src/components/Header/HeaderSecondaryMenu.tsx +13 -11
- package/src/components/Header/HeaderSubMenu.tsx +1 -1
- package/src/components/Header/HeaderTop.tsx +27 -14
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlock.fixture.tsx +2 -2
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlockContent.ts +2 -2
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlockInner.tsx +2 -2
- package/src/components/MobileAppTile/MobileAppTile.fixture.mobile.tsx +8 -19
- package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +10 -12
- package/src/components/MobileAppTile/MobileAppTile.tsx +2 -1
- package/src/components/MobileAppTile/MobileAppTileContent.ts +2 -2
- 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/ProductBlock/ProductBlock.fixture.mobile.tsx +2 -2
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +4 -4
- package/src/components/ProductBlock/ProductBlockContent.ts +2 -2
- package/src/components/ProductBlock/renderBackwardButton.tsx +2 -2
- package/src/components/ProductGallery/ProductGallery.fixture.mobile.tsx +3 -3
- package/src/components/ProductGallery/ProductGallery.fixture.tsx +3 -3
- package/src/components/PromoTile/PromoTileContent.ts +2 -2
- package/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.fixture.mobile.tsx +2 -2
- package/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfo.fixture.tsx +2 -2
- package/src/components/RepresentativeOfficeInfo/RepresentativeOfficeInfoContent.ts +2 -2
- 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/StepsBlock/StepsBlockContent.ts +9 -9
- package/src/components/Tabs/Tabs.tsx +42 -53
- package/src/components/Tabs/renderTabs.tsx +37 -0
- package/src/components/TariffsTable/EmbeddableCellData.mobile.tsx +3 -2
- package/src/components/TariffsTable/EmbeddableCellData.tsx +3 -2
- package/src/components/TariffsTable/TariffsTableContent.ts +2 -2
- package/src/hooks/useForm.ts +7 -0
- package/src/hooks/useLink.ts +3 -3
- package/src/hooks/useList.ts +24 -0
- package/src/hooks/useLocation.ts +34 -28
- package/src/hooks/useSWRResource.ts +9 -4
- package/src/icons/ArrowDownSolidIcon.svg +1 -1
- package/src/icons/ArrowUpSolidIcon.svg +1 -1
- package/src/icons/IconName.ts +4 -4
- package/src/services/sitemap/useSitemap.ts +7 -0
- package/src/ui-kit/BaseFiltration/BaseFiltrationInner.tsx +2 -2
- package/src/ui-kit/BaseFiltration/renderFiltrationForm.tsx +4 -4
- package/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +2 -2
- package/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
- package/src/ui-kit/BenefitsList/DefaultBenefitsList.tsx +8 -3
- package/src/ui-kit/Button/Button.tsx +14 -16
- package/src/ui-kit/Button/ButtonContent.ts +21 -0
- package/src/ui-kit/Button/ButtonInner.tsx +5 -9
- package/src/ui-kit/Button/ButtonProps.ts +4 -49
- package/src/ui-kit/Button/ButtonsSectionContent.ts +8 -0
- package/src/ui-kit/Button/renderButtonsSection.tsx +3 -3
- package/src/ui-kit/CookiePopup/CookiePopup.tsx +12 -17
- package/src/ui-kit/{Dialog → DialogManager}/CloseButton.tsx +3 -3
- package/src/ui-kit/DialogManager/Dialog.tsx +31 -0
- package/src/ui-kit/DialogManager/DialogAction.ts +15 -0
- package/src/ui-kit/DialogManager/DialogManager.tsx +85 -0
- package/src/ui-kit/DialogManager/useDialogManager.ts +14 -0
- package/src/ui-kit/InputRange/InputRangeProps.ts +1 -0
- package/src/ui-kit/ListControlProps.ts +5 -0
- package/src/ui-kit/LocationDialog/LocationDialog.fixture.tsx +1 -74
- package/src/ui-kit/LocationDialog/LocationDialog.tsx +57 -138
- package/src/ui-kit/LocationDialog/renderForeignOffices.tsx +37 -0
- package/src/ui-kit/LocationDialog/renderRegion.tsx +15 -0
- package/src/ui-kit/LocationDialog/renderRegionGroup.tsx +15 -0
- package/src/ui-kit/LocationDialog/useLocationDialog.tsx +11 -0
- package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +10 -2
- package/src/ui-kit/SearchBar/SearchBar.tsx +14 -15
- package/src/ui-kit/SearchDialog/SearchDialog.tsx +8 -10
- package/src/ui-kit/SearchDialog/useSearchDialog.tsx +12 -0
- package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +1 -1
- 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/hooks/useCachedAsyncData.d.ts +0 -2
- package/bundle/model/Button.d.ts +0 -15
- package/bundle/ui-kit/BaseTile/getTileRightPadding.d.ts +0 -1
- package/bundle/ui-kit/Dialog/DialogAction.d.ts +0 -12
- package/bundle/ui-kit/Dialog/useDialog.d.ts +0 -4
- package/bundle/ui-kit/Dialog/useDialogHandlers.d.ts +0 -6
- package/bundle/ui-kit/Dialog/useDialogProps.d.ts +0 -7
- package/bundle/ui-kit/LocationDialog/LocationDialogProps.d.ts +0 -14
- 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/hooks/useCachedAsyncData.d.ts +0 -2
- package/dist/hooks/useCachedAsyncData.js +0 -25
- package/dist/hooks/useCachedAsyncData.js.map +0 -1
- package/dist/model/Button.d.ts +0 -15
- package/dist/model/Button.js.map +0 -1
- package/dist/services/sitemap/findActiveSubItem.js.map +0 -1
- package/dist/services/sitemap/isHrefActive.js.map +0 -1
- package/dist/services/sitemap/isTopItemActive.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/dist/ui-kit/Dialog/CloseButton.js.map +0 -1
- package/dist/ui-kit/Dialog/Dialog.js +0 -22
- package/dist/ui-kit/Dialog/Dialog.js.map +0 -1
- package/dist/ui-kit/Dialog/DialogAction.d.ts +0 -12
- package/dist/ui-kit/Dialog/DialogAction.js.map +0 -1
- package/dist/ui-kit/Dialog/useDialog.d.ts +0 -4
- package/dist/ui-kit/Dialog/useDialog.js +0 -9
- package/dist/ui-kit/Dialog/useDialog.js.map +0 -1
- package/dist/ui-kit/Dialog/useDialogHandlers.d.ts +0 -6
- package/dist/ui-kit/Dialog/useDialogHandlers.js +0 -21
- package/dist/ui-kit/Dialog/useDialogHandlers.js.map +0 -1
- package/dist/ui-kit/Dialog/useDialogProps.d.ts +0 -7
- package/dist/ui-kit/Dialog/useDialogProps.js +0 -39
- package/dist/ui-kit/Dialog/useDialogProps.js.map +0 -1
- package/dist/ui-kit/LocationDialog/LocationDialogProps.d.ts +0 -14
- package/dist/ui-kit/LocationDialog/LocationDialogProps.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/hooks/useCachedAsyncData.d.ts +0 -2
- package/lib/hooks/useCachedAsyncData.js +0 -22
- package/lib/hooks/useCachedAsyncData.js.map +0 -1
- package/lib/model/Button.d.ts +0 -15
- package/lib/model/Button.js +0 -2
- package/lib/model/Button.js.map +0 -1
- package/lib/services/sitemap/findActiveSubItem.js.map +0 -1
- package/lib/services/sitemap/isHrefActive.js.map +0 -1
- package/lib/services/sitemap/isTopItemActive.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/lib/ui-kit/Dialog/CloseButton.js.map +0 -1
- package/lib/ui-kit/Dialog/Dialog.js +0 -20
- package/lib/ui-kit/Dialog/Dialog.js.map +0 -1
- package/lib/ui-kit/Dialog/DialogAction.d.ts +0 -12
- package/lib/ui-kit/Dialog/DialogAction.js.map +0 -1
- package/lib/ui-kit/Dialog/useDialog.d.ts +0 -4
- package/lib/ui-kit/Dialog/useDialog.js +0 -6
- package/lib/ui-kit/Dialog/useDialog.js.map +0 -1
- package/lib/ui-kit/Dialog/useDialogHandlers.d.ts +0 -6
- package/lib/ui-kit/Dialog/useDialogHandlers.js +0 -18
- package/lib/ui-kit/Dialog/useDialogHandlers.js.map +0 -1
- package/lib/ui-kit/Dialog/useDialogProps.d.ts +0 -7
- package/lib/ui-kit/Dialog/useDialogProps.js +0 -36
- package/lib/ui-kit/Dialog/useDialogProps.js.map +0 -1
- package/lib/ui-kit/LocationDialog/LocationDialogProps.d.ts +0 -14
- package/lib/ui-kit/LocationDialog/LocationDialogProps.js +0 -2
- package/lib/ui-kit/LocationDialog/LocationDialogProps.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/hooks/useCachedAsyncData.d.ts +0 -2
- package/mobile/bundle/model/Button.d.ts +0 -15
- package/mobile/bundle/ui-kit/BaseTile/getTileRightPadding.d.ts +0 -1
- package/mobile/bundle/ui-kit/Dialog/DialogAction.d.ts +0 -12
- package/mobile/bundle/ui-kit/Dialog/useDialog.d.ts +0 -4
- package/mobile/bundle/ui-kit/Dialog/useDialogHandlers.d.ts +0 -6
- package/mobile/bundle/ui-kit/Dialog/useDialogProps.d.ts +0 -7
- package/mobile/bundle/ui-kit/LocationDialog/LocationDialogProps.d.ts +0 -14
- 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/hooks/useCachedAsyncData.d.ts +0 -2
- package/mobile/dist/hooks/useCachedAsyncData.js +0 -25
- package/mobile/dist/hooks/useCachedAsyncData.js.map +0 -1
- package/mobile/dist/model/Button.d.ts +0 -15
- package/mobile/dist/model/Button.js.map +0 -1
- package/mobile/dist/services/sitemap/findActiveSubItem.js.map +0 -1
- package/mobile/dist/services/sitemap/isHrefActive.js.map +0 -1
- package/mobile/dist/services/sitemap/isTopItemActive.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/dist/ui-kit/Dialog/CloseButton.d.ts +0 -7
- package/mobile/dist/ui-kit/Dialog/CloseButton.js.map +0 -1
- package/mobile/dist/ui-kit/Dialog/Dialog.d.ts +0 -8
- package/mobile/dist/ui-kit/Dialog/Dialog.js +0 -22
- package/mobile/dist/ui-kit/Dialog/Dialog.js.map +0 -1
- package/mobile/dist/ui-kit/Dialog/DialogAction.d.ts +0 -12
- package/mobile/dist/ui-kit/Dialog/DialogAction.js.map +0 -1
- package/mobile/dist/ui-kit/Dialog/useDialog.d.ts +0 -4
- package/mobile/dist/ui-kit/Dialog/useDialog.js +0 -9
- package/mobile/dist/ui-kit/Dialog/useDialog.js.map +0 -1
- package/mobile/dist/ui-kit/Dialog/useDialogHandlers.d.ts +0 -6
- package/mobile/dist/ui-kit/Dialog/useDialogHandlers.js +0 -21
- package/mobile/dist/ui-kit/Dialog/useDialogHandlers.js.map +0 -1
- package/mobile/dist/ui-kit/Dialog/useDialogProps.d.ts +0 -7
- package/mobile/dist/ui-kit/Dialog/useDialogProps.js +0 -39
- package/mobile/dist/ui-kit/Dialog/useDialogProps.js.map +0 -1
- package/mobile/dist/ui-kit/LocationDialog/LocationDialogProps.d.ts +0 -14
- package/mobile/dist/ui-kit/LocationDialog/LocationDialogProps.js +0 -2
- package/mobile/dist/ui-kit/LocationDialog/LocationDialogProps.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/hooks/useCachedAsyncData.d.ts +0 -2
- package/mobile/lib/hooks/useCachedAsyncData.js +0 -22
- package/mobile/lib/hooks/useCachedAsyncData.js.map +0 -1
- package/mobile/lib/model/Button.d.ts +0 -15
- package/mobile/lib/model/Button.js +0 -2
- package/mobile/lib/model/Button.js.map +0 -1
- package/mobile/lib/services/sitemap/findActiveSubItem.js.map +0 -1
- package/mobile/lib/services/sitemap/isHrefActive.js.map +0 -1
- package/mobile/lib/services/sitemap/isTopItemActive.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/lib/ui-kit/Dialog/CloseButton.d.ts +0 -7
- package/mobile/lib/ui-kit/Dialog/CloseButton.js.map +0 -1
- package/mobile/lib/ui-kit/Dialog/Dialog.d.ts +0 -8
- package/mobile/lib/ui-kit/Dialog/Dialog.js +0 -20
- package/mobile/lib/ui-kit/Dialog/Dialog.js.map +0 -1
- package/mobile/lib/ui-kit/Dialog/DialogAction.d.ts +0 -12
- package/mobile/lib/ui-kit/Dialog/DialogAction.js.map +0 -1
- package/mobile/lib/ui-kit/Dialog/useDialog.d.ts +0 -4
- package/mobile/lib/ui-kit/Dialog/useDialog.js +0 -6
- package/mobile/lib/ui-kit/Dialog/useDialog.js.map +0 -1
- package/mobile/lib/ui-kit/Dialog/useDialogHandlers.d.ts +0 -6
- package/mobile/lib/ui-kit/Dialog/useDialogHandlers.js +0 -18
- package/mobile/lib/ui-kit/Dialog/useDialogHandlers.js.map +0 -1
- package/mobile/lib/ui-kit/Dialog/useDialogProps.d.ts +0 -7
- package/mobile/lib/ui-kit/Dialog/useDialogProps.js +0 -36
- package/mobile/lib/ui-kit/Dialog/useDialogProps.js.map +0 -1
- package/mobile/lib/ui-kit/LocationDialog/LocationDialogProps.d.ts +0 -14
- package/mobile/lib/ui-kit/LocationDialog/LocationDialogProps.js +0 -2
- package/mobile/lib/ui-kit/LocationDialog/LocationDialogProps.js.map +0 -1
- package/mobile/src/components/CarouselProgramsCard/programCardStyles.ts +0 -2
- package/mobile/src/components/Header/sitemap.wcms-resource.json +0 -144
- 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/hooks/useCachedAsyncData.ts +0 -37
- package/mobile/src/model/Button.ts +0 -16
- package/mobile/src/ui-kit/BaseTile/getTileRightPadding.ts +0 -12
- package/mobile/src/ui-kit/Dialog/Dialog.tsx +0 -46
- package/mobile/src/ui-kit/Dialog/DialogAction.ts +0 -14
- package/mobile/src/ui-kit/Dialog/useDialog.ts +0 -6
- package/mobile/src/ui-kit/Dialog/useDialogHandlers.ts +0 -28
- package/mobile/src/ui-kit/Dialog/useDialogProps.ts +0 -48
- package/mobile/src/ui-kit/LocationDialog/LocationDialogProps.ts +0 -21
- package/src/components/CarouselProgramsCard/programCardStyles.mobile.ts +0 -2
- package/src/components/CarouselProgramsCard/programCardStyles.ts +0 -2
- package/src/components/Header/sitemap.wcms-resource.json +0 -144
- 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/hooks/useCachedAsyncData.ts +0 -37
- package/src/model/Button.ts +0 -16
- package/src/ui-kit/BaseTile/getTileRightPadding.ts +0 -12
- package/src/ui-kit/Dialog/Dialog.tsx +0 -46
- package/src/ui-kit/Dialog/DialogAction.ts +0 -14
- package/src/ui-kit/Dialog/useDialog.ts +0 -6
- package/src/ui-kit/Dialog/useDialogHandlers.ts +0 -28
- package/src/ui-kit/Dialog/useDialogProps.ts +0 -48
- package/src/ui-kit/LocationDialog/LocationDialogProps.ts +0 -21
- /package/bundle/{services/sitemap → components/Header}/findActiveSubItem.d.ts +0 -0
- /package/bundle/{services/sitemap → components/Header}/isHrefActive.d.ts +0 -0
- /package/bundle/{services/sitemap → components/Header}/isTopItemActive.d.ts +0 -0
- /package/cosmos-static/icons/{ChevronLeft.svg → ChevronLeftIcon.svg} +0 -0
- /package/dist/{services/sitemap → components/Header}/findActiveSubItem.d.ts +0 -0
- /package/dist/{services/sitemap → components/Header}/findActiveSubItem.js +0 -0
- /package/dist/{services/sitemap → components/Header}/isHrefActive.d.ts +0 -0
- /package/dist/{services/sitemap → components/Header}/isHrefActive.js +0 -0
- /package/dist/{services/sitemap → components/Header}/isTopItemActive.d.ts +0 -0
- /package/dist/{services/sitemap → components/Header}/isTopItemActive.js +0 -0
- /package/dist/ui-kit/{Dialog → DialogManager}/DialogAction.js +0 -0
- /package/lib/{services/sitemap → components/Header}/findActiveSubItem.d.ts +0 -0
- /package/lib/{services/sitemap → components/Header}/findActiveSubItem.js +0 -0
- /package/lib/{services/sitemap → components/Header}/isHrefActive.d.ts +0 -0
- /package/lib/{services/sitemap → components/Header}/isHrefActive.js +0 -0
- /package/lib/{services/sitemap → components/Header}/isTopItemActive.d.ts +0 -0
- /package/lib/{services/sitemap → components/Header}/isTopItemActive.js +0 -0
- /package/lib/ui-kit/{Dialog → DialogManager}/DialogAction.js +0 -0
- /package/mobile/bundle/{services/sitemap → components/Header}/findActiveSubItem.d.ts +0 -0
- /package/mobile/bundle/{services/sitemap → components/Header}/isHrefActive.d.ts +0 -0
- /package/mobile/bundle/{services/sitemap → components/Header}/isTopItemActive.d.ts +0 -0
- /package/mobile/dist/{services/sitemap → components/Header}/findActiveSubItem.d.ts +0 -0
- /package/mobile/dist/{services/sitemap → components/Header}/findActiveSubItem.js +0 -0
- /package/mobile/dist/{services/sitemap → components/Header}/isHrefActive.d.ts +0 -0
- /package/mobile/dist/{services/sitemap → components/Header}/isHrefActive.js +0 -0
- /package/mobile/dist/{services/sitemap → components/Header}/isTopItemActive.d.ts +0 -0
- /package/mobile/dist/{services/sitemap → components/Header}/isTopItemActive.js +0 -0
- /package/mobile/dist/ui-kit/{Dialog → DialogManager}/DialogAction.js +0 -0
- /package/mobile/lib/{services/sitemap → components/Header}/findActiveSubItem.d.ts +0 -0
- /package/mobile/lib/{services/sitemap → components/Header}/findActiveSubItem.js +0 -0
- /package/mobile/lib/{services/sitemap → components/Header}/isHrefActive.d.ts +0 -0
- /package/mobile/lib/{services/sitemap → components/Header}/isHrefActive.js +0 -0
- /package/mobile/lib/{services/sitemap → components/Header}/isTopItemActive.d.ts +0 -0
- /package/mobile/lib/{services/sitemap → components/Header}/isTopItemActive.js +0 -0
- /package/mobile/lib/ui-kit/{Dialog → DialogManager}/DialogAction.js +0 -0
- /package/mobile/src/{services/sitemap → components/Header}/findActiveSubItem.ts +0 -0
- /package/mobile/src/{services/sitemap → components/Header}/isHrefActive.ts +0 -0
- /package/mobile/src/{services/sitemap → components/Header}/isTopItemActive.ts +0 -0
- /package/mobile/src/icons/{ChevronLeft.svg → ChevronLeftIcon.svg} +0 -0
- /package/src/{services/sitemap → components/Header}/findActiveSubItem.ts +0 -0
- /package/src/{services/sitemap → components/Header}/isHrefActive.ts +0 -0
- /package/src/{services/sitemap → components/Header}/isTopItemActive.ts +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
|
},
|
|
@@ -505,16 +510,17 @@
|
|
|
505
510
|
return await response.json();
|
|
506
511
|
}
|
|
507
512
|
|
|
508
|
-
const REGIONS_URL
|
|
513
|
+
const REGIONS_URL = '/api/v1/regions';
|
|
509
514
|
const EMPTY_VALUE$3 = [];
|
|
510
515
|
function useGetRegions() {
|
|
511
|
-
const { data } = useAsyncData(REGIONS_URL
|
|
516
|
+
const { data } = useAsyncData(REGIONS_URL, fetchJSONUnsafe);
|
|
512
517
|
return data || EMPTY_VALUE$3;
|
|
513
518
|
}
|
|
514
519
|
|
|
515
|
-
const
|
|
516
|
-
open: (
|
|
520
|
+
const useDialogManager = () => ({
|
|
521
|
+
open: (dialog, options = {}) => defaultEventBus.fire('dialog', { type: 'open', dialog, ...options }),
|
|
517
522
|
close: () => defaultEventBus.fire('dialog', { type: 'close' }),
|
|
523
|
+
closeAll: () => defaultEventBus.fire('dialog', { type: 'close', all: true }),
|
|
518
524
|
});
|
|
519
525
|
|
|
520
526
|
const dirname = (path) => path?.split('/').slice(0, -1).join('/');
|
|
@@ -576,7 +582,7 @@
|
|
|
576
582
|
function useLink(params = {}) {
|
|
577
583
|
const { isRemote, basePath } = params;
|
|
578
584
|
const router = useRouter();
|
|
579
|
-
const {
|
|
585
|
+
const { closeAll } = useDialogManager();
|
|
580
586
|
return (props) => ({
|
|
581
587
|
...props,
|
|
582
588
|
href: isRemote && !basePath ? props.href : adjustHref(router)(props.href, basePath),
|
|
@@ -590,7 +596,7 @@
|
|
|
590
596
|
// Default routing
|
|
591
597
|
return;
|
|
592
598
|
}
|
|
593
|
-
|
|
599
|
+
closeAll();
|
|
594
600
|
// Client routing
|
|
595
601
|
ev?.preventDefault();
|
|
596
602
|
router.push(href);
|
|
@@ -869,7 +875,7 @@
|
|
|
869
875
|
|
|
870
876
|
const renderBusinessCardDataOrganization = (field) => (jsxs("div", { className: "sm:flex sm:justify-between sm:gap-5", children: [jsxs("div", { className: "sm:w-1/2", children: [jsx(InputControl, { className: "shrink-0 w-full mb-3", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { className: "shrink-0 w-full mb-3", label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) })] }), jsxs("div", { className: "sm:w-1/2", children: [jsx(PhoneInputControl, { className: "shrink-0 w-full mb-3", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), jsx(InputControl, { className: "shrink-0 w-full mb-3", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('mail'), defaultValidator) })] })] }));
|
|
871
877
|
|
|
872
|
-
const renderRegion
|
|
878
|
+
const renderRegion = ({ regions, field }) => (jsx("div", { className: "w-full mb-3 sm:mb-5", children: jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }) }));
|
|
873
879
|
|
|
874
880
|
const initialFormState$3 = {
|
|
875
881
|
name: '',
|
|
@@ -900,7 +906,7 @@
|
|
|
900
906
|
}, [onSubmit]);
|
|
901
907
|
const [, { field, ...formProps }] = useForm(initialFormState$3, handleSubmit);
|
|
902
908
|
const regions = useGetRegions();
|
|
903
|
-
return (jsxs("form", { className: "container", onSubmit: formProps.onSubmit, children: [renderRegion
|
|
909
|
+
return (jsxs("form", { className: "container", onSubmit: formProps.onSubmit, children: [renderRegion({ regions, field }), renderBusinessCardDataOrganization(field), renderSubmitButton(button, 'mb-4'), jsx(Footnote, { link: link })] }));
|
|
904
910
|
});
|
|
905
911
|
|
|
906
912
|
const BRANCHES_URL = '/api/v1/branches';
|
|
@@ -1055,10 +1061,8 @@
|
|
|
1055
1061
|
});
|
|
1056
1062
|
|
|
1057
1063
|
const EMPTY_VALUE$1 = {};
|
|
1058
|
-
function useSWRResource(filename, fallback =
|
|
1059
|
-
const { data } = useAsyncData(`/wcms-resources/${filename}.json
|
|
1060
|
-
fallback,
|
|
1061
|
-
});
|
|
1064
|
+
function useSWRResource(filename, fallback = EMPTY_VALUE$1) {
|
|
1065
|
+
const { data } = useAsyncData(filename ? `/wcms-resources/${filename}.json` : null, fetchJSONUnsafe, { fallback });
|
|
1062
1066
|
return data || EMPTY_VALUE$1;
|
|
1063
1067
|
}
|
|
1064
1068
|
|
|
@@ -1321,7 +1325,7 @@
|
|
|
1321
1325
|
return (jsx("div", { className: `inline-block snap-always box-border ${className}`, style: style, "aria-current": Boolean(idx === activeIndex), ref: ref, children: children }));
|
|
1322
1326
|
});
|
|
1323
1327
|
|
|
1324
|
-
const childStyleMap = ['min-w-full', 'min-w-
|
|
1328
|
+
const childStyleMap = ['min-w-full', '@lg:min-w-[50%]', '@lg:min-w-[33.3%]', '@lg:min-w-[25%]'];
|
|
1325
1329
|
const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', minHeight, children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
|
|
1326
1330
|
const observerOptions = {
|
|
1327
1331
|
sensitivity: 1,
|
|
@@ -1386,6 +1390,7 @@
|
|
|
1386
1390
|
const max = maxBy();
|
|
1387
1391
|
|
|
1388
1392
|
const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
|
|
1393
|
+
const min = minBy();
|
|
1389
1394
|
|
|
1390
1395
|
const getItemWidth = (container) => (itemCount) => container.scrollWidth / itemCount;
|
|
1391
1396
|
const scrollBy = (container) => (itemCount, delta) => {
|
|
@@ -1488,6 +1493,753 @@
|
|
|
1488
1493
|
|
|
1489
1494
|
const ButtonsBlock = JSX(({ buttons, className, ...rest }) => (jsx(BlockWrapper, { className: style('!bg-transparent', className), defaultPadding: "p-0", ...rest, children: renderButtonsSection(buttons) })));
|
|
1490
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
|
+
|
|
1491
2243
|
const NumberInput = JSX((props) => {
|
|
1492
2244
|
const { onChange, min, max, defaultValue = '0', fractionDigits = 0, ...inputProps } = props;
|
|
1493
2245
|
const normalizedProps = useNormalizedInput(props, {
|
|
@@ -1663,20 +2415,54 @@
|
|
|
1663
2415
|
'CarouselEventCard',
|
|
1664
2416
|
];
|
|
1665
2417
|
|
|
1666
|
-
const CarouselBankHistoryCard = JSX(({ title, description, className }) => (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", children: jsx(Headline, { headlineVersion: "
|
|
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 }) })));
|
|
1667
2419
|
|
|
1668
|
-
const
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
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 } }));
|
|
1673
2441
|
});
|
|
1674
2442
|
|
|
1675
|
-
const
|
|
1676
|
-
|
|
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;
|
|
1677
2446
|
|
|
1678
|
-
const
|
|
1679
|
-
|
|
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
|
+
]);
|
|
2451
|
+
|
|
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 }));
|
|
1680
2466
|
|
|
1681
2467
|
const DOT_SIZE_MAP = {
|
|
1682
2468
|
L: 'w-1.5 h-1.5 mr-m',
|
|
@@ -1697,6 +2483,29 @@
|
|
|
1697
2483
|
};
|
|
1698
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);
|
|
1699
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
|
+
|
|
1700
2509
|
const buttonSizeStyles = {
|
|
1701
2510
|
default: 'w-24 h-14',
|
|
1702
2511
|
stretched: 'flex-1 h-14',
|
|
@@ -1756,28 +2565,6 @@
|
|
|
1756
2565
|
});
|
|
1757
2566
|
const renderIcon$1 = (icon) => icon?.src || icon?.icon ? (jsx("div", { children: jsx(Img, { image: icon }) })) : null;
|
|
1758
2567
|
|
|
1759
|
-
const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
|
|
1760
|
-
const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
|
|
1761
|
-
const onToggle = useCallback(() => {
|
|
1762
|
-
setIsUnfolded((_) => !_);
|
|
1763
|
-
}, []);
|
|
1764
|
-
const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
|
|
1765
|
-
const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
|
|
1766
|
-
return isFoldButtonOnTop ? (jsxs("div", { className: className, children: [buttonNode, sectionNode] })) : (jsxs("div", { className: className, children: [sectionNode, buttonNode] }));
|
|
1767
|
-
});
|
|
1768
|
-
|
|
1769
|
-
const FoldableSection = JSX(({ className = '', isUnfolded, children }) => {
|
|
1770
|
-
const containerRef = useRef(null);
|
|
1771
|
-
useEffect(() => {
|
|
1772
|
-
if (containerRef.current) {
|
|
1773
|
-
containerRef.current.style.maxHeight = isUnfolded
|
|
1774
|
-
? `${containerRef.current.scrollHeight}px`
|
|
1775
|
-
: '';
|
|
1776
|
-
}
|
|
1777
|
-
}, [isUnfolded, children?.length]);
|
|
1778
|
-
return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} ${className}`, children: children }));
|
|
1779
|
-
});
|
|
1780
|
-
|
|
1781
2568
|
const getPaddingStyle = (isHighlighting = false) => isHighlighting ? 'p-6xl mt-6' : 'mt-6 p-6xl'; // Хак для мобильной версии т.к. контракт должен быть идентичный
|
|
1782
2569
|
|
|
1783
2570
|
const renderCardInfo = (cell, i) => {
|
|
@@ -1809,8 +2596,8 @@
|
|
|
1809
2596
|
black: 'bg-black',
|
|
1810
2597
|
white: 'bg-white',
|
|
1811
2598
|
};
|
|
1812
|
-
const CarouselCatalogCard = JSX(({ className = '', title, description, image, price, button, colors, ...rest }) => (jsxs(BlockWrapper, { className: style('flex flex-col justify-left
|
|
1813
|
-
const renderColorOption = (color, i) => (jsx("div", { role: "figure", className: `w-6 h-6 ml-
|
|
2599
|
+
const CarouselCatalogCard = JSX(({ className = '', title, description, image, price, button, colors, ...rest }) => (jsxs(BlockWrapper, { className: style('flex flex-col justify-left', className), defaultPadding: "p-2xl", ...rest, children: [image?.src ? jsx(Img, { className: "flex justify-center mb-xl", image: image }) : null, jsx(Headline, { title: title, description: description, headlineVersion: "XS", isPadding: false, align: "text-left", className: "mb-m" }), colors?.length ? (jsxs("div", { className: "flex text-secondary-text mb-m", children: [jsx("div", { className: "mr-xs", children: jsx(Text, { size: "text-s", align: "text-left", font: "font-light", children: "\u0426\u0432\u0435\u0442\u0430:" }) }), colors.map(renderColorOption)] })) : null, price ? (jsxs(Text, { size: "text-h3", align: "text-left", children: [price, "\u00A0\u20BD"] })) : null, renderButtonsSection([button], { buttonClassName: 'w-full mt-lg' })] })));
|
|
2600
|
+
const renderColorOption = (color, i) => (jsx("div", { role: "figure", className: `w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${cardStyleMap[color]}` }, String(i)));
|
|
1814
2601
|
|
|
1815
2602
|
const alignTextStyle = 'text-left';
|
|
1816
2603
|
|
|
@@ -1866,14 +2653,6 @@
|
|
|
1866
2653
|
return orientation === 'horizontal' ? (jsx(SwipeListControl, { onVisibleIndicesChange: handleSlideChange, children: tableColumns })) : (tableColumns);
|
|
1867
2654
|
});
|
|
1868
2655
|
|
|
1869
|
-
const imageAlignmentMap = {
|
|
1870
|
-
start: 'self-start',
|
|
1871
|
-
center: 'self-center',
|
|
1872
|
-
end: 'self-end',
|
|
1873
|
-
};
|
|
1874
|
-
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 })] })] })));
|
|
1875
|
-
const renderImageContainer = (image, { className, imageAlign }) => image ? (jsx("div", { className: style('flex-shrink-0', imageAlign && imageAlignmentMap[imageAlign], className), children: image })) : null;
|
|
1876
|
-
|
|
1877
2656
|
var Currency;
|
|
1878
2657
|
(function (Currency) {
|
|
1879
2658
|
Currency["RUB"] = "RUB";
|
|
@@ -1900,7 +2679,7 @@
|
|
|
1900
2679
|
};
|
|
1901
2680
|
|
|
1902
2681
|
const icon = { icon: 'GpsIcon' };
|
|
1903
|
-
const CurrentLocation
|
|
2682
|
+
const CurrentLocation = JSX(({ className = '', address }) => (jsxs("div", { className: `flex gap-s ${className}`, children: [jsx(RoundedIcon, { ...icon, iconBgVersion: "primary" }), jsxs("div", { className: "space-y-2xs", children: [address ? jsx("p", { className: "text-primary-main text-l", children: address }) : null, jsx("p", { className: "text-secondary-text text-m", children: "\u041A\u0443\u0440\u0441 \u0443\u043A\u0430\u0437\u0430\u043D \u0434\u043B\u044F \u0437\u0430\u0434\u0430\u043D\u043D\u043E\u0433\u043E \u043E\u0444\u0438\u0441\u0430" })] })] })));
|
|
1904
2683
|
|
|
1905
2684
|
const roundTo = (value, precision = 2) => {
|
|
1906
2685
|
const factor = 10 ** precision;
|
|
@@ -2004,7 +2783,7 @@
|
|
|
2004
2783
|
};
|
|
2005
2784
|
|
|
2006
2785
|
const EXCHANGE_RATES_URL = '/api/v1/exchangerates';
|
|
2007
|
-
const REGION_URL
|
|
2786
|
+
const REGION_URL = '/api/v1/region';
|
|
2008
2787
|
function useFetchExchangeRateData() {
|
|
2009
2788
|
const { data } = useAsyncData(EXCHANGE_RATES_URL, fetchData);
|
|
2010
2789
|
return data || {};
|
|
@@ -2017,7 +2796,7 @@
|
|
|
2017
2796
|
};
|
|
2018
2797
|
const fetchRegion = async () => {
|
|
2019
2798
|
try {
|
|
2020
|
-
return await fetchJSONUnsafe(REGION_URL
|
|
2799
|
+
return await fetchJSONUnsafe(REGION_URL, { method: 'GET' });
|
|
2021
2800
|
}
|
|
2022
2801
|
catch (error) {
|
|
2023
2802
|
console.log(error);
|
|
@@ -2043,12 +2822,14 @@
|
|
|
2043
2822
|
currencyRatesBuy.unshift({ currency: { currency: Currency.RUB } });
|
|
2044
2823
|
const currencyRatesSell = currencyRates.filter((_) => _.saleExchangeRate);
|
|
2045
2824
|
currencyRatesSell.push({ currency: { currency: Currency.RUB } });
|
|
2046
|
-
return (jsx(BlockWrapper, { className: style('box-border min-h-80', className), ...rest, children: jsx(BaseTile, { className: "h-full", title: jsx(Heading, { headingType: "h4", title: title, className: "whitespace-pre-wrap" }), children: jsxs("div", { className: "flex gap-6xl flex-wrap", children: [jsxs("div", { children: [currencyRates ? (jsx(CurrencyTable, { className: "mb-xl", exchangeCurrencyItems: currencyRates })) : null, jsx(CurrentLocation
|
|
2825
|
+
return (jsx(BlockWrapper, { className: style('box-border min-h-80', className), ...rest, children: jsx(BaseTile, { className: "h-full", title: jsx(Heading, { headingType: "h4", title: title, className: "whitespace-pre-wrap" }), children: jsxs("div", { className: "flex gap-6xl flex-wrap", children: [jsxs("div", { children: [currencyRates ? (jsx(CurrencyTable, { className: "mb-xl", exchangeCurrencyItems: currencyRates })) : null, jsx(CurrentLocation, { address: exchangeRates?.address })] }), currencyRates.length && currencyRatesBuy.length && currencyRatesSell.length ? (jsx(ExchangeCurrencyCalculator, { className: "grow", currencyRatesBuy: currencyRatesBuy, currencyRatesSell: currencyRatesSell, button: button })) : null] }) }) }));
|
|
2047
2826
|
});
|
|
2048
2827
|
const getCurrencyRates = (currencies) => {
|
|
2049
2828
|
return currencies?.filter((_) => _?.currency?.id === 1 || _?.currency?.id === 2) || [];
|
|
2050
2829
|
};
|
|
2051
2830
|
|
|
2831
|
+
const useSitemap = (fallback) => useSWRResource(projectSettings.SITEMAP || 'sitemap', fallback);
|
|
2832
|
+
|
|
2052
2833
|
const linkListStyles = '';
|
|
2053
2834
|
|
|
2054
2835
|
const LinkList = JSX(({ className = '', items }) => items?.length ? (jsx("ul", { className: style('flex flex-col', linkListStyles, className), children: items.map(renderLinkListItem) })) : null);
|
|
@@ -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" })] })));
|
|
@@ -2139,9 +2920,11 @@
|
|
|
2139
2920
|
|
|
2140
2921
|
const TextInformation = JSX(({ className = '', links }) => (jsxs("div", { className: className, children: [jsx("div", { className: "pt-lg", children: jsx(Text, { size: "text-xs", font: "font-light", color: "text-secondary-text", children: `\u00a9\u00A02000-${new Date().getFullYear()}\u00A0АО \u00ABРоссельхозбанк\u00BB Генеральная лицензия Банка России \u2116\u00A03349 от\u00A012.08.2015\u00A0г.` }) }), links?.length ? (jsx("div", { className: "flex flex-col sm:flex-row justify-start items-start gap-x-lg gap-y-xs pt-lg", children: links.map((_, i) => (jsx(TextInformationLink, { index: i, ..._ }, String(i)))) })) : null] })));
|
|
2141
2922
|
|
|
2142
|
-
const Footer = JSX(({ className,
|
|
2143
|
-
const
|
|
2144
|
-
|
|
2923
|
+
const Footer = JSX(({ className, ...rest }) => {
|
|
2924
|
+
const fallback = rest.options?.page?.fallback;
|
|
2925
|
+
const { topItems } = useSitemap(fallback);
|
|
2926
|
+
const { relatedEnterprises, contacts, socialMedia, mobileApps, horizontalNavigationTitle, documents, } = useSWRResource(projectSettings.FOOTER || 'footer', fallback);
|
|
2927
|
+
return (jsxs(BlockWrapper, { tag: "footer", className: className, ...rest, children: [jsx("div", { className: "mb-lg pb-xs border-b border-main-divider", children: topItems?.map((item, i) => (jsx(RollupItem, { label: item?.text, labelIcon: item?.icon, children: jsx(LinkList, { items: item.items }) }, String(i)))) }), jsx(Contacts, { className: "overflow-hidden", items: contacts }), jsxs("div", { className: "mt-xl", children: [jsx(SocialMedia, { className: "mb-xl", media: socialMedia, buttonSize: "stretched", children: "\u0421\u043E\u0446\u0441\u0435\u0442\u0438" }), jsx(Text, { size: "text-s", font: "font-light", color: "text-secondary-text", children: "\u041C\u043E\u0431\u0438\u043B\u044C\u043D\u043E\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435" }), jsx("div", { className: "mt-xs", children: mobileApps?.map(renderButton) })] }), jsx(HorizontalNavigation, { className: "py-lg border-y border-main-divider", title: horizontalNavigationTitle, links: relatedEnterprises }), jsx(TextInformation, { links: documents })] }));
|
|
2145
2928
|
});
|
|
2146
2929
|
const renderButton = ({ href = '/' }, i) => {
|
|
2147
2930
|
const { label } = findIconByHref(href);
|
|
@@ -2181,23 +2964,25 @@
|
|
|
2181
2964
|
};
|
|
2182
2965
|
const HeaderTop = JSX(({ bgColor, logo, internetBankUrl, version }) => {
|
|
2183
2966
|
const router = useRouter();
|
|
2184
|
-
const isRootLocation = router.pathname
|
|
2185
|
-
const onClick = useCallback(() => {
|
|
2967
|
+
const isRootLocation = projectSettings.BASE_PATH?.startsWith(router.pathname);
|
|
2968
|
+
const onClick = useCallback((e) => {
|
|
2969
|
+
e.preventDefault();
|
|
2186
2970
|
router.back();
|
|
2187
2971
|
}, []);
|
|
2188
|
-
return (jsxs("div", { className: "flex items-center justify-between w-full", children: [isRootLocation ? (jsx(Logo, { bgColor: bgColor, logo: logo })) : (
|
|
2189
|
-
icon: 'ChevronLeft',
|
|
2190
|
-
iconVersion: 'black',
|
|
2191
|
-
} }), "\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] }));
|
|
2192
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"] }));
|
|
2193
2978
|
|
|
2194
2979
|
const BG_COLOR_TO_BLOCK_VERSION = {
|
|
2195
2980
|
'bg-white': 'primary',
|
|
2196
2981
|
transparent: 'transparent',
|
|
2197
2982
|
};
|
|
2198
|
-
const Header = JSX(({ bgColor = 'bg-white', version = BG_COLOR_TO_BLOCK_VERSION[bgColor],
|
|
2199
|
-
const { logo, internetBankUrl } =
|
|
2200
|
-
return (jsx(BlockWrapper, { tag: "header", defaultPadding: "", version: version, ...rest, children: jsx("div", { className: "container px-
|
|
2983
|
+
const Header = JSX(({ bgColor = 'bg-white', version = BG_COLOR_TO_BLOCK_VERSION[bgColor], ...rest }) => {
|
|
2984
|
+
const { logo, internetBankUrl } = useSitemap(rest.options?.page?.fallback);
|
|
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 }) }) }));
|
|
2201
2986
|
});
|
|
2202
2987
|
|
|
2203
2988
|
const gapStyles = {
|
|
@@ -2286,56 +3071,9 @@
|
|
|
2286
3071
|
|
|
2287
3072
|
const MobileAppTile = JSX(({ className, padding, alignTitle = 'left', buttons = [], description, headingType = 'h4', image, items, qr, title = 'Мобильное приложение', version = 'primary', ...rest }) => {
|
|
2288
3073
|
const containerStyle = version === 'secondary' ? 'p-m min-w-32' : 'min-w-24';
|
|
2289
|
-
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] })] }) }));
|
|
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] })] }) }));
|
|
2290
3075
|
});
|
|
2291
3076
|
|
|
2292
|
-
const sum = (list = []) => list.reduce((a, b) => a + b, 0);
|
|
2293
|
-
|
|
2294
|
-
const avg = (items = []) => (items?.length ? sum(items) / items.length : 0);
|
|
2295
|
-
|
|
2296
|
-
const deviation = (items) => items?.length ? Math.sqrt(Math.abs(avg(items.map((_) => _ ** 2)) - avg(items) ** 2)) : 0;
|
|
2297
|
-
|
|
2298
|
-
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'
|
|
2299
|
-
? 'bg-secondary-light text-primary-main'
|
|
2300
|
-
: '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;
|
|
2301
|
-
|
|
2302
|
-
const RichText = JSX((props) => {
|
|
2303
|
-
const { __html = '', richVersion = '' } = props;
|
|
2304
|
-
return (jsx("div", { className: style(richVersion, 'md-container'), dangerouslySetInnerHTML: { __html } }));
|
|
2305
|
-
});
|
|
2306
|
-
|
|
2307
|
-
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;
|
|
2308
|
-
|
|
2309
|
-
const renderBenefitLabel = (label, i) => label ? (jsx(Text, { color: "text-primary-text group-data-secondary:text-white", size: "text-h6", children: label }, `label-${i}`)) : null;
|
|
2310
|
-
|
|
2311
|
-
const renderBenefitText = (_, i) => _.type === 'rte' && '__html' in _ && _.__html ? (jsx(RichText, { ..._ }, `rte-${i}`)) : ([
|
|
2312
|
-
'label' in _ ? renderBenefitLabel(_.label, i) : null,
|
|
2313
|
-
'description' in _ ? renderBenefitDescription(_.description, i) : null,
|
|
2314
|
-
]);
|
|
2315
|
-
|
|
2316
|
-
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(_) })] })));
|
|
2317
|
-
|
|
2318
|
-
const MAX_BENEFITS_LEN_DEVIATION = 16;
|
|
2319
|
-
const benefitLength = (_) => _.type === 'rte'
|
|
2320
|
-
? _.__html?.length || 0
|
|
2321
|
-
: Math.max(_.label?.length || 0, _.description?.length || 0);
|
|
2322
|
-
const isDistortedBenefits = (benefits) => deviation(benefits.map(benefitLength)) > MAX_BENEFITS_LEN_DEVIATION;
|
|
2323
|
-
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);
|
|
2324
|
-
|
|
2325
|
-
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);
|
|
2326
|
-
|
|
2327
|
-
const BenefitsList = JSX(({ isTabularBenefits, ...rest }) => isTabularBenefits ? jsx(TabularBenefitsList, { ...rest }) : jsx(DefaultBenefitsList, { ...rest }));
|
|
2328
|
-
|
|
2329
|
-
const Tags = JSX(({ className, tags }) => tags?.length ? (jsx("div", { className: style('flex flex-wrap gap-xs', className), role: "list", children: tags.map(renderTag) })) : null);
|
|
2330
|
-
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)));
|
|
2331
|
-
|
|
2332
|
-
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, }) => {
|
|
2333
|
-
const img = image?.src ? jsx(Img, { image: image }) : null;
|
|
2334
|
-
const headline = (jsx(Headline, { title: title, description: description, headlineVersion: headlineVersion, align: align, isPadding: false }));
|
|
2335
|
-
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] }) }));
|
|
2336
|
-
});
|
|
2337
|
-
const leftOrRightImage = (img, directionRight) => directionRight ? { rightImage: img } : { leftImage: img };
|
|
2338
|
-
|
|
2339
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;
|
|
2340
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"] })] }));
|
|
2341
3079
|
|
|
@@ -2805,106 +3543,65 @@
|
|
|
2805
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 })) }) }));
|
|
2806
3544
|
};
|
|
2807
3545
|
|
|
2808
|
-
const
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
const TEXT_CLASSES = 'font-sans text-m text-center';
|
|
2813
|
-
const ACTIVE_TEXT_CLASSES = 'text-white';
|
|
2814
|
-
const INACTIVE_TEXT_CLASSES = 'text-secondary-text sm:group-hover/btn:text-primary-main';
|
|
2815
|
-
const TAB_CLASSES = {
|
|
2816
|
-
block: {
|
|
2817
|
-
scrollable: {
|
|
2818
|
-
active: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${SCROLLABLE_ACTIVE_LINK_CLASSES}`,
|
|
2819
|
-
default: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${INACTIVE_LINK_CLASSES}`,
|
|
2820
|
-
},
|
|
2821
|
-
centered: {
|
|
2822
|
-
active: `px-4 rounded-md ${LINK_CLASSES} ${WIDESCREEN_ACTIVE_LINK_CLASSES} whitespace-nowrap`,
|
|
2823
|
-
default: `px-4 rounded-md ${LINK_CLASSES} group/btn bg-transparent whitespace-nowrap`,
|
|
2824
|
-
},
|
|
2825
|
-
wideScreen: {
|
|
2826
|
-
active: `${LINK_CLASSES} ${WIDESCREEN_ACTIVE_LINK_CLASSES} whitespace-nowrap`,
|
|
2827
|
-
default: `${LINK_CLASSES} ${INACTIVE_LINK_CLASSES} whitespace-nowrap`,
|
|
2828
|
-
},
|
|
2829
|
-
},
|
|
2830
|
-
text: {
|
|
2831
|
-
scrollable: {
|
|
2832
|
-
active: `${TEXT_CLASSES} flex items-center h-full border-0 border-b-2`,
|
|
2833
|
-
default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES}`,
|
|
2834
|
-
},
|
|
2835
|
-
centered: {
|
|
2836
|
-
active: `${TEXT_CLASSES} ${ACTIVE_TEXT_CLASSES}`,
|
|
2837
|
-
default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES}`,
|
|
2838
|
-
},
|
|
2839
|
-
wideScreen: {
|
|
2840
|
-
active: `${TEXT_CLASSES} ${ACTIVE_TEXT_CLASSES} text-black px-2.5 bg-white sm:bg-primary-main sm:text-white`,
|
|
2841
|
-
default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES} px-2.5 bg-white`,
|
|
2842
|
-
},
|
|
2843
|
-
},
|
|
3546
|
+
const tabPaddingStyleMap = {
|
|
3547
|
+
default: 'px-xs',
|
|
3548
|
+
underlined: 'px-m',
|
|
3549
|
+
rounded: 'px-lg rounded-md',
|
|
2844
3550
|
};
|
|
2845
|
-
const
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
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',
|
|
2849
3556
|
};
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
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' }) => {
|
|
2854
3568
|
const link = useLink();
|
|
2855
|
-
const
|
|
2856
|
-
|
|
2857
|
-
adjustedProps.onClick(ev);
|
|
2858
|
-
onClick(tab);
|
|
3569
|
+
const handleClick = () => {
|
|
3570
|
+
onClick && onClick(item);
|
|
2859
3571
|
};
|
|
2860
|
-
|
|
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 }) }) }));
|
|
2861
3575
|
});
|
|
2862
3576
|
|
|
2863
|
-
const
|
|
2864
|
-
const LIGHT_BADGE_CLASSES = 'bg-white/30 text-white';
|
|
2865
|
-
const DARK_BADGE_CLASSES = 'text-secondary-text group-hover/btn:text-primary-main';
|
|
2866
|
-
const renderGroupTab = ({ page, currentTab, showCounter, onClick, tabsMode }) => (tab, i) => {
|
|
2867
|
-
const active = currentTab === tab;
|
|
2868
|
-
const count = tab.ref && page?.blocks
|
|
2869
|
-
? page.blocks.filter((block) => block?.labels?.includes(tab.ref)).length
|
|
2870
|
-
: 0;
|
|
2871
|
-
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)}`));
|
|
2872
|
-
};
|
|
2873
|
-
const renderCount = (tabsMode, count, active) => {
|
|
2874
|
-
return (jsx("div", { className: style(BADGE_CLASSES, active && tabsMode !== 'scrollable' ? LIGHT_BADGE_CLASSES : DARK_BADGE_CLASSES), children: count }));
|
|
2875
|
-
};
|
|
3577
|
+
const renderTab = (activeTab, onClick, type) => (tab, i) => (jsx(TabItem, { isActive: tab === activeTab, onClick: onClick, type: type, item: tab }, String(i)));
|
|
2876
3578
|
|
|
2877
|
-
const
|
|
2878
|
-
|
|
2879
|
-
if (!(type === 'group' || type === 'link')) {
|
|
2880
|
-
return null;
|
|
2881
|
-
}
|
|
2882
|
-
switch (type) {
|
|
2883
|
-
case 'group':
|
|
2884
|
-
return renderGroupTab({ page, showCounter, ...rest })(tab, i);
|
|
2885
|
-
case 'link': {
|
|
2886
|
-
return jsx(LinkTab, { tab: tab, ...rest }, String(i));
|
|
2887
|
-
}
|
|
2888
|
-
default:
|
|
2889
|
-
assertUnreachable(type);
|
|
2890
|
-
}
|
|
2891
|
-
return null;
|
|
2892
|
-
};
|
|
2893
|
-
|
|
2894
|
-
const CenteredTabs = JSX(({ tabs, ...rest }) => (jsx("div", { className: "flex p-1 m-auto bg-main-gray rounded-md", children: tabs?.map(renderTab({ ...rest })) })));
|
|
2895
|
-
|
|
2896
|
-
const scrollButtonStyle = 'absolute z-40 top-0';
|
|
2897
|
-
const ScrollableTabs = JSX((props) => {
|
|
2898
|
-
const { tabs, ...rest } = props;
|
|
3579
|
+
const scrollButtonStyle = 'hidden sm:flex absolute z-40 top-0';
|
|
3580
|
+
const ScrollableTabsControl = JSX(({ className, items = [], value, onChange, tabsType }) => {
|
|
2899
3581
|
const [containerRef, scroll] = useSwipeListScroll({
|
|
2900
|
-
itemCount:
|
|
3582
|
+
itemCount: items?.length || 0,
|
|
2901
3583
|
});
|
|
2902
|
-
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] }));
|
|
2903
3585
|
});
|
|
2904
3586
|
|
|
2905
|
-
const
|
|
2906
|
-
|
|
2907
|
-
|
|
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);
|
|
2908
3605
|
useEffect(() => {
|
|
2909
3606
|
if (!tabs || !tabs[0]) {
|
|
2910
3607
|
return;
|
|
@@ -2912,27 +3609,23 @@
|
|
|
2912
3609
|
fireTabEvent(tabs[0]);
|
|
2913
3610
|
}, []);
|
|
2914
3611
|
useEffect(() => {
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
3612
|
+
const activeTab = tabs[activeTabIndex];
|
|
3613
|
+
if (activeTab?.type === 'group') {
|
|
3614
|
+
defaultEventBus.subject('tab', { type: activeTab.type, label: activeTab.ref });
|
|
3615
|
+
}
|
|
3616
|
+
}, [tabs, activeTabIndex]);
|
|
3617
|
+
const handleChange = useCallback((_) => {
|
|
3618
|
+
const index = normalizedTabs.indexOf(_);
|
|
3619
|
+
setActiveTabIndex(index);
|
|
3620
|
+
fireTabEvent(tabs[index]);
|
|
2922
3621
|
}, []);
|
|
2923
|
-
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
|
+
}) }));
|
|
2924
3628
|
});
|
|
2925
|
-
const renderTabs = ({ tabsMode, tabs, ...rest }) => {
|
|
2926
|
-
switch (tabsMode) {
|
|
2927
|
-
case 'wideScreen':
|
|
2928
|
-
return tabs?.map(renderTab({ tabsMode, ...rest }));
|
|
2929
|
-
case 'centered':
|
|
2930
|
-
return jsx(CenteredTabs, { tabs: tabs, tabsMode: tabsMode, ...rest });
|
|
2931
|
-
case 'scrollable':
|
|
2932
|
-
return jsx(ScrollableTabs, { tabs: tabs, tabsMode: tabsMode, ...rest });
|
|
2933
|
-
}
|
|
2934
|
-
return null;
|
|
2935
|
-
};
|
|
2936
3629
|
const fireTabEvent = (tab) => {
|
|
2937
3630
|
if (tab.type === 'group') {
|
|
2938
3631
|
defaultEventBus.fire('tab', { type: tab.type, label: tab.ref });
|
|
@@ -2941,6 +3634,7 @@
|
|
|
2941
3634
|
defaultEventBus.fire('tab', { type: tab.type, label: tab.href });
|
|
2942
3635
|
}
|
|
2943
3636
|
};
|
|
3637
|
+
const normalizeTab = (_) => (_?.type === 'group' ? { text: _.title } : _);
|
|
2944
3638
|
|
|
2945
3639
|
const renderButtonsCellData = ({ buttons }) => renderButtonsSection(buttons, {
|
|
2946
3640
|
className: 'mt-3',
|
|
@@ -2997,6 +3691,7 @@
|
|
|
2997
3691
|
ApplicationForm,
|
|
2998
3692
|
ButtonsBlock,
|
|
2999
3693
|
BonusBenefitsBlock,
|
|
3694
|
+
Calculator,
|
|
3000
3695
|
CardTransfer,
|
|
3001
3696
|
Carousel,
|
|
3002
3697
|
CarouselCard,
|
|
@@ -3030,52 +3725,6 @@
|
|
|
3030
3725
|
BenefitsBlock,
|
|
3031
3726
|
};
|
|
3032
3727
|
|
|
3033
|
-
const STORAGE_DEFAULT_TTL = 86400000; // 24 * 60 * 60 * 1000
|
|
3034
|
-
function useCachedAsyncData(key, fetcher, storage = globalThis?.localStorage) {
|
|
3035
|
-
const cachedFetcher = useCallback(async (...args) => {
|
|
3036
|
-
const storageKey = `async:${key}`;
|
|
3037
|
-
const storageData = storage.getItem(storageKey);
|
|
3038
|
-
const cachedData = getParsedData(storageData);
|
|
3039
|
-
if (cachedData) {
|
|
3040
|
-
return cachedData;
|
|
3041
|
-
}
|
|
3042
|
-
const data = await fetcher(...args);
|
|
3043
|
-
storage.setItem(storageKey, JSON.stringify({ data, timestamp: Date.now() }));
|
|
3044
|
-
return data;
|
|
3045
|
-
}, [key, fetcher]);
|
|
3046
|
-
return useAsyncData(key, cachedFetcher);
|
|
3047
|
-
}
|
|
3048
|
-
function getParsedData(storageData) {
|
|
3049
|
-
const { data = null, timestamp = null } = storageData ? JSON.parse(storageData) : {};
|
|
3050
|
-
return data && Date.now() - timestamp < STORAGE_DEFAULT_TTL ? data : undefined;
|
|
3051
|
-
}
|
|
3052
|
-
|
|
3053
|
-
const REGION_URL = '/api/v1/region';
|
|
3054
|
-
function useLocation(defaultLocation = 'Москва') {
|
|
3055
|
-
const currentLocation = getLocalStorageLocation();
|
|
3056
|
-
const [location, setLocation] = useState(currentLocation?.region ?? { name: defaultLocation });
|
|
3057
|
-
const { data } = useCachedAsyncData(REGION_URL, fetchJSONUnsafe);
|
|
3058
|
-
useEffect(() => {
|
|
3059
|
-
setLocation(currentLocation?.region && currentLocation?.manual
|
|
3060
|
-
? currentLocation.region
|
|
3061
|
-
: data || { name: defaultLocation });
|
|
3062
|
-
}, [data]);
|
|
3063
|
-
const onChangeLocation = useCallback((region) => {
|
|
3064
|
-
globalThis.localStorage?.setItem('location', JSON.stringify({ manual: true, region }));
|
|
3065
|
-
setLocation(region);
|
|
3066
|
-
}, []);
|
|
3067
|
-
return [location, onChangeLocation];
|
|
3068
|
-
}
|
|
3069
|
-
const getLocalStorageLocation = () => {
|
|
3070
|
-
const localStorageLocation = globalThis.localStorage?.getItem('location');
|
|
3071
|
-
try {
|
|
3072
|
-
return localStorageLocation ? JSON.parse(localStorageLocation) : null;
|
|
3073
|
-
}
|
|
3074
|
-
catch (_) {
|
|
3075
|
-
return null;
|
|
3076
|
-
}
|
|
3077
|
-
};
|
|
3078
|
-
|
|
3079
3728
|
const debounce = (fn, delay = 600) => {
|
|
3080
3729
|
let timerId;
|
|
3081
3730
|
const debouncedCallback = (...args) => {
|
|
@@ -3138,59 +3787,12 @@
|
|
|
3138
3787
|
};
|
|
3139
3788
|
}, deps);
|
|
3140
3789
|
|
|
3141
|
-
const CloseButton = JSX(({ className,
|
|
3142
|
-
|
|
3143
|
-
function useDialogHandlers({ onOpen, onClose } = {}) {
|
|
3144
|
-
useEffect(() => defaultEventBus.subscribe('dialog', (action) => {
|
|
3145
|
-
switch (action.type) {
|
|
3146
|
-
case 'open':
|
|
3147
|
-
onOpen && onOpen(action);
|
|
3148
|
-
break;
|
|
3149
|
-
case 'close':
|
|
3150
|
-
onClose && onClose();
|
|
3151
|
-
break;
|
|
3152
|
-
default:
|
|
3153
|
-
assertUnreachable(action);
|
|
3154
|
-
}
|
|
3155
|
-
}), [onOpen, onClose]);
|
|
3156
|
-
}
|
|
3157
|
-
|
|
3158
|
-
function useDialogProps(id, isOpenedOnInit = false) {
|
|
3159
|
-
const [isOpened, { setTrue: open, setFalse: close }] = useBool(isOpenedOnInit);
|
|
3160
|
-
const [params, setParams] = useState({ id });
|
|
3161
|
-
const wasOpened = useRef(isOpened);
|
|
3162
|
-
wasOpened.current ||= isOpened;
|
|
3163
|
-
const handleOpen = useCallback((_) => {
|
|
3164
|
-
if (_.id === id) {
|
|
3165
|
-
setParams(_);
|
|
3166
|
-
open();
|
|
3167
|
-
}
|
|
3168
|
-
else {
|
|
3169
|
-
close();
|
|
3170
|
-
}
|
|
3171
|
-
}, [id]);
|
|
3172
|
-
const handleClose = useCallback(() => {
|
|
3173
|
-
close();
|
|
3174
|
-
defaultEventBus.fire('dialog', { type: 'close' });
|
|
3175
|
-
}, []);
|
|
3176
|
-
useDialogHandlers({
|
|
3177
|
-
onOpen: handleOpen,
|
|
3178
|
-
onClose: close,
|
|
3179
|
-
});
|
|
3180
|
-
return {
|
|
3181
|
-
...params,
|
|
3182
|
-
isOpened,
|
|
3183
|
-
wasOpened: wasOpened.current,
|
|
3184
|
-
open,
|
|
3185
|
-
close,
|
|
3186
|
-
onClose: handleClose,
|
|
3187
|
-
};
|
|
3188
|
-
}
|
|
3790
|
+
const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-1 bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", children: jsx(Img, { image: { icon: 'CloseIcon' }, width: "24", height: "24" }) })));
|
|
3189
3791
|
|
|
3190
3792
|
const COOKIE_DIALOG_ID = 'cookie';
|
|
3191
3793
|
const DIALOG_INITIAL_DELAY = 3 * 1000;
|
|
3192
3794
|
const CookiePopup = JSX(({ termLink, personalDataPolicyLink }) => {
|
|
3193
|
-
const {
|
|
3795
|
+
const [opened, { setTrue: open, setFalse: close }] = useBool();
|
|
3194
3796
|
useDebouncedEffect(() => {
|
|
3195
3797
|
if (!globalThis.localStorage?.getItem(COOKIE_DIALOG_ID)) {
|
|
3196
3798
|
open();
|
|
@@ -3199,274 +3801,72 @@
|
|
|
3199
3801
|
const handleClose = useCallback(() => {
|
|
3200
3802
|
globalThis.localStorage?.setItem(COOKIE_DIALOG_ID, 'true');
|
|
3201
3803
|
close();
|
|
3202
|
-
}, [
|
|
3203
|
-
return
|
|
3804
|
+
}, []);
|
|
3805
|
+
return opened ? (jsx("div", { className: "container fixed left-0 right-0 bottom-0 z-50", children: jsxs("div", { className: "bg-white m-xl p-xl rounded-md flex sm:items-center shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: [jsx("div", { className: "sm:flex-1", children: jsxs(Paragraph, { size: "text-s", font: "font-light", color: "text-primary-text", children: ["\u0410\u041E \u00AB\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u00BB \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442", jsx(LinkWrapper, { isRemote: true, className: linkWrapperStyle(termLink?.href), ...termLink, children: "cookie" }), "(\u0444\u0430\u0439\u043B\u044B \u0441 \u0434\u0430\u043D\u043D\u044B\u043C\u0438 \u043E \u043F\u0440\u043E\u0448\u043B\u044B\u0445 \u043F\u043E\u0441\u0435\u0449\u0435\u043D\u0438\u044F\u0445 \u0441\u0430\u0439\u0442\u0430) \u0434\u043B\u044F \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043E\u0432 \u0438 \u0443\u0434\u043E\u0431\u0441\u0442\u0432\u0430 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0435\u0439. \u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0437\u0430\u043F\u0440\u0435\u0442\u0438\u0442\u044C \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435 cookie \u0432 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u0441\u0432\u043E\u0435\u0433\u043E \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.", jsx(LinkWrapper, { isRemote: true, className: linkWrapperStyle(personalDataPolicyLink?.href), ...personalDataPolicyLink, children: "\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430 \u0412\u0430\u0448\u0438\u0445 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" }), "\u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0441\u044F \u0432 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0442\u0440\u0435\u0431\u043E\u0432\u0430\u043D\u0438\u044F\u043C\u0438 \u0424\u0435\u0434\u0435\u0440\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u0437\u0430\u043A\u043E\u043D\u0430 \u043E\u0442 27.07.2006 \u2116 152-\u04243 \u00AB\u041E \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445\u00BB."] }) }), jsx("div", { className: "ml-s sm:ml-0 w-24 flex justify-end", children: jsx(CloseButton, { className: "bg-main-gray rounded-md", onClose: handleClose }) })] }) })) : null;
|
|
3204
3806
|
});
|
|
3205
|
-
const
|
|
3807
|
+
const linkWrapperStyle = (href) => style('inline mx-1', href ? 'text-green-dark' : '');
|
|
3206
3808
|
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
const
|
|
3210
|
-
|
|
3809
|
+
function useList(initialList = []) {
|
|
3810
|
+
const [list, setList] = useState(initialList);
|
|
3811
|
+
const push = useCallback((item) => setList((_) => [..._, item]), []);
|
|
3812
|
+
const pop = useCallback(() => setList((_) => _.slice(0, -1)), []);
|
|
3813
|
+
const remove = useCallback((item) => setList((_) => _.filter((currentItem) => currentItem !== item)), []);
|
|
3814
|
+
const clear = useCallback(() => setList([]), []);
|
|
3815
|
+
return [list, { setList, push, pop, remove, clear }];
|
|
3211
3816
|
}
|
|
3212
3817
|
|
|
3213
|
-
const
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
}
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
};
|
|
3231
|
-
function computeM(s1, s2) {
|
|
3232
|
-
const range = Math.max(0, Math.floor(Math.max(s1.length, s2.length) / 2) - 1);
|
|
3233
|
-
const s1Matches = new Array(s1.length);
|
|
3234
|
-
const s2Matches = new Array(s2.length);
|
|
3235
|
-
let m = 0;
|
|
3236
|
-
for (let i = 0; i < s1.length; i++) {
|
|
3237
|
-
const low = Math.max(0, i - range);
|
|
3238
|
-
const high = Math.min(i + range, s2.length - 1);
|
|
3239
|
-
for (let j = low; j <= high; j++) {
|
|
3240
|
-
if (s1Matches[i] || s2Matches[j] || s1[i] !== s2[j]) {
|
|
3241
|
-
continue;
|
|
3242
|
-
}
|
|
3243
|
-
m++;
|
|
3244
|
-
s1Matches[i] = true;
|
|
3245
|
-
s2Matches[j] = true;
|
|
3246
|
-
}
|
|
3247
|
-
}
|
|
3248
|
-
return { m, s1Matches, s2Matches };
|
|
3249
|
-
}
|
|
3250
|
-
function computeT(s1, s2, { s1Matches, s2Matches }) {
|
|
3251
|
-
let t = 0;
|
|
3252
|
-
for (let i = 0, k = 0; i < s1.length; i++) {
|
|
3253
|
-
if (!s1Matches[i]) {
|
|
3254
|
-
continue;
|
|
3255
|
-
}
|
|
3256
|
-
let j = k;
|
|
3257
|
-
for (; j < s2.length; j++) {
|
|
3258
|
-
if (s2Matches[j]) {
|
|
3259
|
-
k = j + 1;
|
|
3818
|
+
const DialogManager = JSX(() => {
|
|
3819
|
+
const [dialogs, { push, pop, clear }] = useList();
|
|
3820
|
+
const closeAll = useCallback(() => {
|
|
3821
|
+
for (const _ of dialogs) {
|
|
3822
|
+
_.onClose && _.onClose();
|
|
3823
|
+
}
|
|
3824
|
+
clear();
|
|
3825
|
+
}, [dialogs]);
|
|
3826
|
+
const close = useCallback(() => {
|
|
3827
|
+
const _ = dialogs[dialogs.length - 1];
|
|
3828
|
+
_?.onClose && _.onClose();
|
|
3829
|
+
pop();
|
|
3830
|
+
}, [dialogs]);
|
|
3831
|
+
useEffect(() => defaultEventBus.subscribe('dialog', (action) => {
|
|
3832
|
+
switch (action.type) {
|
|
3833
|
+
case 'open':
|
|
3834
|
+
push(action);
|
|
3260
3835
|
break;
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3836
|
+
case 'close':
|
|
3837
|
+
if (action.all) {
|
|
3838
|
+
closeAll();
|
|
3839
|
+
}
|
|
3840
|
+
else {
|
|
3841
|
+
close();
|
|
3842
|
+
}
|
|
3843
|
+
break;
|
|
3844
|
+
default:
|
|
3845
|
+
assertUnreachable(action);
|
|
3265
3846
|
}
|
|
3266
|
-
}
|
|
3267
|
-
return t;
|
|
3268
|
-
}
|
|
3269
|
-
function computePrefixL(s1, s2) {
|
|
3270
|
-
let prefixL = 0;
|
|
3271
|
-
while (s1[prefixL] === s2[prefixL] && prefixL < JARO_WINKLER_MAX_L) {
|
|
3272
|
-
prefixL++;
|
|
3273
|
-
}
|
|
3274
|
-
return prefixL;
|
|
3275
|
-
}
|
|
3276
|
-
|
|
3277
|
-
const groupBy = (list, keyGetter) => {
|
|
3278
|
-
const result = new Map();
|
|
3279
|
-
for (const item of list) {
|
|
3280
|
-
const key = keyGetter(item);
|
|
3281
|
-
const group = result.get(key) || [];
|
|
3282
|
-
result.set(key, [...group, item]);
|
|
3283
|
-
}
|
|
3284
|
-
return result;
|
|
3285
|
-
};
|
|
3286
|
-
|
|
3287
|
-
const Dialog = JSX(({ className, isOpened, head, children, onClose }) => {
|
|
3847
|
+
}), [closeAll, close]);
|
|
3288
3848
|
useEffect(() => {
|
|
3289
3849
|
const handleEscape = ({ key }) => {
|
|
3290
3850
|
if (key === 'Escape') {
|
|
3291
|
-
|
|
3851
|
+
close();
|
|
3292
3852
|
}
|
|
3293
3853
|
};
|
|
3294
3854
|
globalThis.document?.addEventListener('keydown', handleEscape);
|
|
3295
3855
|
return () => {
|
|
3296
3856
|
globalThis.document?.removeEventListener('keydown', handleEscape);
|
|
3297
3857
|
};
|
|
3298
|
-
}, [
|
|
3299
|
-
return isOpened ? (jsx("div", { className: style('fixed inset-0 bg-white text-l font-light z-50 overflow-x-hidden overflow-y-scroll no-scrollbar', className), role: "dialog", children: jsxs("div", { className: "relative container pb-6xl min-h-full", children: [jsxs("div", { className: "sticky bg-white pt-xl top-0", children: [jsx(CloseButton, { className: "absolute top-0 -right-6xl", onClick: onClose }), head] }), children] }) })) : null;
|
|
3300
|
-
});
|
|
3301
|
-
|
|
3302
|
-
const SearchBar = JSX(({ className, searchTerm, onSearch }) => {
|
|
3303
|
-
return (jsxs("form", { className: `font-sans relative ${className}`, children: [jsx("div", { className: "absolute rounded h-full flex items-center justify-center pl-4 max-w-44 gap-3.5 pointer-events-none", children: searchTerm ? null : (jsx("label", { htmlFor: "search-bar-input", className: `text-secondary-text `, children: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0444\u0438\u043B\u0438\u0430\u043B\u0430\u043C" })) }), jsx("input", { id: "search-bar-input", className: `h-12 pl-4 w-full peer text-l text-black border border-solid rounded-md box-border
|
|
3304
|
-
outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text`, value: searchTerm, onChange: (e) => onSearch(e.target.value.toLowerCase()), type: "text", name: "location-search-bar-input" })] }));
|
|
3305
|
-
});
|
|
3306
|
-
|
|
3307
|
-
const SEARCH_TERM_MIN_LENGTH = 3;
|
|
3308
|
-
const LOCATION_DIALOG_ID = 'location';
|
|
3309
|
-
const LocationDialog = JSX(({ currentLocation, onChangeLocation, foreignOffices }) => {
|
|
3310
|
-
const dialogProps = useDialogProps(LOCATION_DIALOG_ID);
|
|
3311
|
-
const [query, setQuery] = useState('');
|
|
3312
|
-
const regions = cleanUpRegions(useRegions()).sort((a, b) => a.name.localeCompare(b.name));
|
|
3313
|
-
const regionsGroupByLetter = groupBy(regions, regionFirstLetter);
|
|
3314
|
-
const handleChangeLocation = useCallback((region) => {
|
|
3315
|
-
dialogProps.onClose && dialogProps.onClose();
|
|
3316
|
-
onChangeLocation && onChangeLocation(region);
|
|
3317
|
-
}, [dialogProps.onClose, onChangeLocation]);
|
|
3318
|
-
return (jsxs(Dialog, { ...dialogProps, head: jsxs("div", { children: [jsx(CurrentLocation, { currentLocation: currentLocation, onChangeLocation: handleChangeLocation }), jsx(SearchBar, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
|
|
3319
|
-
.filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
|
|
3320
|
-
.map(renderRegion(handleChangeLocation)) })) : (jsx("div", { className: "columns-5", children: Array.from(regionsGroupByLetter.entries()).map(renderRegionGroup(handleChangeLocation)) })), jsx(ForeignOffices, { foreignOffices: foreignOffices })] }));
|
|
3321
|
-
});
|
|
3322
|
-
const regionFirstLetter = (region) => region.name?.charAt(0) || '';
|
|
3323
|
-
const cleanUpRegions = (regions) => regions.map((region) => ({
|
|
3324
|
-
...region,
|
|
3325
|
-
name: region.name?.replace(/республика|область|край'/gi, '').trim() || '',
|
|
3326
|
-
}));
|
|
3327
|
-
const CurrentLocation = JSX(({ currentLocation, onChangeLocation }) => currentLocation ? (jsxs("div", { className: "mb-4", children: [jsx(Text, { size: "text-l", font: "font-light", children: "\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:\u00A0" }), jsx("button", { className: "cursor-pointer", onClick: () => {
|
|
3328
|
-
onChangeLocation && onChangeLocation(currentLocation);
|
|
3329
|
-
}, children: jsx(Text, { color: "text-primary-main", children: currentLocation.name }) })] })) : null);
|
|
3330
|
-
const renderRegionGroup = (onChangeLocation) => ([letter, regions]) => (jsxs("div", { className: "break-inside-avoid mb-2xl w-56", children: [jsx("div", { className: "mb-s", children: jsx(Text, { size: "text-h6", children: letter }) }), regions.map(renderRegion(onChangeLocation))] }, letter));
|
|
3331
|
-
const renderRegion = (onChangeLocation) => (region) => (jsx("div", { className: "mb-2xs", children: jsx("button", { className: "cursor-pointer hover:text-primary-hover", onClick: () => {
|
|
3332
|
-
onChangeLocation && onChangeLocation(region);
|
|
3333
|
-
}, children: region.name || '' }) }, region.id));
|
|
3334
|
-
const ForeignOffices = JSX(({ foreignOffices }) => foreignOffices?.length ? (jsxs("div", { className: "border-t border-main-divider mt-2xs pt-2xs", children: [jsx("div", { className: "mb-m", children: jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text", children: "\u041F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u0430 \u0437\u0430 \u0440\u0443\u0431\u0435\u0436\u043E\u043C:" }) }), jsx("div", { className: "flex gap-10", children: foreignOffices.map((office, i) => (jsx(ForeignOffice, { ...office }, String(i)))) })] })) : null);
|
|
3335
|
-
const ForeignOffice = JSX(({ icon, ...rest }) => {
|
|
3336
|
-
const link = useLink();
|
|
3337
|
-
const { text, target, href, onClick } = link(rest);
|
|
3338
|
-
return (jsxs("div", { className: "flex gap-x-3", children: [icon ? jsx(Img, { pathPrefix: "/wcms-resources/", image: icon }) : null, text ? (jsx("a", { className: "hover:text-primary-hover", href: href, target: target, onClick: onClick, children: text })) : null] }));
|
|
3339
|
-
});
|
|
3340
|
-
|
|
3341
|
-
const compareBy = (indexOf) => (a, b) => indexOf(a) - indexOf(b);
|
|
3342
|
-
const desc = (cmp) => (a, b) => -cmp(a, b);
|
|
3343
|
-
|
|
3344
|
-
function zip(firstCol, ...restCols) {
|
|
3345
|
-
return firstCol.map((firstEl, rowIndex) => [firstEl, ...restCols.map((col) => col[rowIndex])]);
|
|
3346
|
-
}
|
|
3347
|
-
|
|
3348
|
-
const joinMaps = (aggregate, emptyVal) => (acc, map) => {
|
|
3349
|
-
for (const [key, b] of map) {
|
|
3350
|
-
acc.set(key, aggregate(acc.get(key) || emptyVal, b));
|
|
3351
|
-
}
|
|
3352
|
-
return acc;
|
|
3353
|
-
};
|
|
3354
|
-
|
|
3355
|
-
const MIN_TERM_LEN = 3;
|
|
3356
|
-
const tokenize = (text) => text
|
|
3357
|
-
.toLowerCase()
|
|
3358
|
-
.split(/[^0-9a-zа-я-]+/)
|
|
3359
|
-
.filter((token) => token.length >= MIN_TERM_LEN && !/[0-9a-z]/.test(token));
|
|
3360
|
-
|
|
3361
|
-
const textRank = (queryTokens) => (text) => {
|
|
3362
|
-
const textTokens = tokenize(text || '');
|
|
3363
|
-
return textTokens.length
|
|
3364
|
-
? sum(queryTokens.map((qToken) => max(textTokens.map(jaroWinklerDistance(qToken)))))
|
|
3365
|
-
: 0;
|
|
3366
|
-
};
|
|
3367
|
-
|
|
3368
|
-
const JW_THRESHOLD = 0.8;
|
|
3369
|
-
const RANK_EPS = 0.001;
|
|
3370
|
-
const search = (query) => (searchIndex) => {
|
|
3371
|
-
const { corpus, dictionary } = searchIndex || {};
|
|
3372
|
-
if (!query || !corpus?.length || !dictionary || !Object.keys(dictionary).length) {
|
|
3373
|
-
return [];
|
|
3374
|
-
}
|
|
3375
|
-
const queryTokens = tokenize(query);
|
|
3376
|
-
if (!queryTokens.length) {
|
|
3377
|
-
return [];
|
|
3378
|
-
}
|
|
3379
|
-
const dictEntries = Object.entries(dictionary);
|
|
3380
|
-
const pagesRanking = queryTokens
|
|
3381
|
-
.map(computePagesRankingPerToken(dictEntries))
|
|
3382
|
-
.reduce(joinMaps((a, b) => a + b, 0), new Map());
|
|
3383
|
-
const relevantPages = [...pagesRanking.entries()]
|
|
3384
|
-
.filter(([, pageRank]) => pageRank >= (JW_THRESHOLD - RANK_EPS) * queryTokens.length) // Multiplication of query tokens
|
|
3385
|
-
.map(([pageIndex]) => corpus[pageIndex]);
|
|
3386
|
-
return sortResultsByRank(queryTokens)(relevantPages);
|
|
3387
|
-
};
|
|
3388
|
-
const computePagesRankingPerToken = (dictEntries) => (qToken) => dictEntries
|
|
3389
|
-
.map(([stem, pageIndices]) => [jaroWinklerDistance(qToken)(stem), pageIndices])
|
|
3390
|
-
.filter(([stemRank]) => stemRank >= JW_THRESHOLD)
|
|
3391
|
-
.map(([stemRank, pageIndices]) => fillMapWith(pageIndices, stemRank))
|
|
3392
|
-
.reduce(joinMaps(Math.max, 0), new Map());
|
|
3393
|
-
const sortResultsByRank = (queryTokens) => (results) => zip(results, results.map(({ title }) => title).map(textRank(queryTokens)))
|
|
3394
|
-
.sort(desc(compareBy(([, pageTitleRank]) => pageTitleRank)))
|
|
3395
|
-
.map(([corpusItem]) => corpusItem);
|
|
3396
|
-
const fillMapWith = (keys, value) => new Map(keys.map((_) => [_, value]));
|
|
3397
|
-
|
|
3398
|
-
const SEARCH_INDEX_FILENAME = 'search.index.json';
|
|
3399
|
-
const DEFAULT_BASE_PATH = ['/'];
|
|
3400
|
-
const useSearch = ({ basePathList = DEFAULT_BASE_PATH, initialQuery = '', wasOpened, }) => {
|
|
3401
|
-
const [query, setQuery] = useState(initialQuery || '');
|
|
3858
|
+
}, [close]);
|
|
3402
3859
|
useEffect(() => {
|
|
3403
|
-
if (
|
|
3404
|
-
|
|
3860
|
+
if (dialogs.length) {
|
|
3861
|
+
globalThis.document?.body.classList.add('no-scrollbar');
|
|
3405
3862
|
}
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
[wasOpened, basePathList]);
|
|
3409
|
-
const { data } = useAsyncData(key, fetchSearchIndex);
|
|
3410
|
-
const [result, setResult] = useState(null);
|
|
3411
|
-
useDebouncedEffect(() => {
|
|
3412
|
-
if (data) {
|
|
3413
|
-
setResult(data.map(search(query)));
|
|
3863
|
+
else {
|
|
3864
|
+
globalThis.document?.body.classList.remove('no-scrollbar');
|
|
3414
3865
|
}
|
|
3415
|
-
}, [
|
|
3416
|
-
return
|
|
3417
|
-
};
|
|
3418
|
-
const fetchSearchIndex = async (...basePathList) => (await Promise.allSettled(basePathList.map((basePath) => fetchJSON(joinPath(basePath, '/', SEARCH_INDEX_FILENAME))))).map((_) => (_.status === 'fulfilled' ? _.value : {}));
|
|
3419
|
-
|
|
3420
|
-
const Sitemap = JSX(({ className, topItems }) => {
|
|
3421
|
-
const link = useLink({ isRemote: true });
|
|
3422
|
-
return (jsx("div", { className: style('flex items-start justify-between', className), children: topItems?.map(link).map(renderColumn) }));
|
|
3423
|
-
});
|
|
3424
|
-
const renderColumn = (menuItem, index) => {
|
|
3425
|
-
const { text, items, href, target, onClick } = menuItem;
|
|
3426
|
-
return (jsxs("div", { className: "flex flex-col gap-3.5 w-1/4", children: [jsx("a", { className: "leading-5 text-l text-primary-text hover:text-primary-main no-underline", href: href, target: target || '_self', onClick: onClick, children: text || `Раздел ${index}` }), items?.map((_, i) => (jsx(ColumnItem, { ..._, basePath: appendSlash(href), index: i }, String(i))))] }, String(index)));
|
|
3427
|
-
};
|
|
3428
|
-
const ColumnItem = JSX(({ text, index, basePath, ...rest }) => {
|
|
3429
|
-
const isAnotherPortal = projectSettings.BASE_PATH && basePath ? !projectSettings.BASE_PATH.startsWith(basePath) : false;
|
|
3430
|
-
const link = useLink({ isRemote: isAnotherPortal, basePath });
|
|
3431
|
-
const { href, target, onClick } = link(rest);
|
|
3432
|
-
return (jsx("a", { className: style('text-l font-light text-secondary-text hover:text-primary-main no-underline', 'overflow-x-hidden overflow-ellipsis whitespace-nowrap'), href: href, target: target || '_self', onClick: onClick, children: text || `Раздел ${index}` }));
|
|
3433
|
-
});
|
|
3434
|
-
|
|
3435
|
-
const SearchInput = JSX(({ className, value, autoFocus, onChange, onFocus }) => {
|
|
3436
|
-
const handleChange = useCallback((ev) => {
|
|
3437
|
-
onChange && onChange(ev.target?.value || '');
|
|
3438
|
-
}, [onChange]);
|
|
3439
|
-
return (jsxs("div", { className: style('font-sans relative', className), role: "form", children: [jsx("div", { className: "absolute h-full flex items-center pl-m pointer-events-none", children: jsx(Img, { image: { icon: 'LoupeIcon' }, width: "24", height: "24" }) }), jsx("input", { className: style('h-12 pl-12 w-full text-l text-black outline-none box-border', 'border border-solid rounded-md border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'), value: value, type: "text", name: "search-bar-input", placeholder: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u0430\u0439\u0442\u0443", autoFocus: autoFocus, onChange: handleChange, onFocus: onFocus })] }));
|
|
3866
|
+
}, [dialogs]);
|
|
3867
|
+
return dialogs.length ? (jsx("div", { className: "fixed inset-0 z-50", role: "dialog", children: dialogs.map(({ dialog, id }, i) => (jsx("div", { className: style('absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar', i === dialogs.length - 1 ? '' : 'hidden'), children: dialog }, String(id || i)))) })) : null;
|
|
3440
3868
|
});
|
|
3441
3869
|
|
|
3442
|
-
const SEARCH_DIALOG_ID = 'search';
|
|
3443
|
-
const SearchDialog = JSX(({ topItems }) => {
|
|
3444
|
-
const dialogProps = useDialogProps(SEARCH_DIALOG_ID);
|
|
3445
|
-
const basePathList = useMemo(() => topItems?.map((_) => _.href || '/'), [topItems]);
|
|
3446
|
-
const [searchResult, searchInputProps] = useSearch({
|
|
3447
|
-
basePathList,
|
|
3448
|
-
initialQuery: dialogProps.message,
|
|
3449
|
-
wasOpened: dialogProps.wasOpened,
|
|
3450
|
-
});
|
|
3451
|
-
const searchItems = useMemo(() => combineTopItemsAndSearchResult(topItems)(searchResult), [topItems, searchResult]);
|
|
3452
|
-
useEffect(() => printSearchItems(searchItems), [searchItems]); // Temp
|
|
3453
|
-
return (jsx(Dialog, { ...dialogProps, head: jsx(SearchInput, { autoFocus: true, ...searchInputProps }), children: jsx(Sitemap, { topItems: searchItems }) }));
|
|
3454
|
-
});
|
|
3455
|
-
const combineTopItemsAndSearchResult = (topItems) => (searchResult) => topItems?.length && searchResult?.length
|
|
3456
|
-
? zip(topItems, searchResult).map(([_, portalSearchResult]) => ({
|
|
3457
|
-
..._,
|
|
3458
|
-
items: portalSearchResult?.map(({ title, uri }) => ({ text: title, href: joinPath('/', uri) })),
|
|
3459
|
-
}))
|
|
3460
|
-
: [];
|
|
3461
|
-
// Temp
|
|
3462
|
-
function printSearchItems(topItems) {
|
|
3463
|
-
for (const _ of topItems.filter(({ items }) => items?.length)) {
|
|
3464
|
-
console.group(_.text);
|
|
3465
|
-
console.table(_.items, ['text', 'href']);
|
|
3466
|
-
console.groupEnd();
|
|
3467
|
-
}
|
|
3468
|
-
}
|
|
3469
|
-
|
|
3470
3870
|
const api = LikeAPI();
|
|
3471
3871
|
function useLikeService(pagePath) {
|
|
3472
3872
|
const [likeCount, setLikeCount] = useState(0);
|
|
@@ -3517,23 +3917,8 @@
|
|
|
3517
3917
|
blockDecorator,
|
|
3518
3918
|
parent: data,
|
|
3519
3919
|
};
|
|
3520
|
-
const sitemap = useSWRResource(projectSettings.SITEMAP || 'sitemap', data?.fallback);
|
|
3521
|
-
const [location, onChangeLocation] = useLocation(sitemap?.defaultLocation);
|
|
3522
3920
|
useBlockRouterProvider();
|
|
3523
|
-
|
|
3524
|
-
useDialogHandlers({
|
|
3525
|
-
onOpen: setSomeDialogOpened,
|
|
3526
|
-
onClose: resetSomeDialogOpened,
|
|
3527
|
-
});
|
|
3528
|
-
return (jsxs("section", { className: style('relative @container', pageStyle, className, isSomeDialogOpened ? 'overflow-hidden h-screen' : ''), "data-theme": colorPalette, children: [slots?.header ? (jsx("div", { className: "relative z-10 mb-5 shadow-[0_8px_32px_0px_#00000014]", children: renderBlocksList(slots?.header, {
|
|
3529
|
-
...options,
|
|
3530
|
-
slotName: 'header',
|
|
3531
|
-
extraProps: { sitemap, location },
|
|
3532
|
-
}) })) : null, jsxs("div", { className: "container @lg:grid @lg:grid-cols-12 @lg:gap-1", children: [renderChildren({ block: data, options, extraProps: { className: 'scroll-mt-12' } }), renderBlocksList(slots?.footer, {
|
|
3533
|
-
...options,
|
|
3534
|
-
slotName: 'footer',
|
|
3535
|
-
extraProps: { sitemap, location },
|
|
3536
|
-
})] }), likeControl ? renderLikeControl() : null, jsx(CookiePopup, { termLink: { href: '/pd-policy#cookie', target: '_blank' }, personalDataPolicyLink: { href: '/pd-policy', target: '_blank' } }), jsx(SearchDialog, { topItems: sitemap?.topItems }), jsx(LocationDialog, { currentLocation: location, foreignOffices: sitemap?.foreignOffices, onChangeLocation: onChangeLocation })] }));
|
|
3921
|
+
return (jsxs("div", { children: [jsxs("section", { className: style('relative @container', pageStyle, className), "data-theme": colorPalette, children: [slots?.header ? (jsx("div", { className: "relative z-10 mb-5 shadow-[0_8px_32px_0px_#00000014]", children: renderBlocksList(slots?.header, { ...options, slotName: 'header' }) })) : null, jsxs("div", { className: "container @lg:grid @lg:grid-cols-12 @lg:gap-1", children: [renderChildren({ block: data, options, extraProps: { className: 'scroll-mt-12' } }), renderBlocksList(slots?.footer, { ...options, slotName: 'footer' })] }), likeControl ? renderLikeControl() : null] }), jsx(DialogManager, {}), jsx(CookiePopup, { termLink: { href: '/pd-policy#cookie', target: '_blank' }, personalDataPolicyLink: { href: '/pd-policy', target: '_blank' } })] }));
|
|
3537
3922
|
});
|
|
3538
3923
|
ContentPage.childrenTypes = [];
|
|
3539
3924
|
ContentPage.slots = () => ['header', 'footer'];
|
|
@@ -3543,7 +3928,7 @@
|
|
|
3543
3928
|
|
|
3544
3929
|
const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
|
|
3545
3930
|
|
|
3546
|
-
const packageVersion = "0.
|
|
3931
|
+
const packageVersion = "0.13.0";
|
|
3547
3932
|
|
|
3548
3933
|
exports.Blocks = Blocks;
|
|
3549
3934
|
exports.ContentPage = ContentPage;
|