UNPKG

@catull/igniteui-angular

Version:

Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps

178 lines (177 loc) 6.58 kB
import { EventEmitter, NgZone } from '@angular/core'; import { IGridEditEventArgs } from '../common/events'; export interface GridSelectionRange { rowStart: number; rowEnd: number; columnStart: string | number; columnEnd: string | number; } export interface ISelectionNode { row: number; column: number; layout?: IMultiRowLayoutNode; isSummaryRow?: boolean; } export interface IMultiRowLayoutNode { rowStart: number; colStart: number; rowEnd: number; colEnd: number; columnVisibleIndex: number; } interface ISelectionKeyboardState { node: null | ISelectionNode; shift: boolean; range: GridSelectionRange; active: boolean; } interface ISelectionPointerState extends ISelectionKeyboardState { ctrl: boolean; primaryButton: boolean; } declare type SelectionState = ISelectionKeyboardState | ISelectionPointerState; export declare class IgxRow { id: any; index: number; data: any; transactionState: any; state: any; newData: any; constructor(id: any, index: number, data: any); createEditEventArgs(): IGridEditEventArgs; } export declare class IgxCell { id: any; rowIndex: number; column: any; value: any; editValue: any; rowData: any; primaryKey: any; state: any; constructor(id: any, rowIndex: number, column: any, value: any, editValue: any, rowData: any); castToNumber(value: any): any; createEditEventArgs(): IGridEditEventArgs; } export declare class IgxGridCRUDService { grid: any; cell: IgxCell | null; row: IgxRow | null; createCell(cell: any): IgxCell; createRow(cell: IgxCell): IgxRow; sameRow(rowID: any): boolean; sameCell(cell: IgxCell): boolean; readonly inEditMode: boolean; readonly rowEditing: boolean; readonly primaryKey: any; beginRowEdit(): void; endRowEdit(): void; begin(cell: any): void; end(): void; isInEditMode(rowIndex: number, columnIndex: number): boolean; } export declare class IgxGridSelectionService { private zone; grid: any; dragMode: boolean; activeElement: ISelectionNode | null; keyboardState: ISelectionKeyboardState; pointerState: ISelectionPointerState; selection: Map<number, Set<number>>; temp: Map<number, Set<number>>; _ranges: Set<string>; _selectionRange: Range; rowSelection: Set<any>; private allRowsSelected; /** * Returns the current selected ranges in the grid from both * keyboard and pointer interactions */ readonly ranges: GridSelectionRange[]; primaryButton: boolean; constructor(zone: NgZone); /** * Resets the keyboard state */ initKeyboardState(): void; /** * Resets the pointer state */ initPointerState(): void; /** * Adds a single node. * Single clicks | Ctrl + single clicks on cells is the usual case. */ add(node: ISelectionNode, addToRange?: boolean): void; /** * Adds the active keyboard range selection (if any) to the `ranges` meta. */ addKeyboardRange(): void; remove(node: ISelectionNode): void; isInMap(node: ISelectionNode): boolean; selected(node: ISelectionNode): boolean; isActiveNode(node: ISelectionNode): boolean; isActiveLayout(current: IMultiRowLayoutNode, target: IMultiRowLayoutNode): boolean; addRangeMeta(node: ISelectionNode, state?: SelectionState): void; removeRangeMeta(node: ISelectionNode, state?: SelectionState): void; /** * Generates a new selection range from the given `node`. * If `state` is passed instead it will generate the range based on the passed `node` * and the start node of the `state`. */ generateRange(node: ISelectionNode, state?: SelectionState): GridSelectionRange; /** * */ keyboardStateOnKeydown(node: ISelectionNode, shift: boolean, shiftTab: boolean): void; keyboardStateOnFocus(node: ISelectionNode, emitter: EventEmitter<GridSelectionRange>, dom: any): void; pointerDown(node: ISelectionNode, shift: boolean, ctrl: boolean): void; pointerDownShiftKey(node: ISelectionNode): void; mergeMap(target: Map<number, Set<number>>, source: Map<number, Set<number>>): void; pointerEnter(node: ISelectionNode, event: PointerEvent): boolean; pointerUp(node: ISelectionNode, emitter: EventEmitter<GridSelectionRange>): boolean; selectRange(node: ISelectionNode, state: SelectionState, collection?: Map<number, Set<number>>): void; dragSelect(node: ISelectionNode, state: SelectionState): void; clear(clearAcriveEl?: boolean): void; clearTextSelection(): void; restoreTextSelection(): void; /** * (╯°□°)╯︵ ┻━┻ * Chrome and Chromium don't care about the active * range after keyboard navigation, thus this. */ _moveSelectionChrome(node: Node): void; /** Returns array of the selected row id's. */ getSelectedRows(): Array<any>; /** Clears row selection, if filtering is applied clears only selected rows from filtered data. */ clearRowSelection(event?: any): void; /** Select all rows, if filtering is applied select only from filtered data. */ selectAllRows(event?: any): void; /** Select the specified row and emit event. */ selectRowById(rowID: any, clearPrevSelection?: any, event?: any): void; /** Deselect the specified row and emit event. */ deselectRow(rowID: any, event?: any): void; /** Select specified rows. No event is emitted. */ selectRowsWithNoEvent(rowIDs: any[], clearPrevSelection?: any): void; /** Deselect specified rows. No event is emitted. */ deselectRowsWithNoEvent(rowIDs: any[]): void; isRowSelected(rowID: any): boolean; /** Select range from last selected row to the current specified row.*/ selectMultipleRows(rowID: any, rowData: any, event?: any): void; areAllRowSelected(): boolean; hasSomeRowSelected(): boolean; readonly filteredSelectedRowIds: any[]; emitRowSelectionEvent(newSelection: any, added: any, removed: any, event?: any): boolean; getRowDataById(rowID: any): Object; getRowIDs(data: any): Array<any>; clearHeaderCBState(): void; /**Clear rowSelection and update checkbox state*/ clearAllSelectedRows(): void; /** Returns all data in the grid, with applied filtering and sorting and without deleted rows. */ readonly allData: Array<any>; private areEqualCollections; private isFilteringApplied; private isRowDeleted; } export declare function isChromium(): boolean; export {};