@toclocoinc/lattice-grid 1.56.0 → 1.57.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 +118 -17
  3. package/docs/api-detail.html +102 -7
  4. package/lattice-grid.d.ts +282 -15
  5. package/lattice-grid.esm.min.js +750 -512
  6. package/lattice-grid.min.cjs +749 -512
  7. package/lattice-grid.min.css +1 -1
  8. package/lattice-grid.min.js +749 -512
  9. package/modules/ai.esm.min.js +6 -4
  10. package/modules/ai.min.cjs +6 -4
  11. package/modules/ai.min.js +6 -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 +746 -512
  49. package/modules/htmx.min.cjs +746 -512
  50. package/modules/htmx.min.js +746 -512
  51. package/modules/kanban.esm.min.js +106 -25
  52. package/modules/kanban.min.cjs +106 -25
  53. package/modules/kanban.min.js +106 -25
  54. package/modules/kpi.esm.min.js +4 -4
  55. package/modules/kpi.min.cjs +4 -4
  56. package/modules/kpi.min.js +4 -4
  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 +749 -512
  76. package/modules/webcomponent.min.cjs +749 -512
  77. package/modules/webcomponent.min.js +749 -512
  78. package/package.json +1 -1
@@ -437,7 +437,7 @@
437
437
  <div class="shell">
438
438
  <aside class="rail">
439
439
  <p class="rail__brand">Lattice Grid</p>
440
- <p class="rail__sub">Developer guide · v1.56.0</p>
440
+ <p class="rail__sub">Developer guide · v1.57.0</p>
441
441
  <nav>
442
442
  <div class="rail__group">
443
443
  <span class="rail__label">Start here</span>
@@ -553,7 +553,7 @@
553
553
  <a href="API.html">reference tables</a> are the shorter version for when you already know.
554
554
  </p>
555
555
  <p class="chips">
556
- <span class="chip">Version 1.56.0</span>
556
+ <span class="chip">Version 1.57.0</span>
557
557
  <span class="chip">Zero dependencies</span>
558
558
  <span class="chip">No build step</span>
559
559
  </p>
@@ -1278,7 +1278,7 @@ off(); <span class="cmt">// every subscrip
1278
1278
  </p>
1279
1279
  <div class="example">
1280
1280
  <p class="example__label">Which version am I running?</p>
1281
- <pre><code>grid.getVersion(); <span class="cmt">// '1.56.0'</span>
1281
+ <pre><code>grid.getVersion(); <span class="cmt">// '1.57.0'</span>
1282
1282
  LatticeGrid.getVersion(); <span class="cmt">// the same, when you have no grid to hand</span></code></pre>
1283
1283
  </div>
1284
1284
  <p class="lead-in">
@@ -2755,13 +2755,94 @@ createGrid(right, { columns, rows,
2755
2755
  <table>
2756
2756
  <thead><tr><th>Event</th><th>Fired on</th><th>Carries</th></tr></thead>
2757
2757
  <tbody>
2758
- <tr><td class="name">row:received</td><td class="desc">the target</td><td class="desc"><code>{ data, at, rejected }</code></td></tr>
2758
+ <tr><td class="name">beforeRowReceive</td><td class="desc">the target, before the insert</td><td class="desc"><code>{ data, at, overKey, source }</code>, cancellable</td></tr>
2759
+ <tr><td class="name">rowReceive:cancelled</td><td class="desc">the target, on a veto</td><td class="desc"><code>{ data, at, overKey, source, reason }</code></td></tr>
2760
+ <tr><td class="name">row:received</td><td class="desc">the target</td><td class="desc"><code>{ data, at, overKey, rejected }</code></td></tr>
2759
2761
  <tr><td class="name">row:sent</td><td class="desc">the source, on a move</td><td class="desc"><code>{ key, data, mode }</code></td></tr>
2760
2762
  <tr><td class="name">row:copied</td><td class="desc">the source, on a copy</td><td class="desc"><code>{ key, data, mode }</code></td></tr>
2761
2763
  </tbody>
2762
2764
  </table>
2763
2765
  </div>
2764
2766
 
2767
+ <p class="lead-in">
2768
+ Those events all describe a drag that has <em>settled</em>. To follow one while it is
2769
+ happening — to highlight a candidate row, drive your own drop indicator, or update a side
2770
+ panel as the row travels — there are four more, and they all fire on the grid the drag
2771
+ <strong>started</strong> in, for a same-grid reorder and a cross-grid transfer alike. A drag is
2772
+ one gesture with one owner, and the source is the only grid present for the whole of it, where
2773
+ the pointer may cross several others or none; <code>over</code> names whichever grid the event
2774
+ is about, so one subscription can decorate any of them.
2775
+ </p>
2776
+
2777
+ <div class="table-wrap">
2778
+ <table>
2779
+ <thead><tr><th>Event</th><th>Fires when</th><th>Carries</th></tr></thead>
2780
+ <tbody>
2781
+ <tr><td class="name">rowDrag:started</td><td class="desc">the press passed the drag threshold</td><td class="desc"><code>{ key, data, over, at, overKey }</code></td></tr>
2782
+ <tr><td class="name">rowDrag:moved</td><td class="desc">the pointer is over a candidate position; <strong>at most once per animation frame</strong></td><td class="desc"><code>{ key, data, over, at, overKey }</code></td></tr>
2783
+ <tr><td class="name">rowDrag:left</td><td class="desc">the pointer left a grid; <code>over</code> is the grid it left</td><td class="desc"><code>{ key, data, over, at: null, overKey: null }</code></td></tr>
2784
+ <tr><td class="name">rowDrag:ended</td><td class="desc">the gesture ended, drop or no drop</td><td class="desc"><code>{ key, data, over, at, overKey, dropped }</code></td></tr>
2785
+ </tbody>
2786
+ </table>
2787
+ </div>
2788
+
2789
+ <div class="example">
2790
+ <p class="example__label">Highlight the row a drag is hovering, and clean up however it ends</p>
2791
+ <pre><code>backlog.on('rowDrag:moved', (e) =&gt; {
2792
+ <span class="cmt">// e.over is the grid under the pointer, null over none.</span>
2793
+ paintCandidate(e.over, e.overKey); <span class="cmt">// overKey is null where there is no row to name</span>
2794
+ });
2795
+ backlog.on('rowDrag:left', (e) =&gt; clearCandidate(e.over));
2796
+ backlog.on('rowDrag:ended', (e) =&gt; {
2797
+ clearCandidate(e.over); <span class="cmt">// always fires, even released off every grid</span>
2798
+ <span class="kw">if</span> (!e.dropped) toast('Nothing moved');
2799
+ });</code></pre>
2800
+ </div>
2801
+
2802
+ <div class="why">
2803
+ <p><strong>Notifications, not gates.</strong> None of the four is cancellable and none carries
2804
+ <code>preventDefault</code>. The drop is already vetoable twice over — <code>beforeRowMove</code>
2805
+ for a reorder, <code>beforeRowReceive</code> for a drop into another grid — and a third veto on
2806
+ the same gesture would be a third place to look when a drop does not happen.</p>
2807
+ <p><strong><code>rowDrag:moved</code> is coalesced to one event per animation frame</strong>,
2808
+ carrying that frame's latest pointer position. A pointer produces several hundred moves a
2809
+ second and a handler that draws cannot usefully run faster than the display, so the rate is
2810
+ capped at the display's rather than the pointer's. The other three fire on the transition
2811
+ itself, and no <code>rowDrag:moved</code> is ever delivered after <code>rowDrag:ended</code>.</p>
2812
+ <p><strong>Read, measure and draw in these handlers; do not mutate.</strong> The drag resolves
2813
+ where it would land against the display order, so changing rows, sort, filters or grouping
2814
+ mid-gesture moves the ground under the drop — and <code>data</code> is the source row's own
2815
+ object rather than a copy, so writing to it edits a row that is still in the grid without
2816
+ announcing the change. Work that changes the grid belongs in <code>beforeRowReceive</code>,
2817
+ which is asked before the insert, or in the settled events afterwards.</p>
2818
+ <p><strong>The end is always reported.</strong> Exactly one <code>rowDrag:ended</code> follows
2819
+ every <code>rowDrag:started</code>, including a release outside every grid, where
2820
+ <code>over</code> is null. A press that never passes the drag threshold is a click and raises
2821
+ none of them; a grid destroyed mid-drag raises no <code>rowDrag:ended</code>.</p>
2822
+ </div>
2823
+
2824
+ <p class="lead-in">
2825
+ A drop can mean something other than a move. Dragging a backlog row onto a row in another
2826
+ grid often means <em>assign this to that</em>: the host wants to know which row it landed on,
2827
+ record the relationship, and keep the row where it was. <code>beforeRowReceive</code> fires on
2828
+ the receiving grid before the insert, naming the row under the pointer as <code>overKey</code>
2829
+ (null past the last row, on empty space, on the header or on a pinned row) and the grid it came
2830
+ from as <code>source</code>. <code>preventDefault(reason)</code> stops the insert, and the source
2831
+ grid is untouched: the row stays, and neither <code>row:sent</code> nor <code>row:copied</code>
2832
+ fires. The handler may be <code>async</code>, as every before-event may; a drop whose row under
2833
+ the pointer, or source row, is gone by the time it settles is cancelled as <code>'stale'</code>.
2834
+ </p>
2835
+
2836
+ <div class="example">
2837
+ <p class="example__label">Assign on drop, rather than move</p>
2838
+ <pre><code>assigned.on('beforeRowReceive', (e) =&gt; {
2839
+ <span class="kw">if</span> (e.overKey === <span class="kw">null</span>) <span class="kw">return</span>; <span class="cmt">// dropped on no row: let it move</span>
2840
+ e.preventDefault('assigned'); <span class="cmt">// the backlog row stays in the backlog</span>
2841
+ assign(e.data.id, e.overKey); <span class="cmt">// the relationship is the change</span>
2842
+ });
2843
+ assigned.on('rowReceive:cancelled', (e) =&gt; console.log(e.reason)); <span class="cmt">// 'assigned'</span></code></pre>
2844
+ </div>
2845
+
2765
2846
  <div class="why">
2766
2847
  <p><strong>Off by default, and both ends have to agree.</strong> Rows leaving a grid is a data
2767
2848
  change you have to want: a grid that quietly let its rows be dragged away would lose one to a
@@ -4839,6 +4920,14 @@ grid.selection.extendRange(34, 'cap'); <span class="cmt">// grows the block jus
4839
4920
  normally with <code>mode: 'single'</code> — the checkbox remains the only way to change
4840
4921
  which one row is selected.
4841
4922
  </p>
4923
+ <p class="lead-in">
4924
+ With <code>mode: 'single'</code>, checking a row's box selects that row and replaces
4925
+ whichever one was selected before; unchecking the selected row clears the selection.
4926
+ <code>grid.selection.set(keys)</code> itself keeps only the <em>first</em> key of whatever
4927
+ array it is given when <code>mode</code> is <code>'single'</code> — that contract is
4928
+ unchanged (BACKLOG-0001233) — so the checkbox column never builds a two-key array to hand
4929
+ it; it sets the one key it just toggled.
4930
+ </p>
4842
4931
 
4843
4932
  <div class="why">
4844
4933
  <p><strong>Ctrl+Shift+Arrow is the keyboard form of ctrl-dragging.</strong> The first press
@@ -7309,7 +7398,7 @@ grid.import.apply(preview);</code></pre>
7309
7398
  <tr><td class="name">deriveRangeSpec</td><td class="desc">Decide what a chart of a range should be without drawing it: the type, the category column, the measures, and a spec ready for <code>createChart</code>.</td></tr>
7310
7399
  <tr><td class="name">regressionPlots</td><td class="desc">Turn a fitted regression model into diagnostic chart specs ready for <code>createChart</code>: the fit line with its confidence band, residuals-vs-fitted, a QQ plot of the residuals, and a multicollinearity correlogram with the model’s VIF. The plots that need a per-row or per-coefficient quantity the grid has no column for (scale-location, residuals-vs-leverage, the coefficient forest) are returned as a null spec carrying the reason rather than dropped.</td></tr>
7311
7400
  <tr><td class="name">createDataRouter</td><td class="desc">Split one arriving stream or dataset across many grids by what each record is — a property or a predicate — driving each grid through the public keyed <code>rows.apply</code> path so a snapshot is a diff, a delta is applied in place, a moved partition moves the row rather than duplicating it, and an unmatched record is counted, sunk and never dropped. By default routing is first-match-wins (<code>overlap: false</code>); to fan one partition value to several viewers at once (a grid <em>and</em> a KPI panel <em>and</em> a chart off one feed) create the router with <code>overlap: true</code> — with the default, a second viewer on the same value receives nothing and the router emits a one-time dev warning naming the clash. v2 adds cross-grid selection filtering: <code>link(source, target, relation)</code> makes a selection in one grid filter what another receives — by a key map or a predicate function, multi-select as an IN set, debounced — re-pushed through the same keyed-diff path so the target stays dumb. v5 adds wedge-conversion primitives: <code>subscribe(value, handler)</code> routes a slice to any non-grid view (KPI tile, detail pane, map, form) as the same keyed diff a grid gets; <code>alert(value, condition, handler)</code> evaluates a condition over a slice and emits (edge-triggered, debounced) rather than rendering; and <code>configure(spec)</code> (or <code>createDataRouter({ config })</code>) takes the whole routing graph as one declarative data spec that desugars to the imperative API and composes with it. v3 also adds per-route reshaping — <code>transform</code>/<code>filter</code>/<code>sort</code> and <code>rollup</code> ({ groupBy, aggregate }) summaries — a relationship graph (<code>relate(edges)</code>: multi-hop, several-into-one AND, and mutual edges) that scales v2's pairwise <code>link</code>, and stream hygiene: a <code>seq</code>/version orders and de-duplicates a feed (stale/duplicate deltas dropped, counted in <code>dropped</code>), <code>push</code> with a <code>batch</code>/<code>coalesce</code> buffers a high-frequency feed (<code>flushStream</code> for a deterministic point), and <code>lastSeq</code>/<code>checkpoint</code>/<code>seenThrough</code> resume precisely after a dropped socket. v4 adds time-travel: <code>buffer({ window, max })</code> records the ordered stream into a bounded ring over a moving base, so <code>scrubTo</code> reconstructs a past point, <code>replay</code> (with <code>pause</code>/<code>resume</code>) walks a range, and <code>live</code> returns to the head — every state pushed by the same keyed diff, <code>traveling</code>/<code>buffered</code> reporting the state. v6 adds cross-tab sync: <code>broadcast({ channel })</code> mirrors the ordered, de-duplicated deltas to other tabs/windows over a BroadcastChannel with no echo loop, a popped-out grid joining the same feed with no second socket and resyncing mid-stream via the reconnect path. v7 adds query-slice routing: <code>query(adapter, request)</code> sources the router from a DFQL/DuckDB (or any pushdown) adapter, partitioning one result across the routes; a route-level <code>where</code> is pushed down where the adapter's capabilities allow and the residual finished client-side, with <code>lastQueryPlan</code> reporting the split. v8 adds write-back: a <code>writable</code> route captures the grid's committed edits off its public edit surface and routes them to <code>onWrite(change, ctx)</code> (per-route or router-global), reverting on reject, re-entering an accepted write as a delta, and surfacing a last-write-wins <code>onConflict</code>; a derived route cannot be writable. v9 adds fan-in: <code>addSource(feed, { map, key })</code> returns a per-feed handle (<code>load</code>/<code>apply</code>/<code>push</code>/<code>remove</code>) whose rows are normalized and namespaced so many feeds merge into one keyed store without id collisions, <code>removeSource</code> dropping exactly a feed's rows and <code>sources</code> listing them. v10 adds observability: <code>metrics()</code> is a cheap snapshot of per-route/per-source counts and throughput plus the global unrouted/dropped/buffered/lag figures, <code>on('metrics')</code> drives a periodic emit (off unless a listener is registered), and <code>mountDevtools(el)</code> renders a live panel from the module's own DOM file. Detaches its grids on <code>destroy</code>; the host owns them.</td></tr>
7312
- <tr><td class="name">createKanban</td><td class="desc">A board (kanban) view of rows as cards, grouped into columns by a configurable property (a status, a stage, a state field), with per-column card count and an optional points sum, a WIP over-limit flag, configured columns shown even when empty, granular readonly (whole board / per column / per card), field-mapped card templates that reuse the grid’s own column formatters when a grid is bound, and the core pointer events (<code>card:click</code>, <code>card:dblclick</code>, <code>card:contextmenu</code>). It is a dataset viewer like any other: it consumes data through the same keyed-diff <code>rows.apply({ add, update, remove })</code> contract a grid exposes, so a Data Router can <code>attach(value, board)</code> and drive a kanban beside a grid and a chart off one feed. Accessibility is built in from the start — a labelled group of labelled column lists, cards in a roving-tabindex focus ring with arrow-key navigation, and a polite live region. Every structural property is named in config (<code>columnProperty</code>, <code>pointsProperty</code>, <code>orderProperty</code>, <code>swimlaneProperty</code>, <code>sprintProperty</code>, <code>epicProperty</code>) so it maps DemandFlow and any customer schema without code change. Pass <code>null</code> as the element for a headless board that computes the same model without a DOM. Cards drag between columns (writing the column property) and within a column into a position (writing the order property with fractional ranking), and the same move is keyboard-accessible — <kbd>Space</kbd> to grab, arrows to choose a target, <kbd>Space</kbd>/<kbd>Enter</kbd> to drop, <kbd>Escape</kbd> to cancel — announced on the live region; multi-select drags every selected card. A move calls <code>onBeforeMove(card, from, to, index)</code> first (return <code>false</code> to veto) and then persists through the grid’s shipped write-back path — grid-bound via <code>grid.edit.setCells</code> (the same public edit-commit path inline editing uses, so the grid’s pipeline owns optimistic apply / confirm / revert), standalone with a revert when <code>onCardMove</code> rejects — emitting <code>card:move</code>. A configurable per-card <code>contextMenu</code> replaces the <code>card:contextmenu</code> event when present. With <code>swimlanes: true</code> it renders a 2D lane&times;column grid grouped by <code>swimlaneProperty</code> (per-lane count/points, columns aligned across lanes, a cross-lane drag writing the swimlane property); columns and lanes collapse (state surviving a keyed-diff update), columns reorder by header drag, and <code>setQuickFilter</code>/<code>setFilter</code>/<code>facets</code> drive search and faceting. <code>setSprint</code>/<code>showBacklog</code>/<code>sprints</code> give a sprint view, switcher and backlog; <code>setEpic</code>/<code>epicRollup</code>/<code>rollup</code> give an epic view and rollups (count, points, progress toward the <code>done</code> columns). A card can pop out a nested grid of its children (an epic's stories, a story's tasks, recursively) via a <code>childrenProperty</code> and/or <code>loadChildren(card)</code>: the child is a full composed <code>createGrid</code> (or, with <code>asBoard</code>, a nested board) opened in a drawer/modal/inline container — reuse by composition, no grid-core coupling — emitting <code>card:expand</code>/<code>card:drill</code>. Live updates arrive through the same keyed-diff contract a grid uses, so a Data Router drives the board directly (<code>attach(board, predicate)</code>); a live <code>rows.apply</code> re-renders preserving scroll, focus, selection, collapse and any open pop-out. <code>virtualize</code> renders only a scroll window of a tall column; <code>getState</code>/<code>setState</code> (and <code>config.state</code>) save and restore collapse, order, filter and sprint/epic selection; <code>setLoading</code>/<code>setError</code> give loading and error states. The move is fully keyboard-driven — Space to grab, arrows for column/position, Alt+Up/Down across swimlanes, Space/Enter to drop, Escape to cancel — announced on a live region. A field opted in with <code>card: { title: { field, edit: true } }</code> edits inline (double-click or <code>editCard</code>): grid-bound through the grid's own field editor via its public edit path, standalone through a host editor factory or a default input with an <code>onCardEdit</code> revert; a per-column add-card (<code>config.addCard</code>/<code>onAddCard</code>, or <code>grid.edit.addRow</code>) creates a card and opens it in edit. The module imports nothing from the grid's DOM package.</td></tr>
7401
+ <tr><td class="name">createKanban</td><td class="desc">A board (kanban) view of rows as cards, grouped into columns by a configurable property (a status, a stage, a state field), with per-column card count and an optional points sum, a WIP over-limit flag, configured columns shown even when empty, granular readonly (whole board / per column / per card), field-mapped card templates that reuse the grid’s own column formatters when a grid is bound, and the core pointer events (<code>card:click</code>, <code>card:dblclick</code>, <code>card:contextmenu</code>). It is a dataset viewer like any other: it consumes data through the same keyed-diff <code>rows.apply({ add, update, remove })</code> contract a grid exposes, so a Data Router can <code>attach(value, board)</code> and drive a kanban beside a grid and a chart off one feed. Accessibility is built in from the start — a labelled group of labelled column lists, cards in a roving-tabindex focus ring with arrow-key navigation, and a polite live region. Every structural property is named in config (<code>columnProperty</code>, <code>pointsProperty</code>, <code>orderProperty</code>, <code>swimlaneProperty</code>, <code>sprintProperty</code>, <code>epicProperty</code>) so it maps DemandFlow and any customer schema without code change. Pass <code>null</code> as the element for a headless board that computes the same model without a DOM. Cards drag between columns (writing the column property) and within a column into a position (writing the order property with fractional ranking), and the same move is keyboard-accessible — <kbd>Space</kbd> to grab, arrows to choose a target, <kbd>Space</kbd>/<kbd>Enter</kbd> to drop, <kbd>Escape</kbd> to cancel — announced on the live region; multi-select drags every selected card. A move calls <code>onBeforeMove(card, from, to, index)</code> first (return <code>false</code> to veto) and then persists through the grid’s shipped write-back path — grid-bound via <code>grid.edit.setCells</code> (the same public edit-commit path inline editing uses, so the grid’s pipeline owns optimistic apply / confirm / revert), standalone with a revert when <code>onCardMove</code> rejects — emitting <code>card:move</code>. A configurable per-card <code>contextMenu</code> replaces the <code>card:contextmenu</code> event when present. With <code>swimlanes: true</code> it renders a 2D lane&times;column grid grouped by <code>swimlaneProperty</code> (per-lane count/points, columns aligned across lanes, a cross-lane drag writing the swimlane property); columns and lanes collapse (state surviving a keyed-diff update), columns reorder by header drag, and <code>setQuickFilter</code>/<code>setFilter</code>/<code>facets</code> drive search and faceting. <code>setSprint</code>/<code>showBacklog</code>/<code>sprints</code> give a sprint view, switcher and backlog; <code>setEpic</code>/<code>epicRollup</code>/<code>rollup</code> give an epic view and rollups (count, points, progress toward the <code>done</code> columns). A card can pop out a nested grid of its children (an epic's stories, a story's tasks, recursively) via a <code>childrenProperty</code> and/or <code>loadChildren(card)</code>: the child is a full composed <code>createGrid</code> (or, with <code>asBoard</code>, a nested board) opened in a drawer/modal/inline container — reuse by composition, no grid-core coupling — emitting <code>card:expand</code>/<code>card:drill</code>. Live updates arrive through the same keyed-diff contract a grid uses, so a Data Router drives the board directly (<code>attach(board, predicate)</code>); on a standalone board (not <code>grid</code>-bound, which ignores <code>rows.apply</code> and routes to the bound grid instead) <code>rows.apply({ update })</code> merges each patch into the row already stored under its key, matching the grid's own <code>rows.apply({ update })</code> — a field the patch omits is preserved, and a patch that does change the grouping property still moves the card — while <code>add</code> sets the row outright; a live <code>rows.apply</code> re-renders preserving scroll, focus, selection, collapse and any open pop-out. <code>virtualize</code> renders only a scroll window of a tall column; <code>getState</code>/<code>setState</code> (and <code>config.state</code>) save and restore collapse, order, filter and sprint/epic selection; <code>setLoading</code>/<code>setError</code> give loading and error states. The move is fully keyboard-driven — Space to grab, arrows for column/position, Alt+Up/Down across swimlanes, Space/Enter to drop, Escape to cancel — announced on a live region. A field opted in with <code>card: { title: { field, edit: true } }</code> edits inline (double-click or <code>editCard</code>): grid-bound through the grid's own field editor via its public edit path, standalone through a host editor factory or a default input with an <code>onCardEdit</code> revert; a per-column add-card (<code>config.addCard</code>/<code>onAddCard</code>, or <code>grid.edit.addRow</code>) creates a card and opens it in edit. The module imports nothing from the grid's DOM package.</td></tr>
7313
7402
  <tr><td class="name">createKPI</td><td class="desc">A KPI / stat-tile view (module <code>kpi</code>) of a dataset as a panel of aggregate tiles — each tile a <code>sum</code>, <code>avg</code>, <code>min</code>, <code>max</code>, <code>count</code>, <code>countDistinct</code> or a <code>custom</code> reducer over the routed rows, with an optional <code>filter</code> predicate, number <code>format</code> (<code>number</code>/<code>currency</code>/<code>percent</code>/<code>compact</code>), a <code>baseline</code> for a delta, semantic threshold bands (<code>thresholds</code> with two cut points and a direction, or an explicit <code>bands</code> list, giving a <code>good</code>/<code>warn</code>/<code>critical</code> status kept separate from any accent), and an optional <code>sparkline</code> series. It is a dataset viewer like any other: it consumes data through the same keyed-diff <code>rows.apply({ add, update, remove })</code> contract a grid exposes, so a Data Router can <code>attach(value, kpi)</code> and drive a KPI panel beside a grid, a kanban and a chart off one feed. Updates are incremental — a delta adjusts each tile's running accumulator by only the rows it carries (an add contributes, a remove reverses, an update reverses-then-contributes), the two bounded exceptions being a <code>min</code>/<code>max</code> whose current extreme is removed (a rescan of that tile's own value multiset) and a <code>custom</code> reducer (recomputed over the filtered store, an arbitrary function having no inverse). Each tile is a labelled <code>&lt;figure&gt;</code>, focusable and keyboard-activatable, its value announced, the sparkline respecting <code>prefers-reduced-motion</code>; a <code>tile:click</code> event (also from the keyboard) lets a host drill down or filter a routed grid. Pass <code>null</code> as the element for a headless panel that computes the same tile model without a DOM. Not a dashboard layout engine (that is the parked dashboard generator) and no charting beyond the minimal sparkline (that is the charts module).</td></tr>
7314
7403
  <tr><td class="name">createAI</td><td class="desc">Create an AI narrative / insights controller (module <code>ai</code>) over a live grid. It produces a short, plain-language narrative of the grid's <em>computed</em> figures — a per-KPI / per-chart / per-column <code>explain</code>, or an <code>insights</code> panel over the current filtered view. The grid makes no AI call of its own: <code>createAI</code> imports no provider SDK, holds no key, and makes no network request; it calls one host callback, <code>ask({ system, messages, prompt, tools?, schema?, signal })</code> — your model, your key, your privacy decision — the same philosophy as the data adapters. Two grounding paths feed one guard: where the provider offers tool-use the model is given a curated read-only tool set (<code>getSchema</code>, <code>getProfile</code>, <code>getStatistics</code>, <code>getForecast</code>, <code>runQuery</code>) and the grid's own engine computes what it asks for; otherwise the module builds a facts packet from <code>grid.statistics</code>/the profile/forecasts/view counts and passes it in the prompt. Every figure in the narrative is reconciled against the values the engine produced this render — an ungrounded number is stripped before display (the number-reconciliation guard), so a hallucinated figure never reaches the user. The prompt is constrained to narrate-only; the layer is read-only and never mutates data. <code>redact</code> (a column id, a list, or a predicate) and <code>maxRows</code> bound what the module hands <code>ask()</code>, and the module sends nothing itself; an <code>ask()</code> error surfaces a friendly message and the grid stays fully usable, AI being additive rather than load-bearing. Complementary to <code>grid.ai</code> (the intent/plan skill layer): pass no <code>ask</code> and it adopts the grid's configured <code>ai.ask</code>, running the facts-packet path over it. Pass a headless grid for a DOM-free narrative; <code>facts(target)</code> returns the exact grounded packet without calling <code>ask()</code>. UMD global <code>LatticeGridAI</code>.</td></tr>
7315
7404
  <tr><td class="name">createTabs</td><td class="desc">Create a tabbed grid (module <code>tabs</code>): a <code>role="tablist"</code> strip above a stack of <code>role="tabpanel"</code> regions, each hosting its own, independently-configured <code>createGrid</code> instance — "configure each tab as per a normal grid" rather than one grid whose state is swapped (<code>ColumnModel#applyState</code> only repositions/hides/resizes existing columns by id; it carries no field, type or row data, so a state-swap only works when every tab shares one schema). <code>createGrid</code> is injected (<code>createTabs(el, { createGrid, tabs })</code>), the same pattern the React/Vue/Svelte adapters use, so the module imports no engine code and adds nothing to a page that does not load it. A tab that names <code>from: '&lt;tabId&gt;'</code> gets a <code>source: { mode: 'derived', from: &lt;the parent tab’s live grid&gt;, where, group, join, … }</code> wired for it automatically — reusing the shipped derived-source mechanism rather than a new config-inheritance one — and activating a derived tab materialises its whole ancestor chain first; a cyclic <code>from</code> graph is refused (naming the exact cycle) when <code>createTabs</code> is called, not at first click. A tab’s grid mounts on first activation and then stays alive, hidden, so its scroll/selection/filters/sort/grouping/expansion — and an open cell/row editor, left exactly as it was, uncommitted and undiscarded — survive a switch natively; <code>destroy()</code> tears every mounted tab down. The strip is a real tablist with <code>aria-selected</code>, a roving <code>tabindex</code>, and manual-activation keyboard handling (arrows/Home/End move focus, Enter/Space or a click activates). Events: <code>tab:changed</code>, a cancellable <code>beforeTabChange</code> paired with <code>tabChange:cancelled</code>. UMD global <code>LatticeGridTabs</code>.</td></tr>
@@ -7466,6 +7555,10 @@ el.grid.sort.set([{ col: 'charge', dir: 'desc' }]);</code></pre>
7466
7555
  <tr><td class="name">row:moved</td><td class="desc">A row was dragged to a new position.</td></tr>
7467
7556
  <tr><td class="name">row:received</td><td class="desc">A row arrived from a source.</td></tr>
7468
7557
  <tr><td class="name">row:sent</td><td class="desc">A row was written back to a source.</td></tr>
7558
+ <tr><td class="name">rowDrag:started</td><td class="desc">A row drag began. Fires on the grid the drag started in, as do rowDrag:moved, rowDrag:left and rowDrag:ended.</td></tr>
7559
+ <tr><td class="name">rowDrag:moved</td><td class="desc">The drag is over a candidate position. Coalesced to one event per animation frame, carrying that frame's latest pointer position.</td></tr>
7560
+ <tr><td class="name">rowDrag:left</td><td class="desc">The pointer left a grid; over names the grid it left. Emitted on the transition, not on a frame.</td></tr>
7561
+ <tr><td class="name">rowDrag:ended</td><td class="desc">The gesture ended, whether or not a drop followed, including a release outside every grid. dropped says whether the release is being acted on. Notifications only — none of the four is cancellable.</td></tr>
7469
7562
  <tr><td class="name">rows:changed</td><td class="desc">The row set changed. See what a change firing promises: identified means the three arrays name the rows that moved, companion marks a duplicate announcement of a change already made with identity, and a firing with neither is a real change of unknown extent.</td></tr>
7470
7563
  <tr><td class="name">rows:deferred</td><td class="desc">Updates were held rather than applied, because an edit is in flight.</td></tr>
7471
7564
  <tr><td class="name">rows:paused</td><td class="desc">A live feed was paused; updates queue from here.</td></tr>
@@ -7535,7 +7628,7 @@ el.grid.sort.set([{ col: 'charge', dir: 'desc' }]);</code></pre>
7535
7628
  <tr><td class="name">filter:changed</td><td class="desc">The condition tree or the quick filter changed.</td></tr>
7536
7629
  <tr><td class="name">page:changed</td><td class="desc">Fired after the rows have moved, whether the page changed by API or by the pager control.</td></tr>
7537
7630
  <tr><td class="name">sort:changed</td><td class="desc">The full sort entry list.</td></tr>
7538
- <tr><td class="name">state:changed</td><td class="desc">Every state change, whether a user gesture or a programmatic call, announced exactly once — with one known gap, filters.where (BACKLOG-0001235), which changes the where section and the rows on screen without raising it. cause is 'user', 'apply' or 'reset'; sections names the GridState keys that moved; report lists anything a restore could not apply. A save layer subscribes to this one event and ignores cause 'reset'.</td></tr>
7631
+ <tr><td class="name">state:changed</td><td class="desc">Every state change, whether a user gesture or a programmatic call — including a named filters.where predicate registered, replaced, removed or reapplied (BACKLOG-0001235) — announced exactly once. cause is 'user', 'apply' or 'reset'; sections names the GridState keys that moved; report lists anything a restore could not apply. A save layer subscribes to this one event and ignores cause 'reset'.</td></tr>
7539
7632
  <tr><td class="name">state:reset</td><td class="desc">The grid was returned to its baseline.</td></tr>
7540
7633
  <tr><td class="name">timeline:attached</td><td class="desc">A time brush was connected to the grid.</td></tr>
7541
7634
  <tr><td class="name">timeline:detached</td><td class="desc">The brush was removed.</td></tr>
@@ -7600,6 +7693,7 @@ el.grid.sort.set([{ col: 'charge', dir: 'desc' }]);</code></pre>
7600
7693
  <tr><td class="name">beforeDelete</td><td class="desc">Before an optimistic row delete applies — the canonical confirm-before-delete hook. Paired with delete:cancelled.</td></tr>
7601
7694
  <tr><td class="name">beforeRowMove</td><td class="desc">Before a row reorder applies. Paired with rowMove:cancelled.</td></tr>
7602
7695
  <tr><td class="name">beforeGroup</td><td class="desc">Before a group/tree expand or collapse applies. Paired with group:cancelled.</td></tr>
7696
+ <tr><td class="name">beforeRowReceive</td><td class="desc">Before a row dragged from another grid is inserted into this one; fires on the receiving grid and names the row under the pointer (overKey). A veto leaves the source grid untouched. Paired with rowReceive:cancelled.</td></tr>
7603
7697
  <tr><td class="name">edit:cancelled</td><td class="desc">A beforeEdit was vetoed; reason is 'stale' when a live delta moved the cell during an async gate.</td></tr>
7604
7698
  <tr><td class="name">sort:cancelled</td><td class="desc">A beforeSort was vetoed.</td></tr>
7605
7699
  <tr><td class="name">filter:cancelled</td><td class="desc">A beforeFilter was vetoed.</td></tr>
@@ -7611,6 +7705,7 @@ el.grid.sort.set([{ col: 'charge', dir: 'desc' }]);</code></pre>
7611
7705
  <tr><td class="name">delete:cancelled</td><td class="desc">A beforeDelete was vetoed; reason is 'stale' when the row was already gone.</td></tr>
7612
7706
  <tr><td class="name">rowMove:cancelled</td><td class="desc">A beforeRowMove was vetoed; reason is 'stale' when the row had moved.</td></tr>
7613
7707
  <tr><td class="name">group:cancelled</td><td class="desc">A beforeGroup was vetoed.</td></tr>
7708
+ <tr><td class="name">rowReceive:cancelled</td><td class="desc">A beforeRowReceive was vetoed; nothing was inserted and the source still holds the row. reason is 'stale' when the row under the pointer or the source row was gone by the time an async handler settled.</td></tr>
7614
7709
  <tr><td class="name">export:request</td><td class="desc">A remote export was requested. Past-tense notification.</td></tr>
7615
7710
  <tr><td class="name">export:done</td><td class="desc">A remote export completed. Past-tense notification.</td></tr>
7616
7711
  <tr><td class="name">shortcuts:opened</td><td class="desc">The keyboard-shortcuts help overlay opened. Past-tense notification.</td></tr>
@@ -7806,7 +7901,7 @@ grid.licence.state(); <span class="cmt">// 'licensed' | 'localhost' | 'trial'<
7806
7901
 
7807
7902
  <footer>
7808
7903
  <p>
7809
- Lattice Grid 1.56.0 · Copyright © 2026 TOCLOCO Inc. All rights reserved.
7904
+ Lattice Grid 1.57.0 · Copyright © 2026 TOCLOCO Inc. All rights reserved.
7810
7905
  Written against the shipped source. Where this guide and the code disagree, the code wins,
7811
7906
  please <a href="https://www.latticegrid.dev">tell us</a>.
7812
7907
  </p>