UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Microsoft 365.

73 lines (72 loc) 2.45 kB
import * as React from 'react'; import { ISwatchColorPickerProps } from './SwatchColorPicker.types'; export interface ISwatchColorPickerState { selectedIndex?: number; } export declare class SwatchColorPickerBase extends React.Component<ISwatchColorPickerProps, ISwatchColorPickerState> { static defaultProps: ISwatchColorPickerProps; private _id; private _cellFocused; private navigationIdleTimeoutId; private isNavigationIdle; private readonly navigationIdleDelay; private async; private _getItemsWithIndex; static getDerivedStateFromProps(newProps: ISwatchColorPickerProps, state: ISwatchColorPickerState): { selectedIndex: number | undefined; } | null; constructor(props: ISwatchColorPickerProps); componentWillUnmount(): void; render(): JSX.Element | null; private _onRenderItem; /** * When the whole swatchColorPicker is blurred, * make sure to clear the pending focused stated */ private _onSwatchColorPickerBlur; /** * Render a color cell * @param item - The item to render * @returns - Element representing the item */ private _renderOption; /** * Callback passed to the GridCell that will manage triggering the onCellHovered callback for mouseEnter */ private _onMouseEnter; /** * Callback passed to the GridCell that will manage Hover/Focus updates */ private _onMouseMove; /** * Callback passed to the GridCell that will manage Hover/Focus updates */ private _onMouseLeave; /** * Callback to make sure we don't update the hovered element during mouse wheel */ private _onWheel; /** * Callback that */ private _onKeyDown; /** * Sets a timeout so we won't process any mouse "hover" events * while navigating (via mouseWheel or arrowKeys) */ private _setNavigationTimeout; /** * Callback passed to the GridCell class that will trigger the onCellHovered callback of the SwatchColorPicker * NOTE: This will not be triggered if shouldFocusOnHover === true */ private _onGridCellHovered; /** * Callback passed to the GridCell class that will trigger the onCellFocus callback of the SwatchColorPicker */ private _onGridCellFocused; /** * Handle the click on a cell * @param item - The cell that the click was fired against */ private _onCellClick; }