import { StackPanelClassNameContract } from "@microsoft/fast-components-class-name-contracts-base"; import Foundation, { HandledProps } from "@microsoft/fast-components-foundation-react"; import { Direction } from "@microsoft/fast-web-utilities"; import React from "react"; import { StackPanelHandledProps, StackPanelProps, StackPanelUnhandledProps } from "./stack-panel.props"; export interface StackPanelState { isScrollable: boolean; renderedRangeStartIndex: number; renderedRangeEndIndex: number; direction: Direction; } declare class StackPanel extends Foundation { static displayName: string; static defaultProps: Partial; private static DirectionAttributeName; protected handledProps: HandledProps; private rootElement; /** * ref to the element which is the container all children are rendered into * It is sized accomodate all children and is the container that is being scrolled */ private itemContainerElement; private resizeDetector; private itemPositions; private viewportSpan; private itemContainerSpan; private maxScroll; /** * Stores last scroll position from scroll events */ private lastRecordedScroll; /** * Delays updating ui during scrolling * (to avoid rendering of items that just scroll by) */ private scrollLayoutUpdateTimer; /** * constructor */ constructor(props: StackPanelProps); /** * Renders the component */ render(): React.ReactElement; /** * React life-cycle method */ componentDidMount(): void; /** * React life-cycle method */ componentDidUpdate(prevProps: StackPanelProps): void; /** * React life-cycle method */ componentWillUnmount(): void; /** * Create class-names */ protected generateClassNames(): string; /** * Render the items */ private renderItems; /** * Render a single item */ private renderItem; /** * Builds a list of positioning data for all items */ private updateItemPositions; /** * Gets the maximum distance that can be scrolled */ private getMaxScrollDistance; /** * Get the size of the viewport along the panel's axis */ private getViewportSpan; /** * Recalculates the layout */ private updateLayout; /** * gets the first row where the row bottom exceeds the threshold value * returns final item index if no rows reach threshold value */ private getThresholdItemIndex; /** * gets the current buffer size (number of items to render outside the viewport) */ private getBufferLength; /** * Handle scroll events */ private onScrollCapture; /** * Handle viewport resize events */ private handleResize; /** * report scroll changes to callback */ private reportScrollChange; /** * updates the direction in state if necessary */ private updateDirection; /** * gets the current direction */ private getDirection; /** * Gets the scroll position and accounts for direction */ private getScrollPosition; /** * Sets the scroll position and accounts for direction */ private setScrollPosition; /** * Scrolls the container for the items list */ private scrollContent; /** * Gets the scroll position that brings the item at a particular index into the viewport */ private getScrollIntoViewPosition; } export default StackPanel; export * from "./stack-panel.props"; export { StackPanelClassNameContract };