View as Markdown

API reference: @salmonui/data-grid/engine

FocusStateinterface

import type { FocusState } from '@salmonui/data-grid/engine';

Also exported from @salmonui/data-grid/engine/focus.

interface FocusState {
    readonly target: FocusTarget | null;
    readonly mode: 'navigate' | 'edit';
    readonly direction: 'ltr' | 'rtl';
    readonly lastCell: {
        readonly rowId: RowId;
        readonly columnId: ColumnId;
    } | null;
    readonly intent: FocusIntent | null;
}
FocusState members (5)
NameSignatureDescription
targetreadonly target: FocusTarget | null;
modereadonly mode: 'navigate' | 'edit';
directionreadonly direction: 'ltr' | 'rtl';

Resolved text direction (the direction option, or what the renderer detected from dir).

lastCellreadonly lastCell: { readonly rowId: RowId; readonly columnId: ColumnId; } | null;

Last body cell, so moving back from the header returns to it.

intentreadonly intent: FocusIntent | null;

Span-aware moves: the column a vertical move aimed at, or the row a horizontal move aimed at, when it landed on a span anchor elsewhere. The next move in the same axis continues from it, so moving down through a column span returns to the original column. Null otherwise.