@opencorestack/opengridx 0.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.
- package/CHANGELOG.md +99 -0
- package/LICENSE +21 -0
- package/README.md +213 -0
- package/dist/exceljs.min-CrbHmMCD.js +22597 -0
- package/dist/exceljs.min-CrbHmMCD.js.map +1 -0
- package/dist/index.d.ts +1217 -0
- package/dist/opengridx.css +1 -0
- package/dist/opengridx.es.js +6104 -0
- package/dist/opengridx.es.js.map +1 -0
- package/dist/opengridx.umd.js +81 -0
- package/dist/opengridx.umd.js.map +1 -0
- package/package.json +110 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# OpenGridX β Changelog
|
|
2
|
+
|
|
3
|
+
**Package**: `@opencorestack/opengridx`
|
|
4
|
+
**License**: MIT Β© 2026 Open Core Stack
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## [0.1.0] β March 6, 2026 π
|
|
9
|
+
|
|
10
|
+
> **Status: β
RELEASE READY β 100% feature-complete for v0.1.0 scope**
|
|
11
|
+
|
|
12
|
+
This is the initial public release of OpenGridX. All planned v0.1.0 features are implemented, tested, and included in the production bundle.
|
|
13
|
+
|
|
14
|
+
### β
Core Features
|
|
15
|
+
- **High-Performance Virtualization** β Custom row + column virtual scrolling engine, 60fps at 100k+ rows
|
|
16
|
+
- **Multi-Column Sorting** β Client-side and server-side; stable multi-field sort
|
|
17
|
+
- **Advanced Filtering** β 11+ operators (contains, equals, startsWith, etc.) with AND/OR filter builder UI
|
|
18
|
+
- **Pagination** β Client-side and server-side modes with configurable page sizes
|
|
19
|
+
- **Row Selection** β Single and multi-row checkbox selection with `rowSelectionModel` controlled/uncontrolled API
|
|
20
|
+
|
|
21
|
+
### β
Advanced UI & Layout
|
|
22
|
+
- **Column Pinning** β Left and right sticky columns with correct z-index layering
|
|
23
|
+
- **Row Pinning** β Top and bottom pinned rows with visual separation
|
|
24
|
+
- **Column Resizing** β Throttled drag-to-resize at 60fps with minimum width enforcement
|
|
25
|
+
- **Column Reordering** β Drag-and-drop column reorder
|
|
26
|
+
- **Row Reordering** β Drag-and-drop row reorder with `onRowOrderChange` callback
|
|
27
|
+
- **Detail Panels** β Expandable master-detail rows via `getDetailPanelContent`
|
|
28
|
+
- **Cell & Row Spanning** β `colSpan` and `rowSpan` support for merged-cell layouts
|
|
29
|
+
- **List View Mode** β Card-based responsive layout via `listView` / `listViewColumn`
|
|
30
|
+
- **Column Grouping** β Multi-level column header groups via `columnGroupingModel`
|
|
31
|
+
- **Toolbar** β Built-in toolbar with column visibility, filter, and density controls; fully replaceable via `slots`
|
|
32
|
+
|
|
33
|
+
### β
Data Management
|
|
34
|
+
- **Inline Cell Editing** β Double-click or Enter to edit; `editable` per column; `processRowUpdate` callback
|
|
35
|
+
- **Tree Data** β Client-side hierarchical rows via `treeData` + `getTreeDataPath`
|
|
36
|
+
- **Row Grouping** β Group rows by column value with collapsible groups and aggregation summaries
|
|
37
|
+
- **Aggregation** β SUM, AVG, COUNT, MIN, MAX in group footers and global sticky footer
|
|
38
|
+
- **Pivot Mode** β Multidimensional data pivoting via `pivotMode` + `pivotModel`
|
|
39
|
+
|
|
40
|
+
### β
Server-Side Integration
|
|
41
|
+
- **Data Source API** β `useGridDataSource` hook for unified server-side fetching
|
|
42
|
+
- **Server-Side Sorting, Filtering & Pagination** β All offloaded cleanly to the backend
|
|
43
|
+
- **Infinite Scroll** β Viewport-triggered batch-loading (`paginationMode="infinite"`)
|
|
44
|
+
- **Server-Side Tree Data** β Lazy children loading via `dataSource.getChildren`
|
|
45
|
+
- **Server-Side Aggregation** β Fetch summary totals directly from API responses
|
|
46
|
+
|
|
47
|
+
### β
Export
|
|
48
|
+
- **CSV Export** β `exportToCsv()` utility, respects `valueFormatter`
|
|
49
|
+
- **Excel Export** β Basic `.xlsx` via `exportToExcel()`; advanced pixel-perfect image-embedded export via `exportToExcelAdvanced()` (lazy-loads ExcelJS)
|
|
50
|
+
- **JSON Export** β `exportToJson()`
|
|
51
|
+
- **Print** β `printGrid()` with print-optimised CSS
|
|
52
|
+
|
|
53
|
+
### β
Clipboard
|
|
54
|
+
- **Keyboard Copy** β `Ctrl+C` / `Cmd+C` copies selected rows as TSV (tab-separated values)
|
|
55
|
+
- **Programmatic Copy** β `apiRef.current.copySelectedRows()` for button-triggered copying
|
|
56
|
+
- **Excel/Sheets Compatible** β TSV output pastes cleanly into any spreadsheet app
|
|
57
|
+
- **Smart Focus Handling** β Does not intercept `Ctrl+C` in text inputs; correctly handles checkbox-focused grid cells
|
|
58
|
+
|
|
59
|
+
### β
Theming
|
|
60
|
+
- **`DataGridThemeProvider`** β React context-based global theming
|
|
61
|
+
- **5 Built-in Themes** β `darkTheme`, `roseTheme`, `emeraldTheme`, `amberTheme`, `compactTheme`
|
|
62
|
+
- **CSS Variables** β Full `--ogx-*` token system; Shadow DOM compatible
|
|
63
|
+
- **`cellClassName` / `headerClassName`** β Per-column custom class injection
|
|
64
|
+
|
|
65
|
+
### β
Accessibility (WCAG 2.1 AA)
|
|
66
|
+
- Semantic ARIA roles: `grid`, `row`, `gridcell`, `columnheader`
|
|
67
|
+
- `aria-sort`, `aria-selected`, `aria-expanded`, `aria-readonly`, `aria-label` throughout
|
|
68
|
+
- Full keyboard navigation: Arrow keys, Tab, Enter, Escape, Home/End, PageUp/PageDown
|
|
69
|
+
- Visible focus ring in keyboard mode (CSS classname-toggled, zero React state overhead)
|
|
70
|
+
|
|
71
|
+
### β
State Persistence
|
|
72
|
+
- **`initialState` prop** β Restore column widths, visibility, sort, and filter on mount
|
|
73
|
+
- **`useGridStateStorage(key)` hook** β Auto-saves to `localStorage`; pluggable storage backend
|
|
74
|
+
|
|
75
|
+
### β
Developer Experience
|
|
76
|
+
- **`apiRef`** β Full imperative API: `getSelectedRows`, `copySelectedRows`, `selectRow`, `sortColumn`, `setFilterModel`, `getVisibleRows`, `scrollToIndexes`, and more
|
|
77
|
+
- **`slots` System** β Replace Toolbar, Pagination, NoRowsOverlay, LoadingOverlay, Footer
|
|
78
|
+
- **`slotProps`** β Pass custom props to slot components
|
|
79
|
+
- **TypeScript** β 100% typed; full `index.d.ts` output via `vite-plugin-dts`
|
|
80
|
+
- **Zero UI Dependencies** β No Ant Design, MUI, or Radix. Pure React + vanilla CSS (BEM)
|
|
81
|
+
|
|
82
|
+
### π¦ Bundle
|
|
83
|
+
| Artifact | Minified | Gzipped |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| `opengridx.es.js` (ES Module) | 226 KB | **52 KB** |
|
|
86
|
+
| `opengridx.umd.js` (UMD) | 1,089 KB | 315 KB |
|
|
87
|
+
| `opengridx.css` | 59 KB | **10 KB** |
|
|
88
|
+
| `exceljs` (lazy, Excel export only) | 1,385 KB | 302 KB |
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## πΊοΈ Planned for v0.2.0
|
|
93
|
+
|
|
94
|
+
- **Rich Excel Styling** β Bold headers, background fill, border styles natively via ExcelJS (no post-processing)
|
|
95
|
+
- **Cell Range Clipboard** β Select a rectangular cell region (mouse drag), copy to clipboard, paste from Excel back into editable cells
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
*Last Updated: March 6, 2026*
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Open Core Stack
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# OpenGridX | The Free Enterprise React DataGrid
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
**OpenGridX** is a premium, high-performance React DataGrid engine designed to break the "Pay-to-Play" model in the React ecosystem. It provides a pure-custom, zero-dependency alternative to enterprise grids like **MUI X DataGrid Pro** and **AG Grid**, offering advanced features for free.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## π Why OpenGridX?
|
|
10
|
+
Most React grids gatekeep essential features like **Row Grouping**, **Excel Export**, and **Master-Detail** behind expensive annual licenses. OpenGridX provides these premium capabilities out-of-the-box, with full source-code control and no external UI dependencies.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## π Live Demo & Documentation
|
|
15
|
+
Explore the interactive showcase and full API documentation online:
|
|
16
|
+
π **[opencorestack.github.io/OpenGridX](https://opencorestack.github.io/OpenGridX/)**
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## π Key Features
|
|
21
|
+
|
|
22
|
+
- **High-Performance Virtualization**: Custom-built engine handling 100,000+ rows and columns at 60fps.
|
|
23
|
+
- **Advanced Layouts**: Native support for **Row & Column Spanning**, Grouping, and Tree Data.
|
|
24
|
+
- **Premium UX**: Built-in glassmorphism, smooth micro-animations, and responsive headers.
|
|
25
|
+
- **Data Orchestration**: 11+ filter operators, multi-column sorting, and robust pagination.
|
|
26
|
+
- **Zero UI Dependencies**: 100% vanilla CSS (BEM) and pure React/TypeScript logic.
|
|
27
|
+
- **Skeleton Loader**: Built-in animated loading states with smart column detection.
|
|
28
|
+
- **Fully Customizable**: Slots system for replacing any component (pagination, overlays, toolbar).
|
|
29
|
+
- **Export Functionality**: Built-in CSV, Excel, JSON, and Print export (zero dependencies).
|
|
30
|
+
|
|
31
|
+
## π¨ Customization & Extensibility
|
|
32
|
+
|
|
33
|
+
### Slots System
|
|
34
|
+
|
|
35
|
+
Replace any built-in component with your own custom implementation:
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { Select } from 'antd'; // or any UI library
|
|
39
|
+
|
|
40
|
+
<DataGrid
|
|
41
|
+
rows={rows}
|
|
42
|
+
columns={columns}
|
|
43
|
+
slots={{
|
|
44
|
+
toolbar: CustomToolbar,
|
|
45
|
+
pagination: CustomPaginationComponent,
|
|
46
|
+
noRowsOverlay: CustomEmptyState,
|
|
47
|
+
loadingOverlay: CustomLoader,
|
|
48
|
+
footer: CustomFooter
|
|
49
|
+
}}
|
|
50
|
+
slotProps={{
|
|
51
|
+
toolbar: { /* custom props */ },
|
|
52
|
+
pagination: { /* custom props */ }
|
|
53
|
+
}}
|
|
54
|
+
/>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Use Case Examples:**
|
|
58
|
+
- Custom toolbars with export buttons, filters, actions
|
|
59
|
+
- Replace pagination with Ant Design, MUI, or custom components
|
|
60
|
+
- Custom loading states and empty states
|
|
61
|
+
- Brand-specific footers and overlays
|
|
62
|
+
|
|
63
|
+
π **[Full Customization Guide](docs/customization/slots-api.md)**
|
|
64
|
+
|
|
65
|
+
### Export Functionality
|
|
66
|
+
|
|
67
|
+
OpenGridX has **two tiers of Excel export** β basic built-in (zero dependencies) and advanced rich export (optional ExcelJS).
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import {
|
|
71
|
+
exportToCsv,
|
|
72
|
+
exportToExcel, // β
built-in, zero deps
|
|
73
|
+
exportToExcelAdvanced, // β
rich .xlsx β requires: npm install exceljs
|
|
74
|
+
exportToJson,
|
|
75
|
+
printGrid
|
|
76
|
+
} from '@opencorestack/opengridx';
|
|
77
|
+
|
|
78
|
+
// CSV β zero dependencies
|
|
79
|
+
exportToCsv(rows, columns, { fileName: 'data.csv' });
|
|
80
|
+
|
|
81
|
+
// Basic Excel β zero dependencies
|
|
82
|
+
// Generates an HTML-based .xlsx that opens perfectly in Excel/Sheets
|
|
83
|
+
exportToExcel(rows, columns, { fileName: 'data.xlsx' });
|
|
84
|
+
|
|
85
|
+
// Advanced Excel β requires ExcelJS (npm install exceljs)
|
|
86
|
+
// Real binary .xlsx with: styled headers, image embedding,
|
|
87
|
+
// multi-sheet, aggregation rows, frozen headers, auto-filter
|
|
88
|
+
exportToExcelAdvanced(rows, columns, {
|
|
89
|
+
fileName: 'data.xlsx',
|
|
90
|
+
columnStyles: {
|
|
91
|
+
avatar: { embedImage: true, imageWidth: 40, imageHeight: 40 }
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// JSON β zero dependencies
|
|
96
|
+
exportToJson(rows, columns, { fileName: 'data.json' });
|
|
97
|
+
|
|
98
|
+
// Print β zero dependencies
|
|
99
|
+
printGrid(rows, columns, 'Report Title');
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
> **Optional peer dependency:** `exportToExcelAdvanced` requires ExcelJS for rich `.xlsx` generation. Install it only when needed:
|
|
103
|
+
> ```bash
|
|
104
|
+
> npm install exceljs
|
|
105
|
+
> ```
|
|
106
|
+
> All other export functions (`exportToExcel`, `exportToCsv`, `exportToJson`, `printGrid`) work with **zero extra dependencies**.
|
|
107
|
+
|
|
108
|
+
### Skeleton Loader
|
|
109
|
+
|
|
110
|
+
Built-in animated skeleton rows during data loading:
|
|
111
|
+
- Automatically adapts to column definitions
|
|
112
|
+
- Dynamically calculates placeholder columns based on viewport width
|
|
113
|
+
- Smooth shimmer animation for professional UX
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
<DataGrid
|
|
117
|
+
rows={rows}
|
|
118
|
+
columns={columns}
|
|
119
|
+
loading={isLoading} // Shows skeleton automatically
|
|
120
|
+
/>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## β‘ Performance & Bundle Size
|
|
124
|
+
|
|
125
|
+
OpenGridX is built for speed and efficiency. The core library is lightweight, with heavier features loaded on-demand.
|
|
126
|
+
|
|
127
|
+
| Component | Minified Size | Gzipped (Transfer) | Status |
|
|
128
|
+
| :--- | :--- | :--- | :--- |
|
|
129
|
+
| **Core Library** (`opengridx.es.js`) | **220 KB** | **51 KB** | β
Highly Optimized |
|
|
130
|
+
| **Excel Extension** (`exceljs.min...js`) | **1.38 MB** | **301 KB** | β
Progressively Loaded |
|
|
131
|
+
| **Styles** (`opengridx.css`) | **58 KB** | **9 KB** | β
Lean & Themeable |
|
|
132
|
+
|
|
133
|
+
### Optimization Highlights:
|
|
134
|
+
- **Progressive Loading**: Heavy dependencies like `ExcelJS` are only fetched when the advanced export feature is triggered via `exportToExcelAdvanced`.
|
|
135
|
+
- **Tree-shaking Ready**: Built as an ES Module to ensure your bundler (Vite, Webpack, etc.) only includes what you use.
|
|
136
|
+
- **Zero UI Dependencies**: No bulky third-party component libraries. Just pure React and optimized CSS.
|
|
137
|
+
- **Efficient Rendering**: Uses custom virtualization and optimized CSS classes to handle 100k+ rows with zero lag.
|
|
138
|
+
|
|
139
|
+
## π Project Structure
|
|
140
|
+
|
|
141
|
+
- `lib/`: Core library source.
|
|
142
|
+
- `demo/`: Interactive showcase and feature testing dashboard.
|
|
143
|
+
- `docs/`: Technical research, catalogs, and architectural analysis.
|
|
144
|
+
- `.agent/`: Master project context and automation workflows.
|
|
145
|
+
|
|
146
|
+
## π οΈ Getting Started
|
|
147
|
+
|
|
148
|
+
### Installation
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npm install @opencorestack/opengridx
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
// Styles are automatically included β no separate CSS import needed
|
|
156
|
+
import { DataGrid } from '@opencorestack/opengridx';
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
> **Note:** Styles are bundled inside the component. If you need to import them manually (e.g., for SSR or CSS-in-JS setups):
|
|
160
|
+
> ```tsx
|
|
161
|
+
> import '@opencorestack/opengridx/styles';
|
|
162
|
+
> ```
|
|
163
|
+
|
|
164
|
+
## π Documentation
|
|
165
|
+
|
|
166
|
+
Detailed documentation is available in the [docs/](docs/README.md) directory.
|
|
167
|
+
|
|
168
|
+
### ποΈ Components API
|
|
169
|
+
- **[DataGrid](docs/components/datagrid.md)** - Main component props and slots
|
|
170
|
+
- **[Header](docs/components/header.md)** - Column headers and grouping
|
|
171
|
+
- **[Row & Cell](docs/components/row.md)** - Row and Cell customization
|
|
172
|
+
- **[Toolbar & Pagination](docs/components/toolbar.md)** - Supplemental UI components
|
|
173
|
+
|
|
174
|
+
### π Core Features
|
|
175
|
+
- **[Virtualization](docs/features/virtualization.md)** - 60fps rendering for 100k+ rows
|
|
176
|
+
- **[Filtering & Search](docs/features/filtering.md)** - Quick filters and advanced operators
|
|
177
|
+
- **[Sorting & Pagination](docs/features/sorting-pagination.md)** - Multi-column organization
|
|
178
|
+
- **[Editing & Reordering](docs/features/editing-reordering.md)** - Inline edits and Drag-and-Drop
|
|
179
|
+
- **[Loading & Performance](docs/features/loading-states.md)** - Skeletons, Lazy, and Infinite loading
|
|
180
|
+
- **[Row Selection](docs/features/selection.md)** - Checkbox and multi-row interaction
|
|
181
|
+
- **[Pinning](docs/features/pinning.md)** - Sticky columns and rows
|
|
182
|
+
- **[State Persistence](docs/features/state-persistence.md)** - Save/Restore grid configuration
|
|
183
|
+
- **[Infinite Scroll](docs/features/infinite-scroll.md)** - Seamless lazy-loading
|
|
184
|
+
|
|
185
|
+
### π Advanced Data
|
|
186
|
+
- **[Aggregation & Pivot](docs/features/aggregation-pivot.md)** - Summary totals and multidimensional data
|
|
187
|
+
- **[Tree Data & Grouping](docs/features/tree-data-grouping.md)** - Hierarchical display and Column Grouping
|
|
188
|
+
- **[Cell Spanning](docs/features/cell-spanning.md)** - Colspan and Rowspan implementation
|
|
189
|
+
- **[Master-Detail](docs/features/master-detail.md)** - Expandable Detail Panels
|
|
190
|
+
- **[List View](docs/features/list-view.md)** - Responsive card-based layout
|
|
191
|
+
- **[Export Guide](docs/features/export-guide.md)** - Excel, CSV, and Print functionality
|
|
192
|
+
- **[Data Source](docs/features/data-source.md)** - Connecting to backend APIs
|
|
193
|
+
|
|
194
|
+
### π¨ Customization
|
|
195
|
+
- **[Theming Guide](docs/customization/theming.md)** - Visual styles and CSS variables
|
|
196
|
+
- **[Slots API](docs/customization/slots-api.md)** - Component replacement system
|
|
197
|
+
- **[Custom Pagination](docs/features/custom-pagination.md)** - Custom paging UI
|
|
198
|
+
|
|
199
|
+
## π Development Status
|
|
200
|
+
|
|
201
|
+
Currently in **Phase 4: Server-Side Integration**.
|
|
202
|
+
All core UI features (Pinning, Spanning, Tree Data, Grouping, Skeleton Loading, Custom Components) are fully implemented and verified in the [demo app](demo/).
|
|
203
|
+
|
|
204
|
+
### Recent Updates
|
|
205
|
+
- β
Skeleton loader with dynamic column calculation
|
|
206
|
+
- β
Slots system for component customization
|
|
207
|
+
- β
Fixed horizontal scrolling for wide tables
|
|
208
|
+
- β
Enhanced empty states
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## π License
|
|
213
|
+
MIT Β© 2026 Open Core Stack
|