Skip to main content

Interface: SearchPanelProps

Props of SearchPanel.

Properties​

autoFocus?​

autoFocus?: boolean;

Move the keyboard focus into the panel when it opens. Default true.


className?​

className?: string;

Class of the panel element.


initialPath?​

initialPath?: readonly [string, string] | null;

Opens in path mode with these two table ids (a deep link's path).


initialQuery?​

initialQuery?: string;

Query the panel opens with (a deep link's q).


kinds?​

kinds?: SearchKind[];

Kinds searched. Default: all.


limit?​

limit?: number;

Most hits listed. Default 50.


model​

model: DiagramModel;

View-filtered model (what is drawn).

Methods​

onClose()​

onClose(): void;

Called when the panel is closed (Esc or its close button).

Returns​

void


onHits()?​

onHits?(hits): void;

Called with the current hits while typing (host decorates them, 'match' tone).

Parameters​

hits​

SearchHit[]

Returns​

void


onModeChange()?​

onModeChange?(mode): void;

Switched between search and path mode.

Parameters​

mode​

SearchPanelMode

Returns​

void


onPath()?​

onPath?(path, ends): void;

Two-table path mode: the path (null when unconnected) and its ends, or null, null while incomplete.

Parameters​

path​

TablePath | null

ends​

[string, string] | null

Returns​

void


onQueryChange()?​

onQueryChange?(query): void;

The query as it is typed (a deep link carries it).

Parameters​

query​

string

Returns​

void


onSelect()​

onSelect(hit): void;

Called with the chosen hit (Enter / click); the host focuses and highlights it.

Parameters​

hit​

SearchHit

Returns​

void