@refinitiv-ui/efx-grid 6.0.91 → 6.0.92

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. package/lib/column-dragging/es6/ColumnDragging.d.ts +1 -1
  2. package/lib/column-dragging/es6/ColumnDragging.js +144 -34
  3. package/lib/core/dist/core.js +2410 -2621
  4. package/lib/core/dist/core.min.js +1 -1
  5. package/lib/core/es6/data/ColumnStats.js +14 -14
  6. package/lib/core/es6/data/DataCache.js +118 -118
  7. package/lib/core/es6/data/DataTable.d.ts +3 -1
  8. package/lib/core/es6/data/DataTable.js +208 -190
  9. package/lib/core/es6/data/DataView.d.ts +1 -1
  10. package/lib/core/es6/data/DataView.js +291 -291
  11. package/lib/core/es6/data/Segment.js +79 -79
  12. package/lib/core/es6/data/SegmentCollection.js +81 -81
  13. package/lib/core/es6/data/WrappedView.js +41 -41
  14. package/lib/core/es6/grid/Core.js +635 -635
  15. package/lib/core/es6/grid/ILayoutGrid.js +1 -1
  16. package/lib/core/es6/grid/LayoutGrid.js +183 -183
  17. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +91 -91
  18. package/lib/core/es6/grid/components/Cell.js +29 -29
  19. package/lib/core/es6/grid/components/CellFloatingPanel.js +11 -11
  20. package/lib/core/es6/grid/components/CellSpan.js +7 -7
  21. package/lib/core/es6/grid/components/CellSpans.js +36 -34
  22. package/lib/core/es6/grid/components/Column.js +40 -40
  23. package/lib/core/es6/grid/components/ElementWrapper.js +17 -17
  24. package/lib/core/es6/grid/components/HScrollbar.js +31 -31
  25. package/lib/core/es6/grid/components/Scrollbar.js +77 -77
  26. package/lib/core/es6/grid/components/StretchedCells.js +49 -49
  27. package/lib/core/es6/grid/components/VScrollbar.js +11 -11
  28. package/lib/core/es6/grid/components/VirtualItems.js +3 -3
  29. package/lib/core/es6/grid/event/EventDispatcher.js +9 -9
  30. package/lib/core/es6/grid/event/EventListeners.js +4 -4
  31. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +186 -186
  32. package/lib/core/es6/grid/util/Conflator.js +4 -4
  33. package/lib/core/es6/grid/util/Reverter.js +1 -1
  34. package/lib/core/es6/grid/util/SectionSettings.js +20 -20
  35. package/lib/core/es6/grid/util/SelectionList.js +23 -23
  36. package/lib/core/es6/grid/util/TrackLayout.js +74 -74
  37. package/lib/core/es6/grid/util/Virtualizer.js +15 -15
  38. package/lib/core/es6/grid/util/util.js +20 -20
  39. package/lib/core/es6/index.d.ts +0 -2
  40. package/lib/core/es6/index.js +0 -3
  41. package/lib/grid/index.js +1 -1
  42. package/lib/rt-grid/dist/rt-grid.js +193 -70
  43. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  44. package/lib/rt-grid/es6/Grid.js +46 -30
  45. package/lib/rt-grid/es6/RowDefinition.d.ts +2 -1
  46. package/lib/rt-grid/es6/RowDefinition.js +74 -16
  47. package/lib/tr-grid-cell-selection/es6/CellSelection.js +56 -1
  48. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +3 -1
  49. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +29 -1
  50. package/lib/tr-grid-util/es6/CellPainter.js +94 -93
  51. package/lib/tr-grid-util/es6/Conflator.js +4 -4
  52. package/lib/tr-grid-util/es6/CoralItems.js +6 -6
  53. package/lib/tr-grid-util/es6/DateTime.js +39 -39
  54. package/lib/tr-grid-util/es6/Deferred.js +5 -5
  55. package/lib/tr-grid-util/es6/Delay.js +1 -1
  56. package/lib/tr-grid-util/es6/Dom.js +26 -26
  57. package/lib/tr-grid-util/es6/DragUI.js +17 -17
  58. package/lib/tr-grid-util/es6/ElementObserver.js +12 -12
  59. package/lib/tr-grid-util/es6/ElementWrapper.js +2 -2
  60. package/lib/tr-grid-util/es6/ElfDate.js +4 -4
  61. package/lib/tr-grid-util/es6/ElfUtil.js +37 -37
  62. package/lib/tr-grid-util/es6/EventDispatcher.js +12 -12
  63. package/lib/tr-grid-util/es6/ExpanderIcon.js +6 -6
  64. package/lib/tr-grid-util/es6/ExpressionParser.js +43 -43
  65. package/lib/tr-grid-util/es6/Ext.js +6 -6
  66. package/lib/tr-grid-util/es6/FieldFormatter.js +17 -17
  67. package/lib/tr-grid-util/es6/FilterBuilder.js +57 -57
  68. package/lib/tr-grid-util/es6/FilterOperators.d.ts +12 -1
  69. package/lib/tr-grid-util/es6/FilterOperators.js +13 -2
  70. package/lib/tr-grid-util/es6/GridPlugin.js +86 -86
  71. package/lib/tr-grid-util/es6/GroupDefinitions.js +90 -90
  72. package/lib/tr-grid-util/es6/Icon.js +4 -4
  73. package/lib/tr-grid-util/es6/MouseDownTrait.js +6 -6
  74. package/lib/tr-grid-util/es6/MultiTableManager.js +68 -68
  75. package/lib/tr-grid-util/es6/NumberFormatter.js +22 -22
  76. package/lib/tr-grid-util/es6/PercentBar.js +17 -17
  77. package/lib/tr-grid-util/es6/Perf.js +5 -5
  78. package/lib/tr-grid-util/es6/Popup.js +42 -42
  79. package/lib/tr-grid-util/es6/RangeBar.js +5 -5
  80. package/lib/tr-grid-util/es6/RequestQueue.js +5 -5
  81. package/lib/tr-grid-util/es6/RowPainter.js +23 -23
  82. package/lib/tr-grid-util/es6/SubTable.js +94 -94
  83. package/lib/tr-grid-util/es6/Table.js +51 -51
  84. package/lib/tr-grid-util/es6/TextHighlighter.js +49 -49
  85. package/lib/tr-grid-util/es6/TickCodes.js +2 -2
  86. package/lib/tr-grid-util/es6/Timer.js +2 -2
  87. package/lib/tr-grid-util/es6/TouchProxy.js +7 -7
  88. package/lib/tr-grid-util/es6/Util.js +50 -50
  89. package/lib/tr-grid-util/es6/formula/ADCService.js +2 -2
  90. package/lib/tr-grid-util/es6/formula/ADCSubscription.js +19 -19
  91. package/lib/tr-grid-util/es6/formula/AdFinService.js +2 -2
  92. package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +19 -19
  93. package/lib/tr-grid-util/es6/formula/Engine.js +56 -56
  94. package/lib/tr-grid-util/es6/formula/Formula.js +62 -62
  95. package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +3 -3
  96. package/lib/tr-grid-util/es6/formula/Realtime.js +15 -15
  97. package/lib/tr-grid-util/es6/formula/RealtimeService.js +15 -15
  98. package/lib/tr-grid-util/es6/formula/TSIService.js +2 -2
  99. package/lib/tr-grid-util/es6/formula/TSISubscription.js +104 -104
  100. package/lib/tr-grid-util/es6/formula/VariableToken.js +20 -20
  101. package/lib/tr-grid-util/es6/formula/functions/AdFin.js +10 -10
  102. package/lib/tr-grid-util/es6/formula/functions/Excel.js +1 -1
  103. package/lib/tr-grid-util/es6/formula/functions/Info.js +2 -2
  104. package/lib/tr-grid-util/es6/formula/functions/Internal.js +5 -5
  105. package/lib/tr-grid-util/es6/formula/functions/Logic.js +5 -5
  106. package/lib/tr-grid-util/es6/formula/functions/Math.js +46 -46
  107. package/lib/tr-grid-util/es6/formula/functions/Statistics.js +27 -27
  108. package/lib/tr-grid-util/es6/formula/functions/Text.js +19 -19
  109. package/lib/tr-grid-util/es6/index.js +1 -1
  110. package/lib/tr-grid-util/es6/jet/Adc.js +36 -36
  111. package/lib/tr-grid-util/es6/jet/CollectionDict.js +11 -11
  112. package/lib/tr-grid-util/es6/jet/DataGenerator.js +95 -95
  113. package/lib/tr-grid-util/es6/jet/DataSet.js +1 -1
  114. package/lib/tr-grid-util/es6/jet/MockArchive.js +5 -5
  115. package/lib/tr-grid-util/es6/jet/MockJET.js +1 -1
  116. package/lib/tr-grid-util/es6/jet/MockQuotes.js +13 -13
  117. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +100 -100
  118. package/lib/tr-grid-util/es6/jet/MockRTK.js +4 -4
  119. package/lib/tr-grid-util/es6/jet/MockUtil.js +2 -2
  120. package/lib/tr-grid-util/es6/jet/index.js +1 -1
  121. package/lib/tr-grid-util/es6/jet/mockDataAPI.js +15 -15
  122. package/lib/tr-grid-util/es6/locale/translation-de.js +1 -1
  123. package/lib/tr-grid-util/es6/locale/translation-en.js +1 -1
  124. package/lib/tr-grid-util/es6/locale/translation-ja.js +1 -1
  125. package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +1 -1
  126. package/lib/tr-grid-util/es6/locale/translation-zh.js +1 -1
  127. package/lib/tr-grid-util/es6/locale/translation.js +1 -1
  128. package/lib/types/es6/ColumnDragging.d.ts +1 -1
  129. package/lib/types/es6/ColumnGrouping.d.ts +3 -1
  130. package/lib/types/es6/Core/data/DataTable.d.ts +4 -0
  131. package/lib/types/es6/Core/data/DataView.d.ts +2 -0
  132. package/lib/types/es6/Core/data/SegmentCollection.d.ts +2 -0
  133. package/lib/types/es6/Core/index.d.ts +0 -2
  134. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -1
  135. package/lib/versions.json +4 -4
  136. package/package.json +1 -1
  137. package/lib/core/es6/grid/util/ElementFrameWork.d.ts +0 -18
  138. package/lib/core/es6/grid/util/ElementFrameWork.js +0 -227
  139. package/lib/core/es6/grid/util/HttpRequest.d.ts +0 -53
  140. package/lib/core/es6/grid/util/HttpRequest.js +0 -371
  141. package/lib/core/es6/grid/util/PercentBar.d.ts +0 -43
  142. package/lib/core/es6/grid/util/PercentBar.js +0 -390
  143. package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +0 -41
  144. package/lib/core/es6/grid/util/PercentBarRenderer.js +0 -316
  145. package/lib/core/es6/grid/util/RangeBar.d.ts +0 -25
  146. package/lib/core/es6/grid/util/RangeBar.js +0 -255
  147. package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +0 -18
  148. package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +0 -53
  149. package/lib/types/es6/Core/grid/util/PercentBar.d.ts +0 -43
  150. package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +0 -41
  151. 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
- var dataGen = new DataGenerator();
5
+ let dataGen = new DataGenerator();
6
6
 
7
7
  /** @private
8
8
  * @namespace
9
9
  */
10
- var Adc = {};
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
- var rows = [];
25
- var i, f, len, row, j;
26
- var identifiers, formula, fields, invalidDict;
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
- var fieldCount = fields.length;
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 (var index = 0; index < fieldCount; index++) {
60
- var timeSeriesField = fields[index];
59
+ for (let index = 0; index < fieldCount; index++) {
60
+ let timeSeriesField = fields[index];
61
61
 
62
- var regex = /TR.(.*)(?=\()/;
63
- var result = timeSeriesField.match(regex);
64
- var field = result[0].replace("TR.", "");
65
- var phrase = timeSeriesField.toLowerCase();
66
- var startDateRegex = /sdate=(.*)[,]/;
67
- var endDateRegex = /edate=(.*)[)]/;
68
- var startDateMatch = phrase.match(startDateRegex);
69
- var endDateMatch = phrase.match(endDateRegex);
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
- var startDate = startDateMatch ? startDateMatch[1] : DateTime.format(new Date(), "YYYY-MM-DD");
72
- var endDate = endDateMatch[1];
71
+ let startDate = startDateMatch ? startDateMatch[1] : DateTime.format(new Date(), "YYYY-MM-DD");
72
+ let endDate = endDateMatch[1];
73
73
 
74
- var swapDateTmp;
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
- var msBetweenDate = (+new Date(endDate)) - (+new Date(startDate));
81
+ let msBetweenDate = (+new Date(endDate)) - (+new Date(startDate));
82
82
 
83
- var msInDay = 1000 * 60 * 60 * 24;
84
- var betweenDay = msBetweenDate / msInDay;
85
- // var betweenDay = Math.floor(Math.random() * 10); // For random length
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
- var date = new Date(new Date(startDate).setDate(new Date(startDate).getDate() + i));
90
- var fieldValue = {
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
- var rics = identifiers;
99
+ let rics = identifiers;
100
100
  for (i = 0; i < rics.length; i++) {
101
101
 
102
- var ric = rics[i];
103
- var rowValue = [
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
- var generatedValue = DataGenerator.generateRecord(field);
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
- var rowMap = {};
191
+ let rowMap = {};
192
192
 
193
193
  len = identifiers.length;
194
- var rowData = dataGen.generate(fields, len);
194
+ let rowData = dataGen.generate(fields, len);
195
195
  for (i = 0; i < len; ++i) {
196
- var inst = identifiers[i];
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
- var chance = dataGen.randInt(1, 10);
208
+ let chance = dataGen.randInt(1, 10);
209
209
  if (chance <= 3) { // chance 30%
210
- var pos = dataGen.randInt(0, rows.length - 1); // random row pos
210
+ let pos = dataGen.randInt(0, rows.length - 1); // random row pos
211
211
  row = rows[pos];
212
212
  len = row.length;
213
- var mockupRow = new Array(len);
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
- var fields = strFields.split(/,(?![^()]*\))/);
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
- var CollectionDict = function() {
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
- var ary = this._dict[key];
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
- var len = items ? items.length : 0;
45
+ let len = items ? items.length : 0;
46
46
  if(len) {
47
- var ary = this._dict[key];
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
- var ary = this._dict[key];
67
+ let ary = this._dict[key];
68
68
  if(ary) {
69
- var at = ary.indexOf(item);
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
- var ary = this._dict[key];
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
- var ary = [];
120
- var dict = this._dict;
121
- for(var key in dict) {
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
- var items = this._dict[key] || null;
135
+ let items = this._dict[key] || null;
136
136
  if(items) {
137
137
  return items.length;
138
138
  }