UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

174 lines (173 loc) 6.05 kB
import React, { RefObject } from 'react'; import { StandardProps } from '../../util/component-types'; interface ISplitHorizontalTopPaneProps extends StandardProps { /** Set height of this pane. */ height?: number | string; /** Define this pane as the primary content pane. When the split is collapsed, this pane becomes full height. */ isPrimary: boolean; } export declare const SplitHorizontalTopPane: { (_props: ISplitHorizontalTopPaneProps): null; displayName: string; peek: { description: string; }; propName: string; propTypes: { children: any; height: any; isPrimary: any; }; defaultProps: { isPrimary: boolean; }; }; interface ISplitHorizontalBottomPaneProps extends StandardProps { /** Set height of this pane. */ height?: number | string; /** Define this pane as the primary content pane. When the split is collapsed, this pane becomes full height. */ isPrimary: boolean; } interface ISplitHorizontalDividerProps extends StandardProps { } export interface ISplitHorizontalProps extends StandardProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> { /** Render as expanded or collapsed. */ isExpanded: boolean; /** Allows animated expand and collapse behavior. */ isAnimated: boolean; /** Called when the user is currently resizing the split with the Divider. */ onResizing: (height: number, { event, props, }: { event: MouseEvent | TouchEvent; props: ISplitHorizontalProps; }) => void; /** Called when the user resizes the split with the Divider. */ onResize: (height: number, { event, props, }: { event: MouseEvent | TouchEvent; props: ISplitHorizontalProps; }) => void; /** Use this prop to shift the collapsed position by a known value. */ collapseShift: number; } interface ISplitHorizontalState { collapseAmount: number; isAnimated: boolean; isExpanded: boolean; } declare class SplitHorizontal extends React.Component<ISplitHorizontalProps, ISplitHorizontalState, {}> { static displayName: string; static peek: { description: string; categories: string[]; madeFrom: string[]; }; static _isPrivate: boolean; static propTypes: { className: any; children: any; isExpanded: any; isAnimated: any; onResizing: any; onResize: any; collapseShift: any; TopPane: any; BottomPane: any; Divider: any; }; static defaultProps: { isExpanded: boolean; isAnimated: boolean; collapseShift: number; onResizing: (...args: any[]) => void; onResize: (...args: any[]) => void; }; state: { collapseAmount: number; isAnimated: boolean; isExpanded: boolean; }; static TopPane: { (_props: ISplitHorizontalTopPaneProps): null; displayName: string; peek: { description: string; }; propName: string; propTypes: { children: any; height: any; isPrimary: any; }; defaultProps: { isPrimary: boolean; }; }; static BottomPane: { (_props: ISplitHorizontalBottomPaneProps): null; displayName: string; peek: { description: string; }; propName: string; propTypes: { children: any; height: any; isPrimary: any; }; defaultProps: { isPrimary: boolean; }; }; static Divider: { (_props: ISplitHorizontalDividerProps): null; displayName: string; peek: { description: string; }; propName: string; propTypes: { children: any; }; }; private innerRef; private topPaneRef; private bottomPaneRef; secondaryStartRect: DOMRect | null; getPanes: () => { top: ISplitHorizontalTopPaneProps; bottom: ISplitHorizontalBottomPaneProps; primary: ISplitHorizontalTopPaneProps | ISplitHorizontalBottomPaneProps; secondary: ISplitHorizontalTopPaneProps | ISplitHorizontalBottomPaneProps; primaryRef: React.RefObject<HTMLDivElement>; secondaryRef: React.RefObject<HTMLDivElement>; }; panes: { top: ISplitHorizontalTopPaneProps; bottom: ISplitHorizontalBottomPaneProps; primary: ISplitHorizontalTopPaneProps | ISplitHorizontalBottomPaneProps; secondary: ISplitHorizontalTopPaneProps | ISplitHorizontalBottomPaneProps; primaryRef: React.RefObject<HTMLDivElement>; secondaryRef: React.RefObject<HTMLDivElement>; }; applyDeltaToSecondaryHeight: (dY: number, isExpanded: boolean, secondaryStartRect: ClientRect | DOMRect, secondaryRef: React.RefObject<HTMLDivElement>, secondary: ISplitHorizontalTopPaneProps | ISplitHorizontalBottomPaneProps, bottom: ISplitHorizontalBottomPaneProps, 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: ({ dY }: { dY: number; }, { event }: { event: MouseEvent | TouchEvent; }) => void; handleDragEnd: ({ dY }: { dY: number; }, { event }: { event: MouseEvent | TouchEvent; }) => void; UNSAFE_componentWillReceiveProps(nextProps: ISplitHorizontalProps): void; componentDidMount(): void; render(): React.ReactNode; } export default SplitHorizontal;