schummar-table 1.0.4 → 1.1.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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: schummar-table-upgrade
3
- description: Use when upgrading the schummar-table dependency from the 0.51.x line to a newer major version, or when the consumer's code hits errors/types referencing FunctionWithDeps, MemoizedTableTheme, subgrid, enableColumnReorder, configureTableTheme, initalRowHeight, throttleScroll, overscanTop, overscanBottom, useTableContext returning a store/getState()-only shape, table.useState, table.update, or TableResetContext.
3
+ description: Use when upgrading the schummar-table dependency from the 0.51.x line to a newer major version, or when the consumer's code hits errors/types referencing FunctionWithDeps, MemoizedTableTheme, subgrid, configureTableTheme, initalRowHeight, throttleScroll, overscanTop, overscanBottom, useTableContext returning a store/getState()-only shape, table.useState, table.update, or TableResetContext.
4
4
  ---
5
5
 
6
6
  # schummar-table upgrade (0.51.x -> current)
@@ -56,13 +56,13 @@ Just drop the wrapping array and the deps array — keep the function that was i
56
56
 
57
57
  `FunctionWithDeps` and `MemoizedTableTheme` types are gone — remove any imports/usages of them (needs human review if the consumer built their own helpers around these types).
58
58
 
59
- ## 3. Column reorder removed
59
+ ## 3. Column reorder
60
60
 
61
61
  Grep: `grep -rn 'enableColumnReorder\|columnOrder' src/`
62
62
 
63
- - Remove the `enableColumnReorder` prop wherever it's passed to `<Table>`.
64
- - Remove `'columnOrder'` from any `persist.include` / `persist.exclude` array.
65
- - Previously persisted column orders in storage are silently ignored now — no migration needed, but mention it to users if column order was a documented feature.
63
+ `enableColumnReorder` and the `'columnOrder'` persist key work as before; nothing to change. Column
64
+ order can now also be set with `defaultColumnOrder`, `columnOrder` and `onColumnOrderChange`, and
65
+ reordered from the column selection menu.
66
66
 
67
67
  ## 4. `subgrid` prop removed (always-on CSS subgrid)
68
68
 
@@ -147,10 +147,10 @@ After:
147
147
 
148
148
  Grep: `grep -rn 'useTableContext\|\.useState(\|\.getState(\|\.update(\|TableResetContext' src/`
149
149
 
150
- `useTableContext()` no longer returns a store. It returns a plain object (type `TableContextValue`) with fields — `props`, `displaySize`, `sort`, `selection`, `expanded`, `hiddenColumns`, `columnWidths`, `filters`, `filterValues`, `columns`, `activeColumns`, `visibleColumns`, `items`, `itemsById`, `activeItems`, `activeItemsById` — plus `actions`.
150
+ `useTableContext()` no longer returns a store. It returns a plain object (type `TableContextValue`) with fields — `props`, `displaySize`, `sort`, `selection`, `expanded`, `hiddenColumns`, `columnOrder`, `columnWidths`, `filters`, `filterValues`, `columns`, `activeColumns`, `visibleColumns`, `items`, `itemsById`, `activeItems`, `activeItemsById` — plus `actions`.
151
151
 
152
152
  - `table.useState(selector)` → destructure the field directly from `useTableContext()`.
153
- - `table.update(...)` → call the matching method on `actions`: `actions.setSort`, `actions.setSelection`, `actions.toggleSelection`, `actions.setExpanded`, `actions.toggleExpanded`, `actions.setHiddenColumns`, `actions.setColumnWidth`, `actions.setFilterValue`, `actions.clearFilters`, `actions.resetTable`.
153
+ - `table.update(...)` → call the matching method on `actions`: `actions.setSort`, `actions.setSelection`, `actions.toggleSelection`, `actions.setExpanded`, `actions.toggleExpanded`, `actions.setHiddenColumns`, `actions.setColumnOrder`, `actions.moveColumn`, `actions.setColumnWidth`, `actions.setFilterValue`, `actions.clearFilters`, `actions.resetTable`.
154
154
  - `table.getState()` → `actions.getState()` (for reading latest state inside event handlers, where a plain destructure from render would be stale).
155
155
  - `TableResetContext` → `actions.resetTable()`.
156
156
  - New `useTableActions()` hook returns just the stable `actions` object, useful when a component only needs to dispatch and shouldn't re-render on every state change.