@refinitiv-ui/efx-grid 6.0.91 → 6.0.93

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) 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/filter-dialog/lib/filter-dialog.js +1 -0
  42. package/lib/grid/index.js +1 -1
  43. package/lib/rt-grid/dist/rt-grid.js +193 -70
  44. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  45. package/lib/rt-grid/es6/Grid.js +46 -30
  46. package/lib/rt-grid/es6/RowDefinition.d.ts +2 -1
  47. package/lib/rt-grid/es6/RowDefinition.js +74 -16
  48. package/lib/tr-grid-cell-selection/es6/CellSelection.js +56 -1
  49. package/lib/tr-grid-checkbox/es6/Checkbox.js +268 -268
  50. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +3 -2
  51. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +60 -32
  52. package/lib/tr-grid-column-stack/es6/ColumnStack.js +279 -279
  53. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +227 -207
  54. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +11 -11
  55. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +1 -2
  56. package/lib/tr-grid-row-dragging/es6/RowDragging.js +120 -121
  57. package/lib/tr-grid-util/es6/CellPainter.js +94 -104
  58. package/lib/tr-grid-util/es6/Conflator.js +4 -4
  59. package/lib/tr-grid-util/es6/CoralItems.js +6 -6
  60. package/lib/tr-grid-util/es6/DateTime.js +41 -41
  61. package/lib/tr-grid-util/es6/Deferred.js +5 -5
  62. package/lib/tr-grid-util/es6/Delay.d.ts +3 -3
  63. package/lib/tr-grid-util/es6/Delay.js +14 -3
  64. package/lib/tr-grid-util/es6/Dom.js +26 -26
  65. package/lib/tr-grid-util/es6/DragUI.js +17 -17
  66. package/lib/tr-grid-util/es6/ElementObserver.js +12 -12
  67. package/lib/tr-grid-util/es6/ElementWrapper.js +2 -2
  68. package/lib/tr-grid-util/es6/ElfDate.js +4 -4
  69. package/lib/tr-grid-util/es6/ElfUtil.js +37 -37
  70. package/lib/tr-grid-util/es6/EventDispatcher.js +12 -12
  71. package/lib/tr-grid-util/es6/ExpanderIcon.js +6 -6
  72. package/lib/tr-grid-util/es6/ExpressionParser.js +43 -43
  73. package/lib/tr-grid-util/es6/Ext.js +6 -6
  74. package/lib/tr-grid-util/es6/FieldFormatter.js +17 -17
  75. package/lib/tr-grid-util/es6/FilterBuilder.js +57 -58
  76. package/lib/tr-grid-util/es6/FilterOperators.d.ts +12 -1
  77. package/lib/tr-grid-util/es6/FilterOperators.js +13 -2
  78. package/lib/tr-grid-util/es6/GridPlugin.js +86 -87
  79. package/lib/tr-grid-util/es6/GroupDefinitions.js +90 -90
  80. package/lib/tr-grid-util/es6/Icon.js +4 -4
  81. package/lib/tr-grid-util/es6/MouseDownTrait.js +6 -6
  82. package/lib/tr-grid-util/es6/MultiTableManager.js +71 -80
  83. package/lib/tr-grid-util/es6/NumberFormatter.js +23 -23
  84. package/lib/tr-grid-util/es6/PercentBar.js +17 -17
  85. package/lib/tr-grid-util/es6/Perf.js +5 -5
  86. package/lib/tr-grid-util/es6/Popup.js +42 -42
  87. package/lib/tr-grid-util/es6/RangeBar.js +5 -5
  88. package/lib/tr-grid-util/es6/RequestQueue.js +5 -5
  89. package/lib/tr-grid-util/es6/RowPainter.js +23 -23
  90. package/lib/tr-grid-util/es6/SubTable.js +94 -94
  91. package/lib/tr-grid-util/es6/Table.js +51 -51
  92. package/lib/tr-grid-util/es6/TextHighlighter.js +52 -52
  93. package/lib/tr-grid-util/es6/TickCodes.js +2 -2
  94. package/lib/tr-grid-util/es6/Timer.js +2 -2
  95. package/lib/tr-grid-util/es6/TouchProxy.js +7 -7
  96. package/lib/tr-grid-util/es6/Util.js +50 -50
  97. package/lib/tr-grid-util/es6/formula/ADCService.js +2 -2
  98. package/lib/tr-grid-util/es6/formula/ADCSubscription.js +19 -19
  99. package/lib/tr-grid-util/es6/formula/AdFinService.js +2 -2
  100. package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +19 -19
  101. package/lib/tr-grid-util/es6/formula/Engine.js +56 -56
  102. package/lib/tr-grid-util/es6/formula/Formula.js +62 -62
  103. package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +3 -3
  104. package/lib/tr-grid-util/es6/formula/Realtime.js +15 -15
  105. package/lib/tr-grid-util/es6/formula/RealtimeService.js +15 -15
  106. package/lib/tr-grid-util/es6/formula/TSIService.js +2 -2
  107. package/lib/tr-grid-util/es6/formula/TSISubscription.js +104 -104
  108. package/lib/tr-grid-util/es6/formula/VariableToken.js +20 -20
  109. package/lib/tr-grid-util/es6/formula/functions/AdFin.js +10 -10
  110. package/lib/tr-grid-util/es6/formula/functions/Excel.js +1 -1
  111. package/lib/tr-grid-util/es6/formula/functions/Info.js +2 -2
  112. package/lib/tr-grid-util/es6/formula/functions/Internal.js +5 -5
  113. package/lib/tr-grid-util/es6/formula/functions/Logic.js +5 -5
  114. package/lib/tr-grid-util/es6/formula/functions/Math.js +46 -46
  115. package/lib/tr-grid-util/es6/formula/functions/Statistics.js +27 -27
  116. package/lib/tr-grid-util/es6/formula/functions/Text.js +19 -19
  117. package/lib/tr-grid-util/es6/index.js +1 -1
  118. package/lib/tr-grid-util/es6/jet/Adc.js +36 -36
  119. package/lib/tr-grid-util/es6/jet/CollectionDict.js +11 -11
  120. package/lib/tr-grid-util/es6/jet/DataGenerator.js +95 -95
  121. package/lib/tr-grid-util/es6/jet/DataSet.js +1 -1
  122. package/lib/tr-grid-util/es6/jet/MockArchive.js +5 -5
  123. package/lib/tr-grid-util/es6/jet/MockJET.js +1 -1
  124. package/lib/tr-grid-util/es6/jet/MockQuotes.js +13 -13
  125. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +100 -100
  126. package/lib/tr-grid-util/es6/jet/MockRTK.js +4 -4
  127. package/lib/tr-grid-util/es6/jet/MockUtil.js +2 -2
  128. package/lib/tr-grid-util/es6/jet/index.js +1 -1
  129. package/lib/tr-grid-util/es6/jet/mockDataAPI.js +15 -15
  130. package/lib/tr-grid-util/es6/locale/translation-de.js +1 -1
  131. package/lib/tr-grid-util/es6/locale/translation-en.js +1 -1
  132. package/lib/tr-grid-util/es6/locale/translation-ja.js +1 -1
  133. package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +1 -1
  134. package/lib/tr-grid-util/es6/locale/translation-zh.js +1 -1
  135. package/lib/tr-grid-util/es6/locale/translation.js +1 -1
  136. package/lib/types/es6/ColumnDragging.d.ts +1 -1
  137. package/lib/types/es6/ColumnGrouping.d.ts +3 -1
  138. package/lib/types/es6/Core/data/DataTable.d.ts +4 -0
  139. package/lib/types/es6/Core/data/DataView.d.ts +2 -0
  140. package/lib/types/es6/Core/data/SegmentCollection.d.ts +2 -0
  141. package/lib/types/es6/Core/index.d.ts +0 -2
  142. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -1
  143. package/lib/types/es6/RowDragging.d.ts +1 -2
  144. package/lib/versions.json +12 -12
  145. package/package.json +1 -1
  146. package/lib/core/es6/grid/util/ElementFrameWork.d.ts +0 -18
  147. package/lib/core/es6/grid/util/ElementFrameWork.js +0 -227
  148. package/lib/core/es6/grid/util/HttpRequest.d.ts +0 -53
  149. package/lib/core/es6/grid/util/HttpRequest.js +0 -371
  150. package/lib/core/es6/grid/util/PercentBar.d.ts +0 -43
  151. package/lib/core/es6/grid/util/PercentBar.js +0 -390
  152. package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +0 -41
  153. package/lib/core/es6/grid/util/PercentBarRenderer.js +0 -316
  154. package/lib/core/es6/grid/util/RangeBar.d.ts +0 -25
  155. package/lib/core/es6/grid/util/RangeBar.js +0 -255
  156. package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +0 -18
  157. package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +0 -53
  158. package/lib/types/es6/Core/grid/util/PercentBar.d.ts +0 -43
  159. package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +0 -41
  160. package/lib/types/es6/Core/grid/util/RangeBar.d.ts +0 -25
@@ -6,7 +6,7 @@ import {CollectionDict} from "./CollectionDict.js";
6
6
  * @param {Object} subB
7
7
  * @return {string}
8
8
  */
9
- var _joinSubKeys = function(subA, subB) {
9
+ let _joinSubKeys = function(subA, subB) {
10
10
  return subA.ric + "_" + subB.ric;
11
11
  };
12
12
 
@@ -14,9 +14,9 @@ var _joinSubKeys = function(subA, subB) {
14
14
  * @param {string} ric
15
15
  * @return {boolean}
16
16
  */
17
- var _isDynamicChain = function(ric) {
17
+ let _isDynamicChain = function(ric) {
18
18
  // Dynamic chain will be 2 . (dot) for example .PG.PA
19
- var matching = ric.match(/\./g); // Can be null when doesn't found dot(.)
19
+ let matching = ric.match(/\./g); // Can be null when doesn't found dot(.)
20
20
  if(matching) {
21
21
  return matching.length > 1;
22
22
  }
@@ -27,9 +27,9 @@ var _isDynamicChain = function(ric) {
27
27
  * @param {Array<Object>} arr sub children
28
28
  * @return {Array<Object>}
29
29
  */
30
- var _shuffleArray = function(arr) {
31
- var arrayShuffled = arr; // Modify original array
32
- var i, randNumber, tmp;
30
+ let _shuffleArray = function(arr) {
31
+ let arrayShuffled = arr; // Modify original array
32
+ let i, randNumber, tmp;
33
33
  // Shuffle the array randomly using the Fisher-Yates algorithm
34
34
  for (i = arrayShuffled.length - 1; i > 0; i--) {
35
35
  randNumber = Math.floor(Math.random() * (i + 1)); // TODO: it can be use this._dataGen.randInt(min, max) range
@@ -46,16 +46,16 @@ var _shuffleArray = function(arr) {
46
46
  return arrayShuffled;
47
47
  };
48
48
 
49
- var _assignChildOrder = function(obj, index) {
49
+ let _assignChildOrder = function(obj, index) {
50
50
  obj["CHILD_ORDER"] = index;
51
51
  };
52
52
 
53
- var _childOrderSort = function(a, b) {
53
+ let _childOrderSort = function(a, b) {
54
54
  return a["CHILD_ORDER"] - b["CHILD_ORDER"];
55
55
  };
56
56
 
57
57
  /** @constructor */
58
- var MockQuotes2 = function() {
58
+ let MockQuotes2 = function() {
59
59
 
60
60
  };
61
61
  /** @private
@@ -127,7 +127,7 @@ MockQuotes2.prototype.setPercentageDataUpdate = function(percent) {
127
127
  /** @constructor
128
128
  * @param {Object=} options
129
129
  */
130
- var MockSubscriptions = function(options) {
130
+ let MockSubscriptions = function(options) {
131
131
  this._onSubscriptionResponse = this._onSubscriptionResponse.bind(this);
132
132
 
133
133
  this._subMap = {};
@@ -159,7 +159,7 @@ MockSubscriptions.prototype.config = function(options) {
159
159
  if(!options) {
160
160
  return;
161
161
  }
162
- var num = options.minInterval;
162
+ let num = options.minInterval;
163
163
  if(typeof num === "number") {
164
164
  this._minInterval = num;
165
165
  if(this._minInterval > this._maxInterval) {
@@ -235,8 +235,8 @@ MockSubscriptions.prototype.addFields = function(fields) {
235
235
  if(typeof fields === "string") {
236
236
  fields = [fields];
237
237
  }
238
- var len = fields.length;
239
- for(var i = 0; i < len; ++i) {
238
+ let len = fields.length;
239
+ for(let i = 0; i < len; ++i) {
240
240
  this._fields[fields[i]] = true;
241
241
  }
242
242
  };
@@ -245,7 +245,7 @@ MockSubscriptions.prototype.addFields = function(fields) {
245
245
  * @param {string} subId
246
246
  */
247
247
  MockSubscriptions.prototype.removeSubscription = function(subId) {
248
- var sub = this._subMap[subId];
248
+ let sub = this._subMap[subId];
249
249
  if(!sub) {
250
250
  return;
251
251
  }
@@ -253,10 +253,10 @@ MockSubscriptions.prototype.removeSubscription = function(subId) {
253
253
  delete this._subMap[subId];
254
254
  this._dataMap.removeItem(sub["ric"], sub);
255
255
  if(sub["chain"]) {
256
- var children = sub["children"];
257
- var len = children.length;
258
- for(var i = 0; i < len; ++i) {
259
- var child = children[i];
256
+ let children = sub["children"];
257
+ let len = children.length;
258
+ for(let i = 0; i < len; ++i) {
259
+ let child = children[i];
260
260
  this._dataMap.removeItem(_joinSubKeys(sub, child), child);
261
261
  child["parent"] = null;
262
262
  }
@@ -274,12 +274,12 @@ MockSubscriptions.prototype.removeRic = MockSubscriptions.prototype.removeSubscr
274
274
  MockSubscriptions.prototype.removeChain = MockSubscriptions.prototype.removeSubscription;
275
275
  /** @public */
276
276
  MockSubscriptions.prototype.removeAllSubscriptions = function() { // All channels will also be closed
277
- var working = this._working;
277
+ let working = this._working;
278
278
  this.stop();
279
279
 
280
280
  if(this._hasListener("subscriptionRemoved")) {
281
- var subs = [];
282
- for(var subId in this._subMap) {
281
+ let subs = [];
282
+ for(let subId in this._subMap) {
283
283
  subs.push(this._subMap[subId]);
284
284
  }
285
285
  if(subs.length > 0) {
@@ -301,9 +301,9 @@ MockSubscriptions.prototype.removeFields = function(fields) {
301
301
  if(typeof fields === "string") {
302
302
  fields = [fields];
303
303
  }
304
- var len = fields.length;
305
- for(var i = 0; i < len; ++i) {
306
- var field = fields[i];
304
+ let len = fields.length;
305
+ for(let i = 0; i < len; ++i) {
306
+ let field = fields[i];
307
307
  if(this._fields[field]) {
308
308
  delete this._fields[field];
309
309
  }
@@ -311,8 +311,8 @@ MockSubscriptions.prototype.removeFields = function(fields) {
311
311
  };
312
312
  /** @public */
313
313
  MockSubscriptions.prototype.removeAllFields = function() {
314
- var dirty = false;
315
- for(var field in this._fields) { // eslint-disable-line no-unused-vars
314
+ let dirty = false;
315
+ for(let field in this._fields) { // eslint-disable-line no-unused-vars
316
316
  dirty = true;
317
317
  break;
318
318
  }
@@ -355,7 +355,7 @@ MockSubscriptions.prototype.dispose = function() {
355
355
  MockSubscriptions.prototype.addEventListener = function(type, handler) {
356
356
  if(!handler) { return; }
357
357
 
358
- var listeners = this._events[type];
358
+ let listeners = this._events[type];
359
359
  if(listeners) {
360
360
  if(listeners.indexOf(handler) < 0) {
361
361
  listeners.push(handler);
@@ -369,10 +369,10 @@ MockSubscriptions.prototype.addEventListener = function(type, handler) {
369
369
  * @param {Function} handler
370
370
  */
371
371
  MockSubscriptions.prototype.removeEventListener = function(type, handler) {
372
- var listeners = (this._events) ? this._events[type] : null;
372
+ let listeners = (this._events) ? this._events[type] : null;
373
373
  if(!listeners) { return; }
374
374
 
375
- var at = listeners.indexOf(handler);
375
+ let at = listeners.indexOf(handler);
376
376
  if(at >= 0) {
377
377
  listeners.splice(at, 1);
378
378
  }
@@ -394,7 +394,7 @@ MockSubscriptions.prototype.getSubscription = function(subId) {
394
394
  * @return {string} string
395
395
  */
396
396
  MockSubscriptions.prototype.getRic = function(subId) {
397
- var sub = this._subMap[subId];
397
+ let sub = this._subMap[subId];
398
398
  if(sub) {
399
399
  return sub["ric"];
400
400
  }
@@ -429,8 +429,8 @@ MockSubscriptions.prototype.filter = function (start, count) {
429
429
  * @param {!Object} toObj
430
430
  * @return {!Object} Return toObj
431
431
  */
432
- var copyValues = function(fromObj, toObj) {
433
- for(var key in fromObj) {
432
+ let copyValues = function(fromObj, toObj) {
433
+ for(let key in fromObj) {
434
434
  toObj[key] = fromObj[key];
435
435
  }
436
436
  return toObj;
@@ -459,21 +459,21 @@ MockSubscriptions.prototype._addSymbol = function(ric, asChain, subId) {
459
459
  if(asChain) {
460
460
  ric = ric.replace("0#", ""); // The receiver is not expecting 0# symbol
461
461
  }
462
- var sub = {};
462
+ let sub = {};
463
463
  sub["ric"] = ric;
464
464
  sub["chain"] = asChain;
465
465
  sub["id"] = subId;
466
466
  sub["dataId"] = subId + ric;
467
467
  this._subMap[subId] = sub; // Collect all user subscriptions
468
468
  this._dataMap.addItem(ric, sub);
469
- var subs = this._dataMap.getItems(ric);
470
- var subCount = subs.length;
469
+ let subs = this._dataMap.getItems(ric);
470
+ let subCount = subs.length;
471
471
 
472
472
  this._dispatch("subscriptionAdded", {"subs": [sub]});
473
473
 
474
- var childSub = null;
475
- var childCount = 0;
476
- var i;
474
+ let childSub = null;
475
+ let childCount = 0;
476
+ let i;
477
477
  if(asChain) {
478
478
  // Note that constituents should have no subscription object. They should share the same subscription as their parent. Hence we does not register it to the _subMap
479
479
  if(subCount === 1) { // The first chain detected
@@ -490,8 +490,8 @@ MockSubscriptions.prototype._addSymbol = function(ric, asChain, subId) {
490
490
  this._dataMap.addItem(_joinSubKeys(sub, childSub), childSub);
491
491
  }
492
492
  } else {
493
- var firstSub = subs[0];
494
- var constituents = firstSub["children"];
493
+ let firstSub = subs[0];
494
+ let constituents = firstSub["children"];
495
495
  childCount = constituents.length;
496
496
  sub["children"] = new Array(childCount);
497
497
 
@@ -521,9 +521,9 @@ MockSubscriptions.prototype._addSymbol = function(ric, asChain, subId) {
521
521
  * @return {number}
522
522
  */
523
523
  MockSubscriptions.simpleDigest = function(str) {
524
- var len = str.length;
525
- var sum = 0;
526
- for(var i = 0; i < len; ++i) {
524
+ let len = str.length;
525
+ let sum = 0;
526
+ for(let i = 0; i < len; ++i) {
527
527
  sum += str.charCodeAt(i);
528
528
  }
529
529
  return sum;
@@ -532,7 +532,7 @@ MockSubscriptions.simpleDigest = function(str) {
532
532
  /** @private */
533
533
  MockSubscriptions.prototype._connect = function() {
534
534
  if(this._working && !this._timerId) {
535
- var delay = this._dataGen.randInt(this._minInterval, this._maxInterval);
535
+ let delay = this._dataGen.randInt(this._minInterval, this._maxInterval);
536
536
  this._timerId = window.setTimeout(this._onSubscriptionResponse, delay); // This will be async for fire event to user
537
537
  }
538
538
  };
@@ -541,49 +541,49 @@ MockSubscriptions.prototype._connect = function() {
541
541
  MockSubscriptions.prototype._onSubscriptionResponse = function() {
542
542
  this._timerId = 0;
543
543
 
544
- var keys = this._dataMap.getAllKeys(); // list of all rics
545
- var len = keys ? keys.length : 0; // len include all row index (Constituent and normal ric)
544
+ let keys = this._dataMap.getAllKeys(); // list of all rics
545
+ let len = keys ? keys.length : 0; // len include all row index (Constituent and normal ric)
546
546
  if(!len) { // No symbol has been added
547
547
  this._connect();
548
548
  return;
549
549
  }
550
550
 
551
- var minRow = (this._percentageDataUpdate - 0.02) * len;
551
+ let minRow = (this._percentageDataUpdate - 0.02) * len;
552
552
  minRow = minRow > 0 ? minRow : 1; // update at least 1 row
553
- var maxRow = (this._percentageDataUpdate + 0.02) * len;
553
+ let maxRow = (this._percentageDataUpdate + 0.02) * len;
554
554
  maxRow = maxRow < len ? maxRow : len; // not more than all rows
555
- var numRows = this._dataGen.randInt(minRow, maxRow);
556
- var fields = this._fields;
555
+ let numRows = this._dataGen.randInt(minRow, maxRow);
556
+ let fields = this._fields;
557
557
 
558
- for(var i = 0; i < numRows; i++) {
559
- var key = keys[this._dataGen.randIndex(len)]; // WARNING: Same sub could be picked more than once
560
- var subs = this._dataMap.getItems(key); // Get all subs with the same RIC
558
+ for(let i = 0; i < numRows; i++) {
559
+ let key = keys[this._dataGen.randIndex(len)]; // WARNING: Same sub could be picked more than once
560
+ let subs = this._dataMap.getItems(key); // Get all subs with the same RIC
561
561
 
562
- var sub = subs[0]; // Only the first sub is need to generate data
563
- var subParent = sub.parent;
564
- var updatePosition = this._dataGen.randBoolean(); // Flag for change CHILD_ORDER position
562
+ let sub = subs[0]; // Only the first sub is need to generate data
563
+ let subParent = sub.parent;
564
+ let updatePosition = this._dataGen.randBoolean(); // Flag for change CHILD_ORDER position
565
565
 
566
- var values, j, jLen;
566
+ let values, j, jLen;
567
567
  if(_isDynamicChain(key) && subParent && updatePosition) { // subParent in header of dynamic chain is behavior like a normal ric
568
568
  // TODO: support rate of ordering is changed
569
- var children = subParent.children;
569
+ let children = subParent.children;
570
570
 
571
571
  children = _shuffleArray(children);
572
- var childrenLen = children.length;
573
- var subIndex = children.indexOf(sub);
572
+ let childrenLen = children.length;
573
+ let subIndex = children.indexOf(sub);
574
574
  sub["CHILD_ORDER"] = subIndex;
575
575
 
576
576
  values = this._generateQuoteData(sub, fields);
577
577
 
578
578
  jLen = subs.length;
579
579
  for(j = 0; j < jLen; ++j) { // It could be same ric and it need to dispatch with same ric number
580
- for (var k = 0; k < childrenLen; k++) {
581
- var child = children[k];
580
+ for (let k = 0; k < childrenLen; k++) {
581
+ let child = children[k];
582
582
  if(subs[j] === child) {
583
583
  values["CHILD_ORDER"] = child["CHILD_ORDER"];
584
584
  this._dispatchDataChanged(subs[j], values);
585
585
  } else {
586
- var currentChild = child["CHILD_ORDER"];
586
+ let currentChild = child["CHILD_ORDER"];
587
587
  this._dispatchDataChanged(child, {
588
588
  X_RIC_NAME: child.ric,
589
589
  CHILD_ORDER: currentChild
@@ -597,7 +597,7 @@ MockSubscriptions.prototype._onSubscriptionResponse = function() {
597
597
  values = this._generateQuoteData(sub, fields);
598
598
  jLen = subs.length;
599
599
  for(j = 0; j < jLen; ++j) { // It could be same ric and it need to dispatch with same ric number
600
- var childOrder = subs[j]["CHILD_ORDER"];
600
+ let childOrder = subs[j]["CHILD_ORDER"];
601
601
  if(childOrder != null) { // Children of chain will have a CHILD_ORDER
602
602
  values["CHILD_ORDER"] = childOrder;
603
603
  }
@@ -623,17 +623,17 @@ MockSubscriptions.prototype._dispatchPostUpdate = function (obj) {
623
623
  * @return {!Object}
624
624
  */
625
625
  MockSubscriptions.prototype._generateQuoteData = function(sub, fields) {
626
- var ric = sub.ric;
627
- var prevData = sub.prevData;
626
+ let ric = sub.ric;
627
+ let prevData = sub.prevData;
628
628
 
629
- var values = {};
630
- var options = {
629
+ let values = {};
630
+ let options = {
631
631
  text: ric,
632
632
  prefix: sub["parent"] ? sub["parent"]["ric"] : "" // prefix for constituents
633
633
  };
634
- for(var field in fields){
635
- var data = this._dataGen.generateQuoteData(field, options);
636
- var formattedField = field + "_FORMATTED";
634
+ for(let field in fields){
635
+ let data = this._dataGen.generateQuoteData(field, options);
636
+ let formattedField = field + "_FORMATTED";
637
637
  if(prevData) {
638
638
  if(data.changeOnly) {
639
639
  if(prevData[field] === data.value) {
@@ -664,11 +664,11 @@ MockSubscriptions.prototype._generateQuoteData = function(sub, fields) {
664
664
  * @return {Object}
665
665
  */
666
666
  MockSubscriptions.prototype._getChildSubByRic = function(parentSub, ric) {
667
- var children = parentSub["children"];
667
+ let children = parentSub["children"];
668
668
  if(children) {
669
- var childCount = children.length;
670
- for(var i = 0; i < childCount; ++i) {
671
- var child = children[i];
669
+ let childCount = children.length;
670
+ for(let i = 0; i < childCount; ++i) {
671
+ let child = children[i];
672
672
  if(child["ric"] === ric) {
673
673
  return child;
674
674
  }
@@ -680,21 +680,21 @@ MockSubscriptions.prototype._getChildSubByRic = function(parentSub, ric) {
680
680
  * @param {string} ric
681
681
  */
682
682
  MockSubscriptions.prototype._updateDuplicateSymbol = function(ric) {
683
- var subs = this._dataMap.getItems(ric);
683
+ let subs = this._dataMap.getItems(ric);
684
684
  if(!subs) {
685
685
  return;
686
686
  }
687
- var subCount = subs.length;
687
+ let subCount = subs.length;
688
688
  if(subCount < 2) {
689
689
  return;
690
690
  }
691
- var firstSub = subs[0];
692
- var prevData = firstSub["prevData"];
693
- var isChain = firstSub["chain"] ? true : false;
694
- var i;
691
+ let firstSub = subs[0];
692
+ let prevData = firstSub["prevData"];
693
+ let isChain = firstSub["chain"] ? true : false;
694
+ let i;
695
695
  if(prevData) {
696
696
  for(i = 1; i < subCount; ++i) {
697
- var sub = subs[i];
697
+ let sub = subs[i];
698
698
  if(!sub["prevData"]) {
699
699
  // TODO: check in duplicate dynamic chain
700
700
  this._dispatchDataChanged(sub, prevData);
@@ -706,20 +706,20 @@ MockSubscriptions.prototype._updateDuplicateSymbol = function(ric) {
706
706
  if(!isChain) {
707
707
  return;
708
708
  }
709
- var ricList = firstSub["ricList"];
709
+ let ricList = firstSub["ricList"];
710
710
  if(!ricList) {
711
711
  return;
712
712
  }
713
- var childCount = ricList.length;
713
+ let childCount = ricList.length;
714
714
 
715
715
  for(i = 1; i < subCount; ++i) {
716
- var sub2 = subs[i];
717
- var ricList2 = sub2["ricList"];
718
- var childCount2 = ricList2 ? ricList2.length : 0;
719
- for(var j = childCount2; j < childCount; ++j) {
720
- var childRic = ricList[j];
721
- var childSub = this._getChildSubByRic(firstSub, childRic);
722
- var childSub2 = this._getChildSubByRic(sub2, childRic);
716
+ let sub2 = subs[i];
717
+ let ricList2 = sub2["ricList"];
718
+ let childCount2 = ricList2 ? ricList2.length : 0;
719
+ for(let j = childCount2; j < childCount; ++j) {
720
+ let childRic = ricList[j];
721
+ let childSub = this._getChildSubByRic(firstSub, childRic);
722
+ let childSub2 = this._getChildSubByRic(sub2, childRic);
723
723
  if(childSub && childSub2) {
724
724
  if(childSub["prevData"]) {
725
725
  // TODO: check in duplicate dynamic chain
@@ -734,13 +734,13 @@ MockSubscriptions.prototype._updateDuplicateSymbol = function(ric) {
734
734
  * @param {Object} dataUpdates
735
735
  */
736
736
  MockSubscriptions.prototype._dispatchDataChanged = function(sub, dataUpdates) {
737
- var values = copyValues(dataUpdates, {});
738
- var evtArg = {};
737
+ let values = copyValues(dataUpdates, {});
738
+ let evtArg = {};
739
739
  evtArg["ric"] = sub["ric"];
740
740
  evtArg["values"] = values;
741
741
  evtArg["subId"] = sub["id"];
742
742
 
743
- var prevData = sub.prevData; // For data generation on the next update
743
+ let prevData = sub.prevData; // For data generation on the next update
744
744
  if(!prevData) {
745
745
  prevData = {};
746
746
  sub.prevData = prevData;
@@ -751,9 +751,9 @@ MockSubscriptions.prototype._dispatchDataChanged = function(sub, dataUpdates) {
751
751
  values["SUB_ID"] = sub["id"];
752
752
  copyValues(values, prevData);
753
753
 
754
- var parentSub = sub.parent;
754
+ let parentSub = sub.parent;
755
755
  if(parentSub) { // This is the first time constituent have the data
756
- var ricList = parentSub["ricList"];
756
+ let ricList = parentSub["ricList"];
757
757
  if(!ricList) {
758
758
  ricList = parentSub["ricList"] = [];
759
759
  }
@@ -780,7 +780,7 @@ MockSubscriptions.prototype.onFeedStatusChanged = function(feedNames, handler) {
780
780
  * @return {boolean}
781
781
  */
782
782
  MockSubscriptions.prototype._hasListener = function(type) {
783
- var listeners = this._events[type];
783
+ let listeners = this._events[type];
784
784
  return listeners ? (listeners.length > 0) : false;
785
785
  };
786
786
  /** @private
@@ -788,10 +788,10 @@ MockSubscriptions.prototype._hasListener = function(type) {
788
788
  * @param {Object} eventArg
789
789
  */
790
790
  MockSubscriptions.prototype._dispatch = function(type, eventArg) {
791
- var listeners = this._events[type];
791
+ let listeners = this._events[type];
792
792
  if(!listeners) { return; }
793
- var len = listeners.length;
794
- for(var i = 0; i < len; ++i) {
793
+ let len = listeners.length;
794
+ for(let i = 0; i < len; ++i) {
795
795
  listeners[i](eventArg);
796
796
  }
797
797
  };
@@ -3,7 +3,7 @@ import { MockQuotes2 } from "./MockQuotes2.js";
3
3
  import { cloneObject } from "../Util.js";
4
4
 
5
5
  /** @constructor */
6
- var MockRTKData = {};
6
+ let MockRTKData = {};
7
7
 
8
8
  /** @type {Object}
9
9
  * @public
@@ -14,7 +14,7 @@ MockRTKData.DataGrid = cloneObject(DataGrid);
14
14
  * @return {*}
15
15
  */
16
16
  MockRTKData.DataGrid.request = function (payload) {
17
- var p = DataGrid.request(payload);
17
+ let p = DataGrid.request(payload);
18
18
  return p.then(function (res) {
19
19
  return JSON.parse(res);
20
20
  });
@@ -29,7 +29,7 @@ MockRTKData.Adc = cloneObject(Adc);
29
29
  * @return {*}
30
30
  */
31
31
  MockRTKData.Adc.request = function (payload) {
32
- var p = Adc.request(payload);
32
+ let p = Adc.request(payload);
33
33
  return p.then(function (res) {
34
34
  return JSON.parse(res);
35
35
  });
@@ -44,7 +44,7 @@ MockRTKData.setInvalidFields = setInvalidFields;
44
44
 
45
45
 
46
46
  /** @constructor */
47
- var MockRTK = {};
47
+ let MockRTK = {};
48
48
 
49
49
  /** @type {MockQuotes2}
50
50
  * @public
@@ -2,7 +2,7 @@
2
2
  * @public
3
3
  * @type {Object}
4
4
  */
5
- var invalidFieldDict = {
5
+ let invalidFieldDict = {
6
6
  'TR.NonExistField': true,
7
7
  'TR.NotExistField': true,
8
8
  'CF_IGNORE_FIELD': true
@@ -16,7 +16,7 @@ function setInvalidFields(fields) {
16
16
  if (fields && typeof fields === 'string') {
17
17
  invalidFieldDict[fields] = true;
18
18
  } else if (Array.isArray(fields)) {
19
- for (var i = 0; i < fields.length; i++) {
19
+ for (let i = 0; i < fields.length; i++) {
20
20
  invalidFieldDict[fields[i]] = true;
21
21
  }
22
22
  }
@@ -2,7 +2,7 @@ import { MockJET } from "./MockJET.js";
2
2
  import { DataGenerator } from "./DataGenerator.js";
3
3
  import { MockRTK } from "./MockRTK.js";
4
4
 
5
- var tr = window["tr"];
5
+ let tr = window["tr"];
6
6
  if(!tr) {
7
7
  tr = window["tr"] = {};
8
8
  }
@@ -2,12 +2,12 @@ import { Adc } from "./Adc.js";
2
2
  import { DataGenerator } from "./DataGenerator.js";
3
3
  import { invalidFieldDict, setInvalidFields } from "./MockUtil.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 DataGrid = {};
10
+ let DataGrid = {};
11
11
 
12
12
  /** @private
13
13
  * @function
@@ -20,13 +20,13 @@ DataGrid.request = function (payload, mockResponse) {
20
20
  return Promise.resolve(JSON.stringify(mockResponse));
21
21
  }
22
22
 
23
- var i, f, len, row;
24
- var instruments = payload.instruments;
25
- var fields = payload.fields;
23
+ let i, f, len, row;
24
+ let instruments = payload.instruments;
25
+ let fields = payload.fields;
26
26
 
27
27
  // _invalidFieldDict is a dictionary of non exist field
28
28
  // so we must remove invalid field to make "mocking api" return result more like a "real api".
29
- var invalidDict = invalidFieldDict;
29
+ let invalidDict = invalidFieldDict;
30
30
  fields = [];
31
31
  for (i = 0; i < payload.fields.length; i++) {
32
32
  f = payload.fields[i];
@@ -36,14 +36,14 @@ DataGrid.request = function (payload, mockResponse) {
36
36
  }
37
37
 
38
38
  // for filter duplicate instrument
39
- var rowMap = {};
39
+ let rowMap = {};
40
40
 
41
41
  // build data
42
42
  len = instruments.length;
43
- var data2D = [];
44
- var rowData = dataGen.generate(fields, len);
43
+ let data2D = [];
44
+ let rowData = dataGen.generate(fields, len);
45
45
  for (i = 0; i < len; ++i) {
46
- var inst = instruments[i];
46
+ let inst = instruments[i];
47
47
  row = rowMap[inst];
48
48
  if (!row) {
49
49
  row = rowMap[inst] = rowData[i];
@@ -55,12 +55,12 @@ DataGrid.request = function (payload, mockResponse) {
55
55
  // There is a chance that rtk will return multiple row data per instrument
56
56
  // so we must create mock up for this case
57
57
  if (data2D.length > 0) {
58
- var chance = dataGen.randInt(1, 10);
58
+ let chance = dataGen.randInt(1, 10);
59
59
  if (chance <= 3) { // chance 30%
60
- var pos = dataGen.randInt(0, data2D.length - 1); // random row pos
60
+ let pos = dataGen.randInt(0, data2D.length - 1); // random row pos
61
61
  row = data2D[pos];
62
62
  len = row.length;
63
- var mockupRow = new Array(len);
63
+ let mockupRow = new Array(len);
64
64
  mockupRow[0] = row[0]; // 1st index is for instrument
65
65
  for (i = 1; i < len; i++) {
66
66
  mockupRow[i] = ''; // real case will return null or empty string
@@ -70,7 +70,7 @@ DataGrid.request = function (payload, mockResponse) {
70
70
  }
71
71
 
72
72
  // build header
73
- var headers = [{
73
+ let headers = [{
74
74
  "displayName": "Instrument"
75
75
  }];
76
76
  for (i = 0; i < fields.length; i++) {
@@ -92,7 +92,7 @@ DataGrid.request = function (payload, mockResponse) {
92
92
  * @param {string} dataType
93
93
  * @return {Promise}
94
94
  */
95
- var mockDataAPI = function (dataType) {
95
+ let mockDataAPI = function (dataType) {
96
96
  if (dataType === "datagrid") {
97
97
  return Promise.resolve(DataGrid);
98
98
  } else if(dataType === "adc") {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @namespace
3
3
  */
4
- var translationDe = {
4
+ let translationDe = {
5
5
  "sun": "So",
6
6
  "mon": "Mo",
7
7
  "tue": "Di",
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @namespace
3
3
  */
4
- var translationEn = {
4
+ let translationEn = {
5
5
  "sun": "Sun",
6
6
  "mon": "Mon",
7
7
  "tue": "Tue",
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @namespace
3
3
  */
4
- var translationJa = {
4
+ let translationJa = {
5
5
  'sun': '日',
6
6
  'mon': '月',
7
7
  'tue': '火',
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @namespace
3
3
  */
4
- var translationZhHant = {
4
+ let translationZhHant = {
5
5
  'sun': '週日',
6
6
  'mon': '週一',
7
7
  'tue': '週二',
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @namespace
3
3
  */
4
- var translationZh = {
4
+ let translationZh = {
5
5
  'sun': '周日',
6
6
  'mon': '周一',
7
7
  'tue': '周二',
@@ -7,7 +7,7 @@ import translationZhHant from "./translation-zh-hant.js";
7
7
  /**
8
8
  * @namespace
9
9
  */
10
- var translation = {
10
+ let translation = {
11
11
  "en": translationEn,
12
12
  "de": translationDe,
13
13
  "ja": translationJa,