import * as React from 'react'; import * as PropType from 'prop-types'; import { IUpdateSelectionEvent } from './base-controller'; import { IGridProps, IGridResizeCombinedEvent, IGridAddress, IGridSelection, IHeader } from './types'; declare global { namespace JSX { interface IntrinsicElements { 'react-bolivianite-grid': React.DetailedHTMLProps, HTMLDivElement>; } } } export declare class Grid extends React.PureComponent { static propTypes: { tabIndex: PropType.Requireable; preserveScrollbars: PropType.Requireable; repository: PropType.Validator; data: PropType.Requireable; readOnly: PropType.Requireable; overscanRows: PropType.Requireable; overscanColumns: PropType.Requireable; theme: PropType.Requireable; active: PropType.Requireable; selection: PropType.Requireable; onRenderCell: PropType.Validator; onRenderHeader: PropType.Validator; onRenderHeaderCorner: PropType.Requireable; onRenderSelection: PropType.Requireable; onRenderEditor: PropType.Requireable; onRenderResizer: PropType.Requireable; onAutoMeasure: PropType.Requireable; onSpace: PropType.Requireable; onRemove: PropType.Requireable; onNullify: PropType.Requireable; onCopy: PropType.Requireable; onPaste: PropType.Requireable; onRightClick: PropType.Requireable; onHeaderRightClick: PropType.Requireable; onUpdate: PropType.Requireable; onSelection: PropType.Requireable; onHeaderResize: PropType.Requireable; onReadOnly: PropType.Requireable; scrollViewClass: PropType.Requireable; }; static defaultProps: { tabIndex: number; preserveScrollbars: boolean; readOnly: boolean; overscanRows: number; overscanColumns: number; }; private _detached; private _blockContextMenu; private _onContextMenuListener; private _rt; private _scrollUpdateTrottled; private _ref; private _refView; private _scrollerStyle; private _lastView; private _lastOverscan; private _focused; private _kbCtr; private _msCtr; private _currentEdit; state: { scrollLeft: number; scrollTop: number; viewHeight: number; viewWidth: number; active: IGridAddress; edit: IGridAddress; selection: IGridSelection[]; resizeHeaderPreview: { header: IHeader; change: number; }; resizeLevelPreview: { header: IHeader; change: number; }; }; private _chromeFix; constructor(p: IGridProps, c: any); private readonly _theme; private readonly _columnCount; private readonly _rowCount; private readonly _headersHeight; private readonly _headersWidth; private readonly _selection; private readonly _active; private _onRef; private _onRefView; private _onBlur; private _onFocus; private _onRootMouseLeave; private _onKeyDown; private _onRootMouseEnter; private _onRootMouseDown; private _onScrollViewUpdate; private _ctrlGetState; private _ctrlGetActiveNotifier(prev, next); private _ctrlGetSelectionNotifier(prev, next); private _ctrlRightClick; private _ctrlCopy; private _ctrlPaste; private _ctrlNullify; private _ctrlRemove; private _ctrlSpace; private _ctrlIsReadOnly(e); private _ctrlIsNoEditor(e); private _ctrlIsCellReadOnly; private _ctrlOnReadOnlyFilter; private _onCellMouseDown; private _onCellTouchStart; private _onHeaderMouseDownHeader; private _onCornerMouseDown; private _onCellMouseEnter; private _onAutoMeasureApply({cells, headers}, behavior, workType, headerType); private _onAutoMeasure(); private _onAfterUpdate(); private _createView(); private _createOverscan(); private _prepareCellProps(row, col); private _renderCell(row, col); private _renderEditor(row, col); private _renderData(); private _renderHeader(out, type, index, header, scrollPos, lock, parent); private _renderHeaders(type, scrollPos); private _renderResizing({scrollLeft, scrollTop}); private _isAddressOutOfBounds(cell); private _getFilteredSelections(); private _renderSelections(); private _renderHeadersLayer; private _bodyRenderer; focus(): void; blur(): void; /** TODO: instead of using column index - use cell position and viewport minus scroll size */ scrollTo: (cell: { column?: number; row?: number; }) => void; openEditor: (cell: IGridAddress) => void; closeEditor: (commit: boolean, callback?: () => void) => void; resizeHeaders(e: IGridResizeCombinedEvent): void; updateSelection: ({ active, selection }: IUpdateSelectionEvent, callback?: () => void) => void; autoMeasure(headers: IHeader[], type?: 'levels' | 'cells'): void; previewResizeHeader(resizeHeaderPreview: { header: IHeader; change: number; }): void; previewResizeLevel(resizeLevelPreview: { header: IHeader; change: number; }): void; componentDidMount(): void; componentDidUpdate(pp: IGridProps): void; componentWillUnmount(): void; render(): JSX.Element; } export default Grid;