@alaarab/ogrid-mcp 2.4.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 (52) hide show
  1. package/README.md +68 -0
  2. package/bundled-docs/api/README.md +94 -0
  3. package/bundled-docs/api/column-def.mdx +379 -0
  4. package/bundled-docs/api/components-column-chooser.mdx +310 -0
  5. package/bundled-docs/api/components-column-header-filter.mdx +363 -0
  6. package/bundled-docs/api/components-datagrid-table.mdx +316 -0
  7. package/bundled-docs/api/components-pagination-controls.mdx +344 -0
  8. package/bundled-docs/api/components-sidebar.mdx +427 -0
  9. package/bundled-docs/api/components-status-bar.mdx +309 -0
  10. package/bundled-docs/api/grid-api.mdx +299 -0
  11. package/bundled-docs/api/js-api.mdx +198 -0
  12. package/bundled-docs/api/ogrid-props.mdx +244 -0
  13. package/bundled-docs/api/types.mdx +640 -0
  14. package/bundled-docs/features/cell-references.mdx +225 -0
  15. package/bundled-docs/features/column-chooser.mdx +279 -0
  16. package/bundled-docs/features/column-groups.mdx +290 -0
  17. package/bundled-docs/features/column-pinning.mdx +282 -0
  18. package/bundled-docs/features/column-reordering.mdx +359 -0
  19. package/bundled-docs/features/column-types.mdx +181 -0
  20. package/bundled-docs/features/context-menu.mdx +216 -0
  21. package/bundled-docs/features/csv-export.mdx +227 -0
  22. package/bundled-docs/features/editing.mdx +377 -0
  23. package/bundled-docs/features/filtering.mdx +330 -0
  24. package/bundled-docs/features/formulas.mdx +381 -0
  25. package/bundled-docs/features/grid-api.mdx +311 -0
  26. package/bundled-docs/features/keyboard-navigation.mdx +236 -0
  27. package/bundled-docs/features/pagination.mdx +245 -0
  28. package/bundled-docs/features/performance.mdx +433 -0
  29. package/bundled-docs/features/row-selection.mdx +256 -0
  30. package/bundled-docs/features/server-side-data.mdx +291 -0
  31. package/bundled-docs/features/sidebar.mdx +234 -0
  32. package/bundled-docs/features/sorting.mdx +241 -0
  33. package/bundled-docs/features/spreadsheet-selection.mdx +201 -0
  34. package/bundled-docs/features/status-bar.mdx +205 -0
  35. package/bundled-docs/features/toolbar.mdx +284 -0
  36. package/bundled-docs/features/virtual-scrolling.mdx +624 -0
  37. package/bundled-docs/getting-started/installation.mdx +216 -0
  38. package/bundled-docs/getting-started/overview.mdx +151 -0
  39. package/bundled-docs/getting-started/quick-start.mdx +425 -0
  40. package/bundled-docs/getting-started/vanilla-js.mdx +191 -0
  41. package/bundled-docs/guides/accessibility.mdx +550 -0
  42. package/bundled-docs/guides/controlled-vs-uncontrolled.mdx +153 -0
  43. package/bundled-docs/guides/custom-cell-editors.mdx +201 -0
  44. package/bundled-docs/guides/framework-showcase.mdx +200 -0
  45. package/bundled-docs/guides/mcp-live-testing.mdx +291 -0
  46. package/bundled-docs/guides/mcp.mdx +172 -0
  47. package/bundled-docs/guides/migration-from-ag-grid.mdx +223 -0
  48. package/bundled-docs/guides/theming.mdx +211 -0
  49. package/dist/esm/bridge-client.d.ts +87 -0
  50. package/dist/esm/bridge-client.js +162 -0
  51. package/dist/esm/index.js +1060 -0
  52. package/package.json +43 -0
@@ -0,0 +1,216 @@
1
+ ---
2
+ sidebar_position: 2
3
+ title: Installation
4
+ description: Install OGrid for your framework
5
+ ---
6
+
7
+ # Installation
8
+
9
+ OGrid ships as separate packages for each UI framework. Pick the one that matches your project's design system.
10
+
11
+ ## React
12
+
13
+ Choose one React UI package based on your design system:
14
+
15
+ ### Radix UI (Recommended)
16
+
17
+ **Lightest option.** Radix UI primitives are bundled as regular dependencies -- no peer deps beyond React.
18
+
19
+ ```bash
20
+ npm install @alaarab/ogrid-react-radix
21
+ ```
22
+
23
+ **When to choose:** New projects, or when you want minimal bundle size and no design system lock-in.
24
+
25
+ ### Fluent UI
26
+
27
+ **Microsoft's design system.** Requires Fluent UI v9 as a peer dependency.
28
+
29
+ ```bash
30
+ npm install @alaarab/ogrid-react-fluent @fluentui/react-components
31
+ ```
32
+
33
+ **When to choose:** SharePoint Framework (SPFx) apps, Microsoft 365 integrations, or projects already using Fluent UI.
34
+
35
+ ### Material UI
36
+
37
+ **Google's Material Design.** Requires MUI v7 and Emotion as peer dependencies.
38
+
39
+ ```bash
40
+ npm install @alaarab/ogrid-react-material @mui/material @emotion/react @emotion/styled
41
+ ```
42
+
43
+ **When to choose:** Projects using Material Design, or when you need MUI's extensive component ecosystem.
44
+
45
+ ---
46
+
47
+ ## Angular
48
+
49
+ Choose one Angular UI package based on your design system:
50
+
51
+ ### Radix (Angular CDK)
52
+
53
+ **Lightest option.** Uses Angular CDK for overlays -- no heavy UI framework dependencies.
54
+
55
+ ```bash
56
+ npm install @alaarab/ogrid-angular-radix @angular/cdk
57
+ ```
58
+
59
+ **When to choose:** New Angular projects, or when you want minimal bundle size and no design system lock-in.
60
+
61
+ ### Angular Material
62
+
63
+ **Official Material Design for Angular.** Requires Angular v21, Angular Material, and CDK as peer dependencies.
64
+
65
+ ```bash
66
+ npm install @alaarab/ogrid-angular-material @angular/material @angular/cdk
67
+ ```
68
+
69
+ **When to choose:** Projects already using Angular Material, or when you need Material Design components.
70
+
71
+ ### PrimeNG
72
+
73
+ **PrimeNG component library.** Requires Angular v21 and PrimeNG as peer dependencies.
74
+
75
+ ```bash
76
+ npm install @alaarab/ogrid-angular-primeng primeng
77
+ ```
78
+
79
+ **When to choose:** Projects already using PrimeNG, or when you prefer PrimeNG's component set.
80
+
81
+ ---
82
+
83
+ ## Vue
84
+
85
+ Choose one Vue UI package based on your design system:
86
+
87
+ ### Radix (Headless UI)
88
+
89
+ **Lightest option.** Headless UI Vue components are bundled as regular dependencies -- no peer deps beyond Vue.
90
+
91
+ ```bash
92
+ npm install @alaarab/ogrid-vue-radix
93
+ ```
94
+
95
+ **When to choose:** New Vue projects, or when you want minimal bundle size and no design system lock-in.
96
+
97
+ ### Vuetify
98
+
99
+ **Material Design for Vue.** Requires Vue 3 and Vuetify as peer dependencies.
100
+
101
+ ```bash
102
+ npm install @alaarab/ogrid-vue-vuetify vuetify
103
+ ```
104
+
105
+ **When to choose:** Projects already using Vuetify, or when you need Material Design components.
106
+
107
+ ### PrimeVue
108
+
109
+ **PrimeVue component library.** Requires Vue 3 and PrimeVue as peer dependencies.
110
+
111
+ ```bash
112
+ npm install @alaarab/ogrid-vue-primevue primevue
113
+ ```
114
+
115
+ **When to choose:** Projects already using PrimeVue, or when you prefer PrimeVue's component set.
116
+
117
+ ---
118
+
119
+ ## Vanilla JS (No Framework)
120
+
121
+ **Framework-free data grid.** Class-based API with EventEmitter state management. Zero framework dependencies.
122
+
123
+ ```bash
124
+ npm install @alaarab/ogrid-js
125
+ ```
126
+
127
+ **When to choose:** Projects without React/Angular/Vue, legacy codebases, or when you want full control over rendering.
128
+
129
+ :::tip Theme CSS
130
+ The JS package ships a default theme with light and dark mode support:
131
+
132
+ ```js
133
+ ```
134
+
135
+ Or link it directly in HTML:
136
+
137
+ ```html
138
+ <link rel="stylesheet" href="node_modules/@alaarab/ogrid-js/dist/styles/ogrid.css" />
139
+ ```
140
+
141
+ You can override any `--ogrid-*` CSS variable to customize colors, or skip the default theme entirely and write your own CSS targeting the `ogrid-*` class names.
142
+ :::
143
+
144
+ ## Core Only
145
+
146
+ If you want to build your own framework adapter on top of OGrid's types and utilities, install the core package directly.
147
+
148
+ ```bash
149
+ npm install @alaarab/ogrid-core
150
+ ```
151
+
152
+ :::info
153
+ You typically do not need to install `@alaarab/ogrid-core` separately. All React UI packages re-export everything from `@alaarab/ogrid-react` (which re-exports from core), so types like `IColumnDef`, `IOGridApi`, and hooks like `useUndoRedo` are available directly from your chosen UI package.
154
+ :::
155
+
156
+ ## Requirements
157
+
158
+ | Framework | Version |
159
+ |---|---|
160
+ | React | 17, 18, or 19 |
161
+ | Angular | 21 |
162
+ | Vue | 3.3+ |
163
+ | TypeScript | 5.x recommended (not required) |
164
+ | Node.js | >= 18 (for development/build tooling) |
165
+
166
+ ## Verifying the Installation
167
+
168
+ After installing, confirm everything is working by rendering a minimal grid.
169
+
170
+ **React:**
171
+ ```tsx
172
+
173
+ type Row = { id: number; name: string };
174
+ const columns: IColumnDef<Row>[] = [{ columnId: 'name', name: 'Name' }];
175
+
176
+ function App() {
177
+ return <OGrid<Row> columns={columns} data={[{ id: 1, name: 'Test' }]} getRowId={(row) => row.id} />;
178
+ }
179
+ ```
180
+
181
+ **Angular:**
182
+ ```typescript
183
+
184
+ @Component({
185
+ standalone: true,
186
+ imports: [OGridComponent],
187
+ template: `<ogrid [props]="gridProps" />`
188
+ })
189
+ export class AppComponent {
190
+ gridProps = {
191
+ columns: [{ columnId: 'name', name: 'Name' }] as IColumnDef[],
192
+ data: [{ id: 1, name: 'Test' }],
193
+ getRowId: (row: any) => row.id,
194
+ };
195
+ }
196
+ ```
197
+
198
+ **Vue:**
199
+ ```vue
200
+ <script setup lang="ts">
201
+
202
+ const columns: IColumnDef[] = [{ columnId: 'name', name: 'Name' }];
203
+ const data = [{ id: 1, name: 'Test' }];
204
+ const getRowId = (row: any) => row.id;
205
+ </script>
206
+
207
+ <template>
208
+ <OGrid :gridProps="{ columns, data, getRowId }" />
209
+ </template>
210
+ ```
211
+
212
+ If the grid renders with a single row showing "Test", your installation is correct.
213
+
214
+ ## Next Steps
215
+
216
+ - [Quick Start](./quick-start) -- build a grid with your chosen framework
@@ -0,0 +1,151 @@
1
+ ---
2
+ sidebar_position: 1
3
+ title: Overview
4
+ description: What is OGrid and why use it
5
+ ---
6
+
7
+ # Overview
8
+
9
+ OGrid is a lightweight, open-source data grid library that delivers spreadsheet-grade features without the enterprise paywall. It ships with React, Angular, and Vue adapters -- each with multiple UI library implementations -- plus a vanilla JS package, all powered by a shared TypeScript core.
10
+
11
+ ## Why OGrid?
12
+
13
+ Most production-grade React data grids fall into one of two camps: free but limited, or feature-rich but locked behind expensive licenses. OGrid bridges that gap.
14
+
15
+ - **Free and MIT-licensed.** Every feature is included. No enterprise tier, no feature gating.
16
+ - **25+ built-in features.** Sorting, filtering, pagination, cell editing, clipboard, undo/redo, fill handle, row selection, cell range selection, column pinning, column groups, CSV export, context menu, keyboard navigation, cell references, virtual scrolling, status bar, sidebar, and more.
17
+ - **Multiple frameworks.** React, Angular, and Vue adapters with UI library choices for each -- switch later with zero logic changes.
18
+ - **TypeScript-first.** Full strict-mode TypeScript with exported types for every prop, event, and API method.
19
+ - **Lightweight.** The Radix package has no heavy framework dependency. Fluent and Material packages use their respective component libraries as peer dependencies.
20
+
21
+ ## Architecture
22
+
23
+ OGrid is built on a **3-layer architecture**: a pure TypeScript core, framework adapter layers (React hooks, Angular services, Vue composables), and thin UI shells. No duplicated logic, no drift.
24
+
25
+
26
+ <ArchitectureDiagram />
27
+
28
+ ### Core Layer — `@alaarab/ogrid-core`
29
+
30
+ Pure TypeScript with zero dependencies. Provides the type system (`IOGridProps`, `IColumnDef`, `IOGridApi`, `FilterValue`, etc.) and shared algorithms (`getCellValue`, `buildHeaderRows`, `parseValue`, `normalizeSelectionRange`, etc.) used by both the React and JS packages.
31
+
32
+ ### Framework Adapter Layers
33
+
34
+ Each framework adapter translates Core's algorithms into idiomatic framework patterns — React hooks, Angular services with signals, or Vue composables with refs.
35
+
36
+ **React** — `@alaarab/ogrid-react`
37
+
38
+ | Domain | Hooks |
39
+ |---|---|
40
+ | **Orchestration** | `useOGrid` · `useDataGridState` |
41
+ | **Cell Editing** | `useCellEditing` · `useInlineCellEditorState` · `useRichSelectState` |
42
+ | **Selection** | `useCellSelection` · `useRowSelection` · `useActiveCell` |
43
+ | **Navigation** | `useKeyboardNavigation` (arrow keys, Tab, Enter, Ctrl+Arrow) |
44
+ | **Clipboard** | `useClipboard` · `useFillHandle` · `useUndoRedo` |
45
+ | **Layout** | `useColumnResize` · `useSideBarState` · `useColumnChooserState` |
46
+ | **Filtering** | `useColumnHeaderFilterState` · `useFilterOptions` |
47
+
48
+ **Angular** — `@alaarab/ogrid-angular`
49
+
50
+ Angular v21 services using signals (`signal()`, `computed()`, `effect()`). Standalone components with inline templates. Zone-less by default.
51
+
52
+ | Service | Equivalent |
53
+ |---|---|
54
+ | `OGridService` | `useOGrid` — pagination, sorting, filtering, visibility, editing |
55
+ | `DataGridStateService` | `useDataGridState` — layout, selection, editing, interaction |
56
+
57
+ **Vue** — `@alaarab/ogrid-vue`
58
+
59
+ Vue 3 Composition API composables using `ref()`, `computed()`, `watch()`.
60
+
61
+ | Composable | Equivalent |
62
+ |---|---|
63
+ | `useOGrid` | Pagination, sorting, filtering, column visibility |
64
+ | `useDataGridState` | Layout, cell selection, editing, clipboard, keyboard nav |
65
+ | 20+ feature composables | `useCellEditing`, `useCellSelection`, `useClipboard`, etc. |
66
+
67
+ ### UI Layer — Pick Your Framework
68
+
69
+ Each UI package is a thin shell (~1,500 lines) that calls the same core logic and renders into native components:
70
+
71
+ | Package | Built on | Best for |
72
+ |---|---|---|
73
+ | `@alaarab/ogrid-react-radix` | Radix primitives | Lightweight apps, custom design systems |
74
+ | `@alaarab/ogrid-react-fluent` | Fluent UI v9 | Microsoft 365, SharePoint, Teams apps |
75
+ | `@alaarab/ogrid-react-material` | MUI v7 | Material Design apps, dashboards |
76
+ | `@alaarab/ogrid-angular-radix` | Angular CDK | Lightweight Angular apps, custom design systems |
77
+ | `@alaarab/ogrid-angular-material` | Angular Material v21 | Angular + Material Design |
78
+ | `@alaarab/ogrid-angular-primeng` | PrimeNG v21 | Angular + PrimeNG ecosystem |
79
+ | `@alaarab/ogrid-vue-radix` | Radix primitives (Vue) | Lightweight Vue apps, custom design systems |
80
+ | `@alaarab/ogrid-vue-vuetify` | Vuetify 3 | Vue + Material Design |
81
+ | `@alaarab/ogrid-vue-primevue` | PrimeVue 4 | Vue + PrimeVue ecosystem |
82
+
83
+ All packages within a framework export the same `OGrid` component with the same props. Switching UI libraries is a one-line import change — your column definitions, event handlers, data sources, and API calls stay identical.
84
+
85
+ ### Why This Matters
86
+
87
+ - **Write once, render anywhere.** A bug fix or feature in core lands across all frameworks instantly.
88
+ - **Zero lock-in.** Migrate between React, Angular, and Vue without rewriting business logic.
89
+ - **Guaranteed parity.** Shared core ensures all packages behave identically.
90
+ - **Small surface area.** No duplicated state logic to drift out of sync.
91
+
92
+ ## Packages
93
+
94
+ | Package | npm | Description |
95
+ |---|---|---|
96
+ | `@alaarab/ogrid-core` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-core)](https://npmjs.com/package/@alaarab/ogrid-core) | Pure TS types, algorithms, utilities (zero deps) |
97
+ | **React** | | |
98
+ | `@alaarab/ogrid-react` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-react)](https://npmjs.com/package/@alaarab/ogrid-react) | React hooks, headless components, utilities |
99
+ | `@alaarab/ogrid-react-radix` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-react-radix)](https://npmjs.com/package/@alaarab/ogrid-react-radix) | Radix UI implementation (default, lightweight) |
100
+ | `@alaarab/ogrid-react-fluent` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-react-fluent)](https://npmjs.com/package/@alaarab/ogrid-react-fluent) | Fluent UI v9 implementation |
101
+ | `@alaarab/ogrid-react-material` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-react-material)](https://npmjs.com/package/@alaarab/ogrid-react-material) | Material UI v7 implementation |
102
+ | **Angular** | | |
103
+ | `@alaarab/ogrid-angular` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-angular)](https://npmjs.com/package/@alaarab/ogrid-angular) | Angular v21 services with signals |
104
+ | `@alaarab/ogrid-angular-radix` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-angular-radix)](https://npmjs.com/package/@alaarab/ogrid-angular-radix) | Angular CDK implementation (lightweight) |
105
+ | `@alaarab/ogrid-angular-material` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-angular-material)](https://npmjs.com/package/@alaarab/ogrid-angular-material) | Angular Material v21 implementation |
106
+ | `@alaarab/ogrid-angular-primeng` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-angular-primeng)](https://npmjs.com/package/@alaarab/ogrid-angular-primeng) | PrimeNG v21 implementation |
107
+ | **Vue** | | |
108
+ | `@alaarab/ogrid-vue` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-vue)](https://npmjs.com/package/@alaarab/ogrid-vue) | Vue 3 composables with Composition API |
109
+ | `@alaarab/ogrid-vue-radix` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-vue-radix)](https://npmjs.com/package/@alaarab/ogrid-vue-radix) | Radix Vue implementation (lightweight) |
110
+ | `@alaarab/ogrid-vue-vuetify` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-vue-vuetify)](https://npmjs.com/package/@alaarab/ogrid-vue-vuetify) | Vuetify 3 implementation |
111
+ | `@alaarab/ogrid-vue-primevue` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-vue-primevue)](https://npmjs.com/package/@alaarab/ogrid-vue-primevue) | PrimeVue 4 implementation |
112
+ | **Other** | | |
113
+ | `@alaarab/ogrid-js` | [![npm](https://img.shields.io/npm/v/@alaarab/ogrid-js)](https://npmjs.com/package/@alaarab/ogrid-js) | Vanilla JS data grid (no framework) |
114
+
115
+ ## Feature Highlights
116
+
117
+ | Feature | Description |
118
+ |---|---|
119
+ | Sorting | Single-column sort with ascending/descending toggle |
120
+ | Filtering | Text, multi-select, and people filters per column |
121
+ | Pagination | Client-side or server-side with configurable page sizes |
122
+ | Cell Editing | Inline text, select, checkbox, and rich select editors |
123
+ | Cell Selection | Spreadsheet-style range selection with drag support |
124
+ | Clipboard | Copy/paste with multi-cell support (Ctrl+C / Ctrl+V) |
125
+ | Fill Handle | Drag to fill cells (like Excel) |
126
+ | Undo/Redo | Full undo/redo stack for cell edits |
127
+ | Row Selection | Single or multiple row selection with checkbox column |
128
+ | Column Pinning | Pin columns to left or right edge |
129
+ | Column Groups | Multi-row grouped column headers |
130
+ | Column Chooser | Show/hide columns with a dropdown |
131
+ | Context Menu | Right-click menu with copy, paste, undo, and export |
132
+ | CSV Export | One-click export to CSV |
133
+ | Keyboard Navigation | Arrow keys, Tab, Enter, Page Down/Up, Ctrl+Home/End |
134
+ | Cell References | Excel-style column letters (A, B, C...), row numbers, name box |
135
+ | Status Bar | Row count, filtered count, selected count, and aggregations |
136
+ | Sidebar | Column visibility and filter panels in a collapsible sidebar |
137
+ | Server-Side Data | `IDataSource` interface for server-side pagination and filtering |
138
+ | Grid API | Imperative `IOGridApi` ref for programmatic control |
139
+ | Column Resize | Drag column borders to resize |
140
+ | Virtual Scrolling | Row and column virtualization for 10K+ row datasets |
141
+ | Web Worker Sort | Background-thread sorting for 50K+ rows |
142
+ | Theming | Inherits your framework's theme automatically |
143
+
144
+ ## Coming from AG Grid?
145
+
146
+ OGrid is designed as a drop-in replacement for AG Grid with a simpler, more React-idiomatic API. If you are migrating from AG Grid, see the [Migration Guide](../guides/migration-from-ag-grid).
147
+
148
+ ## Next Steps
149
+
150
+ - [Installation](./installation) -- install OGrid for your framework
151
+ - [Quick Start](./quick-start) -- build a grid with React, Angular, or Vue