@refinitiv-ui/efx-grid 6.0.15 → 6.0.17
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/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +661 -84
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +10 -0
- package/lib/rt-grid/es6/ColumnDefinition.js +110 -1
- package/lib/rt-grid/es6/FieldDefinition.d.ts +6 -0
- package/lib/rt-grid/es6/FieldDefinition.js +43 -0
- package/lib/rt-grid/es6/Grid.js +184 -8
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +1 -0
- package/lib/rt-grid/es6/SnapshotFiller.js +125 -17
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +4 -4
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +273 -143
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +7 -1
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +167 -146
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +44 -43
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +202 -497
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +30 -29
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +176 -98
- package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +40 -40
- package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +17 -15
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +89 -159
- package/lib/types/es6/ColumnStack.d.ts +7 -1
- package/lib/types/es6/Core/data/Segment.d.ts +3 -3
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +1 -1
- package/lib/types/es6/InCellEditing.d.ts +44 -43
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +10 -0
- package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +6 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +2 -0
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +4 -0
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +1 -0
- package/lib/types/es6/RowColoring.d.ts +17 -15
- package/lib/types/es6/RowFiltering.d.ts +30 -29
- package/lib/types/es6/RowGrouping.d.ts +40 -40
- package/lib/versions.json +7 -7
- package/package.json +1 -1
@@ -2,6 +2,7 @@
|
|
2
2
|
import Grid from "./Grid.js";
|
3
3
|
import {Ext} from "../../tr-grid-util/es6/Ext.js";
|
4
4
|
import {EventDispatcher} from "../../tr-grid-util/es6/EventDispatcher.js";
|
5
|
+
import {FieldDefinition} from "./FieldDefinition.js";
|
5
6
|
|
6
7
|
/** @private
|
7
8
|
* @param {Object} obj
|
@@ -189,10 +190,19 @@ SnapshotFiller.prototype._onRequest = function () {
|
|
189
190
|
var instruments = Object.keys(this._rics);
|
190
191
|
|
191
192
|
var i;
|
192
|
-
var fields =
|
193
|
+
var fields = [];
|
194
|
+
var timeSeriesFields = [];
|
195
|
+
for (var field in this._fields) {
|
196
|
+
if(!FieldDefinition.isTimeSeriesField(field)) {
|
197
|
+
fields.push(field);
|
198
|
+
} else {
|
199
|
+
timeSeriesFields.push(field);
|
200
|
+
}
|
201
|
+
}
|
193
202
|
var fieldLen = fields.length;
|
203
|
+
var timeSeriesFieldLen = timeSeriesFields.length;
|
194
204
|
|
195
|
-
if (!fieldLen || !instruments.length) { // No ADC field or real-time RIC
|
205
|
+
if ( (!fieldLen && !timeSeriesFieldLen ) || !instruments.length) { // No ADC field or real-time RIC
|
196
206
|
return;
|
197
207
|
}
|
198
208
|
|
@@ -202,21 +212,47 @@ SnapshotFiller.prototype._onRequest = function () {
|
|
202
212
|
|
203
213
|
var onSuccess, payload;
|
204
214
|
if (this._rtk) {
|
205
|
-
var strFields
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
.
|
218
|
-
|
219
|
-
|
215
|
+
var strFields;
|
216
|
+
// Request time serie fields
|
217
|
+
if(timeSeriesFields.length > 0) {
|
218
|
+
// request time series field
|
219
|
+
var strtTimeSeriesFields = timeSeriesFields.join(',');
|
220
|
+
payload = {
|
221
|
+
"method": "select",
|
222
|
+
"formula": strtTimeSeriesFields,
|
223
|
+
"identifiers": instruments,
|
224
|
+
"productId": this._adcOptions.productId,
|
225
|
+
"output": "Col,date|,Row,In|,va,T,NoEmptyTickers" // For customize output server, for more information please visit "https://confluence.refinitiv.com/display/ADC/Data+Cloud+Output+Format"
|
226
|
+
};
|
227
|
+
onSuccess = this._onRTKTimeSeriesSuccess.bind(this, timeSeriesFields);
|
228
|
+
this._rtk.Data.Adc
|
229
|
+
.request(payload)
|
230
|
+
.then(onSuccess)
|
231
|
+
.catch(function (err) {
|
232
|
+
console.log(err);
|
233
|
+
});
|
234
|
+
}
|
235
|
+
|
236
|
+
// Request normal adc field
|
237
|
+
if(fields.length > 0) {
|
238
|
+
strFields = fields.join(',');
|
239
|
+
payload = {
|
240
|
+
"method": "select",
|
241
|
+
"formula": strFields,
|
242
|
+
"identifiers": instruments,
|
243
|
+
"productId": this._adcOptions.productId,
|
244
|
+
"output": "Col,In,va,T,NoEmptyTickers" // For customize output server, for more information please visit "https://confluence.refinitiv.com/display/ADC/Data+Cloud+Output+Format"
|
245
|
+
};
|
246
|
+
onSuccess = this._onRTKSuccess.bind(this, fields);
|
247
|
+
this._rtk.Data.Adc
|
248
|
+
.request(payload)
|
249
|
+
.then(onSuccess)
|
250
|
+
.catch(function (err) {
|
251
|
+
console.log(err);
|
252
|
+
});
|
253
|
+
}
|
254
|
+
|
255
|
+
|
220
256
|
} else {
|
221
257
|
var reqFields = [];
|
222
258
|
for(i = 0; i < fieldLen; i++) {
|
@@ -377,5 +413,77 @@ SnapshotFiller.prototype._onRTKSuccess = function (fields, serverResult) {
|
|
377
413
|
});
|
378
414
|
};
|
379
415
|
|
416
|
+
|
417
|
+
/** @private
|
418
|
+
* @function
|
419
|
+
* @param {Array.<string>} fields
|
420
|
+
* @param {string} serverResult
|
421
|
+
*/
|
422
|
+
SnapshotFiller.prototype._onRTKTimeSeriesSuccess = function (fields, serverResult) {
|
423
|
+
|
424
|
+
// TODO: noti the user for change structure
|
425
|
+
this._dispatch("adcDataReceived", serverResult);
|
426
|
+
var data2D = serverResult["rows"];
|
427
|
+
var svHeaders = serverResult["rows"] && serverResult["rows"][0];
|
428
|
+
if (!Array.isArray(data2D) || !Array.isArray(svHeaders)) {
|
429
|
+
return; // TODO: Return Promise.reject(errMsg);
|
430
|
+
}
|
431
|
+
|
432
|
+
var headerLen = svHeaders.length;
|
433
|
+
|
434
|
+
var headerDates = [];
|
435
|
+
var i, j;
|
436
|
+
|
437
|
+
for (i = 2; i < headerLen; i++) { // Start with 2 (Skip instrunment and date header)
|
438
|
+
headerDates.push(svHeaders[i].v);
|
439
|
+
}
|
440
|
+
|
441
|
+
var ric, j, field;
|
442
|
+
var len = data2D.length;
|
443
|
+
var ricMap = {};
|
444
|
+
var childrenFieldToParent = {};
|
445
|
+
|
446
|
+
var fileNameToTSField = {};
|
447
|
+
var count = 0;
|
448
|
+
for (let i = 1; i < len; i++) {
|
449
|
+
var dataRow = data2D[i];
|
450
|
+
var fieldName = dataRow[1];
|
451
|
+
if(!fileNameToTSField[fieldName]) {
|
452
|
+
fileNameToTSField[fieldName] = fields[count++];
|
453
|
+
}
|
454
|
+
}
|
455
|
+
|
456
|
+
// TODO: Freeze the data view before setting multiple data
|
457
|
+
for (i = 1; i < len; i++) { // to skip column header index, use i = 1
|
458
|
+
var dataRow = data2D[i];
|
459
|
+
ric = dataRow[0];
|
460
|
+
var fieldName = dataRow[1]; // ex. PRICECLOSE
|
461
|
+
if(!ricMap[ric]) {
|
462
|
+
ricMap[ric] = {};
|
463
|
+
}
|
464
|
+
var snapData = ricMap[ric];
|
465
|
+
for (var k = 0; k < headerDates.length; k++) {
|
466
|
+
field = fileNameToTSField[fieldName].replace("TR.", "") + "_" + headerDates[k]; // TODO: make support time series field definition cache
|
467
|
+
childrenFieldToParent[field] = fileNameToTSField[fieldName];
|
468
|
+
snapData[field] = dataRow[2 + k]; // Start with field value
|
469
|
+
}
|
470
|
+
}
|
471
|
+
|
472
|
+
// return result only ric that has update data
|
473
|
+
var dataMapping = {};
|
474
|
+
for (ric in ricMap) {
|
475
|
+
var obj = ricMap[ric];
|
476
|
+
if (!isEmptyObject(obj)) {
|
477
|
+
dataMapping[ric] = obj;
|
478
|
+
}
|
479
|
+
}
|
480
|
+
|
481
|
+
this._dispatch("dataChanged", {
|
482
|
+
data: dataMapping,
|
483
|
+
timeSeries: true,
|
484
|
+
childrenFieldToParent: childrenFieldToParent
|
485
|
+
});
|
486
|
+
};
|
487
|
+
|
380
488
|
export { SnapshotFiller };
|
381
489
|
export default SnapshotFiller;
|
@@ -24,12 +24,12 @@ declare class ColumnGroupingPlugin extends GridPlugin {
|
|
24
24
|
|
25
25
|
constructor(options?: ColumnGroupingPlugin.Options|null);
|
26
26
|
|
27
|
-
public beforeProcessOption(optionName: string, optionValue: any): any;
|
28
|
-
|
29
27
|
public getName(): string;
|
30
28
|
|
31
29
|
public initialize(host: any, options?: any): void;
|
32
30
|
|
31
|
+
public beforeProcessOption(optionName: string, optionValue: any): any;
|
32
|
+
|
33
33
|
public unload(host: any): void;
|
34
34
|
|
35
35
|
public config(options: any): void;
|
@@ -66,9 +66,9 @@ declare class ColumnGroupingPlugin extends GridPlugin {
|
|
66
66
|
|
67
67
|
public getCellInfo(e: Element|Event|MouseEvent|null): any;
|
68
68
|
|
69
|
-
public moveColumnIntoGroup(
|
69
|
+
public moveColumnIntoGroup(colRef: number|string|null, to: number, groupId: string): void;
|
70
70
|
|
71
|
-
public setColumnParent(
|
71
|
+
public setColumnParent(colRef: number|string|null, groupId: string): void;
|
72
72
|
|
73
73
|
}
|
74
74
|
|