@genesislcap/grid-pro 15.97.0 → 15.98.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/custom-elements.json +1492 -14
  2. package/dist/dts/datasource/cube.block-loads.d.ts +29 -0
  3. package/dist/dts/datasource/cube.block-loads.d.ts.map +1 -0
  4. package/dist/dts/datasource/cube.client.d.ts +50 -0
  5. package/dist/dts/datasource/cube.client.d.ts.map +1 -0
  6. package/dist/dts/datasource/cube.request.d.ts +99 -0
  7. package/dist/dts/datasource/cube.request.d.ts.map +1 -0
  8. package/dist/dts/datasource/cube.source.d.ts +43 -0
  9. package/dist/dts/datasource/cube.source.d.ts.map +1 -0
  10. package/dist/dts/datasource/infinite.datasource.d.ts +39 -3
  11. package/dist/dts/datasource/infinite.datasource.d.ts.map +1 -1
  12. package/dist/dts/datasource/infinite.resource-cube.d.ts +22 -0
  13. package/dist/dts/datasource/infinite.resource-cube.d.ts.map +1 -0
  14. package/dist/dts/datasource/server-side.datasource.d.ts +49 -1
  15. package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
  16. package/dist/dts/datasource/server-side.resource-cube.d.ts +21 -0
  17. package/dist/dts/datasource/server-side.resource-cube.d.ts.map +1 -0
  18. package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts +2 -1
  19. package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts.map +1 -1
  20. package/dist/esm/datasource/cube.block-loads.js +48 -0
  21. package/dist/esm/datasource/cube.client.js +144 -0
  22. package/dist/esm/datasource/cube.request.js +165 -0
  23. package/dist/esm/datasource/cube.source.js +73 -0
  24. package/dist/esm/datasource/infinite.datasource.js +157 -24
  25. package/dist/esm/datasource/infinite.resource-cube.js +56 -0
  26. package/dist/esm/datasource/server-side.datasource.js +197 -23
  27. package/dist/esm/datasource/server-side.resource-cube.js +58 -0
  28. package/dist/grid-pro.api.json +510 -3
  29. package/dist/grid-pro.d.ts +139 -3
  30. package/package.json +12 -12
@@ -91,6 +91,7 @@ import { HeaderStyleFunc } from 'ag-grid-community';
91
91
  import { HeaderTooltipValueGetterFunc } from 'ag-grid-community';
92
92
  import { HeaderValueGetterFunc } from '@ag-grid-community/core';
93
93
  import { HeaderValueGetterFunc as HeaderValueGetterFunc_2 } from 'ag-grid-community';
94
+ import { Http } from '@genesislcap/foundation-comms';
94
95
  import { IAggFunc } from '@ag-grid-community/core';
95
96
  import { IAggFunc as IAggFunc_2 } from 'ag-grid-community';
96
97
  import { ICellEditorComp } from '@ag-grid-community/core';
@@ -143,6 +144,7 @@ import { SocketObservable } from '@genesislcap/foundation-comms';
143
144
  import { SortComparatorFn } from 'ag-grid-community';
144
145
  import { SortDef } from 'ag-grid-community';
145
146
  import { SortDirection } from 'ag-grid-community';
147
+ import type { SortModelItem } from '@ag-grid-community/core';
146
148
  import { SortType } from 'ag-grid-community';
147
149
  import { SpanRowsFunc } from 'ag-grid-community';
148
150
  import { Subscription } from 'rxjs';
@@ -1440,6 +1442,56 @@ export declare const criteriaJoin = " && ";
1440
1442
  */
1441
1443
  export declare const csvExportParams: CsvExportParams;
1442
1444
 
1445
+ declare type CubeBlockRequest = {
1446
+ startRow: number;
1447
+ endRow: number;
1448
+ sortModel?: SortModelItem[];
1449
+ filterModel?: unknown;
1450
+ };
1451
+
1452
+ declare type CubeColumn = {
1453
+ name: string;
1454
+ role: string;
1455
+ type: string;
1456
+ numberAsString?: boolean;
1457
+ };
1458
+
1459
+ declare type CubeEnvelope = {
1460
+ rows: Record<string, unknown>[];
1461
+ hasMore: boolean;
1462
+ rowKind: string;
1463
+ columns: CubeColumn[];
1464
+ generation?: string;
1465
+ };
1466
+
1467
+ declare class CubeInfiniteDatasource implements IDatasource {
1468
+ private readonly options;
1469
+ private readonly loads;
1470
+ private detached;
1471
+ constructor(options: CubeInfiniteDatasourceOptions);
1472
+ getRows(params: IGetRowsParams): void;
1473
+ invalidatePendingLoads(): void;
1474
+ /** AG Grid calls this on a datasource it then keeps using, so replies in flight stay valid. */
1475
+ destroy(): void;
1476
+ /** The host is replacing this instance; AG Grid keeps asking it for blocks until the swap. */
1477
+ detach(): void;
1478
+ }
1479
+
1480
+ declare type CubeInfiniteDatasourceOptions = CubeRowReports & {
1481
+ fetchRows: (request: CubeBlockRequest) => Promise<CubeEnvelope>;
1482
+ onNoDataAvailable?: () => void;
1483
+ onDataAvailable?: () => void;
1484
+ onError?: (error: unknown) => void;
1485
+ };
1486
+
1487
+ declare type CubeRowReports = {
1488
+ /** The column that identifies a row. Without one, rows cannot be told apart and are not reported. */
1489
+ rowId?: string;
1490
+ onRowsDelivered?: (rows: any[]) => void;
1491
+ onRowsWithdrawn?: (rowIds: string[]) => void;
1492
+ onRowCacheReset?: () => void;
1493
+ };
1494
+
1443
1495
  /**
1444
1496
  * Event detail for data changes
1445
1497
  */
@@ -6057,6 +6109,16 @@ export declare const gridProGenesisDatasourceEventNames: {
6057
6109
  * Use this instead of Server-Side Row Model when you don't need Enterprise features
6058
6110
  * like row grouping, aggregation, or pivoting.
6059
6111
  *
6112
+ * **Genesis Spring data cubes**: with `cube-url` set, `resource-name` names a cube resource read
6113
+ * over HTTP from that URL: its `query` endpoint as flat rows, or the named `cube-operation`.
6114
+ * Filtering, sorting (on several columns) and paging run on the cube; `criteria` restricts every
6115
+ * request and `order-by` takes a cube sort such as `-price,name` for a grid that is not sorted.
6116
+ * Rows are read on demand, and re-read on a commit ACK for an event in `pollTriggerEvents`. The
6117
+ * Genesis stream attributes (`is-snapshot`, `max-view`, `reverse`, `request`) do not apply.
6118
+ * Rows that carry no id - a resource that is not `addressable`, or a named operation whose rows
6119
+ * have no `ROW_REF`, with no `row-id` set - are identified by position and raise no
6120
+ * `datasource-data-changed`.
6121
+ *
6060
6122
  * @see https://www.ag-grid.com/javascript-data-grid/infinite-scrolling/
6061
6123
  * @beta
6062
6124
  *
@@ -6081,12 +6143,33 @@ export declare class GridProInfiniteDatasource extends GridProInfiniteDatasource
6081
6143
  connect: Connect;
6082
6144
  connectEvents: ConnectEvents;
6083
6145
  datasource: Datasource;
6146
+ http: Http;
6147
+ /**
6148
+ * The base URL of a Genesis Spring data cube API, such as `/gwf/my-spring-app/api/v1/cubes`.
6149
+ * @remarks When set, `resource-name` names a cube resource on it rather than a Genesis resource.
6150
+ */
6151
+ cubeUrl: string;
6152
+ /**
6153
+ * A named cube operation to read instead of the cube resource's `query` endpoint.
6154
+ * @remarks Only applies with `cube-url`. Its columns offer no filters, because its schema does
6155
+ * not say which columns it accepts filters on; `criteria` still applies.
6156
+ */
6157
+ cubeOperation: string;
6084
6158
  request: any;
6085
6159
  private indexes;
6086
6160
  private infiniteDatasource;
6161
+ private readonly cube;
6162
+ private initialised;
6087
6163
  /** Unsubscribes the commit-response listener behind `pollTriggerEvents`. @internal */
6088
6164
  private commitResponseUnsubscribe?;
6165
+ protected get rowId(): string;
6166
+ private get isCube();
6089
6167
  resourceNameChanged(oldValue: string, newValue: string): void;
6168
+ cubeUrlChanged(oldValue: string, newValue: string): void;
6169
+ cubeOperationChanged(oldValue: string, newValue: string): void;
6170
+ private restartOnCubeSourceChange;
6171
+ /** Cube reads go over HTTP, so a socket drop says nothing about them. */
6172
+ private syncConnectionSubscription;
6090
6173
  criteriaChanged(oldCriteria: string, newCriteria: string): void;
6091
6174
  connectedCallback(): void;
6092
6175
  disconnectedCallback(): void;
@@ -6127,6 +6210,11 @@ export declare class GridProInfiniteDatasource extends GridProInfiniteDatasource
6127
6210
  private isInfiniteSupportedForResource;
6128
6211
  /** @internal */
6129
6212
  private onDatasourceReady;
6213
+ /** @internal */
6214
+ private attachInfiniteDatasource;
6215
+ private cubeGridOptions;
6216
+ private onCubeReady;
6217
+ private reloadCubeData;
6130
6218
  /**
6131
6219
  * A pushed INSERT/DELETE changes which rows exist or their order, so the change is reported
6132
6220
  * and then the rows are re-read (purge).
@@ -6170,8 +6258,8 @@ export declare class GridProInfiniteDatasource extends GridProInfiniteDatasource
6170
6258
  * Honours `pollTriggerEvents` without polling: a commit ACK for one of the listed events
6171
6259
  * means a write went through this session, so the loaded blocks are re-read in place - the
6172
6260
  * same action as `applyTransaction`, which keeps the grid's row count and scroll position.
6173
- * @remarks REQUEST_SERVER only. DATASERVER already receives every change on the paging
6174
- * subscription, so a commit-triggered re-read there would just duplicate the live push.
6261
+ * @remarks REQUEST_SERVER and cube resources only. DATASERVER already receives every change on
6262
+ * the paging subscription, so a commit-triggered re-read there would just duplicate the live push.
6175
6263
  * @internal
6176
6264
  */
6177
6265
  private setupCommitTriggeredRefresh;
@@ -7437,6 +7525,16 @@ export declare enum GridProRendererTypes {
7437
7525
  * `criteriaOnlyRequest`. A req/rep resource without it reports a `resource-type` error and no
7438
7526
  * datasource is attached to the grid.
7439
7527
  *
7528
+ * **Genesis Spring data cubes**: with `cube-url` set, `resource-name` names a cube resource read
7529
+ * over HTTP from that URL: its `query` endpoint, or the named `cube-operation`. Filtering, sorting
7530
+ * and paging run on the cube, and on the `query` endpoint row grouping and value aggregation do
7531
+ * too; `criteria` restricts every request. The Genesis stream attributes (`live-updates`, polling,
7532
+ * `is-snapshot`, `order-by`, `request`) do not apply. Row grouping also requires the AG Grid
7533
+ * Enterprise `RowGroupingModule`, and is not offered on date and datetime columns: a request that
7534
+ * groups by one is refused and reported as a datasource error. Rows that carry no id - a resource
7535
+ * that is not `addressable`, or a named operation whose rows have no `ROW_REF`, with no `row-id`
7536
+ * set - get AG Grid's own row ids and raise no `datasource-data-changed`.
7537
+ *
7440
7538
  * **Custom Sort Indicators**: This datasource automatically applies custom sort indicators that are always visible (instead of only on hover).
7441
7539
  * Sortable columns will show a subtle sort icon even when not sorted, and active sort indicators will be more prominent.
7442
7540
  * The custom styling uses AG Grid's native icon font for consistency with the grid theme.
@@ -7465,19 +7563,49 @@ export declare enum GridProRendererTypes {
7465
7563
  */
7466
7564
  export declare class GridProServerSideDatasource extends GridProServerSideDatasource_base {
7467
7565
  pollingDatasource: Datasource;
7566
+ http: Http;
7468
7567
  /**
7469
7568
  * Enable live updates for the grid.
7470
7569
  * @remarks Only works with DATASERVER resources (StreamDatasource) right now.
7471
7570
  */
7472
7571
  liveUpdates: boolean;
7572
+ /**
7573
+ * The base URL of a Genesis Spring data cube API, such as `/gwf/my-spring-app/api/v1/cubes`.
7574
+ * @remarks When set, `resource-name` names a cube resource on it rather than a Genesis resource.
7575
+ */
7576
+ cubeUrl: string;
7577
+ /**
7578
+ * A named cube operation to read instead of the cube resource's `query` endpoint.
7579
+ * @remarks Only applies with `cube-url`. A named operation returns rows it has already
7580
+ * aggregated, so row grouping is not available on it. Its columns offer no filters, because its
7581
+ * schema does not say which columns it accepts filters on; `criteria` still applies.
7582
+ */
7583
+ cubeOperation: string;
7473
7584
  request: any;
7474
7585
  private indexes;
7475
7586
  private ssrmDatasource;
7587
+ private readonly cube;
7588
+ private cubeSsrmDatasource;
7589
+ private initialised;
7476
7590
  private liveUpdatesStream;
7591
+ private filterSub;
7592
+ protected get rowId(): string;
7593
+ private get isCube();
7477
7594
  resourceNameChanged(oldValue: string, newValue: string): void;
7595
+ cubeUrlChanged(oldValue: string, newValue: string): void;
7596
+ cubeOperationChanged(oldValue: string, newValue: string): void;
7478
7597
  criteriaChanged(oldCriteria: string, newCriteria: string): void;
7479
7598
  connectedCallback(): void;
7480
7599
  disconnectedCallback(): void;
7600
+ /** Cube reads go over HTTP, so a socket drop says nothing about them. */
7601
+ private syncConnectionSubscription;
7602
+ /**
7603
+ * Re-reads an attached cube once a burst of `setFilter()` / `removeFilter()` calls settles.
7604
+ * @remarks Genesis resources are left as they were: their criteria is fixed when the stream or
7605
+ * request is created.
7606
+ */
7607
+ private subscribeToFilterChanges;
7608
+ private unsubscribeFromFilterChanges;
7481
7609
  deepClone(): Node;
7482
7610
  /**
7483
7611
  * Resets the grid data while keeping columnDefs and reloads data.
@@ -7496,6 +7624,7 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
7496
7624
  */
7497
7625
  private removeServerSideSortIndicatorStyling;
7498
7626
  init(): Promise<void>;
7627
+ private genesisGridOptions;
7499
7628
  private clearReadyListener;
7500
7629
  private onDatasourceReady;
7501
7630
  destroy(): Promise<void>;
@@ -7589,6 +7718,13 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
7589
7718
  private createDataserverStream;
7590
7719
  private getAgColumnDefs;
7591
7720
  loadMore(): void;
7721
+ private restartOnCubeSourceChange;
7722
+ private cubeGridOptions;
7723
+ /** A group row is identified by its group value: only some cubes give group rows a `ROW_REF`. */
7724
+ private cubeRowId;
7725
+ private onCubeReady;
7726
+ private reloadCubeData;
7727
+ private purgeCubeRows;
7592
7728
  }
7593
7729
 
7594
7730
  declare const GridProServerSideDatasource_base: (new (...args: any[]) => {
@@ -9884,7 +10020,7 @@ export declare type ServerSideDatasourceOptions = {
9884
10020
  * @remarks `null` clears the datasource from the grid on teardown.
9885
10021
  */
9886
10022
  export declare interface SetInfiniteDatasourceEventDetail {
9887
- datasource: GenesisInfiniteDatasource | null;
10023
+ datasource: GenesisInfiniteDatasource | CubeInfiniteDatasource | null;
9888
10024
  }
9889
10025
 
9890
10026
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/grid-pro",
3
3
  "description": "Genesis Foundation AG Grid",
4
- "version": "15.97.0",
4
+ "version": "15.98.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -38,19 +38,19 @@
38
38
  }
39
39
  },
40
40
  "devDependencies": {
41
- "@genesislcap/foundation-testing": "15.97.0",
42
- "@genesislcap/genx": "15.97.0",
43
- "@genesislcap/ts-builder": "15.97.0",
44
- "@genesislcap/uvu-playwright-builder": "15.97.0",
45
- "@genesislcap/vite-builder": "15.97.0",
46
- "@genesislcap/webpack-builder": "15.97.0"
41
+ "@genesislcap/foundation-testing": "15.98.0",
42
+ "@genesislcap/genx": "15.98.0",
43
+ "@genesislcap/ts-builder": "15.98.0",
44
+ "@genesislcap/uvu-playwright-builder": "15.98.0",
45
+ "@genesislcap/vite-builder": "15.98.0",
46
+ "@genesislcap/webpack-builder": "15.98.0"
47
47
  },
48
48
  "dependencies": {
49
- "@genesislcap/foundation-comms": "15.97.0",
50
- "@genesislcap/foundation-criteria": "15.97.0",
51
- "@genesislcap/foundation-logger": "15.97.0",
52
- "@genesislcap/foundation-ui": "15.97.0",
53
- "@genesislcap/foundation-utils": "15.97.0",
49
+ "@genesislcap/foundation-comms": "15.98.0",
50
+ "@genesislcap/foundation-criteria": "15.98.0",
51
+ "@genesislcap/foundation-logger": "15.98.0",
52
+ "@genesislcap/foundation-ui": "15.98.0",
53
+ "@genesislcap/foundation-utils": "15.98.0",
54
54
  "@microsoft/fast-colors": "5.3.1",
55
55
  "@microsoft/fast-components": "2.30.6",
56
56
  "@microsoft/fast-element": "1.14.0",