@genesislcap/grid-pro 15.30.0 → 15.30.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.
Files changed (49) hide show
  1. package/dist/custom-elements.json +8196 -7794
  2. package/dist/dts/column-selection/column-selection.d.ts +4 -3
  3. package/dist/dts/column-selection/column-selection.d.ts.map +1 -1
  4. package/dist/dts/column-selection/column-selection.styles.d.ts.map +1 -1
  5. package/dist/dts/datasource/base.datasource.d.ts +69 -8
  6. package/dist/dts/datasource/base.datasource.d.ts.map +1 -1
  7. package/dist/dts/datasource/base.types.d.ts +10 -0
  8. package/dist/dts/datasource/base.types.d.ts.map +1 -1
  9. package/dist/dts/datasource/dataserver-result.filter.d.ts +17 -0
  10. package/dist/dts/datasource/dataserver-result.filter.d.ts.map +1 -0
  11. package/dist/dts/datasource/delivered-block.ledger.d.ts +37 -0
  12. package/dist/dts/datasource/delivered-block.ledger.d.ts.map +1 -0
  13. package/dist/dts/datasource/infinite.datasource.d.ts +65 -1
  14. package/dist/dts/datasource/infinite.datasource.d.ts.map +1 -1
  15. package/dist/dts/datasource/infinite.resource.d.ts +136 -6
  16. package/dist/dts/datasource/infinite.resource.d.ts.map +1 -1
  17. package/dist/dts/datasource/server-side.datasource.d.ts +8 -4
  18. package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
  19. package/dist/dts/datasource/server-side.resource-base.d.ts +23 -0
  20. package/dist/dts/datasource/server-side.resource-base.d.ts.map +1 -1
  21. package/dist/dts/datasource/server-side.resource-dataserver.d.ts +28 -0
  22. package/dist/dts/datasource/server-side.resource-dataserver.d.ts.map +1 -1
  23. package/dist/dts/datasource/server-side.resource-reqrep.d.ts +1 -1
  24. package/dist/dts/datasource/server-side.resource-reqrep.d.ts.map +1 -1
  25. package/dist/dts/grid-pro-beta.d.ts +6 -0
  26. package/dist/dts/grid-pro-beta.d.ts.map +1 -1
  27. package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts +4 -0
  28. package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts.map +1 -1
  29. package/dist/dts/grid-pro.d.ts.map +1 -1
  30. package/dist/dts/react.d.ts +20 -20
  31. package/dist/esm/column-selection/column-selection.js +11 -9
  32. package/dist/esm/column-selection/column-selection.styles.js +0 -2
  33. package/dist/esm/column-selection/column-selection.template.js +1 -1
  34. package/dist/esm/datasource/base.datasource.js +182 -27
  35. package/dist/esm/datasource/dataserver-result.filter.js +28 -0
  36. package/dist/esm/datasource/delivered-block.ledger.js +52 -0
  37. package/dist/esm/datasource/infinite.datasource.js +131 -20
  38. package/dist/esm/datasource/infinite.resource.js +221 -16
  39. package/dist/esm/datasource/server-side.datasource.js +80 -29
  40. package/dist/esm/datasource/server-side.resource-base.js +39 -0
  41. package/dist/esm/datasource/server-side.resource-dataserver.js +110 -23
  42. package/dist/esm/datasource/server-side.resource-reqrep.js +25 -3
  43. package/dist/esm/grid-pro-beta.js +20 -2
  44. package/dist/esm/grid-pro.js +4 -1
  45. package/dist/grid-pro.api.json +66 -66
  46. package/dist/grid-pro.d.ts +294 -21
  47. package/dist/react.cjs +23 -23
  48. package/dist/react.mjs +21 -21
  49. package/package.json +13 -13
@@ -721,7 +721,8 @@ export declare type ColumnPickerSort = 'selected-first' | 'ag-grid';
721
721
  * Layout: select-all + search → column list. Ordering via `sort`
722
722
  * (`selected-first` default, or `ag-grid`). Checkboxes toggle visibility via
723
723
  * `api.setColumnsVisible`; drag handles on hidden rows use AG native DnD onto the grid
724
- * (`allowDragFromColumnsToolPanel`); visible rows reorder inside the picker via HTML5 drag.
724
+ * (`allowDragFromColumnsToolPanel`) even while search is active; visible-row reorder inside
725
+ * the picker uses HTML5 drag and is disabled during search.
725
726
  *
726
727
  * @tagname %%prefix%%-column-selection
727
728
  */
@@ -775,8 +776,8 @@ export declare class ColumnSelection extends ColumnSelection_base {
775
776
  private set pickerApi(value);
776
777
  /** Query root for picker DOM (shadow panel). */
777
778
  private get pickerRoot();
778
- /** Drag reorder / grid drop disabled while search filter is active. */
779
- get canDrag(): boolean;
779
+ /** Panel reorder disabled while search filter is active. */
780
+ get canReorderInPanel(): boolean;
780
781
  /** Handle is draggable onto the grid (hidden columns, or all when using ag-grid sort). */
781
782
  canDragToGrid(item: ColumnPickerItem): boolean;
782
783
  /** Columns in the current (search-filtered) picker lists that can be toggled. */
@@ -1430,8 +1431,12 @@ export declare const csvExportParams: CsvExportParams;
1430
1431
  export declare interface DataChangedEventDetail {
1431
1432
  changes: {
1432
1433
  add?: any[];
1434
+ /** Row-id-only objects (`{ [rowId]: id }`) for the rows that left the grid. */
1433
1435
  remove?: any[];
1434
1436
  update?: any[];
1437
+ /** Where `add` rows were inserted, as AG Grid's `RowDataTransaction.addIndex`. */
1438
+ addIndex?: number;
1439
+ /** @deprecated Never populated; the emitted field is `addIndex`. */
1435
1440
  insertIndex?: number;
1436
1441
  };
1437
1442
  }
@@ -2562,7 +2567,12 @@ export declare class GenesisGridDatasourceElement extends GenesisGridDatasourceE
2562
2567
  protected criteriaFromFilters: Map<string, string>;
2563
2568
  protected update: BehaviorSubject<Map<string, string>>;
2564
2569
  protected datasourceOptions(): DatasourceOptions;
2565
- private buildCriteria;
2570
+ /**
2571
+ * The criteria the resource should be read with: the `criteria` attribute plus anything added
2572
+ * through `setFilter()`.
2573
+ * @internal
2574
+ */
2575
+ protected buildCriteria(): string;
2566
2576
  setFilter(fieldName: string, newFilter: string): void;
2567
2577
  removeFilter(fieldName: string): void;
2568
2578
  get isRequestServer(): boolean;
@@ -2623,12 +2633,7 @@ declare const GenesisGridDatasourceElement_base: new () => {
2623
2633
  addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2624
2634
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2625
2635
  removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2626
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options
2627
- /**
2628
- * 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.
2629
- * @remarks DATASERVER only.
2630
- */
2631
- ?: boolean | EventListenerOptions): void;
2636
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2632
2637
  readonly attributes: NamedNodeMap;
2633
2638
  get classList(): DOMTokenList;
2634
2639
  set classList(value: string): any;
@@ -2693,7 +2698,15 @@ declare const GenesisGridDatasourceElement_base: new () => {
2693
2698
  removeAttribute(qualifiedName: string): void;
2694
2699
  removeAttributeNS(namespace: string | null, localName: string): void;
2695
2700
  removeAttributeNode(attr: Attr): Attr;
2696
- requestFullscreen(options?: FullscreenOptions): Promise<void>;
2701
+ requestFullscreen(options
2702
+ /**
2703
+ * Returns whether the `row-id` attribute is the default one, depending on the resource type.
2704
+ * @internal
2705
+ */
2706
+ ? /**
2707
+ * Returns whether the `row-id` attribute is the default one, depending on the resource type.
2708
+ * @internal
2709
+ */: FullscreenOptions): Promise<void>;
2697
2710
  requestPointerLock(options?: PointerLockOptions): Promise<void>;
2698
2711
  scroll(options?: ScrollToOptions): void;
2699
2712
  scroll(x: number, y: number): void;
@@ -2967,6 +2980,15 @@ declare class GenesisInfiniteDatasource implements IDatasource {
2967
2980
  private rowId;
2968
2981
  private baseCriteria;
2969
2982
  private isRequestServer;
2983
+ /**
2984
+ * The `order-by` attribute, used when the grid itself is unsorted.
2985
+ * @remarks DATASERVER takes the name of an index on the query; REQUEST_SERVER takes a column
2986
+ * with the direction inline.
2987
+ * @internal
2988
+ */
2989
+ private defaultOrderBy?;
2990
+ /** The `reverse` attribute, applied alongside `defaultOrderBy` on DATASERVER. @internal */
2991
+ private defaultReverse;
2970
2992
  private createSnapshotFunc;
2971
2993
  private createDataserverStreamFunc;
2972
2994
  private getMoreRowsFunc;
@@ -2974,17 +2996,69 @@ declare class GenesisInfiniteDatasource implements IDatasource {
2974
2996
  * Called when an unsolicited batch changes which rows exist or their order (an INSERT or a
2975
2997
  * DELETE). The cache cannot be patched in place for those - a created row arrives at the end
2976
2998
  * rather than in sort position, and a delete below the delivered watermark is skipped to keep
2977
- * slice offsets stable - so the rows have to be re-read.
2999
+ * slice offsets stable - so the rows have to be re-read. Receives the pushed change so the
3000
+ * host can report it before the re-read.
2978
3001
  * @internal
2979
3002
  */
2980
3003
  private onRowsInvalidatedFunc?;
2981
3004
  /**
2982
3005
  * Called when an unsolicited batch only modified rows already held. The cache is patched in
2983
- * place, so the grid just needs to re-render its blocks.
3006
+ * place, so the grid just needs to re-render its blocks. Receives the pushed change so the
3007
+ * host can report it.
2984
3008
  * @internal
2985
3009
  */
2986
3010
  private onRowsUpdatedFunc?;
3011
+ /**
3012
+ * Called with the rows just handed to AG Grid for a block, on either transport. This is the
3013
+ * only point at which rows leave the datasource, so it is where the host learns which rows
3014
+ * the grid holds (a re-read after a refresh delivers the same rows again).
3015
+ * @internal
3016
+ */
3017
+ private onRowsDeliveredFunc?;
3018
+ /**
3019
+ * Called with the ids of rows a re-read of a block no longer returned: they left the grid
3020
+ * (deleted on the server, or moved into a block that reports them again).
3021
+ * @internal
3022
+ */
3023
+ private onRowsWithdrawnFunc?;
3024
+ /**
3025
+ * Called when a filter or sort change drops every row the grid held, on either transport, so
3026
+ * the host forgets them too. AG Grid purges its own cache on those changes.
3027
+ * @internal
3028
+ */
3029
+ private onRowCacheResetFunc?;
3030
+ /**
3031
+ * Called when the first block comes back with no rows, and when it comes back with rows, so
3032
+ * the host can raise the same no-data / loading-finished events the server-side model does.
3033
+ * @internal
3034
+ */
3035
+ private onNoDataAvailableFunc?;
3036
+ /** @internal */
3037
+ private onDataAvailableFunc?;
2987
3038
  private errorHandlerFunc;
3039
+ /** Which rows each delivered block carried, for withdrawal and eviction reporting. @internal */
3040
+ private ledger;
3041
+ /**
3042
+ * Bumped whenever the rows this datasource was reading for are dropped (a teardown, or a
3043
+ * filter/sort change). A REQUEST_SERVER reply that resolves for an earlier generation was read
3044
+ * for a cache the grid no longer has.
3045
+ * @remarks Deliberately a generation rather than a "destroyed" flag: AG Grid calls `destroy()`
3046
+ * on the datasource bean it then keeps using (`InfiniteRowModel.start()` re-applies the
3047
+ * `datasource` grid option, and `setDatasource` destroys the previous one first), so a sticky
3048
+ * flag would disable the instance the grid is still driving.
3049
+ * @internal
3050
+ */
3051
+ private loadGeneration;
3052
+ /**
3053
+ * Set once the host has dropped this instance for a replacement (a criteria change, a resource
3054
+ * change, teardown). AG Grid keeps calling the bean it was given until the new one is attached,
3055
+ * and its purge re-requests blocks immediately, so without this the replaced instance keeps
3056
+ * reading with its captured criteria and reporting those rows to the host as delivered.
3057
+ * @remarks Distinct from `destroy()`, which AG Grid itself calls on a bean it then keeps using;
3058
+ * only the host calls `detach()`, and only when it will never use this instance again.
3059
+ * @internal
3060
+ */
3061
+ private detached;
2988
3062
  /**
2989
3063
  * Max time a DATASERVER block may stay pending before the safety valve resolves it with the
2990
3064
  * rows accumulated so far.
@@ -3007,11 +3081,20 @@ declare class GenesisInfiniteDatasource implements IDatasource {
3007
3081
  private dataserverStreamSubscription;
3008
3082
  private sourceRef;
3009
3083
  /**
3010
- * Identifies the CRITERIA_MATCH/ORDER_BY the current subscription was opened with; a change
3011
- * means the subscription has to be re-opened, as those are DATA_LOGON parameters.
3084
+ * Identifies the CRITERIA_MATCH/ORDER_BY the current rows were read with. A change means AG
3085
+ * Grid has dropped every block (it purges on filter/sort changes): on DATASERVER the
3086
+ * subscription has to be re-opened, as those are DATA_LOGON parameters, and on both transports
3087
+ * the host is told its held rows are gone.
3012
3088
  * @internal
3013
3089
  */
3014
3090
  private subscriptionKey;
3091
+ /**
3092
+ * Identifies the CRITERIA_MATCH/ORDER_BY the rows the host currently holds were read with.
3093
+ * Unlike `subscriptionKey` this survives a subscription teardown, so a filter or sort change
3094
+ * is still recognised as one when a live push tore the subscription down first.
3095
+ * @internal
3096
+ */
3097
+ private rowCacheKey;
3015
3098
  /**
3016
3099
  * Session-cumulative row cache, keyed by row id. A Map preserves insertion order, so the
3017
3100
  * cache can be sliced by block range; Genesis splits batches across messages and later
@@ -3046,8 +3129,11 @@ declare class GenesisInfiniteDatasource implements IDatasource {
3046
3129
  createSnapshotFunc: (params?: any) => Promise<RequestServerResult | FilteredDataServerResult>;
3047
3130
  createDataserverStreamFunc?: (params?: any) => SocketObservable<FilteredDataServerResult>;
3048
3131
  getMoreRowsFunc?: (sourceRef: string) => Promise<unknown>;
3049
- onRowsInvalidatedFunc?: () => void;
3050
- onRowsUpdatedFunc?: () => void;
3132
+ onRowsInvalidatedFunc?: (change: FilteredDataServerResult) => void;
3133
+ onRowsUpdatedFunc?: (change: FilteredDataServerResult) => void;
3134
+ onRowsDeliveredFunc?: (rows: any[]) => void;
3135
+ onRowsWithdrawnFunc?: (rowIds: string[]) => void;
3136
+ onRowCacheResetFunc?: () => void;
3051
3137
  errorHandlerFunc: (message: string, type: string) => void;
3052
3138
  resourceName: string;
3053
3139
  resourceParams: any;
@@ -3057,6 +3143,10 @@ declare class GenesisInfiniteDatasource implements IDatasource {
3057
3143
  rowId: string;
3058
3144
  baseCriteria?: string;
3059
3145
  isRequestServer: boolean;
3146
+ defaultOrderBy?: string;
3147
+ defaultReverse?: boolean;
3148
+ onNoDataAvailableFunc?: () => void;
3149
+ onDataAvailableFunc?: () => void;
3060
3150
  });
3061
3151
  /**
3062
3152
  * Builds request parameters for REQUEST_SERVER resources.
@@ -3090,6 +3180,23 @@ declare class GenesisInfiniteDatasource implements IDatasource {
3090
3180
  * outstanding at once, and each settles as soon as the cache covers its range.
3091
3181
  * @internal
3092
3182
  */
3183
+ /**
3184
+ * Notes the CRITERIA_MATCH/ORDER_BY a block is being read with. A change means AG Grid has
3185
+ * purged its cache and restarted from block 0: on DATASERVER the subscription is re-opened
3186
+ * (those are DATA_LOGON parameters), and on both transports the host is told the rows it held
3187
+ * are gone, so the rows read under the new filter or sort are reported as new.
3188
+ * @internal
3189
+ */
3190
+ /**
3191
+ * The sort a block is read with: the grid's own sort model when the user has sorted, and the
3192
+ * `order-by` / `reverse` attributes otherwise.
3193
+ * @remarks Without the fallback those attributes reached the comms datasource but were then
3194
+ * dropped, because the logon builder removes ORDER_BY and REVERSE whenever the grid is
3195
+ * unsorted. Sorting from the grid still wins, as it is the more specific instruction.
3196
+ * @internal
3197
+ */
3198
+ private resolveSortConfig;
3199
+ private noteRequestKey;
3093
3200
  private getDataserverRows;
3094
3201
  /**
3095
3202
  * Keeps pulling batches while blocks are still waiting.
@@ -3138,6 +3245,19 @@ declare class GenesisInfiniteDatasource implements IDatasource {
3138
3245
  * @internal
3139
3246
  */
3140
3247
  private settleBlock;
3248
+ /**
3249
+ * Raises the no-data / data-available hooks for the first block, as the server-side resource
3250
+ * does. Later blocks say nothing: the question is whether the resource has any rows at all,
3251
+ * and the answer cannot change once the first block has been served.
3252
+ * @internal
3253
+ */
3254
+ private notifyDataAvailability;
3255
+ /**
3256
+ * Reports rows handed to the grid for a block, then the rows a re-read of that block no longer
3257
+ * carries and the rows whose block the grid evicted.
3258
+ * @internal
3259
+ */
3260
+ private deliverRows;
3141
3261
  /**
3142
3262
  * Warns when the view filled up before the data ran out.
3143
3263
  * @remarks The server stops sending at MAX_VIEW rows and reports MORE_ROWS false, which is
@@ -3163,7 +3283,23 @@ declare class GenesisInfiniteDatasource implements IDatasource {
3163
3283
  * @internal
3164
3284
  */
3165
3285
  private teardownDataserverSubscription;
3286
+ /**
3287
+ * Drops the subscription and the cached rows.
3288
+ * @remarks AG Grid calls this on the bean it then keeps using (`InfiniteRowModel.start()`
3289
+ * re-applies the `datasource` grid option, and `setDatasource` destroys the previous one
3290
+ * first), and it can land while a block request is in flight. So it must leave the datasource
3291
+ * able to serve that reply and the next `getRows`: it drops the subscription, not the instance.
3292
+ */
3166
3293
  destroy?(): void;
3294
+ /**
3295
+ * Drops this instance for good: the host is replacing it, so it must stop serving the grid and
3296
+ * stop reporting rows, even though AG Grid still holds it as its `datasource` until the
3297
+ * replacement is attached.
3298
+ * @remarks Deliberately separate from `destroy()`, which AG Grid calls on a bean it then keeps
3299
+ * using (`InfiniteRowModel.start()` re-applies the `datasource` grid option, and `setDatasource`
3300
+ * destroys the previous one first).
3301
+ */
3302
+ detach(): void;
3167
3303
  }
3168
3304
 
3169
3305
  /**
@@ -4243,19 +4379,71 @@ declare const GridPro_base: (new (...args: any[]) => {
4243
4379
  }) & typeof FoundationElement;
4244
4380
 
4245
4381
  export declare class GridProBaseDatasource extends GenesisGridDatasourceElement {
4382
+ serializer: JSONSerializer;
4246
4383
  protected dataSubWasLoggedOff: boolean;
4247
4384
  keepColDefsOnClearRowData: boolean;
4248
4385
  rowData: Map<string, any>;
4249
4386
  protected transactionData: TransactionData;
4387
+ /** So rows without a row id are warned about once per element, not once per block. @internal */
4388
+ private missingRowIdWarned;
4250
4389
  protected connectionSub: Subscription | undefined;
4251
4390
  protected subscribeToConnection(): void;
4252
4391
  protected unsubscribeFromConnection(): void;
4253
4392
  protected generateColumnDefsFromMetadata(fieldsMetadata: FieldMetadata[], getFilterParamsByFieldType: (field: FieldMetadata) => ColDef['filterParams'] | any, getFilterByFieldType: (type: FieldTypeEnum) => string): ColDef[];
4254
4393
  protected handleStreamInserts(insertedRows: any[], addIndex?: number): void;
4394
+ /**
4395
+ * Resolves the id of the held row a stream row refers to.
4396
+ * @remarks Under a custom `row-id` a DATASERVER push may carry only the default id
4397
+ * (`ROW_REF`), so the held row with that default id supplies the custom one. Returns
4398
+ * `undefined` when neither id is present - callers skip the row rather than matching
4399
+ * `undefined === undefined` against the first held row.
4400
+ * @internal
4401
+ */
4402
+ protected resolveRowId(row: any): string | undefined;
4255
4403
  protected handleStreamDeletes(deletedRows: any[]): void;
4256
4404
  protected handleStreamUpdates(updatedRows: any[]): void;
4257
4405
  protected applyAllTransactions(): void;
4258
4406
  private applyMappedTransaction;
4407
+ /**
4408
+ * Reports rows a block-based row model (server-side, infinite) has just handed to the grid.
4409
+ * Rows not held before are reported as `add`; rows already held (a block re-read after a
4410
+ * refresh, or a req/rep re-read after a commit or poll) are reported as `update` only when
4411
+ * their content changed, so a plain re-read is silent.
4412
+ * @remarks `rowData` holds the rows delivered since the last cache reset: the resource reports
4413
+ * rows a re-read no longer returned (`reportWithdrawnRows`), and `clearRowData` empties it when
4414
+ * the grid drops its cache. Block eviction is not mirrored - see `DeliveredBlockLedger` - so
4415
+ * this is a superset of what the grid holds.
4416
+ * @internal
4417
+ */
4418
+ protected reportDeliveredRows(rows: any[]): void;
4419
+ /**
4420
+ * Reports rows a block re-read no longer returned: they left the grid (deleted on the server,
4421
+ * or moved into a block that reports them again). Rows already reported removed - a DATASERVER
4422
+ * push, say - are skipped.
4423
+ * @internal
4424
+ */
4425
+ protected reportWithdrawnRows(rowIds: string[]): void;
4426
+ /**
4427
+ * Starts a fresh transaction and returns it, so a caller can keep working on the object it
4428
+ * built even if a consumer's `datasource-data-changed` handler resets the element meanwhile.
4429
+ * @internal
4430
+ */
4431
+ protected resetTransaction(): TransactionData & {
4432
+ add: any[];
4433
+ remove: any[];
4434
+ update: any[];
4435
+ };
4436
+ /**
4437
+ * Whether two versions of a row differ in content. Identity and a key-order-insensitive
4438
+ * field comparison come first, so a re-read of unchanged rows costs no serialization; nested
4439
+ * values fall back to the serializer.
4440
+ * @internal
4441
+ */
4442
+ protected hasRowContentChanged(known: any, row: any): boolean;
4443
+ /** Emits `datasource-data-changed` for `transaction` when it is non-empty. @internal */
4444
+ protected emitTransaction(transaction: TransactionData | undefined): void;
4445
+ /** @internal */
4446
+ private warnMissingRowIdOnce;
4259
4447
  /**
4260
4448
  * Builds the index map used for server-side sorting from the resource's metadata.
4261
4449
  * @remarks Real DATASERVER indexes keep their names; when the resource also (or only) reports
@@ -4511,6 +4699,12 @@ export declare class GridProBeta extends GridProBeta_base {
4511
4699
  * @internal
4512
4700
  */
4513
4701
  private handleDataChanged;
4702
+ /**
4703
+ * Whether the live grid runs AG Grid's client-side row model (the default when the datasource
4704
+ * set no `rowModelType`).
4705
+ * @internal
4706
+ */
4707
+ private get isClientSideRowModel();
4514
4708
  private flashAddedCells;
4515
4709
  /**
4516
4710
  * Handles schema updates from datasource
@@ -6431,12 +6625,15 @@ export declare const gridProGenesisDatasourceEventNames: {
6431
6625
  * @fires datasource-initialize - Fired to hand off infinite row model grid options. detail: `InitializeEventDetail`
6432
6626
  * @fires datasource-init - Fired when the infinite grid model should initialize data
6433
6627
  * @fires datasource-schema-updated - Fired when column metadata or defs are updated. detail: `SchemaUpdatedEventDetail`
6628
+ * @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`
6434
6629
  * @fires set-infinite-datasource - Fired to attach or clear the infinite row model datasource. detail: `SetInfiniteDatasourceEventDetail`
6435
6630
  * @fires refresh-infinite-cache - Fired to request an infinite row model refresh; `purge` drops the block cache and re-reads. detail: `RefreshInfiniteCacheEventDetail`
6436
6631
  * @fires add-grid-css-class - Fired to add a CSS class on the grid host (hover sort indicators). detail: `GridCssClassEventDetail`
6437
6632
  * @fires remove-grid-css-class - Fired to remove that CSS class from the grid host. detail: `GridCssClassEventDetail`
6438
6633
  * @fires cache-filter-config - Fired to persist filter configuration for the grid
6439
- * @fires datasource-data-cleared - Fired when infinite row data is cleared. detail: `DataClearedEventDetail`
6634
+ * @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`
6635
+ * @fires datasource-loading-finished - Fired when the first block comes back with rows
6636
+ * @fires datasource-no-data-available - Fired when the first block comes back empty
6440
6637
  * @fires datasource-filters-restored - Fired when persisted filters are reapplied
6441
6638
  */
6442
6639
  export declare class GridProInfiniteDatasource extends GridProInfiniteDatasource_base {
@@ -6452,6 +6649,19 @@ export declare class GridProInfiniteDatasource extends GridProInfiniteDatasource
6452
6649
  criteriaChanged(oldCriteria: string, newCriteria: string): void;
6453
6650
  connectedCallback(): void;
6454
6651
  disconnectedCallback(): void;
6652
+ /** Unsubscribes the `setFilter()` listener. @internal */
6653
+ private filterSub;
6654
+ /**
6655
+ * Reloads when `setFilter()` or `removeFilter()` changes the criteria.
6656
+ * @remarks The criteria a block is read with is captured when the resource is built, so a
6657
+ * filter added later reaches nothing until the rows are re-read. The `criteria` attribute
6658
+ * already reloads through `criteriaChanged`; this gives the programmatic API the same
6659
+ * behaviour instead of silently doing nothing.
6660
+ * @internal
6661
+ */
6662
+ private subscribeToFilterChanges;
6663
+ /** @internal */
6664
+ private unsubscribeFromFilterChanges;
6455
6665
  deepClone(): Node;
6456
6666
  /**
6457
6667
  * Resets the grid data while keeping columnDefs and reloads data.
@@ -6462,10 +6672,58 @@ export declare class GridProInfiniteDatasource extends GridProInfiniteDatasource
6462
6672
  init(): Promise<void>;
6463
6673
  /** @internal */
6464
6674
  private clearReadyListener;
6675
+ /**
6676
+ * Whether the infinite row model can drive this resource.
6677
+ * @remarks It pages a req/rep by sending CRITERIA_MATCH, ORDER_BY and OFFSET in DETAILS, which
6678
+ * a request reply only accepts when it is declared `criteriaOnlyRequest`
6679
+ * (`CRITERIA_ONLY_REQUEST` in its metadata). Without it the server expects its inputs in
6680
+ * `REQUEST` instead and rejects every block, which on this row model surfaces as a grid that
6681
+ * simply never fills. Report it once, up front, as the server-side model does.
6682
+ * @returns `true` when the infinite model can be used, `false` after reporting a
6683
+ * `resource-type` error.
6684
+ * @internal
6685
+ */
6686
+ private isInfiniteSupportedForResource;
6465
6687
  /** @internal */
6466
6688
  private onDatasourceReady;
6689
+ /**
6690
+ * A pushed INSERT/DELETE changes which rows exist or their order, so the change is reported
6691
+ * and then the rows are re-read (purge).
6692
+ * @internal
6693
+ */
6694
+ private handleLiveRowsInvalidated;
6695
+ /**
6696
+ * A pushed MODIFY is already patched into the paging cache, so the change is reported and the
6697
+ * grid only needs to re-render its blocks.
6698
+ * @internal
6699
+ */
6700
+ private handleLiveRowsUpdated;
6701
+ /**
6702
+ * Turns a DATASERVER push into the same transaction the client-side datasource reports:
6703
+ * partial MODIFY rows are merged into the held row, and a remove carries just the row id.
6704
+ * @remarks Unlike the client-side model, a pushed row need not be held here - it may sit
6705
+ * beyond the loaded blocks, in which case the grid will never show it.
6706
+ *
6707
+ * So a pushed INSERT is deliberately not reported: nothing here says where the new row sorts,
6708
+ * and reporting an `add` for a row that lands at position 40,000 of an unscrolled grid would
6709
+ * contradict the event's contract and leave the row held forever, since no block re-read ever
6710
+ * delivers (or withdraws) it. Every INSERT is followed by a purge and re-read, which reports
6711
+ * the row as `add` if and when it actually reaches the grid.
6712
+ *
6713
+ * A MODIFY for a row that is not held is skipped for the same reason; a DELETE is reported by
6714
+ * the id it carries, and one that cannot be resolved to an id is skipped with a warning rather
6715
+ * than matched against the wrong row.
6716
+ * @internal
6717
+ */
6718
+ private reportLiveChange;
6467
6719
  destroy(): Promise<void>;
6468
6720
  restart(): Promise<void>;
6721
+ /**
6722
+ * Forgets every held row and tells consumers, as the client-side datasource does: the grid is
6723
+ * dropping its rows (a reload, a filter or sort change, or teardown). `withColumnDefs` also
6724
+ * clears the column definitions.
6725
+ * @internal
6726
+ */
6469
6727
  private clearRowData;
6470
6728
  /**
6471
6729
  * Honours `pollTriggerEvents` without polling: a commit ACK for one of the listed events
@@ -6902,7 +7160,7 @@ export declare enum GridProRendererTypes {
6902
7160
  * @fires base-datasource-connected - Fired when error state is cleared after connection succeeds
6903
7161
  * @fires datasource-loading-finished - Fired when pending stream transactions are flushed with no row changes
6904
7162
  * @fires datasource-no-data-available - Fired when loading finishes with an empty row set
6905
- * @fires datasource-data-changed - Fired when row data changes from applied stream transactions. detail: `DataChangedEventDetail`
7163
+ * @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`
6906
7164
  * @fires cache-filter-config - Fired to persist filter configuration for the grid
6907
7165
  * @fires refresh-server-side - Fired to request a server-side refresh. detail: `RefreshServerSideEventDetail`
6908
7166
  * @fires set-server-side-datasource - Fired to attach or clear the server-side row model datasource
@@ -6913,12 +7171,11 @@ export declare enum GridProRendererTypes {
6913
7171
  * @fires datasource-init - Fired when the server-side grid model should initialize data
6914
7172
  * @fires datasource-schema-updated - Fired when column metadata or defs are updated. detail: `SchemaUpdatedEventDetail`
6915
7173
  * @fires datasource-filters-restored - Fired when persisted filters are reapplied
6916
- * @fires datasource-data-cleared - Fired when server-side row data is cleared. detail: `DataClearedEventDetail`
7174
+ * @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`
6917
7175
  * @fires apply-server-side-transaction - Fired to apply a server-side row transaction
6918
7176
  * @fires datasource-ready - Fired when the host grid is ready to start loading data
6919
7177
  */
6920
7178
  export declare class GridProServerSideDatasource extends GridProServerSideDatasource_base {
6921
- serializer: JSONSerializer;
6922
7179
  pollingDatasource: Datasource;
6923
7180
  /**
6924
7181
  * Enable live updates for the grid.
@@ -6955,6 +7212,12 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
6955
7212
  private onDatasourceReady;
6956
7213
  destroy(): Promise<void>;
6957
7214
  restart(): Promise<void>;
7215
+ /**
7216
+ * Forgets every held row and tells consumers, as the client-side datasource does: the grid is
7217
+ * dropping its rows (a reload, a filter or sort change, or teardown). `withColumnDefs` also
7218
+ * clears the column definitions.
7219
+ * @internal
7220
+ */
6958
7221
  private clearRowData;
6959
7222
  /**
6960
7223
  * Checks whether the resolved resource can be served through the Server-Side Row Model.
@@ -8877,6 +9140,16 @@ export declare type ServerSideDatasourceOptions = {
8877
9140
  onNoDataAvailableFunc?: () => void;
8878
9141
  /** Called when a server-side load finishes with one or more rows. */
8879
9142
  onDataAvailableFunc?: () => void;
9143
+ /**
9144
+ * Called with the rows just handed to AG Grid for a block. This is the only point at which
9145
+ * rows leave the datasource, so it is where the host learns which rows the grid holds.
9146
+ */
9147
+ onRowsDeliveredFunc?: (rows: any[]) => void;
9148
+ /**
9149
+ * Called with the ids of rows a re-read of a block no longer returned - they left the grid
9150
+ * (deleted on the server, or moved to a block that reports them again).
9151
+ */
9152
+ onRowsWithdrawnFunc?: (rowIds: string[]) => void;
8880
9153
  resourceName: string;
8881
9154
  resourceParams?: DataserverParams | RequestParams;
8882
9155
  resourceIndexes?: Map<string, string[]>;
package/dist/react.cjs CHANGED
@@ -123,6 +123,11 @@ const StringEditor = React.forwardRef(function StringEditor(props, ref) {
123
123
  return React.createElement(customElements.getName(StringEditorWC) ?? '%%prefix%%-string-editor', { ...rest, ref }, children);
124
124
  });
125
125
 
126
+ const GridProColumn = React.forwardRef(function GridProColumn(props, ref) {
127
+ const { children, ...rest } = props;
128
+ return React.createElement(customElements.getName(GridProColumnWC) ?? 'grid-pro-column', { ...rest, ref }, children);
129
+ });
130
+
126
131
  const ActionRenderer = React.forwardRef(function ActionRenderer(props, ref) {
127
132
  const { children, ...rest } = props;
128
133
  return React.createElement(customElements.getName(ActionRendererWC) ?? '%%prefix%%-grid-pro-action-renderer', { ...rest, ref }, children);
@@ -163,16 +168,6 @@ const AgTextRenderer = React.forwardRef(function AgTextRenderer(props, ref) {
163
168
  return React.createElement(customElements.getName(AgTextRendererWC) ?? '%%prefix%%-grid-text-renderer', { ...rest, ref }, children);
164
169
  });
165
170
 
166
- const GridProColumn = React.forwardRef(function GridProColumn(props, ref) {
167
- const { children, ...rest } = props;
168
- return React.createElement(customElements.getName(GridProColumnWC) ?? 'grid-pro-column', { ...rest, ref }, children);
169
- });
170
-
171
- const ColumnSelection = React.forwardRef(function ColumnSelection(props, ref) {
172
- const { children, ...rest } = props;
173
- return React.createElement(customElements.getName(ColumnSelectionWC) ?? '%%prefix%%-column-selection', { ...rest, ref }, children);
174
- });
175
-
176
171
  const GridProClientSideDatasource = React.forwardRef(function GridProClientSideDatasource(props, ref) {
177
172
  const { onBaseDatasourceError, onDatasourceError, onBaseDatasourceConnected, onDatasourceLoadingFinished, onDatasourceNoDataAvailable, onDatasourceDataChanged, onDatasourceInitialize, onDatasourceDestroy, onDatasourceDataCleared, onDatasourceSchemaUpdated, onDatasourceFiltersRestored, onDatasourceDataLoaded, onDatasourceLoadingStarted, onDatasourceMoreDataAvailable, onDatasourceReady, onDatasourceInit, onMoreRowsChanged, onDatasourceSizeChanged, children, ...rest } = props;
178
173
  const _innerRef = React.useRef(null);
@@ -276,7 +271,7 @@ const GridProClientSideDatasource = React.forwardRef(function GridProClientSideD
276
271
  });
277
272
 
278
273
  const GridProInfiniteDatasource = React.forwardRef(function GridProInfiniteDatasource(props, ref) {
279
- const { onBaseDatasourceError, onDatasourceError, onBaseDatasourceConnected, onDatasourceInitialize, onDatasourceInit, onDatasourceSchemaUpdated, onSetInfiniteDatasource, onRefreshInfiniteCache, onAddGridCssClass, onRemoveGridCssClass, onCacheFilterConfig, onDatasourceDataCleared, onDatasourceFiltersRestored, onDatasourceLoadingFinished, onDatasourceNoDataAvailable, onDatasourceDataChanged, children, ...rest } = props;
274
+ const { onBaseDatasourceError, onDatasourceError, onBaseDatasourceConnected, onDatasourceInitialize, onDatasourceInit, onDatasourceSchemaUpdated, onDatasourceDataChanged, onSetInfiniteDatasource, onRefreshInfiniteCache, onAddGridCssClass, onRemoveGridCssClass, onCacheFilterConfig, onDatasourceDataCleared, onDatasourceLoadingFinished, onDatasourceNoDataAvailable, onDatasourceFiltersRestored, children, ...rest } = props;
280
275
  const _innerRef = React.useRef(null);
281
276
  const _onBaseDatasourceErrorRef = React.useRef(onBaseDatasourceError);
282
277
  _onBaseDatasourceErrorRef.current = onBaseDatasourceError;
@@ -290,6 +285,8 @@ const GridProInfiniteDatasource = React.forwardRef(function GridProInfiniteDatas
290
285
  _onDatasourceInitRef.current = onDatasourceInit;
291
286
  const _onDatasourceSchemaUpdatedRef = React.useRef(onDatasourceSchemaUpdated);
292
287
  _onDatasourceSchemaUpdatedRef.current = onDatasourceSchemaUpdated;
288
+ const _onDatasourceDataChangedRef = React.useRef(onDatasourceDataChanged);
289
+ _onDatasourceDataChangedRef.current = onDatasourceDataChanged;
293
290
  const _onSetInfiniteDatasourceRef = React.useRef(onSetInfiniteDatasource);
294
291
  _onSetInfiniteDatasourceRef.current = onSetInfiniteDatasource;
295
292
  const _onRefreshInfiniteCacheRef = React.useRef(onRefreshInfiniteCache);
@@ -302,14 +299,12 @@ const GridProInfiniteDatasource = React.forwardRef(function GridProInfiniteDatas
302
299
  _onCacheFilterConfigRef.current = onCacheFilterConfig;
303
300
  const _onDatasourceDataClearedRef = React.useRef(onDatasourceDataCleared);
304
301
  _onDatasourceDataClearedRef.current = onDatasourceDataCleared;
305
- const _onDatasourceFiltersRestoredRef = React.useRef(onDatasourceFiltersRestored);
306
- _onDatasourceFiltersRestoredRef.current = onDatasourceFiltersRestored;
307
302
  const _onDatasourceLoadingFinishedRef = React.useRef(onDatasourceLoadingFinished);
308
303
  _onDatasourceLoadingFinishedRef.current = onDatasourceLoadingFinished;
309
304
  const _onDatasourceNoDataAvailableRef = React.useRef(onDatasourceNoDataAvailable);
310
305
  _onDatasourceNoDataAvailableRef.current = onDatasourceNoDataAvailable;
311
- const _onDatasourceDataChangedRef = React.useRef(onDatasourceDataChanged);
312
- _onDatasourceDataChangedRef.current = onDatasourceDataChanged;
306
+ const _onDatasourceFiltersRestoredRef = React.useRef(onDatasourceFiltersRestored);
307
+ _onDatasourceFiltersRestoredRef.current = onDatasourceFiltersRestored;
313
308
  React.useLayoutEffect(() => {
314
309
  const el = _innerRef.current;
315
310
  if (!el) return;
@@ -325,6 +320,8 @@ const GridProInfiniteDatasource = React.forwardRef(function GridProInfiniteDatas
325
320
  el.addEventListener('datasource-init', _onDatasourceInitFn);
326
321
  const _onDatasourceSchemaUpdatedFn = (e) => _onDatasourceSchemaUpdatedRef.current?.(e);
327
322
  el.addEventListener('datasource-schema-updated', _onDatasourceSchemaUpdatedFn);
323
+ const _onDatasourceDataChangedFn = (e) => _onDatasourceDataChangedRef.current?.(e);
324
+ el.addEventListener('datasource-data-changed', _onDatasourceDataChangedFn);
328
325
  const _onSetInfiniteDatasourceFn = (e) => _onSetInfiniteDatasourceRef.current?.(e);
329
326
  el.addEventListener('set-infinite-datasource', _onSetInfiniteDatasourceFn);
330
327
  const _onRefreshInfiniteCacheFn = (e) => _onRefreshInfiniteCacheRef.current?.(e);
@@ -337,14 +334,12 @@ const GridProInfiniteDatasource = React.forwardRef(function GridProInfiniteDatas
337
334
  el.addEventListener('cache-filter-config', _onCacheFilterConfigFn);
338
335
  const _onDatasourceDataClearedFn = (e) => _onDatasourceDataClearedRef.current?.(e);
339
336
  el.addEventListener('datasource-data-cleared', _onDatasourceDataClearedFn);
340
- const _onDatasourceFiltersRestoredFn = (e) => _onDatasourceFiltersRestoredRef.current?.(e);
341
- el.addEventListener('datasource-filters-restored', _onDatasourceFiltersRestoredFn);
342
337
  const _onDatasourceLoadingFinishedFn = (e) => _onDatasourceLoadingFinishedRef.current?.(e);
343
338
  el.addEventListener('datasource-loading-finished', _onDatasourceLoadingFinishedFn);
344
339
  const _onDatasourceNoDataAvailableFn = (e) => _onDatasourceNoDataAvailableRef.current?.(e);
345
340
  el.addEventListener('datasource-no-data-available', _onDatasourceNoDataAvailableFn);
346
- const _onDatasourceDataChangedFn = (e) => _onDatasourceDataChangedRef.current?.(e);
347
- el.addEventListener('datasource-data-changed', _onDatasourceDataChangedFn);
341
+ const _onDatasourceFiltersRestoredFn = (e) => _onDatasourceFiltersRestoredRef.current?.(e);
342
+ el.addEventListener('datasource-filters-restored', _onDatasourceFiltersRestoredFn);
348
343
  return () => {
349
344
  el.removeEventListener('base-datasource-error', _onBaseDatasourceErrorFn);
350
345
  el.removeEventListener('datasource-error', _onDatasourceErrorFn);
@@ -352,16 +347,16 @@ const GridProInfiniteDatasource = React.forwardRef(function GridProInfiniteDatas
352
347
  el.removeEventListener('datasource-initialize', _onDatasourceInitializeFn);
353
348
  el.removeEventListener('datasource-init', _onDatasourceInitFn);
354
349
  el.removeEventListener('datasource-schema-updated', _onDatasourceSchemaUpdatedFn);
350
+ el.removeEventListener('datasource-data-changed', _onDatasourceDataChangedFn);
355
351
  el.removeEventListener('set-infinite-datasource', _onSetInfiniteDatasourceFn);
356
352
  el.removeEventListener('refresh-infinite-cache', _onRefreshInfiniteCacheFn);
357
353
  el.removeEventListener('add-grid-css-class', _onAddGridCssClassFn);
358
354
  el.removeEventListener('remove-grid-css-class', _onRemoveGridCssClassFn);
359
355
  el.removeEventListener('cache-filter-config', _onCacheFilterConfigFn);
360
356
  el.removeEventListener('datasource-data-cleared', _onDatasourceDataClearedFn);
361
- el.removeEventListener('datasource-filters-restored', _onDatasourceFiltersRestoredFn);
362
357
  el.removeEventListener('datasource-loading-finished', _onDatasourceLoadingFinishedFn);
363
358
  el.removeEventListener('datasource-no-data-available', _onDatasourceNoDataAvailableFn);
364
- el.removeEventListener('datasource-data-changed', _onDatasourceDataChangedFn);
359
+ el.removeEventListener('datasource-filters-restored', _onDatasourceFiltersRestoredFn);
365
360
  };
366
361
  }, []);
367
362
  return React.createElement(customElements.getName(GridProInfiniteDatasourceWC) ?? 'grid-pro-infinite-datasource', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
@@ -474,6 +469,11 @@ const GridProServerSideDatasource = React.forwardRef(function GridProServerSideD
474
469
  return React.createElement(customElements.getName(GridProServerSideDatasourceWC) ?? 'grid-pro-server-side-datasource', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
475
470
  });
476
471
 
472
+ const ColumnSelection = React.forwardRef(function ColumnSelection(props, ref) {
473
+ const { children, ...rest } = props;
474
+ return React.createElement(customElements.getName(ColumnSelectionWC) ?? '%%prefix%%-column-selection', { ...rest, ref }, children);
475
+ });
476
+
477
477
  const GridProGenesisDatasource = React.forwardRef(function GridProGenesisDatasource(props, ref) {
478
478
  const { onBaseDatasourceError, onDatasourceError, onBaseDatasourceConnected, onDatasourceLoadingFinished, onDatasourceNoDataAvailable, onDatasourceDataChanged, onDatasourceInitialize, onDatasourceDestroy, onDatasourceDataCleared, onDatasourceSchemaUpdated, onDatasourceFiltersRestored, onDatasourceDataLoaded, onDatasourceLoadingStarted, onDatasourceMoreDataAvailable, onDatasourceReady, onDatasourceInit, onMoreRowsChanged, onDatasourceSizeChanged, children, ...rest } = props;
479
479
  const _innerRef = React.useRef(null);
@@ -590,6 +590,7 @@ module.exports = {
590
590
  NumberEditor,
591
591
  SelectEditor,
592
592
  StringEditor,
593
+ GridProColumn,
593
594
  ActionRenderer,
594
595
  ActionsMenuRenderer,
595
596
  BooleanRenderer,
@@ -598,11 +599,10 @@ module.exports = {
598
599
  StatusPillRenderer,
599
600
  AgTextFieldRenderer,
600
601
  AgTextRenderer,
601
- GridProColumn,
602
- ColumnSelection,
603
602
  GridProClientSideDatasource,
604
603
  GridProInfiniteDatasource,
605
604
  GridProServerSideDatasource,
605
+ ColumnSelection,
606
606
  GridProGenesisDatasource,
607
607
  MulticolumnDropdown,
608
608
  };