@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
@@ -198,6 +198,14 @@ declare interface ILayoutGrid extends ElementWrapper {
|
|
198
198
|
|
199
199
|
getContextRow(rowIndex: number): any;
|
200
200
|
|
201
|
+
selectColumn(colIndex: number, selected?: boolean): void;
|
202
|
+
|
203
|
+
isSelectedColumn(colIndex: number): boolean;
|
204
|
+
|
205
|
+
selectCell(colIndex: number, rowIndex: number, selected?: boolean): void;
|
206
|
+
|
207
|
+
setCellBounds(colIndex: number, rowIndex: number, width: number, height: number): void;
|
208
|
+
|
201
209
|
}
|
202
210
|
|
203
211
|
export default ILayoutGrid;
|
@@ -646,13 +646,56 @@ ILayoutGrid.prototype.isColumnActive = function (colIndex) { };
|
|
646
646
|
* @param {number} rowIndex
|
647
647
|
* @param {function(number):Array.<{attribute:string, value:string, remove:boolean}>} func
|
648
648
|
*/
|
649
|
-
ILayoutGrid.prototype.setRowAttributes = function (rowIndex, func) {
|
649
|
+
ILayoutGrid.prototype.setRowAttributes = function (rowIndex, func) {};
|
650
650
|
|
651
651
|
/** @public
|
652
652
|
* @param {number} rowIndex
|
653
653
|
* @return {Object}
|
654
654
|
*/
|
655
|
-
ILayoutGrid.prototype.getContextRow = function (rowIndex) {
|
655
|
+
ILayoutGrid.prototype.getContextRow = function (rowIndex) {};
|
656
|
+
|
657
|
+
/** @public
|
658
|
+
* @param {number} colIndex
|
659
|
+
* @param {boolean=} selected
|
660
|
+
*/
|
661
|
+
ILayoutGrid.prototype.selectColumn = function (colIndex, selected) {};
|
662
|
+
/** @public
|
663
|
+
* @param {number} colIndex
|
664
|
+
* @return {boolean}
|
665
|
+
*/
|
666
|
+
ILayoutGrid.prototype.isSelectedColumn = function (colIndex) {};
|
667
|
+
/** @public
|
668
|
+
* @param {number} colIndex
|
669
|
+
* @param {number} rowIndex
|
670
|
+
* @param {boolean=} selected
|
671
|
+
*/
|
672
|
+
ILayoutGrid.prototype.selectCell = function (colIndex, rowIndex, selected) {};
|
673
|
+
/** @public
|
674
|
+
* @param {number} colIndex
|
675
|
+
* @param {number} rowIndex
|
676
|
+
* @param {number} width
|
677
|
+
* @param {number} height
|
678
|
+
*/
|
679
|
+
ILayoutGrid.prototype.setCellBounds = function (colIndex, rowIndex, width, height) {};
|
680
|
+
/** @public
|
681
|
+
* @ignore
|
682
|
+
* @return {!TrackLayout}
|
683
|
+
*/
|
684
|
+
ILayoutGrid.prototype.getHorizontalLayout = function () {};
|
685
|
+
/** @public
|
686
|
+
* @ignore
|
687
|
+
* @param {number} lftIdx
|
688
|
+
* @param {number} rgtIdx
|
689
|
+
* @param {!Array.<number>} outPositions
|
690
|
+
* @param {!Array.<boolean>} outNoBorders
|
691
|
+
*/
|
692
|
+
ILayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositions, outNoBorders) {};
|
693
|
+
/** @public
|
694
|
+
* @ignore
|
695
|
+
* @param {!Array.<number>} positions Left and right bound positions in pixel
|
696
|
+
* @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
|
697
|
+
*/
|
698
|
+
ILayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {};
|
656
699
|
|
657
700
|
export default ILayoutGrid;
|
658
701
|
export { ILayoutGrid };
|
@@ -10,13 +10,22 @@ import TrackLayout from "./util/TrackLayout.js";
|
|
10
10
|
import SelectionList from "./util/SelectionList.js";
|
11
11
|
import ILayoutGrid from "./ILayoutGrid.js";
|
12
12
|
import ElementWrapper from "./components/ElementWrapper.js";
|
13
|
+
import HScrollbar from "./components/HScrollbar.js";
|
13
14
|
|
14
15
|
declare class LayoutGrid extends ElementWrapper {
|
15
16
|
|
16
|
-
constructor(
|
17
|
+
constructor(options?: any);
|
17
18
|
|
18
19
|
public getContextRow(rowIndex: number): any;
|
19
20
|
|
21
|
+
public selectColumn(colIndex: number, selected?: boolean): void;
|
22
|
+
|
23
|
+
public isSelectedColumn(colIndex: number): boolean;
|
24
|
+
|
25
|
+
public selectCell(colIndex: number, rowIndex: number, selected?: boolean): void;
|
26
|
+
|
27
|
+
public setCellBounds(colIndex: number, rowIndex: number, width: number, height: number): void;
|
28
|
+
|
20
29
|
}
|
21
30
|
|
22
31
|
export default LayoutGrid;
|
@@ -11,6 +11,7 @@ import TrackLayout from "./util/TrackLayout.js";
|
|
11
11
|
import SelectionList from "./util/SelectionList.js";
|
12
12
|
import ILayoutGrid from "./ILayoutGrid.js";
|
13
13
|
import ElementWrapper from "./components/ElementWrapper.js";
|
14
|
+
import HScrollbar from "./components/HScrollbar.js";
|
14
15
|
/* eslint-enable */
|
15
16
|
|
16
17
|
//#region Events
|
@@ -32,15 +33,15 @@ import ElementWrapper from "./components/ElementWrapper.js";
|
|
32
33
|
/**
|
33
34
|
* Please see {@link ILayoutGrid} for full APIs and parameter lists.
|
34
35
|
* @constructor
|
35
|
-
* @param {
|
36
|
-
* @param {Object=} opt_options
|
36
|
+
* @param {Object=} options
|
37
37
|
* @extends {ElementWrapper}
|
38
38
|
*/
|
39
|
-
var LayoutGrid = function (
|
39
|
+
var LayoutGrid = function (options) {
|
40
40
|
var _t = this;
|
41
41
|
|
42
42
|
_t._onMouseMove = _t._onMouseMove.bind(_t);
|
43
43
|
_t._onMouseOut = _t._onMouseOut.bind(_t);
|
44
|
+
_t._onResetTransformIE = _t._onResetTransformIE.bind(_t);
|
44
45
|
|
45
46
|
_t._trackX = new TrackLayout();
|
46
47
|
_t._trackY = new TrackLayout();
|
@@ -49,7 +50,7 @@ var LayoutGrid = function (opt_initializer, opt_options) {
|
|
49
50
|
|
50
51
|
_t._cellSpans = new CellSpans();
|
51
52
|
|
52
|
-
_t._element =
|
53
|
+
_t._element = document.createElement("div");
|
53
54
|
_t._element.className = "tr-lg tr-even-shading";
|
54
55
|
|
55
56
|
_t._ctxRows = new VirtualItems(); // Context rows act as a virtual column storing UI context or metadata for rows
|
@@ -59,8 +60,14 @@ var LayoutGrid = function (opt_initializer, opt_options) {
|
|
59
60
|
_t._stretchedCells = new StretchedCells(_t._trackX, _t._trackY, _t);
|
60
61
|
_t._selectionList = new SelectionList();
|
61
62
|
|
62
|
-
if (
|
63
|
-
_t._virOwner =
|
63
|
+
if (options) {
|
64
|
+
_t._virOwner = options["owner"] || null;
|
65
|
+
if(options["horizontalScrollbar"]) {
|
66
|
+
_t._hscrollbar = options["horizontalScrollbar"];
|
67
|
+
}
|
68
|
+
}
|
69
|
+
if(!_t._virOwner) {
|
70
|
+
_t._element.classList.add("section");
|
64
71
|
}
|
65
72
|
|
66
73
|
_t._addEvent("rowHighlighted");
|
@@ -72,19 +79,11 @@ var LayoutGrid = function (opt_initializer, opt_options) {
|
|
72
79
|
Ext.inherits(LayoutGrid, ElementWrapper);
|
73
80
|
|
74
81
|
/**
|
75
|
-
* For virtualization in Y-Axis
|
76
82
|
* @type {number}
|
77
83
|
* @private
|
78
84
|
*/
|
79
85
|
LayoutGrid.prototype._index = -1;
|
80
86
|
|
81
|
-
/**
|
82
|
-
* For virtualization in Y-Axis
|
83
|
-
* @type {number}
|
84
|
-
* @private
|
85
|
-
*/
|
86
|
-
LayoutGrid.prototype._indexOffset = 0;
|
87
|
-
|
88
87
|
/**
|
89
88
|
* For virtualization in Y-Axis
|
90
89
|
* @type {number}
|
@@ -163,11 +162,14 @@ LayoutGrid.prototype._firstColumn;
|
|
163
162
|
*/
|
164
163
|
LayoutGrid.prototype._lastColumn;
|
165
164
|
|
166
|
-
/**
|
167
|
-
|
168
|
-
|
169
|
-
*/
|
165
|
+
/** @type {Element}
|
166
|
+
* @private
|
167
|
+
*/
|
170
168
|
LayoutGrid.prototype._rightSpace;
|
169
|
+
/** @type {number}
|
170
|
+
* @private
|
171
|
+
*/
|
172
|
+
LayoutGrid.prototype._rightSpaceSize = 0;
|
171
173
|
|
172
174
|
/**
|
173
175
|
* @type {boolean}
|
@@ -247,6 +249,18 @@ LayoutGrid.prototype._transformIETimer = 0;
|
|
247
249
|
* @private
|
248
250
|
*/
|
249
251
|
LayoutGrid.prototype._ctxRows;
|
252
|
+
/** @type {Element}
|
253
|
+
* @private
|
254
|
+
*/
|
255
|
+
LayoutGrid.prototype._boundLayer = null;
|
256
|
+
/** @type {Element}
|
257
|
+
* @private
|
258
|
+
*/
|
259
|
+
LayoutGrid.prototype._columnBound = null;
|
260
|
+
/** @type {HScrollbar}
|
261
|
+
* @private
|
262
|
+
*/
|
263
|
+
LayoutGrid.prototype._hscrollbar = null;
|
250
264
|
|
251
265
|
|
252
266
|
/**
|
@@ -269,6 +283,7 @@ LayoutGrid.prototype.dispose = function () {
|
|
269
283
|
|
270
284
|
this._highlightedCells.length = 0;
|
271
285
|
this._ctx = null;
|
286
|
+
this._hscrollbar = null;
|
272
287
|
|
273
288
|
this._dispose();
|
274
289
|
};
|
@@ -277,11 +292,13 @@ LayoutGrid.prototype.dispose = function () {
|
|
277
292
|
* @override
|
278
293
|
*/
|
279
294
|
LayoutGrid.prototype.getWidth = function () {
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
295
|
+
return this.isVisible() ? this._getWidth() : 0;
|
296
|
+
};
|
297
|
+
/** @private
|
298
|
+
* @return {number}
|
299
|
+
*/
|
300
|
+
LayoutGrid.prototype._getWidth = function () {
|
301
|
+
return this.getContentWidth() + this._rightSpaceSize;
|
285
302
|
};
|
286
303
|
|
287
304
|
/**
|
@@ -293,8 +310,7 @@ LayoutGrid.prototype.setWidth = function (px) {
|
|
293
310
|
return false;
|
294
311
|
}
|
295
312
|
|
296
|
-
var
|
297
|
-
var changes = this._trackX.setTrackSize(px, reserveSpace); // WARNING: Perform scalling instead of setting width directly
|
313
|
+
var changes = this._trackX.setTrackSize(px - this._rightSpaceSize); // WARNING: Perform scalling instead of setting width directly
|
298
314
|
|
299
315
|
if (changes == null) {
|
300
316
|
return false;
|
@@ -326,7 +342,7 @@ LayoutGrid.prototype.setHeight = function (px) {
|
|
326
342
|
return false;
|
327
343
|
}
|
328
344
|
|
329
|
-
var changes = this._trackY.setTrackSize(px
|
345
|
+
var changes = this._trackY.setTrackSize(px); // WARNING: Perform scalling instead of setting height directly
|
330
346
|
|
331
347
|
if (changes == null) {
|
332
348
|
return true;
|
@@ -362,7 +378,7 @@ LayoutGrid.prototype.hitTest = function (x, y, opt_omitSpan) {
|
|
362
378
|
return null;
|
363
379
|
}
|
364
380
|
|
365
|
-
if (x >= this.
|
381
|
+
if (x >= this.getContentWidth()) {
|
366
382
|
return null;
|
367
383
|
}
|
368
384
|
|
@@ -407,7 +423,7 @@ LayoutGrid.prototype.hitTestX = function (x) {
|
|
407
423
|
return -1;
|
408
424
|
}
|
409
425
|
|
410
|
-
if (x >= this.
|
426
|
+
if (x >= this.getContentWidth()) {
|
411
427
|
return ~this._colCount;
|
412
428
|
}
|
413
429
|
|
@@ -982,7 +998,7 @@ LayoutGrid.prototype.setColumnCount = function (val) {
|
|
982
998
|
}
|
983
999
|
}
|
984
1000
|
|
985
|
-
// this.
|
1001
|
+
// this._updateCssWidth(); // Core grid will guarantee updating width to each section
|
986
1002
|
} else {
|
987
1003
|
for (i = oldColCount; i < val; ++i) {
|
988
1004
|
column = this._newColumn(i);
|
@@ -1621,7 +1637,7 @@ LayoutGrid.prototype.insertColumn = function (index, opt_json) {
|
|
1621
1637
|
}
|
1622
1638
|
|
1623
1639
|
this._updateCellSpans(cellSpans, true); // Restore all styling
|
1624
|
-
this.
|
1640
|
+
this._calculateViewSize(true);
|
1625
1641
|
this._stretchedCells.updateXAxis();
|
1626
1642
|
// this._syncLayoutToColumns(index); // Core grid will guarantee updating width to each section
|
1627
1643
|
|
@@ -1676,7 +1692,7 @@ LayoutGrid.prototype.removeColumnAt = function (index) {
|
|
1676
1692
|
this._syncLayoutToColumns(index);
|
1677
1693
|
|
1678
1694
|
if (index >= this._colCount) {
|
1679
|
-
this.
|
1695
|
+
this._updateCssWidth();
|
1680
1696
|
}
|
1681
1697
|
|
1682
1698
|
return definition;
|
@@ -1716,14 +1732,6 @@ LayoutGrid.prototype.moveColumn = function (from, to) {
|
|
1716
1732
|
var nextSibling = this._columns[to + 1] || null;
|
1717
1733
|
movedColumn.insertBefore(nextSibling);
|
1718
1734
|
|
1719
|
-
if (this._rightSpace) {
|
1720
|
-
var pn = this._rightSpace.parentNode;
|
1721
|
-
|
1722
|
-
if (pn) {
|
1723
|
-
pn.appendChild(this._rightSpace);
|
1724
|
-
}
|
1725
|
-
}
|
1726
|
-
|
1727
1735
|
this._updateColumnIndices();
|
1728
1736
|
this._updateCellSpans(cellSpans, true); // Restore all styling
|
1729
1737
|
|
@@ -1826,12 +1834,14 @@ LayoutGrid.prototype.setRowOffset = function (index) {
|
|
1826
1834
|
this._rowOffset = index;
|
1827
1835
|
};
|
1828
1836
|
|
1829
|
-
/**
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1837
|
+
/** @public
|
1838
|
+
* @ignore
|
1839
|
+
*/
|
1840
|
+
LayoutGrid.prototype.updateLayout = function () {
|
1841
|
+
this._calculateViewSize(true); // Column bounds will be updated by trigger from Core
|
1842
|
+
|
1843
|
+
this._updateRightSpaceStyle();
|
1844
|
+
};
|
1835
1845
|
|
1836
1846
|
/**
|
1837
1847
|
* {@link ILayoutGrid#stretchCell}
|
@@ -1869,7 +1879,7 @@ LayoutGrid.prototype.stretchCell = function (cellRef, rowIndex, opt_stretching,
|
|
1869
1879
|
this._updateLayers();
|
1870
1880
|
}
|
1871
1881
|
|
1872
|
-
this.
|
1882
|
+
this._calculateViewSize();
|
1873
1883
|
cell = this._stretchedCells.stretchCell(rowIndex, onlyToTheRight ? colIndex : 0);
|
1874
1884
|
cell.setParent(coverLayer);
|
1875
1885
|
} else {
|
@@ -1924,7 +1934,7 @@ LayoutGrid.prototype.updateStretchedCells = function () {
|
|
1924
1934
|
if (childCount <= 0) {
|
1925
1935
|
return false;
|
1926
1936
|
}
|
1927
|
-
this.
|
1937
|
+
this._calculateViewSize(true);
|
1928
1938
|
|
1929
1939
|
this._stretchedCells.updateCells();
|
1930
1940
|
return childCount ? true : false;
|
@@ -1932,20 +1942,38 @@ LayoutGrid.prototype.updateStretchedCells = function () {
|
|
1932
1942
|
|
1933
1943
|
/** @private
|
1934
1944
|
* @param {boolean=} forceRecal
|
1945
|
+
* @return {number}
|
1935
1946
|
*/
|
1936
|
-
LayoutGrid.prototype.
|
1947
|
+
LayoutGrid.prototype._calculateViewSize = function (forceRecal) {
|
1937
1948
|
var ctx = this._ctx;
|
1938
1949
|
var stretchSize = forceRecal ? 0 : this._stretchedCells.getStretchSize();
|
1939
1950
|
if(!stretchSize && ctx) {
|
1940
1951
|
if(ctx["getWidth"]) {
|
1952
|
+
var contentWidth = this.getContentWidth();
|
1941
1953
|
stretchSize = ctx["getWidth"]();
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1954
|
+
if(stretchSize) { // Grid may not be in the document
|
1955
|
+
if(!ctx.hasClass("no-borders")) {
|
1956
|
+
stretchSize -= 1;
|
1957
|
+
}
|
1958
|
+
if(contentWidth < stretchSize) { // If view width is larger than actual content
|
1959
|
+
stretchSize = contentWidth;
|
1960
|
+
}
|
1961
|
+
this._stretchedCells.setStretchSize(stretchSize);
|
1962
|
+
return stretchSize;
|
1963
|
+
} else {
|
1964
|
+
return contentWidth;
|
1945
1965
|
}
|
1946
|
-
this._stretchedCells.setStretchSize(stretchSize);
|
1947
1966
|
}
|
1948
1967
|
}
|
1968
|
+
return stretchSize;
|
1969
|
+
};
|
1970
|
+
/** View size is width of container (Grid's pane) or content (LayoutGrid's columns), whichever is smaller.
|
1971
|
+
* @public
|
1972
|
+
* @ignore
|
1973
|
+
* @return {number}
|
1974
|
+
*/
|
1975
|
+
LayoutGrid.prototype._getViewSize = function () {
|
1976
|
+
return this._calculateViewSize();
|
1949
1977
|
};
|
1950
1978
|
|
1951
1979
|
/**
|
@@ -2011,8 +2039,9 @@ LayoutGrid.prototype.reserveRightSpace = function (size) {
|
|
2011
2039
|
}
|
2012
2040
|
|
2013
2041
|
this._rightSpace.style.width = size + "px";
|
2042
|
+
this._rightSpaceSize = size;
|
2014
2043
|
|
2015
|
-
this.
|
2044
|
+
this._updateCssWidth();
|
2016
2045
|
} else if (this._rightSpace) {
|
2017
2046
|
var pn = this._rightSpace.parentNode;
|
2018
2047
|
|
@@ -2021,20 +2050,30 @@ LayoutGrid.prototype.reserveRightSpace = function (size) {
|
|
2021
2050
|
}
|
2022
2051
|
|
2023
2052
|
this._rightSpace = null;
|
2053
|
+
this._rightSpaceSize = 0;
|
2024
2054
|
|
2025
|
-
this.
|
2055
|
+
this._updateCssWidth();
|
2026
2056
|
}
|
2027
2057
|
|
2028
2058
|
return this._rightSpace;
|
2029
2059
|
};
|
2030
2060
|
|
2031
|
-
/**
|
2032
|
-
|
2033
|
-
|
2034
|
-
|
2035
|
-
*/
|
2036
|
-
LayoutGrid.prototype._updateRightSpaceStyle = function(absolutePos) {
|
2061
|
+
/** @public
|
2062
|
+
* @ignore
|
2063
|
+
*/
|
2064
|
+
LayoutGrid.prototype._updateRightSpaceStyle = function() {
|
2037
2065
|
var rs = this._rightSpace;
|
2066
|
+
if(!rs) {
|
2067
|
+
return;
|
2068
|
+
}
|
2069
|
+
var isScrollbarActive = false;
|
2070
|
+
var pinnedRgtCount = 0;
|
2071
|
+
if(this._hscrollbar) {
|
2072
|
+
isScrollbarActive = this._hscrollbar.isActive();
|
2073
|
+
pinnedRgtCount = this._hscrollbar.getPinnedRightColumnCount();
|
2074
|
+
}
|
2075
|
+
var absolutePos = isScrollbarActive && !pinnedRgtCount; // if true, the right space element will be positioned absolutely
|
2076
|
+
|
2038
2077
|
if (absolutePos) {
|
2039
2078
|
rs.style.top = this._trackY.getLaneStart(this._activeRow) + "px";
|
2040
2079
|
rs.style.left = this._trackX.getLaneStart(this._colCount) + "px";
|
@@ -2058,6 +2097,9 @@ LayoutGrid.prototype._updateLayers = function() {
|
|
2058
2097
|
this._element.appendChild(this._rightSpace);
|
2059
2098
|
}
|
2060
2099
|
}
|
2100
|
+
if(this._boundLayer) {
|
2101
|
+
this._element.appendChild(this._boundLayer);
|
2102
|
+
}
|
2061
2103
|
if(this._coverLayer) {
|
2062
2104
|
this._element.appendChild(this._coverLayer); // The layer should always on top
|
2063
2105
|
}
|
@@ -2126,6 +2168,153 @@ LayoutGrid.prototype.getContextRow = function (rowIndex) {
|
|
2126
2168
|
return this._ctxRows.getItem(rowIndex);
|
2127
2169
|
};
|
2128
2170
|
|
2171
|
+
/** @public
|
2172
|
+
* @param {number} colIndex
|
2173
|
+
* @param {boolean=} selected
|
2174
|
+
*/
|
2175
|
+
LayoutGrid.prototype.selectColumn = function (colIndex, selected) {
|
2176
|
+
this.enableColumnClass(colIndex, "selected-column", selected);
|
2177
|
+
|
2178
|
+
var columnBound = this._columnBound;
|
2179
|
+
if(!columnBound) {
|
2180
|
+
columnBound = this._columnBound = document.createElement("div");
|
2181
|
+
columnBound.className = "selection-bound column-bound";
|
2182
|
+
}
|
2183
|
+
var boundLayer = this._boundLayer;
|
2184
|
+
if(!boundLayer) {
|
2185
|
+
boundLayer = this._boundLayer = document.createElement("div");
|
2186
|
+
boundLayer.className = "cover-layer";
|
2187
|
+
this._updateLayers();
|
2188
|
+
}
|
2189
|
+
};
|
2190
|
+
/** @public
|
2191
|
+
* @param {number} colIndex
|
2192
|
+
* @return {boolean}
|
2193
|
+
*/
|
2194
|
+
LayoutGrid.prototype.isSelectedColumn = function (colIndex) {
|
2195
|
+
return this.hasColumnClass(colIndex, "selected-column");
|
2196
|
+
};
|
2197
|
+
/** @public
|
2198
|
+
* @param {number} colIndex
|
2199
|
+
* @param {number} rowIndex
|
2200
|
+
* @param {boolean=} selected
|
2201
|
+
*/
|
2202
|
+
LayoutGrid.prototype.selectCell = function (colIndex, rowIndex, selected) {
|
2203
|
+
var cell = this._getCell(colIndex, rowIndex);
|
2204
|
+
if(cell) {
|
2205
|
+
cell.enableClass("selection", selected);
|
2206
|
+
}
|
2207
|
+
};
|
2208
|
+
/** @public
|
2209
|
+
* @param {number} colIndex
|
2210
|
+
* @param {number} rowIndex
|
2211
|
+
* @param {number} width
|
2212
|
+
* @param {number} height
|
2213
|
+
*/
|
2214
|
+
LayoutGrid.prototype.setCellBounds = function (colIndex, rowIndex, width, height) {};
|
2215
|
+
/** @public
|
2216
|
+
* @ignore
|
2217
|
+
* @return {!TrackLayout}
|
2218
|
+
*/
|
2219
|
+
LayoutGrid.prototype.getHorizontalLayout = function () {
|
2220
|
+
return this._trackX;
|
2221
|
+
};
|
2222
|
+
/** @public
|
2223
|
+
* @ignore
|
2224
|
+
* @param {number} lftIdx
|
2225
|
+
* @param {number} rgtIdx Inclusive index
|
2226
|
+
* @param {!Array.<number>} outPositions
|
2227
|
+
* @param {!Array.<boolean>} outNoBorders
|
2228
|
+
*/
|
2229
|
+
LayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositions, outNoBorders) {
|
2230
|
+
var lftPx = 0;
|
2231
|
+
var rgtPx = 0;
|
2232
|
+
var noLftBorder = false;
|
2233
|
+
var noRgtBorder = false;
|
2234
|
+
var pinnedRgtIdx = this._trackX.getLaneCount();
|
2235
|
+
if(lftIdx >= 0) {
|
2236
|
+
lftPx = this._trackX.getLaneStart(lftIdx);
|
2237
|
+
rgtPx = this._trackX.getLaneEnd(rgtIdx);
|
2238
|
+
}
|
2239
|
+
if(lftPx < rgtPx) {
|
2240
|
+
var lftView = 0;
|
2241
|
+
var rgtView, rgtLimit;
|
2242
|
+
var scrollLeft = 0;
|
2243
|
+
var pinnedLftCount = 0;
|
2244
|
+
var pinnedRgtCount = 0;
|
2245
|
+
if(this._hscrollbar) {
|
2246
|
+
scrollLeft = this._hscrollbar.getScrollLeft();
|
2247
|
+
pinnedLftCount = this._hscrollbar.getPinnedLeftColumnCount();
|
2248
|
+
pinnedRgtCount = this._hscrollbar.getPinnedRightColumnCount();
|
2249
|
+
}
|
2250
|
+
rgtView = rgtLimit = this._trackX.getTrackSize();
|
2251
|
+
if(pinnedLftCount) {
|
2252
|
+
lftView = this._trackX.getLaneStart(pinnedLftCount);
|
2253
|
+
}
|
2254
|
+
if(pinnedRgtCount) {
|
2255
|
+
pinnedRgtIdx -= pinnedRgtCount;
|
2256
|
+
rgtView = this._getViewSize() - rgtLimit + this._trackX.getLaneStart(pinnedRgtIdx);
|
2257
|
+
}
|
2258
|
+
if(lftIdx >= pinnedLftCount && lftIdx < pinnedRgtIdx) {
|
2259
|
+
lftPx -= scrollLeft;
|
2260
|
+
if(lftPx < lftView) {
|
2261
|
+
lftPx = lftView;
|
2262
|
+
noLftBorder = true;
|
2263
|
+
} else if(lftPx > rgtView) {
|
2264
|
+
lftPx = rgtView;
|
2265
|
+
noLftBorder = true;
|
2266
|
+
}
|
2267
|
+
} else if(lftIdx >= pinnedRgtIdx) {
|
2268
|
+
lftPx = this._getViewSize() - rgtLimit + this._trackX.getLaneStart(lftIdx);
|
2269
|
+
}
|
2270
|
+
if(rgtIdx >= pinnedLftCount && rgtIdx < pinnedRgtIdx) {
|
2271
|
+
rgtPx -= scrollLeft;
|
2272
|
+
if(rgtPx < lftView) {
|
2273
|
+
rgtPx = lftView;
|
2274
|
+
noRgtBorder = true;
|
2275
|
+
} else if(rgtPx > rgtView) {
|
2276
|
+
rgtPx = rgtView;
|
2277
|
+
noRgtBorder = true;
|
2278
|
+
}
|
2279
|
+
} else if(rgtIdx >= pinnedRgtIdx) {
|
2280
|
+
rgtPx = this._getViewSize() - rgtLimit + this._trackX.getLaneEnd(rgtIdx);
|
2281
|
+
}
|
2282
|
+
}
|
2283
|
+
outPositions[0] = lftPx;
|
2284
|
+
outPositions[1] = rgtPx;
|
2285
|
+
outNoBorders[0] = noLftBorder;
|
2286
|
+
outNoBorders[1] = noRgtBorder;
|
2287
|
+
};
|
2288
|
+
/** @public
|
2289
|
+
* @ignore
|
2290
|
+
* @param {!Array.<number>} positions Left and right bound positions in pixel
|
2291
|
+
* @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
|
2292
|
+
*/
|
2293
|
+
LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
|
2294
|
+
var columnBound = this._columnBound;
|
2295
|
+
if(!columnBound) {
|
2296
|
+
return;
|
2297
|
+
}
|
2298
|
+
|
2299
|
+
var lftPx = positions[0];
|
2300
|
+
var rgtPx = positions[1];
|
2301
|
+
if(lftPx >= rgtPx) {
|
2302
|
+
var pn = columnBound.parentNode;
|
2303
|
+
if(pn) {
|
2304
|
+
pn.removeChild(columnBound);
|
2305
|
+
}
|
2306
|
+
} else {
|
2307
|
+
columnBound.style.left = lftPx + "px";
|
2308
|
+
columnBound.style.width = (rgtPx - lftPx) + "px";
|
2309
|
+
|
2310
|
+
columnBound.style.height = this._trackY.getTrackSize() + "px";
|
2311
|
+
columnBound.classList.toggle("no-left-bound", noBorders[0]);
|
2312
|
+
columnBound.classList.toggle("no-right-bound", noBorders[1]);
|
2313
|
+
if(this._boundLayer) {
|
2314
|
+
this._boundLayer.appendChild(columnBound);
|
2315
|
+
}
|
2316
|
+
}
|
2317
|
+
};
|
2129
2318
|
|
2130
2319
|
/**
|
2131
2320
|
* @private
|
@@ -2206,33 +2395,19 @@ LayoutGrid.prototype._newColumn = function (indexX) {
|
|
2206
2395
|
column.insertBefore(nextColumn);
|
2207
2396
|
}
|
2208
2397
|
|
2209
|
-
if (this._rightSpace) {
|
2210
|
-
var pn = this._rightSpace.parentNode;
|
2211
|
-
|
2212
|
-
if (pn) {
|
2213
|
-
pn.appendChild(this._rightSpace);
|
2214
|
-
}
|
2215
|
-
}
|
2216
|
-
|
2217
2398
|
return column;
|
2218
2399
|
};
|
2219
2400
|
|
2220
|
-
/**
|
2401
|
+
/** Update LayoutGrid CSS width. Grid width is calculated from summation of each column width plus reserved right space
|
2221
2402
|
* @private
|
2222
2403
|
*/
|
2223
|
-
LayoutGrid.prototype.
|
2224
|
-
if (this._frozenLayout) {
|
2225
|
-
|
2226
|
-
|
2404
|
+
LayoutGrid.prototype._updateCssWidth = function () { // This method is also called by _syncLayoutToColumns()
|
2405
|
+
if (!this._frozenLayout) {
|
2406
|
+
this._calculateViewSize(true);
|
2407
|
+
this._stretchedCells.updateXAxis();
|
2227
2408
|
|
2228
|
-
|
2229
|
-
this._stretchedCells.updateXAxis();
|
2230
|
-
var contentWidth = this.getContentWidth();
|
2231
|
-
|
2232
|
-
if (this._rightSpace) {
|
2233
|
-
contentWidth += this._rightSpace.offsetWidth;
|
2409
|
+
this._element.style.width = this._getWidth() + "px"; // View is kept in sync with content size
|
2234
2410
|
}
|
2235
|
-
this._element.style.width = contentWidth + "px"; // View is kept in sync with content size
|
2236
2411
|
};
|
2237
2412
|
|
2238
2413
|
/**
|
@@ -2318,7 +2493,7 @@ LayoutGrid.prototype._syncLayoutToColumns = function (from) {
|
|
2318
2493
|
}
|
2319
2494
|
|
2320
2495
|
this._updateCellSpanLayout(this._cellSpans.getAllSpans());
|
2321
|
-
this.
|
2496
|
+
this._updateCssWidth();
|
2322
2497
|
return true;
|
2323
2498
|
};
|
2324
2499
|
|
@@ -2585,7 +2760,7 @@ LayoutGrid.prototype._resetTransformIETimer = function () {
|
|
2585
2760
|
if (Util.isIE) {
|
2586
2761
|
if(!this._transformIETimer) {
|
2587
2762
|
this.enableClass("reset-transform");
|
2588
|
-
this._transformIETimer = setTimeout(this._onResetTransformIE
|
2763
|
+
this._transformIETimer = setTimeout(this._onResetTransformIE, 20);
|
2589
2764
|
}
|
2590
2765
|
}
|
2591
2766
|
};
|
@@ -5,13 +5,22 @@ import Reverter from "./util/Reverter.js";
|
|
5
5
|
import ILayoutGrid from "./ILayoutGrid.js";
|
6
6
|
import LayoutGrid from "./LayoutGrid.js";
|
7
7
|
import ElementWrapper from "./components/ElementWrapper.js";
|
8
|
+
import HScrollbar from "./components/HScrollbar.js";
|
8
9
|
|
9
10
|
declare class VirtualizedLayoutGrid extends ElementWrapper {
|
10
11
|
|
11
|
-
constructor(
|
12
|
+
constructor(options?: any);
|
12
13
|
|
13
14
|
public getContextRow(rowIndex: number): any;
|
14
15
|
|
16
|
+
public selectColumn(colIndex: number, selected?: boolean): void;
|
17
|
+
|
18
|
+
public isSelectedColumn(colIndex: number): boolean;
|
19
|
+
|
20
|
+
public selectCell(colIndex: number, rowIndex: number, selected?: boolean): void;
|
21
|
+
|
22
|
+
public setCellBounds(colIndex: number, rowIndex: number, width: number, height: number): void;
|
23
|
+
|
15
24
|
}
|
16
25
|
|
17
26
|
export default VirtualizedLayoutGrid;
|