@genesislcap/grid-pro 15.10.1 → 15.10.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 +46 -0
- package/dist/dts/datasource/server-side.datasource.d.ts +2 -0
- package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
- package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts +7 -1
- package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts.map +1 -1
- package/dist/esm/datasource/server-side.datasource.js +79 -71
- package/dist/esm/grid-pro-genesis-datasource/grid-pro-genesis-datasource.js +11 -3
- package/dist/grid-pro.d.ts +9 -1
- package/package.json +14 -14
|
@@ -10332,6 +10332,19 @@
|
|
|
10332
10332
|
"module": "src/grid-pro-genesis-datasource/grid-pro-genesis-datasource.ts"
|
|
10333
10333
|
}
|
|
10334
10334
|
},
|
|
10335
|
+
{
|
|
10336
|
+
"kind": "field",
|
|
10337
|
+
"name": "onDatasourceReady",
|
|
10338
|
+
"type": {
|
|
10339
|
+
"text": "EventListener"
|
|
10340
|
+
},
|
|
10341
|
+
"privacy": "private",
|
|
10342
|
+
"readonly": true,
|
|
10343
|
+
"inheritedFrom": {
|
|
10344
|
+
"name": "GridProGenesisDatasource",
|
|
10345
|
+
"module": "src/grid-pro-genesis-datasource/grid-pro-genesis-datasource.ts"
|
|
10346
|
+
}
|
|
10347
|
+
},
|
|
10335
10348
|
{
|
|
10336
10349
|
"kind": "method",
|
|
10337
10350
|
"name": "colDefsDeepClone",
|
|
@@ -10387,6 +10400,15 @@
|
|
|
10387
10400
|
"module": "src/grid-pro-genesis-datasource/grid-pro-genesis-datasource.ts"
|
|
10388
10401
|
}
|
|
10389
10402
|
},
|
|
10403
|
+
{
|
|
10404
|
+
"kind": "method",
|
|
10405
|
+
"name": "clearReadyListener",
|
|
10406
|
+
"privacy": "private",
|
|
10407
|
+
"inheritedFrom": {
|
|
10408
|
+
"name": "GridProGenesisDatasource",
|
|
10409
|
+
"module": "src/grid-pro-genesis-datasource/grid-pro-genesis-datasource.ts"
|
|
10410
|
+
}
|
|
10411
|
+
},
|
|
10390
10412
|
{
|
|
10391
10413
|
"kind": "method",
|
|
10392
10414
|
"name": "destroy",
|
|
@@ -12038,6 +12060,16 @@
|
|
|
12038
12060
|
"kind": "method",
|
|
12039
12061
|
"name": "init"
|
|
12040
12062
|
},
|
|
12063
|
+
{
|
|
12064
|
+
"kind": "method",
|
|
12065
|
+
"name": "clearReadyListener",
|
|
12066
|
+
"privacy": "private"
|
|
12067
|
+
},
|
|
12068
|
+
{
|
|
12069
|
+
"kind": "field",
|
|
12070
|
+
"name": "onDatasourceReady",
|
|
12071
|
+
"privacy": "private"
|
|
12072
|
+
},
|
|
12041
12073
|
{
|
|
12042
12074
|
"kind": "method",
|
|
12043
12075
|
"name": "destroy",
|
|
@@ -16220,6 +16252,15 @@
|
|
|
16220
16252
|
"privacy": "private",
|
|
16221
16253
|
"default": "0"
|
|
16222
16254
|
},
|
|
16255
|
+
{
|
|
16256
|
+
"kind": "field",
|
|
16257
|
+
"name": "onDatasourceReady",
|
|
16258
|
+
"type": {
|
|
16259
|
+
"text": "EventListener"
|
|
16260
|
+
},
|
|
16261
|
+
"privacy": "private",
|
|
16262
|
+
"readonly": true
|
|
16263
|
+
},
|
|
16223
16264
|
{
|
|
16224
16265
|
"kind": "method",
|
|
16225
16266
|
"name": "deepClone",
|
|
@@ -16280,6 +16321,11 @@
|
|
|
16280
16321
|
"description": "Initializes the datasource.",
|
|
16281
16322
|
"privacy": "public"
|
|
16282
16323
|
},
|
|
16324
|
+
{
|
|
16325
|
+
"kind": "method",
|
|
16326
|
+
"name": "clearReadyListener",
|
|
16327
|
+
"privacy": "private"
|
|
16328
|
+
},
|
|
16283
16329
|
{
|
|
16284
16330
|
"kind": "method",
|
|
16285
16331
|
"name": "destroy",
|
|
@@ -437,6 +437,8 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
|
|
|
437
437
|
*/
|
|
438
438
|
private removeServerSideSortIndicatorStyling;
|
|
439
439
|
init(): Promise<void>;
|
|
440
|
+
private clearReadyListener;
|
|
441
|
+
private onDatasourceReady;
|
|
440
442
|
destroy(): Promise<void>;
|
|
441
443
|
restart(): Promise<void>;
|
|
442
444
|
private clearRowData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-side.datasource.d.ts","sourceRoot":"","sources":["../../../src/datasource/server-side.datasource.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,UAAU,EACV,iBAAiB,EAYlB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,cAAc,EAEf,MAAM,+BAA+B,CAAC;AAYvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;;;;;;;;kBA8DhC,CAAA;;;;;;;;8BAmBgD,CAAC,cAAe,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAgB3E,CAAC;4IAGwC,CAAA;wFAKlB,CAAC;+IAIT,CAAC;2FAGV,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAwCqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;mBA+CvB,CAAC;;;;;;;;;;;;;6BA2BT,CAAC;8BACgB,CAAC;kBAGjB,CAAC;;oBAEK,CAAC;;sBAMW,CAAC;oBAGE,CAAC;;;;;;;;gDAgB3B,CAAC;;;;;;;;;;;;;;;;;;uBA2BsC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"server-side.datasource.d.ts","sourceRoot":"","sources":["../../../src/datasource/server-side.datasource.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,UAAU,EACV,iBAAiB,EAYlB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,cAAc,EAEf,MAAM,+BAA+B,CAAC;AAYvC,OAAO,EAAE,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6B;IAE5D,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAOtD,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAaxD,iBAAiB;IAUjB,oBAAoB;IAUX,SAAS,IAAI,IAAI;IAO1B;;;;OAIG;IACG,kBAAkB,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAwDnE;;;OAGG;IACH,OAAO,CAAC,mCAAmC;IAgB3C;;;OAGG;IACH,OAAO,CAAC,oCAAoC;IAatC,IAAI;IAiDV,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,iBAAiB,CAiFvB;IAEa,OAAO;IAsBP,OAAO;IAKtB,OAAO,CAAC,YAAY;IAmBpB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,0BAA0B;IAYlC;;;;;;OAMG;IACH,OAAO,CAAC,0BAA0B;IAKlC,OAAO,CAAC,kBAAkB;YAgDZ,mBAAmB;IAKjC;;;;;;;;;;;;OAYG;YACW,kBAAkB;IA+BhC;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB,CAA+B;IAEzD;;;;;;;;;OASG;IACH,OAAO,CAAC,0BAA0B,CAAS;IAE3C;;;;;;OAMG;IACI,uBAAuB;IAM9B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,wBAAwB;IAsEhC,OAAO,CAAC,yBAAyB;YAyCnB,sBAAsB;YA2DtB,eAAe;IAmBpB,gBAAgB,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG;IAIvC,QAAQ;CAGlB"}
|
|
@@ -136,7 +136,11 @@ declare const GridProGenesisDatasource_base: (new (...args: any[]) => {
|
|
|
136
136
|
setAttributeNodeNS(attr: Attr): Attr | null;
|
|
137
137
|
setHTMLUnsafe(html: string): void;
|
|
138
138
|
setPointerCapture(pointerId: number): void;
|
|
139
|
-
toggleAttribute(qualifiedName: string, force
|
|
139
|
+
toggleAttribute(qualifiedName: string, force? /**
|
|
140
|
+
* Sets the columnDefs and rowData for the grid.
|
|
141
|
+
* @remarks This should only happen once, when the grid is first initialized. Follow up updates will use transactions.
|
|
142
|
+
* @internal
|
|
143
|
+
*/: boolean): boolean;
|
|
140
144
|
webkitMatchesSelector(selectors: string): boolean;
|
|
141
145
|
textContent: string;
|
|
142
146
|
readonly baseURI: string;
|
|
@@ -425,6 +429,7 @@ export declare class GridProGenesisDatasource extends GridProGenesisDatasource_b
|
|
|
425
429
|
private _sourceRef;
|
|
426
430
|
private _nextOffset;
|
|
427
431
|
private _loadMoreCount;
|
|
432
|
+
private readonly onDatasourceReady;
|
|
428
433
|
connectedCallback(): void;
|
|
429
434
|
disconnectedCallback(): void;
|
|
430
435
|
deepClone(): Node;
|
|
@@ -437,6 +442,7 @@ export declare class GridProGenesisDatasource extends GridProGenesisDatasource_b
|
|
|
437
442
|
* @remarks This method is called automatically when the element is connected to the DOM.
|
|
438
443
|
*/
|
|
439
444
|
init(keepColDefsOnClearRowData?: boolean): Promise<void>;
|
|
445
|
+
private clearReadyListener;
|
|
440
446
|
/**
|
|
441
447
|
* Destroys the datasource, resetting it to its initial state.
|
|
442
448
|
* @public
|
|
@@ -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":"AACA,OAAO,EACL,iBAAiB,EAUlB,MAAM,+BAA+B,CAAC;AAKvC,OAAO,EAAE,qBAAqB,EAAqB,MAAM,+BAA+B,CAAC;AAwBzF;;GAEG;AACH,UAAU,eAAe;IACvB,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC;IACZ,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;;;;;;;;kBAwBwF,CAAC;;;;;;;;8BAiDjF,CAAC,c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G;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;OAGG;IACH,OAAO,CAAC,cAAc;IAOtB;;;OAGG;IACH,OAAO,CAAC,eAAe;IAiBvB;;;;;;OAMG;IACU,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAsBhD;;;;;;;OAOG;YACW,gBAAgB;IAwG9B,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,kBAAkB;IAU1B;;;;;;;OAOG;IACH,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,sBAAsB;IAoE9B,OAAO,CAAC,mBAAmB;YA0Bb,eAAe;IAWtB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAK9C,YAAY,CAAC,SAAS,EAAE,MAAM;IAK5B,gBAAgB,CAAC,WAAW,EAAE,GAAG;IAI1C,OAAO,CAAC,iBAAiB;IAQhB,mBAAmB,CAAC,OAAO,QAAK;IAKhC,mBAAmB,CAAC,OAAO,QAAK;IAKzC;;;OAGG;IACM,mBAAmB,CAAC,OAAO,QAAK;IAKzC;;;;;OAKG;cACgB,iBAAiB,IAAI,iBAAiB;IAazD;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAc1B;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IAQnC;;;;;;OAMG;IACM,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE;IAqBlD;;;OAGG;IACH,OAAO,CAAC,cAAc;IAQb,QAAQ;CA+BlB"}
|
|
@@ -99,6 +99,77 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
99
99
|
this.liveUpdates = false;
|
|
100
100
|
this.request = {};
|
|
101
101
|
this.sortIndicatorCSSDestroy = null;
|
|
102
|
+
this.onDatasourceReady = (_event) => __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
const initOK = yield this.initializeDatasource(this.datasourceOptions(), true, false);
|
|
104
|
+
if (!initOK) {
|
|
105
|
+
logger.debug(`Genesis Datasource init failed for ${this.resourceName}`);
|
|
106
|
+
this.clearRowData();
|
|
107
|
+
this.setDisconnected(true);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (!this.isSsrmSupportedForResource()) {
|
|
111
|
+
this.refuseServerSideDatasource();
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
this.$emit(gridProGenesisDatasourceEventNames.dataInit);
|
|
115
|
+
this.setDisconnected(false);
|
|
116
|
+
this.indexes = this.getResourceIndexes(this.datasource.availableIndexes, this.datasource.availableSortableFields);
|
|
117
|
+
const fieldMetadata = toFieldMetadata(this.datasource.originalFieldDef);
|
|
118
|
+
const agColumnDefs = yield this.getAgColumnDefs(fieldMetadata);
|
|
119
|
+
// Emit event to set column definitions
|
|
120
|
+
this.$emit(datasourceEventNames.schemaUpdated, {
|
|
121
|
+
schema: agColumnDefs,
|
|
122
|
+
metadata: fieldMetadata,
|
|
123
|
+
});
|
|
124
|
+
if (this.isRequestServer) {
|
|
125
|
+
// Enable polling if not in snapshot mode and polling is not disabled
|
|
126
|
+
const usePolling = !this.isSnapshot && !this.disablePolling;
|
|
127
|
+
this.ssrmDatasource = new ReqRepServerSideDatasource({
|
|
128
|
+
createReqRepRequestFunc: this.createReqRepRequest.bind(this),
|
|
129
|
+
createReqRepStreamFunc: usePolling ? this.createReqRepStream.bind(this) : undefined,
|
|
130
|
+
onPollingUpdateFunc: usePolling ? this.applyReqRepPollingUpdate.bind(this) : undefined,
|
|
131
|
+
resetPreviousPollResultFunc: usePolling
|
|
132
|
+
? this.resetPreviousPollResult.bind(this)
|
|
133
|
+
: undefined,
|
|
134
|
+
usePolling: usePolling,
|
|
135
|
+
reloadResourceDataFunc: this.reloadResourceData.bind(this),
|
|
136
|
+
errorHandlerFunc: this.handleErrors.bind(this),
|
|
137
|
+
onNoDataAvailableFunc: () => this.$emit(datasourceEventNames.noDataAvailable),
|
|
138
|
+
onDataAvailableFunc: () => this.$emit(datasourceEventNames.loadingFinished),
|
|
139
|
+
resourceName: this.resourceName,
|
|
140
|
+
resourceParams: this.datasource.requestOnlyParams,
|
|
141
|
+
resourceIndexes: this.indexes,
|
|
142
|
+
resourceColDefs: this.datasource.originalFieldDef,
|
|
143
|
+
maxRows: +this.maxRows,
|
|
144
|
+
maxView: +this.maxView,
|
|
145
|
+
rowId: this.rowId,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
this.ssrmDatasource = new DataserverServerSideDatasource({
|
|
150
|
+
createDataserverStreamFunc: this.createDataserverStream.bind(this),
|
|
151
|
+
reloadResourceDataFunc: this.reloadResourceData.bind(this),
|
|
152
|
+
errorHandlerFunc: this.handleErrors.bind(this),
|
|
153
|
+
onNoDataAvailableFunc: () => this.$emit(datasourceEventNames.noDataAvailable),
|
|
154
|
+
onDataAvailableFunc: () => this.$emit(datasourceEventNames.loadingFinished),
|
|
155
|
+
resourceName: this.resourceName,
|
|
156
|
+
resourceParams: this.datasource.dataserverOnlyParams,
|
|
157
|
+
resourceIndexes: this.indexes,
|
|
158
|
+
resourceColDefs: this.datasource.originalFieldDef,
|
|
159
|
+
maxRows: +this.maxRows,
|
|
160
|
+
maxView: +this.maxView,
|
|
161
|
+
rowId: this.rowId,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
// Emit event to set server side datasource
|
|
165
|
+
this.$emit(datasourceEventNames.setServerSideDatasource, {
|
|
166
|
+
datasource: this.ssrmDatasource,
|
|
167
|
+
});
|
|
168
|
+
// Emit event to restore cached filter config
|
|
169
|
+
this.$emit(datasourceEventNames.filtersRestored);
|
|
170
|
+
// Apply custom sort indicator styling for server-side datasource
|
|
171
|
+
this.applyServerSideSortIndicatorStyling();
|
|
172
|
+
});
|
|
102
173
|
/**
|
|
103
174
|
* Stores the previous poll result for comparison (poll N vs poll N-1).
|
|
104
175
|
* @remarks
|
|
@@ -270,85 +341,22 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
270
341
|
keepColDefsOnClearRowData: this.keepColDefsOnClearRowData,
|
|
271
342
|
});
|
|
272
343
|
// TODO: refactor this to prevent rendering datasource component until grid is ready
|
|
273
|
-
this.
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
this.clearRowData();
|
|
278
|
-
this.setDisconnected(true);
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
if (!this.isSsrmSupportedForResource()) {
|
|
282
|
-
this.refuseServerSideDatasource();
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
this.$emit(gridProGenesisDatasourceEventNames.dataInit);
|
|
286
|
-
this.setDisconnected(false);
|
|
287
|
-
this.indexes = this.getResourceIndexes(this.datasource.availableIndexes, this.datasource.availableSortableFields);
|
|
288
|
-
const fieldMetadata = toFieldMetadata(this.datasource.originalFieldDef);
|
|
289
|
-
const agColumnDefs = yield this.getAgColumnDefs(fieldMetadata);
|
|
290
|
-
// Emit event to set column definitions
|
|
291
|
-
this.$emit(datasourceEventNames.schemaUpdated, {
|
|
292
|
-
schema: agColumnDefs,
|
|
293
|
-
metadata: fieldMetadata,
|
|
294
|
-
});
|
|
295
|
-
if (this.isRequestServer) {
|
|
296
|
-
// Enable polling if not in snapshot mode and polling is not disabled
|
|
297
|
-
const usePolling = !this.isSnapshot && !this.disablePolling;
|
|
298
|
-
this.ssrmDatasource = new ReqRepServerSideDatasource({
|
|
299
|
-
createReqRepRequestFunc: this.createReqRepRequest.bind(this),
|
|
300
|
-
createReqRepStreamFunc: usePolling ? this.createReqRepStream.bind(this) : undefined,
|
|
301
|
-
onPollingUpdateFunc: usePolling ? this.applyReqRepPollingUpdate.bind(this) : undefined,
|
|
302
|
-
resetPreviousPollResultFunc: usePolling
|
|
303
|
-
? this.resetPreviousPollResult.bind(this)
|
|
304
|
-
: undefined,
|
|
305
|
-
usePolling: usePolling,
|
|
306
|
-
reloadResourceDataFunc: this.reloadResourceData.bind(this),
|
|
307
|
-
errorHandlerFunc: this.handleErrors.bind(this),
|
|
308
|
-
onNoDataAvailableFunc: () => this.$emit(datasourceEventNames.noDataAvailable),
|
|
309
|
-
onDataAvailableFunc: () => this.$emit(datasourceEventNames.loadingFinished),
|
|
310
|
-
resourceName: this.resourceName,
|
|
311
|
-
resourceParams: this.datasource.requestOnlyParams,
|
|
312
|
-
resourceIndexes: this.indexes,
|
|
313
|
-
resourceColDefs: this.datasource.originalFieldDef,
|
|
314
|
-
maxRows: +this.maxRows,
|
|
315
|
-
maxView: +this.maxView,
|
|
316
|
-
rowId: this.rowId,
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
this.ssrmDatasource = new DataserverServerSideDatasource({
|
|
321
|
-
createDataserverStreamFunc: this.createDataserverStream.bind(this),
|
|
322
|
-
reloadResourceDataFunc: this.reloadResourceData.bind(this),
|
|
323
|
-
errorHandlerFunc: this.handleErrors.bind(this),
|
|
324
|
-
onNoDataAvailableFunc: () => this.$emit(datasourceEventNames.noDataAvailable),
|
|
325
|
-
onDataAvailableFunc: () => this.$emit(datasourceEventNames.loadingFinished),
|
|
326
|
-
resourceName: this.resourceName,
|
|
327
|
-
resourceParams: this.datasource.dataserverOnlyParams,
|
|
328
|
-
resourceIndexes: this.indexes,
|
|
329
|
-
resourceColDefs: this.datasource.originalFieldDef,
|
|
330
|
-
maxRows: +this.maxRows,
|
|
331
|
-
maxView: +this.maxView,
|
|
332
|
-
rowId: this.rowId,
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
// Emit event to set server side datasource
|
|
336
|
-
this.$emit(datasourceEventNames.setServerSideDatasource, {
|
|
337
|
-
datasource: this.ssrmDatasource,
|
|
338
|
-
});
|
|
339
|
-
// Emit event to restore cached filter config
|
|
340
|
-
this.$emit(datasourceEventNames.filtersRestored);
|
|
341
|
-
// Apply custom sort indicator styling for server-side datasource
|
|
342
|
-
this.applyServerSideSortIndicatorStyling();
|
|
343
|
-
}), { once: true });
|
|
344
|
+
this.clearReadyListener();
|
|
345
|
+
this.addEventListener(datasourceEventNames.ready, this.onDatasourceReady, {
|
|
346
|
+
once: true,
|
|
347
|
+
});
|
|
344
348
|
if (!this.resourceName) {
|
|
345
349
|
this.handleErrors('Application not connected or invalid resource name, datasource will not work.', 'unknown');
|
|
346
350
|
}
|
|
347
351
|
});
|
|
348
352
|
}
|
|
353
|
+
clearReadyListener() {
|
|
354
|
+
this.removeEventListener(datasourceEventNames.ready, this.onDatasourceReady);
|
|
355
|
+
}
|
|
349
356
|
destroy() {
|
|
350
357
|
return __awaiter(this, void 0, void 0, function* () {
|
|
351
358
|
var _a, _b;
|
|
359
|
+
this.clearReadyListener();
|
|
352
360
|
this.datasource.destroy();
|
|
353
361
|
(_a = this.liveUpdatesStream) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
354
362
|
this.liveUpdatesStream = undefined;
|
|
@@ -62,6 +62,9 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
62
62
|
this._isMoreRowsResult = false;
|
|
63
63
|
this._nextOffset = 0;
|
|
64
64
|
this._loadMoreCount = 0;
|
|
65
|
+
this.onDatasourceReady = () => {
|
|
66
|
+
void this.loadResourceData();
|
|
67
|
+
};
|
|
65
68
|
}
|
|
66
69
|
// DatasourceOptions
|
|
67
70
|
criteriaChanged(oldCriteria, newCriteria) {
|
|
@@ -152,9 +155,10 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
152
155
|
options: Object.assign({ getRowId: (params) => params.data[this.rowId] }, this.deferredGridOptions),
|
|
153
156
|
});
|
|
154
157
|
// TODO: instead of listening to ready event, we should only render the datasource slot when the grid is ready
|
|
155
|
-
this.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
+
this.clearReadyListener();
|
|
159
|
+
this.addEventListener(datasourceEventNames.ready, this.onDatasourceReady, {
|
|
160
|
+
once: true,
|
|
161
|
+
});
|
|
158
162
|
const filterDebounceTime = 600;
|
|
159
163
|
this.updateSub = this.update
|
|
160
164
|
.pipe(skip(1), debounceTime(filterDebounceTime), tap((f) => logger.debug('filters (debounced): ', f)))
|
|
@@ -163,6 +167,9 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
163
167
|
});
|
|
164
168
|
});
|
|
165
169
|
}
|
|
170
|
+
clearReadyListener() {
|
|
171
|
+
this.removeEventListener(datasourceEventNames.ready, this.onDatasourceReady);
|
|
172
|
+
}
|
|
166
173
|
/**
|
|
167
174
|
* Destroys the datasource, resetting it to its initial state.
|
|
168
175
|
* @public
|
|
@@ -170,6 +177,7 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
170
177
|
destroy() {
|
|
171
178
|
var _a;
|
|
172
179
|
logger.debug('GridProGenesisDatasource.destroy()', this.resourceName);
|
|
180
|
+
this.clearReadyListener();
|
|
173
181
|
if (this.dataSub) {
|
|
174
182
|
this.dataSub.unsubscribe();
|
|
175
183
|
this.dataSub = undefined;
|
package/dist/grid-pro.d.ts
CHANGED
|
@@ -4447,6 +4447,7 @@ export declare class GridProGenesisDatasource extends GridProGenesisDatasource_b
|
|
|
4447
4447
|
private _sourceRef;
|
|
4448
4448
|
private _nextOffset;
|
|
4449
4449
|
private _loadMoreCount;
|
|
4450
|
+
private readonly onDatasourceReady;
|
|
4450
4451
|
connectedCallback(): void;
|
|
4451
4452
|
disconnectedCallback(): void;
|
|
4452
4453
|
deepClone(): Node;
|
|
@@ -4459,6 +4460,7 @@ export declare class GridProGenesisDatasource extends GridProGenesisDatasource_b
|
|
|
4459
4460
|
* @remarks This method is called automatically when the element is connected to the DOM.
|
|
4460
4461
|
*/
|
|
4461
4462
|
init(keepColDefsOnClearRowData?: boolean): Promise<void>;
|
|
4463
|
+
private clearReadyListener;
|
|
4462
4464
|
/**
|
|
4463
4465
|
* Destroys the datasource, resetting it to its initial state.
|
|
4464
4466
|
* @public
|
|
@@ -4717,7 +4719,11 @@ declare const GridProGenesisDatasource_base: (new (...args: any[]) => {
|
|
|
4717
4719
|
setAttributeNodeNS(attr: Attr): Attr | null;
|
|
4718
4720
|
setHTMLUnsafe(html: string): void;
|
|
4719
4721
|
setPointerCapture(pointerId: number): void;
|
|
4720
|
-
toggleAttribute(qualifiedName: string, force
|
|
4722
|
+
toggleAttribute(qualifiedName: string, force? /**
|
|
4723
|
+
* Sets the columnDefs and rowData for the grid.
|
|
4724
|
+
* @remarks This should only happen once, when the grid is first initialized. Follow up updates will use transactions.
|
|
4725
|
+
* @internal
|
|
4726
|
+
*/: boolean): boolean;
|
|
4721
4727
|
webkitMatchesSelector(selectors: string): boolean;
|
|
4722
4728
|
textContent: string;
|
|
4723
4729
|
readonly baseURI: string;
|
|
@@ -5072,6 +5078,8 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
|
|
|
5072
5078
|
*/
|
|
5073
5079
|
private removeServerSideSortIndicatorStyling;
|
|
5074
5080
|
init(): Promise<void>;
|
|
5081
|
+
private clearReadyListener;
|
|
5082
|
+
private onDatasourceReady;
|
|
5075
5083
|
destroy(): Promise<void>;
|
|
5076
5084
|
restart(): Promise<void>;
|
|
5077
5085
|
private clearRowData;
|
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.10.
|
|
4
|
+
"version": "15.10.2",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -40,20 +40,20 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@genesislcap/foundation-testing": "15.10.
|
|
44
|
-
"@genesislcap/genx": "15.10.
|
|
45
|
-
"@genesislcap/rollup-builder": "15.10.
|
|
46
|
-
"@genesislcap/ts-builder": "15.10.
|
|
47
|
-
"@genesislcap/uvu-playwright-builder": "15.10.
|
|
48
|
-
"@genesislcap/vite-builder": "15.10.
|
|
49
|
-
"@genesislcap/webpack-builder": "15.10.
|
|
43
|
+
"@genesislcap/foundation-testing": "15.10.2",
|
|
44
|
+
"@genesislcap/genx": "15.10.2",
|
|
45
|
+
"@genesislcap/rollup-builder": "15.10.2",
|
|
46
|
+
"@genesislcap/ts-builder": "15.10.2",
|
|
47
|
+
"@genesislcap/uvu-playwright-builder": "15.10.2",
|
|
48
|
+
"@genesislcap/vite-builder": "15.10.2",
|
|
49
|
+
"@genesislcap/webpack-builder": "15.10.2"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@genesislcap/foundation-comms": "15.10.
|
|
53
|
-
"@genesislcap/foundation-criteria": "15.10.
|
|
54
|
-
"@genesislcap/foundation-logger": "15.10.
|
|
55
|
-
"@genesislcap/foundation-ui": "15.10.
|
|
56
|
-
"@genesislcap/foundation-utils": "15.10.
|
|
52
|
+
"@genesislcap/foundation-comms": "15.10.2",
|
|
53
|
+
"@genesislcap/foundation-criteria": "15.10.2",
|
|
54
|
+
"@genesislcap/foundation-logger": "15.10.2",
|
|
55
|
+
"@genesislcap/foundation-ui": "15.10.2",
|
|
56
|
+
"@genesislcap/foundation-utils": "15.10.2",
|
|
57
57
|
"@microsoft/fast-colors": "5.3.1",
|
|
58
58
|
"@microsoft/fast-components": "2.30.6",
|
|
59
59
|
"@microsoft/fast-element": "1.14.0",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"require": "./dist/react.cjs"
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "85189092e1be3c1876961cce085154f263c11cb1"
|
|
95
95
|
}
|