@opencorestack/opengridx 2.0.3 → 2.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +54 -3
  2. package/dist/index.d.ts +50 -2
  3. package/dist/opengridx.css +1 -1
  4. package/dist/opengridx.es.js +3805 -3692
  5. package/dist/opengridx.es.js.map +1 -1
  6. package/dist/opengridx.umd.js +16 -16
  7. package/dist/opengridx.umd.js.map +1 -1
  8. package/docs/API_REFERENCE.md +14 -4
  9. package/docs/components/column-visibility.md +40 -16
  10. package/docs/components/datagrid.md +1 -0
  11. package/docs/customization/slots-api.md +18 -6
  12. package/docs/features/export-guide.md +22 -3
  13. package/docs/features/sorting-pagination.md +2 -0
  14. package/docs/features/tree-data-grouping.md +8 -1
  15. package/docs/features/virtualization.md +66 -17
  16. package/docs/roadmap.md +13 -7
  17. package/lib/components/Cell/Cell.tsx +1 -0
  18. package/lib/components/DataGrid/DataGrid.css +7 -0
  19. package/lib/components/DataGrid/DataGrid.defects.test.tsx +103 -0
  20. package/lib/components/DataGrid/DataGrid.tsx +45 -11
  21. package/lib/components/DataGrid/DataGrid.virtualization.browser.test.tsx +183 -0
  22. package/lib/components/DataGrid/GridEmptyState.tsx +7 -1
  23. package/lib/components/DataGrid/GridListView.tsx +3 -0
  24. package/lib/components/DataGrid/GridPinnedRows.tsx +3 -0
  25. package/lib/components/DataGrid/GridVirtualRows.tsx +8 -1
  26. package/lib/components/ListView/ListViewRow.tsx +3 -0
  27. package/lib/components/Row/Row.tsx +10 -0
  28. package/lib/hooks/core/useGridColumns.tsx +8 -3
  29. package/lib/hooks/core/useGridDevWarnings.ts +42 -0
  30. package/lib/hooks/core/useGridKeyboardNavigation.ts +12 -14
  31. package/lib/hooks/core/useGridScrollSync.ts +62 -15
  32. package/lib/hooks/core/useGridVirtualization.ts +4 -1
  33. package/lib/hooks/core/useGridVisibleRows.ts +3 -2
  34. package/lib/hooks/features/useAggregation.ts +3 -38
  35. package/lib/hooks/useRowGrouping.test.ts +162 -1
  36. package/lib/hooks/useRowGrouping.ts +42 -59
  37. package/lib/hooks/useTreeData.test.ts +83 -0
  38. package/lib/hooks/useTreeData.ts +44 -43
  39. package/lib/index.ts +2 -0
  40. package/lib/types/index.ts +22 -2
  41. package/lib/utils/aggregation/aggregation.test.ts +16 -0
  42. package/lib/utils/aggregation/index.ts +62 -0
  43. package/lib/utils/export/exportToExcelAdvanced.test.ts +109 -0
  44. package/lib/utils/export/exportToExcelAdvanced.ts +89 -5
  45. package/lib/utils/scroll/index.ts +28 -0
  46. package/llms.txt +22 -13
  47. package/package.json +7 -3
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # OpenGridX — AI Agent Context
2
2
  # Package: @opencorestack/opengridx
3
- # Version: 2.0.3
3
+ # Version: 2.1.0
4
4
  # Docs: https://opencorestack.github.io/OpenGridX/
5
5
  # This file is machine-readable. AI developers: start here.
6
6
 
@@ -67,8 +67,11 @@ export default function App() {
67
67
  ### Display
68
68
  | Prop | Type | Default | Description |
69
69
  |-------------------|-----------|---------|----------------------------------------|
70
- | height | number | 500 | Grid height in pixels |
70
+ | height | number/string | — | Grid height. The grid must have a BOUNDED height or it renders every row (see GOTCHAS) |
71
71
  | autoHeight | boolean | false | Fit height to rows |
72
+ | overscanRowCount | number | 3 | Minimum rows rendered outside the viewport (adaptive) |
73
+ | ariaLabel | string | — | Accessible name for the grid |
74
+ | localeText | GridLocaleText | — | Override pagination / no-rows strings |
72
75
  | rowHeight | number | 52 | Row height in pixels |
73
76
  | headerHeight | number | 56 | Header height in pixels |
74
77
  | loading | boolean | false | Show skeleton loading overlay |
@@ -79,6 +82,8 @@ export default function App() {
79
82
  | Prop | Type | Description |
80
83
  |----------------------------|-------------------------------|-------------------------------------|
81
84
  | checkboxSelection | boolean | Enable checkbox column |
85
+ | disableMultipleRowSelection | boolean | Cap selection to one row |
86
+ | pinCheckboxColumn | boolean (default true) | Pin the checkbox column left |
82
87
  | rowSelectionModel | GridRowId[] | Controlled selection |
83
88
  | onRowSelectionModelChange | (model: GridRowId[]) => void | Selection change callback |
84
89
  | disableRowSelectionOnClick | boolean | Prevent click toggling selection |
@@ -87,9 +92,9 @@ export default function App() {
87
92
  | Prop | Type | Description |
88
93
  |-------------------|-----------------------------|----------------------------------|
89
94
  | sortModel | GridSortItem[] | Controlled sort state |
95
+ | multiSort | boolean | Plain click appends to sortModel (Shift+click always does) |
90
96
  | onSortModelChange | (model: GridSortItem[]) => void | Sort change callback |
91
97
  | sortingMode | 'client' / 'server' | Where sorting is applied |
92
- | disableColumnSorting | boolean | Disable sorting for all columns |
93
98
 
94
99
  ### Filtering
95
100
  | Prop | Type | Description |
@@ -97,7 +102,6 @@ export default function App() {
97
102
  | filterModel | GridFilterModel | Controlled filter state |
98
103
  | onFilterModelChange | (model: GridFilterModel) => void | Filter change callback |
99
104
  | filterMode | 'client' / 'server' | Where filtering is applied |
100
- | disableColumnFilter | boolean | Disable filter for all columns |
101
105
 
102
106
  ### Pagination
103
107
  | Prop | Type | Description |
@@ -119,7 +123,6 @@ export default function App() {
119
123
  | columnOrder | string[] | Controlled column order |
120
124
  | onColumnOrderChange | (params) => void | Column reorder callback |
121
125
  | disableColumnReorder | boolean | Disable drag-to-reorder |
122
- | disableColumnResize | boolean | Disable resize handles |
123
126
  | columnGroupingModel | GridColumnGroupingModel | Multi-level column header groups |
124
127
 
125
128
  ### Row Features
@@ -129,8 +132,6 @@ export default function App() {
129
132
  | rowReordering | boolean | Enable drag-and-drop row reordering |
130
133
  | onRowOrderChange | (params) => void | Row reorder callback |
131
134
  | getRowId | (row: R) => GridRowId | Custom row ID accessor (default: row.id) |
132
- | getRowClassName | (params) => string | Dynamic CSS class per row |
133
- | getRowHeight | (params) => number | Dynamic row height |
134
135
 
135
136
  ### Cell Editing
136
137
  | Prop | Type | Description |
@@ -143,15 +144,18 @@ export default function App() {
143
144
  | Prop | Type | Description |
144
145
  |-------------------------|----------------------------|-----------------------------------------|
145
146
  | getDetailPanelContent | (params) => ReactNode | Render expanded detail row |
147
+ | pinExpandColumn | boolean (default true) | Pin the detail-panel expand column |
146
148
  | getDetailPanelHeight | (params) => number / 'auto'| Height of detail panel |
147
- | expandedRowIds | Set<GridRowId> | Controlled expanded rows |
149
+ | detailPanelExpandedRowIds | Set<GridRowId> | Controlled expanded rows |
148
150
  | onDetailPanelExpandedRowIdsChange | (ids) => void | Expand/collapse callback |
149
151
 
150
152
  ### Grouping & Aggregation
151
153
  | Prop | Type | Description |
152
154
  |------------------------|---------------------------|------------------------------------------|
153
- | rowGroupingModel | string[] | Fields to group by |
155
+ | rowGroupingModel | string[] | Fields to group by (one nesting level per field). Disables pagination |
154
156
  | aggregationModel | GridAggregationModel | {field: 'sum'/'avg'/'min'/'max'/'count'} |
157
+ | onAggregationModelChange | (model) => void | Aggregation model changed |
158
+ | groupingColDef | Partial<GridColDef> | Dedicated pinned __group__ column |
155
159
  | getAggregationPosition | (group) => 'footer'/'inline' | Where to render aggregation row |
156
160
  | defaultGroupingExpansionDepth | number | Auto-expand depth (default -1 = all) |
157
161
 
@@ -179,8 +183,8 @@ export default function App() {
179
183
  |--------------|-----------------------|------------------------------------------|
180
184
  | slots | GridSlots | Replace toolbar, pagination, overlays |
181
185
  | slotProps | GridSlotProps | Props for slot components |
182
- | theme | GridTheme | Override theme tokens |
183
- | sx | React.CSSProperties | Inline styles on the root element |
186
+ | className | string | Extra CSS class on the root element |
187
+ | style | React.CSSProperties | Inline styles on the root element (use DataGridThemeProvider for theming) |
184
188
 
185
189
  ### Callbacks
186
190
  | Prop | Type | Description |
@@ -473,8 +477,9 @@ interface GridColumnPinning { left?: string[]; right?: string[]; }
473
477
  interface GridRowPinning { top?: GridRowId[]; bottom?: GridRowId[]; }
474
478
 
475
479
  interface GridRenderCellParams<R = GridRowModel> {
476
- value: any; row: R; field: string;
480
+ value: unknown; formattedValue?: string; row: R; field: string;
477
481
  colDef: GridColDef<R>; rowIndex: number; colIndex: number;
482
+ rowMeta?: GridRowMeta; // hierarchy info for tree-data / grouping rows
478
483
  }
479
484
 
480
485
  interface GridDataSource {
@@ -501,4 +506,8 @@ interface GridGetRowsResponse { rows: GridRowModel[]; rowCount: number; }
501
506
  7. **`singleSelect` editing**: for dropdown editors in cells, set `type: 'singleSelect'` and provide `valueOptions`.
502
507
  8. **`initialState.columns.columnWidths`**: accepts `Record<string, number>` to restore saved column widths.
503
508
  9. **`pinnedColumns`** and **`columnWidths`** are independent state — pinning does not reset widths.
504
- 10. **Aggregation** requires `rowGroupingModel` OR a global footer via `getAggregationPosition={() => 'footer'}`.
509
+ 10. **Aggregation**: setting `aggregationModel` alone renders a sticky footer with the totals; with `rowGroupingModel` each group row also shows its own aggregates. `null`/`undefined` values are ignored by every function.
510
+ 11. **GOTCHAS — bounded height**: virtualization only works if the grid's container has a bounded height. A flex child without `min-height: 0` grows to fit every row, so every row is rendered. Pagination hides this, and row grouping turns pagination off. Use `<div style={{ flex: 1, minHeight: 0 }}>` around `height="100%"`, or pass a fixed pixel `height`. Dev builds log a warning when this happens.
511
+ 12. **Pagination is ignored under row grouping** — a grouped grid is one scrollable, virtualized list.
512
+ 13. **`valueFormatter` + `renderCell`**: `renderCell` receives `params.formattedValue` (v2.1+), so a custom renderer can reuse the formatter instead of duplicating it.
513
+ 14. **`slots.footer`** replaces the pagination area and receives `aggregationResult`, `rowCount`, `paginationModel`, `onPaginationModelChange` and `apiRef` (v2.1+).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencorestack/opengridx",
3
- "version": "2.0.3",
3
+ "version": "2.1.0",
4
4
  "description": "OpenGridX: High-performance React data infrastructure. Unlock advanced Row Grouping, Excel Export, and Column Pinning without the usual \"Pro\" gatekeeping. Built for speed, scale, and complete architectural freedom. Fully open, virtualization-ready, and feature-complete.",
5
5
  "type": "module",
6
6
  "main": "./dist/opengridx.umd.js",
@@ -41,8 +41,10 @@
41
41
  "build:lib": "tsc --project tsconfig.build.json && vite build --config vite.config.lib.js && cp lib/styles/opengridx.css.d.ts dist/opengridx.css.d.ts",
42
42
  "lint": "eslint .",
43
43
  "preview": "vite preview",
44
- "test": "vitest run",
45
- "test:watch": "vitest",
44
+ "test": "vitest run --project unit",
45
+ "test:browser": "vitest run --project browser",
46
+ "test:all": "vitest run",
47
+ "test:watch": "vitest --project unit",
46
48
  "coverage": "vitest run --coverage",
47
49
  "prepublishOnly": "npm run build:lib"
48
50
  },
@@ -103,6 +105,7 @@
103
105
  "@types/react": "^19.2.5",
104
106
  "@types/react-dom": "^19.2.3",
105
107
  "@vitejs/plugin-react": "^5.1.1",
108
+ "@vitest/browser-playwright": "^4.0.18",
106
109
  "@vitest/coverage-v8": "^4.0.18",
107
110
  "eslint": "^9.39.1",
108
111
  "eslint-plugin-react-hooks": "^7.0.1",
@@ -111,6 +114,7 @@
111
114
  "jsdom": "^29.1.1",
112
115
  "jspdf": "^4.2.1",
113
116
  "jspdf-autotable": "^5.0.8",
117
+ "playwright": "^1.58.2",
114
118
  "react": "^19.2.0",
115
119
  "react-dom": "^19.2.0",
116
120
  "react-router-dom": "^7.13.1",