choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
44 lines (43 loc) • 2.81 kB
TypeScript
import { JSXElementConstructor, Key, ReactElement, ReactNode } from 'react';
import { TabsPosition } from './enum';
import { TabGroupProps } from './TabGroup';
import { TabPaneProps } from './TabPane';
import { GroupPanelMap, TabsCustomized } from './Tabs';
export declare function toGroups(children: ReactNode): ReactElement<TabGroupProps>[];
export declare function toArray(children: ReactNode): ReactElement<TabPaneProps>[];
export declare function getDefaultActiveKeyInGroup(panelMap: Map<string, TabPaneProps>): string | undefined;
export declare function getDefaultActiveKey(totalPanelsMap: Map<string, TabPaneProps>, groupedPanelsMap: Map<string, GroupPanelMap>, option: {
activeKey?: string | undefined;
defaultActiveKey?: string | undefined;
}): string | undefined;
export declare function getDefaultGroupKey(groupedPanelsMap: Map<string, GroupPanelMap>): string | undefined;
export declare function getActiveKeyByGroupKey(groupedPanelsMap: Map<string, GroupPanelMap>, key: string): string | undefined;
export declare function generateKey(key: Key | undefined | null, index: number): string;
export declare function getActiveIndex(map: Map<string, TabPaneProps>, activeKey: string | undefined): number;
export declare function setTransform(style: CSSStyleDeclaration, v?: string): void;
export declare function isTransformSupported(style: CSSStyleDeclaration): boolean;
export declare function setTransition(style: CSSStyleDeclaration, v?: string): void;
export declare function getTransformPropValue(v: string): {
transform: string;
WebkitTransform: string;
};
export declare function isVertical(tabBarPosition: TabsPosition | undefined): boolean;
export declare function getTransformByIndex(index: number, tabBarPosition: TabsPosition | undefined): string;
export declare function getMarginStyle(index: number, tabBarPosition: TabsPosition | undefined): {
[x: string]: string;
};
export declare function getStyle(el: HTMLElement, property: string): number;
export declare function setPxStyle(el: HTMLElement, value: string | number, vertical: boolean): void;
export declare function getDataAttr(props: object): object;
export declare function getLeft(tabNode: HTMLElement, wrapperNode: HTMLElement): number;
export declare function getTop(tabNode: HTMLElement, wrapperNode: HTMLElement): number;
export declare function getHeader(props: TabPaneProps): ReactNode;
interface normalizeOptions {
tabDraggable?: boolean | undefined;
tabTitleEditable?: boolean | undefined;
tabCountHideable?: boolean | undefined;
}
export declare function normalizePanes(children: ReactNode, customized?: TabsCustomized | undefined | null, options?: normalizeOptions): [Map<string, TabPaneProps & {
type: string | JSXElementConstructor<any>;
}>, Map<string, GroupPanelMap>];
export {};