@genesislcap/grid-pro 15.24.2 → 15.25.0-FUI-2611.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 (39) hide show
  1. package/dist/custom-elements.json +557 -43
  2. package/dist/dts/datasource/base.datasource.d.ts +70 -7
  3. package/dist/dts/datasource/base.datasource.d.ts.map +1 -1
  4. package/dist/dts/datasource/base.types.d.ts +27 -0
  5. package/dist/dts/datasource/base.types.d.ts.map +1 -1
  6. package/dist/dts/datasource/delivered-block.ledger.d.ts +32 -0
  7. package/dist/dts/datasource/delivered-block.ledger.d.ts.map +1 -0
  8. package/dist/dts/datasource/infinite.datasource.d.ts +33 -1
  9. package/dist/dts/datasource/infinite.datasource.d.ts.map +1 -1
  10. package/dist/dts/datasource/infinite.resource.d.ts +59 -6
  11. package/dist/dts/datasource/infinite.resource.d.ts.map +1 -1
  12. package/dist/dts/datasource/server-side.datasource.d.ts +14 -4
  13. package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
  14. package/dist/dts/datasource/server-side.resource-base.d.ts +24 -0
  15. package/dist/dts/datasource/server-side.resource-base.d.ts.map +1 -1
  16. package/dist/dts/datasource/server-side.resource-dataserver.d.ts +26 -0
  17. package/dist/dts/datasource/server-side.resource-dataserver.d.ts.map +1 -1
  18. package/dist/dts/datasource/server-side.resource-reqrep.d.ts.map +1 -1
  19. package/dist/dts/grid-pro-beta.d.ts +6 -0
  20. package/dist/dts/grid-pro-beta.d.ts.map +1 -1
  21. package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts +4 -0
  22. package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts.map +1 -1
  23. package/dist/dts/grid-pro.d.ts.map +1 -1
  24. package/dist/dts/react.d.ts +1 -1
  25. package/dist/esm/datasource/base.datasource.js +177 -23
  26. package/dist/esm/datasource/delivered-block.ledger.js +59 -0
  27. package/dist/esm/datasource/infinite.datasource.js +61 -17
  28. package/dist/esm/datasource/infinite.resource.js +59 -10
  29. package/dist/esm/datasource/server-side.datasource.js +73 -25
  30. package/dist/esm/datasource/server-side.resource-base.js +43 -0
  31. package/dist/esm/datasource/server-side.resource-dataserver.js +77 -17
  32. package/dist/esm/datasource/server-side.resource-reqrep.js +12 -0
  33. package/dist/esm/grid-pro-beta.js +20 -2
  34. package/dist/esm/grid-pro.js +4 -1
  35. package/dist/grid-pro.api.json +35 -35
  36. package/dist/grid-pro.d.ts +212 -17
  37. package/dist/react.cjs +6 -6
  38. package/dist/react.mjs +6 -6
  39. package/package.json +13 -13
@@ -461,11 +461,25 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
461
461
  */
462
462
  handleDataChanged(event) {
463
463
  const { changes } = event.detail;
464
- if (!this.gridApi)
464
+ // Every datasource emits this for consumers, but only the client-side row model takes row
465
+ // transactions: the infinite and server-side datasources drive the grid through
466
+ // refresh-infinite-cache / apply-server-side-transaction, and applyTransaction on those
467
+ // models is a no-op that logs an AG Grid warning per event.
468
+ if (!this.gridApi || !this.isClientSideRowModel)
465
469
  return;
466
470
  const result = this.gridApi.applyTransaction(changes);
467
471
  this.flashAddedCells(result === null || result === void 0 ? void 0 : result.add);
468
472
  }
473
+ /**
474
+ * Whether the live grid runs AG Grid's client-side row model (the default when the datasource
475
+ * set no `rowModelType`).
476
+ * @internal
477
+ */
478
+ get isClientSideRowModel() {
479
+ var _a, _b, _c;
480
+ const rowModelType = (_c = (_b = (_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.getGridOption) === null || _b === void 0 ? void 0 : _b.call(_a, 'rowModelType')) !== null && _c !== void 0 ? _c : 'clientSide';
481
+ return rowModelType === 'clientSide';
482
+ }
469
483
  flashAddedCells(rowNodes) {
470
484
  if (this.enableRowFlashing && (rowNodes === null || rowNodes === void 0 ? void 0 : rowNodes.length)) {
471
485
  this.gridApi.flashCells({ rowNodes });
@@ -578,7 +592,11 @@ export class GridProBeta extends LifecycleMixin(FoundationElement) {
578
592
  if (includeSchema) {
579
593
  this.gridApi.setGridOption('columnDefs', []);
580
594
  }
581
- this.gridApi.setGridOption('rowData', []);
595
+ // rowData belongs to the client-side row model; the infinite and server-side caches are
596
+ // cleared by their own refresh / transaction events.
597
+ if (this.isClientSideRowModel) {
598
+ this.gridApi.setGridOption('rowData', []);
599
+ }
582
600
  this.gridApi.refreshCells({ force: true });
583
601
  }
584
602
  /**
@@ -414,7 +414,10 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
414
414
  handleDataChanged(event) {
415
415
  var _a, _b, _c;
416
416
  const { changes } = event.detail;
417
- if (!this.gridApi)
417
+ // Every datasource emits this for consumers, but row transactions are a client-side row
418
+ // model API: the server-side datasource drives the grid through apply-server-side-transaction,
419
+ // and applyTransaction on that model is a no-op that logs an AG Grid warning per event.
420
+ if (!this.gridApi || this.isServerSide)
418
421
  return;
419
422
  if (((_a = changes.add) === null || _a === void 0 ? void 0 : _a.length) > 0) {
420
423
  if (this.asyncAdd) {
@@ -4497,7 +4497,7 @@
4497
4497
  },
4498
4498
  {
4499
4499
  "kind": "Content",
4500
- "text": "{\n add?: any[];\n remove?: any[];\n update?: any[];\n insertIndex?: number;\n }"
4500
+ "text": "{\n add?: any[];\n remove?: any[];\n update?: any[];\n addIndex?: number;\n insertIndex?: number;\n }"
4501
4501
  },
4502
4502
  {
4503
4503
  "kind": "Content",
@@ -17160,6 +17160,37 @@
17160
17160
  "isProtected": false,
17161
17161
  "isAbstract": false
17162
17162
  },
17163
+ {
17164
+ "kind": "Property",
17165
+ "canonicalReference": "@genesislcap/grid-pro!GridProBaseDatasource#serializer:member",
17166
+ "docComment": "",
17167
+ "excerptTokens": [
17168
+ {
17169
+ "kind": "Content",
17170
+ "text": "serializer: "
17171
+ },
17172
+ {
17173
+ "kind": "Reference",
17174
+ "text": "JSONSerializer",
17175
+ "canonicalReference": "@genesislcap/foundation-utils!JSONSerializer:interface"
17176
+ },
17177
+ {
17178
+ "kind": "Content",
17179
+ "text": ";"
17180
+ }
17181
+ ],
17182
+ "isReadonly": false,
17183
+ "isOptional": false,
17184
+ "releaseTag": "Public",
17185
+ "name": "serializer",
17186
+ "propertyTypeTokenRange": {
17187
+ "startIndex": 1,
17188
+ "endIndex": 2
17189
+ },
17190
+ "isStatic": false,
17191
+ "isProtected": false,
17192
+ "isAbstract": false
17193
+ },
17163
17194
  {
17164
17195
  "kind": "Method",
17165
17196
  "canonicalReference": "@genesislcap/grid-pro!GridProBaseDatasource#setDisconnected:member(1)",
@@ -22864,7 +22895,7 @@
22864
22895
  {
22865
22896
  "kind": "Class",
22866
22897
  "canonicalReference": "@genesislcap/grid-pro!GridProInfiniteDatasource:class",
22867
- "docComment": "/**\n * A Genesis Datasource element for AG Grid's Infinite Row Model.\n *\n * @remarks\n *\n * The Infinite Row Model is part of AG Grid Community (free) and provides: - Lazy loading of data as user scrolls - Server-side sorting and filtering - Simple infinite scroll without grouping/aggregation - Live updates for DATASERVER resources: the DATA_LOGON stream the grid pages over pushes every change, so no flag or second subscription is needed\n *\n * REQUEST_SERVER resources are read on demand only - a change on the server shows up when the grid re-reads (scroll, filter/sort change, or an explicit refresh), not live. The exception is a write made through this session: a commit ACK for an event listed in `pollTriggerEvents` re-reads the loaded blocks, so entity-management CRUD is reflected immediately.\n *\n * Like the other datasources, consumer options passed as `deferredGridOptions` (including via entity-management's `gridOptions` with `datasource-type=\"infinite\"`) are merged over this element's defaults in `init()`.\n *\n * Use this instead of Server-Side Row Model when you don't need Enterprise features like row grouping, aggregation, or pivoting.\n *\n * @fires\n *\n * base-datasource-error - Fired when a datasource error is reported. detail: `BaseDatasourceErrorEventDetail`\n *\n * @fires\n *\n * datasource-error - Fired when a datasource error occurs (for grid integration). detail: `DatasourceErrorEventDetail`\n *\n * @fires\n *\n * base-datasource-connected - Fired when error state is cleared after connection succeeds\n *\n * @fires\n *\n * datasource-initialize - Fired to hand off infinite row model grid options. detail: `InitializeEventDetail`\n *\n * @fires\n *\n * datasource-init - Fired when the infinite grid model should initialize data\n *\n * @fires\n *\n * datasource-schema-updated - Fired when column metadata or defs are updated. detail: `SchemaUpdatedEventDetail`\n *\n * @fires\n *\n * set-infinite-datasource - Fired to attach or clear the infinite row model datasource. detail: `SetInfiniteDatasourceEventDetail`\n *\n * @fires\n *\n * refresh-infinite-cache - Fired to request an infinite row model refresh; `purge` drops the block cache and re-reads. detail: `RefreshInfiniteCacheEventDetail`\n *\n * @fires\n *\n * add-grid-css-class - Fired to add a CSS class on the grid host (hover sort indicators). detail: `GridCssClassEventDetail`\n *\n * @fires\n *\n * remove-grid-css-class - Fired to remove that CSS class from the grid host. detail: `GridCssClassEventDetail`\n *\n * @fires\n *\n * cache-filter-config - Fired to persist filter configuration for the grid\n *\n * @fires\n *\n * datasource-data-cleared - Fired when infinite row data is cleared. detail: `DataClearedEventDetail`\n *\n * @fires\n *\n * datasource-filters-restored - Fired when persisted filters are reapplied\n *\n * @see\n *\n * https://www.ag-grid.com/javascript-data-grid/infinite-scrolling/\n *\n * @beta\n */\n",
22898
+ "docComment": "/**\n * A Genesis Datasource element for AG Grid's Infinite Row Model.\n *\n * @remarks\n *\n * The Infinite Row Model is part of AG Grid Community (free) and provides: - Lazy loading of data as user scrolls - Server-side sorting and filtering - Simple infinite scroll without grouping/aggregation - Live updates for DATASERVER resources: the DATA_LOGON stream the grid pages over pushes every change, so no flag or second subscription is needed\n *\n * REQUEST_SERVER resources are read on demand only - a change on the server shows up when the grid re-reads (scroll, filter/sort change, or an explicit refresh), not live. The exception is a write made through this session: a commit ACK for an event listed in `pollTriggerEvents` re-reads the loaded blocks, so entity-management CRUD is reflected immediately.\n *\n * Like the other datasources, consumer options passed as `deferredGridOptions` (including via entity-management's `gridOptions` with `datasource-type=\"infinite\"`) are merged over this element's defaults in `init()`.\n *\n * Use this instead of Server-Side Row Model when you don't need Enterprise features like row grouping, aggregation, or pivoting.\n *\n * @fires\n *\n * base-datasource-error - Fired when a datasource error is reported. detail: `BaseDatasourceErrorEventDetail`\n *\n * @fires\n *\n * datasource-error - Fired when a datasource error occurs (for grid integration). detail: `DatasourceErrorEventDetail`\n *\n * @fires\n *\n * base-datasource-connected - Fired when error state is cleared after connection succeeds\n *\n * @fires\n *\n * datasource-initialize - Fired to hand off infinite row model grid options. detail: `InitializeEventDetail`\n *\n * @fires\n *\n * datasource-init - Fired when the infinite grid model should initialize data\n *\n * @fires\n *\n * datasource-schema-updated - Fired when column metadata or defs are updated. detail: `SchemaUpdatedEventDetail`\n *\n * @fires\n *\n * datasource-data-changed - Fired when rows are delivered to the grid, a DATASERVER push changes them, or a re-read no longer returns them; `add` are rows the grid did not hold before, `update` are held rows whose content changed, `remove` carries the row id. detail: `DataChangedEventDetail`\n *\n * @fires\n *\n * set-infinite-datasource - Fired to attach or clear the infinite row model datasource. detail: `SetInfiniteDatasourceEventDetail`\n *\n * @fires\n *\n * refresh-infinite-cache - Fired to request an infinite row model refresh; `purge` drops the block cache and re-reads. detail: `RefreshInfiniteCacheEventDetail`\n *\n * @fires\n *\n * add-grid-css-class - Fired to add a CSS class on the grid host (hover sort indicators). detail: `GridCssClassEventDetail`\n *\n * @fires\n *\n * remove-grid-css-class - Fired to remove that CSS class from the grid host. detail: `GridCssClassEventDetail`\n *\n * @fires\n *\n * cache-filter-config - Fired to persist filter configuration for the grid\n *\n * @fires\n *\n * datasource-data-cleared - Fired when the grid drops every row it held (reload, filter or sort change, destroy); `includeSchema` says whether the columns went too. detail: `DataClearedEventDetail`\n *\n * @fires\n *\n * datasource-filters-restored - Fired when persisted filters are reapplied\n *\n * @see\n *\n * https://www.ag-grid.com/javascript-data-grid/infinite-scrolling/\n *\n * @beta\n */\n",
22868
22899
  "excerptTokens": [
22869
22900
  {
22870
22901
  "kind": "Content",
@@ -23706,7 +23737,7 @@
23706
23737
  {
23707
23738
  "kind": "Class",
23708
23739
  "canonicalReference": "@genesislcap/grid-pro!GridProServerSideDatasource:class",
23709
- "docComment": "/**\n * A Genesis Datasource element, for server-side | SSRM-compatible data fetching and used exclusively by the GridPro element.\n *\n * @remarks\n *\n * Only supports Server-Side Row Model. Requires `@ag-grid-enterprise/server-side-row-model` setup and valid AG Grid Enterprise license.\n *\n * **Supported resources**: DATASERVER resources, and REQUEST_SERVER (req/rep) resources that declare `criteriaOnlyRequest`. A req/rep resource without it reports a `resource-type` error and no datasource is attached to the grid.\n *\n * **Custom Sort Indicators**: This datasource automatically applies custom sort indicators that are always visible (instead of only on hover). Sortable columns will show a subtle sort icon even when not sorted, and active sort indicators will be more prominent. The custom styling uses AG Grid's native icon font for consistency with the grid theme.\n *\n * @fires\n *\n * base-datasource-error - Fired when a datasource error is reported. detail: `BaseDatasourceErrorEventDetail`\n *\n * @fires\n *\n * datasource-error - Fired when a datasource error occurs (for grid integration). detail: `DatasourceErrorEventDetail`\n *\n * @fires\n *\n * base-datasource-connected - Fired when error state is cleared after connection succeeds\n *\n * @fires\n *\n * datasource-loading-finished - Fired when pending stream transactions are flushed with no row changes\n *\n * @fires\n *\n * datasource-no-data-available - Fired when loading finishes with an empty row set\n *\n * @fires\n *\n * datasource-data-changed - Fired when row data changes from applied stream transactions. detail: `DataChangedEventDetail`\n *\n * @fires\n *\n * cache-filter-config - Fired to persist filter configuration for the grid\n *\n * @fires\n *\n * refresh-server-side - Fired to request a server-side refresh. detail: `RefreshServerSideEventDetail`\n *\n * @fires\n *\n * set-server-side-datasource - Fired to attach or clear the server-side row model datasource\n *\n * @fires\n *\n * datasource-loading-started - Fired when a server-side load cycle starts\n *\n * @fires\n *\n * add-grid-css-class - Fired to add a CSS class on the grid host (e.g. server-side styling). detail: `GridCssClassEventDetail`\n *\n * @fires\n *\n * remove-grid-css-class - Fired to remove a CSS class from the grid host. detail: `GridCssClassEventDetail`\n *\n * @fires\n *\n * datasource-initialize - Fired to hand off server-side grid options. detail: `InitializeEventDetail`\n *\n * @fires\n *\n * datasource-init - Fired when the server-side grid model should initialize data\n *\n * @fires\n *\n * datasource-schema-updated - Fired when column metadata or defs are updated. detail: `SchemaUpdatedEventDetail`\n *\n * @fires\n *\n * datasource-filters-restored - Fired when persisted filters are reapplied\n *\n * @fires\n *\n * datasource-data-cleared - Fired when server-side row data is cleared. detail: `DataClearedEventDetail`\n *\n * @fires\n *\n * apply-server-side-transaction - Fired to apply a server-side row transaction\n *\n * @fires\n *\n * datasource-ready - Fired when the host grid is ready to start loading data\n *\n * @beta\n */\n",
23740
+ "docComment": "/**\n * A Genesis Datasource element, for server-side | SSRM-compatible data fetching and used exclusively by the GridPro element.\n *\n * @remarks\n *\n * Only supports Server-Side Row Model. Requires `@ag-grid-enterprise/server-side-row-model` setup and valid AG Grid Enterprise license.\n *\n * **Supported resources**: DATASERVER resources, and REQUEST_SERVER (req/rep) resources that declare `criteriaOnlyRequest`. A req/rep resource without it reports a `resource-type` error and no datasource is attached to the grid.\n *\n * **Custom Sort Indicators**: This datasource automatically applies custom sort indicators that are always visible (instead of only on hover). Sortable columns will show a subtle sort icon even when not sorted, and active sort indicators will be more prominent. The custom styling uses AG Grid's native icon font for consistency with the grid theme.\n *\n * @fires\n *\n * base-datasource-error - Fired when a datasource error is reported. detail: `BaseDatasourceErrorEventDetail`\n *\n * @fires\n *\n * datasource-error - Fired when a datasource error occurs (for grid integration). detail: `DatasourceErrorEventDetail`\n *\n * @fires\n *\n * base-datasource-connected - Fired when error state is cleared after connection succeeds\n *\n * @fires\n *\n * datasource-loading-finished - Fired when pending stream transactions are flushed with no row changes\n *\n * @fires\n *\n * datasource-no-data-available - Fired when loading finishes with an empty row set\n *\n * @fires\n *\n * datasource-data-changed - Fired when rows are delivered to the grid, a live stream pushes a change, a poll detects one, or a re-read no longer returns a row; `add` are rows the grid did not hold before, `update` are held rows whose content changed, `remove` carries the row id. detail: `DataChangedEventDetail`\n *\n * @fires\n *\n * cache-filter-config - Fired to persist filter configuration for the grid\n *\n * @fires\n *\n * refresh-server-side - Fired to request a server-side refresh. detail: `RefreshServerSideEventDetail`\n *\n * @fires\n *\n * set-server-side-datasource - Fired to attach or clear the server-side row model datasource\n *\n * @fires\n *\n * datasource-loading-started - Fired when a server-side load cycle starts\n *\n * @fires\n *\n * add-grid-css-class - Fired to add a CSS class on the grid host (e.g. server-side styling). detail: `GridCssClassEventDetail`\n *\n * @fires\n *\n * remove-grid-css-class - Fired to remove a CSS class from the grid host. detail: `GridCssClassEventDetail`\n *\n * @fires\n *\n * datasource-initialize - Fired to hand off server-side grid options. detail: `InitializeEventDetail`\n *\n * @fires\n *\n * datasource-init - Fired when the server-side grid model should initialize data\n *\n * @fires\n *\n * datasource-schema-updated - Fired when column metadata or defs are updated. detail: `SchemaUpdatedEventDetail`\n *\n * @fires\n *\n * datasource-filters-restored - Fired when persisted filters are reapplied\n *\n * @fires\n *\n * datasource-data-cleared - Fired when the grid drops every row it held (reload, filter or sort change, destroy); `includeSchema` says whether the columns went too. detail: `DataClearedEventDetail`\n *\n * @fires\n *\n * apply-server-side-transaction - Fired to apply a server-side row transaction\n *\n * @fires\n *\n * datasource-ready - Fired when the host grid is ready to start loading data\n *\n * @beta\n */\n",
23710
23741
  "excerptTokens": [
23711
23742
  {
23712
23743
  "kind": "Content",
@@ -24233,37 +24264,6 @@
24233
24264
  "isOptional": false,
24234
24265
  "isAbstract": false,
24235
24266
  "name": "restart"
24236
- },
24237
- {
24238
- "kind": "Property",
24239
- "canonicalReference": "@genesislcap/grid-pro!GridProServerSideDatasource#serializer:member",
24240
- "docComment": "",
24241
- "excerptTokens": [
24242
- {
24243
- "kind": "Content",
24244
- "text": "serializer: "
24245
- },
24246
- {
24247
- "kind": "Reference",
24248
- "text": "JSONSerializer",
24249
- "canonicalReference": "@genesislcap/foundation-utils!JSONSerializer:interface"
24250
- },
24251
- {
24252
- "kind": "Content",
24253
- "text": ";"
24254
- }
24255
- ],
24256
- "isReadonly": false,
24257
- "isOptional": false,
24258
- "releaseTag": "Beta",
24259
- "name": "serializer",
24260
- "propertyTypeTokenRange": {
24261
- "startIndex": 1,
24262
- "endIndex": 2
24263
- },
24264
- "isStatic": false,
24265
- "isProtected": false,
24266
- "isAbstract": false
24267
24267
  }
24268
24268
  ],
24269
24269
  "extendsTokenRange": {
@@ -33344,7 +33344,7 @@
33344
33344
  },
33345
33345
  {
33346
33346
  "kind": "Content",
33347
- "text": "<void>;\n errorHandlerFunc?: (message: string, type: string) => void;\n onNoDataAvailableFunc?: () => void;\n onDataAvailableFunc?: () => void;\n resourceName: string;\n resourceParams?: "
33347
+ "text": "<void>;\n errorHandlerFunc?: (message: string, type: string) => void;\n onNoDataAvailableFunc?: () => void;\n onDataAvailableFunc?: () => void;\n onRowsDeliveredFunc?: (rows: any[]) => void;\n onRowsWithdrawnFunc?: (rowIds: string[]) => void;\n onRowsEvictedFunc?: (rowIds: string[]) => void;\n maxBlocksInCache?: number;\n gridReceivesLiveUpdates?: boolean;\n resourceName: string;\n resourceParams?: "
33348
33348
  },
33349
33349
  {
33350
33350
  "kind": "Reference",
@@ -825,8 +825,12 @@ export declare const csvExportParams: CsvExportParams;
825
825
  export declare interface DataChangedEventDetail {
826
826
  changes: {
827
827
  add?: any[];
828
+ /** Row-id-only objects (`{ [rowId]: id }`) for the rows that left the grid. */
828
829
  remove?: any[];
829
830
  update?: any[];
831
+ /** Where `add` rows were inserted, as AG Grid's `RowDataTransaction.addIndex`. */
832
+ addIndex?: number;
833
+ /** @deprecated Never populated; the emitted field is `addIndex`. */
830
834
  insertIndex?: number;
831
835
  };
832
836
  }
@@ -2001,12 +2005,7 @@ declare const GenesisGridDatasourceElement_base: new () => {
2001
2005
  addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2002
2006
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2003
2007
  removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2004
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options
2005
- /**
2006
- * Optional parameter that allows you to select a subset of fields from the query if the client is not interested in receiving all of them.
2007
- * @remarks DATASERVER only.
2008
- */
2009
- ?: boolean | EventListenerOptions): void;
2008
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2010
2009
  readonly attributes: NamedNodeMap;
2011
2010
  get classList(): DOMTokenList;
2012
2011
  set classList(value: string): any;
@@ -2071,7 +2070,15 @@ declare const GenesisGridDatasourceElement_base: new () => {
2071
2070
  removeAttribute(qualifiedName: string): void;
2072
2071
  removeAttributeNS(namespace: string | null, localName: string): void;
2073
2072
  removeAttributeNode(attr: Attr): Attr;
2074
- requestFullscreen(options?: FullscreenOptions): Promise<void>;
2073
+ requestFullscreen(options
2074
+ /**
2075
+ * Returns whether the `row-id` attribute is the default one, depending on the resource type.
2076
+ * @internal
2077
+ */
2078
+ ? /**
2079
+ * Returns whether the `row-id` attribute is the default one, depending on the resource type.
2080
+ * @internal
2081
+ */: FullscreenOptions): Promise<void>;
2075
2082
  requestPointerLock(options?: PointerLockOptions): Promise<void>;
2076
2083
  scroll(options?: ScrollToOptions): void;
2077
2084
  scroll(x: number, y: number): void;
@@ -2352,17 +2359,48 @@ declare class GenesisInfiniteDatasource implements IDatasource {
2352
2359
  * Called when an unsolicited batch changes which rows exist or their order (an INSERT or a
2353
2360
  * DELETE). The cache cannot be patched in place for those - a created row arrives at the end
2354
2361
  * rather than in sort position, and a delete below the delivered watermark is skipped to keep
2355
- * slice offsets stable - so the rows have to be re-read.
2362
+ * slice offsets stable - so the rows have to be re-read. Receives the pushed change so the
2363
+ * host can report it before the re-read.
2356
2364
  * @internal
2357
2365
  */
2358
2366
  private onRowsInvalidatedFunc?;
2359
2367
  /**
2360
2368
  * Called when an unsolicited batch only modified rows already held. The cache is patched in
2361
- * place, so the grid just needs to re-render its blocks.
2369
+ * place, so the grid just needs to re-render its blocks. Receives the pushed change so the
2370
+ * host can report it.
2362
2371
  * @internal
2363
2372
  */
2364
2373
  private onRowsUpdatedFunc?;
2374
+ /**
2375
+ * Called with the rows just handed to AG Grid for a block, on either transport. This is the
2376
+ * only point at which rows leave the datasource, so it is where the host learns which rows
2377
+ * the grid holds (a re-read after a refresh delivers the same rows again).
2378
+ * @internal
2379
+ */
2380
+ private onRowsDeliveredFunc?;
2381
+ /**
2382
+ * Called with the ids of rows a re-read of a block no longer returned: they left the grid
2383
+ * (deleted on the server, or moved into a block that reports them again).
2384
+ * @internal
2385
+ */
2386
+ private onRowsWithdrawnFunc?;
2387
+ /**
2388
+ * Called with the ids of rows whose block the grid evicted from its cache (`maxBlocksInCache`),
2389
+ * so the host stops treating them as held.
2390
+ * @internal
2391
+ */
2392
+ private onRowsEvictedFunc?;
2393
+ /**
2394
+ * Called when a filter or sort change drops every row the grid held, on either transport, so
2395
+ * the host forgets them too. AG Grid purges its own cache on those changes.
2396
+ * @internal
2397
+ */
2398
+ private onRowCacheResetFunc?;
2365
2399
  private errorHandlerFunc;
2400
+ /** Which rows each delivered block carried, for withdrawal and eviction reporting. @internal */
2401
+ private ledger;
2402
+ /** Set by destroy(); a reply that resolves afterwards belongs to a dropped cache. @internal */
2403
+ private destroyed;
2366
2404
  /**
2367
2405
  * Max time a DATASERVER block may stay pending before the safety valve resolves it with the
2368
2406
  * rows accumulated so far.
@@ -2385,8 +2423,10 @@ declare class GenesisInfiniteDatasource implements IDatasource {
2385
2423
  private dataserverStreamSubscription;
2386
2424
  private sourceRef;
2387
2425
  /**
2388
- * Identifies the CRITERIA_MATCH/ORDER_BY the current subscription was opened with; a change
2389
- * means the subscription has to be re-opened, as those are DATA_LOGON parameters.
2426
+ * Identifies the CRITERIA_MATCH/ORDER_BY the current rows were read with. A change means AG
2427
+ * Grid has dropped every block (it purges on filter/sort changes): on DATASERVER the
2428
+ * subscription has to be re-opened, as those are DATA_LOGON parameters, and on both transports
2429
+ * the host is told its held rows are gone.
2390
2430
  * @internal
2391
2431
  */
2392
2432
  private subscriptionKey;
@@ -2424,14 +2464,20 @@ declare class GenesisInfiniteDatasource implements IDatasource {
2424
2464
  createSnapshotFunc: (params?: any) => Promise<RequestServerResult | FilteredDataServerResult>;
2425
2465
  createDataserverStreamFunc?: (params?: any) => SocketObservable<FilteredDataServerResult>;
2426
2466
  getMoreRowsFunc?: (sourceRef: string) => Promise<unknown>;
2427
- onRowsInvalidatedFunc?: () => void;
2428
- onRowsUpdatedFunc?: () => void;
2467
+ onRowsInvalidatedFunc?: (change: FilteredDataServerResult) => void;
2468
+ onRowsUpdatedFunc?: (change: FilteredDataServerResult) => void;
2469
+ onRowsDeliveredFunc?: (rows: any[]) => void;
2470
+ onRowsWithdrawnFunc?: (rowIds: string[]) => void;
2471
+ onRowsEvictedFunc?: (rowIds: string[]) => void;
2472
+ onRowCacheResetFunc?: () => void;
2429
2473
  errorHandlerFunc: (message: string, type: string) => void;
2430
2474
  resourceName: string;
2431
2475
  resourceParams: any;
2432
2476
  resourceIndexes: Map<string, string[]>;
2433
2477
  resourceColDefs: MetadataDetail[];
2434
2478
  maxRows: number;
2479
+ /** AG Grid's `maxBlocksInCache`, so eviction can be mirrored; unset keeps every block. */
2480
+ maxBlocksInCache?: number;
2435
2481
  rowId: string;
2436
2482
  baseCriteria?: string;
2437
2483
  isRequestServer: boolean;
@@ -2468,6 +2514,14 @@ declare class GenesisInfiniteDatasource implements IDatasource {
2468
2514
  * outstanding at once, and each settles as soon as the cache covers its range.
2469
2515
  * @internal
2470
2516
  */
2517
+ /**
2518
+ * Notes the CRITERIA_MATCH/ORDER_BY a block is being read with. A change means AG Grid has
2519
+ * purged its cache and restarted from block 0: on DATASERVER the subscription is re-opened
2520
+ * (those are DATA_LOGON parameters), and on both transports the host is told the rows it held
2521
+ * are gone, so the rows read under the new filter or sort are reported as new.
2522
+ * @internal
2523
+ */
2524
+ private noteRequestKey;
2471
2525
  private getDataserverRows;
2472
2526
  /**
2473
2527
  * Keeps pulling batches while blocks are still waiting.
@@ -2516,6 +2570,12 @@ declare class GenesisInfiniteDatasource implements IDatasource {
2516
2570
  * @internal
2517
2571
  */
2518
2572
  private settleBlock;
2573
+ /**
2574
+ * Reports rows handed to the grid for a block, then the rows a re-read of that block no longer
2575
+ * carries and the rows whose block the grid evicted.
2576
+ * @internal
2577
+ */
2578
+ private deliverRows;
2519
2579
  /**
2520
2580
  * Warns when the view filled up before the data ran out.
2521
2581
  * @remarks The server stops sending at MAX_VIEW rows and reports MORE_ROWS false, which is
@@ -3606,19 +3666,78 @@ declare const GridPro_base: (new (...args: any[]) => {
3606
3666
  }) & typeof FoundationElement;
3607
3667
 
3608
3668
  export declare class GridProBaseDatasource extends GenesisGridDatasourceElement {
3669
+ serializer: JSONSerializer;
3609
3670
  protected dataSubWasLoggedOff: boolean;
3610
3671
  keepColDefsOnClearRowData: boolean;
3611
3672
  rowData: Map<string, any>;
3612
3673
  protected transactionData: TransactionData;
3674
+ /** So rows without a row id are warned about once per element, not once per block. @internal */
3675
+ private missingRowIdWarned;
3613
3676
  protected connectionSub: Subscription | undefined;
3614
3677
  protected subscribeToConnection(): void;
3615
3678
  protected unsubscribeFromConnection(): void;
3616
3679
  protected generateColumnDefsFromMetadata(fieldsMetadata: FieldMetadata[], getFilterParamsByFieldType: (field: FieldMetadata) => ColDef['filterParams'] | any, getFilterByFieldType: (type: FieldTypeEnum) => string): ColDef[];
3617
3680
  protected handleStreamInserts(insertedRows: any[], addIndex?: number): void;
3681
+ /**
3682
+ * Resolves the id of the held row a stream row refers to.
3683
+ * @remarks Under a custom `row-id` a DATASERVER push may carry only the default id
3684
+ * (`ROW_REF`), so the held row with that default id supplies the custom one. Returns
3685
+ * `undefined` when neither id is present - callers skip the row rather than matching
3686
+ * `undefined === undefined` against the first held row.
3687
+ * @internal
3688
+ */
3689
+ protected resolveRowId(row: any): string | undefined;
3618
3690
  protected handleStreamDeletes(deletedRows: any[]): void;
3619
3691
  protected handleStreamUpdates(updatedRows: any[]): void;
3620
3692
  protected applyAllTransactions(): void;
3621
3693
  private applyMappedTransaction;
3694
+ /**
3695
+ * Reports rows a block-based row model (server-side, infinite) has just handed to the grid.
3696
+ * Rows not held before are reported as `add`; rows already held (a block re-read after a
3697
+ * refresh, or a req/rep re-read after a commit or poll) are reported as `update` only when
3698
+ * their content changed, so a plain re-read is silent.
3699
+ * @remarks `rowData` mirrors the rows the grid holds: the resource reports rows a re-read no
3700
+ * longer returned (`reportWithdrawnRows`) and blocks the grid evicted from its cache
3701
+ * (`forgetRows`), and `clearRowData` empties it when the grid drops its cache.
3702
+ * @internal
3703
+ */
3704
+ protected reportDeliveredRows(rows: any[]): void;
3705
+ /**
3706
+ * Reports rows a block re-read no longer returned: they left the grid (deleted on the server,
3707
+ * or moved into a block that reports them again). Rows already reported removed - a DATASERVER
3708
+ * push, say - are skipped.
3709
+ * @internal
3710
+ */
3711
+ protected reportWithdrawnRows(rowIds: string[]): void;
3712
+ /**
3713
+ * Forgets rows the grid evicted from its block cache. They still exist on the server, so
3714
+ * nothing is emitted; a later re-read reports them as `add`, as the grid did not hold them.
3715
+ * @internal
3716
+ */
3717
+ protected forgetRows(rowIds: string[]): void;
3718
+ /**
3719
+ * Starts a fresh transaction and returns it, so a caller can keep working on the object it
3720
+ * built even if a consumer's `datasource-data-changed` handler resets the element meanwhile.
3721
+ * @internal
3722
+ */
3723
+ protected resetTransaction(): TransactionData & {
3724
+ add: any[];
3725
+ remove: any[];
3726
+ update: any[];
3727
+ };
3728
+ /**
3729
+ * Whether two versions of a row differ in content. Identity and a key-order-insensitive
3730
+ * field comparison come first, so a re-read of unchanged rows costs no serialization; nested
3731
+ * values fall back to the serializer.
3732
+ * @internal
3733
+ */
3734
+ protected hasRowContentChanged(known: any, row: any): boolean;
3735
+ /** Emits `datasource-data-changed` for `transaction` when it is non-empty. @internal */
3736
+ protected emitTransaction(transaction: TransactionData | undefined): void;
3737
+ /** Emits `datasource-data-changed` for the current transaction when it is non-empty. @internal */
3738
+ protected emitPendingTransaction(): void;
3739
+ /** @internal */
3740
+ private warnMissingRowIdOnce;
3622
3741
  /**
3623
3742
  * Builds the index map used for server-side sorting from the resource's metadata.
3624
3743
  * @remarks Real DATASERVER indexes keep their names; when the resource also (or only) reports
@@ -3863,6 +3982,12 @@ export declare class GridProBeta extends GridProBeta_base {
3863
3982
  * @internal
3864
3983
  */
3865
3984
  private handleDataChanged;
3985
+ /**
3986
+ * Whether the live grid runs AG Grid's client-side row model (the default when the datasource
3987
+ * set no `rowModelType`).
3988
+ * @internal
3989
+ */
3990
+ private get isClientSideRowModel();
3866
3991
  private flashAddedCells;
3867
3992
  /**
3868
3993
  * Handles schema updates from datasource
@@ -5746,12 +5871,13 @@ export declare const gridProGenesisDatasourceEventNames: {
5746
5871
  * @fires datasource-initialize - Fired to hand off infinite row model grid options. detail: `InitializeEventDetail`
5747
5872
  * @fires datasource-init - Fired when the infinite grid model should initialize data
5748
5873
  * @fires datasource-schema-updated - Fired when column metadata or defs are updated. detail: `SchemaUpdatedEventDetail`
5874
+ * @fires datasource-data-changed - Fired when rows are delivered to the grid, a DATASERVER push changes them, or a re-read no longer returns them; `add` are rows the grid did not hold before, `update` are held rows whose content changed, `remove` carries the row id. detail: `DataChangedEventDetail`
5749
5875
  * @fires set-infinite-datasource - Fired to attach or clear the infinite row model datasource. detail: `SetInfiniteDatasourceEventDetail`
5750
5876
  * @fires refresh-infinite-cache - Fired to request an infinite row model refresh; `purge` drops the block cache and re-reads. detail: `RefreshInfiniteCacheEventDetail`
5751
5877
  * @fires add-grid-css-class - Fired to add a CSS class on the grid host (hover sort indicators). detail: `GridCssClassEventDetail`
5752
5878
  * @fires remove-grid-css-class - Fired to remove that CSS class from the grid host. detail: `GridCssClassEventDetail`
5753
5879
  * @fires cache-filter-config - Fired to persist filter configuration for the grid
5754
- * @fires datasource-data-cleared - Fired when infinite row data is cleared. detail: `DataClearedEventDetail`
5880
+ * @fires datasource-data-cleared - Fired when the grid drops every row it held (reload, filter or sort change, destroy); `includeSchema` says whether the columns went too. detail: `DataClearedEventDetail`
5755
5881
  * @fires datasource-filters-restored - Fired when persisted filters are reapplied
5756
5882
  */
5757
5883
  export declare class GridProInfiniteDatasource extends GridProInfiniteDatasource_base {
@@ -5763,6 +5889,8 @@ export declare class GridProInfiniteDatasource extends GridProInfiniteDatasource
5763
5889
  private infiniteDatasource;
5764
5890
  /** Unsubscribes the commit-response listener behind `pollTriggerEvents`. @internal */
5765
5891
  private commitResponseUnsubscribe?;
5892
+ /** The `maxBlocksInCache` the grid was initialised with, so eviction can be mirrored. @internal */
5893
+ private maxBlocksInCache?;
5766
5894
  resourceNameChanged(oldValue: string, newValue: string): void;
5767
5895
  criteriaChanged(oldCriteria: string, newCriteria: string): void;
5768
5896
  connectedCallback(): void;
@@ -5779,8 +5907,37 @@ export declare class GridProInfiniteDatasource extends GridProInfiniteDatasource
5779
5907
  private clearReadyListener;
5780
5908
  /** @internal */
5781
5909
  private onDatasourceReady;
5910
+ /**
5911
+ * A pushed INSERT/DELETE changes which rows exist or their order, so the change is reported
5912
+ * and then the rows are re-read (purge).
5913
+ * @internal
5914
+ */
5915
+ private handleLiveRowsInvalidated;
5916
+ /**
5917
+ * A pushed MODIFY is already patched into the paging cache, so the change is reported and the
5918
+ * grid only needs to re-render its blocks.
5919
+ * @internal
5920
+ */
5921
+ private handleLiveRowsUpdated;
5922
+ /**
5923
+ * Turns a DATASERVER push into the same transaction the client-side datasource reports:
5924
+ * inserts of held rows become updates, partial MODIFY rows are merged into the held row, and
5925
+ * a remove carries just the row id.
5926
+ * @remarks Unlike the client-side model, a pushed row need not be held here - it may sit
5927
+ * beyond the loaded blocks. A MODIFY for such a row is not reported (the block that delivers
5928
+ * it reports it as `add`); a DELETE is reported by the id it carries, and one that cannot be
5929
+ * resolved to an id is skipped with a warning rather than matched against the wrong row.
5930
+ * @internal
5931
+ */
5932
+ private reportLiveChange;
5782
5933
  destroy(): Promise<void>;
5783
5934
  restart(): Promise<void>;
5935
+ /**
5936
+ * Forgets every held row and tells consumers, as the client-side datasource does: the grid is
5937
+ * dropping its rows (a reload, a filter or sort change, or teardown). `withColumnDefs` also
5938
+ * clears the column definitions.
5939
+ * @internal
5940
+ */
5784
5941
  private clearRowData;
5785
5942
  /**
5786
5943
  * Honours `pollTriggerEvents` without polling: a commit ACK for one of the listed events
@@ -6217,7 +6374,7 @@ export declare enum GridProRendererTypes {
6217
6374
  * @fires base-datasource-connected - Fired when error state is cleared after connection succeeds
6218
6375
  * @fires datasource-loading-finished - Fired when pending stream transactions are flushed with no row changes
6219
6376
  * @fires datasource-no-data-available - Fired when loading finishes with an empty row set
6220
- * @fires datasource-data-changed - Fired when row data changes from applied stream transactions. detail: `DataChangedEventDetail`
6377
+ * @fires datasource-data-changed - Fired when rows are delivered to the grid, a live stream pushes a change, a poll detects one, or a re-read no longer returns a row; `add` are rows the grid did not hold before, `update` are held rows whose content changed, `remove` carries the row id. detail: `DataChangedEventDetail`
6221
6378
  * @fires cache-filter-config - Fired to persist filter configuration for the grid
6222
6379
  * @fires refresh-server-side - Fired to request a server-side refresh. detail: `RefreshServerSideEventDetail`
6223
6380
  * @fires set-server-side-datasource - Fired to attach or clear the server-side row model datasource
@@ -6228,13 +6385,18 @@ export declare enum GridProRendererTypes {
6228
6385
  * @fires datasource-init - Fired when the server-side grid model should initialize data
6229
6386
  * @fires datasource-schema-updated - Fired when column metadata or defs are updated. detail: `SchemaUpdatedEventDetail`
6230
6387
  * @fires datasource-filters-restored - Fired when persisted filters are reapplied
6231
- * @fires datasource-data-cleared - Fired when server-side row data is cleared. detail: `DataClearedEventDetail`
6388
+ * @fires datasource-data-cleared - Fired when the grid drops every row it held (reload, filter or sort change, destroy); `includeSchema` says whether the columns went too. detail: `DataClearedEventDetail`
6232
6389
  * @fires apply-server-side-transaction - Fired to apply a server-side row transaction
6233
6390
  * @fires datasource-ready - Fired when the host grid is ready to start loading data
6234
6391
  */
6235
6392
  export declare class GridProServerSideDatasource extends GridProServerSideDatasource_base {
6236
- serializer: JSONSerializer;
6237
6393
  pollingDatasource: Datasource;
6394
+ /**
6395
+ * The `maxBlocksInCache` the consumer gave the grid, if any, so block eviction can be mirrored
6396
+ * in the held-row bookkeeping. The server-side defaults set none, so AG Grid keeps every block.
6397
+ * @internal
6398
+ */
6399
+ private get gridMaxBlocksInCache();
6238
6400
  /**
6239
6401
  * Enable live updates for the grid.
6240
6402
  * @remarks Only works with DATASERVER resources (StreamDatasource) right now.
@@ -6270,6 +6432,12 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
6270
6432
  private onDatasourceReady;
6271
6433
  destroy(): Promise<void>;
6272
6434
  restart(): Promise<void>;
6435
+ /**
6436
+ * Forgets every held row and tells consumers, as the client-side datasource does: the grid is
6437
+ * dropping its rows (a reload, a filter or sort change, or teardown). `withColumnDefs` also
6438
+ * clears the column definitions.
6439
+ * @internal
6440
+ */
6273
6441
  private clearRowData;
6274
6442
  /**
6275
6443
  * Checks whether the resolved resource can be served through the Server-Side Row Model.
@@ -8148,6 +8316,33 @@ export declare type ServerSideDatasourceOptions = {
8148
8316
  onNoDataAvailableFunc?: () => void;
8149
8317
  /** Called when a server-side load finishes with one or more rows. */
8150
8318
  onDataAvailableFunc?: () => void;
8319
+ /**
8320
+ * Called with the rows just handed to AG Grid for a block. This is the only point at which
8321
+ * rows leave the datasource, so it is where the host learns which rows the grid holds.
8322
+ */
8323
+ onRowsDeliveredFunc?: (rows: any[]) => void;
8324
+ /**
8325
+ * Called with the ids of rows a re-read of a block no longer returned - they left the grid
8326
+ * (deleted on the server, or moved to a block that reports them again).
8327
+ */
8328
+ onRowsWithdrawnFunc?: (rowIds: string[]) => void;
8329
+ /**
8330
+ * Called with the ids of rows whose block AG Grid evicted from its cache (`maxBlocksInCache`),
8331
+ * so the host stops treating them as held. Nothing changed on the server.
8332
+ */
8333
+ onRowsEvictedFunc?: (rowIds: string[]) => void;
8334
+ /**
8335
+ * AG Grid's `maxBlocksInCache`, when the consumer set one, so the datasource can mirror the
8336
+ * grid's block eviction. Unset means the grid keeps every block.
8337
+ */
8338
+ maxBlocksInCache?: number;
8339
+ /**
8340
+ * Whether the host applies pushed INSERTs and DELETEs to the grid as transactions
8341
+ * (`live-updates`). The paging subscription receives every push either way; this decides
8342
+ * whether the row cache mirrors the grid's re-indexing or treats the grid as a snapshot that
8343
+ * only a refresh brings up to date.
8344
+ */
8345
+ gridReceivesLiveUpdates?: boolean;
8151
8346
  resourceName: string;
8152
8347
  resourceParams?: DataserverParams | RequestParams;
8153
8348
  resourceIndexes?: Map<string, string[]>;
package/dist/react.cjs CHANGED
@@ -270,7 +270,7 @@ const GridProClientSideDatasource = React.forwardRef(function GridProClientSideD
270
270
  });
271
271
 
272
272
  const GridProInfiniteDatasource = React.forwardRef(function GridProInfiniteDatasource(props, ref) {
273
- const { onBaseDatasourceError, onDatasourceError, onBaseDatasourceConnected, onDatasourceInitialize, onDatasourceInit, onDatasourceSchemaUpdated, onSetInfiniteDatasource, onRefreshInfiniteCache, onAddGridCssClass, onRemoveGridCssClass, onCacheFilterConfig, onDatasourceDataCleared, onDatasourceFiltersRestored, onDatasourceLoadingFinished, onDatasourceNoDataAvailable, onDatasourceDataChanged, children, ...rest } = props;
273
+ const { onBaseDatasourceError, onDatasourceError, onBaseDatasourceConnected, onDatasourceInitialize, onDatasourceInit, onDatasourceSchemaUpdated, onDatasourceDataChanged, onSetInfiniteDatasource, onRefreshInfiniteCache, onAddGridCssClass, onRemoveGridCssClass, onCacheFilterConfig, onDatasourceDataCleared, onDatasourceFiltersRestored, onDatasourceLoadingFinished, onDatasourceNoDataAvailable, children, ...rest } = props;
274
274
  const _innerRef = React.useRef(null);
275
275
  const _onBaseDatasourceErrorRef = React.useRef(onBaseDatasourceError);
276
276
  _onBaseDatasourceErrorRef.current = onBaseDatasourceError;
@@ -284,6 +284,8 @@ const GridProInfiniteDatasource = React.forwardRef(function GridProInfiniteDatas
284
284
  _onDatasourceInitRef.current = onDatasourceInit;
285
285
  const _onDatasourceSchemaUpdatedRef = React.useRef(onDatasourceSchemaUpdated);
286
286
  _onDatasourceSchemaUpdatedRef.current = onDatasourceSchemaUpdated;
287
+ const _onDatasourceDataChangedRef = React.useRef(onDatasourceDataChanged);
288
+ _onDatasourceDataChangedRef.current = onDatasourceDataChanged;
287
289
  const _onSetInfiniteDatasourceRef = React.useRef(onSetInfiniteDatasource);
288
290
  _onSetInfiniteDatasourceRef.current = onSetInfiniteDatasource;
289
291
  const _onRefreshInfiniteCacheRef = React.useRef(onRefreshInfiniteCache);
@@ -302,8 +304,6 @@ const GridProInfiniteDatasource = React.forwardRef(function GridProInfiniteDatas
302
304
  _onDatasourceLoadingFinishedRef.current = onDatasourceLoadingFinished;
303
305
  const _onDatasourceNoDataAvailableRef = React.useRef(onDatasourceNoDataAvailable);
304
306
  _onDatasourceNoDataAvailableRef.current = onDatasourceNoDataAvailable;
305
- const _onDatasourceDataChangedRef = React.useRef(onDatasourceDataChanged);
306
- _onDatasourceDataChangedRef.current = onDatasourceDataChanged;
307
307
  React.useLayoutEffect(() => {
308
308
  const el = _innerRef.current;
309
309
  if (!el) return;
@@ -319,6 +319,8 @@ const GridProInfiniteDatasource = React.forwardRef(function GridProInfiniteDatas
319
319
  el.addEventListener('datasource-init', _onDatasourceInitFn);
320
320
  const _onDatasourceSchemaUpdatedFn = (e) => _onDatasourceSchemaUpdatedRef.current?.(e);
321
321
  el.addEventListener('datasource-schema-updated', _onDatasourceSchemaUpdatedFn);
322
+ const _onDatasourceDataChangedFn = (e) => _onDatasourceDataChangedRef.current?.(e);
323
+ el.addEventListener('datasource-data-changed', _onDatasourceDataChangedFn);
322
324
  const _onSetInfiniteDatasourceFn = (e) => _onSetInfiniteDatasourceRef.current?.(e);
323
325
  el.addEventListener('set-infinite-datasource', _onSetInfiniteDatasourceFn);
324
326
  const _onRefreshInfiniteCacheFn = (e) => _onRefreshInfiniteCacheRef.current?.(e);
@@ -337,8 +339,6 @@ const GridProInfiniteDatasource = React.forwardRef(function GridProInfiniteDatas
337
339
  el.addEventListener('datasource-loading-finished', _onDatasourceLoadingFinishedFn);
338
340
  const _onDatasourceNoDataAvailableFn = (e) => _onDatasourceNoDataAvailableRef.current?.(e);
339
341
  el.addEventListener('datasource-no-data-available', _onDatasourceNoDataAvailableFn);
340
- const _onDatasourceDataChangedFn = (e) => _onDatasourceDataChangedRef.current?.(e);
341
- el.addEventListener('datasource-data-changed', _onDatasourceDataChangedFn);
342
342
  return () => {
343
343
  el.removeEventListener('base-datasource-error', _onBaseDatasourceErrorFn);
344
344
  el.removeEventListener('datasource-error', _onDatasourceErrorFn);
@@ -346,6 +346,7 @@ const GridProInfiniteDatasource = React.forwardRef(function GridProInfiniteDatas
346
346
  el.removeEventListener('datasource-initialize', _onDatasourceInitializeFn);
347
347
  el.removeEventListener('datasource-init', _onDatasourceInitFn);
348
348
  el.removeEventListener('datasource-schema-updated', _onDatasourceSchemaUpdatedFn);
349
+ el.removeEventListener('datasource-data-changed', _onDatasourceDataChangedFn);
349
350
  el.removeEventListener('set-infinite-datasource', _onSetInfiniteDatasourceFn);
350
351
  el.removeEventListener('refresh-infinite-cache', _onRefreshInfiniteCacheFn);
351
352
  el.removeEventListener('add-grid-css-class', _onAddGridCssClassFn);
@@ -355,7 +356,6 @@ const GridProInfiniteDatasource = React.forwardRef(function GridProInfiniteDatas
355
356
  el.removeEventListener('datasource-filters-restored', _onDatasourceFiltersRestoredFn);
356
357
  el.removeEventListener('datasource-loading-finished', _onDatasourceLoadingFinishedFn);
357
358
  el.removeEventListener('datasource-no-data-available', _onDatasourceNoDataAvailableFn);
358
- el.removeEventListener('datasource-data-changed', _onDatasourceDataChangedFn);
359
359
  };
360
360
  }, []);
361
361
  return React.createElement(customElements.getName(GridProInfiniteDatasourceWC) ?? 'grid-pro-infinite-datasource', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);