@genesislcap/grid-pro 14.170.1-alpha-2fe40dd.0 → 14.171.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.
- package/dist/custom-elements.json +1 -38
- package/dist/dts/datasource/server-side.datasource.d.ts +8 -7
- package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
- package/dist/esm/datasource/server-side.datasource.js +64 -82
- package/dist/grid-pro.d.ts +7 -7
- package/docs/api-report.md +1 -8
- package/package.json +13 -13
|
@@ -8157,20 +8157,6 @@
|
|
|
8157
8157
|
"text": "SocketObservable<FilteredDataServerResult>"
|
|
8158
8158
|
}
|
|
8159
8159
|
},
|
|
8160
|
-
{
|
|
8161
|
-
"kind": "field",
|
|
8162
|
-
"name": "dataserverStreamSubscription",
|
|
8163
|
-
"type": {
|
|
8164
|
-
"text": "SocketSubscription"
|
|
8165
|
-
}
|
|
8166
|
-
},
|
|
8167
|
-
{
|
|
8168
|
-
"kind": "field",
|
|
8169
|
-
"name": "createDataserverStreamFunc",
|
|
8170
|
-
"type": {
|
|
8171
|
-
"text": "(\n existingParams?: any,\n ) => Promise<SocketObservable<FilteredDataServerResult>>"
|
|
8172
|
-
}
|
|
8173
|
-
},
|
|
8174
8160
|
{
|
|
8175
8161
|
"kind": "field",
|
|
8176
8162
|
"name": "resourceName",
|
|
@@ -8296,25 +8282,6 @@
|
|
|
8296
8282
|
}
|
|
8297
8283
|
]
|
|
8298
8284
|
},
|
|
8299
|
-
{
|
|
8300
|
-
"kind": "method",
|
|
8301
|
-
"name": "applyServerSideData",
|
|
8302
|
-
"privacy": "private",
|
|
8303
|
-
"parameters": [
|
|
8304
|
-
{
|
|
8305
|
-
"name": "params",
|
|
8306
|
-
"type": {
|
|
8307
|
-
"text": "IServerSideGetRowsParams"
|
|
8308
|
-
}
|
|
8309
|
-
},
|
|
8310
|
-
{
|
|
8311
|
-
"name": "result",
|
|
8312
|
-
"type": {
|
|
8313
|
-
"text": "RawDataServerResult"
|
|
8314
|
-
}
|
|
8315
|
-
}
|
|
8316
|
-
]
|
|
8317
|
-
},
|
|
8318
8285
|
{
|
|
8319
8286
|
"kind": "method",
|
|
8320
8287
|
"name": "sortMapByNumericKey",
|
|
@@ -8339,11 +8306,7 @@
|
|
|
8339
8306
|
},
|
|
8340
8307
|
{
|
|
8341
8308
|
"kind": "method",
|
|
8342
|
-
"name": "
|
|
8343
|
-
},
|
|
8344
|
-
{
|
|
8345
|
-
"kind": "method",
|
|
8346
|
-
"name": "refreshDatasource",
|
|
8309
|
+
"name": "restartSubscription",
|
|
8347
8310
|
"privacy": "private",
|
|
8348
8311
|
"return": {
|
|
8349
8312
|
"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
|
|
2
|
+
import { Auth, Connect, FilteredDataServerResult, MetadataDetail, SocketObservable } 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
|
+
stream: SocketObservable<FilteredDataServerResult>;
|
|
12
12
|
resourceName: string;
|
|
13
13
|
resourceParams?: any;
|
|
14
14
|
resourceIndexes?: Map<string, [string]>;
|
|
@@ -26,8 +26,6 @@ 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>>;
|
|
31
29
|
private resourceName;
|
|
32
30
|
resourceParams: any;
|
|
33
31
|
private resourceIndexes;
|
|
@@ -54,11 +52,9 @@ export declare class StreamDatasource extends StreamBaseDatasource implements IS
|
|
|
54
52
|
private currentSortModel;
|
|
55
53
|
constructor(options: StreamDatasourceOptions);
|
|
56
54
|
getRows(params: IServerSideGetRowsParams): Promise<void>;
|
|
57
|
-
private applyServerSideData;
|
|
58
55
|
private sortMapByNumericKey;
|
|
59
56
|
dataLogoff(): Promise<void>;
|
|
60
|
-
|
|
61
|
-
private refreshDatasource;
|
|
57
|
+
private restartSubscription;
|
|
62
58
|
private getOrderByAndToBeSortedColIds;
|
|
63
59
|
private handleCurrentStreamLoad;
|
|
64
60
|
private buildCriteriaMatchFromFilters;
|
|
@@ -249,6 +245,11 @@ declare const GridProServerSideDatasource_base: (new (...args: any[]) => {
|
|
|
249
245
|
ariaReadOnly: string;
|
|
250
246
|
ariaRequired: string;
|
|
251
247
|
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
|
+
*/
|
|
252
253
|
ariaRowCount: string;
|
|
253
254
|
ariaRowIndex: string;
|
|
254
255
|
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.dataserverStream = options.stream;
|
|
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, _b;
|
|
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,29 +48,28 @@ 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.restartSubscription(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.restartSubscription(params);
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
const toBeAppliedSortModel = params.request.sortModel;
|
|
62
|
-
if (((_a = this.currentSortModel) === null || _a === void 0 ? void 0 : _a.length)
|
|
62
|
+
if (toBeAppliedSortModel.length !== ((_a = this.currentSortModel) === null || _a === void 0 ? void 0 : _a.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.restartSubscription(params);
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
else if (toBeAppliedSortModel.length > 0) {
|
|
73
|
-
this.currentSortModel = toBeAppliedSortModel;
|
|
74
73
|
const coldIdBeingSorted = toBeAppliedSortModel[0].colId; // Not allowing multiple sorts by user
|
|
75
74
|
const sortTypeBeingApplied = toBeAppliedSortModel[0].sort;
|
|
76
75
|
const orderByAndToBeSortedColIds = this.getOrderByAndToBeSortedColIds(this.resourceIndexes, coldIdBeingSorted);
|
|
@@ -81,13 +80,15 @@ export class StreamDatasource extends StreamBaseDatasource {
|
|
|
81
80
|
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/');
|
|
82
81
|
logger.debug('Available indexes:', availableIndexes);
|
|
83
82
|
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;
|
|
88
89
|
this.resourceParams.ORDER_BY = orderByAndToBeSortedColIds.orderBy;
|
|
89
90
|
this.resourceParams.REVERSE = sortTypeBeingApplied === 'desc' ? true : false;
|
|
90
|
-
yield this.
|
|
91
|
+
yield this.restartSubscription(params);
|
|
91
92
|
return;
|
|
92
93
|
}
|
|
93
94
|
}
|
|
@@ -95,62 +96,55 @@ export class StreamDatasource extends StreamBaseDatasource {
|
|
|
95
96
|
if (this.moreRows && params.request.startRow >= Number(this.maxRows)) {
|
|
96
97
|
this.connect.getMoreRows(this.streamSourceRef);
|
|
97
98
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
this.dataserverStream.pipe(take(1)).subscribe((result) => {
|
|
100
|
+
var _a;
|
|
101
|
+
const messageType = result.MESSAGE_TYPE;
|
|
102
|
+
if (messageType &&
|
|
103
|
+
(messageType === MessageType.LOGOFF_ACK || messageType === MessageType.MSG_NACK)) {
|
|
104
|
+
params.fail();
|
|
105
|
+
return;
|
|
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);
|
|
105
145
|
});
|
|
106
146
|
});
|
|
107
147
|
}
|
|
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
|
-
}
|
|
154
148
|
sortMapByNumericKey(inputMap) {
|
|
155
149
|
// Convert Map to array of key-value pairs
|
|
156
150
|
const sortedArray = Array.from(inputMap.entries()).sort(([key1], [key2]) => +key2 - +key1);
|
|
@@ -167,23 +161,16 @@ export class StreamDatasource extends StreamBaseDatasource {
|
|
|
167
161
|
this.streamSourceRef = undefined;
|
|
168
162
|
});
|
|
169
163
|
}
|
|
170
|
-
|
|
164
|
+
restartSubscription(params) {
|
|
171
165
|
var _a;
|
|
172
166
|
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
yield this.dataLogoff();
|
|
173
168
|
this.rowData = new Map();
|
|
174
169
|
this.client_ROWS_COUNT = 0;
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
const streamOnMessage = (message) => message;
|
|
171
|
+
const onError = (error) => logger.error(error);
|
|
177
172
|
this.dataserverStream = undefined;
|
|
178
|
-
|
|
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();
|
|
173
|
+
this.dataserverStream = this.connect.stream(this.resourceName, streamOnMessage, onError, this.resourceParams);
|
|
187
174
|
(_a = params.api) === null || _a === void 0 ? void 0 : _a.refreshServerSide({ purge: true });
|
|
188
175
|
params.fail();
|
|
189
176
|
});
|
|
@@ -355,7 +342,6 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
355
342
|
deinit() {
|
|
356
343
|
var _a;
|
|
357
344
|
this.clearRowData();
|
|
358
|
-
this.ssrmDatasource.deinit();
|
|
359
345
|
this.ssrmDatasource = undefined;
|
|
360
346
|
this.originalFieldDef = undefined;
|
|
361
347
|
(_a = this.agGrid.gridApi) === null || _a === void 0 ? void 0 : _a.refreshServerSide({ purge: true });
|
|
@@ -375,7 +361,7 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
375
361
|
}, cacheBlockSize: this.maxRows, defaultColDef: {
|
|
376
362
|
filter: true,
|
|
377
363
|
resizable: true,
|
|
378
|
-
|
|
364
|
+
sortable: true,
|
|
379
365
|
}, pagination: this.pagination, paginationPageSize: this.maxRows, rowBuffer: 0, rowModelType: 'serverSide', suppressServerSideInfiniteScroll: false, suppressMultiSort: true, onFilterChanged: (params) => { }, onSortChanged: (params) => { } }, this.deferredGridOptions);
|
|
380
366
|
this.agGrid.addEventListener('onGridReady', () => __awaiter(this, void 0, void 0, function* () {
|
|
381
367
|
const meta = yield this.connect
|
|
@@ -388,8 +374,9 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
388
374
|
const fieldMetadata = toFieldMetadata(this.originalFieldDef);
|
|
389
375
|
const agColumnDefs = yield this.getAgColumnDefs(fieldMetadata);
|
|
390
376
|
this.agGrid.gridApi.setColumnDefs(agColumnDefs);
|
|
377
|
+
const dataserverStream = yield this.createDataserverStream();
|
|
391
378
|
this.ssrmDatasource = new StreamDatasource({
|
|
392
|
-
|
|
379
|
+
stream: dataserverStream,
|
|
393
380
|
resourceName: this.resourceName,
|
|
394
381
|
resourceParams: this.params,
|
|
395
382
|
resourceIndexes: this.indexes,
|
|
@@ -460,9 +447,6 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
460
447
|
var _a;
|
|
461
448
|
const messageType = message.MESSAGE_TYPE;
|
|
462
449
|
if (messageType === MessageType.QUERY_UPDATE && message.ROW) {
|
|
463
|
-
if (!this.ssrmDatasource) {
|
|
464
|
-
return;
|
|
465
|
-
}
|
|
466
450
|
const nextMessage = dataServerResultFilter(message);
|
|
467
451
|
this.agTransaction = { add: [], remove: [], update: [] };
|
|
468
452
|
this.handleStreamInserts(nextMessage.inserts);
|
|
@@ -483,9 +467,7 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
|
|
|
483
467
|
}
|
|
484
468
|
});
|
|
485
469
|
const onError = (error) => logger.error(error);
|
|
486
|
-
return this.connect.stream(this.resourceName,
|
|
487
|
-
streamOnMessage(message);
|
|
488
|
-
}, onError, existingParams !== null && existingParams !== void 0 ? existingParams : this.params, false);
|
|
470
|
+
return this.connect.stream(this.resourceName, streamOnMessage, onError, existingParams !== null && existingParams !== void 0 ? existingParams : this.params);
|
|
489
471
|
});
|
|
490
472
|
}
|
|
491
473
|
handleStreamDeletesTemp(deletes) {
|
package/dist/grid-pro.d.ts
CHANGED
|
@@ -45,7 +45,6 @@ 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';
|
|
49
48
|
import { Swatch } from '@microsoft/fast-components';
|
|
50
49
|
import { SwatchRGB } from '@microsoft/fast-components';
|
|
51
50
|
import { TextField } from '@genesislcap/foundation-ui';
|
|
@@ -2852,6 +2851,11 @@ declare const GridProServerSideDatasource_base: (new (...args: any[]) => {
|
|
|
2852
2851
|
ariaReadOnly: string;
|
|
2853
2852
|
ariaRequired: string;
|
|
2854
2853
|
ariaRoleDescription: string;
|
|
2854
|
+
/**
|
|
2855
|
+
* A Genesis Datasource element, for server-side | SSRM-compatible data fetching and used exclusively by the GridPro element.
|
|
2856
|
+
* @remarks Only supports Server-Side Row Model. Requires `@ag-grid-enterprise/server-side-row-model` setup and valid AG Grid Enterprise license.
|
|
2857
|
+
* @alpha
|
|
2858
|
+
*/
|
|
2855
2859
|
ariaRowCount: string;
|
|
2856
2860
|
ariaRowIndex: string;
|
|
2857
2861
|
ariaRowIndexText: string;
|
|
@@ -3224,8 +3228,6 @@ export declare class StreamDatasource extends StreamBaseDatasource implements IS
|
|
|
3224
3228
|
auth: Auth;
|
|
3225
3229
|
connect: Connect;
|
|
3226
3230
|
dataserverStream: SocketObservable<FilteredDataServerResult>;
|
|
3227
|
-
dataserverStreamSubscription: SocketSubscription;
|
|
3228
|
-
createDataserverStreamFunc: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
3229
3231
|
private resourceName;
|
|
3230
3232
|
resourceParams: any;
|
|
3231
3233
|
private resourceIndexes;
|
|
@@ -3252,11 +3254,9 @@ export declare class StreamDatasource extends StreamBaseDatasource implements IS
|
|
|
3252
3254
|
private currentSortModel;
|
|
3253
3255
|
constructor(options: StreamDatasourceOptions);
|
|
3254
3256
|
getRows(params: IServerSideGetRowsParams): Promise<void>;
|
|
3255
|
-
private applyServerSideData;
|
|
3256
3257
|
private sortMapByNumericKey;
|
|
3257
3258
|
dataLogoff(): Promise<void>;
|
|
3258
|
-
|
|
3259
|
-
private refreshDatasource;
|
|
3259
|
+
private restartSubscription;
|
|
3260
3260
|
private getOrderByAndToBeSortedColIds;
|
|
3261
3261
|
private handleCurrentStreamLoad;
|
|
3262
3262
|
private buildCriteriaMatchFromFilters;
|
|
@@ -3271,7 +3271,7 @@ export declare class StreamDatasource extends StreamBaseDatasource implements IS
|
|
|
3271
3271
|
* @alpha
|
|
3272
3272
|
*/
|
|
3273
3273
|
export declare type StreamDatasourceOptions = {
|
|
3274
|
-
|
|
3274
|
+
stream: SocketObservable<FilteredDataServerResult>;
|
|
3275
3275
|
resourceName: string;
|
|
3276
3276
|
resourceParams?: any;
|
|
3277
3277
|
resourceIndexes?: Map<string, [string]>;
|
package/docs/api-report.md
CHANGED
|
@@ -51,7 +51,6 @@ 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';
|
|
55
54
|
import { Swatch } from '@microsoft/fast-components';
|
|
56
55
|
import { SwatchRGB } from '@microsoft/fast-components';
|
|
57
56
|
import { TextField } from '@genesislcap/foundation-ui';
|
|
@@ -1340,16 +1339,10 @@ export class StreamDatasource extends StreamBaseDatasource implements IServerSid
|
|
|
1340
1339
|
// (undocumented)
|
|
1341
1340
|
connect: Connect;
|
|
1342
1341
|
// (undocumented)
|
|
1343
|
-
createDataserverStreamFunc: (existingParams?: any) => Promise<SocketObservable<FilteredDataServerResult>>;
|
|
1344
|
-
// (undocumented)
|
|
1345
1342
|
dataLogoff(): Promise<void>;
|
|
1346
1343
|
// (undocumented)
|
|
1347
1344
|
dataserverStream: SocketObservable<FilteredDataServerResult>;
|
|
1348
1345
|
// (undocumented)
|
|
1349
|
-
dataserverStreamSubscription: SocketSubscription;
|
|
1350
|
-
// (undocumented)
|
|
1351
|
-
deinit(): Promise<void>;
|
|
1352
|
-
// (undocumented)
|
|
1353
1346
|
getRows(params: IServerSideGetRowsParams): Promise<void>;
|
|
1354
1347
|
// (undocumented)
|
|
1355
1348
|
resourceParams: any;
|
|
@@ -1361,7 +1354,7 @@ export class StreamDatasource extends StreamBaseDatasource implements IServerSid
|
|
|
1361
1354
|
|
|
1362
1355
|
// @alpha
|
|
1363
1356
|
export type StreamDatasourceOptions = {
|
|
1364
|
-
|
|
1357
|
+
stream: SocketObservable<FilteredDataServerResult>;
|
|
1365
1358
|
resourceName: string;
|
|
1366
1359
|
resourceParams?: any;
|
|
1367
1360
|
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.
|
|
4
|
+
"version": "14.171.0",
|
|
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.
|
|
34
|
-
"@genesislcap/genx": "14.
|
|
35
|
-
"@genesislcap/rollup-builder": "14.
|
|
36
|
-
"@genesislcap/ts-builder": "14.
|
|
37
|
-
"@genesislcap/uvu-playwright-builder": "14.
|
|
38
|
-
"@genesislcap/vite-builder": "14.
|
|
39
|
-
"@genesislcap/webpack-builder": "14.
|
|
33
|
+
"@genesislcap/foundation-testing": "14.171.0",
|
|
34
|
+
"@genesislcap/genx": "14.171.0",
|
|
35
|
+
"@genesislcap/rollup-builder": "14.171.0",
|
|
36
|
+
"@genesislcap/ts-builder": "14.171.0",
|
|
37
|
+
"@genesislcap/uvu-playwright-builder": "14.171.0",
|
|
38
|
+
"@genesislcap/vite-builder": "14.171.0",
|
|
39
|
+
"@genesislcap/webpack-builder": "14.171.0",
|
|
40
40
|
"rimraf": "^3.0.2"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@genesislcap/foundation-comms": "14.
|
|
44
|
-
"@genesislcap/foundation-logger": "14.
|
|
45
|
-
"@genesislcap/foundation-ui": "14.
|
|
46
|
-
"@genesislcap/foundation-utils": "14.
|
|
43
|
+
"@genesislcap/foundation-comms": "14.171.0",
|
|
44
|
+
"@genesislcap/foundation-logger": "14.171.0",
|
|
45
|
+
"@genesislcap/foundation-ui": "14.171.0",
|
|
46
|
+
"@genesislcap/foundation-utils": "14.171.0",
|
|
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": "312d2536cdfdd0c1b2c00dd623cc863edac31d7a"
|
|
73
73
|
}
|