@alaarab/ogrid-mcp 2.8.1 → 2.11.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/bundled-docs/api/README.md +7 -32
- package/bundled-docs/api/column-def.mdx +1 -1
- package/bundled-docs/api/components-column-chooser.mdx +0 -96
- package/bundled-docs/api/components-column-header-filter.mdx +1 -83
- package/bundled-docs/api/components-datagrid-table.mdx +0 -63
- package/bundled-docs/api/components-pagination-controls.mdx +0 -94
- package/bundled-docs/api/components-sidebar.mdx +0 -76
- package/bundled-docs/api/components-status-bar.mdx +0 -66
- package/bundled-docs/api/headless-hooks.mdx +410 -0
- package/bundled-docs/api/ogrid-props.mdx +1 -1
- package/bundled-docs/api/types.mdx +1 -1
- package/bundled-docs/features/cell-references.mdx +2 -116
- package/bundled-docs/features/column-chooser.mdx +0 -131
- package/bundled-docs/features/column-groups.mdx +1 -136
- package/bundled-docs/features/column-pinning.mdx +1 -108
- package/bundled-docs/features/column-reordering.mdx +1 -168
- package/bundled-docs/features/column-types.mdx +0 -71
- package/bundled-docs/features/context-menu.mdx +1 -93
- package/bundled-docs/features/csv-export.mdx +1 -104
- package/bundled-docs/features/editing.mdx +0 -149
- package/bundled-docs/features/filtering.mdx +0 -119
- package/bundled-docs/features/formulas.mdx +2 -102
- package/bundled-docs/features/grid-api.mdx +1 -108
- package/bundled-docs/features/keyboard-navigation.mdx +1 -74
- package/bundled-docs/features/mobile-touch.mdx +0 -71
- package/bundled-docs/features/pagination.mdx +0 -105
- package/bundled-docs/features/performance.mdx +0 -191
- package/bundled-docs/features/premium-inputs.mdx +0 -311
- package/bundled-docs/features/responsive-columns.mdx +1 -76
- package/bundled-docs/features/row-selection.mdx +2 -106
- package/bundled-docs/features/server-side-data.mdx +1 -129
- package/bundled-docs/features/sidebar.mdx +1 -78
- package/bundled-docs/features/sorting.mdx +2 -108
- package/bundled-docs/features/spreadsheet-selection.mdx +2 -79
- package/bundled-docs/features/status-bar.mdx +1 -72
- package/bundled-docs/features/toolbar.mdx +1 -75
- package/bundled-docs/features/virtual-scrolling.mdx +1 -304
- package/bundled-docs/getting-started/headless-or-component.mdx +112 -0
- package/bundled-docs/getting-started/installation.mdx +11 -141
- package/bundled-docs/getting-started/overview.mdx +15 -55
- package/bundled-docs/getting-started/quick-start.mdx +4 -279
- package/bundled-docs/guides/browser-support-matrix.mdx +6 -17
- package/bundled-docs/guides/mcp-live-testing.mdx +0 -82
- package/bundled-docs/guides/mcp.mdx +4 -4
- package/bundled-docs/guides/migration-from-ag-grid.mdx +2 -3
- package/bundled-docs/guides/theming.mdx +50 -23
- package/dist/esm/index.js +9 -39
- package/package.json +5 -5
- package/bundled-docs/api/js-api.mdx +0 -198
- package/bundled-docs/getting-started/vanilla-js.mdx +0 -218
- package/bundled-docs/guides/framework-showcase.mdx +0 -246
|
@@ -16,7 +16,6 @@ Complete API documentation for OGrid components, types, and interfaces.
|
|
|
16
16
|
- [OGrid Props](./ogrid-props.mdx): top-level OGrid component props (client-side and server-side modes)
|
|
17
17
|
- [Column Definition](./column-def.mdx): complete column definition reference (IColumnDef, IColumnGroupDef, cell editors, filters)
|
|
18
18
|
- [Grid API](./grid-api.mdx): imperative grid API (IOGridApi) for programmatic control
|
|
19
|
-
- [JS API](./js-api.mdx): vanilla JS API reference (OGrid class, state classes, components)
|
|
20
19
|
|
|
21
20
|
## Types
|
|
22
21
|
|
|
@@ -32,7 +31,6 @@ Complete API documentation for OGrid components, types, and interfaces.
|
|
|
32
31
|
### Getting Started
|
|
33
32
|
- [Installation](/docs/getting-started/installation)
|
|
34
33
|
- [Quick Start](/docs/getting-started/quick-start)
|
|
35
|
-
- [Framework Showcase](/docs/guides/framework-showcase)
|
|
36
34
|
|
|
37
35
|
### Features
|
|
38
36
|
- [Sorting](/docs/features/sorting)
|
|
@@ -48,10 +46,9 @@ Complete API documentation for OGrid components, types, and interfaces.
|
|
|
48
46
|
|
|
49
47
|
## Type Imports
|
|
50
48
|
|
|
51
|
-
All types can be imported from any
|
|
49
|
+
All types can be imported from any React UI package:
|
|
52
50
|
|
|
53
51
|
```typescript
|
|
54
|
-
// React packages
|
|
55
52
|
IColumnDef,
|
|
56
53
|
IOGridApi,
|
|
57
54
|
IOGridProps,
|
|
@@ -61,34 +58,12 @@ All types can be imported from any OGrid package:
|
|
|
61
58
|
FilterValue,
|
|
62
59
|
RowId,
|
|
63
60
|
} from '@alaarab/ogrid-react-radix';
|
|
64
|
-
|
|
65
|
-
// Angular packages
|
|
66
|
-
IColumnDef,
|
|
67
|
-
IOGridApi,
|
|
68
|
-
IDataSource,
|
|
69
|
-
} from '@alaarab/ogrid-angular-material';
|
|
70
|
-
|
|
71
|
-
// Vue packages
|
|
72
|
-
IColumnDef,
|
|
73
|
-
IOGridApi,
|
|
74
|
-
IDataSource,
|
|
75
|
-
} from '@alaarab/ogrid-vue-vuetify';
|
|
76
|
-
|
|
77
|
-
// Vanilla JS
|
|
78
|
-
IColumnDef,
|
|
79
|
-
IDataSource,
|
|
80
|
-
} from '@alaarab/ogrid-js';
|
|
81
61
|
```
|
|
82
62
|
|
|
83
|
-
##
|
|
84
|
-
|
|
85
|
-
Each framework has idiomatic APIs:
|
|
86
|
-
|
|
87
|
-
| Framework | Orchestration | State Hook/Service | Props Pattern |
|
|
88
|
-
|-----------|---------------|-------------------|---------------|
|
|
89
|
-
| React | `useOGrid()` hook | `useDataGridState()` | Individual props |
|
|
90
|
-
| Angular | `OGridService` | `DataGridStateService` | Signal-based inputs |
|
|
91
|
-
| Vue | `useOGrid()` composable | `useDataGridState()` | Individual props or `:grid-props` |
|
|
92
|
-
| Vanilla JS | `OGrid` class | `GridState` class | Constructor options |
|
|
63
|
+
## API surface
|
|
93
64
|
|
|
94
|
-
|
|
65
|
+
| Surface | Entry point |
|
|
66
|
+
|---|---|
|
|
67
|
+
| Component | `<OGrid>` from `@alaarab/ogrid-react-radix` or `-react-fluent` |
|
|
68
|
+
| Orchestration hook | `useOGrid()` |
|
|
69
|
+
| State hook | `useDataGridState()` |
|
|
@@ -43,7 +43,7 @@ interface IColumnMeta {
|
|
|
43
43
|
|
|
44
44
|
## IColumnDef<T>
|
|
45
45
|
|
|
46
|
-
Extends `IColumnMeta` with rendering, editing, and data access properties.
|
|
46
|
+
Extends `IColumnMeta` with rendering, editing, and data access properties. `renderCell` returns a React node; `cellStyle` accepts a `React.CSSProperties` object or a function returning one.
|
|
47
47
|
|
|
48
48
|
```typescript
|
|
49
49
|
interface IColumnDef<T> extends IColumnMeta {
|
|
@@ -15,30 +15,6 @@ A dropdown component that allows users to show/hide columns in the grid. Display
|
|
|
15
15
|
|
|
16
16
|
```typescript
|
|
17
17
|
// or
|
|
18
|
-
// or
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
</TabItem>
|
|
22
|
-
<TabItem value="angular" label="Angular">
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
// or
|
|
26
|
-
// or
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
</TabItem>
|
|
30
|
-
<TabItem value="vue" label="Vue">
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
// or
|
|
34
|
-
// or
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
</TabItem>
|
|
38
|
-
<TabItem value="js" label="Vanilla JS">
|
|
39
|
-
|
|
40
|
-
```typescript
|
|
41
|
-
// ColumnChooser is an internal component in vanilla JS
|
|
42
18
|
```
|
|
43
19
|
|
|
44
20
|
</TabItem>
|
|
@@ -134,78 +110,6 @@ function MyApp() {
|
|
|
134
110
|
|
|
135
111
|
The "ID" and "Product Name" columns will have disabled checkboxes and cannot be hidden.
|
|
136
112
|
|
|
137
|
-
## Angular Usage
|
|
138
|
-
|
|
139
|
-
In Angular packages, the component uses `@Input()` and `@Output()` decorators:
|
|
140
|
-
|
|
141
|
-
```typescript
|
|
142
|
-
|
|
143
|
-
@Component({
|
|
144
|
-
selector: 'app-my-grid',
|
|
145
|
-
standalone: true,
|
|
146
|
-
imports: [ColumnChooserComponent],
|
|
147
|
-
template: `
|
|
148
|
-
<ogrid-column-chooser
|
|
149
|
-
[columns]="columns"
|
|
150
|
-
[visibleColumns]="visibleColumns"
|
|
151
|
-
(onVisibilityChange)="handleVisibilityChange($event)"
|
|
152
|
-
/>
|
|
153
|
-
`
|
|
154
|
-
})
|
|
155
|
-
export class MyGridComponent {
|
|
156
|
-
columns: IColumnDefinition[] = [
|
|
157
|
-
{ columnId: 'id', name: 'ID', required: true },
|
|
158
|
-
{ columnId: 'name', name: 'Product Name' },
|
|
159
|
-
{ columnId: 'price', name: 'Price' },
|
|
160
|
-
];
|
|
161
|
-
|
|
162
|
-
visibleColumns = new Set(['id', 'name', 'price']);
|
|
163
|
-
|
|
164
|
-
handleVisibilityChange(event: { columnKey: string; visible: boolean }) {
|
|
165
|
-
if (event.visible) {
|
|
166
|
-
this.visibleColumns.add(event.columnKey);
|
|
167
|
-
} else {
|
|
168
|
-
this.visibleColumns.delete(event.columnKey);
|
|
169
|
-
}
|
|
170
|
-
this.visibleColumns = new Set(this.visibleColumns); // Trigger change detection
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
## Vue Usage
|
|
176
|
-
|
|
177
|
-
In Vue packages, the component accepts props via `v-bind` or shorthand `:`:
|
|
178
|
-
|
|
179
|
-
```vue
|
|
180
|
-
<template>
|
|
181
|
-
<ColumnChooser
|
|
182
|
-
:columns="columns"
|
|
183
|
-
:visible-columns="visibleColumns"
|
|
184
|
-
@visibility-change="handleVisibilityChange"
|
|
185
|
-
/>
|
|
186
|
-
</template>
|
|
187
|
-
|
|
188
|
-
<script setup lang="ts">
|
|
189
|
-
|
|
190
|
-
const columns: IColumnDefinition[] = [
|
|
191
|
-
{ columnId: 'id', name: 'ID', required: true },
|
|
192
|
-
{ columnId: 'name', name: 'Product Name' },
|
|
193
|
-
{ columnId: 'price', name: 'Price' },
|
|
194
|
-
];
|
|
195
|
-
|
|
196
|
-
const visibleColumns = ref<Set<string>>(new Set(['id', 'name', 'price']));
|
|
197
|
-
|
|
198
|
-
const handleVisibilityChange = (columnKey: string, visible: boolean) => {
|
|
199
|
-
if (visible) {
|
|
200
|
-
visibleColumns.value.add(columnKey);
|
|
201
|
-
} else {
|
|
202
|
-
visibleColumns.value.delete(columnKey);
|
|
203
|
-
}
|
|
204
|
-
visibleColumns.value = new Set(visibleColumns.value); // Trigger reactivity
|
|
205
|
-
};
|
|
206
|
-
</script>
|
|
207
|
-
```
|
|
208
|
-
|
|
209
113
|
## Behavior
|
|
210
114
|
|
|
211
115
|
### Select All / Clear All
|
|
@@ -15,30 +15,6 @@ A column header component that combines sorting and filtering UI. Displays the c
|
|
|
15
15
|
|
|
16
16
|
```typescript
|
|
17
17
|
// or
|
|
18
|
-
// or
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
</TabItem>
|
|
22
|
-
<TabItem value="angular" label="Angular">
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
// or
|
|
26
|
-
// or
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
</TabItem>
|
|
30
|
-
<TabItem value="vue" label="Vue">
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
// or
|
|
34
|
-
// or
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
</TabItem>
|
|
38
|
-
<TabItem value="js" label="Vanilla JS">
|
|
39
|
-
|
|
40
|
-
```typescript
|
|
41
|
-
// ColumnHeaderFilter is an internal component in vanilla JS
|
|
42
18
|
```
|
|
43
19
|
|
|
44
20
|
</TabItem>
|
|
@@ -198,64 +174,6 @@ function MyHeader() {
|
|
|
198
174
|
}
|
|
199
175
|
```
|
|
200
176
|
|
|
201
|
-
## Angular Usage
|
|
202
|
-
|
|
203
|
-
In Angular packages, the component has the same prop interface but uses `@Input()` decorators:
|
|
204
|
-
|
|
205
|
-
```typescript
|
|
206
|
-
|
|
207
|
-
@Component({
|
|
208
|
-
selector: 'app-my-header',
|
|
209
|
-
standalone: true,
|
|
210
|
-
imports: [ColumnHeaderFilterComponent],
|
|
211
|
-
template: `
|
|
212
|
-
<ogrid-column-header-filter
|
|
213
|
-
[columnKey]="'status'"
|
|
214
|
-
[columnName]="'Status'"
|
|
215
|
-
[filterType]="'multiSelect'"
|
|
216
|
-
[selectedValues]="selectedValues"
|
|
217
|
-
(onFilterChange)="handleFilterChange($event)"
|
|
218
|
-
[options]="options"
|
|
219
|
-
/>
|
|
220
|
-
`
|
|
221
|
-
})
|
|
222
|
-
export class MyHeaderComponent {
|
|
223
|
-
selectedValues: string[] = [];
|
|
224
|
-
options = ['Active', 'Pending', 'Completed'];
|
|
225
|
-
|
|
226
|
-
handleFilterChange(values: string[]) {
|
|
227
|
-
this.selectedValues = values;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
## Vue Usage
|
|
233
|
-
|
|
234
|
-
In Vue packages, the component accepts props via `v-bind` or shorthand `:`:
|
|
235
|
-
|
|
236
|
-
```vue
|
|
237
|
-
<template>
|
|
238
|
-
<ColumnHeaderFilter
|
|
239
|
-
column-key="status"
|
|
240
|
-
column-name="Status"
|
|
241
|
-
filter-type="multiSelect"
|
|
242
|
-
:selected-values="selectedValues"
|
|
243
|
-
@filter-change="handleFilterChange"
|
|
244
|
-
:options="options"
|
|
245
|
-
/>
|
|
246
|
-
</template>
|
|
247
|
-
|
|
248
|
-
<script setup lang="ts">
|
|
249
|
-
|
|
250
|
-
const selectedValues = ref<string[]>([]);
|
|
251
|
-
const options = ['Active', 'Pending', 'Completed'];
|
|
252
|
-
|
|
253
|
-
const handleFilterChange = (values: string[]) => {
|
|
254
|
-
selectedValues.value = values;
|
|
255
|
-
};
|
|
256
|
-
</script>
|
|
257
|
-
```
|
|
258
|
-
|
|
259
177
|
## Accessibility
|
|
260
178
|
|
|
261
179
|
`ColumnHeaderFilter` implements WCAG 2.1 AA standards with full keyboard and screen reader support.
|
|
@@ -344,7 +262,7 @@ See the [Accessibility Guide](/docs/guides/accessibility) for complete documenta
|
|
|
344
262
|
|
|
345
263
|
## Styling
|
|
346
264
|
|
|
347
|
-
All UI packages provide default styles matching their design system (Radix UI, Fluent UI
|
|
265
|
+
All UI packages provide default styles matching their design system (Radix UI, Fluent UI). Styles are scoped to avoid conflicts.
|
|
348
266
|
|
|
349
267
|
**CSS custom properties** (all packages):
|
|
350
268
|
- `--ogrid-header-bg` - Header background color
|
|
@@ -15,30 +15,6 @@ The core data grid component that renders the table structure, headers, rows, ce
|
|
|
15
15
|
|
|
16
16
|
```typescript
|
|
17
17
|
// or
|
|
18
|
-
// or
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
</TabItem>
|
|
22
|
-
<TabItem value="angular" label="Angular">
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
// or
|
|
26
|
-
// or
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
</TabItem>
|
|
30
|
-
<TabItem value="vue" label="Vue">
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
// or
|
|
34
|
-
// or
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
</TabItem>
|
|
38
|
-
<TabItem value="js" label="Vanilla JS">
|
|
39
|
-
|
|
40
|
-
```typescript
|
|
41
|
-
// DataGridTable is an internal component of OGrid in vanilla JS
|
|
42
18
|
```
|
|
43
19
|
|
|
44
20
|
</TabItem>
|
|
@@ -142,45 +118,6 @@ function MyGrid() {
|
|
|
142
118
|
}
|
|
143
119
|
```
|
|
144
120
|
|
|
145
|
-
## Angular Usage
|
|
146
|
-
|
|
147
|
-
In Angular Material/Radix packages, `DataGridTable` accepts a single `propsInput` property:
|
|
148
|
-
|
|
149
|
-
```typescript
|
|
150
|
-
|
|
151
|
-
@Component({
|
|
152
|
-
selector: 'app-my-grid',
|
|
153
|
-
standalone: true,
|
|
154
|
-
imports: [DataGridTableComponent],
|
|
155
|
-
template: `
|
|
156
|
-
<ogrid-datagrid-table [propsInput]="gridProps" />
|
|
157
|
-
`
|
|
158
|
-
})
|
|
159
|
-
export class MyGridComponent {
|
|
160
|
-
ogridService = new OGridService<Product>();
|
|
161
|
-
gridProps = this.ogridService.getDataGridProps();
|
|
162
|
-
}
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
In Angular PrimeNG, `DataGridTable` uses individual `@Input()` properties matching the React prop names.
|
|
166
|
-
|
|
167
|
-
## Vue Usage
|
|
168
|
-
|
|
169
|
-
In Vue Vuetify/PrimeVue packages, `DataGridTable` accepts a single `:grid-props` prop:
|
|
170
|
-
|
|
171
|
-
```vue
|
|
172
|
-
<template>
|
|
173
|
-
<DataGridTable :grid-props="gridProps" />
|
|
174
|
-
</template>
|
|
175
|
-
|
|
176
|
-
<script setup lang="ts">
|
|
177
|
-
|
|
178
|
-
const { dataGridProps: gridProps } = useOGrid({ /* ... */ });
|
|
179
|
-
</script>
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
In Vue Radix, `DataGridTable` uses individual props via `defineProps<IOGridProps>()` (like React).
|
|
183
|
-
|
|
184
121
|
## Accessibility
|
|
185
122
|
|
|
186
123
|
`DataGridTable` implements WCAG 2.1 AA standards with comprehensive keyboard navigation and screen reader support.
|
|
@@ -15,30 +15,6 @@ A pagination UI component that displays page navigation buttons, current page in
|
|
|
15
15
|
|
|
16
16
|
```typescript
|
|
17
17
|
// or
|
|
18
|
-
// or
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
</TabItem>
|
|
22
|
-
<TabItem value="angular" label="Angular">
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
// or
|
|
26
|
-
// or
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
</TabItem>
|
|
30
|
-
<TabItem value="vue" label="Vue">
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
// or
|
|
34
|
-
// or
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
</TabItem>
|
|
38
|
-
<TabItem value="js" label="Vanilla JS">
|
|
39
|
-
|
|
40
|
-
```typescript
|
|
41
|
-
// PaginationControls is an internal component in vanilla JS
|
|
42
18
|
```
|
|
43
19
|
|
|
44
20
|
</TabItem>
|
|
@@ -132,76 +108,6 @@ function MyApp() {
|
|
|
132
108
|
}
|
|
133
109
|
```
|
|
134
110
|
|
|
135
|
-
## Angular Usage
|
|
136
|
-
|
|
137
|
-
In Angular packages, the component uses `@Input()` and `@Output()` decorators:
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
|
|
141
|
-
@Component({
|
|
142
|
-
selector: 'app-my-grid',
|
|
143
|
-
standalone: true,
|
|
144
|
-
imports: [PaginationControlsComponent],
|
|
145
|
-
template: `
|
|
146
|
-
<ogrid-pagination-controls
|
|
147
|
-
[currentPage]="currentPage"
|
|
148
|
-
[pageSize]="pageSize"
|
|
149
|
-
[totalCount]="totalCount"
|
|
150
|
-
(onPageChange)="handlePageChange($event)"
|
|
151
|
-
(onPageSizeChange)="handlePageSizeChange($event)"
|
|
152
|
-
[entityLabelPlural]="'users'"
|
|
153
|
-
/>
|
|
154
|
-
`
|
|
155
|
-
})
|
|
156
|
-
export class MyGridComponent {
|
|
157
|
-
currentPage = 1;
|
|
158
|
-
pageSize = 20;
|
|
159
|
-
totalCount = 500;
|
|
160
|
-
|
|
161
|
-
handlePageChange(page: number) {
|
|
162
|
-
this.currentPage = page;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
handlePageSizeChange(pageSize: number) {
|
|
166
|
-
this.pageSize = pageSize;
|
|
167
|
-
this.currentPage = 1; // Reset to first page
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
## Vue Usage
|
|
173
|
-
|
|
174
|
-
In Vue packages, the component accepts props via `v-bind` or shorthand `:`:
|
|
175
|
-
|
|
176
|
-
```vue
|
|
177
|
-
<template>
|
|
178
|
-
<PaginationControls
|
|
179
|
-
:current-page="currentPage"
|
|
180
|
-
:page-size="pageSize"
|
|
181
|
-
:total-count="totalCount"
|
|
182
|
-
@page-change="handlePageChange"
|
|
183
|
-
@page-size-change="handlePageSizeChange"
|
|
184
|
-
entity-label-plural="users"
|
|
185
|
-
/>
|
|
186
|
-
</template>
|
|
187
|
-
|
|
188
|
-
<script setup lang="ts">
|
|
189
|
-
|
|
190
|
-
const currentPage = ref(1);
|
|
191
|
-
const pageSize = ref(20);
|
|
192
|
-
const totalCount = ref(500);
|
|
193
|
-
|
|
194
|
-
const handlePageChange = (page: number) => {
|
|
195
|
-
currentPage.value = page;
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
const handlePageSizeChange = (size: number) => {
|
|
199
|
-
pageSize.value = size;
|
|
200
|
-
currentPage.value = 1; // Reset to first page
|
|
201
|
-
};
|
|
202
|
-
</script>
|
|
203
|
-
```
|
|
204
|
-
|
|
205
111
|
## Behavior
|
|
206
112
|
|
|
207
113
|
### Pagination Buttons
|
|
@@ -21,27 +21,6 @@ A collapsible sidebar panel that provides quick access to column visibility cont
|
|
|
21
21
|
The `SideBar` component is framework-agnostic and uses inline styles. All React UI packages (Radix, Fluent, Material) use the same `SideBar` from `@alaarab/ogrid-react`.
|
|
22
22
|
:::
|
|
23
23
|
|
|
24
|
-
</TabItem>
|
|
25
|
-
<TabItem value="angular" label="Angular">
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
// SideBar is rendered internally by OGridLayout in Angular packages
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
</TabItem>
|
|
32
|
-
<TabItem value="vue" label="Vue">
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
// SideBar is rendered internally by OGridLayout in Vue packages
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
</TabItem>
|
|
39
|
-
<TabItem value="js" label="Vanilla JS">
|
|
40
|
-
|
|
41
|
-
```typescript
|
|
42
|
-
// SideBar is an internal component in vanilla JS
|
|
43
|
-
```
|
|
44
|
-
|
|
45
24
|
</TabItem>
|
|
46
25
|
</Tabs>
|
|
47
26
|
|
|
@@ -224,61 +203,6 @@ function MyGrid() {
|
|
|
224
203
|
/>
|
|
225
204
|
```
|
|
226
205
|
|
|
227
|
-
## Angular Usage
|
|
228
|
-
|
|
229
|
-
In Angular packages, the sidebar is rendered internally by `OGridLayoutComponent` when `sideBar` is enabled:
|
|
230
|
-
|
|
231
|
-
```typescript
|
|
232
|
-
|
|
233
|
-
@Component({
|
|
234
|
-
selector: 'app-my-grid',
|
|
235
|
-
template: `
|
|
236
|
-
<ogrid [propsInput]="gridProps" />
|
|
237
|
-
`
|
|
238
|
-
})
|
|
239
|
-
export class MyGridComponent {
|
|
240
|
-
ogridService = new OGridService<Product>();
|
|
241
|
-
|
|
242
|
-
constructor() {
|
|
243
|
-
// Enable sidebar via props
|
|
244
|
-
this.ogridService.setProps({
|
|
245
|
-
sideBar: {
|
|
246
|
-
panels: ['columns', 'filters'],
|
|
247
|
-
defaultPanel: 'columns',
|
|
248
|
-
position: 'right',
|
|
249
|
-
},
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
gridProps = this.ogridService.getDataGridProps();
|
|
254
|
-
}
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
## Vue Usage
|
|
258
|
-
|
|
259
|
-
In Vue packages, the sidebar is rendered internally by `OGridLayout` when `sideBar` is enabled:
|
|
260
|
-
|
|
261
|
-
```vue
|
|
262
|
-
<template>
|
|
263
|
-
<OGrid
|
|
264
|
-
:data="products"
|
|
265
|
-
:columns="columns"
|
|
266
|
-
:get-row-id="(item) => item.id"
|
|
267
|
-
:side-bar="{
|
|
268
|
-
panels: ['columns', 'filters'],
|
|
269
|
-
defaultPanel: 'columns',
|
|
270
|
-
position: 'right',
|
|
271
|
-
}"
|
|
272
|
-
/>
|
|
273
|
-
</template>
|
|
274
|
-
|
|
275
|
-
<script setup lang="ts">
|
|
276
|
-
|
|
277
|
-
const products = [...];
|
|
278
|
-
const columns = [...];
|
|
279
|
-
</script>
|
|
280
|
-
```
|
|
281
|
-
|
|
282
206
|
## Behavior
|
|
283
207
|
|
|
284
208
|
### Tab Strip
|
|
@@ -15,28 +15,6 @@ A status bar component that displays row counts, filtered counts, selected count
|
|
|
15
15
|
|
|
16
16
|
```typescript
|
|
17
17
|
// or
|
|
18
|
-
// or
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
</TabItem>
|
|
22
|
-
<TabItem value="angular" label="Angular">
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
// StatusBar is rendered internally by DataGridTable in Angular packages
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
</TabItem>
|
|
29
|
-
<TabItem value="vue" label="Vue">
|
|
30
|
-
|
|
31
|
-
```typescript
|
|
32
|
-
// StatusBar is rendered internally by DataGridTable in Vue packages
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
</TabItem>
|
|
36
|
-
<TabItem value="js" label="Vanilla JS">
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
// StatusBar is an internal component in vanilla JS
|
|
40
18
|
```
|
|
41
19
|
|
|
42
20
|
</TabItem>
|
|
@@ -168,50 +146,6 @@ The status bar intelligently shows/hides sections based on available data:
|
|
|
168
146
|
|
|
169
147
|
Sections are separated by `|` (pipe) characters.
|
|
170
148
|
|
|
171
|
-
## Angular Usage
|
|
172
|
-
|
|
173
|
-
In Angular packages, the status bar is rendered internally by `DataGridTable` when `statusBar` is enabled. You don't need to import or use the component directly.
|
|
174
|
-
|
|
175
|
-
```typescript
|
|
176
|
-
|
|
177
|
-
@Component({
|
|
178
|
-
selector: 'app-my-grid',
|
|
179
|
-
template: `
|
|
180
|
-
<ogrid-datagrid-table [propsInput]="gridProps" />
|
|
181
|
-
`
|
|
182
|
-
})
|
|
183
|
-
export class MyGridComponent {
|
|
184
|
-
ogridService = new OGridService<Product>();
|
|
185
|
-
|
|
186
|
-
constructor() {
|
|
187
|
-
// Enable status bar via props
|
|
188
|
-
this.ogridService.setProps({ statusBar: true });
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
gridProps = this.ogridService.getDataGridProps();
|
|
192
|
-
}
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
## Vue Usage
|
|
196
|
-
|
|
197
|
-
In Vue packages, the status bar is rendered internally by `DataGridTable` when `statusBar` is enabled.
|
|
198
|
-
|
|
199
|
-
```vue
|
|
200
|
-
<template>
|
|
201
|
-
<DataGridTable :grid-props="gridProps" />
|
|
202
|
-
</template>
|
|
203
|
-
|
|
204
|
-
<script setup lang="ts">
|
|
205
|
-
|
|
206
|
-
const { dataGridProps: gridProps } = useOGrid({
|
|
207
|
-
data: products,
|
|
208
|
-
columns: columns,
|
|
209
|
-
getRowId: (item) => item.id,
|
|
210
|
-
statusBar: true, // Enable status bar
|
|
211
|
-
});
|
|
212
|
-
</script>
|
|
213
|
-
```
|
|
214
|
-
|
|
215
149
|
## Enabling in OGrid
|
|
216
150
|
|
|
217
151
|
The top-level `OGrid` component accepts a `statusBar` prop:
|