@redneckz/wildless-cms-uni-blocks 0.5.10 → 0.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/migration-scripts/0.4.5.js +1 -1
- package/bin/migration-scripts/0.5.10.js +36 -0
- package/bin/utils.js +0 -2
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +164 -98
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/EventBus/EventMap.d.ts +2 -1
- package/dist/components/Bonus/Bonus.js +11 -2
- package/dist/components/Bonus/Bonus.js.map +1 -1
- package/dist/components/Bonus/BonusContent.d.ts +30 -2
- package/dist/components/CardTransfer/CardTransfer.js +10 -11
- package/dist/components/CardTransfer/CardTransfer.js.map +1 -1
- package/dist/components/CardTransfer/CardTransferContent.d.ts +2 -2
- package/dist/components/ComparisonTable/TableColumn.js +7 -2
- package/dist/components/ComparisonTable/TableColumn.js.map +1 -1
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +2 -2
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +1 -1
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/dist/components/ExchangeRateTile/renderInput.js +2 -2
- package/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
- package/dist/components/GracePeriod/GracePeriod.js +3 -3
- package/dist/components/GracePeriod/GracePeriod.js.map +1 -1
- package/dist/components/GracePeriod/GracePeriodContent.d.ts +1 -1
- package/dist/components/MobileAppTile/MobileAppTile.js +2 -2
- package/dist/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/dist/components/SafeDepositRental/RegionsAndBranches.js +1 -1
- package/dist/components/SafeDepositRental/RegionsAndBranches.js.map +1 -1
- package/dist/components/SafeDepositRental/SafeDepositRental.js +1 -1
- package/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/dist/components/SafeDepositRental/SafeDepositRentalTotal.js +1 -1
- package/dist/components/SafeDepositRental/SafeDepositRentalTotal.js.map +1 -1
- package/dist/components/SafeDepositRental/WrapperSelect.js +6 -3
- package/dist/components/SafeDepositRental/WrapperSelect.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +4 -0
- package/dist/components/Tabs/Tabs.js +13 -3
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/TabsContent.d.ts +2 -0
- package/dist/components/Tabs/renderLinkTab.d.ts +3 -2
- package/dist/components/Tabs/renderLinkTab.js +4 -1
- package/dist/components/Tabs/renderLinkTab.js.map +1 -1
- package/dist/components/Tabs/renderTab.js +12 -2
- package/dist/components/Tabs/renderTab.js.map +1 -1
- package/dist/react/IntersectionObserverTag.js +7 -3
- package/dist/react/IntersectionObserverTag.js.map +1 -1
- package/dist/ui-kit/BlockWrapper.js +34 -12
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/dist/ui-kit/CurrencyInput/CurrencyInput.js +11 -6
- package/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/dist/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +2 -7
- package/dist/ui-kit/CurrencyInput/adjustValue .d.ts +1 -0
- package/dist/ui-kit/CurrencyInput/adjustValue .js +15 -0
- package/dist/ui-kit/CurrencyInput/adjustValue .js.map +1 -0
- package/dist/ui-kit/Input/Input.d.ts +1 -1
- package/dist/ui-kit/Input/Input.js +7 -4
- package/dist/ui-kit/Input/Input.js.map +1 -1
- package/dist/ui-kit/Input/InputProps.d.ts +6 -3
- package/dist/ui-kit/Select/Select.d.ts +10 -4
- package/dist/ui-kit/Select/Select.js +23 -5
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/dist/utils/changeHashOnObserve.d.ts +9 -1
- package/dist/utils/changeHashOnObserve.js +12 -4
- package/dist/utils/changeHashOnObserve.js.map +1 -1
- package/lib/EventBus/EventMap.d.ts +2 -1
- package/lib/common.css +1 -1
- package/lib/components/Bonus/Bonus.js +11 -2
- package/lib/components/Bonus/Bonus.js.map +1 -1
- package/lib/components/Bonus/BonusContent.d.ts +30 -2
- package/lib/components/CardTransfer/CardTransfer.js +10 -11
- package/lib/components/CardTransfer/CardTransfer.js.map +1 -1
- package/lib/components/CardTransfer/CardTransferContent.d.ts +2 -2
- package/lib/components/ComparisonTable/TableColumn.js +7 -2
- package/lib/components/ComparisonTable/TableColumn.js.map +1 -1
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +2 -2
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +1 -1
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/lib/components/ExchangeRateTile/renderInput.js +2 -2
- package/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
- package/lib/components/GracePeriod/GracePeriod.js +3 -3
- package/lib/components/GracePeriod/GracePeriod.js.map +1 -1
- package/lib/components/GracePeriod/GracePeriodContent.d.ts +1 -1
- package/lib/components/MobileAppTile/MobileAppTile.js +2 -2
- package/lib/components/MobileAppTile/MobileAppTile.js.map +1 -1
- package/lib/components/SafeDepositRental/RegionsAndBranches.js +1 -1
- package/lib/components/SafeDepositRental/RegionsAndBranches.js.map +1 -1
- package/lib/components/SafeDepositRental/SafeDepositRental.js +1 -1
- package/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/lib/components/SafeDepositRental/SafeDepositRentalTotal.js +1 -1
- package/lib/components/SafeDepositRental/SafeDepositRentalTotal.js.map +1 -1
- package/lib/components/SafeDepositRental/WrapperSelect.js +7 -4
- package/lib/components/SafeDepositRental/WrapperSelect.js.map +1 -1
- package/lib/components/Tabs/Tabs.d.ts +4 -0
- package/lib/components/Tabs/Tabs.js +13 -3
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/TabsContent.d.ts +2 -0
- package/lib/components/Tabs/renderLinkTab.d.ts +3 -2
- package/lib/components/Tabs/renderLinkTab.js +5 -2
- package/lib/components/Tabs/renderLinkTab.js.map +1 -1
- package/lib/components/Tabs/renderTab.js +12 -2
- package/lib/components/Tabs/renderTab.js.map +1 -1
- package/lib/react/IntersectionObserverTag.js +7 -3
- package/lib/react/IntersectionObserverTag.js.map +1 -1
- package/lib/ui-kit/BlockWrapper.js +35 -13
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/ui-kit/CurrencyInput/CurrencyInput.js +12 -7
- package/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/lib/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +2 -7
- package/lib/ui-kit/CurrencyInput/adjustValue .d.ts +1 -0
- package/lib/ui-kit/CurrencyInput/adjustValue .js +12 -0
- package/lib/ui-kit/CurrencyInput/adjustValue .js.map +1 -0
- package/lib/ui-kit/Input/Input.d.ts +1 -1
- package/lib/ui-kit/Input/Input.js +8 -5
- package/lib/ui-kit/Input/Input.js.map +1 -1
- package/lib/ui-kit/Input/InputProps.d.ts +6 -3
- package/lib/ui-kit/Select/Select.d.ts +10 -4
- package/lib/ui-kit/{SelectCustom/SelectCustom.fixture.d.ts → Select/Select.fixture.d.ts} +0 -0
- package/lib/ui-kit/Select/Select.js +24 -6
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/lib/utils/changeHashOnObserve.d.ts +9 -1
- package/lib/utils/changeHashOnObserve.js +12 -4
- package/lib/utils/changeHashOnObserve.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +90 -52
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/EventBus/EventMap.d.ts +2 -1
- package/mobile/dist/components/Bonus/Bonus.js +11 -2
- package/mobile/dist/components/Bonus/Bonus.js.map +1 -1
- package/mobile/dist/components/Bonus/BonusContent.d.ts +30 -2
- package/mobile/dist/components/CardTransfer/CardTransfer.js +10 -11
- package/mobile/dist/components/CardTransfer/CardTransfer.js.map +1 -1
- package/mobile/dist/components/CardTransfer/CardTransferContent.d.ts +2 -2
- package/mobile/dist/components/ComparisonTable/TableColumn.js +7 -2
- package/mobile/dist/components/ComparisonTable/TableColumn.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +2 -2
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/renderInput.js +2 -2
- package/mobile/dist/components/ExchangeRateTile/renderInput.js.map +1 -1
- package/mobile/dist/components/GracePeriod/GracePeriod.js +3 -3
- package/mobile/dist/components/GracePeriod/GracePeriod.js.map +1 -1
- package/mobile/dist/components/GracePeriod/GracePeriodContent.d.ts +1 -1
- package/mobile/dist/components/SafeDepositRental/RegionsAndBranches.js +1 -1
- package/mobile/dist/components/SafeDepositRental/RegionsAndBranches.js.map +1 -1
- package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js +1 -1
- package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/mobile/dist/components/SafeDepositRental/SafeDepositRentalTotal.js +1 -1
- package/mobile/dist/components/SafeDepositRental/SafeDepositRentalTotal.js.map +1 -1
- package/mobile/dist/components/SafeDepositRental/WrapperSelect.js +6 -3
- package/mobile/dist/components/SafeDepositRental/WrapperSelect.js.map +1 -1
- package/mobile/dist/components/Tabs/Tabs.d.ts +4 -0
- package/mobile/dist/components/Tabs/Tabs.js +13 -3
- package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
- package/mobile/dist/components/Tabs/TabsContent.d.ts +2 -0
- package/mobile/dist/components/Tabs/renderLinkTab.d.ts +3 -2
- package/mobile/dist/components/Tabs/renderLinkTab.js +4 -1
- package/mobile/dist/components/Tabs/renderLinkTab.js.map +1 -1
- package/mobile/dist/components/Tabs/renderTab.js +12 -2
- package/mobile/dist/components/Tabs/renderTab.js.map +1 -1
- package/mobile/dist/react/IntersectionObserverTag.js +7 -3
- package/mobile/dist/react/IntersectionObserverTag.js.map +1 -1
- package/mobile/dist/ui-kit/BlockWrapper.js +34 -12
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js +11 -6
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +2 -7
- package/mobile/dist/ui-kit/CurrencyInput/adjustValue .d.ts +1 -0
- package/mobile/dist/ui-kit/CurrencyInput/adjustValue .js +15 -0
- package/mobile/dist/ui-kit/CurrencyInput/adjustValue .js.map +1 -0
- package/mobile/dist/ui-kit/Input/Input.d.ts +1 -1
- package/mobile/dist/ui-kit/Input/Input.js +7 -4
- package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputProps.d.ts +6 -3
- package/mobile/dist/ui-kit/Select/Select.d.ts +10 -4
- package/mobile/dist/ui-kit/Select/Select.js +23 -5
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/dist/utils/changeHashOnObserve.d.ts +9 -1
- package/mobile/dist/utils/changeHashOnObserve.js +12 -4
- package/mobile/dist/utils/changeHashOnObserve.js.map +1 -1
- package/mobile/lib/EventBus/EventMap.d.ts +2 -1
- package/mobile/lib/components/Bonus/Bonus.js +11 -2
- package/mobile/lib/components/Bonus/Bonus.js.map +1 -1
- package/mobile/lib/components/Bonus/BonusContent.d.ts +30 -2
- package/mobile/lib/components/CardTransfer/CardTransfer.js +10 -11
- package/mobile/lib/components/CardTransfer/CardTransfer.js.map +1 -1
- package/mobile/lib/components/CardTransfer/CardTransferContent.d.ts +2 -2
- package/mobile/lib/components/ComparisonTable/TableColumn.js +7 -2
- package/mobile/lib/components/ComparisonTable/TableColumn.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +2 -2
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +1 -1
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/renderInput.js +2 -2
- package/mobile/lib/components/ExchangeRateTile/renderInput.js.map +1 -1
- package/mobile/lib/components/GracePeriod/GracePeriod.js +3 -3
- package/mobile/lib/components/GracePeriod/GracePeriod.js.map +1 -1
- package/mobile/lib/components/GracePeriod/GracePeriodContent.d.ts +1 -1
- package/mobile/lib/components/SafeDepositRental/RegionsAndBranches.js +1 -1
- package/mobile/lib/components/SafeDepositRental/RegionsAndBranches.js.map +1 -1
- package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js +1 -1
- package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/mobile/lib/components/SafeDepositRental/SafeDepositRentalTotal.js +1 -1
- package/mobile/lib/components/SafeDepositRental/SafeDepositRentalTotal.js.map +1 -1
- package/mobile/lib/components/SafeDepositRental/WrapperSelect.js +7 -4
- package/mobile/lib/components/SafeDepositRental/WrapperSelect.js.map +1 -1
- package/mobile/lib/components/Tabs/Tabs.d.ts +4 -0
- package/mobile/lib/components/Tabs/Tabs.js +13 -3
- package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/components/Tabs/TabsContent.d.ts +2 -0
- package/mobile/lib/components/Tabs/renderLinkTab.d.ts +3 -2
- package/mobile/lib/components/Tabs/renderLinkTab.js +5 -2
- package/mobile/lib/components/Tabs/renderLinkTab.js.map +1 -1
- package/mobile/lib/components/Tabs/renderTab.js +12 -2
- package/mobile/lib/components/Tabs/renderTab.js.map +1 -1
- package/mobile/lib/react/IntersectionObserverTag.js +7 -3
- package/mobile/lib/react/IntersectionObserverTag.js.map +1 -1
- package/mobile/lib/ui-kit/BlockWrapper.js +35 -13
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js +12 -7
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInputProps.d.ts +2 -7
- package/mobile/lib/ui-kit/CurrencyInput/adjustValue .d.ts +1 -0
- package/mobile/lib/ui-kit/CurrencyInput/adjustValue .js +12 -0
- package/mobile/lib/ui-kit/CurrencyInput/adjustValue .js.map +1 -0
- package/mobile/lib/ui-kit/Input/Input.d.ts +1 -1
- package/mobile/lib/ui-kit/Input/Input.js +8 -5
- package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputProps.d.ts +6 -3
- package/mobile/lib/ui-kit/Select/Select.d.ts +10 -4
- package/mobile/lib/ui-kit/Select/Select.js +24 -6
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/utils/changeHashOnObserve.d.ts +9 -1
- package/mobile/lib/utils/changeHashOnObserve.js +12 -4
- package/mobile/lib/utils/changeHashOnObserve.js.map +1 -1
- package/mobile/src/EventBus/EventMap.ts +3 -1
- package/mobile/src/components/Accordion/Accordion.ui.json +79 -0
- package/mobile/src/components/BenefitsBlock/BenefitsBlock.ui.json +16 -0
- package/mobile/src/components/Bonus/Bonus.example.json +5 -2
- package/mobile/src/components/Bonus/Bonus.tsx +44 -16
- package/mobile/src/components/Bonus/Bonus.ui.json +16 -0
- package/mobile/src/components/Bonus/BonusContent.ts +33 -2
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.example.json +1 -1
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.ui.json +11 -0
- package/mobile/src/components/Calculator/Calculator.example.json +2 -1
- package/mobile/src/components/Calculator/Calculator.ui.json +31 -0
- package/mobile/src/components/CardTransfer/CardTransfer.example.json +7 -2
- package/mobile/src/components/CardTransfer/CardTransfer.tsx +22 -23
- package/mobile/src/components/CardTransfer/CardTransfer.ui.json +1 -0
- package/mobile/src/components/CardTransfer/CardTransferContent.ts +2 -2
- package/mobile/src/components/Catalog/Catalog.ui.json +1 -0
- package/mobile/src/components/ComparisonTable/ComparisonTable.ui.json +1 -0
- package/mobile/src/components/ComparisonTable/TableColumn.tsx +17 -11
- package/mobile/src/components/ContentPage/ContentPage.page.json +15 -1
- package/mobile/src/components/ErrorBlock/ErrorBlock.ui.json +12 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +4 -3
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.ui.json +1 -0
- package/mobile/src/components/ExchangeRateTile/renderInput.tsx +3 -3
- package/mobile/src/components/Footer/Footer.ui.json +11 -0
- package/mobile/src/components/Gallery/Gallery.ui.json +1 -0
- package/mobile/src/components/GracePeriod/GracePeriod.tsx +5 -4
- package/mobile/src/components/GracePeriod/GracePeriod.ui.json +15 -0
- package/mobile/src/components/GracePeriod/GracePeriodContent.ts +1 -1
- package/mobile/src/components/Header/Header.ui.json +11 -0
- package/mobile/src/components/Headline/Headline.ui.json +1 -0
- package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlock.ui.json +15 -0
- package/mobile/src/components/LinkDocs/LinkDocs.ui.json +1 -0
- package/mobile/src/components/LinkList/LinkList.ui.json +1 -0
- package/mobile/src/components/MiniGallery/MiniGallery.ui.json +1 -0
- package/mobile/src/components/MobileAppTile/MobileAppTile.ui.json +7 -0
- package/mobile/src/components/OfficeServicesBlock/OfficeServicesBlock.ui.json +11 -0
- package/mobile/src/components/OtherProducts/OtherProducts.ui.json +76 -0
- package/mobile/src/components/PictureText/PictureText.ui.json +1 -0
- package/mobile/src/components/Placeholder/Placeholder.ui.json +1 -0
- package/mobile/src/components/ProductBlock/ProductBlock.ui.json +12 -0
- package/mobile/src/components/ProductGallery/ProductGallery.ui.json +30 -0
- package/mobile/src/components/ProductTile/ProductTile.ui.json +1 -0
- package/mobile/src/components/PromoTile/PromoTile.ui.json +1 -0
- package/mobile/src/components/Recommendation/Recommendation.ui.json +11 -0
- package/mobile/src/components/SafeDepositRental/RegionsAndBranches.tsx +4 -4
- package/mobile/src/components/SafeDepositRental/SafeDepositRental.tsx +1 -1
- package/mobile/src/components/SafeDepositRental/SafeDepositRental.ui.json +1 -0
- package/mobile/src/components/SafeDepositRental/SafeDepositRentalTotal.tsx +2 -2
- package/mobile/src/components/SafeDepositRental/WrapperSelect.tsx +15 -20
- package/mobile/src/components/StepsBlock/StepsBlock.ui.json +11 -0
- package/mobile/src/components/Tabs/Tabs.tsx +25 -3
- package/mobile/src/components/Tabs/Tabs.ui.json +1 -0
- package/mobile/src/components/Tabs/TabsContent.ts +2 -0
- package/mobile/src/components/Tabs/renderLinkTab.tsx +28 -12
- package/mobile/src/components/Tabs/renderTab.tsx +13 -2
- package/mobile/src/components/TariffsTable/TariffsTable.ui.json +33 -0
- package/mobile/src/components/TextBlock/TextBlock.ui.json +1 -0
- package/mobile/src/components/Tile/Tile.ui.json +1 -0
- package/mobile/src/react/IntersectionObserverTag.tsx +10 -3
- package/mobile/src/ui-kit/BlockWrapper.tsx +45 -18
- package/mobile/src/ui-kit/CurrencyInput/CurrencyInput.tsx +21 -36
- package/mobile/src/ui-kit/CurrencyInput/CurrencyInputProps.ts +3 -7
- package/mobile/src/ui-kit/CurrencyInput/adjustValue .ts +17 -0
- package/mobile/src/ui-kit/Input/Input.tsx +37 -16
- package/mobile/src/ui-kit/Input/InputProps.ts +6 -3
- package/mobile/src/ui-kit/Select/Select.tsx +86 -20
- package/mobile/src/utils/changeHashOnObserve.ts +30 -10
- package/package.json +6 -3
- package/src/EventBus/EventMap.ts +3 -1
- package/src/components/Accordion/Accordion.ui.json +79 -0
- package/src/components/BenefitsBlock/BenefitsBlock.ui.json +16 -0
- package/src/components/Bonus/Bonus.example.json +5 -2
- package/src/components/Bonus/Bonus.fixture.tsx +37 -6
- package/src/components/Bonus/Bonus.tsx +44 -16
- package/src/components/Bonus/Bonus.ui.json +16 -0
- package/src/components/Bonus/BonusContent.ts +33 -2
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.example.json +1 -1
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.ui.json +11 -0
- package/src/components/Calculator/Calculator.example.json +2 -1
- package/src/components/Calculator/Calculator.ui.json +31 -0
- package/src/components/CardTransfer/CardTransfer.example.json +7 -2
- package/src/components/CardTransfer/CardTransfer.fixture.tsx +9 -1
- package/src/components/CardTransfer/CardTransfer.tsx +22 -23
- package/src/components/CardTransfer/CardTransfer.ui.json +1 -0
- package/src/components/CardTransfer/CardTransferContent.ts +2 -2
- package/src/components/Catalog/Catalog.ui.json +1 -0
- package/src/components/ComparisonTable/ComparisonTable.ui.json +1 -0
- package/src/components/ComparisonTable/TableColumn.tsx +17 -11
- package/src/components/ContentPage/ContentPage.page.json +15 -1
- package/src/components/ErrorBlock/ErrorBlock.ui.json +12 -0
- package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +4 -3
- package/src/components/ExchangeRateTile/ExchangeRateTile.ui.json +1 -0
- package/src/components/ExchangeRateTile/renderInput.tsx +3 -3
- package/src/components/Footer/Footer.ui.json +11 -0
- package/src/components/Gallery/Gallery.ui.json +1 -0
- package/src/components/GracePeriod/GracePeriod.fixture.tsx +5 -5
- package/src/components/GracePeriod/GracePeriod.tsx +5 -4
- package/src/components/GracePeriod/GracePeriod.ui.json +15 -0
- package/src/components/GracePeriod/GracePeriodContent.ts +1 -1
- package/src/components/Header/Header.ui.json +11 -0
- package/src/components/Headline/Headline.ui.json +1 -0
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlock.ui.json +15 -0
- package/src/components/LinkDocs/LinkDocs.ui.json +1 -0
- package/src/components/LinkList/LinkList.ui.json +1 -0
- package/src/components/MiniGallery/MiniGallery.ui.json +1 -0
- package/src/components/MobileAppTile/MobileAppTile.tsx +2 -2
- package/src/components/MobileAppTile/MobileAppTile.ui.json +7 -0
- package/src/components/OfficeServicesBlock/OfficeServicesBlock.ui.json +11 -0
- package/src/components/OtherProducts/OtherProducts.ui.json +76 -0
- package/src/components/PictureText/PictureText.ui.json +1 -0
- package/src/components/Placeholder/Placeholder.ui.json +1 -0
- package/src/components/ProductBlock/ProductBlock.ui.json +12 -0
- package/src/components/ProductGallery/ProductGallery.ui.json +30 -0
- package/src/components/ProductTile/ProductTile.ui.json +1 -0
- package/src/components/PromoTile/PromoTile.ui.json +1 -0
- package/src/components/Recommendation/Recommendation.ui.json +11 -0
- package/src/components/SafeDepositRental/RegionsAndBranches.tsx +4 -4
- package/src/components/SafeDepositRental/SafeDepositRental.tsx +1 -1
- package/src/components/SafeDepositRental/SafeDepositRental.ui.json +1 -0
- package/src/components/SafeDepositRental/SafeDepositRentalTotal.tsx +2 -2
- package/src/components/SafeDepositRental/WrapperSelect.tsx +15 -20
- package/src/components/StepsBlock/StepsBlock.ui.json +11 -0
- package/src/components/Tabs/Tabs.tsx +25 -3
- package/src/components/Tabs/Tabs.ui.json +1 -0
- package/src/components/Tabs/TabsContent.ts +2 -0
- package/src/components/Tabs/renderLinkTab.tsx +28 -12
- package/src/components/Tabs/renderTab.tsx +13 -2
- package/src/components/TariffsTable/TariffsTable.ui.json +33 -0
- package/src/components/TextBlock/TextBlock.ui.json +1 -0
- package/src/components/Tile/Tile.ui.json +1 -0
- package/src/react/IntersectionObserverTag.tsx +10 -3
- package/src/ui-kit/BlockWrapper.tsx +45 -18
- package/src/ui-kit/CurrencyInput/CurrencyInput.tsx +21 -36
- package/src/ui-kit/CurrencyInput/CurrencyInputProps.ts +3 -7
- package/src/ui-kit/CurrencyInput/adjustValue .ts +17 -0
- package/src/ui-kit/Input/Input.tsx +37 -16
- package/src/ui-kit/Input/InputProps.ts +6 -3
- package/src/ui-kit/{SelectCustom/SelectCustom.fixture.tsx → Select/Select.fixture.tsx} +2 -2
- package/src/ui-kit/Select/Select.tsx +86 -20
- package/src/utils/changeHashOnObserve.ts +30 -10
- package/bin/migration-scripts/0.4.5.spec.ts +0 -352
- package/dist/components/ExchangeRateTile/renderButton.d.ts +0 -3
- package/dist/components/ExchangeRateTile/renderButton.js +0 -9
- package/dist/components/ExchangeRateTile/renderButton.js.map +0 -1
- package/dist/ui-kit/Select/SelectOption.d.ts +0 -7
- package/dist/ui-kit/Select/SelectOption.js +0 -8
- package/dist/ui-kit/Select/SelectOption.js.map +0 -1
- package/dist/ui-kit/SelectCustom/SelectCustom.d.ts +0 -13
- package/dist/ui-kit/SelectCustom/SelectCustom.js +0 -30
- package/dist/ui-kit/SelectCustom/SelectCustom.js.map +0 -1
- package/lib/components/ExchangeRateTile/renderButton.d.ts +0 -3
- package/lib/components/ExchangeRateTile/renderButton.js +0 -6
- package/lib/components/ExchangeRateTile/renderButton.js.map +0 -1
- package/lib/ui-kit/Select/SelectOption.d.ts +0 -7
- package/lib/ui-kit/Select/SelectOption.js +0 -6
- package/lib/ui-kit/Select/SelectOption.js.map +0 -1
- package/lib/ui-kit/SelectCustom/SelectCustom.d.ts +0 -13
- package/lib/ui-kit/SelectCustom/SelectCustom.js +0 -28
- package/lib/ui-kit/SelectCustom/SelectCustom.js.map +0 -1
- package/mobile/dist/components/ExchangeRateTile/renderButton.d.ts +0 -3
- package/mobile/dist/components/ExchangeRateTile/renderButton.js +0 -9
- package/mobile/dist/components/ExchangeRateTile/renderButton.js.map +0 -1
- package/mobile/dist/ui-kit/Select/SelectOption.d.ts +0 -7
- package/mobile/dist/ui-kit/Select/SelectOption.js +0 -8
- package/mobile/dist/ui-kit/Select/SelectOption.js.map +0 -1
- package/mobile/dist/ui-kit/SelectCustom/SelectCustom.d.ts +0 -13
- package/mobile/dist/ui-kit/SelectCustom/SelectCustom.js +0 -30
- package/mobile/dist/ui-kit/SelectCustom/SelectCustom.js.map +0 -1
- package/mobile/lib/components/ExchangeRateTile/renderButton.d.ts +0 -3
- package/mobile/lib/components/ExchangeRateTile/renderButton.js +0 -6
- package/mobile/lib/components/ExchangeRateTile/renderButton.js.map +0 -1
- package/mobile/lib/ui-kit/Select/SelectOption.d.ts +0 -7
- package/mobile/lib/ui-kit/Select/SelectOption.js +0 -6
- package/mobile/lib/ui-kit/Select/SelectOption.js.map +0 -1
- package/mobile/lib/ui-kit/SelectCustom/SelectCustom.d.ts +0 -13
- package/mobile/lib/ui-kit/SelectCustom/SelectCustom.js +0 -28
- package/mobile/lib/ui-kit/SelectCustom/SelectCustom.js.map +0 -1
- package/mobile/src/components/Blocks.spec.tsx +0 -66
- package/mobile/src/components/ContentPage/computeAPIFallback.spec.ts +0 -63
- package/mobile/src/components/ContentPage/normalizeBlock.spec.ts +0 -50
- package/mobile/src/components/ExchangeRateTile/renderButton.tsx +0 -10
- package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +0 -1206
- package/mobile/src/content-page-repository/mapJSON.spec.ts +0 -28
- package/mobile/src/services/sitemap/checkIsHrefSameOrigin.spec.ts +0 -20
- package/mobile/src/services/sitemap/isTopItemActive.spec.ts +0 -60
- package/mobile/src/services/sitemap/mergeTopItems.spec.ts +0 -20
- package/mobile/src/ui-kit/Select/SelectOption.tsx +0 -18
- package/mobile/src/ui-kit/SelectCustom/SelectCustom.tsx +0 -91
- package/mobile/src/ui-kit/SwipeListControl/utils/getIndexParts.spec.ts +0 -19
- package/mobile/src/ui-kit/SwipeListControl/utils/getScrollPoints.spec.ts +0 -42
- package/mobile/src/utils/adjustHref.spec.ts +0 -25
- package/mobile/src/utils/maxBy.spec.ts +0 -11
- package/mobile/src/utils/url.spec.ts +0 -17
- package/src/components/Blocks.spec.tsx +0 -66
- package/src/components/ContentPage/computeAPIFallback.spec.ts +0 -63
- package/src/components/ContentPage/normalizeBlock.mobile.spec.ts +0 -71
- package/src/components/ContentPage/normalizeBlock.spec.ts +0 -50
- package/src/components/ExchangeRateTile/renderButton.tsx +0 -10
- package/src/components/__snapshots__/Blocks.spec.tsx.snap +0 -1206
- package/src/content-page-repository/mapJSON.spec.ts +0 -28
- package/src/services/sitemap/checkIsHrefSameOrigin.spec.ts +0 -20
- package/src/services/sitemap/isTopItemActive.spec.ts +0 -60
- package/src/services/sitemap/mergeTopItems.spec.ts +0 -20
- package/src/ui-kit/Select/SelectOption.tsx +0 -18
- package/src/ui-kit/SelectCustom/SelectCustom.tsx +0 -91
- package/src/ui-kit/SwipeListControl/utils/getIndexParts.spec.ts +0 -19
- package/src/ui-kit/SwipeListControl/utils/getScrollPoints.spec.ts +0 -42
- package/src/utils/adjustHref.spec.ts +0 -25
- package/src/utils/maxBy.spec.ts +0 -11
- package/src/utils/url.spec.ts +0 -17
package/bundle/bundle.umd.js
CHANGED
|
@@ -255,34 +255,65 @@
|
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
const changeHashOnObserve = (entries) => {
|
|
259
|
-
if (!entries
|
|
258
|
+
const changeHashOnObserve = ({ anchor, anchorClickRef }) => (entries) => {
|
|
259
|
+
if (!entries?.length) {
|
|
260
260
|
return;
|
|
261
261
|
}
|
|
262
262
|
const [entry] = entries;
|
|
263
|
-
if (entry.isIntersecting)
|
|
263
|
+
if (!entry.isIntersecting || entry.boundingClientRect.top > 150) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (anchorClickRef?.current?.isScrolling && anchorClickRef.current.label === `#${anchor}`) {
|
|
267
|
+
EventBus.inst.fire('anchorClick', { isScrolling: false, label: undefined });
|
|
268
|
+
EventBus.inst.fire('tab', { type: 'link', label: anchor });
|
|
269
|
+
}
|
|
270
|
+
else if (!anchorClickRef?.current?.isScrolling) {
|
|
271
|
+
EventBus.inst.fire('tab', { type: 'link', label: anchor });
|
|
272
|
+
}
|
|
264
273
|
};
|
|
265
274
|
|
|
275
|
+
const THRESHOLD_ACCURACY = 100; // Decimals number (100 is for two decimals number, 0.**)
|
|
276
|
+
const THRESHOLD_ARRAY_LENGTH = 18;
|
|
277
|
+
const THRESHOLD_ARRAY_START_VALUE = (THRESHOLD_ACCURACY - THRESHOLD_ARRAY_LENGTH) / THRESHOLD_ACCURACY;
|
|
266
278
|
const BlockWrapper = JSX(({ anchor, className, context, children, tag = 'section', labels }) => {
|
|
267
279
|
const Tag = tag;
|
|
268
280
|
const { IntersectionObserverTag } = context;
|
|
269
281
|
const [shouldRenderBlock, setShouldRenderBlock] = useState(true);
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
282
|
+
const anchorClickRef = useRef({});
|
|
283
|
+
const observerCallback = useMemo(() => changeHashOnObserve({ anchor, anchorClickRef }), [anchor, anchorClickRef]);
|
|
284
|
+
useEffect(() => {
|
|
285
|
+
const anchorClickCleanup = EventBus.inst.subscribe('anchorClick', (e) => {
|
|
286
|
+
anchorClickRef.current = e;
|
|
287
|
+
});
|
|
288
|
+
const tabCleanup = EventBus.inst.subscribe('tab', (event) => {
|
|
289
|
+
if (event.type === 'group') {
|
|
290
|
+
setShouldRenderBlock(!labels?.length || !event.label || labels.includes(event.label));
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
changeHash(event.label);
|
|
294
|
+
setShouldRenderBlock(true);
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
return () => {
|
|
298
|
+
anchorClickCleanup();
|
|
299
|
+
tabCleanup();
|
|
300
|
+
};
|
|
301
|
+
}, [anchorClickRef]);
|
|
279
302
|
if (!shouldRenderBlock) {
|
|
280
303
|
return null;
|
|
281
304
|
}
|
|
282
|
-
return anchor ? (jsx(IntersectionObserverTag, { tag: tag, className: className, observerCallback:
|
|
305
|
+
return anchor ? (jsx(IntersectionObserverTag, { tag: tag, className: className, observerCallback: observerCallback, observerOptions: {
|
|
306
|
+
threshold: new Array(THRESHOLD_ARRAY_LENGTH).fill(0).map(getIntersectionThreshold),
|
|
307
|
+
}, anchor: anchor, children: children })) : (jsx(Tag, { className: className, children: children }));
|
|
283
308
|
});
|
|
284
|
-
function
|
|
285
|
-
|
|
309
|
+
function getIntersectionThreshold(_, i) {
|
|
310
|
+
const value = (i + 1) / THRESHOLD_ACCURACY + THRESHOLD_ARRAY_START_VALUE;
|
|
311
|
+
return Math.round(value * THRESHOLD_ACCURACY) / THRESHOLD_ACCURACY;
|
|
312
|
+
}
|
|
313
|
+
function changeHash(label) {
|
|
314
|
+
if (label) {
|
|
315
|
+
globalThis.document.location.hash = label;
|
|
316
|
+
}
|
|
286
317
|
}
|
|
287
318
|
|
|
288
319
|
const HEADING_STYLE_MAP = {
|
|
@@ -1255,12 +1286,19 @@
|
|
|
1255
1286
|
|
|
1256
1287
|
const Bonus = JSX((props) => {
|
|
1257
1288
|
const { context, className = '', title, description, bonusItems, ...rest } = props;
|
|
1258
|
-
return (jsx(BlockWrapper, { className: `font-sans bg-white p-[50px] pb-9 ${className}`, context: context, ...rest, children: jsxs("div", { className: "container", children: [jsx(Headline, { context: context, className: "!p-0", title: title, description: description, headlineVersion: "M", align: "center" }), jsx("div", { className: "flex flex-wrap w-full mt-9", children: bonusItems
|
|
1289
|
+
return (jsx(BlockWrapper, { className: `font-sans bg-white p-[50px] pb-9 ${className}`, context: context, ...rest, children: jsxs("div", { className: "container", children: [jsx(Headline, { context: context, className: "!p-0", title: title, description: description, headlineVersion: "M", align: "center" }), jsx("div", { className: "flex flex-wrap w-full mt-9", children: bonusItems?.length
|
|
1259
1290
|
? bonusItems.map((_, i) => {
|
|
1260
|
-
return (jsx("div", { className: "flex-grow w-[49%] border border-gray pl-9 pt-9 pr-6 pb-6 mb-
|
|
1291
|
+
return (jsx("div", { className: "flex-grow w-[49%] border border-gray pl-9 pt-9 pr-6 pb-6 mb-3 mx-2 even:mr-0 odd:ml-0 last:odd:mx-0", children: jsxs("div", { className: "flex justify-between w-full", children: [jsxs("div", { className: "flex flex-col justify-between mr-4", children: [jsxs("div", { children: [jsx("div", { className: "text-h4", children: _.title }), jsx("div", { className: "text-xl-light mt-2 max-w-[488px]", children: _.description })] }), _?.buttons?.length ? (jsx(ButtonSection, { context: context, buttons: _?.buttons })) : null] }), _.bonusItemContent?.bonusType
|
|
1292
|
+
? renderBonusItemContent(_.bonusItemContent)
|
|
1293
|
+
: null] }) }, String(i)));
|
|
1261
1294
|
})
|
|
1262
1295
|
: null })] }) }));
|
|
1263
1296
|
});
|
|
1297
|
+
const renderBonusItemContent = (bonusItemContent) => (jsx("div", { children: bonusItemContent.bonusType === 'count'
|
|
1298
|
+
? renderBonusCount(bonusItemContent)
|
|
1299
|
+
: renderBonusImage(bonusItemContent) }));
|
|
1300
|
+
const renderBonusCount = (_) => (jsxs("div", { className: "relative -bottom-3 h-auto flex items-end mt-14 shrink-0", children: [_.bonusCount ? (jsx("span", { className: "font-mohave -tracking-[5px] text-title-extra bg-clip-text text-transparent bg-green-to-yellow -mb-7", children: _.bonusCount })) : null, _.bonusName ? (jsx("span", { className: "text-h2 bg-clip-text text-transparent bg-green-to-yellow", children: _.bonusName })) : null] }));
|
|
1301
|
+
const renderBonusImage = (_) => _.image ? (jsx(Img, { className: `w-[50px] h-[50px] min-w-[50px] p-3 rounded-full`, image: _.image })) : null;
|
|
1264
1302
|
|
|
1265
1303
|
function getElementsColsValue(className = '') {
|
|
1266
1304
|
const colSpan = getColSpan(className);
|
|
@@ -1696,33 +1734,55 @@
|
|
|
1696
1734
|
})) }) }), jsx("div", { className: "w-full h-2 bg-primary-main" })] }));
|
|
1697
1735
|
}
|
|
1698
1736
|
|
|
1699
|
-
const
|
|
1700
|
-
|
|
1737
|
+
const adjustValue = (val) => onlyOneDot(setZeroStart(replaceCommaToDot(val)));
|
|
1738
|
+
const onlyOneDot = (val) => {
|
|
1739
|
+
const matches = val.match(/\./g) || [];
|
|
1740
|
+
return matches.length > 1 ? val.slice(0, val.lastIndexOf('.')) : val;
|
|
1741
|
+
};
|
|
1742
|
+
const setZeroStart = (val) => {
|
|
1743
|
+
const isZeroStart = val.indexOf('0') === 0 && val.length === 2;
|
|
1744
|
+
const newVal = isZeroStart ? val.replace('0', '0.') : val;
|
|
1745
|
+
return newVal.startsWith('.') ? newVal.replace('.', '0.') : newVal;
|
|
1746
|
+
};
|
|
1747
|
+
const replaceCommaToDot = (val) => String(val.replace(',', '.').replace(/[^.\d]/g, ''));
|
|
1748
|
+
|
|
1749
|
+
const Input = JSX(({ className = '', inputClassName = '', id, name, type = 'text', label, value = '', children, onChange, ...inputProps }) => {
|
|
1750
|
+
const handleChange = useCallback((e) => {
|
|
1751
|
+
const validInputValue = e.target.validity.valid ? e.target.value : value;
|
|
1752
|
+
onChange(validInputValue);
|
|
1753
|
+
}, [onChange]);
|
|
1754
|
+
const paddingStyle = children ? 'pr-8' : '';
|
|
1755
|
+
return (jsxs("div", { className: `relative ${className}`, children: [label ? jsx("label", { className: "block text-m-light mb-2", children: label }) : null, jsx("input", { className: `w-full border rounded-md border-main-stroke hover:border-primary-hover active:border-primary-text
|
|
1756
|
+
focus:border-primary-text text-primary-text outline-none p-4 ${paddingStyle} ${inputClassName}`, id: id, name: name || id, type: type, value: value, onChange: handleChange, ...inputProps }), children] }));
|
|
1757
|
+
});
|
|
1758
|
+
|
|
1759
|
+
const CurrencyInput = JSX(({ className = '', onChange, minValue = 0, maxValue = 300000, ...inputProps }) => {
|
|
1760
|
+
const handleChange = useCallback((inputValue) => {
|
|
1701
1761
|
if (!onChange) {
|
|
1702
1762
|
return;
|
|
1703
1763
|
}
|
|
1704
|
-
const
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1764
|
+
const adjustedVal = adjustValue(inputValue);
|
|
1765
|
+
const clampVal = getClampValue(adjustedVal, clamp(Number(adjustedVal), minValue, maxValue));
|
|
1766
|
+
onChange(String(clampVal));
|
|
1767
|
+
}, [onChange]);
|
|
1768
|
+
return (jsx(Input, { className: className, inputClassName: "w-full", onChange: handleChange, ...inputProps, children: jsx("span", { className: "text-xl-light absolute right-4 bottom-4", children: "\u20BD" }) }));
|
|
1708
1769
|
});
|
|
1770
|
+
const getClampValue = (val, clampVal) => Number(val) === clampVal ? val : String(clampVal);
|
|
1709
1771
|
|
|
1710
1772
|
const AMOUNT_KEY = 'amount';
|
|
1711
1773
|
const FORM_URL = 'https://www.rshb.ru/p2p/';
|
|
1712
1774
|
const DEFAULT_TITLE = 'Укажите сумму перевода';
|
|
1713
1775
|
const DEFAULT_LABEL = 'Сумма перевода';
|
|
1714
1776
|
const DEFAULT_PLACEHOLDER = '1500';
|
|
1715
|
-
const
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
className: 'w-full h-[56px] px-9 mt-6',
|
|
1719
|
-
};
|
|
1720
|
-
const CardTransfer = JSX(({ className = '', title = DEFAULT_TITLE, label = DEFAULT_LABEL, placeholder = DEFAULT_PLACEHOLDER, buttonText = DEFAULT_BUTTON_TEXT, ...rest }) => {
|
|
1777
|
+
const CardTransfer = JSX(({ className = '', title = DEFAULT_TITLE, label = DEFAULT_LABEL, placeholder = DEFAULT_PLACEHOLDER, button, context, ...rest }) => {
|
|
1778
|
+
const router = context.useRouter();
|
|
1779
|
+
const { handlerDecorator } = context;
|
|
1721
1780
|
const [value, setValue] = useState('');
|
|
1722
1781
|
const isDisabled = !Number(value);
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1782
|
+
const buttonStyle = isDisabled
|
|
1783
|
+
? getDisabledButtonClasses({ version: button?.version })
|
|
1784
|
+
: getRegularButtonClasses({ className: 'text-white', version: button?.version });
|
|
1785
|
+
return (jsxs(BlockWrapper, { className: `p-[50px] flex flex-col items-center font-sans bg-white ${className}`, context: context, ...rest, children: [title ? jsx(Heading, { className: "max-w-[684px] pb-9", headingType: "h2", title: title }) : null, jsxs("form", { className: "w-[468px]", method: "POST", action: FORM_URL, children: [jsx(CurrencyInput, { name: AMOUNT_KEY, value: value, onChange: setValue, placeholder: placeholder, label: label }), button?.text ? (jsx("button", { type: "submit", className: `w-full p-4 mt-6 ${buttonStyle} `, disabled: isDisabled, ...useLink({ router, handlerDecorator }, button), children: button.text })) : null] })] }));
|
|
1726
1786
|
});
|
|
1727
1787
|
|
|
1728
1788
|
const iconVersionMap = {
|
|
@@ -1972,38 +2032,7 @@
|
|
|
1972
2032
|
|
|
1973
2033
|
const CurrentLocation = JSX(({ className = '', address, distance }) => (jsxs("div", { className: `flex ${className}`, children: [jsx(Img, { image: { icon: 'GpsIcon' }, width: "24", height: "24", asSVG: true }), jsxs("div", { className: "ml-3", children: [address ? jsx("p", { className: "text-primary-main m-0 mb-1 text-l", children: address }) : null, distance ? (jsxs("p", { className: "text-secondary-text m-0 text-m-light", 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] })] })));
|
|
1974
2034
|
|
|
1975
|
-
const
|
|
1976
|
-
const result = Number(formatValue(value)) * Math.pow(rate, precision ? -1 : 1);
|
|
1977
|
-
return Number.isInteger(result) ? result : roundTo(result);
|
|
1978
|
-
};
|
|
1979
|
-
const formatValue = (value) => value.replace(/[^\d.,]/g, '').replace(',', '.');
|
|
1980
|
-
|
|
1981
|
-
const tableFunc = (table) => (input) => {
|
|
1982
|
-
const [, output] = table.find(([predicate]) => predicate(input)) || [];
|
|
1983
|
-
return output;
|
|
1984
|
-
};
|
|
1985
|
-
|
|
1986
|
-
const callbackCurrencySelect = (props) => tableFunc([
|
|
1987
|
-
[
|
|
1988
|
-
(_) => _.value !== Currency.RUB && _.oppositeValue !== Currency.RUB,
|
|
1989
|
-
() => props.handleConvert(props.value, Currency.RUB),
|
|
1990
|
-
],
|
|
1991
|
-
[
|
|
1992
|
-
(_) => _.value === Currency.RUB && _.oppositeValue === Currency.RUB,
|
|
1993
|
-
() => props.handleConvert(props.value, Currency.USD),
|
|
1994
|
-
],
|
|
1995
|
-
[() => true, () => props.handleConvert(props.value)],
|
|
1996
|
-
])(props)?.();
|
|
1997
|
-
|
|
1998
|
-
const Input = JSX(({ className = '', id, name, type = 'text', placeholder, pattern, value, onChange }) => {
|
|
1999
|
-
const handleChange = (e) => {
|
|
2000
|
-
const validInputValue = e.target.validity.valid ? e.target.value : value;
|
|
2001
|
-
onChange(validInputValue);
|
|
2002
|
-
};
|
|
2003
|
-
return (jsx("input", { className: `border rounded-md border-main-stroke hover:border-primary-hover active:border-primary-text focus:border-primary-text text-primary-text outline-none ${className}`, id: id, name: name || id, type: type, pattern: pattern, placeholder: placeholder, value: value, onChange: handleChange }));
|
|
2004
|
-
});
|
|
2005
|
-
|
|
2006
|
-
const SelectCustom = JSX(({ className = '', isBorder = true, label, options = [], value, onChange }) => {
|
|
2035
|
+
const Select = JSX(({ className = '', isBorder = true, label, options = [], value, onChange, placeholder = '' }) => {
|
|
2007
2036
|
const [selectedItem, setSelectedItem] = useState(options[0] || { key: '', text: '' });
|
|
2008
2037
|
const [isOpen, setIsOpen] = useState(false);
|
|
2009
2038
|
const choiceOption = (option) => {
|
|
@@ -2015,25 +2044,47 @@
|
|
|
2015
2044
|
useEffect(() => {
|
|
2016
2045
|
setSelectedItem(value || { key: '', text: '' });
|
|
2017
2046
|
}, [value]);
|
|
2018
|
-
return (jsxs("div", { className: `${
|
|
2019
|
-
${getBorderStyle(isBorder)}`, onClick: () => setIsOpen(!isOpen), children: [selectedItem
|
|
2047
|
+
return (jsxs("div", { className: `${className}`, children: [label ? jsx("span", { className: "mb-2 flex", children: label }) : null, jsxs("div", { className: `relative ${isOpen ? 'z-20' : 'z-10'}`, children: [jsxs("div", { className: `text-m-light flex justify-between items-center mb-0.5 text-primary-text cursor-pointer
|
|
2048
|
+
${getBorderStyle(isBorder)}`, onClick: () => setIsOpen(!isOpen), children: [jsx("p", { className: "p-4 pr-8 h-[56px] overflow-hidden text-ellipsis whitespace-nowrap", children: selectedItem?.text || placeholder }), jsx(Icon, { name: "ArrowUpIcon", width: "16", height: "16", className: `absolute right-3 ${isOpen ? '' : 'rotate-180'}` })] }), options?.length ? (jsx("div", { className: `h-0 ${renderOptionsStyle(isOpen)}`, children: jsx("div", { className: `bg-white text-l max-h-[256px] overflow-y-auto overflow-x-hidden rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]`, children: options.map(renderOption(choiceOption, isOpen, isSelected)) }) })) : null] })] }));
|
|
2020
2049
|
});
|
|
2050
|
+
const renderOptionsStyle = (isOpen) => (isOpen ? '' : 'overflow-hidden');
|
|
2021
2051
|
const renderOption = (choiceOption, isOpen, isSelected) => (option, i) => {
|
|
2022
2052
|
return (jsxs("div", { onClick: () => {
|
|
2023
2053
|
choiceOption(option);
|
|
2024
|
-
}, className: "flex px-4 py-3 cursor-pointer hover:bg-main-divider pr-11", children: [jsx("span", { children: option.text }), jsx(Icon, { name: "DoneSimpleIcon", width: "16", height: "16", className: ['absolute right-4 pt-0.5', isSelected(option) && isOpen ? '' : 'hidden'].join(' ') })] }, String(i)));
|
|
2054
|
+
}, className: "flex px-4 py-3 cursor-pointer hover:bg-main-divider pr-11 relative", children: [jsx("span", { className: "min-h-6", children: option.text }), jsx(Icon, { name: "DoneSimpleIcon", width: "16", height: "16", className: ['absolute right-4 pt-0.5', isSelected(option) && isOpen ? '' : 'hidden'].join(' ') })] }, String(i)));
|
|
2025
2055
|
};
|
|
2026
|
-
|
|
2027
|
-
return isBorder ? 'border border-main-stroke rounded-md hover:border-primary-hover' : '';
|
|
2028
|
-
}
|
|
2056
|
+
const getBorderStyle = (isBorder) => isBorder ? 'border border-main-stroke rounded-md hover:border-primary-hover' : '';
|
|
2029
2057
|
|
|
2030
2058
|
function renderInput(props) {
|
|
2031
2059
|
const { placeholder, rates, selected, value, setValue, setSelected } = props;
|
|
2032
2060
|
const ratesOptions = rates.map((_) => ({ key: _.code ?? '', text: _.code ?? '' }));
|
|
2033
2061
|
const selectedValue = { key: selected, text: selected };
|
|
2034
|
-
return (jsxs("div", { className: "relative flex", children: [jsx(Input, { className: "shrink-0 h-14 pl-4 pt-4 pb-4 text-l w-full appearance-none mr-[-90px]", placeholder: placeholder, type: "text", value: value, onChange: setValue }), ratesOptions.length ? (jsx(
|
|
2062
|
+
return (jsxs("div", { className: "relative flex", children: [jsx(Input, { className: "shrink-0 h-14 pl-4 pt-4 pb-4 text-l w-full appearance-none mr-[-90px]", placeholder: placeholder, type: "text", value: value, onChange: setValue }), ratesOptions.length ? (jsx(Select, { isBorder: false, onChange: (_) => setSelected(_.key), options: ratesOptions, value: selectedValue })) : null] }));
|
|
2035
2063
|
}
|
|
2036
2064
|
|
|
2065
|
+
const calculateResult = (value, rate, precision) => {
|
|
2066
|
+
const result = Number(formatValue(value)) * Math.pow(rate, precision ? -1 : 1);
|
|
2067
|
+
return Number.isInteger(result) ? result : roundTo(result);
|
|
2068
|
+
};
|
|
2069
|
+
const formatValue = (value) => value.replace(/[^\d.,]/g, '').replace(',', '.');
|
|
2070
|
+
|
|
2071
|
+
const tableFunc = (table) => (input) => {
|
|
2072
|
+
const [, output] = table.find(([predicate]) => predicate(input)) || [];
|
|
2073
|
+
return output;
|
|
2074
|
+
};
|
|
2075
|
+
|
|
2076
|
+
const callbackCurrencySelect = (props) => tableFunc([
|
|
2077
|
+
[
|
|
2078
|
+
(_) => _.value !== Currency.RUB && _.oppositeValue !== Currency.RUB,
|
|
2079
|
+
() => props.handleConvert(props.value, Currency.RUB),
|
|
2080
|
+
],
|
|
2081
|
+
[
|
|
2082
|
+
(_) => _.value === Currency.RUB && _.oppositeValue === Currency.RUB,
|
|
2083
|
+
() => props.handleConvert(props.value, Currency.USD),
|
|
2084
|
+
],
|
|
2085
|
+
[() => true, () => props.handleConvert(props.value)],
|
|
2086
|
+
])(props)?.();
|
|
2087
|
+
|
|
2037
2088
|
const ExchangeCurrencyCalculator = JSX(({ context, className = '', currencyRatesBuy, currencyRatesSell, button }) => {
|
|
2038
2089
|
const { useRouter, handlerDecorator } = context;
|
|
2039
2090
|
const router = useRouter();
|
|
@@ -2292,10 +2343,10 @@
|
|
|
2292
2343
|
..._,
|
|
2293
2344
|
flexBasis: `${_.month.length * colSize}%`,
|
|
2294
2345
|
}));
|
|
2295
|
-
return (jsxs("div", { className: "w-full flex flex-col justify-center mt-
|
|
2346
|
+
return (jsxs("div", { className: "w-full flex flex-col justify-center mt-13", children: [jsx("div", { className: "flex w-full mb-3 text-h6 text-center", children: mappedCalendar.map((_) => renderMonthNames(_, colSize)) }), jsx("div", { className: "flex w-full", children: mappedCalendar.map((_, ind) => (jsxs("div", { className: "pr-[11px] mr-3 border-r border-main-divider last:border-r-0 last:pr-0 last:mr-0", style: { flexBasis: _.flexBasis }, children: [jsx("div", { className: "flex", children: renderMonthImages(_) }), jsxs("div", { className: "text-s-light text-primary-text mt-3", children: [jsx("span", { children: _.text }), "\u2009", jsx("span", { className: "text-primary-main", children: _.greenText })] })] }, `monthItem-${ind}`))) })] }));
|
|
2296
2347
|
};
|
|
2297
|
-
const renderMonthNames = (item, colSize) => item.month
|
|
2298
|
-
const renderMonthImages = (item) => item.month
|
|
2348
|
+
const renderMonthNames = (item, colSize) => item.month?.map((_, i) => (jsx("div", { style: { flexBasis: `${colSize}%` }, children: _.name }, `monthName-${i}`)));
|
|
2349
|
+
const renderMonthImages = (item) => item.month?.map((_) => _.image?.src ? (jsx("div", { className: "h-[207px] border-r-[1px] pr-3 mr-3 border-main-divider last:border-r-0 last:pr-0 last:mr-0", children: jsx(Img, { image: _.image, className: "flex" }) }, `monthImage-${_.image.src}`)) : null);
|
|
2299
2350
|
|
|
2300
2351
|
const checkIsHrefSameOrigin = (href, router) => getOrigin(href) === getOrigin(router.href);
|
|
2301
2352
|
|
|
@@ -2530,8 +2581,8 @@
|
|
|
2530
2581
|
return (jsxs(BlockWrapper, { context: context, className: `flex justify-between font-sans p-9 box-border relative min-h-[320px]
|
|
2531
2582
|
${getTileMinHeight(className)}
|
|
2532
2583
|
${VersionStyleMap[version]}
|
|
2533
|
-
${className}`, ...rest, children: [jsx(BaseTile, { context: context, className: "z-
|
|
2534
|
-
${textColorClass}` })) : null, buttons: buttons?.length ? (jsx(ButtonSection, { context: context, buttons: buttonsWithClass, className: "flex gap-4" })) : null, children: jsxs("div", { className: "flex flex-1 items-center", children: [qr?.src ? (jsx("div", { className: `flex justify-center mr-5 bg-white rounded-md ${containerStyle}`, children: jsx(Img, { className: "w-fit", image: qr }) })) : null, renderList(version, items)] }) }), image?.src ? (jsx("div", { className: "absolute right-0 bottom-0", children: jsx(Img, { image: image }) })) : null] }));
|
|
2584
|
+
${className}`, ...rest, children: [jsx(BaseTile, { context: context, className: "z-10", title: title ? (jsx(Heading, { headingType: headingType, as: "h3", title: title, className: `whitespace-pre-wrap max-w-[509px] mb-6
|
|
2585
|
+
${textColorClass}` })) : null, buttons: buttons?.length ? (jsx(ButtonSection, { context: context, buttons: buttonsWithClass, className: "flex gap-4" })) : null, children: jsxs("div", { className: "flex flex-1 items-center", children: [qr?.src ? (jsx("div", { className: `flex justify-center mr-5 bg-white rounded-md ${containerStyle}`, children: jsx(Img, { className: "w-fit", image: qr, alt: "QR-\u043A\u043E\u0434" }) })) : null, renderList(version, items)] }) }), image?.src ? (jsx("div", { className: "absolute right-0 bottom-0", children: jsx(Img, { image: image }) })) : null] }));
|
|
2535
2586
|
});
|
|
2536
2587
|
const renderList = (version, items) => {
|
|
2537
2588
|
return items?.length ? (jsx(List, { items: items, itemClassName: "text-l-light mb-2 last:mb-0", version: version === 'primary' ? 'tile' : 'tile-white' })) : (jsx("span", { className: "text-m-light text-secondary-text", children: "\u041D\u0430\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u0430\u043C\u0435\u0440\u0443 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 \u043D\u0430 QR-\u043A\u043E\u0434 \u0438 \u0441\u043A\u0430\u0447\u0430\u0439\u0442\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435" }));
|
|
@@ -2718,23 +2769,16 @@
|
|
|
2718
2769
|
return fetchJSON(url, { method: 'GET' });
|
|
2719
2770
|
};
|
|
2720
2771
|
|
|
2721
|
-
const
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
const SelectOption = JSX(({ className = '', value, selected, disabled = false, children }) => {
|
|
2729
|
-
return (jsx("option", { className: className, value: `${value}`, selected: selected, disabled: disabled, children: children }));
|
|
2730
|
-
});
|
|
2731
|
-
|
|
2732
|
-
const WrapperSelect = JSX(({ data, fieldLabel, fieldValue, selected, placeholder, setSelected, label }) => {
|
|
2733
|
-
return (jsxs("div", { children: [jsx("span", { className: "block text-m-light mb-2", children: label }), jsxs(Select, { className: `h-14 border border-gray p-4 rounded-md text-s w-full cursor-pointer ${!selected ? 'text-secondary-text' : ''}`, value: selected, onChange: (_) => setSelected(_), children: [placeholder ? jsx(SelectOption, { value: "", children: placeholder }) : null, data.map((_, i) => (jsx(SelectOption, { value: _?.[fieldValue || fieldLabel], children: _?.[fieldLabel] }, String(i))))] })] }));
|
|
2772
|
+
const WrapperSelect = JSX(({ data, fieldLabel, fieldValue, selected, placeholder = '', setSelected, label }) => {
|
|
2773
|
+
const dataFormat = data
|
|
2774
|
+
.filter(Boolean)
|
|
2775
|
+
.map((_) => ({ key: _?.[fieldValue || fieldLabel], text: _?.[fieldLabel] }));
|
|
2776
|
+
const selectedObj = dataFormat.find((_) => _.key === selected);
|
|
2777
|
+
return (jsx(Select, { options: dataFormat, label: label, placeholder: placeholder || selected, onChange: (_) => setSelected(_.key), value: selectedObj }));
|
|
2734
2778
|
});
|
|
2735
2779
|
|
|
2736
2780
|
const RegionsAndBranches = JSX(({ regions = [], selectedRegion, onSelectedRegion: onSelectedRegion, branches = [], selectedBranch, onSelectedBranch, }) => {
|
|
2737
|
-
return (jsxs("div", { className: "flex justify-between mb-6", children: [jsx("div", { className: "w-
|
|
2781
|
+
return (jsxs("div", { className: "flex justify-between gap-4 mb-6", children: [jsx("div", { className: "max-w-[396px] w-1/2", children: jsx(WrapperSelect, { data: regions, fieldValue: "code", fieldLabel: "name", selected: selectedRegion, setSelected: onSelectedRegion, label: "\u0420\u0435\u0433\u0438\u043E\u043D" }) }), jsx("div", { className: "max-w-[396px] w-1/2", children: jsx(WrapperSelect, { data: branches, fieldValue: "branchCode", fieldLabel: "address", selected: selectedBranch, setSelected: onSelectedBranch, label: "\u041E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435" }) })] }));
|
|
2738
2782
|
});
|
|
2739
2783
|
|
|
2740
2784
|
const Radio = JSX(({ name, text, value, checked, onChange, className }) => (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer", children: [jsx("input", { className: "appearance-none flex justify-center items-center shrink-0 w-5 h-5 border-2 border-primary-main\n rounded-full cursor-pointer after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main", type: "radio", value: value, name: name, checked: checked, onChange: onChange }), text ? jsx("span", { className: "font-sans ml-3 cursor-pointer", children: text }) : null] }) })));
|
|
@@ -2781,7 +2825,7 @@
|
|
|
2781
2825
|
return (jsxs("div", { className: "flex flex-col justify-between", children: [jsxs("div", { className: "flex", children: [renderTotal('Аренда за', days, 'mr-11'), renderTotal('Цена', price + ' ₽')] }), jsxs("div", { className: "bg-primary-main px-10 pt-10 pb-4 text-center", children: [jsx(Img, { image: { icon: 'PackA4Icon' }, width: "290", height: "257", asSVG: true }), jsxs("span", { className: "text-s-light text-white opacity-80 mt-2 inline-block", children: ["\u041D\u0430 \u0440\u0438\u0441\u0443\u043D\u043A\u0438 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0430 \u043F\u0430\u0447\u043A\u0430", jsx("br", {}), " \u043B\u0438\u0441\u0442\u043E\u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0430 \u04104"] })] })] }));
|
|
2782
2826
|
});
|
|
2783
2827
|
const renderTotal = (label, total, className = '') => {
|
|
2784
|
-
return (jsxs("div", { className: className, children: [jsx("
|
|
2828
|
+
return (jsxs("div", { className: className, children: [jsx("div", { className: "text-m-light text-secondary-text mb-1", children: label }), jsx("span", { className: "text-h3 text-primary-text", children: total })] }));
|
|
2785
2829
|
};
|
|
2786
2830
|
const calculatePrice = (days, tariffs) => {
|
|
2787
2831
|
const tariffType = getTariffType(days);
|
|
@@ -2952,7 +2996,7 @@
|
|
|
2952
2996
|
const toggleShowMap = () => {
|
|
2953
2997
|
setShowMap(!showMap);
|
|
2954
2998
|
};
|
|
2955
|
-
return (jsxs(BlockWrapper, { context: context, className: className, ...rest, children: [jsxs("div", { className: "bg-white px-8 py-12", children: [title ? (jsx(Heading, { title: title, headingType: "h3", as: "h2", className: "mb-2.5 text-center" })) : null, jsx(SafeDepositRentalForm, { regions: regions, setPoints: setPoints, toggleShowMap: toggleShowMap }), footnote ? jsx("p", { className: "text-s-light text-secondary-text", children: footnote }) : null] }), points.length && showMap ? jsx(YandexMap, { points: points }) : null] }));
|
|
2999
|
+
return (jsxs(BlockWrapper, { context: context, className: className, ...rest, children: [jsxs("div", { className: "font-sans bg-white px-8 py-12", children: [title ? (jsx(Heading, { title: title, headingType: "h3", as: "h2", className: "mb-2.5 text-center" })) : null, jsx(SafeDepositRentalForm, { regions: regions, setPoints: setPoints, toggleShowMap: toggleShowMap }), footnote ? jsx("p", { className: "text-s-light text-secondary-text", children: footnote }) : null] }), points.length && showMap ? jsx(YandexMap, { points: points }) : null] }));
|
|
2956
3000
|
});
|
|
2957
3001
|
|
|
2958
3002
|
const checkIsIconRenderable = (icon) => Boolean(icon?.icon || icon?.src);
|
|
@@ -3033,7 +3077,10 @@
|
|
|
3033
3077
|
const renderTitle = (title, active) => (jsx("h3", { className: `${TEXT_CLASSES} ${active ? ACTIVE_TEXT_CLASSES : INACTIVE_TEXT_CLASSES}`, children: title }));
|
|
3034
3078
|
const renderCount = (count, active) => (jsx("div", { className: `${BADGE_CLASSES} ${active ? ACTIVE_BADGE_CLASSES : INACTIVE_BADGE_CLASSES}`, children: count }));
|
|
3035
3079
|
|
|
3036
|
-
const renderLinkTab = ({ text, onClick, href, target = '_self', i }) =>
|
|
3080
|
+
const renderLinkTab = ({ text, currentTab, onClick, href, target = '_self', i, }) => {
|
|
3081
|
+
const active = currentTab?.type === 'link' && currentTab.href === href;
|
|
3082
|
+
return (jsx("a", { className: `${LINK_CLASSES} ${active ? ACTIVE_LINK_CLASSES : INACTIVE_LINK_CLASSES}`, target: target, href: href, onClick: onClick, children: jsx("span", { className: `${TEXT_CLASSES} ${active ? ACTIVE_TEXT_CLASSES : INACTIVE_TEXT_CLASSES}`, children: text }) }, String(i)));
|
|
3083
|
+
};
|
|
3037
3084
|
|
|
3038
3085
|
const renderTab = ({ onClick, currentTab, showCounter, page, context }) =>
|
|
3039
3086
|
// Linter doesn't understand that switch processes all cases
|
|
@@ -3048,19 +3095,37 @@
|
|
|
3048
3095
|
switch (type) {
|
|
3049
3096
|
case 'group':
|
|
3050
3097
|
return renderGroupTab({ onClick, currentTab, showCounter, page, context })(tab, i);
|
|
3051
|
-
case 'link':
|
|
3098
|
+
case 'link': {
|
|
3099
|
+
const link = useLink({ router, handlerDecorator }, tab);
|
|
3100
|
+
const linkClick = link.onClick;
|
|
3052
3101
|
return renderLinkTab({
|
|
3053
|
-
...
|
|
3102
|
+
...link,
|
|
3103
|
+
onClick: (ev) => {
|
|
3104
|
+
linkClick(ev);
|
|
3105
|
+
onClick(tab);
|
|
3106
|
+
EventBus.inst.fire('anchorClick', { isScrolling: true, label: tab.href });
|
|
3107
|
+
},
|
|
3108
|
+
currentTab,
|
|
3054
3109
|
i,
|
|
3055
3110
|
});
|
|
3111
|
+
}
|
|
3056
3112
|
default:
|
|
3057
3113
|
assertUnreachable(type);
|
|
3058
3114
|
}
|
|
3059
3115
|
};
|
|
3060
3116
|
|
|
3061
3117
|
const Tabs = JSX((props) => {
|
|
3062
|
-
const { context, className, tabs, page, showCounter } = props;
|
|
3118
|
+
const { context, className = '', tabs, page, showCounter, isSticky } = props;
|
|
3063
3119
|
const [currentTab, setCurrentTab] = useState(tabs ? tabs[0] : undefined);
|
|
3120
|
+
useEffect(() => EventBus.inst.subscribe('tab', (event) => {
|
|
3121
|
+
if (!tabs) {
|
|
3122
|
+
return;
|
|
3123
|
+
}
|
|
3124
|
+
const tab = tabs.find(checkTab(event));
|
|
3125
|
+
if (event.type === 'link' && tab) {
|
|
3126
|
+
setCurrentTab(tab);
|
|
3127
|
+
}
|
|
3128
|
+
}), [tabs]);
|
|
3064
3129
|
useEffect(() => {
|
|
3065
3130
|
if (currentTab?.type === 'group') {
|
|
3066
3131
|
return EventBus.inst.subject('tab', { label: currentTab.ref });
|
|
@@ -3070,11 +3135,12 @@
|
|
|
3070
3135
|
const handleClick = (selectedTab) => {
|
|
3071
3136
|
if (selectedTab?.type === 'group') {
|
|
3072
3137
|
EventBus.inst.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
|
|
3073
|
-
setCurrentTab(selectedTab);
|
|
3074
3138
|
}
|
|
3139
|
+
setCurrentTab(selectedTab);
|
|
3075
3140
|
};
|
|
3076
|
-
return (jsx(BlockWrapper, { context: context, className:
|
|
3141
|
+
return (jsx(BlockWrapper, { context: context, className: `${isSticky ? 'sticky top-1 z-20 ' : ''}box-border flex gap-x-1 ${className}`, role: "tablist", children: tabs?.map(renderTab({ onClick: handleClick, currentTab, page, showCounter, context })) }));
|
|
3077
3142
|
});
|
|
3143
|
+
const checkTab = (event) => (_) => _.type === 'link' && _.href === `#${event.label}`;
|
|
3078
3144
|
|
|
3079
3145
|
const DIVIDER_CLASSES = 'border-main-divider border border-t-0 border-x-0';
|
|
3080
3146
|
const FIRST_CELL_CLASSES = 'w-[354px] flex-shrink-0';
|