@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
@@ -6,7 +6,7 @@ import EventDispatcher from "../../../tr-grid-util/es6/EventDispatcher.js";
6
6
  * @param {string} rid
7
7
  * @param {!Object} sharedObj
8
8
  */
9
- var Segment = function(rid, sharedObj) {
9
+ let Segment = function(rid, sharedObj) {
10
10
  this._rid = rid;
11
11
  this._children = {};
12
12
  this._shared = sharedObj;
@@ -114,11 +114,11 @@ Segment.prototype.dispose = function() {
114
114
  this._disposed = true;
115
115
 
116
116
  this.removeAllEventListeners();
117
- var segmentNames = this._subSegNames;
117
+ let segmentNames = this._subSegNames;
118
118
  if(segmentNames) {
119
- var segmentCount = segmentNames.length;
120
- var segmentMap = this._subSegMap;
121
- for(var i = 0; i < segmentCount; ++i) {
119
+ let segmentCount = segmentNames.length;
120
+ let segmentMap = this._subSegMap;
121
+ for(let i = 0; i < segmentCount; ++i) {
122
122
  segmentMap[segmentNames[i]].dispose();
123
123
  }
124
124
  this._subSegMap = this._subSegNames = null;
@@ -150,16 +150,16 @@ Segment.prototype.getParentId = function() {
150
150
  * @return {Array.<string>}
151
151
  */
152
152
  Segment.prototype.getSubSegmentIds = function(out_ary) {
153
- var segmentNames = this._subSegNames;
153
+ let segmentNames = this._subSegNames;
154
154
  if(segmentNames) {
155
155
  if(!out_ary) {
156
156
  out_ary = [];
157
157
  }
158
- var segmentCount = segmentNames.length;
159
- var segmentMap = this._subSegMap;
160
- for(var i = 0; i < segmentCount; ++i) {
161
- var segmentName = segmentNames[i];
162
- var segment = segmentMap[segmentName];
158
+ let segmentCount = segmentNames.length;
159
+ let segmentMap = this._subSegMap;
160
+ for(let i = 0; i < segmentCount; ++i) {
161
+ let segmentName = segmentNames[i];
162
+ let segment = segmentMap[segmentName];
163
163
  out_ary.push(segment.getId());
164
164
  segment.getSubSegmentIds(out_ary);
165
165
  }
@@ -176,10 +176,12 @@ Segment.prototype.getSubSegmentIds = function(out_ary) {
176
176
  Segment.prototype.addChild = function(rid, dataId) {
177
177
  if(rid) {
178
178
  this._shared.childToSegment[rid] = this._rid;
179
- if(this._collapsed) {
180
- this._shared.dirtyCollapsingState = true; // TODO: Check if we need to update this only when new child is added
181
- }
182
- if(!this._children[rid]) {
179
+ if(this._children[rid]) {
180
+ this._children[rid] = dataId || rid; // Update data id
181
+ } else {
182
+ if(this._collapsed) {
183
+ this._shared.dirtyCollapsingState = true; // TODO: Check if we need to update this only when new child is added
184
+ }
183
185
  this._children[rid] = dataId || rid;
184
186
  ++this._childCount;
185
187
  return true;
@@ -193,10 +195,10 @@ Segment.prototype.addChild = function(rid, dataId) {
193
195
  * @return {boolean}
194
196
  */
195
197
  Segment.prototype.addChildren = function(rids, dataIds) {
196
- var rowIds = Array.isArray(rids) ? rids : [rids];
197
- var rowCount = rowIds.length;
198
- var dirty = 0;
199
- var i;
198
+ let rowIds = Array.isArray(rids) ? rids : [rids];
199
+ let rowCount = rowIds.length;
200
+ let dirty = 0;
201
+ let i;
200
202
  if(dataIds != null) {
201
203
  dataIds = Array.isArray(dataIds) ? dataIds : [dataIds];
202
204
  for(i = 0; i < rowCount; ++i) {
@@ -231,7 +233,7 @@ Segment.prototype.removeChild = function(rid) {
231
233
  return false; // The specified rid is not a child of this segment
232
234
  }
233
235
 
234
- var objMap = this._shared.childToSegment;
236
+ let objMap = this._shared.childToSegment;
235
237
  delete objMap[rid];
236
238
  delete this._children[rid]; // Slow
237
239
  --this._childCount;
@@ -252,10 +254,10 @@ Segment.prototype.removeChildren = function(rids) {
252
254
  if(!this._childCount) {
253
255
  return false;
254
256
  }
255
- var rowIds = Array.isArray(rids) ? rids : [rids];
256
- var rowCount = rowIds.length;
257
- var dirty = 0;
258
- for(var i = 0; i < rowCount; ++i) {
257
+ let rowIds = Array.isArray(rids) ? rids : [rids];
258
+ let rowCount = rowIds.length;
259
+ let dirty = 0;
260
+ for(let i = 0; i < rowCount; ++i) {
259
261
  dirty |= this.removeChild(rowIds[i]);
260
262
  }
261
263
  return dirty ? true : false;
@@ -270,9 +272,9 @@ Segment.prototype.removeAllChildren = function() {
270
272
  if(!this._childCount) {
271
273
  return false;
272
274
  }
273
- var objMap = this._shared.childToSegment;
274
- var chdr = this._children;
275
- for(var rid in chdr) {
275
+ let objMap = this._shared.childToSegment;
276
+ let chdr = this._children;
277
+ for(let rid in chdr) {
276
278
  if(objMap[rid]) {
277
279
  delete objMap[rid]; // TODO: Check if we need to do this
278
280
  }
@@ -322,12 +324,12 @@ Segment.prototype.setClassification = function(fields) {
322
324
  if(this._subSegLevel) {
323
325
  return false; // non-root segment cannot be classified
324
326
  }
325
- var classifiers = null;
327
+ let classifiers = null;
326
328
  if(this._subSegDef) {
327
329
  classifiers = this._subSegDef.classifiers;
328
330
  }
329
331
 
330
- var newClassifiers = null;
332
+ let newClassifiers = null;
331
333
  if(fields) {
332
334
  if(typeof fields === "string") {
333
335
  newClassifiers = [fields];
@@ -335,11 +337,11 @@ Segment.prototype.setClassification = function(fields) {
335
337
  newClassifiers = fields;
336
338
  }
337
339
  }
338
- var i;
339
- var fieldCount = newClassifiers ? newClassifiers.length : 0;
340
+ let i;
341
+ let fieldCount = newClassifiers ? newClassifiers.length : 0;
340
342
 
341
343
  if(fieldCount) {
342
- var curCount = classifiers ? classifiers.length : 0;
344
+ let curCount = classifiers ? classifiers.length : 0;
343
345
  if(curCount === fieldCount) { // Check duplication
344
346
  for(i = 0; i < fieldCount; ++i) {
345
347
  if(newClassifiers[i] !== classifiers[i]) {
@@ -375,11 +377,11 @@ Segment.prototype.setClassification = function(fields) {
375
377
  * @return {boolean}
376
378
  */
377
379
  Segment.prototype.classify = function(rows) {
378
- var classifiers = this._subSegDef ? this._subSegDef.classifiers : null;
379
- var classifierCount = classifiers ? classifiers.length : 0;
380
+ let classifiers = this._subSegDef ? this._subSegDef.classifiers : null;
381
+ let classifierCount = classifiers ? classifiers.length : 0;
380
382
 
381
- var segmentNames = this._subSegNames;
382
- var segmentCount = segmentNames ? segmentNames.length : 0;
383
+ let segmentNames = this._subSegNames;
384
+ let segmentCount = segmentNames ? segmentNames.length : 0;
383
385
 
384
386
  if(!segmentCount) {
385
387
  if(this._subSegLevel >= classifierCount) {
@@ -387,18 +389,18 @@ Segment.prototype.classify = function(rows) {
387
389
  }
388
390
  }
389
391
 
390
- var sharedObj = this._shared;
392
+ let sharedObj = this._shared;
391
393
  if(this._collapsed) {
392
394
  sharedObj.dirtyCollapsingState = true;
393
395
  }
394
396
 
395
397
  // Prepare existing sub segments for checking change in its members
396
- var i;
397
- var segmentName = "";
398
- var nonExistenceGroups = {};
399
- var removalCount = 0;
400
- var segmentMap = this._subSegMap;
401
- var segment = null;
398
+ let i;
399
+ let segmentName = "";
400
+ let nonExistenceGroups = {};
401
+ let removalCount = 0;
402
+ let segmentMap = this._subSegMap;
403
+ let segment = null;
402
404
  if(segmentCount) {
403
405
  removalCount = segmentCount;
404
406
  for(i = 0; i < removalCount; ++i) {
@@ -417,21 +419,21 @@ Segment.prototype.classify = function(rows) {
417
419
  }
418
420
 
419
421
  // Loop through row children and assign them to their corresponding sub segment
420
- var isRootSegment = !this._subSegLevel;
421
- var rid;
422
- var children = this._children;
422
+ let isRootSegment = !this._subSegLevel;
423
+ let rid;
424
+ let children = this._children;
423
425
  if(this._subSegLevel < classifierCount && rows) {
424
426
  if(!segmentMap) {
425
427
  segmentMap = this._subSegMap = {};
426
428
  segmentNames = this._subSegNames = [];
427
429
  }
428
430
 
429
- var classifier = classifiers[this._subSegLevel];
431
+ let classifier = classifiers[this._subSegLevel];
430
432
 
431
433
  for(rid in children) {
432
- var dataId = children[rid];
433
- var record = rows[dataId];
434
- var val = record ? record[classifier] : null; // WARNING: row could already be removed
434
+ let dataId = children[rid];
435
+ let record = rows[dataId];
436
+ let val = record ? record[classifier] : null; // WARNING: row could already be removed
435
437
 
436
438
  sharedObj.childToSegment[rid] = this._rid; // Relocate child in case of it has been moved to a non existence group
437
439
 
@@ -480,7 +482,7 @@ Segment.prototype.classify = function(rows) {
480
482
  segment = segmentMap[segmentName];
481
483
  delete segmentMap[segmentName];
482
484
  // TODO: Slow
483
- var at = segmentNames.indexOf(segmentName);
485
+ let at = segmentNames.indexOf(segmentName);
484
486
  if(at >= 0) {
485
487
  segmentNames.splice(at, 1);
486
488
  }
@@ -512,7 +514,7 @@ Segment.prototype.classify = function(rows) {
512
514
  if(isRootSegment) { // If this is a root segment
513
515
  if(this._subSegDef) {
514
516
  if(segmentCount) {
515
- var subSegments = this._subSegDef.subSegments = [];
517
+ let subSegments = this._subSegDef.subSegments = [];
516
518
  this.getAllSubSegments(subSegments);
517
519
  subSegments.forEach(Segment._assignSubSegmentOrder);
518
520
  } else {
@@ -543,7 +545,7 @@ Segment.prototype.isSubSegment = function() {
543
545
  */
544
546
  Segment.prototype.getFirstAncestor = function() {
545
547
  if(this._subSegLevel && this._subSegDef) {
546
- var ancestor = this._subSegDef.root;
548
+ let ancestor = this._subSegDef.root;
547
549
  return /** @type{Segment} */(ancestor) || null;
548
550
  }
549
551
  return null;
@@ -553,15 +555,15 @@ Segment.prototype.getFirstAncestor = function() {
553
555
  * @return {Array.<Segment>}
554
556
  */
555
557
  Segment.prototype.getAllSubSegments = function(out_ary) {
556
- var segmentNames = this._subSegNames;
558
+ let segmentNames = this._subSegNames;
557
559
  if(segmentNames) {
558
560
  if(!out_ary) {
559
561
  out_ary = [];
560
562
  }
561
- var segmentMap = this._subSegMap;
562
- var segmentCount = segmentNames.length;
563
- for(var i = 0; i < segmentCount; ++i) {
564
- var segment = segmentMap[segmentNames[i]];
563
+ let segmentMap = this._subSegMap;
564
+ let segmentCount = segmentNames.length;
565
+ for(let i = 0; i < segmentCount; ++i) {
566
+ let segment = segmentMap[segmentNames[i]];
565
567
  out_ary.push(segment);
566
568
  segment.getAllSubSegments(out_ary);
567
569
  }
@@ -583,7 +585,7 @@ Segment.prototype.setRowData = function(rows, clsSource) {
583
585
  if(!rows) {
584
586
  return;
585
587
  }
586
- var row = rows[this._rid];
588
+ let row = rows[this._rid];
587
589
  if(!row) {
588
590
  row = rows[this._rid] = {};
589
591
  }
@@ -596,7 +598,7 @@ Segment.prototype.setRowData = function(rows, clsSource) {
596
598
  row = clsSource[this._rid] = {};
597
599
  }
598
600
 
599
- var segment = this;
601
+ let segment = this;
600
602
  while(segment && segment.isSubSegment()) {
601
603
  segment.getSubSegmentName(row);
602
604
  segment = segment._subSegParent;
@@ -608,8 +610,8 @@ Segment.prototype.setRowData = function(rows, clsSource) {
608
610
  */
609
611
  Segment.prototype.getSubSegmentName = function(row) {
610
612
  if(row && this._subSegLevel) {
611
- var classifiers = this.getClassification();
612
- var field = classifiers[this._subSegLevel - 1];
613
+ let classifiers = this.getClassification();
614
+ let field = classifiers[this._subSegLevel - 1];
613
615
  if(field) {
614
616
  row[field] = this._subSegName;
615
617
  }
@@ -649,7 +651,7 @@ Segment.prototype.isCollapsed = function() {
649
651
  * @return {boolean}
650
652
  */
651
653
  Segment.prototype.getCollapsingStates = function(objMap, parentState) {
652
- var segmentNames = this._subSegNames;
654
+ let segmentNames = this._subSegNames;
653
655
  if(!this._subSegLevel) { // Only root segment
654
656
  if(!segmentNames) { // No sub segment
655
657
  if(!this._collapsed) {
@@ -661,7 +663,7 @@ Segment.prototype.getCollapsingStates = function(objMap, parentState) {
661
663
  if(!objMap) {
662
664
  objMap = {};
663
665
  }
664
- var dirty = false;
666
+ let dirty = false;
665
667
  if(this._subSegLevel) { // Sub segments are also subjected to collapsing
666
668
  if(parentState) {
667
669
  objMap[this._rid] = true;
@@ -669,20 +671,20 @@ Segment.prototype.getCollapsingStates = function(objMap, parentState) {
669
671
  }
670
672
  }
671
673
  if(this._childCount) {
672
- var collapsed = parentState || this._collapsed;
674
+ let collapsed = parentState || this._collapsed;
673
675
  if(segmentNames) {
674
- var segmentMap = this._subSegMap;
675
- var segmentCount = segmentNames.length;
676
- for(var i = 0; i < segmentCount; ++i) {
677
- var segment = segmentMap[segmentNames[i]];
676
+ let segmentMap = this._subSegMap;
677
+ let segmentCount = segmentNames.length;
678
+ for(let i = 0; i < segmentCount; ++i) {
679
+ let segment = segmentMap[segmentNames[i]];
678
680
  objMap[segment.getId()] = !!parentState;
679
681
  if(segment.getCollapsingStates(objMap, collapsed)) {
680
682
  dirty = true;
681
683
  }
682
684
  }
683
685
  } else if(collapsed) {
684
- var chdr = this._children;
685
- for(var rid in chdr) {
686
+ let chdr = this._children;
687
+ for(let rid in chdr) {
686
688
  objMap[rid] = collapsed;
687
689
  }
688
690
  dirty = true;
@@ -696,7 +698,7 @@ Segment.prototype.getCollapsingStates = function(objMap, parentState) {
696
698
  */
697
699
  Segment.prototype.getOrder = function() {
698
700
  if(this._subSegLevel) {
699
- var ancestor = this.getFirstAncestor();
701
+ let ancestor = this.getFirstAncestor();
700
702
  if(ancestor) {
701
703
  // WARNING: this._order cannot be greater than 9999
702
704
  return ancestor.getOrder() + this._order;
@@ -710,9 +712,9 @@ Segment.prototype.getOrder = function() {
710
712
  */
711
713
  Segment.prototype.getLastOrder = function() {
712
714
  if(this._subSegDef) {
713
- var subSegments = this._subSegDef.subSegments;
715
+ let subSegments = this._subSegDef.subSegments;
714
716
  if(subSegments) {
715
- var lastSegment = subSegments[subSegments.length - 1];
717
+ let lastSegment = subSegments[subSegments.length - 1];
716
718
  if(lastSegment) {
717
719
  return lastSegment.getOrder();
718
720
  }
@@ -736,29 +738,29 @@ Segment._tabs = null;
736
738
  * @return {Array.<string>} lines
737
739
  */
738
740
  Segment.prototype.log = function(lines) {
739
- var i;
740
- var tabs = Segment._tabs;
741
+ let i;
742
+ let tabs = Segment._tabs;
741
743
  if(!tabs) {
742
744
  tabs = Segment._tabs = [];
743
- var tabCh = "";
745
+ let tabCh = "";
744
746
  for(i = 0; i < 11; ++i) {
745
747
  tabs[i] = tabCh;
746
748
  tabCh += " ";
747
749
  }
748
750
  }
749
- var collapsedCh = this._collapsed ? "+ " : "- ";
751
+ let collapsedCh = this._collapsed ? "+ " : "- ";
750
752
  lines.push(tabs[this._subSegLevel] + collapsedCh + this._rid);
751
753
 
752
- var segmentNames = this._subSegNames;
754
+ let segmentNames = this._subSegNames;
753
755
  if(segmentNames) {
754
- var segmentCount = segmentNames.length;
755
- var segmentMap = this._subSegMap;
756
+ let segmentCount = segmentNames.length;
757
+ let segmentMap = this._subSegMap;
756
758
  for(i = 0; i < segmentCount; ++i) {
757
759
  segmentMap[segmentNames[i]].log(lines);
758
760
  }
759
761
  } else if(this._childCount) {
760
- var indent = tabs[this._subSegLevel + 1];
761
- for(var rid in this._children) {
762
+ let indent = tabs[this._subSegLevel + 1];
763
+ for(let rid in this._children) {
762
764
  lines.push(indent + "- " + rid);
763
765
  }
764
766
  }
@@ -24,6 +24,8 @@ declare class SegmentCollection extends EventDispatcher {
24
24
 
25
25
  public getSegment(rid: string): Segment|null;
26
26
 
27
+ public getSegmentParent(rid: string): Segment|null;
28
+
27
29
  public getSegments(): { [key: string]: Segment }|null;
28
30
 
29
31
  public getSegmentIds(): (string)[];