import React from 'react'; import type { BaseProps, BaseHtmlProps } from '../../wui-core/src/iCore'; export type TabPosition = 'top' | 'bottom' | 'left' | 'right' | string; export type TabType = 'line' | 'card' | 'editable-card' | 'fill' | 'primary' | 'trangle' | 'fade' | 'trapezoid' | string; export type MoreType = 'moreTabsSelect' | 'moreTabsArrow'; export interface EntranceProps extends TabsProps, Omit, 'onChange' | 'onDrag' | 'tabIndex'> { extraContent?: React.ReactNode; tabBarExtraContent?: React.ReactNode; tabPosition?: TabPosition; tabBarPosition?: TabPosition; style?: React.CSSProperties; type?: TabType; } export interface TabsProps extends BaseProps { destroyInactiveTabPane?: boolean; renderTabBar?: (p: TabsProps, node: React.ReactNode) => React.ReactNode; renderTabContent?: () => React.ReactNode; onChange?: (key: string) => void; tabBarPosition?: string; tabBarStyle?: React.CSSProperties | TabType | undefined; activeKey?: string; defaultActiveKey?: string; onTabClick?: (key: string) => void; hideAdd?: boolean; onEdit?: (key: string, c: string) => void; onPopMenuClick?: (val: { type: string; tabKey: string; }) => void; onPrevClick?: (e: React.MouseEvent) => void; onTabScroll?: (position: Record, e?: React.MouseEvent) => void; onNextClick?: (e: React.MouseEvent) => void; extraContent?: React.ReactNode; animated?: boolean; tabIndex?: string; inkBarAnimated?: boolean; moreType?: MoreType; tabBarClassName?: string; tabContentClassName?: string; dragable?: boolean; onDrag?: (result: object) => void; closable?: boolean; closeIcon?: React.ReactNode; scrollAnimated?: boolean; useTransform3d?: boolean; trigger?: string[]; popMenu?: (val?: string) => { key: string; text: string; }[]; onPopMenu?: (open: boolean, tab: string) => void; addIcon?: React.ReactElement; moreIcon?: React.ReactElement; id?: string; items?: { key: string; tab: React.ReactElement | string; children: any; style?: React.CSSProperties; forceRender?: boolean; placeholder?: any; closeIcon?: React.ReactElement; closable?: boolean; fieldid?: string; id?: string; disabled?: boolean; nid?: string; uitype?: string; }[]; centered?: boolean; } export interface TabsState { activeKey?: string; disableCloseOth?: boolean; contextmenuType?: Record | null; } export interface TabProps { active?: boolean; value?: string; clsfix?: string; tabClick?: (key: string) => void; onClick?: (key: string) => void; } export interface InkTabBarProps { onTabClick?: () => void; } export interface InkTabBarNodeProps { clsPrefix?: string; styles: React.CSSProperties; inkBarAnimated?: boolean; saveRef?: (ref: string) => React.LegacyRef; getRef?: (ref: string) => HTMLElement; direction?: string; } export interface SaveRefProps { children?: (saveRef: (name: string) => React.LegacyRef, getRef: (name: string) => HTMLElement) => React.ReactNode; } export interface ScrollableInkTabBarProps { children?: (() => void) | null; onTabClick?: (key: string) => void; } export interface ScrollableTabBarNodeProps extends BaseProps { activeKey?: string; getRef?: (name: string) => HTMLElement; saveRef?: (name: string) => React.LegacyRef; tabBarPosition?: TabPosition; scrollAnimated?: boolean; onPrevClick?: (e: React.MouseEvent) => void; onNextClick?: (e: React.MouseEvent) => void; navWrapper?: (child: React.ReactNode) => React.ReactNode; children: React.ReactNode; prevIcon?: React.ReactNode; nextIcon?: React.ReactNode; direction?: string; onTabClick?: (key: string) => void; moreType?: MoreType; panels?: any; isEditNum?: number; tabBarStyle?: React.CSSProperties | TabType | undefined; onEdit?: (key: string, c: string) => void; moreIcon?: React.ReactElement; } export interface ScrollableTabBarNodeState { next?: boolean; prev?: boolean; menuArr?: any[] | string; } export interface SearchTabsProps { clsfix?: string; onChange?: (key: string) => void; value?: string; } export interface SearchTabsState { activeValue?: string; } export interface TabBarRootNodeProps extends BaseProps { tabBarPosition?: TabPosition; extraContent?: React.ReactNode; onKeyDown?: () => void; saveRef?: (name: string) => React.LegacyRef; direction?: 'ltr' | 'rtl'; tabBarClassName?: string; } export interface TabBarTabsNodeProps extends BaseHtmlProps { activeKey?: string; panels?: React.ReactNode[]; tabBarGutter?: number; onTabClick?: (key: string) => void; saveRef?: (name: string) => React.LegacyRef; renderTabBarNode?: (node: any) => React.ReactChild; tabBarPosition?: TabPosition; direction?: 'ltr' | 'rtl'; dragable?: boolean; onDrag?: (result: object) => void; tabBarStyle?: React.CSSProperties | TabType | undefined; items?: { key: string; tab: React.ReactElement | string; children: any; style?: React.CSSProperties; forceRender?: boolean; placeholder?: any; closeIcon?: React.ReactElement; closable?: boolean; fieldid?: string; id?: string; disabled?: boolean; nid?: string; uitype?: string; }[]; } export interface TabContentProps { animated?: boolean; animatedWithMargin?: boolean; clsPrefix?: string; children?: React.ReactNode; activeKey?: string; style?: React.CSSProperties; tabBarPosition: string; destroyInactiveTabPane?: any; tabContentClassName?: string; items?: { key: string; tab: React.ReactElement | string; children: any; style?: React.CSSProperties; forceRender?: boolean; placeholder?: any; closeIcon?: React.ReactElement; closable?: boolean; fieldid?: string; id?: string; disabled?: boolean; nid?: string; uitype?: string; }[]; } export interface TabPaneProps extends Omit, 'placeholder'> { rootclsPrefix?: string; active?: boolean; destroyInactiveTabPane?: boolean; forceRender?: boolean; placeholder?: React.ReactNode; tab?: React.ReactNode; disabled?: boolean; closable?: boolean; closeIcon?: React.ReactNode; } export interface DragSnapshot { draggingOver: null; isDragging: boolean; isDropAnimating: boolean; [name: string]: any; } export interface PopMenuProps extends BaseProps { items?: { text?: string; key?: string; }[]; onMenuClick?: (val: string, activeKey: string) => void; onPopMenuIsShow: (open: boolean) => void; } export interface PopMenuState { visible?: boolean; activeKey?: string; position?: Record; }