@opencorestack/opengridx 0.1.9 → 1.0.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 (57) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/index.d.ts +60 -41
  3. package/dist/opengridx.es.js +5045 -4549
  4. package/dist/opengridx.es.js.map +1 -1
  5. package/dist/opengridx.umd.js +11 -11
  6. package/dist/opengridx.umd.js.map +1 -1
  7. package/docs/README.md +14 -0
  8. package/docs/components/aggregation-footer.md +48 -0
  9. package/docs/components/datagrid.md +3 -0
  10. package/docs/components/empty-state.md +50 -0
  11. package/docs/components/error-overlay.md +40 -0
  12. package/docs/roadmap.md +20 -1
  13. package/lib/components/Cell/Cell.tsx +9 -10
  14. package/lib/components/Cell/GridEditInputCell.tsx +4 -4
  15. package/lib/components/ColumnVisibilityPanel/ColumnVisibilityPanel.tsx +3 -2
  16. package/lib/components/DataGrid/DataGrid.regression.test.tsx +132 -0
  17. package/lib/components/DataGrid/DataGrid.tsx +336 -1018
  18. package/lib/components/DataGrid/GridAggregationFooter.tsx +68 -0
  19. package/lib/components/DataGrid/GridEmptyState.tsx +16 -0
  20. package/lib/components/DataGrid/GridErrorOverlay.tsx +33 -0
  21. package/lib/components/DataGrid/GridListView.tsx +116 -0
  22. package/lib/components/DataGrid/GridPinnedRows.tsx +98 -0
  23. package/lib/components/DataGrid/GridStandaloneColumnPanel.tsx +124 -0
  24. package/lib/components/DataGrid/GridVirtualRows.tsx +202 -0
  25. package/lib/components/FilterPanel/FilterPanel.tsx +18 -10
  26. package/lib/components/Header/ColumnMenu.tsx +2 -2
  27. package/lib/components/Header/Header.tsx +4 -4
  28. package/lib/components/ListView/ListViewRow.tsx +2 -2
  29. package/lib/components/Row/Row.tsx +10 -10
  30. package/lib/components/SkeletonRow/SkeletonRow.tsx +9 -2
  31. package/lib/components/Toolbar/GridToolbar.tsx +6 -0
  32. package/lib/hooks/core/useDataGrid.regression.test.ts +66 -0
  33. package/lib/hooks/core/useDataGrid.ts +14 -34
  34. package/lib/hooks/core/useGridColumns.tsx +228 -0
  35. package/lib/hooks/core/useGridControlledState.ts +192 -0
  36. package/lib/hooks/core/useGridRowPipeline.ts +109 -0
  37. package/lib/hooks/core/useGridScrollSync.ts +52 -0
  38. package/lib/hooks/core/useGridStateSnapshot.ts +63 -0
  39. package/lib/hooks/core/useGridVirtualization.ts +186 -0
  40. package/lib/hooks/core/useGridVisibleRows.ts +66 -0
  41. package/lib/hooks/core/useLayout.ts +0 -6
  42. package/lib/hooks/features/useAggregation.ts +7 -7
  43. package/lib/hooks/features/useGridDataSource.ts +1 -1
  44. package/lib/hooks/features/useGridEditing.ts +31 -32
  45. package/lib/hooks/features/usePivot.test.ts +202 -0
  46. package/lib/hooks/features/usePivot.ts +0 -0
  47. package/lib/hooks/useColumnReorder.ts +1 -1
  48. package/lib/hooks/useRowGrouping.ts +14 -14
  49. package/lib/hooks/useTreeData.ts +1 -1
  50. package/lib/state/types.ts +1 -1
  51. package/lib/state/useGridStateStorage.ts +1 -1
  52. package/lib/types/index.ts +48 -32
  53. package/lib/utils/export/exportToExcelAdvanced.ts +14 -14
  54. package/lib/utils/export/index.ts +22 -17
  55. package/lib/utils/filtering/index.ts +20 -20
  56. package/lib/utils/sorting/index.ts +1 -1
  57. package/package.json +1 -1
@@ -2,36 +2,36 @@
2
2
  import type { GridRowModel, GridFilterItem, GridFilterModel, GridFilterGroup } from '../../types';
3
3
 
4
4
  export const FILTER_OPERATORS = {
5
- contains: (value: any, filterValue: any): boolean => {
5
+ contains: (value: unknown, filterValue: unknown): boolean => {
6
6
  if (value == null || filterValue == null) return false;
7
7
  return String(value).toLowerCase().includes(String(filterValue).toLowerCase());
8
8
  },
9
9
 
10
- equals: (value: any, filterValue: any): boolean => {
10
+ equals: (value: unknown, filterValue: unknown): boolean => {
11
11
  if (value == null && filterValue == null) return true;
12
12
  if (value == null || filterValue == null) return false;
13
13
  return String(value).toLowerCase() === String(filterValue).toLowerCase();
14
14
  },
15
15
 
16
- startsWith: (value: any, filterValue: any): boolean => {
16
+ startsWith: (value: unknown, filterValue: unknown): boolean => {
17
17
  if (value == null || filterValue == null) return false;
18
18
  return String(value).toLowerCase().startsWith(String(filterValue).toLowerCase());
19
19
  },
20
20
 
21
- endsWith: (value: any, filterValue: any): boolean => {
21
+ endsWith: (value: unknown, filterValue: unknown): boolean => {
22
22
  if (value == null || filterValue == null) return false;
23
23
  return String(value).toLowerCase().endsWith(String(filterValue).toLowerCase());
24
24
  },
25
25
 
26
- isEmpty: (value: any): boolean => {
26
+ isEmpty: (value: unknown): boolean => {
27
27
  return value == null || String(value).trim() === '';
28
28
  },
29
29
 
30
- isNotEmpty: (value: any): boolean => {
30
+ isNotEmpty: (value: unknown): boolean => {
31
31
  return value != null && String(value).trim() !== '';
32
32
  },
33
33
 
34
- '>': (value: any, filterValue: any): boolean => {
34
+ '>': (value: unknown, filterValue: unknown): boolean => {
35
35
  if (value == null || filterValue == null) return false;
36
36
  const numValue = Number(value);
37
37
  const numFilter = Number(filterValue);
@@ -39,7 +39,7 @@ export const FILTER_OPERATORS = {
39
39
  return numValue > numFilter;
40
40
  },
41
41
 
42
- '>=': (value: any, filterValue: any): boolean => {
42
+ '>=': (value: unknown, filterValue: unknown): boolean => {
43
43
  if (value == null || filterValue == null) return false;
44
44
  const numValue = Number(value);
45
45
  const numFilter = Number(filterValue);
@@ -47,7 +47,7 @@ export const FILTER_OPERATORS = {
47
47
  return numValue >= numFilter;
48
48
  },
49
49
 
50
- '<': (value: any, filterValue: any): boolean => {
50
+ '<': (value: unknown, filterValue: unknown): boolean => {
51
51
  if (value == null || filterValue == null) return false;
52
52
  const numValue = Number(value);
53
53
  const numFilter = Number(filterValue);
@@ -55,7 +55,7 @@ export const FILTER_OPERATORS = {
55
55
  return numValue < numFilter;
56
56
  },
57
57
 
58
- '<=': (value: any, filterValue: any): boolean => {
58
+ '<=': (value: unknown, filterValue: unknown): boolean => {
59
59
  if (value == null || filterValue == null) return false;
60
60
  const numValue = Number(value);
61
61
  const numFilter = Number(filterValue);
@@ -63,7 +63,7 @@ export const FILTER_OPERATORS = {
63
63
  return numValue <= numFilter;
64
64
  },
65
65
 
66
- '!=': (value: any, filterValue: any): boolean => {
66
+ '!=': (value: unknown, filterValue: unknown): boolean => {
67
67
  if (filterValue == null || filterValue === '') return true;
68
68
  // Numeric comparison if both are numbers, otherwise string
69
69
  const numV = Number(value);
@@ -72,28 +72,28 @@ export const FILTER_OPERATORS = {
72
72
  return String(value).toLowerCase() !== String(filterValue).toLowerCase();
73
73
  },
74
74
 
75
- isAnyOf: (value: any, filterValue: any[]): boolean => {
75
+ isAnyOf: (value: unknown, filterValue: unknown[]): boolean => {
76
76
  if (value == null || !Array.isArray(filterValue)) return false;
77
- return filterValue.some(v =>
77
+ return filterValue.some(v =>
78
78
  String(value).toLowerCase() === String(v).toLowerCase()
79
79
  );
80
80
  },
81
81
 
82
- not: (value: any, filterValue: any): boolean => {
82
+ not: (value: unknown, filterValue: unknown): boolean => {
83
83
  if (value == null && filterValue == null) return false;
84
84
  if (value == null || filterValue == null) return true;
85
85
  return String(value).toLowerCase() !== String(filterValue).toLowerCase();
86
86
  },
87
87
 
88
88
  // Used by boolean and singleSelect — case-insensitive string comparison
89
- is: (value: any, filterValue: any): boolean => {
89
+ is: (value: unknown, filterValue: unknown): boolean => {
90
90
  if (filterValue == null || filterValue === '') return true;
91
91
  const rowStr = String(value).toLowerCase();
92
92
  const filterStr = String(filterValue).toLowerCase();
93
93
  return rowStr === filterStr;
94
94
  },
95
95
 
96
- '=': (value: any, filterValue: any): boolean => {
96
+ '=': (value: unknown, filterValue: unknown): boolean => {
97
97
  if (value == null || filterValue == null || filterValue === '') return false;
98
98
  return Number(value) === Number(filterValue);
99
99
  },
@@ -119,7 +119,7 @@ export function applyFilterItem<R extends GridRowModel>(
119
119
  }
120
120
 
121
121
  // Apply the operator
122
- return operatorFn(rowValue, value);
122
+ return (operatorFn as (a: unknown, b: unknown) => boolean)(rowValue, value);
123
123
  }
124
124
 
125
125
  /**
@@ -155,9 +155,9 @@ export function isRowMatchingFilter<R extends GridRowModel>(
155
155
  ): boolean {
156
156
  // Normalize input: GridFilterModel matches GridFilterGroup shape largely, but let's be safe
157
157
 
158
- const items = (filterModel as any).items || [];
159
- const logicOperator = (filterModel as any).logicOperator || 'and';
160
- const quickFilterValues = (filterModel as any).quickFilterValues || [];
158
+ const items = filterModel.items ?? [];
159
+ const logicOperator = filterModel.logicOperator ?? 'and';
160
+ const quickFilterValues = ('quickFilterValues' in filterModel ? filterModel.quickFilterValues : undefined) ?? [];
161
161
 
162
162
  if (quickFilterValues.length > 0 && !applyQuickFilter(row, quickFilterValues)) {
163
163
  return false;
@@ -1,7 +1,7 @@
1
1
 
2
2
  import type { GridRowModel, GridSortItem } from '../../types';
3
3
 
4
- export function compareValues(a: any, b: any, direction: 'asc' | 'desc'): number {
4
+ export function compareValues(a: unknown, b: unknown, direction: 'asc' | 'desc'): number {
5
5
 
6
6
  if (a == null && b == null) return 0;
7
7
  if (a == null) return direction === 'asc' ? 1 : -1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencorestack/opengridx",
3
- "version": "0.1.9",
3
+ "version": "1.0.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",