UNPKG

@jdcfe/yep-react

Version:

一套移动端的React组件库

63 lines (62 loc) 2.06 kB
import * as React from 'react'; export declare type Tab = { title: string; }; export declare type underlineProps = { style: React.CSSProperties; className: string; }; export interface DefaultTabBarProps { prefixCls?: string; style?: React.CSSProperties; className?: string; activeTab: number; onTabClick?: (tab: any, index: number) => void; goToTab?: (index: number) => void; tabBarPosition?: 'top' | 'bottom' | 'left' | 'right'; page?: number; tabs: Tab[]; renderTab: (t: Tab) => React.ReactNode; tabBarTextStyle?: React.CSSProperties; tabBarActiveTextColor?: string; tabBarInactiveTextColor?: string; tabBarBackgroundColor?: string; tabBarUnderlineStyle: React.CSSProperties; renderUnderline: (underlineProps: underlineProps) => React.ReactNode; animated: boolean; } export interface State { transform?: string; isMoving?: boolean; showPrev?: boolean; showNext?: boolean; } export default class DefaultTabBar extends React.PureComponent<DefaultTabBarProps, State> { layout: HTMLDivElement; static defaultProps: { prefixCls: string; onTabClick: () => null; activeTab: number; page: number; animated: boolean; tabBarBackgroundColor: string; }; constructor(props: DefaultTabBarProps); componentWillReceiveProps(nextProps: DefaultTabBarProps): void; onPan: { onPanStart: () => void; onPanMove: (status: any) => void; onPanEnd: () => void; setCurrentOffset: (offset: React.ReactText) => React.ReactText; }; isTabBarVertical(position?: "bottom" | "left" | "right" | "top" | undefined): boolean; getTransformByIndex: (props: DefaultTabBarProps) => { transform: string; showPrev: boolean; showNext: boolean; }; getTabSize(page: number, tabLength: number): number; onClick: (index: number) => void; renderTab: (t: Tab, i: number, size: number, isTabBarVertical: boolean) => JSX.Element; render(): JSX.Element; }