@genesislcap/grid-pro 14.278.0 → 14.278.2
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/README.md +254 -442
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -60,7 +60,233 @@ import { rapidGridComponents } from '@genesislcap/rapid-grid-pro';
|
|
|
60
60
|
provideDesignSystem().register(baseComponents, rapidGridComponents);
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
### Attributes
|
|
63
|
+
### Grid Pro Element Attributes
|
|
64
|
+
|
|
65
|
+
The `<grid-pro>` element supports the following attributes and properties:
|
|
66
|
+
|
|
67
|
+
#### Grid Attributes
|
|
68
|
+
|
|
69
|
+
|Name|Type|Default|Description|
|
|
70
|
+
|----|----|-------|-----------|
|
|
71
|
+
| `:rowData` | `any[]` | - | **Manual data**: Array of row data for scenarios where you set data manually without using datasource components. |
|
|
72
|
+
| `:gridComponents` | `{[componentName: string]: any}` | - | **Custom components**: Object containing custom AG Grid components (cell renderers, editors, filters). |
|
|
73
|
+
| `:eventsAndCallbacks` | `GridProEventsAndCallbacks` | - | **AG Grid events**: Object containing AG Grid event handlers and callbacks. |
|
|
74
|
+
| `:gridFontFace` | `string` | `defaultAgGridFontFace` | **Font configuration**: Font face configuration for AG Grid themes. |
|
|
75
|
+
| `auto-cell-renderer-by-type` | `boolean` | `false` | **Genesis-specific**: Enable automatic cell renderer selection by data type. |
|
|
76
|
+
| `only-template-col-defs` | `boolean` | `false` | **Genesis-specific**: Use only template-defined column definitions, ignore metadata. |
|
|
77
|
+
| `grid-autosizing` | `boolean` | `false` | **Important**: Controls automatic column sizing on interaction. Disables manual column widths and local storage persistence of widths. |
|
|
78
|
+
| `add-index` | `number` | `0` | Index position for new rows when using `applyTransaction` or `applyTransactionAsync`. |
|
|
79
|
+
| `async-add` | `boolean` | `false` | Use `applyTransactionAsync` for add transactions (better performance for large datasets). |
|
|
80
|
+
| `async-remove` | `boolean` | `false` | Use `applyTransactionAsync` for remove transactions (better performance for large datasets). |
|
|
81
|
+
| `async-update` | `boolean` | `true` | Use `applyTransactionAsync` for update transactions (enabled by default for performance). |
|
|
82
|
+
| `enable-cell-flashing` | `boolean` | `false` | Enable cell flashing animations when cell values change. |
|
|
83
|
+
| `enable-row-flashing` | `boolean` | `false` | Enable row flashing animations for add transactions. |
|
|
84
|
+
| `enabled-row-flashing` | `boolean` | `false` | **@deprecated** - Use `enable-row-flashing` instead. |
|
|
85
|
+
| `persist-column-state-key` | `string` | - | **Key for persisting column state** in local browser or KV storage. Essential for maintaining user preferences. |
|
|
86
|
+
| `persist-filter-model-key` | `string` | - | **Key for persisting filter model** in local browser or KV storage. Maintains filter state across sessions. |
|
|
87
|
+
| `header-case-type` | `GridProCaseType` | `CONSTANT_CASE` | Transform header names: `camelCase`, `capitalCase`, `dotCase`, `headerCase`, `noCase`, `paramCase`, `pascalCase`, `pathCase`, `sentenceCase`, `snakeCase`. |
|
|
88
|
+
| `column-component-name` | `string` | `grid-pro-column` | **Internal**: Name of the column component to use. |
|
|
89
|
+
| `header-height` | `number` | - | Custom header height in pixels. Overrides theme defaults. |
|
|
90
|
+
| `row-height` | `number` | - | Custom row height in pixels. Overrides theme defaults. |
|
|
91
|
+
| `theme` | `string` | `alpine` | AG Grid theme name. Available: `alpine`, `alpine-dark`, `balham`, `balham-dark`, `material`. |
|
|
92
|
+
| `pagination` | `boolean` | `false` | **Enables pagination**. Basic pagination works with AG Grid Community edition. **Enterprise features** like custom pagination components require AG Grid Enterprise. Works with both client-side and server-side datasources. |
|
|
93
|
+
| `pagination-page-size` | `number` | `25` | Number of rows per page when pagination is enabled. |
|
|
94
|
+
| `with-status-bar` | `boolean` | `false` | **Enterprise Feature**: Enables status bar at bottom of grid. **Requires AG Grid Enterprise module**. |
|
|
95
|
+
| `:statusBarConfig` | `GridProStatusBarConfig` | `DEFAULT_STATUS_BAR_CONFIG` | **Enterprise Feature**: Configuration for status bar components. Must use binding syntax with observable property. |
|
|
96
|
+
|
|
97
|
+
#### Status Bar Configuration
|
|
98
|
+
|
|
99
|
+
**Enterprise License Required**: Status bar functionality requires the AG Grid Enterprise module. Status bar components will only be displayed if the Enterprise module is properly licensed and configured.
|
|
100
|
+
|
|
101
|
+
**Important Datasource Behavior:**
|
|
102
|
+
|
|
103
|
+
- **Client-side datasources**: All status bar components are available (`rows`, `maxRows`, `loadMore`, `reload`)
|
|
104
|
+
- **Server-side datasources**: `loadMore` component is **automatically disabled** and will not be shown, even if configured
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
interface GridProStatusBarConfig {
|
|
108
|
+
rows?: boolean; // Enable row count component (default: true)
|
|
109
|
+
maxRows?: boolean; // Enable max rows label-value component (default: false)
|
|
110
|
+
loadMore?: boolean | GridProStatusBarLoadMoreConfig; // Enable/configure load more button (CLIENT-SIDE ONLY)
|
|
111
|
+
reload?: boolean | GridProStatusBarReloadConfig; // Enable/configure reload button
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface GridProStatusBarLoadMoreConfig {
|
|
115
|
+
onLoadMore?: () => void; // Custom callback function (defaults to datasource.loadMore())
|
|
116
|
+
appearance?: string; // Button appearance: 'accent', 'lightweight', 'neutral', 'outline', 'stealth'
|
|
117
|
+
tooltip?: string; // Custom tooltip text
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface GridProStatusBarReloadConfig {
|
|
121
|
+
onReload?: () => void; // Custom callback function (defaults to datasource restart/reload)
|
|
122
|
+
icon?: string; // Custom icon name (default: 'refresh')
|
|
123
|
+
tooltip?: string; // Custom tooltip text
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Status Bar Component Availability by Datasource Type:**
|
|
128
|
+
|
|
129
|
+
| Component | Client-Side Datasource | Server-Side Datasource | Description |
|
|
130
|
+
|-----------|------------------------|-------------------------|-------------|
|
|
131
|
+
| `rows` | Available | Available | Shows row count information |
|
|
132
|
+
| `maxRows` | Available | Available | Shows maximum rows limit |
|
|
133
|
+
| `loadMore` | Available | **Disabled** | Load more button (infinite scroll alternative) |
|
|
134
|
+
| `reload` | Available | Available | Reload/refresh button |
|
|
135
|
+
|
|
136
|
+
**Complete Usage Examples:**
|
|
137
|
+
|
|
138
|
+
**1. Client-Side Grid with All Status Bar Components:**
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
@customElement({
|
|
142
|
+
name: 'client-side-grid-example',
|
|
143
|
+
template: html`
|
|
144
|
+
<grid-pro
|
|
145
|
+
pagination
|
|
146
|
+
pagination-page-size="50"
|
|
147
|
+
with-status-bar
|
|
148
|
+
:statusBarConfig="${(x) => x.clientStatusBarConfig}"
|
|
149
|
+
persist-column-state-key="client-grid-columns"
|
|
150
|
+
persist-filter-model-key="client-grid-filters"
|
|
151
|
+
enable-row-flashing
|
|
152
|
+
enable-cell-flashing
|
|
153
|
+
header-case-type="headerCase"
|
|
154
|
+
theme="alpine-dark"
|
|
155
|
+
async-update
|
|
156
|
+
auto-cell-renderer-by-type>
|
|
157
|
+
<grid-pro-client-side-datasource
|
|
158
|
+
resource-name="ALL_TRADES"
|
|
159
|
+
max-rows="1000"
|
|
160
|
+
></grid-pro-client-side-datasource>
|
|
161
|
+
</grid-pro>
|
|
162
|
+
`
|
|
163
|
+
})
|
|
164
|
+
export class ClientSideGridExample extends GenesisElement {
|
|
165
|
+
// Client-side datasource: ALL status bar components available
|
|
166
|
+
@observable clientStatusBarConfig: GridProStatusBarConfig = {
|
|
167
|
+
rows: true, // Available
|
|
168
|
+
maxRows: true, // Available
|
|
169
|
+
loadMore: { // Available - shows load more button
|
|
170
|
+
appearance: 'accent',
|
|
171
|
+
tooltip: 'Load more trades from server'
|
|
172
|
+
},
|
|
173
|
+
reload: { // Available
|
|
174
|
+
tooltip: 'Refresh all trade data'
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**2. Server-Side Grid (loadMore Automatically Disabled):**
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
@customElement({
|
|
184
|
+
name: 'server-side-grid-example',
|
|
185
|
+
template: html`
|
|
186
|
+
<grid-pro
|
|
187
|
+
pagination
|
|
188
|
+
pagination-page-size="100"
|
|
189
|
+
with-status-bar
|
|
190
|
+
:statusBarConfig="${(x) => x.serverStatusBarConfig}"
|
|
191
|
+
persist-column-state-key="server-grid-columns"
|
|
192
|
+
enable-row-flashing
|
|
193
|
+
theme="balham">
|
|
194
|
+
<grid-pro-server-side-datasource
|
|
195
|
+
resource-name="ALL_TRADES"
|
|
196
|
+
max-rows="500"
|
|
197
|
+
></grid-pro-server-side-datasource>
|
|
198
|
+
</grid-pro>
|
|
199
|
+
`
|
|
200
|
+
})
|
|
201
|
+
export class ServerSideGridExample extends GenesisElement {
|
|
202
|
+
// Server-side datasource: loadMore automatically disabled
|
|
203
|
+
@observable serverStatusBarConfig: GridProStatusBarConfig = {
|
|
204
|
+
rows: true, // Available - shows row counts
|
|
205
|
+
maxRows: true, // Available - shows max rows info
|
|
206
|
+
loadMore: true, // DISABLED - even if true, will not show (by design when it is a server-side datasource)
|
|
207
|
+
reload: { // Available - shows reload button
|
|
208
|
+
tooltip: 'Refresh trade data from server'
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**3. Manual Data Grid with Custom Components:**
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
@customElement({
|
|
218
|
+
name: 'manual-data-grid',
|
|
219
|
+
template: html`
|
|
220
|
+
<grid-pro
|
|
221
|
+
:rowData="${(x) => x.rowData}"
|
|
222
|
+
:gridComponents="${(x) => x.gridComponents}"
|
|
223
|
+
:eventsAndCallbacks="${(x) => x.eventsAndCallbacks}"
|
|
224
|
+
theme="balham"
|
|
225
|
+
header-height="50"
|
|
226
|
+
persist-column-state-key="manual-grid-state"
|
|
227
|
+
enable-cell-flashing>
|
|
228
|
+
</grid-pro>
|
|
229
|
+
`
|
|
230
|
+
})
|
|
231
|
+
export class ManualDataGrid extends GenesisElement {
|
|
232
|
+
@observable rowData = [
|
|
233
|
+
{ id: 1, name: 'John Doe', age: 30, department: 'Engineering' },
|
|
234
|
+
{ id: 2, name: 'Jane Smith', age: 25, department: 'Marketing' },
|
|
235
|
+
// ... more data
|
|
236
|
+
];
|
|
237
|
+
|
|
238
|
+
@observable gridComponents = {
|
|
239
|
+
customRenderer: CustomCellRenderer,
|
|
240
|
+
customEditor: CustomCellEditor,
|
|
241
|
+
customFilter: CustomFilter
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
@observable eventsAndCallbacks = {
|
|
245
|
+
onCellValueChanged: (event) => {
|
|
246
|
+
console.log('Cell value changed:', event);
|
|
247
|
+
// Handle cell value changes
|
|
248
|
+
},
|
|
249
|
+
onRowSelected: (event) => {
|
|
250
|
+
console.log('Row selected:', event);
|
|
251
|
+
// Handle row selection
|
|
252
|
+
},
|
|
253
|
+
onGridReady: (event) => {
|
|
254
|
+
console.log('Grid ready:', event);
|
|
255
|
+
// Grid initialization complete
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
**4. Theme and Font Customization:**
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
@customElement({
|
|
265
|
+
name: 'themed-grid',
|
|
266
|
+
template: html`
|
|
267
|
+
<grid-pro
|
|
268
|
+
theme="material"
|
|
269
|
+
:gridFontFace="${(x) => x.customFontFace}"
|
|
270
|
+
header-height="48"
|
|
271
|
+
row-height="42"
|
|
272
|
+
header-case-type="sentenceCase">
|
|
273
|
+
<grid-pro-server-side-datasource
|
|
274
|
+
resource-name="ALL_POSITIONS"
|
|
275
|
+
></grid-pro-server-side-datasource>
|
|
276
|
+
</grid-pro>
|
|
277
|
+
`
|
|
278
|
+
})
|
|
279
|
+
export class ThemedGrid extends GenesisElement {
|
|
280
|
+
@observable customFontFace = `
|
|
281
|
+
@font-face {
|
|
282
|
+
font-family: 'CustomGridFont';
|
|
283
|
+
src: url('path/to/custom-font.woff2') format('woff2');
|
|
284
|
+
}
|
|
285
|
+
`;
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Datasource Attributes
|
|
64
290
|
|
|
65
291
|
There are many attributes that can be set on a datasource component.
|
|
66
292
|
|
|
@@ -112,7 +338,6 @@ There are additional attributes that can affect the behavior of a datasource com
|
|
|
112
338
|
|
|
113
339
|
|Name|Type|Default|Description|
|
|
114
340
|
|----|----|-------|-----------|
|
|
115
|
-
| `pagination` | `boolean` | `false` | This option enables pagination if set to true, otherwise the behavior will be infinite-scroll.|
|
|
116
341
|
| `zero-based-view-number` | `boolean` | `false` | This option, if set to true, will make the starting VIEW_NUMBER zero-based (starting from 0 instead of 1).|
|
|
117
342
|
| `live-updates` | `boolean` | `false` | This option enables live updates for the grid if set to true.|
|
|
118
343
|
|
|
@@ -364,38 +589,38 @@ It's important to note that any client app can implement the other Row Models to
|
|
|
364
589
|
|
|
365
590
|
| Feature | Client-Side | Server-Side | Notes |
|
|
366
591
|
| --- | --- |--- | --- |
|
|
367
|
-
| All Data in Client |
|
|
368
|
-
| Fetch Data as User Scrolls |
|
|
592
|
+
| All Data in Client | Yes | No | Free |
|
|
593
|
+
| Fetch Data as User Scrolls | No | Yes | Free |
|
|
369
594
|
| Row Sorting | (client) | (client OR server) our component is server-only | Free |
|
|
370
595
|
| Row Filtering | (client) | (client OR server) our component is server-only | Free |
|
|
371
|
-
| Quick Filter |
|
|
372
|
-
| Floating Filters |
|
|
373
|
-
| Dynamic Row Height |
|
|
596
|
+
| Quick Filter | Yes | Yes | Free |
|
|
597
|
+
| Floating Filters | Yes | Yes | Free |
|
|
598
|
+
| Dynamic Row Height | Yes | Yes | Free |
|
|
374
599
|
| Row Grouping | (client) | (server) | Paid (Enterprise) |
|
|
375
600
|
| Row Pivoting | (client) | (server) | Paid (Enterprise) |
|
|
376
|
-
| Lazy Loading Row Groups |
|
|
601
|
+
| Lazy Loading Row Groups | No | Yes | Paid (Enterprise) |
|
|
377
602
|
| Value Aggregation | (client) | (server) | Paid (Enterprise) |
|
|
378
|
-
| Row Selection |
|
|
379
|
-
| Specify Selectable Rows |
|
|
380
|
-
| Header Checkbox Selection |
|
|
381
|
-
| Range Selection |
|
|
382
|
-
| Column Spanning |
|
|
383
|
-
| Column Pinning |
|
|
384
|
-
| Row Pinning |
|
|
385
|
-
| Pagination |
|
|
386
|
-
| Custom Filters |
|
|
387
|
-
| Cell Editors |
|
|
388
|
-
| Cell Renderers |
|
|
389
|
-
| Value Getter |
|
|
390
|
-
| Value Setter |
|
|
391
|
-
| Value Formatter |
|
|
392
|
-
| Value Parser |
|
|
393
|
-
| Full Width Rows |
|
|
394
|
-
| CSV Export |
|
|
395
|
-
| Excel Export |
|
|
396
|
-
| Clipboard Copy & Paste |
|
|
397
|
-
| Update via Transaction |
|
|
398
|
-
| Update via Async Transactions |
|
|
603
|
+
| Row Selection | Yes | Yes | Free |
|
|
604
|
+
| Specify Selectable Rows | Yes | Yes | Free |
|
|
605
|
+
| Header Checkbox Selection | Yes | Yes | Free |
|
|
606
|
+
| Range Selection | Yes | Yes | Free |
|
|
607
|
+
| Column Spanning | Yes | Yes | Free |
|
|
608
|
+
| Column Pinning | Yes | Yes | Free |
|
|
609
|
+
| Row Pinning | Yes | Yes | Free |
|
|
610
|
+
| Pagination | Yes | Yes | Free |
|
|
611
|
+
| Custom Filters | Yes | Yes | Free |
|
|
612
|
+
| Cell Editors | Yes | Yes | Free |
|
|
613
|
+
| Cell Renderers | Yes | Yes | Free |
|
|
614
|
+
| Value Getter | Yes | Yes | Free |
|
|
615
|
+
| Value Setter | Yes | Yes | Free |
|
|
616
|
+
| Value Formatter | Yes | Yes | Free |
|
|
617
|
+
| Value Parser | Yes | Yes | Free |
|
|
618
|
+
| Full Width Rows | Yes | Yes | Free |
|
|
619
|
+
| CSV Export | Yes | (data on screen) | Free |
|
|
620
|
+
| Excel Export | Yes | (data on screen) | Paid (Enterprise) |
|
|
621
|
+
| Clipboard Copy & Paste | Yes | Yes | Free |
|
|
622
|
+
| Update via Transaction | Yes | Yes | Free |
|
|
623
|
+
| Update via Async Transactions | Yes | Yes | Free |
|
|
399
624
|
|
|
400
625
|
### Summary
|
|
401
626
|
|
|
@@ -434,419 +659,6 @@ By leveraging both DOM Virtualisation and Pagination, our "grid components" can
|
|
|
434
659
|
- **Scrolling**: As users scroll, DOM Virtualisation ensures only the visible rows and columns are rendered, maintaining performance.
|
|
435
660
|
- **Page Navigation**: Users can navigate through pages to access the full dataset without overwhelming the client.
|
|
436
661
|
|
|
437
|
-
## Status Bar and Pagination
|
|
438
|
-
|
|
439
|
-
The Grid Pro component supports a comprehensive status bar system at the bottom of the grid, along with flexible pagination options. The status bar can be configured with various panels to display information like row counts, custom content, and action buttons.
|
|
440
|
-
|
|
441
|
-
### Enterprise License Requirement
|
|
442
|
-
|
|
443
|
-
**Important**: Status bar functionality requires the AG Grid Enterprise module to be available. Status bar components will only be displayed if the Enterprise module is properly licensed and configured.
|
|
444
|
-
|
|
445
|
-
### Basic Status Bar Usage
|
|
446
|
-
|
|
447
|
-
The status bar can be enabled using the datasource attributes and configured through the `status-bar-config` attribute:
|
|
448
|
-
|
|
449
|
-
```html
|
|
450
|
-
<rapid-grid-pro>
|
|
451
|
-
<grid-pro-client-side-datasource
|
|
452
|
-
resource-name="ALL_TRADES"
|
|
453
|
-
with-status-bar="true"
|
|
454
|
-
status-bar-config='{"rows": true, "reload": true, "loadMore": true}'
|
|
455
|
-
></grid-pro-client-side-datasource>
|
|
456
|
-
</rapid-grid-pro>
|
|
457
|
-
```
|
|
458
|
-
|
|
459
|
-
### Status Bar Configuration Interface
|
|
460
|
-
|
|
461
|
-
The status bar can be configured using the `GridProStatusBarConfig` interface:
|
|
462
|
-
|
|
463
|
-
```typescript
|
|
464
|
-
interface GridProStatusBarConfig {
|
|
465
|
-
rows?: boolean; // Enable row count component (default: true)
|
|
466
|
-
maxRows?: boolean; // Enable max rows label-value component (default: false)
|
|
467
|
-
loadMore?: boolean | GridProStatusBarLoadMoreConfig; // Enable/configure load more button
|
|
468
|
-
reload?: boolean | GridProStatusBarReloadConfig; // Enable/configure reload button
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
interface GridProStatusBarLoadMoreConfig {
|
|
472
|
-
onLoadMore?: () => void; // Custom callback function
|
|
473
|
-
appearance?: string; // Button appearance: 'accent', 'lightweight', 'neutral', 'outline', 'stealth'
|
|
474
|
-
tooltip?: string; // Custom tooltip text (default: 'Load More')
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
interface GridProStatusBarReloadConfig {
|
|
478
|
-
onReload?: () => void; // Custom callback function
|
|
479
|
-
icon?: string; // Custom icon name (default: 'refresh')
|
|
480
|
-
tooltip?: string; // Custom tooltip text (default: 'Reload')
|
|
481
|
-
}
|
|
482
|
-
```
|
|
483
|
-
|
|
484
|
-
### Status Bar Configuration Examples
|
|
485
|
-
|
|
486
|
-
#### Basic Configuration
|
|
487
|
-
|
|
488
|
-
```typescript
|
|
489
|
-
// Simple boolean configuration
|
|
490
|
-
const statusBarConfig = {
|
|
491
|
-
rows: true,
|
|
492
|
-
maxRows: true,
|
|
493
|
-
loadMore: true,
|
|
494
|
-
reload: true
|
|
495
|
-
};
|
|
496
|
-
```
|
|
497
|
-
|
|
498
|
-
#### Advanced Configuration with Custom Callbacks
|
|
499
|
-
|
|
500
|
-
```typescript
|
|
501
|
-
// Advanced configuration with custom callbacks and styling
|
|
502
|
-
const statusBarConfig = {
|
|
503
|
-
rows: true,
|
|
504
|
-
maxRows: false,
|
|
505
|
-
loadMore: {
|
|
506
|
-
onLoadMore: () => {
|
|
507
|
-
console.log('Custom load more logic');
|
|
508
|
-
// Your custom load more implementation
|
|
509
|
-
},
|
|
510
|
-
appearance: 'accent',
|
|
511
|
-
tooltip: 'Load 50 more records from server'
|
|
512
|
-
},
|
|
513
|
-
reload: {
|
|
514
|
-
onReload: () => {
|
|
515
|
-
console.log('Custom reload logic');
|
|
516
|
-
// Your custom reload implementation
|
|
517
|
-
},
|
|
518
|
-
icon: 'refresh',
|
|
519
|
-
tooltip: 'Refresh all data from server'
|
|
520
|
-
}
|
|
521
|
-
};
|
|
522
|
-
```
|
|
523
|
-
|
|
524
|
-
#### TypeScript Usage in Component
|
|
525
|
-
|
|
526
|
-
```typescript
|
|
527
|
-
import { GridProStatusBarConfig } from '@genesislcap/grid-pro';
|
|
528
|
-
|
|
529
|
-
@customElement({
|
|
530
|
-
name: 'my-grid-component',
|
|
531
|
-
template: html`
|
|
532
|
-
<rapid-grid-pro with-status-bar>
|
|
533
|
-
<grid-pro-client-side-datasource
|
|
534
|
-
resource-name="ALL_TRADES"
|
|
535
|
-
:status-bar-config=${(x) => x.statusBarConfig}
|
|
536
|
-
></grid-pro-client-side-datasource>
|
|
537
|
-
</rapid-grid-pro>
|
|
538
|
-
`
|
|
539
|
-
})
|
|
540
|
-
export class MyGridComponent extends GenesisElement {
|
|
541
|
-
@observable statusBarConfig: GridProStatusBarConfig = {
|
|
542
|
-
rows: true,
|
|
543
|
-
maxRows: true,
|
|
544
|
-
loadMore: {
|
|
545
|
-
appearance: 'outline',
|
|
546
|
-
tooltip: 'Load more trades from server'
|
|
547
|
-
},
|
|
548
|
-
reload: {
|
|
549
|
-
tooltip: 'Refresh trade data'
|
|
550
|
-
}
|
|
551
|
-
};
|
|
552
|
-
}
|
|
553
|
-
```
|
|
554
|
-
|
|
555
|
-
### Client-Side vs Server-Side Datasource Differences
|
|
556
|
-
|
|
557
|
-
#### Client-Side Datasource (`<grid-pro-client-side-datasource>`)
|
|
558
|
-
|
|
559
|
-
**Available Status Bar Components:**
|
|
560
|
-
|
|
561
|
-
- **Row Count**: Shows total and filtered row count (`agTotalAndFilteredRowCountComponent`)
|
|
562
|
-
- **Max Rows**: Shows the maximum rows limit
|
|
563
|
-
- **Load More**: Button to load additional rows from server
|
|
564
|
-
- **Reload**: Button to reload/refresh the datasource
|
|
565
|
-
- **Pagination**: Full pagination controls when pagination is enabled
|
|
566
|
-
|
|
567
|
-
**Example:**
|
|
568
|
-
|
|
569
|
-
```html
|
|
570
|
-
<rapid-grid-pro with-status-bar>
|
|
571
|
-
<grid-pro-client-side-datasource
|
|
572
|
-
resource-name="ALL_TRADES"
|
|
573
|
-
status-bar-config='{"rows": true, "maxRows": true, "loadMore": true, "reload": true}'
|
|
574
|
-
></grid-pro-client-side-datasource>
|
|
575
|
-
</rapid-grid-pro>
|
|
576
|
-
```
|
|
577
|
-
|
|
578
|
-
#### Server-Side Datasource (`<grid-pro-server-side-datasource>`)
|
|
579
|
-
|
|
580
|
-
**Available Status Bar Components:**
|
|
581
|
-
|
|
582
|
-
- **Row Count**: Shows total row count only (`agTotalRowCountComponent`)
|
|
583
|
-
- **Max Rows**: Shows the maximum rows limit
|
|
584
|
-
- **Load More**: **NOT AVAILABLE** - Server-side uses infinite scroll or pagination instead
|
|
585
|
-
- **Reload**: Button to reload/refresh the datasource
|
|
586
|
-
- **Pagination**: Full pagination controls when pagination is enabled
|
|
587
|
-
|
|
588
|
-
**Important Notes:**
|
|
589
|
-
|
|
590
|
-
- Load More button is **automatically disabled** for server-side datasources
|
|
591
|
-
- Server-side row model handles data loading through infinite scroll or pagination
|
|
592
|
-
- Row count component shows total rows (not filtered count due to server limitations)
|
|
593
|
-
|
|
594
|
-
**Example:**
|
|
595
|
-
|
|
596
|
-
```html
|
|
597
|
-
<rapid-grid-pro with-status-bar>
|
|
598
|
-
<grid-pro-server-side-datasource
|
|
599
|
-
resource-name="ALL_TRADES"
|
|
600
|
-
status-bar-config='{"rows": true, "maxRows": true, "reload": true}'
|
|
601
|
-
pagination="true"
|
|
602
|
-
></grid-pro-server-side-datasource>
|
|
603
|
-
</rapid-grid-pro>
|
|
604
|
-
```
|
|
605
|
-
|
|
606
|
-
### Pagination
|
|
607
|
-
|
|
608
|
-
#### Basic Pagination Setup
|
|
609
|
-
|
|
610
|
-
```html
|
|
611
|
-
<!-- Client-side pagination -->
|
|
612
|
-
<rapid-grid-pro pagination="true" pagination-page-size="25" with-status-bar="true">
|
|
613
|
-
<grid-pro-client-side-datasource
|
|
614
|
-
resource-name="ALL_TRADES"
|
|
615
|
-
></grid-pro-client-side-datasource>
|
|
616
|
-
</rapid-grid-pro>
|
|
617
|
-
|
|
618
|
-
<!-- Server-side pagination -->
|
|
619
|
-
<rapid-grid-pro pagination="true" with-status-bar="true">
|
|
620
|
-
<grid-pro-server-side-datasource
|
|
621
|
-
resource-name="ALL_TRADES"
|
|
622
|
-
max-rows="50"
|
|
623
|
-
></grid-pro-server-side-datasource>
|
|
624
|
-
</rapid-grid-pro>
|
|
625
|
-
```
|
|
626
|
-
|
|
627
|
-
#### Pagination with Custom Status Bar
|
|
628
|
-
|
|
629
|
-
When pagination is enabled, Grid Pro automatically:
|
|
630
|
-
|
|
631
|
-
- Adds pagination controls to the status bar
|
|
632
|
-
- Suppresses the default AG Grid pagination panel
|
|
633
|
-
- Positions pagination controls on the right side of the status bar
|
|
634
|
-
|
|
635
|
-
```html
|
|
636
|
-
<rapid-grid-pro pagination="true" with-status-bar="true">
|
|
637
|
-
<grid-pro-client-side-datasource
|
|
638
|
-
resource-name="ALL_TRADES"
|
|
639
|
-
status-bar-config='{"rows": true, "reload": true}'
|
|
640
|
-
></grid-pro-client-side-datasource>
|
|
641
|
-
</rapid-grid-pro>
|
|
642
|
-
```
|
|
643
|
-
|
|
644
|
-
**Default Status Bar Layout with Pagination:**
|
|
645
|
-
|
|
646
|
-
- Left: Row count component (`agTotalAndFilteredRowCountComponent` for client-side, `agTotalRowCountComponent` for server-side)
|
|
647
|
-
- Right: Pagination controls with navigation buttons and page information
|
|
648
|
-
|
|
649
|
-
### Built-in AG Grid Status Bar Panels
|
|
650
|
-
|
|
651
|
-
Grid Pro supports all standard AG Grid status bar panels:
|
|
652
|
-
|
|
653
|
-
- `agTotalRowCountComponent`: Displays the total row count
|
|
654
|
-
- `agTotalAndFilteredRowCountComponent`: Displays the total and filtered row count
|
|
655
|
-
- `agFilteredRowCountComponent`: Displays the filtered row count
|
|
656
|
-
- `agSelectedRowCountComponent`: Displays the selected row count
|
|
657
|
-
- `agAggregationComponent`: Displays aggregations for the selected range
|
|
658
|
-
|
|
659
|
-
### Custom Status Bar Components
|
|
660
|
-
|
|
661
|
-
Grid Pro provides several custom status bar components accessible through the `GridProStatusBarTypes` enum:
|
|
662
|
-
|
|
663
|
-
#### LabelValueStatusBarComponent
|
|
664
|
-
|
|
665
|
-
A flexible component that displays a label and value pair:
|
|
666
|
-
|
|
667
|
-
```typescript
|
|
668
|
-
import { GridProStatusBarTypes } from '@genesislcap/grid-pro';
|
|
669
|
-
|
|
670
|
-
// In your grid options:
|
|
671
|
-
statusBar: {
|
|
672
|
-
statusPanels: [
|
|
673
|
-
{
|
|
674
|
-
statusPanel: GridProStatusBarTypes.labelValue,
|
|
675
|
-
statusPanelParams: {
|
|
676
|
-
label: 'Max Rows',
|
|
677
|
-
value: 250,
|
|
678
|
-
hide: false
|
|
679
|
-
},
|
|
680
|
-
align: 'left',
|
|
681
|
-
},
|
|
682
|
-
],
|
|
683
|
-
},
|
|
684
|
-
```
|
|
685
|
-
|
|
686
|
-
#### LoadMoreStatusBarComponent
|
|
687
|
-
|
|
688
|
-
A button component that allows users to load additional rows (client-side only):
|
|
689
|
-
|
|
690
|
-
```typescript
|
|
691
|
-
import { GridProStatusBarTypes } from '@genesislcap/grid-pro';
|
|
692
|
-
|
|
693
|
-
// In your grid options:
|
|
694
|
-
statusBar: {
|
|
695
|
-
statusPanels: [
|
|
696
|
-
{
|
|
697
|
-
statusPanel: GridProStatusBarTypes.loadMore,
|
|
698
|
-
statusPanelParams: {
|
|
699
|
-
onLoadMore: () => console.log('Loading more data...'),
|
|
700
|
-
appearance: 'outline',
|
|
701
|
-
tooltip: 'Load more rows from server'
|
|
702
|
-
},
|
|
703
|
-
align: 'right',
|
|
704
|
-
},
|
|
705
|
-
],
|
|
706
|
-
},
|
|
707
|
-
```
|
|
708
|
-
|
|
709
|
-
#### ReloadStatusBarComponent
|
|
710
|
-
|
|
711
|
-
A refresh button component that allows users to reload the grid data:
|
|
712
|
-
|
|
713
|
-
```typescript
|
|
714
|
-
import { GridProStatusBarTypes } from '@genesislcap/grid-pro';
|
|
715
|
-
|
|
716
|
-
// In your grid options:
|
|
717
|
-
statusBar: {
|
|
718
|
-
statusPanels: [
|
|
719
|
-
{
|
|
720
|
-
statusPanel: GridProStatusBarTypes.reload,
|
|
721
|
-
statusPanelParams: {
|
|
722
|
-
onReload: () => console.log('Reloading data...'),
|
|
723
|
-
icon: 'refresh',
|
|
724
|
-
tooltip: 'Reload the datasource'
|
|
725
|
-
},
|
|
726
|
-
align: 'right',
|
|
727
|
-
},
|
|
728
|
-
],
|
|
729
|
-
},
|
|
730
|
-
```
|
|
731
|
-
|
|
732
|
-
#### PaginationStatusBarComponent
|
|
733
|
-
|
|
734
|
-
A pagination control component that provides navigation buttons and page information:
|
|
735
|
-
|
|
736
|
-
```typescript
|
|
737
|
-
import { GridProStatusBarTypes } from '@genesislcap/grid-pro';
|
|
738
|
-
|
|
739
|
-
// In your grid options:
|
|
740
|
-
statusBar: {
|
|
741
|
-
statusPanels: [
|
|
742
|
-
{ statusPanel: 'agTotalAndFilteredRowCountComponent', align: 'left' },
|
|
743
|
-
{ statusPanel: GridProStatusBarTypes.pagination, align: 'right' },
|
|
744
|
-
],
|
|
745
|
-
},
|
|
746
|
-
```
|
|
747
|
-
|
|
748
|
-
### Manual Status Bar Configuration
|
|
749
|
-
|
|
750
|
-
You can also manually configure the status bar using direct grid options:
|
|
751
|
-
|
|
752
|
-
```typescript
|
|
753
|
-
import { GridProStatusBarTypes } from '@genesislcap/grid-pro';
|
|
754
|
-
|
|
755
|
-
const gridOptions = {
|
|
756
|
-
statusBar: {
|
|
757
|
-
statusPanels: [
|
|
758
|
-
{ statusPanel: 'agTotalAndFilteredRowCountComponent', align: 'left' },
|
|
759
|
-
{
|
|
760
|
-
statusPanel: GridProStatusBarTypes.labelValue,
|
|
761
|
-
statusPanelParams: { label: 'Active Records', value: 1250 },
|
|
762
|
-
align: 'center'
|
|
763
|
-
},
|
|
764
|
-
{
|
|
765
|
-
statusPanel: GridProStatusBarTypes.reload,
|
|
766
|
-
statusPanelParams: {
|
|
767
|
-
tooltip: 'Refresh all data'
|
|
768
|
-
},
|
|
769
|
-
align: 'right'
|
|
770
|
-
},
|
|
771
|
-
],
|
|
772
|
-
},
|
|
773
|
-
};
|
|
774
|
-
```
|
|
775
|
-
|
|
776
|
-
### Complete Usage Examples
|
|
777
|
-
|
|
778
|
-
#### Client-Side with Full Status Bar
|
|
779
|
-
|
|
780
|
-
```html
|
|
781
|
-
<rapid-grid-pro
|
|
782
|
-
pagination="true"
|
|
783
|
-
pagination-page-size="50"
|
|
784
|
-
with-status-bar="true">
|
|
785
|
-
<grid-pro-client-side-datasource
|
|
786
|
-
resource-name="ALL_TRADES"
|
|
787
|
-
max-rows="500"
|
|
788
|
-
status-bar-config='{
|
|
789
|
-
"rows": true,
|
|
790
|
-
"maxRows": true,
|
|
791
|
-
"loadMore": {
|
|
792
|
-
"appearance": "accent",
|
|
793
|
-
"tooltip": "Load 50 more trades"
|
|
794
|
-
},
|
|
795
|
-
"reload": {
|
|
796
|
-
"tooltip": "Refresh trade data"
|
|
797
|
-
}
|
|
798
|
-
}'
|
|
799
|
-
></grid-pro-client-side-datasource>
|
|
800
|
-
</rapid-grid-pro>
|
|
801
|
-
```
|
|
802
|
-
|
|
803
|
-
#### Server-Side with Pagination
|
|
804
|
-
|
|
805
|
-
```html
|
|
806
|
-
<rapid-grid-pro
|
|
807
|
-
pagination="true"
|
|
808
|
-
with-status-bar="true">
|
|
809
|
-
<grid-pro-server-side-datasource
|
|
810
|
-
resource-name="ALL_TRADES"
|
|
811
|
-
max-rows="100"
|
|
812
|
-
status-bar-config='{
|
|
813
|
-
"rows": true,
|
|
814
|
-
"maxRows": true,
|
|
815
|
-
"reload": true
|
|
816
|
-
}'
|
|
817
|
-
></grid-pro-server-side-datasource>
|
|
818
|
-
</rapid-grid-pro>
|
|
819
|
-
```
|
|
820
|
-
|
|
821
|
-
#### Infinite Scroll with Minimal Status Bar
|
|
822
|
-
|
|
823
|
-
```html
|
|
824
|
-
<rapid-grid-pro with-status-bar="true">
|
|
825
|
-
<grid-pro-server-side-datasource
|
|
826
|
-
resource-name="ALL_TRADES"
|
|
827
|
-
max-rows="50"
|
|
828
|
-
status-bar-config='{"rows": true, "reload": true}'
|
|
829
|
-
></grid-pro-server-side-datasource>
|
|
830
|
-
</rapid-grid-pro>
|
|
831
|
-
```
|
|
832
|
-
|
|
833
|
-
### Accessibility Features
|
|
834
|
-
|
|
835
|
-
All status bar components include comprehensive accessibility support:
|
|
836
|
-
|
|
837
|
-
- **ARIA labels** and **roles** for screen readers
|
|
838
|
-
- **Keyboard navigation** support (Tab, Enter, Space)
|
|
839
|
-
- **Focus management** and visual indicators
|
|
840
|
-
- **Semantic HTML** structure with proper landmarks
|
|
841
|
-
- **Tooltips** and **descriptions** for interactive elements
|
|
842
|
-
|
|
843
|
-
### Performance Considerations
|
|
844
|
-
|
|
845
|
-
- Status bar components are lightweight and optimized for performance
|
|
846
|
-
- Components are only rendered when enabled in configuration
|
|
847
|
-
- Event listeners are properly cleaned up when components are destroyed
|
|
848
|
-
- Status updates are debounced to prevent excessive re-renders
|
|
849
|
-
|
|
850
662
|
## License
|
|
851
663
|
|
|
852
664
|
Note: this project provides front-end dependencies and uses licensed components listed in the next section; thus, licenses for those components are required during development. Contact [Genesis Global](https://genesis.global/contact-us/) for more details.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/grid-pro",
|
|
3
3
|
"description": "Genesis Foundation AG Grid",
|
|
4
|
-
"version": "14.278.
|
|
4
|
+
"version": "14.278.2",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -38,20 +38,20 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@genesislcap/foundation-testing": "14.278.
|
|
42
|
-
"@genesislcap/genx": "14.278.
|
|
43
|
-
"@genesislcap/rollup-builder": "14.278.
|
|
44
|
-
"@genesislcap/ts-builder": "14.278.
|
|
45
|
-
"@genesislcap/uvu-playwright-builder": "14.278.
|
|
46
|
-
"@genesislcap/vite-builder": "14.278.
|
|
47
|
-
"@genesislcap/webpack-builder": "14.278.
|
|
41
|
+
"@genesislcap/foundation-testing": "14.278.2",
|
|
42
|
+
"@genesislcap/genx": "14.278.2",
|
|
43
|
+
"@genesislcap/rollup-builder": "14.278.2",
|
|
44
|
+
"@genesislcap/ts-builder": "14.278.2",
|
|
45
|
+
"@genesislcap/uvu-playwright-builder": "14.278.2",
|
|
46
|
+
"@genesislcap/vite-builder": "14.278.2",
|
|
47
|
+
"@genesislcap/webpack-builder": "14.278.2",
|
|
48
48
|
"rimraf": "^5.0.0"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@genesislcap/foundation-comms": "14.278.
|
|
52
|
-
"@genesislcap/foundation-logger": "14.278.
|
|
53
|
-
"@genesislcap/foundation-ui": "14.278.
|
|
54
|
-
"@genesislcap/foundation-utils": "14.278.
|
|
51
|
+
"@genesislcap/foundation-comms": "14.278.2",
|
|
52
|
+
"@genesislcap/foundation-logger": "14.278.2",
|
|
53
|
+
"@genesislcap/foundation-ui": "14.278.2",
|
|
54
|
+
"@genesislcap/foundation-utils": "14.278.2",
|
|
55
55
|
"@microsoft/fast-colors": "5.3.1",
|
|
56
56
|
"@microsoft/fast-components": "2.30.6",
|
|
57
57
|
"@microsoft/fast-element": "1.14.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"access": "public"
|
|
78
78
|
},
|
|
79
79
|
"customElements": "dist/custom-elements.json",
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "2c6ab52f798c70513a1638647e4be88fd4a91f10"
|
|
81
81
|
}
|