@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
@@ -5,7 +5,7 @@ import Segment from "./Segment.js";
5
5
  /** @constructor
6
6
  * @extends {EventDispatcher}
7
7
  */
8
- var SegmentCollection = function() {
8
+ let SegmentCollection = function() {
9
9
  this._onSubSegmentAdded = this._onSubSegmentAdded.bind(this);
10
10
  this._onSubSegmentRemoved = this._onSubSegmentRemoved.bind(this);
11
11
 
@@ -77,7 +77,7 @@ SegmentCollection.prototype.addSegment = function(rid, childRids) {
77
77
  console.log("child of a segment cannot be set as a segment separator");
78
78
  return false;
79
79
  }
80
- var segment = this._segments[rid] = new Segment(rid, this._shared);
80
+ let segment = this._segments[rid] = new Segment(rid, this._shared);
81
81
  segment.addEventListener("subSegmentAdded", this._onSubSegmentAdded);
82
82
  segment.addEventListener("subSegmentRemoved", this._onSubSegmentRemoved);
83
83
  ++this._segmentCount;
@@ -95,10 +95,10 @@ SegmentCollection.prototype.addSegment = function(rid, childRids) {
95
95
  * @return {boolean} Returns true if there is any change. Otherwise, returns false
96
96
  */
97
97
  SegmentCollection.prototype.addSegments = function(rids) {
98
- var rowIds = Array.isArray(rids) ? rids : [rids];
99
- var rowCount = rowIds.length;
100
- var dirty = 0;
101
- for(var i = 0; i < rowCount; ++i) {
98
+ let rowIds = Array.isArray(rids) ? rids : [rids];
99
+ let rowCount = rowIds.length;
100
+ let dirty = 0;
101
+ for(let i = 0; i < rowCount; ++i) {
102
102
  dirty |= this.addSegment(rowIds[i]);
103
103
  }
104
104
  return dirty ? true : false;
@@ -122,7 +122,7 @@ SegmentCollection.prototype.getParentRowId = function(rid) {
122
122
  * @return {boolean} Returns true if there is any change. Otherwise, returns false
123
123
  */
124
124
  SegmentCollection.prototype.removeSegment = function(rid) {
125
- var segment = this._segments[rid];
125
+ let segment = this._segments[rid];
126
126
  if(segment) {
127
127
  if(this._segmentCount <= 1) {
128
128
  return this.removeAllSegments();
@@ -130,11 +130,11 @@ SegmentCollection.prototype.removeSegment = function(rid) {
130
130
  if(segment.isSubSegment()) {
131
131
  this._removalList.push(segment.getId());
132
132
  }
133
- var subSegIds = segment.getSubSegmentIds();
133
+ let subSegIds = segment.getSubSegmentIds();
134
134
  if(subSegIds) {
135
- var len = subSegIds.length;
136
- for(var i = 0; i < len; ++i) {
137
- var subSegId = subSegIds[i];
135
+ let len = subSegIds.length;
136
+ for(let i = 0; i < len; ++i) {
137
+ let subSegId = subSegIds[i];
138
138
  if(this._segments[subSegId]) {
139
139
  this._removalList.push(subSegId);
140
140
  delete this._segments[subSegId]; // Slow
@@ -156,7 +156,7 @@ SegmentCollection.prototype.removeSegment = function(rid) {
156
156
  */
157
157
  SegmentCollection.prototype.removeAllSegments = function() {
158
158
  if(this._segmentCount) {
159
- for(var key in this._segments) {
159
+ for(let key in this._segments) {
160
160
  this._segments[key].dispose();
161
161
  }
162
162
  this._segments = {};
@@ -188,7 +188,7 @@ SegmentCollection.prototype.getSegment = function(rid) {
188
188
  * @return {Segment}
189
189
  */
190
190
  SegmentCollection.prototype.getSegmentParent = function(rid) {
191
- var parentRowId = this.getParentRowId(rid);
191
+ let parentRowId = this.getParentRowId(rid);
192
192
  if(parentRowId) {
193
193
  return this.getSegment(parentRowId);
194
194
  }
@@ -214,7 +214,7 @@ SegmentCollection.prototype.getSegmentIds = function() {
214
214
  * @return {boolean} Returns true if there is any change. Otherwise, returns false
215
215
  */
216
216
  SegmentCollection.prototype.collapseSegment = function(segmentId, bool) {
217
- var segment = this._segments[segmentId];
217
+ let segment = this._segments[segmentId];
218
218
  if(segment) {
219
219
  return segment.collapse(bool);
220
220
  }
@@ -233,9 +233,9 @@ SegmentCollection.prototype.expandSegment = function(segmentId, bool) {
233
233
  */
234
234
  SegmentCollection.prototype.expandAllSegments = function() {
235
235
  if(this._segmentCount) {
236
- var segmentSeparators = this._segments;
237
- var dirty = 0;
238
- for(var rid in segmentSeparators) {
236
+ let segmentSeparators = this._segments;
237
+ let dirty = 0;
238
+ for(let rid in segmentSeparators) {
239
239
  dirty |= segmentSeparators[rid].expand();
240
240
  }
241
241
  if(dirty) {
@@ -249,7 +249,7 @@ SegmentCollection.prototype.expandAllSegments = function() {
249
249
  * @return {boolean} Returns true if there is any change. Otherwise, returns false
250
250
  */
251
251
  SegmentCollection.prototype.isCollapsedSegment = function(segmentId) {
252
- var segment = this._segments[segmentId];
252
+ let segment = this._segments[segmentId];
253
253
  if(segment) {
254
254
  return segment.isCollapsed();
255
255
  }
@@ -261,13 +261,13 @@ SegmentCollection.prototype.isCollapsedSegment = function(segmentId) {
261
261
  SegmentCollection.prototype.getCollapsedRows = function() {
262
262
  if(this._shared.dirtyCollapsingState) {
263
263
  this._shared.dirtyCollapsingState = false;
264
- var collapsedRids = null;
265
- var count = 0;
264
+ let collapsedRids = null;
265
+ let count = 0;
266
266
  if(this._segmentCount) {
267
- var segmentSeparators = this._segments;
267
+ let segmentSeparators = this._segments;
268
268
  collapsedRids = {};
269
- for(var rid in segmentSeparators) {
270
- var segment = segmentSeparators[rid];
269
+ for(let rid in segmentSeparators) {
270
+ let segment = segmentSeparators[rid];
271
271
  if(!segment.isSubSegment()) {
272
272
  if(segment.getCollapsingStates(collapsedRids)) {
273
273
  ++count;
@@ -287,7 +287,7 @@ SegmentCollection.prototype.getCollapsedRows = function() {
287
287
  * @return {boolean} Returns true if there is any change. Otherwise, returns false
288
288
  */
289
289
  SegmentCollection.prototype.addSegmentChild = function(segmentId, rid, dataId) {
290
- var segment = this._segments[segmentId];
290
+ let segment = this._segments[segmentId];
291
291
  if(segment && !segment.isSubSegment()) {
292
292
  return segment.addChild(rid, dataId);
293
293
  }
@@ -300,7 +300,7 @@ SegmentCollection.prototype.addSegmentChild = function(segmentId, rid, dataId) {
300
300
  * @return {boolean} Returns true if there is any change. Otherwise, returns false
301
301
  */
302
302
  SegmentCollection.prototype.addSegmentChildren = function(segmentId, rids, dataIds) {
303
- var segment = this._segments[segmentId];
303
+ let segment = this._segments[segmentId];
304
304
  if(segment && !segment.isSubSegment()) {
305
305
  return segment.addChildren(rids, dataIds);
306
306
  }
@@ -312,7 +312,7 @@ SegmentCollection.prototype.addSegmentChildren = function(segmentId, rids, dataI
312
312
  * @return {boolean} Returns true if there is any change. Otherwise, returns false
313
313
  */
314
314
  SegmentCollection.prototype.containsSegmentChild = function(segmentId, rid) {
315
- var segment = this._segments[segmentId];
315
+ let segment = this._segments[segmentId];
316
316
  if(segment) {
317
317
  return segment.containsChild(rid);
318
318
  }
@@ -324,7 +324,7 @@ SegmentCollection.prototype.containsSegmentChild = function(segmentId, rid) {
324
324
  * @return {boolean} Returns true if there is any change. Otherwise, returns false
325
325
  */
326
326
  SegmentCollection.prototype.removeSegmentChild = function(segmentId, rid) {
327
- var segment = this._segments[segmentId];
327
+ let segment = this._segments[segmentId];
328
328
  if(segment) {
329
329
  return segment.removeChild(rid);
330
330
  }
@@ -336,7 +336,7 @@ SegmentCollection.prototype.removeSegmentChild = function(segmentId, rid) {
336
336
  * @return {boolean} Returns true if there is any change. Otherwise, returns false
337
337
  */
338
338
  SegmentCollection.prototype.removeSegmentChildren = function(segmentId, rids) {
339
- var segment = this._segments[segmentId];
339
+ let segment = this._segments[segmentId];
340
340
  if(segment) {
341
341
  return segment.removeChildren(rids);
342
342
  }
@@ -347,10 +347,10 @@ SegmentCollection.prototype.removeSegmentChildren = function(segmentId, rids) {
347
347
  */
348
348
  SegmentCollection.prototype.removeAllSegmentChildren = function() {
349
349
  this._shared.childToSegment = {};
350
- var segmentSeparators = this._segments;
351
- var dirty = false;
352
- for(var rid in segmentSeparators) {
353
- var segment = segmentSeparators[rid];
350
+ let segmentSeparators = this._segments;
351
+ let dirty = false;
352
+ for(let rid in segmentSeparators) {
353
+ let segment = segmentSeparators[rid];
354
354
  if(segment.removeAllChildren()) {
355
355
  dirty = true;
356
356
  }
@@ -368,19 +368,19 @@ SegmentCollection.prototype.removeAllSegmentChildren = function() {
368
368
  * @param {Array.<string>} rids
369
369
  */
370
370
  SegmentCollection.prototype.fillSegment = function(segmentId, rids) {
371
- var rowCount = Array.isArray(rids) ? rids.length : 0;
371
+ let rowCount = Array.isArray(rids) ? rids.length : 0;
372
372
  if(!rowCount) {
373
373
  return;
374
374
  }
375
- var segmentSeparators = this._segments;
376
- var curSegment = segmentSeparators[segmentId];
375
+ let segmentSeparators = this._segments;
376
+ let curSegment = segmentSeparators[segmentId];
377
377
  if(curSegment && !curSegment.isSubSegment()) {
378
- var segmentAt = rids.indexOf(segmentId);
378
+ let segmentAt = rids.indexOf(segmentId);
379
379
  if(segmentAt >= 0) {
380
380
  curSegment.removeAllChildren();
381
- for(var r = segmentAt + 1; r < rowCount; ++r) {
382
- var rid = rids[r];
383
- var segmentSeparator = segmentSeparators[rid];
381
+ for(let r = segmentAt + 1; r < rowCount; ++r) {
382
+ let rid = rids[r];
383
+ let segmentSeparator = segmentSeparators[rid];
384
384
  if(segmentSeparator) {
385
385
  break;
386
386
  }
@@ -396,13 +396,13 @@ SegmentCollection.prototype.fillSegment = function(segmentId, rids) {
396
396
  SegmentCollection.prototype.fillSegments = function(rids) {
397
397
  this._shared.childToSegment = {};
398
398
 
399
- var rowCount = Array.isArray(rids) ? rids.length : 0;
400
- var segmentSeparators = this._segments;
401
- var curSegment = null;
402
- var change = false;
403
- for(var r = 0; r < rowCount; ++r) {
404
- var rid = rids[r];
405
- var segmentSeparator = segmentSeparators[rid];
399
+ let rowCount = Array.isArray(rids) ? rids.length : 0;
400
+ let segmentSeparators = this._segments;
401
+ let curSegment = null;
402
+ let change = false;
403
+ for(let r = 0; r < rowCount; ++r) {
404
+ let rid = rids[r];
405
+ let segmentSeparator = segmentSeparators[rid];
406
406
  if(segmentSeparator && !segmentSeparator.isSubSegment()) {
407
407
  curSegment = segmentSeparator;
408
408
  curSegment.removeAllChildren();
@@ -417,20 +417,20 @@ SegmentCollection.prototype.fillSegments = function(rids) {
417
417
  * @param {Array.<string>} rids
418
418
  */
419
419
  SegmentCollection.prototype.calcSegmentOrder = function(rids) {
420
- var segmentList = this._segmentList;
420
+ let segmentList = this._segmentList;
421
421
  if(segmentList) {
422
422
  segmentList.length = 0;
423
423
  } else {
424
424
  segmentList = this._segmentList = [];
425
425
  }
426
426
 
427
- var ridCount = rids ? rids.length : 0;
428
- var segmentSeparators = this._segments;
429
- var segmentCount = this._segmentCount;
430
- var order = 0;
431
- for(var i = 0; i < ridCount; ++i) {
432
- var rid = rids[i];
433
- var segment = segmentSeparators[rid];
427
+ let ridCount = rids ? rids.length : 0;
428
+ let segmentSeparators = this._segments;
429
+ let segmentCount = this._segmentCount;
430
+ let order = 0;
431
+ for(let i = 0; i < ridCount; ++i) {
432
+ let rid = rids[i];
433
+ let segment = segmentSeparators[rid];
434
434
  if(segment) {
435
435
  if(!segment.isSubSegment()) {
436
436
  this._segmentList.push(segment);
@@ -448,20 +448,20 @@ SegmentCollection.prototype.calcSegmentOrder = function(rids) {
448
448
  * @return {Array.<number>} Returns Array of segment values, if there are at least one segment, otherwise returns null
449
449
  */ //
450
450
  SegmentCollection.prototype.getSegmentValues = function(rids, partial) {
451
- var rowCount = rids ? rids.length : 0;
451
+ let rowCount = rids ? rids.length : 0;
452
452
  if(!rowCount) {
453
453
  return null;
454
454
  }
455
- var segmentSeparators = this._segments;
456
- var childToSegmentId = this._shared.childToSegment;
457
- var curSegment = null;
458
- var prevSegment = null;
459
- var segmentValues = new Array(rowCount);
460
- var segmentVal = 0;
461
- var highestVal = -10;
462
- var offset = 0;
463
- for(var r = 0; r < rowCount; ++r) {
464
- var rid = rids[r];
455
+ let segmentSeparators = this._segments;
456
+ let childToSegmentId = this._shared.childToSegment;
457
+ let curSegment = null;
458
+ let prevSegment = null;
459
+ let segmentValues = new Array(rowCount);
460
+ let segmentVal = 0;
461
+ let highestVal = -10;
462
+ let offset = 0;
463
+ for(let r = 0; r < rowCount; ++r) {
464
+ let rid = rids[r];
465
465
  curSegment = segmentSeparators[rid];
466
466
  if(curSegment) { // segment separator
467
467
  segmentVal = curSegment.getOrder() * 100;
@@ -473,7 +473,7 @@ SegmentCollection.prototype.getSegmentValues = function(rids, partial) {
473
473
  }
474
474
  }
475
475
  } else {
476
- var parentId = childToSegmentId[rid];
476
+ let parentId = childToSegmentId[rid];
477
477
  if(parentId) { // segment member
478
478
  curSegment = segmentSeparators[parentId];
479
479
  segmentVal = curSegment.getOrder() * 100;
@@ -500,13 +500,13 @@ SegmentCollection.prototype.getSegmentValues = function(rids, partial) {
500
500
  * @return {string}
501
501
  */
502
502
  SegmentCollection.prototype.logStructure = function() {
503
- var segmentList = this._segmentList;
503
+ let segmentList = this._segmentList;
504
504
  if(!segmentList) {
505
505
  return "";
506
506
  }
507
- var segmentCount = segmentList.length;
508
- var lines = [];
509
- for(var i = 0; i < segmentCount; ++i) {
507
+ let segmentCount = segmentList.length;
508
+ let lines = [];
509
+ for(let i = 0; i < segmentCount; ++i) {
510
510
  segmentList[i].log(lines);
511
511
  }
512
512
 
@@ -516,10 +516,10 @@ SegmentCollection.prototype.logStructure = function() {
516
516
  * @return {string}
517
517
  */
518
518
  SegmentCollection.prototype.logRowIdMap = function() {
519
- var lines = [];
520
- var childToSegmentId = this._shared.childToSegment;
521
- for(var rid in childToSegmentId) {
522
- var segmentId = childToSegmentId[rid];
519
+ let lines = [];
520
+ let childToSegmentId = this._shared.childToSegment;
521
+ for(let rid in childToSegmentId) {
522
+ let segmentId = childToSegmentId[rid];
523
523
  lines.push(rid + " > " + segmentId);
524
524
  }
525
525
 
@@ -533,7 +533,7 @@ SegmentCollection.prototype.logRowIdMap = function() {
533
533
  * @return {boolean}
534
534
  */
535
535
  SegmentCollection.prototype.setSegmentClassification = function(segmentId, fields) {
536
- var segment = this._segments[segmentId];
536
+ let segment = this._segments[segmentId];
537
537
  if(segment) {
538
538
  if(segment.setClassification(fields)) {
539
539
  if(segment.getClassification()) {
@@ -566,9 +566,9 @@ SegmentCollection.prototype.classify = function(rows) {
566
566
  }
567
567
  this._classification = this._classifierChanged = false;
568
568
 
569
- var segmentSeparators = this._segments;
570
- for(var rid in segmentSeparators) {
571
- var segment = this._segments[rid];
569
+ let segmentSeparators = this._segments;
570
+ for(let rid in segmentSeparators) {
571
+ let segment = this._segments[rid];
572
572
  if(!segment.isSubSegment()) {
573
573
  if(segment.getClassification()) {
574
574
  this._classification = true;
@@ -596,9 +596,9 @@ SegmentCollection.prototype.classify = function(rows) {
596
596
  * @param {!Object} e
597
597
  */
598
598
  SegmentCollection.prototype._onSubSegmentAdded = function(e) {
599
- var rid = e["rid"];
599
+ let rid = e["rid"];
600
600
  if(!this._segments[rid]) {
601
- var segment = /** @type{Segment} */(e["segment"]);
601
+ let segment = /** @type{Segment} */(e["segment"]);
602
602
  this._insertionList.push(segment);
603
603
  this._segments[rid] = segment;
604
604
  this._segmentCount++;
@@ -613,7 +613,7 @@ SegmentCollection.prototype._onSubSegmentAdded = function(e) {
613
613
  * @param {!Object} e
614
614
  */
615
615
  SegmentCollection.prototype._onSubSegmentRemoved = function(e) {
616
- var rid = e["rid"];
616
+ let rid = e["rid"];
617
617
  this.removeSegment(rid);
618
618
  };
619
619
 
@@ -17,7 +17,7 @@ import ColumnStats from "./ColumnStats.js"; // eslint-disable-line
17
17
  * @extends {EventDispatcher}
18
18
  * @param {WrappedView~Options} options
19
19
  */
20
- var WrappedView = function(options) {
20
+ let WrappedView = function(options) {
21
21
  this._onDataChanged = this._onDataChanged.bind(this);
22
22
  this._onWrapSizeChanged = this._onWrapSizeChanged.bind(this);
23
23
 
@@ -71,7 +71,7 @@ WrappedView.prototype._dataConflator = null;
71
71
  */
72
72
  WrappedView.prototype._onDataChanged = function(e) {
73
73
  if(this._dv) {
74
- var rids = this._dv.getVisibleRowIds(true);
74
+ let rids = this._dv.getVisibleRowIds(true);
75
75
  if(this._refreshRids(rids)) {
76
76
  if(!e["globalChange"]) {
77
77
  e["globalChange"] = true; // TODO: Optimize how we to dispatch globalChange
@@ -94,11 +94,11 @@ WrappedView.prototype._onWrapSizeChanged = function(e) {
94
94
  * @return {boolean} Returns true if there is any change
95
95
  */
96
96
  WrappedView.prototype._refreshRids = function(rids) {
97
- var dirty = false;
97
+ let dirty = false;
98
98
  if(this._dv && Array.isArray(rids)) {
99
- var wrapSize = this.getWrapSize();
99
+ let wrapSize = this.getWrapSize();
100
100
  if(wrapSize > 0) {
101
- var startIndex = wrapSize * this._wrapIndex;
101
+ let startIndex = wrapSize * this._wrapIndex;
102
102
 
103
103
  if(startIndex < rids.length) {
104
104
  dirty = true;
@@ -145,12 +145,12 @@ WrappedView.prototype.getRowData = function(rid) {
145
145
  * @return {!Array}
146
146
  */
147
147
  WrappedView.prototype.getColumnData = function(cid, inclNonDataRow) {
148
- var rids = this.getAllRowIds(true, inclNonDataRow);
148
+ let rids = this.getAllRowIds(true, inclNonDataRow);
149
149
 
150
- var rows = [];
151
- var len = rids.length;
152
- for(var r = 0; r < len; ++r) {
153
- var rowData = this._dt.getRowData(rids[r]);
150
+ let rows = [];
151
+ let len = rids.length;
152
+ for(let r = 0; r < len; ++r) {
153
+ let rowData = this._dt.getRowData(rids[r]);
154
154
  if(rowData) {
155
155
  rows.push(rowData[cid]);
156
156
  } else if(inclNonDataRow) {
@@ -182,11 +182,11 @@ WrappedView.prototype._toRowId = function(rowRef) {
182
182
  * @return {!Array.<string>}
183
183
  */
184
184
  WrappedView.prototype._toRowIds = function(rowRefs) {
185
- var rowCount = Array.isArray(rowRefs) ? rowRefs.length : 0;
186
- var ary = new Array(rowCount);
187
- var rids = this._rids;
188
- for(var r = 0; r < rowCount; ++r) {
189
- var rowRef = rowRefs[r];
185
+ let rowCount = Array.isArray(rowRefs) ? rowRefs.length : 0;
186
+ let ary = new Array(rowCount);
187
+ let rids = this._rids;
188
+ for(let r = 0; r < rowCount; ++r) {
189
+ let rowRef = rowRefs[r];
190
190
  if(typeof rowRef === "number") {
191
191
  ary[r] = rids[rowRef] || "";
192
192
  } else {
@@ -323,7 +323,7 @@ WrappedView.prototype.setColumnData = function(cid, valueList, opt_ridList) {
323
323
  * @return {boolean} Return true if there is any change, and false otherwise
324
324
  */
325
325
  WrappedView.prototype.setDataAt = function(rowIndex, cid, value) {
326
- var rid = this.getRowId(rowIndex);
326
+ let rid = this.getRowId(rowIndex);
327
327
  if(rid && this._dt) {
328
328
  return this._dt.setData(rid, cid, value);
329
329
  }
@@ -337,7 +337,7 @@ WrappedView.prototype.setDataAt = function(rowIndex, cid, value) {
337
337
  * @return {boolean} Return true if there is any change, and false otherwise
338
338
  */
339
339
  WrappedView.prototype.setRowDataAt = function(rowIndex, values, opt_eventArg) {
340
- var rid = this.getRowId(rowIndex);
340
+ let rid = this.getRowId(rowIndex);
341
341
  return this.setRowData(rid, values, opt_eventArg);
342
342
  };
343
343
 
@@ -348,7 +348,7 @@ WrappedView.prototype.setRowDataAt = function(rowIndex, values, opt_eventArg) {
348
348
  * @return {string} Return Row id that has been inserted or changed
349
349
  */
350
350
  WrappedView.prototype.insertRow = function(rowRef, opt_values, opt_rid) { // Data changed event may be dispatched
351
- var rowId = this._toRowId(rowRef);
351
+ let rowId = this._toRowId(rowRef);
352
352
  return this._dv.insertRow(rowId, opt_values, opt_rid);
353
353
  };
354
354
 
@@ -381,9 +381,9 @@ WrappedView.prototype.removeRows = function(rowRefs) {
381
381
  * move(ary, 1, 0); // [1, 0, 2] Move index 1 to the position before index 0
382
382
  */
383
383
  WrappedView.prototype.moveRow = function(fromRef, toRef) {
384
- var toRid = this._toRowId(toRef);
385
- var fromIndices = /** @type{!Array.<number>} */(Array.isArray(fromRef) ? fromRef : [fromRef]);
386
- var fromRids = this._toRowIds(fromIndices);
384
+ let toRid = this._toRowId(toRef);
385
+ let fromIndices = /** @type{!Array.<number>} */(Array.isArray(fromRef) ? fromRef : [fromRef]);
386
+ let fromRids = this._toRowIds(fromIndices);
387
387
 
388
388
  // if(this._dt.hasSegmentation()) {
389
389
  // this.synchronizeRowOrder();
@@ -459,8 +459,8 @@ WrappedView.prototype.sortOnce = function(cid, opt_sortOrder) {
459
459
  * customLogic = function(a, b, sortOrder) {
460
460
  * return (a - b) * sortOrder; // for numeric comparison
461
461
  * };
462
- * var dt = new DataTable();
463
- * var dv = new DataView(dt);
462
+ * let dt = new DataTable();
463
+ * let dv = new DataView(dt);
464
464
  * dv.setSortingLogic(customLogic);
465
465
  * dv.sort("Column id", "ascending");
466
466
  */
@@ -510,7 +510,7 @@ WrappedView.prototype.hideRows = function(rowRefs, opt_show) {
510
510
  * @public
511
511
  */
512
512
  WrappedView.prototype.showRows = function(rowRefs, opt_show) {
513
- var rids = this._toRowIds(rowRefs);
513
+ let rids = this._toRowIds(rowRefs);
514
514
  this._dv.showRows(rids, opt_show);
515
515
  };
516
516
  /** Unhide all rows
@@ -840,7 +840,7 @@ WrappedView.prototype.getGroupRows = function () {
840
840
  * @return {number}
841
841
  */
842
842
  WrappedView.prototype.getGroupLevel = function (rowRef) {
843
- var rowId = this._toRowId(rowRef);
843
+ let rowId = this._toRowId(rowRef);
844
844
  return this._dv.getGroupLevel(rowId);
845
845
  };
846
846
 
@@ -967,7 +967,7 @@ WrappedView.prototype.removeRowExpansion = function(rid) {
967
967
  * @param {number=} count=1
968
968
  */
969
969
  WrappedView.prototype.toggleRowExpansion = function(rowRef, force, count) {
970
- var rid = this._toRowId(rowRef);
970
+ let rid = this._toRowId(rowRef);
971
971
  this._dv.toggleRowExpansion(rid, force, count);
972
972
  };
973
973
  /** @public
@@ -1045,7 +1045,7 @@ WrappedView.prototype.searchAll = function(searchLogic, opt_out) {
1045
1045
  * @return {number} Row index
1046
1046
  */
1047
1047
  WrappedView.prototype.searchPrev = function(rowRef, searchLogic) {
1048
- var rid = this._toRowId(rowRef);
1048
+ let rid = this._toRowId(rowRef);
1049
1049
  return this._dv.searchPrev(rid, searchLogic);
1050
1050
  };
1051
1051
  /**
@@ -1055,7 +1055,7 @@ WrappedView.prototype.searchPrev = function(rowRef, searchLogic) {
1055
1055
  * @return {number} Row index
1056
1056
  */
1057
1057
  WrappedView.prototype.searchNext = function(rowRef, searchLogic) {
1058
- var rid = this._toRowId(rowRef);
1058
+ let rid = this._toRowId(rowRef);
1059
1059
  return this._dv.searchNext(rid, searchLogic);
1060
1060
  };
1061
1061
 
@@ -1097,7 +1097,7 @@ WrappedView.prototype.synchronizeRowOrder = function() {
1097
1097
  * @return {boolean} Return true if there is any change
1098
1098
  */
1099
1099
  WrappedView.prototype.setSegmentSeparator = function(rowRef, enabled) {
1100
- var rowId = this._toRowId(rowRef);
1100
+ let rowId = this._toRowId(rowRef);
1101
1101
  return this._dv.setSegmentSeparator(rowId, enabled);
1102
1102
  };
1103
1103
  /**
@@ -1137,7 +1137,7 @@ WrappedView.prototype.getSegmentParentRowId = function(rid) {
1137
1137
  * @return {boolean} Return true if there is any change
1138
1138
  */
1139
1139
  WrappedView.prototype.collapseSegment = function(rowRef, collapsed) {
1140
- var rid = this._toRowId(rowRef);
1140
+ let rid = this._toRowId(rowRef);
1141
1141
  return this._dv.collapseSegment(rid, collapsed);
1142
1142
  };
1143
1143
  /** @public
@@ -1164,7 +1164,7 @@ WrappedView.prototype.setSegmentCollapsingLogic = function() {};
1164
1164
  * @return {boolean} Return true if only the given row is a collapsed segment separator
1165
1165
  */
1166
1166
  WrappedView.prototype.isSegmentCollapsed = function(rowRef) {
1167
- var rid = this._toRowId(rowRef);
1167
+ let rid = this._toRowId(rowRef);
1168
1168
  return this._dv.isSegmentCollapsed(rid);
1169
1169
  };
1170
1170
  /** Remove existing segment children and fill the segments with all contnet rows before the next segment separator
@@ -1172,7 +1172,7 @@ WrappedView.prototype.isSegmentCollapsed = function(rowRef) {
1172
1172
  * @param {string|number} segmentRef Row id or row index
1173
1173
  */
1174
1174
  WrappedView.prototype.fillSegment = function(segmentRef) {
1175
- var rid = this._toRowId(segmentRef);
1175
+ let rid = this._toRowId(segmentRef);
1176
1176
  this._dv.fillSegment(rid);
1177
1177
  };
1178
1178
  /** Remove all existing segment children in each segment and fill the segments with all contnet rows before the next segment separator
@@ -1187,8 +1187,8 @@ WrappedView.prototype.fillSegments = function() {
1187
1187
  * @return {boolean} Return true if there is any change
1188
1188
  */
1189
1189
  WrappedView.prototype.addSegmentChild = function(segmentRef, rowRef) {
1190
- var segmentId = this._toRowId(segmentRef);
1191
- var rowId = this._toRowId(rowRef);
1190
+ let segmentId = this._toRowId(segmentRef);
1191
+ let rowId = this._toRowId(rowRef);
1192
1192
  return this._dv.addSegmentChild(segmentId, rowId);
1193
1193
  };
1194
1194
  /** @public
@@ -1197,8 +1197,8 @@ WrappedView.prototype.addSegmentChild = function(segmentRef, rowRef) {
1197
1197
  * @return {boolean} Return true if there is any change
1198
1198
  */
1199
1199
  WrappedView.prototype.addSegmentChildren = function(segmentRef, rowRefs) {
1200
- var segmentId = this._toRowId(segmentRef);
1201
- var rowIds = this._toRowIds(rowRefs);
1200
+ let segmentId = this._toRowId(segmentRef);
1201
+ let rowIds = this._toRowIds(rowRefs);
1202
1202
  return this._dv.addSegmentChildren(segmentId, rowIds);
1203
1203
  };
1204
1204
  /** @public
@@ -1207,8 +1207,8 @@ WrappedView.prototype.addSegmentChildren = function(segmentRef, rowRefs) {
1207
1207
  * @return {boolean} Return true if there is any change
1208
1208
  */
1209
1209
  WrappedView.prototype.removeSegmentChild = function(segmentRef, rowRef) {
1210
- var segmentId = this._toRowId(segmentRef);
1211
- var rowId = this._toRowId(rowRef);
1210
+ let segmentId = this._toRowId(segmentRef);
1211
+ let rowId = this._toRowId(rowRef);
1212
1212
  return this._dv.removeSegmentChild(segmentId, rowId);
1213
1213
  };
1214
1214
  /** @public
@@ -1217,8 +1217,8 @@ WrappedView.prototype.removeSegmentChild = function(segmentRef, rowRef) {
1217
1217
  * @return {boolean} Return true if there is any change
1218
1218
  */
1219
1219
  WrappedView.prototype.removeSegmentChildren = function(segmentRef, rowRefs) {
1220
- var segmentId = this._toRowId(segmentRef);
1221
- var rowIds = this._toRowIds(rowRefs);
1220
+ let segmentId = this._toRowId(segmentRef);
1221
+ let rowIds = this._toRowIds(rowRefs);
1222
1222
  return this._dv.removeSegmentChildren(segmentId, rowIds);
1223
1223
  };
1224
1224
  /** @public
@@ -1296,7 +1296,7 @@ WrappedView.prototype.dump = function(opt_options) {
1296
1296
  //}
1297
1297
  dv.log({"rowCount": 10}); // Showing 10 records
1298
1298
  dv.log({"getter": function(rowData, colName){
1299
- var complexData = rowData[colName];
1299
+ let complexData = rowData[colName];
1300
1300
  return complextData.someProperty;
1301
1301
  }});
1302
1302
  */