@genesislcap/grid-pro 14.12.3-alpha-964c9f1.0 → 14.12.3
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/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts +2 -6
- package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts.map +1 -1
- package/dist/dts/grid-pro.d.ts.map +1 -1
- package/dist/esm/grid-pro-genesis-datasource/grid-pro-genesis-datasource.js +34 -70
- package/dist/esm/grid-pro.js +2 -1
- package/package.json +6 -6
|
@@ -346,20 +346,17 @@ export declare class GridProGenesisDatasource extends GridProGenesisDatasource_b
|
|
|
346
346
|
isSnapshot: boolean;
|
|
347
347
|
maxRows: number;
|
|
348
348
|
maxView: number;
|
|
349
|
-
pollingInterval: number;
|
|
350
349
|
movingView: boolean;
|
|
351
350
|
orderBy: string;
|
|
352
351
|
request: any;
|
|
353
352
|
resourceName: string;
|
|
354
353
|
resourceNameChanged(oldValue: string, newValue: string): void;
|
|
355
354
|
reverse: boolean;
|
|
356
|
-
rowId:
|
|
357
|
-
datasourceKey: string;
|
|
355
|
+
rowId: string;
|
|
358
356
|
restartOnReconnection: boolean;
|
|
359
357
|
private dataSub;
|
|
360
358
|
private updateSub;
|
|
361
359
|
private connectionSub;
|
|
362
|
-
private isRequestServer;
|
|
363
360
|
private requiresFullRowDataAndColDefs;
|
|
364
361
|
private dataSubWasLoggedOff;
|
|
365
362
|
private rows;
|
|
@@ -371,8 +368,7 @@ export declare class GridProGenesisDatasource extends GridProGenesisDatasource_b
|
|
|
371
368
|
disconnectedCallback(): void;
|
|
372
369
|
deepClone(): Node;
|
|
373
370
|
private get agGrid();
|
|
374
|
-
|
|
375
|
-
init(): Promise<void>;
|
|
371
|
+
init(): void;
|
|
376
372
|
deinit(): void;
|
|
377
373
|
/**
|
|
378
374
|
* Use {@link deinit} instead
|
|
@@ -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,OAAO,EAEP,UAAU,
|
|
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,OAAO,EAEP,UAAU,EAWX,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiB/D,qBAGa,wBAAyB,SAAQ,6BAAiC;IACpE,OAAO,EAAG,OAAO,CAAC;IACf,UAAU,EAAG,UAAU,CAAC;IAExB,mBAAmB,EAAE,WAAW,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACgC,UAAU,UAAS;IACvC,OAAO,EAAE,MAAM,CAAmC;IAClD,OAAO,EAAE,MAAM,CAAoC;IAChD,UAAU,UAAS;IACL,OAAO,EAAE,MAAM,CAAC;IACtD,OAAO,EAAE,GAAG,CAAC;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O,CAAC;IAE/B,OAAO,CAAC,oBAAoB,CAAS;;IAarC,iBAAiB,IAAI,IAAI;IAyBzB,oBAAoB,IAAI,IAAI;IAQ5B,wBAAwB,CAAC,qBAAqB,EAAE,cAAc,GAAG,cAAc;IAc/E,uBAAuB,IAAI,OAAO;IAOlC;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAW/B;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAIpC,OAAO,CAAC,yBAAyB;IAcjC,OAAO,CAAC,oBAAoB;IAa5B,IAAI,WAAW,CAAC,OAAO,EAAE,WAAW,EA2EnC;IAED,OAAO,CAAC,kBAAkB;IAiB1B,wBAAwB,CAAC,UAAU,GAAE,MAAM,EAAO;IAgClD,IAAI,kBAAkB,aAerB;IAED,0BAA0B,CAAC,OAAO,KAAA,EAAE,QAAQ,KAAA,EAAE,QAAQ,KAAA;IAqBtD,mBAAmB,CAAC,SAAS,KAAA,EAAE,KAAK,KAAA;IAiBpC,OAAO,CAAC,eAAe,CAAa;IAEpC,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,eAAe;CAMxB;AAGD,eAAO,MAAM,8BAA8B,EAAE,cAA0B,CAAC;AAExE,eAAO,MAAM,oBAAoB;;CAEhC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;kBAM5B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
|
2
|
-
import { Connect, dataServerResultFilter, Datasource, DatasourceDefaults, FieldTypeEnum, MessageType, normaliseCriteria,
|
|
2
|
+
import { Connect, dataServerResultFilter, Datasource, DatasourceDefaults, FieldTypeEnum, MessageType, normaliseCriteria, } from '@genesislcap/foundation-comms';
|
|
3
3
|
import { LifecycleMixin } from '@genesislcap/foundation-utils';
|
|
4
4
|
import { attr, customElement, DOM, observable } from '@microsoft/fast-element';
|
|
5
5
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
@@ -17,11 +17,10 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
17
17
|
this.isSnapshot = false;
|
|
18
18
|
this.maxRows = DatasourceDefaults.MAX_ROWS_250;
|
|
19
19
|
this.maxView = DatasourceDefaults.MAX_VIEW_1000;
|
|
20
|
-
this.pollingInterval = DatasourceDefaults.REQ_REP_POLLING_INTERVAL_MS;
|
|
21
20
|
this.movingView = false;
|
|
22
21
|
this.reverse = false;
|
|
22
|
+
this.rowId = 'ROW_REF';
|
|
23
23
|
this.restartOnReconnection = false;
|
|
24
|
-
this.isRequestServer = false;
|
|
25
24
|
this.requiresFullRowDataAndColDefs = true;
|
|
26
25
|
this.dataSubWasLoggedOff = false;
|
|
27
26
|
this.rows = new Map();
|
|
@@ -35,12 +34,12 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
35
34
|
}
|
|
36
35
|
connectedCallback() {
|
|
37
36
|
super.connectedCallback();
|
|
38
|
-
DOM.queueUpdate(() =>
|
|
37
|
+
DOM.queueUpdate(() => {
|
|
39
38
|
if (!this.shouldRunConnect)
|
|
40
39
|
return;
|
|
41
|
-
|
|
42
|
-
})
|
|
43
|
-
this.connectionSub = this.connect.
|
|
40
|
+
this.init();
|
|
41
|
+
});
|
|
42
|
+
this.connectionSub = this.connect.isConnectedSubject.subscribe((isConnected) => {
|
|
44
43
|
if (isConnected && this.agGrid.attributes['ds-disconnected']) {
|
|
45
44
|
this.agGrid.removeAttribute('ds-disconnected');
|
|
46
45
|
if (this.restartOnReconnection) {
|
|
@@ -70,36 +69,22 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
70
69
|
return this.parentElement;
|
|
71
70
|
}
|
|
72
71
|
// Genesis Specific
|
|
73
|
-
get rowIdByResourceType() {
|
|
74
|
-
if (this.rowId)
|
|
75
|
-
return this.rowId; // Allow user to override
|
|
76
|
-
if (this.isRequestServer)
|
|
77
|
-
return 'RECORD_ID'; // REQUEST_SERVER default record id
|
|
78
|
-
return 'ROW_REF'; // DATASERVER default record id
|
|
79
|
-
}
|
|
80
72
|
init() {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
.subscribe((value) => {
|
|
97
|
-
this.loadResourceData(withoutFullInit);
|
|
98
|
-
});
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
logger.warn(`Application not connected, falling back to local columnDefs/rowData`);
|
|
102
|
-
});
|
|
73
|
+
if (this.agGrid && this.resourceName && this.connect.isConnected) {
|
|
74
|
+
const gridOptions = Object.assign({ getRowId: (params) => params.data[this.rowId] }, this.deferredGridOptions);
|
|
75
|
+
this.agGrid.gridOptions = Object.assign({}, gridOptions);
|
|
76
|
+
this.agGrid.addEventListener('onGridReady', () => __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
yield this.loadResourceData();
|
|
78
|
+
}), { once: true });
|
|
79
|
+
const filterDebounceTime = 600;
|
|
80
|
+
this.updateSub = this.update
|
|
81
|
+
.pipe(skip(1), debounceTime(filterDebounceTime), tap((f) => logger.debug('filters (debounced): ', f)))
|
|
82
|
+
.subscribe((value) => {
|
|
83
|
+
this.loadResourceData(withoutFullInit);
|
|
84
|
+
});
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
logger.warn(`Application not connected, falling back to local columnDefs/rowData`);
|
|
103
88
|
}
|
|
104
89
|
deinit() {
|
|
105
90
|
this.reset();
|
|
@@ -121,11 +106,10 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
121
106
|
this.connectionSub.unsubscribe();
|
|
122
107
|
this.connectionSub = undefined;
|
|
123
108
|
}
|
|
124
|
-
this.isRequestServer = false;
|
|
125
109
|
this.requiresFullRowDataAndColDefs = true;
|
|
126
110
|
this.dataSubWasLoggedOff = false;
|
|
127
111
|
this.clearRowData();
|
|
128
|
-
if (
|
|
112
|
+
if (this.sourceRef) {
|
|
129
113
|
this.connect.dataLogoff(this.sourceRef);
|
|
130
114
|
this.sourceRef = undefined;
|
|
131
115
|
}
|
|
@@ -142,7 +126,6 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
142
126
|
this.agTransaction = undefined;
|
|
143
127
|
(_b = (_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.setColumnDefs([]);
|
|
144
128
|
(_d = (_c = this.agGrid) === null || _c === void 0 ? void 0 : _c.gridApi) === null || _d === void 0 ? void 0 : _d.setRowData([]);
|
|
145
|
-
this.rowId = undefined;
|
|
146
129
|
}
|
|
147
130
|
updateRowData(rowData) {
|
|
148
131
|
const agColumnDefs = this.getAgColumnDefs(this.datasource.fieldMetadata);
|
|
@@ -196,9 +179,7 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
196
179
|
if (Array.isArray(result))
|
|
197
180
|
return result;
|
|
198
181
|
if (result.REPLY) {
|
|
199
|
-
return
|
|
200
|
-
? result.REPLY[0][this.datasourceKey]
|
|
201
|
-
: result.REPLY;
|
|
182
|
+
return result.REPLY;
|
|
202
183
|
}
|
|
203
184
|
if (result.ROW) {
|
|
204
185
|
return dataServerResultFilter(result).inserts;
|
|
@@ -216,14 +197,14 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
216
197
|
reverse: this.reverse,
|
|
217
198
|
maxRows: this.maxRows,
|
|
218
199
|
maxView: this.maxView,
|
|
219
|
-
pollingInterval: this.pollingInterval,
|
|
220
200
|
movingView: this.movingView,
|
|
221
201
|
};
|
|
222
202
|
}
|
|
223
203
|
handleStreamResult(result) {
|
|
224
204
|
if (!result)
|
|
225
205
|
return;
|
|
226
|
-
|
|
206
|
+
const isRequestServer = result.hasOwnProperty('REPLY');
|
|
207
|
+
if (isRequestServer) {
|
|
227
208
|
this.applyRequestServerData(result);
|
|
228
209
|
}
|
|
229
210
|
else {
|
|
@@ -231,37 +212,26 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
231
212
|
}
|
|
232
213
|
}
|
|
233
214
|
applyRequestServerData(requestServerResult) {
|
|
234
|
-
var _a;
|
|
215
|
+
var _a, _b;
|
|
235
216
|
if (!Array.isArray(requestServerResult.REPLY) ||
|
|
236
217
|
!((_a = requestServerResult.MESSAGE_TYPE) === null || _a === void 0 ? void 0 : _a.startsWith('REP_'))) {
|
|
237
218
|
logger.error('received invalid RequestServerResult', requestServerResult);
|
|
238
219
|
return;
|
|
239
220
|
}
|
|
240
|
-
const requestServerData = this.datasourceKey && requestServerResult.REPLY.length > 0
|
|
241
|
-
? requestServerResult.REPLY[0][this.datasourceKey]
|
|
242
|
-
: requestServerResult.REPLY;
|
|
243
221
|
if (this.requiresFullRowDataAndColDefs) {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
222
|
+
if (this.rowId !== 'ROW_REF') {
|
|
223
|
+
(_b = requestServerResult.REPLY) === null || _b === void 0 ? void 0 : _b.forEach((insertData) => {
|
|
224
|
+
this.rows.set(insertData[this.rowId], insertData);
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
const rowData = this.rows.size > 0 ? Array.from(this.rows.values()) : requestServerResult.REPLY;
|
|
248
228
|
this.updateRowData(rowData);
|
|
249
229
|
return;
|
|
250
230
|
}
|
|
251
231
|
this.agTransaction = { add: [], remove: [], update: [] };
|
|
252
|
-
|
|
253
|
-
const rowsToDelete = Array.from(this.rows.values()).filter((row) =>
|
|
254
|
-
const match = requestServerData.find((data) => data[this.rowId] === row[this.rowId]);
|
|
255
|
-
if (match) {
|
|
256
|
-
rowsToUpdate.push(match);
|
|
257
|
-
return false; // don't delete rows that need to be updated
|
|
258
|
-
}
|
|
259
|
-
return true; // delete rows that don't exist in requestServerData
|
|
260
|
-
});
|
|
261
|
-
const rowsToInsert = requestServerData.filter((data) => !this.rows.has(data[this.rowId]));
|
|
262
|
-
this.handleStreamInserts(rowsToInsert);
|
|
232
|
+
this.handleStreamInserts(requestServerResult.REPLY);
|
|
233
|
+
const rowsToDelete = Array.from(this.rows.values()).filter((row) => !requestServerResult.REPLY.includes(row));
|
|
263
234
|
this.handleStreamDeletes(rowsToDelete);
|
|
264
|
-
this.handleStreamUpdates(rowsToUpdate);
|
|
265
235
|
this.agGrid.gridApi.applyTransactionAsync(this.agTransaction);
|
|
266
236
|
}
|
|
267
237
|
applyDataserverData(dataServerResult) {
|
|
@@ -387,9 +357,6 @@ __decorate([
|
|
|
387
357
|
__decorate([
|
|
388
358
|
attr({ attribute: 'max-view' })
|
|
389
359
|
], GridProGenesisDatasource.prototype, "maxView", void 0);
|
|
390
|
-
__decorate([
|
|
391
|
-
attr({ attribute: 'polling-interval' })
|
|
392
|
-
], GridProGenesisDatasource.prototype, "pollingInterval", void 0);
|
|
393
360
|
__decorate([
|
|
394
361
|
attr({ attribute: 'moving-view' })
|
|
395
362
|
], GridProGenesisDatasource.prototype, "movingView", void 0);
|
|
@@ -408,9 +375,6 @@ __decorate([
|
|
|
408
375
|
__decorate([
|
|
409
376
|
attr({ attribute: 'row-id' })
|
|
410
377
|
], GridProGenesisDatasource.prototype, "rowId", void 0);
|
|
411
|
-
__decorate([
|
|
412
|
-
attr({ attribute: 'datasoruce-key' })
|
|
413
|
-
], GridProGenesisDatasource.prototype, "datasourceKey", void 0);
|
|
414
378
|
__decorate([
|
|
415
379
|
attr({ mode: 'boolean', attribute: 'restart-on-reconnection' })
|
|
416
380
|
], GridProGenesisDatasource.prototype, "restartOnReconnection", void 0);
|
package/dist/esm/grid-pro.js
CHANGED
|
@@ -250,8 +250,9 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
|
|
|
250
250
|
return lowerCasedPropertyNames.concat(hyphenatedPropertyNames);
|
|
251
251
|
}
|
|
252
252
|
agAttributeChangedCallback(attName, oldValue, newValue) {
|
|
253
|
-
if (
|
|
253
|
+
if (oldValue === newValue) {
|
|
254
254
|
return;
|
|
255
|
+
}
|
|
255
256
|
const gridPropertyName = this.agPropertiesMap[attName];
|
|
256
257
|
if (gridPropertyName) {
|
|
257
258
|
// for properties set before gridOptions is called
|
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.12.3
|
|
4
|
+
"version": "14.12.3",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"test": "echo \"Error: no test specified\""
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@genesislcap/foundation-testing": "14.12.3
|
|
26
|
+
"@genesislcap/foundation-testing": "^14.12.3",
|
|
27
27
|
"@playwright/test": "^1.18.1",
|
|
28
28
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
29
29
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"webpack-merge": "^5.7.3"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@genesislcap/foundation-comms": "14.12.3
|
|
78
|
-
"@genesislcap/foundation-ui": "14.12.3
|
|
79
|
-
"@genesislcap/foundation-utils": "14.12.3
|
|
77
|
+
"@genesislcap/foundation-comms": "^14.12.3",
|
|
78
|
+
"@genesislcap/foundation-ui": "^14.12.3",
|
|
79
|
+
"@genesislcap/foundation-utils": "^14.12.3",
|
|
80
80
|
"@microsoft/fast-colors": "^5.1.4",
|
|
81
81
|
"@microsoft/fast-components": "^2.21.3",
|
|
82
82
|
"@microsoft/fast-element": "^1.7.0",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"publishConfig": {
|
|
98
98
|
"access": "public"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "c1258f6a3a2658ebd1e088db57fcbae2b444f155"
|
|
101
101
|
}
|