UNPKG

@true-directive/grid

Version:

Angular Data Grid from Yopsilon.

132 lines (131 loc) 5.61 kB
/** * Copyright (c) 2018-2019 Aleksey Melnikov, True Directive Company. * @link https://truedirective.com/ * @license MIT */ import { ElementRef, ChangeDetectorRef, KeyValueDiffers, EventEmitter } from '@angular/core'; import { Column, CellPosition, GridPart, Selection, UIAction, RowPosition } from '@true-directive/base'; import { RowDragEvent, RowClickEvent, ContextMenuEvent, CheckedChangedEvent, CellClickEvent } from '@true-directive/base'; import { GridViewComponent } from './grid-view.component'; import { GridStateService } from './grid-state.service'; import { InternationalizationService } from './internationalization/internationalization.service'; export declare class GridComponent extends GridViewComponent { state: GridStateService; protected intl: InternationalizationService; protected elementRef: ElementRef; protected changeDetector: ChangeDetectorRef; protected keyValueDiffers: KeyValueDiffers; rowMouseDown: EventEmitter<any>; rowMouseUp: EventEmitter<any>; rowClick: EventEmitter<RowClickEvent>; cellClick: EventEmitter<CellClickEvent>; rowDblClick: EventEmitter<RowClickEvent>; rowKeyDown: EventEmitter<any>; contextMenu: EventEmitter<ContextMenuEvent>; selectionChanged: EventEmitter<Selection>; checkedChanged: EventEmitter<CheckedChangedEvent>; /** * Пользователь перетащил строки. Событие возникает до того, как строки будут перенесены * гридом. Это действие можно отменить и обработать вне грида. */ rowDrag: EventEmitter<RowDragEvent>; /** * Пользователь перетащил строки и грид обработал это действие. */ rowDragged: EventEmitter<RowDragEvent>; /** * Маркер, указывающий новую позицию перетаскиваемого столбца */ dropMarker: any; private _cellTouched; private _cellTouchedScrollPos; private _dragColumn; private _drag_x0; private _drag_y0; private _lastSel; private _paging; readonly isDragging: boolean; /** * Начало действия пользователя (перемещение строки или выделение ячеек) * @param eX Начальная координата X * @param eY Начальная координата Y * @param place Часть грида, в которой инициировано действие * @param ctrlKey Нажата ли клавиша Ctrl * @param byTouch Инициировано ли тач-событием */ protected startAction(cp: CellPosition, eX: number, eY: number, place: GridPart, ctrlKey?: boolean, byTouch?: boolean, button?: number): void; /** * Касание пальцем * @param e Параметры события */ touchStart(e: any): void; protected readonly touchScroll: boolean; /** * Окончание касания * @param e Параметры события */ touchEnd(e: any): void; /** * Нажатие кнопки мыши. * @param e Параметры события */ dataMouseDown(e: any): void; protected doRowClick(e: any): void; dataContextMenu(e: any): void; dataRowClick(e: any, r: any): void; dataRowDblClick(e: any, r: any): void; /** * Key event handler * @param keyEvent Key event parameters */ processKey(e: any): boolean; dataKeyDown(e: any): void; checkAll(fieldName: string): void; uncheckAll(fieldName: string): void; /** * Continue selecting * @param e Event parameters */ private doSelect; /** * Selection of the grid * @return GridSelection instance with selected ranges list. */ readonly selection: import("./grid-selection.class").GridSelection; /** * Returns data which contained in selected ranges * @return Array with the data */ readonly selectedData: any[]; readonly draggedRows: any[]; getDragTransform(i: number): string; getDragWidth(): string; private checkRowDrag; private startDragRows; protected specifyDropPosition(pos: RowPosition, rLeft: number, e: MouseEvent): RowPosition; protected dropInfo(e: MouseEvent): any; protected dragRows(e: MouseEvent): RowPosition; private endDragRows; protected documentMouseMove(e: MouseEvent): void; documentMouseUp(e: MouseEvent): void; resizeInProcess(value: boolean): void; dragInProcess(value: boolean): void; private showMarker; hideMarker(): void; proceedToResizeColumn(ui: UIAction): void; resizeColumn(e: any): void; private setDragPosition; isDragColumn(): boolean; private startDragColumn; protected commitDrag(): void; protected dragColumn(e: UIAction): void; protected dropColumn(e: any): void; /** * Обработка события строки - переключение чекбокса. * @param e Параметры события */ toggleCheckbox(e: any): void; toggleCheckColumn(col: Column): void; setAppearance(): void; constructor(state: GridStateService, intl: InternationalizationService, elementRef: ElementRef, changeDetector: ChangeDetectorRef, keyValueDiffers: KeyValueDiffers); }