hazo_ui 6.16.0 → 6.19.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.
package/CHANGE_LOG.md CHANGED
@@ -5,6 +5,96 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## v6.19.0 (2026-10-23)
9
+
10
+ ### Added — TrendSummary + computeTrendStats
11
+
12
+ - **`TrendSummary`** — reusable trend widget: rolling-window stat cards (All
13
+ time, 7d, 30d, 3mo, 6mo, YTD) with % change deltas vs the prior equal period,
14
+ plus an interactive YTD monthly bar chart with axes, gridlines, and hover
15
+ tooltips. Pure inline SVG (no chart library). Data-driven via props — pair with
16
+ `computeTrendStats` to produce the data from any timestamped record list.
17
+ Configurable labels (`chartTitle`, `chartTooltipSuffix`, `totalLabel`,
18
+ `prevTemplate`).
19
+ - **`computeTrendStats(items, now?, options?)`** — pure, dependency-free helper
20
+ that computes rolling-window counts + % change + YTD monthly series from a
21
+ list of `{ created_at }` records. Also available from `hazo_ui/utils` for
22
+ Server Component usage.
23
+
24
+ ## v6.18.0 (2026-10-19)
25
+
26
+ ### Changed — widened `hazo_i18n` peer range
27
+
28
+ - **`hazo_i18n` peer range widened to `^0.9.0 || ^0.15.0` (was `^0.9.0`).** This package
29
+ never imports `hazo_i18n` directly — only via `hazo_core/i18n`'s stable `registerCatalog()`
30
+ probe — so there is no real compatibility change. npm's caret on a `0.x` version only
31
+ matches that exact minor line (`^0.9.0` excludes `0.15.x`), so both lines must be listed
32
+ explicitly for a consumer installing `hazo_i18n` 0.15.x (e.g. Kinstripe's
33
+ dependency-hygiene cleanup) to see a valid peer.
34
+
35
+ ### Added — EditableDataTable (paste, Enter-down navigation, header styling)
36
+
37
+ - **Paste support** — pasting TSV (`\t`-separated) or CSV (`,`-separated)
38
+ clipboard text into a text/number cell now expands across the editable
39
+ columns to the right of the pasted-into cell and down into as many rows
40
+ as the clipboard text has lines, creating new rows via `createRow()`
41
+ when the paste runs past the end of the current `rows` array. Only
42
+ targets `editable !== false` text/number columns — select/color
43
+ columns are left untouched by a paste that starts on or crosses one of
44
+ them, same restriction already in place for the Tab traversal. A
45
+ single-cell paste (no tab/comma/newline) is left to the browser's
46
+ native paste-into-input behavior, unchanged from before.
47
+ - **Enter moves focus down one row** — Enter still commits the current
48
+ cell (unchanged), and now also moves the active-edit target one row
49
+ down in the *same* column (spreadsheet-style), reusing the existing
50
+ `activeEditCell`/`forceEdit` cross-row focus mechanism that Tab already
51
+ relies on. On the last row there's no next row to move into; Enter just
52
+ commits in place, same as before this feature existed.
53
+ - **Clearer column headers** — the header `<TableRow>` now gets a
54
+ `bg-muted/60` background and a 2px bottom border, and each `<TableHead>`
55
+ label is bold, uppercase, and tracked (`font-semibold uppercase
56
+ tracking-wide text-[11px]`), so the header reads as a distinct visual
57
+ tier instead of blending into the first data row. No layout/API change.
58
+ - Tab/Shift+Tab navigation, inline-edit, add-row, delete-row, and
59
+ drag-reorder are all unaffected — existing tests extended, none
60
+ weakened. One pre-existing render-isolation test (100+ rows, "only the
61
+ edited row re-renders") was updated to also expect the Enter-down
62
+ target row (the row directly below the edited one) to re-render,
63
+ since forcing that row into edit mode is the whole point of the new
64
+ feature.
65
+
66
+ ## v6.17.0 (2026-10-18)
67
+
68
+ ### Added — EditableDataTable
69
+
70
+ - **`EditableDataTable`** — inline-editable data grid for small datasets.
71
+ Click-to-edit cells (text, number, select, color), add/delete rows, row
72
+ drag-reorder via @dnd-kit. Built on shadcn Table primitives. Separate from
73
+ `HazoUiTable` (read-only display with sort/filter/pagination). See README
74
+ for comparison.
75
+ - Test-app demo page at `/editable-table`.
76
+
77
+ ### Fixed — EditableDataTable (final-review fixes)
78
+
79
+ - **Tab navigation sent focus to `document.body` in any table mixing
80
+ text/number columns with select/color columns.** The cross-row Tab
81
+ traversal (`activeEditCell`/`forceEdit`/`onTabOut`) included `select`/
82
+ `color` columns as possible targets, but `EditableCell`'s `forceEdit`
83
+ mechanism only does anything observable for `text`/`number` cells — for
84
+ `select`/`color` it was a no-op, so the computed target could never
85
+ actually receive focus and focus fell through to `document.body`
86
+ instead of reaching the next row. `select`/`color` columns are now
87
+ excluded from this traversal entirely (same as the delete/add buttons
88
+ already were); they remain reachable via native Tab/click, unchanged.
89
+ Affects every consumer whose columns mix types — e.g. hazo_canvas's
90
+ Sankey/Dagre/Network node tables (which end in a color column) and
91
+ Sankey's link table (two select columns before its number column).
92
+ - **Editing one cell in a 100+ row table re-rendered every row.**
93
+ `SortableRow` is now wrapped in `React.memo`, and row rendering is
94
+ restructured into a new, module-scope `React.memo`'d row component with
95
+ stable, ref-backed callbacks — so editing one row no longer forces every
96
+ other row's cells to re-render. No API change.
97
+
8
98
  ## v6.16.0 (2026-10-15)
9
99
 
10
100
  ### Added — Tailwind v3 preset + responsive AppHeader
package/README.md CHANGED
@@ -3932,6 +3932,19 @@ display states automatically: loading skeleton, empty state, and populated list.
3932
3932
 
3933
3933
  ---
3934
3934
 
3935
+ ## Table Components
3936
+
3937
+ hazo_ui ships two table components for different use cases:
3938
+
3939
+ | Component | Purpose | Editing | Pagination | Server-side data |
3940
+ |-----------|---------|---------|------------|-----------------|
3941
+ | `HazoUiTable` | Read-only data display | No | Yes | Yes (`onLoad`) |
3942
+ | `EditableDataTable` | Inline data editing | Click-to-edit cells, add/delete/reorder rows, Tab/Shift+Tab + Enter navigation, TSV/CSV paste | No | No |
3943
+
3944
+ **Use `HazoUiTable`** for dashboards, admin lists, and any table where users browse but don't modify data in-place.
3945
+
3946
+ **Use `EditableDataTable`** for forms, configuration panels, and data editors where users need to create, modify, and reorder small datasets (typically <100 rows) with immediate feedback.
3947
+
3935
3948
  ## HazoUiTable — Column-config-driven Data Table (v2.14.0+, v2.15 additions)
3936
3949
 
3937
3950
  A higher-level data table that composes the shadcn `Table` primitive