UNPKG

@jdcfe/yep-react

Version:

一套移动端的React组件库

88 lines (87 loc) 3.16 kB
import * as React from 'react'; import DefaultTabBar from './DefaultTabBar'; export interface TabsProps { prefixCls?: string; className?: string; style?: React.CSSProperties; defaultIndex?: number; children: React.ReactNode; onChange?: (index: number) => void; tabBarPosition?: 'top' | 'bottom' | 'left' | 'right'; tabDirection?: 'horizontal' | 'vertical'; animated?: boolean; swipeable?: boolean; usePaged?: boolean; renderTabBar?: ((props: any) => React.ReactNode) | false; onTabClick?: () => void; tabBarActiveTextColor?: string; tabBarBackgroundColor?: string; tabBarInactiveTextColor?: string; tabBarTextStyle?: React.CSSProperties; tabBarUnderlineStyle?: React.CSSProperties; renderTab?: (props: any) => React.ReactNode; distanceToChangeTab?: number; page?: number; } export interface State { isMoving: boolean; currentTab: number; contentPos: string; } export default class Tabs extends React.PureComponent<TabsProps, State> { static defaultProps: { prefixCls: string; style: {}; defaultIndex: number; className: string; onChange: () => null; tabBarPosition: string; tabDirection: string; animated: boolean; swipeable: boolean; usePaged: boolean; onTabClick: () => null; distanceToChangeTab: number; }; static TabPanel: React.FunctionComponent<import("./TabPanel").TabPanelProps>; static DefaultTabBar: typeof DefaultTabBar; prevCurrentTab: number; nextCurrentTab: number; layout: HTMLDivElement; constructor(props: TabsProps); componentDidMount(): void; componentDidUpdate(): void; getTabIndex(props: TabsProps): number; getContentPosByIndex(index: number, isVertical: boolean): string; isTabVertical(direction?: "horizontal" | "vertical" | undefined): boolean; createContentLayoutRef(el: HTMLDivElement): void; tabClickGoToTab(index: number): void; goToTab(index: number, force?: boolean, usePaged?: boolean | undefined): boolean; onSwipe(e: any): void; onPan: { onPanStart: (status: any) => void; onPanMove: (status: any) => void; onPanEnd: () => void; setCurrentOffset: (offset: React.ReactText) => React.ReactText; }; getOffsetIndex: (current: number, width: number, threshold?: number | undefined) => number; getTabBarBaseProps(): { activeTab: number; animated: boolean | undefined; goToTab: (index: number) => void; onTabClick: (() => void) | undefined; tabBarActiveTextColor: string | undefined; tabBarBackgroundColor: string | undefined; tabBarInactiveTextColor: string | undefined; tabBarPosition: "bottom" | "left" | "right" | "top" | undefined; tabBarTextStyle: React.CSSProperties | undefined; tabBarUnderlineStyle: React.CSSProperties | undefined; tabs: { title: any; key: number; }[]; }; renderTabBar(tabBarProps: any): {} | null | undefined; renderContent(): JSX.Element; render(): JSX.Element; }