UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

176 lines (175 loc) 6.04 kB
import React, { RefObject } from 'react'; import { StandardProps } from '../../util/component-types'; interface ISplitVerticalRightPaneProps extends StandardProps { /** Set width of this pane. */ width?: number | string; /** Define this pane as the primary content pane. When the split is collapsed, this pane becomes full width. */ isPrimary: boolean; } export declare const SplitVerticalRightPane: { (_props: ISplitVerticalRightPaneProps): null; displayName: string; peek: { description: string; }; propName: string; propTypes: { children: any; width: any; isPrimary: any; }; defaultProps: { isPrimary: boolean; }; }; interface ISplitVerticalLeftPaneProps extends StandardProps { /** Set width of this pane. */ width?: number | string; /** Define this pane as the primary content pane. When the split is collapsed, this pane becomes full width. */ isPrimary: boolean; } interface ISplitVerticalProps extends StandardProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> { /** Render as expanded or collapsed. */ isExpanded: boolean; /** Allows animated expand and collapse behavior. */ isAnimated: boolean; /** Allows draggable resizing of the SplitVertical */ isResizeable: boolean; /** Called when the user is currently resizing the split with the Divider. */ onResizing: (height: number, { event, props, }: { event: MouseEvent | TouchEvent; props: ISplitVerticalProps; }) => void; /** Called when the user resizes the split with the Divider. */ onResize: (height: number, { event, props, }: { event: MouseEvent | TouchEvent; props: ISplitVerticalProps; }) => void; /** Use this prop to shift the collapsed position by a known value. */ collapseShift: number; } interface ISplitVerticalState { collapseAmount: number; isAnimated: boolean; isExpanded: boolean; } declare class SplitVertical extends React.Component<ISplitVerticalProps, ISplitVerticalState, {}> { static displayName: string; static peek: { description: string; categories: string[]; madeFrom: string[]; }; static _isPrivate: boolean; static propTypes: { className: any; children: any; isResizeable: any; isExpanded: any; isAnimated: any; onResizing: any; onResize: any; collapseShift: any; RightPane: any; LeftPane: any; Divider: any; }; static defaultProps: { isExpanded: boolean; isAnimated: boolean; collapseShift: number; onResizing: (...args: any[]) => void; onResize: (...args: any[]) => void; isResizeable: boolean; }; state: { isAnimated: boolean; isExpanded: boolean; collapseAmount: number; }; static RightPane: { (_props: ISplitVerticalRightPaneProps): null; displayName: string; peek: { description: string; }; propName: string; propTypes: { children: any; width: any; isPrimary: any; }; defaultProps: { isPrimary: boolean; }; }; static LeftPane: { (_props: ISplitVerticalLeftPaneProps): null; displayName: string; peek: { description: string; }; propName: string; propTypes: { children: any; width: any; isPrimary: any; }; defaultProps: { isPrimary: boolean; }; }; static Divider: { (_props: StandardProps): null; displayName: string; peek: { description: string; }; propName: string; propTypes: { children: any; }; }; private innerRef; private leftPaneRef; private rightPaneRef; secondaryStartRect: DOMRect | null; getPanes: () => { right: ISplitVerticalRightPaneProps; left: ISplitVerticalLeftPaneProps; primary: ISplitVerticalRightPaneProps | ISplitVerticalLeftPaneProps; secondary: ISplitVerticalRightPaneProps | ISplitVerticalLeftPaneProps; primaryRef: React.RefObject<HTMLDivElement>; secondaryRef: React.RefObject<HTMLDivElement>; }; panes: { right: ISplitVerticalRightPaneProps; left: ISplitVerticalLeftPaneProps; primary: ISplitVerticalRightPaneProps | ISplitVerticalLeftPaneProps; secondary: ISplitVerticalRightPaneProps | ISplitVerticalLeftPaneProps; primaryRef: React.RefObject<HTMLDivElement>; secondaryRef: React.RefObject<HTMLDivElement>; }; applyDeltaToSecondaryWidth: (dX: number, isExpanded: boolean, secondaryStartRect: ClientRect | DOMRect, secondaryRef: React.RefObject<HTMLDivElement>, secondary: ISplitVerticalRightPaneProps | ISplitVerticalLeftPaneProps, right: ISplitVerticalRightPaneProps, innerRef: React.RefObject<HTMLDivElement>, primaryRef: React.RefObject<HTMLDivElement>, collapseShift?: number) => number; expandSecondary: () => void; collapseSecondary: (collapseAmount: number) => void; disableAnimation: (innerRef: RefObject<HTMLDivElement>, secondaryRef: RefObject<HTMLDivElement>, primaryRef: RefObject<HTMLDivElement>) => void; resetAnimation: (innerRef: RefObject<HTMLDivElement>, secondaryRef: RefObject<HTMLDivElement>, primaryRef: RefObject<HTMLDivElement>) => void; handleDragStart: () => void; handleDrag: ({ dX }: { dX: number; }, { event }: { event: MouseEvent | TouchEvent; }) => void; handleDragEnd: ({ dX }: { dX: number; }, { event }: { event: MouseEvent | TouchEvent; }) => void; UNSAFE_componentWillReceiveProps(nextProps: ISplitVerticalProps): void; componentDidMount(): void; render(): React.ReactNode; } export default SplitVertical;