@kanunilabs/datagrid-enterprise
@kanunilabs/datagrid-enterprise / CellEditorSpec
Interface: CellEditorSpec
Properties
allowCustom?
optionalallowCustom?:boolean
ariaLabel?
optionalariaLabel?:string
dataType
dataType:
GridDataType|undefined
dateFormat?
optionaldateFormat?:string
Format for a date column — governs both the mask and the display.
error
error:
string|null
Validation message for the current value; null when valid.
matchMode?
optionalmatchMode?:LookupMatchMode
onCancel
onCancel: () =>
void
Returns
void
onChange
onChange: (
value) =>void
Parameters
value
unknown
Returns
void
onCommit
onCommit: (
move) =>void
Parameters
move
"none" | "down"
Returns
void
onPortalOpen?
optionalonPortalOpen?: (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
onTab: (
direction) =>void
Tab / Shift+Tab: commit here and keep going in the adjacent cell.
Parameters
direction
-1 | 1
Returns
void
options?
optionaloptions?: readonlyLookupItem[] |null
Choices for a lookup column. null = the list is still being fetched —
the control renders disabled rather than empty, so the user cannot
commit a blank over a value while the options are in flight (E3).
seeded?
optionalseeded?:boolean
The editor was opened by TYPING, so value is the character the user
just pressed. The caret goes after it instead of selecting it — selecting
would make the second keystroke erase the first.
surfaceClass?
optionalsurfaceClass?:string
The portal surface classes for the calendar / lookup list.
t?
optionalt?:GridDictionary
Dictionary — the date calendar's captions and the no-match text.
value
value:
unknown