@refinitiv-ui/efx-grid 6.0.90 → 6.0.92

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) 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 +2446 -2625
  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 +4 -0
  8. package/lib/core/es6/data/DataTable.js +219 -190
  9. package/lib/core/es6/data/DataView.d.ts +2 -0
  10. package/lib/core/es6/data/DataView.js +300 -292
  11. package/lib/core/es6/data/Segment.js +85 -83
  12. package/lib/core/es6/data/SegmentCollection.d.ts +2 -0
  13. package/lib/core/es6/data/SegmentCollection.js +91 -80
  14. package/lib/core/es6/data/WrappedView.js +41 -41
  15. package/lib/core/es6/grid/Core.js +635 -635
  16. package/lib/core/es6/grid/ILayoutGrid.js +1 -1
  17. package/lib/core/es6/grid/LayoutGrid.js +183 -183
  18. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +91 -91
  19. package/lib/core/es6/grid/components/Cell.js +29 -29
  20. package/lib/core/es6/grid/components/CellFloatingPanel.js +11 -11
  21. package/lib/core/es6/grid/components/CellSpan.js +7 -7
  22. package/lib/core/es6/grid/components/CellSpans.js +36 -34
  23. package/lib/core/es6/grid/components/Column.js +40 -40
  24. package/lib/core/es6/grid/components/ElementWrapper.js +17 -17
  25. package/lib/core/es6/grid/components/HScrollbar.js +31 -31
  26. package/lib/core/es6/grid/components/Scrollbar.js +77 -77
  27. package/lib/core/es6/grid/components/StretchedCells.js +49 -49
  28. package/lib/core/es6/grid/components/VScrollbar.js +11 -11
  29. package/lib/core/es6/grid/components/VirtualItems.js +3 -3
  30. package/lib/core/es6/grid/event/EventDispatcher.js +9 -9
  31. package/lib/core/es6/grid/event/EventListeners.js +4 -4
  32. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +186 -186
  33. package/lib/core/es6/grid/util/Conflator.js +4 -4
  34. package/lib/core/es6/grid/util/Reverter.js +1 -1
  35. package/lib/core/es6/grid/util/SectionSettings.js +20 -20
  36. package/lib/core/es6/grid/util/SelectionList.js +23 -23
  37. package/lib/core/es6/grid/util/TrackLayout.js +74 -74
  38. package/lib/core/es6/grid/util/Virtualizer.js +15 -15
  39. package/lib/core/es6/grid/util/util.js +20 -20
  40. package/lib/core/es6/index.d.ts +0 -2
  41. package/lib/core/es6/index.js +0 -3
  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-column-grouping/es6/ColumnGrouping.d.ts +3 -1
  50. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +29 -1
  51. package/lib/tr-grid-util/es6/CellPainter.js +94 -93
  52. package/lib/tr-grid-util/es6/Conflator.js +4 -4
  53. package/lib/tr-grid-util/es6/CoralItems.js +6 -6
  54. package/lib/tr-grid-util/es6/DateTime.js +39 -39
  55. package/lib/tr-grid-util/es6/Deferred.js +5 -5
  56. package/lib/tr-grid-util/es6/Delay.js +1 -1
  57. package/lib/tr-grid-util/es6/Dom.js +26 -26
  58. package/lib/tr-grid-util/es6/DragUI.js +17 -17
  59. package/lib/tr-grid-util/es6/ElementObserver.js +12 -12
  60. package/lib/tr-grid-util/es6/ElementWrapper.js +2 -2
  61. package/lib/tr-grid-util/es6/ElfDate.js +4 -4
  62. package/lib/tr-grid-util/es6/ElfUtil.js +37 -37
  63. package/lib/tr-grid-util/es6/EventDispatcher.js +12 -12
  64. package/lib/tr-grid-util/es6/ExpanderIcon.js +6 -6
  65. package/lib/tr-grid-util/es6/ExpressionParser.js +43 -43
  66. package/lib/tr-grid-util/es6/Ext.js +6 -6
  67. package/lib/tr-grid-util/es6/FieldFormatter.js +17 -17
  68. package/lib/tr-grid-util/es6/FilterBuilder.js +57 -57
  69. package/lib/tr-grid-util/es6/FilterOperators.d.ts +12 -1
  70. package/lib/tr-grid-util/es6/FilterOperators.js +13 -2
  71. package/lib/tr-grid-util/es6/GridPlugin.js +86 -86
  72. package/lib/tr-grid-util/es6/GroupDefinitions.js +90 -90
  73. package/lib/tr-grid-util/es6/Icon.js +4 -4
  74. package/lib/tr-grid-util/es6/MouseDownTrait.js +6 -6
  75. package/lib/tr-grid-util/es6/MultiTableManager.js +68 -68
  76. package/lib/tr-grid-util/es6/NumberFormatter.js +22 -22
  77. package/lib/tr-grid-util/es6/PercentBar.js +17 -17
  78. package/lib/tr-grid-util/es6/Perf.js +5 -5
  79. package/lib/tr-grid-util/es6/Popup.js +42 -42
  80. package/lib/tr-grid-util/es6/RangeBar.js +5 -5
  81. package/lib/tr-grid-util/es6/RequestQueue.js +5 -5
  82. package/lib/tr-grid-util/es6/RowPainter.js +23 -23
  83. package/lib/tr-grid-util/es6/SubTable.js +94 -94
  84. package/lib/tr-grid-util/es6/Table.js +51 -51
  85. package/lib/tr-grid-util/es6/TextHighlighter.js +49 -49
  86. package/lib/tr-grid-util/es6/TickCodes.js +2 -2
  87. package/lib/tr-grid-util/es6/Timer.js +2 -2
  88. package/lib/tr-grid-util/es6/TouchProxy.js +7 -7
  89. package/lib/tr-grid-util/es6/Util.js +50 -50
  90. package/lib/tr-grid-util/es6/formula/ADCService.js +2 -2
  91. package/lib/tr-grid-util/es6/formula/ADCSubscription.js +19 -19
  92. package/lib/tr-grid-util/es6/formula/AdFinService.js +2 -2
  93. package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +19 -19
  94. package/lib/tr-grid-util/es6/formula/Engine.js +56 -56
  95. package/lib/tr-grid-util/es6/formula/Formula.js +62 -62
  96. package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +3 -3
  97. package/lib/tr-grid-util/es6/formula/Realtime.js +15 -15
  98. package/lib/tr-grid-util/es6/formula/RealtimeService.js +15 -15
  99. package/lib/tr-grid-util/es6/formula/TSIService.js +2 -2
  100. package/lib/tr-grid-util/es6/formula/TSISubscription.js +104 -104
  101. package/lib/tr-grid-util/es6/formula/VariableToken.js +20 -20
  102. package/lib/tr-grid-util/es6/formula/functions/AdFin.js +10 -10
  103. package/lib/tr-grid-util/es6/formula/functions/Excel.js +1 -1
  104. package/lib/tr-grid-util/es6/formula/functions/Info.js +2 -2
  105. package/lib/tr-grid-util/es6/formula/functions/Internal.js +5 -5
  106. package/lib/tr-grid-util/es6/formula/functions/Logic.js +5 -5
  107. package/lib/tr-grid-util/es6/formula/functions/Math.js +46 -46
  108. package/lib/tr-grid-util/es6/formula/functions/Statistics.js +27 -27
  109. package/lib/tr-grid-util/es6/formula/functions/Text.js +19 -19
  110. package/lib/tr-grid-util/es6/index.js +1 -1
  111. package/lib/tr-grid-util/es6/jet/Adc.js +36 -36
  112. package/lib/tr-grid-util/es6/jet/CollectionDict.js +11 -11
  113. package/lib/tr-grid-util/es6/jet/DataGenerator.js +95 -95
  114. package/lib/tr-grid-util/es6/jet/DataSet.js +1 -1
  115. package/lib/tr-grid-util/es6/jet/MockArchive.js +5 -5
  116. package/lib/tr-grid-util/es6/jet/MockJET.js +1 -1
  117. package/lib/tr-grid-util/es6/jet/MockQuotes.js +13 -13
  118. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +100 -100
  119. package/lib/tr-grid-util/es6/jet/MockRTK.js +4 -4
  120. package/lib/tr-grid-util/es6/jet/MockUtil.js +2 -2
  121. package/lib/tr-grid-util/es6/jet/index.js +1 -1
  122. package/lib/tr-grid-util/es6/jet/mockDataAPI.js +15 -15
  123. package/lib/tr-grid-util/es6/locale/translation-de.js +1 -1
  124. package/lib/tr-grid-util/es6/locale/translation-en.js +1 -1
  125. package/lib/tr-grid-util/es6/locale/translation-ja.js +1 -1
  126. package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +1 -1
  127. package/lib/tr-grid-util/es6/locale/translation-zh.js +1 -1
  128. package/lib/tr-grid-util/es6/locale/translation.js +1 -1
  129. package/lib/types/es6/ColumnDragging.d.ts +1 -1
  130. package/lib/types/es6/ColumnGrouping.d.ts +3 -1
  131. package/lib/types/es6/Core/data/DataTable.d.ts +4 -0
  132. package/lib/types/es6/Core/data/DataView.d.ts +2 -0
  133. package/lib/types/es6/Core/data/SegmentCollection.d.ts +2 -0
  134. package/lib/types/es6/Core/index.d.ts +0 -2
  135. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -1
  136. package/lib/versions.json +4 -4
  137. package/package.json +1 -1
  138. package/lib/core/es6/grid/util/ElementFrameWork.d.ts +0 -18
  139. package/lib/core/es6/grid/util/ElementFrameWork.js +0 -227
  140. package/lib/core/es6/grid/util/HttpRequest.d.ts +0 -53
  141. package/lib/core/es6/grid/util/HttpRequest.js +0 -371
  142. package/lib/core/es6/grid/util/PercentBar.d.ts +0 -43
  143. package/lib/core/es6/grid/util/PercentBar.js +0 -390
  144. package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +0 -41
  145. package/lib/core/es6/grid/util/PercentBarRenderer.js +0 -316
  146. package/lib/core/es6/grid/util/RangeBar.d.ts +0 -25
  147. package/lib/core/es6/grid/util/RangeBar.js +0 -255
  148. package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +0 -18
  149. package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +0 -53
  150. package/lib/types/es6/Core/grid/util/PercentBar.d.ts +0 -43
  151. package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +0 -41
  152. package/lib/types/es6/Core/grid/util/RangeBar.d.ts +0 -25
@@ -25,7 +25,7 @@ import DataSet from "./DataSet.js";
25
25
  * @param {number=} seed
26
26
  * @return {number}
27
27
  */
28
- var _generateId = function(fInfo, seed) {
28
+ let _generateId = function(fInfo, seed) {
29
29
  if(seed == null) {
30
30
  seed = fInfo._id != null ? fInfo._id : -1;
31
31
  fInfo._id = ++seed;
@@ -37,19 +37,19 @@ var _generateId = function(fInfo, seed) {
37
37
  * @param {number=} seed
38
38
  * @return {Date}
39
39
  */
40
- var _generateDate1 = function(fInfo, seed) {
40
+ let _generateDate1 = function(fInfo, seed) {
41
41
  if(seed == null) {
42
42
  return randDate(6e11, 16e11, seed);
43
43
  }
44
44
  return new Date(1e12 + 1e9 * seed);
45
45
  };
46
46
 
47
- var POW10 = [1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10];
47
+ let POW10 = [1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10];
48
48
 
49
49
  /** @type {Object.<string, DataGenerator~DataOptions>}
50
50
  * @private
51
51
  */
52
- var _fieldInfo = {
52
+ let _fieldInfo = {
53
53
  "X_RIC_NAME": {type: "string"},
54
54
  "CF_NAME": {type: "string", prefix: true, suffix: " Name"},
55
55
  "CF_LAST": {type: "number", min: 0.01, max: 1000, prec: 2},
@@ -113,7 +113,7 @@ var _fieldInfo = {
113
113
  * @param {string} field
114
114
  * @return {!Object}
115
115
  */
116
- var getFieldInfo = function(field) {
116
+ let getFieldInfo = function(field) {
117
117
  return _fieldInfo[field] || {};
118
118
  };
119
119
 
@@ -121,9 +121,9 @@ var getFieldInfo = function(field) {
121
121
  * @param {string} field
122
122
  * @param {DataGenerator~FieldInformation|Function} options
123
123
  */
124
- var addFieldInfo = function(field, options) {
124
+ let addFieldInfo = function(field, options) {
125
125
  if(field) {
126
- var opt = options;
126
+ let opt = options;
127
127
  if(typeof options === "function") {
128
128
  opt = {
129
129
  type: "function",
@@ -139,8 +139,8 @@ var addFieldInfo = function(field, options) {
139
139
  * @param {number} seed
140
140
  * @return {number}
141
141
  */
142
- var pseudoRandNumber = function(seed) {
143
- var rand = Math.sin(seed * 113) * 10000;
142
+ let pseudoRandNumber = function(seed) {
143
+ let rand = Math.sin(seed * 113) * 10000;
144
144
  rand *= rand;
145
145
  return rand - (rand | 0);
146
146
  };
@@ -149,7 +149,7 @@ var pseudoRandNumber = function(seed) {
149
149
  * @param {*=} seed
150
150
  * @return {number}
151
151
  */
152
- var _getRandomNumber = function(seed) {
152
+ let _getRandomNumber = function(seed) {
153
153
  return (typeof seed === "number") ? pseudoRandNumber(seed) : Math.random();
154
154
  };
155
155
 
@@ -161,13 +161,13 @@ var _getRandomNumber = function(seed) {
161
161
  * @param {number=} seed
162
162
  * @return {number}
163
163
  */
164
- var randNumber = function(min, max, prec, seed) {
164
+ let randNumber = function(min, max, prec, seed) {
165
165
  if(!min) { min = 0; }
166
166
  if(max == null) { max = 100; }
167
- var v = (max - min) * _getRandomNumber(seed) + min;
167
+ let v = (max - min) * _getRandomNumber(seed) + min;
168
168
 
169
169
  if(prec > 0) {
170
- var pow = POW10[prec];
170
+ let pow = POW10[prec];
171
171
  return Math.floor(v * pow) / pow;
172
172
  } else if(prec != null) {
173
173
  return Math.floor(v);
@@ -183,7 +183,7 @@ var randNumber = function(min, max, prec, seed) {
183
183
  * @param {number=} seed
184
184
  * @return {number}
185
185
  */
186
- var randInt = function(min, max, seed) {
186
+ let randInt = function(min, max, seed) {
187
187
  return randNumber(min, max + 1, 0, seed);
188
188
  };
189
189
 
@@ -194,7 +194,7 @@ var randInt = function(min, max, seed) {
194
194
  * @param {number=} seed
195
195
  * @return {number}
196
196
  */
197
- var randBetween = function(min, max, seed) {
197
+ let randBetween = function(min, max, seed) {
198
198
  return randNumber(min, max, 0, seed);
199
199
  };
200
200
 
@@ -206,7 +206,7 @@ var randBetween = function(min, max, seed) {
206
206
  * @param {number=} seed
207
207
  * @return {number}
208
208
  */
209
- var randIndex = function(max, seed) {
209
+ let randIndex = function(max, seed) {
210
210
  return randBetween(0, max, seed);
211
211
  };
212
212
 
@@ -214,7 +214,7 @@ var randIndex = function(max, seed) {
214
214
  * @param {number=} seed
215
215
  * @return {boolean}
216
216
  */
217
- var randBoolean = function(seed) {
217
+ let randBoolean = function(seed) {
218
218
  return randInt(0, 1, seed) === 0;
219
219
  };
220
220
 
@@ -224,9 +224,9 @@ var randBoolean = function(seed) {
224
224
  * @param {number=} seed
225
225
  * @return {*}
226
226
  */
227
- var randMember = function(set, seed) {
227
+ let randMember = function(set, seed) {
228
228
  if(set) {
229
- var index = randIndex(set.length, seed);
229
+ let index = randIndex(set.length, seed);
230
230
  return set[index];
231
231
  }
232
232
  return String.fromCharCode(randInt(65, 90, seed));
@@ -238,7 +238,7 @@ var randMember = function(set, seed) {
238
238
  * @param {number=} seed
239
239
  * @return {Date}
240
240
  */
241
- var randDate = function(min, max, seed) {
241
+ let randDate = function(min, max, seed) {
242
242
  min = min || (Date.now() - 63072000000); //2 years back from now
243
243
  if(min instanceof Date) {
244
244
  min = min.getTime();
@@ -249,7 +249,7 @@ var randDate = function(min, max, seed) {
249
249
  max = max.getTime();
250
250
  }
251
251
 
252
- var ts = randInt(0, (max - min) / 1000, seed);
252
+ let ts = randInt(0, (max - min) / 1000, seed);
253
253
  return new Date(min + (ts * 1000));
254
254
  };
255
255
 
@@ -259,15 +259,15 @@ var randDate = function(min, max, seed) {
259
259
  * @param {number=} seed
260
260
  * @return {string}
261
261
  */
262
- var randString = function(min, max, seed) {
263
- var wordCount = (min < max) ? randBetween(min, max, seed) : min;
262
+ let randString = function(min, max, seed) {
263
+ let wordCount = (min < max) ? randBetween(min, max, seed) : min;
264
264
 
265
- var ary = new Array(wordCount);
266
- for(var i = 0; i < wordCount; ++i) {
265
+ let ary = new Array(wordCount);
266
+ for(let i = 0; i < wordCount; ++i) {
267
267
  if(seed != null) {
268
268
  seed *= 1.17 * (i + 1);
269
269
  }
270
- var idx = randIndex(DataSet.words.length, seed);
270
+ let idx = randIndex(DataSet.words.length, seed);
271
271
  ary[i] = DataSet.words[idx];
272
272
  }
273
273
  return ary.join(" ");
@@ -280,7 +280,7 @@ var randString = function(min, max, seed) {
280
280
  * @param {Array.<string|number>=} fields Keys to be mapped on the output records.
281
281
  * @return {Array.<Object>} records
282
282
  */
283
- var toRecords = function(data2D, fields) {
283
+ let toRecords = function(data2D, fields) {
284
284
  if(!Array.isArray(data2D)) {
285
285
  return null;
286
286
  }
@@ -291,16 +291,16 @@ var toRecords = function(data2D, fields) {
291
291
  fields = [];
292
292
  }
293
293
  }
294
- var len = data2D.length;
295
- var records = new Array(len);
296
- for(var i = 0; i < len; ++i) {
297
- var record = records[i] = {};
298
- var columns = data2D[i];
299
- var jLen = columns ? (columns.length || 0) : 0;
300
- for(var j = 0; j < jLen; ++j) {
301
- var value = columns[j];
294
+ let len = data2D.length;
295
+ let records = new Array(len);
296
+ for(let i = 0; i < len; ++i) {
297
+ let record = records[i] = {};
298
+ let columns = data2D[i];
299
+ let jLen = columns ? (columns.length || 0) : 0;
300
+ for(let j = 0; j < jLen; ++j) {
301
+ let value = columns[j];
302
302
  if(value !== undefined) { // eslint-disable-line
303
- var key = fields[j];
303
+ let key = fields[j];
304
304
  if(!key && key !== 0) {
305
305
  key = j + "";
306
306
  }
@@ -314,7 +314,7 @@ var toRecords = function(data2D, fields) {
314
314
  /** @public
315
315
  * @return {number}
316
316
  */
317
- var getSeed = function() {
317
+ let getSeed = function() {
318
318
  return DataGenerator.seed;
319
319
  };
320
320
 
@@ -324,8 +324,8 @@ var getSeed = function() {
324
324
  * @param {DataGenerator~DataOptions=} options
325
325
  * @return {!Array.<Array>} 2D Array of data
326
326
  */
327
- var generate = function(fields, options) {
328
- var result = _generate2DArray(fields, options, DataGenerator.seed);
327
+ let generate = function(fields, options) {
328
+ let result = _generate2DArray(fields, options, DataGenerator.seed);
329
329
  DataGenerator.seed = result.seed;
330
330
 
331
331
  return result.data;
@@ -338,11 +338,11 @@ var generate = function(fields, options) {
338
338
  * @param {number=} seed
339
339
  * @return {!Object} Object with the given fields as its keys
340
340
  */
341
- var generateRecord = function(fields, options, seed) {
341
+ let generateRecord = function(fields, options, seed) {
342
342
  if(!Array.isArray(fields)) {
343
343
  fields = [fields + ""];
344
344
  }
345
- var config = {};
345
+ let config = {};
346
346
  if(options != null) {
347
347
  if(typeof options === "number") {
348
348
  seed = options;
@@ -351,10 +351,10 @@ var generateRecord = function(fields, options, seed) {
351
351
  }
352
352
  }
353
353
 
354
- var fieldCount = fields.length;
355
- var record = {};
356
- for(var i = 0; i < fieldCount; ++i) {
357
- var field = fields[i];
354
+ let fieldCount = fields.length;
355
+ let record = {};
356
+ for(let i = 0; i < fieldCount; ++i) {
357
+ let field = fields[i];
358
358
  record[field] = _generateFieldData(field, config, seed).value;
359
359
  }
360
360
  return record;
@@ -365,17 +365,17 @@ var generateRecord = function(fields, options, seed) {
365
365
  * @param {(number|DataGenerator~DataOptions)=} options Configuration object or number of rows
366
366
  * @return {!Array.<Object>} Array of object with the given fields as its keys
367
367
  */
368
- var generateRecords = function(fields, options) {
369
- var result = _generate2DArray(fields, options, DataGenerator.seed);
368
+ let generateRecords = function(fields, options) {
369
+ let result = _generate2DArray(fields, options, DataGenerator.seed);
370
370
  DataGenerator.seed = result.seed;
371
371
  fields = result.fields;
372
- var fieldCount = fields.length;
373
- var records = result.data;
374
- for(var i = records.length; --i >= 0;) {
375
- var ary = records[i];
376
- var record = {};
377
- for(var j = 0; j < fieldCount; ++j) {
378
- var field = fields[j];
372
+ let fieldCount = fields.length;
373
+ let records = result.data;
374
+ for(let i = records.length; --i >= 0;) {
375
+ let ary = records[i];
376
+ let record = {};
377
+ for(let j = 0; j < fieldCount; ++j) {
378
+ let field = fields[j];
379
379
  record[field] = ary[j];
380
380
  }
381
381
  records[i] = record;
@@ -390,11 +390,11 @@ var generateRecords = function(fields, options) {
390
390
  * @param {number=} seed
391
391
  * @return {!Object} Object with value, formattedValue and other properties
392
392
  */
393
- var generateQuoteData = function(field, options, seed) {
394
- var fInfo = _generateFieldData(field, options, seed);
393
+ let generateQuoteData = function(field, options, seed) {
394
+ let fInfo = _generateFieldData(field, options, seed);
395
395
 
396
396
  //formatting
397
- var fmtValue = fInfo.value + "";
397
+ let fmtValue = fInfo.value + "";
398
398
  if(fInfo.prefix){
399
399
  if(typeof fInfo.prefix == "string") {
400
400
  fmtValue = fInfo.prefix + fmtValue;
@@ -419,9 +419,9 @@ var generateQuoteData = function(field, options, seed) {
419
419
  * @param {number=} seed Default seed for randomization
420
420
  * @return {!Object}
421
421
  */
422
- var _generate2DArray = function(fields, options, seed) {
423
- var config = {};
424
- var numRows = 0;
422
+ let _generate2DArray = function(fields, options, seed) {
423
+ let config = {};
424
+ let numRows = 0;
425
425
  if(options) {
426
426
  if(typeof options === "number") {
427
427
  numRows = config.numRows = options;
@@ -445,14 +445,14 @@ var _generate2DArray = function(fields, options, seed) {
445
445
  } else if(!Array.isArray(fields)) {
446
446
  fields = [fields + ""];
447
447
  }
448
- var fieldCount = fields.length;
448
+ let fieldCount = fields.length;
449
449
 
450
- var dataRows = [];
451
- for(var i = 0; i < numRows; ++i) {
452
- var row = [];
450
+ let dataRows = [];
451
+ for(let i = 0; i < numRows; ++i) {
452
+ let row = [];
453
453
  // Same field in a single record must be produced to the same value
454
- for(var j = 0; j < fieldCount; ++j) {
455
- var field = fields[j];
454
+ for(let j = 0; j < fieldCount; ++j) {
455
+ let field = fields[j];
456
456
  row.push(_generateFieldData(field, options, seed).value);
457
457
  }
458
458
  if(seed != null) {
@@ -472,9 +472,9 @@ var _generate2DArray = function(fields, options, seed) {
472
472
  * @param {string} str
473
473
  * @return {number}
474
474
  */
475
- var _hash = function(str) {
476
- var sum = 0;
477
- var i = str ? str.length : 0;
475
+ let _hash = function(str) {
476
+ let sum = 0;
477
+ let i = str ? str.length : 0;
478
478
  while(--i >= 0) {
479
479
  sum += str.charCodeAt(i) * (i + 0.9879);
480
480
  }
@@ -486,8 +486,8 @@ var _hash = function(str) {
486
486
  * @param {number=} seed
487
487
  * @return {!Object} Object with value and other properties
488
488
  */
489
- var _generateFieldData = function(field, options, seed) {
490
- var fInfo = getFieldInfo(field);
489
+ let _generateFieldData = function(field, options, seed) {
490
+ let fInfo = getFieldInfo(field);
491
491
  if(!fInfo.type) {
492
492
  fInfo.type = "number";
493
493
  addFieldInfo(field, fInfo);
@@ -503,9 +503,9 @@ var _generateFieldData = function(field, options, seed) {
503
503
  seed += fInfo.hash; // Make each field unique for the same seed
504
504
  }
505
505
 
506
- var min = fInfo.min != null ? fInfo.min : 100; // WARNING: Default values are non-standard values
507
- var max = fInfo.max != null ? fInfo.max : 10000;
508
- var value;
506
+ let min = fInfo.min != null ? fInfo.min : 100; // WARNING: Default values are non-standard values
507
+ let max = fInfo.max != null ? fInfo.max : 10000;
508
+ let value;
509
509
 
510
510
  if(fInfo.type === "string") {
511
511
  if(fInfo.min != null || fInfo.max != null) {
@@ -522,7 +522,7 @@ var _generateFieldData = function(field, options, seed) {
522
522
  } else if(fInfo.type === "date") {
523
523
  value = randDate(min, max, seed);
524
524
  } else if(fInfo.type === "isoDate") {
525
- var date = randDate(min, max, seed);
525
+ let date = randDate(min, max, seed);
526
526
  value = date.toISOString().slice(0, 10);
527
527
  } else if(fInfo.type === "isoDateObject") {
528
528
  value = randDate(min, max, seed);
@@ -533,7 +533,7 @@ var _generateFieldData = function(field, options, seed) {
533
533
  fInfo.field = field;
534
534
  value = fInfo.generate(fInfo, seed);
535
535
  } else { // Default is number for all unknown type
536
- var prec = fInfo.prec != null ? fInfo.prec : 0;
536
+ let prec = fInfo.prec != null ? fInfo.prec : 0;
537
537
  value = randNumber(min, max, prec, seed);
538
538
  }
539
539
  fInfo.value = value;
@@ -544,7 +544,7 @@ var _generateFieldData = function(field, options, seed) {
544
544
  /** @constructor
545
545
  * @param {number=} seed
546
546
  */
547
- var DataGenerator = function(seed) {
547
+ let DataGenerator = function(seed) {
548
548
  this._seed = seed != null ? seed : null;
549
549
  };
550
550
 
@@ -560,7 +560,7 @@ DataGenerator.prototype._seed = null;
560
560
  * @return {!Array.<Array>} 2D Array of data
561
561
  */
562
562
  DataGenerator.prototype.generate = function(fields, options) {
563
- var result = _generate2DArray(fields, options, this._seed);
563
+ let result = _generate2DArray(fields, options, this._seed);
564
564
  this._seed = result.seed;
565
565
 
566
566
  return result.data;
@@ -572,16 +572,16 @@ DataGenerator.prototype.generate = function(fields, options) {
572
572
  * @return {!Array.<Object>} Array of data object
573
573
  */
574
574
  DataGenerator.prototype.generateRecords = function(fields, options) {
575
- var result = _generate2DArray(fields, options, this._seed);
575
+ let result = _generate2DArray(fields, options, this._seed);
576
576
  this._seed = result.seed;
577
577
  fields = result.fields;
578
- var fieldCount = fields.length;
579
- var records = result.data;
580
- for(var i = records.length; --i >= 0;) {
581
- var ary = records[i];
582
- var record = {};
583
- for(var j = 0; j < fieldCount; ++j) {
584
- var field = fields[j];
578
+ let fieldCount = fields.length;
579
+ let records = result.data;
580
+ for(let i = records.length; --i >= 0;) {
581
+ let ary = records[i];
582
+ let record = {};
583
+ for(let j = 0; j < fieldCount; ++j) {
584
+ let field = fields[j];
585
585
  record[field] = ary[j];
586
586
  }
587
587
  records[i] = record;
@@ -595,7 +595,7 @@ DataGenerator.prototype.generateRecords = function(fields, options) {
595
595
  * @return {!Object} Object with value, formattedValue and other properties
596
596
  */
597
597
  DataGenerator.prototype.generateQuoteData = function(field, options) {
598
- var fInfo = generateQuoteData(field, options, this._seed);
598
+ let fInfo = generateQuoteData(field, options, this._seed);
599
599
  if(this._seed != null) {
600
600
  ++this._seed;
601
601
  }
@@ -624,7 +624,7 @@ DataGenerator.prototype.setSeed = function(seed) {
624
624
  * @return {number}
625
625
  */
626
626
  DataGenerator.prototype.randBetween = function(min, max) {
627
- var result = randBetween(min, max, this._seed);
627
+ let result = randBetween(min, max, this._seed);
628
628
  if(this._seed != null) {
629
629
  ++this._seed;
630
630
  }
@@ -637,7 +637,7 @@ DataGenerator.prototype.randBetween = function(min, max) {
637
637
  * @return {number}
638
638
  */
639
639
  DataGenerator.prototype.randInt = function(min, max) {
640
- var result = randInt(min, max, this._seed);
640
+ let result = randInt(min, max, this._seed);
641
641
  if(this._seed != null) {
642
642
  ++this._seed;
643
643
  }
@@ -649,7 +649,7 @@ DataGenerator.prototype.randInt = function(min, max) {
649
649
  * @return {number}
650
650
  */
651
651
  DataGenerator.prototype.randIndex = function(max) {
652
- var result = randIndex(max, this._seed);
652
+ let result = randIndex(max, this._seed);
653
653
  if(this._seed != null) {
654
654
  ++this._seed;
655
655
  }
@@ -663,7 +663,7 @@ DataGenerator.prototype.randIndex = function(max) {
663
663
  * @return {number}
664
664
  */
665
665
  DataGenerator.prototype.randNumber = function(min, max, prec) {
666
- var result = randNumber(min, max, prec, this._seed);
666
+ let result = randNumber(min, max, prec, this._seed);
667
667
  if(this._seed != null) {
668
668
  ++this._seed;
669
669
  }
@@ -674,7 +674,7 @@ DataGenerator.prototype.randNumber = function(min, max, prec) {
674
674
  * @return {boolean}
675
675
  */
676
676
  DataGenerator.prototype.randBoolean = function() {
677
- var result = randBoolean(this._seed);
677
+ let result = randBoolean(this._seed);
678
678
  if(this._seed != null) {
679
679
  ++this._seed;
680
680
  }
@@ -686,7 +686,7 @@ DataGenerator.prototype.randBoolean = function() {
686
686
  * @return {*}
687
687
  */
688
688
  DataGenerator.prototype.randMember = function(set) {
689
- var result = randMember(set, this._seed);
689
+ let result = randMember(set, this._seed);
690
690
  if(this._seed != null) {
691
691
  ++this._seed;
692
692
  }
@@ -699,7 +699,7 @@ DataGenerator.prototype.randMember = function(set) {
699
699
  * @return {Date}
700
700
  */
701
701
  DataGenerator.prototype.randDate = function(min, max) {
702
- var result = randDate(min, max, this._seed);
702
+ let result = randDate(min, max, this._seed);
703
703
  if(this._seed != null) {
704
704
  ++this._seed;
705
705
  }
@@ -712,7 +712,7 @@ DataGenerator.prototype.randDate = function(min, max) {
712
712
  * @return {string}
713
713
  */
714
714
  DataGenerator.prototype.randString = function(min, max) {
715
- var result = randString(min, max, this._seed);
715
+ let result = randString(min, max, this._seed);
716
716
  if(this._seed != null) {
717
717
  ++this._seed;
718
718
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @namespace
3
3
  */
4
- var DataSet = {};
4
+ let DataSet = {};
5
5
 
6
6
  DataSet.texts = [
7
7
  "If a dog and cat had a baby together that grew up and worked a desk job he'd be a Cog in the machine",
@@ -1,5 +1,5 @@
1
1
  /** @constructor */
2
- var MockArchive = function() {
2
+ let MockArchive = function() {
3
3
  this._data = {};
4
4
  };
5
5
  /** @type {!Object}
@@ -23,7 +23,7 @@ MockArchive.prototype.put = function(key, val) {
23
23
  * @return {*}
24
24
  */
25
25
  MockArchive.prototype.get = function(key) {
26
- var val = this._data[key];
26
+ let val = this._data[key];
27
27
  return (val != null) ? val : "";
28
28
  };
29
29
 
@@ -41,10 +41,10 @@ MockArchive.prototype.save = function() {
41
41
  * @return {!Array}
42
42
  */
43
43
  MockArchive.prototype.filter = function(func) {
44
- var out_ary = [];
44
+ let out_ary = [];
45
45
  if(func) {
46
- for(var key in this._data) {
47
- var val = this._data[key];
46
+ for(let key in this._data) {
47
+ let val = this._data[key];
48
48
  if(func(val)) {
49
49
  out_ary.push(val);
50
50
  }
@@ -6,7 +6,7 @@ import {mockDataAPI} from "./mockDataAPI.js";
6
6
  /** @constructor
7
7
  * @param {Object=} options
8
8
  */
9
- var MockJET = function(options) {
9
+ let MockJET = function(options) {
10
10
  this["Quotes"] = new MockQuotes();
11
11
  this["Quotes2"] = new MockQuotes2();
12
12
  this["Archive"] = new MockArchive();
@@ -1,7 +1,7 @@
1
1
  import { randIndex, generateQuoteData } from "./DataGenerator.js";
2
2
 
3
3
  /** @constructor */
4
- var MockQuotes = function() {
4
+ let MockQuotes = function() {
5
5
  };
6
6
 
7
7
  /** @public
@@ -16,7 +16,7 @@ MockQuotes.prototype.create = function(opt_id) {
16
16
  /** @constructor
17
17
  * @param {string=} opt_id
18
18
  */
19
- var MockSubscription = function(opt_id) {
19
+ let MockSubscription = function(opt_id) {
20
20
  this._onRowUpdated = this._onRowUpdated.bind(this);
21
21
 
22
22
  this._fieldMap = {};
@@ -73,7 +73,7 @@ MockSubscription._runningId = 0;
73
73
  * @return {MockSubscription}
74
74
  */
75
75
  MockSubscription.prototype.formattedFields = function(fields) {
76
- for(var i = fields.length; --i >= 0;){
76
+ for(let i = fields.length; --i >= 0;){
77
77
  this._fieldMap[fields[i]] = true;
78
78
  }
79
79
  return this;
@@ -83,7 +83,7 @@ MockSubscription.prototype.formattedFields = function(fields) {
83
83
  * @return {MockSubscription}
84
84
  */
85
85
  MockSubscription.prototype.rawFields = function(fields) {
86
- for(var i = fields.length; --i >= 0;){
86
+ for(let i = fields.length; --i >= 0;){
87
87
  this._fieldMap[fields[i]] = true;
88
88
  }
89
89
  return this;
@@ -155,13 +155,13 @@ MockSubscription.prototype._onRowUpdated = function() {
155
155
  return;
156
156
  }
157
157
  //TODO: random which fields to be updated
158
- var len = this._rics ? this._rics.length : 0;
159
- var ric;
158
+ let len = this._rics ? this._rics.length : 0;
159
+ let ric;
160
160
  if(len === 1) {
161
161
  ric = this._rics[0];
162
162
  this._updateHandler(this, ric, this._getUpdateData(ric));
163
163
  } else {
164
- for(var i = 0; i < len; ++i) {
164
+ for(let i = 0; i < len; ++i) {
165
165
  if(!randIndex(3)) {
166
166
  ric = this._rics[i];
167
167
  this._updateHandler(this, ric, this._getUpdateData(ric));
@@ -178,12 +178,12 @@ MockSubscription.prototype._onRowUpdated = function() {
178
178
  * @return {Object}
179
179
  */
180
180
  MockSubscription.prototype._getUpdateData = function(ric) {
181
- var data = {"id": this["id"]};
182
- var options = {"text": ric};
183
- for(var field in this._fieldMap) {
184
- var fInfo = generateQuoteData(field, options);
185
- var v = fInfo.value;
186
- var fv = fInfo.formattedValue;
181
+ let data = {"id": this["id"]};
182
+ let options = {"text": ric};
183
+ for(let field in this._fieldMap) {
184
+ let fInfo = generateQuoteData(field, options);
185
+ let v = fInfo.value;
186
+ let fv = fInfo.formattedValue;
187
187
  if(fInfo.changeOnly) {
188
188
  if(this._prevData[field] === v) {
189
189
  continue;