@douyinfe/semi-ui
Version:
A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.
55 lines (54 loc) • 2.48 kB
TypeScript
import React, { MouseEvent, ReactNode } from 'react';
import PropTypes from 'prop-types';
import { DropdownProps } from '../dropdown';
import { TabBarProps, PlainTab } from './interface';
export interface TabBarState {
endInd: number;
rePosKey: number;
startInd: number;
uuid: string;
currentVisibleItems: string[];
}
export interface OverflowItem extends PlainTab {
key: string;
active: boolean;
}
declare class TabBar extends React.Component<TabBarProps, TabBarState> {
static propTypes: {
activeKey: PropTypes.Requireable<string>;
className: PropTypes.Requireable<string>;
collapsible: PropTypes.Requireable<boolean>;
list: PropTypes.Requireable<any[]>;
onTabClick: PropTypes.Requireable<(...args: any[]) => any>;
size: PropTypes.Requireable<string>;
style: PropTypes.Requireable<object>;
tabBarExtraContent: PropTypes.Requireable<PropTypes.ReactNodeLike>;
tabPosition: PropTypes.Requireable<string>;
type: PropTypes.Requireable<string>;
closable: PropTypes.Requireable<boolean>;
deleteTabItem: PropTypes.Requireable<(...args: any[]) => any>;
more: PropTypes.Requireable<NonNullable<number | object>>;
};
constructor(props: TabBarProps);
componentDidMount(): void;
componentDidUpdate(prevProps: any): void;
renderIcon(icon: ReactNode): ReactNode;
renderExtra(): ReactNode;
handleItemClick: (itemKey: string, e: MouseEvent<Element>) => void;
handleKeyDown: (event: React.KeyboardEvent, itemKey: string, closable: boolean) => void;
renderTabItem: (panel: PlainTab) => ReactNode;
scrollTabItemIntoViewByKey: (key: string, logicalPosition?: ScrollLogicalPosition) => void;
scrollActiveTabItemIntoView: (logicalPosition?: ScrollLogicalPosition) => void;
renderTabComponents: (list: Array<PlainTab>) => Array<ReactNode>;
handleArrowClick: (items: Array<OverflowItem>, pos: 'start' | 'end') => void;
renderCollapse: (items: Array<OverflowItem>, icon: ReactNode, pos: 'start' | 'end') => ReactNode;
renderOverflow: (items: any[]) => Array<ReactNode>;
renderCollapsedTab: () => ReactNode;
renderWithMoreTrigger: () => ReactNode;
renderMoreDropdown: (panels: PlainTab[], dropDownProps: DropdownProps, trigger: ReactNode) => ReactNode;
render(): ReactNode;
private _isActive;
private _getBarItemKeyByItemKey;
private _getItemKeyByBarItemKey;
}
export default TabBar;