GitHub

Reference machines

select

interface 3 type 3 function 1
interface Interfaces 3

# CreateSelectInput

Type Parameters

V

Members

defaultOpen?
optional defaultOpen?: boolean
defaultValue?
optional defaultValue?: V | null
items
items: readonly SelectItem<V>[]
navigation?
optional navigation?: "wrap" | "clamp"

Default 'wrap' — APG listboxes wrap by default.

# SelectContext

Type Parameters

V

Members

highlightedId
highlightedId: string | null
items
items: readonly SelectItem<V>[]
typeahead
typeahead: string

Buffer for type-ahead search. The Layer 3 attachment resets this after a short timeout (typically 500 ms) by dispatching TYPEAHEAD.RESET.

value
value: V | null

# SelectItem

Type Parameters

V

Members

disabled?
readonly optional disabled?: boolean

###### Overrides

CollectionItem.disabled

id
readonly id: string

###### Overrides

CollectionItem.id

label?
readonly optional label?: string

###### Overrides

CollectionItem.label

value
readonly value: V
type Type Aliases 3

# SelectEvent

SelectEvent<V> = { type: "OPEN"; } | { type: "CLOSE"; } | { type: "TOGGLE"; } | { type: "ESCAPE"; } | { id: string; type: "SELECT"; } | { id: string | null; type: "HIGHLIGHT"; } | { direction: NavigateDirection; type: "NAVIGATE"; } | { char: string; type: "TYPEAHEAD"; } | { type: "TYPEAHEAD.RESET"; } | { type: "SET.VALUE"; value: V | null; } | { items: ReadonlyArray<SelectItem<V>>; type: "SET.ITEMS"; }

Type Parameters

V
function Functions 1

# createSelectMachine ( )

createSelectMachine<V>(input): SelectMachine<V>

Construct a fresh Select machine.

Type Parameters

V

Parameters

Returns

SelectMachine<V>