UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

63 lines (62 loc) 2.68 kB
/// <reference types="react" /> import * as React from 'react'; import { BaseComponent } from '../../Utilities'; import { IScrollablePane, IScrollablePaneProps } from './ScrollablePane.types'; import { Sticky } from '../../Sticky'; export interface IScrollablePaneContext { scrollablePane?: { subscribe: (handler: (container: HTMLElement, stickyContainer: HTMLElement) => void) => void; unsubscribe: (handler: (container: HTMLElement, stickyContainer: HTMLElement) => void) => void; addSticky: (sticky: Sticky) => void; removeSticky: (sticky: Sticky) => void; updateStickyRefHeights: () => void; sortSticky: (sticky: Sticky) => void; notifySubscribers: (sort?: boolean) => void; }; } export interface IScrollablePaneState { stickyTopHeight: number; stickyBottomHeight: number; scrollbarWidth: number | undefined; scrollbarHeight: number | undefined; } export declare class ScrollablePaneBase extends BaseComponent<IScrollablePaneProps, IScrollablePaneState> implements IScrollablePane { static childContextTypes: React.ValidationMap<IScrollablePaneContext>; private _root; private _stickyAboveRef; private _stickyBelowRef; private _contentContainer; private _subscribers; private _stickies; private _mutationObserver; private _notifyThrottled; constructor(props: IScrollablePaneProps); readonly root: HTMLDivElement | null; readonly stickyAbove: HTMLDivElement | null; readonly stickyBelow: HTMLDivElement | null; readonly contentContainer: HTMLDivElement | null; getChildContext(): IScrollablePaneContext; componentDidMount(): void; componentWillUnmount(): void; shouldComponentUpdate(nextProps: IScrollablePaneProps, nextState: IScrollablePaneState): boolean; componentDidUpdate(prevProps: IScrollablePaneProps, prevState: IScrollablePaneState): void; render(): JSX.Element; setStickiesDistanceFromTop(): void; forceLayoutUpdate(): void; subscribe: (handler: Function) => void; unsubscribe: (handler: Function) => void; addSticky: (sticky: Sticky) => void; removeSticky: (sticky: Sticky) => void; sortSticky: (sticky: Sticky) => void; updateStickyRefHeights: () => void; notifySubscribers: () => void; getScrollPosition: () => number; private _checkStickyStatus(sticky); private _addToStickyContainer; private _removeStickyFromContainers; private _onWindowResize; private _getStickyContainerStyle; private _getScrollbarWidth(); private _getScrollbarHeight(); private _onScroll; }