@toclocoinc/lattice-grid 1.56.0 → 1.58.0

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.
Files changed (78) hide show
  1. package/README.md +1 -1
  2. package/docs/API.html +158 -17
  3. package/docs/api-detail.html +227 -7
  4. package/lattice-grid.d.ts +366 -15
  5. package/lattice-grid.esm.min.js +964 -545
  6. package/lattice-grid.min.cjs +963 -545
  7. package/lattice-grid.min.css +1 -1
  8. package/lattice-grid.min.js +963 -545
  9. package/modules/ai.esm.min.js +7 -4
  10. package/modules/ai.min.cjs +7 -4
  11. package/modules/ai.min.js +7 -4
  12. package/modules/angular.esm.min.js +7 -4
  13. package/modules/angular.min.cjs +7 -4
  14. package/modules/angular.min.js +7 -4
  15. package/modules/chart-alluvial.esm.min.js +1 -1
  16. package/modules/chart-arc.esm.min.js +1 -1
  17. package/modules/chart-bubblemap.esm.min.js +1 -1
  18. package/modules/chart-bump.esm.min.js +1 -1
  19. package/modules/chart-calendar.esm.min.js +1 -1
  20. package/modules/chart-decomposition.esm.min.js +1 -1
  21. package/modules/chart-diverging.esm.min.js +1 -1
  22. package/modules/chart-dumbbell.esm.min.js +1 -1
  23. package/modules/chart-fan.esm.min.js +1 -1
  24. package/modules/chart-hexbin.esm.min.js +1 -1
  25. package/modules/chart-hexmap.esm.min.js +1 -1
  26. package/modules/chart-icicle.esm.min.js +1 -1
  27. package/modules/chart-parallel.esm.min.js +1 -1
  28. package/modules/chart-ridgeline.esm.min.js +1 -1
  29. package/modules/chart-roc.esm.min.js +1 -1
  30. package/modules/chart-slope.esm.min.js +1 -1
  31. package/modules/chart-splom.esm.min.js +1 -1
  32. package/modules/chart-waffle.esm.min.js +1 -1
  33. package/modules/charts.esm.min.js +4 -4
  34. package/modules/charts.min.cjs +4 -4
  35. package/modules/charts.min.js +4 -4
  36. package/modules/data-router.esm.min.js +4 -4
  37. package/modules/data-router.min.cjs +4 -4
  38. package/modules/data-router.min.js +4 -4
  39. package/modules/devtools.esm.min.js +2 -2
  40. package/modules/devtools.min.cjs +2 -2
  41. package/modules/devtools.min.js +2 -2
  42. package/modules/dhtmlx-compat.esm.min.js +4 -4
  43. package/modules/dhtmlx-compat.min.cjs +4 -4
  44. package/modules/dhtmlx-compat.min.js +4 -4
  45. package/modules/gantt.esm.min.js +4 -4
  46. package/modules/gantt.min.cjs +4 -4
  47. package/modules/gantt.min.js +4 -4
  48. package/modules/htmx.esm.min.js +960 -545
  49. package/modules/htmx.min.cjs +960 -545
  50. package/modules/htmx.min.js +960 -545
  51. package/modules/kanban.esm.min.js +107 -27
  52. package/modules/kanban.min.cjs +107 -27
  53. package/modules/kanban.min.js +107 -27
  54. package/modules/kpi.esm.min.js +41 -8
  55. package/modules/kpi.min.cjs +41 -8
  56. package/modules/kpi.min.js +41 -8
  57. package/modules/layout.esm.min.js +4 -4
  58. package/modules/layout.min.cjs +4 -4
  59. package/modules/layout.min.js +4 -4
  60. package/modules/mock-socket.esm.min.js +2 -2
  61. package/modules/mock-socket.min.cjs +2 -2
  62. package/modules/mock-socket.min.js +2 -2
  63. package/modules/react.esm.min.js +7 -4
  64. package/modules/react.min.cjs +7 -4
  65. package/modules/react.min.js +7 -4
  66. package/modules/svelte.esm.min.js +7 -4
  67. package/modules/svelte.min.cjs +7 -4
  68. package/modules/svelte.min.js +7 -4
  69. package/modules/tabs.esm.min.js +4 -4
  70. package/modules/tabs.min.cjs +4 -4
  71. package/modules/tabs.min.js +4 -4
  72. package/modules/vue.esm.min.js +7 -4
  73. package/modules/vue.min.cjs +7 -4
  74. package/modules/vue.min.js +7 -4
  75. package/modules/webcomponent.esm.min.js +963 -545
  76. package/modules/webcomponent.min.cjs +963 -545
  77. package/modules/webcomponent.min.js +963 -545
  78. package/package.json +1 -1
package/lattice-grid.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.56.0, type declarations
2
+ * Lattice Grid 1.58.0, type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -340,7 +340,8 @@ export interface Option {
340
340
  label: string;
341
341
  disabled?: boolean;
342
342
  variant?: VariantName;
343
- icon?: string;
343
+ /** A glyph name from the icon registry (see {@link IconName}), shown before the label. */
344
+ icon?: IconName;
344
345
  group?: string;
345
346
  }
346
347
 
@@ -364,6 +365,32 @@ export interface LookupSpec {
364
365
  export type DecorationName = 'plain' | 'fill' | 'pill' | 'dot' | 'bar' | 'heat' | 'icon';
365
366
  export type VariantName = 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'accent' | 'none' | (string & {});
366
367
 
368
+ /**
369
+ * A glyph name from the icon sprite registry (`packages/dom/src/cell/icons.js`).
370
+ *
371
+ * The union below is every built-in name, generated from `iconNames()` so an
372
+ * editor can autocomplete and typo-check them — see
373
+ * `test/icon-name-type-drift.test.js`, which fails if this list and the
374
+ * registry ever disagree. It is deliberately **not closed**: the registry is
375
+ * extensible at runtime via `registerIcon`, `registerIcons`, `config.icons` and
376
+ * `grid.icons`, and `(string & {})` widens the type so a custom registered name
377
+ * still typechecks without losing autocomplete on the built-ins. A name the
378
+ * registry has never heard of — built-in or custom — draws a blank glyph and
379
+ * warns once at runtime; it is not a type error.
380
+ */
381
+ export type IconName =
382
+ | 'chevronRight' | 'chevronDown' | 'chevronUp' | 'chevronLeft'
383
+ | 'check' | 'dash' | 'close' | 'plus' | 'minus'
384
+ | 'info' | 'success' | 'warning' | 'danger' | 'clock' | 'lock'
385
+ | 'link' | 'external' | 'filter' | 'pause' | 'play' | 'chart' | 'palette'
386
+ | 'undo' | 'redo' | 'columns' | 'download' | 'restore' | 'spreadsheet' | 'print'
387
+ | 'maximise' | 'minimise' | 'views' | 'search' | 'pencil' | 'trash' | 'share'
388
+ | 'pin' | 'sortAsc' | 'sortDesc' | 'menu' | 'drag'
389
+ | 'star' | 'heart' | 'circleFilled' | 'square' | 'bolt' | 'flag'
390
+ | 'arrow' | 'highlight' | 'thumbUp' | 'eye' | 'eyeOff' | 'copy' | 'present'
391
+ | 'blank'
392
+ | (string & {});
393
+
367
394
  /** A built-in threshold icon set, mapping value bands to built-in glyphs. */
368
395
  export type IconSetName = 'trafficLights' | 'arrows' | 'trafficArrows' | 'ratings' | (string & {});
369
396
 
@@ -375,7 +402,8 @@ export type IconSetName = 'trafficLights' | 'arrows' | 'trafficArrows' | 'rating
375
402
  */
376
403
  export interface IconBand {
377
404
  min?: number;
378
- icon: string;
405
+ /** A glyph name from the icon registry (see {@link IconName}). */
406
+ icon: IconName;
379
407
  label?: string;
380
408
  variant?: VariantName;
381
409
  }
@@ -387,7 +415,12 @@ export interface DecorationSpec {
387
415
  outline?: boolean;
388
416
  edge?: boolean;
389
417
  position?: 'start' | 'end';
390
- name?: string | Record<string, string>;
418
+ /**
419
+ * `icon` decoration only: either a single glyph name (see {@link IconName})
420
+ * used for every value, or a value -> glyph name map for exact-value icons.
421
+ * Omit both `name` and `bands` to use `iconSet`/its default instead.
422
+ */
423
+ name?: IconName | Record<string, IconName>;
391
424
  /** icon only: a built-in threshold icon set, expanded to `bands`. */
392
425
  iconSet?: IconSetName;
393
426
  /** icon only: value bands mapped to glyphs, first match by descending `min`. */
@@ -2280,6 +2313,36 @@ export interface GridConfig {
2280
2313
  sharedMemory?: boolean;
2281
2314
  /** A totals line at the foot of each group as well as the grid. */
2282
2315
  groupFooter?: boolean;
2316
+ /**
2317
+ * Draw the group row yourself.
2318
+ *
2319
+ * The grid's own group row is an expander, a label and a count. A host that
2320
+ * needs more — a section header with a points rollup, a done/total count and
2321
+ * a progress bar — supplies this instead, and owns the whole row: it is drawn
2322
+ * as one band across every column, and no ordinary cells are mounted for it.
2323
+ *
2324
+ * Return an HTML string, or a node, or write into `params.element` and return
2325
+ * nothing. Unlike `fullWidth.render`, a string here **is** inserted as markup,
2326
+ * on the same footing as the board's `cardRenderer`: this is your own template
2327
+ * for a row the grid synthesised, not a value out of your data.
2328
+ *
2329
+ * The chevron is yours to draw and yours to wire: give any element in your
2330
+ * markup `data-lat-group-toggle` and a click on it expands or collapses the
2331
+ * group, or call `params.toggle()` from a node you built yourself.
2332
+ */
2333
+ groupRenderer?(params: GroupRowParams): string | Node | void;
2334
+ /**
2335
+ * Which groups start expanded, before anyone has opened or closed one.
2336
+ *
2337
+ * `true` (the default) opens every group, `false` closes every group, a
2338
+ * number opens the first N levels (`0` closes everything, a negative opens
2339
+ * every level), and a predicate answers per group — the current sprint's
2340
+ * section open while the rest start closed.
2341
+ *
2342
+ * Only ever consulted for a group nobody has touched: once the user or your
2343
+ * code expands or collapses one, that decision stands.
2344
+ */
2345
+ groupDefaultExpanded?: boolean | number | ((group: GroupInfo) => boolean);
2283
2346
  /**
2284
2347
  * Where the grand total goes.
2285
2348
  *
@@ -4156,6 +4219,11 @@ export type EventName =
4156
4219
  | 'model:changed' | 'rows:changed' | 'rows:queued' | 'rows:deferred'
4157
4220
  | 'rows:paused' | 'rows:resumed' | 'row:received' | 'row:sent' | 'row:copied'
4158
4221
  | 'row:moved' | 'source:error' | 'stream:chunk' | 'stream:end' | 'stream:evicted'
4222
+ /* The row-drag gesture as it happens (BACKLOG-0001224). Notifications only:
4223
+ * the drop is already vetoable by `beforeRowMove` and `beforeRowReceive`, and
4224
+ * a third veto on the same gesture would be a fourth place to look. All four
4225
+ * fire on the grid the drag started in and carry a {@link RowDragEvent}. */
4226
+ | 'rowDrag:started' | 'rowDrag:moved' | 'rowDrag:left' | 'rowDrag:ended'
4159
4227
  /* Cells and editing */
4160
4228
  | 'cell:changed' | 'cell:pending' | 'cell:confirmed' | 'cell:reverted' | 'cell:conflict'
4161
4229
  | 'cell:clicked' | 'cell:dblclicked' | 'cell:contextmenu'
@@ -4212,11 +4280,14 @@ export type EventName =
4212
4280
  | 'beforeEdit' | 'beforeSort' | 'beforeFilter'
4213
4281
  | 'beforeColumnMove' | 'beforeColumnResize' | 'beforeColumnHide'
4214
4282
  | 'beforeSelect' | 'beforeRowAdd' | 'beforeDelete' | 'beforeRowMove' | 'beforeGroup'
4283
+ /* A row dropped in from another grid, on the receiving grid (BACKLOG-0001225):
4284
+ * a {@link BeforeRowReceiveEvent}. */
4285
+ | 'beforeRowReceive'
4215
4286
  /* Their cancellation notifications (past-tense, non-cancellable). */
4216
4287
  | 'edit:cancelled' | 'sort:cancelled' | 'filter:cancelled'
4217
4288
  | 'columnMove:cancelled' | 'columnResize:cancelled' | 'columnHide:cancelled'
4218
4289
  | 'selection:cancelled' | 'rowAdd:cancelled' | 'delete:cancelled'
4219
- | 'rowMove:cancelled' | 'group:cancelled'
4290
+ | 'rowMove:cancelled' | 'group:cancelled' | 'rowReceive:cancelled'
4220
4291
  /* Every event at once, for logging and debugging. */
4221
4292
  | '*';
4222
4293
 
@@ -4258,6 +4329,157 @@ export interface BeforeEvent extends GridEvent {
4258
4329
  reason: string | null;
4259
4330
  }
4260
4331
 
4332
+ /**
4333
+ * The `beforeRowReceive` event (BACKLOG-0001225): a row dragged from another
4334
+ * grid is about to be inserted into this one. Fires on the **receiving** grid,
4335
+ * before the insert, with the row under the pointer named — so a drop that
4336
+ * means "assign this to that" can be recorded by the host and the insert
4337
+ * stopped with `preventDefault(reason)`.
4338
+ *
4339
+ * A veto leaves the source grid untouched: the row stays where it was, and
4340
+ * neither `row:sent` nor `row:copied` fires there. The source removes its row
4341
+ * only after the target has admitted it, and a veto is a refusal to admit.
4342
+ * The paired `rowReceive:cancelled` carries the same context plus the reason.
4343
+ *
4344
+ * Like every {@link BeforeEvent}, the handler may be `async`; the insert is
4345
+ * held until it settles, and is cancelled as `'stale'` (BACKLOG-0001242) if
4346
+ * the source row is gone by then, or if the row under the pointer is gone or
4347
+ * has moved to a different index — `at` names a slot as "before `overKey`",
4348
+ * and once that is no longer where `overKey`'s row sits, `at` is a stale index
4349
+ * into a list that changed while the handler was thinking, not the slot the
4350
+ * drop meant. `overKey: null` (the drop landed on no row) has no row to drift
4351
+ * against and is never stale on that account.
4352
+ */
4353
+ export interface BeforeRowReceiveEvent extends BeforeEvent {
4354
+ /**
4355
+ * The row about to be inserted: a shallow copy of the source row's data,
4356
+ * and the very object that is inserted if no handler vetoes, so a change
4357
+ * made to it here lands with the row.
4358
+ */
4359
+ data: Record<string, unknown>;
4360
+ /**
4361
+ * The display index the row would be inserted at: the index of the row
4362
+ * under the pointer, or `rows.count()` when the drop landed on no row. When
4363
+ * `overKey` names a row, this is guaranteed to still be that row's index at
4364
+ * the moment the insert actually runs — an async handler that leaves the
4365
+ * named row at a different index causes the drop to be cancelled as
4366
+ * `'stale'` (BACKLOG-0001242) rather than inserted at this index regardless.
4367
+ */
4368
+ at: number;
4369
+ /**
4370
+ * The key of the row under the pointer when the drop happened — the row the
4371
+ * user meant. Null when the drop landed past the last row, on empty space,
4372
+ * on the header, or on a pinned row: there is no row to name, and a nearest
4373
+ * guess would be wrong in a way that looks right.
4374
+ */
4375
+ overKey: string | null;
4376
+ /** The grid the row is being dragged from. */
4377
+ source: Grid;
4378
+ }
4379
+
4380
+ /**
4381
+ * The `rowReceive:cancelled` event (BACKLOG-0001225): a `beforeRowReceive`
4382
+ * was vetoed, or went stale during an async handler. Nothing was inserted and
4383
+ * the source grid is untouched.
4384
+ */
4385
+ export interface RowReceiveCancelledEvent extends GridEvent {
4386
+ /** The row that was not inserted, as the handler saw it. */
4387
+ data: Record<string, unknown>;
4388
+ /** The display index it would have taken. */
4389
+ at: number;
4390
+ /** The key of the row under the pointer, or null. */
4391
+ overKey: string | null;
4392
+ /** The grid the row would have come from; it still holds the row. */
4393
+ source: Grid;
4394
+ /**
4395
+ * The reason given to `preventDefault`, `'prevented'` when none was given,
4396
+ * or `'stale'` when the row under the pointer or the source row was gone by
4397
+ * the time an async handler settled.
4398
+ */
4399
+ reason: string;
4400
+ }
4401
+
4402
+ /**
4403
+ * The row-drag lifecycle events (BACKLOG-0001224): `rowDrag:started`,
4404
+ * `rowDrag:moved`, `rowDrag:left` and `rowDrag:ended`, which report a row drag
4405
+ * *as it happens* rather than once it has settled. Before them a host got the
4406
+ * handle the grid draws and then one settled event, with nothing in between to
4407
+ * highlight a candidate target, drive a custom drop indicator, or react when
4408
+ * the pointer left the grid.
4409
+ *
4410
+ * **All four fire on the grid the drag started in**, whether the row is being
4411
+ * reordered within that grid or dragged into another one. A drag is one gesture
4412
+ * with one owner, and the source grid is the only grid present for the whole of
4413
+ * it — the pointer may cross several others, or none. `over` names whichever
4414
+ * grid the event is about, so a single subscription can drive decoration on any
4415
+ * of them.
4416
+ *
4417
+ * **Notifications, not gates.** None of these is cancellable and none carries
4418
+ * `preventDefault`. The drop is already vetoable twice over — `beforeRowMove`
4419
+ * for a reorder, `beforeRowReceive` for a drop into another grid — and a third
4420
+ * veto on the same gesture would be a third place to look when a drop does not
4421
+ * happen.
4422
+ *
4423
+ * **What is safe to do in a handler.** Read, measure and draw: highlight a
4424
+ * candidate row, move an indicator, update a side panel. Do not mutate rows,
4425
+ * columns, sort, filters or grouping from one of these. The drag resolves where
4426
+ * it would land against the display order, so changing that order mid-gesture
4427
+ * moves the ground under the drop; and `data` is the source row's own object
4428
+ * rather than a copy, so writing to it edits the row that is still in the grid
4429
+ * without announcing it. Work that changes the grid belongs in
4430
+ * `beforeRowReceive`, which is asked before the insert, or in the settled
4431
+ * events afterwards.
4432
+ *
4433
+ * **`rowDrag:moved` is coalesced to one event per animation frame**, carrying
4434
+ * the latest pointer position of that frame, so a handler runs at the display's
4435
+ * rate rather than the pointer's several hundred events a second. The other
4436
+ * three fire on the transition itself.
4437
+ *
4438
+ * The sequence for any gesture is `rowDrag:started`, then `rowDrag:moved` and
4439
+ * `rowDrag:left` as the pointer travels, then exactly one `rowDrag:ended` —
4440
+ * including when the pointer is released outside every grid. No `rowDrag:moved`
4441
+ * is delivered after `rowDrag:ended`. A press that never passes the drag
4442
+ * threshold is a click and raises none of them; a grid destroyed mid-drag
4443
+ * raises no `rowDrag:ended`.
4444
+ */
4445
+ export interface RowDragEvent extends GridEvent {
4446
+ /** The key of the row being dragged. */
4447
+ key: string;
4448
+ /**
4449
+ * The dragged row's data as it stands in the source grid — that row's own
4450
+ * object, not a copy. Null if the row has left the source during the drag.
4451
+ */
4452
+ data: Record<string, unknown> | null;
4453
+ /**
4454
+ * The grid the event is about: the grid under the pointer for
4455
+ * `rowDrag:started`, `rowDrag:moved` and `rowDrag:ended`, and the grid just
4456
+ * left for `rowDrag:left`. Null when the pointer is over no grid at all.
4457
+ */
4458
+ over: Grid | null;
4459
+ /**
4460
+ * Where the row would land in `over`: the display index it would take. Null
4461
+ * when there is no candidate to report — the pointer is over no grid, over a
4462
+ * grid that will refuse the row, or over a header; and on `rowDrag:left`,
4463
+ * which is about a grid the pointer has already gone from.
4464
+ */
4465
+ at: number | null;
4466
+ /**
4467
+ * The key of the row under the pointer in `over`, or null where there is no
4468
+ * row to name: past the last row, on empty space, on a header, on a pinned
4469
+ * row, on a grid that will refuse the drop, or on `rowDrag:left`.
4470
+ */
4471
+ overKey: string | null;
4472
+ /**
4473
+ * `rowDrag:ended` only: whether the release is being acted on — a transfer
4474
+ * the target accepts, or a same-grid reorder that is a real move and is not
4475
+ * refused by a sort, filter or grouping. False when the row was released over
4476
+ * no grid, over a grid that refuses it, or back where it started. What became
4477
+ * of an acted-on drop is reported by `row:moved`, `row:sent`, `row:received`
4478
+ * and `rowReceive:cancelled`.
4479
+ */
4480
+ dropped?: boolean;
4481
+ }
4482
+
4261
4483
  /**
4262
4484
  * The `state:changed` event (BACKLOG-0001182).
4263
4485
  *
@@ -4270,9 +4492,10 @@ export interface BeforeEvent extends GridEvent {
4270
4492
  * `state.apply()` — applying a saved view, an undo, a reset — announces itself
4271
4493
  * once, carrying the outermost cause rather than the inner mechanism's.
4272
4494
  *
4273
- * **One known gap** (BACKLOG-0001235): a host predicate registered through
4274
- * `filters.where(name, fn)` changes the `where` section and the rows on screen
4275
- * without raising this event, so a persistence layer does not yet see it.
4495
+ * A host predicate registered, replaced or removed through
4496
+ * `filters.where(name, fn)`, and a `filters.reapply()` that re-runs one, go
4497
+ * through the same tracked door as `sort` and `filters`: each fires this
4498
+ * event once, `cause: 'user'`, with `'where'` in `sections` (BACKLOG-0001235).
4276
4499
  */
4277
4500
  export interface StateChangedEvent extends GridEvent {
4278
4501
  /** Why the state changed. `'reset'` is the one a save should ignore. */
@@ -4441,6 +4664,13 @@ export interface RowsApi {
4441
4664
  * grid is not grouped.
4442
4665
  */
4443
4666
  groupHeadings(index: number): Row[];
4667
+ /**
4668
+ * The leaf rows beneath a group heading: the members it counts in
4669
+ * `leafCount`, as rows, so you can roll up a field the grid was never told
4670
+ * to total. Filtered members in display order. Computed per call, so call it
4671
+ * when you draw a group row rather than in a loop over every row.
4672
+ */
4673
+ leavesOf(key: string): Row[];
4444
4674
  expand(key: string, deep?: boolean): void;
4445
4675
  collapse(key: string): void;
4446
4676
  expandAll(): void;
@@ -5738,6 +5968,53 @@ export interface CellMenuParams {
5738
5968
  grid: Grid;
5739
5969
  }
5740
5970
 
5971
+ /** Which group `groupDefaultExpanded` is being asked about. */
5972
+ export interface GroupInfo {
5973
+ /** The group's key, the same string `Row.key` carries and `rows.expand` takes. */
5974
+ key: string;
5975
+ /** The id of the column this level groups on. */
5976
+ column?: string;
5977
+ /** The value this group stands for. */
5978
+ value?: unknown;
5979
+ /** Depth of the group. Zero is the outermost level. */
5980
+ level?: number;
5981
+ /** The group path from the root down to this group. */
5982
+ path?: string[];
5983
+ }
5984
+
5985
+ /** What `groupRenderer` is handed. */
5986
+ export interface GroupRowParams {
5987
+ /** The group row itself. */
5988
+ row: Row;
5989
+ /** The group's key, as `rows.expand`/`rows.collapse` take it. */
5990
+ key: string;
5991
+ /** The id of the column this level groups on. */
5992
+ column?: string;
5993
+ /** The value this group stands for. */
5994
+ value: unknown;
5995
+ /** Depth of the group. Zero is the outermost level. */
5996
+ level: number;
5997
+ /** Whether the group is currently open. */
5998
+ expanded: boolean;
5999
+ /** How many records sit beneath it, at any depth. */
6000
+ leafCount: number;
6001
+ /** The group's own reductions, by column id — whatever `total` asked for. */
6002
+ totals?: Record<string, unknown>;
6003
+ /**
6004
+ * The rows beneath this group, computed when you call it.
6005
+ *
6006
+ * A function rather than an array because a group is unbounded and this runs
6007
+ * per paint: a host that only needs the count should read `leafCount` and
6008
+ * never call this.
6009
+ */
6010
+ leaves(): Row[];
6011
+ /** Expand the group if it is closed, collapse it if it is open. */
6012
+ toggle(): void;
6013
+ grid: Grid;
6014
+ /** The element to fill. Write into it directly, or return content instead. */
6015
+ element: HTMLElement;
6016
+ }
6017
+
5741
6018
  /** What `fullWidth.render` is handed. */
5742
6019
  export interface FullWidthParams {
5743
6020
  row: Row;
@@ -5776,7 +6053,18 @@ export interface RailActionParams {
5776
6053
  export interface RailAction {
5777
6054
  name: string;
5778
6055
  title: string | (() => string);
5779
- icon?: string | (() => string);
6056
+ /**
6057
+ * A glyph name from the icon registry (see {@link IconName}) — a built-in
6058
+ * name, or one registered with `registerIcon`/`registerIcons`,
6059
+ * `config.icons` or `grid.icons`. A function form is re-read on every
6060
+ * repaint, the same as `title`, so a toggle can swap its glyph with its
6061
+ * state. When omitted, the rail tries `name` as the icon name instead (so an
6062
+ * action named after a built-in, e.g. `'undo'`, needs no separate `icon`);
6063
+ * an unrecognised name — from either `icon` or the `name` fallback — draws a
6064
+ * blank glyph, and only an explicitly-given unrecognised `icon` warns once
6065
+ * in the console.
6066
+ */
6067
+ icon?: IconName | (() => IconName);
5780
6068
  run(params: RailActionParams): void;
5781
6069
  enabled?(): boolean;
5782
6070
  /**
@@ -6537,6 +6825,28 @@ export function graphqlAdapter(options: {
6537
6825
  export function createGrid(element: HTMLElement, config?: GridConfig): Grid;
6538
6826
  export function createHeadlessGrid(config?: GridConfig): Grid;
6539
6827
 
6828
+ /**
6829
+ * House-wide defaults, merged beneath every grid built afterwards.
6830
+ *
6831
+ * For an application with many grids that should agree on theme, density or
6832
+ * row key. The exported factories cannot be wrapped in place — `createGrid` is
6833
+ * exported through a getter with no setter, so assigning over it is discarded
6834
+ * in a plain script and throws in a module — so this is the supported route.
6835
+ *
6836
+ * - **The per-grid config always wins.** Defaults sit *beneath* what
6837
+ * `createGrid`/`createHeadlessGrid` is passed; a key the grid names keeps the
6838
+ * grid's value, a key it omits takes the house value.
6839
+ * - **Plain objects deep-merge; arrays and everything else replace.** A house
6840
+ * `views: { storage }` and a grid's `views: { local: true }` both survive;
6841
+ * a grid's `columns` array replaces the house one rather than extending it.
6842
+ * - **Calling it again replaces the set, it does not accumulate.** Extend
6843
+ * explicitly with `defaults({ ...defaults(), density: 'compact' })`.
6844
+ * - **Never retroactive.** Grids already built are untouched.
6845
+ *
6846
+ * `defaults()` reads the current set; `defaults(null)` clears it.
6847
+ */
6848
+ export function defaults(config?: Partial<GridConfig> | null): Partial<GridConfig>;
6849
+
6540
6850
  /**
6541
6851
  * The library version, e.g. `'1.13.1'`.
6542
6852
  *
@@ -6620,6 +6930,7 @@ export function version(): string;
6620
6930
  export const LatticeGrid: {
6621
6931
  createGrid: typeof createGrid;
6622
6932
  createHeadlessGrid: typeof createHeadlessGrid;
6933
+ defaults: typeof defaults;
6623
6934
  registerModules: typeof registerModules;
6624
6935
  setLicence: typeof setLicence;
6625
6936
  version: typeof version;
@@ -8640,8 +8951,12 @@ declare module 'lattice-grid/modules/kanban' {
8640
8951
  addCard?: boolean;
8641
8952
  /** Persist a standalone inline edit; return false or a rejected promise to revert. */
8642
8953
  onCardEdit?: (event: { card: KanbanCard; key: unknown; field: string; fieldPath: string; value: unknown }) => boolean | void | Promise<boolean | void>;
8643
- /** Create a card for a column on add-card; return the row to create (with its key), or nothing to auto-generate. */
8644
- onAddCard?: (columnId: string) => KanbanRow | void;
8954
+ /**
8955
+ * Create a card for a column on add-card; return the row to create (with
8956
+ * its key), a Promise of that row, or nothing to auto-generate. A rejected
8957
+ * Promise creates no card and leaves the board unchanged (BACKLOG-0001230).
8958
+ */
8959
+ onAddCard?: (columnId: string) => KanbanRow | Promise<KanbanRow> | void;
8645
8960
  /** A predicate filter over cards; only matching cards are shown. */
8646
8961
  filter?: (row: KanbanRow, card: KanbanCard) => boolean;
8647
8962
  /** Quick-filter text matched case-insensitively across card fields. */
@@ -8724,6 +9039,26 @@ declare module 'lattice-grid/modules/kanban' {
8724
9039
  readonly count: number;
8725
9040
  }
8726
9041
 
9042
+ /**
9043
+ * Named card predicates, composed with AND (BACKLOG-0001229), following the
9044
+ * grid's `filters.where` convention (BACKLOG-0001202). Several may be
9045
+ * registered under different names at once; each can be replaced or removed
9046
+ * without touching the others. `setFilter(fn)` is unchanged sugar for
9047
+ * `where(DEFAULT, fn)` / `where(DEFAULT, null)`.
9048
+ */
9049
+ interface KanbanFilters {
9050
+ /** The reserved name `board.setFilter` registers/removes under. */
9051
+ readonly DEFAULT: string;
9052
+ /** The registered names, in registration order. */
9053
+ where(): string[];
9054
+ /** Register or replace the predicate under `name`. */
9055
+ where(name: string, predicate: (row: KanbanRow, card: KanbanCard) => boolean): Kanban;
9056
+ /** Remove whatever is registered under `name`; a no-op if nothing was. */
9057
+ where(name: string, predicate: null): Kanban;
9058
+ /** Re-run every named predicate (or one, by name) and re-render. */
9059
+ reapply(name?: string): boolean;
9060
+ }
9061
+
8727
9062
  /**
8728
9063
  * A board instance: a kanban view of grid rows as cards grouped into columns.
8729
9064
  * It consumes data through the same keyed-diff `rows.apply` contract a grid
@@ -8772,9 +9107,11 @@ declare module 'lattice-grid/modules/kanban' {
8772
9107
  reorderLanes(order: string[]): Kanban;
8773
9108
  /** Move one swimlane before another (or to the end); emits `swimlane:reorder`. */
8774
9109
  moveLane(id: string, beforeId: string | null): Kanban;
8775
- /** Set a predicate filter over cards, or clear it with null. */
9110
+ /** Named card predicates, composed with AND (BACKLOG-0001229). See {@link KanbanFilters}. */
9111
+ filters: KanbanFilters;
9112
+ /** Set a predicate filter over cards, or clear it with null. Sugar for `filters.where(filters.DEFAULT, fn)`. */
8776
9113
  setFilter(fn: ((row: KanbanRow, card: KanbanCard) => boolean) | null): Kanban;
8777
- /** Set the quick-filter text matched across card fields. */
9114
+ /** Set the quick-filter text matched across card fields. Independent of every `filters.where` predicate. */
8778
9115
  setQuickFilter(text: string): Kanban;
8779
9116
  /** Distinct values of a property with card counts — the raw material for a facet control. */
8780
9117
  facets(property: string): { value: unknown; count: number }[];
@@ -8808,8 +9145,13 @@ declare module 'lattice-grid/modules/kanban' {
8808
9145
  editCard(key: unknown, name?: string): object | null;
8809
9146
  /** Commit an inline edit through the write-back path (grid.edit.setCells when bound); emits `card:edit`. */
8810
9147
  applyEdit(key: unknown, name: string, value: unknown): Promise<boolean>;
8811
- /** Add a card to a column and open it in inline edit; emits `card:add`. */
8812
- addCard(columnId: string, seed?: KanbanRow): unknown;
9148
+ /**
9149
+ * Add a card to a column and open it in inline edit; emits `card:add`.
9150
+ * Returns the new key directly, or a Promise of it when `onAddCard`
9151
+ * returns a Promise or a `beforeAdd` handler defers (BACKLOG-0001230); a
9152
+ * rejected `onAddCard` Promise resolves this to `null` with no card added.
9153
+ */
9154
+ addCard(columnId: string, seed?: KanbanRow): unknown | Promise<unknown>;
8813
9155
  /** Serialise the restorable state: collapsed columns/lanes, order, filter, sprint/epic, selection. */
8814
9156
  getState(): object;
8815
9157
  /** Restore a state snapshot from {@link Kanban#getState}. */
@@ -8819,6 +9161,15 @@ declare module 'lattice-grid/modules/kanban' {
8819
9161
  /** Set (or clear with null) an error state, rendered as a host-supplied message. */
8820
9162
  setError(message: string | null): Kanban;
8821
9163
  setRows(rows: KanbanRow[]): Kanban;
9164
+ /**
9165
+ * Replace the board's configured column set (BACKLOG-0001228). Keeps card
9166
+ * placement and interaction state (collapsed columns, column order, quick
9167
+ * filter, selection) for every column id that survives; a dropped id is
9168
+ * not specially handled — a card whose value has nowhere configured to go
9169
+ * re-derives an ad hoc column rather than becoming `unplaced` (the same
9170
+ * "never silently drop a card" rule an unconfigured value already gets).
9171
+ */
9172
+ setColumns(defs: KanbanColumnDef[]): Kanban;
8822
9173
  refresh(): Kanban;
8823
9174
  destroy(): void;
8824
9175
  }