UNPKG

@sap-ux/ui-components

Version:
103 lines 2.78 kB
import React from 'react'; import './UISplitter.scss'; export interface UISplitterProps { type: UISplitterType; vertical?: boolean; hidden?: boolean; onResizeStart?: () => void; onResize: (position: number) => boolean; onResizeEnd?: () => void; onToggle?: () => void; title?: string; splitterLayoutType?: UISplitterLayoutType; /** * Tabindex of splitter element. * * @default 0 */ splitterTabIndex?: -1 | 0; } export declare enum UISplitterType { Resize = "resize", Toggle = "toggle" } export declare enum UISplitterLayoutType { Standard = "standard", Compact = "compact" } /** * */ export declare class UISplitter extends React.Component<UISplitterProps> { private readonly splitterOverlay; private readonly mousedownPosition; private readonly rootRef; private readonly size; private readonly compactSize; private animationFrame?; /** * * @param props */ constructor(props: UISplitterProps); /** * Method called on mousedown over splitter. * Method would start resize session. * * @param {React.MouseEvent} event Mouse. */ private startSplitterMove; /** * Method called when resize session is in progress and user moves mouse. * * @param {React.MouseEvent} event Mouse event. */ private doMousemoveResize; /** * Method which receives new delta position of splitter and updates DOM with calling callback. * * @param {number} deltaPosition Delta position of splitter. */ private doResize; /** * Method called on mouseup or mouseleave events. * Method would end resize session. */ private stopMousemoveResize; /** * Method to update splitter DOM and events depending on if resize started or ended. * * @param {boolean} start Resize is started or ended. */ private updateSplitterEvents; /** * Method called when clicked over splitter and splitter type is 'Toggle'. */ private toggleSplitter; /** * Gets icon. * * @param type * @param splitterLayoutType * @returns {string} */ private getIcon; /** * Method called when keydown events fired while splitter is focused. * Method enables support for resize using keyboard. * * @param {React.KeyboardEvent<HTMLDivElement>} event KeyDown event. */ private onKeyDown; /** * Method returns class names string depending on props and component state. * * @returns {number} Minimal size of section. */ getClassNames(): string; /** * @returns {React.ReactElement} */ render(): React.ReactElement; } //# sourceMappingURL=UISplitter.d.ts.map