@refinitiv-ui/efx-grid 6.0.1 → 6.0.2
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.
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +80 -18
- package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/core/dist/core.css +1 -1
- package/lib/core/dist/core.js +12961 -10749
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataView.d.ts +22 -7
- package/lib/core/es6/data/DataView.js +176 -49
- package/lib/core/es6/data/WrappedView.d.ts +289 -0
- package/lib/core/es6/data/WrappedView.js +1319 -0
- package/lib/core/es6/grid/Core.d.ts +13 -0
- package/lib/core/es6/grid/Core.js +393 -155
- package/lib/core/es6/grid/ILayoutGrid.d.ts +8 -0
- package/lib/core/es6/grid/ILayoutGrid.js +45 -2
- package/lib/core/es6/grid/LayoutGrid.d.ts +10 -1
- package/lib/core/es6/grid/LayoutGrid.js +257 -82
- package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +10 -1
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +314 -27
- package/lib/core/es6/grid/components/Column.js +8 -2
- package/lib/core/es6/grid/components/HScrollbar.d.ts +4 -0
- package/lib/core/es6/grid/components/HScrollbar.js +20 -4
- package/lib/core/es6/grid/util/TrackLayout.d.ts +1 -1
- package/lib/core/es6/grid/util/TrackLayout.js +2 -3
- package/lib/core/es6/tr-grid-theme.js +1 -1
- package/lib/filter-dialog/lib/filter-dialog.js +8 -6
- package/lib/grid/lib/efx-grid.d.ts +14 -7
- package/lib/grid/lib/efx-grid.js +113 -114
- package/lib/grid/themes/base.less +4 -2
- package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
- package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/grid/themes/halo/efx-grid.less +69 -32
- package/lib/grid/themes/halo/light/efx-grid.js +1 -1
- package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/grid/themes/solar/charcoal/efx-grid.js +1 -1
- package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
- package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
- package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +1 -0
- package/lib/row-segmenting/es6/RowSegmenting.js +40 -11
- package/lib/rt-grid/dist/rt-grid.js +10290 -7864
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +4 -1
- package/lib/rt-grid/es6/ColumnDefinition.js +3 -0
- package/lib/rt-grid/es6/Grid.d.ts +14 -7
- package/lib/rt-grid/es6/Grid.js +241 -74
- package/lib/rt-grid/es6/RowDefinition.d.ts +4 -1
- package/lib/rt-grid/es6/RowDefinition.js +52 -2
- package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +1 -1
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +53 -40
- package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +2 -0
- package/lib/tr-grid-checkbox/es6/Checkbox.js +29 -14
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +1 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +10 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +5 -1
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +226 -4
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +3 -0
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +1 -0
- package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +4 -2
- package/lib/tr-grid-filter-input/es6/FilterInput.js +73 -10
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +102 -12
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +88 -33
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +41 -31
- package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +5 -1
- package/lib/tr-grid-row-selection/es6/RowSelection.js +188 -7
- package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +2 -0
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +36 -0
- package/lib/tr-grid-util/es6/CellPainter.d.ts +8 -8
- package/lib/tr-grid-util/es6/Conflator.d.ts +2 -2
- package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
- package/lib/tr-grid-util/es6/DateTime.d.ts +4 -4
- package/lib/tr-grid-util/es6/Delay.d.ts +1 -1
- package/lib/tr-grid-util/es6/Dom.d.ts +4 -4
- package/lib/tr-grid-util/es6/ElementWrapper.d.ts +1 -1
- package/lib/tr-grid-util/es6/ElfDate.d.ts +3 -3
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -4
- package/lib/tr-grid-util/es6/EventDispatcher.d.ts +1 -1
- package/lib/tr-grid-util/es6/FieldFormatter.d.ts +1 -1
- package/lib/tr-grid-util/es6/FilterBuilder.d.ts +5 -5
- package/lib/tr-grid-util/es6/GridPlugin.d.ts +3 -3
- package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +1 -1
- package/lib/tr-grid-util/es6/MultiTableManager.d.ts +2 -2
- package/lib/tr-grid-util/es6/PercentBar.d.ts +1 -1
- package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
- package/lib/tr-grid-util/es6/Popup.d.ts +2 -2
- package/lib/tr-grid-util/es6/RequestQueue.d.ts +1 -1
- package/lib/tr-grid-util/es6/RowPainter.d.ts +3 -0
- package/lib/tr-grid-util/es6/RowPainter.js +66 -12
- package/lib/tr-grid-util/es6/SubTable.d.ts +9 -9
- package/lib/tr-grid-util/es6/Table.d.ts +13 -13
- package/lib/tr-grid-util/es6/TextHighlighter.d.ts +3 -3
- package/lib/tr-grid-util/es6/TickCodes.d.ts +2 -2
- package/lib/tr-grid-util/es6/TouchProxy.d.ts +1 -1
- package/lib/tr-grid-util/es6/Util.d.ts +6 -6
- package/lib/tr-grid-util/es6/formula/Engine.d.ts +5 -5
- package/lib/tr-grid-util/es6/formula/Formula.d.ts +3 -3
- package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +2 -2
- package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +4 -4
- package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/MockJET.d.ts +4 -4
- package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +11 -11
- package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +7 -7
- package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +1 -1
- package/lib/types/es6/CellSelection.d.ts +1 -1
- package/lib/types/es6/Checkbox.d.ts +2 -0
- package/lib/types/es6/ColumnGrouping.d.ts +1 -0
- package/lib/types/es6/ColumnSelection.d.ts +5 -1
- package/lib/types/es6/Core/data/DataView.d.ts +22 -7
- package/lib/types/es6/Core/data/WrappedView.d.ts +289 -0
- package/lib/types/es6/Core/grid/Core.d.ts +13 -0
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +8 -0
- package/lib/types/es6/Core/grid/LayoutGrid.d.ts +10 -1
- package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +10 -1
- package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +4 -0
- package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +1 -1
- package/lib/types/es6/FilterInput.d.ts +4 -2
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +4 -1
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +15 -8
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +4 -1
- package/lib/types/es6/RowColoring.d.ts +2 -0
- package/lib/types/es6/RowFiltering.d.ts +2 -0
- package/lib/types/es6/RowSegmenting.d.ts +1 -0
- package/lib/types/es6/RowSelection.d.ts +5 -1
- package/lib/types/es6/Zoom.d.ts +2 -1
- package/lib/types/es6/index.d.ts +2 -0
- package/lib/versions.json +17 -17
- package/lib/zoom/es6/Zoom.d.ts +2 -1
- package/lib/zoom/es6/Zoom.js +11 -4
- package/package.json +7 -7
@@ -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 {
|
14
|
-
* @param {string=} opt_className
|
30
|
+
* @param {Object=} options
|
15
31
|
* @extends {ElementWrapper}
|
16
32
|
*/
|
17
|
-
var VirtualizedLayoutGrid = function (
|
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 =
|
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
|
-
|
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,13 @@ var VirtualizedLayoutGrid = function (opt_initializer, opt_className) {
|
|
37
61
|
Ext.inherits(VirtualizedLayoutGrid, ElementWrapper);
|
38
62
|
|
39
63
|
|
40
|
-
/** For virtualization in Y-Axis
|
41
|
-
* @private
|
42
|
-
* @type {number}
|
43
|
-
*/
|
44
|
-
VirtualizedLayoutGrid.prototype._index = -1;
|
45
|
-
|
46
64
|
/**
|
47
65
|
* @private
|
48
66
|
* @type {number}
|
49
67
|
*/
|
50
|
-
VirtualizedLayoutGrid.prototype.
|
68
|
+
VirtualizedLayoutGrid.prototype._index = -1;
|
51
69
|
|
52
|
-
/**
|
70
|
+
/** For virtualization in Y-Axis
|
53
71
|
* @private
|
54
72
|
* @type {number}
|
55
73
|
*/
|
@@ -71,9 +89,45 @@ VirtualizedLayoutGrid.prototype._layoutY;
|
|
71
89
|
VirtualizedLayoutGrid.prototype._selectionList = null;
|
72
90
|
|
73
91
|
/** @type {Reverter}
|
74
|
-
|
75
|
-
|
92
|
+
* @private
|
93
|
+
*/
|
76
94
|
VirtualizedLayoutGrid.prototype._reverter = null;
|
95
|
+
/** @type {Element}
|
96
|
+
* @private
|
97
|
+
*/
|
98
|
+
VirtualizedLayoutGrid.prototype._rowBound = null;
|
99
|
+
/** @type {Element}
|
100
|
+
* @private
|
101
|
+
*/
|
102
|
+
VirtualizedLayoutGrid.prototype._cellBound = null;
|
103
|
+
/** @type {number}
|
104
|
+
* @private
|
105
|
+
*/
|
106
|
+
VirtualizedLayoutGrid.prototype._cbLftIdx = 0;
|
107
|
+
/** @type {number}
|
108
|
+
* @private
|
109
|
+
*/
|
110
|
+
VirtualizedLayoutGrid.prototype._cbRgtIdx = 0;
|
111
|
+
/** @type {number}
|
112
|
+
* @private
|
113
|
+
*/
|
114
|
+
VirtualizedLayoutGrid.prototype._cbTopIdx = 0;
|
115
|
+
/** @type {number}
|
116
|
+
* @private
|
117
|
+
*/
|
118
|
+
VirtualizedLayoutGrid.prototype._cbBtmIdx = 0;
|
119
|
+
/** @type {number}
|
120
|
+
* @private
|
121
|
+
*/
|
122
|
+
VirtualizedLayoutGrid.prototype._rowBoundTimer = 0;
|
123
|
+
/** @type {Element}
|
124
|
+
* @private
|
125
|
+
*/
|
126
|
+
VirtualizedLayoutGrid.prototype._boundLayer = null;
|
127
|
+
/** @type {HScrollbar}
|
128
|
+
* @private
|
129
|
+
*/
|
130
|
+
VirtualizedLayoutGrid.prototype._hscrollbar = null;
|
77
131
|
|
78
132
|
//#region ====== Override ElementWrapper ======//
|
79
133
|
/** @override */
|
@@ -95,9 +149,14 @@ VirtualizedLayoutGrid.prototype.dispose = function () {
|
|
95
149
|
this.setRowCount(0); // Fire rowCountChanged
|
96
150
|
this.unlistenAll();
|
97
151
|
|
152
|
+
this._hscrollbar = null;
|
98
153
|
this._grid.dispose();
|
99
154
|
this._dispose();
|
100
155
|
this._reverter.dispose();
|
156
|
+
if(this._rowBoundTimer) {
|
157
|
+
clearTimeout(this._rowBoundTimer);
|
158
|
+
this._rowBoundTimer = 0;
|
159
|
+
}
|
101
160
|
};
|
102
161
|
/** @override */
|
103
162
|
VirtualizedLayoutGrid.prototype.setWidth = function (px) {
|
@@ -190,6 +249,7 @@ VirtualizedLayoutGrid.prototype.setRowHeight = function (index, val) {
|
|
190
249
|
if(this._layoutY.setLaneSize(index, val)) {
|
191
250
|
this._grid.setRowHeight(index - this._firstIndex, val);
|
192
251
|
this._element.style.height = this._layoutY.getTrackSize() + "px";
|
252
|
+
this._requestUpdatingRowBounds();
|
193
253
|
return this._dispatchRowHeightChangedEvent(index, index + 1);
|
194
254
|
}
|
195
255
|
return false;
|
@@ -340,6 +400,7 @@ VirtualizedLayoutGrid.prototype.setRowCount = function (val, noBinding) {
|
|
340
400
|
if(prevCount !== val){
|
341
401
|
this._layoutY.setLaneCount(val);
|
342
402
|
this._element.style.height = this._layoutY.getTrackSize() + "px";
|
403
|
+
this._requestUpdatingRowBounds();
|
343
404
|
//After rowCountChanged fires, virtualizer will update virtual row count if
|
344
405
|
//the range of virtual layout changed.
|
345
406
|
this._dispatch("rowCountChanged", { "rowCount": val, "prevCount": prevCount, "noBinding": noBinding });
|
@@ -481,24 +542,33 @@ VirtualizedLayoutGrid.prototype.isSelectedRow = function (at) {
|
|
481
542
|
VirtualizedLayoutGrid.prototype.setSelectedRow = function (rowIndex, opt_selected) {
|
482
543
|
this._selectionList.setSelection(rowIndex, opt_selected);
|
483
544
|
|
484
|
-
var
|
485
|
-
this._grid.setSelectedRow(
|
545
|
+
var selected = this._selectionList.getSelection(rowIndex);
|
546
|
+
this._grid.setSelectedRow(rowIndex - this._firstIndex, selected);
|
547
|
+
|
548
|
+
if(selected) {
|
549
|
+
this._initRowBounds();
|
550
|
+
}
|
551
|
+
this._updateRowBounds();
|
486
552
|
};
|
487
553
|
|
488
554
|
/** @inheritDoc */
|
489
555
|
VirtualizedLayoutGrid.prototype.selectSingleRow = function (rowIndex) {
|
490
|
-
this.
|
556
|
+
this._selectionList.clearAllSelections();
|
557
|
+
this._grid.clearSelectedRows();
|
491
558
|
this.setSelectedRow(rowIndex);
|
492
559
|
};
|
493
560
|
/** @inheritDoc */
|
494
561
|
VirtualizedLayoutGrid.prototype.selectRowRange = function (rowIndex, length) {
|
495
562
|
this._selectionList.selectRange(rowIndex, length);
|
496
563
|
this._updateRowSelection();
|
564
|
+
this._initRowBounds();
|
565
|
+
this._updateRowBounds();
|
497
566
|
};
|
498
567
|
/** @inheritDoc */
|
499
568
|
VirtualizedLayoutGrid.prototype.clearSelectedRows = function () {
|
500
569
|
var count = this._selectionList.clearAllSelections();
|
501
570
|
this._grid.clearSelectedRows();
|
571
|
+
this._updateRowBounds();
|
502
572
|
return count;
|
503
573
|
};
|
504
574
|
/** @inheritDoc */
|
@@ -698,8 +768,12 @@ VirtualizedLayoutGrid.prototype.getRowOffset = function(){
|
|
698
768
|
return this._rowOffset;
|
699
769
|
};
|
700
770
|
|
701
|
-
/** @
|
702
|
-
|
771
|
+
/** @public
|
772
|
+
* @ignore
|
773
|
+
*/
|
774
|
+
VirtualizedLayoutGrid.prototype.updateLayout = function () {
|
775
|
+
this._grid.updateLayout();
|
776
|
+
};
|
703
777
|
|
704
778
|
/** {@link ILayoutGrid#stretchCell}
|
705
779
|
* @inheritDoc */
|
@@ -722,8 +796,8 @@ VirtualizedLayoutGrid.prototype.unstretchCell = function (cellRef, rowIndex) {
|
|
722
796
|
};
|
723
797
|
/** {@link ILayoutGrid#unstretchAllCells}
|
724
798
|
* @inheritDoc */
|
725
|
-
VirtualizedLayoutGrid.prototype.unstretchAllCells = function (
|
726
|
-
|
799
|
+
VirtualizedLayoutGrid.prototype.unstretchAllCells = function () {
|
800
|
+
this._grid.unstretchAllCells();
|
727
801
|
};
|
728
802
|
|
729
803
|
/** {@link ILayoutGrid#getStretchedCell}
|
@@ -803,6 +877,220 @@ VirtualizedLayoutGrid.prototype.setRowAttributes = function (rowIndex, func) {
|
|
803
877
|
VirtualizedLayoutGrid.prototype.getContextRow = function (rowIndex) {
|
804
878
|
return this._grid.getContextRow(rowIndex - this._firstIndex);
|
805
879
|
};
|
880
|
+
|
881
|
+
/** @public
|
882
|
+
* @param {number} colIndex
|
883
|
+
* @param {boolean=} selected
|
884
|
+
*/
|
885
|
+
VirtualizedLayoutGrid.prototype.selectColumn = function (colIndex, selected) {
|
886
|
+
this._grid.selectColumn(colIndex, selected);
|
887
|
+
};
|
888
|
+
/** @public
|
889
|
+
* @param {number} colIndex
|
890
|
+
* @return {boolean}
|
891
|
+
*/
|
892
|
+
VirtualizedLayoutGrid.prototype.isSelectedColumn = function (colIndex) {
|
893
|
+
return this._grid.isSelectedColumn(colIndex);
|
894
|
+
};
|
895
|
+
/** @public
|
896
|
+
* @param {number} colIndex
|
897
|
+
* @param {number} rowIndex
|
898
|
+
* @param {boolean=} selected
|
899
|
+
*/
|
900
|
+
VirtualizedLayoutGrid.prototype.selectCell = function (colIndex, rowIndex, selected) {
|
901
|
+
this._grid.selectCell(colIndex, rowIndex - this._firstIndex, selected);
|
902
|
+
};
|
903
|
+
/** @public
|
904
|
+
* @param {number} colIndex
|
905
|
+
* @param {number} rowIndex
|
906
|
+
* @param {number} width
|
907
|
+
* @param {number} height
|
908
|
+
*/
|
909
|
+
VirtualizedLayoutGrid.prototype.setCellBounds = function (colIndex, rowIndex, width, height) {
|
910
|
+
var cellBound = this._cellBound;
|
911
|
+
if(!cellBound) {
|
912
|
+
cellBound = this._cellBound = document.createElement("div");
|
913
|
+
cellBound.className = "selection-bound";
|
914
|
+
}
|
915
|
+
this._initBoundLayer();
|
916
|
+
|
917
|
+
// Validate inputs
|
918
|
+
var rgtIndex = colIndex + width; // Exclusive
|
919
|
+
var btmIndex = rowIndex + height; // Exclusive
|
920
|
+
|
921
|
+
var colCount = this.getColumnCount();
|
922
|
+
var rowCount = this._layoutY.getLaneCount();
|
923
|
+
|
924
|
+
this._cbLftIdx = _validateIndex(colIndex, colCount);
|
925
|
+
this._cbRgtIdx = _validateIndex(rgtIndex, colCount);
|
926
|
+
this._cbTopIdx = _validateIndex(rowIndex, rowCount);
|
927
|
+
this._cbBtmIdx = _validateIndex(btmIndex, rowCount);
|
928
|
+
|
929
|
+
this._updateCellBounds();
|
930
|
+
};
|
931
|
+
/** @public
|
932
|
+
* @ignore
|
933
|
+
* @return {!TrackLayout}
|
934
|
+
*/
|
935
|
+
VirtualizedLayoutGrid.prototype.getHorizontalLayout = function () {
|
936
|
+
return this._grid.getHorizontalLayout();
|
937
|
+
};
|
938
|
+
/** @public
|
939
|
+
* @ignore
|
940
|
+
* @param {number} lftIdx
|
941
|
+
* @param {number} rgtIdx Inclusive index
|
942
|
+
* @param {!Array.<number>} outPositions
|
943
|
+
* @param {!Array.<boolean>} outNoBorders
|
944
|
+
*/
|
945
|
+
VirtualizedLayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositions, outNoBorders) {
|
946
|
+
this._grid.calculateColumnBounds(lftIdx, rgtIdx, outPositions, outNoBorders);
|
947
|
+
};
|
948
|
+
/** @private
|
949
|
+
*/
|
950
|
+
VirtualizedLayoutGrid.prototype._updateCellBounds = function () {
|
951
|
+
var cellBound = this._cellBound;
|
952
|
+
if(!cellBound) {
|
953
|
+
return;
|
954
|
+
}
|
955
|
+
|
956
|
+
var layoutX = this.getHorizontalLayout();
|
957
|
+
var layoutY = this._layoutY;
|
958
|
+
var lftIdx = this._cbLftIdx;
|
959
|
+
var rgtIdx = this._cbRgtIdx; // Exclusive
|
960
|
+
var topIdx = this._cbTopIdx;
|
961
|
+
var btmIdx = this._cbBtmIdx; // Exclusive
|
962
|
+
var lftPx, rgtPx, topPx, btmPx;
|
963
|
+
lftPx = rgtPx = topPx = btmPx = 0;
|
964
|
+
if(lftIdx < rgtIdx && topIdx < btmIdx) {
|
965
|
+
lftPx = layoutX.getLaneStart(lftIdx);
|
966
|
+
rgtPx = layoutX.getLaneEnd(rgtIdx - 1);
|
967
|
+
topPx = layoutY.getLaneStart(topIdx);
|
968
|
+
btmPx = layoutY.getLaneEnd(btmIdx - 1);
|
969
|
+
}
|
970
|
+
|
971
|
+
var width = rgtPx - lftPx;
|
972
|
+
var height = btmPx - topPx;
|
973
|
+
var noBorders = [false, false];
|
974
|
+
if(width > 0 && height > 0 && this._hscrollbar) {
|
975
|
+
var positions = [0, 0];
|
976
|
+
this.calculateColumnBounds(lftIdx, rgtIdx - 1, positions, noBorders);
|
977
|
+
lftPx = positions[0];
|
978
|
+
rgtPx = positions[1];
|
979
|
+
width = rgtPx - lftPx;
|
980
|
+
}
|
981
|
+
|
982
|
+
if(width > 0) {
|
983
|
+
cellBound.style.left = lftPx + "px";
|
984
|
+
cellBound.style.top = topPx + "px";
|
985
|
+
cellBound.style.width = width + "px";
|
986
|
+
cellBound.style.height = height + "px";
|
987
|
+
|
988
|
+
cellBound.classList.toggle("no-left-bound", noBorders[0]);
|
989
|
+
cellBound.classList.toggle("no-right-bound", noBorders[1]);
|
990
|
+
|
991
|
+
if(this._boundLayer) {
|
992
|
+
this._boundLayer.appendChild(cellBound);
|
993
|
+
}
|
994
|
+
} else {
|
995
|
+
var pn = cellBound.parentNode;
|
996
|
+
if(pn) {
|
997
|
+
pn.removeChild(cellBound);
|
998
|
+
}
|
999
|
+
}
|
1000
|
+
};
|
1001
|
+
/** @public
|
1002
|
+
* @ignore
|
1003
|
+
* @param {!Array.<number>} positions Left and right bound positions in pixel
|
1004
|
+
* @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
|
1005
|
+
*/
|
1006
|
+
VirtualizedLayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
|
1007
|
+
this._grid.updateColumnBounds(positions, noBorders);
|
1008
|
+
this._updateRowBounds();
|
1009
|
+
};
|
1010
|
+
/** @private
|
1011
|
+
*/
|
1012
|
+
VirtualizedLayoutGrid.prototype._initBoundLayer = function () {
|
1013
|
+
var boundLayer = this._boundLayer;
|
1014
|
+
if(!boundLayer) {
|
1015
|
+
boundLayer = this._boundLayer = document.createElement("div");
|
1016
|
+
boundLayer.className = "cover-layer";
|
1017
|
+
this._element.appendChild(boundLayer);
|
1018
|
+
}
|
1019
|
+
};
|
1020
|
+
/** @private
|
1021
|
+
*/
|
1022
|
+
VirtualizedLayoutGrid.prototype._initRowBounds = function () {
|
1023
|
+
var rowBound = this._rowBound;
|
1024
|
+
if(!rowBound) {
|
1025
|
+
rowBound = this._rowBound = document.createElement("div");
|
1026
|
+
rowBound.className = "selection-bound";
|
1027
|
+
}
|
1028
|
+
this._initBoundLayer();
|
1029
|
+
};
|
1030
|
+
/** @private
|
1031
|
+
*/
|
1032
|
+
VirtualizedLayoutGrid.prototype._requestUpdatingRowBounds = function () {
|
1033
|
+
if(!this._rowBoundTimer) {
|
1034
|
+
this._rowBoundTimer = setTimeout(this._updateRowBounds, 10);
|
1035
|
+
}
|
1036
|
+
};
|
1037
|
+
/** @private
|
1038
|
+
*/
|
1039
|
+
VirtualizedLayoutGrid.prototype._updateRowBounds = function () {
|
1040
|
+
this._rowBoundTimer = 0;
|
1041
|
+
this._updateCellBounds();
|
1042
|
+
|
1043
|
+
var rowBound = this._rowBound;
|
1044
|
+
if(!rowBound) {
|
1045
|
+
return;
|
1046
|
+
}
|
1047
|
+
var topIdx = this.getFirstSelectedRow();
|
1048
|
+
var btmIdx = -1; // Inclusive
|
1049
|
+
var topPx = 0;
|
1050
|
+
var btmPx = 0;
|
1051
|
+
var rowCount = this._layoutY.getLaneCount();
|
1052
|
+
if(topIdx >= rowCount) {
|
1053
|
+
topIdx = rowCount - 1;
|
1054
|
+
}
|
1055
|
+
if(topIdx >= 0) {
|
1056
|
+
btmIdx = this.getLastSelectedRow();
|
1057
|
+
if(btmIdx >= rowCount) {
|
1058
|
+
btmIdx = rowCount - 1;
|
1059
|
+
}
|
1060
|
+
topPx = this._layoutY.getLaneStart(topIdx);
|
1061
|
+
btmPx = this._layoutY.getLaneEnd(btmIdx);
|
1062
|
+
}
|
1063
|
+
|
1064
|
+
if(topPx >= btmPx) {
|
1065
|
+
var pn = rowBound.parentNode;
|
1066
|
+
if(pn) {
|
1067
|
+
pn.removeChild(rowBound);
|
1068
|
+
}
|
1069
|
+
} else {
|
1070
|
+
rowBound.style.top = topPx + "px";
|
1071
|
+
rowBound.style.height = (btmPx - topPx) + "px";
|
1072
|
+
|
1073
|
+
var boundWidth = this._grid._getViewSize();
|
1074
|
+
rowBound.style.width = boundWidth + "px";
|
1075
|
+
|
1076
|
+
var scrollLeft = 0;
|
1077
|
+
var pinnedLftCount = 0;
|
1078
|
+
var pinnedRgtCount = 0;
|
1079
|
+
var endOfScroll = false;
|
1080
|
+
if(this._hscrollbar) {
|
1081
|
+
scrollLeft = this._hscrollbar.getScrollLeft();
|
1082
|
+
pinnedLftCount = this._hscrollbar.getPinnedLeftColumnCount();
|
1083
|
+
pinnedRgtCount = this._hscrollbar.getPinnedRightColumnCount();
|
1084
|
+
endOfScroll = this._hscrollbar.isEndOfHorizontalScroll();
|
1085
|
+
}
|
1086
|
+
rowBound.classList.toggle("no-left-bound", !pinnedLftCount && scrollLeft > 0);
|
1087
|
+
rowBound.classList.toggle("no-right-bound", !pinnedRgtCount && !endOfScroll);
|
1088
|
+
|
1089
|
+
if(this._boundLayer) {
|
1090
|
+
this._boundLayer.appendChild(rowBound);
|
1091
|
+
}
|
1092
|
+
}
|
1093
|
+
};
|
806
1094
|
//#endregion public methods
|
807
1095
|
|
808
1096
|
//#region ====== Private methods ======//
|
@@ -873,10 +1161,9 @@ VirtualizedLayoutGrid.prototype._onRestingPosition = function () {
|
|
873
1161
|
};
|
874
1162
|
/** @public
|
875
1163
|
* @ignore
|
876
|
-
* @param {boolean} absolutePos if true, the right space element will be positioned absolutely
|
877
1164
|
*/
|
878
|
-
VirtualizedLayoutGrid.prototype._updateRightSpaceStyle = function(
|
879
|
-
this._grid._updateRightSpaceStyle(
|
1165
|
+
VirtualizedLayoutGrid.prototype._updateRightSpaceStyle = function() {
|
1166
|
+
this._grid._updateRightSpaceStyle();
|
880
1167
|
};
|
881
1168
|
/** @public
|
882
1169
|
* @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 =
|
182
|
-
if(
|
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(
|
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.
|
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
|
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
|
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
|
304
|
+
var distributions = this._distributeLaneSize(targetSize - fixedSize, indices);
|
306
305
|
|
307
306
|
// Find any change to flexible lane size
|
308
307
|
var dirty = false;
|