@toclocoinc/lattice-grid 1.68.0 → 1.68.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -1
- package/angular/fesm2022/toclocoinc-lattice-grid-angular.mjs +1 -0
- package/angular/package.json +1 -1
- package/docs/API.html +8058 -3962
- package/docs/api-detail.html +101 -4
- package/lattice-grid.d.ts +5917 -78
- package/lattice-grid.esm.min.js +197 -39
- package/lattice-grid.min.cjs +197 -39
- package/lattice-grid.min.js +197 -39
- package/modules/ai.d.ts +172 -11
- package/modules/ai.esm.min.js +3 -3
- package/modules/ai.min.cjs +3 -3
- package/modules/ai.min.js +3 -3
- package/modules/angular.d.ts +1 -1
- package/modules/angular.esm.min.js +3 -3
- package/modules/angular.min.cjs +3 -3
- package/modules/angular.min.js +3 -3
- package/modules/chart-alluvial.d.ts +1 -1
- package/modules/chart-alluvial.esm.min.js +1 -1
- package/modules/chart-alluvial.min.cjs +1 -1
- package/modules/chart-alluvial.min.js +1 -1
- package/modules/chart-arc.d.ts +1 -1
- package/modules/chart-arc.esm.min.js +1 -1
- package/modules/chart-arc.min.cjs +1 -1
- package/modules/chart-arc.min.js +1 -1
- package/modules/chart-bubblemap.d.ts +1 -1
- package/modules/chart-bubblemap.esm.min.js +1 -1
- package/modules/chart-bubblemap.min.cjs +1 -1
- package/modules/chart-bubblemap.min.js +1 -1
- package/modules/chart-bump.d.ts +1 -1
- package/modules/chart-bump.esm.min.js +1 -1
- package/modules/chart-bump.min.cjs +1 -1
- package/modules/chart-bump.min.js +1 -1
- package/modules/chart-calendar.d.ts +1 -1
- package/modules/chart-calendar.esm.min.js +1 -1
- package/modules/chart-calendar.min.cjs +1 -1
- package/modules/chart-calendar.min.js +1 -1
- package/modules/chart-decomposition.d.ts +1 -1
- package/modules/chart-decomposition.esm.min.js +1 -1
- package/modules/chart-decomposition.min.cjs +1 -1
- package/modules/chart-decomposition.min.js +1 -1
- package/modules/chart-diverging.d.ts +1 -1
- package/modules/chart-diverging.esm.min.js +1 -1
- package/modules/chart-diverging.min.cjs +1 -1
- package/modules/chart-diverging.min.js +1 -1
- package/modules/chart-dumbbell.d.ts +1 -1
- package/modules/chart-dumbbell.esm.min.js +1 -1
- package/modules/chart-dumbbell.min.cjs +1 -1
- package/modules/chart-dumbbell.min.js +1 -1
- package/modules/chart-fan.d.ts +1 -1
- package/modules/chart-fan.esm.min.js +1 -1
- package/modules/chart-fan.min.cjs +1 -1
- package/modules/chart-fan.min.js +1 -1
- package/modules/chart-hexbin.d.ts +1 -1
- package/modules/chart-hexbin.esm.min.js +1 -1
- package/modules/chart-hexbin.min.cjs +1 -1
- package/modules/chart-hexbin.min.js +1 -1
- package/modules/chart-hexmap.d.ts +1 -1
- package/modules/chart-hexmap.esm.min.js +1 -1
- package/modules/chart-hexmap.min.cjs +1 -1
- package/modules/chart-hexmap.min.js +1 -1
- package/modules/chart-icicle.d.ts +1 -1
- package/modules/chart-icicle.esm.min.js +1 -1
- package/modules/chart-icicle.min.cjs +1 -1
- package/modules/chart-icicle.min.js +1 -1
- package/modules/chart-markermap.d.ts +1 -1
- package/modules/chart-markermap.esm.min.js +1 -1
- package/modules/chart-markermap.min.cjs +1 -1
- package/modules/chart-markermap.min.js +1 -1
- package/modules/chart-parallel.d.ts +1 -1
- package/modules/chart-parallel.esm.min.js +1 -1
- package/modules/chart-parallel.min.cjs +1 -1
- package/modules/chart-parallel.min.js +1 -1
- package/modules/chart-ridgeline.d.ts +1 -1
- package/modules/chart-ridgeline.esm.min.js +1 -1
- package/modules/chart-ridgeline.min.cjs +1 -1
- package/modules/chart-ridgeline.min.js +1 -1
- package/modules/chart-roc.d.ts +1 -1
- package/modules/chart-roc.esm.min.js +1 -1
- package/modules/chart-roc.min.cjs +1 -1
- package/modules/chart-roc.min.js +1 -1
- package/modules/chart-slope.d.ts +1 -1
- package/modules/chart-slope.esm.min.js +1 -1
- package/modules/chart-slope.min.cjs +1 -1
- package/modules/chart-slope.min.js +1 -1
- package/modules/chart-splom.d.ts +1 -1
- package/modules/chart-splom.esm.min.js +1 -1
- package/modules/chart-splom.min.cjs +1 -1
- package/modules/chart-splom.min.js +1 -1
- package/modules/chart-waffle.d.ts +1 -1
- package/modules/chart-waffle.esm.min.js +1 -1
- package/modules/chart-waffle.min.cjs +1 -1
- package/modules/chart-waffle.min.js +1 -1
- package/modules/charts.d.ts +16 -1
- package/modules/charts.esm.min.js +23 -16
- package/modules/charts.min.cjs +23 -16
- package/modules/charts.min.js +23 -16
- package/modules/data-router.d.ts +259 -3
- package/modules/data-router.esm.min.js +9 -4
- package/modules/data-router.min.cjs +9 -4
- package/modules/data-router.min.js +9 -4
- package/modules/devtools.d.ts +1 -1
- package/modules/devtools.esm.min.js +1 -1
- package/modules/devtools.min.cjs +1 -1
- package/modules/devtools.min.js +1 -1
- package/modules/dhtmlx-compat.d.ts +1 -1
- package/modules/dhtmlx-compat.esm.min.js +3 -3
- package/modules/dhtmlx-compat.min.cjs +3 -3
- package/modules/dhtmlx-compat.min.js +3 -3
- package/modules/gantt.d.ts +563 -12
- package/modules/gantt.esm.min.js +8 -4
- package/modules/gantt.min.cjs +8 -4
- package/modules/gantt.min.js +8 -4
- package/modules/geo-europe-nuts.d.ts +1 -1
- package/modules/geo-europe-nuts.esm.min.js +1 -1
- package/modules/geo-uk.d.ts +1 -1
- package/modules/geo-uk.esm.min.js +1 -1
- package/modules/geo-us-states.d.ts +1 -1
- package/modules/geo-us-states.esm.min.js +1 -1
- package/modules/geo-world-110m.d.ts +1 -1
- package/modules/geo-world-110m.esm.min.js +1 -1
- package/modules/geo-world-50m.d.ts +1 -1
- package/modules/geo-world-50m.esm.min.js +1 -1
- package/modules/htmx.d.ts +1 -1
- package/modules/htmx.esm.min.js +197 -39
- package/modules/htmx.min.cjs +197 -39
- package/modules/htmx.min.js +197 -39
- package/modules/kanban.d.ts +687 -4
- package/modules/kanban.esm.min.js +3 -3
- package/modules/kanban.min.cjs +3 -3
- package/modules/kanban.min.js +3 -3
- package/modules/kpi.d.ts +237 -3
- package/modules/kpi.esm.min.js +4 -4
- package/modules/kpi.min.cjs +4 -4
- package/modules/kpi.min.js +4 -4
- package/modules/layout.d.ts +249 -7
- package/modules/layout.esm.min.js +3 -3
- package/modules/layout.min.cjs +3 -3
- package/modules/layout.min.js +3 -3
- package/modules/mock-socket.d.ts +6 -1
- package/modules/mock-socket.esm.min.js +1 -1
- package/modules/mock-socket.min.cjs +1 -1
- package/modules/mock-socket.min.js +1 -1
- package/modules/react.d.ts +18 -1
- package/modules/react.esm.min.js +3 -3
- package/modules/react.min.cjs +3 -3
- package/modules/react.min.js +3 -3
- package/modules/svelte.d.ts +1 -1
- package/modules/svelte.esm.min.js +3 -3
- package/modules/svelte.min.cjs +3 -3
- package/modules/svelte.min.js +3 -3
- package/modules/tabs.d.ts +116 -11
- package/modules/tabs.esm.min.js +3 -3
- package/modules/tabs.min.cjs +3 -3
- package/modules/tabs.min.js +3 -3
- package/modules/vue.d.ts +12 -1
- package/modules/vue.esm.min.js +3 -3
- package/modules/vue.min.cjs +3 -3
- package/modules/vue.min.js +3 -3
- package/modules/webcomponent.d.ts +89 -6
- package/modules/webcomponent.esm.min.js +242 -43
- package/modules/webcomponent.min.cjs +242 -43
- package/modules/webcomponent.min.js +242 -43
- package/package.json +1 -1
package/modules/kanban.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.68.
|
|
2
|
+
* Lattice Grid 1.68.2, kanban module type declarations
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
@@ -14,28 +14,93 @@ type KanbanRow = Record<string, unknown>;
|
|
|
14
14
|
* and carried for the later cycles that render them.
|
|
15
15
|
*/
|
|
16
16
|
interface KanbanCard {
|
|
17
|
+
/** The card's identity, from the board's `rowKey`. */
|
|
17
18
|
key: unknown;
|
|
19
|
+
/**
|
|
20
|
+
* The row behind the card. On a grid-bound board this is the materialised object the
|
|
21
|
+
* board read off the grid, not the grid's own row.
|
|
22
|
+
*/
|
|
18
23
|
row: KanbanRow;
|
|
24
|
+
/**
|
|
25
|
+
* Which column the card sits in — the stringified group value — or null when the row's
|
|
26
|
+
* group value is null or undefined, which leaves the card unplaced.
|
|
27
|
+
*/
|
|
19
28
|
columnId: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* The card's estimate, from `pointsProperty`. Zero when there is no points property or
|
|
31
|
+
* the value is not a finite number.
|
|
32
|
+
*/
|
|
20
33
|
points: number;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the points value was a finite number. A card without points contributes
|
|
36
|
+
* nothing to a column's sum.
|
|
37
|
+
*/
|
|
21
38
|
hasPoints: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The raw value of `orderProperty`, which ranks the card inside its column. Undefined
|
|
41
|
+
* when no order property is configured.
|
|
42
|
+
*/
|
|
22
43
|
order?: unknown;
|
|
44
|
+
/**
|
|
45
|
+
* The raw value of `swimlaneProperty`, the lane the card belongs to. Undefined when no
|
|
46
|
+
* swimlane property is configured.
|
|
47
|
+
*/
|
|
23
48
|
swimlane?: unknown;
|
|
49
|
+
/**
|
|
50
|
+
* The raw value of `sprintProperty`, used by the sprint selection. Undefined when no
|
|
51
|
+
* sprint property is configured.
|
|
52
|
+
*/
|
|
24
53
|
sprint?: unknown;
|
|
54
|
+
/**
|
|
55
|
+
* The raw value of `epicProperty`, used by the epic selection. Undefined when no epic
|
|
56
|
+
* property is configured.
|
|
57
|
+
*/
|
|
25
58
|
epic?: unknown;
|
|
59
|
+
/**
|
|
60
|
+
* The card template's text, one entry per `card` mapping. A mapping that names a grid
|
|
61
|
+
* column is read through that column's own formatter, so it reads exactly as the cell
|
|
62
|
+
* does; anything missing is ''.
|
|
63
|
+
*/
|
|
26
64
|
fields: Record<string, string>;
|
|
27
65
|
}
|
|
28
66
|
|
|
29
67
|
/** A column with its cards and aggregates. `over` is true when `count` exceeds `wipLimit`. */
|
|
30
68
|
interface KanbanColumn {
|
|
69
|
+
/**
|
|
70
|
+
* The column's identity — a configured column's `id`, or the stringified group value a
|
|
71
|
+
* data-driven column came from.
|
|
72
|
+
*/
|
|
31
73
|
id: string;
|
|
74
|
+
/** The heading shown above the column. Defaults to the id, humanised. */
|
|
32
75
|
title: string;
|
|
76
|
+
/**
|
|
77
|
+
* The accent colour drawn as a dot in the header, as configured. Null when the column
|
|
78
|
+
* def set none.
|
|
79
|
+
*/
|
|
33
80
|
color: string | null;
|
|
81
|
+
/**
|
|
82
|
+
* The work-in-progress limit for this column, or null when it has none. Advisory unless
|
|
83
|
+
* `enforceWip` is on.
|
|
84
|
+
*/
|
|
34
85
|
wipLimit: number | null;
|
|
86
|
+
/**
|
|
87
|
+
* Whether the column is currently collapsed to a strip — either configured so, or
|
|
88
|
+
* collapsed by the user.
|
|
89
|
+
*/
|
|
35
90
|
collapsed: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* The column's cards that survive the board's filters, in arrival order, re-sorted by
|
|
93
|
+
* `orderProperty` when one is configured.
|
|
94
|
+
*/
|
|
36
95
|
cards: KanbanCard[];
|
|
96
|
+
/** How many cards the column holds — the length of `cards`, after filtering. */
|
|
37
97
|
count: number;
|
|
98
|
+
/** The sum of the column's card points; cards without a finite points value add nothing. */
|
|
38
99
|
points: number;
|
|
100
|
+
/**
|
|
101
|
+
* True when the column has a WIP limit and its count exceeds it. The header shows this
|
|
102
|
+
* whether or not `enforceWip` refuses the move.
|
|
103
|
+
*/
|
|
39
104
|
over: boolean;
|
|
40
105
|
}
|
|
41
106
|
|
|
@@ -60,8 +125,17 @@ type KanbanColumnDef = string | {
|
|
|
60
125
|
|
|
61
126
|
/** A card field editor handle returned by a host editor factory. */
|
|
62
127
|
interface KanbanEditor {
|
|
128
|
+
/** The editor's element. The board appends it to the card being edited. */
|
|
63
129
|
el: HTMLElement;
|
|
130
|
+
/**
|
|
131
|
+
* Called straight after the editor is appended, to put the caret where it belongs.
|
|
132
|
+
* Without it the board focuses `el` itself.
|
|
133
|
+
*/
|
|
64
134
|
focus?: () => void;
|
|
135
|
+
/**
|
|
136
|
+
* Called when the edit commits or is cancelled, so the editor can release what it
|
|
137
|
+
* holds. Optional.
|
|
138
|
+
*/
|
|
65
139
|
destroy?: () => void;
|
|
66
140
|
}
|
|
67
141
|
|
|
@@ -74,15 +148,34 @@ type KanbanFieldMap = string | ((row: KanbanRow) => unknown) | {
|
|
|
74
148
|
|
|
75
149
|
/** The field-to-property mapping that drives the card template. */
|
|
76
150
|
interface KanbanCardMap {
|
|
151
|
+
/** The card's headline text. */
|
|
77
152
|
title?: KanbanFieldMap;
|
|
153
|
+
/** A second line under the title. */
|
|
78
154
|
subtitle?: KanbanFieldMap;
|
|
155
|
+
/** A comma-separated string rendered as one chip per label; blanks are skipped. */
|
|
79
156
|
labels?: KanbanFieldMap;
|
|
157
|
+
/** The person shown first in the card's meta row. */
|
|
80
158
|
assignee?: KanbanFieldMap;
|
|
159
|
+
/** The due date, shown in the meta row as whatever text the mapping produces. */
|
|
81
160
|
due?: KanbanFieldMap;
|
|
161
|
+
/** An image URL drawn as a cover band across the top of the card. */
|
|
82
162
|
cover?: KanbanFieldMap;
|
|
163
|
+
/**
|
|
164
|
+
* A progress bar over the card. The value is read as a percentage (0-100); a value that
|
|
165
|
+
* is not a number draws no bar.
|
|
166
|
+
*/
|
|
83
167
|
progress?: KanbanFieldMap;
|
|
168
|
+
/** A single badge chip at the end of the meta row. */
|
|
84
169
|
badges?: KanbanFieldMap;
|
|
170
|
+
/**
|
|
171
|
+
* A colour for the card's left border. Any CSS colour; an empty value leaves the border
|
|
172
|
+
* plain.
|
|
173
|
+
*/
|
|
85
174
|
accent?: KanbanFieldMap;
|
|
175
|
+
/**
|
|
176
|
+
* Any other card slot the board's theme declares, mapped the same way as the named
|
|
177
|
+
* ones above. `undefined` is the honest value for a slot that is left unmapped.
|
|
178
|
+
*/
|
|
86
179
|
[field: string]: KanbanFieldMap | undefined;
|
|
87
180
|
}
|
|
88
181
|
|
|
@@ -93,11 +186,25 @@ type KanbanReadonly = boolean | {
|
|
|
93
186
|
cards?: Record<string, boolean>;
|
|
94
187
|
};
|
|
95
188
|
|
|
96
|
-
/**
|
|
189
|
+
/**
|
|
190
|
+
* The payload of the three card pointer events — `card:click`, `card:dblclick`
|
|
191
|
+
* and `card:contextmenu`. The board's other events carry their own shapes;
|
|
192
|
+
* {@link KanbanEventPayloads} names one per event.
|
|
193
|
+
*/
|
|
97
194
|
interface KanbanEvent {
|
|
195
|
+
/** The card the event is about. */
|
|
98
196
|
card: KanbanCard;
|
|
197
|
+
/** The id of the column the card is in, or null when it is unplaced. */
|
|
99
198
|
column: string | null;
|
|
199
|
+
/**
|
|
200
|
+
* The card's element, for a host that wants to anchor a popover to it. Absent on a
|
|
201
|
+
* headless board.
|
|
202
|
+
*/
|
|
100
203
|
el?: unknown;
|
|
204
|
+
/**
|
|
205
|
+
* The DOM event that caused this one, so a host can read modifier keys or call
|
|
206
|
+
* `preventDefault`.
|
|
207
|
+
*/
|
|
101
208
|
originalEvent?: unknown;
|
|
102
209
|
}
|
|
103
210
|
|
|
@@ -161,8 +268,17 @@ interface KanbanSlaConfig {
|
|
|
161
268
|
|
|
162
269
|
/** The computed SLA state of one card. */
|
|
163
270
|
interface KanbanSlaState {
|
|
271
|
+
/** The card this ageing state belongs to. */
|
|
164
272
|
key: unknown;
|
|
273
|
+
/**
|
|
274
|
+
* The column the card was in when it was aged — the thresholds are looked up per
|
|
275
|
+
* column.
|
|
276
|
+
*/
|
|
165
277
|
columnId: string | null;
|
|
278
|
+
/**
|
|
279
|
+
* The card's swimlane value, for a per-lane threshold. Undefined on a board without
|
|
280
|
+
* swimlanes.
|
|
281
|
+
*/
|
|
166
282
|
lane?: unknown;
|
|
167
283
|
/** The ageing-clock start epoch (ms), or null when no time source could be resolved. */
|
|
168
284
|
start: number | null;
|
|
@@ -213,7 +329,13 @@ interface KanbanSla {
|
|
|
213
329
|
* swimlane property) and any customer schema without code change.
|
|
214
330
|
*/
|
|
215
331
|
interface KanbanConfig {
|
|
332
|
+
/** The source rows, one per card. Use this or `grid`, not both — `rows` wins. */
|
|
216
333
|
rows?: KanbanRow[];
|
|
334
|
+
/**
|
|
335
|
+
* A Lattice grid to bind to instead of `rows`: the board reads the grid's displayed
|
|
336
|
+
* rows through its own value pipeline and writes moves back through it. On a bound
|
|
337
|
+
* board `rows.apply` and `setRows` are ignored with a warning.
|
|
338
|
+
*/
|
|
217
339
|
grid?: unknown;
|
|
218
340
|
/**
|
|
219
341
|
* Card identity (a field or fn, returning a string or number); default
|
|
@@ -222,12 +344,40 @@ interface KanbanConfig {
|
|
|
222
344
|
* join into here.
|
|
223
345
|
*/
|
|
224
346
|
rowKey?: string | ((row: KanbanRow) => string | number);
|
|
347
|
+
/**
|
|
348
|
+
* The row property whose value puts a card in a column. Without it (and without `grid`
|
|
349
|
+
* or `columns`) the board warns and shows nothing.
|
|
350
|
+
*/
|
|
225
351
|
columnProperty?: string;
|
|
352
|
+
/**
|
|
353
|
+
* The columns to show, as ids or `{ id, title, color, wipLimit, collapsed, done }`.
|
|
354
|
+
* Configured columns appear even when empty; a group value outside them still gets a
|
|
355
|
+
* column of its own, appended, so no card is dropped.
|
|
356
|
+
*/
|
|
226
357
|
columns?: KanbanColumnDef[];
|
|
358
|
+
/**
|
|
359
|
+
* Pins the leading column order by id; anything not named keeps its natural position
|
|
360
|
+
* after the pinned ones. A user reorder replaces this.
|
|
361
|
+
*/
|
|
227
362
|
columnOrder?: string[];
|
|
363
|
+
/** The row property summed into each column header's points figure. */
|
|
228
364
|
pointsProperty?: string;
|
|
365
|
+
/**
|
|
366
|
+
* Show the points sum in each column and lane header (default false). It needs
|
|
367
|
+
* `pointsProperty` too.
|
|
368
|
+
*/
|
|
229
369
|
showPoints?: boolean;
|
|
370
|
+
/**
|
|
371
|
+
* The row property that ranks cards within a column. Set it to make dropping a card at
|
|
372
|
+
* a position meaningful: a move then writes a new order value. Without it cards stay in
|
|
373
|
+
* arrival order.
|
|
374
|
+
*/
|
|
230
375
|
orderProperty?: string;
|
|
376
|
+
/**
|
|
377
|
+
* The row property that puts a card in a swimlane. Naming it does not switch on the
|
|
378
|
+
* lane layout — set `swimlanes` for that — but it does let a cross-lane drop write the
|
|
379
|
+
* lane back.
|
|
380
|
+
*/
|
|
231
381
|
swimlaneProperty?: string;
|
|
232
382
|
/** Render the 2D swimlane layout using `swimlaneProperty` (default false). */
|
|
233
383
|
swimlanes?: boolean;
|
|
@@ -239,7 +389,15 @@ interface KanbanConfig {
|
|
|
239
389
|
enforceWip?: boolean;
|
|
240
390
|
/** A custom card template: return an HTML string or a DOM node to own the whole card body. */
|
|
241
391
|
cardRenderer?: (card: KanbanCard, ctx: { column: KanbanColumn; readonly: boolean; el: HTMLElement; doc: Document }) => string | Node | void;
|
|
392
|
+
/**
|
|
393
|
+
* The row property holding a card's sprint, which `setSprint` and the sprint selection
|
|
394
|
+
* filter on.
|
|
395
|
+
*/
|
|
242
396
|
sprintProperty?: string;
|
|
397
|
+
/**
|
|
398
|
+
* The row property holding a card's epic, which `setEpic` and the epic selection filter
|
|
399
|
+
* on.
|
|
400
|
+
*/
|
|
243
401
|
epicProperty?: string;
|
|
244
402
|
/** A configurable sprint dataset: the canonical sprint list (order + titles), shown even when empty. */
|
|
245
403
|
sprints?: (string | { id: unknown; title?: string })[];
|
|
@@ -276,9 +434,23 @@ interface KanbanConfig {
|
|
|
276
434
|
filter?: (row: KanbanRow, card: KanbanCard) => boolean;
|
|
277
435
|
/** Quick-filter text matched case-insensitively across card fields. */
|
|
278
436
|
quickFilter?: string;
|
|
437
|
+
/**
|
|
438
|
+
* Maps the card template's slots — title, subtitle, labels, assignee, due, cover,
|
|
439
|
+
* progress, badges, accent — to row properties, and opts a slot into inline edit. Any
|
|
440
|
+
* other name is carried as an extra field on `KanbanCard.fields`.
|
|
441
|
+
*/
|
|
279
442
|
card?: KanbanCardMap;
|
|
443
|
+
/**
|
|
444
|
+
* Blocks edits and moves: `true` for the whole board, or a map singling out columns and
|
|
445
|
+
* cards by id and key. Default false.
|
|
446
|
+
*/
|
|
280
447
|
readonly?: KanbanReadonly;
|
|
448
|
+
/** The board's accessible name. Defaults to `Board`. */
|
|
281
449
|
ariaLabel?: string;
|
|
450
|
+
/**
|
|
451
|
+
* The placeholder shown in a column with no cards. Empty by default, so the module
|
|
452
|
+
* ships no English of its own.
|
|
453
|
+
*/
|
|
282
454
|
emptyText?: string;
|
|
283
455
|
/** Whether card selection is enabled (default true). */
|
|
284
456
|
selectable?: boolean;
|
|
@@ -297,8 +469,17 @@ interface KanbanConfig {
|
|
|
297
469
|
onCardMove?: (event: KanbanMoveEvent) => boolean | void | Promise<boolean | void>;
|
|
298
470
|
/** A per-card context menu: items, or `fn(card, selectedCards)` returning items. Suppresses `card:contextmenu`. */
|
|
299
471
|
contextMenu?: KanbanMenuItem[] | ((card: KanbanCard, selected: KanbanCard[]) => KanbanMenuItem[]);
|
|
472
|
+
/**
|
|
473
|
+
* Called when a card is clicked, with the same payload as the `card:click` event. Both
|
|
474
|
+
* fire: this does not replace a registered handler.
|
|
475
|
+
*/
|
|
300
476
|
onCardClick?: (event: KanbanEvent) => void;
|
|
477
|
+
/** Called when a card is double-clicked, alongside the `card:dblclick` event. */
|
|
301
478
|
onCardDblClick?: (event: KanbanEvent) => void;
|
|
479
|
+
/**
|
|
480
|
+
* Called on a card's context-menu gesture, alongside the `card:contextmenu` event. A
|
|
481
|
+
* configured `contextMenu` suppresses both.
|
|
482
|
+
*/
|
|
302
483
|
onCardContextMenu?: (event: KanbanEvent) => void;
|
|
303
484
|
}
|
|
304
485
|
|
|
@@ -332,25 +513,489 @@ interface KanbanChildren {
|
|
|
332
513
|
|
|
333
514
|
/** One context-menu item. `action` receives the card, the selected cards, and the board. */
|
|
334
515
|
interface KanbanMenuItem {
|
|
516
|
+
/** The item's text in the menu. */
|
|
335
517
|
label: string;
|
|
518
|
+
/**
|
|
519
|
+
* Runs when the item is chosen, with the clicked card, the selected cards (the clicked
|
|
520
|
+
* one when nothing is selected) and the board. Not called on a disabled item.
|
|
521
|
+
*/
|
|
336
522
|
action?: (ctx: { card: KanbanCard; cards: KanbanCard[]; board: Kanban }) => void;
|
|
523
|
+
/** Greys the item out and ignores clicks on it. */
|
|
337
524
|
disabled?: boolean;
|
|
338
525
|
}
|
|
339
526
|
|
|
340
527
|
/** The payload of a `card:move` (and `card:reverted`) event. */
|
|
341
528
|
interface KanbanMoveEvent {
|
|
529
|
+
/** The keys of the cards that actually moved — the ones no `beforeMove` veto refused. */
|
|
530
|
+
keys: unknown[];
|
|
531
|
+
/** The moved cards, in the same order as `keys`. */
|
|
532
|
+
cards: KanbanCard[];
|
|
533
|
+
/** Where each card came from, one column id (or null for unplaced) per moved card. */
|
|
534
|
+
from: (string | null)[];
|
|
535
|
+
/** The column the cards landed in. */
|
|
536
|
+
to: string;
|
|
537
|
+
/** The position asked for within the target column, or null for the end. */
|
|
538
|
+
index: number | null;
|
|
539
|
+
/**
|
|
540
|
+
* The new order values written to `orderProperty`, one per moved card — computed to sit
|
|
541
|
+
* between the neighbours at the drop point. Null when no order property is configured.
|
|
542
|
+
*/
|
|
543
|
+
orders: number[] | null;
|
|
544
|
+
/** Where the move came from: `'user'` for a drag or keyboard move, `'ai'` for an approved AI proposal, `'api'` for `board.move`. */
|
|
545
|
+
origin: 'user' | 'api' | 'init' | 'ai';
|
|
546
|
+
/** The swimlane the cards were moved to, when the gesture named one and a swimlane property is configured. */
|
|
547
|
+
lane?: unknown;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/** The members every cancellable board before-event carries. */
|
|
551
|
+
interface KanbanBeforeEvent {
|
|
552
|
+
/** The event's own name. */
|
|
553
|
+
type: string;
|
|
554
|
+
/** Where the action came from. */
|
|
555
|
+
origin: 'user' | 'api' | 'init' | 'ai';
|
|
556
|
+
/** Cancel the pending action; the reason is surfaced on the matching `<action>:cancelled`. */
|
|
557
|
+
preventDefault(reason?: string): void;
|
|
558
|
+
/** True once any handler has cancelled it. */
|
|
559
|
+
readonly defaultPrevented: boolean;
|
|
560
|
+
/** The first reason given to `preventDefault`, or null. */
|
|
561
|
+
readonly reason: string | null;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/** `card:edit` and `beforeEdit`: one field of one card. */
|
|
565
|
+
interface KanbanCardEditEvent {
|
|
566
|
+
/** The card being edited. */
|
|
567
|
+
card: KanbanCard;
|
|
568
|
+
/** That card's key. */
|
|
569
|
+
key: unknown;
|
|
570
|
+
/** The card-spec name of the field. */
|
|
571
|
+
field: string;
|
|
572
|
+
/** The row property the field writes to. */
|
|
573
|
+
fieldPath: string;
|
|
574
|
+
/** The value being written. */
|
|
575
|
+
value: unknown;
|
|
576
|
+
/** Where the edit came from. */
|
|
577
|
+
origin: 'user' | 'api' | 'init' | 'ai';
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/** `beforeEdit`: an inline card edit is about to be written. */
|
|
581
|
+
interface KanbanBeforeEditEvent extends KanbanBeforeEvent {
|
|
582
|
+
/** The card being edited. */
|
|
583
|
+
card: KanbanCard;
|
|
584
|
+
/** That card's key. */
|
|
585
|
+
key: unknown;
|
|
586
|
+
/** The card-spec name of the field. */
|
|
587
|
+
field: string;
|
|
588
|
+
/** The row property the field writes to. */
|
|
589
|
+
fieldPath: string;
|
|
590
|
+
/** The value that would be written. */
|
|
591
|
+
value: unknown;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/** `edit:cancelled`: a `beforeEdit` handler refused the write. */
|
|
595
|
+
interface KanbanEditCancelledEvent extends KanbanCardEditEvent {
|
|
596
|
+
/** The reason given to `preventDefault`, or `'prevented'`. */
|
|
597
|
+
reason: string;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/** `card:add`: a card was appended to a column. */
|
|
601
|
+
interface KanbanCardAddEvent {
|
|
602
|
+
/** The column it was added to. */
|
|
603
|
+
column: string;
|
|
604
|
+
/** The new card's key — the grid's temporary key on a grid-bound board until the server confirms it. */
|
|
605
|
+
key: unknown;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/** `beforeAdd`: a card is about to be appended. */
|
|
609
|
+
interface KanbanBeforeAddEvent extends KanbanBeforeEvent {
|
|
610
|
+
/** The column it would be added to. */
|
|
611
|
+
column: string;
|
|
612
|
+
/** The seed values the new row would be built from. */
|
|
613
|
+
seed: Record<string, unknown>;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/** `add:cancelled`: a `beforeAdd` handler refused the append. */
|
|
617
|
+
interface KanbanAddCancelledEvent {
|
|
618
|
+
/** The column the card was not added to. */
|
|
619
|
+
column: string;
|
|
620
|
+
/** The seed values that were not written. */
|
|
621
|
+
seed: Record<string, unknown>;
|
|
622
|
+
/** Where the append came from. */
|
|
623
|
+
origin: 'user' | 'api' | 'init' | 'ai';
|
|
624
|
+
/** The reason given to `preventDefault`, or `'prevented'`. */
|
|
625
|
+
reason: string;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
/** `beforeMove`: one card of a move is about to be applied; raised once per card. */
|
|
629
|
+
interface KanbanBeforeMoveEvent extends KanbanBeforeEvent {
|
|
630
|
+
/** The card being moved. */
|
|
631
|
+
card: KanbanCard;
|
|
632
|
+
/** That card's key. */
|
|
633
|
+
key: unknown;
|
|
634
|
+
/** The column it is in, or null when it is unplaced. */
|
|
635
|
+
from: string | null;
|
|
636
|
+
/** The column it would land in. */
|
|
637
|
+
to: string;
|
|
638
|
+
/** The position asked for within that column, or null for the end. */
|
|
639
|
+
index: number | null;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/** `move:cancelled`: a `beforeMove` handler refused one card of a move. */
|
|
643
|
+
interface KanbanMoveCancelledEvent {
|
|
644
|
+
/** The one key that did not move. */
|
|
342
645
|
keys: unknown[];
|
|
646
|
+
/** That one card. */
|
|
343
647
|
cards: KanbanCard[];
|
|
648
|
+
/** The column it is still in. */
|
|
344
649
|
from: (string | null)[];
|
|
650
|
+
/** The column it would have landed in. */
|
|
345
651
|
to: string;
|
|
652
|
+
/** The position that was asked for, or null. */
|
|
346
653
|
index: number | null;
|
|
654
|
+
/** The reason given to `preventDefault`, or `'prevented'`. */
|
|
655
|
+
reason: string;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* `card:reverted`: a move did not stick — the bound grid refused the write, an
|
|
660
|
+
* `onCardMove` callback returned false, or the server reverted the cell.
|
|
661
|
+
*/
|
|
662
|
+
interface KanbanCardRevertedEvent {
|
|
663
|
+
/** The keys that went back. */
|
|
664
|
+
keys: unknown[];
|
|
665
|
+
/** Those cards. */
|
|
666
|
+
cards: KanbanCard[];
|
|
667
|
+
/** Where each came from. */
|
|
668
|
+
from: (string | null)[];
|
|
669
|
+
/** The column they are in again, or null when it is not known. */
|
|
670
|
+
to: string | null;
|
|
671
|
+
/** The position that had been asked for, or null. */
|
|
672
|
+
index: number | null;
|
|
673
|
+
/** The order values that had been computed, or null. */
|
|
347
674
|
orders: number[] | null;
|
|
675
|
+
/** Where the move came from, on the two board-side reverts. */
|
|
676
|
+
origin?: 'user' | 'api' | 'init' | 'ai';
|
|
677
|
+
/** True on the grid-side revert, which reports it explicitly. */
|
|
678
|
+
reverted?: boolean;
|
|
679
|
+
/** Why the grid reverted the cell, on the grid-side revert. */
|
|
680
|
+
reason?: string;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
/** `card:confirmed`: the grid confirmed the column write behind an optimistic move. */
|
|
684
|
+
interface KanbanCardConfirmedEvent {
|
|
685
|
+
/** The key that was confirmed. */
|
|
686
|
+
keys: unknown[];
|
|
687
|
+
/** That card, or an empty array when it has since gone. */
|
|
688
|
+
cards: KanbanCard[];
|
|
689
|
+
/** The column it is in, or null when the card has gone. */
|
|
690
|
+
to: string | null;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/** `selection:changed`: the selected cards changed. */
|
|
694
|
+
interface KanbanSelectionEvent {
|
|
695
|
+
/** Every selected card key, in selection order. */
|
|
696
|
+
keys: unknown[];
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/** `column:collapse`: a column was collapsed or expanded. */
|
|
700
|
+
interface KanbanColumnCollapseEvent {
|
|
701
|
+
/** The column that moved. */
|
|
702
|
+
column: string;
|
|
703
|
+
/** True when it is now collapsed. */
|
|
704
|
+
collapsed: boolean;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
/** `beforeColumnChange`: a column is about to be collapsed or expanded. */
|
|
708
|
+
interface KanbanBeforeColumnChangeEvent extends KanbanBeforeEvent {
|
|
709
|
+
/** The column that would move. */
|
|
710
|
+
column: string;
|
|
711
|
+
/** True when it would become collapsed. */
|
|
712
|
+
collapsed: boolean;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/** `columnChange:cancelled`: a `beforeColumnChange` handler refused it. */
|
|
716
|
+
interface KanbanColumnChangeCancelledEvent extends KanbanColumnCollapseEvent {
|
|
717
|
+
/** Where the change came from. */
|
|
718
|
+
origin: 'user' | 'api' | 'init' | 'ai';
|
|
719
|
+
/** The reason given to `preventDefault`, or `'prevented'`. */
|
|
720
|
+
reason: string;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
/** `swimlane:collapse`: a swimlane was collapsed or expanded. */
|
|
724
|
+
interface KanbanSwimlaneCollapseEvent {
|
|
725
|
+
/** The lane that moved. */
|
|
726
|
+
swimlane: string;
|
|
727
|
+
/** True when it is now collapsed. */
|
|
728
|
+
collapsed: boolean;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/** `column:reorder` and `swimlane:reorder`: the order the board draws them in. */
|
|
732
|
+
interface KanbanOrderEvent {
|
|
733
|
+
/** The ids in their new order, as the rebuilt model holds them. */
|
|
734
|
+
order: string[];
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
/** `beforeColumnReorder` and `beforeLaneReorder`: an order is about to be applied. */
|
|
738
|
+
interface KanbanBeforeOrderEvent extends KanbanBeforeEvent {
|
|
739
|
+
/** The ids in the order that was asked for. */
|
|
740
|
+
order: string[];
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/** `columnReorder:cancelled` and `laneReorder:cancelled`: a handler refused the order. */
|
|
744
|
+
interface KanbanOrderCancelledEvent extends KanbanOrderEvent {
|
|
745
|
+
/** Where the reorder came from. */
|
|
746
|
+
origin: 'user' | 'api' | 'init' | 'ai';
|
|
747
|
+
/** The reason given to `preventDefault`, or `'prevented'`. */
|
|
748
|
+
reason: string;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/** `filter:changed`: the quick filter or a named predicate changed. */
|
|
752
|
+
interface KanbanFilterChangedEvent {
|
|
753
|
+
/** The quick-filter text now in force, or undefined when there is none. */
|
|
754
|
+
quickFilter?: string;
|
|
755
|
+
/** True when at least one named predicate is registered. */
|
|
756
|
+
hasFilter: boolean;
|
|
757
|
+
/** The names of the registered predicates. */
|
|
758
|
+
filters: string[];
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
/** `sprint:changed`: the shown sprint changed. */
|
|
762
|
+
interface KanbanSprintChangedEvent {
|
|
763
|
+
/** The sprint now shown: a sprint id, `board.BACKLOG`, or undefined for all of them. */
|
|
764
|
+
sprint: unknown;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/** `epic:changed`: the shown epic changed. */
|
|
768
|
+
interface KanbanEpicChangedEvent {
|
|
769
|
+
/** The epic now shown, or undefined for all of them. */
|
|
770
|
+
epic: unknown;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
/** `card:expand`: a card's children were opened. */
|
|
774
|
+
interface KanbanCardExpandEvent {
|
|
775
|
+
/** The card that was expanded. */
|
|
776
|
+
card: KanbanCard;
|
|
777
|
+
/** Its child rows, as the children loader returned them. */
|
|
778
|
+
rows: Record<string, unknown>[];
|
|
779
|
+
/** How they are being presented. */
|
|
780
|
+
present: 'drawer' | 'modal' | 'inline';
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
/** `card:drill`: a card was expanded from inside an already-open detail. */
|
|
784
|
+
interface KanbanCardDrillEvent {
|
|
785
|
+
/** The card that was expanded. */
|
|
786
|
+
card: KanbanCard;
|
|
787
|
+
/** Its child rows. */
|
|
788
|
+
rows: Record<string, unknown>[];
|
|
789
|
+
/** How many levels down this is; 1 is the first drill. */
|
|
790
|
+
depth: number;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/** `drag:start`: a card drag began. */
|
|
794
|
+
interface KanbanDragStartEvent {
|
|
795
|
+
/** Every key the drag carries — the selection when the dragged card is in it. */
|
|
796
|
+
keys: unknown[];
|
|
797
|
+
/** The card under the pointer. */
|
|
798
|
+
card: KanbanCard;
|
|
799
|
+
/** The DOM `dragstart` event. */
|
|
800
|
+
originalEvent: unknown;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
/** `drag:end`: a card drag ended, whether or not it dropped on a column. */
|
|
804
|
+
interface KanbanDragEndEvent {
|
|
805
|
+
/** The keys the drag carried. */
|
|
806
|
+
keys: unknown[];
|
|
807
|
+
/** The DOM `drop` event; absent when the browser ended the drag without one. */
|
|
808
|
+
originalEvent?: unknown;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/** `card:sla`: a card crossed an ageing threshold. */
|
|
812
|
+
interface KanbanSlaEvent {
|
|
813
|
+
/** The card's key. */
|
|
814
|
+
key: unknown;
|
|
815
|
+
/** The card, or null when it is no longer on the board. */
|
|
816
|
+
card: KanbanCard | null;
|
|
817
|
+
/** The level it has just reached. */
|
|
818
|
+
level: 'ok' | 'warn' | 'breach' | null;
|
|
819
|
+
/** The level it was at before this crossing. */
|
|
820
|
+
previous: 'ok' | 'warn' | 'breach' | null;
|
|
821
|
+
/** Its age in ms, or null when unknown. */
|
|
822
|
+
ageMs: number | null;
|
|
823
|
+
/** A short human age label (`2d`, `5h`, …). */
|
|
824
|
+
ageText: string;
|
|
825
|
+
/** The column it was aged in. */
|
|
826
|
+
columnId: string | null;
|
|
827
|
+
/** Its swimlane value, on a board with swimlanes. */
|
|
828
|
+
lane?: unknown;
|
|
829
|
+
/** The resolved warn threshold in ms, or null. */
|
|
830
|
+
warnMs: number | null;
|
|
831
|
+
/** The resolved breach threshold in ms, or null. */
|
|
832
|
+
breachMs: number | null;
|
|
833
|
+
/** The epoch (ms) of the crossing. */
|
|
834
|
+
at: number;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* The events a board raises.
|
|
839
|
+
*
|
|
840
|
+
* The board's own, not the grid's: `grid.on` takes {@link EventName} and knows
|
|
841
|
+
* nothing about these, and a grid-bound board follows the grid's events itself
|
|
842
|
+
* rather than re-publishing them. `on()` warns once on any other name, because
|
|
843
|
+
* a binding to an event that can never fire is a silent no-op.
|
|
844
|
+
*
|
|
845
|
+
* The `before…` six are cancellable on the same contract the grid core uses: call `preventDefault(reason?)` on the payload, or return
|
|
846
|
+
* a Promise to hold the action until it settles; a veto fires the matching
|
|
847
|
+
* `<action>:cancelled` carrying the reason.
|
|
848
|
+
*/
|
|
849
|
+
type KanbanEventName =
|
|
850
|
+
/** A card was clicked, or Enter was pressed on a focused card. */
|
|
851
|
+
| 'card:click'
|
|
852
|
+
/** A card was double-clicked. */
|
|
853
|
+
| 'card:dblclick'
|
|
854
|
+
/** A context menu was requested on a card. */
|
|
855
|
+
| 'card:contextmenu'
|
|
856
|
+
/** One or more cards were moved to a column, after every `beforeMove` gate passed and the write-back was applied. */
|
|
857
|
+
| 'card:move'
|
|
858
|
+
/** A move did not stick: the bound grid refused the write, an `onCardMove` callback returned false, or the server reverted the cell. */
|
|
859
|
+
| 'card:reverted'
|
|
860
|
+
/** The bound grid confirmed the column write behind an optimistic move. */
|
|
861
|
+
| 'card:confirmed'
|
|
862
|
+
/** The set of selected cards changed. */
|
|
863
|
+
| 'selection:changed'
|
|
864
|
+
/** A column was collapsed or expanded. */
|
|
865
|
+
| 'column:collapse'
|
|
866
|
+
/** A card was appended to a column. */
|
|
867
|
+
| 'card:add'
|
|
868
|
+
/** A card drag began. */
|
|
869
|
+
| 'drag:start'
|
|
870
|
+
/** A card drag ended, whether or not it dropped on a column. */
|
|
871
|
+
| 'drag:end'
|
|
872
|
+
/** A swimlane was collapsed or expanded. */
|
|
873
|
+
| 'swimlane:collapse'
|
|
874
|
+
/** The swimlane order changed. */
|
|
875
|
+
| 'swimlane:reorder'
|
|
876
|
+
/** The column order changed. */
|
|
877
|
+
| 'column:reorder'
|
|
878
|
+
/** The quick filter or a named card predicate changed. */
|
|
879
|
+
| 'filter:changed'
|
|
880
|
+
/** The shown sprint changed. */
|
|
881
|
+
| 'sprint:changed'
|
|
882
|
+
/** The shown epic changed. */
|
|
883
|
+
| 'epic:changed'
|
|
884
|
+
/** A card's children were opened. */
|
|
885
|
+
| 'card:expand'
|
|
886
|
+
/** A card was expanded from inside an already-open detail. */
|
|
887
|
+
| 'card:drill'
|
|
888
|
+
/** An inline card edit was written. */
|
|
889
|
+
| 'card:edit'
|
|
890
|
+
/** A card crossed an ageing threshold — ok to warn, or ok/warn to breach. */
|
|
891
|
+
| 'card:sla'
|
|
892
|
+
/** One card of a move is about to be applied; raised once per card, and cancellable. */
|
|
893
|
+
| 'beforeMove'
|
|
894
|
+
/** A card is about to be appended; cancellable. */
|
|
895
|
+
| 'beforeAdd'
|
|
896
|
+
/** An inline card edit is about to be written; cancellable. */
|
|
897
|
+
| 'beforeEdit'
|
|
898
|
+
/** A swimlane reorder is about to be applied; cancellable. */
|
|
899
|
+
| 'beforeLaneReorder'
|
|
900
|
+
/** A column reorder is about to be applied; cancellable. */
|
|
901
|
+
| 'beforeColumnReorder'
|
|
902
|
+
/** A column collapse or expand is about to be applied; cancellable. */
|
|
903
|
+
| 'beforeColumnChange'
|
|
904
|
+
/** A `beforeMove` handler refused one card; raised once per refused card. */
|
|
905
|
+
| 'move:cancelled'
|
|
906
|
+
/** A `beforeAdd` handler refused the append. */
|
|
907
|
+
| 'add:cancelled'
|
|
908
|
+
/** A `beforeEdit` handler refused the write. */
|
|
909
|
+
| 'edit:cancelled'
|
|
910
|
+
/** A `beforeLaneReorder` handler refused the order. */
|
|
911
|
+
| 'laneReorder:cancelled'
|
|
912
|
+
/** A `beforeColumnReorder` handler refused the order. */
|
|
913
|
+
| 'columnReorder:cancelled'
|
|
914
|
+
/** A `beforeColumnChange` handler refused the collapse or expand. */
|
|
915
|
+
| 'columnChange:cancelled';
|
|
916
|
+
|
|
917
|
+
/** What a handler receives, per board event. */
|
|
918
|
+
interface KanbanEventPayloads {
|
|
919
|
+
/** The card, its column, its element and the DOM event. */
|
|
920
|
+
'card:click': KanbanEvent;
|
|
921
|
+
/** The card, its column, its element and the DOM event. */
|
|
922
|
+
'card:dblclick': KanbanEvent;
|
|
923
|
+
/** The card, its column, its element and the DOM event. */
|
|
924
|
+
'card:contextmenu': KanbanEvent;
|
|
925
|
+
/** Which cards moved, where from and to, and the order values written. */
|
|
926
|
+
'card:move': KanbanMoveEvent;
|
|
927
|
+
/** Which cards went back, and why when the grid said so. */
|
|
928
|
+
'card:reverted': KanbanCardRevertedEvent;
|
|
929
|
+
/** The card the grid confirmed, and the column it is in. */
|
|
930
|
+
'card:confirmed': KanbanCardConfirmedEvent;
|
|
931
|
+
/** Every selected card key. */
|
|
932
|
+
'selection:changed': KanbanSelectionEvent;
|
|
933
|
+
/** The column, and whether it is now collapsed. */
|
|
934
|
+
'column:collapse': KanbanColumnCollapseEvent;
|
|
935
|
+
/** The column added to, and the new card's key. */
|
|
936
|
+
'card:add': KanbanCardAddEvent;
|
|
937
|
+
/** The keys the drag carries, the card under the pointer, and the DOM event. */
|
|
938
|
+
'drag:start': KanbanDragStartEvent;
|
|
939
|
+
/** The keys the drag carried, and the DOM event where there was one. */
|
|
940
|
+
'drag:end': KanbanDragEndEvent;
|
|
941
|
+
/** The lane, and whether it is now collapsed. */
|
|
942
|
+
'swimlane:collapse': KanbanSwimlaneCollapseEvent;
|
|
943
|
+
/** The lane ids in their new order. */
|
|
944
|
+
'swimlane:reorder': KanbanOrderEvent;
|
|
945
|
+
/** The column ids in their new order. */
|
|
946
|
+
'column:reorder': KanbanOrderEvent;
|
|
947
|
+
/** The quick-filter text, and the named predicates in force. */
|
|
948
|
+
'filter:changed': KanbanFilterChangedEvent;
|
|
949
|
+
/** The sprint now shown. */
|
|
950
|
+
'sprint:changed': KanbanSprintChangedEvent;
|
|
951
|
+
/** The epic now shown. */
|
|
952
|
+
'epic:changed': KanbanEpicChangedEvent;
|
|
953
|
+
/** The card, its child rows, and how they are presented. */
|
|
954
|
+
'card:expand': KanbanCardExpandEvent;
|
|
955
|
+
/** The card, its child rows, and how deep the drill is. */
|
|
956
|
+
'card:drill': KanbanCardDrillEvent;
|
|
957
|
+
/** The card, the field, and the value written. */
|
|
958
|
+
'card:edit': KanbanCardEditEvent;
|
|
959
|
+
/** The crossing: the level reached, the one before it, and the age behind it. */
|
|
960
|
+
'card:sla': KanbanSlaEvent;
|
|
961
|
+
/** The card about to move, with `preventDefault` to stop it. */
|
|
962
|
+
beforeMove: KanbanBeforeMoveEvent;
|
|
963
|
+
/** The column and seed about to be appended, with `preventDefault` to stop it. */
|
|
964
|
+
beforeAdd: KanbanBeforeAddEvent;
|
|
965
|
+
/** The field about to be written, with `preventDefault` to stop it. */
|
|
966
|
+
beforeEdit: KanbanBeforeEditEvent;
|
|
967
|
+
/** The lane order about to be applied, with `preventDefault` to stop it. */
|
|
968
|
+
beforeLaneReorder: KanbanBeforeOrderEvent;
|
|
969
|
+
/** The column order about to be applied, with `preventDefault` to stop it. */
|
|
970
|
+
beforeColumnReorder: KanbanBeforeOrderEvent;
|
|
971
|
+
/** The collapse about to be applied, with `preventDefault` to stop it. */
|
|
972
|
+
beforeColumnChange: KanbanBeforeColumnChangeEvent;
|
|
973
|
+
/** The one card that did not move, and why. */
|
|
974
|
+
'move:cancelled': KanbanMoveCancelledEvent;
|
|
975
|
+
/** The card that was not added, and why. */
|
|
976
|
+
'add:cancelled': KanbanAddCancelledEvent;
|
|
977
|
+
/** The write that was not made, and why. */
|
|
978
|
+
'edit:cancelled': KanbanEditCancelledEvent;
|
|
979
|
+
/** The lane order that was not applied, and why. */
|
|
980
|
+
'laneReorder:cancelled': KanbanOrderCancelledEvent;
|
|
981
|
+
/** The column order that was not applied, and why. */
|
|
982
|
+
'columnReorder:cancelled': KanbanOrderCancelledEvent;
|
|
983
|
+
/** The collapse that was not applied, and why. */
|
|
984
|
+
'columnChange:cancelled': KanbanColumnChangeCancelledEvent;
|
|
348
985
|
}
|
|
349
986
|
|
|
350
987
|
/** The keyed-diff consumer surface a board shares with a grid, so a Data Router routes to it directly. */
|
|
351
988
|
interface KanbanRows {
|
|
989
|
+
/**
|
|
990
|
+
* Apply a keyed diff: `add` replaces whatever row each key names, `update` merges its
|
|
991
|
+
* fields into the stored row (so a patch need only carry what changed), `remove` drops
|
|
992
|
+
* the keys. The board regroups and repaints, keeping scroll, focus, selection, collapse
|
|
993
|
+
* and any open pop-out. Ignored with a warning on a grid-bound board.
|
|
994
|
+
*/
|
|
352
995
|
apply(change: { add?: KanbanRow[]; update?: KanbanRow[]; remove?: unknown[] }): void;
|
|
996
|
+
/** Visit every row the board holds, with its key. */
|
|
353
997
|
forEach(fn: (row: KanbanRow, key: unknown) => void): void;
|
|
998
|
+
/** How many rows the board holds, before filtering. */
|
|
354
999
|
readonly count: number;
|
|
355
1000
|
}
|
|
356
1001
|
|
|
@@ -381,20 +1026,45 @@ interface KanbanFilters {
|
|
|
381
1026
|
* viewer.
|
|
382
1027
|
*/
|
|
383
1028
|
interface Kanban {
|
|
1029
|
+
/** The element the board renders into, or null for a headless board. */
|
|
384
1030
|
readonly el: unknown | null;
|
|
385
1031
|
/** The resolved card identity; see `KanbanConfig.rowKey`. */
|
|
386
1032
|
readonly rowKey: string | ((row: KanbanRow) => string | number);
|
|
1033
|
+
/**
|
|
1034
|
+
* The keyed-diff consumer surface, the same shape a grid exposes — this is what makes a
|
|
1035
|
+
* board a Data Router target.
|
|
1036
|
+
*/
|
|
387
1037
|
rows: KanbanRows;
|
|
388
1038
|
/** The card-aging / SLA monitor, present only when a `sla` config was supplied. */
|
|
389
1039
|
sla?: KanbanSla;
|
|
1040
|
+
/** The current columns in display order, each with its cards and aggregates. */
|
|
390
1041
|
columns(): KanbanColumn[];
|
|
1042
|
+
/** One column by id, or undefined when the board has no such column. */
|
|
391
1043
|
column(id: string): KanbanColumn | undefined;
|
|
1044
|
+
/** How many cards a column holds after filtering; 0 for an unknown column. */
|
|
392
1045
|
count(id: string): number;
|
|
1046
|
+
/** A column's points sum; 0 for an unknown column. */
|
|
393
1047
|
points(id: string): number;
|
|
1048
|
+
/** Every card on the board, unplaced ones included, in no particular column order. */
|
|
394
1049
|
cards(): KanbanCard[];
|
|
1050
|
+
/**
|
|
1051
|
+
* One card by key, or undefined when no card has that key (it may have been filtered
|
|
1052
|
+
* out).
|
|
1053
|
+
*/
|
|
395
1054
|
card(key: unknown): KanbanCard | undefined;
|
|
396
|
-
|
|
397
|
-
|
|
1055
|
+
/**
|
|
1056
|
+
* Register an event handler; returns a function that removes it. An unrecognised event
|
|
1057
|
+
* name is warned about once, because it names a binding that could never fire. What each
|
|
1058
|
+
* event carries is {@link KanbanEventPayloads}; the handler is declared with the widest
|
|
1059
|
+
* of them, so narrow on the name inside it.
|
|
1060
|
+
*/
|
|
1061
|
+
on(name: KanbanEventName, fn: (event: KanbanEventPayloads[KanbanEventName]) => void): () => void;
|
|
1062
|
+
/** Remove a handler registered with `on`. */
|
|
1063
|
+
off(name: KanbanEventName, fn: (event: KanbanEventPayloads[KanbanEventName]) => void): void;
|
|
1064
|
+
/**
|
|
1065
|
+
* Whether editing is blocked — for the whole board, or for the column or card named in
|
|
1066
|
+
* the scope.
|
|
1067
|
+
*/
|
|
398
1068
|
readonly(scope?: { column?: string; card?: unknown }): boolean;
|
|
399
1069
|
/**
|
|
400
1070
|
* Move one or more cards to a column (and, with an order property, to a
|
|
@@ -476,6 +1146,10 @@ interface Kanban {
|
|
|
476
1146
|
setLoading(loading: boolean): Kanban;
|
|
477
1147
|
/** Set (or clear with null) an error state, rendered as a host-supplied message. */
|
|
478
1148
|
setError(message: string | null): Kanban;
|
|
1149
|
+
/**
|
|
1150
|
+
* Replace the source rows and re-render, and make that array the board's source again
|
|
1151
|
+
* so a later `refresh()` re-reads it. Ignored with a warning on a grid-bound board.
|
|
1152
|
+
*/
|
|
479
1153
|
setRows(rows: KanbanRow[]): Kanban;
|
|
480
1154
|
/**
|
|
481
1155
|
* Replace the board's configured column set. Keeps card
|
|
@@ -486,7 +1160,16 @@ interface Kanban {
|
|
|
486
1160
|
* "never silently drop a card" rule an unconfigured value already gets).
|
|
487
1161
|
*/
|
|
488
1162
|
setColumns(defs: KanbanColumnDef[]): Kanban;
|
|
1163
|
+
/**
|
|
1164
|
+
* Re-read the source and re-render: a bound grid's rows, or the configured array. Once
|
|
1165
|
+
* rows have arrived through `rows.apply` nothing is re-read — the board regroups what
|
|
1166
|
+
* it holds, so a routed feed is never thrown away.
|
|
1167
|
+
*/
|
|
489
1168
|
refresh(): Kanban;
|
|
1169
|
+
/**
|
|
1170
|
+
* Empty the element, remove only the class the board added, and stop the flow and SLA
|
|
1171
|
+
* monitors. A bound grid is left alone — the host owns it.
|
|
1172
|
+
*/
|
|
490
1173
|
destroy(): void;
|
|
491
1174
|
}
|
|
492
1175
|
|