@refinitiv-ui/efx-grid 6.0.2 → 6.0.5

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 (203) hide show
  1. package/lib/column-dragging/es6/ColumnDragging.d.ts +49 -0
  2. package/lib/column-dragging/es6/ColumnDragging.js +764 -0
  3. package/lib/column-dragging/es6/index.d.ts +1 -0
  4. package/lib/column-dragging/es6/index.js +1 -0
  5. package/lib/column-format-dialog/lib/column-format-dialog.d.ts +13 -1
  6. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +15 -2
  7. package/lib/column-selection-dialog/lib/column-selection-dialog.js +146 -5
  8. package/lib/core/dist/core.css +1 -1
  9. package/lib/core/dist/core.js +468 -1092
  10. package/lib/core/dist/core.min.js +1 -1
  11. package/lib/core/es6/data/ColumnStats.d.ts +2 -2
  12. package/lib/core/es6/data/DataCache.d.ts +4 -4
  13. package/lib/core/es6/data/DataTable.d.ts +5 -5
  14. package/lib/core/es6/data/DataTable.js +33 -11
  15. package/lib/core/es6/data/DataView.d.ts +12 -18
  16. package/lib/core/es6/data/DataView.js +0 -4
  17. package/lib/core/es6/data/Segment.d.ts +2 -0
  18. package/lib/core/es6/data/Segment.js +7 -0
  19. package/lib/core/es6/data/SegmentCollection.d.ts +3 -3
  20. package/lib/core/es6/data/WrappedView.d.ts +13 -13
  21. package/lib/core/es6/data/WrappedView.js +6 -6
  22. package/lib/core/es6/grid/Core.d.ts +31 -27
  23. package/lib/core/es6/grid/Core.js +47 -11
  24. package/lib/core/es6/grid/ILayoutGrid.d.ts +15 -15
  25. package/lib/core/es6/grid/LayoutGrid.js +54 -26
  26. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +71 -0
  27. package/lib/core/es6/grid/components/Cell.d.ts +4 -4
  28. package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +1 -1
  29. package/lib/core/es6/grid/components/CellSpans.d.ts +8 -8
  30. package/lib/core/es6/grid/components/Column.d.ts +1 -1
  31. package/lib/core/es6/grid/components/ElementWrapper.d.ts +6 -6
  32. package/lib/core/es6/grid/components/Scrollbar.d.ts +3 -1
  33. package/lib/core/es6/grid/components/Scrollbar.js +13 -0
  34. package/lib/core/es6/grid/components/StretchedCells.js +2 -2
  35. package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +14 -6
  36. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +147 -81
  37. package/lib/core/es6/grid/util/Conflator.d.ts +2 -2
  38. package/lib/core/es6/grid/util/ElementFrameWork.d.ts +3 -3
  39. package/lib/core/es6/grid/util/HttpRequest.d.ts +2 -2
  40. package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +1 -1
  41. package/lib/core/es6/grid/util/RangeBar.d.ts +1 -1
  42. package/lib/core/es6/grid/util/SectionSettings.d.ts +5 -5
  43. package/lib/core/es6/grid/util/SectionSettings.js +5 -0
  44. package/lib/core/es6/grid/util/SelectionList.d.ts +2 -2
  45. package/lib/core/es6/grid/util/TrackLayout.d.ts +7 -3
  46. package/lib/core/es6/grid/util/TrackLayout.js +27 -0
  47. package/lib/core/es6/grid/util/util.d.ts +2 -2
  48. package/lib/core/es6/index.d.ts +1 -5
  49. package/lib/core/es6/index.js +1 -7
  50. package/lib/core/es6/tr-grid-theme.js +1 -1
  51. package/lib/filter-dialog/lib/checkbox-list.d.ts +13 -1
  52. package/lib/filter-dialog/lib/filter-dialog.d.ts +14 -1
  53. package/lib/filter-dialog/lib/filter-dialog.js +86 -26
  54. package/lib/filter-dialog/themes/base-checkbox.less +8 -1
  55. package/lib/filter-dialog/themes/base.less +69 -1
  56. package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +1 -1
  57. package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +2 -2
  58. package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +1 -1
  59. package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +1 -1
  60. package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +2 -2
  61. package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +1 -1
  62. package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +1 -1
  63. package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +2 -2
  64. package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +1 -1
  65. package/lib/filter-dialog/themes/halo/light/checkbox-list.js +1 -1
  66. package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +2 -2
  67. package/lib/filter-dialog/themes/halo/light/filter-dialog.js +1 -1
  68. package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +1 -1
  69. package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +2 -2
  70. package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +1 -1
  71. package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +1 -1
  72. package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +2 -2
  73. package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +1 -1
  74. package/lib/grid/lib/efx-grid.d.ts +25 -10
  75. package/lib/grid/lib/efx-grid.js +22 -56
  76. package/lib/grid/themes/base.less +1 -1
  77. package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
  78. package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
  79. package/lib/grid/themes/halo/efx-grid.less +33 -39
  80. package/lib/grid/themes/halo/light/efx-grid.js +1 -1
  81. package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
  82. package/lib/grid/themes/solar/charcoal/efx-grid.js +1 -1
  83. package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
  84. package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
  85. package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
  86. package/lib/index.d.ts +2 -0
  87. package/lib/index.js +2 -0
  88. package/lib/row-segmenting/es6/RowSegmenting.d.ts +7 -2
  89. package/lib/row-segmenting/es6/RowSegmenting.js +98 -11
  90. package/lib/rt-grid/dist/rt-grid.js +1244 -1249
  91. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  92. package/lib/rt-grid/es6/ColumnDefinition.d.ts +5 -3
  93. package/lib/rt-grid/es6/ColumnDefinition.js +17 -108
  94. package/lib/rt-grid/es6/DataConnector.d.ts +3 -3
  95. package/lib/rt-grid/es6/Grid.d.ts +24 -9
  96. package/lib/rt-grid/es6/Grid.js +285 -103
  97. package/lib/rt-grid/es6/RowDefSorter.d.ts +19 -0
  98. package/lib/rt-grid/es6/RowDefSorter.js +137 -0
  99. package/lib/rt-grid/es6/RowDefinition.d.ts +9 -7
  100. package/lib/rt-grid/es6/RowDefinition.js +6 -0
  101. package/lib/rt-grid/es6/SnapshotFiller.d.ts +6 -1
  102. package/lib/rt-grid/es6/SnapshotFiller.js +144 -15
  103. package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +4 -3
  104. package/lib/tr-grid-checkbox/es6/Checkbox.js +51 -21
  105. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +46 -9
  106. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +8 -4
  107. package/lib/tr-grid-column-stack/es6/ColumnStack.js +240 -125
  108. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +4 -3
  109. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +28 -13
  110. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +8 -5
  111. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +106 -3
  112. package/lib/tr-grid-percent-bar/es6/PercentBar.js +1 -1
  113. package/lib/tr-grid-printer/es6/CellWriter.d.ts +3 -3
  114. package/lib/tr-grid-printer/es6/GridPrinter.d.ts +1 -1
  115. package/lib/tr-grid-printer/es6/GridPrinter.js +26 -13
  116. package/lib/tr-grid-printer/es6/PrintTrait.d.ts +2 -2
  117. package/lib/tr-grid-printer/es6/SectionWriter.d.ts +3 -3
  118. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +3 -4
  119. package/lib/tr-grid-row-dragging/es6/RowDragging.js +86 -195
  120. package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +7 -2
  121. package/lib/tr-grid-row-grouping/es6/RowGrouping.js +97 -7
  122. package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +8 -8
  123. package/lib/tr-grid-row-selection/es6/RowSelection.js +55 -31
  124. package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +1 -1
  125. package/lib/tr-grid-textformatting/es6/TextFormatting.js +12 -0
  126. package/lib/tr-grid-util/es6/CellPainter.js +1 -1
  127. package/lib/tr-grid-util/es6/DragUI.d.ts +16 -0
  128. package/lib/tr-grid-util/es6/DragUI.js +214 -0
  129. package/lib/tr-grid-util/es6/ElementObserver.d.ts +2 -0
  130. package/lib/tr-grid-util/es6/ElementObserver.js +32 -2
  131. package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -1
  132. package/lib/tr-grid-util/es6/ElfUtil.js +131 -28
  133. package/lib/tr-grid-util/es6/ExpanderIcon.js +2 -2
  134. package/lib/tr-grid-util/es6/FieldFormatter.js +7 -5
  135. package/lib/tr-grid-util/es6/GridPlugin.js +8 -4
  136. package/lib/tr-grid-util/es6/MultiTableManager.d.ts +8 -0
  137. package/lib/tr-grid-util/es6/MultiTableManager.js +164 -57
  138. package/lib/tr-grid-util/es6/NumberFormatter.d.ts +2 -0
  139. package/lib/tr-grid-util/es6/NumberFormatter.js +64 -19
  140. package/lib/tr-grid-util/es6/RowPainter.js +57 -19
  141. package/lib/tr-grid-util/es6/formula/Formula.js +9 -1
  142. package/lib/tr-grid-util/es6/jsx.d.ts +223 -0
  143. package/lib/types/es6/Checkbox.d.ts +4 -3
  144. package/lib/types/es6/ColumnStack.d.ts +8 -4
  145. package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +3 -2
  146. package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +2 -1
  147. package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +20 -18
  148. package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +2 -1
  149. package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +3 -2
  150. package/lib/types/es6/CompositeGrid/Plugin.d.ts +28 -0
  151. package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +2 -1
  152. package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +5 -4
  153. package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +2 -1
  154. package/lib/types/es6/CompositeGrid/index.d.ts +9 -9
  155. package/lib/types/es6/ConditionalColoring.d.ts +4 -3
  156. package/lib/types/es6/Core/data/ColumnStats.d.ts +2 -2
  157. package/lib/types/es6/Core/data/DataCache.d.ts +4 -4
  158. package/lib/types/es6/Core/data/DataTable.d.ts +5 -5
  159. package/lib/types/es6/Core/data/DataView.d.ts +12 -18
  160. package/lib/types/es6/Core/data/Segment.d.ts +2 -0
  161. package/lib/types/es6/Core/data/SegmentCollection.d.ts +3 -3
  162. package/lib/types/es6/Core/data/WrappedView.d.ts +13 -13
  163. package/lib/types/es6/Core/grid/Core.d.ts +31 -27
  164. package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +15 -15
  165. package/lib/types/es6/Core/grid/components/Cell.d.ts +4 -4
  166. package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +1 -1
  167. package/lib/types/es6/Core/grid/components/CellSpans.d.ts +8 -8
  168. package/lib/types/es6/Core/grid/components/Column.d.ts +1 -1
  169. package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +6 -6
  170. package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +3 -1
  171. package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +14 -6
  172. package/lib/types/es6/Core/grid/util/Conflator.d.ts +2 -2
  173. package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +3 -3
  174. package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +2 -2
  175. package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +1 -1
  176. package/lib/types/es6/Core/grid/util/RangeBar.d.ts +1 -1
  177. package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +5 -5
  178. package/lib/types/es6/Core/grid/util/SelectionList.d.ts +2 -2
  179. package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +7 -3
  180. package/lib/types/es6/Core/grid/util/util.d.ts +2 -2
  181. package/lib/types/es6/Core/index.d.ts +1 -5
  182. package/lib/types/es6/ExtensionOptions.d.ts +2 -0
  183. package/lib/types/es6/InCellEditing.d.ts +8 -5
  184. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +5 -3
  185. package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +3 -3
  186. package/lib/types/es6/RealtimeGrid/Grid.d.ts +24 -9
  187. package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +19 -0
  188. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +9 -7
  189. package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +6 -1
  190. package/lib/types/es6/RowDragging.d.ts +3 -4
  191. package/lib/types/es6/RowGrouping.d.ts +7 -2
  192. package/lib/types/es6/RowSegmenting.d.ts +7 -2
  193. package/lib/types/es6/RowSelection.d.ts +8 -8
  194. package/lib/types/es6/TextFormatting.d.ts +1 -1
  195. package/lib/types/es6/index.d.ts +1 -0
  196. package/lib/versions.json +17 -16
  197. package/package.json +1 -1
  198. package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.d.ts +0 -24
  199. package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.js +0 -615
  200. package/lib/core/es6/grid/plugins/Plugin.d.ts +0 -28
  201. package/lib/core/es6/grid/plugins/Plugin.js +0 -272
  202. package/lib/types/es6/Core/grid/plugins/DragAndDropTitlePlugin.d.ts +0 -24
  203. package/lib/types/es6/Core/grid/plugins/Plugin.d.ts +0 -28
@@ -91,6 +91,7 @@ var Core = function (opt_initializer) {
91
91
  _t._updateColumnBounds = _t._updateColumnBounds.bind(_t);
92
92
  _t._dispatchColumnPositionChanged = _t._dispatchColumnPositionChanged.bind(_t);
93
93
  _t._dispatchRowPositionChanged = _t._dispatchRowPositionChanged.bind(_t);
94
+ _t._requestScrollbarUpdate = _t._requestScrollbarUpdate.bind(_t);
94
95
 
95
96
  // Text nodes are unintentionally getting in the tag.
96
97
  if(opt_initializer) { // Any node other than element node is not allowed within the tag.
@@ -508,6 +509,10 @@ Core.prototype._preserveProportion = false;
508
509
  * @private
509
510
  */
510
511
  Core.prototype._preserveGridSize = false;
512
+ /** @type {number}
513
+ * @private
514
+ */
515
+ Core.prototype._rowHeightTimerId = 0;
511
516
  //#region Public Methods
512
517
 
513
518
  /**
@@ -515,7 +520,7 @@ Core.prototype._preserveGridSize = false;
515
520
  * @return {string}
516
521
  */
517
522
  Core.getVersion = function () {
518
- return "5.0.50";
523
+ return "5.0.59";
519
524
  };
520
525
  /** {@link ElementWrapper#dispose}
521
526
  * @override
@@ -834,6 +839,10 @@ Core.prototype.addSectionAt = function (at, opt_type, opt_sectionName) {
834
839
  }
835
840
 
836
841
  this._updateSectionIndices(at);
842
+ if (this._autoSetDataSource) {
843
+ // This could trigger data binding and column virtualization
844
+ sectionSettings.setDataSource(this._dataSource);
845
+ }
837
846
 
838
847
  sectType = sectionSettings.getType();
839
848
  if (sectType === "footer") {
@@ -3339,6 +3348,11 @@ Core.prototype.getScrollHeight = function () {
3339
3348
  }
3340
3349
  return this._vscrollbar.getContentHeight();
3341
3350
  };
3351
+ /** @public
3352
+ */
3353
+ Core.prototype.restoreScrollbars = function () {
3354
+ this._vscrollbar.restoreTrackPosition();
3355
+ };
3342
3356
 
3343
3357
  /** @public
3344
3358
  * @ignore
@@ -3464,6 +3478,13 @@ Core.prototype.requestRowRefresh = function() {
3464
3478
  this._rowRefreshTimer = setTimeout(this._onRowRefresh, 100);
3465
3479
  }
3466
3480
  };
3481
+ /** Set a timer to call updateScrollbarHeight only once to avoid performance issue due to multiple call of _updateScrollbarHeight()
3482
+ * @public
3483
+ */
3484
+ Core.prototype._requestScrollbarUpdate = function() {
3485
+ this._updateScrollbarHeight(true, true);
3486
+ this._rowHeightTimerId = 0;
3487
+ };
3467
3488
 
3468
3489
  /** prevent bind data process
3469
3490
  * @public
@@ -4056,9 +4077,6 @@ Core.prototype._newSection = function (opt_type, sectionName) {
4056
4077
  section.listen("rowCountChanged", this._onRowCountChanged);
4057
4078
  section.listen("rowHeightChanged", this._onRowHeightChanged);
4058
4079
 
4059
- if (this._autoSetDataSource) {
4060
- sectionSettings.setDataSource(this._dataSource);
4061
- }
4062
4080
  return sectionSettings;
4063
4081
  };
4064
4082
 
@@ -4349,7 +4367,12 @@ Core.prototype._removeColumn = function (num) { // TODO: change the logic to us
4349
4367
  */
4350
4368
  Core.prototype._onSectionDataChanged = function (e) {
4351
4369
  if(this._dispatchingDataChanged) { return; } // Prevent infinite loop
4352
- this._dispatchingDataChanged = true;
4370
+
4371
+ var colCount = this._layoutX.getLaneCount();
4372
+ this._dispatchingDataChanged = colCount ? true : false;
4373
+ if(!colCount) {
4374
+ return;
4375
+ }
4353
4376
 
4354
4377
  var fromR = /** @type{number} */(e["fromRowIndex"]);
4355
4378
  var toR = /** @type{number} */(e["toRowIndex"]);
@@ -4357,6 +4380,9 @@ Core.prototype._onSectionDataChanged = function (e) {
4357
4380
  var dataView = /** @type{DataView} */(e["dataSource"]);
4358
4381
  var hasDataView = (dataView && dataView.getDataSource()) ? 1 : 0;
4359
4382
  var rids, rowDataCollection;
4383
+
4384
+ section._startBindingSession(true);
4385
+
4360
4386
  if(hasDataView) {
4361
4387
  rids = dataView.getVisibleRowIds(true);
4362
4388
  rowDataCollection = dataView.getMultipleRowData(rids, fromR, toR);
@@ -4364,7 +4390,6 @@ Core.prototype._onSectionDataChanged = function (e) {
4364
4390
  }
4365
4391
  this._dispatch("preSectionDataBinding", e);
4366
4392
 
4367
- var colCount = this._layoutX.getLaneCount();
4368
4393
  var dataMap = this.getDataColumnMap();
4369
4394
  for (var c = 0; c < colCount; ++c) {
4370
4395
  if(section["isColumnActive"](c) && (this.isColumnVisible(c) || this._isAlwaysRenderColumn(c))) {
@@ -4395,8 +4420,9 @@ Core.prototype._onSectionDataChanged = function (e) {
4395
4420
  }
4396
4421
 
4397
4422
  this._dispatch("postSectionDataBinding", e);
4398
-
4399
4423
  this._dispatchRowExpansionBinding(e);
4424
+
4425
+ section._startBindingSession(false);
4400
4426
  this._dispatchingDataChanged = false;
4401
4427
  };
4402
4428
 
@@ -4470,6 +4496,9 @@ Core.prototype._onRowInViewChanged = function (e) { // Triggered from virtualize
4470
4496
  * @param {Object} e
4471
4497
  */
4472
4498
  Core.prototype._onColInViewChanged = function (e) {
4499
+ if(!this.getColumnCount()) {
4500
+ return; // No column for activation and no cell to be rendered
4501
+ }
4473
4502
  var pfi = e["prevFirstIndex"];
4474
4503
  var pli = e["prevLastIndex"]; // INCLUSIVE
4475
4504
  var fi = e["firstIndex"];
@@ -4719,8 +4748,14 @@ Core.prototype._onRowHeightChanged = function (e) {
4719
4748
  this._rowHeightConflator._needScrollbarUpdate = false;
4720
4749
  this._updateScrollbarHeight(true, true);
4721
4750
  } else if(minSectionIndex >= 0) {
4722
- this._updateScrollbarHeight(minSectionIndex < this._startVScrollbarIndex,
4723
- minSectionIndex >= this._startVScrollbarIndex);
4751
+ if(this._dispatchingDataChanged){
4752
+ if(!this._rowHeightTimerId){
4753
+ this._rowHeightTimerId = setTimeout(this._requestScrollbarUpdate, 0);
4754
+ }
4755
+ } else {
4756
+ this._updateScrollbarHeight(minSectionIndex < this._startVScrollbarIndex,
4757
+ minSectionIndex >= this._startVScrollbarIndex);
4758
+ }
4724
4759
  }
4725
4760
 
4726
4761
  this._dispatchRowPositionChanged();
@@ -4785,7 +4820,7 @@ Core.prototype._onColumnCountChanged = function () {
4785
4820
  // TODO: Optimize these methods during initialization
4786
4821
  var pinnedLeft = this._countPinnedLeftColumns();
4787
4822
  var pinnedRight = this._countPinnedRightColumns();
4788
- ///
4823
+
4789
4824
  this._updateColumnBounds();
4790
4825
 
4791
4826
  if (this._hScrollbarEnabled && pinnedLeft + pinnedRight < this.getColumnCount()) {
@@ -5146,7 +5181,8 @@ Core.prototype._updateSectionIndices = function (from) {
5146
5181
 
5147
5182
  /** @private */
5148
5183
  Core.prototype._updateLayout = function () {
5149
- if(this._disposed) { return; }
5184
+ var element = this.getElement();
5185
+ if(this._disposed || !element.offsetParent) { return; }
5150
5186
 
5151
5187
  this._syncLayoutToColumns(); // Update only if need
5152
5188
 
@@ -4,7 +4,7 @@ import TrackLayout from "./util/TrackLayout.js";
4
4
 
5
5
  declare interface ILayoutGrid extends ElementWrapper {
6
6
 
7
- hitTest(x: number, y: number, opt_omitSpan?: boolean): any|null;
7
+ hitTest(x: number, y: number, opt_omitSpan?: boolean): any|null|null;
8
8
 
9
9
  hitTestX(x: number): number;
10
10
 
@@ -76,13 +76,13 @@ declare interface ILayoutGrid extends ElementWrapper {
76
76
 
77
77
  setRowScalability(rowIndex: number, val: boolean): boolean;
78
78
 
79
- getCell(colIndex: number, rowIndex: number, opt_includeSpan?: boolean): ElementWrapper;
79
+ getCell(colIndex: number, rowIndex: number, opt_includeSpan?: boolean): ElementWrapper|null;
80
80
 
81
- getCellContent(colIndex: number, rowIndex: number): Element|Node|NodeList;
81
+ getCellContent(colIndex: number, rowIndex: number): Element|Node|NodeList|null;
82
82
 
83
- setCellContent(colIndex: number, rowIndex: number, data: string|Element|ElementWrapper|any): Element;
83
+ setCellContent(colIndex: number, rowIndex: number, data: string|Element|ElementWrapper|any): Element|null;
84
84
 
85
- getColumn(index: number): ElementWrapper;
85
+ getColumn(index: number): ElementWrapper|null;
86
86
 
87
87
  getColumnCount(): number;
88
88
 
@@ -100,7 +100,7 @@ declare interface ILayoutGrid extends ElementWrapper {
100
100
 
101
101
  setBorders(lft: boolean, top: boolean, rgt: boolean, btm: boolean): void;
102
102
 
103
- getColumnStyle(colIndex: number, styleName: string): string|null;
103
+ getColumnStyle(colIndex: number, styleName: string): string|null|null;
104
104
 
105
105
  setColumnStyle(colIndex: number, styleName: string, value: string): void;
106
106
 
@@ -118,7 +118,7 @@ declare interface ILayoutGrid extends ElementWrapper {
118
118
 
119
119
  getContentHeight(): number;
120
120
 
121
- getCellsByRowIndex(rowIndex: number): (ElementWrapper)[];
121
+ getCellsByRowIndex(rowIndex: number): (ElementWrapper)[]|null;
122
122
 
123
123
  disableHorizontalGridLine(opt_bool?: boolean): void;
124
124
 
@@ -134,7 +134,7 @@ declare interface ILayoutGrid extends ElementWrapper {
134
134
 
135
135
  setRowHighlight(rowIndex: number): void;
136
136
 
137
- getSelectedRows(): (number)[];
137
+ getSelectedRows(): (number)[]|null;
138
138
 
139
139
  getSelectedRowCount(): number;
140
140
 
@@ -172,25 +172,25 @@ declare interface ILayoutGrid extends ElementWrapper {
172
172
 
173
173
  getRowOffset(): number;
174
174
 
175
- stretchCell(cellRef: number|Cell, rowIndex?: number, opt_stretching?: boolean, onlyToTheRight?: boolean): Cell;
175
+ stretchCell(cellRef: number|Cell, rowIndex?: number, opt_stretching?: boolean, onlyToTheRight?: boolean): Cell|null;
176
176
 
177
- unstretchCell(cellRef: number|Cell, rowIndex?: number): Cell;
177
+ unstretchCell(cellRef: number|Cell, rowIndex?: number): Cell|null;
178
178
 
179
179
  unstretchAllCells(): void;
180
180
 
181
- getStretchedCell(cellRef: number|Cell, rowIndex?: number): Cell;
181
+ getStretchedCell(cellRef: number|Cell, rowIndex?: number): Cell|null;
182
182
 
183
183
  getStretchedCells(): (Cell)[];
184
184
 
185
185
  updateStretchedCells(): boolean;
186
186
 
187
- getColumnHost(): Element;
187
+ getColumnHost(): Element|null;
188
188
 
189
- reserveRightSpace(size: number): Element;
189
+ reserveRightSpace(size: number): Element|null;
190
190
 
191
- getReservedSpace(): Element;
191
+ getReservedSpace(): Element|null;
192
192
 
193
- getComputedStyle(): CSSStyleDeclaration;
193
+ getComputedStyle(): CSSStyleDeclaration|null;
194
194
 
195
195
  isColumnActive(colIndex: number): boolean;
196
196
 
@@ -528,6 +528,22 @@ LayoutGrid.prototype._setColumnWidth = function (indexX, val) {
528
528
  LayoutGrid.prototype._updateColumnLayout = function () {
529
529
  this._syncLayoutToColumns(0);
530
530
  };
531
+ /** @public
532
+ * @ignore
533
+ * @param {boolean} enabled
534
+ * @param {number=} fromR
535
+ * @param {number=} toR
536
+ */
537
+ LayoutGrid.prototype._startBindingSession = function (enabled, fromR, toR) {
538
+ // Prevent error when calling _startBindingSession in LayoutGrid
539
+ };
540
+ /** @public
541
+ * @ignore
542
+ * @return {Array<boolean>}
543
+ */
544
+ LayoutGrid.prototype._getTempRowHeights = function () {
545
+ return null;
546
+ };
531
547
 
532
548
  /**
533
549
  * {@link ILayoutGrid#getRowHeight}
@@ -1369,6 +1385,11 @@ LayoutGrid.prototype.setRowHighlight = function (rowIndex) {
1369
1385
  this._highlightedCells[c] = cell;
1370
1386
  cell.addClass("highlighted-row");
1371
1387
  }
1388
+ var stretchEl = this.getStretchedCell(rowIndex); // check stretched cell
1389
+ if(stretchEl) {
1390
+ this._highlightedCells.push(stretchEl);
1391
+ stretchEl.addClass("highlighted-row");
1392
+ }
1372
1393
  } else {
1373
1394
  this._highlightedCells.length = 0;
1374
1395
  }
@@ -1654,6 +1675,7 @@ LayoutGrid.prototype.insertColumn = function (index, opt_json) {
1654
1675
  cell.addClass("selected-row");
1655
1676
  }
1656
1677
  }
1678
+ // TODO: Check if it can insert column with stretch cell
1657
1679
  }
1658
1680
 
1659
1681
  column.activate(atTheMiddle || !this._colVir);
@@ -1885,6 +1907,10 @@ LayoutGrid.prototype.stretchCell = function (cellRef, rowIndex, opt_stretching,
1885
1907
  } else {
1886
1908
  cell = this._stretchedCells.unstretchCell(rowIndex);
1887
1909
  }
1910
+ if(cell) {
1911
+ var selected = this._selectionList.getSelection(rowIndex);
1912
+ cell.enableClass("selected-row", selected); // It's can enable class without get stretch cell again.
1913
+ }
1888
1914
  return cell;
1889
1915
  };
1890
1916
 
@@ -1967,6 +1993,19 @@ LayoutGrid.prototype._calculateViewSize = function (forceRecal) {
1967
1993
  }
1968
1994
  return stretchSize;
1969
1995
  };
1996
+
1997
+ /**
1998
+ * @private
1999
+ * @param {number} rowIndex
2000
+ * @param {string} className
2001
+ * @param {boolean} enabled
2002
+ */
2003
+ LayoutGrid.prototype._enableStretchCellClass = function (rowIndex, className, enabled ) {
2004
+ var stretchEl = this.getStretchedCell(rowIndex); // check stretched cell
2005
+ if(stretchEl) {
2006
+ stretchEl.enableClass(className, enabled);
2007
+ }
2008
+ };
1970
2009
  /** View size is width of container (Grid's pane) or content (LayoutGrid's columns), whichever is smaller.
1971
2010
  * @public
1972
2011
  * @ignore
@@ -2650,11 +2689,16 @@ LayoutGrid.prototype._updateCellSpans = function (cellSpans, adding) {
2650
2689
  */
2651
2690
  LayoutGrid.prototype._onMouseMove = function (e) {
2652
2691
  var target = e["target"];
2653
- var colElement = Util.closestElement(target, "column");
2654
- var colIndex = this.getColumnIndex(colElement);
2655
- var cellElement = (colIndex >= 0) ? Util.closestElement(target, "cell") : null;
2656
2692
 
2657
- this.setRowHighlight(this.getCellIndex(colIndex, cellElement));
2693
+ var cellElement = Util.closestElement(target, "cell");
2694
+ var colIndex = this._stretchedCells.getColumnIndex(cellElement);
2695
+ if(colIndex < 0) { // Not found colIndex in stretching cell, then get from normal row
2696
+ var colElement = Util.closestElement(target, "column");
2697
+ colIndex = this.getColumnIndex(colElement);
2698
+ }
2699
+ var rowIndex = this.getCellIndex(colIndex, cellElement);
2700
+
2701
+ this.setRowHighlight(rowIndex);
2658
2702
  };
2659
2703
 
2660
2704
  /**
@@ -2685,27 +2729,16 @@ LayoutGrid.prototype._onMouseOut = function (e) {
2685
2729
  */
2686
2730
  LayoutGrid.prototype._updateSelectionUI = function (rowIndex) { // Update UI of the specified row index
2687
2731
  var selected = this._selectionList.getSelection(rowIndex);
2688
-
2689
- for (var c = 0; c < this._colCount; ++c) {
2690
- var cell = this._columns[c].getCell(rowIndex);
2691
-
2692
- if (cell) {
2693
- cell.enableClass("selected-row", selected);
2694
- }
2695
- }
2732
+ this._enableStretchCellClass(rowIndex, "selected-row", selected);
2733
+ this.enableRowClass(rowIndex, "selected-row", selected);
2696
2734
  };
2697
2735
 
2698
2736
  /** @private
2699
2737
  * @param {number} rowIndex
2700
2738
  */
2701
2739
  LayoutGrid.prototype._addSelectionUI = function (rowIndex) {
2702
- for (var c = 0; c < this._colCount; ++c) {
2703
- var cell = this._columns[c].getCell(rowIndex);
2704
-
2705
- if (cell) {
2706
- cell.addClass("selected-row");
2707
- }
2708
- }
2740
+ this._enableStretchCellClass(rowIndex, "selected-row", true);
2741
+ this.enableRowClass(rowIndex, "selected-row", true);
2709
2742
  };
2710
2743
 
2711
2744
  /**
@@ -2713,13 +2746,8 @@ LayoutGrid.prototype._addSelectionUI = function (rowIndex) {
2713
2746
  * @param {number} rowIndex
2714
2747
  */
2715
2748
  LayoutGrid.prototype._removeSelectionUI = function (rowIndex) {
2716
- for (var c = 0; c < this._colCount; ++c) {
2717
- var cell = this._columns[c].getCell(rowIndex);
2718
-
2719
- if (cell) {
2720
- cell.removeClass("selected-row");
2721
- }
2722
- }
2749
+ this._enableStretchCellClass(rowIndex, "selected-row", false);
2750
+ this.enableRowClass(rowIndex, "selected-row", false);
2723
2751
  };
2724
2752
 
2725
2753
  /**
@@ -67,6 +67,11 @@ Ext.inherits(VirtualizedLayoutGrid, ElementWrapper);
67
67
  */
68
68
  VirtualizedLayoutGrid.prototype._index = -1;
69
69
 
70
+ /** Number of rows offsetting from the first section
71
+ * @private
72
+ * @type {number}
73
+ */
74
+ VirtualizedLayoutGrid.prototype._rowOffset = 0;
70
75
  /** For virtualization in Y-Axis
71
76
  * @private
72
77
  * @type {number}
@@ -128,6 +133,14 @@ VirtualizedLayoutGrid.prototype._boundLayer = null;
128
133
  * @private
129
134
  */
130
135
  VirtualizedLayoutGrid.prototype._hscrollbar = null;
136
+ /** @type {string}
137
+ * @private
138
+ */
139
+ VirtualizedLayoutGrid.prototype._session = "A";
140
+ /** @type {Array<boolean>}
141
+ * @private
142
+ */
143
+ VirtualizedLayoutGrid.prototype._tempRowHeights = null;
131
144
 
132
145
  //#region ====== Override ElementWrapper ======//
133
146
  /** @override */
@@ -239,13 +252,68 @@ VirtualizedLayoutGrid.prototype._setColumnWidth = function (indexX, val) {
239
252
  VirtualizedLayoutGrid.prototype._updateColumnLayout = function () {
240
253
  this._grid._updateColumnLayout();
241
254
  };
255
+ /** @public
256
+ * @ignore
257
+ * @param {boolean} enabled
258
+ */
259
+ VirtualizedLayoutGrid.prototype._startBindingSession = function (enabled) {
260
+ this._isBinding = enabled;
261
+ if(!enabled){
262
+ // Clear old session
263
+ if(this._tempRowHeights){
264
+ var defaultRowHeight = this.getDefaultRowHeight();
265
+ var hasSession = true;
266
+ var removedIndices = [];
267
+
268
+ for(var key in this._tempRowHeights){
269
+ var index = +key;
270
+ var rowSession = this._layoutY.getLaneProperty(index, "sizeSession");
271
+ if(rowSession) {
272
+ if(rowSession != this._session){
273
+ this.setRowHeight(index, defaultRowHeight);
274
+ this._layoutY.setLaneProperty(index, "sizeSession", null);
275
+ removedIndices.push(index);
276
+ }
277
+ }
278
+ }
279
+ var removedCount = removedIndices.length;
280
+ for(var i = 0; i < removedCount; i++){
281
+ delete this._tempRowHeights[removedIndices[i]];
282
+ }
283
+ if(removedCount){
284
+ for(var remainingKey in this._tempRowHeights){
285
+ hasSession = remainingKey != null;
286
+ break;
287
+ }
288
+ }
289
+ if(!hasSession){
290
+ this._tempRowHeights = null;
291
+ }
242
292
 
293
+ }
294
+ this._session = this._session === "A" ? "B" : "A";
295
+ }
296
+ };
297
+ /** @public
298
+ * @ignore
299
+ * @return {Array<boolean>}
300
+ */
301
+ VirtualizedLayoutGrid.prototype._getTempRowHeights = function () {
302
+ return this._tempRowHeights;
303
+ };
243
304
  /** @inheritDoc */
244
305
  VirtualizedLayoutGrid.prototype.getRowHeight = function (index) {
245
306
  return this._layoutY.getLaneSize(index);
246
307
  };
247
308
  /** @inheritDoc */
248
309
  VirtualizedLayoutGrid.prototype.setRowHeight = function (index, val) {
310
+ if(this._isBinding && val != this.getDefaultRowHeight()){
311
+ this._layoutY.setLaneProperty(index, "sizeSession", this._session);
312
+ if(!this._tempRowHeights){
313
+ this._tempRowHeights = [];
314
+ }
315
+ this._tempRowHeights[index] = true; // Store row index that set temporary row height
316
+ }
249
317
  if(this._layoutY.setLaneSize(index, val)) {
250
318
  this._grid.setRowHeight(index - this._firstIndex, val);
251
319
  this._element.style.height = this._layoutY.getTrackSize() + "px";
@@ -399,6 +467,9 @@ VirtualizedLayoutGrid.prototype.setRowCount = function (val, noBinding) {
399
467
  var prevCount = this._layoutY.getLaneCount();
400
468
  if(prevCount !== val){
401
469
  this._layoutY.setLaneCount(val);
470
+ if(this._tempRowHeights){
471
+ this._tempRowHeights.length = val;
472
+ }
402
473
  this._element.style.height = this._layoutY.getTrackSize() + "px";
403
474
  this._requestUpdatingRowBounds();
404
475
  //After rowCountChanged fires, virtualizer will update virtual row count if
@@ -10,11 +10,11 @@ declare class Cell extends ElementWrapper {
10
10
 
11
11
  public setTextContent(str: string): void;
12
12
 
13
- public getTextElement(): Element;
13
+ public getTextElement(): Element|null;
14
14
 
15
15
  public hasElement(): boolean;
16
16
 
17
- public getSection(): ILayoutGrid;
17
+ public getSection(): ILayoutGrid|null;
18
18
 
19
19
  public initialize(): Element;
20
20
 
@@ -34,11 +34,11 @@ declare class Cell extends ElementWrapper {
34
34
 
35
35
  public insertFloatingIcon(elem: Element, opt_order?: number): void;
36
36
 
37
- public removeFloatingIcon(elemRef: Element|string): Element|null;
37
+ public removeFloatingIcon(elemRef: Element|string): Element|null|null;
38
38
 
39
39
  public insertFrontIcon(elem: Element, opt_order?: number): void;
40
40
 
41
- public removeFrontIcon(elemRef: Element|string): Element|null;
41
+ public removeFrontIcon(elemRef: Element|string): Element|null|null;
42
42
 
43
43
  public updatePadding(): void;
44
44
 
@@ -9,7 +9,7 @@ declare class CellFloatingPanel extends ElementWrapper {
9
9
 
10
10
  public insertItem(item: Element, opt_order?: number): void;
11
11
 
12
- public removeItem(elemRef?: (Element|string)): Element|null;
12
+ public removeItem(elemRef?: (Element|string)): Element|null|null;
13
13
 
14
14
  public clearItems(): void;
15
15
 
@@ -8,19 +8,19 @@ declare class CellSpans {
8
8
 
9
9
  public shiftColumn(from: number, amount: number): boolean;
10
10
 
11
- public removeSpan(indexX: number, indexY: number): CellSpan;
11
+ public removeSpan(indexX: number, indexY: number): CellSpan|null;
12
12
 
13
- public removeSpanByColIndex(at: number, opt_ary?: (CellSpan)[]): (CellSpan)[];
13
+ public removeSpanByColIndex(at: number, opt_ary?: (CellSpan)[]): (CellSpan)[]|null;
14
14
 
15
- public removeSpanStartedFromRowIndex(at: number, opt_ary?: (CellSpan)[]): (CellSpan)[];
15
+ public removeSpanStartedFromRowIndex(at: number, opt_ary?: (CellSpan)[]): (CellSpan)[]|null;
16
16
 
17
- public clearAllSpans(): (CellSpan)[];
17
+ public clearAllSpans(): (CellSpan)[]|null;
18
18
 
19
19
  public hasSpan(): boolean;
20
20
 
21
- public getSpan(indexX: number, indexY: number): CellSpan|null;
21
+ public getSpan(indexX: number, indexY: number): CellSpan|null|null;
22
22
 
23
- public getOccupyingSpan(indexX: number, indexY: number): CellSpan|null;
23
+ public getOccupyingSpan(indexX: number, indexY: number): CellSpan|null|null;
24
24
 
25
25
  public getAllSpans(): (CellSpan)[];
26
26
 
@@ -28,9 +28,9 @@ declare class CellSpans {
28
28
 
29
29
  public getRowSpan(indexX: number, indexY: number): number;
30
30
 
31
- public setColSpan(indexX: number, indexY: number, spanVal: number): CellSpan;
31
+ public setColSpan(indexX: number, indexY: number, spanVal: number): CellSpan|null;
32
32
 
33
- public setRowSpan(indexX: number, indexY: number, spanVal: number): CellSpan;
33
+ public setRowSpan(indexX: number, indexY: number, spanVal: number): CellSpan|null;
34
34
 
35
35
  }
36
36
 
@@ -14,7 +14,7 @@ declare class Column extends ElementWrapper {
14
14
 
15
15
  public isActive(): boolean;
16
16
 
17
- public getSection(): ILayoutGrid;
17
+ public getSection(): ILayoutGrid|null;
18
18
 
19
19
  }
20
20
 
@@ -7,11 +7,11 @@ declare class ElementWrapper extends EventDispatcher {
7
7
 
8
8
  constructor(opt_element?: Element);
9
9
 
10
- public getContent(opt_allContent?: boolean): Element|Node|NodeList;
10
+ public getContent(opt_allContent?: boolean): Element|Node|NodeList|null;
11
11
 
12
- public setContent(content: string|Element|ElementWrapper|any, opt_tooltip?: string): Element;
12
+ public setContent(content: string|Element|ElementWrapper|any, opt_tooltip?: string): Element|null;
13
13
 
14
- public addContent(content: Element|Node|ElementWrapper): Element;
14
+ public addContent(content: Element|Node|ElementWrapper): Element|null;
15
15
 
16
16
  public removeContent(content: Element|Node|ElementWrapper): boolean;
17
17
 
@@ -23,11 +23,11 @@ declare class ElementWrapper extends EventDispatcher {
23
23
 
24
24
  public dispose(): void;
25
25
 
26
- public getElement(): Element;
26
+ public getElement(): Element|null;
27
27
 
28
- public getNextSibling(): Element|Node;
28
+ public getNextSibling(): Element|Node|null;
29
29
 
30
- public getParent(): Element|Node;
30
+ public getParent(): Element|Node|null;
31
31
 
32
32
  public setParent(parent: ElementWrapper|Element|Node, opt_prepend?: boolean): void;
33
33
 
@@ -49,12 +49,14 @@ declare class Scrollbar extends ElementWrapper {
49
49
 
50
50
  public setMouseWheelSpeed(val: string): void;
51
51
 
52
- public getDefaultMouseWheelLogic(): ((...params: any[]) => any);
52
+ public getDefaultMouseWheelLogic(): ((...params: any[]) => any)|null;
53
53
 
54
54
  public setScrollingStep(px: number): void;
55
55
 
56
56
  public freezeScrolling(frozen?: boolean): boolean;
57
57
 
58
+ public restoreTrackPosition(): void;
59
+
58
60
  }
59
61
 
60
62
  export default Scrollbar;
@@ -1367,6 +1367,19 @@ Scrollbar.prototype.freezeScrolling = function (frozen) {
1367
1367
  this._isFrozen = frozen !== false;
1368
1368
  return prev;
1369
1369
  };
1370
+ /** @public
1371
+ */
1372
+ Scrollbar.prototype.restoreTrackPosition = function () {
1373
+ // Scroll event will be fired asynchronously, if there is any change
1374
+ var track = this._element;
1375
+ if(this._vertical) {
1376
+ track.scrollTop = this._tScrollVal;
1377
+ if(track.scrollTop){
1378
+ this._tScrollVal = track.scrollTop; //Check to ensure that cache equal to element's scroll
1379
+ }
1380
+ }
1381
+ //TODO: handle restore scrollLeft for hscroll
1382
+ };
1370
1383
 
1371
1384
  Scrollbar._proto = Scrollbar.prototype;
1372
1385
 
@@ -160,10 +160,10 @@ StretchedCells.prototype.getColumnIndex = function (cellRef) {
160
160
  if(cellRef["getElement"]) {
161
161
  var cellElement = cellRef["getElement"]();
162
162
  if(cellElement) {
163
- return cellElement._colIndex || 0;
163
+ return cellElement._colIndex != null ? cellElement._colIndex : -1;
164
164
  }
165
165
  } else {
166
- return cellRef._colIndex || 0;
166
+ return cellRef._colIndex != null ? cellRef._colIndex : -1;
167
167
  }
168
168
  }
169
169
  return -1;