@toclocoinc/lattice-grid 1.28.0 → 1.30.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.
@@ -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.28.0</p>
440
+ <p class="rail__sub">Developer guide · v1.30.0</p>
441
441
  <nav>
442
442
  <div class="rail__group">
443
443
  <span class="rail__label">Start here</span>
@@ -1378,7 +1378,7 @@ LatticeGrid.getVersion(); <span class="cmt">// the same, when you have no grid
1378
1378
  <thead><tr><th>Family</th><th>Types</th></tr></thead>
1379
1379
  <tbody>
1380
1380
  <tr><td class="name">Core</td><td class="desc"><code>text</code>, <code>number</code>, <code>boolean</code>, <code>date</code>, <code>dateString</code>, <code>object</code>, <code>lookup</code></td></tr>
1381
- <tr><td class="name">Temporal</td><td class="desc"><code>datetime</code>, <code>time</code>, <code>duration</code></td></tr>
1381
+ <tr><td class="name">Temporal</td><td class="desc"><code>datetime</code>, <code>timestamp</code>, <code>time</code>, <code>duration</code></td></tr>
1382
1382
  <tr><td class="name">Network</td><td class="desc"><code>ipv4</code>, <code>ipv6</code>, <code>cidr</code>, <code>mac</code></td></tr>
1383
1383
  <tr><td class="name">Numeric bases</td><td class="desc"><code>hex</code>, <code>hex8</code>, <code>hex16</code>, <code>hex32</code>, <code>binary</code>, <code>binary8</code>, <code>octal</code></td></tr>
1384
1384
  <tr><td class="name">Units: computing</td><td class="desc"><code>bytes</code>, <code>megabytes</code>, <code>gigabytes</code>, <code>bitrate</code>, <code>gigabits</code></td></tr>
@@ -1537,8 +1537,36 @@ dataTypes: {
1537
1537
  convert.</p>
1538
1538
  <p>It is also faster and smaller: ISO 8601 sorts lexicographically in the same order it sorts
1539
1539
  chronologically, so a date column sorts as text, and repeated dates dictionary-encode well.</p>
1540
- <p>When you genuinely mean an instant (a log timestamp) use <code>datetime</code> and set
1541
- <code>format.timeZone</code>.</p>
1540
+ <p>When you genuinely mean an instant (a log timestamp, an audit time) use
1541
+ <code>timestamp</code> — see below. <code>datetime</code> stays a wall clock, deliberately.</p>
1542
+ </div>
1543
+
1544
+ <h3 id="timestamp-type">timestamp — an instant, stored UTC, shown in a chosen zone</h3>
1545
+ <p class="lead-in">
1546
+ <code>type: 'timestamp'</code> is the sibling to <code>datetime</code> for data that is one
1547
+ genuine moment everywhere — an audit time, an event <code>created_at</code>, a cross-region log
1548
+ line — rather than a wall clock.
1549
+ </p>
1550
+ <div class="why">
1551
+ <p><strong>Stored as an instant.</strong> A value ingests from epoch-millis, a <code>Date</code>,
1552
+ or a zone-bearing ISO string (<code>…Z</code> / <code>…+01:00</code>) and is stored as
1553
+ epoch-millis UTC. Because storage is numeric, sort, filter and compare operate on the
1554
+ <em>instant</em>, never on rendered text — two rows from different origin zones order by true
1555
+ chronology, and changing the display zone never reorders them.</p>
1556
+ <p><strong>Shown in a display zone you control.</strong> The cell renders in the zone resolved
1557
+ by precedence: the column's <code>typeOptions.timeZone</code>, then the grid's
1558
+ <code>config.timeZone</code>, then the viewer's local zone. The resolved zone is nameable
1559
+ (e.g. <code>Europe/London (BST)</code>) so a reader always knows which clock they are reading;
1560
+ set <code>typeOptions.showOrigin: true</code> to also show the origin zone when it differs, and
1561
+ when no origin was recorded the cell says so rather than assuming local.</p>
1562
+ <p><strong>Grouped by civil day in the display zone.</strong> Grouping a <code>timestamp</code>
1563
+ column buckets by civil day by default — <code>group: { granularity: 'week' | 'month' | 'instant', weekStart: 1 }</code>
1564
+ chooses week (Monday-start by default), month, or the exact instant. Buckets are computed by
1565
+ projecting the instant to a civil date in the display zone, so a 23- or 25-hour daylight-saving
1566
+ day still collapses to one bucket rather than splitting.</p>
1567
+ <p><strong>Excel export.</strong> Excel has no zone, so the display-zone wall clock is written
1568
+ as a plain numeric datetime serial (<code>yyyy-mm-dd hh:mm</code>) — what you saw on screen,
1569
+ with the zone named in the docs and column header, never shifted silently to UTC.</p>
1542
1570
  </div>
1543
1571
 
1544
1572
  <h3>Formats</h3>
@@ -2369,6 +2397,34 @@ grid.setPinnedRows([], { edge: 'top' }); <span class="cmt">// clear</span
2369
2397
  No second, empty row is rendered underneath it.
2370
2398
  </p>
2371
2399
 
2400
+ <h3 id="banded-header-grouping">Forming banded headers at runtime (BACKLOG-0000739)</h3>
2401
+ <p class="lead-in">
2402
+ Banded headers can be declared in config (<code>columnGroups</code>) and now also formed,
2403
+ renamed, moved and dissolved at runtime through <code>grid.columns</code>, with a keyboard
2404
+ equivalent for every action. The model is the single source of truth: a band made by
2405
+ interaction is the same <code>ColumnGroup</code> tree config drives, and it round-trips through
2406
+ a saved view.
2407
+ </p>
2408
+ <div class="why">
2409
+ <p><strong>The API.</strong> <code>groupColumns(ids, { title, groupId })</code> wraps columns
2410
+ in a new band or adds them to an existing one; <code>ungroupColumn(id)</code> takes a column
2411
+ out (dissolving a band it empties); <code>renameGroup(id, title)</code>,
2412
+ <code>dissolveGroup(id)</code> and <code>moveGroup(id, to)</code> do the rest. Each emits
2413
+ <code>columngroup:changed</code>. A band's columns are always contiguous, and a nested band
2414
+ dissolves into its parent, not the root.</p>
2415
+ <p><strong>The keyboard (WCAG 2.1.1).</strong> From a focused header cell:
2416
+ <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>&larr;</kbd>/<kbd>&rarr;</kbd> groups the column with its
2417
+ neighbour on that side (joining an adjacent band, or forming a new one);
2418
+ <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>&uarr;</kbd> takes it out of its band; and
2419
+ <kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>&larr;</kbd>/<kbd>&rarr;</kbd> moves the whole band as a
2420
+ unit. Every action is announced through the live region, and a refusal — "not in a band",
2421
+ "cannot be moved there" — is announced too, never silent.</p>
2422
+ <p><strong>Pinning and visibility.</strong> A band lives in one pin region and draws over its
2423
+ visible columns there: hiding a column shrinks the band's span without changing the band
2424
+ definition, and hiding the last visible column hides the band. A band is exposed to assistive
2425
+ technology as one <code>role="columnheader"</code> cell with an <code>aria-colspan</code>.</p>
2426
+ </div>
2427
+
2372
2428
  <h2 id="row-reorder">Row reorder</h2>
2373
2429
  <p class="lead-in">
2374
2430
  <code>rowReorder: true</code> puts a drag handle in the first visible column and lets a user
@@ -6179,6 +6235,7 @@ grid.state.apply(savedView.state);
6179
6235
  <tr><td class="name">chartRange</td><td class="desc">Chart a selected cell range — the spreadsheet gesture. Derives the chart from the range’s shape (a leading text column is the categories, the numeric columns the measures), respects hidden and unreadable columns, and returns the live chart or null when there is nothing to measure.</td></tr>
6180
6236
  <tr><td class="name">canChartRange</td><td class="desc">Whether <code>chartRange</code> would draw something for the grid’s current selection — the question a menu asks before offering the item.</td></tr>
6181
6237
  <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>
6238
+ <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>
6182
6239
  <tr><td class="name">createDevtools</td><td class="desc">Mount the devtools panel against a grid, including its accessibility checks.</td></tr>
6183
6240
  <tr><td class="name">createLatticeGridElement</td><td class="desc">Build the element class without registering it, for a custom registry.</td></tr>
6184
6241
  <tr><td class="name">createMessages</td><td class="desc">Build a message catalogue. A partial set lays over the built-in British English one.</td></tr>