<bmx-task-board>
The plan as cards in columns: a column for each stage of the work, a card for each task, and lanes across the board by person, category or phase.
14 properties · 2 events · 3 methods · 14 parts
Example
lane-by. Moving a card changes those fields on the task, so a Gantt chart given the same list
sees the move. The board schedules the plan too, so every card knows its dates and a critical one says so.
strict-limits would refuse a third card.
Show markup
<bmx-task-board
id="ex-task-board"
label="Office move board"
lane-by="assignee"
editable
tasks='[
{"id":"1","name":"Survey the new site","status":"Done","assignee":"Ada Lovelace","duration":3,"progress":100},
{"id":"2","name":"Agree the floor plan","status":"In progress","assignee":"Grace Hopper","duration":4,"progress":60},
{"id":"3","name":"Network cabling","status":"In progress","assignee":"Ada Lovelace","duration":6,"progress":20},
{"id":"4","name":"Furniture delivery","status":"To do","assignee":"Grace Hopper","duration":2},
{"id":"5","name":"Meeting rooms AV","status":"To do","duration":5,"category":"Facilities"}
]'
links='[{"from":"1","to":"2"},{"from":"2","to":"3"},{"from":"2","to":"4"},{"from":"3","to":"5"}]'
></bmx-task-board>
<script type="module">
await customElements.whenDefined('bmx-task-board');
// A column with a limit is an object; from markup, `columns="To do,In progress,Done"` works without one.
document.getElementById('ex-task-board').columns = ['To do', { id: 'In progress', limit: 2 }, 'Done'];
</script>
<div class="row" style="margin-block-start: 1rem">
<span class="note">
<strong>A column is a status and a lane is a person</strong> — or a category, or a phase, with
<code>lane-by</code>. Moving a card changes those fields on the task, so a Gantt chart given the same list
sees the move. The board schedules the plan too, so every card knows its dates and a critical one says so.
</span>
</div>
<div class="row" style="margin-block-start: 1rem">
<span class="note">
<strong>Carry a card from the keyboard.</strong> <kbd>Space</kbd> picks it up; the arrows carry it —
<kbd>Shift</kbd> with <kbd>↑</kbd> and <kbd>↓</kbd> between lanes — and <kbd>Space</kbd> drops
it or <kbd>Esc</kbd> puts it back, each step announced. The In progress column has a limit of two;
<code>strict-limits</code> would refuse a third card.
</span>
</div>
<bmx-task-board
label="Office move"
columns="To do,In progress,Done"
lane-by="assignee"
tasks='[{"id":"1","name":"Survey","status":"Done","assignee":"Ada"},
{"id":"2","name":"Fit-out","status":"To do"}]'
></bmx-task-board>
It reads the same tasks and links as bmx-gantt and bmx-pert-chart.
A column is a value of a task's status; a lane is a value of its
assignee, its category or the phase it belongs to; so moving a card is
changing those fields, and a Gantt chart given the same list sees the move.
Because the board schedules the plan too, every card knows its dates, and a
card on the critical path says so.
LIMITS ARE SHOWN, AND CAN BE HELD
A column with a limit shows its count against it and turns to its warning
colour when it is passed. With strict-limits, a full column refuses a
card - drawn refused while it is still in the reader's hand.
A BOARD THE KEYBOARD CAN USE
The cards take one Tab stop and the arrow keys move between them. Space picks a card up; the arrows then carry it - Up and Down within a column, Left and Right between columns, Shift with Up and Down between lanes - and Space drops it or Escape puts it back, each step announced. A pointer drags the same cards, on a mouse, a pen or a finger.
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
applyChanges |
apply-changes |
boolean |
true |
Whether a move is applied by the board itself. Off to own the list entirely. |
canMove |
property only | (detail: BmxTaskBoardMoveDetail) => boolean |
— | Whether a move may be made, asked while a card is carried. A function, set from script. |
columns |
columns |
(string | BmxBoardColumn)[] | string |
[] |
The columns, as status values in order: columns="To do,In progress,Done", or objects with a label and a limit from script. Left empty, the statuses the tasks use are the columns. |
editable |
editable |
boolean |
false |
Lets the reader move cards. |
holidays |
holidays |
string[] | string |
[] |
Dates that are not worked, YYYY-MM-DD. |
label |
label |
string |
— | What the board is called. Without one it is announced as "Task board". |
laneBy |
lane-by |
BmxBoardLaneBy |
'none' |
What the rows of the board are: none, assignee, category or parent (the phase). |
links |
links |
BmxTaskLink[] | string |
[] |
The links between tasks, which decide each card's dates and whether it is critical. |
locale |
locale |
string |
— | The locale dates are written in. Defaults to the page's. |
projectStart |
project-start |
string |
— | The first day work can happen, YYYY-MM-DD. |
showDates |
show-dates |
boolean |
true |
Shows each card's dates. |
strictLimits |
strict-limits |
boolean |
false |
Refuses a card to a column that is at its limit. |
tasks |
tasks |
BmxTask[] | string |
[] |
The tasks - the same list bmx-gantt takes. Summaries are not cards. |
workingDays |
working-days |
number[] | string |
[1, 2, 3, 4, 5] |
Days of the week that are worked, 0 for Sunday. |
Events
| Event | Detail | Description |
|---|---|---|
bmxCardMove |
BmxTaskBoardMoveDetail |
A card is about to move. Cancelable. |
bmxSelect |
BmxTaskBoardSelectDetail |
A card was chosen. |
Methods
| Method | Signature | Description |
|---|---|---|
focusCard |
focusCard(id: string) => Promise<void> |
Focuses a card. |
getSchedule |
getSchedule() => Promise<BmxSchedule> |
The plan as scheduled. |
moveCard |
moveCard(id: string, column: string, lane?: string, index?: number) => Promise<boolean> |
Moves a card from script, as if the reader had; returns whether it moved. |
Slots
| Slot | Description |
|---|---|
empty |
what to draw when there are no tasks. |
CSS shadow parts
| Part | Description |
|---|---|
board |
|
card-assignee |
|
card-category |
|
card-critical-badge |
|
card-dates |
|
card-ghost |
|
card-name |
|
card-progress |
|
card-wbs |
|
column-count |
|
empty |
|
lane |
|
lane-header |
|
placeholder |
CSS custom properties
| Property | Description |
|---|---|
--bmx-board-card-background |
A card's fill. |
--bmx-board-card-border |
Its border. |
--bmx-board-card-color |
Its text. |
--bmx-board-card-radius |
Its corners. |
--bmx-board-card-shadow |
Its shadow. |
--bmx-board-column-background |
A column's fill. |
--bmx-board-column-width |
The narrowest a column may be. |
--bmx-board-columns |
How many columns there are. Written by the component. |
--bmx-board-critical-color |
The mark on a critical card. |
--bmx-board-header-color |
Column and lane headings. |
--bmx-board-over-color |
A column's count once it passes its limit. |
--bmx-board-progress-color |
The progress meter. |
--bmx-board-target-color |
The outline of the cell a card would land in. @part board - the whole board (role="region"). @part column-header - a column's heading. Also column-header-over. @part column-count - its count, against its limit when it has one. @part lane - one row of the board. @part lane-header - a lane's heading. @part cell - one lane-and-column cell (role="list"). Also cell-target. @part card - one card. Also card-critical, card-carried and card-<category>. @part card-wbs - the outline number. @part card-category - the category chip. @part card-critical-badge - the "Critical" chip. @part card-name - the task's name. @part card-dates - its dates. @part card-assignee - the assignee's initials. @part card-progress - the progress meter. @part placeholder - where a dragged card would land. @part card-ghost - the copy that follows the pointer. @part empty - what is drawn when there are no tasks. |