@genesislcap/grid-pro 14.70.1 → 14.70.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +17 -2
- package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts +15 -5
- package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts.map +1 -1
- package/dist/esm/grid-pro-genesis-datasource/grid-pro-genesis-datasource.js +36 -6
- package/dist/grid-pro.d.ts +16 -5
- package/docs/api-report.md +12 -0
- package/package.json +7 -7
|
@@ -3566,9 +3566,24 @@
|
|
|
3566
3566
|
"name": "transaction",
|
|
3567
3567
|
"type": {
|
|
3568
3568
|
"text": "RowDataTransaction"
|
|
3569
|
-
}
|
|
3569
|
+
},
|
|
3570
|
+
"description": "The transaction data to be mapped."
|
|
3571
|
+
},
|
|
3572
|
+
{
|
|
3573
|
+
"name": "operations",
|
|
3574
|
+
"default": "Object.values(OperationType)",
|
|
3575
|
+
"type": {
|
|
3576
|
+
"text": "OperationType[]"
|
|
3577
|
+
},
|
|
3578
|
+
"description": "The operations to be mapped. Can be 'add', 'update' or 'remove'."
|
|
3570
3579
|
}
|
|
3571
|
-
]
|
|
3580
|
+
],
|
|
3581
|
+
"description": "Maps the transaction data to the row data mapper function, if it exists.",
|
|
3582
|
+
"return": {
|
|
3583
|
+
"type": {
|
|
3584
|
+
"text": ""
|
|
3585
|
+
}
|
|
3586
|
+
}
|
|
3572
3587
|
},
|
|
3573
3588
|
{
|
|
3574
3589
|
"kind": "method",
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { GridOptions } from '@ag-grid-community/core';
|
|
2
2
|
import { Auth, Connect, Datasource } from '@genesislcap/foundation-comms';
|
|
3
3
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
4
|
+
/**
|
|
5
|
+
* The operation type for the {@link @genesislcap/grid-pro#GridProGenesisDatasource.mapTransaction} method.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare enum OperationType {
|
|
9
|
+
Add = "add",
|
|
10
|
+
Update = "update",
|
|
11
|
+
Remove = "remove"
|
|
12
|
+
}
|
|
4
13
|
declare const GridProGenesisDatasource_base: (new (...args: any[]) => {
|
|
5
14
|
"__#1@#_container": import("@genesislcap/foundation-utils").FoundationLayoutContainer | import("@genesislcap/foundation-utils").LayoutCacheContainer | import("@genesislcap/foundation-utils").DOMContainer;
|
|
6
15
|
cloneNode(deep?: boolean): Node;
|
|
@@ -86,11 +95,6 @@ declare const GridProGenesisDatasource_base: (new (...args: any[]) => {
|
|
|
86
95
|
insertAdjacentHTML(position: InsertPosition, text: string): void;
|
|
87
96
|
insertAdjacentText(where: InsertPosition, data: string): void;
|
|
88
97
|
matches(selectors: string): boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Sends a DATA_LOGOFF when the resource is an active stream
|
|
91
|
-
* @remarks Will only happen for streaming DATASERER resources.
|
|
92
|
-
* @internal
|
|
93
|
-
*/
|
|
94
98
|
releasePointerCapture(pointerId: number): void;
|
|
95
99
|
removeAttribute(qualifiedName: string): void;
|
|
96
100
|
removeAttributeNS(namespace: string, localName: string): void;
|
|
@@ -447,6 +451,12 @@ export declare class GridProGenesisDatasource extends GridProGenesisDatasource_b
|
|
|
447
451
|
private handleStreamResult;
|
|
448
452
|
private applyRequestServerData;
|
|
449
453
|
private applyDataserverData;
|
|
454
|
+
/**
|
|
455
|
+
* Maps the transaction data to the row data mapper function, if it exists.
|
|
456
|
+
* @param transaction - The transaction data to be mapped.
|
|
457
|
+
* @param operations - The operations to be mapped. Can be 'add', 'update' or 'remove'.
|
|
458
|
+
* @returns The mapped transaction (if the row data mapper function exists), or the original transaction.
|
|
459
|
+
*/
|
|
450
460
|
private mapTransaction;
|
|
451
461
|
private handleStreamInserts;
|
|
452
462
|
private handleStreamDeletes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-pro-genesis-datasource.d.ts","sourceRoot":"","sources":["../../../src/grid-pro-genesis-datasource/grid-pro-genesis-datasource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,WAAW,EAAsB,MAAM,yBAAyB,CAAC;AAClF,OAAO,EACL,IAAI,EACJ,OAAO,EAEP,UAAU,EAYX,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC
|
|
1
|
+
{"version":3,"file":"grid-pro-genesis-datasource.d.ts","sourceRoot":"","sources":["../../../src/grid-pro-genesis-datasource/grid-pro-genesis-datasource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,WAAW,EAAsB,MAAM,yBAAyB,CAAC;AAClF,OAAO,EACL,IAAI,EACJ,OAAO,EAEP,UAAU,EAYX,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAkB/D;;;GAGG;AACH,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED;;;;GAIG;AACH,qBAGa,wBAAyB,SAAQ,6BAAiC;IACvE,IAAI,EAAG,IAAI,CAAC;IACT,OAAO,EAAG,OAAO,CAAC;IACf,UAAU,EAAG,UAAU,CAAC;IAExB,mBAAmB,EAAE,WAAW,CAAC;IACvC,QAAQ,EAAE,MAAM,CAA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;IAYlB;;;;;OAKG;YACW,kBAAkB;IAUhC;;;;;;OAMG;YACW,gBAAgB;IA4C9B,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,kBAAkB;IAU1B,OAAO,CAAC,sBAAsB;IAmD9B,OAAO,CAAC,mBAAmB;IA2B3B;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAyBtB,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,eAAe;IA6CvB,OAAO,CAAC,aAAa;IAMd,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAK9C,YAAY,CAAC,SAAS,EAAE,MAAM;CAItC"}
|
|
@@ -12,6 +12,16 @@ const criteriaDelimiter = ';';
|
|
|
12
12
|
const criteriaJoin = ' && ';
|
|
13
13
|
const withoutFullInit = null;
|
|
14
14
|
const withoutColumnDefs = null;
|
|
15
|
+
/**
|
|
16
|
+
* The operation type for the {@link @genesislcap/grid-pro#GridProGenesisDatasource.mapTransaction} method.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export var OperationType;
|
|
20
|
+
(function (OperationType) {
|
|
21
|
+
OperationType["Add"] = "add";
|
|
22
|
+
OperationType["Update"] = "update";
|
|
23
|
+
OperationType["Remove"] = "remove";
|
|
24
|
+
})(OperationType || (OperationType = {}));
|
|
15
25
|
/**
|
|
16
26
|
* The Genesis Datasource element, for CSRM-compatible data fetching and used exclusively by the GridPro element.
|
|
17
27
|
* @remarks Only supports Client-Side Row Model.
|
|
@@ -326,7 +336,6 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
326
336
|
this.setRowData(rowData);
|
|
327
337
|
return;
|
|
328
338
|
}
|
|
329
|
-
this.agTransaction = { add: [], remove: [], update: [] };
|
|
330
339
|
const rowsToUpdate = [];
|
|
331
340
|
const rowsToDelete = Array.from(this.rows.values()).filter((row) => {
|
|
332
341
|
const match = requestServerData.find((data) => data[this.rowId] === row[this.rowId]);
|
|
@@ -337,10 +346,13 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
337
346
|
return true; // delete rows that don't exist in requestServerData
|
|
338
347
|
});
|
|
339
348
|
const rowsToInsert = requestServerData.filter((data) => !this.rows.has(data[this.rowId]));
|
|
349
|
+
this.agTransaction = { add: [], remove: [] };
|
|
340
350
|
this.handleStreamInserts(rowsToInsert);
|
|
341
351
|
this.handleStreamDeletes(rowsToDelete);
|
|
352
|
+
this.agGrid.gridApi.applyTransaction(this.mapTransaction(this.agTransaction, [OperationType.Add, OperationType.Remove]));
|
|
353
|
+
this.agTransaction = { update: [] };
|
|
342
354
|
this.handleStreamUpdates(rowsToUpdate);
|
|
343
|
-
this.agGrid.gridApi.
|
|
355
|
+
this.agGrid.gridApi.applyTransactionAsync(this.mapTransaction(this.agTransaction, [OperationType.Update]));
|
|
344
356
|
}
|
|
345
357
|
applyDataserverData(dataServerResult) {
|
|
346
358
|
var _a;
|
|
@@ -352,17 +364,35 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
352
364
|
this.setRowData(rowData);
|
|
353
365
|
return;
|
|
354
366
|
}
|
|
355
|
-
this.agTransaction = { add: [], remove: []
|
|
367
|
+
this.agTransaction = { add: [], remove: [] };
|
|
356
368
|
this.handleStreamInserts(dataServerResult.inserts);
|
|
357
369
|
this.handleStreamDeletes(dataServerResult.deletes);
|
|
370
|
+
this.agGrid.gridApi.applyTransaction(this.mapTransaction(this.agTransaction, [OperationType.Add, OperationType.Remove]));
|
|
371
|
+
this.agTransaction = { update: [] };
|
|
358
372
|
this.handleStreamUpdates(dataServerResult.updates);
|
|
359
|
-
this.agGrid.gridApi.
|
|
373
|
+
this.agGrid.gridApi.applyTransactionAsync(this.mapTransaction(this.agTransaction, [OperationType.Update]));
|
|
360
374
|
}
|
|
361
|
-
|
|
375
|
+
/**
|
|
376
|
+
* Maps the transaction data to the row data mapper function, if it exists.
|
|
377
|
+
* @param transaction - The transaction data to be mapped.
|
|
378
|
+
* @param operations - The operations to be mapped. Can be 'add', 'update' or 'remove'.
|
|
379
|
+
* @returns The mapped transaction (if the row data mapper function exists), or the original transaction.
|
|
380
|
+
*/
|
|
381
|
+
mapTransaction(transaction, operations = Object.values(OperationType)) {
|
|
362
382
|
if (!this.rowDataMapper) {
|
|
363
383
|
return transaction;
|
|
364
384
|
}
|
|
365
|
-
|
|
385
|
+
const mappedTransaction = {};
|
|
386
|
+
if (operations.includes(OperationType.Add)) {
|
|
387
|
+
mappedTransaction.add = this.rowDataMapper(transaction.add, this.rows);
|
|
388
|
+
}
|
|
389
|
+
if (operations.includes(OperationType.Remove)) {
|
|
390
|
+
mappedTransaction.remove = this.rowDataMapper(transaction.remove, this.rows);
|
|
391
|
+
}
|
|
392
|
+
if (operations.includes(OperationType.Update)) {
|
|
393
|
+
mappedTransaction.update = this.rowDataMapper(transaction.update, this.rows);
|
|
394
|
+
}
|
|
395
|
+
return mappedTransaction;
|
|
366
396
|
}
|
|
367
397
|
handleStreamInserts(insertedRows) {
|
|
368
398
|
insertedRows === null || insertedRows === void 0 ? void 0 : insertedRows.forEach((insertData) => {
|
package/dist/grid-pro.d.ts
CHANGED
|
@@ -1332,6 +1332,12 @@ export declare class GridProGenesisDatasource extends GridProGenesisDatasource_b
|
|
|
1332
1332
|
private handleStreamResult;
|
|
1333
1333
|
private applyRequestServerData;
|
|
1334
1334
|
private applyDataserverData;
|
|
1335
|
+
/**
|
|
1336
|
+
* Maps the transaction data to the row data mapper function, if it exists.
|
|
1337
|
+
* @param transaction - The transaction data to be mapped.
|
|
1338
|
+
* @param operations - The operations to be mapped. Can be 'add', 'update' or 'remove'.
|
|
1339
|
+
* @returns The mapped transaction (if the row data mapper function exists), or the original transaction.
|
|
1340
|
+
*/
|
|
1335
1341
|
private mapTransaction;
|
|
1336
1342
|
private handleStreamInserts;
|
|
1337
1343
|
private handleStreamDeletes;
|
|
@@ -1427,11 +1433,6 @@ declare const GridProGenesisDatasource_base: (new (...args: any[]) => {
|
|
|
1427
1433
|
insertAdjacentHTML(position: InsertPosition, text: string): void;
|
|
1428
1434
|
insertAdjacentText(where: InsertPosition, data: string): void;
|
|
1429
1435
|
matches(selectors: string): boolean;
|
|
1430
|
-
/**
|
|
1431
|
-
* Sends a DATA_LOGOFF when the resource is an active stream
|
|
1432
|
-
* @remarks Will only happen for streaming DATASERER resources.
|
|
1433
|
-
* @internal
|
|
1434
|
-
*/
|
|
1435
1436
|
releasePointerCapture(pointerId: number): void;
|
|
1436
1437
|
removeAttribute(qualifiedName: string): void;
|
|
1437
1438
|
removeAttributeNS(namespace: string, localName: string): void;
|
|
@@ -2057,6 +2058,16 @@ export declare const logger: Logger;
|
|
|
2057
2058
|
*/
|
|
2058
2059
|
export declare function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[]): ColDef[];
|
|
2059
2060
|
|
|
2061
|
+
/**
|
|
2062
|
+
* The operation type for the {@link @genesislcap/grid-pro#GridProGenesisDatasource.mapTransaction} method.
|
|
2063
|
+
* @internal
|
|
2064
|
+
*/
|
|
2065
|
+
export declare enum OperationType {
|
|
2066
|
+
Add = "add",
|
|
2067
|
+
Update = "update",
|
|
2068
|
+
Remove = "remove"
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2060
2071
|
declare interface SelectCellRendererParams extends ICellRendererParams {
|
|
2061
2072
|
accessor: string;
|
|
2062
2073
|
defaultValue?: string;
|
package/docs/api-report.md
CHANGED
|
@@ -754,6 +754,18 @@ export const logger: Logger;
|
|
|
754
754
|
// @public
|
|
755
755
|
export function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[]): ColDef[];
|
|
756
756
|
|
|
757
|
+
// Warning: (ae-internal-missing-underscore) The name "OperationType" should be prefixed with an underscore because the declaration is marked as @internal
|
|
758
|
+
//
|
|
759
|
+
// @internal
|
|
760
|
+
export enum OperationType {
|
|
761
|
+
// (undocumented)
|
|
762
|
+
Add = "add",
|
|
763
|
+
// (undocumented)
|
|
764
|
+
Remove = "remove",
|
|
765
|
+
// (undocumented)
|
|
766
|
+
Update = "update"
|
|
767
|
+
}
|
|
768
|
+
|
|
757
769
|
// @public
|
|
758
770
|
export class SelectRenderer extends FoundationElement implements ICellRendererComp {
|
|
759
771
|
// (undocumented)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/grid-pro",
|
|
3
3
|
"description": "Genesis Foundation AG Grid",
|
|
4
|
-
"version": "14.70.
|
|
4
|
+
"version": "14.70.2",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"test:debug": "genx test --debug"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@genesislcap/foundation-testing": "14.70.
|
|
32
|
-
"@genesislcap/genx": "14.70.
|
|
31
|
+
"@genesislcap/foundation-testing": "14.70.2",
|
|
32
|
+
"@genesislcap/genx": "14.70.2",
|
|
33
33
|
"rimraf": "^3.0.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@genesislcap/foundation-comms": "14.70.
|
|
37
|
-
"@genesislcap/foundation-ui": "14.70.
|
|
38
|
-
"@genesislcap/foundation-utils": "14.70.
|
|
36
|
+
"@genesislcap/foundation-comms": "14.70.2",
|
|
37
|
+
"@genesislcap/foundation-ui": "14.70.2",
|
|
38
|
+
"@genesislcap/foundation-utils": "14.70.2",
|
|
39
39
|
"@microsoft/fast-colors": "^5.1.4",
|
|
40
40
|
"@microsoft/fast-components": "^2.21.3",
|
|
41
41
|
"@microsoft/fast-element": "^1.7.0",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"customElements": "dist/custom-elements.json",
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "efc54c4f5968451219d8ab6da8a0c73cb054c2b7"
|
|
62
62
|
}
|