@dloizides/ui-tables 3.0.1 → 3.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ### Fixed
6
+
7
+ - `DataTable` / `StatusLedger`: a clickable row (`onRowPress`, no `keyboardNavigation`) renders as a focusable `div` with `role="group"` instead of a native `<button>`, so an Edit or Delete button in a cell is no longer a button inside a button. The row keeps its pointer cursor, hover and pressed tint, focus ring and Enter to open; Space no longer opens it (Space belongs to button roles). Pressing a button inside the row calls only that button. ROW-OPEN-1 "Every list row opens its record".
8
+
9
+ ## 3.0.1
10
+
11
+ ### Changed
12
+
13
+ - Peer and dev `@dloizides/ui-forms` raised to 1.31.0 (`DateInput`).
14
+
15
+ ### Fixed
16
+
17
+ - `Filters`: the date filter renders inside the bar `Field` (control label voice, no extra 16px rhythm), so it lines up with the other fields in the bar. FINREG-DATE-2 "Every FinReg date field uses the shared input".
18
+
19
+ ## 3.0.0
20
+
21
+ ### Breaking
22
+
23
+ - `StatusLedger` props require `onRowPress` or `rowAction={{ none: '<reason>' }}` (`DataTableRowAction`) and forward it to every inner `DataTable`; `StatusLedgerProps` is now a type alias over `StatusLedgerBaseProps`. ROW-OPEN-1 "Every list row opens its record".
24
+
25
+ ### Fixed
26
+
27
+ - `DataTable`: the brand focus ring is drawn on the focused row frame on keyboard focus (it was on the inner pressable of a selectable row).
28
+
29
+ ## 2.0.0
30
+
31
+ ### Breaking
32
+
33
+ - `DataTableProps` require `onRowPress` or `rowAction={{ none: '<reason>' }}`; a table with neither no longer type-checks. ROW-OPEN-1 "Every list row opens its record".
34
+
35
+ ### Added
36
+
37
+ - Clickable rows get a pointer cursor, a pressed brand tint and a brand focus ring; the hover tint is unchanged.
38
+
39
+ ### Changed
40
+
41
+ - The `dateRange` filter renders `DateRangeControl` from `@dloizides/ui-forms` (same testIDs); the local `DateRangeField` is gone. Peer and dev `@dloizides/ui-forms` raised to 1.30.0. FINREG-DATE-2 "Every FinReg date field uses the shared input".
42
+
3
43
  ## 1.29.1
4
44
 
5
45
  ### Changed
package/README.md CHANGED
@@ -100,6 +100,21 @@ use `@dloizides/ui-layout`'s responsive `ModalDropdown` (modal on mobile/native)
100
100
  />
101
101
  ```
102
102
 
103
+ #### Row action (required)
104
+
105
+ Every `DataTable` (and `StatusLedger`) declares what a row does: pass `onRowPress` to open the
106
+ record, or `rowAction={{ none: '<reason>' }}` when a row truly opens nothing. A table with
107
+ neither does not type-check.
108
+
109
+ ```tsx
110
+ <DataTable columns={columns} rows={rows} keyExtractor={(r) => r.id} onRowPress={(r) => open(r.id)} />
111
+ <DataTable columns={columns} rows={rows} keyExtractor={(r) => r.id} rowAction={{ none: 'read-only audit log' }} />
112
+ ```
113
+
114
+ A clickable row has a pointer cursor, hover and pressed tint, a focus ring, and opens on click
115
+ or Enter. It is a focusable `role="group"` element, not a `<button>`, so buttons in its cells
116
+ (Edit, Delete) are valid and pressing one runs only that button.
117
+
103
118
  #### Expandable rows (optional)
104
119
 
105
120
  For surfaces that open a full-width detail panel under a row (e.g. an audit log's
package/dist/index.js CHANGED
@@ -560,7 +560,8 @@ function DataTableRow({
560
560
  ...selectable ? { "aria-selected": isSelected } : null,
561
561
  // A navigable table is a real grid, so its rows are grid rows — selectable or not.
562
562
  // `role` wins over `accessibilityRole` on RNW.
563
- ...keyboardNavigation ? { role: "row" } : null
563
+ ...keyboardNavigation ? { role: "row" } : null,
564
+ ...!keyboardNavigation && onRowPress ? { role: "group" } : null
564
565
  };
565
566
  const rowNode = /* @__PURE__ */ jsxRuntime.jsx(
566
567
  TableRow,