UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

41 lines (40 loc) 1.57 kB
/// <reference types="react" /> import * as PropTypes from 'prop-types'; import { BaseComponent } from '../../Utilities'; import { IStickyProps } from './Sticky.types'; export interface IStickyState { isStickyTop: boolean; isStickyBottom: boolean; placeholderHeight?: number; } export interface IStickyContext { scrollablePane: PropTypes.Requireable<object>; } export declare class Sticky extends BaseComponent<IStickyProps, IStickyState> { static defaultProps: IStickyProps; static contextTypes: IStickyContext; context: { scrollablePane: { subscribe: (handler: Function) => void; unsubscribe: (handler: Function) => void; addStickyHeader: (sticky: Sticky) => void; removeStickyHeader: (sticky: Sticky) => void; addStickyFooter: (sticky: Sticky) => void; removeStickyFooter: (sticky: Sticky) => void; notifySubscribers: (sort?: boolean) => void; }; }; content: HTMLElement; root: HTMLElement; constructor(props: IStickyProps); componentDidMount(): void; componentWillUnmount(): void; componentDidUpdate(prevProps: IStickyProps, prevState: IStickyState): void; shouldComponentUpdate(nextProps: IStickyProps, nextState: IStickyState): boolean; setPlaceholderHeight(height: number): void; render(): JSX.Element; private _onScrollEvent(headerBound, footerBound); private _setSticky(callback); private _resetSticky(callback); private _getBackground(); }