UNPKG

ngxsmk-datatable

Version:

A powerful, feature-rich Angular datatable component with virtual scrolling, built for Angular 17+

55 lines (54 loc) 1.83 kB
import { Subject } from 'rxjs'; import { KeyboardNavigationConfig, KeyboardNavigationEvent, CellPosition, CellSelectionRange } from '../interfaces/keyboard-navigation.interface'; import * as i0 from "@angular/core"; export declare class KeyboardNavigationService { private config; private currentCell; private selectionRange; keyboardEvent$: Subject<KeyboardNavigationEvent>; cellFocus$: Subject<CellPosition>; cellSelection$: Subject<CellSelectionRange>; constructor(); /** * Set keyboard navigation configuration */ setConfig(config: Partial<KeyboardNavigationConfig>): void; /** * Get current configuration */ getConfig(): KeyboardNavigationConfig; /** * Handle keyboard event */ handleKeyboardEvent(event: KeyboardEvent, rowIndex: number, columnIndex: number, value: any): void; /** * Set current focused cell */ setCurrentCell(position: CellPosition): void; /** * Get current focused cell */ getCurrentCell(): CellPosition | null; /** * Set cell selection range */ setSelectionRange(range: CellSelectionRange): void; /** * Get cell selection range */ getSelectionRange(): CellSelectionRange | null; /** * Move focus to next cell */ moveToNextCell(currentRow: number, currentCol: number, totalRows: number, totalCols: number): CellPosition; /** * Move focus to previous cell */ moveToPreviousCell(currentRow: number, currentCol: number, totalCols: number): CellPosition; private isArrowKey; private handleArrowKey; private handleTabKey; private handleHomeEndKey; static ɵfac: i0.ɵɵFactoryDeclaration<KeyboardNavigationService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<KeyboardNavigationService>; }