@alaarab/ogrid-mcp 2.5.9 → 2.6.1
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/bundled-docs/api/README.md +20 -20
- package/bundled-docs/api/components-column-chooser.mdx +1 -1
- package/bundled-docs/api/components-column-header-filter.mdx +1 -1
- package/bundled-docs/api/components-datagrid-table.mdx +1 -1
- package/bundled-docs/api/components-pagination-controls.mdx +1 -1
- package/bundled-docs/api/components-sidebar.mdx +1 -1
- package/bundled-docs/api/components-status-bar.mdx +1 -1
- package/bundled-docs/api/js-api.mdx +2 -2
- package/bundled-docs/features/cell-references.mdx +9 -9
- package/bundled-docs/features/column-chooser.mdx +4 -1
- package/bundled-docs/features/column-groups.mdx +10 -3
- package/bundled-docs/features/column-pinning.mdx +7 -3
- package/bundled-docs/features/column-reordering.mdx +6 -4
- package/bundled-docs/features/column-types.mdx +1 -1
- package/bundled-docs/features/context-menu.mdx +8 -4
- package/bundled-docs/features/csv-export.mdx +7 -7
- package/bundled-docs/features/editing.mdx +21 -21
- package/bundled-docs/features/filtering.mdx +15 -15
- package/bundled-docs/features/formulas.mdx +27 -27
- package/bundled-docs/features/grid-api.mdx +2 -2
- package/bundled-docs/features/keyboard-navigation.mdx +5 -5
- package/bundled-docs/features/pagination.mdx +1 -1
- package/bundled-docs/features/row-selection.mdx +3 -2
- package/bundled-docs/getting-started/overview.mdx +7 -4
- package/bundled-docs/getting-started/quick-start.mdx +11 -11
- package/bundled-docs/getting-started/vanilla-js.mdx +26 -23
- package/bundled-docs/guides/accessibility.mdx +11 -11
- package/bundled-docs/guides/framework-showcase.mdx +18 -18
- package/bundled-docs/guides/mcp.mdx +9 -9
- package/package.json +1 -1
|
@@ -7,21 +7,21 @@ description: Excel-like formula support with 93 built-in functions, live recalcu
|
|
|
7
7
|
|
|
8
8
|
# Formulas
|
|
9
9
|
|
|
10
|
-
Type `=SUM(A1:A5)` into any editable cell and it evaluates instantly. Change a value in A1 and everything that depends on it recalculates.
|
|
10
|
+
Type `=SUM(A1:A5)` into any editable cell and it evaluates instantly. Change a value in A1 and everything that depends on it recalculates. It works like Excel, built right into your grid — no external library, no backend call, no wiring required.
|
|
11
11
|
|
|
12
|
-
The engine adds ~12KB gzipped and is completely tree-shakeable
|
|
12
|
+
The engine adds ~12KB gzipped and is completely **tree-shakeable** — grids without `formulas={true}` don't pay any cost.
|
|
13
13
|
|
|
14
14
|
## Live Demo
|
|
15
15
|
|
|
16
16
|
<FormulasDemo />
|
|
17
17
|
|
|
18
18
|
:::tip Try it in your framework
|
|
19
|
-
The demo uses Radix UI styling. The formula engine is framework-agnostic
|
|
19
|
+
The demo uses Radix UI styling. The formula engine itself is framework-agnostic — same behavior in React, Angular, Vue, and Vanilla JS.
|
|
20
20
|
:::
|
|
21
21
|
|
|
22
22
|
## Why bother with in-grid formulas?
|
|
23
23
|
|
|
24
|
-
If you've ever had users copy grid data into Excel to calculate totals
|
|
24
|
+
If you've ever had users copy grid data into Excel to calculate totals or derived fields — then paste it back — formulas solve that. Users can build their own calculations directly in the table, results stay live, and you don't have to build a calculator UI.
|
|
25
25
|
|
|
26
26
|
## Enable formulas
|
|
27
27
|
|
|
@@ -63,7 +63,7 @@ function App() {
|
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
:::tip Switching UI libraries
|
|
66
|
-
Same props across all React packages
|
|
66
|
+
Same props across all React packages — just change the import:
|
|
67
67
|
|
|
68
68
|
- **Radix** (lightweight, default): `from '@alaarab/ogrid-react-radix'`
|
|
69
69
|
- **Fluent UI** (Microsoft 365 / SPFx): `from '@alaarab/ogrid-react-fluent'` - wrap in `<FluentProvider>`
|
|
@@ -106,7 +106,7 @@ Same API across Angular packages. Change the import:
|
|
|
106
106
|
- **Angular Material**: `from '@alaarab/ogrid-angular-material'`
|
|
107
107
|
- **PrimeNG**: `from '@alaarab/ogrid-angular-primeng'`
|
|
108
108
|
|
|
109
|
-
All components are standalone
|
|
109
|
+
All components are standalone — no NgModule required.
|
|
110
110
|
:::
|
|
111
111
|
|
|
112
112
|
</TabItem>
|
|
@@ -174,7 +174,7 @@ formulaState.setFormula(2, 0, '=A1+B1', grid.getApi().getDataAccessor());
|
|
|
174
174
|
|
|
175
175
|
## Entering formulas
|
|
176
176
|
|
|
177
|
-
Type any value starting with `=` into an editable cell. The engine parses and evaluates it, then shows the result. The formula string is stored separately from your data
|
|
177
|
+
Type any value starting with `=` into an editable cell. The engine parses and evaluates it, then shows the result. The formula string is stored separately from your data — your `data[]` array is never modified by formulas.
|
|
178
178
|
|
|
179
179
|
```
|
|
180
180
|
=A1+B1 → adds two cells
|
|
@@ -185,7 +185,7 @@ Type any value starting with `=` into an editable cell. The engine parses and ev
|
|
|
185
185
|
|
|
186
186
|
## Pre-loading formulas
|
|
187
187
|
|
|
188
|
-
Use `initialFormulas` to seed formulas when the grid mounts
|
|
188
|
+
Use `initialFormulas` to seed formulas when the grid mounts — useful for reports with fixed summary rows:
|
|
189
189
|
|
|
190
190
|
```tsx
|
|
191
191
|
<OGrid
|
|
@@ -202,24 +202,24 @@ Coordinates are 0-based: `col` is the position in your flat columns array, `row`
|
|
|
202
202
|
|
|
203
203
|
## How recalculation works
|
|
204
204
|
|
|
205
|
-
The engine
|
|
205
|
+
The engine builds a dependency graph. When A1 changes, it finds every formula that references A1, then recalculates them in topological order — dependents of dependents are handled correctly. Circular references produce a `#CIRC!` error instead of an infinite loop.
|
|
206
206
|
|
|
207
207
|
## Formula-aware copy, paste, and fill
|
|
208
208
|
|
|
209
209
|
When `formulas` is enabled:
|
|
210
210
|
|
|
211
|
-
- **Copy**
|
|
212
|
-
- **Paste**
|
|
213
|
-
- **Fill handle**
|
|
211
|
+
- **Copy** — copies the formula string (`=SUM(A1:A5)`), not the computed value
|
|
212
|
+
- **Paste** — if the pasted value starts with `=`, it becomes a formula in the target cell
|
|
213
|
+
- **Fill handle** — dragging a formula cell down adjusts relative references. `=A1+B1` dragged down becomes `=A2+B2`. Lock references with `$`: `=$A$1` never adjusts.
|
|
214
214
|
|
|
215
215
|
## Cell reference syntax
|
|
216
216
|
|
|
217
217
|
| Syntax | Example | What it means |
|
|
218
218
|
|--------|---------|---------|
|
|
219
|
-
| Relative | `A1` | Column A, Row 1
|
|
219
|
+
| Relative | `A1` | Column A, Row 1 — adjusts when filled |
|
|
220
220
|
| Absolute column | `$A1` | Column A locked, row adjusts |
|
|
221
221
|
| Absolute row | `A$1` | Row 1 locked, column adjusts |
|
|
222
|
-
| Fully absolute | `$A$1` | Both locked
|
|
222
|
+
| Fully absolute | `$A$1` | Both locked — never adjusts |
|
|
223
223
|
| Range | `A1:B5` | Rectangular block from A1 to B5 |
|
|
224
224
|
| Named range | `Revenue` | Resolves to a defined cell or range |
|
|
225
225
|
| Cross-sheet | `Sheet2!A1` | Cell A1 from another sheet |
|
|
@@ -238,7 +238,7 @@ Give meaningful names to cells or ranges you reference often:
|
|
|
238
238
|
/>
|
|
239
239
|
```
|
|
240
240
|
|
|
241
|
-
Now write `=SUM(Revenue)` or `=A1*TaxRate` instead of cryptic coordinates. Named ranges are case-insensitive
|
|
241
|
+
Now write `=SUM(Revenue)` or `=A1*TaxRate` instead of cryptic coordinates. Named ranges are case-insensitive — `Revenue`, `revenue`, and `REVENUE` all resolve to the same range.
|
|
242
242
|
|
|
243
243
|
You can also manage them at runtime:
|
|
244
244
|
|
|
@@ -293,9 +293,9 @@ Reference cells from other grids by registering sheet accessors:
|
|
|
293
293
|
```
|
|
294
294
|
|
|
295
295
|
Then write:
|
|
296
|
-
- `=Sheet2!A1`
|
|
297
|
-
- `=SUM(Sheet2!A1:A10)`
|
|
298
|
-
- `='Sales Data'!B5`
|
|
296
|
+
- `=Sheet2!A1` — single cell from Sheet2
|
|
297
|
+
- `=SUM(Sheet2!A1:A10)` — range from Sheet2
|
|
298
|
+
- `='Sales Data'!B5` — quoted name for sheets with spaces
|
|
299
299
|
|
|
300
300
|
Referencing an unregistered sheet produces a `#REF!` error.
|
|
301
301
|
|
|
@@ -320,15 +320,15 @@ Formula errors display in red (controlled by `--ogrid-formula-error-color`):
|
|
|
320
320
|
|-------|---------|
|
|
321
321
|
| `#REF!` | Cell reference points outside the grid, or unregistered sheet |
|
|
322
322
|
| `#DIV/0!` | Division by zero |
|
|
323
|
-
| `#VALUE!` | Wrong argument type
|
|
324
|
-
| `#NAME?` | Unknown function name
|
|
323
|
+
| `#VALUE!` | Wrong argument type — text where a number was expected |
|
|
324
|
+
| `#NAME?` | Unknown function name — check spelling |
|
|
325
325
|
| `#CIRC!` | Circular reference detected |
|
|
326
326
|
| `#N/A` | No match found (VLOOKUP, MATCH, XLOOKUP) |
|
|
327
|
-
| `#NUM!` | Invalid numeric argument
|
|
327
|
+
| `#NUM!` | Invalid numeric argument — e.g., LARGE with k larger than the list |
|
|
328
328
|
| `#ERROR!` | General parse or eval error |
|
|
329
329
|
|
|
330
330
|
:::tip Pro tip
|
|
331
|
-
`#NAME?` is almost always a typo. Formula function names are case-insensitive
|
|
331
|
+
`#NAME?` is almost always a typo. Formula function names are case-insensitive — `sum`, `SUM`, and `Sum` all work — but `=SUMM(A1:A5)` gives `#NAME?`.
|
|
332
332
|
:::
|
|
333
333
|
|
|
334
334
|
## All 93 built-in functions
|
|
@@ -358,7 +358,7 @@ Formula errors display in red (controlled by `--ogrid-formula-error-color`):
|
|
|
358
358
|
|
|
359
359
|
| Prop | Type | Default | Description |
|
|
360
360
|
|------|------|---------|-------------|
|
|
361
|
-
| `formulas` | `boolean` | `false` | Enable formula support. Tree-shakeable
|
|
361
|
+
| `formulas` | `boolean` | `false` | Enable formula support. Tree-shakeable — zero cost when not used. |
|
|
362
362
|
| `initialFormulas` | `Array<{ col, row, formula }>` | — | Pre-load formulas on mount (0-based col/row indices). |
|
|
363
363
|
| `onFormulaRecalc` | `(result: IRecalcResult) => void` | — | Called after each recalculation with the updated cell list. |
|
|
364
364
|
| `formulaFunctions` | `Record<string, IFormulaFunction>` | — | Custom functions to register alongside built-ins. |
|
|
@@ -367,10 +367,10 @@ Formula errors display in red (controlled by `--ogrid-formula-error-color`):
|
|
|
367
367
|
|
|
368
368
|
## Next steps
|
|
369
369
|
|
|
370
|
-
- [Editing & Clipboard](./editing)
|
|
371
|
-
- [Cell References](./cell-references)
|
|
372
|
-
- [CSV Export](./csv-export)
|
|
373
|
-
- [Status Bar](./status-bar)
|
|
370
|
+
- [Editing & Clipboard](./editing) — formula-aware copy, paste, and fill handle
|
|
371
|
+
- [Cell References](./cell-references) — Excel-style column letters and the name box
|
|
372
|
+
- [CSV Export](./csv-export) — export formula strings or computed values
|
|
373
|
+
- [Status Bar](./status-bar) — live SUM/AVERAGE/COUNT on selected cells
|
|
374
374
|
|
|
375
375
|
## Community
|
|
376
376
|
|
|
@@ -172,9 +172,9 @@ async function handleRefresh() {
|
|
|
172
172
|
</TabItem>
|
|
173
173
|
</Tabs>
|
|
174
174
|
|
|
175
|
-
##
|
|
175
|
+
## How It Works
|
|
176
176
|
|
|
177
|
-
Pass a `ref` to `OGrid
|
|
177
|
+
Pass a `ref` to the `OGrid` component. The ref exposes the `IOGridApi<T>` interface with methods for programmatic grid control.
|
|
178
178
|
|
|
179
179
|
### API Methods
|
|
180
180
|
|
|
@@ -7,7 +7,7 @@ description: Full keyboard support for navigating, editing, selecting, and opera
|
|
|
7
7
|
|
|
8
8
|
# Keyboard Navigation
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
OGrid supports comprehensive keyboard navigation for moving between cells, editing values, selecting ranges, and performing clipboard and undo operations -- all without touching the mouse.
|
|
11
11
|
|
|
12
12
|
## Live Demo
|
|
13
13
|
|
|
@@ -119,7 +119,7 @@ const grid = new OGrid(document.getElementById('grid'), {
|
|
|
119
119
|
</TabItem>
|
|
120
120
|
</Tabs>
|
|
121
121
|
|
|
122
|
-
Click
|
|
122
|
+
Click any cell to make it the active cell, then use the keyboard to navigate and edit.
|
|
123
123
|
|
|
124
124
|
## Navigation
|
|
125
125
|
|
|
@@ -197,9 +197,9 @@ Copied data uses tab-separated format compatible with Excel and Google Sheets. M
|
|
|
197
197
|
|
|
198
198
|
Undo/redo requires the `onUndo`, `onRedo`, `canUndo`, and `canRedo` props to be wired up (typically via the `useUndoRedo` hook).
|
|
199
199
|
|
|
200
|
-
## How
|
|
200
|
+
## How It Works
|
|
201
201
|
|
|
202
|
-
|
|
202
|
+
Keyboard navigation is handled by the `useKeyboardNavigation` hook in core, which is automatically wired into the grid when `cellSelection` is enabled (the default). The hook listens for `keydown` events on the grid wrapper element and translates them into active cell movements, selection range changes, or editing actions.
|
|
203
203
|
|
|
204
204
|
### Disabling Cell Selection
|
|
205
205
|
|
|
@@ -233,4 +233,4 @@ On macOS, Ctrl is replaced by the Command key for all shortcuts (Cmd+C, Cmd+V, C
|
|
|
233
233
|
|
|
234
234
|
- [Context Menu](./context-menu) -- right-click menu mirrors keyboard shortcuts
|
|
235
235
|
- [Status Bar](./status-bar) -- shows aggregations for keyboard-selected ranges
|
|
236
|
-
- [Column Pinning](./column-pinning) -- navigation works across pinned and scrollable columns
|
|
236
|
+
- [Column Pinning](./column-pinning) -- navigation works seamlessly across pinned and scrollable columns
|
|
@@ -7,7 +7,7 @@ description: Built-in pagination with configurable page sizes for client-side an
|
|
|
7
7
|
|
|
8
8
|
# Pagination
|
|
9
9
|
|
|
10
|
-
OGrid includes a built-in pagination bar with page navigation buttons, page size selector, and a row count summary. It works with both client-side data arrays and server-side data sources.
|
|
10
|
+
OGrid includes a built-in pagination bar with page navigation buttons, page size selector, and a row count summary. It works seamlessly with both client-side data arrays and server-side data sources.
|
|
11
11
|
|
|
12
12
|
## Live Demo
|
|
13
13
|
|
|
@@ -149,8 +149,9 @@ const grid = new OGrid(document.getElementById('grid'), {
|
|
|
149
149
|
rowSelection: 'multiple',
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
-
grid.on('selectionChange', ({
|
|
153
|
-
console.log(`${
|
|
152
|
+
grid.on('selectionChange', ({ selectedItems, selectedRowIds }) => {
|
|
153
|
+
console.log(`${selectedItems.length} rows selected`);
|
|
154
|
+
console.log('Selected row IDs:', selectedRowIds);
|
|
154
155
|
});
|
|
155
156
|
|
|
156
157
|
// Programmatic access
|
|
@@ -6,11 +6,11 @@ description: What is OGrid and why use it
|
|
|
6
6
|
|
|
7
7
|
# Overview
|
|
8
8
|
|
|
9
|
-
OGrid is
|
|
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
10
|
|
|
11
11
|
## Why OGrid?
|
|
12
12
|
|
|
13
|
-
Most production-grade data grids
|
|
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
14
|
|
|
15
15
|
- **Free and MIT-licensed.** Every feature is included. No enterprise tier, no feature gating.
|
|
16
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.
|
|
@@ -80,11 +80,14 @@ Each UI package is a thin shell (~1,500 lines) that calls the same core logic an
|
|
|
80
80
|
| `@alaarab/ogrid-vue-vuetify` | Vuetify 3 | Vue + Material Design |
|
|
81
81
|
| `@alaarab/ogrid-vue-primevue` | PrimeVue 4 | Vue + PrimeVue ecosystem |
|
|
82
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.
|
|
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 within that framework family.
|
|
84
84
|
|
|
85
85
|
### Why This Matters
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
- **Shared core, broad portability.** A core fix often benefits every package, while wrapper-specific UI behavior is still verified and documented per package.
|
|
88
|
+
- **Zero lock-in.** Migrate between React, Angular, and Vue without rewriting business logic.
|
|
89
|
+
- **Shared core, aligned behavior.** Most behavior is implemented once in core, with package-specific docs and tests calling out the remaining differences.
|
|
90
|
+
- **Small surface area.** No duplicated state logic to drift out of sync.
|
|
88
91
|
|
|
89
92
|
## Packages
|
|
90
93
|
|
|
@@ -7,7 +7,7 @@ description: A sortable, filterable, editable data grid in under 50 lines
|
|
|
7
7
|
|
|
8
8
|
# Quick Start
|
|
9
9
|
|
|
10
|
-
Here's a grid in 60 seconds
|
|
10
|
+
Here's a grid in 60 seconds — sorting, filtering, editing, pagination, and keyboard navigation, all working out of the box.
|
|
11
11
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
@@ -213,7 +213,7 @@ All Angular packages share the same component API. Change one import:
|
|
|
213
213
|
- **Angular Material**: `from '@alaarab/ogrid-angular-material'`
|
|
214
214
|
- **PrimeNG**: `from '@alaarab/ogrid-angular-primeng'`
|
|
215
215
|
|
|
216
|
-
All components are standalone
|
|
216
|
+
All components are standalone — no NgModule required.
|
|
217
217
|
:::
|
|
218
218
|
|
|
219
219
|
</TabItem>
|
|
@@ -321,11 +321,11 @@ The JS package has a class-based imperative API. See the [Vanilla JS guide](./va
|
|
|
321
321
|
|
|
322
322
|
Paste those ~40 lines and you have:
|
|
323
323
|
|
|
324
|
-
- **Sorting**
|
|
325
|
-
- **Filtering**
|
|
326
|
-
- **Inline editing**
|
|
327
|
-
- **Currency formatting**
|
|
328
|
-
- **Pagination, keyboard nav, cell selection, status bar**
|
|
324
|
+
- **Sorting** — click any column header, ascending/descending, shift-click for multi-sort
|
|
325
|
+
- **Filtering** — the Department column gets a multi-select dropdown filter
|
|
326
|
+
- **Inline editing** — double-click any salary cell to edit in place
|
|
327
|
+
- **Currency formatting** — `valueFormatter` formats numbers on display without affecting stored values
|
|
328
|
+
- **Pagination, keyboard nav, cell selection, status bar** — all there, no extra config
|
|
329
329
|
|
|
330
330
|
## Three concepts worth knowing
|
|
331
331
|
|
|
@@ -419,7 +419,7 @@ grid.destroy();
|
|
|
419
419
|
|
|
420
420
|
## What's next?
|
|
421
421
|
|
|
422
|
-
- [Sorting](../features/sorting), [Filtering](../features/filtering), [Editing](../features/editing)
|
|
423
|
-
- [Server-Side Data](../features/server-side-data)
|
|
424
|
-
- [Grid API](../api/js-api)
|
|
425
|
-
- [Column Definitions](../api/types)
|
|
422
|
+
- [Sorting](../features/sorting), [Filtering](../features/filtering), [Editing](../features/editing) — dig into individual features
|
|
423
|
+
- [Server-Side Data](../features/server-side-data) — connect to a REST API or GraphQL endpoint
|
|
424
|
+
- [Grid API](../api/js-api) — full reference for programmatic control
|
|
425
|
+
- [Column Definitions](../api/types) — every column option explained
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
sidebar_position: 4
|
|
3
3
|
title: Vanilla JS
|
|
4
|
-
description: OGrid without a framework
|
|
4
|
+
description: OGrid without a framework — pure JavaScript, class-based API
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
# Vanilla JS
|
|
9
9
|
|
|
10
|
-
You don't need React, Angular, or Vue to use OGrid. The `@alaarab/ogrid-js` package gives you a
|
|
10
|
+
You don't need React, Angular, or Vue to use OGrid. The `@alaarab/ogrid-js` package gives you a sortable, filterable, editable data grid with the shared OGrid core through a simple class-based API — just a container element and an options object.
|
|
11
11
|
|
|
12
12
|
It's a good fit if you're working on an internal tool, a dashboard that can't take on a framework, or you're embedding a grid inside an existing non-framework app.
|
|
13
13
|
|
|
@@ -27,7 +27,7 @@ Or drop it into an HTML file directly using a CDN (no build tools needed):
|
|
|
27
27
|
|
|
28
28
|
## Build a real example
|
|
29
29
|
|
|
30
|
-
Let's make an order management dashboard. It tracks orders by status, amount, and customer
|
|
30
|
+
Let's make an order management dashboard. It tracks orders by status, amount, and customer — sortable, filterable, and editable inline.
|
|
31
31
|
|
|
32
32
|
```html
|
|
33
33
|
<div id="orders-grid" style="height: 500px;"></div>
|
|
@@ -88,15 +88,17 @@ Let's make an order management dashboard. It tracks orders by status, amount, an
|
|
|
88
88
|
|
|
89
89
|
## What you get out of the box
|
|
90
90
|
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
- **
|
|
94
|
-
- **
|
|
95
|
-
- **
|
|
96
|
-
- **
|
|
97
|
-
- **
|
|
98
|
-
- **
|
|
99
|
-
- **
|
|
91
|
+
The JS package shares the same data model and most feature concepts as the framework packages, but browser-level interaction parity is still tracked package by package.
|
|
92
|
+
|
|
93
|
+
- **Sorting** — click column headers
|
|
94
|
+
- **Filtering** — multi-select dropdown on the Status column
|
|
95
|
+
- **Inline editing** — double-click any Amount cell to edit
|
|
96
|
+
- **Cell selection** — click and drag to select ranges
|
|
97
|
+
- **Keyboard navigation** — arrow keys, Tab, Home/End, Ctrl+Arrow
|
|
98
|
+
- **Clipboard** — Ctrl+C/V/X works like a spreadsheet
|
|
99
|
+
- **Undo/redo** — Ctrl+Z/Y
|
|
100
|
+
- **Status bar** — row count and selection aggregations
|
|
101
|
+
- **Pagination** — page controls at the bottom
|
|
100
102
|
|
|
101
103
|
## Constructor
|
|
102
104
|
|
|
@@ -104,7 +106,7 @@ Let's make an order management dashboard. It tracks orders by status, amount, an
|
|
|
104
106
|
const grid = new OGrid(containerElement, options);
|
|
105
107
|
```
|
|
106
108
|
|
|
107
|
-
The container element defines where the grid renders. OGrid fills it completely
|
|
109
|
+
The container element defines where the grid renders. OGrid fills it completely — give it an explicit height (CSS or inline).
|
|
108
110
|
|
|
109
111
|
## Key options
|
|
110
112
|
|
|
@@ -134,23 +136,24 @@ grid.on('cellValueChanged', ({ item, columnId, oldValue, newValue }) => {
|
|
|
134
136
|
// save to backend
|
|
135
137
|
});
|
|
136
138
|
|
|
137
|
-
grid.on('selectionChange', ({
|
|
138
|
-
console.log(`${
|
|
139
|
-
updateActionBar(
|
|
139
|
+
grid.on('selectionChange', ({ selectedItems, selectedRowIds }) => {
|
|
140
|
+
console.log(`${selectedItems.length} rows selected`);
|
|
141
|
+
updateActionBar(selectedItems, selectedRowIds);
|
|
140
142
|
});
|
|
141
143
|
|
|
142
|
-
grid.on('sortChange', ({
|
|
143
|
-
|
|
144
|
+
grid.on('sortChange', ({ sort }) => {
|
|
145
|
+
if (!sort) return;
|
|
146
|
+
console.log(`Sorted by ${sort.field} ${sort.direction}`);
|
|
144
147
|
});
|
|
145
148
|
```
|
|
146
149
|
|
|
147
150
|
| Event | Payload | When it fires |
|
|
148
151
|
|-------|---------|---------------|
|
|
149
152
|
| `cellValueChanged` | `{ item, columnId, oldValue, newValue }` | A cell edit is committed |
|
|
150
|
-
| `sortChange` | `{
|
|
153
|
+
| `sortChange` | `{ sort }` | User changes sort |
|
|
151
154
|
| `filterChange` | `{ filters }` | User changes filters |
|
|
152
155
|
| `pageChange` | `{ page }` | User navigates pages |
|
|
153
|
-
| `selectionChange` | `{
|
|
156
|
+
| `selectionChange` | `{ selectedItems, selectedRowIds }` | Row selection changes |
|
|
154
157
|
|
|
155
158
|
## Programmatic control
|
|
156
159
|
|
|
@@ -210,6 +213,6 @@ grid.destroy();
|
|
|
210
213
|
|
|
211
214
|
## What's next?
|
|
212
215
|
|
|
213
|
-
- [JS API Reference](../api/js-api)
|
|
214
|
-
- [Features](../features/sorting)
|
|
215
|
-
- [Theming Guide](../guides/theming)
|
|
216
|
+
- [JS API Reference](../api/js-api) — full method and options reference
|
|
217
|
+
- [Features](../features/sorting) — feature guides, with JS notes where behavior differs from framework packages
|
|
218
|
+
- [Theming Guide](../guides/theming) — deep dive into CSS customization
|
|
@@ -5,21 +5,21 @@ title: Accessibility
|
|
|
5
5
|
|
|
6
6
|
# Accessibility
|
|
7
7
|
|
|
8
|
-
Good accessibility isn't just compliance
|
|
8
|
+
Good accessibility isn't just compliance — it's building software that works for everyone. A keyboard user in a tight workflow shouldn't have to reach for the mouse. A screen reader user deserves the same experience as anyone else.
|
|
9
9
|
|
|
10
|
-
OGrid is built with this in mind. Keyboard navigation, screen reader support, high contrast mode, and ARIA semantics are all baked in
|
|
10
|
+
OGrid is built with this in mind. Keyboard navigation, screen reader support, high contrast mode, and ARIA semantics are all baked in — you don't configure them, you just benefit from them.
|
|
11
11
|
|
|
12
12
|
## What's built in by default
|
|
13
13
|
|
|
14
14
|
You get all of this without any extra setup:
|
|
15
15
|
|
|
16
|
-
- Full keyboard navigation
|
|
16
|
+
- Full keyboard navigation — arrow keys, Tab, Home/End, Ctrl+Arrow, all working like a spreadsheet
|
|
17
17
|
- Screen reader announcements for sort, filter, edit, selection, and pagination changes
|
|
18
18
|
- Proper ARIA roles and attributes on the grid, rows, cells, and headers
|
|
19
19
|
- `:focus-visible` indicators so keyboard users always know where they are
|
|
20
20
|
- Focus trapping in dropdowns and popovers (Escape always gets you out)
|
|
21
21
|
- High contrast mode support via CSS custom properties with system color fallbacks
|
|
22
|
-
- Semantic HTML
|
|
22
|
+
- Semantic HTML — real `<table>`, `<thead>`, `<th>`, `<td>` elements that assistive tech understands
|
|
23
23
|
|
|
24
24
|
The one thing you do need to add: an `aria-label` on the grid. It's one prop.
|
|
25
25
|
|
|
@@ -113,7 +113,7 @@ Key attributes and what they do:
|
|
|
113
113
|
| `aria-expanded` | Open/closed state of filter dropdowns |
|
|
114
114
|
| `aria-current="page"` | Current page in pagination |
|
|
115
115
|
|
|
116
|
-
The status bar uses `role="status"` with `aria-live="polite"
|
|
116
|
+
The status bar uses `role="status"` with `aria-live="polite"` — it announces changes without interrupting what the user is doing.
|
|
117
117
|
|
|
118
118
|
## Screen reader support
|
|
119
119
|
|
|
@@ -221,22 +221,22 @@ npm install --save-dev jest-axe
|
|
|
221
221
|
|
|
222
222
|
Automated tests catch structural issues but can't cover everything. Before shipping:
|
|
223
223
|
|
|
224
|
-
- [ ] Navigate the entire grid using only the keyboard
|
|
224
|
+
- [ ] Navigate the entire grid using only the keyboard — no mouse
|
|
225
225
|
- [ ] Enable VoiceOver (`Cmd+F5`) or NVDA and navigate through sort, filter, edit
|
|
226
|
-
- [ ] Test at 200% zoom
|
|
227
|
-
- [ ] Toggle Windows High Contrast Mode
|
|
226
|
+
- [ ] Test at 200% zoom — nothing should overflow or become unusable
|
|
227
|
+
- [ ] Toggle Windows High Contrast Mode — all content should remain visible
|
|
228
228
|
- [ ] Verify `aria-label` is set on the grid (one of the most common misses)
|
|
229
229
|
|
|
230
230
|
## Known limitations
|
|
231
231
|
|
|
232
232
|
**Virtual scrolling:** When `virtualScroll.enabled` is true, only visible rows are in the DOM. Screen readers won't know the full dataset size unless you set `aria-rowcount` on the grid wrapper manually.
|
|
233
233
|
|
|
234
|
-
**Custom cell renderers:** If you use `renderCell` to render custom content inside cells, you're responsible for making that content accessible
|
|
234
|
+
**Custom cell renderers:** If you use `renderCell` to render custom content inside cells, you're responsible for making that content accessible — ARIA attributes, keyboard interaction, announcements. The grid provides the structure; your custom content needs to carry its own accessibility.
|
|
235
235
|
|
|
236
236
|
## Resources
|
|
237
237
|
|
|
238
|
-
- [ARIA Grid Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/)
|
|
238
|
+
- [ARIA Grid Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/) — the spec OGrid follows
|
|
239
239
|
- [WCAG 2.1 Quick Reference](https://www.w3.org/WAI/WCAG21/quickref/)
|
|
240
|
-
- [axe DevTools Browser Extension](https://www.deque.com/axe/devtools/)
|
|
240
|
+
- [axe DevTools Browser Extension](https://www.deque.com/axe/devtools/) — free in-browser auditing
|
|
241
241
|
|
|
242
242
|
Found an accessibility issue? [Open an issue](https://github.com/alaarab/ogrid/issues) and tag it `accessibility` with your browser, screen reader version, and reproduction steps.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
sidebar_position: 5
|
|
3
3
|
title: Framework Showcase
|
|
4
|
-
description: OGrid in React, Angular, Vue, and Vanilla JS —
|
|
4
|
+
description: OGrid in React, Angular, Vue, and Vanilla JS — shared core, native components
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
# Framework Showcase
|
|
9
9
|
|
|
10
|
-
OGrid works with your existing design system
|
|
10
|
+
OGrid works with your existing design system — not against it. React, Angular, Vue, and Vanilla JS are all fully supported, and every framework shares the same headless core so most behavior stays aligned across them.
|
|
11
11
|
|
|
12
|
-
Every grid below is live.
|
|
12
|
+
Every grid below is live. Core interactions like sorting, filtering, editing, and selection are wired up across the demos, while deeper browser parity still varies by package.
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
@@ -17,11 +17,11 @@ Every grid below is live. Sort, filter, edit, select, copy-paste, undo. It all w
|
|
|
17
17
|
|
|
18
18
|
The short version:
|
|
19
19
|
|
|
20
|
-
- **Starting from scratch?** Pick the Radix variant for your framework
|
|
21
|
-
- **Already using a design system?** Pick the matching package
|
|
20
|
+
- **Starting from scratch?** Pick the Radix variant for your framework — it's the lightest, with no peer dependencies beyond the framework itself.
|
|
21
|
+
- **Already using a design system?** Pick the matching package — Fluent, Material, Angular Material, PrimeNG, Vuetify, or PrimeVue — and the grid components will use your existing components for buttons, inputs, and popovers.
|
|
22
22
|
- **No framework?** Use `@alaarab/ogrid-js` for a full-featured grid with just a CDN import.
|
|
23
23
|
|
|
24
|
-
Switching between UI libraries later is straightforward
|
|
24
|
+
Switching between UI libraries later is straightforward — you change the import and the wrapper provider if required. The grid configuration (columns, data, event handlers) doesn't change.
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
@@ -31,7 +31,7 @@ Three design systems, all sharing the same hooks from `@alaarab/ogrid-react`. Yo
|
|
|
31
31
|
|
|
32
32
|
### Radix UI — lightweight default
|
|
33
33
|
|
|
34
|
-
The default React package. Radix primitives are bundled in
|
|
34
|
+
The default React package. Radix primitives are bundled in — no separate peer dependency to install. It's a good starting point for new projects or when you want minimal overhead.
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
npm install @alaarab/ogrid-react-radix
|
|
@@ -53,7 +53,7 @@ export default function App() {
|
|
|
53
53
|
|
|
54
54
|
<ShowcaseRadixDemo />
|
|
55
55
|
|
|
56
|
-
### Fluent UI — Microsoft
|
|
56
|
+
### Fluent UI — Microsoft ecosystem
|
|
57
57
|
|
|
58
58
|
If you're building for Microsoft Teams, SharePoint, or any Microsoft 365 integration, Fluent is your pick. The grid uses native Fluent components for headers, filters, and inputs so it blends naturally.
|
|
59
59
|
|
|
@@ -76,7 +76,7 @@ export default function App() {
|
|
|
76
76
|
|
|
77
77
|
### Material UI — Google's Material Design
|
|
78
78
|
|
|
79
|
-
If your app already uses MUI, this drops right in. The grid uses MUI components and respects your `ThemeProvider
|
|
79
|
+
If your app already uses MUI, this drops right in. The grid uses MUI components and respects your `ThemeProvider` — including custom palettes and typography.
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
82
|
npm install @alaarab/ogrid-react-material @mui/material @emotion/react @emotion/styled
|
|
@@ -101,7 +101,7 @@ export default function App() {
|
|
|
101
101
|
|
|
102
102
|
## Angular
|
|
103
103
|
|
|
104
|
-
Signals-based reactivity with standalone components
|
|
104
|
+
Signals-based reactivity with standalone components — no NgModule, no boilerplate. All three packages share the same services from `@alaarab/ogrid-angular`.
|
|
105
105
|
|
|
106
106
|
### Radix (Angular CDK) — lightweight default
|
|
107
107
|
|
|
@@ -137,7 +137,7 @@ npm install @alaarab/ogrid-angular-material @angular/material @angular/cdk
|
|
|
137
137
|
|
|
138
138
|
### PrimeNG
|
|
139
139
|
|
|
140
|
-
For teams
|
|
140
|
+
For teams in the PrimeFaces ecosystem, PrimeNG integration means dialogs, dropdowns, and inputs all look native.
|
|
141
141
|
|
|
142
142
|
```bash
|
|
143
143
|
npm install @alaarab/ogrid-angular-primeng primeng
|
|
@@ -155,7 +155,7 @@ Composition API composables built with `ref()` and `computed()`. All three packa
|
|
|
155
155
|
|
|
156
156
|
### Radix (Headless UI) — lightweight default
|
|
157
157
|
|
|
158
|
-
Headless UI Vue components bundled in
|
|
158
|
+
Headless UI Vue components bundled in — no peer dependencies beyond Vue 3. Good starting point for new Vue projects.
|
|
159
159
|
|
|
160
160
|
```bash
|
|
161
161
|
npm install @alaarab/ogrid-vue-radix
|
|
@@ -204,7 +204,7 @@ npm install @alaarab/ogrid-vue-primevue primevue
|
|
|
204
204
|
|
|
205
205
|
## Vanilla JS / TypeScript
|
|
206
206
|
|
|
207
|
-
No framework, no virtual DOM
|
|
207
|
+
No framework, no virtual DOM — just a container element and a class constructor. A built-in CSS theme covers light and dark mode with CSS custom properties you can override.
|
|
208
208
|
|
|
209
209
|
```bash
|
|
210
210
|
npm install @alaarab/ogrid-js
|
|
@@ -223,7 +223,7 @@ npm install @alaarab/ogrid-js
|
|
|
223
223
|
| **Vue** 3.3+ | Radix (Headless UI) *(bundled)* · Vuetify 3 · PrimeVue 4 | Composition API |
|
|
224
224
|
| **Vanilla JS/TS** | Built-in CSS theme *(zero deps)* | EventEmitter |
|
|
225
225
|
|
|
226
|
-
All 10 packages share the same `@alaarab/ogrid-core
|
|
226
|
+
All 10 packages share the same `@alaarab/ogrid-core`. Shared test factories cover the common contract, and package-specific browser coverage handles the remaining interaction differences. Switching design systems within a framework family is usually a one-line import change.
|
|
227
227
|
|
|
228
228
|
## Premium inputs (optional)
|
|
229
229
|
|
|
@@ -240,7 +240,7 @@ See [Premium Inputs](../features/premium-inputs) for usage and the full list of
|
|
|
240
240
|
|
|
241
241
|
## Related
|
|
242
242
|
|
|
243
|
-
- [Quick Start](../getting-started/quick-start)
|
|
244
|
-
- [Vanilla JS Guide](../getting-started/vanilla-js)
|
|
245
|
-
- [Theming Guide](./theming)
|
|
246
|
-
- [Premium Inputs](../features/premium-inputs)
|
|
243
|
+
- [Quick Start](../getting-started/quick-start) — get a grid running in 60 seconds
|
|
244
|
+
- [Vanilla JS Guide](../getting-started/vanilla-js) — full JS API documentation
|
|
245
|
+
- [Theming Guide](./theming) — customize colors and styling
|
|
246
|
+
- [Premium Inputs](../features/premium-inputs) — advanced cell editors
|