@refinitiv-ui/efx-grid 6.0.31 → 6.0.33
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/core/dist/core.js +376 -126
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/grid/Core.d.ts +4 -0
- package/lib/core/es6/grid/Core.js +79 -33
- package/lib/core/es6/grid/ILayoutGrid.js +3 -3
- package/lib/core/es6/grid/LayoutGrid.js +67 -23
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +92 -55
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +1 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +29 -5
- package/lib/core/es6/grid/util/SelectionList.d.ts +6 -2
- package/lib/core/es6/grid/util/SelectionList.js +76 -7
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +521 -179
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.js +14 -13
- package/lib/rt-grid/es6/RowDefinition.js +1 -1
- package/lib/statistics-row/es6/StatisticsRow.d.ts +25 -25
- package/lib/statistics-row/es6/StatisticsRow.js +9 -4
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +4 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +58 -30
- package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +2 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +14 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +2 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +35 -12
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +23 -1
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +339 -40
- package/lib/tr-grid-util/es6/GroupDefinitions.d.ts +2 -0
- package/lib/tr-grid-util/es6/GroupDefinitions.js +15 -0
- package/lib/tr-grid-util/es6/Util.d.ts +3 -0
- package/lib/tr-grid-util/es6/Util.js +15 -0
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/CollectionDict.js +12 -2
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +170 -47
- package/lib/types/es6/ColumnGrouping.d.ts +4 -0
- package/lib/types/es6/ColumnSelection.d.ts +2 -0
- package/lib/types/es6/ColumnStack.d.ts +2 -0
- package/lib/types/es6/Core/grid/util/SelectionList.d.ts +6 -2
- package/lib/types/es6/RowDragging.d.ts +23 -1
- package/lib/types/es6/StatisticsRow.d.ts +25 -25
- package/lib/versions.json +6 -6
- package/package.json +1 -1
@@ -339,8 +339,12 @@ declare class Core extends ElementWrapper {
|
|
339
339
|
|
340
340
|
public enableRowVirtualization(opt_enabled: boolean): void;
|
341
341
|
|
342
|
+
public isRowVirtualizationEnabled(): boolean;
|
343
|
+
|
342
344
|
public enableColumnVirtualization(opt_enabled?: boolean|null): void;
|
343
345
|
|
346
|
+
public isColumnVirtualizationEnabled(): boolean;
|
347
|
+
|
344
348
|
public setRowScrollingStep(rowCount: number): void;
|
345
349
|
|
346
350
|
public getVMouseWheelHandler(): ((...params: any[]) => any)|null;
|
@@ -536,7 +536,7 @@ Core.prototype._groupDefs = null;
|
|
536
536
|
* @return {string}
|
537
537
|
*/
|
538
538
|
Core.getVersion = function () {
|
539
|
-
return "5.1.
|
539
|
+
return "5.1.42";
|
540
540
|
};
|
541
541
|
/** {@link ElementWrapper#dispose}
|
542
542
|
* @override
|
@@ -672,10 +672,10 @@ Core.prototype.getConfigObject = function (gridOptions) {
|
|
672
672
|
}
|
673
673
|
}
|
674
674
|
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
obj["
|
675
|
+
// It will be overwrite in rt-grid or atlas-blotter
|
676
|
+
obj["rowVirtualization"] = this.isRowVirtualizationEnabled();
|
677
|
+
obj["columnVirtualization"] = this.isColumnVirtualizationEnabled();
|
678
|
+
obj["rowHighlighting"] = this._rowHighlighting;
|
679
679
|
|
680
680
|
if(this._fixFrozenTopSections) {
|
681
681
|
obj["topFreezingCount"] = this._startVScrollbarIndex >= 0 ? (this._startVScrollbarIndex + 1) : false;
|
@@ -688,7 +688,13 @@ Core.prototype.getConfigObject = function (gridOptions) {
|
|
688
688
|
if(this._rowScrollingStep) {
|
689
689
|
obj["stepScroll"] = (this._rowScrollingStep === 1) ? true : this._rowScrollingStep;
|
690
690
|
}
|
691
|
-
|
691
|
+
|
692
|
+
var val = this._vscrollbar.getAutoHide();
|
693
|
+
if(val !== true) {
|
694
|
+
// TODO: check this._hscrollbar and this._vscrollbar can be difference config
|
695
|
+
obj["autoHideScrollbar"] = val; // this._hscrollbar has the same settings
|
696
|
+
}
|
697
|
+
|
692
698
|
var wheelSpeed = this._vscrollbar.getMouseWheelSpeed();
|
693
699
|
if(wheelSpeed) {
|
694
700
|
obj["linearWheelScrolling"] = wheelSpeed;
|
@@ -3661,6 +3667,14 @@ Core.prototype.enableRowVirtualization = function (opt_enabled) {
|
|
3661
3667
|
this._rowVirtualizer.deactivate();
|
3662
3668
|
}
|
3663
3669
|
};
|
3670
|
+
|
3671
|
+
/** @public
|
3672
|
+
* @return {boolean}
|
3673
|
+
*/
|
3674
|
+
Core.prototype.isRowVirtualizationEnabled = function () {
|
3675
|
+
return this._rowVirtualizer.isEnabled();
|
3676
|
+
};
|
3677
|
+
|
3664
3678
|
/** No runtime support
|
3665
3679
|
* @public
|
3666
3680
|
* @param {boolean=} opt_enabled
|
@@ -3675,6 +3689,13 @@ Core.prototype.enableColumnVirtualization = function (opt_enabled) {
|
|
3675
3689
|
}
|
3676
3690
|
};
|
3677
3691
|
|
3692
|
+
/** @public
|
3693
|
+
* @return {boolean}
|
3694
|
+
*/
|
3695
|
+
Core.prototype.isColumnVirtualizationEnabled = function () {
|
3696
|
+
return this._colVirtualizer.isEnabled();
|
3697
|
+
};
|
3698
|
+
|
3678
3699
|
/** Scrolling step will be multiple of the default row height in pixels. For example, if default row height is 32 pixel and row scrolling step is 2, <br>
|
3679
3700
|
* then the actual scrolling step for vertical scrollbar will be (32 * 2) = 64 pixels
|
3680
3701
|
* @public
|
@@ -4062,47 +4083,72 @@ Core.prototype._updateColumnBounds = function () {
|
|
4062
4083
|
return;
|
4063
4084
|
}
|
4064
4085
|
|
4086
|
+
var sectCount = this._settings.length;
|
4087
|
+
if(!sectCount) {
|
4088
|
+
return;
|
4089
|
+
}
|
4090
|
+
|
4091
|
+
// Collecting column selection and selection ranges
|
4092
|
+
var selRanges = [];
|
4093
|
+
var pair = null;
|
4065
4094
|
var colCount = this.getColumnCount();
|
4066
|
-
var
|
4095
|
+
var selIndices = [];
|
4067
4096
|
var i;
|
4068
4097
|
for(i = 0; i < colCount; i++) {
|
4069
4098
|
if(this.isSelectedColumn(i)) {
|
4070
|
-
|
4099
|
+
selIndices.push(i);
|
4100
|
+
if(!pair) {
|
4101
|
+
pair = [i, -1];
|
4102
|
+
}
|
4103
|
+
} else if(pair) {
|
4104
|
+
pair[1] = i - 1;
|
4105
|
+
selRanges.push(pair);
|
4106
|
+
pair = null;
|
4071
4107
|
}
|
4072
4108
|
}
|
4109
|
+
if(pair) {
|
4110
|
+
pair[1] = colCount - 1;
|
4111
|
+
selRanges.push(pair);
|
4112
|
+
pair = null;
|
4113
|
+
}
|
4114
|
+
|
4073
4115
|
var arg = {
|
4074
|
-
selectedColumns:
|
4116
|
+
"selectedColumns": selIndices,
|
4117
|
+
"selectionRanges": selRanges
|
4075
4118
|
};
|
4076
4119
|
this._dispatch("beforeColumnBoundUpdate", arg);
|
4077
4120
|
|
4078
|
-
|
4079
|
-
var
|
4080
|
-
var
|
4081
|
-
|
4082
|
-
|
4083
|
-
|
4084
|
-
|
4085
|
-
|
4086
|
-
}
|
4087
|
-
}
|
4088
|
-
}
|
4089
|
-
var sectCount = this._settings.length;
|
4090
|
-
if(sectCount) {
|
4091
|
-
var sectionSetting = this._settings[0];
|
4092
|
-
var section = sectionSetting.getSection();
|
4121
|
+
// Calculate position from ranges
|
4122
|
+
var rangeCount = selRanges.length;
|
4123
|
+
var posAry = [];
|
4124
|
+
var noBorderAry = [];
|
4125
|
+
var topSectionSettings = this._settings[0];
|
4126
|
+
var section = topSectionSettings.getSection();
|
4127
|
+
for(i = 0; i < rangeCount; ++i) {
|
4128
|
+
pair = selRanges[i];
|
4093
4129
|
var positions = [0, 0];
|
4094
4130
|
var noBorders = [false, false];
|
4095
|
-
section.calculateColumnBounds(
|
4096
|
-
|
4097
|
-
|
4098
|
-
|
4099
|
-
}
|
4100
|
-
section.updateColumnBounds(positions, noBorders, topPx);
|
4101
|
-
for(i = 1; i < sectCount; i++) {
|
4102
|
-
section = this._settings[i].getSection();
|
4103
|
-
section.updateColumnBounds(positions, noBorders);
|
4131
|
+
section.calculateColumnBounds(pair[0], pair[1], positions, noBorders);
|
4132
|
+
if(positions[0] < positions[1]) {
|
4133
|
+
posAry.push(positions);
|
4134
|
+
noBorderAry.push(noBorders);
|
4104
4135
|
}
|
4105
4136
|
}
|
4137
|
+
|
4138
|
+
// Render column bounds
|
4139
|
+
var topPx = 0;
|
4140
|
+
var topBoundIdx = -1;
|
4141
|
+
if(arg["topBoundRowIndex"] != null) {
|
4142
|
+
topBoundIdx = +arg["topBoundRowIndex"];
|
4143
|
+
}
|
4144
|
+
if(topBoundIdx >= 0 && topSectionSettings.getType() === "title") {
|
4145
|
+
topPx = this._layoutY.getLaneStart(topBoundIdx);
|
4146
|
+
}
|
4147
|
+
section.updateColumnBounds(posAry, noBorderAry, topPx);
|
4148
|
+
for(i = 1; i < sectCount; i++) {
|
4149
|
+
section = this._settings[i].getSection();
|
4150
|
+
section.updateColumnBounds(posAry, noBorderAry);
|
4151
|
+
}
|
4106
4152
|
};
|
4107
4153
|
|
4108
4154
|
/** @public
|
@@ -692,11 +692,11 @@ ILayoutGrid.prototype.getHorizontalLayout = function () {};
|
|
692
692
|
ILayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositions, outNoBorders) {};
|
693
693
|
/** @public
|
694
694
|
* @ignore
|
695
|
-
* @param {!Array.<
|
696
|
-
* @param {!Array.<
|
695
|
+
* @param {!Array.<Array>} posAry Left and right bound positions in pixel
|
696
|
+
* @param {!Array.<Array>} noBorderAry Boolean values indicating existence of left and right CSS borders
|
697
697
|
* @param {number=} topPx Top position of bound
|
698
698
|
*/
|
699
|
-
ILayoutGrid.prototype.updateColumnBounds = function (
|
699
|
+
ILayoutGrid.prototype.updateColumnBounds = function (posAry, noBorderAry, topPx) {};
|
700
700
|
|
701
701
|
export default ILayoutGrid;
|
702
702
|
export { ILayoutGrid };
|
@@ -253,10 +253,18 @@ LayoutGrid.prototype._ctxRows;
|
|
253
253
|
* @private
|
254
254
|
*/
|
255
255
|
LayoutGrid.prototype._boundLayer = null;
|
256
|
-
/** @type {Element}
|
256
|
+
/** @type {Array.<Element>}
|
257
|
+
* @private
|
258
|
+
*/
|
259
|
+
LayoutGrid.prototype._colBounds = null;
|
260
|
+
/** @type {Array.<Element>}
|
261
|
+
* @private
|
262
|
+
*/
|
263
|
+
LayoutGrid.prototype._colBoundCache = null;
|
264
|
+
/** @type {boolean}
|
257
265
|
* @private
|
258
266
|
*/
|
259
|
-
LayoutGrid.prototype.
|
267
|
+
LayoutGrid.prototype._colSelDirty = false;
|
260
268
|
/** @type {HScrollbar}
|
261
269
|
* @private
|
262
270
|
*/
|
@@ -280,6 +288,8 @@ LayoutGrid.prototype.dispose = function () {
|
|
280
288
|
}
|
281
289
|
|
282
290
|
this._colCount = this._rowCount = this._activeRowEnd = this._availableRowCount = 0;
|
291
|
+
this._colBounds = this._colBoundCache = null;
|
292
|
+
this._colSelDirty = false;
|
283
293
|
|
284
294
|
this._highlightedCells.length = 0;
|
285
295
|
this._ctx = null;
|
@@ -2221,16 +2231,15 @@ LayoutGrid.prototype.getContextRow = function (rowIndex) {
|
|
2221
2231
|
LayoutGrid.prototype.selectColumn = function (colIndex, selected) {
|
2222
2232
|
this.enableColumnClass(colIndex, "selected-column", selected);
|
2223
2233
|
|
2224
|
-
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2229
|
-
|
2230
|
-
|
2231
|
-
|
2232
|
-
|
2233
|
-
this._updateLayers();
|
2234
|
+
if(selected) {
|
2235
|
+
this._colSelDirty = true;
|
2236
|
+
|
2237
|
+
var boundLayer = this._boundLayer;
|
2238
|
+
if(!boundLayer) {
|
2239
|
+
boundLayer = this._boundLayer = document.createElement("div");
|
2240
|
+
boundLayer.className = "cover-layer";
|
2241
|
+
this._updateLayers();
|
2242
|
+
}
|
2234
2243
|
}
|
2235
2244
|
};
|
2236
2245
|
/** @public
|
@@ -2333,24 +2342,56 @@ LayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositi
|
|
2333
2342
|
};
|
2334
2343
|
/** @public
|
2335
2344
|
* @ignore
|
2336
|
-
* @param {!Array.<
|
2337
|
-
* @param {!Array.<
|
2345
|
+
* @param {!Array.<Array>} posAry Left and right bound positions in pixel
|
2346
|
+
* @param {!Array.<Array>} noBorderAry Boolean values indicating existence of left and right CSS borders
|
2338
2347
|
* @param {number=} topPx Top position of bound
|
2339
2348
|
*/
|
2340
|
-
LayoutGrid.prototype.updateColumnBounds = function (
|
2341
|
-
|
2342
|
-
if(!columnBound) {
|
2349
|
+
LayoutGrid.prototype.updateColumnBounds = function (posAry, noBorderAry, topPx) {
|
2350
|
+
if(!this._colSelDirty) {
|
2343
2351
|
return;
|
2344
2352
|
}
|
2345
2353
|
|
2346
|
-
var
|
2347
|
-
var
|
2348
|
-
if(
|
2349
|
-
|
2354
|
+
var cbs = this._colBounds;
|
2355
|
+
var cbc = this._colBoundCache;
|
2356
|
+
if(!cbs) {
|
2357
|
+
cbs = this._colBounds = [];
|
2358
|
+
}
|
2359
|
+
if(!cbc) {
|
2360
|
+
cbc = this._colBoundCache = [];
|
2361
|
+
}
|
2362
|
+
|
2363
|
+
var rangeCount = posAry.length;
|
2364
|
+
var i;
|
2365
|
+
var pn = null; // parentNode
|
2366
|
+
var columnBound = null;
|
2367
|
+
|
2368
|
+
// Remove unused bounds from document
|
2369
|
+
var activeCount = cbs.length;
|
2370
|
+
for(i = rangeCount; i < activeCount; ++i) {
|
2371
|
+
columnBound = cbs[i];
|
2372
|
+
pn = columnBound.parentNode;
|
2350
2373
|
if(pn) {
|
2351
2374
|
pn.removeChild(columnBound);
|
2352
2375
|
}
|
2353
|
-
}
|
2376
|
+
}
|
2377
|
+
cbs.length = activeCount = rangeCount;
|
2378
|
+
|
2379
|
+
if(!rangeCount) {
|
2380
|
+
this._colSelDirty = false;
|
2381
|
+
return;
|
2382
|
+
}
|
2383
|
+
|
2384
|
+
for(i = 0; i < rangeCount; ++i) {
|
2385
|
+
var positions = posAry[i];
|
2386
|
+
var noBorders = noBorderAry[i];
|
2387
|
+
var lftPx = /** @type{number} */(positions[0]);
|
2388
|
+
var rgtPx = /** @type{number} */(positions[1]);
|
2389
|
+
|
2390
|
+
columnBound = cbc[i];
|
2391
|
+
if(!columnBound) {
|
2392
|
+
columnBound = cbc[i] = document.createElement("div");
|
2393
|
+
columnBound.className = "selection-bound column-bound";
|
2394
|
+
}
|
2354
2395
|
columnBound.style.left = lftPx + "px";
|
2355
2396
|
columnBound.style.width = (rgtPx - lftPx) + "px";
|
2356
2397
|
|
@@ -2360,7 +2401,10 @@ LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx)
|
|
2360
2401
|
columnBound.classList.toggle("no-left-bound", noBorders[0]);
|
2361
2402
|
columnBound.classList.toggle("no-right-bound", noBorders[1]);
|
2362
2403
|
if(this._boundLayer) {
|
2363
|
-
|
2404
|
+
if(!cbs[i]) {
|
2405
|
+
cbs[i] = columnBound;
|
2406
|
+
this._boundLayer.appendChild(columnBound);
|
2407
|
+
}
|
2364
2408
|
}
|
2365
2409
|
}
|
2366
2410
|
};
|
@@ -97,10 +97,18 @@ VirtualizedLayoutGrid.prototype._selectionList = null;
|
|
97
97
|
* @private
|
98
98
|
*/
|
99
99
|
VirtualizedLayoutGrid.prototype._reverter = null;
|
100
|
-
/** @type {Element}
|
100
|
+
/** @type {Array.<Element>}
|
101
|
+
* @private
|
102
|
+
*/
|
103
|
+
VirtualizedLayoutGrid.prototype._rowBounds = null;
|
104
|
+
/** @type {Array.<Element>}
|
105
|
+
* @private
|
106
|
+
*/
|
107
|
+
VirtualizedLayoutGrid.prototype._rowBoundCache = null;
|
108
|
+
/** @type {boolean}
|
101
109
|
* @private
|
102
110
|
*/
|
103
|
-
VirtualizedLayoutGrid.prototype.
|
111
|
+
VirtualizedLayoutGrid.prototype._rowSelDirty = false;
|
104
112
|
/** @type {Element}
|
105
113
|
* @private
|
106
114
|
*/
|
@@ -166,6 +174,9 @@ VirtualizedLayoutGrid.prototype.dispose = function () {
|
|
166
174
|
this._grid.dispose();
|
167
175
|
this._dispose();
|
168
176
|
this._reverter.dispose();
|
177
|
+
|
178
|
+
this._rowBounds = this._rowBoundCache = null;
|
179
|
+
this._rowSelDirty = false;
|
169
180
|
if(this._rowBoundTimer) {
|
170
181
|
clearTimeout(this._rowBoundTimer);
|
171
182
|
this._rowBoundTimer = 0;
|
@@ -617,9 +628,10 @@ VirtualizedLayoutGrid.prototype.setSelectedRow = function (rowIndex, opt_selecte
|
|
617
628
|
this._grid.setSelectedRow(rowIndex - this._firstIndex, selected);
|
618
629
|
|
619
630
|
if(selected) {
|
620
|
-
this.
|
631
|
+
this._rowSelDirty = true;
|
632
|
+
this._initBoundLayer();
|
621
633
|
}
|
622
|
-
this.
|
634
|
+
this._requestUpdatingRowBounds();
|
623
635
|
};
|
624
636
|
|
625
637
|
/** @inheritDoc */
|
@@ -632,14 +644,15 @@ VirtualizedLayoutGrid.prototype.selectSingleRow = function (rowIndex) {
|
|
632
644
|
VirtualizedLayoutGrid.prototype.selectRowRange = function (rowIndex, length) {
|
633
645
|
this._selectionList.selectRange(rowIndex, length);
|
634
646
|
this._updateRowSelection();
|
635
|
-
this.
|
636
|
-
this.
|
647
|
+
this._rowSelDirty = true;
|
648
|
+
this._initBoundLayer();
|
649
|
+
this._requestUpdatingRowBounds();
|
637
650
|
};
|
638
651
|
/** @inheritDoc */
|
639
652
|
VirtualizedLayoutGrid.prototype.clearSelectedRows = function () {
|
640
653
|
var count = this._selectionList.clearAllSelections();
|
641
654
|
this._grid.clearSelectedRows();
|
642
|
-
this.
|
655
|
+
this._requestUpdatingRowBounds(); // WARNING: Row bounds are not removed from the document immediately
|
643
656
|
return count;
|
644
657
|
};
|
645
658
|
/** @inheritDoc */
|
@@ -1081,12 +1094,12 @@ VirtualizedLayoutGrid.prototype._updateCellBounds = function () {
|
|
1081
1094
|
};
|
1082
1095
|
/** @public
|
1083
1096
|
* @ignore
|
1084
|
-
* @param {!Array.<
|
1085
|
-
* @param {!Array.<
|
1097
|
+
* @param {!Array.<Array>} posAry Left and right bound positions in pixel
|
1098
|
+
* @param {!Array.<Array>} noBorderAry Boolean values indicating existence of left and right CSS borders
|
1086
1099
|
* @param {number=} topPx Top position of bound
|
1087
1100
|
*/
|
1088
|
-
VirtualizedLayoutGrid.prototype.updateColumnBounds = function (
|
1089
|
-
this._grid.updateColumnBounds(
|
1101
|
+
VirtualizedLayoutGrid.prototype.updateColumnBounds = function (posAry, noBorderAry, topPx) {
|
1102
|
+
this._grid.updateColumnBounds(posAry, noBorderAry, topPx);
|
1090
1103
|
this._updateRowBounds();
|
1091
1104
|
};
|
1092
1105
|
/** @private
|
@@ -1101,16 +1114,6 @@ VirtualizedLayoutGrid.prototype._initBoundLayer = function () {
|
|
1101
1114
|
};
|
1102
1115
|
/** @private
|
1103
1116
|
*/
|
1104
|
-
VirtualizedLayoutGrid.prototype._initRowBounds = function () {
|
1105
|
-
var rowBound = this._rowBound;
|
1106
|
-
if(!rowBound) {
|
1107
|
-
rowBound = this._rowBound = document.createElement("div");
|
1108
|
-
rowBound.className = "selection-bound";
|
1109
|
-
}
|
1110
|
-
this._initBoundLayer();
|
1111
|
-
};
|
1112
|
-
/** @private
|
1113
|
-
*/
|
1114
1117
|
VirtualizedLayoutGrid.prototype._requestUpdatingRowBounds = function () {
|
1115
1118
|
if(!this._rowBoundTimer) {
|
1116
1119
|
this._rowBoundTimer = setTimeout(this._updateRowBounds, 10);
|
@@ -1122,54 +1125,88 @@ VirtualizedLayoutGrid.prototype._updateRowBounds = function () {
|
|
1122
1125
|
this._rowBoundTimer = 0;
|
1123
1126
|
this._updateCellBounds();
|
1124
1127
|
|
1125
|
-
|
1126
|
-
if(!rowBound) {
|
1128
|
+
if(!this._rowSelDirty) {
|
1127
1129
|
return;
|
1128
1130
|
}
|
1129
|
-
var
|
1130
|
-
var
|
1131
|
-
|
1132
|
-
|
1133
|
-
var rowCount = this._layoutY.getLaneCount();
|
1134
|
-
if(topIdx >= rowCount) {
|
1135
|
-
topIdx = rowCount - 1;
|
1131
|
+
var rbs = this._rowBounds;
|
1132
|
+
var rbc = this._rowBoundCache;
|
1133
|
+
if(!rbs) {
|
1134
|
+
rbs = this._rowBounds = [];
|
1136
1135
|
}
|
1137
|
-
if(
|
1138
|
-
|
1139
|
-
if(btmIdx >= rowCount) {
|
1140
|
-
btmIdx = rowCount - 1;
|
1141
|
-
}
|
1142
|
-
topPx = this._layoutY.getLaneStart(topIdx);
|
1143
|
-
btmPx = this._layoutY.getLaneEnd(btmIdx);
|
1136
|
+
if(!rbc) {
|
1137
|
+
rbc = this._rowBoundCache = [];
|
1144
1138
|
}
|
1145
1139
|
|
1146
|
-
|
1147
|
-
|
1140
|
+
var selList = this._selectionList;
|
1141
|
+
var rowCount = this._layoutY.getLaneCount();
|
1142
|
+
selList.deselectFrom(rowCount); // TODO: move this to setRowCount
|
1143
|
+
|
1144
|
+
var selRanges = selList.getConnectedRanges();
|
1145
|
+
var rangeCount = selRanges.length;
|
1146
|
+
var i;
|
1147
|
+
var pn = null; // parentNode
|
1148
|
+
var rowBound = null;
|
1149
|
+
|
1150
|
+
// Remove unused bounds from document
|
1151
|
+
var activeCount = rbs.length;
|
1152
|
+
for(i = rangeCount; i < activeCount; ++i) {
|
1153
|
+
rowBound = rbs[i];
|
1154
|
+
pn = rowBound.parentNode;
|
1148
1155
|
if(pn) {
|
1149
1156
|
pn.removeChild(rowBound);
|
1150
1157
|
}
|
1151
|
-
}
|
1158
|
+
}
|
1159
|
+
rbs.length = activeCount = rangeCount;
|
1160
|
+
|
1161
|
+
if(!rangeCount) {
|
1162
|
+
var selCount = selList.getSelectionCount();
|
1163
|
+
if(!selCount) {
|
1164
|
+
this._rowSelDirty = false;
|
1165
|
+
}
|
1166
|
+
return;
|
1167
|
+
}
|
1168
|
+
|
1169
|
+
// Prepare shared parameters
|
1170
|
+
var scrollLeft = 0;
|
1171
|
+
var pinnedLftCount = 0;
|
1172
|
+
var pinnedRgtCount = 0;
|
1173
|
+
var endOfScroll = false;
|
1174
|
+
if(this._hscrollbar) {
|
1175
|
+
scrollLeft = this._hscrollbar.getScrollLeft();
|
1176
|
+
pinnedLftCount = this._hscrollbar.getPinnedLeftColumnCount();
|
1177
|
+
pinnedRgtCount = this._hscrollbar.getPinnedRightColumnCount();
|
1178
|
+
endOfScroll = this._hscrollbar.isEndOfHorizontalScroll();
|
1179
|
+
}
|
1180
|
+
var noLeftBound = !pinnedLftCount && scrollLeft > 0;
|
1181
|
+
var noRightBound = !pinnedRgtCount && !endOfScroll;
|
1182
|
+
var boundWidth = this._grid._getViewSize();
|
1183
|
+
|
1184
|
+
// Create row bound elements based on number of selection ranges
|
1185
|
+
for(i = 0; i < rangeCount; ++i) {
|
1186
|
+
var pair = selRanges[i];
|
1187
|
+
var topIdx = pair[0];
|
1188
|
+
var btmIdx = pair[1]; // Inclusive
|
1189
|
+
var topPx = this._layoutY.getLaneStart(topIdx);
|
1190
|
+
var btmPx = this._layoutY.getLaneEnd(btmIdx);
|
1191
|
+
|
1192
|
+
rowBound = rbc[i];
|
1193
|
+
if(!rowBound) {
|
1194
|
+
rowBound = rbc[i] = document.createElement("div");
|
1195
|
+
rowBound.className = "selection-bound";
|
1196
|
+
}
|
1197
|
+
|
1152
1198
|
rowBound.style.top = topPx + "px";
|
1153
1199
|
rowBound.style.height = (btmPx - topPx) + "px";
|
1154
|
-
|
1155
|
-
var boundWidth = this._grid._getViewSize();
|
1156
1200
|
rowBound.style.width = boundWidth + "px";
|
1157
1201
|
|
1158
|
-
|
1159
|
-
|
1160
|
-
var pinnedRgtCount = 0;
|
1161
|
-
var endOfScroll = false;
|
1162
|
-
if(this._hscrollbar) {
|
1163
|
-
scrollLeft = this._hscrollbar.getScrollLeft();
|
1164
|
-
pinnedLftCount = this._hscrollbar.getPinnedLeftColumnCount();
|
1165
|
-
pinnedRgtCount = this._hscrollbar.getPinnedRightColumnCount();
|
1166
|
-
endOfScroll = this._hscrollbar.isEndOfHorizontalScroll();
|
1167
|
-
}
|
1168
|
-
rowBound.classList.toggle("no-left-bound", !pinnedLftCount && scrollLeft > 0);
|
1169
|
-
rowBound.classList.toggle("no-right-bound", !pinnedRgtCount && !endOfScroll);
|
1202
|
+
rowBound.classList.toggle("no-left-bound", noLeftBound);
|
1203
|
+
rowBound.classList.toggle("no-right-bound", noRightBound);
|
1170
1204
|
|
1171
1205
|
if(this._boundLayer) {
|
1172
|
-
|
1206
|
+
if(!rbs[i]) {
|
1207
|
+
rbs[i] = rowBound;
|
1208
|
+
this._boundLayer.appendChild(rowBound);
|
1209
|
+
}
|
1173
1210
|
}
|
1174
1211
|
}
|
1175
1212
|
};
|
@@ -4,6 +4,7 @@ import Core from "../Core.js";
|
|
4
4
|
import ILayoutGrid from "../ILayoutGrid.js";
|
5
5
|
import ElementWrapper from "../components/ElementWrapper.js";
|
6
6
|
import DataTable from "../../data/DataTable.js";
|
7
|
+
import { isEmptyObject } from "../../../../tr-grid-util/es6/Util.js";
|
7
8
|
|
8
9
|
declare namespace SortableTitlePlugin {
|
9
10
|
|
@@ -5,6 +5,7 @@ import Core from "../Core.js";
|
|
5
5
|
import ILayoutGrid from "../ILayoutGrid.js";
|
6
6
|
import ElementWrapper from "../components/ElementWrapper.js";
|
7
7
|
import DataTable from "../../data/DataTable.js";
|
8
|
+
import { isEmptyObject } from "../../../../tr-grid-util/es6/Util.js";
|
8
9
|
/* eslint-enable */
|
9
10
|
|
10
11
|
/** Fired when user click and before the sorting operation.
|
@@ -464,7 +465,10 @@ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
|
|
464
465
|
}
|
465
466
|
field = opt["field"];
|
466
467
|
if (field) {
|
467
|
-
col["
|
468
|
+
if(col["field"] !== field) {
|
469
|
+
col["sortBy"] = field;
|
470
|
+
} // else The default value is an empty sortBy, which refers to the same column field by default.
|
471
|
+
|
468
472
|
if (this._sortingSequenceMap && this._sortingSequenceMap[field]) {
|
469
473
|
col["sortingSequence"] = this._sortingSequenceMap[field];
|
470
474
|
}
|
@@ -477,16 +481,32 @@ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
|
|
477
481
|
extOptions = obj["sorting"] = {};
|
478
482
|
}
|
479
483
|
|
480
|
-
|
481
|
-
|
484
|
+
var val = this.getSortedColumns();
|
485
|
+
if(val != null) {
|
486
|
+
extOptions["initialSort"] = val;
|
487
|
+
}
|
488
|
+
|
489
|
+
val = this._sortableIndicator;
|
490
|
+
if(val !== false) {
|
491
|
+
extOptions["sortableIndicator"] = val;
|
492
|
+
}
|
493
|
+
|
482
494
|
if(this._maxCount !== 1) {
|
483
495
|
extOptions["multiColumn"] = this._maxCount === -1 ? true : this._maxCount;
|
484
496
|
}
|
485
497
|
if(this._dblClickAllowed) {
|
486
498
|
extOptions["disableDoubleClickToSort"] = !this._dblClickAllowed;
|
487
499
|
}
|
488
|
-
|
489
|
-
|
500
|
+
|
501
|
+
val = this._sortableColumns;
|
502
|
+
if(val !== true) {
|
503
|
+
extOptions["sortableColumns"] = val;
|
504
|
+
}
|
505
|
+
|
506
|
+
val = this._dataSorting;
|
507
|
+
if(val !== true) {
|
508
|
+
extOptions["indicatorOnly"] = val;
|
509
|
+
}
|
490
510
|
// extOptions["mode"] = this._mode;
|
491
511
|
if(this._disabled) {
|
492
512
|
extOptions["disabled"] = true;
|
@@ -503,6 +523,10 @@ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
|
|
503
523
|
extOptions["sortingSequence"] = sortingSeq.slice();
|
504
524
|
}
|
505
525
|
|
526
|
+
if(isEmptyObject(obj["sorting"])) {
|
527
|
+
delete obj["sorting"];
|
528
|
+
}
|
529
|
+
|
506
530
|
return obj;
|
507
531
|
};
|
508
532
|
|
@@ -12,6 +12,8 @@ declare class SelectionList {
|
|
12
12
|
|
13
13
|
public deselect(at: number): boolean;
|
14
14
|
|
15
|
+
public deselectFrom(at: number): boolean;
|
16
|
+
|
15
17
|
public toggleSelection(at: number): void;
|
16
18
|
|
17
19
|
public singularlySelect(at: number): boolean;
|
@@ -36,13 +38,15 @@ declare class SelectionList {
|
|
36
38
|
|
37
39
|
public getLastSelectedIndex(): number;
|
38
40
|
|
39
|
-
public getAllSelections(): (number)[]
|
41
|
+
public getAllSelections(): (number)[];
|
42
|
+
|
43
|
+
public getConnectedRanges(from?: number|null, to?: number|null): (number)[][];
|
40
44
|
|
41
45
|
public getSelectionMap(): (boolean)[]|null;
|
42
46
|
|
43
47
|
public clearAllSelections(): number;
|
44
48
|
|
45
|
-
public copyFrom(srcSelections: SelectionList|null, fromSrcIndex: number,
|
49
|
+
public copyFrom(srcSelections: SelectionList|null, fromSrcIndex: number, offset: number, forLength: number): void;
|
46
50
|
|
47
51
|
}
|
48
52
|
|