From 4abfa80ead94d65892c683ce4fe2abeed6e97288 Mon Sep 17 00:00:00 2001 From: el-makarova Date: Tue, 20 Feb 2024 18:00:44 +0300 Subject: [PATCH] feat(AdaptiveTabs): allow to control some properties in More control --- src/components/AdaptiveTabs/AdaptiveTabs.tsx | 5 ++++- src/components/AdaptiveTabs/README.md | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/AdaptiveTabs/AdaptiveTabs.tsx b/src/components/AdaptiveTabs/AdaptiveTabs.tsx index a94c69c5..8fe38960 100644 --- a/src/components/AdaptiveTabs/AdaptiveTabs.tsx +++ b/src/components/AdaptiveTabs/AdaptiveTabs.tsx @@ -117,6 +117,8 @@ export interface AdaptiveTabsProps { size?: TabsSize; /** Allows you not to specify activeTab */ allowNotSelected?: boolean; + /** Settings to control popup with hidden tabs list */ + moreControlProps?: Pick; } interface AdaptiveTabsState { @@ -858,7 +860,7 @@ export class AdaptiveTabs extends React.Component, Adapt renderSelect() { const activeTabID = this.activeTab; const {firstHiddenTabIndex, tabChosenFromSelectId} = this.state; - const {items} = this.props; + const {items, moreControlProps} = this.props; const itemsForSelect = items .slice(firstHiddenTabIndex, items.length) @@ -880,6 +882,7 @@ export class AdaptiveTabs extends React.Component, Adapt filterable={false} renderControl={this.renderSwitcherForMoreSelect} onOpenChange={this.handleOpenSelectChange} + {...moreControlProps} /> ); } diff --git a/src/components/AdaptiveTabs/README.md b/src/components/AdaptiveTabs/README.md index c5facae5..7eaab2d7 100644 --- a/src/components/AdaptiveTabs/README.md +++ b/src/components/AdaptiveTabs/README.md @@ -23,6 +23,7 @@ with the caption `More'. If only one tab fits, the select is displayed instead o | wrapTo | `wrapTo?(item: TabItemProps, node: React.ReactNode, index: number): void` | | | Allows to wrap TabItem into another component or render custom tab | | className | `String` | | | Class name for the tabs container | | [breakpointsConfig](#breakpointsConfig) | `Record` | | | Breakpoints config which control the thersholds of tab size. | +| moreControlProps | `{popupWidth?: 'fit' \| number; virtualizationThreshold?: number;}` | | | Settings to control popup with hidden tabs list | ### breakpointsConfig