UNPKG

4.04 kBTypeScriptView Raw
1import { BeanStub } from "./context/beanStub";
2import { Column } from "./entities/column";
3import { CellPosition } from "./entities/cellPosition";
4import { RowNode } from "./entities/rowNode";
5import { HeaderPosition } from "./headerRendering/common/headerPosition";
6import { ColumnGroup } from "./entities/columnGroup";
7import { GridCtrl } from "./gridComp/gridCtrl";
8import { NavigationService } from "./gridBodyComp/navigationService";
9import { CtrlsService } from "./ctrlsService";
10import { HeaderCellCtrl } from "./headerRendering/cells/column/headerCellCtrl";
11export declare class FocusService extends BeanStub {
12 private readonly columnModel;
13 private readonly headerNavigationService;
14 private readonly columnApi;
15 private readonly gridApi;
16 private readonly rowRenderer;
17 private readonly rowPositionUtils;
18 private readonly rangeService;
19 navigationService: NavigationService;
20 ctrlsService: CtrlsService;
21 static AG_KEYBOARD_FOCUS: string;
22 private gridCtrl;
23 private focusedCellPosition;
24 private focusedHeaderPosition;
25 private static keyboardModeActive;
26 private static instancesMonitored;
27 /**
28 * Adds a gridCore to the list of the gridCores monitoring Keyboard Mode
29 * in a specific HTMLDocument.
30 *
31 * @param doc {Document} - The Document containing the gridCore.
32 * @param gridCore {GridComp} - The GridCore to be monitored.
33 */
34 private static addKeyboardModeEvents;
35 /**
36 * Removes a gridCore from the list of the gridCores monitoring Keyboard Mode
37 * in a specific HTMLDocument.
38 *
39 * @param doc {Document} - The Document containing the gridCore.
40 * @param gridCore {GridComp} - The GridCore to be removed.
41 */
42 private static removeKeyboardModeEvents;
43 /**
44 * This method will be called by `keydown` and `mousedown` events on all Documents monitoring
45 * KeyboardMode. It will then fire a KEYBOARD_FOCUS, MOUSE_FOCUS on each gridCore present in
46 * the Document allowing each gridCore to maintain a state for KeyboardMode.
47 *
48 * @param event {KeyboardEvent | MouseEvent | TouchEvent} - The event triggered.
49 */
50 private static toggleKeyboardMode;
51 private init;
52 unregisterGridCompController(gridCompController: GridCtrl): void;
53 onColumnEverythingChanged(): void;
54 isKeyboardMode(): boolean;
55 getFocusCellToUseAfterRefresh(): CellPosition | null;
56 getFocusHeaderToUseAfterRefresh(): HeaderPosition | null;
57 private isDomDataMissingInHierarchy;
58 clearFocusedCell(): void;
59 getFocusedCell(): CellPosition | null;
60 setFocusedCell(rowIndex: number, colKey: string | Column, floating: string | null | undefined, forceBrowserFocus?: boolean): void;
61 isCellFocused(cellPosition: CellPosition): boolean;
62 isRowNodeFocused(rowNode: RowNode): boolean;
63 isHeaderWrapperFocused(headerCtrl: HeaderCellCtrl): boolean;
64 clearFocusedHeader(): void;
65 getFocusedHeader(): HeaderPosition | null;
66 setFocusedHeader(headerRowIndex: number, column: ColumnGroup | Column): void;
67 focusHeaderPosition(params: {
68 headerPosition: HeaderPosition | null;
69 direction?: 'Before' | 'After' | null;
70 fromTab?: boolean;
71 allowUserOverride?: boolean;
72 event?: KeyboardEvent;
73 }): boolean;
74 isAnyCellFocused(): boolean;
75 isRowFocused(rowIndex: number, floating?: string | null): boolean;
76 findFocusableElements(rootNode: HTMLElement, exclude?: string | null, onlyUnmanaged?: boolean): HTMLElement[];
77 focusInto(rootNode: HTMLElement, up?: boolean, onlyUnmanaged?: boolean): boolean;
78 findNextFocusableElement(rootNode: HTMLElement, onlyManaged?: boolean | null, backwards?: boolean): HTMLElement | null;
79 isFocusUnderManagedComponent(rootNode: HTMLElement): boolean;
80 findTabbableParent(node: HTMLElement | null, limit?: number): HTMLElement | null;
81 private onCellFocused;
82 focusGridView(column?: Column, backwards?: boolean): boolean;
83 focusNextGridCoreContainer(backwards: boolean): boolean;
84}