@genesislcap/grid-pro 14.183.2 → 14.183.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/custom-elements.json +38 -1
- package/dist/dts/datasource/server-side.datasource.d.ts +7 -8
- package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
- package/dist/esm/datasource/server-side.datasource.js +82 -64
- package/dist/grid-pro.d.ts +7 -7
- package/docs/api-report.md +8 -1
- package/package.json +13 -13
|
@@ -8204,6 +8204,20 @@
|
|
|
8204
8204
|
"text": "SocketObservable<FilteredDataServerResult>"
|
|
8205
8205
|
}
|
|
8206
8206
|
},
|
|
8207
|
+
{
|
|
8208
|
+
"kind": "field",
|
|
8209
|
+
"name": "dataserverStreamSubscription",
|
|
8210
|
+
"type": {
|
|
8211
|
+
"text": "SocketSubscription"
|
|
8212
|
+
}
|
|
8213
|
+
},
|
|
8214
|
+
{
|
|
8215
|
+
"kind": "field",
|
|
8216
|
+
"name": "createDataserverStreamFunc",
|
|
8217
|
+
"type": {
|
|
8218
|
+
"text": "(\n existingParams?: any,\n ) => Promise<SocketObservable<FilteredDataServerResult>>"
|
|
8219
|
+
}
|
|
8220
|
+
},
|
|
8207
8221
|
{
|
|
8208
8222
|
"kind": "field",
|
|
8209
8223
|
"name": "resourceName",
|
|
@@ -8329,6 +8343,25 @@
|
|
|
8329
8343
|
}
|
|
8330
8344
|
]
|
|
8331
8345
|
},
|
|
8346
|
+
{
|
|
8347
|
+
"kind": "method",
|
|
8348
|
+
"name": "applyServerSideData",
|
|
8349
|
+
"privacy": "private",
|
|
8350
|
+
"parameters": [
|
|
8351
|
+
{
|
|
8352
|
+
"name": "params",
|
|
8353
|
+
"type": {
|
|
8354
|
+
"text": "IServerSideGetRowsParams"
|
|
8355
|
+
}
|
|
8356
|
+
},
|
|
8357
|
+
{
|
|
8358
|
+
"name": "result",
|
|
8359
|
+
"type": {
|
|
8360
|
+
"text": "RawDataServerResult"
|
|
8361
|
+
}
|
|
8362
|
+
}
|
|
8363
|
+
]
|
|
8364
|
+
},
|
|
8332
8365
|
{
|
|
8333
8366
|
"kind": "method",
|
|
8334
8367
|
"name": "sortMapByNumericKey",
|
|
@@ -8353,7 +8386,11 @@
|
|
|
8353
8386
|
},
|
|
8354
8387
|
{
|
|
8355
8388
|
"kind": "method",
|
|
8356
|
-
"name": "
|
|
8389
|
+
"name": "deinit"
|
|
8390
|
+
},
|
|
8391
|
+
{
|
|
8392
|
+
"kind": "method",
|
|
8393
|
+
"name": "refreshDatasource",
|
|
8357
8394
|
"privacy": "private",
|
|
8358
8395
|
"return": {
|
|
8359
8396
|
"type": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IServerSideDatasource, IServerSideGetRowsParams, IServerSideRowModel, RowDataTransaction, ServerSideTransactionResult } from '@ag-grid-community/core';
|
|
2
|
-
import { Auth, Connect, FilteredDataServerResult, MetadataDetail, SocketObservable } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { Auth, Connect, FilteredDataServerResult, MetadataDetail, SocketObservable, SocketSubscription } from '@genesislcap/foundation-comms';
|
|
3
3
|
import { GridProBaseDatasource, StreamBaseDatasource } from './base.datasource';
|
|
4
4
|
/**
|
|
5
5
|
* Type definition for configuration options used for streams.
|
|
@@ -8,7 +8,7 @@ import { GridProBaseDatasource, StreamBaseDatasource } from './base.datasource';
|
|
|
8
8
|
* @alpha
|
|
9
9
|
*/
|
|
10
10
|
export type StreamDatasourceOptions = {
|
|
11
|
-
|
|
11
|
+
createDataserverStreamFunc: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
12
12
|
resourceName: string;
|
|
13
13
|
resourceParams?: any;
|
|
14
14
|
resourceIndexes?: Map<string, [string]>;
|
|
@@ -26,6 +26,8 @@ export declare class StreamDatasource extends StreamBaseDatasource implements IS
|
|
|
26
26
|
auth: Auth;
|
|
27
27
|
connect: Connect;
|
|
28
28
|
dataserverStream: SocketObservable<FilteredDataServerResult>;
|
|
29
|
+
dataserverStreamSubscription: SocketSubscription;
|
|
30
|
+
createDataserverStreamFunc: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
29
31
|
private resourceName;
|
|
30
32
|
resourceParams: any;
|
|
31
33
|
private resourceIndexes;
|
|
@@ -52,9 +54,11 @@ export declare class StreamDatasource extends StreamBaseDatasource implements IS
|
|
|
52
54
|
private currentSortModel;
|
|
53
55
|
constructor(options: StreamDatasourceOptions);
|
|
54
56
|
getRows(params: IServerSideGetRowsParams): Promise<void>;
|
|
57
|
+
private applyServerSideData;
|
|
55
58
|
private sortMapByNumericKey;
|
|
56
59
|
dataLogoff(): Promise<void>;
|
|
57
|
-
|
|
60
|
+
deinit(): Promise<void>;
|
|
61
|
+
private refreshDatasource;
|
|
58
62
|
private getOrderByAndToBeSortedColIds;
|
|
59
63
|
private handleCurrentStreamLoad;
|
|
60
64
|
private buildCriteriaMatchFromFilters;
|
|
@@ -245,11 +249,6 @@ declare const GridProServerSideDatasource_base: (new (...args: any[]) => {
|
|
|
245
249
|
ariaReadOnly: string;
|
|
246
250
|
ariaRequired: string;
|
|
247
251
|
ariaRoleDescription: string;
|
|
248
|
-
/**
|
|
249
|
-
* A Genesis Datasource element, for server-side | SSRM-compatible data fetching and used exclusively by the GridPro element.
|
|
250
|
-
* @remarks Only supports Server-Side Row Model. Requires `@ag-grid-enterprise/server-side-row-model` setup and valid AG Grid Enterprise license.
|
|
251
|
-
* @alpha
|
|
252
|
-
*/
|
|
253
252
|
ariaRowCount: string;
|
|
254
253
|
ariaRowIndex: string;
|
|
255
254
|
ariaRowIndexText: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-side.datasource.d.ts","sourceRoot":"","sources":["../../../src/datasource/server-side.datasource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EAEnB,kBAAkB,EAClB,2BAA2B,EAG5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,IAAI,EACJ,OAAO,EAIP,wBAAwB,EAIxB,cAAc,
|
|
1
|
+
{"version":3,"file":"server-side.datasource.d.ts","sourceRoot":"","sources":["../../../src/datasource/server-side.datasource.ts"],"names":[],"mappings":"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"}
|
|
@@ -26,7 +26,7 @@ export class StreamDatasource extends StreamBaseDatasource {
|
|
|
26
26
|
this.moreRows = false;
|
|
27
27
|
this.calculatedRowsCount = 0;
|
|
28
28
|
this.lastSequenceId = 0;
|
|
29
|
-
this.
|
|
29
|
+
this.createDataserverStreamFunc = options.createDataserverStreamFunc;
|
|
30
30
|
this.resourceName = options.resourceName;
|
|
31
31
|
this.resourceParams = options.resourceParams;
|
|
32
32
|
this.originalCriteriaMatch = options.resourceParams.CRITERIA_MATCH;
|
|
@@ -38,7 +38,7 @@ export class StreamDatasource extends StreamBaseDatasource {
|
|
|
38
38
|
this.pagination = options.pagination;
|
|
39
39
|
}
|
|
40
40
|
getRows(params) {
|
|
41
|
-
var _a
|
|
41
|
+
var _a;
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
const filterModelBeingApplied = params.request.filterModel;
|
|
44
44
|
const filtersAreBeingApplied = Object.keys(filterModelBeingApplied).length > 0;
|
|
@@ -48,28 +48,29 @@ export class StreamDatasource extends StreamBaseDatasource {
|
|
|
48
48
|
if (filtersAreGettingCleaned && this.currentFilterModel) {
|
|
49
49
|
this.currentFilterModel = null;
|
|
50
50
|
this.resourceParams.CRITERIA_MATCH = this.originalCriteriaMatch;
|
|
51
|
-
yield this.
|
|
51
|
+
yield this.refreshDatasource(params);
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
else if (filterModelBeingAppliedDiffersFromCurrent && filtersAreBeingApplied) {
|
|
55
55
|
this.currentFilterModel = filterModelBeingApplied;
|
|
56
56
|
this.resourceParams.CRITERIA_MATCH = this.buildCriteriaMatchFromFilters();
|
|
57
|
-
yield this.
|
|
57
|
+
yield this.refreshDatasource(params);
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
const toBeAppliedSortModel = params.request.sortModel;
|
|
62
|
-
if (
|
|
62
|
+
if (((_a = this.currentSortModel) === null || _a === void 0 ? void 0 : _a.length) !== toBeAppliedSortModel.length ||
|
|
63
63
|
toBeAppliedSortModel.length > 0) {
|
|
64
64
|
if (toBeAppliedSortModel.length === 0 && this.currentSortModel) {
|
|
65
65
|
this.calculatedRowsCount = 0;
|
|
66
66
|
this.currentSortModel = null;
|
|
67
67
|
this.resourceParams.ORDER_BY = null;
|
|
68
68
|
this.resourceParams.REVERSE = null;
|
|
69
|
-
yield this.
|
|
69
|
+
yield this.refreshDatasource(params);
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
else if (toBeAppliedSortModel.length > 0) {
|
|
73
|
+
this.currentSortModel = toBeAppliedSortModel;
|
|
73
74
|
const coldIdBeingSorted = toBeAppliedSortModel[0].colId; // Not allowing multiple sorts by user
|
|
74
75
|
const sortTypeBeingApplied = toBeAppliedSortModel[0].sort;
|
|
75
76
|
const orderByAndToBeSortedColIds = this.getOrderByAndToBeSortedColIds(this.resourceIndexes, coldIdBeingSorted);
|
|
@@ -80,15 +81,13 @@ export class StreamDatasource extends StreamBaseDatasource {
|
|
|
80
81
|
logger.warn('The FIELD/column (${coldIdBeingSorted}) being sorted is not part of an INDEX, required for the [orderBy] operation. See https://learn.genesis.global/docs/database/data-types/index-entities/');
|
|
81
82
|
logger.debug('Available indexes:', availableIndexes);
|
|
82
83
|
logger.debug('Columns that can be sorted with the available indexes:', availableIndexFields);
|
|
83
|
-
(_b = params.api) === null || _b === void 0 ? void 0 : _b.refreshServerSide({ purge: true });
|
|
84
84
|
params.fail();
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
else if (JSON.stringify(toBeAppliedSortModel) !== JSON.stringify(this.currentSortModel)) {
|
|
88
|
-
this.currentSortModel = toBeAppliedSortModel;
|
|
89
88
|
this.resourceParams.ORDER_BY = orderByAndToBeSortedColIds.orderBy;
|
|
90
89
|
this.resourceParams.REVERSE = sortTypeBeingApplied === 'desc' ? true : false;
|
|
91
|
-
yield this.
|
|
90
|
+
yield this.refreshDatasource(params);
|
|
92
91
|
return;
|
|
93
92
|
}
|
|
94
93
|
}
|
|
@@ -96,55 +95,62 @@ export class StreamDatasource extends StreamBaseDatasource {
|
|
|
96
95
|
if (this.moreRows && params.request.startRow >= Number(this.maxRows)) {
|
|
97
96
|
this.connect.getMoreRows(this.streamSourceRef);
|
|
98
97
|
}
|
|
99
|
-
this.dataserverStream
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
this.moreRows = result.MORE_ROWS;
|
|
108
|
-
if (result.ROW) {
|
|
109
|
-
const nextMessage = dataServerResultFilter(result);
|
|
110
|
-
this.handleCurrentStreamLoad(nextMessage);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
this.rowData = new Map();
|
|
114
|
-
const successRowData = { rowData: [] };
|
|
115
|
-
successRowData.rowCount = 0;
|
|
116
|
-
params.success(successRowData);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
this.lastSequenceId = result.SEQUENCE_ID;
|
|
120
|
-
if (this.lastSequenceId === 1) {
|
|
121
|
-
this.streamSourceRef = result.SOURCE_REF;
|
|
122
|
-
this.server_ROWS_COUNT = (_a = result.ROWS_COUNT) !== null && _a !== void 0 ? _a : this.rowData.size;
|
|
123
|
-
}
|
|
124
|
-
const successRowData = {
|
|
125
|
-
rowData: Array.from(this.sortMapByNumericKey(this.rowData).values()),
|
|
126
|
-
rowCount: this.pagination && !this.resourceParams.CRITERIA_MATCH
|
|
127
|
-
? Math.min(this.server_ROWS_COUNT, this.maxView)
|
|
128
|
-
: undefined,
|
|
129
|
-
};
|
|
130
|
-
this.calculatedRowsCount = this.client_ROWS_COUNT;
|
|
131
|
-
if (this.calculatedRowsCount === 0) {
|
|
132
|
-
this.calculatedRowsCount = params.request.endRow;
|
|
133
|
-
}
|
|
134
|
-
if (params.request.endRow > this.maxView ||
|
|
135
|
-
params.request.endRow > this.calculatedRowsCount) {
|
|
136
|
-
successRowData.rowCount = this.calculatedRowsCount;
|
|
137
|
-
}
|
|
138
|
-
else if (params.request.endRow === this.server_ROWS_COUNT) {
|
|
139
|
-
successRowData.rowCount = this.server_ROWS_COUNT;
|
|
140
|
-
}
|
|
141
|
-
else if (!this.moreRows && this.server_ROWS_COUNT > this.calculatedRowsCount) {
|
|
142
|
-
successRowData.rowCount = this.calculatedRowsCount;
|
|
143
|
-
}
|
|
144
|
-
params.success(successRowData);
|
|
98
|
+
if (!this.dataserverStream) {
|
|
99
|
+
this.dataserverStream = yield this.createDataserverStreamFunc(this.resourceParams);
|
|
100
|
+
}
|
|
101
|
+
this.dataserverStreamSubscription = this.dataserverStream
|
|
102
|
+
.pipe(take(1))
|
|
103
|
+
.subscribe((dataserverResult) => {
|
|
104
|
+
this.applyServerSideData(params, dataserverResult);
|
|
145
105
|
});
|
|
146
106
|
});
|
|
147
107
|
}
|
|
108
|
+
applyServerSideData(params, result) {
|
|
109
|
+
var _a;
|
|
110
|
+
const messageType = result.MESSAGE_TYPE;
|
|
111
|
+
if (messageType &&
|
|
112
|
+
(messageType === MessageType.LOGOFF_ACK || messageType === MessageType.MSG_NACK)) {
|
|
113
|
+
params.fail();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this.moreRows = result.MORE_ROWS;
|
|
117
|
+
if (result.ROW) {
|
|
118
|
+
const nextMessage = dataServerResultFilter(result);
|
|
119
|
+
this.handleCurrentStreamLoad(nextMessage);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
this.rowData = new Map();
|
|
123
|
+
const successRowData = { rowData: [] };
|
|
124
|
+
successRowData.rowCount = 0;
|
|
125
|
+
params.success(successRowData);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
this.lastSequenceId = result.SEQUENCE_ID;
|
|
129
|
+
if (this.lastSequenceId === 1) {
|
|
130
|
+
this.streamSourceRef = result.SOURCE_REF;
|
|
131
|
+
this.server_ROWS_COUNT = (_a = result.ROWS_COUNT) !== null && _a !== void 0 ? _a : this.rowData.size;
|
|
132
|
+
}
|
|
133
|
+
const successRowData = {
|
|
134
|
+
rowData: Array.from(this.sortMapByNumericKey(this.rowData).values()),
|
|
135
|
+
rowCount: this.pagination && !this.resourceParams.CRITERIA_MATCH
|
|
136
|
+
? Math.min(this.server_ROWS_COUNT, this.maxView)
|
|
137
|
+
: undefined,
|
|
138
|
+
};
|
|
139
|
+
this.calculatedRowsCount = this.client_ROWS_COUNT;
|
|
140
|
+
if (this.calculatedRowsCount === 0) {
|
|
141
|
+
this.calculatedRowsCount = params.request.endRow;
|
|
142
|
+
}
|
|
143
|
+
if (params.request.endRow > this.maxView || params.request.endRow > this.calculatedRowsCount) {
|
|
144
|
+
successRowData.rowCount = this.calculatedRowsCount;
|
|
145
|
+
}
|
|
146
|
+
else if (params.request.endRow === this.server_ROWS_COUNT) {
|
|
147
|
+
successRowData.rowCount = this.server_ROWS_COUNT;
|
|
148
|
+
}
|
|
149
|
+
else if (!this.moreRows && this.server_ROWS_COUNT > this.calculatedRowsCount) {
|
|
150
|
+
successRowData.rowCount = this.calculatedRowsCount;
|
|
151
|
+
}
|
|
152
|
+
params.success(successRowData);
|
|
153
|
+
}
|
|
148
154
|
sortMapByNumericKey(inputMap) {
|
|
149
155
|
// Convert Map to array of key-value pairs
|
|
150
156
|
const sortedArray = Array.from(inputMap.entries()).sort(([key1], [key2]) => +key2 - +key1);
|
|
@@ -161,16 +167,23 @@ export class StreamDatasource extends StreamBaseDatasource {
|
|
|
161
167
|
this.streamSourceRef = undefined;
|
|
162
168
|
});
|
|
163
169
|
}
|
|
164
|
-
|
|
170
|
+
deinit() {
|
|
165
171
|
var _a;
|
|
166
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
-
yield this.dataLogoff();
|
|
168
173
|
this.rowData = new Map();
|
|
169
174
|
this.client_ROWS_COUNT = 0;
|
|
170
|
-
|
|
171
|
-
|
|
175
|
+
this.calculatedRowsCount = 0;
|
|
176
|
+
this.server_ROWS_COUNT = 0;
|
|
172
177
|
this.dataserverStream = undefined;
|
|
173
|
-
|
|
178
|
+
(_a = this.dataserverStreamSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
179
|
+
this.dataserverStreamSubscription = undefined;
|
|
180
|
+
yield this.dataLogoff();
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
refreshDatasource(params) {
|
|
184
|
+
var _a;
|
|
185
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
+
yield this.deinit();
|
|
174
187
|
(_a = params.api) === null || _a === void 0 ? void 0 : _a.refreshServerSide({ purge: true });
|
|
175
188
|
params.fail();
|
|
176
189
|
});
|
|
@@ -342,6 +355,7 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
342
355
|
deinit() {
|
|
343
356
|
var _a;
|
|
344
357
|
this.clearRowData();
|
|
358
|
+
this.ssrmDatasource.deinit();
|
|
345
359
|
this.ssrmDatasource = undefined;
|
|
346
360
|
this.originalFieldDef = undefined;
|
|
347
361
|
(_a = this.agGrid.gridApi) === null || _a === void 0 ? void 0 : _a.refreshServerSide({ purge: true });
|
|
@@ -361,7 +375,7 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
361
375
|
}, cacheBlockSize: this.maxRows, defaultColDef: {
|
|
362
376
|
filter: true,
|
|
363
377
|
resizable: true,
|
|
364
|
-
sortable:
|
|
378
|
+
sortable: false,
|
|
365
379
|
}, pagination: this.pagination, paginationPageSize: this.maxRows, rowBuffer: 0, rowModelType: 'serverSide', suppressServerSideInfiniteScroll: false, suppressMultiSort: true, onFilterChanged: (params) => { }, onSortChanged: (params) => { } }, this.deferredGridOptions);
|
|
366
380
|
this.agGrid.addEventListener('onGridReady', () => __awaiter(this, void 0, void 0, function* () {
|
|
367
381
|
const meta = yield this.connect
|
|
@@ -374,9 +388,8 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
374
388
|
const fieldMetadata = toFieldMetadata(this.originalFieldDef);
|
|
375
389
|
const agColumnDefs = yield this.getAgColumnDefs(fieldMetadata);
|
|
376
390
|
this.agGrid.gridApi.setColumnDefs(agColumnDefs);
|
|
377
|
-
const dataserverStream = yield this.createDataserverStream();
|
|
378
391
|
this.ssrmDatasource = new StreamDatasource({
|
|
379
|
-
|
|
392
|
+
createDataserverStreamFunc: this.createDataserverStream.bind(this),
|
|
380
393
|
resourceName: this.resourceName,
|
|
381
394
|
resourceParams: this.params,
|
|
382
395
|
resourceIndexes: this.indexes,
|
|
@@ -447,6 +460,9 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
447
460
|
var _a;
|
|
448
461
|
const messageType = message.MESSAGE_TYPE;
|
|
449
462
|
if (messageType === MessageType.QUERY_UPDATE && message.ROW) {
|
|
463
|
+
if (!this.ssrmDatasource) {
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
450
466
|
const nextMessage = dataServerResultFilter(message);
|
|
451
467
|
this.agTransaction = { add: [], remove: [], update: [] };
|
|
452
468
|
this.handleStreamInserts(nextMessage.inserts);
|
|
@@ -467,7 +483,9 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
467
483
|
}
|
|
468
484
|
});
|
|
469
485
|
const onError = (error) => logger.error(error);
|
|
470
|
-
return this.connect.
|
|
486
|
+
return this.connect.streamWithoutAutoTeardown(this.resourceName, (message) => {
|
|
487
|
+
streamOnMessage(message);
|
|
488
|
+
}, onError, existingParams !== null && existingParams !== void 0 ? existingParams : this.params);
|
|
471
489
|
});
|
|
472
490
|
}
|
|
473
491
|
handleStreamDeletesTemp(deletes) {
|
package/dist/grid-pro.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ import type { ServerSideTransaction } from '@ag-grid-community/core';
|
|
|
45
45
|
import type { ServerSideTransactionResult } from '@ag-grid-community/core';
|
|
46
46
|
import { Session } from '@genesislcap/foundation-comms';
|
|
47
47
|
import { SocketObservable } from '@genesislcap/foundation-comms';
|
|
48
|
+
import { SocketSubscription } from '@genesislcap/foundation-comms';
|
|
48
49
|
import { Swatch } from '@microsoft/fast-components';
|
|
49
50
|
import { SwatchRGB } from '@microsoft/fast-components';
|
|
50
51
|
import { TextField } from '@genesislcap/foundation-ui';
|
|
@@ -2829,11 +2830,6 @@ declare const GridProServerSideDatasource_base: (new (...args: any[]) => {
|
|
|
2829
2830
|
ariaReadOnly: string;
|
|
2830
2831
|
ariaRequired: string;
|
|
2831
2832
|
ariaRoleDescription: string;
|
|
2832
|
-
/**
|
|
2833
|
-
* A Genesis Datasource element, for server-side | SSRM-compatible data fetching and used exclusively by the GridPro element.
|
|
2834
|
-
* @remarks Only supports Server-Side Row Model. Requires `@ag-grid-enterprise/server-side-row-model` setup and valid AG Grid Enterprise license.
|
|
2835
|
-
* @alpha
|
|
2836
|
-
*/
|
|
2837
2833
|
ariaRowCount: string;
|
|
2838
2834
|
ariaRowIndex: string;
|
|
2839
2835
|
ariaRowIndexText: string;
|
|
@@ -3221,6 +3217,8 @@ export declare class StreamDatasource extends StreamBaseDatasource implements IS
|
|
|
3221
3217
|
auth: Auth;
|
|
3222
3218
|
connect: Connect;
|
|
3223
3219
|
dataserverStream: SocketObservable<FilteredDataServerResult>;
|
|
3220
|
+
dataserverStreamSubscription: SocketSubscription;
|
|
3221
|
+
createDataserverStreamFunc: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
3224
3222
|
private resourceName;
|
|
3225
3223
|
resourceParams: any;
|
|
3226
3224
|
private resourceIndexes;
|
|
@@ -3247,9 +3245,11 @@ export declare class StreamDatasource extends StreamBaseDatasource implements IS
|
|
|
3247
3245
|
private currentSortModel;
|
|
3248
3246
|
constructor(options: StreamDatasourceOptions);
|
|
3249
3247
|
getRows(params: IServerSideGetRowsParams): Promise<void>;
|
|
3248
|
+
private applyServerSideData;
|
|
3250
3249
|
private sortMapByNumericKey;
|
|
3251
3250
|
dataLogoff(): Promise<void>;
|
|
3252
|
-
|
|
3251
|
+
deinit(): Promise<void>;
|
|
3252
|
+
private refreshDatasource;
|
|
3253
3253
|
private getOrderByAndToBeSortedColIds;
|
|
3254
3254
|
private handleCurrentStreamLoad;
|
|
3255
3255
|
private buildCriteriaMatchFromFilters;
|
|
@@ -3264,7 +3264,7 @@ export declare class StreamDatasource extends StreamBaseDatasource implements IS
|
|
|
3264
3264
|
* @alpha
|
|
3265
3265
|
*/
|
|
3266
3266
|
export declare type StreamDatasourceOptions = {
|
|
3267
|
-
|
|
3267
|
+
createDataserverStreamFunc: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
3268
3268
|
resourceName: string;
|
|
3269
3269
|
resourceParams?: any;
|
|
3270
3270
|
resourceIndexes?: Map<string, [string]>;
|
package/docs/api-report.md
CHANGED
|
@@ -51,6 +51,7 @@ import type { ServerSideTransaction } from '@ag-grid-community/core';
|
|
|
51
51
|
import type { ServerSideTransactionResult } from '@ag-grid-community/core';
|
|
52
52
|
import { Session } from '@genesislcap/foundation-comms';
|
|
53
53
|
import { SocketObservable } from '@genesislcap/foundation-comms';
|
|
54
|
+
import { SocketSubscription } from '@genesislcap/foundation-comms';
|
|
54
55
|
import { Swatch } from '@microsoft/fast-components';
|
|
55
56
|
import { SwatchRGB } from '@microsoft/fast-components';
|
|
56
57
|
import { TextField } from '@genesislcap/foundation-ui';
|
|
@@ -1345,10 +1346,16 @@ export class StreamDatasource extends StreamBaseDatasource implements IServerSid
|
|
|
1345
1346
|
// (undocumented)
|
|
1346
1347
|
connect: Connect;
|
|
1347
1348
|
// (undocumented)
|
|
1349
|
+
createDataserverStreamFunc: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
1350
|
+
// (undocumented)
|
|
1348
1351
|
dataLogoff(): Promise<void>;
|
|
1349
1352
|
// (undocumented)
|
|
1350
1353
|
dataserverStream: SocketObservable<FilteredDataServerResult>;
|
|
1351
1354
|
// (undocumented)
|
|
1355
|
+
dataserverStreamSubscription: SocketSubscription;
|
|
1356
|
+
// (undocumented)
|
|
1357
|
+
deinit(): Promise<void>;
|
|
1358
|
+
// (undocumented)
|
|
1352
1359
|
getRows(params: IServerSideGetRowsParams): Promise<void>;
|
|
1353
1360
|
// (undocumented)
|
|
1354
1361
|
resourceParams: any;
|
|
@@ -1360,7 +1367,7 @@ export class StreamDatasource extends StreamBaseDatasource implements IServerSid
|
|
|
1360
1367
|
|
|
1361
1368
|
// @alpha
|
|
1362
1369
|
export type StreamDatasourceOptions = {
|
|
1363
|
-
|
|
1370
|
+
createDataserverStreamFunc: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
1364
1371
|
resourceName: string;
|
|
1365
1372
|
resourceParams?: any;
|
|
1366
1373
|
resourceIndexes?: Map<string, [string]>;
|
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.183.
|
|
4
|
+
"version": "14.183.3",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -30,20 +30,20 @@
|
|
|
30
30
|
"test:debug": "genx test --debug"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@genesislcap/foundation-testing": "14.183.
|
|
34
|
-
"@genesislcap/genx": "14.183.
|
|
35
|
-
"@genesislcap/rollup-builder": "14.183.
|
|
36
|
-
"@genesislcap/ts-builder": "14.183.
|
|
37
|
-
"@genesislcap/uvu-playwright-builder": "14.183.
|
|
38
|
-
"@genesislcap/vite-builder": "14.183.
|
|
39
|
-
"@genesislcap/webpack-builder": "14.183.
|
|
33
|
+
"@genesislcap/foundation-testing": "14.183.3",
|
|
34
|
+
"@genesislcap/genx": "14.183.3",
|
|
35
|
+
"@genesislcap/rollup-builder": "14.183.3",
|
|
36
|
+
"@genesislcap/ts-builder": "14.183.3",
|
|
37
|
+
"@genesislcap/uvu-playwright-builder": "14.183.3",
|
|
38
|
+
"@genesislcap/vite-builder": "14.183.3",
|
|
39
|
+
"@genesislcap/webpack-builder": "14.183.3",
|
|
40
40
|
"rimraf": "^3.0.2"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@genesislcap/foundation-comms": "14.183.
|
|
44
|
-
"@genesislcap/foundation-logger": "14.183.
|
|
45
|
-
"@genesislcap/foundation-ui": "14.183.
|
|
46
|
-
"@genesislcap/foundation-utils": "14.183.
|
|
43
|
+
"@genesislcap/foundation-comms": "14.183.3",
|
|
44
|
+
"@genesislcap/foundation-logger": "14.183.3",
|
|
45
|
+
"@genesislcap/foundation-ui": "14.183.3",
|
|
46
|
+
"@genesislcap/foundation-utils": "14.183.3",
|
|
47
47
|
"@microsoft/fast-colors": "^5.3.1",
|
|
48
48
|
"@microsoft/fast-components": "^2.30.6",
|
|
49
49
|
"@microsoft/fast-element": "^1.12.0",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
71
|
"customElements": "dist/custom-elements.json",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "ffef17c6fd8f87716f8a5b1a86fa060016d927b4"
|
|
73
73
|
}
|