PromucFlow_constructor/app/client/src/widgets/TabsWidget/constants.ts
Paul Li 6df4ebc1f0
feat: Tab widget should have navigation arrows when the tabs don't fit (#8630)
* feat: Tab widget should have navigation arrows when the tabs don't fit

-- Add scroll navigation control

* feat: Tab widget should have navigation arrows when the tabs don't fit

-- Divide tabs navigator control into both sides of contents

* feat: Tab widget should have navigation arrows when the tabs don't fit

-- Implement navigation per slide

* feat: Tab widget should have navigation arrows when the tabs don't fit

-- Refactor on useEffect dependencies and some calculations
-- Introduce if-else statement for readability and consistency

* feat: Tab widget should have navigation arrows when the tabs don't fit

-- Add class names for scroll navigation controls
-- Narrow the width of Tab widget in dsl
-- Add a Cypress test case for checking the presence of scroll navigation controls

Co-authored-by: Arpit Mohan <arpit@appsmith.com>
2022-01-12 13:04:28 +08:00

37 lines
770 B
TypeScript

import { WidgetProps } from "widgets/BaseWidget";
export interface TabContainerWidgetProps extends WidgetProps {
tabId: string;
}
export interface TabsWidgetProps<T extends TabContainerWidgetProps>
extends WidgetProps {
isVisible?: boolean;
shouldScrollContents: boolean;
tabs: Array<{
id: string;
label: string;
widgetId: string;
isVisible?: boolean;
}>;
tabsObj: Record<
string,
{
id: string;
label: string;
widgetId: string;
isVisible?: boolean;
index: number;
}
>;
shouldShowTabs: boolean;
children: T[];
snapColumns?: number;
onTabSelected?: string;
snapRows?: number;
defaultTab: string;
selectedTabWidgetId: string;
}
export const SCROLL_NAV_CONTROL_CONTAINER_WIDTH = 30;