Documentation

@kanunilabs/datagrid-enterprise


@kanunilabs/datagrid-enterprise / DateEditorSpec

Interface: DateEditorSpec

Properties

ariaLabel?

optional ariaLabel?: string


autoFocus?

optional autoFocus?: boolean


columnId?

optional columnId?: string


disabled?

optional disabled?: boolean


format?

optional format?: string

Column format. Defaults to yyyy-MM-dd.


invalid?

optional invalid?: boolean


onCancel

onCancel: () => void

Returns

void


onChange

onChange: (value) => void

Commit shape follows the value the editor was GIVEN: a Date column gets a Date back, an ISO-string column gets a string.

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


surfaceClass?

optional surfaceClass?: string

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


t

t: GridDictionary


testId?

optional testId?: string


value

value: unknown