@redneckz/wildless-cms-uni-blocks 0.14.293 → 0.14.295
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.14.257.js +21 -0
- package/bin/migration-scripts/0.14.294.js +23 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +203 -156
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/CalculatorContent.d.ts +1 -8
- package/bundle/components/Calculator/EmbeddableCalcBlocks.d.ts +1 -3
- package/bundle/components/Calculator/constants.d.ts +0 -5
- package/bundle/components/CalculatorBonus/CalculatorBonus.d.ts +9 -0
- package/bundle/components/CalculatorBonus/CalculatorBonusContent.d.ts +12 -0
- package/bundle/components/Tabs/TabsContent.d.ts +1 -1
- package/bundle/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
- package/bundle/components/TabsLayout/renderTabsLayout.d.ts +11 -0
- package/bundle/ui-kit/Calculator/CalculatorLayout.d.ts +5 -0
- package/{mobile/dist/components → bundle/ui-kit}/Calculator/renderRate.d.ts +1 -1
- package/bundle/{components → ui-kit}/Calculator/renderWantedSumInput.d.ts +1 -1
- package/bundle/ui-kit/TabsControl/TabItem.d.ts +5 -4
- package/bundle/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
- package/bundle/ui-kit/TabsControl/renderTab.d.ts +3 -3
- package/bundle/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Blocks.mobile.js +2 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js +4 -4
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/CalculatorContent.d.ts +1 -8
- package/dist/components/Calculator/CreditCalculatorForm.js +4 -4
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.js +4 -4
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/EmbeddableCalcBlocks.d.ts +1 -3
- package/dist/components/Calculator/EmbeddableCalcBlocks.js +0 -2
- package/dist/components/Calculator/EmbeddableCalcBlocks.js.map +1 -1
- package/dist/components/Calculator/RefinancingCalculatorForm.js +4 -4
- package/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/constants.d.ts +0 -5
- package/dist/components/Calculator/constants.js +1 -16
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/CalculatorBonus/CalculatorBonus.d.ts +9 -0
- package/dist/components/CalculatorBonus/CalculatorBonus.js +46 -0
- package/dist/components/CalculatorBonus/CalculatorBonus.js.map +1 -0
- package/dist/components/CalculatorBonus/CalculatorBonusContent.d.ts +12 -0
- package/dist/components/CalculatorBonus/CalculatorBonusContent.js +2 -0
- package/dist/components/CalculatorBonus/CalculatorBonusContent.js.map +1 -0
- package/dist/components/CalculatorBonus/getBonus.js +25 -0
- package/dist/components/CalculatorBonus/getBonus.js.map +1 -0
- package/dist/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.js +13 -2
- package/dist/components/CalculatorBonus/getBonusCalculatorParams.js.map +1 -0
- package/dist/components/Tabs/TabsContent.d.ts +1 -1
- package/dist/components/Tabs/renderTabs.js +0 -2
- package/dist/components/Tabs/renderTabs.js.map +1 -1
- package/dist/components/TabsLayout/TabsLayout.js +39 -16
- package/dist/components/TabsLayout/TabsLayout.js.map +1 -1
- package/dist/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
- package/dist/components/TabsLayout/renderTabsLayout.d.ts +11 -0
- package/dist/components/TabsLayout/renderTabsLayout.js +19 -0
- package/dist/components/TabsLayout/renderTabsLayout.js.map +1 -0
- package/dist/ui-kit/Calculator/CalculatorLayout.d.ts +5 -0
- package/dist/ui-kit/Calculator/CalculatorLayout.js +9 -0
- package/dist/ui-kit/Calculator/CalculatorLayout.js.map +1 -0
- package/dist/{components → ui-kit}/Calculator/CalculatorValueBlock.js +1 -1
- package/dist/ui-kit/Calculator/CalculatorValueBlock.js.map +1 -0
- package/dist/{components → ui-kit}/Calculator/Rate.js +1 -1
- package/dist/ui-kit/Calculator/Rate.js.map +1 -0
- package/{mobile/dist/components → dist/ui-kit}/Calculator/renderFootnote.js +1 -1
- package/dist/ui-kit/Calculator/renderFootnote.js.map +1 -0
- package/dist/{components → ui-kit}/Calculator/renderRate.d.ts +1 -1
- package/{mobile/dist/components → dist/ui-kit}/Calculator/renderRate.js +1 -1
- package/dist/ui-kit/Calculator/renderRate.js.map +1 -0
- package/{lib/components → dist/ui-kit}/Calculator/renderWantedSumInput.d.ts +1 -1
- package/{mobile/dist/components → dist/ui-kit}/Calculator/renderWantedSumInput.js +1 -1
- package/dist/ui-kit/Calculator/renderWantedSumInput.js.map +1 -0
- package/dist/ui-kit/TabsControl/ScrollableTabsControl.js +15 -3
- package/dist/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
- package/dist/ui-kit/TabsControl/TabItem.d.ts +5 -4
- package/dist/ui-kit/TabsControl/TabItem.js.map +1 -1
- package/dist/ui-kit/TabsControl/TabItemInner.js +14 -8
- package/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
- package/dist/ui-kit/TabsControl/TabsControl.js +1 -1
- package/dist/ui-kit/TabsControl/TabsControl.js.map +1 -1
- package/dist/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
- package/dist/ui-kit/TabsControl/renderTab.d.ts +3 -3
- package/dist/ui-kit/TabsControl/renderTab.js.map +1 -1
- package/dist/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
- package/dist/ui-kit/TabsControl/renderTabItemInner.js +23 -0
- package/dist/ui-kit/TabsControl/renderTabItemInner.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Blocks.mobile.js +2 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js +4 -4
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/Calculator.fixture.d.ts +0 -1
- package/lib/components/Calculator/Calculator.fixture.mobile.d.ts +0 -1
- package/lib/components/Calculator/CalculatorContent.d.ts +1 -8
- package/lib/components/Calculator/CreditCalculatorForm.js +4 -4
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.js +4 -4
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/EmbeddableCalcBlocks.d.ts +1 -3
- package/lib/components/Calculator/EmbeddableCalcBlocks.js +0 -2
- package/lib/components/Calculator/EmbeddableCalcBlocks.js.map +1 -1
- package/lib/components/Calculator/RefinancingCalculatorForm.js +4 -4
- package/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/constants.d.ts +0 -5
- package/lib/components/Calculator/constants.js +0 -15
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/CalculatorBonus/CalculatorBonus.d.ts +9 -0
- package/lib/components/CalculatorBonus/CalculatorBonus.fixture.d.ts +6 -0
- package/lib/components/CalculatorBonus/CalculatorBonus.js +44 -0
- package/lib/components/CalculatorBonus/CalculatorBonus.js.map +1 -0
- package/lib/components/CalculatorBonus/CalculatorBonusContent.d.ts +12 -0
- package/lib/components/CalculatorBonus/CalculatorBonusContent.js +2 -0
- package/lib/components/CalculatorBonus/CalculatorBonusContent.js.map +1 -0
- package/lib/components/{Calculator → CalculatorBonus}/getBonus.js +13 -1
- package/lib/components/CalculatorBonus/getBonus.js.map +1 -0
- package/lib/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.js +12 -1
- package/lib/components/CalculatorBonus/getBonusCalculatorParams.js.map +1 -0
- package/lib/components/Tabs/Tabs.fixture.d.ts +0 -1
- package/lib/components/Tabs/Tabs.fixture.mobile.d.ts +0 -1
- package/lib/components/Tabs/TabsContent.d.ts +1 -1
- package/lib/components/Tabs/renderTabs.js +0 -2
- package/lib/components/Tabs/renderTabs.js.map +1 -1
- package/lib/components/TabsLayout/TabsLayout.fixture.d.ts +2 -0
- package/lib/components/TabsLayout/TabsLayout.fixture.mobile.d.ts +2 -0
- package/lib/components/TabsLayout/TabsLayout.js +40 -17
- package/lib/components/TabsLayout/TabsLayout.js.map +1 -1
- package/lib/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
- package/lib/components/TabsLayout/renderTabsLayout.d.ts +10 -0
- package/lib/components/TabsLayout/renderTabsLayout.js +16 -0
- package/lib/components/TabsLayout/renderTabsLayout.js.map +1 -0
- package/lib/ui-kit/Calculator/CalculatorLayout.d.ts +5 -0
- package/lib/ui-kit/Calculator/CalculatorLayout.js +7 -0
- package/lib/ui-kit/Calculator/CalculatorLayout.js.map +1 -0
- package/{mobile/lib/components → lib/ui-kit}/Calculator/CalculatorValueBlock.js +1 -1
- package/lib/ui-kit/Calculator/CalculatorValueBlock.js.map +1 -0
- package/lib/{components → ui-kit}/Calculator/Rate.js +1 -1
- package/lib/ui-kit/Calculator/Rate.js.map +1 -0
- package/{mobile/lib/components → lib/ui-kit}/Calculator/renderFootnote.js +1 -1
- package/lib/ui-kit/Calculator/renderFootnote.js.map +1 -0
- package/lib/{components → ui-kit}/Calculator/renderRate.d.ts +1 -1
- package/{mobile/lib/components → lib/ui-kit}/Calculator/renderRate.js +1 -1
- package/lib/ui-kit/Calculator/renderRate.js.map +1 -0
- package/{dist/components → lib/ui-kit}/Calculator/renderWantedSumInput.d.ts +1 -1
- package/{mobile/lib/components → lib/ui-kit}/Calculator/renderWantedSumInput.js +1 -1
- package/lib/ui-kit/Calculator/renderWantedSumInput.js.map +1 -0
- package/lib/ui-kit/TabsControl/ScrollableTabsControl.js +15 -3
- package/lib/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
- package/lib/ui-kit/TabsControl/TabItem.d.ts +5 -4
- package/lib/ui-kit/TabsControl/TabItem.js.map +1 -1
- package/lib/ui-kit/TabsControl/TabItemInner.js +14 -8
- package/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
- package/lib/ui-kit/TabsControl/TabsControl.fixture.d.ts +1 -1
- package/lib/ui-kit/TabsControl/TabsControl.js +1 -1
- package/lib/ui-kit/TabsControl/TabsControl.js.map +1 -1
- package/lib/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
- package/lib/ui-kit/TabsControl/renderTab.d.ts +3 -3
- package/lib/ui-kit/TabsControl/renderTab.js.map +1 -1
- package/lib/ui-kit/TabsControl/renderTabItemInner.d.ts +10 -0
- package/lib/ui-kit/TabsControl/renderTabItemInner.js +20 -0
- package/lib/ui-kit/TabsControl/renderTabItemInner.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +212 -165
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +1 -8
- package/mobile/bundle/components/Calculator/EmbeddableCalcBlocks.d.ts +1 -3
- package/mobile/bundle/components/Calculator/constants.d.ts +0 -5
- package/mobile/bundle/components/CalculatorBonus/CalculatorBonus.d.ts +9 -0
- package/mobile/bundle/components/CalculatorBonus/CalculatorBonusContent.d.ts +12 -0
- package/mobile/bundle/components/Tabs/TabsContent.d.ts +1 -1
- package/mobile/bundle/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
- package/mobile/bundle/components/TabsLayout/renderTabsLayout.d.ts +11 -0
- package/mobile/bundle/ui-kit/Calculator/CalculatorLayout.d.ts +5 -0
- package/mobile/bundle/{components → ui-kit}/Calculator/renderRate.d.ts +1 -1
- package/mobile/bundle/{components → ui-kit}/Calculator/renderWantedSumInput.d.ts +1 -1
- package/mobile/bundle/ui-kit/TabsControl/TabItem.d.ts +5 -4
- package/mobile/bundle/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
- package/mobile/bundle/ui-kit/TabsControl/renderTab.d.ts +3 -3
- package/mobile/bundle/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
- package/mobile/dist/components/Blocks.js +2 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +4 -4
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/CalculatorContent.d.ts +1 -8
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js +4 -4
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +4 -4
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/EmbeddableCalcBlocks.d.ts +1 -3
- package/mobile/dist/components/Calculator/EmbeddableCalcBlocks.js +0 -2
- package/mobile/dist/components/Calculator/EmbeddableCalcBlocks.js.map +1 -1
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js +4 -4
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.d.ts +0 -5
- package/mobile/dist/components/Calculator/constants.js +1 -16
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/CalculatorBonus/CalculatorBonus.d.ts +9 -0
- package/mobile/dist/components/CalculatorBonus/CalculatorBonus.js +46 -0
- package/mobile/dist/components/CalculatorBonus/CalculatorBonus.js.map +1 -0
- package/mobile/dist/components/CalculatorBonus/CalculatorBonusContent.d.ts +12 -0
- package/mobile/dist/components/CalculatorBonus/CalculatorBonusContent.js +2 -0
- package/mobile/dist/components/CalculatorBonus/CalculatorBonusContent.js.map +1 -0
- package/mobile/dist/components/CalculatorBonus/getBonus.js +25 -0
- package/mobile/dist/components/CalculatorBonus/getBonus.js.map +1 -0
- package/mobile/dist/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.js +13 -2
- package/mobile/dist/components/CalculatorBonus/getBonusCalculatorParams.js.map +1 -0
- package/mobile/dist/components/Tabs/TabsContent.d.ts +1 -1
- package/mobile/dist/components/Tabs/renderTabs.js +0 -2
- package/mobile/dist/components/Tabs/renderTabs.js.map +1 -1
- package/mobile/dist/components/TabsLayout/TabsLayout.js +39 -16
- package/mobile/dist/components/TabsLayout/TabsLayout.js.map +1 -1
- package/mobile/dist/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
- package/mobile/dist/components/TabsLayout/renderTabsLayout.d.ts +11 -0
- package/mobile/dist/components/TabsLayout/renderTabsLayout.js +19 -0
- package/mobile/dist/components/TabsLayout/renderTabsLayout.js.map +1 -0
- package/mobile/dist/ui-kit/Calculator/CalculatorLayout.d.ts +5 -0
- package/mobile/dist/ui-kit/Calculator/CalculatorLayout.js +9 -0
- package/mobile/dist/ui-kit/Calculator/CalculatorLayout.js.map +1 -0
- package/mobile/dist/{components → ui-kit}/Calculator/CalculatorValueBlock.js +1 -1
- package/mobile/dist/ui-kit/Calculator/CalculatorValueBlock.js.map +1 -0
- package/mobile/dist/{components → ui-kit}/Calculator/Rate.js +1 -1
- package/mobile/dist/ui-kit/Calculator/Rate.js.map +1 -0
- package/{dist/components → mobile/dist/ui-kit}/Calculator/renderFootnote.js +1 -1
- package/mobile/dist/ui-kit/Calculator/renderFootnote.js.map +1 -0
- package/{bundle/components → mobile/dist/ui-kit}/Calculator/renderRate.d.ts +1 -1
- package/{dist/components → mobile/dist/ui-kit}/Calculator/renderRate.js +1 -1
- package/mobile/dist/ui-kit/Calculator/renderRate.js.map +1 -0
- package/mobile/dist/ui-kit/Calculator/renderWantedSumInput.d.ts +7 -0
- package/{dist/components → mobile/dist/ui-kit}/Calculator/renderWantedSumInput.js +1 -1
- package/mobile/dist/ui-kit/Calculator/renderWantedSumInput.js.map +1 -0
- package/mobile/dist/ui-kit/TabsControl/ScrollableTabsControl.js +15 -3
- package/mobile/dist/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabItem.d.ts +5 -4
- package/mobile/dist/ui-kit/TabsControl/TabItem.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabItemInner.js +14 -8
- package/mobile/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabsControl.js +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabsControl.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
- package/mobile/dist/ui-kit/TabsControl/renderTab.d.ts +3 -3
- package/mobile/dist/ui-kit/TabsControl/renderTab.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
- package/mobile/dist/ui-kit/TabsControl/renderTabItemInner.js +23 -0
- package/mobile/dist/ui-kit/TabsControl/renderTabItemInner.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Blocks.js +2 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +4 -4
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/CalculatorContent.d.ts +1 -8
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js +4 -4
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +4 -4
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/EmbeddableCalcBlocks.d.ts +1 -3
- package/mobile/lib/components/Calculator/EmbeddableCalcBlocks.js +0 -2
- package/mobile/lib/components/Calculator/EmbeddableCalcBlocks.js.map +1 -1
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js +4 -4
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.d.ts +0 -5
- package/mobile/lib/components/Calculator/constants.js +0 -15
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/CalculatorBonus/CalculatorBonus.d.ts +9 -0
- package/mobile/lib/components/CalculatorBonus/CalculatorBonus.js +44 -0
- package/mobile/lib/components/CalculatorBonus/CalculatorBonus.js.map +1 -0
- package/mobile/lib/components/CalculatorBonus/CalculatorBonusContent.d.ts +12 -0
- package/mobile/lib/components/CalculatorBonus/CalculatorBonusContent.js +2 -0
- package/mobile/lib/components/CalculatorBonus/CalculatorBonusContent.js.map +1 -0
- package/mobile/lib/components/{Calculator → CalculatorBonus}/getBonus.js +13 -1
- package/mobile/lib/components/CalculatorBonus/getBonus.js.map +1 -0
- package/mobile/lib/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.js +12 -1
- package/mobile/lib/components/CalculatorBonus/getBonusCalculatorParams.js.map +1 -0
- package/mobile/lib/components/Tabs/TabsContent.d.ts +1 -1
- package/mobile/lib/components/Tabs/renderTabs.js +0 -2
- package/mobile/lib/components/Tabs/renderTabs.js.map +1 -1
- package/mobile/lib/components/TabsLayout/TabsLayout.js +40 -17
- package/mobile/lib/components/TabsLayout/TabsLayout.js.map +1 -1
- package/mobile/lib/components/TabsLayout/TabsLayoutContent.d.ts +31 -6
- package/mobile/lib/components/TabsLayout/renderTabsLayout.d.ts +11 -0
- package/mobile/lib/components/TabsLayout/renderTabsLayout.js +16 -0
- package/mobile/lib/components/TabsLayout/renderTabsLayout.js.map +1 -0
- package/mobile/lib/ui-kit/Calculator/CalculatorLayout.d.ts +5 -0
- package/mobile/lib/ui-kit/Calculator/CalculatorLayout.js +7 -0
- package/mobile/lib/ui-kit/Calculator/CalculatorLayout.js.map +1 -0
- package/{lib/components → mobile/lib/ui-kit}/Calculator/CalculatorValueBlock.js +1 -1
- package/mobile/lib/ui-kit/Calculator/CalculatorValueBlock.js.map +1 -0
- package/mobile/lib/{components → ui-kit}/Calculator/Rate.js +1 -1
- package/mobile/lib/ui-kit/Calculator/Rate.js.map +1 -0
- package/{lib/components → mobile/lib/ui-kit}/Calculator/renderFootnote.js +1 -1
- package/mobile/lib/ui-kit/Calculator/renderFootnote.js.map +1 -0
- package/mobile/lib/ui-kit/Calculator/renderRate.d.ts +8 -0
- package/{lib/components → mobile/lib/ui-kit}/Calculator/renderRate.js +1 -1
- package/mobile/lib/ui-kit/Calculator/renderRate.js.map +1 -0
- package/mobile/lib/ui-kit/Calculator/renderWantedSumInput.d.ts +7 -0
- package/{lib/components → mobile/lib/ui-kit}/Calculator/renderWantedSumInput.js +1 -1
- package/mobile/lib/ui-kit/Calculator/renderWantedSumInput.js.map +1 -0
- package/mobile/lib/ui-kit/TabsControl/ScrollableTabsControl.js +15 -3
- package/mobile/lib/ui-kit/TabsControl/ScrollableTabsControl.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabItem.d.ts +5 -4
- package/mobile/lib/ui-kit/TabsControl/TabItem.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabItemInner.js +14 -8
- package/mobile/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabsControl.js +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabsControl.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabsControlProps.d.ts +11 -2
- package/mobile/lib/ui-kit/TabsControl/renderTab.d.ts +3 -3
- package/mobile/lib/ui-kit/TabsControl/renderTab.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/renderTabItemInner.d.ts +11 -0
- package/mobile/lib/ui-kit/TabsControl/renderTabItemInner.js +20 -0
- package/mobile/lib/ui-kit/TabsControl/renderTabItemInner.js.map +1 -0
- package/mobile/src/components/Blocks.ts +2 -0
- package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +4 -4
- package/mobile/src/components/Calculator/CalculatorContent.ts +1 -11
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +4 -4
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +4 -4
- package/mobile/src/components/Calculator/EmbeddableCalcBlocks.tsx +0 -3
- package/mobile/src/components/Calculator/RefinancingCalculatorForm.tsx +4 -4
- package/mobile/src/components/Calculator/constants.ts +0 -18
- package/mobile/src/components/CalculatorBonus/CalculatorBonus.example.json +1 -0
- package/mobile/src/components/CalculatorBonus/CalculatorBonus.tsx +75 -0
- package/mobile/src/components/CalculatorBonus/CalculatorBonus.ui.json +1 -0
- package/mobile/src/components/CalculatorBonus/CalculatorBonusContent.ts +16 -0
- package/mobile/src/components/{Calculator → CalculatorBonus}/getBonus.ts +15 -1
- package/mobile/src/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.ts +13 -1
- package/mobile/src/components/Tabs/TabsContent.ts +1 -1
- package/mobile/src/components/Tabs/renderTabs.tsx +0 -10
- package/mobile/src/components/TabsLayout/TabsLayout.example.json +4 -3
- package/mobile/src/components/TabsLayout/TabsLayout.tsx +56 -57
- package/mobile/src/components/TabsLayout/TabsLayoutContent.ts +36 -8
- package/mobile/src/components/TabsLayout/renderTabsLayout.tsx +32 -0
- package/mobile/src/ui-kit/Calculator/CalculatorLayout.tsx +17 -0
- package/mobile/src/{components → ui-kit}/Calculator/CalculatorValueBlock.tsx +1 -1
- package/mobile/src/{components → ui-kit}/Calculator/Rate.tsx +1 -1
- package/{src/components → mobile/src/ui-kit}/Calculator/renderFootnote.tsx +1 -1
- package/mobile/src/{components → ui-kit}/Calculator/renderRate.tsx +1 -1
- package/mobile/src/{components → ui-kit}/Calculator/renderWantedSumInput.tsx +2 -2
- package/mobile/src/ui-kit/TabsControl/ScrollableTabsControl.tsx +28 -5
- package/mobile/src/ui-kit/TabsControl/TabItem.tsx +5 -5
- package/mobile/src/ui-kit/TabsControl/TabItemInner.tsx +21 -15
- package/mobile/src/ui-kit/TabsControl/TabsControl.tsx +4 -1
- package/mobile/src/ui-kit/TabsControl/TabsControlProps.ts +12 -2
- package/mobile/src/ui-kit/TabsControl/renderTab.tsx +3 -3
- package/mobile/src/ui-kit/TabsControl/renderTabItemInner.tsx +63 -0
- package/package.json +1 -1
- package/src/components/Blocks.mobile.ts +2 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +4 -4
- package/src/components/Calculator/Calculator.fixture.mobile.tsx +0 -24
- package/src/components/Calculator/Calculator.fixture.tsx +0 -33
- package/src/components/Calculator/CalculatorContent.ts +1 -11
- package/src/components/Calculator/CreditCalculatorForm.tsx +4 -4
- package/src/components/Calculator/DepositCalculatorForm.tsx +4 -4
- package/src/components/Calculator/EmbeddableCalcBlocks.tsx +0 -3
- package/src/components/Calculator/RefinancingCalculatorForm.tsx +4 -4
- package/src/components/Calculator/constants.ts +0 -18
- package/src/components/CalculatorBonus/CalculatorBonus.example.json +1 -0
- package/src/components/CalculatorBonus/CalculatorBonus.fixture.tsx +34 -0
- package/src/components/CalculatorBonus/CalculatorBonus.tsx +75 -0
- package/src/components/CalculatorBonus/CalculatorBonus.ui.json +1 -0
- package/src/components/CalculatorBonus/CalculatorBonusContent.ts +16 -0
- package/src/components/{Calculator → CalculatorBonus}/getBonus.ts +15 -1
- package/src/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.ts +13 -1
- package/src/components/Tabs/Tabs.fixture.mobile.tsx +0 -16
- package/src/components/Tabs/Tabs.fixture.tsx +0 -19
- package/src/components/Tabs/TabsContent.ts +1 -1
- package/src/components/Tabs/renderTabs.tsx +0 -10
- package/src/components/TabsLayout/TabsLayout.example.json +4 -3
- package/src/components/TabsLayout/TabsLayout.fixture.mobile.tsx +51 -30
- package/src/components/TabsLayout/TabsLayout.fixture.tsx +61 -30
- package/src/components/TabsLayout/TabsLayout.tsx +56 -57
- package/src/components/TabsLayout/TabsLayoutContent.ts +36 -8
- package/src/components/TabsLayout/renderTabsLayout.tsx +32 -0
- package/src/ui-kit/Calculator/CalculatorLayout.tsx +17 -0
- package/src/{components → ui-kit}/Calculator/CalculatorValueBlock.tsx +1 -1
- package/src/{components → ui-kit}/Calculator/Rate.tsx +1 -1
- package/{mobile/src/components → src/ui-kit}/Calculator/renderFootnote.tsx +1 -1
- package/src/{components → ui-kit}/Calculator/renderRate.tsx +1 -1
- package/src/{components → ui-kit}/Calculator/renderWantedSumInput.tsx +2 -2
- package/src/ui-kit/TabsControl/ScrollableTabsControl.tsx +28 -5
- package/src/ui-kit/TabsControl/TabItem.tsx +5 -5
- package/src/ui-kit/TabsControl/TabItemInner.tsx +21 -15
- package/src/ui-kit/TabsControl/TabsControl.fixture.tsx +7 -20
- package/src/ui-kit/TabsControl/TabsControl.tsx +4 -1
- package/src/ui-kit/TabsControl/TabsControlProps.ts +12 -2
- package/src/ui-kit/TabsControl/renderTab.tsx +3 -3
- package/src/ui-kit/TabsControl/renderTabItemInner.tsx +63 -0
- package/bundle/components/Calculator/BonusCalculatorForm.d.ts +0 -8
- package/bundle/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
- package/bundle/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
- package/bundle/components/TabsLayout/alignTabStyle.d.ts +0 -2
- package/bundle/components/TabsLayout/useScrollToTab.d.ts +0 -2
- package/dist/components/Calculator/BonusCalculatorForm.d.ts +0 -8
- package/dist/components/Calculator/BonusCalculatorForm.js +0 -44
- package/dist/components/Calculator/BonusCalculatorForm.js.map +0 -1
- package/dist/components/Calculator/CalculatorValueBlock.js.map +0 -1
- package/dist/components/Calculator/Rate.js.map +0 -1
- package/dist/components/Calculator/getBonus.js +0 -13
- package/dist/components/Calculator/getBonus.js.map +0 -1
- package/dist/components/Calculator/getBonusCalculatorParams.js.map +0 -1
- package/dist/components/Calculator/renderFootnote.js.map +0 -1
- package/dist/components/Calculator/renderRate.js.map +0 -1
- package/dist/components/Calculator/renderWantedSumInput.js.map +0 -1
- package/dist/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
- package/dist/components/TabsLayout/TabsLayoutButton.js +0 -24
- package/dist/components/TabsLayout/TabsLayoutButton.js.map +0 -1
- package/dist/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
- package/dist/components/TabsLayout/TabsLayoutRedirectSection.js +0 -27
- package/dist/components/TabsLayout/TabsLayoutRedirectSection.js.map +0 -1
- package/dist/components/TabsLayout/alignTabStyle.d.ts +0 -2
- package/dist/components/TabsLayout/alignTabStyle.js +0 -8
- package/dist/components/TabsLayout/alignTabStyle.js.map +0 -1
- package/dist/components/TabsLayout/useScrollToTab.d.ts +0 -2
- package/dist/components/TabsLayout/useScrollToTab.js +0 -17
- package/dist/components/TabsLayout/useScrollToTab.js.map +0 -1
- package/lib/components/Calculator/BonusCalculatorForm.d.ts +0 -8
- package/lib/components/Calculator/BonusCalculatorForm.js +0 -42
- package/lib/components/Calculator/BonusCalculatorForm.js.map +0 -1
- package/lib/components/Calculator/CalculatorValueBlock.js.map +0 -1
- package/lib/components/Calculator/Rate.js.map +0 -1
- package/lib/components/Calculator/getBonus.js.map +0 -1
- package/lib/components/Calculator/getBonusCalculatorParams.js.map +0 -1
- package/lib/components/Calculator/renderFootnote.js.map +0 -1
- package/lib/components/Calculator/renderRate.js.map +0 -1
- package/lib/components/Calculator/renderWantedSumInput.js.map +0 -1
- package/lib/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
- package/lib/components/TabsLayout/TabsLayoutButton.js +0 -22
- package/lib/components/TabsLayout/TabsLayoutButton.js.map +0 -1
- package/lib/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
- package/lib/components/TabsLayout/TabsLayoutRedirectSection.js +0 -25
- package/lib/components/TabsLayout/TabsLayoutRedirectSection.js.map +0 -1
- package/lib/components/TabsLayout/alignTabStyle.d.ts +0 -2
- package/lib/components/TabsLayout/alignTabStyle.js +0 -6
- package/lib/components/TabsLayout/alignTabStyle.js.map +0 -1
- package/lib/components/TabsLayout/useScrollToTab.d.ts +0 -2
- package/lib/components/TabsLayout/useScrollToTab.js +0 -14
- package/lib/components/TabsLayout/useScrollToTab.js.map +0 -1
- package/mobile/bundle/components/Calculator/BonusCalculatorForm.d.ts +0 -8
- package/mobile/bundle/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
- package/mobile/bundle/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
- package/mobile/bundle/components/TabsLayout/alignTabStyle.d.ts +0 -2
- package/mobile/bundle/components/TabsLayout/useScrollToTab.d.ts +0 -2
- package/mobile/dist/components/Calculator/BonusCalculatorForm.d.ts +0 -8
- package/mobile/dist/components/Calculator/BonusCalculatorForm.js +0 -44
- package/mobile/dist/components/Calculator/BonusCalculatorForm.js.map +0 -1
- package/mobile/dist/components/Calculator/CalculatorValueBlock.js.map +0 -1
- package/mobile/dist/components/Calculator/Rate.js.map +0 -1
- package/mobile/dist/components/Calculator/getBonus.js +0 -13
- package/mobile/dist/components/Calculator/getBonus.js.map +0 -1
- package/mobile/dist/components/Calculator/getBonusCalculatorParams.js.map +0 -1
- package/mobile/dist/components/Calculator/renderFootnote.js.map +0 -1
- package/mobile/dist/components/Calculator/renderRate.js.map +0 -1
- package/mobile/dist/components/Calculator/renderWantedSumInput.d.ts +0 -7
- package/mobile/dist/components/Calculator/renderWantedSumInput.js.map +0 -1
- package/mobile/dist/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
- package/mobile/dist/components/TabsLayout/TabsLayoutButton.js +0 -24
- package/mobile/dist/components/TabsLayout/TabsLayoutButton.js.map +0 -1
- package/mobile/dist/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
- package/mobile/dist/components/TabsLayout/TabsLayoutRedirectSection.js +0 -27
- package/mobile/dist/components/TabsLayout/TabsLayoutRedirectSection.js.map +0 -1
- package/mobile/dist/components/TabsLayout/alignTabStyle.d.ts +0 -2
- package/mobile/dist/components/TabsLayout/alignTabStyle.js +0 -8
- package/mobile/dist/components/TabsLayout/alignTabStyle.js.map +0 -1
- package/mobile/dist/components/TabsLayout/useScrollToTab.d.ts +0 -2
- package/mobile/dist/components/TabsLayout/useScrollToTab.js +0 -17
- package/mobile/dist/components/TabsLayout/useScrollToTab.js.map +0 -1
- package/mobile/lib/components/Calculator/BonusCalculatorForm.d.ts +0 -8
- package/mobile/lib/components/Calculator/BonusCalculatorForm.js +0 -42
- package/mobile/lib/components/Calculator/BonusCalculatorForm.js.map +0 -1
- package/mobile/lib/components/Calculator/CalculatorValueBlock.js.map +0 -1
- package/mobile/lib/components/Calculator/Rate.js.map +0 -1
- package/mobile/lib/components/Calculator/getBonus.js.map +0 -1
- package/mobile/lib/components/Calculator/getBonusCalculatorParams.js.map +0 -1
- package/mobile/lib/components/Calculator/renderFootnote.js.map +0 -1
- package/mobile/lib/components/Calculator/renderRate.d.ts +0 -8
- package/mobile/lib/components/Calculator/renderRate.js.map +0 -1
- package/mobile/lib/components/Calculator/renderWantedSumInput.d.ts +0 -7
- package/mobile/lib/components/Calculator/renderWantedSumInput.js.map +0 -1
- package/mobile/lib/components/TabsLayout/TabsLayoutButton.d.ts +0 -10
- package/mobile/lib/components/TabsLayout/TabsLayoutButton.js +0 -22
- package/mobile/lib/components/TabsLayout/TabsLayoutButton.js.map +0 -1
- package/mobile/lib/components/TabsLayout/TabsLayoutRedirectSection.d.ts +0 -6
- package/mobile/lib/components/TabsLayout/TabsLayoutRedirectSection.js +0 -25
- package/mobile/lib/components/TabsLayout/TabsLayoutRedirectSection.js.map +0 -1
- package/mobile/lib/components/TabsLayout/alignTabStyle.d.ts +0 -2
- package/mobile/lib/components/TabsLayout/alignTabStyle.js +0 -6
- package/mobile/lib/components/TabsLayout/alignTabStyle.js.map +0 -1
- package/mobile/lib/components/TabsLayout/useScrollToTab.d.ts +0 -2
- package/mobile/lib/components/TabsLayout/useScrollToTab.js +0 -14
- package/mobile/lib/components/TabsLayout/useScrollToTab.js.map +0 -1
- package/mobile/src/components/Calculator/BonusCalculatorForm.tsx +0 -68
- package/mobile/src/components/TabsLayout/TabsLayoutButton.tsx +0 -63
- package/mobile/src/components/TabsLayout/TabsLayoutRedirectSection.tsx +0 -32
- package/mobile/src/components/TabsLayout/alignTabStyle.ts +0 -7
- package/mobile/src/components/TabsLayout/useScrollToTab.ts +0 -16
- package/src/components/Calculator/BonusCalculatorForm.tsx +0 -68
- package/src/components/TabsLayout/TabsLayoutButton.tsx +0 -63
- package/src/components/TabsLayout/TabsLayoutRedirectSection.tsx +0 -32
- package/src/components/TabsLayout/alignTabStyle.ts +0 -7
- package/src/components/TabsLayout/useScrollToTab.ts +0 -16
- /package/bundle/components/{Calculator → CalculatorBonus}/getBonus.d.ts +0 -0
- /package/bundle/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.d.ts +0 -0
- /package/bundle/{components → ui-kit}/Calculator/CalculatorValueBlock.d.ts +0 -0
- /package/bundle/{components → ui-kit}/Calculator/Rate.d.ts +0 -0
- /package/bundle/{components → ui-kit}/Calculator/renderFootnote.d.ts +0 -0
- /package/dist/components/{Calculator → CalculatorBonus}/getBonus.d.ts +0 -0
- /package/dist/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.d.ts +0 -0
- /package/dist/{components → ui-kit}/Calculator/CalculatorValueBlock.d.ts +0 -0
- /package/dist/{components → ui-kit}/Calculator/Rate.d.ts +0 -0
- /package/dist/{components → ui-kit}/Calculator/renderFootnote.d.ts +0 -0
- /package/lib/components/{Calculator → CalculatorBonus}/getBonus.d.ts +0 -0
- /package/lib/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.d.ts +0 -0
- /package/lib/{components → ui-kit}/Calculator/CalculatorValueBlock.d.ts +0 -0
- /package/lib/{components → ui-kit}/Calculator/Rate.d.ts +0 -0
- /package/lib/{components → ui-kit}/Calculator/renderFootnote.d.ts +0 -0
- /package/mobile/bundle/components/{Calculator → CalculatorBonus}/getBonus.d.ts +0 -0
- /package/mobile/bundle/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.d.ts +0 -0
- /package/mobile/bundle/{components → ui-kit}/Calculator/CalculatorValueBlock.d.ts +0 -0
- /package/mobile/bundle/{components → ui-kit}/Calculator/Rate.d.ts +0 -0
- /package/mobile/bundle/{components → ui-kit}/Calculator/renderFootnote.d.ts +0 -0
- /package/mobile/dist/components/{Calculator → CalculatorBonus}/getBonus.d.ts +0 -0
- /package/mobile/dist/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.d.ts +0 -0
- /package/mobile/dist/{components → ui-kit}/Calculator/CalculatorValueBlock.d.ts +0 -0
- /package/mobile/dist/{components → ui-kit}/Calculator/Rate.d.ts +0 -0
- /package/mobile/dist/{components → ui-kit}/Calculator/renderFootnote.d.ts +0 -0
- /package/mobile/lib/components/{Calculator → CalculatorBonus}/getBonus.d.ts +0 -0
- /package/mobile/lib/components/{Calculator → CalculatorBonus}/getBonusCalculatorParams.d.ts +0 -0
- /package/mobile/lib/{components → ui-kit}/Calculator/CalculatorValueBlock.d.ts +0 -0
- /package/mobile/lib/{components → ui-kit}/Calculator/Rate.d.ts +0 -0
- /package/mobile/lib/{components → ui-kit}/Calculator/renderFootnote.d.ts +0 -0
|
@@ -2,49 +2,80 @@ import { type BlockRendererOptions } from '../../BlockRenderer/BlockRendererOpti
|
|
|
2
2
|
import '../../setup-fixture';
|
|
3
3
|
import { Blocks } from '../Blocks';
|
|
4
4
|
import { TabsLayout } from './TabsLayout';
|
|
5
|
-
import
|
|
5
|
+
import { type Tab } from './TabsLayoutContent';
|
|
6
6
|
|
|
7
7
|
const options: BlockRendererOptions = {
|
|
8
8
|
blocksRegistry: Blocks,
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
const TABS: Tab[] = [
|
|
12
|
+
{
|
|
13
|
+
type: 'group',
|
|
14
|
+
description: 'Описание первого таб группа',
|
|
15
|
+
text: 'Первый таб',
|
|
16
|
+
selected: false,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
type: 'group',
|
|
20
|
+
description: 'Описание первого таб группа',
|
|
21
|
+
text: 'Второй таб',
|
|
22
|
+
selected: false,
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const TEXT_BLOCK_DESCRIPTION = {
|
|
27
|
+
type: 'TextBlock',
|
|
28
|
+
content: {
|
|
29
|
+
title: 'Текстовый блок',
|
|
30
|
+
description: 'Описание',
|
|
31
|
+
},
|
|
32
|
+
style: ['col-span-12'],
|
|
33
|
+
};
|
|
34
|
+
|
|
11
35
|
export default {
|
|
12
36
|
default: (
|
|
13
37
|
<div className="container grid grid-cols-12">
|
|
14
38
|
<TabsLayout
|
|
15
39
|
className="col-span-12"
|
|
16
|
-
tabs={
|
|
40
|
+
tabs={TABS}
|
|
41
|
+
tabsType="animated"
|
|
42
|
+
options={options}
|
|
43
|
+
block={{
|
|
44
|
+
slots: {
|
|
45
|
+
'Первый таб': [TEXT_BLOCK_DESCRIPTION, TEXT_BLOCK_DESCRIPTION],
|
|
46
|
+
'Второй таб': [TEXT_BLOCK_DESCRIPTION],
|
|
47
|
+
},
|
|
48
|
+
}}
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
),
|
|
52
|
+
wide: (
|
|
53
|
+
<div className="container grid grid-cols-12">
|
|
54
|
+
<TabsLayout
|
|
55
|
+
className="col-span-12"
|
|
56
|
+
tabs={TABS}
|
|
57
|
+
tabsType="default"
|
|
58
|
+
options={options}
|
|
59
|
+
block={{
|
|
60
|
+
slots: {
|
|
61
|
+
'Первый таб': [TEXT_BLOCK_DESCRIPTION, TEXT_BLOCK_DESCRIPTION],
|
|
62
|
+
'Второй таб': [TEXT_BLOCK_DESCRIPTION],
|
|
63
|
+
},
|
|
64
|
+
}}
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
),
|
|
68
|
+
scrollable: (
|
|
69
|
+
<div className="container grid grid-cols-12">
|
|
70
|
+
<TabsLayout
|
|
71
|
+
className="col-span-12"
|
|
72
|
+
tabs={TABS}
|
|
73
|
+
tabsType="underlined"
|
|
17
74
|
options={options}
|
|
18
75
|
block={{
|
|
19
76
|
slots: {
|
|
20
|
-
'Первый таб': [
|
|
21
|
-
|
|
22
|
-
type: 'TextBlock',
|
|
23
|
-
content: {
|
|
24
|
-
title: 'Текстовый блок',
|
|
25
|
-
description: 'Описание',
|
|
26
|
-
},
|
|
27
|
-
style: ['col-span-12'],
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
type: 'TextBlock',
|
|
31
|
-
content: {
|
|
32
|
-
title: 'Текстовый блок',
|
|
33
|
-
description: 'Описание',
|
|
34
|
-
},
|
|
35
|
-
style: ['col-span-12'],
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
'Второй таб': [
|
|
39
|
-
{
|
|
40
|
-
type: 'TextBlock',
|
|
41
|
-
content: {
|
|
42
|
-
title: 'Текстовый блок',
|
|
43
|
-
description: 'Описание',
|
|
44
|
-
},
|
|
45
|
-
style: ['col-span-12'],
|
|
46
|
-
},
|
|
47
|
-
],
|
|
77
|
+
'Первый таб': [TEXT_BLOCK_DESCRIPTION, TEXT_BLOCK_DESCRIPTION],
|
|
78
|
+
'Второй таб': [TEXT_BLOCK_DESCRIPTION],
|
|
48
79
|
},
|
|
49
80
|
}}
|
|
50
81
|
/>
|
|
@@ -1,66 +1,78 @@
|
|
|
1
|
-
import { useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
1
|
+
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
2
|
import { renderBlocksList } from '../../BlockRenderer/renderBlockList';
|
|
3
|
-
import {
|
|
4
|
-
import { type Align } from '../../model/Align';
|
|
3
|
+
import { useRouter } from '../../hooks/useRouter';
|
|
5
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
|
-
import {
|
|
7
|
-
import { useSwipeListScroll } from '../../ui-kit/SwipeListControl/useSwipeListScroll';
|
|
5
|
+
import { type TabItemBase } from '../../ui-kit/TabsControl/TabItem';
|
|
8
6
|
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
9
7
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
10
8
|
import { style } from '../../utils/style';
|
|
11
|
-
import {
|
|
12
|
-
import { alignTabStyle } from './alignTabStyle';
|
|
13
|
-
import { TabsLayoutButton } from './TabsLayoutButton';
|
|
9
|
+
import { renderTabsLayout } from './renderTabsLayout';
|
|
14
10
|
import { type Tab, type TabsLayoutContent } from './TabsLayoutContent';
|
|
15
|
-
|
|
11
|
+
|
|
12
|
+
const TAB_QUERY_PARAM_KEY = 'tab';
|
|
16
13
|
|
|
17
14
|
export interface TabsLayoutProps extends TabsLayoutContent, UniBlockProps {}
|
|
18
15
|
|
|
19
16
|
export const TabsLayout = UniBlock<TabsLayoutProps>(
|
|
20
|
-
({ className = '', tabs = [], block,
|
|
17
|
+
({ className = '', tabs = [], block, tabsType, ...rest }) => {
|
|
18
|
+
const router = useRouter();
|
|
19
|
+
|
|
20
|
+
const { isReady } = router;
|
|
21
|
+
|
|
21
22
|
const [activeTabIndex, setActiveTabIndex] = useState(getInitSelectedIndex(tabs));
|
|
22
23
|
|
|
24
|
+
const defaultSelectedTab = tabs.findIndex((_) => Boolean(_.selected));
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
const defaultTabIndex = router.query[TAB_QUERY_PARAM_KEY]
|
|
28
|
+
? tabs.findIndex(
|
|
29
|
+
(_, index) => _.type === 'group' && String(index) === router.query[TAB_QUERY_PARAM_KEY],
|
|
30
|
+
)
|
|
31
|
+
: defaultSelectedTab;
|
|
32
|
+
|
|
33
|
+
setActiveTabIndex(defaultTabIndex === -1 ? 0 : defaultTabIndex);
|
|
34
|
+
}, [isReady, defaultSelectedTab]);
|
|
35
|
+
|
|
23
36
|
const slotName = getSlotName(tabs[activeTabIndex], activeTabIndex);
|
|
24
37
|
|
|
25
|
-
const
|
|
38
|
+
const updateUrlSearchTabParam = (_: TabItemBase, index: number) => {
|
|
39
|
+
const searchParams = new URLSearchParams(router.query as Record<string, string>);
|
|
40
|
+
if (_.text) {
|
|
41
|
+
searchParams.set(TAB_QUERY_PARAM_KEY, String(index));
|
|
42
|
+
} else {
|
|
43
|
+
searchParams.delete(TAB_QUERY_PARAM_KEY);
|
|
44
|
+
}
|
|
45
|
+
router.replace(`${router.pathname}?${searchParams}`, '', { scroll: false });
|
|
46
|
+
};
|
|
26
47
|
|
|
27
|
-
const
|
|
28
|
-
|
|
48
|
+
const handleChange = useCallback(
|
|
49
|
+
(_: TabItemBase) => {
|
|
50
|
+
const index = tabs.indexOf(_ as Tab);
|
|
51
|
+
const tab = tabs[index];
|
|
29
52
|
|
|
30
|
-
|
|
53
|
+
setActiveTabIndex(index);
|
|
54
|
+
|
|
55
|
+
if (tab.type === 'group') {
|
|
56
|
+
updateUrlSearchTabParam(_, index);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
[tabs],
|
|
60
|
+
);
|
|
31
61
|
|
|
32
62
|
return (
|
|
33
63
|
<BlockWrapper className={style(className)} defaultPadding="p-0" {...rest}>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
onVisibleIndicesChange={scroll.handleVisibleIndicesChange}
|
|
41
|
-
>
|
|
42
|
-
{tabs.map(renderTabButton(activeTabIndex, setActiveTabIndex, tabAlign))}
|
|
43
|
-
</SwipeListContainer>
|
|
44
|
-
<CarouselScrollButtons
|
|
45
|
-
scroll={scroll}
|
|
46
|
-
arrowsPadded={true}
|
|
47
|
-
onScrollLeft={decActiveSlideIndex}
|
|
48
|
-
onScrollRight={incActiveSlideIndex}
|
|
49
|
-
activeIndex={activeSlideIndex}
|
|
50
|
-
itemCount={itemCount}
|
|
51
|
-
/>
|
|
52
|
-
</div>
|
|
64
|
+
{renderTabsLayout({
|
|
65
|
+
items: tabs,
|
|
66
|
+
value: tabs[activeTabIndex],
|
|
67
|
+
tabsType,
|
|
68
|
+
onChange: handleChange,
|
|
69
|
+
})}
|
|
53
70
|
<div className="space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs">
|
|
54
|
-
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
key: `${slotName}-${block?.type}`,
|
|
60
|
-
slotName,
|
|
61
|
-
parent: block,
|
|
62
|
-
})
|
|
63
|
-
)}
|
|
71
|
+
{renderBlocksList(block?.slots?.[slotName], {
|
|
72
|
+
...rest?.options,
|
|
73
|
+
slotName,
|
|
74
|
+
parent: block,
|
|
75
|
+
})}
|
|
64
76
|
</div>
|
|
65
77
|
</BlockWrapper>
|
|
66
78
|
);
|
|
@@ -71,20 +83,7 @@ export const TabsLayout = UniBlock<TabsLayoutProps>(
|
|
|
71
83
|
},
|
|
72
84
|
);
|
|
73
85
|
|
|
74
|
-
const getSlotName = (tab: Tab, index: number): string => tab?.
|
|
86
|
+
const getSlotName = (tab: Tab, index: number): string => tab?.text || `Слот №${index}`;
|
|
75
87
|
|
|
76
88
|
const getInitSelectedIndex = (tabs: Tab[]) =>
|
|
77
89
|
tabs.reduce((selectedIndex, tab, i) => (tab.selected ? i : selectedIndex), 0);
|
|
78
|
-
|
|
79
|
-
const renderTabButton =
|
|
80
|
-
(activeTabIndex: number, onClick: (i: number) => void, tabAlign: Align = 'start') =>
|
|
81
|
-
(tab: Tab, i: number) =>
|
|
82
|
-
(
|
|
83
|
-
<TabsLayoutButton
|
|
84
|
-
key={String(i)}
|
|
85
|
-
className={alignTabStyle[tabAlign]}
|
|
86
|
-
tab={tab}
|
|
87
|
-
isActive={activeTabIndex === i}
|
|
88
|
-
onClick={() => onClick(i)}
|
|
89
|
-
/>
|
|
90
|
-
);
|
|
@@ -1,28 +1,56 @@
|
|
|
1
|
-
import { type Align } from '../../model/Align';
|
|
2
1
|
import { type AspectsProps } from '../../model/AspectsProps';
|
|
3
|
-
import { type DescriptionProps
|
|
4
|
-
import { type
|
|
2
|
+
import { type DescriptionProps } from '../../model/HeadlineType';
|
|
3
|
+
import { type LinkProps } from '../../model/LinkProps';
|
|
5
4
|
import { type IconProps } from '../../model/Picture';
|
|
5
|
+
import { type TabsType } from '../../ui-kit/TabsControl/TabsControlProps';
|
|
6
6
|
import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @title Таб
|
|
10
10
|
*/
|
|
11
|
-
export type
|
|
12
|
-
DescriptionProps &
|
|
11
|
+
export type TabBase = DescriptionProps &
|
|
13
12
|
IconProps &
|
|
14
|
-
|
|
13
|
+
LinkProps &
|
|
15
14
|
AspectsProps & {
|
|
16
15
|
/** @title Вкладка выбрана по-умолчанию */
|
|
17
16
|
selected?: boolean;
|
|
18
17
|
};
|
|
19
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @title Группа
|
|
21
|
+
*/
|
|
22
|
+
export type GroupTab = TabBase & {
|
|
23
|
+
/** @default group */
|
|
24
|
+
type: 'group';
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @title Ссылка
|
|
29
|
+
*/
|
|
30
|
+
export type LinkTab = TabBase &
|
|
31
|
+
LinkProps & {
|
|
32
|
+
/** @default link */
|
|
33
|
+
type: 'link';
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @title Таб
|
|
38
|
+
* @default {
|
|
39
|
+
* "type": "group"
|
|
40
|
+
* }
|
|
41
|
+
*/
|
|
42
|
+
export type Tab = GroupTab | LinkTab;
|
|
43
|
+
|
|
20
44
|
/**
|
|
21
45
|
* @title Табы
|
|
22
46
|
*/
|
|
23
47
|
export type TabsLayoutContent = UniBlockContent & {
|
|
24
|
-
/** @title Выравнивание табов */
|
|
25
|
-
tabAlign?: Align;
|
|
26
48
|
/** @title Список табов */
|
|
27
49
|
tabs?: Tab[];
|
|
50
|
+
/** @title Режим отображения */
|
|
51
|
+
tabsType?: TabsType;
|
|
52
|
+
/** @title Закрепить сверху */
|
|
53
|
+
isSticky?: boolean;
|
|
54
|
+
/** @title Показывать счетчик блоков во вкладках */
|
|
55
|
+
showCounter?: boolean;
|
|
28
56
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ScrollableTabsControl } from '../../ui-kit/TabsControl/ScrollableTabsControl';
|
|
2
|
+
import { type TabItemBase } from '../../ui-kit/TabsControl/TabItem';
|
|
3
|
+
import { TabsControl } from '../../ui-kit/TabsControl/TabsControl';
|
|
4
|
+
import { type TabsControlProps, type TabsType } from '../../ui-kit/TabsControl/TabsControlProps';
|
|
5
|
+
|
|
6
|
+
interface RenderTabsProps {
|
|
7
|
+
items: TabItemBase[];
|
|
8
|
+
value: TabItemBase;
|
|
9
|
+
onChange: TabsControlProps['onChange'];
|
|
10
|
+
tabsType?: TabsType;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const renderTabsLayout = ({ tabsType = 'animated', ...props }: RenderTabsProps) => {
|
|
14
|
+
switch (tabsType) {
|
|
15
|
+
case 'default':
|
|
16
|
+
return <TabsControl {...props} />;
|
|
17
|
+
case 'underlined':
|
|
18
|
+
return (
|
|
19
|
+
<div className="flex">
|
|
20
|
+
<TabsControl className="m-auto" tabsType="underlined" {...props} />
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
case 'animated':
|
|
24
|
+
return (
|
|
25
|
+
<div className="border-b-8 border-primary-main">
|
|
26
|
+
<ScrollableTabsControl className="m-auto" {...props} tabsType="animated" />
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
default:
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { type TitleProps } from '../../model/HeadlineType';
|
|
3
|
+
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
4
|
+
import { style } from '../../utils/style';
|
|
5
|
+
import { BlockWrapper } from '../BlockWrapper';
|
|
6
|
+
import { Heading } from '../Heading/Heading';
|
|
7
|
+
|
|
8
|
+
export interface CalculatorLayoutProps extends UniBlockProps, TitleProps {}
|
|
9
|
+
|
|
10
|
+
export const CalculatorLayout = JSX<CalculatorLayoutProps>(
|
|
11
|
+
({ className, title, children, ...rest }) => (
|
|
12
|
+
<BlockWrapper className={style('space-y-xl', className)} defaultPadding="p-4xl" {...rest}>
|
|
13
|
+
{title ? <Heading className="text-center" title={title} /> : null}
|
|
14
|
+
{children}
|
|
15
|
+
</BlockWrapper>
|
|
16
|
+
),
|
|
17
|
+
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { Text } from '../../ui-kit/Text/Text';
|
|
3
2
|
import { style } from '../../utils/style';
|
|
4
3
|
import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
|
|
4
|
+
import { Text } from '../Text/Text';
|
|
5
5
|
|
|
6
6
|
const calculatorValueBlockStyle = 'flex justify-between @xl:flex-col';
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { UnknownRate, type UnknownRateProps } from '../../components/Calculator/UnknownRate';
|
|
1
2
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
2
3
|
import { Rate, type RateProps } from './Rate';
|
|
3
|
-
import { UnknownRate, type UnknownRateProps } from './UnknownRate';
|
|
4
4
|
|
|
5
5
|
interface RenderRateProps extends RateProps, UnknownRateProps {
|
|
6
6
|
isUnknownRateShown?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InputRange } from '../../ui-kit/InputRange/InputRange';
|
|
2
|
-
import { type InputRangeProps } from '../../ui-kit/InputRange/InputRangeProps';
|
|
3
1
|
import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
|
|
2
|
+
import { InputRange } from '../InputRange/InputRange';
|
|
3
|
+
import { type InputRangeProps } from '../InputRange/InputRangeProps';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_MONEY_STEP = 1000;
|
|
6
6
|
|
|
@@ -6,32 +6,55 @@ import { useSwipeListScroll } from '../SwipeListControl/useSwipeListScroll';
|
|
|
6
6
|
import { renderTab } from './renderTab';
|
|
7
7
|
import { type TabsControlProps } from './TabsControlProps';
|
|
8
8
|
|
|
9
|
-
const scrollButtonStyle = 'hidden sm:flex absolute z-40
|
|
9
|
+
const scrollButtonStyle = 'hidden sm:flex absolute z-40';
|
|
10
|
+
|
|
11
|
+
const scrollStyleType = {
|
|
12
|
+
animated: {
|
|
13
|
+
itemClassName: 'flex',
|
|
14
|
+
gap: 8,
|
|
15
|
+
buttonTop: 'top-5',
|
|
16
|
+
},
|
|
17
|
+
underlined: {
|
|
18
|
+
itemClassName: '',
|
|
19
|
+
gap: 0,
|
|
20
|
+
buttonTop: 'top-0',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
10
23
|
|
|
11
24
|
export const ScrollableTabsControl = JSX<TabsControlProps>(
|
|
12
|
-
({ className, items = [], value, onChange, tabsType }) => {
|
|
25
|
+
({ className, items = [], value, onChange, tabsType = 'default' }) => {
|
|
13
26
|
const [containerRef, scroll] = useSwipeListScroll<HTMLDivElement>({
|
|
14
27
|
itemCount: items?.length || 0,
|
|
15
28
|
});
|
|
16
29
|
|
|
17
30
|
return (
|
|
18
|
-
<div className={style('relative overflow-x-auto no-scrollbar', className)}
|
|
31
|
+
<div className={style('relative overflow-x-auto no-scrollbar', className)}>
|
|
19
32
|
<SwipeListContainer
|
|
20
33
|
containerRef={containerRef}
|
|
21
34
|
snapAlign="snap-start"
|
|
22
35
|
onVisibleIndicesChange={scroll.handleVisibleIndicesChange}
|
|
36
|
+
itemClassName={scrollStyleType[tabsType].itemClassName}
|
|
37
|
+
gap={scrollStyleType[tabsType].gap}
|
|
23
38
|
>
|
|
24
39
|
{items.map(renderTab(value, onChange, tabsType))}
|
|
25
40
|
</SwipeListContainer>
|
|
26
41
|
{scroll.canScrollLeft ? (
|
|
27
42
|
<ScrollLeftButton
|
|
28
|
-
className={style(
|
|
43
|
+
className={style(
|
|
44
|
+
'left-6',
|
|
45
|
+
scrollButtonStyle,
|
|
46
|
+
scrollStyleType[tabsType].buttonTop as string,
|
|
47
|
+
)}
|
|
29
48
|
onClick={scroll.scrollLeft}
|
|
30
49
|
/>
|
|
31
50
|
) : null}
|
|
32
51
|
{scroll.canScrollRight ? (
|
|
33
52
|
<ScrollRightButton
|
|
34
|
-
className={style(
|
|
53
|
+
className={style(
|
|
54
|
+
'right-6',
|
|
55
|
+
scrollButtonStyle,
|
|
56
|
+
scrollStyleType[tabsType].buttonTop as string,
|
|
57
|
+
)}
|
|
35
58
|
onClick={scroll.scrollRight}
|
|
36
59
|
/>
|
|
37
60
|
) : null}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useLink } from '../../hooks/useLink';
|
|
4
|
+
import { type DescriptionProps, type TitleProps } from '../../model/HeadlineType';
|
|
4
5
|
import { type LinkProps } from '../../model/LinkProps';
|
|
6
|
+
import { type IconProps } from '../../model/Picture';
|
|
5
7
|
import { type VNode } from '../../model/VNode';
|
|
6
8
|
import { TabItemInner } from './TabItemInner';
|
|
7
|
-
import { type TabsControlProps } from './TabsControlProps';
|
|
8
|
-
export interface TabItemBase extends LinkProps {
|
|
9
|
+
import { type TabsControlProps, type TabsType } from './TabsControlProps';
|
|
10
|
+
export interface TabItemBase extends LinkProps, TitleProps, DescriptionProps, IconProps {
|
|
9
11
|
name?: string;
|
|
10
12
|
appendRight?: VNode;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
export type TabType = 'default' | 'underlined' | 'rounded';
|
|
14
|
-
|
|
15
15
|
export interface TabItemProps {
|
|
16
16
|
item?: TabItemBase;
|
|
17
17
|
isActive?: boolean;
|
|
18
|
-
type?:
|
|
18
|
+
type?: TabsType;
|
|
19
19
|
onClick?: TabsControlProps['onChange'];
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { style } from '../../utils/style';
|
|
3
|
-
import {
|
|
4
|
-
import { type TabItemProps
|
|
3
|
+
import { renderTabItemInner } from './renderTabItemInner';
|
|
4
|
+
import { type TabItemProps } from './TabItem';
|
|
5
|
+
import { type TabsType } from './TabsControlProps';
|
|
5
6
|
|
|
6
|
-
const tabPaddingStyleMap: Record<
|
|
7
|
+
const tabPaddingStyleMap: Record<TabsType, string> = {
|
|
7
8
|
default: 'px-xs',
|
|
8
9
|
underlined: 'px-m',
|
|
9
|
-
|
|
10
|
+
animated: 'px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs',
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
const tabTextStyle = 'text-secondary-text hover:text-primary-main';
|
|
13
14
|
|
|
14
|
-
const activeTabTextStyleMap: Record<
|
|
15
|
+
const activeTabTextStyleMap: Record<TabsType, string> = {
|
|
15
16
|
default: 'text-black sm:text-white',
|
|
16
17
|
underlined: 'text-primary-main border-b-2',
|
|
17
|
-
|
|
18
|
+
animated: 'text-white sm:text-white',
|
|
18
19
|
};
|
|
19
20
|
|
|
20
|
-
const tabBgStyleMap: Record<
|
|
21
|
+
const tabBgStyleMap: Record<TabsType, string> = {
|
|
21
22
|
default: 'bg-white',
|
|
22
23
|
underlined: 'bg-white',
|
|
23
|
-
|
|
24
|
+
animated: 'p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96',
|
|
24
25
|
};
|
|
25
26
|
|
|
26
|
-
const activeTabBgStyleMap: Record<
|
|
27
|
+
const activeTabBgStyleMap: Record<TabsType, string> = {
|
|
27
28
|
default: 'sm:bg-primary-main',
|
|
28
29
|
underlined: 'bg-white',
|
|
29
|
-
|
|
30
|
+
animated: 'p-2 border-none bg-primary-main text-white h-20 w-96',
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
interface TabItemInnerProps extends TabItemProps {
|
|
@@ -34,10 +35,10 @@ interface TabItemInnerProps extends TabItemProps {
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
export const TabItemInner = JSX<TabItemInnerProps>(
|
|
37
|
-
({ tag = 'div', item = {}, isActive, type = 'default', onClick }) => {
|
|
38
|
+
({ tag = 'div', item = {}, isActive = false, type = 'default', onClick }) => {
|
|
38
39
|
const Tag: any = tag;
|
|
39
40
|
|
|
40
|
-
const { text, appendRight, ...link } = item;
|
|
41
|
+
const { text, description, icon, appendRight, ...link } = item;
|
|
41
42
|
|
|
42
43
|
return (
|
|
43
44
|
<Tag
|
|
@@ -48,8 +49,7 @@ export const TabItemInner = JSX<TabItemInnerProps>(
|
|
|
48
49
|
tabPaddingStyleMap[type],
|
|
49
50
|
isActive ? activeTabBgStyleMap[type] : tabBgStyleMap[type],
|
|
50
51
|
)}
|
|
51
|
-
role="
|
|
52
|
-
aria-selected={isActive}
|
|
52
|
+
role="tablist"
|
|
53
53
|
onClick={onClick}
|
|
54
54
|
{...link}
|
|
55
55
|
>
|
|
@@ -61,7 +61,13 @@ export const TabItemInner = JSX<TabItemInnerProps>(
|
|
|
61
61
|
isActive ? activeTabTextStyleMap[type] : tabTextStyle,
|
|
62
62
|
)}
|
|
63
63
|
>
|
|
64
|
-
|
|
64
|
+
{renderTabItemInner({
|
|
65
|
+
text,
|
|
66
|
+
description,
|
|
67
|
+
icon,
|
|
68
|
+
isActive,
|
|
69
|
+
type,
|
|
70
|
+
})}
|
|
65
71
|
{appendRight ? <div className="ml-xs">{appendRight}</div> : null}
|
|
66
72
|
</div>
|
|
67
73
|
</Tag>
|
|
@@ -7,10 +7,9 @@ import { type TabItemBase } from './TabItem';
|
|
|
7
7
|
import { TabsControl } from './TabsControl';
|
|
8
8
|
|
|
9
9
|
const FOUR_TABS: TabItemBase[] = [
|
|
10
|
-
{ text: 'Вкладка 1', href: '#test' },
|
|
11
|
-
{ text: 'Вкладка 2' },
|
|
12
|
-
{ text: 'Вкладка 3' },
|
|
13
|
-
{ text: 'Вкладка 4' },
|
|
10
|
+
{ text: 'Вкладка 1', href: '#test', title: 'Вкладка 1', description: 'Описание вкладки' },
|
|
11
|
+
{ text: 'Вкладка 2', href: '#test', title: 'Вкладка 2', description: 'Описание вкладки' },
|
|
12
|
+
{ text: 'Вкладка 3', href: '#test', title: 'Вкладка 3', description: 'Описание вкладки' },
|
|
14
13
|
];
|
|
15
14
|
|
|
16
15
|
const NINE_TABS: TabItemBase[] = [
|
|
@@ -22,18 +21,6 @@ const NINE_TABS: TabItemBase[] = [
|
|
|
22
21
|
{ text: 'Вкладка 9' },
|
|
23
22
|
];
|
|
24
23
|
|
|
25
|
-
const YEARS: TabItemBase[] = [
|
|
26
|
-
{ text: '2021' },
|
|
27
|
-
{ text: '2020' },
|
|
28
|
-
{ text: '2019' },
|
|
29
|
-
{ text: '2018' },
|
|
30
|
-
{ text: '2017' },
|
|
31
|
-
{ text: '2016' },
|
|
32
|
-
{ text: '2015' },
|
|
33
|
-
{ text: '2014' },
|
|
34
|
-
{ text: '2013' },
|
|
35
|
-
];
|
|
36
|
-
|
|
37
24
|
const Container: FC = ({ children }) => (
|
|
38
25
|
<div className="container grid grid-cols-12">{children}</div>
|
|
39
26
|
);
|
|
@@ -66,7 +53,7 @@ const ComponentWithScrollableTabs = ({ tabs }: { tabs: TabItemBase[] }) => {
|
|
|
66
53
|
);
|
|
67
54
|
};
|
|
68
55
|
|
|
69
|
-
const
|
|
56
|
+
const ComponentWithNewTab = ({ tabs }: { tabs: TabItemBase[] }) => {
|
|
70
57
|
const [activeTab, setActiveTab] = useState<TabItemBase | undefined>(tabs[0]);
|
|
71
58
|
|
|
72
59
|
return (
|
|
@@ -74,7 +61,7 @@ const ComponentWithRoundedTabs = ({ tabs }: { tabs: TabItemBase[] }) => {
|
|
|
74
61
|
<div className="flex">
|
|
75
62
|
<TabsControl
|
|
76
63
|
className="m-auto p-2xs rounded-md bg-main-gray"
|
|
77
|
-
tabsType="
|
|
64
|
+
tabsType="animated"
|
|
78
65
|
items={tabs}
|
|
79
66
|
value={activeTab}
|
|
80
67
|
onChange={setActiveTab}
|
|
@@ -95,9 +82,9 @@ export default {
|
|
|
95
82
|
<ComponentWithScrollableTabs tabs={NINE_TABS} />
|
|
96
83
|
</Container>
|
|
97
84
|
),
|
|
98
|
-
|
|
85
|
+
animated: (
|
|
99
86
|
<Container>
|
|
100
|
-
<
|
|
87
|
+
<ComponentWithNewTab tabs={FOUR_TABS} />
|
|
101
88
|
</Container>
|
|
102
89
|
),
|
|
103
90
|
};
|
|
@@ -5,7 +5,10 @@ import { type TabsControlProps } from './TabsControlProps';
|
|
|
5
5
|
|
|
6
6
|
export const TabsControl = JSX<TabsControlProps>(
|
|
7
7
|
({ className, tabsType = 'default', items = [], value, onChange }) => (
|
|
8
|
-
<div
|
|
8
|
+
<div
|
|
9
|
+
className={style('flex gap-x-2xs overflow-x-auto no-scrollbar', className)}
|
|
10
|
+
role="tabpanel"
|
|
11
|
+
>
|
|
9
12
|
{items.map(renderTab(value, onChange, tabsType))}
|
|
10
13
|
</div>
|
|
11
14
|
),
|