import { HorizontalOverflowClassNameContract } 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 { HorizontalOverflowHandledProps, HorizontalOverflowProps, HorizontalOverflowUnhandledProps } from "./horizontal-overflow.props"; export declare enum ButtonDirection { previous = "previous", next = "next" } export interface HorizontalOverflowState { itemsHeight: number | null; direction: Direction; } declare class HorizontalOverflow extends Foundation { static displayName: string; static defaultProps: Partial; private static DirectionAttributeName; private static defaultScrollAnimationDuration; protected handledProps: HandledProps; private horizontalOverflowItemsRef; /** * Throttle scroll request animation frame usage */ private throttledScroll; /** * Throttle resize request animation frame usage */ private throttledResize; /** * Stores the overall overflow status */ private overflow; /** * Stores the overallStart status */ private overflowStart; /** * Stores the overallEnd status */ private overflowEnd; /** * Store a reference to a constructed resize observer */ private resizeObserver?; /** * Stores pending animation frame requests */ private openRequestAnimationFrame; /** * The position the current scroll animation started at */ private currentScrollAnimStartPosition; /** * The target position of the current scroll animation */ private currentScrollAnimEndPosition; /** * Start time for current scroll animation */ private currentScrollAnimStartTime; /** * Flag indicates if a scroll animation is in progress */ private isScrollAnimating; /** * Stores last scroll position from scroll events */ private lastRecordedScroll; /** * Constructor */ constructor(props: HorizontalOverflowProps); /** * Renders the Horizontal Overflow markup */ render(): React.ReactElement; /** * React life-cycle method */ componentDidMount(): void; /** * React life-cycle method */ componentWillUnmount(): void; /** * React life-cycle method */ getSnapshotBeforeUpdate(prevProps: HorizontalOverflowProps): boolean | null; /** * React life-cycle method */ componentDidUpdate(prevProps: HorizontalOverflowProps, prevState: HorizontalOverflowState, snapshot: boolean | null): void; /** * Generates class names */ protected generateClassNames(): string; /** * Track scroll position */ private onScrollCapture; /** * A child item got focus make sure it is in view */ private onItemFocus; /** * Compares viewport width, item width and desired peek value to come up with * peek value to use. We don't want to clip focused item to get peek on next/previous item. */ private getScrollPeek; /** * Callback for on scroll change */ private onScrollChange; /** * Get the scroll change data */ private getPositionData; /** * Gets the style for the `ul` element containing the items */ private getListStyle; /** * onLoad handler to make sure any children affecting height are accounted for */ private itemsOnLoad; /** * Handles the resize event */ private onWindowResize; /** * Checks if overflow is occuring */ private isOverflow; /** * Callback for the horizontal overflow change */ private handleOverflowChange; /** * Returns the fixed height if set or identifies and returns the tallest child height */ private getItemHeight; /** * Identifies and returns the tallest child height */ private getItemMaxHeight; /** * Gets the children displayed as items to be scrolled */ private getItems; /** * Gets the distance to scroll based on the direction */ private getScrollDistanceFromButtonDirection; /** * Gets the distance unless it is over the maximum distance, then use maximum distance instead */ private getWithinMaxDistance; /** * Gets the distance unless it is under the minimum distance, then use minimum distance instead */ private getWithinMinDistance; /** * Gets the distance to scroll if the next button has been clicked */ private getNextDistance; /** * Gets the distance to scroll if the previous button has been clicked */ private getPreviousDistance; /** * Gets the maximum distance that can be scrolled */ private getMaxScrollDistance; /** * Handler for the previous click event */ private handlePreviousClick; /** * Handler for the next click event */ private handleNextClick; /** * Handler for the click event fired after next or previous has been clicked */ private handleClick; /** * Returns the available content region width */ private getAvailableWidth; /** * Returns the items widths */ private getItemWidths; /** * Easing animation * Inspired by the github gist contribution: https://gist.github.com/andjosh/6764939 */ private easeInOutQuad; /** * Scrolls the container for the items list */ private scrollContent; /** * Request's an animation frame if there are currently no open animation frame requests */ private requestFrame; /** * Animate one frame of scrolling */ private updateScrollAnimation; /** * get scroll animation position for the provided time */ private getScrollAnimationPosition; /** * Gets the scroll position and accounts for direction */ private getScrollPosition; /** * Sets the scroll position and accounts for direction */ private setScrollPosition; /** * updates the direction in state if necessary */ private updateDirection; /** * gets the current direction */ private getDirection; } export default HorizontalOverflow; export * from "./horizontal-overflow.props"; export { HorizontalOverflowClassNameContract };