Documentation

@kanunilabs/datagrid-enterprise


@kanunilabs/datagrid-enterprise / LookupEditorSpec

Interface: LookupEditorSpec

Properties

allowCustom?

optional allowCustom?: boolean

Let text that matches nothing become the value. Default false.


ariaLabel?

optional ariaLabel?: string


autoFocus?

optional autoFocus?: boolean

Take focus once connected. True for a cell editor; false in row/form mode, where every editable cell mounts an editor at once.


columnId?

optional columnId?: string


commitOnPick?

optional commitOnPick?: boolean

Whether picking an item counts as committing. True for a cell editor — the pick IS the edit. False in row/form mode, where only Save ends it.


invalid?

optional invalid?: boolean


matchMode?

optional matchMode?: LookupMatchMode

Prefix (default) or substring.


noMatchText

noMatchText: string

No-match caption (t.editNoMatch).


onCancel

onCancel: () => void

Returns

void


onChange

onChange: (value) => void

Parameters

value

unknown

Returns

void


onCommit

onCommit: () => void

Returns

void


onPortalOpen?

optional onPortalOpen?: (close) => void

Called when the editor opens a layer on document.body (the lookup list, the date calendar), handing back the function that closes it again.

The layer outlives its cell by design — it is portalled so the grid's scroller cannot clip it — which means removing the grid's DOM does not remove it. Without this the layer stayed on screen after grid.destroy(), hanging over whatever the app rendered next, until the next scroll or resize let place() notice the input was gone.

The editing layer keeps the closer and calls it on dispose. Scoped per grid on purpose: a global registry would let one grid's teardown close another grid's open dropdown.

Parameters

close

() => void

Returns

void


onTab?

optional onTab?: (shiftKey) => void

Parameters

shiftKey

boolean

Returns

void


options

options: readonly LookupItem[]


surfaceClass?

optional surfaceClass?: string

The portal's surface classes, so the list resolves the --dg tokens.


testId?

optional testId?: string


value

value: unknown