@refinitiv-ui/efx-grid 6.0.91 → 6.0.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/lib/column-dragging/es6/ColumnDragging.d.ts +1 -1
  2. package/lib/column-dragging/es6/ColumnDragging.js +144 -34
  3. package/lib/core/dist/core.js +2410 -2621
  4. package/lib/core/dist/core.min.js +1 -1
  5. package/lib/core/es6/data/ColumnStats.js +14 -14
  6. package/lib/core/es6/data/DataCache.js +118 -118
  7. package/lib/core/es6/data/DataTable.d.ts +3 -1
  8. package/lib/core/es6/data/DataTable.js +208 -190
  9. package/lib/core/es6/data/DataView.d.ts +1 -1
  10. package/lib/core/es6/data/DataView.js +291 -291
  11. package/lib/core/es6/data/Segment.js +79 -79
  12. package/lib/core/es6/data/SegmentCollection.js +81 -81
  13. package/lib/core/es6/data/WrappedView.js +41 -41
  14. package/lib/core/es6/grid/Core.js +635 -635
  15. package/lib/core/es6/grid/ILayoutGrid.js +1 -1
  16. package/lib/core/es6/grid/LayoutGrid.js +183 -183
  17. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +91 -91
  18. package/lib/core/es6/grid/components/Cell.js +29 -29
  19. package/lib/core/es6/grid/components/CellFloatingPanel.js +11 -11
  20. package/lib/core/es6/grid/components/CellSpan.js +7 -7
  21. package/lib/core/es6/grid/components/CellSpans.js +36 -34
  22. package/lib/core/es6/grid/components/Column.js +40 -40
  23. package/lib/core/es6/grid/components/ElementWrapper.js +17 -17
  24. package/lib/core/es6/grid/components/HScrollbar.js +31 -31
  25. package/lib/core/es6/grid/components/Scrollbar.js +77 -77
  26. package/lib/core/es6/grid/components/StretchedCells.js +49 -49
  27. package/lib/core/es6/grid/components/VScrollbar.js +11 -11
  28. package/lib/core/es6/grid/components/VirtualItems.js +3 -3
  29. package/lib/core/es6/grid/event/EventDispatcher.js +9 -9
  30. package/lib/core/es6/grid/event/EventListeners.js +4 -4
  31. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +186 -186
  32. package/lib/core/es6/grid/util/Conflator.js +4 -4
  33. package/lib/core/es6/grid/util/Reverter.js +1 -1
  34. package/lib/core/es6/grid/util/SectionSettings.js +20 -20
  35. package/lib/core/es6/grid/util/SelectionList.js +23 -23
  36. package/lib/core/es6/grid/util/TrackLayout.js +74 -74
  37. package/lib/core/es6/grid/util/Virtualizer.js +15 -15
  38. package/lib/core/es6/grid/util/util.js +20 -20
  39. package/lib/core/es6/index.d.ts +0 -2
  40. package/lib/core/es6/index.js +0 -3
  41. package/lib/grid/index.js +1 -1
  42. package/lib/rt-grid/dist/rt-grid.js +193 -70
  43. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  44. package/lib/rt-grid/es6/Grid.js +46 -30
  45. package/lib/rt-grid/es6/RowDefinition.d.ts +2 -1
  46. package/lib/rt-grid/es6/RowDefinition.js +74 -16
  47. package/lib/tr-grid-cell-selection/es6/CellSelection.js +56 -1
  48. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +3 -1
  49. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +29 -1
  50. package/lib/tr-grid-util/es6/CellPainter.js +94 -93
  51. package/lib/tr-grid-util/es6/Conflator.js +4 -4
  52. package/lib/tr-grid-util/es6/CoralItems.js +6 -6
  53. package/lib/tr-grid-util/es6/DateTime.js +39 -39
  54. package/lib/tr-grid-util/es6/Deferred.js +5 -5
  55. package/lib/tr-grid-util/es6/Delay.js +1 -1
  56. package/lib/tr-grid-util/es6/Dom.js +26 -26
  57. package/lib/tr-grid-util/es6/DragUI.js +17 -17
  58. package/lib/tr-grid-util/es6/ElementObserver.js +12 -12
  59. package/lib/tr-grid-util/es6/ElementWrapper.js +2 -2
  60. package/lib/tr-grid-util/es6/ElfDate.js +4 -4
  61. package/lib/tr-grid-util/es6/ElfUtil.js +37 -37
  62. package/lib/tr-grid-util/es6/EventDispatcher.js +12 -12
  63. package/lib/tr-grid-util/es6/ExpanderIcon.js +6 -6
  64. package/lib/tr-grid-util/es6/ExpressionParser.js +43 -43
  65. package/lib/tr-grid-util/es6/Ext.js +6 -6
  66. package/lib/tr-grid-util/es6/FieldFormatter.js +17 -17
  67. package/lib/tr-grid-util/es6/FilterBuilder.js +57 -57
  68. package/lib/tr-grid-util/es6/FilterOperators.d.ts +12 -1
  69. package/lib/tr-grid-util/es6/FilterOperators.js +13 -2
  70. package/lib/tr-grid-util/es6/GridPlugin.js +86 -86
  71. package/lib/tr-grid-util/es6/GroupDefinitions.js +90 -90
  72. package/lib/tr-grid-util/es6/Icon.js +4 -4
  73. package/lib/tr-grid-util/es6/MouseDownTrait.js +6 -6
  74. package/lib/tr-grid-util/es6/MultiTableManager.js +68 -68
  75. package/lib/tr-grid-util/es6/NumberFormatter.js +22 -22
  76. package/lib/tr-grid-util/es6/PercentBar.js +17 -17
  77. package/lib/tr-grid-util/es6/Perf.js +5 -5
  78. package/lib/tr-grid-util/es6/Popup.js +42 -42
  79. package/lib/tr-grid-util/es6/RangeBar.js +5 -5
  80. package/lib/tr-grid-util/es6/RequestQueue.js +5 -5
  81. package/lib/tr-grid-util/es6/RowPainter.js +23 -23
  82. package/lib/tr-grid-util/es6/SubTable.js +94 -94
  83. package/lib/tr-grid-util/es6/Table.js +51 -51
  84. package/lib/tr-grid-util/es6/TextHighlighter.js +49 -49
  85. package/lib/tr-grid-util/es6/TickCodes.js +2 -2
  86. package/lib/tr-grid-util/es6/Timer.js +2 -2
  87. package/lib/tr-grid-util/es6/TouchProxy.js +7 -7
  88. package/lib/tr-grid-util/es6/Util.js +50 -50
  89. package/lib/tr-grid-util/es6/formula/ADCService.js +2 -2
  90. package/lib/tr-grid-util/es6/formula/ADCSubscription.js +19 -19
  91. package/lib/tr-grid-util/es6/formula/AdFinService.js +2 -2
  92. package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +19 -19
  93. package/lib/tr-grid-util/es6/formula/Engine.js +56 -56
  94. package/lib/tr-grid-util/es6/formula/Formula.js +62 -62
  95. package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +3 -3
  96. package/lib/tr-grid-util/es6/formula/Realtime.js +15 -15
  97. package/lib/tr-grid-util/es6/formula/RealtimeService.js +15 -15
  98. package/lib/tr-grid-util/es6/formula/TSIService.js +2 -2
  99. package/lib/tr-grid-util/es6/formula/TSISubscription.js +104 -104
  100. package/lib/tr-grid-util/es6/formula/VariableToken.js +20 -20
  101. package/lib/tr-grid-util/es6/formula/functions/AdFin.js +10 -10
  102. package/lib/tr-grid-util/es6/formula/functions/Excel.js +1 -1
  103. package/lib/tr-grid-util/es6/formula/functions/Info.js +2 -2
  104. package/lib/tr-grid-util/es6/formula/functions/Internal.js +5 -5
  105. package/lib/tr-grid-util/es6/formula/functions/Logic.js +5 -5
  106. package/lib/tr-grid-util/es6/formula/functions/Math.js +46 -46
  107. package/lib/tr-grid-util/es6/formula/functions/Statistics.js +27 -27
  108. package/lib/tr-grid-util/es6/formula/functions/Text.js +19 -19
  109. package/lib/tr-grid-util/es6/index.js +1 -1
  110. package/lib/tr-grid-util/es6/jet/Adc.js +36 -36
  111. package/lib/tr-grid-util/es6/jet/CollectionDict.js +11 -11
  112. package/lib/tr-grid-util/es6/jet/DataGenerator.js +95 -95
  113. package/lib/tr-grid-util/es6/jet/DataSet.js +1 -1
  114. package/lib/tr-grid-util/es6/jet/MockArchive.js +5 -5
  115. package/lib/tr-grid-util/es6/jet/MockJET.js +1 -1
  116. package/lib/tr-grid-util/es6/jet/MockQuotes.js +13 -13
  117. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +100 -100
  118. package/lib/tr-grid-util/es6/jet/MockRTK.js +4 -4
  119. package/lib/tr-grid-util/es6/jet/MockUtil.js +2 -2
  120. package/lib/tr-grid-util/es6/jet/index.js +1 -1
  121. package/lib/tr-grid-util/es6/jet/mockDataAPI.js +15 -15
  122. package/lib/tr-grid-util/es6/locale/translation-de.js +1 -1
  123. package/lib/tr-grid-util/es6/locale/translation-en.js +1 -1
  124. package/lib/tr-grid-util/es6/locale/translation-ja.js +1 -1
  125. package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +1 -1
  126. package/lib/tr-grid-util/es6/locale/translation-zh.js +1 -1
  127. package/lib/tr-grid-util/es6/locale/translation.js +1 -1
  128. package/lib/types/es6/ColumnDragging.d.ts +1 -1
  129. package/lib/types/es6/ColumnGrouping.d.ts +3 -1
  130. package/lib/types/es6/Core/data/DataTable.d.ts +4 -0
  131. package/lib/types/es6/Core/data/DataView.d.ts +2 -0
  132. package/lib/types/es6/Core/data/SegmentCollection.d.ts +2 -0
  133. package/lib/types/es6/Core/index.d.ts +0 -2
  134. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -1
  135. package/lib/versions.json +4 -4
  136. package/package.json +1 -1
  137. package/lib/core/es6/grid/util/ElementFrameWork.d.ts +0 -18
  138. package/lib/core/es6/grid/util/ElementFrameWork.js +0 -227
  139. package/lib/core/es6/grid/util/HttpRequest.d.ts +0 -53
  140. package/lib/core/es6/grid/util/HttpRequest.js +0 -371
  141. package/lib/core/es6/grid/util/PercentBar.d.ts +0 -43
  142. package/lib/core/es6/grid/util/PercentBar.js +0 -390
  143. package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +0 -41
  144. package/lib/core/es6/grid/util/PercentBarRenderer.js +0 -316
  145. package/lib/core/es6/grid/util/RangeBar.d.ts +0 -25
  146. package/lib/core/es6/grid/util/RangeBar.js +0 -255
  147. package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +0 -18
  148. package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +0 -53
  149. package/lib/types/es6/Core/grid/util/PercentBar.d.ts +0 -43
  150. package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +0 -41
  151. package/lib/types/es6/Core/grid/util/RangeBar.d.ts +0 -25
@@ -2,7 +2,7 @@ import { cloneObject } from "./Util.js";
2
2
 
3
3
  /** @constructor
4
4
  */
5
- var GroupDefinitions = function () {
5
+ let GroupDefinitions = function () {
6
6
  this._groupMap = {};
7
7
  this._childToParent = {};
8
8
  };
@@ -36,14 +36,14 @@ GroupDefinitions.getGroupId = function(groupDef) {
36
36
  * @return {number} Return total number of parents. Return 0 if there is no parent.
37
37
  */
38
38
  GroupDefinitions.calcTreeDepth = function (groupMap, groupDef) {
39
- var curDepth = -1;
40
- var curNode = groupDef;
39
+ let curDepth = -1;
40
+ let curNode = groupDef;
41
41
  while(curNode) { // WARNING: infinite loop could occured, if parentId is cycle back to one of the child group
42
42
  if(++curDepth > 15) {
43
43
  console.log("WARNING: Infinite loop detected during column group creation");
44
44
  break;
45
45
  }
46
- var parentId = curNode.parentId;
46
+ let parentId = curNode.parentId;
47
47
  curNode = groupMap[parentId];
48
48
  }
49
49
  return curDepth;
@@ -54,22 +54,22 @@ GroupDefinitions.calcTreeDepth = function (groupMap, groupDef) {
54
54
  * @return {Array.<string>}
55
55
  */
56
56
  GroupDefinitions.getLeafDescendants = function (groupMap, groupId) {
57
- var groupDef = groupMap[groupId];
57
+ let groupDef = groupMap[groupId];
58
58
  if(!groupDef) {
59
59
  return null;
60
60
  }
61
61
 
62
- var leaves = [];
63
- var unvisitedGroups = [groupDef];
64
- var visitedCount = 0;
65
- var visitedMap = {};
62
+ let leaves = [];
63
+ let unvisitedGroups = [groupDef];
64
+ let visitedCount = 0;
65
+ let visitedMap = {};
66
66
  while(visitedCount < unvisitedGroups.length) {
67
67
  groupDef = unvisitedGroups[visitedCount++];
68
68
  visitedMap[groupDef.id] = true;
69
- var chdr = groupDef.children;
70
- var len = chdr ? chdr.length : 0;
71
- for(var i = 0; i < len; ++i) {
72
- var childId = chdr[i];
69
+ let chdr = groupDef.children;
70
+ let len = chdr ? chdr.length : 0;
71
+ for(let i = 0; i < len; ++i) {
72
+ let childId = chdr[i];
73
73
  groupDef = groupMap[childId];
74
74
  if(groupDef) {
75
75
  if(!visitedMap[groupDef.id]) { // Prevent infinite loop
@@ -90,7 +90,7 @@ GroupDefinitions.getLeafDescendants = function (groupMap, groupId) {
90
90
  * @return {Object} Return a new object with guaranteed children property
91
91
  */
92
92
  GroupDefinitions._cloneObject = function(obj) {
93
- var newObj = cloneObject(obj);
93
+ let newObj = cloneObject(obj);
94
94
  if(Array.isArray(newObj.children)) { // This is to prevent modification from the outside source
95
95
  newObj.children = newObj.children.slice();
96
96
  } else {
@@ -106,7 +106,7 @@ GroupDefinitions._cloneObject = function(obj) {
106
106
  * @return {Object} Return a new object with guaranteed children property
107
107
  */
108
108
  GroupDefinitions._toGroupDefinition = function(obj, groupId) {
109
- var groupDef = null;
109
+ let groupDef = null;
110
110
  if(obj) {
111
111
  if(Array.isArray(obj)) {
112
112
  groupDef = {
@@ -129,11 +129,11 @@ GroupDefinitions._toGroupDefinition = function(obj, groupId) {
129
129
  * @return {string}
130
130
  */
131
131
  GroupDefinitions.prototype.toString = function() {
132
- var groupMap = this._groupMap;
133
- var lines = [];
132
+ let groupMap = this._groupMap;
133
+ let lines = [];
134
134
  lines.push("=== groupDefs ===");
135
- for(var key in groupMap) {
136
- var group = groupMap[key];
135
+ for(let key in groupMap) {
136
+ let group = groupMap[key];
137
137
  lines.push(key + ": " + JSON.stringify(group, ["id", "parentId", "children"]));
138
138
  }
139
139
 
@@ -166,9 +166,9 @@ GroupDefinitions.prototype.getDefinition = GroupDefinitions.prototype.getGroup;
166
166
  * @return {!Array.<Object>}
167
167
  */
168
168
  GroupDefinitions.prototype.getGroups = function () {
169
- var groupDefs = [];
170
- var groupMap = this._groupMap;
171
- for(var key in groupMap) {
169
+ let groupDefs = [];
170
+ let groupMap = this._groupMap;
171
+ for(let key in groupMap) {
172
172
  groupDefs.push(groupMap[key]);
173
173
  }
174
174
  return groupDefs;
@@ -190,11 +190,11 @@ GroupDefinitions.prototype.getGroupMap = function () {
190
190
  * @return {!Object.<string, Object>}
191
191
  */
192
192
  GroupDefinitions.prototype.cloneGroupMap = function () {
193
- var groupMap = this._groupMap;
194
- var outMap = {};
195
- for(var groupId in groupMap) {
196
- var groupDef = groupMap[groupId];
197
- var obj = GroupDefinitions._cloneObject(groupDef);
193
+ let groupMap = this._groupMap;
194
+ let outMap = {};
195
+ for(let groupId in groupMap) {
196
+ let groupDef = groupMap[groupId];
197
+ let obj = GroupDefinitions._cloneObject(groupDef);
198
198
  outMap[groupId] = obj;
199
199
  }
200
200
  return outMap;
@@ -203,18 +203,18 @@ GroupDefinitions.prototype.cloneGroupMap = function () {
203
203
  * @public
204
204
  */
205
205
  GroupDefinitions.prototype.rebuildMap = function () {
206
- var groupMap = this._groupMap;
207
- var childToParent = this._childToParent = {};
206
+ let groupMap = this._groupMap;
207
+ let childToParent = this._childToParent = {};
208
208
 
209
209
  // Create child to parent map
210
- var groupIds = Object.keys(groupMap);
211
- var grpCount = groupIds.length;
212
- var i, groupId;
210
+ let groupIds = Object.keys(groupMap);
211
+ let grpCount = groupIds.length;
212
+ let i, groupId;
213
213
  for(i = 0; i < grpCount; ++i) {
214
214
  groupId = groupIds[i];
215
- var chdr = groupMap[groupId].children;
216
- var childCount = chdr ? chdr.length : 0;
217
- for (var j = 0; j < childCount; j++) {
215
+ let chdr = groupMap[groupId].children;
216
+ let childCount = chdr ? chdr.length : 0;
217
+ for (let j = 0; j < childCount; j++) {
218
218
  childToParent[chdr[j]] = groupId;
219
219
  }
220
220
  }
@@ -222,7 +222,7 @@ GroupDefinitions.prototype.rebuildMap = function () {
222
222
  // Apply a parent id to group definition to make it easier to find depth
223
223
  for(i = 0; i < grpCount; ++i) {
224
224
  groupId = groupIds[i];
225
- var parentId = childToParent[groupId];
225
+ let parentId = childToParent[groupId];
226
226
  if(parentId) {
227
227
  groupMap[groupId].parentId = parentId;
228
228
  }
@@ -235,7 +235,7 @@ GroupDefinitions.prototype.rebuildMap = function () {
235
235
  * @return {Array.<string>}
236
236
  */
237
237
  GroupDefinitions.prototype.getGroupChildren = function (groupId) {
238
- var groupDef = this._groupMap[groupId];
238
+ let groupDef = this._groupMap[groupId];
239
239
  return groupDef ? groupDef.children : null;
240
240
  };
241
241
  /** Get all non-group descendants of the given group id.
@@ -261,12 +261,12 @@ GroupDefinitions.prototype.getRootGroup = function (groupId) {
261
261
  if (!groupId) {
262
262
  return null;
263
263
  }
264
- var groupMap = this._groupMap;
265
- var groupDef = groupMap[groupId] || null;
264
+ let groupMap = this._groupMap;
265
+ let groupDef = groupMap[groupId] || null;
266
266
  // TODO: Support column id
267
267
  if(groupDef) {
268
268
  while (groupDef.parentId) {
269
- var parentDef = groupMap[groupDef.parentId];
269
+ let parentDef = groupMap[groupDef.parentId];
270
270
  if(parentDef) {
271
271
  groupDef = parentDef;
272
272
  } else {
@@ -289,10 +289,10 @@ GroupDefinitions.prototype.getParentGroup = function (childId) {
289
289
  */
290
290
  GroupDefinitions.prototype.getParentIds = function(childId) {
291
291
  if (childId && typeof childId === "string") {
292
- var groupId = this._childToParent[childId];
292
+ let groupId = this._childToParent[childId];
293
293
  if (groupId) {
294
- var groupIds = [groupId];
295
- var group = this._groupMap[groupId];
294
+ let groupIds = [groupId];
295
+ let group = this._groupMap[groupId];
296
296
  while (group && group.parentId) {
297
297
  group = this._groupMap[group.parentId];
298
298
  if (group) {
@@ -310,9 +310,9 @@ GroupDefinitions.prototype.getParentIds = function(childId) {
310
310
  * @return {string}
311
311
  */
312
312
  GroupDefinitions.prototype.getParentId = function (childId, groupLevel) {
313
- var parentId = this._childToParent[childId];
313
+ let parentId = this._childToParent[childId];
314
314
  if(groupLevel != null) {
315
- var currentLevel = this.getGroupLevel(parentId);
315
+ let currentLevel = this.getGroupLevel(parentId);
316
316
  while(currentLevel > groupLevel && parentId){
317
317
  parentId = this._childToParent[parentId];
318
318
  currentLevel--;
@@ -327,7 +327,7 @@ GroupDefinitions.prototype.getParentId = function (childId, groupLevel) {
327
327
  * @return {boolean}
328
328
  */
329
329
  GroupDefinitions.prototype.removeAllGroups = function () {
330
- for(var groupId in this._groupMap) { // eslint-disable-line
330
+ for(let groupId in this._groupMap) { // eslint-disable-line
331
331
  this._groupMap = {};
332
332
  this._childToParent = {};
333
333
  return true;
@@ -340,13 +340,13 @@ GroupDefinitions.prototype.removeAllGroups = function () {
340
340
  */
341
341
  GroupDefinitions.prototype.setGroups = function (groupDefs) {
342
342
  // Clear existing group structure
343
- var groupMap = this._groupMap = {};
343
+ let groupMap = this._groupMap = {};
344
344
 
345
345
  // Create group map
346
- var grpCount = groupDefs ? groupDefs.length : 0;
347
- for (var i = 0; i < grpCount; i++) {
348
- var groupDef = groupDefs[i];
349
- var groupId = groupDef.id;
346
+ let grpCount = groupDefs ? groupDefs.length : 0;
347
+ for (let i = 0; i < grpCount; i++) {
348
+ let groupDef = groupDefs[i];
349
+ let groupId = groupDef.id;
350
350
  if(groupId) {
351
351
  groupMap[groupId] = GroupDefinitions._cloneObject(groupDef);
352
352
  }
@@ -360,7 +360,7 @@ GroupDefinitions.prototype.setGroups = function (groupDefs) {
360
360
  * @return {string} Return group ID
361
361
  */
362
362
  GroupDefinitions.prototype.addGroup = function (groupDef) {
363
- var groupId = GroupDefinitions.getGroupId(groupDef);
363
+ let groupId = GroupDefinitions.getGroupId(groupDef);
364
364
  if(groupId) {
365
365
  return this.setGroup(groupId, groupDef);
366
366
  }
@@ -371,7 +371,7 @@ GroupDefinitions.prototype.addGroup = function (groupDef) {
371
371
  * @return {boolean}
372
372
  */
373
373
  GroupDefinitions.prototype.removeGroup = function (groupId) {
374
- var curDef = this._groupMap[groupId];
374
+ let curDef = this._groupMap[groupId];
375
375
  if(curDef) {
376
376
  this.removeAllChildren(groupId);
377
377
  this.unsetParent(groupId);
@@ -393,25 +393,25 @@ GroupDefinitions.prototype.setGroup = function (groupId, groupDef) {
393
393
  }
394
394
 
395
395
  if(groupDef) {
396
- var newDef = GroupDefinitions._toGroupDefinition(groupDef, groupId);
396
+ let newDef = GroupDefinitions._toGroupDefinition(groupDef, groupId);
397
397
  this._ungroupChildren(newDef.children);
398
398
 
399
- var curDef = this._groupMap[groupId];
399
+ let curDef = this._groupMap[groupId];
400
400
  if(curDef) { // Replace
401
401
  this.removeAllChildren(groupId);
402
402
  }
403
- var parentDef = this._childToParent[groupId];
403
+ let parentDef = this._childToParent[groupId];
404
404
  if(parentDef) {
405
405
  newDef.parentId = parentDef.id;
406
406
  }
407
407
  this._groupMap[groupId] = newDef;
408
408
 
409
- var chdr = newDef.children; // newDef is guaranteed to have children property
410
- var len = chdr.length;
411
- for(var i = 0; i < len; ++i) {
412
- var childId = chdr[i];
409
+ let chdr = newDef.children; // newDef is guaranteed to have children property
410
+ let len = chdr.length;
411
+ for(let i = 0; i < len; ++i) {
412
+ let childId = chdr[i];
413
413
  this._childToParent[childId] = groupId;
414
- var childDef = this._groupMap[childId];
414
+ let childDef = this._groupMap[childId];
415
415
  if(childDef) {
416
416
  childDef.parentId = groupId;
417
417
  }
@@ -431,8 +431,8 @@ GroupDefinitions.prototype.setGroup = function (groupId, groupDef) {
431
431
  */
432
432
  GroupDefinitions.prototype._ungroupChildren = function(children) {
433
433
  if (Array.isArray(children)) {
434
- var len = children.length;
435
- for(var i = 0; i < len; ++i) {
434
+ let len = children.length;
435
+ for(let i = 0; i < len; ++i) {
436
436
  this.unsetParent(children[i]);
437
437
  }
438
438
  }
@@ -445,9 +445,9 @@ GroupDefinitions.prototype._ungroupChildren = function(children) {
445
445
  * @return {boolean}
446
446
  */
447
447
  GroupDefinitions.prototype.hasGroupChild = function (parentId, childId) {
448
- var groupDef = this._groupMap[parentId];
448
+ let groupDef = this._groupMap[parentId];
449
449
  if(childId && groupDef) {
450
- var chdr = groupDef.children;
450
+ let chdr = groupDef.children;
451
451
  if(chdr) {
452
452
  return chdr.indexOf(childId) >= 0; // TODO: Use childToParent map to improve performance
453
453
  }
@@ -465,8 +465,8 @@ GroupDefinitions.prototype.contains = function (groupId, childId) {
465
465
  if(groupId === childId) {
466
466
  return true;
467
467
  }
468
- var levelLimit = 20;
469
- var parentId = this._childToParent[childId];
468
+ let levelLimit = 20;
469
+ let parentId = this._childToParent[childId];
470
470
  while(parentId && levelLimit) { // WARNING: Circular dependency could happen
471
471
  if(groupId === parentId) {
472
472
  return true;
@@ -484,15 +484,15 @@ GroupDefinitions.prototype.contains = function (groupId, childId) {
484
484
  * @return {boolean}
485
485
  */
486
486
  GroupDefinitions.prototype.addGroupChild = function (parentId, childId, position) {
487
- var groupDef = this._groupMap[parentId];
487
+ let groupDef = this._groupMap[parentId];
488
488
 
489
489
  if(childId && groupDef) {
490
- var chdr = groupDef.children;
490
+ let chdr = groupDef.children;
491
491
  if(chdr && chdr.indexOf(childId) < 0) {
492
492
  this.unsetParent(childId); // Remove previous parent
493
493
  // Add new child to group structures
494
494
  this._childToParent[childId] = parentId;
495
- var childDef = this._groupMap[childId];
495
+ let childDef = this._groupMap[childId];
496
496
  if(childDef) {
497
497
  childDef.parentId = parentId;
498
498
  }
@@ -527,20 +527,20 @@ GroupDefinitions.prototype.removeGroupChild = function (parentId, childId) {
527
527
  * @return {boolean}
528
528
  */
529
529
  GroupDefinitions.prototype.unsetParent = function (childId) {
530
- var parentId = this._childToParent[childId];
530
+ let parentId = this._childToParent[childId];
531
531
  if(!parentId) {
532
532
  return false;
533
533
  }
534
534
  this._childToParent[childId] = "";
535
- var childDef = this._groupMap[childId];
535
+ let childDef = this._groupMap[childId];
536
536
  if(childDef) {
537
537
  childDef.parentId = "";
538
538
  }
539
- var parentDef = this._groupMap[parentId];
539
+ let parentDef = this._groupMap[parentId];
540
540
  if(parentDef) {
541
- var chdr = parentDef.children;
541
+ let chdr = parentDef.children;
542
542
  if(chdr && chdr.length) {
543
- var at = chdr.indexOf(childId);
543
+ let at = chdr.indexOf(childId);
544
544
  if (at >= 0) {
545
545
  chdr.splice(at, 1); // splice is slow
546
546
  }
@@ -554,18 +554,18 @@ GroupDefinitions.prototype.unsetParent = function (childId) {
554
554
  * @return {boolean}
555
555
  */
556
556
  GroupDefinitions.prototype.removeAllChildren = function(groupId) {
557
- var grpDef = this._groupMap[groupId];
557
+ let grpDef = this._groupMap[groupId];
558
558
  if(grpDef) {
559
- var chdr = grpDef.children;
560
- var len = chdr ? chdr.length : 0;
559
+ let chdr = grpDef.children;
560
+ let len = chdr ? chdr.length : 0;
561
561
  if(len) {
562
562
  grpDef.children = [];
563
- for(var i = 0; i < len; ++i) {
564
- var childId = chdr[i];
563
+ for(let i = 0; i < len; ++i) {
564
+ let childId = chdr[i];
565
565
  if(this._childToParent[childId]) {
566
566
  this._childToParent[childId] = "";
567
567
  }
568
- var childDef = this._groupMap[childId];
568
+ let childDef = this._groupMap[childId];
569
569
  if(childDef) {
570
570
  childDef.parentId = "";
571
571
  }
@@ -582,20 +582,20 @@ GroupDefinitions.prototype.removeAllChildren = function(groupId) {
582
582
  * @return {boolean}
583
583
  */
584
584
  GroupDefinitions.prototype.setGroupChildren = function (groupId, newChildList) {
585
- var groupDef = this._groupMap[groupId];
585
+ let groupDef = this._groupMap[groupId];
586
586
  if(groupDef) {
587
587
  if(Array.isArray(newChildList)) {
588
- var chdr = newChildList.slice();
588
+ let chdr = newChildList.slice();
589
589
  this._ungroupChildren(chdr);
590
590
  this.removeAllChildren(groupId);
591
591
  groupDef.children = chdr;
592
592
 
593
- var parentId = groupDef.id;
594
- var len = chdr.length;
595
- for(var i = 0; i < len; ++i) {
596
- var childId = chdr[i];
593
+ let parentId = groupDef.id;
594
+ let len = chdr.length;
595
+ for(let i = 0; i < len; ++i) {
596
+ let childId = chdr[i];
597
597
  this._childToParent[childId] = parentId;
598
- var childDef = this._groupMap[childId];
598
+ let childDef = this._groupMap[childId];
599
599
  if(childDef) {
600
600
  childDef.parentId = parentId;
601
601
  }
@@ -615,7 +615,7 @@ GroupDefinitions.prototype.setGroupChildren = function (groupId, newChildList) {
615
615
  * @return {string}
616
616
  */
617
617
  GroupDefinitions.prototype.getGroupName = function (groupId) {
618
- var groupDef = this._groupMap[groupId];
618
+ let groupDef = this._groupMap[groupId];
619
619
  if(groupDef) {
620
620
  return groupDef.name || "";
621
621
  }
@@ -627,7 +627,7 @@ GroupDefinitions.prototype.getGroupName = function (groupId) {
627
627
  * @return {boolean}
628
628
  */
629
629
  GroupDefinitions.prototype.setGroupName = function (groupId, groupName) {
630
- var groupDef = this._groupMap[groupId];
630
+ let groupDef = this._groupMap[groupId];
631
631
  if(groupDef) {
632
632
  if(groupDef.name !== groupName) {
633
633
  groupDef.name = groupName;
@@ -1,5 +1,5 @@
1
1
  /** @namespace */
2
- var Icon = {};
2
+ let Icon = {};
3
3
 
4
4
  /** @public
5
5
  * @function
@@ -8,7 +8,7 @@ var Icon = {};
8
8
  * @return {!Element} ef-icon element
9
9
  */
10
10
  Icon.create = function(iconName, className) {
11
- var icon = document.createElement("ef-icon");
11
+ let icon = document.createElement("ef-icon");
12
12
  if(className) {
13
13
  icon.className = className;
14
14
  }
@@ -26,7 +26,7 @@ Icon.create = function(iconName, className) {
26
26
  * @return {!Element} Element that contains the newly created icon
27
27
  */
28
28
  Icon.box = function(iconName, className, boxRef) {
29
- var boxElem = null;
29
+ let boxElem = null;
30
30
  if(boxRef) {
31
31
  if(typeof boxRef == "string") {
32
32
  boxElem = document.createElement(boxRef);
@@ -51,7 +51,7 @@ Icon.box = function(iconName, className, boxRef) {
51
51
  * @param {string=} iconName
52
52
  */
53
53
  Icon.change = function(iconElem, iconName) {
54
- var curIcon = iconElem.getAttribute("icon");
54
+ let curIcon = iconElem.getAttribute("icon");
55
55
  if(curIcon !== iconName) {
56
56
  iconElem.setAttribute("icon", iconName);
57
57
  }
@@ -36,17 +36,17 @@ import {TouchProxy} from "./TouchProxy.js";
36
36
  * @param {(string|MouseDownTrait~Options)=} options String is treated as mouse mode (eg. left|middle|right), or Option object
37
37
  * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button}
38
38
  * @example
39
- * var mdt = new MouseDownTrait(window);
39
+ * let mdt = new MouseDownTrait(window);
40
40
  */
41
- var MouseDownTrait = function(elem, options) {
41
+ let MouseDownTrait = function(elem, options) {
42
42
  this._onMouseDown = this._onMouseDown.bind(this);
43
43
  this._onMouseUp = this._onMouseUp.bind(this);
44
44
  this._onMouseMove = this._dispatch.bind(this, "mouseMove");
45
45
 
46
- var obj;
46
+ let obj;
47
47
  if(options) {
48
48
  if(typeof options == "string") {
49
- var ch = options.charAt(0).toLowerCase();
49
+ let ch = options.charAt(0).toLowerCase();
50
50
  if(ch === "m") { // Middle mouse
51
51
  this._whichBtn = 1;
52
52
  } else if(ch === "r") { // Right mouse
@@ -127,7 +127,7 @@ MouseDownTrait.prototype.getElement = function() {
127
127
  * @param {Element=} elem
128
128
  */
129
129
  MouseDownTrait.prototype.setElement = function(elem) {
130
- var curElem = this._tchProxy.getElement();
130
+ let curElem = this._tchProxy.getElement();
131
131
  if(curElem) {
132
132
  curElem.removeEventListener("dragstart", EventDispatcher.preventDefault, false);
133
133
  if(this._useDrag) {
@@ -178,7 +178,7 @@ MouseDownTrait.prototype.isMouseUp = function() {
178
178
  */
179
179
  MouseDownTrait.prototype.getDuration = function(dateObj) {
180
180
  if(this._down) {
181
- var timeInMs = dateObj ? dateObj.getTime() : Date.now();
181
+ let timeInMs = dateObj ? dateObj.getTime() : Date.now();
182
182
  return timeInMs - this._down["timeStamp"];
183
183
  }
184
184
  return 0;