Kanban API
Complete API reference for @oge-ui/kanban. The kernel — card normalization and write-back, the drag hit-testing, per-column virtual windows, the WIP arithmetic, the keyboard and move machines — is the framework-free @oge-ui/kanban-engine, shared with the React board; live demos are on the overview page.
Properties Methods Events Types
OgeKanban
oge-kanbanProperties 33
Data
| Name | Type | Default | Description |
|---|---|---|---|
dataSource | readonly T[] | [] | Card items — a plain array, copied into an internal working set; the input is never mutated. Edits surface through the past-tense events. |
keyExpr / columnExpr / titleExpr / descriptionExpr / colorExpr | string | ((item: T) => unknown) | 'id' / 'status' / 'title' / 'description' / 'color' | Card field mapping: names (dotted paths reach nested objects) or getter functions. columnExpr holds the card's column key; a card with no resolvable column lands in the untitled column instead of being dropped. |
orderExpr | string | ((item: T) => unknown) | undefined | undefined | Numeric in-column sort order. Unset, the array order is the board order and moves reorder the working set; set, moves write a midpoint order value back onto the item (sequential renumber of the cell when the midpoint has no room). |
swimlaneExpr | string | ((item: T) => unknown) | undefined | undefined | Set = the board renders collapsible swimlane rows (first-seen data order); each lane holds every column. |
tagsExpr / assigneeExpr | string | ((item: T) => unknown) | undefined | undefined | Tag chips and assignee avatars (initials). Both accept a single value or an array — write-back preserves the storage shape. |
dueDateExpr / priorityExpr | string | ((item: T) => unknown) | undefined | undefined | Due-date badge (danger when overdue; formatted through locale) and the priority indicator (colored by value: 'low' green, 'medium'/'normal' amber, 'high'/'urgent'/'critical' red). |
searchExprs | readonly (string | ((item: T) => unknown))[] | undefined | undefined | Extra fields the toolbar search matches, beyond the built-in title + description + tags + assignees haystack. Matching is fold-insensitive (accents, Turkish İ/i). |
columns | readonly OgeKanbanColumn[] | undefined | undefined | Declared columns ({ key, title?, color?, wipLimit?, minCount?, collapsed?, allowAdding?, allowDrag?, allowDrop?, transitionColumns? }); unset = derived from the data's distinct column keys in first-seen order. Cards in undeclared columns stay in the data but leave the view. |
State (two-way)
| Name | Type | Default | Description |
|---|---|---|---|
collapsedColumns / collapsedSwimlanes | model<readonly string[]> | [] | Collapsed column keys (slim vertical pills) and collapsed swimlane keys. |
columnOrder | model<readonly string[]> | [] | Persisted column key order (empty = declared order); written by header drags when allowColumnReordering is on. |
selectedCardKey | model<unknown> | null | The primary (focused / anchor) selected card's key. With selectionMode: 'multiple' the full set is selectedCardKeys. |
selectedCardKeys | model<readonly unknown[]> | [] | Every selected card key, in board order. Ctrl/⌘-click toggles, Shift-click selects the range in the anchor's column, Ctrl+A on a card selects its column (cell), Ctrl+Space toggles, Shift+↑/↓ extends and Escape collapses to the focused card. Selected cards travel together in a drag (the ghost shows the count), Ctrl+←/→ and Delete. |
filterValue | model<OgeKanbanFilterExpression> | {} | The filter chip bar's state — active tags / assignees / priorities. Bind it two-way to persist or preset the chips; it ANDs with filter and the toolbar search. |
columnSort | model<OgeKanbanColumnSort<T>> | {} | Per-column card sort: a column key (or '*' for every column) mapped to { field: 'order' | 'title' | 'priority' | 'dueDate', direction? } or a comparator over normalized cards. The column menu (the header's sort button or a right-click) writes it. Unset columns keep orderExpr / array order; a drop into a sorted column lands where the sort puts it. |
Filtering, selection & transfers
| Name | Type | Default | Description |
|---|---|---|---|
filter | OgeKanbanFilter<T> | undefined | undefined | Programmatic card filter: a predicate over the normalized card, or an OgeKanbanFilterExpression ({ tags?, assignees?, priorities?, columns?, swimlanes?, text?, overdue? } — values inside a field are alternatives, fields combine with AND). Filters only what is shown: WIP counts, exports (unless visibleOnly) and the chips stay on the full data. |
showFilterBar | boolean | false | Shows the filter chip bar under the toolbar: one toggle chip (aria-pressed) per distinct tag, assignee and priority, plus a reset button. |
priorityOrder | readonly string[] | undefined | undefined | Priority ranking for columnSort by priority, most important first (case-insensitive). Unset: urgent, critical, highest, high, medium, normal, low, lowest; numeric priorities compare as numbers. |
selectionMode | 'single' | 'multiple' | 'multiple' | 'multiple' adds Ctrl/Shift-click, the selection shortcuts and multi-card drag; 'single' keeps one selected card. |
dragGroup / boardId | string | undefined | undefined | Boards sharing a dragGroup exchange cards: drag a card (or a selection) onto the other board, or use the card menu's “Move to …” entries — the keyboard and single-pointer twin. boardId names the board in the transfer events and the other boards' menus (a generated id otherwise). |
swimlaneWipLimits | Readonly<Record<string, number>> | undefined | undefined | Per-lane total WIP limits keyed by swimlane value — the lane header's count turns danger when exceeded. Per-cell limits are OgeKanbanColumn.swimlaneWipLimit (the column inside each lane). |
checklistExpr | string | ((item: T) => unknown) | undefined | undefined | Checklist / sub-task field: an array of { text, done } (title / checked / completed and plain strings are read too). Cards show a progress badge with an ICU-plural screen-reader text; toggleChecklistItem() writes back in the entry's own shape. |
quickAdd / inlineTitleEditing | boolean | false / false | quickAdd: the column footer's add button opens an inline title composer (Enter adds and keeps it open, Escape closes) instead of the dialog. inlineTitleEditing: double-clicking a card title edits it in place; F2 on a card always does (both through cardAdding / cardUpdating). |
undoLimit | number | 50 | Undo/redo depth — Ctrl+Z / Ctrl+Y (or Ctrl+Shift+Z) and the toolbar buttons. Undo replays the inverse through the cancelable pipelines, so the -ing / -ed events fire as for the original edit; a multi-card move or bulk delete is one step. Cross-board transfers are not recorded (they span two boards). 0 disables history and hides the buttons. |
Behavior
| Name | Type | Default | Description |
|---|---|---|---|
virtualScrolling | boolean | true | Per-column card windowing over a fixed cardHeight — 10k cards stay smooth. Rich variable-height templates may opt out (false), the documented exception. |
cardHeight | number | undefined | undefined (config: 112) | Fixed card height in px; also drives the drag hit-testing and the keyboard scroll-into-view math. |
showToolbar | boolean | true | The built-in toolbar: primary add button, collapse/expand-all pill and the search box. |
allowAdding / allowUpdating / allowDeleting / allowDragging / allowColumnReordering / allowColumnAdding | boolean | true / true / true / true / false / false | Capability gates for the toolbar, dialog, menu, hover quick actions, keyboard shortcuts and drags. allowColumnAdding renders the "+ Add column" ghost column (inline composer → cancelable columnAdding → columnAdded). Per-column allowAdding: false overrides the board. |
columnWidth | number | 300 | Fixed column track width in px — headers stay legible and the board scrolls horizontally, Trello-style. |
cardColorMode | 'stripe' | 'surface' | 'stripe' | How colorExpr renders: an accent bar on the card's edge, or the whole card surface tinted with the color. |
rtlEnabled | boolean | undefined | undefined | Right-to-left layout: the first column sits on the right, ArrowLeft/Right roving and Ctrl+Arrow card moves are mirrored (ArrowLeft goes to the next column), the column-reorder drag and drop hit-testing follow the mirrored geometry and the collapsed-lane chevron points left. Unset follows the page — the computed direction or the nearest dir attribute, read after the first render and kept current when a dir changes; an explicit value also sets dir on the host. |
dialogItems | readonly OgeFormItemData[] | undefined | undefined | Replaces the edit dialog's default form wholesale (generic OgeForm items); cardEditDialogShowing can still adjust per open. The default form only renders editors for fields the board actually maps. |
readOnly | boolean | false | One switch over every allow* capability; the context menu falls back to the browser's native menu. |
messages / locale | Partial<OgeKanbanMessages> / string | undefined | {} / undefined | Per-instance overrides of the DI config (provideOgeKanbanConfig). Every user-facing string, aria labels and live-region templates included, lives in the messages interface; locale drives every Intl format. |
Methods 16
Methods
| Name | Type | Description |
|---|---|---|
addCard(item) | (item: T) => void | Programmatic insert through the cancelable cardAdding pipeline; the column and swimlane resolve from the item's own fields. |
updateCard(original, updated) | (original: T, updated: T) => void | Programmatic update through the cancelable cardUpdating pipeline. |
deleteCard(item) | (item: T) => void | Programmatic delete through the cancelable cardDeleting pipeline. |
moveCard(key, toColumn, toIndex?, toSwimlane?) | (key: unknown, toColumn: string, toIndex?: number, toSwimlane?: string | null) => void | Moves a card (append when toIndex is omitted) through the cancelable cardMoving pipeline — the same path the drag, the Ctrl+Arrow twin and the context menu commit through. |
editCard(card) / openNewCard(column, swimlane) | (…) => void | Opens the built-in dialog for an existing card / prefilled for a new card, through the cardEditDialogShowing hook. |
closeDialog() | () => void | Closes the edit dialog without saving; fires cardEditDialogHidden. |
collapseAllColumns() / expandAllColumns() | () => void | The toolbar buttons, callable from code. |
undo() / redo() / canUndo() / canRedo() | () => void / () => boolean | History: revert / re-apply the last step through the cancelable pipelines, and whether a step exists. |
selectCards(keys) / clearSelection() | (keys: readonly unknown[]) => void / () => void | Programmatic selection (board order applied; writes selectedCardKeys). |
moveCards(keys, toColumn, toIndex?, toSwimlane?) | (keys: readonly unknown[], toColumn: string, toIndex?: number, toSwimlane?: string | null) => void | Moves several cards into one cell as one undoable step, inserted consecutively (board order kept) before the card at toIndex; without toSwimlane every card stays in its own lane. Each card runs cardMoving / cardMoved. |
deleteCards(items) | (items: readonly T[]) => void | Bulk delete as one undoable step, each item through cardDeleting; announced with an ICU plural. |
transferCards(keys, toBoard, toColumn?, toIndex?, toSwimlane?) | (…) => boolean | Sends cards to another mounted board of the same dragGroup (default: its first droppable column, appended). Returns whether the target's cardTransferring accepted them. |
toggleChecklistItem(key, index) | (key: unknown, index: number) => void | Toggles one checklist entry through cardUpdating (needs a field-name checklistExpr). |
startTitleEdit(key) | (key: unknown) => void | Opens the inline title editor on a card (what F2 does); Enter or blur commits through cardUpdating, Escape cancels. |
clearFilters() | () => void | Resets the chip bar (filterValue); the programmatic filter input is untouched. |
getExportData(options?) / exportToCsv(fileName?, options?) | (options?: OgeKanbanExportOptions) => OgeKanbanExportData / (fileName?: string, options?: OgeKanbanExportOptions) => string | The cards as export rows in board order (column → lane → cell; visibleOnly keeps only what the filters show), and a CSV download built on core's formula-guarded buildCsv (returns the text). Excel is the lazy @oge-ui/kanban/export-excel entry. |
Events 9
Events
| Name | Type | Description |
|---|---|---|
cardClick / cardDblClick / cardContextMenu | OgeKanbanCardEvent<T> | Pointer interactions with a card ({ card, event }). Double-click also opens the editor; right-click fires before the built-in menu opens, so app handlers can coexist with it. |
cardAdding / cardUpdating / cardDeleting / cardMoving | Oge…Event<T> (mutable cancel) | Cancelable pre-events — set cancel = true to veto. cardMoving carries { card, fromColumn, toColumn, fromIndex, toIndex, fromSwimlane, toSwimlane } and guards drags, keyboard moves and programmatic moves alike. |
cardAdded / cardUpdated / cardDeleted / cardMoved | Oge…Event<T> | Past-tense events fire only for applied changes and carry the data to persist (cardMoved.card is the updated item, orderExpr write-back included). |
cardEditDialogShowing | OgeKanbanEditDialogShowingEvent<T> | Cancelable + customization point before the dialog opens: formItems arrives pre-populated with the default OgeForm items and may be mutated or replaced (dx onAppointmentFormOpening parity). |
cardEditDialogHidden | void | The edit dialog closed — saved, cancelled, deleted or closeDialog() (Syncfusion dialogClose parity). |
columnReordered | OgeKanbanColumnReorderedEvent | A header drag committed a new order: { column, fromIndex, toIndex, columnOrder }. |
columnAdding / columnAdded | OgeKanbanColumnAddingEvent / OgeKanbanColumnAddedEvent | The "+ Add column" composer's cancelable pre-event and its past-tense commit. |
cardTransferring | OgeKanbanCardTransferringEvent<T> | Cancelable, fired by the target board before cards from another board of the dragGroup land: { cards, fromBoard, toBoard, fromColumn, toColumn, fromSwimlane, toSwimlane, toIndex, cancel }. |
cardTransferred | OgeKanbanCardTransferredEvent<T> | Fired by both boards after a transfer landed: the source host removes sourceCards from its data, the target host adds cards (column / swimlane already written). |
Types 21
Templates
| Name | Type | Description |
|---|---|---|
*ogeKanbanCardTemplate | OgeKanbanCardTemplateContext<T> | Replaces the card body ($implicit card with its source, plus column and swimlane). Drag, keyboard and ARIA stay on the component. Buttons, links and inputs in the template are real interactive content: Tab reaches them while the card is its column's tab stop, they never start a drag or feed the board's arrow keys, and Escape returns to the card. |
*ogeKanbanColumnHeaderTemplate | OgeKanbanColumnHeaderTemplateContext | Replaces the column header's title row ($implicit column, count, wip); the collapse affordance stays. An OGE extra — no reference library templates its headers. |
Configuration
| Name | Type | Description |
|---|---|---|
provideOgeKanbanConfig(config) | (config: OgeKanbanConfigInput) => Provider | DI-level configuration: messages (shallow-merged per top-level block), locale, cardHeight. |
OgeKanbanMessages | interface | Every user-facing string: toolbar, menu, dialog, board (aria label templates with {title}/{count}/{limit} tokens) and announcements (live-region templates). |
OgeKanbanBoardMessages | interface | The board block: boardLabel, columnLabel / columnLabelWip (the column list's name), cardLabel ({title}, {column}), cardRoleDescription (default card — every card's aria-roledescription), editCardAction / deleteCardAction (the quick-action buttons, {title}), boardHint, wipExceeded, overdue, the empty-state and add-card/column strings. |
OgeKanbanColumn | interface | { key, title?, color?, wipLimit?, minCount?, collapsed?, allowAdding?, allowDrag?, allowDrop?, transitionColumns? } — the declared column shape. wipLimit/minCount drive the danger/warning badges; allowDrag/allowDrop/transitionColumns gate interactive moves (programmatic moveCard is deliberately not gated). |
OgeKanbanCard<T> | interface | The normalized card handed to templates and events: key, source (your item, unchanged), column, title, description, color, order, swimlane, tags, assignees, dueDate, priority, checklist ({ text, done }[]). |
Filtering, sorting & selection types
| Name | Type | Description |
|---|---|---|
OgeKanbanFilter<T> | type | ((card: OgeKanbanCard<T>) => boolean) | OgeKanbanFilterExpression — the filter input's shape. |
OgeKanbanFilterExpression | interface | { tags?, assignees?, priorities?, columns?, swimlanes?, text?, overdue? } — any-of inside a field, all-of across fields; also the chip bar's filterValue. |
OgeKanbanColumnSort<T> | type | Readonly<Record<string, OgeKanbanColumnSortSpec<T>>> keyed by column ('*' = every column). |
OgeKanbanColumnSortSpec<T> | type | { field: OgeKanbanSortField; direction?: 'asc' | 'desc' } or a card comparator (ties fall back to the board order). |
OgeKanbanSortField | 'order' | 'title' | 'priority' | 'dueDate' | Sort fields; ascending priority puts the most important first, empty due dates sort last in both directions. |
OgeKanbanSelectionMode | 'single' | 'multiple' | The selectionMode union. |
OgeKanbanCardTransferringEvent<T> / OgeKanbanCardTransferredEvent<T> | interface | Cross-board transfer payloads: board ids, from/to column and lane, insertion index; the past-tense one carries both cards (as landed) and sourceCards. |
Export
| Name | Type | Description |
|---|---|---|
OgeKanbanExportData | interface | { rows, messages, locale, hasSwimlanes } — what getExportData() returns and both exporters read. |
OgeKanbanExportRow | interface | { key, title, column, columnKey, swimlane, description, tags, assignees, priority, dueDate, checklistDone, checklistTotal }. |
OgeKanbanExportOptions | interface | { visibleOnly? } — only the cards the filters and search show. |
OgeKanbanExportMessages | interface | The optional export messages block: sheetName and every column header (English fallback when a catalog omits it). |
exportKanbanToExcel(board, options?) | (board, options?: OgeKanbanExcelExportOptions) => Promise<void> | The lazy /export-excel entry (optional exceljs peer): one row per card, due dates as real dates, tags/assignees joined with ; . Pass the board instance (Angular) or its ref handle (React). |
buildKanbanExcelWorkbook(data, options?) | (data: OgeKanbanExportData, options?) => Workbook | The pure builder behind it, shared by both layers through @oge-ui/kanban-engine/export-excel. |
OgeKanbanExcelExportOptions | interface | { filename?, sheetName?, visibleOnly? } (defaults kanban.xlsx / the export.sheetName message). |
Notes
- No WAI-ARIA APG kanban pattern exists, and a listbox cannot hold interactive content, so the board is a set of lists with a roving focus: each column is a labeled
role="list"(title, count and WIP limit in the accessible name) ofrole="listitem"wrappers, each holding a focusable card (role="group",aria-roledescription="card"frommessages.board.cardRoleDescription, the selected cardaria-current). One Tab stop per column. - Keyboard on a focused card: Arrow keys rove within and across columns, Enter edits, Delete deletes, Ctrl+Arrow moves the card as the exact keyboard twin of the drag (announced through a polite live region), and Tab continues into the card's own content — the edit / delete quick actions are real labeled buttons, and so is whatever a custom card template renders. Keys typed there stay with that control (Ctrl+Arrow in an input moves by word, not the card); Escape returns to the card.
- Binding plain arrays never mutates them — edits land in an internal working set and the past-tense events carry the data to persist. Without an
orderExprthe array order is the board order; with one, moves write a midpoint order value back in the item's own storage shape. - Virtualization assumes the fixed
cardHeight— that is also what keeps drag hit-testing allocation-free and agreeing with what is rendered. Rich variable-height card templates should set[virtualScrolling]="false"(the documented exception).