UNPKG

ag-grid-enterprise

Version:

Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue

98 lines (97 loc) 4.91 kB
import type { AgColumn, AgColumnGroup, BeanCollection, CellCtrl, CellPosition, CellRange, CellRangeBoundaryParams, CellRangeParams, ClearCellRangeParams, ICellRangeFeature, IHeaderCellComp, IRangeService, NamedBean, PartialCellRange, RowPosition } from 'ag-grid-community'; import { AutoScrollService, BeanStub } from 'ag-grid-community'; export declare class RangeService extends BeanStub implements NamedBean, IRangeService { beanName: "rangeSvc"; private rowModel; private dragSvc; private colModel; private visibleCols; private cellNavigation; private ctrlsSvc; private valueSvc; private selectionMode; wireBeans(beans: BeanCollection): void; private cellRanges; private lastMouseEvent; private readonly bodyScrollListener; private lastCellHovered; private cellHasChanged; /** when a range is created, we mark the 'start cell' for further processing as follows: * 1) if dragging, then the new range is extended from the start position * 2) if user hits 'shift' click on a cell, the previous range is extended from the start position */ private newestRangeStartCell?; private dragging; private draggingRange?; /** When dragging ends, the current range will be used to intersect all other ranges */ private intersectionRange; autoScrollService: AutoScrollService; private readonly columnRangeSelectionCtx; postConstruct(): void; onDragStart(mouseEvent: MouseEvent): void; onDragging(mouseEvent: MouseEvent | null): void; onDragStop(): void; onColumnsChanged(): void; refreshLastRangeStart(): void; isContiguousRange(cellRange: CellRange): boolean; getRangeStartRow(cellRange: PartialCellRange): RowPosition; getRangeEndRow(cellRange: PartialCellRange): RowPosition; getRangeRowCount(cellRange: PartialCellRange): number; handleCellMouseDown(event: MouseEvent, cell: CellPosition): void; private removeRowFromRowNumberRange; setRangeToCell(cell: CellPosition, appendRange?: boolean): void; private getRangeLastColumn; extendRangeRowCountBy(cellRange: CellRange, targetCount: number): void; extendRangeColumnCountBy(cellRange: CellRange, delta: number): void; extendLatestRangeToCell(cellPosition: CellPosition): void; updateRangeRowBoundary(params: CellRangeBoundaryParams): void; getRangeEdgeColumns(cellRange: CellRange): { left: AgColumn; right: AgColumn; }; extendLatestRangeInDirection(event: KeyboardEvent): CellPosition | undefined; setCellRange(params: CellRangeParams): void; setCellRanges(cellRanges: CellRange[]): void; clearCellRangeCellValues(params: ClearCellRangeParams): void; createCellRangeFromCellRangeParams(params: CellRangeParams): CellRange | undefined; createPartialCellRangeFromRangeParams(params: CellRangeParams, allowEmptyColumns: boolean): PartialCellRange | undefined; addCellRange(params: CellRangeParams): CellRange | undefined; getCellRanges(): CellRange[]; isEmpty(): boolean; isMoreThanOneCell(): boolean; areAllRangesAbleToMerge(): boolean; removeAllCellRanges(silent?: boolean): void; isCellInAnyRange(cell: CellPosition): boolean; isCellInSpecificRange(cell: CellPosition, range: CellRange): boolean; isColumnInAnyRange(column: AgColumn | AgColumnGroup): boolean; private findContainingRange; isBottomRightCell(cellRange: CellRange, cell: CellPosition): boolean; getCellRangeCount(cell: CellPosition): number; isRowInRange(thisRow: RowPosition, cellRange: CellRange): boolean; intersectLastRange(fromMouseClick?: boolean): void; createRangeHighlightFeature(compBean: BeanStub, column: AgColumn<any> | AgColumnGroup, headerComp: IHeaderCellComp): void; private setSelectionMode; private refreshRangeStart; private setNewestRangeStartCell; private getColumnsFromParams; private verifyCellRanges; forEachRowInRange(cellRange: CellRange, callback: (row: RowPosition) => void): void; private onBodyScroll; private updateValuesOnMove; private dispatchChangedEvent; private getColumnFromModel; private getColumnsFromModel; private calculateColumnsBetween; private focusCellOnNewColumn; private focusCellOnNewRow; createDragListenerFeature(eContainer: HTMLElement): BeanStub; createCellRangeFeature(ctrl: CellCtrl): ICellRangeFeature; createHeaderGroupCellMouseListenerFeature(column: AgColumnGroup, eGui: HTMLElement): BeanStub; /** * Handle a user clicking column header to (de)select one or more column of cells * CTRL-clicking for toggling column selection + CTRL-SHIFT-clicking supported for selecting ranges of columns */ handleColumnSelection(clickedColumn: AgColumn | AgColumnGroup, event: MouseEvent | KeyboardEvent): void; private deselectColumnsFromRange; private selectColumns; }