@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
@@ -8,8 +8,8 @@ import { ElementWrapper } from "./ElementWrapper.js";
8
8
  * @param {number} count Number of elements to be added
9
9
  * @param {string} childTag Tag name of the cells
10
10
  */
11
- var _addElements = function(parentElem, count, childTag) {
12
- for(var i = count; --i >= 0;) {
11
+ let _addElements = function(parentElem, count, childTag) {
12
+ for(let i = count; --i >= 0;) {
13
13
  parentElem.appendChild(document.createElement(childTag));
14
14
  }
15
15
  };
@@ -19,8 +19,8 @@ var _addElements = function(parentElem, count, childTag) {
19
19
  * @extends {ElementWrapper}
20
20
  * @param {(Element|string)=} opt_elem
21
21
  */
22
- var SubTable = function(opt_elem) {
23
- var elem;
22
+ let SubTable = function(opt_elem) {
23
+ let elem;
24
24
  if(opt_elem) {
25
25
  if(typeof opt_elem == "string") { // tbody, thead, tfoot
26
26
  elem = document.createElement(opt_elem);
@@ -67,9 +67,9 @@ SubTable.prototype.addColumns = function(opt_count) {
67
67
 
68
68
  this._colCount += opt_count;
69
69
 
70
- var cellTag = this._getCellTagName();
71
- var rows = this._elem.children; // TODO: Must include all suspended rows
72
- for(var r = rows.length; --r >= 0;) {
70
+ let cellTag = this._getCellTagName();
71
+ let rows = this._elem.children; // TODO: Must include all suspended rows
72
+ for(let r = rows.length; --r >= 0;) {
73
73
  _addElements(rows[r], opt_count, cellTag);
74
74
  }
75
75
  };
@@ -84,8 +84,8 @@ SubTable.prototype.removeColumns = function(opt_count) {
84
84
  if(opt_count <= 0) { return; }
85
85
 
86
86
  this._colCount -= opt_count;
87
- var rows = this._elem.children; // TODO: Must include all suspended rows
88
- for(var r = rows.length; --r >= 0;) {
87
+ let rows = this._elem.children; // TODO: Must include all suspended rows
88
+ for(let r = rows.length; --r >= 0;) {
89
89
  Dom.removeChildren(rows[r], opt_count);
90
90
  }
91
91
  };
@@ -115,7 +115,7 @@ SubTable.prototype.setColumnCount = function(val) {
115
115
  * @return {Element} tr (HTMLTableRowElement) element
116
116
  */
117
117
  SubTable.prototype.insertRow = function(at) {
118
- var row = this._elem.insertRow(at);
118
+ let row = this._elem.insertRow(at);
119
119
  _addElements(row, this._colCount, this._getCellTagName());
120
120
  return row;
121
121
  };
@@ -125,13 +125,13 @@ SubTable.prototype.insertRow = function(at) {
125
125
  * @return {!Array.<Element>} Array of tr (HTMLTableRowElement) elements
126
126
  */
127
127
  SubTable.prototype.addRows = function(count) {
128
- var rows = null;
128
+ let rows = null;
129
129
  if(count == null) {
130
130
  count = 1;
131
131
  }
132
132
  if(count > 0) {
133
133
  rows = new Array(count);
134
- for(var r = 0; r < count; ++r) {
134
+ for(let r = 0; r < count; ++r) {
135
135
  rows[r] = this.insertRow();
136
136
  }
137
137
 
@@ -155,7 +155,7 @@ SubTable.prototype.removeAllRows = function() {
155
155
  * @param {number} val
156
156
  */
157
157
  SubTable.prototype.setRowCount = function(val) {
158
- var rowCount = this.getRowCount();
158
+ let rowCount = this.getRowCount();
159
159
  if(val >= rowCount) {
160
160
  this.addRows(val - rowCount);
161
161
  } else {
@@ -170,7 +170,7 @@ SubTable.prototype.setDefaultRowHeight = function(val) {
170
170
  if(val === this._defaultRowHeight) { return; }
171
171
 
172
172
  this._defaultRowHeight = val;
173
- var minHeight = (this._defaultRowHeight != null) ? this._defaultRowHeight + "px" : "";
173
+ let minHeight = (this._defaultRowHeight != null) ? this._defaultRowHeight + "px" : "";
174
174
 
175
175
  this._applyDefaultRowHeight(this._elem.children, minHeight);
176
176
  };
@@ -194,7 +194,7 @@ SubTable.prototype.getRowCount = function() {
194
194
  * @return {Element}
195
195
  */
196
196
  SubTable.prototype.getCell = function(c, r) {
197
- var tr = this.getRow(r);
197
+ let tr = this.getRow(r);
198
198
  if(tr) {
199
199
  return tr.cells[c] || null;
200
200
  }
@@ -208,10 +208,10 @@ SubTable.prototype.getCellsInColumn = function(c) {
208
208
  if(c < 0 || c >= this._colCount) {
209
209
  return null;
210
210
  }
211
- var rows = this._elem.children;
212
- var rowCount = rows.length;
213
- var ary = new Array(rowCount);
214
- for(var r = 0; r < rowCount; ++r) {
211
+ let rows = this._elem.children;
212
+ let rowCount = rows.length;
213
+ let ary = new Array(rowCount);
214
+ for(let r = 0; r < rowCount; ++r) {
215
215
  ary[r] = rows[r].cells[c];
216
216
  }
217
217
 
@@ -222,12 +222,12 @@ SubTable.prototype.getCellsInColumn = function(c) {
222
222
  * @return {Array.<Element>} Array of td (HTMLTableCellElement) elements
223
223
  */
224
224
  SubTable.prototype.getCellsInRow = function(r) {
225
- var tr = this.getRow(r);
225
+ let tr = this.getRow(r);
226
226
  if(tr) {
227
- var cells = tr.cells;
228
- var len = cells.length;
229
- var ary = new Array(len);
230
- for(var i = 0; i < len; ++i) {
227
+ let cells = tr.cells;
228
+ let len = cells.length;
229
+ let ary = new Array(len);
230
+ for(let i = 0; i < len; ++i) {
231
231
  ary[i] = cells[i];
232
232
  }
233
233
  return ary;
@@ -238,14 +238,14 @@ SubTable.prototype.getCellsInRow = function(r) {
238
238
  * @return {!Array.<Element>} Array of td (HTMLTableCellElement) elements
239
239
  */
240
240
  SubTable.prototype.getAllCells = function() {
241
- var rows = this._elem.children;
242
- var rowCount = rows.length;
243
- var colCount = this._colCount;
244
- var cellCount = 0;
245
- var ary = new Array(rowCount * colCount);
246
- for(var r = 0; r < rowCount; ++r) {
247
- var tr = rows[r];
248
- for(var c = 0; c < colCount; ++c) {
241
+ let rows = this._elem.children;
242
+ let rowCount = rows.length;
243
+ let colCount = this._colCount;
244
+ let cellCount = 0;
245
+ let ary = new Array(rowCount * colCount);
246
+ for(let r = 0; r < rowCount; ++r) {
247
+ let tr = rows[r];
248
+ for(let c = 0; c < colCount; ++c) {
249
249
  ary[cellCount++] = tr.cells[c];
250
250
  }
251
251
  }
@@ -255,10 +255,10 @@ SubTable.prototype.getAllCells = function() {
255
255
  * @return {!Array.<Element>} Array of tr (HTMLTableRowElement) elements
256
256
  */
257
257
  SubTable.prototype.getAllRows = function() {
258
- var chdr = this._elem.children;
259
- var len = chdr ? chdr.length : 0;
260
- var ary = new Array(len);
261
- for(var i = 0; i < len; ++i) {
258
+ let chdr = this._elem.children;
259
+ let len = chdr ? chdr.length : 0;
260
+ let ary = new Array(len);
261
+ for(let i = 0; i < len; ++i) {
262
262
  ary[i] = chdr[i];
263
263
  }
264
264
  return ary;
@@ -280,14 +280,14 @@ SubTable.prototype.getRow = function(r) {
280
280
  * @return {!Array.<Array.<string>>}
281
281
  */
282
282
  SubTable.prototype.getTextContents = function() {
283
- var rows = this._elem.children;
284
- var rowCount = rows.length;
285
- var rowContents = new Array(rowCount);
286
- for(var r = 0; r < rowCount; ++r) {
287
- var row = rows[r];
288
- var colContents = new Array(this._colCount);
283
+ let rows = this._elem.children;
284
+ let rowCount = rows.length;
285
+ let rowContents = new Array(rowCount);
286
+ for(let r = 0; r < rowCount; ++r) {
287
+ let row = rows[r];
288
+ let colContents = new Array(this._colCount);
289
289
  rowContents[r] = colContents;
290
- for(var c = 0; c < this._colCount; ++c) {
290
+ for(let c = 0; c < this._colCount; ++c) {
291
291
  colContents[c] = row.cells[c].textContent;
292
292
  }
293
293
  }
@@ -299,7 +299,7 @@ SubTable.prototype.getTextContents = function() {
299
299
  * @return {string}
300
300
  */
301
301
  SubTable.prototype.getCellTextContent = function(c, r) {
302
- var cell = this.getCell(c, r);
302
+ let cell = this.getCell(c, r);
303
303
  if(cell) {
304
304
  return cell.textContent;
305
305
  }
@@ -310,11 +310,11 @@ SubTable.prototype.getCellTextContent = function(c, r) {
310
310
  * @return {string}
311
311
  */
312
312
  SubTable.prototype.getColumnTextContent = function(c) { // New-line delimited
313
- var rows = this._elem.children;
314
- var rowCount = rows.length;
313
+ let rows = this._elem.children;
314
+ let rowCount = rows.length;
315
315
  if(c >= 0 && c < this._colCount && rowCount > 0) {
316
- var str = rows[0].cells[c].textContent;
317
- for(var r = 1; r < rowCount; ++r) {
316
+ let str = rows[0].cells[c].textContent;
317
+ for(let r = 1; r < rowCount; ++r) {
318
318
  str += "\n" + rows[r].cells[c].textContent;
319
319
  }
320
320
  return str;
@@ -326,10 +326,10 @@ SubTable.prototype.getColumnTextContent = function(c) { // New-line delimited
326
326
  * @return {string}
327
327
  */
328
328
  SubTable.prototype.getRowTextContent = function(r) { // Tab delimited
329
- var tr = this.getRow(r);
329
+ let tr = this.getRow(r);
330
330
  if(tr && this._colCount > 0) {
331
- var str = tr.cells[0].textContent;
332
- for(var c = 1; c < this._colCount; ++c) {
331
+ let str = tr.cells[0].textContent;
332
+ for(let c = 1; c < this._colCount; ++c) {
333
333
  str += "\t" + tr.cells[c].textContent;
334
334
  }
335
335
  return str;
@@ -340,10 +340,10 @@ SubTable.prototype.getRowTextContent = function(r) { // Tab delimited
340
340
  * @return {string}
341
341
  */
342
342
  SubTable.prototype.getTableTextContent = function() { // Tab delimited
343
- var rowCount = this._elem.children.length;
343
+ let rowCount = this._elem.children.length;
344
344
  if(rowCount > 0) {
345
- var str = this.getRowTextContent(0);
346
- for(var r = 1; r < rowCount; ++r) {
345
+ let str = this.getRowTextContent(0);
346
+ for(let r = 1; r < rowCount; ++r) {
347
347
  str += "\n" + this.getRowTextContent(r);
348
348
  }
349
349
  return str;
@@ -354,13 +354,13 @@ SubTable.prototype.getTableTextContent = function() { // Tab delimited
354
354
  * @return {string}
355
355
  */
356
356
  SubTable.prototype.toString = function() {
357
- var str = this.getElement().outerHTML;
357
+ let str = this.getElement().outerHTML;
358
358
  str = str.replace(/>\s+</g, "><");
359
359
  str = str.replace(/><tr/g, ">\n\t<tr");
360
360
  str = str.replace(/><td/g, ">\n\t\t<td");
361
361
  str = str.replace(/><th/g, ">\n\t\t<th"); // TH can occur in thead
362
362
  str = str.replace(/><\/tr/g, ">\n\t</tr");
363
- var tagName = this.getElement().tagName.toLowerCase();
363
+ let tagName = this.getElement().tagName.toLowerCase();
364
364
  str = str.replace("</" + tagName, "\n</" + tagName);
365
365
  return str;
366
366
  };
@@ -373,15 +373,15 @@ SubTable.prototype.getColumnIndex = function(e) {
373
373
  if(!e) {
374
374
  return -1;
375
375
  }
376
- var len, i;
377
- var tgt = /** @type{Node} */(e.target); // TODO: Support Shadow Root
376
+ let len, i;
377
+ let tgt = /** @type{Node} */(e.target); // TODO: Support Shadow Root
378
378
  if(this._elem.contains(tgt)) {
379
- var tdElem = Dom.closestTagName(tgt, "TD");
379
+ let tdElem = Dom.closestTagName(tgt, "TD");
380
380
  if(!tdElem) {
381
381
  tdElem = Dom.closestTagName(tgt, "TH");
382
382
  }
383
383
  if(tdElem) {
384
- var chdr = tdElem.parentElement.children;
384
+ let chdr = tdElem.parentElement.children;
385
385
  len = chdr.length;
386
386
  for(i = 0; i < len; ++i) {
387
387
  if(tdElem === chdr[i]) {
@@ -390,11 +390,11 @@ SubTable.prototype.getColumnIndex = function(e) {
390
390
  }
391
391
  }
392
392
  } else { // In case of the target is not a child of this element
393
- var rows = this._elem.children;
394
- var cells = (rows[0]) ? rows[0].cells : null;
393
+ let rows = this._elem.children;
394
+ let cells = (rows[0]) ? rows[0].cells : null;
395
395
  if(cells) {
396
- var pos = Dom.getRelativePosition(e, this._elem);
397
- var x = pos["x"];
396
+ let pos = Dom.getRelativePosition(e, this._elem);
397
+ let x = pos["x"];
398
398
  if(x >= 0) {
399
399
  len = cells.length;
400
400
  for(i = 0; i < len; ++i) {
@@ -416,18 +416,18 @@ SubTable.prototype.getRowIndex = function(e) {
416
416
  if(!e) {
417
417
  return -1;
418
418
  }
419
- var rows = this._elem.children; // This return HTML collection
420
- var rowCount = rows ? rows.length : 0;
419
+ let rows = this._elem.children; // This return HTML collection
420
+ let rowCount = rows ? rows.length : 0;
421
421
  if(!rowCount) {
422
422
  return -1;
423
423
  }
424
- var i;
425
- var tgt = /** @type{Node} */(e.target); // TODO: Support Shadow Root
424
+ let i;
425
+ let tgt = /** @type{Node} */(e.target); // TODO: Support Shadow Root
426
426
  if(this._elem.contains(tgt)) {
427
- var trElem = Dom.closestTagName(tgt, "TR");
427
+ let trElem = Dom.closestTagName(tgt, "TR");
428
428
  if(trElem) {
429
429
  for(i = 0; i < rowCount; ++i) {
430
- var row = rows[i];
430
+ let row = rows[i];
431
431
  if(row === trElem) {
432
432
  return i;
433
433
  }
@@ -436,8 +436,8 @@ SubTable.prototype.getRowIndex = function(e) {
436
436
  }
437
437
 
438
438
  // In case of the target is not a child of this element
439
- var pos = Dom.getRelativePosition(e, this._elem);
440
- var y = pos["y"];
439
+ let pos = Dom.getRelativePosition(e, this._elem);
440
+ let y = pos["y"];
441
441
  if(y >= 0) {
442
442
  for(i = 0; i < rowCount; ++i) {
443
443
  y -= rows[i].offsetHeight;
@@ -454,7 +454,7 @@ SubTable.prototype.getRowIndex = function(e) {
454
454
  * @return {number}
455
455
  */
456
456
  SubTable.prototype.getColumnLeft = function(colIndex, rowIndex) {
457
- var cell = this.getCell(colIndex, rowIndex ? rowIndex : 0);
457
+ let cell = this.getCell(colIndex, rowIndex ? rowIndex : 0);
458
458
  if(cell) {
459
459
  return cell.offsetLeft; // WARNING: Hidden cells or cell spanning can cause unexpected results
460
460
  }
@@ -465,7 +465,7 @@ SubTable.prototype.getColumnLeft = function(colIndex, rowIndex) {
465
465
  * @return {number}
466
466
  */
467
467
  SubTable.prototype.getRowTop = function(rowRef) {
468
- var row = null;
468
+ let row = null;
469
469
  if(typeof rowRef === "number") {
470
470
  row = this.getRow(rowRef);
471
471
  } else {
@@ -481,7 +481,7 @@ SubTable.prototype.getRowTop = function(rowRef) {
481
481
  SubTable.prototype.getCellPosition = function(cell, ret_obj) {
482
482
  if(!ret_obj) { ret_obj = {}; }
483
483
  ret_obj["x"] = cell.offsetLeft;
484
- var pn = cell.parentNode; // Expecting tr element
484
+ let pn = cell.parentNode; // Expecting tr element
485
485
  ret_obj["y"] = (pn) ? pn.offsetTop : NaN;
486
486
  return ret_obj;
487
487
  };
@@ -500,7 +500,7 @@ SubTable.prototype.setCellRenderer = function(func) {
500
500
  SubTable.prototype.cloak = function(elem, opt_elementType) {
501
501
  if(elem) {
502
502
  this._elem = elem;
503
- var rows = elem.getElementsByTagName("TR");
503
+ let rows = elem.getElementsByTagName("TR");
504
504
  this._colCount = rows[0] ? rows[0].children.length : 0;
505
505
  }
506
506
  };
@@ -513,7 +513,7 @@ SubTable.prototype.cloak = function(elem, opt_elementType) {
513
513
  * @return {Element} Top left cell element
514
514
  */
515
515
  SubTable.prototype.spanBlock = function (c1, c2, r1, r2) { // WARNING: It's c c r r
516
- var cell = this.getCell(c1, r1);
516
+ let cell = this.getCell(c1, r1);
517
517
  if(!cell) {
518
518
  return null;
519
519
  }
@@ -523,13 +523,13 @@ SubTable.prototype.spanBlock = function (c1, c2, r1, r2) { // WARNING: It's c c
523
523
  if(r2 < r1) {
524
524
  r2 = r1;
525
525
  }
526
- var curColSpan = +cell.getAttribute("colspan");
527
- var curRowSpan = +cell.getAttribute("rowspan");
528
- var c3 = (curColSpan) ? c1 + curColSpan - 1 : c1;
529
- var r3 = (curRowSpan) ? r1 + curRowSpan - 1 : r1;
526
+ let curColSpan = +cell.getAttribute("colspan");
527
+ let curRowSpan = +cell.getAttribute("rowspan");
528
+ let c3 = (curColSpan) ? c1 + curColSpan - 1 : c1;
529
+ let r3 = (curRowSpan) ? r1 + curRowSpan - 1 : r1;
530
530
 
531
531
  // TODO: Optimize below logics
532
- var c, r;
532
+ let c, r;
533
533
  for(c = c3; c >= c1; --c) {
534
534
  for(r = r3; r >= r1; --r) {
535
535
  cell = this.getCell(c, r);
@@ -549,8 +549,8 @@ SubTable.prototype.spanBlock = function (c1, c2, r1, r2) { // WARNING: It's c c
549
549
  }
550
550
 
551
551
  if(cell) { // The last cell from the loop is the top left cell
552
- var colSpan = (c2 - c1 + 1);
553
- var rowSpan = (r2 - r1 + 1);
552
+ let colSpan = (c2 - c1 + 1);
553
+ let rowSpan = (r2 - r1 + 1);
554
554
  if(colSpan > 1) {
555
555
  cell.setAttribute("colspan", colSpan);
556
556
  } else {
@@ -577,7 +577,7 @@ SubTable.parseTableContent = function(tbl) {
577
577
  return null;
578
578
  }
579
579
 
580
- var tbody = (tbl.tagName == "TBODY") ? tbl : tbl.getElementsByTagName("TBODY")[0];
580
+ let tbody = (tbl.tagName == "TBODY") ? tbl : tbl.getElementsByTagName("TBODY")[0];
581
581
  if(!tbody) {
582
582
  if(tbl.tagName == "TABLE") { // Table element can directly host tr element without tbody element
583
583
  tbody = tbl;
@@ -587,16 +587,16 @@ SubTable.parseTableContent = function(tbl) {
587
587
  return null;
588
588
  }
589
589
 
590
- var trs = tbody.getElementsByTagName("TR");
591
- var rowCount = trs.length;
592
- var rows = new Array(rowCount);
593
- for(var i = 0; i < rowCount; ++i) {
594
- var tds = trs[i].getElementsByTagName("TD"); // TODO: Handle TH cell
595
- var colCount = tds.length;
596
- var columns = new Array(colCount);
590
+ let trs = tbody.getElementsByTagName("TR");
591
+ let rowCount = trs.length;
592
+ let rows = new Array(rowCount);
593
+ for(let i = 0; i < rowCount; ++i) {
594
+ let tds = trs[i].getElementsByTagName("TD"); // TODO: Handle TH cell
595
+ let colCount = tds.length;
596
+ let columns = new Array(colCount);
597
597
 
598
598
  rows[i] = columns;
599
- for(var j = 0; j < colCount; ++j) {
599
+ for(let j = 0; j < colCount; ++j) {
600
600
  columns[j] = tds[j].textContent;
601
601
  }
602
602
  }
@@ -608,7 +608,7 @@ SubTable.parseTableContent = function(tbl) {
608
608
  * @param {string} minHeight
609
609
  */
610
610
  SubTable.prototype._applyDefaultRowHeight = function(rows, minHeight) {
611
- for(var r = rows.length; --r >= 0;) {
611
+ for(let r = rows.length; --r >= 0;) {
612
612
  rows[r].style.height = minHeight;
613
613
  }
614
614
  };