@alaarab/ogrid-mcp 2.9.0 → 2.11.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.
Files changed (51) hide show
  1. package/bundled-docs/api/README.md +7 -32
  2. package/bundled-docs/api/column-def.mdx +1 -1
  3. package/bundled-docs/api/components-column-chooser.mdx +0 -96
  4. package/bundled-docs/api/components-column-header-filter.mdx +1 -83
  5. package/bundled-docs/api/components-datagrid-table.mdx +0 -63
  6. package/bundled-docs/api/components-pagination-controls.mdx +0 -94
  7. package/bundled-docs/api/components-sidebar.mdx +0 -76
  8. package/bundled-docs/api/components-status-bar.mdx +0 -66
  9. package/bundled-docs/api/headless-hooks.mdx +410 -0
  10. package/bundled-docs/api/ogrid-props.mdx +1 -1
  11. package/bundled-docs/api/types.mdx +1 -1
  12. package/bundled-docs/features/cell-references.mdx +2 -116
  13. package/bundled-docs/features/column-chooser.mdx +0 -131
  14. package/bundled-docs/features/column-groups.mdx +1 -136
  15. package/bundled-docs/features/column-pinning.mdx +1 -108
  16. package/bundled-docs/features/column-reordering.mdx +1 -168
  17. package/bundled-docs/features/column-types.mdx +0 -71
  18. package/bundled-docs/features/context-menu.mdx +1 -93
  19. package/bundled-docs/features/csv-export.mdx +1 -104
  20. package/bundled-docs/features/editing.mdx +0 -149
  21. package/bundled-docs/features/filtering.mdx +0 -119
  22. package/bundled-docs/features/formulas.mdx +2 -102
  23. package/bundled-docs/features/grid-api.mdx +1 -108
  24. package/bundled-docs/features/keyboard-navigation.mdx +1 -74
  25. package/bundled-docs/features/mobile-touch.mdx +0 -71
  26. package/bundled-docs/features/pagination.mdx +0 -105
  27. package/bundled-docs/features/performance.mdx +0 -191
  28. package/bundled-docs/features/premium-inputs.mdx +0 -311
  29. package/bundled-docs/features/responsive-columns.mdx +1 -76
  30. package/bundled-docs/features/row-selection.mdx +2 -106
  31. package/bundled-docs/features/server-side-data.mdx +1 -129
  32. package/bundled-docs/features/sidebar.mdx +1 -78
  33. package/bundled-docs/features/sorting.mdx +2 -108
  34. package/bundled-docs/features/spreadsheet-selection.mdx +2 -79
  35. package/bundled-docs/features/status-bar.mdx +1 -72
  36. package/bundled-docs/features/toolbar.mdx +1 -75
  37. package/bundled-docs/features/virtual-scrolling.mdx +1 -304
  38. package/bundled-docs/getting-started/headless-or-component.mdx +112 -0
  39. package/bundled-docs/getting-started/installation.mdx +11 -141
  40. package/bundled-docs/getting-started/overview.mdx +15 -55
  41. package/bundled-docs/getting-started/quick-start.mdx +4 -279
  42. package/bundled-docs/guides/browser-support-matrix.mdx +6 -17
  43. package/bundled-docs/guides/mcp-live-testing.mdx +0 -82
  44. package/bundled-docs/guides/mcp.mdx +4 -4
  45. package/bundled-docs/guides/migration-from-ag-grid.mdx +2 -3
  46. package/bundled-docs/guides/theming.mdx +50 -23
  47. package/dist/esm/index.js +9 -39
  48. package/package.json +5 -5
  49. package/bundled-docs/api/js-api.mdx +0 -198
  50. package/bundled-docs/getting-started/vanilla-js.mdx +0 -218
  51. package/bundled-docs/guides/framework-showcase.mdx +0 -246
@@ -20,31 +20,6 @@ npm install @alaarab/ogrid-react-inputs
20
20
 
21
21
  Works with any OGrid React UI package (Radix, Fluent, Material).
22
22
 
23
- </TabItem>
24
- <TabItem value="angular" label="Angular">
25
-
26
- ```bash
27
- npm install @alaarab/ogrid-angular-inputs
28
- ```
29
-
30
- Works with any OGrid Angular UI package (Angular Material, PrimeNG, Radix).
31
-
32
- </TabItem>
33
- <TabItem value="vue" label="Vue">
34
-
35
- ```bash
36
- npm install @alaarab/ogrid-vue-inputs
37
- ```
38
-
39
- Works with any OGrid Vue UI package (Vuetify, PrimeVue, Radix).
40
-
41
- </TabItem>
42
- <TabItem value="js" label="Vanilla JS">
43
-
44
- ```bash
45
- npm install @alaarab/ogrid-js-inputs
46
- ```
47
-
48
23
  </TabItem>
49
24
  </Tabs>
50
25
 
@@ -95,81 +70,8 @@ function App() {
95
70
 
96
71
  - **Radix** (lightweight, default): `from '@alaarab/ogrid-react-radix'`
97
72
  - **Fluent UI** (Microsoft 365 / SPFx): `from '@alaarab/ogrid-react-fluent'`
98
- - **Material UI** (MUI v7): `from '@alaarab/ogrid-react-material'`
99
- :::
100
-
101
- </TabItem>
102
- <TabItem value="angular" label="Angular">
103
-
104
- ```typescript
105
-
106
- const columns = [
107
- { columnId: 'name', name: 'Name' },
108
- {
109
- columnId: 'dueDate',
110
- name: 'Due Date',
111
- editable: true,
112
- cellEditor: DatePickerEditorComponent,
113
- cellEditorPopup: true,
114
- },
115
- ];
116
- ```
117
-
118
- :::tip Switching UI libraries
119
- `DatePickerEditorComponent` works with all Angular UI packages:
120
-
121
- - **Angular Material**: `from '@alaarab/ogrid-angular-material'`
122
- - **PrimeNG**: `from '@alaarab/ogrid-angular-primeng'`
123
- - **Radix** (lightweight): `from '@alaarab/ogrid-angular-radix'`
124
- :::
125
-
126
- </TabItem>
127
- <TabItem value="vue" label="Vue">
128
-
129
- ```typescript
130
-
131
- const columns = [
132
- { columnId: 'name', name: 'Name' },
133
- {
134
- columnId: 'dueDate',
135
- name: 'Due Date',
136
- editable: true,
137
- cellEditor: DatePickerEditor,
138
- cellEditorPopup: true,
139
- },
140
- ];
141
- ```
142
-
143
- :::tip Switching UI libraries
144
- `DatePickerEditor` works with all Vue UI packages:
145
-
146
- - **Vuetify**: `from '@alaarab/ogrid-vue-vuetify'`
147
- - **PrimeVue**: `from '@alaarab/ogrid-vue-primevue'`
148
- - **Radix** (lightweight): `from '@alaarab/ogrid-vue-radix'`
149
73
  :::
150
74
 
151
- </TabItem>
152
- <TabItem value="js" label="Vanilla JS">
153
-
154
- ```typescript
155
-
156
- const grid = new OGrid(container, {
157
- columns: [
158
- { columnId: 'name', name: 'Name' },
159
- {
160
- columnId: 'dueDate',
161
- name: 'Due Date',
162
- editable: true,
163
- cellEditor: createDatePickerEditor,
164
- cellEditorPopup: true,
165
- },
166
- ],
167
- data,
168
- getRowId: (item) => item.id,
169
- editable: true,
170
- });
171
- ```
172
-
173
75
  </TabItem>
174
76
  </Tabs>
175
77
 
@@ -200,57 +102,6 @@ const columns = [
200
102
  cellEditorParams: { maxStars: 5, allowHalf: false },
201
103
  },
202
104
  ];
203
- ```
204
-
205
- </TabItem>
206
- <TabItem value="angular" label="Angular">
207
-
208
- ```typescript
209
-
210
- const columns = [
211
- {
212
- columnId: 'rating',
213
- name: 'Rating',
214
- editable: true,
215
- cellEditor: RatingEditorComponent,
216
- cellEditorPopup: true,
217
- cellEditorParams: { maxStars: 5, allowHalf: false },
218
- },
219
- ];
220
- ```
221
-
222
- </TabItem>
223
- <TabItem value="vue" label="Vue">
224
-
225
- ```typescript
226
-
227
- const columns = [
228
- {
229
- columnId: 'rating',
230
- name: 'Rating',
231
- editable: true,
232
- cellEditor: RatingEditor,
233
- cellEditorPopup: true,
234
- cellEditorParams: { maxStars: 5, allowHalf: false },
235
- },
236
- ];
237
- ```
238
-
239
- </TabItem>
240
- <TabItem value="js" label="Vanilla JS">
241
-
242
- ```typescript
243
-
244
- const columns = [
245
- {
246
- columnId: 'rating',
247
- name: 'Rating',
248
- editable: true,
249
- cellEditor: createRatingEditor,
250
- cellEditorPopup: true,
251
- cellEditorParams: { maxStars: 5, allowHalf: false },
252
- },
253
- ];
254
105
  ```
255
106
 
256
107
  </TabItem>
@@ -283,57 +134,6 @@ const columns = [
283
134
  cellEditorParams: { allowCustom: true },
284
135
  },
285
136
  ];
286
- ```
287
-
288
- </TabItem>
289
- <TabItem value="angular" label="Angular">
290
-
291
- ```typescript
292
-
293
- const columns = [
294
- {
295
- columnId: 'color',
296
- name: 'Color',
297
- editable: true,
298
- cellEditor: ColorPickerEditorComponent,
299
- cellEditorPopup: true,
300
- cellEditorParams: { allowCustom: true },
301
- },
302
- ];
303
- ```
304
-
305
- </TabItem>
306
- <TabItem value="vue" label="Vue">
307
-
308
- ```typescript
309
-
310
- const columns = [
311
- {
312
- columnId: 'color',
313
- name: 'Color',
314
- editable: true,
315
- cellEditor: ColorPickerEditor,
316
- cellEditorPopup: true,
317
- cellEditorParams: { allowCustom: true },
318
- },
319
- ];
320
- ```
321
-
322
- </TabItem>
323
- <TabItem value="js" label="Vanilla JS">
324
-
325
- ```typescript
326
-
327
- const columns = [
328
- {
329
- columnId: 'color',
330
- name: 'Color',
331
- editable: true,
332
- cellEditor: createColorPickerEditor,
333
- cellEditorPopup: true,
334
- cellEditorParams: { allowCustom: true },
335
- },
336
- ];
337
137
  ```
338
138
 
339
139
  </TabItem>
@@ -366,57 +166,6 @@ const columns = [
366
166
  cellEditorParams: { min: 0, max: 100, step: 1 },
367
167
  },
368
168
  ];
369
- ```
370
-
371
- </TabItem>
372
- <TabItem value="angular" label="Angular">
373
-
374
- ```typescript
375
-
376
- const columns = [
377
- {
378
- columnId: 'progress',
379
- name: 'Progress',
380
- editable: true,
381
- cellEditor: SliderEditorComponent,
382
- cellEditorPopup: true,
383
- cellEditorParams: { min: 0, max: 100, step: 1 },
384
- },
385
- ];
386
- ```
387
-
388
- </TabItem>
389
- <TabItem value="vue" label="Vue">
390
-
391
- ```typescript
392
-
393
- const columns = [
394
- {
395
- columnId: 'progress',
396
- name: 'Progress',
397
- editable: true,
398
- cellEditor: SliderEditor,
399
- cellEditorPopup: true,
400
- cellEditorParams: { min: 0, max: 100, step: 1 },
401
- },
402
- ];
403
- ```
404
-
405
- </TabItem>
406
- <TabItem value="js" label="Vanilla JS">
407
-
408
- ```typescript
409
-
410
- const columns = [
411
- {
412
- columnId: 'progress',
413
- name: 'Progress',
414
- editable: true,
415
- cellEditor: createSliderEditor,
416
- cellEditorPopup: true,
417
- cellEditorParams: { min: 0, max: 100, step: 1 },
418
- },
419
- ];
420
169
  ```
421
170
 
422
171
  </TabItem>
@@ -453,66 +202,6 @@ const columns = [
453
202
  },
454
203
  },
455
204
  ];
456
- ```
457
-
458
- </TabItem>
459
- <TabItem value="angular" label="Angular">
460
-
461
- ```typescript
462
-
463
- const columns = [
464
- {
465
- columnId: 'skills',
466
- name: 'Skills',
467
- editable: true,
468
- cellEditor: TagsEditorComponent,
469
- cellEditorPopup: true,
470
- cellEditorParams: {
471
- suggestions: ['React', 'Angular', 'Vue', 'TypeScript', 'Python'],
472
- allowCreate: true,
473
- },
474
- },
475
- ];
476
- ```
477
-
478
- </TabItem>
479
- <TabItem value="vue" label="Vue">
480
-
481
- ```typescript
482
-
483
- const columns = [
484
- {
485
- columnId: 'skills',
486
- name: 'Skills',
487
- editable: true,
488
- cellEditor: TagsEditor,
489
- cellEditorPopup: true,
490
- cellEditorParams: {
491
- suggestions: ['React', 'Angular', 'Vue', 'TypeScript', 'Python'],
492
- allowCreate: true,
493
- },
494
- },
495
- ];
496
- ```
497
-
498
- </TabItem>
499
- <TabItem value="js" label="Vanilla JS">
500
-
501
- ```typescript
502
-
503
- const columns = [
504
- {
505
- columnId: 'skills',
506
- name: 'Skills',
507
- editable: true,
508
- cellEditor: createTagsEditor,
509
- cellEditorPopup: true,
510
- cellEditorParams: {
511
- suggestions: ['React', 'Angular', 'Vue', 'TypeScript', 'Python'],
512
- allowCreate: true,
513
- },
514
- },
515
- ];
516
205
  ```
517
206
 
518
207
  </TabItem>
@@ -59,84 +59,9 @@ function App() {
59
59
  ```
60
60
 
61
61
  <Admonition type="tip">
62
- Also available from `@alaarab/ogrid-react-fluent` and `@alaarab/ogrid-react-material`.
62
+ Also available from `@alaarab/ogrid-react-fluent`.
63
63
  </Admonition>
64
64
 
65
- </TabItem>
66
- <TabItem value="angular" label="Angular">
67
-
68
- ```typescript
69
-
70
- @Component({
71
- template: `
72
- <ogrid-component
73
- [columns]="columns"
74
- [data]="items"
75
- [getRowId]="getRowId"
76
- [responsiveColumns]="true"
77
- />
78
- `,
79
- })
80
- export class AppComponent {
81
- columns = [
82
- { columnId: 'name', name: 'Name', responsivePriority: 0 },
83
- { columnId: 'email', name: 'Email', responsivePriority: 1 },
84
- { columnId: 'phone', name: 'Phone', responsivePriority: 3 },
85
- ];
86
- items = [...];
87
- getRowId = (item: any) => item.id;
88
- }
89
- ```
90
-
91
- <Admonition type="tip">
92
- Also available from `@alaarab/ogrid-angular-primeng` and `@alaarab/ogrid-angular-radix`.
93
- </Admonition>
94
-
95
- </TabItem>
96
- <TabItem value="vue" label="Vue">
97
-
98
- ```vue
99
- <template>
100
- <OGrid
101
- :columns="columns"
102
- :data="items"
103
- :getRowId="(item) => item.id"
104
- :responsiveColumns="true"
105
- />
106
- </template>
107
-
108
- <script setup>
109
-
110
- const columns = [
111
- { columnId: 'name', name: 'Name', responsivePriority: 0 },
112
- { columnId: 'email', name: 'Email', responsivePriority: 1 },
113
- { columnId: 'phone', name: 'Phone', responsivePriority: 3 },
114
- ];
115
- const items = [...];
116
- </script>
117
- ```
118
-
119
- <Admonition type="tip">
120
- Also available from `@alaarab/ogrid-vue-primevue` and `@alaarab/ogrid-vue-radix`.
121
- </Admonition>
122
-
123
- </TabItem>
124
- <TabItem value="js" label="Vanilla JS">
125
-
126
- ```typescript
127
-
128
- const grid = new OGrid(document.getElementById('grid')!, {
129
- columns: [
130
- { columnId: 'name', name: 'Name', responsivePriority: 0 },
131
- { columnId: 'email', name: 'Email', responsivePriority: 1 },
132
- { columnId: 'phone', name: 'Phone', responsivePriority: 3 },
133
- ],
134
- data: items,
135
- getRowId: (item) => item.id,
136
- responsiveColumns: true,
137
- });
138
- ```
139
-
140
65
  </TabItem>
141
66
  </Tabs>
142
67
 
@@ -13,14 +13,8 @@ Select entire rows with checkboxes (multiple mode) or radio-button-style selecti
13
13
 
14
14
  <RowSelectionDemo />
15
15
 
16
- :::tip Framework-Specific Styling
17
- The live demo above shows **React Radix UI** styling (lightweight default). To see how row selection looks in your framework's design system, click the framework buttons above the demo to open online demo:
18
- - **React** - Radix UI checkboxes
19
- - **Angular** - Angular Material checkboxes
20
- - **Vue** - Vuetify checkboxes
21
- - **JS** - Vanilla JS default theme
22
-
23
- Each framework renders with its native checkbox components, so the styling matches your design system.
16
+ :::tip UI styling
17
+ The live demo above shows **Radix UI** styling (lightweight default). The same feature renders through the Fluent UI package with its native components.
24
18
  :::
25
19
 
26
20
  ## Quick Example
@@ -61,106 +55,8 @@ The `OGrid` component has the same props across all React UI packages. To switch
61
55
 
62
56
  - **Radix** (lightweight, default): `from '@alaarab/ogrid-react-radix'`
63
57
  - **Fluent UI** (Microsoft 365 / SPFx): `from '@alaarab/ogrid-react-fluent'` - wrap in `<FluentProvider>`
64
- - **Material UI** (MUI v7): `from '@alaarab/ogrid-react-material'` - wrap in `<ThemeProvider>`
65
58
  :::
66
59
 
67
- </TabItem>
68
- <TabItem value="angular" label="Angular">
69
-
70
- ```typescript
71
-
72
- @Component({
73
- standalone: true,
74
- imports: [OGridComponent],
75
- template: `
76
- <button (click)="handleExport()">Export Selected</button>
77
- <ogrid [props]="gridProps" />
78
- `
79
- })
80
- export class GridComponent {
81
- constructor(private gridService: OGridService) {}
82
-
83
- handleExport() {
84
- const selectedIds = this.gridService.getSelectedRows();
85
- console.log('Selected:', selectedIds);
86
- }
87
-
88
- gridProps = {
89
- columns,
90
- data: people,
91
- getRowId: (item: Person) => item.id,
92
- rowSelection: 'multiple' as const,
93
- onSelectionChange: (event: any) => {
94
- console.log(`${event.selectedItems.length} rows selected`);
95
- },
96
- };
97
- }
98
- ```
99
-
100
- :::tip Switching UI libraries
101
- Same component API across Angular packages. To switch, just change the import:
102
-
103
- - **Radix (CDK)**: `from '@alaarab/ogrid-angular-radix'` *(default, lightweight)*
104
- - **Angular Material**: `from '@alaarab/ogrid-angular-material'`
105
- - **PrimeNG**: `from '@alaarab/ogrid-angular-primeng'`
106
-
107
- All components are standalone - no NgModule required.
108
- :::
109
-
110
- </TabItem>
111
- <TabItem value="vue" label="Vue">
112
-
113
- ```vue
114
- <script setup lang="ts">
115
-
116
- const gridProps = {
117
- columns,
118
- data: people,
119
- getRowId: (item) => item.id,
120
- rowSelection: 'multiple',
121
- onSelectionChange: (event) => {
122
- console.log(`${event.selectedItems.length} rows selected`);
123
- },
124
- };
125
- </script>
126
-
127
- <template>
128
- <OGrid :gridProps="gridProps" />
129
- </template>
130
- ```
131
-
132
- :::tip Switching UI libraries
133
- Same component API across Vue packages. To switch, just change the import:
134
-
135
- - **Radix (Headless UI)**: `from '@alaarab/ogrid-vue-radix'` *(default, lightweight)*
136
- - **Vuetify**: `from '@alaarab/ogrid-vue-vuetify'` - wrap in `<v-app>` for theming
137
- - **PrimeVue**: `from '@alaarab/ogrid-vue-primevue'`
138
- :::
139
-
140
- </TabItem>
141
- <TabItem value="js" label="Vanilla JS">
142
-
143
- ```js
144
-
145
- const grid = new OGrid(document.getElementById('grid'), {
146
- columns: columns,
147
- data: people,
148
- getRowId: (item) => item.id,
149
- rowSelection: 'multiple',
150
- });
151
-
152
- grid.on('selectionChange', ({ selectedItems, selectedRowIds }) => {
153
- console.log(`${selectedItems.length} rows selected`);
154
- console.log('Selected row IDs:', selectedRowIds);
155
- });
156
-
157
- // Programmatic access
158
- document.getElementById('export-btn').addEventListener('click', () => {
159
- const selected = grid.api.getSelectedRows();
160
- console.log('Selected:', selected);
161
- });
162
- ```
163
-
164
60
  </TabItem>
165
61
  </Tabs>
166
62
 
@@ -14,7 +14,7 @@ Pass a `dataSource` instead of a `data` array to delegate sorting, filtering, an
14
14
  <ServerSideDemo />
15
15
 
16
16
  :::tip Try it in your framework
17
- The demo above uses Radix UI for styling. To see this feature with your framework's design system (Fluent UI, Material UI, Vuetify, PrimeNG, etc.), click **"Open in online demo"** below the demo.
17
+ The demo above uses Radix UI for styling. To see this feature with the Fluent UI implementation, click **"Open in online demo"** below the demo.
18
18
  :::
19
19
 
20
20
  ## Quick Example
@@ -63,136 +63,8 @@ The `OGrid` component has the same props across all React UI packages. To switch
63
63
 
64
64
  - **Radix** (lightweight, default): `from '@alaarab/ogrid-react-radix'`
65
65
  - **Fluent UI** (Microsoft 365 / SPFx): `from '@alaarab/ogrid-react-fluent'` - wrap in `<FluentProvider>`
66
- - **Material UI** (MUI v7): `from '@alaarab/ogrid-react-material'` - wrap in `<ThemeProvider>`
67
66
  :::
68
67
 
69
- </TabItem>
70
- <TabItem value="angular" label="Angular">
71
-
72
- ```typescript
73
-
74
- interface Employee {
75
- id: number;
76
- name: string;
77
- department: string;
78
- salary: number;
79
- }
80
-
81
- const dataSource: IDataSource<Employee> = {
82
- async fetchPage(params: IFetchParams): Promise<IPageResult<Employee>> {
83
- const query = new URLSearchParams({
84
- page: String(params.page),
85
- pageSize: String(params.pageSize),
86
- ...(params.sort && {
87
- sortField: params.sort.field,
88
- sortDir: params.sort.direction,
89
- }),
90
- });
91
- const res = await fetch(`/api/employees?${query}`);
92
- return res.json();
93
- },
94
- };
95
-
96
- @Component({
97
- standalone: true,
98
- imports: [OGridComponent],
99
- template: `<ogrid [props]="gridProps" />`
100
- })
101
- export class GridComponent {
102
- gridProps = {
103
- columns: columns,
104
- dataSource,
105
- getRowId: (e: Employee) => e.id,
106
- defaultPageSize: 25,
107
- };
108
- }
109
- ```
110
-
111
- :::tip Switching UI libraries
112
- Same component API across Angular packages. To switch, just change the import:
113
-
114
- - **Radix (CDK)**: `from '@alaarab/ogrid-angular-radix'` *(default, lightweight)*
115
- - **Angular Material**: `from '@alaarab/ogrid-angular-material'`
116
- - **PrimeNG**: `from '@alaarab/ogrid-angular-primeng'`
117
-
118
- All components are standalone - no NgModule required.
119
- :::
120
-
121
- </TabItem>
122
- <TabItem value="vue" label="Vue">
123
-
124
- ```vue
125
- <script setup lang="ts">
126
-
127
- interface Employee {
128
- id: number;
129
- name: string;
130
- department: string;
131
- salary: number;
132
- }
133
-
134
- const dataSource: IDataSource<Employee> = {
135
- async fetchPage(params: IFetchParams): Promise<IPageResult<Employee>> {
136
- const query = new URLSearchParams({
137
- page: String(params.page),
138
- pageSize: String(params.pageSize),
139
- ...(params.sort && {
140
- sortField: params.sort.field,
141
- sortDir: params.sort.direction,
142
- }),
143
- });
144
- const res = await fetch(`/api/employees?${query}`);
145
- return res.json();
146
- },
147
- };
148
-
149
- const gridProps = {
150
- columns,
151
- dataSource,
152
- getRowId: (e: Employee) => e.id,
153
- defaultPageSize: 25,
154
- };
155
- </script>
156
-
157
- <template>
158
- <OGrid :gridProps="gridProps" />
159
- </template>
160
- ```
161
-
162
- :::tip Switching UI libraries
163
- Same component API across Vue packages. To switch, just change the import:
164
-
165
- - **Radix (Headless UI)**: `from '@alaarab/ogrid-vue-radix'` *(default, lightweight)*
166
- - **Vuetify**: `from '@alaarab/ogrid-vue-vuetify'` - wrap in `<v-app>` for theming
167
- - **PrimeVue**: `from '@alaarab/ogrid-vue-primevue'`
168
- :::
169
-
170
- </TabItem>
171
- <TabItem value="js" label="Vanilla JS">
172
-
173
- ```js
174
-
175
- const grid = new OGrid(document.getElementById('grid'), {
176
- columns: columns,
177
- dataSource: {
178
- async fetchPage({ page, pageSize, sort, filters }) {
179
- const query = new URLSearchParams({
180
- page: String(page),
181
- pageSize: String(pageSize),
182
- ...(sort && {
183
- sortField: sort.field,
184
- sortDir: sort.direction,
185
- }),
186
- });
187
- const res = await fetch(`/api/employees?${query}`);
188
- return res.json(); // { items: Employee[], totalCount: number }
189
- },
190
- },
191
- getRowId: (e) => e.id,
192
- pageSize: 25,
193
- });
194
- ```
195
-
196
68
  </TabItem>
197
69
  </Tabs>
198
70