Merge branch 'release' of https://github.com/appsmithorg/appsmith into release
This commit is contained in:
commit
409c2c09c4
|
|
@ -9,6 +9,7 @@ interface TabsComponentProps extends ComponentProps {
|
|||
children?: ReactNode;
|
||||
shouldScrollContents?: boolean;
|
||||
selectedTabId: string;
|
||||
shouldShowTabs: boolean;
|
||||
onTabChange: (tabId: string) => void;
|
||||
tabs: Array<{
|
||||
id: string;
|
||||
|
|
@ -112,22 +113,26 @@ const TabsComponent = (props: TabsComponentProps) => {
|
|||
}, [props.shouldScrollContents]);
|
||||
return (
|
||||
<TabsContainerWrapper ref={tabContainerRef}>
|
||||
<TabsContainer>
|
||||
{props.tabs &&
|
||||
props.tabs.map((tab, index) => (
|
||||
<StyledText
|
||||
onClick={(event: React.MouseEvent<HTMLDivElement>) => {
|
||||
props.onTabChange(tab.id);
|
||||
event.stopPropagation();
|
||||
}}
|
||||
selected={props.selectedTabId === tab.id}
|
||||
key={index}
|
||||
>
|
||||
{tab.label}
|
||||
</StyledText>
|
||||
))}
|
||||
<StyledTab></StyledTab>
|
||||
</TabsContainer>
|
||||
{props.shouldShowTabs ? (
|
||||
<TabsContainer>
|
||||
{props.tabs &&
|
||||
props.tabs.map((tab, index) => (
|
||||
<StyledText
|
||||
onClick={(event: React.MouseEvent<HTMLDivElement>) => {
|
||||
props.onTabChange(tab.id);
|
||||
event.stopPropagation();
|
||||
}}
|
||||
selected={props.selectedTabId === tab.id}
|
||||
key={index}
|
||||
>
|
||||
{tab.label}
|
||||
</StyledText>
|
||||
))}
|
||||
<StyledTab></StyledTab>
|
||||
</TabsContainer>
|
||||
) : (
|
||||
undefined
|
||||
)}
|
||||
<ChildrenWrapper>
|
||||
<ScrollableCanvasWrapper
|
||||
{...props}
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ const WidgetConfigResponse: WidgetConfigReducerState = {
|
|||
{ label: "Tab 1", id: "tab1" },
|
||||
{ label: "Tab 2", id: "tab2" },
|
||||
],
|
||||
shouldShowTabs: true,
|
||||
selectedTab: "Tab 1",
|
||||
blueprint: {
|
||||
view: [
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ export interface TabsWidgetProps<T extends TabContainerWidgetProps>
|
|||
id: string;
|
||||
label: string;
|
||||
}>;
|
||||
shouldShowTabs: boolean;
|
||||
children: T[];
|
||||
snapColumns?: number;
|
||||
snapRows?: number;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user