@redneckz/wildless-cms-uni-blocks 0.3.70 → 0.3.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +388 -416
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Accordion/Accordion.mobile.js.map +1 -1
- package/dist/components/Blocks.d.ts +0 -1
- package/dist/components/Blocks.js +0 -2
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/dist/components/Calculator/Calculator.js +7 -3
- package/dist/components/Calculator/Calculator.js.map +1 -1
- package/dist/components/Calculator/getCalculatorParams.js +2 -1
- package/dist/components/Calculator/getCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/getCreditRate.js +2 -1
- package/dist/components/Calculator/getCreditRate.js.map +1 -1
- package/dist/components/Calculator/getMonthlyPayment.js +2 -1
- package/dist/components/Calculator/getMonthlyPayment.js.map +1 -1
- package/dist/components/Calculator/renderCalculatorBlock.js.map +1 -1
- package/dist/components/ComparisonTable/HeaderCell.mobile.js +4 -2
- package/dist/components/ComparisonTable/HeaderCell.mobile.js.map +1 -1
- package/dist/components/ComparisonTable/TableCell.js +3 -1
- package/dist/components/ComparisonTable/TableCell.js.map +1 -1
- package/dist/components/ComparisonTable/TableCell.mobile.js +3 -1
- package/dist/components/ComparisonTable/TableCell.mobile.js.map +1 -1
- package/dist/components/ComparisonTable/TableRow.js +2 -1
- package/dist/components/ComparisonTable/TableRow.js.map +1 -1
- package/dist/components/ContentPage/ContentPageContext.d.ts +14 -3
- package/dist/components/ExchangeRateTile/CurrencyProps.d.ts +5 -0
- package/dist/components/ExchangeRateTile/CurrencyProps.js +9 -0
- package/dist/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
- package/dist/components/ExchangeRateTile/CurrencyTable.d.ts +1 -1
- package/dist/components/ExchangeRateTile/CurrencyTable.js +2 -2
- package/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +16 -4
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +68 -9
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js +7 -19
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +0 -10
- package/dist/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/dist/components/ExchangeRateTile/calculateResult.js +11 -0
- package/dist/components/ExchangeRateTile/calculateResult.js.map +1 -0
- package/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/dist/components/ExchangeRateTile/callbackCurrencySelect.js +17 -0
- package/dist/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
- package/dist/components/ExchangeRateTile/formatCurrency.js +5 -1
- package/dist/components/ExchangeRateTile/formatCurrency.js.map +1 -1
- package/dist/components/ExchangeRateTile/renderButton.d.ts +1 -0
- package/dist/components/ExchangeRateTile/renderButton.js +9 -0
- package/dist/components/ExchangeRateTile/renderButton.js.map +1 -0
- package/dist/components/ExchangeRateTile/renderInput.d.ts +12 -0
- package/dist/components/ExchangeRateTile/renderInput.js +12 -0
- package/dist/components/ExchangeRateTile/renderInput.js.map +1 -0
- package/dist/components/Footer/Footer.js +1 -1
- package/dist/components/Footer/Footer.js.map +1 -1
- package/dist/components/Footer/MediaButton.js +4 -13
- package/dist/components/Footer/MediaButton.js.map +1 -1
- package/dist/components/Footer/TextInformation.js +1 -1
- package/dist/components/Footer/TextInformation.js.map +1 -1
- package/dist/components/Gallery/Gallery.mobile.js +2 -2
- package/dist/components/Gallery/Gallery.mobile.js.map +1 -1
- package/dist/components/Gallery/GalleryCardInner.js +2 -2
- package/dist/components/Gallery/GalleryCardInner.js.map +1 -1
- package/dist/components/Gallery/GalleryInner.js +7 -2
- package/dist/components/Gallery/GalleryInner.js.map +1 -1
- package/dist/components/GroupBlock/BlocksTypeProps.d.ts +4 -1
- package/dist/components/GroupBlock/GroupBlock.js +3 -3
- package/dist/components/GroupBlock/GroupBlock.js.map +1 -1
- package/dist/components/GroupBlock/GroupBlockTabs.js +2 -2
- package/dist/components/GroupBlock/GroupBlockTabs.js.map +1 -1
- package/dist/components/GroupBlock/GroupBlocksItem.js +1 -1
- package/dist/components/GroupBlock/GroupBlocksItem.js.map +1 -1
- package/dist/components/Header/DropdownMenu.d.ts +13 -0
- package/dist/components/Header/DropdownMenu.js +18 -0
- package/dist/components/Header/DropdownMenu.js.map +1 -0
- package/dist/components/Header/HeaderSubMenu.js +19 -32
- package/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +8 -4
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocsListItemBase.js +2 -1
- package/dist/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
- package/dist/components/Placeholder/Placeholder.js +1 -1
- package/dist/components/Placeholder/Placeholder.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.js +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.mobile.js +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
- package/dist/components/ProductTile/ProductTile.js +2 -2
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/Recommendation/Recommendation.js +7 -2
- package/dist/components/Recommendation/Recommendation.js.map +1 -1
- package/dist/components/Tile/Tile.js +4 -4
- package/dist/components/Tile/Tile.js.map +1 -1
- package/dist/components/Tile/TileContent.d.ts +5 -0
- package/dist/content-page-repository/mapJSON.d.ts +1 -1
- package/dist/content-page-repository/mapJSON.js +9 -7
- package/dist/content-page-repository/mapJSON.js.map +1 -1
- package/dist/content-page-repository/transformMarkdown.js +2 -1
- package/dist/content-page-repository/transformMarkdown.js.map +1 -1
- package/dist/content-page-repository/transformPicture.js +6 -3
- package/dist/content-page-repository/transformPicture.js.map +1 -1
- package/dist/hooks/useCreditCalculatorData.d.ts +1 -2
- package/dist/hooks/useCreditCalculatorData.js.map +1 -1
- package/dist/hooks/useExchangeRates.d.ts +2 -8
- package/dist/hooks/useExchangeRates.js +52 -3
- package/dist/hooks/useExchangeRates.js.map +1 -1
- package/dist/hooks/useTableArrowScrollControl.js +3 -3
- package/dist/hooks/useTableArrowScrollControl.js.map +1 -1
- package/dist/react/IntersectionObserverTag.d.ts +3 -0
- package/dist/react/IntersectionObserverTag.js +17 -0
- package/dist/react/IntersectionObserverTag.js.map +1 -0
- package/dist/{setup-fixture.d.ts → react/setup-fixture.d.ts} +1 -1
- package/{mobile/dist → dist/react}/setup-fixture.js +3 -1
- package/dist/react/setup-fixture.js.map +1 -0
- package/dist/services/sitemap/isHrefActive.d.ts +1 -1
- package/dist/services/sitemap/isHrefActive.js +1 -1
- package/dist/services/sitemap/isHrefActive.js.map +1 -1
- package/dist/ui-kit/Button/ArrowButton.d.ts +1 -1
- package/dist/ui-kit/Button/ArrowButton.js.map +1 -1
- package/dist/ui-kit/Button/ButtonSection.js +2 -1
- package/dist/ui-kit/Button/ButtonSection.js.map +1 -1
- package/dist/ui-kit/Button/renderArrows.d.ts +10 -0
- package/dist/ui-kit/Button/renderArrows.js +9 -0
- package/dist/ui-kit/Button/renderArrows.js.map +1 -0
- package/dist/ui-kit/Img/Img.mobile.js +1 -1
- package/dist/ui-kit/Img/Img.mobile.js.map +1 -1
- package/dist/ui-kit/Input/Input.js +6 -2
- package/dist/ui-kit/Input/Input.js.map +1 -1
- package/dist/ui-kit/Input/InputProps.d.ts +3 -0
- package/dist/ui-kit/InputRange/InputRange.js +10 -6
- package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
- package/dist/ui-kit/SVG.js +1 -1
- package/dist/ui-kit/SVG.js.map +1 -1
- package/dist/ui-kit/SearchBar.mobile.js +1 -1
- package/dist/ui-kit/SearchBar.mobile.js.map +1 -1
- package/dist/ui-kit/Select/Select.d.ts +2 -0
- package/dist/ui-kit/Select/Select.js +2 -2
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +2 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/utils/getIndexParts.js +3 -2
- package/dist/ui-kit/SwipeListControl/utils/getIndexParts.js.map +1 -1
- package/dist/ui-kit/TableArrowScrollControl/TableArrowScrollControl.js +9 -3
- package/dist/ui-kit/TableArrowScrollControl/TableArrowScrollControl.js.map +1 -1
- package/dist/ui-kit/TableArrowScrollControl/TableArrowScrollControlProps.d.ts +5 -4
- package/dist/ui-kit/Tabs/Tabs.js +2 -1
- package/dist/ui-kit/Tabs/Tabs.js.map +1 -1
- package/dist/ui-kit/TopItem/TopItem.js +6 -8
- package/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/dist/utils/changeHashOnScroll.js +2 -1
- package/dist/utils/changeHashOnScroll.js.map +1 -1
- package/dist/utils/getCurrentDate.js +1 -1
- package/dist/utils/roundTo.d.ts +1 -0
- package/dist/utils/roundTo.js +8 -0
- package/dist/utils/roundTo.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Accordion/Accordion.mobile.js.map +1 -1
- package/lib/components/Blocks.d.ts +0 -1
- package/lib/components/Blocks.js +0 -2
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/lib/components/Calculator/Calculator.js +8 -4
- package/lib/components/Calculator/Calculator.js.map +1 -1
- package/lib/components/Calculator/getCalculatorParams.js +2 -1
- package/lib/components/Calculator/getCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/getCreditRate.js +2 -1
- package/lib/components/Calculator/getCreditRate.js.map +1 -1
- package/lib/components/Calculator/getMonthlyPayment.js +2 -1
- package/lib/components/Calculator/getMonthlyPayment.js.map +1 -1
- package/lib/components/Calculator/renderCalculatorBlock.js.map +1 -1
- package/lib/components/ComparisonTable/HeaderCell.mobile.js +4 -2
- package/lib/components/ComparisonTable/HeaderCell.mobile.js.map +1 -1
- package/lib/components/ComparisonTable/TableCell.js +3 -1
- package/lib/components/ComparisonTable/TableCell.js.map +1 -1
- package/lib/components/ComparisonTable/TableCell.mobile.js +3 -1
- package/lib/components/ComparisonTable/TableCell.mobile.js.map +1 -1
- package/lib/components/ComparisonTable/TableRow.js +2 -1
- package/lib/components/ComparisonTable/TableRow.js.map +1 -1
- package/lib/components/ContentPage/ContentPageContext.d.ts +14 -3
- package/lib/components/ExchangeRateTile/CurrencyProps.d.ts +5 -0
- package/lib/components/ExchangeRateTile/CurrencyProps.js +7 -0
- package/lib/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
- package/lib/components/ExchangeRateTile/CurrencyTable.d.ts +1 -1
- package/lib/components/ExchangeRateTile/CurrencyTable.js +2 -2
- package/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +16 -4
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +69 -10
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js +7 -19
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +0 -10
- package/lib/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/lib/components/ExchangeRateTile/calculateResult.js +7 -0
- package/lib/components/ExchangeRateTile/calculateResult.js.map +1 -0
- package/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/lib/components/ExchangeRateTile/callbackCurrencySelect.js +14 -0
- package/lib/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
- package/lib/components/ExchangeRateTile/formatCurrency.js +5 -1
- package/lib/components/ExchangeRateTile/formatCurrency.js.map +1 -1
- package/lib/components/ExchangeRateTile/renderButton.d.ts +1 -0
- package/lib/components/ExchangeRateTile/renderButton.js +6 -0
- package/lib/components/ExchangeRateTile/renderButton.js.map +1 -0
- package/lib/components/ExchangeRateTile/renderInput.d.ts +12 -0
- package/lib/components/ExchangeRateTile/renderInput.js +9 -0
- package/lib/components/ExchangeRateTile/renderInput.js.map +1 -0
- package/lib/components/Footer/Footer.js +1 -1
- package/lib/components/Footer/Footer.js.map +1 -1
- package/lib/components/Footer/MediaButton.js +4 -13
- package/lib/components/Footer/MediaButton.js.map +1 -1
- package/lib/components/Footer/TextInformation.js +1 -1
- package/lib/components/Footer/TextInformation.js.map +1 -1
- package/lib/components/Gallery/Gallery.mobile.js +2 -2
- package/lib/components/Gallery/Gallery.mobile.js.map +1 -1
- package/lib/components/Gallery/GalleryCardInner.js +2 -2
- package/lib/components/Gallery/GalleryCardInner.js.map +1 -1
- package/lib/components/Gallery/GalleryInner.js +7 -2
- package/lib/components/Gallery/GalleryInner.js.map +1 -1
- package/lib/components/GroupBlock/BlocksTypeProps.d.ts +4 -1
- package/lib/components/GroupBlock/GroupBlock.fixture.d.ts +1 -0
- package/lib/components/GroupBlock/GroupBlock.js +3 -3
- package/lib/components/GroupBlock/GroupBlock.js.map +1 -1
- package/lib/components/GroupBlock/GroupBlockTabs.js +2 -2
- package/lib/components/GroupBlock/GroupBlockTabs.js.map +1 -1
- package/lib/components/GroupBlock/GroupBlocksItem.js +1 -1
- package/lib/components/GroupBlock/GroupBlocksItem.js.map +1 -1
- package/lib/components/Header/DropdownMenu.d.ts +13 -0
- package/lib/components/Header/DropdownMenu.js +16 -0
- package/lib/components/Header/DropdownMenu.js.map +1 -0
- package/lib/components/Header/HeaderSubMenu.js +19 -32
- package/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/lib/components/Headline/Headline.fixture.d.ts +9 -3
- package/lib/components/Headline/Headline.fixture.mobile.d.ts +13 -3
- package/lib/components/Insurance/Insurance.fixture.d.ts +2 -1
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +8 -4
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocsListItemBase.js +2 -1
- package/lib/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
- package/lib/components/Placeholder/Placeholder.js +1 -1
- package/lib/components/Placeholder/Placeholder.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +10 -2
- package/lib/components/ProductBlock/ProductBlockInner.js +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.mobile.js +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
- package/lib/components/ProductTile/ProductTile.js +2 -2
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/Recommendation/Recommendation.fixture.d.ts +3 -0
- package/lib/components/Recommendation/Recommendation.js +7 -2
- package/lib/components/Recommendation/Recommendation.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.fixture.mobile.d.ts +7 -1
- package/lib/components/TextBlock/TextBlock.fixture.d.ts +3 -1
- package/lib/components/TextBlock/TextBlock.fixture.mobile.d.ts +3 -1
- package/lib/components/Tile/Tile.js +4 -4
- package/lib/components/Tile/Tile.js.map +1 -1
- package/lib/components/Tile/TileContent.d.ts +5 -0
- package/lib/content-page-repository/mapJSON.d.ts +1 -1
- package/lib/content-page-repository/mapJSON.js +9 -7
- package/lib/content-page-repository/mapJSON.js.map +1 -1
- package/lib/content-page-repository/transformMarkdown.js +2 -1
- package/lib/content-page-repository/transformMarkdown.js.map +1 -1
- package/lib/content-page-repository/transformPicture.js +6 -3
- package/lib/content-page-repository/transformPicture.js.map +1 -1
- package/lib/hooks/useCreditCalculatorData.d.ts +1 -2
- package/lib/hooks/useCreditCalculatorData.js.map +1 -1
- package/lib/hooks/useExchangeRates.d.ts +2 -8
- package/lib/hooks/useExchangeRates.js +52 -3
- package/lib/hooks/useExchangeRates.js.map +1 -1
- package/lib/hooks/useTableArrowScrollControl.js +3 -3
- package/lib/hooks/useTableArrowScrollControl.js.map +1 -1
- package/lib/react/IntersectionObserverTag.d.ts +3 -0
- package/lib/react/IntersectionObserverTag.js +14 -0
- package/lib/react/IntersectionObserverTag.js.map +1 -0
- package/lib/{setup-fixture.d.ts → react/setup-fixture.d.ts} +1 -1
- package/{mobile/lib → lib/react}/setup-fixture.js +3 -1
- package/lib/react/setup-fixture.js.map +1 -0
- package/lib/services/sitemap/isHrefActive.d.ts +1 -1
- package/lib/services/sitemap/isHrefActive.js +1 -1
- package/lib/services/sitemap/isHrefActive.js.map +1 -1
- package/lib/ui-kit/Button/ArrowButton.d.ts +1 -1
- package/lib/ui-kit/Button/ArrowButton.js.map +1 -1
- package/lib/ui-kit/Button/Button.fixture.d.ts +1 -1
- package/lib/ui-kit/Button/Button.fixture.mobile.d.ts +1 -1
- package/lib/ui-kit/Button/ButtonSection.js +2 -1
- package/lib/ui-kit/Button/ButtonSection.js.map +1 -1
- package/lib/ui-kit/Button/renderArrows.d.ts +10 -0
- package/lib/ui-kit/Button/renderArrows.js +6 -0
- package/lib/ui-kit/Button/renderArrows.js.map +1 -0
- package/lib/ui-kit/HeaderItem/HeaderItem.fixture.d.ts +1 -1
- package/lib/ui-kit/Icon/Icon.fixture.d.ts +1 -1
- package/lib/ui-kit/Img/Img.mobile.js +1 -1
- package/lib/ui-kit/Img/Img.mobile.js.map +1 -1
- package/lib/ui-kit/Input/Input.js +6 -2
- package/lib/ui-kit/Input/Input.js.map +1 -1
- package/lib/ui-kit/Input/InputProps.d.ts +3 -0
- package/lib/ui-kit/InputRange/InputRange.js +10 -6
- package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
- package/lib/ui-kit/List/List.fixture.d.ts +1 -1
- package/lib/ui-kit/Logo/Logo.fixture.d.ts +1 -1
- package/lib/ui-kit/SVG.js +1 -1
- package/lib/ui-kit/SVG.js.map +1 -1
- package/lib/ui-kit/SearchBar.mobile.js +1 -1
- package/lib/ui-kit/SearchBar.mobile.js.map +1 -1
- package/lib/ui-kit/Select/Select.d.ts +2 -0
- package/lib/ui-kit/Select/Select.js +2 -2
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +2 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/utils/getIndexParts.js +3 -2
- package/lib/ui-kit/SwipeListControl/utils/getIndexParts.js.map +1 -1
- package/lib/ui-kit/TableArrowScrollControl/TableArrowScrollControl.js +10 -4
- package/lib/ui-kit/TableArrowScrollControl/TableArrowScrollControl.js.map +1 -1
- package/lib/ui-kit/TableArrowScrollControl/TableArrowScrollControlProps.d.ts +5 -4
- package/lib/ui-kit/Tabs/Tabs.js +2 -1
- package/lib/ui-kit/Tabs/Tabs.js.map +1 -1
- package/lib/ui-kit/TopItem/TopItem.fixture.d.ts +1 -1
- package/lib/ui-kit/TopItem/TopItem.js +6 -8
- package/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/lib/utils/changeHashOnScroll.js +2 -1
- package/lib/utils/changeHashOnScroll.js.map +1 -1
- package/lib/utils/getCurrentDate.js +1 -1
- package/lib/utils/roundTo.d.ts +1 -0
- package/lib/utils/roundTo.js +5 -0
- package/lib/utils/roundTo.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +214 -69
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/Accordion/Accordion.js.map +1 -1
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/mobile/dist/components/Calculator/Calculator.js +7 -3
- package/mobile/dist/components/Calculator/Calculator.js.map +1 -1
- package/mobile/dist/components/Calculator/getCalculatorParams.js +2 -1
- package/mobile/dist/components/Calculator/getCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/getCreditRate.js +2 -1
- package/mobile/dist/components/Calculator/getCreditRate.js.map +1 -1
- package/mobile/dist/components/Calculator/getMonthlyPayment.js +2 -1
- package/mobile/dist/components/Calculator/getMonthlyPayment.js.map +1 -1
- package/mobile/dist/components/Calculator/renderCalculatorBlock.js.map +1 -1
- package/mobile/dist/components/ComparisonTable/HeaderCell.js +4 -2
- package/mobile/dist/components/ComparisonTable/HeaderCell.js.map +1 -1
- package/mobile/dist/components/ComparisonTable/TableCell.js +3 -1
- package/mobile/dist/components/ComparisonTable/TableCell.js.map +1 -1
- package/mobile/dist/components/ComparisonTable/TableRow.js +2 -1
- package/mobile/dist/components/ComparisonTable/TableRow.js.map +1 -1
- package/mobile/dist/components/ContentPage/ContentPageContext.d.ts +14 -3
- package/mobile/dist/components/ExchangeRateTile/CurrencyProps.d.ts +5 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyProps.js +9 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.d.ts +1 -1
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js +2 -2
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +16 -4
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +68 -9
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +7 -19
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +0 -10
- package/mobile/dist/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/mobile/dist/components/ExchangeRateTile/calculateResult.js +11 -0
- package/mobile/dist/components/ExchangeRateTile/calculateResult.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.js +17 -0
- package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/formatCurrency.js +5 -1
- package/mobile/dist/components/ExchangeRateTile/formatCurrency.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/renderButton.d.ts +1 -0
- package/mobile/dist/components/ExchangeRateTile/renderButton.js +9 -0
- package/mobile/dist/components/ExchangeRateTile/renderButton.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/renderInput.d.ts +12 -0
- package/mobile/dist/components/ExchangeRateTile/renderInput.js +12 -0
- package/mobile/dist/components/ExchangeRateTile/renderInput.js.map +1 -0
- package/mobile/dist/components/Footer/MediaButton.js +4 -13
- package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
- package/mobile/dist/components/Gallery/Gallery.js +2 -2
- package/mobile/dist/components/Gallery/Gallery.js.map +1 -1
- package/mobile/dist/components/Gallery/GalleryCardInner.js +2 -2
- package/mobile/dist/components/Gallery/GalleryCardInner.js.map +1 -1
- package/mobile/dist/components/Gallery/GalleryInner.js +7 -2
- package/mobile/dist/components/Gallery/GalleryInner.js.map +1 -1
- package/mobile/dist/components/GroupBlock/BlocksTypeProps.d.ts +4 -1
- package/mobile/dist/components/GroupBlock/GroupBlock.js +3 -3
- package/mobile/dist/components/GroupBlock/GroupBlock.js.map +1 -1
- package/mobile/dist/components/GroupBlock/GroupBlockTabs.js +2 -2
- package/mobile/dist/components/GroupBlock/GroupBlockTabs.js.map +1 -1
- package/mobile/dist/components/GroupBlock/GroupBlocksItem.js +1 -1
- package/mobile/dist/components/GroupBlock/GroupBlocksItem.js.map +1 -1
- package/mobile/dist/components/Header/DropdownMenu.d.ts +13 -0
- package/mobile/dist/components/Header/DropdownMenu.js +18 -0
- package/mobile/dist/components/Header/DropdownMenu.js.map +1 -0
- package/mobile/dist/components/Header/HeaderSubMenu.js +19 -32
- package/mobile/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +8 -4
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsListItemBase.js +2 -1
- package/mobile/dist/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
- package/mobile/dist/components/Placeholder/Placeholder.js +1 -1
- package/mobile/dist/components/Placeholder/Placeholder.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockInner.js +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTile.js +2 -2
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/Recommendation/Recommendation.js +7 -2
- package/mobile/dist/components/Recommendation/Recommendation.js.map +1 -1
- package/mobile/dist/components/Tile/Tile.js +4 -4
- package/mobile/dist/components/Tile/Tile.js.map +1 -1
- package/mobile/dist/components/Tile/TileContent.d.ts +5 -0
- package/mobile/dist/content-page-repository/mapJSON.d.ts +1 -1
- package/mobile/dist/content-page-repository/mapJSON.js +9 -7
- package/mobile/dist/content-page-repository/mapJSON.js.map +1 -1
- package/mobile/dist/content-page-repository/transformMarkdown.js +2 -1
- package/mobile/dist/content-page-repository/transformMarkdown.js.map +1 -1
- package/mobile/dist/content-page-repository/transformPicture.js +6 -3
- package/mobile/dist/content-page-repository/transformPicture.js.map +1 -1
- package/mobile/dist/hooks/useCreditCalculatorData.d.ts +1 -2
- package/mobile/dist/hooks/useCreditCalculatorData.js.map +1 -1
- package/mobile/dist/hooks/useExchangeRates.d.ts +2 -8
- package/mobile/dist/hooks/useExchangeRates.js +52 -3
- package/mobile/dist/hooks/useExchangeRates.js.map +1 -1
- package/mobile/dist/hooks/useTableArrowScrollControl.js +3 -3
- package/mobile/dist/hooks/useTableArrowScrollControl.js.map +1 -1
- package/mobile/dist/react/IntersectionObserverTag.d.ts +3 -0
- package/mobile/dist/react/IntersectionObserverTag.js +17 -0
- package/mobile/dist/react/IntersectionObserverTag.js.map +1 -0
- package/mobile/dist/{setup-fixture.d.ts → react/setup-fixture.d.ts} +1 -1
- package/{dist → mobile/dist/react}/setup-fixture.js +3 -1
- package/mobile/dist/react/setup-fixture.js.map +1 -0
- package/mobile/dist/services/sitemap/isHrefActive.d.ts +1 -1
- package/mobile/dist/services/sitemap/isHrefActive.js +1 -1
- package/mobile/dist/services/sitemap/isHrefActive.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ArrowButton.d.ts +1 -1
- package/mobile/dist/ui-kit/Button/ArrowButton.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonSection.js +2 -1
- package/mobile/dist/ui-kit/Button/ButtonSection.js.map +1 -1
- package/mobile/dist/ui-kit/Button/renderArrows.d.ts +10 -0
- package/mobile/dist/ui-kit/Button/renderArrows.js +9 -0
- package/mobile/dist/ui-kit/Button/renderArrows.js.map +1 -0
- package/mobile/dist/ui-kit/Img/Img.js +1 -1
- package/mobile/dist/ui-kit/Img/Img.js.map +1 -1
- package/mobile/dist/ui-kit/Input/Input.js +6 -2
- package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputProps.d.ts +3 -0
- package/mobile/dist/ui-kit/InputRange/InputRange.js +10 -6
- package/mobile/dist/ui-kit/InputRange/InputRange.js.map +1 -1
- package/mobile/dist/ui-kit/SVG.js +1 -1
- package/mobile/dist/ui-kit/SVG.js.map +1 -1
- package/mobile/dist/ui-kit/Select/Select.d.ts +2 -0
- package/mobile/dist/ui-kit/Select/Select.js +2 -2
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +2 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/utils/getIndexParts.js +3 -2
- package/mobile/dist/ui-kit/SwipeListControl/utils/getIndexParts.js.map +1 -1
- package/mobile/dist/ui-kit/TableArrowScrollControl/TableArrowScrollControl.js +9 -3
- package/mobile/dist/ui-kit/TableArrowScrollControl/TableArrowScrollControl.js.map +1 -1
- package/mobile/dist/ui-kit/TableArrowScrollControl/TableArrowScrollControlProps.d.ts +5 -4
- package/mobile/dist/ui-kit/Tabs/Tabs.js +2 -1
- package/mobile/dist/ui-kit/Tabs/Tabs.js.map +1 -1
- package/mobile/dist/ui-kit/TopItem/TopItem.js +6 -8
- package/mobile/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/dist/utils/changeHashOnScroll.js +2 -1
- package/mobile/dist/utils/changeHashOnScroll.js.map +1 -1
- package/mobile/dist/utils/getCurrentDate.js +1 -1
- package/mobile/dist/utils/roundTo.d.ts +1 -0
- package/mobile/dist/utils/roundTo.js +8 -0
- package/mobile/dist/utils/roundTo.js.map +1 -0
- package/mobile/lib/components/Accordion/Accordion.js.map +1 -1
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/mobile/lib/components/Calculator/Calculator.js +8 -4
- package/mobile/lib/components/Calculator/Calculator.js.map +1 -1
- package/mobile/lib/components/Calculator/getCalculatorParams.js +2 -1
- package/mobile/lib/components/Calculator/getCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/getCreditRate.js +2 -1
- package/mobile/lib/components/Calculator/getCreditRate.js.map +1 -1
- package/mobile/lib/components/Calculator/getMonthlyPayment.js +2 -1
- package/mobile/lib/components/Calculator/getMonthlyPayment.js.map +1 -1
- package/mobile/lib/components/Calculator/renderCalculatorBlock.js.map +1 -1
- package/mobile/lib/components/ComparisonTable/HeaderCell.js +4 -2
- package/mobile/lib/components/ComparisonTable/HeaderCell.js.map +1 -1
- package/mobile/lib/components/ComparisonTable/TableCell.js +3 -1
- package/mobile/lib/components/ComparisonTable/TableCell.js.map +1 -1
- package/mobile/lib/components/ComparisonTable/TableRow.js +2 -1
- package/mobile/lib/components/ComparisonTable/TableRow.js.map +1 -1
- package/mobile/lib/components/ContentPage/ContentPageContext.d.ts +14 -3
- package/mobile/lib/components/ExchangeRateTile/CurrencyProps.d.ts +5 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyProps.js +7 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.d.ts +1 -1
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js +2 -2
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +16 -4
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +69 -10
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +7 -19
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +0 -10
- package/mobile/lib/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/mobile/lib/components/ExchangeRateTile/calculateResult.js +7 -0
- package/mobile/lib/components/ExchangeRateTile/calculateResult.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.js +14 -0
- package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/formatCurrency.js +5 -1
- package/mobile/lib/components/ExchangeRateTile/formatCurrency.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/renderButton.d.ts +1 -0
- package/mobile/lib/components/ExchangeRateTile/renderButton.js +6 -0
- package/mobile/lib/components/ExchangeRateTile/renderButton.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/renderInput.d.ts +12 -0
- package/mobile/lib/components/ExchangeRateTile/renderInput.js +9 -0
- package/mobile/lib/components/ExchangeRateTile/renderInput.js.map +1 -0
- package/mobile/lib/components/Footer/MediaButton.js +4 -13
- package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
- package/mobile/lib/components/Gallery/Gallery.js +2 -2
- package/mobile/lib/components/Gallery/Gallery.js.map +1 -1
- package/mobile/lib/components/Gallery/GalleryCardInner.js +2 -2
- package/mobile/lib/components/Gallery/GalleryCardInner.js.map +1 -1
- package/mobile/lib/components/Gallery/GalleryInner.js +7 -2
- package/mobile/lib/components/Gallery/GalleryInner.js.map +1 -1
- package/mobile/lib/components/GroupBlock/BlocksTypeProps.d.ts +4 -1
- package/mobile/lib/components/GroupBlock/GroupBlock.js +3 -3
- package/mobile/lib/components/GroupBlock/GroupBlock.js.map +1 -1
- package/mobile/lib/components/GroupBlock/GroupBlockTabs.js +2 -2
- package/mobile/lib/components/GroupBlock/GroupBlockTabs.js.map +1 -1
- package/mobile/lib/components/GroupBlock/GroupBlocksItem.js +1 -1
- package/mobile/lib/components/GroupBlock/GroupBlocksItem.js.map +1 -1
- package/mobile/lib/components/Header/DropdownMenu.d.ts +13 -0
- package/mobile/lib/components/Header/DropdownMenu.js +16 -0
- package/mobile/lib/components/Header/DropdownMenu.js.map +1 -0
- package/mobile/lib/components/Header/HeaderSubMenu.js +19 -32
- package/mobile/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +8 -4
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsListItemBase.js +2 -1
- package/mobile/lib/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
- package/mobile/lib/components/Placeholder/Placeholder.js +1 -1
- package/mobile/lib/components/Placeholder/Placeholder.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockInner.js +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTile.js +2 -2
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/Recommendation/Recommendation.js +7 -2
- package/mobile/lib/components/Recommendation/Recommendation.js.map +1 -1
- package/mobile/lib/components/Tile/Tile.js +4 -4
- package/mobile/lib/components/Tile/Tile.js.map +1 -1
- package/mobile/lib/components/Tile/TileContent.d.ts +5 -0
- package/mobile/lib/content-page-repository/mapJSON.d.ts +1 -1
- package/mobile/lib/content-page-repository/mapJSON.js +9 -7
- package/mobile/lib/content-page-repository/mapJSON.js.map +1 -1
- package/mobile/lib/content-page-repository/transformMarkdown.js +2 -1
- package/mobile/lib/content-page-repository/transformMarkdown.js.map +1 -1
- package/mobile/lib/content-page-repository/transformPicture.js +6 -3
- package/mobile/lib/content-page-repository/transformPicture.js.map +1 -1
- package/mobile/lib/hooks/useCreditCalculatorData.d.ts +1 -2
- package/mobile/lib/hooks/useCreditCalculatorData.js.map +1 -1
- package/mobile/lib/hooks/useExchangeRates.d.ts +2 -8
- package/mobile/lib/hooks/useExchangeRates.js +52 -3
- package/mobile/lib/hooks/useExchangeRates.js.map +1 -1
- package/mobile/lib/hooks/useTableArrowScrollControl.js +3 -3
- package/mobile/lib/hooks/useTableArrowScrollControl.js.map +1 -1
- package/mobile/lib/react/IntersectionObserverTag.d.ts +3 -0
- package/mobile/lib/react/IntersectionObserverTag.js +14 -0
- package/mobile/lib/react/IntersectionObserverTag.js.map +1 -0
- package/mobile/lib/{setup-fixture.d.ts → react/setup-fixture.d.ts} +1 -1
- package/{lib → mobile/lib/react}/setup-fixture.js +3 -1
- package/mobile/lib/react/setup-fixture.js.map +1 -0
- package/mobile/lib/services/sitemap/isHrefActive.d.ts +1 -1
- package/mobile/lib/services/sitemap/isHrefActive.js +1 -1
- package/mobile/lib/services/sitemap/isHrefActive.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ArrowButton.d.ts +1 -1
- package/mobile/lib/ui-kit/Button/ArrowButton.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonSection.js +2 -1
- package/mobile/lib/ui-kit/Button/ButtonSection.js.map +1 -1
- package/mobile/lib/ui-kit/Button/renderArrows.d.ts +10 -0
- package/mobile/lib/ui-kit/Button/renderArrows.js +6 -0
- package/mobile/lib/ui-kit/Button/renderArrows.js.map +1 -0
- package/mobile/lib/ui-kit/Img/Img.js +1 -1
- package/mobile/lib/ui-kit/Img/Img.js.map +1 -1
- package/mobile/lib/ui-kit/Input/Input.js +6 -2
- package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputProps.d.ts +3 -0
- package/mobile/lib/ui-kit/InputRange/InputRange.js +10 -6
- package/mobile/lib/ui-kit/InputRange/InputRange.js.map +1 -1
- package/mobile/lib/ui-kit/SVG.js +1 -1
- package/mobile/lib/ui-kit/SVG.js.map +1 -1
- package/mobile/lib/ui-kit/Select/Select.d.ts +2 -0
- package/mobile/lib/ui-kit/Select/Select.js +2 -2
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +2 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/utils/getIndexParts.js +3 -2
- package/mobile/lib/ui-kit/SwipeListControl/utils/getIndexParts.js.map +1 -1
- package/mobile/lib/ui-kit/TableArrowScrollControl/TableArrowScrollControl.js +10 -4
- package/mobile/lib/ui-kit/TableArrowScrollControl/TableArrowScrollControl.js.map +1 -1
- package/mobile/lib/ui-kit/TableArrowScrollControl/TableArrowScrollControlProps.d.ts +5 -4
- package/mobile/lib/ui-kit/Tabs/Tabs.js +2 -1
- package/mobile/lib/ui-kit/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/ui-kit/TopItem/TopItem.js +6 -8
- package/mobile/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/lib/utils/changeHashOnScroll.js +2 -1
- package/mobile/lib/utils/changeHashOnScroll.js.map +1 -1
- package/mobile/lib/utils/getCurrentDate.js +1 -1
- package/mobile/lib/utils/roundTo.d.ts +1 -0
- package/mobile/lib/utils/roundTo.js +5 -0
- package/mobile/lib/utils/roundTo.js.map +1 -0
- package/mobile/src/components/Accordion/Accordion.tsx +1 -3
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.example.json +1 -1
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +4 -8
- package/mobile/src/components/Calculator/Calculator.tsx +8 -22
- package/mobile/src/components/Calculator/getCalculatorParams.ts +3 -1
- package/mobile/src/components/Calculator/getCreditRate.ts +3 -1
- package/mobile/src/components/Calculator/getMonthlyPayment.ts +3 -1
- package/mobile/src/components/Calculator/renderCalculatorBlock.tsx +0 -7
- package/mobile/src/components/ComparisonTable/HeaderCell.tsx +7 -13
- package/mobile/src/components/ComparisonTable/TableCell.tsx +7 -8
- package/mobile/src/components/ComparisonTable/TableRow.tsx +6 -9
- package/mobile/src/components/ContentPage/ContentPage.page.json +0 -5
- package/mobile/src/components/ContentPage/ContentPageContext.tsx +20 -4
- package/mobile/src/components/ExchangeRateTile/CurrencyProps.ts +5 -0
- package/mobile/src/components/ExchangeRateTile/CurrencyTable.tsx +4 -4
- package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +120 -35
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +14 -28
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +0 -11
- package/mobile/src/components/ExchangeRateTile/calculateResult.ts +8 -0
- package/mobile/src/components/ExchangeRateTile/callbackCurrencySelect.ts +21 -0
- package/mobile/src/components/ExchangeRateTile/formatCurrency.ts +6 -1
- package/mobile/src/components/ExchangeRateTile/renderButton.tsx +14 -0
- package/mobile/src/components/ExchangeRateTile/renderInput.tsx +43 -0
- package/mobile/src/components/Footer/MediaButton.tsx +7 -17
- package/mobile/src/components/Gallery/Gallery.tsx +2 -2
- package/mobile/src/components/Gallery/GalleryCardInner.tsx +2 -2
- package/mobile/src/components/Gallery/GalleryInner.tsx +10 -20
- package/mobile/src/components/GroupBlock/BlocksTypeProps.ts +4 -1
- package/mobile/src/components/GroupBlock/GroupBlock.example.json +8 -7
- package/mobile/src/components/GroupBlock/GroupBlock.tsx +9 -4
- package/mobile/src/components/GroupBlock/GroupBlockTabs.tsx +4 -4
- package/mobile/src/components/GroupBlock/GroupBlocksItem.tsx +1 -1
- package/mobile/src/components/Header/DropdownMenu.tsx +72 -0
- package/mobile/src/components/Header/HeaderSubMenu.tsx +45 -87
- package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlockInner.tsx +14 -24
- package/mobile/src/components/LinkDocs/LinkDocsListItemBase.tsx +3 -1
- package/mobile/src/components/Placeholder/Placeholder.tsx +6 -2
- package/mobile/src/components/ProductBlock/ProductBlock.example.json +1 -5
- package/mobile/src/components/ProductBlock/ProductBlockInner.tsx +1 -1
- package/mobile/src/components/ProductTile/ProductTile.tsx +2 -2
- package/mobile/src/components/Recommendation/Recommendation.tsx +7 -15
- package/mobile/src/components/TariffsTable/TariffsTable.example.json +1 -5
- package/mobile/src/components/Tile/Tile.example.json +1 -0
- package/mobile/src/components/Tile/Tile.tsx +4 -2
- package/mobile/src/components/Tile/TileContent.ts +5 -0
- package/mobile/src/content-page-repository/mapJSON.ts +11 -7
- package/mobile/src/content-page-repository/transformMarkdown.ts +3 -1
- package/mobile/src/content-page-repository/transformPicture.ts +8 -3
- package/mobile/src/hooks/useCreditCalculatorData.ts +2 -3
- package/mobile/src/hooks/useExchangeRates.ts +70 -10
- package/mobile/src/hooks/useTableArrowScrollControl.ts +3 -3
- package/mobile/src/react/IntersectionObserverTag.tsx +23 -0
- package/mobile/src/{setup-fixture.ts → react/setup-fixture.ts} +5 -2
- package/mobile/src/services/sitemap/isHrefActive.ts +2 -1
- package/mobile/src/ui-kit/Button/ArrowButton.tsx +1 -1
- package/mobile/src/ui-kit/Button/ButtonSection.tsx +3 -1
- package/mobile/src/ui-kit/Button/renderArrows.tsx +41 -0
- package/mobile/src/ui-kit/Img/Img.tsx +1 -0
- package/mobile/src/ui-kit/Input/Input.tsx +21 -5
- package/mobile/src/ui-kit/Input/InputProps.ts +3 -0
- package/mobile/src/ui-kit/InputRange/InputRange.tsx +14 -6
- package/mobile/src/ui-kit/SVG.tsx +2 -2
- package/mobile/src/ui-kit/Select/Select.tsx +17 -7
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +9 -4
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +3 -1
- package/mobile/src/ui-kit/SwipeListControl/utils/getIndexParts.ts +6 -2
- package/mobile/src/ui-kit/TableArrowScrollControl/TableArrowScrollControl.tsx +9 -18
- package/mobile/src/ui-kit/TableArrowScrollControl/TableArrowScrollControlProps.ts +6 -4
- package/mobile/src/ui-kit/Tabs/Tabs.tsx +4 -3
- package/mobile/src/ui-kit/TopItem/TopItem.tsx +8 -9
- package/mobile/src/utils/changeHashOnScroll.ts +3 -1
- package/mobile/src/utils/getCurrentDate.ts +1 -1
- package/mobile/src/utils/roundTo.ts +4 -0
- package/package.json +3 -3
- package/src/components/Accordion/Accordion.fixture.mobile.tsx +1 -1
- package/src/components/Accordion/Accordion.fixture.tsx +11 -11
- package/src/components/Accordion/Accordion.mobile.tsx +1 -3
- package/src/components/BenefitsBlock/BenefitsBlock.fixture.tsx +1 -1
- package/src/components/Blocks.ts +0 -2
- package/src/components/Bonus/Bonus.fixture.tsx +1 -1
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.example.json +1 -1
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.fixture.tsx +1 -1
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +4 -8
- package/src/components/Calculator/Calculator.fixture.tsx +4 -4
- package/src/components/Calculator/Calculator.tsx +8 -22
- package/src/components/Calculator/getCalculatorParams.ts +3 -1
- package/src/components/Calculator/getCreditRate.ts +3 -1
- package/src/components/Calculator/getMonthlyPayment.ts +3 -1
- package/src/components/Calculator/renderCalculatorBlock.tsx +0 -7
- package/src/components/ComparisonTable/ComparisonTable.fixture.mobile.tsx +2 -26
- package/src/components/ComparisonTable/ComparisonTable.fixture.tsx +1 -1
- package/src/components/ComparisonTable/HeaderCell.mobile.tsx +7 -13
- package/src/components/ComparisonTable/TableCell.mobile.tsx +7 -8
- package/src/components/ComparisonTable/TableCell.tsx +7 -10
- package/src/components/ComparisonTable/TableRow.tsx +6 -9
- package/src/components/ContentPage/ContentPage.fixture.mobile.tsx +1 -1
- package/src/components/ContentPage/ContentPage.fixture.tsx +1 -1
- package/src/components/ContentPage/ContentPage.page.json +0 -5
- package/src/components/ContentPage/ContentPageContext.tsx +20 -4
- package/src/components/ExchangeRateTile/CurrencyProps.ts +5 -0
- package/src/components/ExchangeRateTile/CurrencyTable.tsx +4 -4
- package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +120 -35
- package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.tsx +1 -1
- package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +14 -28
- package/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +0 -11
- package/src/components/ExchangeRateTile/calculateResult.ts +8 -0
- package/src/components/ExchangeRateTile/callbackCurrencySelect.ts +21 -0
- package/src/components/ExchangeRateTile/formatCurrency.ts +6 -1
- package/src/components/ExchangeRateTile/renderButton.tsx +14 -0
- package/src/components/ExchangeRateTile/renderInput.tsx +43 -0
- package/src/components/Footer/Footer.fixture.mobile.tsx +1 -1
- package/src/components/Footer/Footer.fixture.tsx +1 -1
- package/src/components/Footer/Footer.tsx +1 -1
- package/src/components/Footer/MediaButton.tsx +7 -17
- package/src/components/Footer/TextInformation.tsx +2 -2
- package/src/components/Gallery/Gallery.fixture.mobile.tsx +2 -24
- package/src/components/Gallery/Gallery.fixture.tsx +1 -1
- package/src/components/Gallery/Gallery.mobile.tsx +2 -2
- package/src/components/Gallery/GalleryCardInner.tsx +2 -2
- package/src/components/Gallery/GalleryInner.tsx +10 -20
- package/src/components/GracePeriod/GracePeriod.fixture.tsx +1 -1
- package/src/components/GroupBlock/BlocksTypeProps.ts +4 -1
- package/src/components/GroupBlock/GroupBlock.example.json +8 -7
- package/src/components/GroupBlock/GroupBlock.fixture.tsx +19 -3
- package/src/components/GroupBlock/GroupBlock.tsx +9 -4
- package/src/components/GroupBlock/GroupBlockTabs.tsx +4 -4
- package/src/components/GroupBlock/GroupBlocksItem.tsx +1 -1
- package/src/components/Header/DropdownMenu.tsx +72 -0
- package/src/components/Header/Header.fixture.mobile.tsx +1 -1
- package/src/components/Header/Header.fixture.tsx +1 -1
- package/src/components/Header/HeaderSubMenu.tsx +45 -87
- package/src/components/Headline/Headline.fixture.mobile.tsx +45 -4
- package/src/components/Headline/Headline.fixture.tsx +31 -7
- package/src/components/Insurance/Insurance.fixture.tsx +6 -2
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlock.fixture.tsx +1 -1
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlockInner.tsx +14 -24
- package/src/components/LikeControl/LikeControl.fixture.tsx +1 -1
- package/src/components/LinkDocs/LinkDocs.fixture.mobile.tsx +2 -2
- package/src/components/LinkDocs/LinkDocs.fixture.tsx +2 -2
- package/src/components/LinkDocs/LinkDocsListItemBase.tsx +3 -1
- package/src/components/LinkList/LinkList.fixture.tsx +1 -1
- package/src/components/MiniGallery/MiniGallery.fixture.tsx +1 -1
- package/src/components/MobileAppTile/MobileAppTile.fixture.mobile.tsx +1 -1
- package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +1 -1
- package/src/components/Navigation/Navigation.fixture.tsx +1 -1
- package/src/components/NavigatorTabs/NavigatorTabs.fixture.tsx +1 -1
- package/src/components/OtherProducts/OtherProducts.fixture.tsx +1 -1
- package/src/components/PictureText/PictureText.fixture.tsx +1 -1
- package/src/components/Placeholder/Placeholder.fixture.mobile.tsx +1 -1
- package/src/components/Placeholder/Placeholder.fixture.tsx +1 -1
- package/src/components/Placeholder/Placeholder.tsx +6 -2
- package/src/components/ProductBlock/ProductBlock.example.json +1 -5
- package/src/components/ProductBlock/ProductBlock.fixture.mobile.tsx +2 -2
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +35 -5
- package/src/components/ProductBlock/ProductBlockInner.mobile.tsx +1 -1
- package/src/components/ProductBlock/ProductBlockInner.tsx +1 -1
- package/src/components/ProductGallery/ProductGallery.fixture.mobile.tsx +1 -1
- package/src/components/ProductGallery/ProductGallery.fixture.tsx +2 -2
- package/src/components/ProductTile/ProductTile.fixture.tsx +1 -1
- package/src/components/ProductTile/ProductTile.tsx +2 -2
- package/src/components/PromoTile/PromoTile.fixture.tsx +2 -2
- package/src/components/Recommendation/Recommendation.fixture.tsx +18 -13
- package/src/components/Recommendation/Recommendation.tsx +7 -15
- package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +38 -3
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +1 -1
- package/src/components/TariffsTable/TariffsTable.example.json +1 -5
- package/src/components/TariffsTable/TariffsTable.fixture.mobile.tsx +2 -30
- package/src/components/TariffsTable/TariffsTable.fixture.tsx +1 -1
- package/src/components/TextBlock/TextBlock.fixture.mobile.tsx +106 -103
- package/src/components/TextBlock/TextBlock.fixture.tsx +65 -87
- package/src/components/Tile/Tile.example.json +1 -0
- package/src/components/Tile/Tile.fixture.tsx +2 -1
- package/src/components/Tile/Tile.tsx +4 -2
- package/src/components/Tile/TileContent.ts +5 -0
- package/src/content-page-repository/mapJSON.ts +11 -7
- package/src/content-page-repository/transformMarkdown.ts +3 -1
- package/src/content-page-repository/transformPicture.ts +8 -3
- package/src/hooks/useCreditCalculatorData.ts +2 -3
- package/src/hooks/useExchangeRates.ts +70 -10
- package/src/hooks/useTableArrowScrollControl.ts +3 -3
- package/src/react/IntersectionObserverTag.tsx +23 -0
- package/src/{setup-fixture.ts → react/setup-fixture.ts} +5 -2
- package/src/services/sitemap/isHrefActive.ts +2 -1
- package/src/ui-kit/Button/ArrowButton.tsx +1 -1
- package/src/ui-kit/Button/Button.fixture.mobile.tsx +1 -1
- package/src/ui-kit/Button/Button.fixture.tsx +1 -1
- package/src/ui-kit/Button/ButtonSection.tsx +3 -1
- package/src/ui-kit/Button/renderArrows.tsx +41 -0
- package/src/ui-kit/HeaderItem/HeaderItem.fixture.tsx +1 -1
- package/src/ui-kit/Icon/Icon.fixture.tsx +2 -2
- package/src/ui-kit/Img/Img.mobile.tsx +1 -0
- package/src/ui-kit/Input/Input.tsx +21 -5
- package/src/ui-kit/Input/InputProps.ts +3 -0
- package/src/ui-kit/InputRange/InputRange.tsx +14 -6
- package/src/ui-kit/List/List.fixture.tsx +1 -1
- package/src/ui-kit/Logo/Logo.fixture.tsx +1 -1
- package/src/ui-kit/SVG.tsx +2 -2
- package/src/ui-kit/SearchBar.mobile.tsx +1 -3
- package/src/ui-kit/Select/Select.tsx +17 -7
- package/src/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.tsx +1 -1
- package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +9 -4
- package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +3 -1
- package/src/ui-kit/SwipeListControl/utils/getIndexParts.ts +6 -2
- package/src/ui-kit/TableArrowScrollControl/TableArrowScrollControl.tsx +9 -18
- package/src/ui-kit/TableArrowScrollControl/TableArrowScrollControlProps.ts +6 -4
- package/src/ui-kit/Tabs/Tabs.tsx +4 -3
- package/src/ui-kit/TopItem/TopItem.fixture.tsx +1 -1
- package/src/ui-kit/TopItem/TopItem.tsx +8 -9
- package/src/utils/changeHashOnScroll.ts +3 -1
- package/src/utils/getCurrentDate.ts +1 -1
- package/src/utils/roundTo.ts +4 -0
- package/dist/components/CreditCalculator/CreditCalculator.d.ts +0 -5
- package/dist/components/CreditCalculator/CreditCalculator.js +0 -14
- package/dist/components/CreditCalculator/CreditCalculator.js.map +0 -1
- package/dist/components/CreditCalculator/CreditCalculatorContent.d.ts +0 -30
- package/dist/components/CreditCalculator/CreditCalculatorContent.js +0 -2
- package/dist/components/CreditCalculator/CreditCalculatorContent.js.map +0 -1
- package/dist/components/CreditCalculator/CreditCalculatorForm.d.ts +0 -5
- package/dist/components/CreditCalculator/CreditCalculatorForm.js +0 -53
- package/dist/components/CreditCalculator/CreditCalculatorForm.js.map +0 -1
- package/dist/components/CreditCalculator/constants.d.ts +0 -7
- package/dist/components/CreditCalculator/constants.js +0 -10
- package/dist/components/CreditCalculator/constants.js.map +0 -1
- package/dist/components/CreditCalculator/defaultTabs.d.ts +0 -2
- package/dist/components/CreditCalculator/defaultTabs.js +0 -23
- package/dist/components/CreditCalculator/defaultTabs.js.map +0 -1
- package/dist/components/CreditCalculator/getCalculatorParams.d.ts +0 -7
- package/dist/components/CreditCalculator/getCalculatorParams.js +0 -11
- package/dist/components/CreditCalculator/getCalculatorParams.js.map +0 -1
- package/dist/components/CreditCalculator/getCreditRate.d.ts +0 -7
- package/dist/components/CreditCalculator/getCreditRate.js +0 -13
- package/dist/components/CreditCalculator/getCreditRate.js.map +0 -1
- package/dist/components/CreditCalculator/getCreditTermYears.d.ts +0 -1
- package/dist/components/CreditCalculator/getCreditTermYears.js +0 -15
- package/dist/components/CreditCalculator/getCreditTermYears.js.map +0 -1
- package/dist/components/CreditCalculator/getDefaultMonths.d.ts +0 -2
- package/dist/components/CreditCalculator/getDefaultMonths.js +0 -8
- package/dist/components/CreditCalculator/getDefaultMonths.js.map +0 -1
- package/dist/components/CreditCalculator/getDefaultSum.d.ts +0 -2
- package/dist/components/CreditCalculator/getDefaultSum.js +0 -8
- package/dist/components/CreditCalculator/getDefaultSum.js.map +0 -1
- package/dist/components/CreditCalculator/getMonthlyPayment.d.ts +0 -11
- package/dist/components/CreditCalculator/getMonthlyPayment.js +0 -19
- package/dist/components/CreditCalculator/getMonthlyPayment.js.map +0 -1
- package/dist/components/CreditCalculator/renderButton.d.ts +0 -1
- package/dist/components/CreditCalculator/renderButton.js +0 -15
- package/dist/components/CreditCalculator/renderButton.js.map +0 -1
- package/dist/components/CreditCalculator/renderMonthsInput.d.ts +0 -10
- package/dist/components/CreditCalculator/renderMonthsInput.js +0 -11
- package/dist/components/CreditCalculator/renderMonthsInput.js.map +0 -1
- package/dist/components/CreditCalculator/renderProposal.d.ts +0 -1
- package/dist/components/CreditCalculator/renderProposal.js +0 -9
- package/dist/components/CreditCalculator/renderProposal.js.map +0 -1
- package/dist/components/CreditCalculator/renderTermsButton.d.ts +0 -1
- package/dist/components/CreditCalculator/renderTermsButton.js +0 -9
- package/dist/components/CreditCalculator/renderTermsButton.js.map +0 -1
- package/dist/components/CreditCalculator/renderWantedSumInput.d.ts +0 -10
- package/dist/components/CreditCalculator/renderWantedSumInput.js +0 -18
- package/dist/components/CreditCalculator/renderWantedSumInput.js.map +0 -1
- package/dist/components/Header/HeaderSubMenuObserver.d.ts +0 -1
- package/dist/components/Header/HeaderSubMenuObserver.js +0 -36
- package/dist/components/Header/HeaderSubMenuObserver.js.map +0 -1
- package/dist/setup-fixture.js.map +0 -1
- package/lib/components/CreditCalculator/CreditCalculator.d.ts +0 -5
- package/lib/components/CreditCalculator/CreditCalculator.fixture.d.ts +0 -4
- package/lib/components/CreditCalculator/CreditCalculator.js +0 -12
- package/lib/components/CreditCalculator/CreditCalculator.js.map +0 -1
- package/lib/components/CreditCalculator/CreditCalculatorContent.d.ts +0 -30
- package/lib/components/CreditCalculator/CreditCalculatorContent.js +0 -2
- package/lib/components/CreditCalculator/CreditCalculatorContent.js.map +0 -1
- package/lib/components/CreditCalculator/CreditCalculatorForm.d.ts +0 -5
- package/lib/components/CreditCalculator/CreditCalculatorForm.js +0 -51
- package/lib/components/CreditCalculator/CreditCalculatorForm.js.map +0 -1
- package/lib/components/CreditCalculator/constants.d.ts +0 -7
- package/lib/components/CreditCalculator/constants.js +0 -8
- package/lib/components/CreditCalculator/constants.js.map +0 -1
- package/lib/components/CreditCalculator/defaultTabs.d.ts +0 -2
- package/lib/components/CreditCalculator/defaultTabs.js +0 -21
- package/lib/components/CreditCalculator/defaultTabs.js.map +0 -1
- package/lib/components/CreditCalculator/getCalculatorParams.d.ts +0 -7
- package/lib/components/CreditCalculator/getCalculatorParams.js +0 -8
- package/lib/components/CreditCalculator/getCalculatorParams.js.map +0 -1
- package/lib/components/CreditCalculator/getCreditRate.d.ts +0 -7
- package/lib/components/CreditCalculator/getCreditRate.js +0 -10
- package/lib/components/CreditCalculator/getCreditRate.js.map +0 -1
- package/lib/components/CreditCalculator/getCreditTermYears.d.ts +0 -1
- package/lib/components/CreditCalculator/getCreditTermYears.js +0 -12
- package/lib/components/CreditCalculator/getCreditTermYears.js.map +0 -1
- package/lib/components/CreditCalculator/getDefaultMonths.d.ts +0 -2
- package/lib/components/CreditCalculator/getDefaultMonths.js +0 -5
- package/lib/components/CreditCalculator/getDefaultMonths.js.map +0 -1
- package/lib/components/CreditCalculator/getDefaultSum.d.ts +0 -2
- package/lib/components/CreditCalculator/getDefaultSum.js +0 -5
- package/lib/components/CreditCalculator/getDefaultSum.js.map +0 -1
- package/lib/components/CreditCalculator/getMonthlyPayment.d.ts +0 -11
- package/lib/components/CreditCalculator/getMonthlyPayment.js +0 -16
- package/lib/components/CreditCalculator/getMonthlyPayment.js.map +0 -1
- package/lib/components/CreditCalculator/renderButton.d.ts +0 -1
- package/lib/components/CreditCalculator/renderButton.js +0 -12
- package/lib/components/CreditCalculator/renderButton.js.map +0 -1
- package/lib/components/CreditCalculator/renderMonthsInput.d.ts +0 -10
- package/lib/components/CreditCalculator/renderMonthsInput.js +0 -8
- package/lib/components/CreditCalculator/renderMonthsInput.js.map +0 -1
- package/lib/components/CreditCalculator/renderProposal.d.ts +0 -1
- package/lib/components/CreditCalculator/renderProposal.js +0 -6
- package/lib/components/CreditCalculator/renderProposal.js.map +0 -1
- package/lib/components/CreditCalculator/renderTermsButton.d.ts +0 -1
- package/lib/components/CreditCalculator/renderTermsButton.js +0 -6
- package/lib/components/CreditCalculator/renderTermsButton.js.map +0 -1
- package/lib/components/CreditCalculator/renderWantedSumInput.d.ts +0 -10
- package/lib/components/CreditCalculator/renderWantedSumInput.js +0 -15
- package/lib/components/CreditCalculator/renderWantedSumInput.js.map +0 -1
- package/lib/components/Header/HeaderSubMenuObserver.d.ts +0 -1
- package/lib/components/Header/HeaderSubMenuObserver.js +0 -34
- package/lib/components/Header/HeaderSubMenuObserver.js.map +0 -1
- package/lib/setup-fixture.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/CreditCalculator.d.ts +0 -5
- package/mobile/dist/components/CreditCalculator/CreditCalculator.js +0 -14
- package/mobile/dist/components/CreditCalculator/CreditCalculator.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/CreditCalculatorContent.d.ts +0 -30
- package/mobile/dist/components/CreditCalculator/CreditCalculatorContent.js +0 -2
- package/mobile/dist/components/CreditCalculator/CreditCalculatorContent.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/CreditCalculatorForm.d.ts +0 -5
- package/mobile/dist/components/CreditCalculator/CreditCalculatorForm.js +0 -53
- package/mobile/dist/components/CreditCalculator/CreditCalculatorForm.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/constants.d.ts +0 -7
- package/mobile/dist/components/CreditCalculator/constants.js +0 -10
- package/mobile/dist/components/CreditCalculator/constants.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/defaultTabs.d.ts +0 -2
- package/mobile/dist/components/CreditCalculator/defaultTabs.js +0 -23
- package/mobile/dist/components/CreditCalculator/defaultTabs.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/getCalculatorParams.d.ts +0 -7
- package/mobile/dist/components/CreditCalculator/getCalculatorParams.js +0 -11
- package/mobile/dist/components/CreditCalculator/getCalculatorParams.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/getCreditRate.d.ts +0 -7
- package/mobile/dist/components/CreditCalculator/getCreditRate.js +0 -13
- package/mobile/dist/components/CreditCalculator/getCreditRate.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/getCreditTermYears.d.ts +0 -1
- package/mobile/dist/components/CreditCalculator/getCreditTermYears.js +0 -15
- package/mobile/dist/components/CreditCalculator/getCreditTermYears.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/getDefaultMonths.d.ts +0 -2
- package/mobile/dist/components/CreditCalculator/getDefaultMonths.js +0 -8
- package/mobile/dist/components/CreditCalculator/getDefaultMonths.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/getDefaultSum.d.ts +0 -2
- package/mobile/dist/components/CreditCalculator/getDefaultSum.js +0 -8
- package/mobile/dist/components/CreditCalculator/getDefaultSum.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/getMonthlyPayment.d.ts +0 -11
- package/mobile/dist/components/CreditCalculator/getMonthlyPayment.js +0 -19
- package/mobile/dist/components/CreditCalculator/getMonthlyPayment.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/renderButton.d.ts +0 -1
- package/mobile/dist/components/CreditCalculator/renderButton.js +0 -15
- package/mobile/dist/components/CreditCalculator/renderButton.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/renderMonthsInput.d.ts +0 -10
- package/mobile/dist/components/CreditCalculator/renderMonthsInput.js +0 -11
- package/mobile/dist/components/CreditCalculator/renderMonthsInput.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/renderProposal.d.ts +0 -1
- package/mobile/dist/components/CreditCalculator/renderProposal.js +0 -9
- package/mobile/dist/components/CreditCalculator/renderProposal.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/renderTermsButton.d.ts +0 -1
- package/mobile/dist/components/CreditCalculator/renderTermsButton.js +0 -9
- package/mobile/dist/components/CreditCalculator/renderTermsButton.js.map +0 -1
- package/mobile/dist/components/CreditCalculator/renderWantedSumInput.d.ts +0 -10
- package/mobile/dist/components/CreditCalculator/renderWantedSumInput.js +0 -18
- package/mobile/dist/components/CreditCalculator/renderWantedSumInput.js.map +0 -1
- package/mobile/dist/components/Header/HeaderSubMenuObserver.d.ts +0 -1
- package/mobile/dist/components/Header/HeaderSubMenuObserver.js +0 -36
- package/mobile/dist/components/Header/HeaderSubMenuObserver.js.map +0 -1
- package/mobile/dist/setup-fixture.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/CreditCalculator.d.ts +0 -5
- package/mobile/lib/components/CreditCalculator/CreditCalculator.js +0 -12
- package/mobile/lib/components/CreditCalculator/CreditCalculator.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/CreditCalculatorContent.d.ts +0 -30
- package/mobile/lib/components/CreditCalculator/CreditCalculatorContent.js +0 -2
- package/mobile/lib/components/CreditCalculator/CreditCalculatorContent.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/CreditCalculatorForm.d.ts +0 -5
- package/mobile/lib/components/CreditCalculator/CreditCalculatorForm.js +0 -51
- package/mobile/lib/components/CreditCalculator/CreditCalculatorForm.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/constants.d.ts +0 -7
- package/mobile/lib/components/CreditCalculator/constants.js +0 -8
- package/mobile/lib/components/CreditCalculator/constants.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/defaultTabs.d.ts +0 -2
- package/mobile/lib/components/CreditCalculator/defaultTabs.js +0 -21
- package/mobile/lib/components/CreditCalculator/defaultTabs.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/getCalculatorParams.d.ts +0 -7
- package/mobile/lib/components/CreditCalculator/getCalculatorParams.js +0 -8
- package/mobile/lib/components/CreditCalculator/getCalculatorParams.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/getCreditRate.d.ts +0 -7
- package/mobile/lib/components/CreditCalculator/getCreditRate.js +0 -10
- package/mobile/lib/components/CreditCalculator/getCreditRate.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/getCreditTermYears.d.ts +0 -1
- package/mobile/lib/components/CreditCalculator/getCreditTermYears.js +0 -12
- package/mobile/lib/components/CreditCalculator/getCreditTermYears.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/getDefaultMonths.d.ts +0 -2
- package/mobile/lib/components/CreditCalculator/getDefaultMonths.js +0 -5
- package/mobile/lib/components/CreditCalculator/getDefaultMonths.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/getDefaultSum.d.ts +0 -2
- package/mobile/lib/components/CreditCalculator/getDefaultSum.js +0 -5
- package/mobile/lib/components/CreditCalculator/getDefaultSum.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/getMonthlyPayment.d.ts +0 -11
- package/mobile/lib/components/CreditCalculator/getMonthlyPayment.js +0 -16
- package/mobile/lib/components/CreditCalculator/getMonthlyPayment.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/renderButton.d.ts +0 -1
- package/mobile/lib/components/CreditCalculator/renderButton.js +0 -12
- package/mobile/lib/components/CreditCalculator/renderButton.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/renderMonthsInput.d.ts +0 -10
- package/mobile/lib/components/CreditCalculator/renderMonthsInput.js +0 -8
- package/mobile/lib/components/CreditCalculator/renderMonthsInput.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/renderProposal.d.ts +0 -1
- package/mobile/lib/components/CreditCalculator/renderProposal.js +0 -6
- package/mobile/lib/components/CreditCalculator/renderProposal.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/renderTermsButton.d.ts +0 -1
- package/mobile/lib/components/CreditCalculator/renderTermsButton.js +0 -6
- package/mobile/lib/components/CreditCalculator/renderTermsButton.js.map +0 -1
- package/mobile/lib/components/CreditCalculator/renderWantedSumInput.d.ts +0 -10
- package/mobile/lib/components/CreditCalculator/renderWantedSumInput.js +0 -15
- package/mobile/lib/components/CreditCalculator/renderWantedSumInput.js.map +0 -1
- package/mobile/lib/components/Header/HeaderSubMenuObserver.d.ts +0 -1
- package/mobile/lib/components/Header/HeaderSubMenuObserver.js +0 -34
- package/mobile/lib/components/Header/HeaderSubMenuObserver.js.map +0 -1
- package/mobile/lib/setup-fixture.js.map +0 -1
- package/mobile/src/components/CreditCalculator/CreditCalculator.example.json +0 -25
- package/mobile/src/components/CreditCalculator/CreditCalculator.tsx +0 -31
- package/mobile/src/components/CreditCalculator/CreditCalculatorContent.ts +0 -34
- package/mobile/src/components/CreditCalculator/CreditCalculatorForm.tsx +0 -92
- package/mobile/src/components/CreditCalculator/constants.ts +0 -8
- package/mobile/src/components/CreditCalculator/defaultTabs.ts +0 -22
- package/mobile/src/components/CreditCalculator/getCalculatorParams.ts +0 -16
- package/mobile/src/components/CreditCalculator/getCreditRate.ts +0 -18
- package/mobile/src/components/CreditCalculator/getCreditTermYears.spec.ts +0 -10
- package/mobile/src/components/CreditCalculator/getCreditTermYears.ts +0 -15
- package/mobile/src/components/CreditCalculator/getDefaultMonths.ts +0 -7
- package/mobile/src/components/CreditCalculator/getDefaultSum.ts +0 -7
- package/mobile/src/components/CreditCalculator/getMonthlyPayment.ts +0 -32
- package/mobile/src/components/CreditCalculator/renderButton.tsx +0 -23
- package/mobile/src/components/CreditCalculator/renderMonthsInput.tsx +0 -29
- package/mobile/src/components/CreditCalculator/renderProposal.tsx +0 -13
- package/mobile/src/components/CreditCalculator/renderTermsButton.tsx +0 -16
- package/mobile/src/components/CreditCalculator/renderWantedSumInput.tsx +0 -36
- package/mobile/src/components/Header/HeaderSubMenuObserver.ts +0 -48
- package/src/components/CreditCalculator/CreditCalculator.example.json +0 -25
- package/src/components/CreditCalculator/CreditCalculator.fixture.tsx +0 -32
- package/src/components/CreditCalculator/CreditCalculator.tsx +0 -31
- package/src/components/CreditCalculator/CreditCalculatorContent.ts +0 -34
- package/src/components/CreditCalculator/CreditCalculatorForm.tsx +0 -92
- package/src/components/CreditCalculator/constants.ts +0 -8
- package/src/components/CreditCalculator/defaultTabs.ts +0 -22
- package/src/components/CreditCalculator/getCalculatorParams.ts +0 -16
- package/src/components/CreditCalculator/getCreditRate.ts +0 -18
- package/src/components/CreditCalculator/getCreditTermYears.spec.ts +0 -10
- package/src/components/CreditCalculator/getCreditTermYears.ts +0 -15
- package/src/components/CreditCalculator/getDefaultMonths.ts +0 -7
- package/src/components/CreditCalculator/getDefaultSum.ts +0 -7
- package/src/components/CreditCalculator/getMonthlyPayment.ts +0 -32
- package/src/components/CreditCalculator/renderButton.tsx +0 -23
- package/src/components/CreditCalculator/renderMonthsInput.tsx +0 -29
- package/src/components/CreditCalculator/renderProposal.tsx +0 -13
- package/src/components/CreditCalculator/renderTermsButton.tsx +0 -16
- package/src/components/CreditCalculator/renderWantedSumInput.tsx +0 -36
- package/src/components/Header/HeaderSubMenuObserver.ts +0 -48
package/bundle/bundle.umd.js
CHANGED
|
@@ -489,8 +489,9 @@
|
|
|
489
489
|
return prefix + extension + size;
|
|
490
490
|
};
|
|
491
491
|
const getExtFromHref = (href) => {
|
|
492
|
-
if (!href)
|
|
492
|
+
if (!href) {
|
|
493
493
|
return '';
|
|
494
|
+
}
|
|
494
495
|
const index = href.lastIndexOf('.');
|
|
495
496
|
return index !== -1 ? href.substring(index + 1) : '';
|
|
496
497
|
};
|
|
@@ -654,8 +655,9 @@
|
|
|
654
655
|
return buttons?.length ? (jsx("div", { className: className, children: buttons.map((button, index) => renderButton$2(useLink({ router, handlerDecorator }, button), index)) })) : null;
|
|
655
656
|
});
|
|
656
657
|
function renderButton$2({ icon, ...button }, i) {
|
|
657
|
-
if (!button?.text)
|
|
658
|
+
if (!button?.text) {
|
|
658
659
|
return;
|
|
660
|
+
}
|
|
659
661
|
return icon ? (jsx(Button, { appendLeft: jsx(Img, { image: icon, width: "24", height: "24", asSVG: true }), ...button }, String(i))) : (jsx(Button, { ...button }, String(i)));
|
|
660
662
|
}
|
|
661
663
|
|
|
@@ -735,7 +737,7 @@
|
|
|
735
737
|
|
|
736
738
|
const ProductBlockInner = JSX(({ className = '', context, title, headingType = 'h2', description, benefits, benefitsVersion = 'normal', buttons, image, items, version = 'primary', isDotted = true, textBlockClassName = '', }) => {
|
|
737
739
|
const textColor = version === 'secondary' ? 'text-white' : 'text-primary-text';
|
|
738
|
-
return (jsxs("div", { className: `flex grow justify-between items-stretch ${className}`, children: [jsx("div", { className: `flex flex-col ${textBlockClassName}`, children: jsxs(BaseTile, { context: context, title: getTitle(title, headingType), buttons: getButtons(context, buttons), children: [description ? (jsx(Description, { className: `mt-4 max-w-[600px] text-md font-light ${textColor}`, description: description })) : null, benefits?.filter((
|
|
740
|
+
return (jsxs("div", { className: `flex grow justify-between items-stretch ${className}`, children: [jsx("div", { className: `flex flex-col ${textBlockClassName}`, children: jsxs(BaseTile, { context: context, title: getTitle(title, headingType), buttons: getButtons(context, buttons), children: [description ? (jsx(Description, { className: `mt-4 max-w-[600px] text-md font-light ${textColor}`, description: description })) : null, benefits?.filter((_) => _.label)?.length ? (jsx("div", { className: "flex gap-6 mt-6", children: benefits.map((benefit, i) => renderBenefit$1({ benefit, version, benefitsVersion }, i)) })) : null, items?.length ? (jsx(List, { className: "mt-5 text-title-2xs font-light", items: items, itemClassName: "mb-[7px]", version: version, isDotted: isDotted })) : null] }) }), image?.src && jsx(Img, { className: "mt-[-50px]", image: image })] }));
|
|
739
741
|
});
|
|
740
742
|
const getTitle = (title, headingType) => {
|
|
741
743
|
return title ? (jsx(Heading, { headingType: headingType, title: title, className: "whitespace-pre-wrap max-w-[600px]" })) : null;
|
|
@@ -787,9 +789,9 @@
|
|
|
787
789
|
};
|
|
788
790
|
const TextBlock = JSX(({ title, description, blockVersion = 'primary', iconVersion, image, className, anchor = null, }) => {
|
|
789
791
|
const textBlockStyleMap = textBlockStyleMaps[blockVersion];
|
|
790
|
-
return (jsxs("section", { className: `font-sans px-9 py-4 flex ${textBlockStyleMap.background} ${className || ''}`, id: anchor, children: [iconVersion === 'small' ? renderIcon
|
|
792
|
+
return (jsxs("section", { className: `font-sans px-9 py-4 flex ${textBlockStyleMap.background} ${className || ''}`, id: anchor, children: [iconVersion === 'small' ? renderIcon(textBlockStyleMap.icon) : null, iconVersion === 'big' ? renderImage(image) : null, jsxs("div", { className: "py-0.5", children: [title ? (jsx("div", { className: `font-medium text-base mb-1 ${textBlockStyleMap.title}`, children: title })) : null, description ? (jsx("div", { className: `text-sm ${textBlockStyleMap.description}`, children: description })) : null] })] }));
|
|
791
793
|
});
|
|
792
|
-
function renderIcon
|
|
794
|
+
function renderIcon(className) {
|
|
793
795
|
return (jsx("div", { className: "pt-1.5 pl-1 pr-4", children: jsx("div", { className: `rounded-full h-4 w-4 text-center text-xs ${className}`, children: "i" }) }));
|
|
794
796
|
}
|
|
795
797
|
function renderImage(image) {
|
|
@@ -833,12 +835,12 @@
|
|
|
833
835
|
secondary: 'bg-primary-main text-white',
|
|
834
836
|
};
|
|
835
837
|
const Tile = JSX((props) => {
|
|
836
|
-
const { context, title, headingType = 'h3', description, items, children, buttons, image, className = '', version = 'primary', role, anchor = null, } = props;
|
|
838
|
+
const { context, title, headingType = 'h3', description, items, children, buttons, image, isDotted = true, className = '', version = 'primary', role, anchor = null, } = props;
|
|
837
839
|
return (jsx("section", { className: `overflow-hidden font-sans p-9 pr-3 box-border ${className} ${tileStyleMap[version]} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, role: role, id: anchor, children: jsxs(BaseTile, { context: context, title: title ? (jsx(Heading, { headingType: headingType, as: "h3", title: title, className: `whitespace-pre-wrap max-w-[600px] ${title ? 'mb-3' : ''}
|
|
838
|
-
${version === 'primary' ? 'text-primary-text' : ''}` })) : null, buttons: buttons?.length ? (jsx(ButtonSection, { context: context, buttons: buttons.map((button) => ({ ...button, className: 'w-[158px]' })), className: "flex mt-9 gap-3" })) : null, image: image?.src && jsx(Img, { className: "mt-auto ml-7", image: image }), children: [description ? (jsx(Description, { className: "max-w-[600px] text-title-new-sm font-light", description: description })) : null, children, renderList$1(items, version)] }) }));
|
|
840
|
+
${version === 'primary' ? 'text-primary-text' : ''}` })) : null, buttons: buttons?.length ? (jsx(ButtonSection, { context: context, buttons: buttons.map((button) => ({ ...button, className: 'w-[158px]' })), className: "flex mt-9 gap-3" })) : null, image: image?.src && jsx(Img, { className: "mt-auto ml-7", image: image }), children: [description ? (jsx(Description, { className: "max-w-[600px] text-title-new-sm font-light", description: description })) : null, children, renderList$1(items, version, isDotted)] }) }));
|
|
839
841
|
});
|
|
840
|
-
function renderList$1(items, version) {
|
|
841
|
-
return items?.length ? (jsx(List, { items: items, itemClassName: "text-title-2xs font-light mt-2", version: version === 'primary' ? 'tile' : 'tile-white' })) : null;
|
|
842
|
+
function renderList$1(items, version, isDotted) {
|
|
843
|
+
return items?.length ? (jsx(List, { items: items, isDotted: isDotted, itemClassName: "text-title-2xs font-light mt-2", version: version === 'primary' ? 'tile' : 'tile-white' })) : null;
|
|
842
844
|
}
|
|
843
845
|
|
|
844
846
|
const productTileStyleMap = {
|
|
@@ -846,11 +848,11 @@
|
|
|
846
848
|
secondary: 'bg-primary-main text-white',
|
|
847
849
|
};
|
|
848
850
|
const ProductTile = JSX(({ context, className = '', title, headingType = 'h3', description, additionalDescription, benefits, buttons, image, version = 'primary', anchor = null, }) => {
|
|
849
|
-
return (jsx("section", { className: `bg-white overflow-hidden text-primary-text font-sans p-9 box-border ${className} ${productTileStyleMap[version]} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, id: anchor, children: jsxs(BaseTile, { context: context, title: title ? (jsx(Heading, { headingType: headingType, as: "h3", title: title, className: `whitespace-pre-wrap max-w-[600px]` })) : null, buttons: buttons?.length ? (jsx(ButtonSection, { context: context, buttons: buttons, className: "flex mt-9 gap-3" })) : null, image: image?.src && jsx(Img, { className: "mt-auto ml-7", image: image }), children: [description ? (jsx(Description, { className: "mt-4 max-w-[600px]", description: description })) : null, renderBenefits(benefits, version), additionalDescription
|
|
851
|
+
return (jsx("section", { className: `bg-white overflow-hidden text-primary-text font-sans p-9 box-border ${className} ${productTileStyleMap[version]} ${getTileRightPadding(className)} ${getTileMinHeight(className)} `, id: anchor, children: jsxs(BaseTile, { context: context, title: title ? (jsx(Heading, { headingType: headingType, as: "h3", title: title, className: `whitespace-pre-wrap max-w-[600px]` })) : null, buttons: buttons?.length ? (jsx(ButtonSection, { context: context, buttons: buttons, className: "flex mt-9 gap-3" })) : null, image: image?.src && jsx(Img, { className: "mt-auto ml-7", image: image }), children: [description ? (jsx(Description, { className: "mt-4 max-w-[600px]", description: description })) : null, renderBenefits(benefits || [], version), additionalDescription
|
|
850
852
|
? renderAdditionalDescription(additionalDescription, version)
|
|
851
853
|
: null] }) }));
|
|
852
854
|
});
|
|
853
|
-
function renderBenefits(benefits
|
|
855
|
+
function renderBenefits(benefits, version) {
|
|
854
856
|
return (jsxs("div", { className: "flex mt-5 mb-1", children: [benefits.length ? jsx("div", { className: "mr-8", children: benefits.map(renderBenefitLabel) }) : null, benefits.length ? (jsx("div", { className: "pt-1", children: benefits.map((_, i) => renderBenefitDescription(_, i, version)) })) : null] }));
|
|
855
857
|
}
|
|
856
858
|
function renderBenefitLabel(benefit, i) {
|
|
@@ -871,10 +873,6 @@
|
|
|
871
873
|
return jsx("div", { className: `text-sm mt-2.5 ${descStyleMap[version]}`, children: additionalDescription });
|
|
872
874
|
}
|
|
873
875
|
|
|
874
|
-
const ArrowButton = JSX(({ className, disabled, ...rest }) => (jsx(Button, { rounded: true, className: `shadow-[0_4px_25px_rgba(0,0,0,0.07)] w-12 h-12 min-h-12 max-h-12 flex items-center justify-center ${disabled
|
|
875
|
-
? 'bg-secondary-light text-secondary-text'
|
|
876
|
-
: 'bg-white text-primary-text hover:text-primary-main'} ${className || ''}`, disabled: disabled, ...rest, children: jsx(Img, { className: "w-4 h-4 min-w-4 min-h-4 rounded-full box-border", image: { icon: 'ArrowLeftIcon', iconVersion: 'black' }, width: "16", height: "16", asSVG: true }) })));
|
|
877
|
-
|
|
878
876
|
const cardVersionMap = {
|
|
879
877
|
primary: 'bg-white text-secondary-text',
|
|
880
878
|
secondary: 'bg-primary-main text-white',
|
|
@@ -894,7 +892,7 @@
|
|
|
894
892
|
|
|
895
893
|
const GalleryCardInner = JSX(({ title, description, image, items, button, version, isDotted = true }) => {
|
|
896
894
|
const titleStyleClasses = getTitleStyle(version);
|
|
897
|
-
return (jsxs("div", { className: "h-full flex flex-col justify-between text-center", children: [jsxs("div", { children: [image?.src ? (jsx("div", { className: "flex justify-center", children: jsx(Img, { className: "mb-6", image: image }) })) : null, title ? renderCardTitle(title, titleStyleClasses) : null, description ? (jsx("div", { className: `font-light text-m-md-new ${title ? 'mt-2' : ''}`, children: description })) : null, items?.length ? renderItems(items,
|
|
895
|
+
return (jsxs("div", { className: "h-full flex flex-col justify-between text-center", children: [jsxs("div", { children: [image?.src ? (jsx("div", { className: "flex justify-center", children: jsx(Img, { className: "mb-6", image: image }) })) : null, title ? renderCardTitle(title, titleStyleClasses) : null, description ? (jsx("div", { className: `font-light text-m-md-new ${title ? 'mt-2' : ''}`, children: description })) : null, items?.length ? renderItems(items, isDotted, version) : null] }), button?.text ? renderButton$1(button) : null] }));
|
|
898
896
|
});
|
|
899
897
|
function renderButton$1(button) {
|
|
900
898
|
return (jsx(Button, { className: "mt-6 w-full", appendLeft: button.icon && jsx(Img, { image: button.icon, width: "24px", height: "24px", asSVG: true }), ...button }));
|
|
@@ -902,7 +900,7 @@
|
|
|
902
900
|
function renderCardTitle(title, className) {
|
|
903
901
|
return jsx("div", { className: `text-xl m-0 ${className}`, children: title });
|
|
904
902
|
}
|
|
905
|
-
function renderItems(items, version = 'primary'
|
|
903
|
+
function renderItems(items, isDotted, version = 'primary') {
|
|
906
904
|
return (jsx(List, { className: `max-w-[308px] mt-2 text-sm ${version === 'primary' ? '!text-secondary-text' : ''}`, itemClassName: "mt-1 first:mt-0", items: items.filter((item) => item?.text).map((item) => item.text), isDotted: isDotted, version: version }));
|
|
907
905
|
}
|
|
908
906
|
function getTitleStyle(version) {
|
|
@@ -919,6 +917,14 @@
|
|
|
919
917
|
items-stretch ${cardStyleMap[version]} ${cardVersionMap[card.version ?? 'primary']} w-full col-span-4`, role: "listitem", children: jsx(GalleryCardInner, { ...card }) }, String(i)));
|
|
920
918
|
}
|
|
921
919
|
|
|
920
|
+
const ArrowButton = JSX(({ className, disabled, ...rest }) => (jsx(Button, { rounded: true, className: `shadow-[0_4px_25px_rgba(0,0,0,0.07)] w-12 h-12 min-h-12 max-h-12 flex items-center justify-center ${disabled
|
|
921
|
+
? 'bg-secondary-light text-secondary-text'
|
|
922
|
+
: 'bg-white text-primary-text hover:text-primary-main'} ${className || ''}`, disabled: disabled, ...rest, children: jsx(Img, { className: "w-4 h-4 min-w-4 min-h-4 rounded-full box-border", image: { icon: 'ArrowLeftIcon', iconVersion: 'black' }, width: "16", height: "16", asSVG: true }) })));
|
|
923
|
+
|
|
924
|
+
function renderArrows({ handler, isShown, btnClass, className = '', isDisabled = false, }) {
|
|
925
|
+
return (jsxs("div", { children: [isShown[0] || isDisabled ? (jsx(ArrowButton, { className: `absolute z-10 ${btnClass[0]} ${className}`, onClick: handler[0], ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E", "data-block-control": "scroll-left", disabled: !isShown[0] })) : null, isShown[1] || isDisabled ? (jsx(ArrowButton, { className: `absolute z-10 rotate-180 ${btnClass[1]} ${className}`, onClick: handler[1], ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E", "data-block-control": "scroll-right", disabled: !isShown[1] })) : null] }));
|
|
926
|
+
}
|
|
927
|
+
|
|
922
928
|
const GalleryInner = JSX(({ context, cards = [], className = '', version = 'normal', anchor = null, ...rest }) => {
|
|
923
929
|
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
924
930
|
const handleNextClick = () => setActiveCardIndex(activeCardIndex + 1);
|
|
@@ -927,7 +933,12 @@
|
|
|
927
933
|
const showNextButton = isGalleryScrollAvailable &&
|
|
928
934
|
cards?.length - activeCardIndex > galleryLengthForScrollMap[version];
|
|
929
935
|
const showPrevButton = isGalleryScrollAvailable && activeCardIndex > 0;
|
|
930
|
-
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white p-[42px] overflow-hidden ${className}`, id: anchor, children: [jsx(GalleryContainer, { context: context, cards: cards, version: version, activeCardIndex: activeCardIndex, ...rest }),
|
|
936
|
+
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white p-[42px] overflow-hidden ${className}`, id: anchor, children: [jsx(GalleryContainer, { context: context, cards: cards, version: version, activeCardIndex: activeCardIndex, ...rest }), renderArrows({
|
|
937
|
+
handler: [handlePrevClick, handleNextClick],
|
|
938
|
+
isShown: [showPrevButton, showNextButton],
|
|
939
|
+
btnClass: ['left-8', 'right-8'],
|
|
940
|
+
className: 'top-1/2',
|
|
941
|
+
}), jsx("div", { className: "absolute top-0 left-0 bottom-0 w-[82px] bg-opacity-from-white" }), jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[82px] bg-opacity-to-white" })] }));
|
|
931
942
|
});
|
|
932
943
|
|
|
933
944
|
const Gallery = JSX((props) => jsx(GalleryInner, { ...props, version: "normal" }));
|
|
@@ -1053,12 +1064,21 @@
|
|
|
1053
1064
|
const cellClasses = `mx-7 h-full ${DIVIDER_CLASSES$1} ${isFillGradient && isFirstRow ? 'border-t' : ''} ${!isLastRow ? 'border-solid' : 'border-b-0'}`;
|
|
1054
1065
|
return (jsx("div", { className: cellWrapperClasses, role: "cell", children: jsx("div", { className: cellClasses, children: cell.map((item, i) => renderCellInner$1(item, i, isFillGradient)) }) }));
|
|
1055
1066
|
});
|
|
1056
|
-
const
|
|
1067
|
+
const labelStyle = (isFillGradient = false) => `text-xl font-medium m-0 ${isFillGradient ? 'text-white' : ''}`;
|
|
1068
|
+
const descriptionStyle = (isFillGradient = false) => `text-sm opacity-80 ${isFillGradient ? 'text-white' : 'text-secondary-text'}`;
|
|
1069
|
+
const renderCellInner$1 = ({ label, description }, i, isFillGradient) => (jsxs("div", { className: "first:pt-7 pt-6 last:pb-7", children: [label ? jsx("h4", { className: labelStyle(isFillGradient), children: label }) : null, description ? jsx("div", { className: descriptionStyle(isFillGradient), children: description }) : null] }, String(i)));
|
|
1057
1070
|
|
|
1058
|
-
const
|
|
1071
|
+
const titleStyle = (isLastRow = false) => `text-sm py-7 ${DIVIDER_CLASSES$1} ${FIRST_CELL_CLASSES$1} ${isLastRow ? 'border-b-0' : 'border-solid'}`;
|
|
1072
|
+
const TableRow = JSX(({ row: { header, data }, activeCardIndex, isColoredFirstColumn, isFirstRow, isLastRow }) => (jsxs(TableRowContainer, { children: [header?.title ? jsx("div", { className: titleStyle(isLastRow), children: header.title }) : null, data?.length ? (jsx(TableCarouselContainer, { activeCardIndex: activeCardIndex, columnWidth: COLUMN_WIDTH$1, children: data.map((cell, i) => (jsx(TableCell, { cell: cell, isFirstRow: isFirstRow, isLastRow: isLastRow, isFillGradient: isColoredFirstColumn && i === 0 }, String(i)))) })) : null] })));
|
|
1059
1073
|
|
|
1060
|
-
const TableArrowScrollControl = JSX(({ isScrollAvailable,
|
|
1061
|
-
return isScrollAvailable ? (jsx("div", { children:
|
|
1074
|
+
const TableArrowScrollControl = JSX(({ isScrollAvailable, handleNextClick, handlePrevClick, showNextButton, showPrevButton }) => {
|
|
1075
|
+
return isScrollAvailable ? (jsx("div", { children: renderArrows({
|
|
1076
|
+
handler: [handlePrevClick, handleNextClick],
|
|
1077
|
+
isShown: [showPrevButton, showNextButton],
|
|
1078
|
+
btnClass: ['top-[108px]', 'top-11'],
|
|
1079
|
+
className: 'right-7',
|
|
1080
|
+
isDisabled: true,
|
|
1081
|
+
}) })) : null;
|
|
1062
1082
|
});
|
|
1063
1083
|
|
|
1064
1084
|
const ComparisonTableRows = JSX(({ rowData, activeCardIndex, isColoredFirstColumn, ...tableArrowScrollProps }) => {
|
|
@@ -1066,12 +1086,12 @@
|
|
|
1066
1086
|
});
|
|
1067
1087
|
|
|
1068
1088
|
const useTableArrowScrollControl = ({ columnsLength, colsLengthForScroll, activeCardIndex, setActiveCardIndex, }) => {
|
|
1069
|
-
const
|
|
1070
|
-
const
|
|
1089
|
+
const handleNextClick = () => setActiveCardIndex(activeCardIndex + 1);
|
|
1090
|
+
const handlePrevClick = () => setActiveCardIndex(activeCardIndex - 1);
|
|
1071
1091
|
const isScrollAvailable = columnsLength > colsLengthForScroll;
|
|
1072
1092
|
const showNextButton = isScrollAvailable && columnsLength - activeCardIndex > colsLengthForScroll;
|
|
1073
1093
|
const showPrevButton = Boolean(isScrollAvailable && activeCardIndex > 0);
|
|
1074
|
-
return {
|
|
1094
|
+
return { handleNextClick, handlePrevClick, isScrollAvailable, showNextButton, showPrevButton };
|
|
1075
1095
|
};
|
|
1076
1096
|
|
|
1077
1097
|
const ComparisonTableBody = JSX(({ context, columns, rowHeaders, isShowAllRow, visibleRowLength, isColoredFirstColumn }) => {
|
|
@@ -1120,7 +1140,7 @@
|
|
|
1120
1140
|
}
|
|
1121
1141
|
|
|
1122
1142
|
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
1123
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill, ...options }, i) => (jsx("path", { d: d, fill:
|
|
1143
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => (jsx("path", { d: d, fill: pathFill || 'currentColor', ...commonOptions, ...options }, i))) }));
|
|
1124
1144
|
});
|
|
1125
1145
|
|
|
1126
1146
|
const CHECK_PATHS = [
|
|
@@ -1141,83 +1161,90 @@
|
|
|
1141
1161
|
return (jsxs("div", { className: `mb-5 ${className}`, children: [title ? jsx("div", { className: "text-base font-light", children: title }) : null, value ? (jsxs("div", { className: "text-title font-normal", children: [prefix, " ", addSpacesBetweenNumbers(Math.round(value)), " ", postfix] })) : null] }));
|
|
1142
1162
|
});
|
|
1143
1163
|
|
|
1144
|
-
const DEFAULT_MIN_SUM
|
|
1145
|
-
const DEFAULT_MAX_SUM
|
|
1146
|
-
const DEFAULT_SUM
|
|
1147
|
-
const DEFAULT_MIN_MONTHS
|
|
1148
|
-
const DEFAULT_MAX_MONTHS
|
|
1149
|
-
const DEFAULT_MONTHS
|
|
1150
|
-
const MONTHS_IN_YEAR
|
|
1164
|
+
const DEFAULT_MIN_SUM = 30000;
|
|
1165
|
+
const DEFAULT_MAX_SUM = 3000000;
|
|
1166
|
+
const DEFAULT_SUM = (DEFAULT_MAX_SUM - DEFAULT_MIN_SUM) / 2;
|
|
1167
|
+
const DEFAULT_MIN_MONTHS = 1;
|
|
1168
|
+
const DEFAULT_MAX_MONTHS = 84;
|
|
1169
|
+
const DEFAULT_MONTHS = Math.round((DEFAULT_MAX_MONTHS - DEFAULT_MIN_MONTHS) / 2);
|
|
1170
|
+
const MONTHS_IN_YEAR = 12;
|
|
1151
1171
|
|
|
1152
1172
|
const InputRange = JSX(({ className, title, items = [], min = 1, max = 100, step = 1, value = min, onChange }) => {
|
|
1153
|
-
const handleChange = (
|
|
1154
|
-
if (!onChange)
|
|
1173
|
+
const handleChange = (_) => {
|
|
1174
|
+
if (!onChange) {
|
|
1155
1175
|
return;
|
|
1156
|
-
|
|
1176
|
+
}
|
|
1177
|
+
const sanitizedValue = Number(_.replace(/\D/g, ''));
|
|
1157
1178
|
onChange(sanitizedValue);
|
|
1158
1179
|
};
|
|
1159
1180
|
const inputStyle = {
|
|
1160
1181
|
backgroundSize: `${(((value - min) * 100) / (max - min)).toFixed(2)}% 100%`,
|
|
1161
1182
|
};
|
|
1162
1183
|
const handleBlur = () => {
|
|
1163
|
-
if (!onChange)
|
|
1184
|
+
if (!onChange) {
|
|
1164
1185
|
return;
|
|
1165
|
-
|
|
1186
|
+
}
|
|
1187
|
+
if (value < min) {
|
|
1166
1188
|
onChange(min);
|
|
1167
|
-
|
|
1189
|
+
}
|
|
1190
|
+
if (value > max) {
|
|
1168
1191
|
onChange(max);
|
|
1192
|
+
}
|
|
1169
1193
|
};
|
|
1170
1194
|
return (jsxs("div", { className: className, children: [jsxs("label", { className: "block relative", children: [title ? jsx("span", { className: "text-base text-secondary-text pl-4", children: title }) : null, jsx("input", { className: `m-0 mt-[5px] font-sans text-title w-full h-14 border border-solid border-main-stroke rounded-md
|
|
1171
1195
|
outline-none p-0 pl-4 box-border text-primary-text`, value: addSpacesBetweenNumbers(value), onChange: (e) => handleChange(e.target.value), onBlur: handleBlur }), jsx("div", { className: "absolute inset-x-0 bottom-[-4px] px-4 leading-[18px]", children: jsx("input", { className: "box-border w-full m-0 cursor-pointer slider", type: "range", min: min, max: max, step: step, value: value, onChange: (e) => handleChange(e.target.value), style: inputStyle }) })] }), jsx("div", { className: "flex justify-between my-3", children: items.map((item, i) => (jsx("span", { className: "text-sm leading-[14px] text-secondary-text pl-4", children: item }, String(i)))) })] }));
|
|
1172
1196
|
});
|
|
1173
1197
|
|
|
1174
|
-
const STEP_MONEY$
|
|
1175
|
-
function renderWantedSumInput
|
|
1198
|
+
const STEP_MONEY$2 = 1000;
|
|
1199
|
+
function renderWantedSumInput(props) {
|
|
1176
1200
|
const { title, className = '', calculatorParams, moneyValue, defaultSum, setMoneyValue, isShowItems = true, } = props;
|
|
1177
|
-
const minSum = calculatorParams?.minSum || DEFAULT_MIN_SUM
|
|
1178
|
-
const maxSum = calculatorParams?.maxSum || DEFAULT_MAX_SUM
|
|
1201
|
+
const minSum = calculatorParams?.minSum || DEFAULT_MIN_SUM;
|
|
1202
|
+
const maxSum = calculatorParams?.maxSum || DEFAULT_MAX_SUM;
|
|
1179
1203
|
const items = [
|
|
1180
1204
|
`От ${addSpacesBetweenNumbers(minSum)} ₽`,
|
|
1181
1205
|
`До ${addSpacesBetweenNumbers(maxSum)} ₽`,
|
|
1182
1206
|
];
|
|
1183
|
-
return (jsx(InputRange, { className: className, title: title, items: isShowItems ? items : [], min: minSum, max: maxSum, step: STEP_MONEY$
|
|
1207
|
+
return (jsx(InputRange, { className: className, title: title, items: isShowItems ? items : [], min: minSum, max: maxSum, step: STEP_MONEY$2, value: moneyValue || defaultSum, onChange: setMoneyValue }));
|
|
1184
1208
|
}
|
|
1185
1209
|
|
|
1186
|
-
const DEFAULT_RATE
|
|
1187
|
-
const getCreditRate
|
|
1210
|
+
const DEFAULT_RATE = 10.2;
|
|
1211
|
+
const getCreditRate = (params) => {
|
|
1188
1212
|
const { calculatorParams, isInsurance } = params;
|
|
1189
|
-
if (!calculatorParams)
|
|
1190
|
-
return DEFAULT_RATE
|
|
1213
|
+
if (!calculatorParams) {
|
|
1214
|
+
return DEFAULT_RATE;
|
|
1215
|
+
}
|
|
1191
1216
|
return isInsurance
|
|
1192
|
-
? calculatorParams?.rateWithInsurance || DEFAULT_RATE
|
|
1193
|
-
: calculatorParams?.rateWithoutInsurance || DEFAULT_RATE
|
|
1217
|
+
? calculatorParams?.rateWithInsurance || DEFAULT_RATE
|
|
1218
|
+
: calculatorParams?.rateWithoutInsurance || DEFAULT_RATE;
|
|
1194
1219
|
};
|
|
1195
1220
|
|
|
1196
|
-
const getCalculatorParams
|
|
1221
|
+
const getCalculatorParams = (params) => {
|
|
1197
1222
|
const { tableRows, isAnnuity = false } = params;
|
|
1198
|
-
if (!tableRows)
|
|
1223
|
+
if (!tableRows) {
|
|
1199
1224
|
return {};
|
|
1225
|
+
}
|
|
1200
1226
|
const calculatorParams = tableRows.find((row) => row.isAnnuity === isAnnuity);
|
|
1201
1227
|
return calculatorParams || {};
|
|
1202
1228
|
};
|
|
1203
1229
|
|
|
1204
|
-
const getDefaultSum
|
|
1230
|
+
const getDefaultSum = (calculatorParams) => calculatorParams.maxSum && calculatorParams.minSum
|
|
1205
1231
|
? (calculatorParams.maxSum - calculatorParams.minSum) / 2
|
|
1206
|
-
: DEFAULT_SUM
|
|
1232
|
+
: DEFAULT_SUM;
|
|
1207
1233
|
|
|
1208
|
-
const getDefaultMonths
|
|
1234
|
+
const getDefaultMonths = (calculatorParams) => calculatorParams.maxMonths && calculatorParams.minMonths
|
|
1209
1235
|
? Math.round((calculatorParams.maxMonths - calculatorParams.minMonths) / 2)
|
|
1210
|
-
: DEFAULT_MONTHS
|
|
1236
|
+
: DEFAULT_MONTHS;
|
|
1211
1237
|
|
|
1212
1238
|
const clamp = (value, min, max) => Math.max(min, Math.min(value, max));
|
|
1213
1239
|
|
|
1214
|
-
const getMonthlyPayment
|
|
1240
|
+
const getMonthlyPayment = (params) => {
|
|
1215
1241
|
const { calculatorParams, paymentType, rate, sum, months } = params;
|
|
1216
|
-
if (!calculatorParams)
|
|
1242
|
+
if (!calculatorParams) {
|
|
1217
1243
|
return 0;
|
|
1218
|
-
|
|
1244
|
+
}
|
|
1245
|
+
const finalSum = clamp(sum, calculatorParams.minSum || DEFAULT_MIN_SUM, calculatorParams.maxSum || DEFAULT_MAX_SUM);
|
|
1219
1246
|
if (paymentType === 'annuity') {
|
|
1220
|
-
const annuityCoef = Number(rate) / (MONTHS_IN_YEAR
|
|
1247
|
+
const annuityCoef = Number(rate) / (MONTHS_IN_YEAR * 100);
|
|
1221
1248
|
return finalSum * (annuityCoef + annuityCoef / (Math.pow(1 + annuityCoef, months) - 1));
|
|
1222
1249
|
}
|
|
1223
1250
|
else {
|
|
@@ -1225,14 +1252,14 @@
|
|
|
1225
1252
|
}
|
|
1226
1253
|
};
|
|
1227
1254
|
|
|
1228
|
-
const STEP_MONTHS
|
|
1229
|
-
function renderMonthsInput
|
|
1255
|
+
const STEP_MONTHS = 1;
|
|
1256
|
+
function renderMonthsInput(props) {
|
|
1230
1257
|
const { title, minMonths, maxMonths, monthsValue, defaultMonths, setMonthsValue } = props;
|
|
1231
1258
|
const monthText = (month) => {
|
|
1232
1259
|
const text = Number(month) % 10 === 1 ? 'месяца' : 'месяцев';
|
|
1233
1260
|
return `${month} ${text}`;
|
|
1234
1261
|
};
|
|
1235
|
-
return (jsx(InputRange, { className: "mt-6", title: title, items: [`От ${monthText(minMonths)}`, `До ${monthText(maxMonths)}`], min: minMonths, max: maxMonths, step: STEP_MONTHS
|
|
1262
|
+
return (jsx(InputRange, { className: "mt-6", title: title, items: [`От ${monthText(minMonths)}`, `До ${monthText(maxMonths)}`], min: minMonths, max: maxMonths, step: STEP_MONTHS, value: monthsValue || defaultMonths, onChange: setMonthsValue }));
|
|
1236
1263
|
}
|
|
1237
1264
|
|
|
1238
1265
|
function renderButtonSection(context, buttons) {
|
|
@@ -1244,29 +1271,29 @@
|
|
|
1244
1271
|
return (jsxs("div", { children: [jsx("div", { className: "text-sm font-light ml-3", children: title }), jsxs("div", { className: "flex justify-start", children: [jsx("span", { className: `calc-rate-text font-mohave text-[200px] leading-[250px] pr-4 mt-[-16px] ${className}`, children: rateFormat }), sup ? jsx("span", { className: "calc-rate-text text-[65px] leading-[75px]", children: sup }) : ''] })] }));
|
|
1245
1272
|
}
|
|
1246
1273
|
|
|
1247
|
-
const DEFAULT_PAYMENT_TYPE
|
|
1248
|
-
const CreditCalculatorForm
|
|
1274
|
+
const DEFAULT_PAYMENT_TYPE = 'annuity';
|
|
1275
|
+
const CreditCalculatorForm = JSX(({ context, className = '', buttons }) => {
|
|
1249
1276
|
const [moneyValue, setMoneyValue] = context.useState(undefined);
|
|
1250
1277
|
const [monthsValue, setMonthsValue] = context.useState(undefined);
|
|
1251
1278
|
const [isAnnuity, toggleIsAnnuity] = context.useState(false);
|
|
1252
1279
|
const [isBudgetary, toggleIsBudgetary] = context.useState(false);
|
|
1253
1280
|
const [isInsurance, toggleIsInsurance] = context.useState(false);
|
|
1254
1281
|
const tableRows = useCreditCalculatorData(context.useAsyncData, 'directoryName').rows;
|
|
1255
|
-
const calculatorParams = getCalculatorParams
|
|
1256
|
-
const defaultSum = getDefaultSum
|
|
1257
|
-
const defaultMonths = getDefaultMonths
|
|
1258
|
-
const minMonths = calculatorParams?.minMonths || DEFAULT_MIN_MONTHS
|
|
1259
|
-
const maxMonths = calculatorParams?.maxMonths || DEFAULT_MAX_MONTHS
|
|
1260
|
-
const rate = getCreditRate
|
|
1261
|
-
const monthlyPayment = getMonthlyPayment
|
|
1282
|
+
const calculatorParams = getCalculatorParams({ tableRows, isAnnuity: isAnnuity });
|
|
1283
|
+
const defaultSum = getDefaultSum(calculatorParams);
|
|
1284
|
+
const defaultMonths = getDefaultMonths(calculatorParams);
|
|
1285
|
+
const minMonths = calculatorParams?.minMonths || DEFAULT_MIN_MONTHS;
|
|
1286
|
+
const maxMonths = calculatorParams?.maxMonths || DEFAULT_MAX_MONTHS;
|
|
1287
|
+
const rate = getCreditRate({ calculatorParams, isInsurance: isInsurance });
|
|
1288
|
+
const monthlyPayment = getMonthlyPayment({
|
|
1262
1289
|
calculatorParams,
|
|
1263
|
-
paymentType: DEFAULT_PAYMENT_TYPE
|
|
1290
|
+
paymentType: DEFAULT_PAYMENT_TYPE,
|
|
1264
1291
|
rate,
|
|
1265
1292
|
sum: moneyValue || defaultSum,
|
|
1266
1293
|
months: monthsValue || defaultMonths,
|
|
1267
1294
|
});
|
|
1268
1295
|
const title = 'Сумма кредита, ₽';
|
|
1269
|
-
return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput
|
|
1296
|
+
return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput({ title, calculatorParams, moneyValue, defaultSum, setMoneyValue }), renderMonthsInput({
|
|
1270
1297
|
title: 'Сумма кредита, ₽',
|
|
1271
1298
|
minMonths,
|
|
1272
1299
|
maxMonths,
|
|
@@ -1278,23 +1305,23 @@
|
|
|
1278
1305
|
: null }), jsxs("div", { className: "w-[351px]", children: [monthlyPayment ? (jsx(CalculatorValueBlock, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0435\u0436", value: monthlyPayment, postfix: "\u20BD" })) : null, renderButtonSection(context, buttons)] })] }));
|
|
1279
1306
|
});
|
|
1280
1307
|
|
|
1281
|
-
const STEP_MONEY$
|
|
1308
|
+
const STEP_MONEY$1 = 1000;
|
|
1282
1309
|
function renderRealEstateValue(props) {
|
|
1283
1310
|
const { calculatorParams, moneyValue, defaultSum, setMoneyValue } = props;
|
|
1284
|
-
const minSum = calculatorParams?.minSum || DEFAULT_MIN_SUM
|
|
1285
|
-
const maxSum = calculatorParams?.maxSum || DEFAULT_MAX_SUM
|
|
1286
|
-
return (jsx(InputRange, { title: "\u0421\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C \u043D\u0435\u0434\u0432\u0438\u0436\u0438\u043C\u043E\u0441\u0442\u0438, \u20BD ", items: [`От ${addSpacesBetweenNumbers(minSum)} ₽`, `До ${addSpacesBetweenNumbers(maxSum)} ₽`], min: minSum, max: maxSum, step: STEP_MONEY$
|
|
1311
|
+
const minSum = calculatorParams?.minSum || DEFAULT_MIN_SUM;
|
|
1312
|
+
const maxSum = calculatorParams?.maxSum || DEFAULT_MAX_SUM;
|
|
1313
|
+
return (jsx(InputRange, { title: "\u0421\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C \u043D\u0435\u0434\u0432\u0438\u0436\u0438\u043C\u043E\u0441\u0442\u0438, \u20BD ", items: [`От ${addSpacesBetweenNumbers(minSum)} ₽`, `До ${addSpacesBetweenNumbers(maxSum)} ₽`], min: minSum, max: maxSum, step: STEP_MONEY$1, value: moneyValue || defaultSum, onChange: setMoneyValue }));
|
|
1287
1314
|
}
|
|
1288
1315
|
|
|
1289
|
-
const STEP_MONEY
|
|
1316
|
+
const STEP_MONEY = 1000;
|
|
1290
1317
|
function renderInitialFeeInput(props) {
|
|
1291
1318
|
const { calculatorParams, moneyValue, defaultSum, setMoneyValue } = props;
|
|
1292
|
-
const minSum = calculatorParams?.minSum || DEFAULT_MIN_SUM
|
|
1293
|
-
const maxSum = calculatorParams?.maxSum || DEFAULT_MAX_SUM
|
|
1319
|
+
const minSum = calculatorParams?.minSum || DEFAULT_MIN_SUM;
|
|
1320
|
+
const maxSum = calculatorParams?.maxSum || DEFAULT_MAX_SUM;
|
|
1294
1321
|
return (jsx(InputRange, { className: "mt-6", title: "\u041F\u0435\u0440\u0432\u043E\u043D\u0430\u0447\u0430\u043B\u044C\u043D\u044B\u0439 \u0432\u0437\u043D\u043E\u0441, \u20BD ", items: [
|
|
1295
1322
|
`От ${addSpacesBetweenNumbers(minSum)} рублей`,
|
|
1296
1323
|
`До ${addSpacesBetweenNumbers(maxSum)} рублей`,
|
|
1297
|
-
], min: minSum, max: maxSum, step: STEP_MONEY
|
|
1324
|
+
], min: minSum, max: maxSum, step: STEP_MONEY, value: moneyValue || defaultSum, onChange: setMoneyValue }));
|
|
1298
1325
|
}
|
|
1299
1326
|
|
|
1300
1327
|
function renderProposalMortgage({ credit, period, taxRefund }) {
|
|
@@ -1307,12 +1334,12 @@
|
|
|
1307
1334
|
const [isInsurance, toggleIsInsurance] = context.useState(false);
|
|
1308
1335
|
const [isFullInsurance, toggleIsFullInsurance] = context.useState(false);
|
|
1309
1336
|
const tableRows = useCreditCalculatorData(context.useAsyncData, 'directoryName').rows;
|
|
1310
|
-
const calculatorParams = getCalculatorParams
|
|
1311
|
-
const defaultSum = getDefaultSum
|
|
1312
|
-
const defaultMonths = getDefaultMonths
|
|
1313
|
-
const minMonths = calculatorParams?.minMonths || DEFAULT_MIN_MONTHS
|
|
1314
|
-
const maxMonths = calculatorParams?.maxMonths || DEFAULT_MAX_MONTHS
|
|
1315
|
-
const rate = getCreditRate
|
|
1337
|
+
const calculatorParams = getCalculatorParams({ tableRows, isAnnuity: isInsurance });
|
|
1338
|
+
const defaultSum = getDefaultSum(calculatorParams);
|
|
1339
|
+
const defaultMonths = getDefaultMonths(calculatorParams);
|
|
1340
|
+
const minMonths = calculatorParams?.minMonths || DEFAULT_MIN_MONTHS;
|
|
1341
|
+
const maxMonths = calculatorParams?.maxMonths || DEFAULT_MAX_MONTHS;
|
|
1342
|
+
const rate = getCreditRate({ calculatorParams, isInsurance: isInsurance });
|
|
1316
1343
|
const monthlyPayment = 777777; // TODO: hardcode
|
|
1317
1344
|
const proposalMortgageValue = { credit: 3892000, period: 15, taxRefund: 650000 }; // TODO: hardcode
|
|
1318
1345
|
return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderRealEstateValue({ calculatorParams, moneyValue, defaultSum, setMoneyValue }), renderInitialFeeInput({
|
|
@@ -1320,7 +1347,7 @@
|
|
|
1320
1347
|
moneyValue,
|
|
1321
1348
|
defaultSum,
|
|
1322
1349
|
setMoneyValue,
|
|
1323
|
-
}), renderMonthsInput
|
|
1350
|
+
}), renderMonthsInput({
|
|
1324
1351
|
title: 'Срок ипотеки, месяцев',
|
|
1325
1352
|
minMonths,
|
|
1326
1353
|
maxMonths,
|
|
@@ -1336,21 +1363,21 @@
|
|
|
1336
1363
|
const [moneyValue, setMoneyValue] = context.useState(undefined);
|
|
1337
1364
|
const [monthsValue, setMonthsValue] = context.useState(undefined);
|
|
1338
1365
|
const tableRows = useCreditCalculatorData(context.useAsyncData, 'directoryName').rows;
|
|
1339
|
-
const calculatorParams = getCalculatorParams
|
|
1340
|
-
const defaultSum = getDefaultSum
|
|
1341
|
-
const defaultMonths = getDefaultMonths
|
|
1366
|
+
const calculatorParams = getCalculatorParams({ tableRows, isAnnuity: false });
|
|
1367
|
+
const defaultSum = getDefaultSum(calculatorParams);
|
|
1368
|
+
const defaultMonths = getDefaultMonths(calculatorParams);
|
|
1342
1369
|
const income = 948841;
|
|
1343
1370
|
const finallySum = 1218841;
|
|
1344
|
-
return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput
|
|
1371
|
+
return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput({
|
|
1345
1372
|
title: 'Сумма вклада, ₽',
|
|
1346
1373
|
calculatorParams: { minSum, maxSum },
|
|
1347
1374
|
moneyValue,
|
|
1348
1375
|
defaultSum,
|
|
1349
1376
|
setMoneyValue,
|
|
1350
|
-
}), renderMonthsInput
|
|
1377
|
+
}), renderMonthsInput({
|
|
1351
1378
|
title: 'Срок вклада, месяцев',
|
|
1352
|
-
minMonths: minMonths || DEFAULT_MIN_MONTHS
|
|
1353
|
-
maxMonths: maxMonths || DEFAULT_MAX_MONTHS
|
|
1379
|
+
minMonths: minMonths || DEFAULT_MIN_MONTHS,
|
|
1380
|
+
maxMonths: maxMonths || DEFAULT_MAX_MONTHS,
|
|
1354
1381
|
monthsValue,
|
|
1355
1382
|
defaultMonths,
|
|
1356
1383
|
setMonthsValue,
|
|
@@ -1366,19 +1393,19 @@
|
|
|
1366
1393
|
const calculatorOtherParams = { minSum: minSumOther, maxSum: maxSumOther };
|
|
1367
1394
|
const incomeBonus = 948841;
|
|
1368
1395
|
const bonusOrDef = bonus || 2528;
|
|
1369
|
-
return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput
|
|
1396
|
+
return (jsxs("section", { className: className, children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput({
|
|
1370
1397
|
title: 'Сумма покупок в категории путешествия, ₽',
|
|
1371
1398
|
calculatorParams: calculatorTripParams,
|
|
1372
1399
|
moneyValue: bonusTripValue,
|
|
1373
|
-
defaultSum: getDefaultSum
|
|
1400
|
+
defaultSum: getDefaultSum(calculatorTripParams),
|
|
1374
1401
|
setMoneyValue: setBonusTripValue,
|
|
1375
1402
|
isShowItems: false,
|
|
1376
|
-
}), renderWantedSumInput
|
|
1403
|
+
}), renderWantedSumInput({
|
|
1377
1404
|
className: 'mt-6',
|
|
1378
1405
|
title: 'Сумма покупок в остальных категориях, ₽',
|
|
1379
1406
|
calculatorParams: calculatorOtherParams,
|
|
1380
1407
|
moneyValue: bonusOtherValue,
|
|
1381
|
-
defaultSum: getDefaultSum
|
|
1408
|
+
defaultSum: getDefaultSum(calculatorOtherParams),
|
|
1382
1409
|
setMoneyValue: setBonusOtherValue,
|
|
1383
1410
|
isShowItems: false,
|
|
1384
1411
|
})] }), jsx("div", { children: bonusOrDef
|
|
@@ -1391,7 +1418,7 @@
|
|
|
1391
1418
|
});
|
|
1392
1419
|
|
|
1393
1420
|
const EmbeddableCalcBlocks = {
|
|
1394
|
-
CreditCalculatorForm
|
|
1421
|
+
CreditCalculatorForm,
|
|
1395
1422
|
MortgageCalculatorForm,
|
|
1396
1423
|
DepositCalculatorForm,
|
|
1397
1424
|
BonusCalculatorForm,
|
|
@@ -1406,7 +1433,6 @@
|
|
|
1406
1433
|
return (jsx("section", { className: `box-border relative flex shrink-0 basis-full ${className}`, role: "listitem", children: jsx("div", { className: "box-border p-9 w-full", children: jsx(EmbeddedBlock, { context: context, ...blockCalcTabs, className: "flex justify-between" }) }) }, String(i)));
|
|
1407
1434
|
};
|
|
1408
1435
|
|
|
1409
|
-
const arrowBtnStyle$1 = 'absolute w-[56px] h-[56px] min-h-[56px] max-h-[56px] top-1 z-10 mt-[25px] bg-white rounded-full';
|
|
1410
1436
|
const Calculator = JSX(({ className = '', context, calcTabs = [], anchor = null }) => {
|
|
1411
1437
|
const tabsNav = calcTabs.map((_) => _.nav || {});
|
|
1412
1438
|
const blockCalcTabs = calcTabs.map(({ calculatorBlock }) => calculatorBlock || {});
|
|
@@ -1419,7 +1445,12 @@
|
|
|
1419
1445
|
const showPrevButton = tabsShift > 0;
|
|
1420
1446
|
return (jsxs("section", { id: anchor, className: `box-border overflow-hidden relative font-sans w-100 bg-white text-primary-text ${className}`, children: [jsxs("div", { children: [tabsNav.length > 1
|
|
1421
1447
|
? renderTabs({ tabsShift, tabsNav, activeSlideIndex, setActiveSlideIndex })
|
|
1422
|
-
: null,
|
|
1448
|
+
: null, renderArrows({
|
|
1449
|
+
handler: [handlePrevClick, handleNextClick],
|
|
1450
|
+
isShown: [showPrevButton, showNextButton],
|
|
1451
|
+
btnClass: ['left-3', 'right-3'],
|
|
1452
|
+
className: 'top-8',
|
|
1453
|
+
})] }), jsx("div", { className: "flex", style: { transform: `translateX(-${activeSlideIndex}00%)` }, role: "list", children: blockCalcTabs?.length
|
|
1423
1454
|
? blockCalcTabs.map(renderCalculatorBlock({ context, className }))
|
|
1424
1455
|
: null })] }));
|
|
1425
1456
|
});
|
|
@@ -1443,16 +1474,69 @@
|
|
|
1443
1474
|
})) }) }), jsx("div", { className: "w-full h-2 bg-primary-main" })] }));
|
|
1444
1475
|
}
|
|
1445
1476
|
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
return
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1477
|
+
function useExchangeRates(useAsyncData) {
|
|
1478
|
+
const { data } = useAsyncData(EXCHANGE_RATES_URL, fetchExchangeRates);
|
|
1479
|
+
const result = data?.hits?.hits?.map((_) => _._source) || [];
|
|
1480
|
+
return result.length ? getCurrencyListByRate(result) : result;
|
|
1481
|
+
}
|
|
1482
|
+
async function fetchExchangeRates() {
|
|
1483
|
+
try {
|
|
1484
|
+
const response = await fetch(EXCHANGE_RATES_URL, {
|
|
1485
|
+
method: 'POST',
|
|
1486
|
+
headers: {
|
|
1487
|
+
'Content-Type': 'application/json',
|
|
1488
|
+
},
|
|
1489
|
+
body: JSON.stringify(EXCHANGE_RATES_BODY),
|
|
1490
|
+
});
|
|
1491
|
+
return await response.json();
|
|
1492
|
+
}
|
|
1493
|
+
catch (err) {
|
|
1494
|
+
console.error(err);
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
const EXCHANGE_RATES_URL = 'https://coins.rshb.ru/api/catalog/vue_storefront_magento_1_currency_rates_average/currency_rates_average/_search?size=10000';
|
|
1498
|
+
const EXCHANGE_RATES_BODY = {
|
|
1499
|
+
query: {
|
|
1500
|
+
bool: {
|
|
1501
|
+
must: [
|
|
1502
|
+
{
|
|
1503
|
+
term: {
|
|
1504
|
+
// eslint-disable-next-line camelcase
|
|
1505
|
+
russian_region_code: '77',
|
|
1506
|
+
},
|
|
1507
|
+
},
|
|
1508
|
+
{
|
|
1509
|
+
term: {
|
|
1510
|
+
// eslint-disable-next-line camelcase
|
|
1511
|
+
from_volume: '0',
|
|
1512
|
+
},
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
terms: {
|
|
1516
|
+
// eslint-disable-next-line camelcase
|
|
1517
|
+
currency_pair: ['USD/RUB', 'EUR/RUB'],
|
|
1518
|
+
},
|
|
1519
|
+
},
|
|
1520
|
+
],
|
|
1521
|
+
},
|
|
1522
|
+
},
|
|
1454
1523
|
};
|
|
1455
|
-
const
|
|
1524
|
+
const getCurrencyListByRate = (currencyRates) => currencyRates.reduce((result, _) => {
|
|
1525
|
+
const currencyInfo = _['currency_first'];
|
|
1526
|
+
if (!validateRate(_['rate_buy']) && !validateRate(_['rate_sell'])) {
|
|
1527
|
+
return result;
|
|
1528
|
+
}
|
|
1529
|
+
const currencyCode = currencyInfo.code;
|
|
1530
|
+
if (!result.some((i) => i.code === currencyCode)) {
|
|
1531
|
+
result.push({
|
|
1532
|
+
code: currencyCode,
|
|
1533
|
+
buy: Number(_.rate_buy),
|
|
1534
|
+
sell: Number(_.rate_sell),
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
return result;
|
|
1538
|
+
}, []);
|
|
1539
|
+
const validateRate = (value) => Math.round(value) > 0;
|
|
1456
1540
|
|
|
1457
1541
|
function getTileHeadingType(className = '') {
|
|
1458
1542
|
const colSpan = getColSpan(className);
|
|
@@ -1467,181 +1551,17 @@
|
|
|
1467
1551
|
}
|
|
1468
1552
|
}
|
|
1469
1553
|
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
const MONTHS_IN_YEAR = 12;
|
|
1477
|
-
|
|
1478
|
-
const getCalculatorParams = (params) => {
|
|
1479
|
-
const { tableRows, isAnnuity = false } = params;
|
|
1480
|
-
if (!tableRows)
|
|
1481
|
-
return {};
|
|
1482
|
-
const calculatorParams = tableRows.find((row) => row.isAnnuity === isAnnuity);
|
|
1483
|
-
return calculatorParams || {};
|
|
1484
|
-
};
|
|
1485
|
-
|
|
1486
|
-
const DEFAULT_RATE = 5;
|
|
1487
|
-
const getCreditRate = (params) => {
|
|
1488
|
-
const { calculatorParams, isInsurance } = params;
|
|
1489
|
-
if (!calculatorParams)
|
|
1490
|
-
return DEFAULT_RATE;
|
|
1491
|
-
return isInsurance
|
|
1492
|
-
? calculatorParams?.rateWithInsurance || DEFAULT_RATE
|
|
1493
|
-
: calculatorParams?.rateWithoutInsurance || DEFAULT_RATE;
|
|
1494
|
-
};
|
|
1495
|
-
|
|
1496
|
-
const MAX_YEARS_LENGTH = 5;
|
|
1497
|
-
const getCreditTermYears = (minMonths, maxMonths) => {
|
|
1498
|
-
const totalYears = Math.ceil((maxMonths - minMonths) / 12);
|
|
1499
|
-
const firstYear = Math.floor(minMonths / MONTHS_IN_YEAR) + 1;
|
|
1500
|
-
const result = new Array(Math.min(totalYears - 1, MAX_YEARS_LENGTH))
|
|
1501
|
-
.fill(0)
|
|
1502
|
-
.map((_, i) => firstYear + i);
|
|
1503
|
-
const maxYear = totalYears + firstYear - 1;
|
|
1504
|
-
return result.concat(maxYear);
|
|
1505
|
-
};
|
|
1506
|
-
|
|
1507
|
-
const getDefaultMonths = (calculatorParams) => calculatorParams.maxMonths && calculatorParams.minMonths
|
|
1508
|
-
? Math.round((calculatorParams.maxMonths - calculatorParams.minMonths) / 2)
|
|
1509
|
-
: DEFAULT_MONTHS;
|
|
1510
|
-
|
|
1511
|
-
const getDefaultSum = (calculatorParams) => calculatorParams.maxSum && calculatorParams.minSum
|
|
1512
|
-
? (calculatorParams.maxSum - calculatorParams.minSum) / 2
|
|
1513
|
-
: DEFAULT_SUM;
|
|
1514
|
-
|
|
1515
|
-
const getMonthlyPayment = (params) => {
|
|
1516
|
-
const { calculatorParams, paymentType, rate, sum, months } = params;
|
|
1517
|
-
if (!calculatorParams)
|
|
1518
|
-
return 0;
|
|
1519
|
-
const finalSum = clamp(sum, calculatorParams.minSum || DEFAULT_MIN_SUM, calculatorParams.maxSum || DEFAULT_MAX_SUM);
|
|
1520
|
-
if (paymentType === 'annuity') {
|
|
1521
|
-
const annuityCoef = Number(rate) / (MONTHS_IN_YEAR * 100);
|
|
1522
|
-
return finalSum * (annuityCoef + annuityCoef / (Math.pow(1 + annuityCoef, months) - 1));
|
|
1523
|
-
}
|
|
1524
|
-
else {
|
|
1525
|
-
return finalSum / months + finalSum * (Number(rate) / 12);
|
|
1526
|
-
}
|
|
1527
|
-
};
|
|
1528
|
-
|
|
1529
|
-
const tableFunc = (table) => (input) => {
|
|
1530
|
-
const [, output] = table.find(([predicate]) => predicate(input)) || [];
|
|
1531
|
-
return output;
|
|
1532
|
-
};
|
|
1533
|
-
|
|
1534
|
-
const func = tableFunc([
|
|
1535
|
-
[(_) => _ === 1, 'год'],
|
|
1536
|
-
[(_) => _ <= 4, 'года'],
|
|
1537
|
-
[() => true, 'лет'],
|
|
1538
|
-
]);
|
|
1539
|
-
function renderButton(number, i, handleClick) {
|
|
1540
|
-
const string = func(number);
|
|
1541
|
-
return (jsx("button", { className: "bg-secondary-light rounded-3xl h-10 w-[75px] box-border mr-2 flex items-center justify-center cursor-pointer border-none", onClick: () => handleClick(number), children: jsxs("span", { className: "font-semibold text-sm", children: [number, " ", string] }) }, String(i)));
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
const STEP_MONTHS = 1;
|
|
1545
|
-
function renderMonthsInput(props) {
|
|
1546
|
-
const { minMonths, maxMonths, monthsValue, defaultMonths, setMonthsValue } = props;
|
|
1547
|
-
return (jsx(InputRange, { className: "mt-[23px]", title: "\u0421\u0440\u043E\u043A \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u043C\u0435\u0441\u044F\u0446\u0435\u0432", items: ['Или выберите из предложенных вариантов ниже'], min: minMonths, max: maxMonths, step: STEP_MONTHS, value: monthsValue || defaultMonths, onChange: setMonthsValue }));
|
|
1548
|
-
}
|
|
1554
|
+
var Currency;
|
|
1555
|
+
(function (Currency) {
|
|
1556
|
+
Currency["RUB"] = "RUB";
|
|
1557
|
+
Currency["EUR"] = "EUR";
|
|
1558
|
+
Currency["USD"] = "USD";
|
|
1559
|
+
})(Currency || (Currency = {}));
|
|
1549
1560
|
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
function renderTermsButton() {
|
|
1555
|
-
return (jsxs("div", { className: "flex items-center", children: [jsx(Button, { className: "mr-3", text: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443", version: "primary", href: "#" }), jsx("div", { className: "w-80 text-2xs leading-4 text-secondary-text", "aria-label": "\u0421\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u0435 \u043D\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445", children: "\u041E\u0442\u043F\u0440\u0430\u0432\u043B\u044F\u044F \u0437\u0430\u044F\u0432\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u043D\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043D\u043D\u043E \u0442\u0440\u0435\u0431\u043E\u0432\u0430\u043D\u0438\u044F\u043C \u0424\u0417 \u00AB\u041E \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445\u00BB" })] }));
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1558
|
-
const STEP_MONEY = 1000;
|
|
1559
|
-
function renderWantedSumInput(props) {
|
|
1560
|
-
const { calculatorParams, moneyValue, defaultSum, setMoneyValue } = props;
|
|
1561
|
-
const minSum = calculatorParams?.minSum || DEFAULT_MIN_SUM;
|
|
1562
|
-
const maxSum = calculatorParams?.maxSum || DEFAULT_MAX_SUM;
|
|
1563
|
-
return (jsx(InputRange, { title: "\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0441\u0443\u043C\u043C\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u20BD", items: [
|
|
1564
|
-
`От ${addSpacesBetweenNumbers(minSum)} рублей`,
|
|
1565
|
-
`До ${addSpacesBetweenNumbers(maxSum)} рублей`,
|
|
1566
|
-
], min: minSum, max: maxSum, step: STEP_MONEY, value: moneyValue || defaultSum, onChange: setMoneyValue }));
|
|
1567
|
-
}
|
|
1568
|
-
|
|
1569
|
-
const DEFAULT_PAYMENT_TYPE = 'annuity';
|
|
1570
|
-
const BORDER_STYLE = 'border-solid border-[3px] border-primary-main rounded-md';
|
|
1571
|
-
const CreditCalculatorForm = JSX(({ context, directoryName }) => {
|
|
1572
|
-
const [moneyValue, setMoneyValue] = context.useState(undefined);
|
|
1573
|
-
const [monthsValue, setMonthsValue] = context.useState(undefined);
|
|
1574
|
-
const [isAnnuityChecked, setIsAnnuityChecked] = context.useState(true);
|
|
1575
|
-
const [isInsuranceChecked, setIsInsuranceChecked] = context.useState(true);
|
|
1576
|
-
const tableRows = useCreditCalculatorData(context.useAsyncData, directoryName).rows;
|
|
1577
|
-
const calculatorParams = getCalculatorParams({ tableRows, isAnnuity: isAnnuityChecked });
|
|
1578
|
-
const defaultSum = getDefaultSum(calculatorParams);
|
|
1579
|
-
const defaultMonths = getDefaultMonths(calculatorParams);
|
|
1580
|
-
const minMonths = calculatorParams?.minMonths || DEFAULT_MIN_MONTHS;
|
|
1581
|
-
const maxMonths = calculatorParams?.maxMonths || DEFAULT_MAX_MONTHS;
|
|
1582
|
-
const rate = getCreditRate({ calculatorParams, isInsurance: isInsuranceChecked });
|
|
1583
|
-
const monthlyPayment = getMonthlyPayment({
|
|
1584
|
-
calculatorParams,
|
|
1585
|
-
paymentType: DEFAULT_PAYMENT_TYPE,
|
|
1586
|
-
rate,
|
|
1587
|
-
sum: moneyValue || defaultSum,
|
|
1588
|
-
months: monthsValue || defaultMonths,
|
|
1589
|
-
});
|
|
1590
|
-
const creditTermYears = getCreditTermYears(minMonths, maxMonths);
|
|
1591
|
-
function handleButtonClick(value) {
|
|
1592
|
-
setMonthsValue(clamp(value * MONTHS_IN_YEAR, minMonths, maxMonths));
|
|
1593
|
-
}
|
|
1594
|
-
return (jsx("section", { className: "mt-7", children: jsxs("div", { className: `box-border p-[49px] pr-[56px] mx-auto w-max ${BORDER_STYLE}`, children: [jsxs("div", { className: "flex justify-between", children: [jsxs("div", { className: "mr-[42px]", children: [renderWantedSumInput({ calculatorParams, moneyValue, defaultSum, setMoneyValue }), renderMonthsInput({
|
|
1595
|
-
minMonths,
|
|
1596
|
-
maxMonths,
|
|
1597
|
-
monthsValue,
|
|
1598
|
-
defaultMonths,
|
|
1599
|
-
setMonthsValue,
|
|
1600
|
-
}), jsx("div", { className: "flex mb-7", children: creditTermYears.map((number, i) => renderButton(number, i, handleButtonClick)) }), 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", checked: isAnnuityChecked, onChange: setIsAnnuityChecked }), jsx(Checkbox, { className: "mt-3 mb-7", text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", checked: isInsuranceChecked, onChange: setIsInsuranceChecked })] }), renderProposal(monthlyPayment, rate)] }), renderTermsButton()] }) }));
|
|
1601
|
-
});
|
|
1602
|
-
|
|
1603
|
-
const DEFAULT_TABS = [
|
|
1604
|
-
{
|
|
1605
|
-
title: 'Кредит',
|
|
1606
|
-
description: 'Ставка от 6% до 7 лет',
|
|
1607
|
-
directoryName: 'credit-calculator-data',
|
|
1608
|
-
icon: { icon: 'CardIcon' },
|
|
1609
|
-
},
|
|
1610
|
-
{
|
|
1611
|
-
title: 'Кредит',
|
|
1612
|
-
description: 'Ставка от 4% до 7 лет',
|
|
1613
|
-
directoryName: 'credit-calculator-data1',
|
|
1614
|
-
icon: { icon: 'ChartSquareIcon' },
|
|
1615
|
-
},
|
|
1616
|
-
{
|
|
1617
|
-
title: 'Кредит',
|
|
1618
|
-
description: 'Ставка от 3% до 6 лет',
|
|
1619
|
-
directoryName: 'credit-calculator-data2',
|
|
1620
|
-
icon: { icon: 'DiscountShapeIcon' },
|
|
1621
|
-
},
|
|
1622
|
-
];
|
|
1623
|
-
|
|
1624
|
-
const CreditCalculator = JSX(({ className = '', context, tabs = DEFAULT_TABS, anchor = null }) => {
|
|
1625
|
-
const [currentTabIndex, setCurrentTabIndex] = context.useState(0);
|
|
1626
|
-
return (jsxs("section", { className: `font-sans text-primary-text py-10 bg-white ${className}`, id: anchor, children: [jsx(Heading, { className: "w-full text-center mb-8", headingType: getTileHeadingType(className), title: "\u041A\u0430\u043B\u044C\u043A\u0443\u043B\u044F\u0442\u043E\u0440" }), jsx(Tabs, { tabs: tabs, currentTabIndex: currentTabIndex, onTabClick: setCurrentTabIndex }), jsx(CreditCalculatorForm, { context: context, directoryName: tabs[currentTabIndex]?.directoryName })] }));
|
|
1561
|
+
const currencyNumberFormat = new Intl.NumberFormat('ru', {
|
|
1562
|
+
style: 'currency',
|
|
1563
|
+
currency: Currency.RUB,
|
|
1627
1564
|
});
|
|
1628
|
-
|
|
1629
|
-
function useExchangeRates(useAsyncData) {
|
|
1630
|
-
const { data } = useAsyncData(EXCHANGE_RATES_URL, fetchExchangeRates);
|
|
1631
|
-
return data || {};
|
|
1632
|
-
}
|
|
1633
|
-
async function fetchExchangeRates() {
|
|
1634
|
-
try {
|
|
1635
|
-
const response = await fetch(EXCHANGE_RATES_URL);
|
|
1636
|
-
return await response.json();
|
|
1637
|
-
}
|
|
1638
|
-
catch (err) {
|
|
1639
|
-
console.error(err);
|
|
1640
|
-
}
|
|
1641
|
-
}
|
|
1642
|
-
const EXCHANGE_RATES_URL = '/api/v1/exchangerates.json';
|
|
1643
|
-
|
|
1644
|
-
const currencyNumberFormat = new Intl.NumberFormat('ru', { style: 'currency', currency: 'RUB' });
|
|
1645
1565
|
const formatCurrency = (value) => (value ? currencyNumberFormat.format(value) : '');
|
|
1646
1566
|
|
|
1647
1567
|
const TABLE_HEAD_STYLE = 'font-light text-left font-normal text-sm text-secondary-text';
|
|
@@ -1653,55 +1573,141 @@
|
|
|
1653
1573
|
return (jsxs("table", { className: `h-fit w-fit ${className}`, children: [jsx("thead", { children: jsxs("tr", { children: [jsx("th", { className: TABLE_HEAD_STYLE, children: "\u0412\u0430\u043B\u044E\u0442\u0430" }), jsx("th", { className: `${TABLE_HEAD_STYLE} pl-11`, children: "\u041A\u0443\u043F\u0438\u0442\u044C" }), jsx("th", { className: `${TABLE_HEAD_STYLE} pl-11`, children: "\u041F\u0440\u043E\u0434\u0430\u0442\u044C" })] }) }), jsx("tbody", { children: exchangeCurrencyItems.map((item) => renderCurrencyRow(item)) })] }));
|
|
1654
1574
|
});
|
|
1655
1575
|
const renderCurrencyRow = (exchangeCurrencyItem) => {
|
|
1656
|
-
const code = exchangeCurrencyItem?.
|
|
1657
|
-
return (jsxs("tr", { className: "pb-1", children: [jsx("td", { className: "pt-4", children: jsxs("div", { className: "flex items-center", children: [code ? jsx(Img, { image: { icon: CURRENCY_ICONS_MAP[code] }, width: "24", height: "24" }) : null, jsx("span", { className: "text-m-title-md ml-2", children: code })] }) }), jsx("td", { className: "pt-4 pl-11 m-title-md font-light", children: formatCurrency(exchangeCurrencyItem.
|
|
1576
|
+
const code = exchangeCurrencyItem?.code;
|
|
1577
|
+
return (jsxs("tr", { className: "pb-1", children: [jsx("td", { className: "pt-4", children: jsxs("div", { className: "flex items-center", children: [code ? jsx(Img, { image: { icon: CURRENCY_ICONS_MAP[code] }, width: "24", height: "24" }) : null, jsx("span", { className: "text-m-title-md ml-2", children: code })] }) }), jsx("td", { className: "pt-4 pl-11 m-title-md font-light", children: formatCurrency(exchangeCurrencyItem.buy) }), jsx("td", { className: "pt-4 pl-11 m-title-md font-light", children: formatCurrency(exchangeCurrencyItem.sell) })] }, code));
|
|
1658
1578
|
};
|
|
1659
1579
|
|
|
1660
1580
|
const CurrentLocation = JSX(({ className = '', address, distance }) => (jsxs("div", { className: `flex text-sm ${className}`, children: [jsx(Img, { image: { icon: 'GpsIcon' }, width: "24", height: "24", asSVG: true }), jsxs("div", { className: "ml-3 font-light", children: [address ? jsx("p", { className: "m-0 mb-[3px]", children: address }) : null, distance ? (jsxs("p", { className: "text-secondary-text m-0", children: ["\u041A\u0443\u0440\u0441 \u0443\u043A\u0430\u0437\u0430\u043D \u0434\u043B\u044F \u0431\u043B\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043E \u043E\u0444\u0438\u0441\u0430 - ", distance] })) : null] })] })));
|
|
1661
1581
|
|
|
1662
|
-
const
|
|
1663
|
-
|
|
1582
|
+
const roundTo = (value, precision = 2) => {
|
|
1583
|
+
const factor = Math.pow(10, precision);
|
|
1584
|
+
return Math.round(parseFloat(String(value)) * factor) / factor;
|
|
1585
|
+
};
|
|
1586
|
+
|
|
1587
|
+
const calculateResult = (value, rate, precision) => {
|
|
1588
|
+
const result = Number(formatValue(value)) * Math.pow(rate, precision ? -1 : 1);
|
|
1589
|
+
return Number.isInteger(result) ? result : roundTo(result);
|
|
1590
|
+
};
|
|
1591
|
+
const formatValue = (value) => value.replace(/[^\d.,]/g, '').replace(',', '.');
|
|
1592
|
+
|
|
1593
|
+
const tableFunc = (table) => (input) => {
|
|
1594
|
+
const [, output] = table.find(([predicate]) => predicate(input)) || [];
|
|
1595
|
+
return output;
|
|
1596
|
+
};
|
|
1597
|
+
|
|
1598
|
+
const callbackCurrencySelect = (props) => tableFunc([
|
|
1599
|
+
[
|
|
1600
|
+
(_) => _.value !== Currency.RUB && _.oppositeValue !== Currency.RUB,
|
|
1601
|
+
() => props.handleConvert(props.value, Currency.RUB),
|
|
1602
|
+
],
|
|
1603
|
+
[
|
|
1604
|
+
(_) => _.value === Currency.RUB && _.oppositeValue === Currency.RUB,
|
|
1605
|
+
() => props.handleConvert(props.value, Currency.USD),
|
|
1606
|
+
],
|
|
1607
|
+
[() => true, () => props.handleConvert(props.value)],
|
|
1608
|
+
])(props)?.();
|
|
1609
|
+
|
|
1610
|
+
function renderButton() {
|
|
1611
|
+
return (jsx(Button, { className: "box-border mt-3.5 py-3 h-12 w-full", version: "primary", href: "https://coins.rshb.ru/exchange", target: "_blank", children: "\u041A\u0443\u043F\u0438\u0442\u044C \u0432\u0430\u043B\u044E\u0442\u0443" }));
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
const Input = JSX(({ className = '', id, name, type = 'text', placeholder, pattern, value, onChange }) => {
|
|
1615
|
+
const handleChange = (e) => {
|
|
1616
|
+
const validInputValue = e.target.validity.valid ? e.target.value : value;
|
|
1617
|
+
onChange(validInputValue);
|
|
1618
|
+
};
|
|
1619
|
+
return (jsx("input", { className: className, id: id, name: name || id, type: type, pattern: pattern, placeholder: placeholder, value: value, onChange: (e) => handleChange(e) }));
|
|
1664
1620
|
});
|
|
1665
1621
|
|
|
1666
|
-
const Select = JSX(({ className = '', id, name, children }) => {
|
|
1667
|
-
return (jsx("select", { className: className, id: id, name: name || id, children: children }));
|
|
1622
|
+
const Select = JSX(({ className = '', id, name, children, value, onChange }) => {
|
|
1623
|
+
return (jsx("select", { className: className, id: id, name: name || id, value: value, onChange: (e) => onChange(e.target.value), children: children }));
|
|
1668
1624
|
});
|
|
1669
1625
|
|
|
1670
1626
|
const SelectOption = JSX(({ className = '', value, selected, children }) => {
|
|
1671
1627
|
return (jsx("option", { className: className, value: `${value}`, selected: selected, children: children }));
|
|
1672
1628
|
});
|
|
1673
1629
|
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
function renderInput(placeholder, codes, selected) {
|
|
1678
|
-
return (jsxs("div", { className: "relative flex items-center", children: [jsx(Input, { className: "h-10 border pl-4 pt-[7px] pb-[7px] rounded-md text-m-sm w-full appearance-none -mr-12", type: "number", placeholder: `${placeholder}` }), codes.length ? (jsx(Select, { className: "h-9 -translate-x-4", children: codes.map((code, i) => (jsx(SelectOption, { value: code, selected: code === selected, children: code }, String(i)))) })) : null] }));
|
|
1630
|
+
function renderInput(props) {
|
|
1631
|
+
const { placeholder, rates, selected, value, setValue, setSelected } = props;
|
|
1632
|
+
return (jsxs("div", { className: "relative flex items-center", children: [jsx(Input, { className: "h-10 border pl-4 pt-[7px] pb-[7px] rounded-md text-m-sm w-full appearance-none -mr-12", placeholder: placeholder, type: "text", value: value, onChange: setValue }), rates.length ? (jsx(Select, { className: "h-9 -translate-x-4", value: selected, onChange: (_) => setSelected(_), children: rates.map((_, i) => (jsx(SelectOption, { value: _.code, children: _.code }, String(i)))) })) : null] }));
|
|
1679
1633
|
}
|
|
1680
1634
|
|
|
1681
|
-
const
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1635
|
+
const ExchangeCurrencyCalculator = JSX(({ context, className = '', currencyRatesBuy, currencyRatesSell }) => {
|
|
1636
|
+
const [calcState, setCalcState] = context.useState({
|
|
1637
|
+
inputSell: '',
|
|
1638
|
+
inputBuy: '',
|
|
1639
|
+
selectSell: currencyRatesBuy?.[0]?.code || Currency.RUB,
|
|
1640
|
+
selectBuy: currencyRatesSell?.[0]?.code || Currency.USD,
|
|
1641
|
+
});
|
|
1642
|
+
const handleSetCalcState = (newState) => {
|
|
1643
|
+
setCalcState((oldState) => ({ ...oldState, ...newState }));
|
|
1644
|
+
};
|
|
1645
|
+
return (jsxs("div", { className: `grid gap-3.5 ${className}`, children: [renderInput({
|
|
1646
|
+
placeholder: 'Хочу продать',
|
|
1647
|
+
rates: currencyRatesBuy,
|
|
1648
|
+
selected: calcState.selectSell,
|
|
1649
|
+
setSelected: handleSelectSell(calcState, handleSetCalcState, currencyRatesSell),
|
|
1650
|
+
value: calcState.inputSell,
|
|
1651
|
+
setValue: (value) => handleInputSell(handleSetCalcState, currencyRatesSell)(value, calcState.selectSell, calcState.selectBuy),
|
|
1652
|
+
}), renderInput({
|
|
1653
|
+
placeholder: 'Получу',
|
|
1654
|
+
rates: currencyRatesSell,
|
|
1655
|
+
selected: calcState.selectBuy,
|
|
1656
|
+
setSelected: handleSelectBuy(calcState, handleSetCalcState, currencyRatesBuy),
|
|
1657
|
+
value: calcState.inputBuy,
|
|
1658
|
+
setValue: (value) => handleInputBuy(handleSetCalcState, currencyRatesBuy)(value, calcState.selectBuy, calcState.selectSell),
|
|
1659
|
+
}), renderButton()] }));
|
|
1660
|
+
});
|
|
1661
|
+
const handleSelectSell = (calcState, setCalcState, currencyRatesSell) => (value) => {
|
|
1662
|
+
setCalcState({ selectSell: value });
|
|
1663
|
+
callbackCurrencySelect({
|
|
1664
|
+
value,
|
|
1665
|
+
oppositeValue: calcState.selectBuy,
|
|
1666
|
+
handleConvert: (codeFrom = calcState.selectSell, codeTo = calcState.selectBuy) => {
|
|
1667
|
+
handleInputSell(setCalcState, currencyRatesSell)(calcState.inputSell, codeFrom, codeTo);
|
|
1668
|
+
},
|
|
1669
|
+
});
|
|
1670
|
+
};
|
|
1671
|
+
const handleSelectBuy = (calcState, setCalcState, currencyRatesBuy) => (value) => {
|
|
1672
|
+
setCalcState({ selectBuy: value });
|
|
1673
|
+
callbackCurrencySelect({
|
|
1674
|
+
value,
|
|
1675
|
+
oppositeValue: calcState.selectSell,
|
|
1676
|
+
handleConvert: (codeTo = calcState.selectBuy, codeFrom = calcState.selectSell) => handleInputBuy(setCalcState, currencyRatesBuy)(calcState.inputBuy, codeTo, codeFrom),
|
|
1677
|
+
});
|
|
1678
|
+
};
|
|
1679
|
+
const handleInputSell = (setCalcState, currencyRatesSell) => (value, codeFrom, codeTo) => {
|
|
1680
|
+
setCalcState({ inputSell: formatValue(value), selectBuy: codeTo });
|
|
1681
|
+
const rate = currencyRatesSell.find((_) => _.code === codeTo)?.buy ||
|
|
1682
|
+
currencyRatesSell.find((_) => _.code === codeFrom)?.sell;
|
|
1683
|
+
if (rate) {
|
|
1684
|
+
setCalcState({
|
|
1685
|
+
inputBuy: String(calculateResult(value, rate, codeFrom === Currency.RUB) || ''),
|
|
1686
|
+
});
|
|
1687
|
+
}
|
|
1688
|
+
};
|
|
1689
|
+
const handleInputBuy = (setCalcState, currencyRatesBuy) => (value, codeTo, codeFrom) => {
|
|
1690
|
+
setCalcState({ inputBuy: formatValue(value), selectSell: codeFrom });
|
|
1691
|
+
const rate = currencyRatesBuy.find((_) => _.code === codeFrom)?.sell ||
|
|
1692
|
+
currencyRatesBuy.find((_) => _.code === codeTo)?.buy;
|
|
1693
|
+
if (rate) {
|
|
1694
|
+
setCalcState({
|
|
1695
|
+
inputSell: String(calculateResult(value, rate, codeTo === Currency.RUB) || ''),
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
};
|
|
1699
|
+
|
|
1695
1700
|
const DEFAULT_LOCATION = {
|
|
1696
1701
|
address: 'Москва, ул.Ленина д.28',
|
|
1697
1702
|
distance: '6км',
|
|
1698
1703
|
};
|
|
1699
1704
|
const ExchangeRateTile = JSX(({ className = '', context, title = 'Курсы обмена валют', anchor = null }) => {
|
|
1700
|
-
const
|
|
1701
|
-
const
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
+
const currencyRates = useExchangeRates(context.useAsyncData);
|
|
1706
|
+
const currencyRatesBuy = currencyRates.filter((_) => _.buy);
|
|
1707
|
+
currencyRatesBuy.unshift({ code: Currency.RUB });
|
|
1708
|
+
const currencyRatesSell = currencyRates.filter((_) => _.sell);
|
|
1709
|
+
currencyRatesSell.push({ code: Currency.RUB });
|
|
1710
|
+
return (jsx("section", { className: `bg-white text-primary-text font-sans p-9 box-border ${className}`, id: anchor, children: jsx(BaseTile, { context: context, title: jsx(Heading, { headingType: getTileHeadingType(className), title: title, className: "whitespace-pre-wrap" }), children: jsxs("div", { className: "flex", children: [jsxs("div", { className: "mr-[43px] pt-4", children: [currencyRates ? (jsx(CurrencyTable, { className: "mb-[31px]", exchangeCurrencyItems: currencyRates })) : null, jsx(CurrentLocation, { ...DEFAULT_LOCATION })] }), currencyRates.length && currencyRatesBuy.length && currencyRatesSell.length ? (jsx(ExchangeCurrencyCalculator, { className: "grow", context: context, currencyRatesBuy: currencyRatesBuy, currencyRatesSell: currencyRatesSell })) : null] }) }) }));
|
|
1705
1711
|
});
|
|
1706
1712
|
|
|
1707
1713
|
const LOGO_PATHS = [
|
|
@@ -1804,47 +1810,38 @@
|
|
|
1804
1810
|
origins: ['t.me', 'telegram.org'],
|
|
1805
1811
|
icon: { icon: 'TelegramIcon' },
|
|
1806
1812
|
label: 'Телеграм',
|
|
1807
|
-
width: '20px',
|
|
1808
|
-
height: '16px',
|
|
1809
1813
|
},
|
|
1810
1814
|
{
|
|
1811
1815
|
origins: ['vk.com'],
|
|
1812
1816
|
icon: { icon: 'VKIcon' },
|
|
1813
1817
|
label: 'ВКонтакте',
|
|
1814
|
-
width: '24px',
|
|
1815
|
-
height: '12px',
|
|
1816
1818
|
},
|
|
1817
1819
|
{
|
|
1818
1820
|
origins: ['ok.ru'],
|
|
1819
1821
|
icon: { icon: 'OkIcon' },
|
|
1820
1822
|
label: 'Одноклассники',
|
|
1821
|
-
width: '12px',
|
|
1822
|
-
height: '20px',
|
|
1823
1823
|
},
|
|
1824
1824
|
{
|
|
1825
1825
|
origins: ['apps.apple.com'],
|
|
1826
1826
|
icon: { icon: 'AppleIcon' },
|
|
1827
1827
|
label: 'App Store',
|
|
1828
|
-
width: '20px',
|
|
1829
|
-
height: '22px',
|
|
1830
1828
|
},
|
|
1831
1829
|
{
|
|
1832
1830
|
origins: ['play.google.com'],
|
|
1833
1831
|
icon: { icon: 'PlayMarketIcon' },
|
|
1834
1832
|
label: 'Google Play',
|
|
1835
|
-
width: '21px',
|
|
1836
|
-
height: '21px',
|
|
1837
1833
|
},
|
|
1838
1834
|
];
|
|
1839
1835
|
const MediaButton = JSX(({ href, version = 'primary' }) => {
|
|
1840
|
-
const { icon,
|
|
1841
|
-
if (!icon)
|
|
1836
|
+
const { icon, label } = ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
|
|
1837
|
+
if (!icon) {
|
|
1842
1838
|
return null;
|
|
1839
|
+
}
|
|
1843
1840
|
const classes = version === 'secondary'
|
|
1844
1841
|
? 'bg-secondary-light hover:bg-secondary-hover'
|
|
1845
1842
|
: 'border-main-divider border-solid border-[1px] hover:bg-primary-main';
|
|
1846
1843
|
const isPrimary = version === 'primary';
|
|
1847
|
-
return (jsx("a", { className: `flex items-center justify-center rounded-md w-14 h-14 group box-border ${classes} ${isPrimary ? 'hover:text-black' : ''}`, href: href, "aria-label": label, target: "_blank", rel: "noopener noreferrer", children: icon ? (jsx(Img, { image:
|
|
1844
|
+
return (jsx("a", { className: `flex items-center justify-center rounded-md w-14 h-14 group box-border ${classes} ${isPrimary ? 'hover:text-black' : ''}`, href: href, "aria-label": label, target: "_blank", rel: "noopener noreferrer", children: icon ? (jsx(Img, { image: icon, imageClassName: isPrimary ? 'group-hover:text-white' : '', width: "24", height: "24", asSVG: true })) : null }));
|
|
1848
1845
|
});
|
|
1849
1846
|
|
|
1850
1847
|
const SocialMedia = JSX(({ className = '', media, version, context, children }) => {
|
|
@@ -1856,13 +1853,13 @@
|
|
|
1856
1853
|
const TextInformation = JSX(({ className, links, context }) => {
|
|
1857
1854
|
const router = context.useRouter();
|
|
1858
1855
|
const { handlerDecorator } = context;
|
|
1859
|
-
return (jsxs("div", { className: `${className || ''}`, children: [jsx("div", { className: "pt-5
|
|
1856
|
+
return (jsxs("div", { className: `${className || ''}`, children: [jsx("div", { className: "pt-5", children: jsx("span", { className: "font-sans font-light text-xs text-secondary-text", children: `\u00a9\u00A02000-${new Date().getFullYear()}\u00A0АО \u00ABРоссельхозбанк\u00BB Генеральная лицензия Банка России \u2116\u00A03349 от\u00A012.08.2015\u00A0г.` }) }), links?.length ? (jsx("div", { className: "flex justify-start items-start gap-5 pt-2.5", children: links.map((_, i) => (jsx(TextInformationLink, { index: i, ...useLink({ router, handlerDecorator }, _) }, String(i)))) })) : null] }));
|
|
1860
1857
|
});
|
|
1861
1858
|
const TextInformationLink = JSX(({ className, index, text, href, target, onClick }) => (jsx("a", { className: `font-sans font-light text-xs text-secondary-text visited:text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${className || ''}`, href: href, target: target, onClick: onClick, children: text || `Документ ${index}` })));
|
|
1862
1859
|
|
|
1863
1860
|
const LEFT_COL_WIDTH_FULL_HD = 'w-[204px]';
|
|
1864
1861
|
const Footer = JSX(({ className, documents, relatedEnterprises, contacts, socialMedia, mobileApps, topItems, context, anchor = null, }) => {
|
|
1865
|
-
return (jsxs("footer", { className: `
|
|
1862
|
+
return (jsxs("footer", { className: `p-9 bg-white ${className || ''}`, id: anchor, children: [jsxs("div", { className: "flex items-stretch gap-[54px] pb-[30px] xl:gap-8", children: [jsx(Logo, { className: LEFT_COL_WIDTH_FULL_HD }), jsx(SearchBar, { context: context, className: "grow" })] }), jsxs("div", { className: "flex items-stretch gap-[54px] xl:gap-8", children: [jsxs("div", { className: `${LEFT_COL_WIDTH_FULL_HD} flex flex-col shrink-0 overflow-hidden`, children: [jsx(Contacts, { items: contacts, context: context, hasButton: true }), jsx(SocialMedia, { media: socialMedia, context: context, children: "\u0421\u043E\u0446\u0441\u0435\u0442\u0438" }), jsx(SocialMedia, { className: "mt-6", media: mobileApps, context: context, children: "\u041C\u043E\u0431\u0438\u043B\u044C\u043D\u043E\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435" })] }), jsx(Sitemap, { className: "pt-[3px]", context: context, items: topItems })] }), jsx(HorizontalNavigation, { className: "mt-[98px]", links: relatedEnterprises, context: context }), jsx(TextInformation, { links: documents, context: context })] }));
|
|
1866
1863
|
});
|
|
1867
1864
|
|
|
1868
1865
|
const GracePeriod = JSX(({ className = '', title, description, calendar, anchor = null }) => {
|
|
@@ -1884,7 +1881,7 @@
|
|
|
1884
1881
|
|
|
1885
1882
|
const checkIsHrefSameOrigin = (href, router) => getOrigin(href) === getOrigin(router.href);
|
|
1886
1883
|
|
|
1887
|
-
const isHrefActive = (href, router, cmp = (
|
|
1884
|
+
const isHrefActive = (href, router, cmp = (targetHref, baseHref) => baseHref.startsWith(targetHref)) => {
|
|
1888
1885
|
return cmp(withoutQuery(href), withoutMobilePath(withoutQuery(isURL(href) ? router.href : router.pathname)));
|
|
1889
1886
|
};
|
|
1890
1887
|
|
|
@@ -1897,21 +1894,19 @@
|
|
|
1897
1894
|
const TEXT_CLASSES$2 = 'font-sans font-light text-sm';
|
|
1898
1895
|
const LINK_CLASSES$1 = 'inline-block border border-solid bg-transparent text-center no-underline';
|
|
1899
1896
|
const TopItem = JSX(({ className = '', text, href, target, active, flat, onClick, children, ariaLabel, bgColor = 'bg-white', }) => (jsx("a", { className: `${getLinkClasses$1(bgColor, active, flat)} ${className}`, href: href, target: target, onClick: onClick, rel: "noopener noreferrer", "aria-label": ariaLabel, children: jsx("span", { className: getTextClasses$2(bgColor, active, flat), children: text || children }) })));
|
|
1900
|
-
const getLinkClasses$1 = (bgColor, active, flat) => {
|
|
1897
|
+
const getLinkClasses$1 = (bgColor, active = false, flat = false) => {
|
|
1901
1898
|
let classes = 'border-transparent';
|
|
1902
1899
|
if (active) {
|
|
1903
1900
|
classes = `rounded-md ${bgColor === 'bg-white' ? 'border-primary-main' : 'border-white'}`;
|
|
1904
1901
|
}
|
|
1905
1902
|
return `${classes} ${LINK_CLASSES$1} ${flat ? '' : 'px-4 py-2'}`;
|
|
1906
1903
|
};
|
|
1907
|
-
const getTextClasses$2 = (bgColor, active, flat) => {
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
classes = active
|
|
1911
|
-
? 'text-primary-main'
|
|
1912
|
-
: `${flat ? 'text-primary-text' : 'text-secondary-text'} hover:text-primary-main`;
|
|
1904
|
+
const getTextClasses$2 = (bgColor, active = false, flat = false) => {
|
|
1905
|
+
if (bgColor !== 'bg-white') {
|
|
1906
|
+
return `text-white ${TEXT_CLASSES$2}`;
|
|
1913
1907
|
}
|
|
1914
|
-
|
|
1908
|
+
const nonActiveAtoms = `${flat ? 'text-primary-text' : 'text-secondary-text'} hover:text-primary-main`;
|
|
1909
|
+
return `${active ? 'text-primary-main' : nonActiveAtoms} ${TEXT_CLASSES$2}`;
|
|
1915
1910
|
};
|
|
1916
1911
|
|
|
1917
1912
|
const HeaderSecondaryMenuButton = JSX(({ className = '', children, ariaLabel }) => (jsx("button", { type: "button", className: `border-0 p-0 w-[24px] h-[24px] flex items-center bg-inherit cursor-pointer ${className}`, disabled: true, "aria-label": ariaLabel, children: children })));
|
|
@@ -1960,75 +1955,41 @@
|
|
|
1960
1955
|
return `${bgColor === 'bg-white' ? 'bg-primary-main' : bgColor} ${BORDER_CLASSES}`;
|
|
1961
1956
|
};
|
|
1962
1957
|
|
|
1963
|
-
const isSSR = () => !(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
1964
|
-
|
|
1965
|
-
const isClient$1 = !isSSR();
|
|
1966
|
-
const headerSubMenuObserver = isClient$1
|
|
1967
|
-
? new IntersectionObserver((entries) => {
|
|
1968
|
-
const createArrays = (selectors) => selectors.map((_) => Array.from(window.document.querySelectorAll(_)));
|
|
1969
|
-
const headerSubMenuButtonElement = window.document.querySelector('[data-header-submenu-visible=toggled]');
|
|
1970
|
-
const [headerSubMenuItems, dotsHeaderSubMenuItems] = createArrays([
|
|
1971
|
-
'[data-item-name=header-submenu]',
|
|
1972
|
-
'[data-item-name=dots-header-submenu]',
|
|
1973
|
-
]);
|
|
1974
|
-
const visibilityList = {};
|
|
1975
|
-
entries.forEach((_) => {
|
|
1976
|
-
visibilityList[_.target.toString()] = _.isIntersecting;
|
|
1977
|
-
});
|
|
1978
|
-
const isHeaderSubMenuButtonShow = toggleVisibilityInItems(visibilityList, dotsHeaderSubMenuItems, 'hidden');
|
|
1979
|
-
toggleVisibilityInItems(visibilityList, headerSubMenuItems, 'invisible');
|
|
1980
|
-
if (headerSubMenuButtonElement) {
|
|
1981
|
-
isHeaderSubMenuButtonShow
|
|
1982
|
-
? headerSubMenuButtonElement.classList.remove('hidden')
|
|
1983
|
-
: headerSubMenuButtonElement.classList.add('hidden');
|
|
1984
|
-
}
|
|
1985
|
-
}, { root: window.document, threshold: 1.0 })
|
|
1986
|
-
: undefined;
|
|
1987
|
-
// TODO: add types
|
|
1988
|
-
const toggleVisibilityInItems = (visibilityList, items, className) => {
|
|
1989
|
-
const isReversed = className !== 'hidden';
|
|
1990
|
-
return items.some((_) => {
|
|
1991
|
-
const key = _.toString();
|
|
1992
|
-
const option = isReversed ? !visibilityList[key] : visibilityList[key];
|
|
1993
|
-
key in visibilityList ? _.classList.toggle(className, option) : null;
|
|
1994
|
-
return isReversed ? _.classList.contains('hidden') : !_.classList.contains('hidden');
|
|
1995
|
-
});
|
|
1996
|
-
};
|
|
1997
|
-
|
|
1998
1958
|
const DOT_BG_COLORS_MAP = {
|
|
1999
1959
|
'bg-white': 'bg-primary-text',
|
|
2000
1960
|
transparent: 'bg-white',
|
|
2001
1961
|
};
|
|
2002
|
-
const
|
|
2003
|
-
const
|
|
1962
|
+
const DropdownMenu = JSX((props) => {
|
|
1963
|
+
const { menuVisible, toggleMenu, menuItems, bgColor, context } = props;
|
|
1964
|
+
const { useRouter, handlerDecorator } = context;
|
|
1965
|
+
const router = useRouter();
|
|
1966
|
+
return (jsxs("div", { className: `absolute w-52 -top-4 right-0 pt-4 z-40 ${menuVisible ? 'bg-white rounded-md shadow-blue-gray/24' : ''}`, children: [jsx("button", { className: "flex justify-between items-center cursor-pointer h-6 ml-6", onClick: toggleMenu, "aria-label": `${menuVisible ? 'Скрыть другие разделы' : 'Показать другие разделы'}`, children: Array(3).fill(bgColor).map(renderDot) }), jsx("div", { className: `flex flex-col rounded-md bg-white p-6 pb-2 ${menuVisible ? '' : 'hidden'}`, "aria-hidden": !menuVisible, children: renderDotsSubMenuItems(menuItems, router, handlerDecorator) })] }));
|
|
1967
|
+
});
|
|
1968
|
+
const renderDotsSubMenuItems = (menuItems, router, handlerDecorator) => menuItems?.map((_) => (jsx("a", { ...useLink({ router, handlerDecorator }, _), className: "text-base font-light pb-4 hover:text-primary-main", children: _.text }, _.href)));
|
|
1969
|
+
const renderDot = (bgColor, i) => (jsx("div", { className: `w-[3px] h-[3px] rounded mr-1 ${DOT_BG_COLORS_MAP[bgColor]}` }, String(i)));
|
|
1970
|
+
|
|
1971
|
+
const HeaderSubMenu = JSX(({ context, subItems = [], bgColor }) => {
|
|
1972
|
+
const [menuVisible, setMenuVisible] = context.useState(false);
|
|
2004
1973
|
const router = context.useRouter();
|
|
2005
|
-
const { handlerDecorator } = context;
|
|
2006
|
-
|
|
2007
|
-
|
|
1974
|
+
const { handlerDecorator, IntersectionObserverTag } = context;
|
|
1975
|
+
const [visibleItemsCount, setVisibleItemsCount] = context.useState(subItems.length);
|
|
1976
|
+
const dropDownMenuItems = subItems.slice(visibleItemsCount);
|
|
1977
|
+
const activeSubItem = findActiveSubItem(router)(subItems);
|
|
1978
|
+
const toggleMenu = () => setMenuVisible(!menuVisible);
|
|
1979
|
+
const observerCallback = (itemIndex) => (entries) => {
|
|
1980
|
+
if (!entries.length) {
|
|
2008
1981
|
return;
|
|
2009
1982
|
}
|
|
2010
|
-
const
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
}
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
return (jsxs("nav", { className: "relative mt-5", children: [jsx("div", { className: "overflow-hidden whitespace-nowrap mr-52", children:
|
|
2019
|
-
|
|
2020
|
-
toggleSubMenu,
|
|
2021
|
-
subItems,
|
|
2022
|
-
bgColor,
|
|
2023
|
-
router,
|
|
2024
|
-
handlerDecorator,
|
|
2025
|
-
})] }));
|
|
2026
|
-
});
|
|
2027
|
-
// TODO: add types
|
|
2028
|
-
const renderDotsSubMenu = ({ subMenuIsShow, toggleSubMenu, subItems, bgColor, router, handlerDecorator, }) => (jsxs("div", { className: `absolute w-52 -top-4 right-0 pt-4 z-40 ${subMenuIsShow ? 'bg-white rounded-md shadow-blue-gray/24' : ''}`, "data-header-submenu-visible": "toggled", children: [jsx("button", { className: "flex justify-between items-center cursor-pointer h-6 ml-6", onClick: toggleSubMenu, "aria-label": `${subMenuIsShow ? 'Скрыть другие разделы' : 'Показать другие разделы'}`, children: Array(3).fill(bgColor).map(renderDot) }), jsx("div", { className: `flex flex-col rounded-md bg-white p-6 pb-2 ${subMenuIsShow ? '' : 'hidden'}`, "aria-hidden": !subMenuIsShow, children: renderDotsSubMenuItems(subItems, router, handlerDecorator) })] }));
|
|
2029
|
-
// TODO: add types
|
|
2030
|
-
const renderDotsSubMenuItems = (subItems, router, handlerDecorator) => subItems?.map((_) => (jsx("a", { ...useLink({ router, handlerDecorator }, _), "data-item-name": "dots-header-submenu", className: "text-base font-light pb-4 hover:text-primary-main", children: _.text }, _.href)));
|
|
2031
|
-
const renderDot = (bgColor, i) => (jsx("div", { className: `w-[3px] h-[3px] rounded mr-1 ${DOT_BG_COLORS_MAP[bgColor]}` }, String(i)));
|
|
1983
|
+
const entry = entries[0];
|
|
1984
|
+
if (entry.intersectionRatio < 1) {
|
|
1985
|
+
setVisibleItemsCount((prev) => Math.min(prev, itemIndex));
|
|
1986
|
+
}
|
|
1987
|
+
else {
|
|
1988
|
+
setVisibleItemsCount((prev) => Math.max(prev, itemIndex + 1));
|
|
1989
|
+
}
|
|
1990
|
+
};
|
|
1991
|
+
return (jsxs("nav", { className: "relative mt-5", children: [jsx("div", { className: "overflow-hidden whitespace-nowrap mr-52", children: subItems.map((_, i) => (jsx(IntersectionObserverTag, { Tag: "span", observerCallback: observerCallback(i), observerOptions: { threshold: 1 }, children: jsx(HeaderItem, { className: `mr-8 ${visibleItemsCount - 1 < i ? 'invisible' : ''}`, active: _ === activeSubItem, ...useLink({ router, handlerDecorator }, _), bgColor: bgColor }) }, String(i)))) }), dropDownMenuItems.length ? (jsx(DropdownMenu, { context: context, menuVisible: menuVisible, toggleMenu: toggleMenu, menuItems: dropDownMenuItems, bgColor: bgColor })) : null] }));
|
|
1992
|
+
});
|
|
2032
1993
|
|
|
2033
1994
|
const BORDER_COLORS = {
|
|
2034
1995
|
'bg-white': 'bg-main-divider',
|
|
@@ -2057,7 +2018,6 @@
|
|
|
2057
2018
|
return (jsxs("div", { className: `flex justify-between items-center gap-2 w-full ${widthStyle}`, children: [jsx("span", { className: "text-secondary-text text-base", children: title }), jsxs("span", { className: "text-primary-main text-title-2xs", children: [addSpacesBetweenNumbers(sum), " \u20BD"] })] }));
|
|
2058
2019
|
}
|
|
2059
2020
|
|
|
2060
|
-
const arrowBtnStyle = 'absolute w-12 h-12 min-h-12 max-h-12 top-1 z-10 mt-[25px] bg-white rounded-full text-primary-text';
|
|
2061
2021
|
const InsuranceAmountBlockInner = JSX(({ className = '', context, cards = [], anchor = null }) => {
|
|
2062
2022
|
const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
|
|
2063
2023
|
const [tabsShift, setTabsShift] = context.useState(0);
|
|
@@ -2076,11 +2036,16 @@
|
|
|
2076
2036
|
isLastShift,
|
|
2077
2037
|
setActiveSlideIndex,
|
|
2078
2038
|
})
|
|
2079
|
-
: null,
|
|
2039
|
+
: null, renderArrows({
|
|
2040
|
+
handler: [handlePrevClick, handleNextClick],
|
|
2041
|
+
isShown: [showPrevButton, showNextButton],
|
|
2042
|
+
btnClass: ['left-[50px]', 'right-[50px]'],
|
|
2043
|
+
className: 'top-[62px]',
|
|
2044
|
+
}), showPrevButton ? (jsx("div", { className: "absolute top-0 left-0 h-full w-[136px] bg-opacity-from-white" })) : null, showNextButton ? (jsx("div", { className: "absolute top-0 right-0 h-full w-[136px] bg-opacity-to-white" })) : null] }) }));
|
|
2080
2045
|
});
|
|
2081
2046
|
function renderGallery({ tabsShift, cards, activeSlideIndex, isLastShift, setActiveSlideIndex, }) {
|
|
2082
2047
|
const tabsShiftWidth = isLastShift ? tabsShift * 460 - 240 : tabsShift * 460;
|
|
2083
|
-
return (jsx("div", { style: { transform: `translateX(-${tabsShiftWidth}px)` }, className: "duration-1000", children: jsx("div", { className: "w-full flex flex-nowrap gap-3.5 pb-[38px]
|
|
2048
|
+
return (jsx("div", { style: { transform: `translateX(-${tabsShiftWidth}px)` }, className: "duration-1000 px-[50px]", children: jsx("div", { className: "w-full flex flex-nowrap gap-3.5 pb-[38px]", children: cards.map((slide, i) => renderSlide({
|
|
2084
2049
|
slide,
|
|
2085
2050
|
i,
|
|
2086
2051
|
activeSlideIndex,
|
|
@@ -2225,7 +2190,7 @@
|
|
|
2225
2190
|
const renderShimmer = (size = 3) => goldenSequence(100, size)
|
|
2226
2191
|
.map((_) => Math.floor(_))
|
|
2227
2192
|
.map(renderShimmerItem);
|
|
2228
|
-
const renderShimmerItem = (width
|
|
2193
|
+
const renderShimmerItem = (width, index) => (jsx("div", { style: { width: `${width || 100}%` }, className: "h-4 mt-2 bg-secondary-light" }, String(index)));
|
|
2229
2194
|
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
2230
2195
|
|
|
2231
2196
|
const productGalleryStyleMap = {
|
|
@@ -2321,7 +2286,12 @@
|
|
|
2321
2286
|
const isUseSlider = cardsCount > CARD_FULL_VIEW_COUNT;
|
|
2322
2287
|
const showNextButton = isUseSlider && cardsCount - activeCardIndex > CARD_FULL_VIEW_COUNT;
|
|
2323
2288
|
const showPrevButton = isUseSlider && activeCardIndex > 0;
|
|
2324
|
-
return (
|
|
2289
|
+
return (jsx("div", { children: renderArrows({
|
|
2290
|
+
handler: [handlePrevClick, handleNextClick],
|
|
2291
|
+
isShown: [showPrevButton, showNextButton],
|
|
2292
|
+
btnClass: ['left-8', 'right-8'],
|
|
2293
|
+
className: 'top-1/2 mt-6',
|
|
2294
|
+
}) }));
|
|
2325
2295
|
};
|
|
2326
2296
|
|
|
2327
2297
|
const StepsBlock = JSX(({ className = '', title, showLines = true, steps = [], button, anchor = null }) => {
|
|
@@ -2383,7 +2353,7 @@
|
|
|
2383
2353
|
});
|
|
2384
2354
|
|
|
2385
2355
|
const GroupBlockTabs = JSX((props) => {
|
|
2386
|
-
const { tabs, currentTag, onTabClick, className = '', isShowCounter
|
|
2356
|
+
const { tabs, currentTag, onTabClick, className = '', isShowCounter } = props;
|
|
2387
2357
|
return (jsx("div", { className: `mb-2 box-border flex gap-x-1 ${className}`, role: "tablist", children: tabs?.map(renderTab(onTabClick, isShowCounter, currentTag)) }));
|
|
2388
2358
|
});
|
|
2389
2359
|
const badgeStyle = 'min-w-[22px] w-[22px] h-[22px] rounded-full text-m-sm';
|
|
@@ -2393,7 +2363,7 @@
|
|
|
2393
2363
|
const tabText = isActive ? 'text-white' : 'text-secondary-text group-hover:text-primary-main';
|
|
2394
2364
|
const counterBlockStyle = `${badgeStyle}
|
|
2395
2365
|
${isActive ? 'bg-white/30 text-white' : 'bg-secondary-light text-secondary-text'}`;
|
|
2396
|
-
return (jsx("div", { className: `flex h-full w-full h-12 flex-1 cursor-pointer mr-2 last:mr-0 box-content ${tabBg}`, role: "tab", onClick: () => onTabClick(tab.tag), "aria-selected": String(isActive), tag: tab?.tag, children: jsxs("div", { className: "flex flex-1 items-center justify-center", children: [tab?.title ? jsx("h3", { className:
|
|
2366
|
+
return (jsx("div", { className: `flex h-full w-full h-12 flex-1 cursor-pointer mr-2 last:mr-0 box-content ${tabBg}`, role: "tab", onClick: () => onTabClick(tab.tag), "aria-selected": String(isActive), tag: tab?.tag, children: jsxs("div", { className: "flex flex-1 items-center justify-center", children: [tab?.title ? jsx("h3", { className: tabText, children: tab?.title }) : null, isShowCounter ? (jsx("div", { className: `flex items-center justify-center ml-8 ${counterBlockStyle}`, children: jsx("span", { children: tab.count }) })) : null] }) }, String(i)));
|
|
2397
2367
|
};
|
|
2398
2368
|
|
|
2399
2369
|
function style2className(style) {
|
|
@@ -2406,7 +2376,7 @@
|
|
|
2406
2376
|
};
|
|
2407
2377
|
|
|
2408
2378
|
const GroupBlocksItem = JSX(({ groupBlocks, context }) => {
|
|
2409
|
-
return (jsx("div", { className:
|
|
2379
|
+
return (jsx("div", { className: "grid grid-cols-12 gap-2 box-border", children: groupBlocks?.length ? groupBlocks.map(renderBlock$1(context)) : null }));
|
|
2410
2380
|
});
|
|
2411
2381
|
const renderBlock$1 = (context) => (block, i) => {
|
|
2412
2382
|
const type = block?.blockType;
|
|
@@ -2422,16 +2392,16 @@
|
|
|
2422
2392
|
return tag ? blocks.filter((block) => block?.tags?.includes(tag)) : blocks;
|
|
2423
2393
|
};
|
|
2424
2394
|
|
|
2425
|
-
const GroupBlock = JSX(({ className = '', tabs, context, anchor = null, groupBlocks = [] }) => {
|
|
2395
|
+
const GroupBlock = JSX(({ className = '', tabs, context, anchor = null, groupBlocks = [], isShowCounter }) => {
|
|
2426
2396
|
const [currentTag, setCurrentTag] = context.useState(tabs?.[0]?.tag);
|
|
2427
2397
|
const filteredBlocks = filterBlocksByTag(groupBlocks, currentTag);
|
|
2428
2398
|
const tabsNewMap = tabs?.map((tab) => {
|
|
2429
2399
|
const count = tab.tag
|
|
2430
|
-
? groupBlocks.filter((block) => block?.tags?.includes(
|
|
2400
|
+
? groupBlocks.filter((block) => block?.tags?.includes(tab.tag)).length
|
|
2431
2401
|
: groupBlocks.length;
|
|
2432
2402
|
return { ...tab, count };
|
|
2433
2403
|
});
|
|
2434
|
-
return (jsxs("section", { id: anchor, className: `box-border gap-1
|
|
2404
|
+
return (jsxs("section", { id: anchor, className: `box-border gap-1 ${className}`, children: [tabsNewMap?.length ? (jsx(GroupBlockTabs, { currentTag: currentTag, onTabClick: setCurrentTag, tabs: tabsNewMap, isShowCounter: isShowCounter })) : null, groupBlocks.length ? (jsx(GroupBlocksItem, { context: context, groupBlocks: filteredBlocks })) : null] }));
|
|
2435
2405
|
});
|
|
2436
2406
|
|
|
2437
2407
|
function getElementsColsValue(className = '') {
|
|
@@ -2448,10 +2418,10 @@
|
|
|
2448
2418
|
}
|
|
2449
2419
|
|
|
2450
2420
|
const BonusBenefitsBlock = JSX(({ className = '', title, subtitle, bonusBenefits, anchor = null }) => {
|
|
2451
|
-
return (jsxs("section", { className: `font-sans text-primary-text bg-white p-50 flex flex-col ${className}`, id: anchor, children: [title ?
|
|
2421
|
+
return (jsxs("section", { className: `font-sans text-primary-text bg-white p-50 flex flex-col text-center ${className}`, id: anchor, children: [title ? jsx(Heading, { headingType: "h3", className: "mb-[10px]", title: title }) : null, subtitle ? jsx("span", { className: "text-md font-normal", children: subtitle }) : null, bonusBenefits?.length ? (jsx("div", { className: `grid gap-1 ${getElementsColsValue(className)}`, children: bonusBenefits.map(renderBonusBenefit) })) : null] }));
|
|
2452
2422
|
});
|
|
2453
2423
|
const renderBonusBenefit = (bonusBenefit, i) => {
|
|
2454
|
-
return (jsxs("div", { className: "flex flex-col items-center max-w-[292px]", children: [bonusBenefit?.icon ? (jsx(Img, { className: "h-[180px] w-[160px] min-w-[160px] min-h-[160px]", image: bonusBenefit.icon, width: "160", height: "180" })) : null, jsx("div", { children: bonusBenefit?.label ?
|
|
2424
|
+
return (jsxs("div", { className: "flex flex-col items-center max-w-[292px]", children: [bonusBenefit?.icon ? (jsx(Img, { className: "h-[180px] w-[160px] min-w-[160px] min-h-[160px]", image: bonusBenefit.icon, width: "160", height: "180" })) : null, jsx("div", { children: bonusBenefit?.label ? jsx("span", { className: "title-2xs m-0", children: bonusBenefit.label }) : null })] }, String(i)));
|
|
2455
2425
|
};
|
|
2456
2426
|
|
|
2457
2427
|
const Blocks = {
|
|
@@ -2460,7 +2430,6 @@
|
|
|
2460
2430
|
Bonus,
|
|
2461
2431
|
ComparisonTable,
|
|
2462
2432
|
Calculator,
|
|
2463
|
-
CreditCalculator,
|
|
2464
2433
|
ExchangeRateTile,
|
|
2465
2434
|
Footer,
|
|
2466
2435
|
Gallery,
|
|
@@ -2494,8 +2463,9 @@
|
|
|
2494
2463
|
blocks?.forEach((block) => {
|
|
2495
2464
|
const currentHash = globalThis.location?.hash; // TODO: remove globalThis, use href from router
|
|
2496
2465
|
const anchorHash = `#${block?.id}`;
|
|
2497
|
-
if (currentHash === anchorHash)
|
|
2466
|
+
if (currentHash === anchorHash) {
|
|
2498
2467
|
return;
|
|
2468
|
+
}
|
|
2499
2469
|
const position = block?.getBoundingClientRect();
|
|
2500
2470
|
if (position && position.top > 0 && position.top < 150) {
|
|
2501
2471
|
router.replace(`#${block?.id}`);
|
|
@@ -2503,6 +2473,8 @@
|
|
|
2503
2473
|
});
|
|
2504
2474
|
};
|
|
2505
2475
|
|
|
2476
|
+
const isSSR = () => !(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
2477
|
+
|
|
2506
2478
|
const LikeButton = JSX(({ className, onClick, ariaLabel }) => (jsx("button", { type: "button", className: `border-0 w-[36px] bg-inherit cursor-pointer ${className || ''}`, onClick: onClick, "aria-label": ariaLabel, children: renderLikeIcon() })));
|
|
2507
2479
|
const renderLikeIcon = () => {
|
|
2508
2480
|
const params = {
|