@refinitiv-ui/efx-grid 6.0.0 → 6.0.3

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-format-dialog/lib/column-format-dialog.d.ts +13 -1
  2. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +15 -2
  3. package/lib/column-selection-dialog/lib/column-selection-dialog.js +226 -23
  4. package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
  5. package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
  6. package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
  7. package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
  8. package/lib/core/dist/core.css +1 -1
  9. package/lib/core/dist/core.js +10158 -7908
  10. package/lib/core/dist/core.min.js +1 -1
  11. package/lib/core/es6/data/DataTable.js +32 -10
  12. package/lib/core/es6/data/DataView.d.ts +16 -7
  13. package/lib/core/es6/data/DataView.js +172 -49
  14. package/lib/core/es6/data/Segment.d.ts +2 -0
  15. package/lib/core/es6/data/Segment.js +7 -0
  16. package/lib/core/es6/data/WrappedView.d.ts +289 -0
  17. package/lib/core/es6/data/WrappedView.js +1319 -0
  18. package/lib/core/es6/grid/Core.d.ts +13 -0
  19. package/lib/core/es6/grid/Core.js +406 -160
  20. package/lib/core/es6/grid/ILayoutGrid.d.ts +8 -0
  21. package/lib/core/es6/grid/ILayoutGrid.js +45 -2
  22. package/lib/core/es6/grid/LayoutGrid.d.ts +10 -1
  23. package/lib/core/es6/grid/LayoutGrid.js +257 -82
  24. package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +10 -1
  25. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +316 -24
  26. package/lib/core/es6/grid/components/Column.js +8 -2
  27. package/lib/core/es6/grid/components/HScrollbar.d.ts +4 -0
  28. package/lib/core/es6/grid/components/HScrollbar.js +20 -4
  29. package/lib/core/es6/grid/util/TrackLayout.d.ts +1 -1
  30. package/lib/core/es6/grid/util/TrackLayout.js +2 -3
  31. package/lib/core/es6/tr-grid-theme.js +1 -1
  32. package/lib/filter-dialog/lib/checkbox-list.d.ts +13 -1
  33. package/lib/filter-dialog/lib/filter-dialog.d.ts +13 -1
  34. package/lib/filter-dialog/lib/filter-dialog.js +24 -9
  35. package/lib/grid/lib/efx-grid.d.ts +27 -8
  36. package/lib/grid/lib/efx-grid.js +114 -115
  37. package/lib/grid/themes/base.less +5 -3
  38. package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
  39. package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
  40. package/lib/grid/themes/halo/efx-grid.less +69 -32
  41. package/lib/grid/themes/halo/light/efx-grid.js +1 -1
  42. package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
  43. package/lib/grid/themes/solar/charcoal/efx-grid.js +1 -1
  44. package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
  45. package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
  46. package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
  47. package/lib/index.d.ts +56 -56
  48. package/lib/index.js +56 -56
  49. package/lib/row-segmenting/es6/RowSegmenting.d.ts +1 -0
  50. package/lib/row-segmenting/es6/RowSegmenting.js +43 -12
  51. package/lib/rt-grid/dist/rt-grid.js +10293 -7865
  52. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  53. package/lib/rt-grid/es6/ColumnDefinition.d.ts +4 -1
  54. package/lib/rt-grid/es6/ColumnDefinition.js +3 -0
  55. package/lib/rt-grid/es6/Grid.d.ts +14 -7
  56. package/lib/rt-grid/es6/Grid.js +244 -75
  57. package/lib/rt-grid/es6/RowDefinition.d.ts +4 -1
  58. package/lib/rt-grid/es6/RowDefinition.js +52 -2
  59. package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +1 -1
  60. package/lib/tr-grid-cell-selection/es6/CellSelection.js +53 -40
  61. package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +4 -1
  62. package/lib/tr-grid-checkbox/es6/Checkbox.js +41 -14
  63. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +1 -0
  64. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +10 -0
  65. package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +5 -1
  66. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +226 -4
  67. package/lib/tr-grid-column-stack/es6/ColumnStack.js +3 -0
  68. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +6 -1
  69. package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +4 -2
  70. package/lib/tr-grid-filter-input/es6/FilterInput.js +73 -10
  71. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +1 -1
  72. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +13 -1
  73. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +1 -3
  74. package/lib/tr-grid-row-dragging/es6/RowDragging.js +165 -70
  75. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
  76. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +88 -33
  77. package/lib/tr-grid-row-grouping/es6/RowGrouping.js +41 -31
  78. package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +13 -9
  79. package/lib/tr-grid-row-selection/es6/RowSelection.js +220 -29
  80. package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +2 -0
  81. package/lib/tr-grid-rowcoloring/es6/RowColoring.js +36 -0
  82. package/lib/tr-grid-util/es6/CellPainter.d.ts +8 -8
  83. package/lib/tr-grid-util/es6/Conflator.d.ts +2 -2
  84. package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
  85. package/lib/tr-grid-util/es6/DateTime.d.ts +4 -4
  86. package/lib/tr-grid-util/es6/Delay.d.ts +1 -1
  87. package/lib/tr-grid-util/es6/Dom.d.ts +4 -4
  88. package/lib/tr-grid-util/es6/ElementWrapper.d.ts +1 -1
  89. package/lib/tr-grid-util/es6/ElfDate.d.ts +3 -3
  90. package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -4
  91. package/lib/tr-grid-util/es6/EventDispatcher.d.ts +1 -1
  92. package/lib/tr-grid-util/es6/ExpanderIcon.js +2 -2
  93. package/lib/tr-grid-util/es6/FieldFormatter.d.ts +1 -1
  94. package/lib/tr-grid-util/es6/FilterBuilder.d.ts +5 -5
  95. package/lib/tr-grid-util/es6/GridPlugin.d.ts +3 -3
  96. package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +1 -1
  97. package/lib/tr-grid-util/es6/MultiTableManager.d.ts +10 -2
  98. package/lib/tr-grid-util/es6/MultiTableManager.js +164 -57
  99. package/lib/tr-grid-util/es6/PercentBar.d.ts +1 -1
  100. package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
  101. package/lib/tr-grid-util/es6/Popup.d.ts +2 -2
  102. package/lib/tr-grid-util/es6/RequestQueue.d.ts +1 -1
  103. package/lib/tr-grid-util/es6/RowPainter.d.ts +3 -0
  104. package/lib/tr-grid-util/es6/RowPainter.js +82 -20
  105. package/lib/tr-grid-util/es6/SubTable.d.ts +9 -9
  106. package/lib/tr-grid-util/es6/Table.d.ts +13 -13
  107. package/lib/tr-grid-util/es6/TextHighlighter.d.ts +3 -3
  108. package/lib/tr-grid-util/es6/TickCodes.d.ts +2 -2
  109. package/lib/tr-grid-util/es6/TouchProxy.d.ts +1 -1
  110. package/lib/tr-grid-util/es6/Util.d.ts +6 -6
  111. package/lib/tr-grid-util/es6/formula/Engine.d.ts +5 -5
  112. package/lib/tr-grid-util/es6/formula/Formula.d.ts +3 -3
  113. package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
  114. package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +2 -2
  115. package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +4 -4
  116. package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +1 -1
  117. package/lib/tr-grid-util/es6/jet/MockJET.d.ts +4 -4
  118. package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +11 -11
  119. package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +7 -7
  120. package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +1 -1
  121. package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +1 -1
  122. package/lib/tr-grid-util/es6/jsx.d.ts +223 -0
  123. package/lib/types/es6/CellSelection.d.ts +1 -1
  124. package/lib/types/es6/Checkbox.d.ts +4 -1
  125. package/lib/types/es6/ColumnGrouping.d.ts +1 -0
  126. package/lib/types/es6/ColumnSelection.d.ts +5 -1
  127. package/lib/types/es6/Core/data/DataView.d.ts +16 -7
  128. package/lib/types/es6/Core/data/Segment.d.ts +2 -0
  129. package/lib/types/es6/Core/data/WrappedView.d.ts +289 -0
  130. package/lib/types/es6/Core/grid/Core.d.ts +13 -0
  131. package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +8 -0
  132. package/lib/types/es6/Core/grid/LayoutGrid.d.ts +10 -1
  133. package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +10 -1
  134. package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +4 -0
  135. package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +1 -1
  136. package/lib/types/es6/FilterInput.d.ts +4 -2
  137. package/lib/types/es6/InCellEditing.d.ts +1 -1
  138. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +4 -1
  139. package/lib/types/es6/RealtimeGrid/Grid.d.ts +15 -8
  140. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +4 -1
  141. package/lib/types/es6/RowColoring.d.ts +2 -0
  142. package/lib/types/es6/RowDragging.d.ts +1 -3
  143. package/lib/types/es6/RowFiltering.d.ts +2 -0
  144. package/lib/types/es6/RowSegmenting.d.ts +1 -0
  145. package/lib/types/es6/RowSelection.d.ts +13 -9
  146. package/lib/types/es6/Zoom.d.ts +2 -1
  147. package/lib/types/es6/index.d.ts +3 -0
  148. package/lib/versions.json +19 -19
  149. package/lib/zoom/es6/Zoom.d.ts +2 -1
  150. package/lib/zoom/es6/Zoom.js +11 -4
  151. package/package.json +9 -2
@@ -6,23 +6,47 @@ import Reverter from "./util/Reverter.js";
6
6
  import ILayoutGrid from "./ILayoutGrid.js";
7
7
  import LayoutGrid from "./LayoutGrid.js";
8
8
  import ElementWrapper from "./components/ElementWrapper.js";
9
+ import HScrollbar from "./components/HScrollbar.js";
9
10
  /* eslint-enable */
10
11
 
12
+
13
+ /** @private
14
+ * @function
15
+ * @param {number} idx
16
+ * @param {number} limit
17
+ * @return {number}
18
+ */
19
+ var _validateIndex = function(idx, limit) {
20
+ if(idx > limit) {
21
+ return limit;
22
+ } else if(idx < 0) {
23
+ return 0;
24
+ }
25
+ return idx;
26
+ };
27
+
11
28
  /** @constructor
12
29
  * @ignore
13
- * @param {Element|null=} opt_initializer this can be either element id (string) or DOM element.
14
- * @param {string=} opt_className
30
+ * @param {Object=} options
15
31
  * @extends {ElementWrapper}
16
32
  */
17
- var VirtualizedLayoutGrid = function (opt_initializer, opt_className) {
33
+ var VirtualizedLayoutGrid = function (options) {
18
34
  var _t = this;
19
35
  _t._onRestingPosition = _t._onRestingPosition.bind(_t);
36
+ _t._updateRowBounds = _t._updateRowBounds.bind(_t);
20
37
 
21
- _t._element = opt_initializer ? opt_initializer : document.createElement("div");
22
- _t._element.className = "tr-vlg";
23
- if(opt_className) { _t.enableClass(/** @type{string} */(opt_className), true); }
38
+ _t._element = document.createElement("div");
39
+ _t._element.className = "tr-vlg section";
24
40
 
25
- _t._grid = new LayoutGrid(null, {"owner": this});
41
+ if(!options) {
42
+ options = {};
43
+ }
44
+ if(options["horizontalScrollbar"]) {
45
+ _t._hscrollbar = options["horizontalScrollbar"];
46
+ }
47
+ options["owner"] = this;
48
+
49
+ _t._grid = new LayoutGrid(options);
26
50
  _t._grid.setParent(_t._element);
27
51
 
28
52
  _t._layoutY = new TrackLayout();
@@ -37,19 +61,18 @@ var VirtualizedLayoutGrid = function (opt_initializer, opt_className) {
37
61
  Ext.inherits(VirtualizedLayoutGrid, ElementWrapper);
38
62
 
39
63
 
40
- /** For virtualization in Y-Axis
64
+ /**
41
65
  * @private
42
66
  * @type {number}
43
67
  */
44
68
  VirtualizedLayoutGrid.prototype._index = -1;
45
69
 
46
- /**
70
+ /** Number of rows offsetting from the first section
47
71
  * @private
48
72
  * @type {number}
49
73
  */
50
- VirtualizedLayoutGrid.prototype._indexOffset = 0;
51
-
52
- /**
74
+ VirtualizedLayoutGrid.prototype._rowOffset = 0;
75
+ /** For virtualization in Y-Axis
53
76
  * @private
54
77
  * @type {number}
55
78
  */
@@ -71,9 +94,45 @@ VirtualizedLayoutGrid.prototype._layoutY;
71
94
  VirtualizedLayoutGrid.prototype._selectionList = null;
72
95
 
73
96
  /** @type {Reverter}
74
- * @private
75
- */
97
+ * @private
98
+ */
76
99
  VirtualizedLayoutGrid.prototype._reverter = null;
100
+ /** @type {Element}
101
+ * @private
102
+ */
103
+ VirtualizedLayoutGrid.prototype._rowBound = null;
104
+ /** @type {Element}
105
+ * @private
106
+ */
107
+ VirtualizedLayoutGrid.prototype._cellBound = null;
108
+ /** @type {number}
109
+ * @private
110
+ */
111
+ VirtualizedLayoutGrid.prototype._cbLftIdx = 0;
112
+ /** @type {number}
113
+ * @private
114
+ */
115
+ VirtualizedLayoutGrid.prototype._cbRgtIdx = 0;
116
+ /** @type {number}
117
+ * @private
118
+ */
119
+ VirtualizedLayoutGrid.prototype._cbTopIdx = 0;
120
+ /** @type {number}
121
+ * @private
122
+ */
123
+ VirtualizedLayoutGrid.prototype._cbBtmIdx = 0;
124
+ /** @type {number}
125
+ * @private
126
+ */
127
+ VirtualizedLayoutGrid.prototype._rowBoundTimer = 0;
128
+ /** @type {Element}
129
+ * @private
130
+ */
131
+ VirtualizedLayoutGrid.prototype._boundLayer = null;
132
+ /** @type {HScrollbar}
133
+ * @private
134
+ */
135
+ VirtualizedLayoutGrid.prototype._hscrollbar = null;
77
136
 
78
137
  //#region ====== Override ElementWrapper ======//
79
138
  /** @override */
@@ -95,9 +154,14 @@ VirtualizedLayoutGrid.prototype.dispose = function () {
95
154
  this.setRowCount(0); // Fire rowCountChanged
96
155
  this.unlistenAll();
97
156
 
157
+ this._hscrollbar = null;
98
158
  this._grid.dispose();
99
159
  this._dispose();
100
160
  this._reverter.dispose();
161
+ if(this._rowBoundTimer) {
162
+ clearTimeout(this._rowBoundTimer);
163
+ this._rowBoundTimer = 0;
164
+ }
101
165
  };
102
166
  /** @override */
103
167
  VirtualizedLayoutGrid.prototype.setWidth = function (px) {
@@ -190,6 +254,7 @@ VirtualizedLayoutGrid.prototype.setRowHeight = function (index, val) {
190
254
  if(this._layoutY.setLaneSize(index, val)) {
191
255
  this._grid.setRowHeight(index - this._firstIndex, val);
192
256
  this._element.style.height = this._layoutY.getTrackSize() + "px";
257
+ this._requestUpdatingRowBounds();
193
258
  return this._dispatchRowHeightChangedEvent(index, index + 1);
194
259
  }
195
260
  return false;
@@ -340,6 +405,7 @@ VirtualizedLayoutGrid.prototype.setRowCount = function (val, noBinding) {
340
405
  if(prevCount !== val){
341
406
  this._layoutY.setLaneCount(val);
342
407
  this._element.style.height = this._layoutY.getTrackSize() + "px";
408
+ this._requestUpdatingRowBounds();
343
409
  //After rowCountChanged fires, virtualizer will update virtual row count if
344
410
  //the range of virtual layout changed.
345
411
  this._dispatch("rowCountChanged", { "rowCount": val, "prevCount": prevCount, "noBinding": noBinding });
@@ -481,24 +547,33 @@ VirtualizedLayoutGrid.prototype.isSelectedRow = function (at) {
481
547
  VirtualizedLayoutGrid.prototype.setSelectedRow = function (rowIndex, opt_selected) {
482
548
  this._selectionList.setSelection(rowIndex, opt_selected);
483
549
 
484
- var adjustedIndex = rowIndex - this._firstIndex;
485
- this._grid.setSelectedRow(adjustedIndex, this._selectionList.getSelection(rowIndex));
550
+ var selected = this._selectionList.getSelection(rowIndex);
551
+ this._grid.setSelectedRow(rowIndex - this._firstIndex, selected);
552
+
553
+ if(selected) {
554
+ this._initRowBounds();
555
+ }
556
+ this._updateRowBounds();
486
557
  };
487
558
 
488
559
  /** @inheritDoc */
489
560
  VirtualizedLayoutGrid.prototype.selectSingleRow = function (rowIndex) {
490
- this.clearSelectedRows();
561
+ this._selectionList.clearAllSelections();
562
+ this._grid.clearSelectedRows();
491
563
  this.setSelectedRow(rowIndex);
492
564
  };
493
565
  /** @inheritDoc */
494
566
  VirtualizedLayoutGrid.prototype.selectRowRange = function (rowIndex, length) {
495
567
  this._selectionList.selectRange(rowIndex, length);
496
568
  this._updateRowSelection();
569
+ this._initRowBounds();
570
+ this._updateRowBounds();
497
571
  };
498
572
  /** @inheritDoc */
499
573
  VirtualizedLayoutGrid.prototype.clearSelectedRows = function () {
500
574
  var count = this._selectionList.clearAllSelections();
501
575
  this._grid.clearSelectedRows();
576
+ this._updateRowBounds();
502
577
  return count;
503
578
  };
504
579
  /** @inheritDoc */
@@ -698,8 +773,12 @@ VirtualizedLayoutGrid.prototype.getRowOffset = function(){
698
773
  return this._rowOffset;
699
774
  };
700
775
 
701
- /** @inheritDoc */
702
- VirtualizedLayoutGrid.prototype.updateLayout = function () {};
776
+ /** @public
777
+ * @ignore
778
+ */
779
+ VirtualizedLayoutGrid.prototype.updateLayout = function () {
780
+ this._grid.updateLayout();
781
+ };
703
782
 
704
783
  /** {@link ILayoutGrid#stretchCell}
705
784
  * @inheritDoc */
@@ -722,8 +801,8 @@ VirtualizedLayoutGrid.prototype.unstretchCell = function (cellRef, rowIndex) {
722
801
  };
723
802
  /** {@link ILayoutGrid#unstretchAllCells}
724
803
  * @inheritDoc */
725
- VirtualizedLayoutGrid.prototype.unstretchAllCells = function (cellRef, rowIndex) {
726
- return this._grid.unstretchAllCells();
804
+ VirtualizedLayoutGrid.prototype.unstretchAllCells = function () {
805
+ this._grid.unstretchAllCells();
727
806
  };
728
807
 
729
808
  /** {@link ILayoutGrid#getStretchedCell}
@@ -803,6 +882,220 @@ VirtualizedLayoutGrid.prototype.setRowAttributes = function (rowIndex, func) {
803
882
  VirtualizedLayoutGrid.prototype.getContextRow = function (rowIndex) {
804
883
  return this._grid.getContextRow(rowIndex - this._firstIndex);
805
884
  };
885
+
886
+ /** @public
887
+ * @param {number} colIndex
888
+ * @param {boolean=} selected
889
+ */
890
+ VirtualizedLayoutGrid.prototype.selectColumn = function (colIndex, selected) {
891
+ this._grid.selectColumn(colIndex, selected);
892
+ };
893
+ /** @public
894
+ * @param {number} colIndex
895
+ * @return {boolean}
896
+ */
897
+ VirtualizedLayoutGrid.prototype.isSelectedColumn = function (colIndex) {
898
+ return this._grid.isSelectedColumn(colIndex);
899
+ };
900
+ /** @public
901
+ * @param {number} colIndex
902
+ * @param {number} rowIndex
903
+ * @param {boolean=} selected
904
+ */
905
+ VirtualizedLayoutGrid.prototype.selectCell = function (colIndex, rowIndex, selected) {
906
+ this._grid.selectCell(colIndex, rowIndex - this._firstIndex, selected);
907
+ };
908
+ /** @public
909
+ * @param {number} colIndex
910
+ * @param {number} rowIndex
911
+ * @param {number} width
912
+ * @param {number} height
913
+ */
914
+ VirtualizedLayoutGrid.prototype.setCellBounds = function (colIndex, rowIndex, width, height) {
915
+ var cellBound = this._cellBound;
916
+ if(!cellBound) {
917
+ cellBound = this._cellBound = document.createElement("div");
918
+ cellBound.className = "selection-bound";
919
+ }
920
+ this._initBoundLayer();
921
+
922
+ // Validate inputs
923
+ var rgtIndex = colIndex + width; // Exclusive
924
+ var btmIndex = rowIndex + height; // Exclusive
925
+
926
+ var colCount = this.getColumnCount();
927
+ var rowCount = this._layoutY.getLaneCount();
928
+
929
+ this._cbLftIdx = _validateIndex(colIndex, colCount);
930
+ this._cbRgtIdx = _validateIndex(rgtIndex, colCount);
931
+ this._cbTopIdx = _validateIndex(rowIndex, rowCount);
932
+ this._cbBtmIdx = _validateIndex(btmIndex, rowCount);
933
+
934
+ this._updateCellBounds();
935
+ };
936
+ /** @public
937
+ * @ignore
938
+ * @return {!TrackLayout}
939
+ */
940
+ VirtualizedLayoutGrid.prototype.getHorizontalLayout = function () {
941
+ return this._grid.getHorizontalLayout();
942
+ };
943
+ /** @public
944
+ * @ignore
945
+ * @param {number} lftIdx
946
+ * @param {number} rgtIdx Inclusive index
947
+ * @param {!Array.<number>} outPositions
948
+ * @param {!Array.<boolean>} outNoBorders
949
+ */
950
+ VirtualizedLayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositions, outNoBorders) {
951
+ this._grid.calculateColumnBounds(lftIdx, rgtIdx, outPositions, outNoBorders);
952
+ };
953
+ /** @private
954
+ */
955
+ VirtualizedLayoutGrid.prototype._updateCellBounds = function () {
956
+ var cellBound = this._cellBound;
957
+ if(!cellBound) {
958
+ return;
959
+ }
960
+
961
+ var layoutX = this.getHorizontalLayout();
962
+ var layoutY = this._layoutY;
963
+ var lftIdx = this._cbLftIdx;
964
+ var rgtIdx = this._cbRgtIdx; // Exclusive
965
+ var topIdx = this._cbTopIdx;
966
+ var btmIdx = this._cbBtmIdx; // Exclusive
967
+ var lftPx, rgtPx, topPx, btmPx;
968
+ lftPx = rgtPx = topPx = btmPx = 0;
969
+ if(lftIdx < rgtIdx && topIdx < btmIdx) {
970
+ lftPx = layoutX.getLaneStart(lftIdx);
971
+ rgtPx = layoutX.getLaneEnd(rgtIdx - 1);
972
+ topPx = layoutY.getLaneStart(topIdx);
973
+ btmPx = layoutY.getLaneEnd(btmIdx - 1);
974
+ }
975
+
976
+ var width = rgtPx - lftPx;
977
+ var height = btmPx - topPx;
978
+ var noBorders = [false, false];
979
+ if(width > 0 && height > 0 && this._hscrollbar) {
980
+ var positions = [0, 0];
981
+ this.calculateColumnBounds(lftIdx, rgtIdx - 1, positions, noBorders);
982
+ lftPx = positions[0];
983
+ rgtPx = positions[1];
984
+ width = rgtPx - lftPx;
985
+ }
986
+
987
+ if(width > 0) {
988
+ cellBound.style.left = lftPx + "px";
989
+ cellBound.style.top = topPx + "px";
990
+ cellBound.style.width = width + "px";
991
+ cellBound.style.height = height + "px";
992
+
993
+ cellBound.classList.toggle("no-left-bound", noBorders[0]);
994
+ cellBound.classList.toggle("no-right-bound", noBorders[1]);
995
+
996
+ if(this._boundLayer) {
997
+ this._boundLayer.appendChild(cellBound);
998
+ }
999
+ } else {
1000
+ var pn = cellBound.parentNode;
1001
+ if(pn) {
1002
+ pn.removeChild(cellBound);
1003
+ }
1004
+ }
1005
+ };
1006
+ /** @public
1007
+ * @ignore
1008
+ * @param {!Array.<number>} positions Left and right bound positions in pixel
1009
+ * @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
1010
+ */
1011
+ VirtualizedLayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
1012
+ this._grid.updateColumnBounds(positions, noBorders);
1013
+ this._updateRowBounds();
1014
+ };
1015
+ /** @private
1016
+ */
1017
+ VirtualizedLayoutGrid.prototype._initBoundLayer = function () {
1018
+ var boundLayer = this._boundLayer;
1019
+ if(!boundLayer) {
1020
+ boundLayer = this._boundLayer = document.createElement("div");
1021
+ boundLayer.className = "cover-layer";
1022
+ this._element.appendChild(boundLayer);
1023
+ }
1024
+ };
1025
+ /** @private
1026
+ */
1027
+ VirtualizedLayoutGrid.prototype._initRowBounds = function () {
1028
+ var rowBound = this._rowBound;
1029
+ if(!rowBound) {
1030
+ rowBound = this._rowBound = document.createElement("div");
1031
+ rowBound.className = "selection-bound";
1032
+ }
1033
+ this._initBoundLayer();
1034
+ };
1035
+ /** @private
1036
+ */
1037
+ VirtualizedLayoutGrid.prototype._requestUpdatingRowBounds = function () {
1038
+ if(!this._rowBoundTimer) {
1039
+ this._rowBoundTimer = setTimeout(this._updateRowBounds, 10);
1040
+ }
1041
+ };
1042
+ /** @private
1043
+ */
1044
+ VirtualizedLayoutGrid.prototype._updateRowBounds = function () {
1045
+ this._rowBoundTimer = 0;
1046
+ this._updateCellBounds();
1047
+
1048
+ var rowBound = this._rowBound;
1049
+ if(!rowBound) {
1050
+ return;
1051
+ }
1052
+ var topIdx = this.getFirstSelectedRow();
1053
+ var btmIdx = -1; // Inclusive
1054
+ var topPx = 0;
1055
+ var btmPx = 0;
1056
+ var rowCount = this._layoutY.getLaneCount();
1057
+ if(topIdx >= rowCount) {
1058
+ topIdx = rowCount - 1;
1059
+ }
1060
+ if(topIdx >= 0) {
1061
+ btmIdx = this.getLastSelectedRow();
1062
+ if(btmIdx >= rowCount) {
1063
+ btmIdx = rowCount - 1;
1064
+ }
1065
+ topPx = this._layoutY.getLaneStart(topIdx);
1066
+ btmPx = this._layoutY.getLaneEnd(btmIdx);
1067
+ }
1068
+
1069
+ if(topPx >= btmPx) {
1070
+ var pn = rowBound.parentNode;
1071
+ if(pn) {
1072
+ pn.removeChild(rowBound);
1073
+ }
1074
+ } else {
1075
+ rowBound.style.top = topPx + "px";
1076
+ rowBound.style.height = (btmPx - topPx) + "px";
1077
+
1078
+ var boundWidth = this._grid._getViewSize();
1079
+ rowBound.style.width = boundWidth + "px";
1080
+
1081
+ var scrollLeft = 0;
1082
+ var pinnedLftCount = 0;
1083
+ var pinnedRgtCount = 0;
1084
+ var endOfScroll = false;
1085
+ if(this._hscrollbar) {
1086
+ scrollLeft = this._hscrollbar.getScrollLeft();
1087
+ pinnedLftCount = this._hscrollbar.getPinnedLeftColumnCount();
1088
+ pinnedRgtCount = this._hscrollbar.getPinnedRightColumnCount();
1089
+ endOfScroll = this._hscrollbar.isEndOfHorizontalScroll();
1090
+ }
1091
+ rowBound.classList.toggle("no-left-bound", !pinnedLftCount && scrollLeft > 0);
1092
+ rowBound.classList.toggle("no-right-bound", !pinnedRgtCount && !endOfScroll);
1093
+
1094
+ if(this._boundLayer) {
1095
+ this._boundLayer.appendChild(rowBound);
1096
+ }
1097
+ }
1098
+ };
806
1099
  //#endregion public methods
807
1100
 
808
1101
  //#region ====== Private methods ======//
@@ -873,10 +1166,9 @@ VirtualizedLayoutGrid.prototype._onRestingPosition = function () {
873
1166
  };
874
1167
  /** @public
875
1168
  * @ignore
876
- * @param {boolean} absolutePos if true, the right space element will be positioned absolutely
877
1169
  */
878
- VirtualizedLayoutGrid.prototype._updateRightSpaceStyle = function(absolutePos) {
879
- this._grid._updateRightSpaceStyle(absolutePos);
1170
+ VirtualizedLayoutGrid.prototype._updateRightSpaceStyle = function() {
1171
+ this._grid._updateRightSpaceStyle();
880
1172
  };
881
1173
  /** @public
882
1174
  * @ignore
@@ -178,10 +178,16 @@ Column.prototype.show = function (opt_shown) {
178
178
  */
179
179
  Column.prototype.setWidth = function (val) {
180
180
  this._element.style.width = val + "px";
181
- var magnitude = (val > 0 && val <= 60) ? 3 - Math.floor((val - 0.01) / 20) : 0;
182
- if(magnitude < 0 || magnitude > 3) {
181
+ var magnitude = 0;
182
+ if(val > 0 && val <= 24){
183
183
  magnitude = 3;
184
184
  }
185
+ else if(val > 24 && val <= 40){
186
+ magnitude = 2;
187
+ }
188
+ else if(val > 40 && val < 60){
189
+ magnitude = 1;
190
+ }
185
191
 
186
192
  var i;
187
193
  var sc = this._sizeClasses;
@@ -8,6 +8,10 @@ declare class HScrollbar extends Scrollbar {
8
8
 
9
9
  public setScrollLeft(px: number): void;
10
10
 
11
+ public getPinnedLeftColumnCount(): number;
12
+
13
+ public getPinnedRightColumnCount(): number;
14
+
11
15
  public isEndOfHorizontalScroll(): boolean;
12
16
 
13
17
  public getContentWidth(): number;
@@ -26,6 +26,10 @@ var HScrollbar = function () {
26
26
  };
27
27
  Ext.inherits(HScrollbar, Scrollbar);
28
28
 
29
+ /** @type {number}
30
+ * @private
31
+ */
32
+ HScrollbar.prototype._pinnedLeftColumnCount = 0;
29
33
  /** @type {number}
30
34
  * @private
31
35
  */
@@ -45,6 +49,7 @@ HScrollbar.prototype.setScrollContent = function (grid, sections, startColIndex,
45
49
  var sectionCount = sections.length;
46
50
  if(sectionCount <= 0) { return; }
47
51
 
52
+ this._pinnedLeftColumnCount = startColIndex >= 0 ? startColIndex : 0;
48
53
  this._pinnedRightColumnCount = pinnedRightColumn > 0 ? pinnedRightColumn : 0;
49
54
  var section = sections[0];
50
55
  var colCount = section.getColumnCount();
@@ -62,8 +67,6 @@ HScrollbar.prototype.setScrollContent = function (grid, sections, startColIndex,
62
67
  var paneElem = pane.getElement();
63
68
  var sliderElem = paneSlider.getElement();
64
69
 
65
- paneElem.classList.toggle("right-pinning", this._pinnedRightColumnCount ? true : false);
66
-
67
70
  var c;
68
71
  var column;
69
72
  for (c = 0; c < startColIndex; ++c) {
@@ -91,10 +94,10 @@ HScrollbar.prototype.setScrollContent = function (grid, sections, startColIndex,
91
94
  paneSlider.addContent(rs);
92
95
  content.push(rs);
93
96
  }
94
- section._updateRightSpaceStyle(this.isActive() && !this._pinnedRightColumnCount);
97
+ section._updateRightSpaceStyle();
95
98
  }
96
99
  section._updateLayers(); // Order of the layers may be changed due to change in rightspace and/or column pinning
97
- paneSlider._titleSection = section.getElement().classList.contains("title"); // To cache virtualized title section
100
+ paneSlider._titleSection = section.hasClass("title"); // To cache virtualized title section
98
101
  paneSlider._columns = columns; // To cache virtualized columns
99
102
  paneSlider._content = content; // To cache virtualized columns
100
103
  }
@@ -125,6 +128,19 @@ HScrollbar.prototype.setScrollLeft = function (px) {
125
128
  this._scrollTo(px); // "scroll" event may be fired
126
129
  };
127
130
 
131
+ /** @public
132
+ * @return {number}
133
+ */
134
+ HScrollbar.prototype.getPinnedLeftColumnCount = function () {
135
+ return this.isEnabled() ? this._pinnedLeftColumnCount : 0;
136
+ };
137
+ /** @public
138
+ * @return {number}
139
+ */
140
+ HScrollbar.prototype.getPinnedRightColumnCount = function () {
141
+ return this.isEnabled() ? this._pinnedRightColumnCount : 0;
142
+ };
143
+
128
144
  /** @public
129
145
  * @ignore
130
146
  * @param {number} val
@@ -36,7 +36,7 @@ declare class TrackLayout {
36
36
 
37
37
  public getTrackSize(): number;
38
38
 
39
- public setTrackSize(targetSize: number, reserveSpace: number): (number)[]|null;
39
+ public setTrackSize(targetSize: number): (number)[]|null;
40
40
 
41
41
  public getLaneStart(index: number): number;
42
42
 
@@ -279,10 +279,9 @@ TrackLayout.prototype.getTrackSize = function () {
279
279
  * If all lanes are eqaul in size (even zero size), they all will be weighted equally
280
280
  * @public
281
281
  * @param {number} targetSize
282
- * @param {number} reserveSpace
283
282
  * @return {Array.<number>|null} Array of size adjustment. Return null if there is no change
284
283
  */
285
- TrackLayout.prototype.setTrackSize = function (targetSize, reserveSpace) {
284
+ TrackLayout.prototype.setTrackSize = function (targetSize) {
286
285
  var i = 0, fixedSize = 0;
287
286
  var indices = [];
288
287
  // Collecting current data for calculation
@@ -302,7 +301,7 @@ TrackLayout.prototype.setTrackSize = function (targetSize, reserveSpace) {
302
301
  }
303
302
  if (indices.length <= 0) { return null; }
304
303
 
305
- var distributions = this._distributeLaneSize(targetSize - fixedSize - reserveSpace, indices);
304
+ var distributions = this._distributeLaneSize(targetSize - fixedSize, indices);
306
305
 
307
306
  // Find any change to flexible lane size
308
307
  var dirty = false;