@refinitiv-ui/efx-grid 6.0.91 → 6.0.93
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/column-dragging/es6/ColumnDragging.d.ts +1 -1
- package/lib/column-dragging/es6/ColumnDragging.js +144 -34
- package/lib/core/dist/core.js +2410 -2621
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/ColumnStats.js +14 -14
- package/lib/core/es6/data/DataCache.js +118 -118
- package/lib/core/es6/data/DataTable.d.ts +3 -1
- package/lib/core/es6/data/DataTable.js +208 -190
- package/lib/core/es6/data/DataView.d.ts +1 -1
- package/lib/core/es6/data/DataView.js +291 -291
- package/lib/core/es6/data/Segment.js +79 -79
- package/lib/core/es6/data/SegmentCollection.js +81 -81
- package/lib/core/es6/data/WrappedView.js +41 -41
- package/lib/core/es6/grid/Core.js +635 -635
- package/lib/core/es6/grid/ILayoutGrid.js +1 -1
- package/lib/core/es6/grid/LayoutGrid.js +183 -183
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +91 -91
- package/lib/core/es6/grid/components/Cell.js +29 -29
- package/lib/core/es6/grid/components/CellFloatingPanel.js +11 -11
- package/lib/core/es6/grid/components/CellSpan.js +7 -7
- package/lib/core/es6/grid/components/CellSpans.js +36 -34
- package/lib/core/es6/grid/components/Column.js +40 -40
- package/lib/core/es6/grid/components/ElementWrapper.js +17 -17
- package/lib/core/es6/grid/components/HScrollbar.js +31 -31
- package/lib/core/es6/grid/components/Scrollbar.js +77 -77
- package/lib/core/es6/grid/components/StretchedCells.js +49 -49
- package/lib/core/es6/grid/components/VScrollbar.js +11 -11
- package/lib/core/es6/grid/components/VirtualItems.js +3 -3
- package/lib/core/es6/grid/event/EventDispatcher.js +9 -9
- package/lib/core/es6/grid/event/EventListeners.js +4 -4
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +186 -186
- package/lib/core/es6/grid/util/Conflator.js +4 -4
- package/lib/core/es6/grid/util/Reverter.js +1 -1
- package/lib/core/es6/grid/util/SectionSettings.js +20 -20
- package/lib/core/es6/grid/util/SelectionList.js +23 -23
- package/lib/core/es6/grid/util/TrackLayout.js +74 -74
- package/lib/core/es6/grid/util/Virtualizer.js +15 -15
- package/lib/core/es6/grid/util/util.js +20 -20
- package/lib/core/es6/index.d.ts +0 -2
- package/lib/core/es6/index.js +0 -3
- package/lib/filter-dialog/lib/filter-dialog.js +1 -0
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +193 -70
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.js +46 -30
- package/lib/rt-grid/es6/RowDefinition.d.ts +2 -1
- package/lib/rt-grid/es6/RowDefinition.js +74 -16
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +56 -1
- package/lib/tr-grid-checkbox/es6/Checkbox.js +268 -268
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +3 -2
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +60 -32
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +279 -279
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +227 -207
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +11 -11
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +1 -2
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +120 -121
- package/lib/tr-grid-util/es6/CellPainter.js +94 -104
- package/lib/tr-grid-util/es6/Conflator.js +4 -4
- package/lib/tr-grid-util/es6/CoralItems.js +6 -6
- package/lib/tr-grid-util/es6/DateTime.js +41 -41
- package/lib/tr-grid-util/es6/Deferred.js +5 -5
- package/lib/tr-grid-util/es6/Delay.d.ts +3 -3
- package/lib/tr-grid-util/es6/Delay.js +14 -3
- package/lib/tr-grid-util/es6/Dom.js +26 -26
- package/lib/tr-grid-util/es6/DragUI.js +17 -17
- package/lib/tr-grid-util/es6/ElementObserver.js +12 -12
- package/lib/tr-grid-util/es6/ElementWrapper.js +2 -2
- package/lib/tr-grid-util/es6/ElfDate.js +4 -4
- package/lib/tr-grid-util/es6/ElfUtil.js +37 -37
- package/lib/tr-grid-util/es6/EventDispatcher.js +12 -12
- package/lib/tr-grid-util/es6/ExpanderIcon.js +6 -6
- package/lib/tr-grid-util/es6/ExpressionParser.js +43 -43
- package/lib/tr-grid-util/es6/Ext.js +6 -6
- package/lib/tr-grid-util/es6/FieldFormatter.js +17 -17
- package/lib/tr-grid-util/es6/FilterBuilder.js +57 -58
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +12 -1
- package/lib/tr-grid-util/es6/FilterOperators.js +13 -2
- package/lib/tr-grid-util/es6/GridPlugin.js +86 -87
- package/lib/tr-grid-util/es6/GroupDefinitions.js +90 -90
- package/lib/tr-grid-util/es6/Icon.js +4 -4
- package/lib/tr-grid-util/es6/MouseDownTrait.js +6 -6
- package/lib/tr-grid-util/es6/MultiTableManager.js +71 -80
- package/lib/tr-grid-util/es6/NumberFormatter.js +23 -23
- package/lib/tr-grid-util/es6/PercentBar.js +17 -17
- package/lib/tr-grid-util/es6/Perf.js +5 -5
- package/lib/tr-grid-util/es6/Popup.js +42 -42
- package/lib/tr-grid-util/es6/RangeBar.js +5 -5
- package/lib/tr-grid-util/es6/RequestQueue.js +5 -5
- package/lib/tr-grid-util/es6/RowPainter.js +23 -23
- package/lib/tr-grid-util/es6/SubTable.js +94 -94
- package/lib/tr-grid-util/es6/Table.js +51 -51
- package/lib/tr-grid-util/es6/TextHighlighter.js +52 -52
- package/lib/tr-grid-util/es6/TickCodes.js +2 -2
- package/lib/tr-grid-util/es6/Timer.js +2 -2
- package/lib/tr-grid-util/es6/TouchProxy.js +7 -7
- package/lib/tr-grid-util/es6/Util.js +50 -50
- package/lib/tr-grid-util/es6/formula/ADCService.js +2 -2
- package/lib/tr-grid-util/es6/formula/ADCSubscription.js +19 -19
- package/lib/tr-grid-util/es6/formula/AdFinService.js +2 -2
- package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +19 -19
- package/lib/tr-grid-util/es6/formula/Engine.js +56 -56
- package/lib/tr-grid-util/es6/formula/Formula.js +62 -62
- package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +3 -3
- package/lib/tr-grid-util/es6/formula/Realtime.js +15 -15
- package/lib/tr-grid-util/es6/formula/RealtimeService.js +15 -15
- package/lib/tr-grid-util/es6/formula/TSIService.js +2 -2
- package/lib/tr-grid-util/es6/formula/TSISubscription.js +104 -104
- package/lib/tr-grid-util/es6/formula/VariableToken.js +20 -20
- package/lib/tr-grid-util/es6/formula/functions/AdFin.js +10 -10
- package/lib/tr-grid-util/es6/formula/functions/Excel.js +1 -1
- package/lib/tr-grid-util/es6/formula/functions/Info.js +2 -2
- package/lib/tr-grid-util/es6/formula/functions/Internal.js +5 -5
- package/lib/tr-grid-util/es6/formula/functions/Logic.js +5 -5
- package/lib/tr-grid-util/es6/formula/functions/Math.js +46 -46
- package/lib/tr-grid-util/es6/formula/functions/Statistics.js +27 -27
- package/lib/tr-grid-util/es6/formula/functions/Text.js +19 -19
- package/lib/tr-grid-util/es6/index.js +1 -1
- package/lib/tr-grid-util/es6/jet/Adc.js +36 -36
- package/lib/tr-grid-util/es6/jet/CollectionDict.js +11 -11
- package/lib/tr-grid-util/es6/jet/DataGenerator.js +95 -95
- package/lib/tr-grid-util/es6/jet/DataSet.js +1 -1
- package/lib/tr-grid-util/es6/jet/MockArchive.js +5 -5
- package/lib/tr-grid-util/es6/jet/MockJET.js +1 -1
- package/lib/tr-grid-util/es6/jet/MockQuotes.js +13 -13
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +100 -100
- package/lib/tr-grid-util/es6/jet/MockRTK.js +4 -4
- package/lib/tr-grid-util/es6/jet/MockUtil.js +2 -2
- package/lib/tr-grid-util/es6/jet/index.js +1 -1
- package/lib/tr-grid-util/es6/jet/mockDataAPI.js +15 -15
- package/lib/tr-grid-util/es6/locale/translation-de.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-en.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-ja.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-zh.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation.js +1 -1
- package/lib/types/es6/ColumnDragging.d.ts +1 -1
- package/lib/types/es6/ColumnGrouping.d.ts +3 -1
- package/lib/types/es6/Core/data/DataTable.d.ts +4 -0
- package/lib/types/es6/Core/data/DataView.d.ts +2 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +2 -0
- package/lib/types/es6/Core/index.d.ts +0 -2
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -1
- package/lib/types/es6/RowDragging.d.ts +1 -2
- package/lib/versions.json +12 -12
- package/package.json +1 -1
- package/lib/core/es6/grid/util/ElementFrameWork.d.ts +0 -18
- package/lib/core/es6/grid/util/ElementFrameWork.js +0 -227
- package/lib/core/es6/grid/util/HttpRequest.d.ts +0 -53
- package/lib/core/es6/grid/util/HttpRequest.js +0 -371
- package/lib/core/es6/grid/util/PercentBar.d.ts +0 -43
- package/lib/core/es6/grid/util/PercentBar.js +0 -390
- package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +0 -41
- package/lib/core/es6/grid/util/PercentBarRenderer.js +0 -316
- package/lib/core/es6/grid/util/RangeBar.d.ts +0 -25
- package/lib/core/es6/grid/util/RangeBar.js +0 -255
- package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +0 -18
- package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +0 -53
- package/lib/types/es6/Core/grid/util/PercentBar.d.ts +0 -43
- package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +0 -41
- package/lib/types/es6/Core/grid/util/RangeBar.d.ts +0 -25
|
@@ -2,12 +2,12 @@ import { DataGenerator } from "./DataGenerator.js";
|
|
|
2
2
|
import { invalidFieldDict } from "./MockUtil.js";
|
|
3
3
|
import { DateTime } from "../DateTime.js";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
let dataGen = new DataGenerator();
|
|
6
6
|
|
|
7
7
|
/** @private
|
|
8
8
|
* @namespace
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
let Adc = {};
|
|
11
11
|
|
|
12
12
|
/** @private
|
|
13
13
|
* @function
|
|
@@ -21,9 +21,9 @@ Adc.request = function (payload, mockResponse) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// build row header
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
let rows = [];
|
|
25
|
+
let i, f, len, row, j;
|
|
26
|
+
let identifiers, formula, fields, invalidDict;
|
|
27
27
|
if(payload.output === "Col,date|,Row,In|,va,T,NoEmptyTickers") {
|
|
28
28
|
|
|
29
29
|
identifiers = payload.identifiers;
|
|
@@ -40,7 +40,7 @@ Adc.request = function (payload, mockResponse) {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
let fieldCount = fields.length;
|
|
44
44
|
// formula = payload.formula.trim().split(",TR"); // TODO: split wit
|
|
45
45
|
|
|
46
46
|
rows.push([
|
|
@@ -56,38 +56,38 @@ Adc.request = function (payload, mockResponse) {
|
|
|
56
56
|
}
|
|
57
57
|
]);
|
|
58
58
|
|
|
59
|
-
for (
|
|
60
|
-
|
|
59
|
+
for (let index = 0; index < fieldCount; index++) {
|
|
60
|
+
let timeSeriesField = fields[index];
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
let regex = /TR.(.*)(?=\()/;
|
|
63
|
+
let result = timeSeriesField.match(regex);
|
|
64
|
+
let field = result[0].replace("TR.", "");
|
|
65
|
+
let phrase = timeSeriesField.toLowerCase();
|
|
66
|
+
let startDateRegex = /sdate=(.*)[,]/;
|
|
67
|
+
let endDateRegex = /edate=(.*)[)]/;
|
|
68
|
+
let startDateMatch = phrase.match(startDateRegex);
|
|
69
|
+
let endDateMatch = phrase.match(endDateRegex);
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
let startDate = startDateMatch ? startDateMatch[1] : DateTime.format(new Date(), "YYYY-MM-DD");
|
|
72
|
+
let endDate = endDateMatch[1];
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
let swapDateTmp;
|
|
75
75
|
if(startDate > endDate) {
|
|
76
76
|
swapDateTmp = startDate;
|
|
77
77
|
startDate = endDate;
|
|
78
78
|
endDate = swapDateTmp;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
let msBetweenDate = (+new Date(endDate)) - (+new Date(startDate));
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
//
|
|
83
|
+
let msInDay = 1000 * 60 * 60 * 24;
|
|
84
|
+
let betweenDay = msBetweenDate / msInDay;
|
|
85
|
+
// let betweenDay = Math.floor(Math.random() * 10); // For random length
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
for (i = 0; i <= betweenDay; i++) {
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
let date = new Date(new Date(startDate).setDate(new Date(startDate).getDate() + i));
|
|
90
|
+
let fieldValue = {
|
|
91
91
|
"h": true,
|
|
92
92
|
"v": DateTime.format(date, "YYYY-MM-DDT00:00:00")
|
|
93
93
|
};
|
|
@@ -96,16 +96,16 @@ Adc.request = function (payload, mockResponse) {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
let rics = identifiers;
|
|
100
100
|
for (i = 0; i < rics.length; i++) {
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
let ric = rics[i];
|
|
103
|
+
let rowValue = [
|
|
104
104
|
ric,
|
|
105
105
|
field
|
|
106
106
|
];
|
|
107
107
|
for (j = 1; j <= betweenDay + 1; j++) {
|
|
108
|
-
|
|
108
|
+
let generatedValue = DataGenerator.generateRecord(field);
|
|
109
109
|
rowValue.push(generatedValue[field]);
|
|
110
110
|
|
|
111
111
|
}
|
|
@@ -188,12 +188,12 @@ Adc.request = function (payload, mockResponse) {
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
// build data
|
|
191
|
-
|
|
191
|
+
let rowMap = {};
|
|
192
192
|
|
|
193
193
|
len = identifiers.length;
|
|
194
|
-
|
|
194
|
+
let rowData = dataGen.generate(fields, len);
|
|
195
195
|
for (i = 0; i < len; ++i) {
|
|
196
|
-
|
|
196
|
+
let inst = identifiers[i];
|
|
197
197
|
row = rowMap[inst];
|
|
198
198
|
if (!row) {
|
|
199
199
|
row = rowMap[inst] = rowData[i];
|
|
@@ -205,12 +205,12 @@ Adc.request = function (payload, mockResponse) {
|
|
|
205
205
|
// There is a chance that rtk will return multiple row data per instrument
|
|
206
206
|
// so we must create mock up for this case
|
|
207
207
|
if (rows.length > 0) {
|
|
208
|
-
|
|
208
|
+
let chance = dataGen.randInt(1, 10);
|
|
209
209
|
if (chance <= 3) { // chance 30%
|
|
210
|
-
|
|
210
|
+
let pos = dataGen.randInt(0, rows.length - 1); // random row pos
|
|
211
211
|
row = rows[pos];
|
|
212
212
|
len = row.length;
|
|
213
|
-
|
|
213
|
+
let mockupRow = new Array(len);
|
|
214
214
|
mockupRow[0] = row[0]; // 1st index is for instrument
|
|
215
215
|
for (i = 1; i < len; i++) {
|
|
216
216
|
mockupRow[i] = ''; // real case will return null or empty string
|
|
@@ -257,7 +257,7 @@ Adc.splitFields = function(strFields) {
|
|
|
257
257
|
\) - a closing parenthesis
|
|
258
258
|
) - ending delimiter of the regular expression
|
|
259
259
|
*/
|
|
260
|
-
|
|
260
|
+
let fields = strFields.split(/,(?![^()]*\))/);
|
|
261
261
|
fields = fields.map(function(field) {
|
|
262
262
|
return field.trim();
|
|
263
263
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @description CollectionDict stores a collection (Array) of any value using a text (string) as a key for accessing the collection.
|
|
2
2
|
* @constructor
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
let CollectionDict = function() {
|
|
5
5
|
this._dict = {};
|
|
6
6
|
};
|
|
7
7
|
/** @type {!Object.<string, Array>}
|
|
@@ -20,7 +20,7 @@ CollectionDict.prototype._count = 0;
|
|
|
20
20
|
*/
|
|
21
21
|
CollectionDict.prototype.addItem = function(key, item) {
|
|
22
22
|
if(key && item != null) {
|
|
23
|
-
|
|
23
|
+
let ary = this._dict[key];
|
|
24
24
|
if(ary) {
|
|
25
25
|
ary.push(item);
|
|
26
26
|
} else {
|
|
@@ -42,9 +42,9 @@ CollectionDict.prototype.addItems = function(key, items) {
|
|
|
42
42
|
if(!Array.isArray(items)) {
|
|
43
43
|
return this.addItem(key, items);
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
let len = items ? items.length : 0;
|
|
46
46
|
if(len) {
|
|
47
|
-
|
|
47
|
+
let ary = this._dict[key];
|
|
48
48
|
if(!ary) {
|
|
49
49
|
ary = this._dict[key] = [];
|
|
50
50
|
}
|
|
@@ -64,9 +64,9 @@ CollectionDict.prototype.addItems = function(key, items) {
|
|
|
64
64
|
* @return {boolean} Return true if the item has been removed
|
|
65
65
|
*/
|
|
66
66
|
CollectionDict.prototype.removeItem = function(key, item) {
|
|
67
|
-
|
|
67
|
+
let ary = this._dict[key];
|
|
68
68
|
if(ary) {
|
|
69
|
-
|
|
69
|
+
let at = ary.indexOf(item);
|
|
70
70
|
if(at >= 0) {
|
|
71
71
|
if(ary.length > 1) {
|
|
72
72
|
ary.splice(at, 1);
|
|
@@ -84,7 +84,7 @@ CollectionDict.prototype.removeItem = function(key, item) {
|
|
|
84
84
|
* @return {boolean} Return true if any item has been removed
|
|
85
85
|
*/
|
|
86
86
|
CollectionDict.prototype.removeItemsByKey = function(key) {
|
|
87
|
-
|
|
87
|
+
let ary = this._dict[key];
|
|
88
88
|
if(ary) {
|
|
89
89
|
delete this._dict[key];
|
|
90
90
|
this._count -= ary.length;
|
|
@@ -116,9 +116,9 @@ CollectionDict.prototype.getItems = function(key) {
|
|
|
116
116
|
*/
|
|
117
117
|
CollectionDict.prototype.getAllItems = function() {
|
|
118
118
|
if(this._count > 0) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
for(
|
|
119
|
+
let ary = [];
|
|
120
|
+
let dict = this._dict;
|
|
121
|
+
for(let key in dict) {
|
|
122
122
|
// Fastest way to add multiple items at once to an array. WARNING: There is a 10,000 item limit.
|
|
123
123
|
Array.prototype.push.apply(ary, dict[key]);
|
|
124
124
|
}
|
|
@@ -132,7 +132,7 @@ CollectionDict.prototype.getAllItems = function() {
|
|
|
132
132
|
*/
|
|
133
133
|
CollectionDict.prototype.getItemCount = function(key) {
|
|
134
134
|
if(key) {
|
|
135
|
-
|
|
135
|
+
let items = this._dict[key] || null;
|
|
136
136
|
if(items) {
|
|
137
137
|
return items.length;
|
|
138
138
|
}
|