@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.
Files changed (41) hide show
  1. package/lib/core/dist/core.js +376 -126
  2. package/lib/core/dist/core.min.js +1 -1
  3. package/lib/core/es6/grid/Core.d.ts +4 -0
  4. package/lib/core/es6/grid/Core.js +79 -33
  5. package/lib/core/es6/grid/ILayoutGrid.js +3 -3
  6. package/lib/core/es6/grid/LayoutGrid.js +67 -23
  7. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +92 -55
  8. package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +1 -0
  9. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +29 -5
  10. package/lib/core/es6/grid/util/SelectionList.d.ts +6 -2
  11. package/lib/core/es6/grid/util/SelectionList.js +76 -7
  12. package/lib/grid/index.js +1 -1
  13. package/lib/rt-grid/dist/rt-grid.js +521 -179
  14. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  15. package/lib/rt-grid/es6/Grid.js +14 -13
  16. package/lib/rt-grid/es6/RowDefinition.js +1 -1
  17. package/lib/statistics-row/es6/StatisticsRow.d.ts +25 -25
  18. package/lib/statistics-row/es6/StatisticsRow.js +9 -4
  19. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +4 -0
  20. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +58 -30
  21. package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +2 -0
  22. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +14 -0
  23. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +2 -0
  24. package/lib/tr-grid-column-stack/es6/ColumnStack.js +35 -12
  25. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +23 -1
  26. package/lib/tr-grid-row-dragging/es6/RowDragging.js +339 -40
  27. package/lib/tr-grid-util/es6/GroupDefinitions.d.ts +2 -0
  28. package/lib/tr-grid-util/es6/GroupDefinitions.js +15 -0
  29. package/lib/tr-grid-util/es6/Util.d.ts +3 -0
  30. package/lib/tr-grid-util/es6/Util.js +15 -0
  31. package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +1 -1
  32. package/lib/tr-grid-util/es6/jet/CollectionDict.js +12 -2
  33. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +170 -47
  34. package/lib/types/es6/ColumnGrouping.d.ts +4 -0
  35. package/lib/types/es6/ColumnSelection.d.ts +2 -0
  36. package/lib/types/es6/ColumnStack.d.ts +2 -0
  37. package/lib/types/es6/Core/grid/util/SelectionList.d.ts +6 -2
  38. package/lib/types/es6/RowDragging.d.ts +23 -1
  39. package/lib/types/es6/StatisticsRow.d.ts +25 -25
  40. package/lib/versions.json +6 -6
  41. package/package.json +1 -1
@@ -6,6 +6,7 @@
6
6
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7
7
 
8
8
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9
+ /* harmony export */ "Qr": () => (/* binding */ isEmptyObject),
9
10
  /* harmony export */ "kI": () => (/* binding */ cloneObject)
10
11
  /* harmony export */ });
11
12
  /* unused harmony exports Util, extendObject, arrayToObject, extendProperty, extendArrayProperty, parseCondition, prettifyCss, getShadowRoot, injectCss, isIE, isMac, isTouchDevice, nestedObjectToArray, rgb2Hex, prepareTSVContent */
@@ -149,6 +150,20 @@ var extendObject = function (obj, extender, limiters) {
149
150
  var cloneObject = function (obj, limiters) {
150
151
  return extendObject({}, obj, limiters);
151
152
  };
153
+
154
+ /** Check empty object
155
+ * @public
156
+ * @function
157
+ * @param {Object} obj
158
+ * @return {boolean}=true, if the obj is empty
159
+ */
160
+ var isEmptyObject = function (obj) {
161
+ for (var key in obj) {
162
+ return false;
163
+ }
164
+ return true;
165
+ };
166
+
152
167
  /** @public
153
168
  * @param {Array=} data
154
169
  * @param {Array.<string>=} fields In case of the given data is an array, this param will be used for mapping index to field
@@ -4693,11 +4708,11 @@ ILayoutGrid.prototype.getHorizontalLayout = function () {};
4693
4708
  ILayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositions, outNoBorders) {};
4694
4709
  /** @public
4695
4710
  * @ignore
4696
- * @param {!Array.<number>} positions Left and right bound positions in pixel
4697
- * @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
4711
+ * @param {!Array.<Array>} posAry Left and right bound positions in pixel
4712
+ * @param {!Array.<Array>} noBorderAry Boolean values indicating existence of left and right CSS borders
4698
4713
  * @param {number=} topPx Top position of bound
4699
4714
  */
4700
- ILayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {};
4715
+ ILayoutGrid.prototype.updateColumnBounds = function (posAry, noBorderAry, topPx) {};
4701
4716
 
4702
4717
  /* harmony default export */ const grid_ILayoutGrid = (ILayoutGrid);
4703
4718
 
@@ -6263,6 +6278,34 @@ SelectionList.prototype.deselect = function (at) {
6263
6278
  }
6264
6279
  return false;
6265
6280
  };
6281
+ /** Deselect all selections starting from the specified index
6282
+ * @public
6283
+ * @param {number} at
6284
+ * @return {boolean}
6285
+ */
6286
+ SelectionList.prototype.deselectFrom = function (at) {
6287
+ if(this._lastIndex < at) {
6288
+ return false;
6289
+ }
6290
+ if(this._firstIndex >= at) {
6291
+ this.clearAllSelections();
6292
+ return true;
6293
+ }
6294
+
6295
+ var lastIndex = this._lastIndex;
6296
+ var sels = this._selections;
6297
+ for(var i = at; i <= lastIndex; ++i) {
6298
+ if (sels[i]) {
6299
+ sels[at] = false;
6300
+ --this._count;
6301
+ }
6302
+ }
6303
+ if (this._anchor >= at) {
6304
+ this._anchor = -1; // No anchor
6305
+ }
6306
+ this._lastIndex = this._findPrevSelection(at);
6307
+ return true;
6308
+ };
6266
6309
  /** @public
6267
6310
  * @param {number} at
6268
6311
  */
@@ -6459,14 +6502,16 @@ SelectionList.prototype.getLastSelectedIndex = function() {
6459
6502
 
6460
6503
  /** WARNING: It will creates a new(EXPENSIVE) defragmented array of selected Index. The selected indices will always be sorted in ascending order
6461
6504
  * @public
6462
- * @return {Array.<number>}
6505
+ * @return {!Array.<number>}
6463
6506
  */
6464
6507
  SelectionList.prototype.getAllSelections = function() {
6465
6508
  if(this._count > 0) {
6466
6509
  var ary = new Array(this._count); // Fastest way to create an array
6467
6510
  var count = 0;
6468
- for(var i = this._firstIndex; i <= this._lastIndex; ++i) {
6469
- if(this._selections[i]) {
6511
+ var sels = this._selections;
6512
+ var lastIdx = this._lastIndex;
6513
+ for(var i = this._firstIndex; i <= lastIdx; ++i) {
6514
+ if(sels[i]) {
6470
6515
  ary[count++] = i;
6471
6516
  }
6472
6517
  }
@@ -6474,6 +6519,45 @@ SelectionList.prototype.getAllSelections = function() {
6474
6519
  }
6475
6520
  return [];
6476
6521
  };
6522
+ /** Get array of connected selection ranges. For intances, if indices 1, 2, 5, and 5 are selected, array of [1, 2] and [5, 5] are returned.
6523
+ * @public
6524
+ * @param {number=} from
6525
+ * @param {number=} to EXCLUSIVE
6526
+ * @return {!Array.<Array.<number>>}
6527
+ */
6528
+ SelectionList.prototype.getConnectedRanges = function(from, to) {
6529
+ if(this._count > 0) {
6530
+ var ary = [];
6531
+ if(from == null || from < this._firstIndex) {
6532
+ from = this._firstIndex;
6533
+ }
6534
+ if(to == null || to > this._lastIndex) {
6535
+ to = this._lastIndex + 1;
6536
+ }
6537
+
6538
+ var pair = null;
6539
+ for(var i = from; i < to; ++i) {
6540
+ if(this._selections[i]) {
6541
+ if(!pair) {
6542
+ pair = [i, -1];
6543
+ }
6544
+ } else if(pair) {
6545
+ pair[1] = i - 1;
6546
+ ary.push(pair);
6547
+ pair = null;
6548
+ }
6549
+ }
6550
+
6551
+ if(pair) {
6552
+ pair[1] = this._lastIndex;
6553
+ ary.push(pair);
6554
+ pair = null;
6555
+ }
6556
+ return ary;
6557
+ }
6558
+ return [];
6559
+ };
6560
+
6477
6561
  /**
6478
6562
  * @public
6479
6563
  * @return {Array.<boolean>}
@@ -6501,13 +6585,13 @@ SelectionList.prototype.clearAllSelections = function() {
6501
6585
  * @public
6502
6586
  * @param {SelectionList} srcSelections
6503
6587
  * @param {number} fromSrcIndex
6504
- * @param {number} offsetIndex
6588
+ * @param {number} offset Offset from the source index to map to destination index of this SelectionList. Use 0 if there is no shifting.
6505
6589
  * @param {number} forLength Positive value only. negative valie is not allowed
6506
6590
  */
6507
- SelectionList.prototype.copyFrom = function (srcSelections, fromSrcIndex, offsetIndex, forLength) {
6591
+ SelectionList.prototype.copyFrom = function (srcSelections, fromSrcIndex, offset, forLength) {
6508
6592
  if (forLength <= 0) { return; }
6509
6593
 
6510
- var toThisIndex = fromSrcIndex + offsetIndex;
6594
+ var toThisIndex = fromSrcIndex + offset;
6511
6595
  if (srcSelections == null) {
6512
6596
  this.deselectRange(toThisIndex, forLength);
6513
6597
  return;
@@ -6528,7 +6612,7 @@ SelectionList.prototype.copyFrom = function (srcSelections, fromSrcIndex, offset
6528
6612
  this._anchor = -1;
6529
6613
  if (srcSelections._anchor >= 0) {
6530
6614
  if (srcSelections._anchor >= fromSrcIndex && srcSelections._anchor < (fromSrcIndex + forLength)) {
6531
- this._anchor = srcSelections._anchor + offsetIndex;
6615
+ this._anchor = srcSelections._anchor + offset;
6532
6616
  }
6533
6617
  }
6534
6618
  };
@@ -8602,10 +8686,18 @@ LayoutGrid.prototype._ctxRows;
8602
8686
  * @private
8603
8687
  */
8604
8688
  LayoutGrid.prototype._boundLayer = null;
8605
- /** @type {Element}
8689
+ /** @type {Array.<Element>}
8690
+ * @private
8691
+ */
8692
+ LayoutGrid.prototype._colBounds = null;
8693
+ /** @type {Array.<Element>}
8606
8694
  * @private
8607
8695
  */
8608
- LayoutGrid.prototype._columnBound = null;
8696
+ LayoutGrid.prototype._colBoundCache = null;
8697
+ /** @type {boolean}
8698
+ * @private
8699
+ */
8700
+ LayoutGrid.prototype._colSelDirty = false;
8609
8701
  /** @type {HScrollbar}
8610
8702
  * @private
8611
8703
  */
@@ -8629,6 +8721,8 @@ LayoutGrid.prototype.dispose = function () {
8629
8721
  }
8630
8722
 
8631
8723
  this._colCount = this._rowCount = this._activeRowEnd = this._availableRowCount = 0;
8724
+ this._colBounds = this._colBoundCache = null;
8725
+ this._colSelDirty = false;
8632
8726
 
8633
8727
  this._highlightedCells.length = 0;
8634
8728
  this._ctx = null;
@@ -10570,16 +10664,15 @@ LayoutGrid.prototype.getContextRow = function (rowIndex) {
10570
10664
  LayoutGrid.prototype.selectColumn = function (colIndex, selected) {
10571
10665
  this.enableColumnClass(colIndex, "selected-column", selected);
10572
10666
 
10573
- var columnBound = this._columnBound;
10574
- if(!columnBound) {
10575
- columnBound = this._columnBound = document.createElement("div");
10576
- columnBound.className = "selection-bound column-bound";
10577
- }
10578
- var boundLayer = this._boundLayer;
10579
- if(!boundLayer) {
10580
- boundLayer = this._boundLayer = document.createElement("div");
10581
- boundLayer.className = "cover-layer";
10582
- this._updateLayers();
10667
+ if(selected) {
10668
+ this._colSelDirty = true;
10669
+
10670
+ var boundLayer = this._boundLayer;
10671
+ if(!boundLayer) {
10672
+ boundLayer = this._boundLayer = document.createElement("div");
10673
+ boundLayer.className = "cover-layer";
10674
+ this._updateLayers();
10675
+ }
10583
10676
  }
10584
10677
  };
10585
10678
  /** @public
@@ -10682,24 +10775,56 @@ LayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositi
10682
10775
  };
10683
10776
  /** @public
10684
10777
  * @ignore
10685
- * @param {!Array.<number>} positions Left and right bound positions in pixel
10686
- * @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
10778
+ * @param {!Array.<Array>} posAry Left and right bound positions in pixel
10779
+ * @param {!Array.<Array>} noBorderAry Boolean values indicating existence of left and right CSS borders
10687
10780
  * @param {number=} topPx Top position of bound
10688
10781
  */
10689
- LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {
10690
- var columnBound = this._columnBound;
10691
- if(!columnBound) {
10782
+ LayoutGrid.prototype.updateColumnBounds = function (posAry, noBorderAry, topPx) {
10783
+ if(!this._colSelDirty) {
10692
10784
  return;
10693
10785
  }
10694
10786
 
10695
- var lftPx = positions[0];
10696
- var rgtPx = positions[1];
10697
- if(lftPx >= rgtPx) {
10698
- var pn = columnBound.parentNode;
10787
+ var cbs = this._colBounds;
10788
+ var cbc = this._colBoundCache;
10789
+ if(!cbs) {
10790
+ cbs = this._colBounds = [];
10791
+ }
10792
+ if(!cbc) {
10793
+ cbc = this._colBoundCache = [];
10794
+ }
10795
+
10796
+ var rangeCount = posAry.length;
10797
+ var i;
10798
+ var pn = null; // parentNode
10799
+ var columnBound = null;
10800
+
10801
+ // Remove unused bounds from document
10802
+ var activeCount = cbs.length;
10803
+ for(i = rangeCount; i < activeCount; ++i) {
10804
+ columnBound = cbs[i];
10805
+ pn = columnBound.parentNode;
10699
10806
  if(pn) {
10700
10807
  pn.removeChild(columnBound);
10701
10808
  }
10702
- } else {
10809
+ }
10810
+ cbs.length = activeCount = rangeCount;
10811
+
10812
+ if(!rangeCount) {
10813
+ this._colSelDirty = false;
10814
+ return;
10815
+ }
10816
+
10817
+ for(i = 0; i < rangeCount; ++i) {
10818
+ var positions = posAry[i];
10819
+ var noBorders = noBorderAry[i];
10820
+ var lftPx = /** @type{number} */(positions[0]);
10821
+ var rgtPx = /** @type{number} */(positions[1]);
10822
+
10823
+ columnBound = cbc[i];
10824
+ if(!columnBound) {
10825
+ columnBound = cbc[i] = document.createElement("div");
10826
+ columnBound.className = "selection-bound column-bound";
10827
+ }
10703
10828
  columnBound.style.left = lftPx + "px";
10704
10829
  columnBound.style.width = (rgtPx - lftPx) + "px";
10705
10830
 
@@ -10709,7 +10834,10 @@ LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx)
10709
10834
  columnBound.classList.toggle("no-left-bound", noBorders[0]);
10710
10835
  columnBound.classList.toggle("no-right-bound", noBorders[1]);
10711
10836
  if(this._boundLayer) {
10712
- this._boundLayer.appendChild(columnBound);
10837
+ if(!cbs[i]) {
10838
+ cbs[i] = columnBound;
10839
+ this._boundLayer.appendChild(columnBound);
10840
+ }
10713
10841
  }
10714
10842
  }
10715
10843
  };
@@ -11730,7 +11858,22 @@ GroupDefinitions.prototype.setGroupChildren = function (groupId, newChildList) {
11730
11858
  }
11731
11859
  return false;
11732
11860
  };
11861
+ /** @public
11862
+ * @param {string} groupId
11863
+ * @param {string} groupName
11864
+ * @return {boolean}
11865
+ */
11866
+ GroupDefinitions.prototype.setGroupName = function (groupId, groupName) {
11867
+ var groupDef = this._groupMap[groupId];
11868
+ if(groupDef) {
11869
+ if(groupDef.name !== groupName) {
11870
+ groupDef.name = groupName;
11871
+ return true;
11872
+ }
11873
+ }
11733
11874
 
11875
+ return false;
11876
+ };
11734
11877
  /* harmony default export */ const es6_GroupDefinitions = ((/* unused pure expression or super */ null && (GroupDefinitions)));
11735
11878
 
11736
11879
 
@@ -23721,10 +23864,18 @@ VirtualizedLayoutGrid.prototype._selectionList = null;
23721
23864
  * @private
23722
23865
  */
23723
23866
  VirtualizedLayoutGrid.prototype._reverter = null;
23724
- /** @type {Element}
23867
+ /** @type {Array.<Element>}
23725
23868
  * @private
23726
23869
  */
23727
- VirtualizedLayoutGrid.prototype._rowBound = null;
23870
+ VirtualizedLayoutGrid.prototype._rowBounds = null;
23871
+ /** @type {Array.<Element>}
23872
+ * @private
23873
+ */
23874
+ VirtualizedLayoutGrid.prototype._rowBoundCache = null;
23875
+ /** @type {boolean}
23876
+ * @private
23877
+ */
23878
+ VirtualizedLayoutGrid.prototype._rowSelDirty = false;
23728
23879
  /** @type {Element}
23729
23880
  * @private
23730
23881
  */
@@ -23790,6 +23941,9 @@ VirtualizedLayoutGrid.prototype.dispose = function () {
23790
23941
  this._grid.dispose();
23791
23942
  this._dispose();
23792
23943
  this._reverter.dispose();
23944
+
23945
+ this._rowBounds = this._rowBoundCache = null;
23946
+ this._rowSelDirty = false;
23793
23947
  if(this._rowBoundTimer) {
23794
23948
  clearTimeout(this._rowBoundTimer);
23795
23949
  this._rowBoundTimer = 0;
@@ -24241,9 +24395,10 @@ VirtualizedLayoutGrid.prototype.setSelectedRow = function (rowIndex, opt_selecte
24241
24395
  this._grid.setSelectedRow(rowIndex - this._firstIndex, selected);
24242
24396
 
24243
24397
  if(selected) {
24244
- this._initRowBounds();
24398
+ this._rowSelDirty = true;
24399
+ this._initBoundLayer();
24245
24400
  }
24246
- this._updateRowBounds();
24401
+ this._requestUpdatingRowBounds();
24247
24402
  };
24248
24403
 
24249
24404
  /** @inheritDoc */
@@ -24256,14 +24411,15 @@ VirtualizedLayoutGrid.prototype.selectSingleRow = function (rowIndex) {
24256
24411
  VirtualizedLayoutGrid.prototype.selectRowRange = function (rowIndex, length) {
24257
24412
  this._selectionList.selectRange(rowIndex, length);
24258
24413
  this._updateRowSelection();
24259
- this._initRowBounds();
24260
- this._updateRowBounds();
24414
+ this._rowSelDirty = true;
24415
+ this._initBoundLayer();
24416
+ this._requestUpdatingRowBounds();
24261
24417
  };
24262
24418
  /** @inheritDoc */
24263
24419
  VirtualizedLayoutGrid.prototype.clearSelectedRows = function () {
24264
24420
  var count = this._selectionList.clearAllSelections();
24265
24421
  this._grid.clearSelectedRows();
24266
- this._updateRowBounds();
24422
+ this._requestUpdatingRowBounds(); // WARNING: Row bounds are not removed from the document immediately
24267
24423
  return count;
24268
24424
  };
24269
24425
  /** @inheritDoc */
@@ -24705,12 +24861,12 @@ VirtualizedLayoutGrid.prototype._updateCellBounds = function () {
24705
24861
  };
24706
24862
  /** @public
24707
24863
  * @ignore
24708
- * @param {!Array.<number>} positions Left and right bound positions in pixel
24709
- * @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
24864
+ * @param {!Array.<Array>} posAry Left and right bound positions in pixel
24865
+ * @param {!Array.<Array>} noBorderAry Boolean values indicating existence of left and right CSS borders
24710
24866
  * @param {number=} topPx Top position of bound
24711
24867
  */
24712
- VirtualizedLayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {
24713
- this._grid.updateColumnBounds(positions, noBorders, topPx);
24868
+ VirtualizedLayoutGrid.prototype.updateColumnBounds = function (posAry, noBorderAry, topPx) {
24869
+ this._grid.updateColumnBounds(posAry, noBorderAry, topPx);
24714
24870
  this._updateRowBounds();
24715
24871
  };
24716
24872
  /** @private
@@ -24725,16 +24881,6 @@ VirtualizedLayoutGrid.prototype._initBoundLayer = function () {
24725
24881
  };
24726
24882
  /** @private
24727
24883
  */
24728
- VirtualizedLayoutGrid.prototype._initRowBounds = function () {
24729
- var rowBound = this._rowBound;
24730
- if(!rowBound) {
24731
- rowBound = this._rowBound = document.createElement("div");
24732
- rowBound.className = "selection-bound";
24733
- }
24734
- this._initBoundLayer();
24735
- };
24736
- /** @private
24737
- */
24738
24884
  VirtualizedLayoutGrid.prototype._requestUpdatingRowBounds = function () {
24739
24885
  if(!this._rowBoundTimer) {
24740
24886
  this._rowBoundTimer = setTimeout(this._updateRowBounds, 10);
@@ -24746,54 +24892,88 @@ VirtualizedLayoutGrid.prototype._updateRowBounds = function () {
24746
24892
  this._rowBoundTimer = 0;
24747
24893
  this._updateCellBounds();
24748
24894
 
24749
- var rowBound = this._rowBound;
24750
- if(!rowBound) {
24895
+ if(!this._rowSelDirty) {
24751
24896
  return;
24752
24897
  }
24753
- var topIdx = this.getFirstSelectedRow();
24754
- var btmIdx = -1; // Inclusive
24755
- var topPx = 0;
24756
- var btmPx = 0;
24757
- var rowCount = this._layoutY.getLaneCount();
24758
- if(topIdx >= rowCount) {
24759
- topIdx = rowCount - 1;
24898
+ var rbs = this._rowBounds;
24899
+ var rbc = this._rowBoundCache;
24900
+ if(!rbs) {
24901
+ rbs = this._rowBounds = [];
24760
24902
  }
24761
- if(topIdx >= 0) {
24762
- btmIdx = this.getLastSelectedRow();
24763
- if(btmIdx >= rowCount) {
24764
- btmIdx = rowCount - 1;
24765
- }
24766
- topPx = this._layoutY.getLaneStart(topIdx);
24767
- btmPx = this._layoutY.getLaneEnd(btmIdx);
24903
+ if(!rbc) {
24904
+ rbc = this._rowBoundCache = [];
24768
24905
  }
24769
24906
 
24770
- if(topPx >= btmPx) {
24771
- var pn = rowBound.parentNode;
24907
+ var selList = this._selectionList;
24908
+ var rowCount = this._layoutY.getLaneCount();
24909
+ selList.deselectFrom(rowCount); // TODO: move this to setRowCount
24910
+
24911
+ var selRanges = selList.getConnectedRanges();
24912
+ var rangeCount = selRanges.length;
24913
+ var i;
24914
+ var pn = null; // parentNode
24915
+ var rowBound = null;
24916
+
24917
+ // Remove unused bounds from document
24918
+ var activeCount = rbs.length;
24919
+ for(i = rangeCount; i < activeCount; ++i) {
24920
+ rowBound = rbs[i];
24921
+ pn = rowBound.parentNode;
24772
24922
  if(pn) {
24773
24923
  pn.removeChild(rowBound);
24774
24924
  }
24775
- } else {
24925
+ }
24926
+ rbs.length = activeCount = rangeCount;
24927
+
24928
+ if(!rangeCount) {
24929
+ var selCount = selList.getSelectionCount();
24930
+ if(!selCount) {
24931
+ this._rowSelDirty = false;
24932
+ }
24933
+ return;
24934
+ }
24935
+
24936
+ // Prepare shared parameters
24937
+ var scrollLeft = 0;
24938
+ var pinnedLftCount = 0;
24939
+ var pinnedRgtCount = 0;
24940
+ var endOfScroll = false;
24941
+ if(this._hscrollbar) {
24942
+ scrollLeft = this._hscrollbar.getScrollLeft();
24943
+ pinnedLftCount = this._hscrollbar.getPinnedLeftColumnCount();
24944
+ pinnedRgtCount = this._hscrollbar.getPinnedRightColumnCount();
24945
+ endOfScroll = this._hscrollbar.isEndOfHorizontalScroll();
24946
+ }
24947
+ var noLeftBound = !pinnedLftCount && scrollLeft > 0;
24948
+ var noRightBound = !pinnedRgtCount && !endOfScroll;
24949
+ var boundWidth = this._grid._getViewSize();
24950
+
24951
+ // Create row bound elements based on number of selection ranges
24952
+ for(i = 0; i < rangeCount; ++i) {
24953
+ var pair = selRanges[i];
24954
+ var topIdx = pair[0];
24955
+ var btmIdx = pair[1]; // Inclusive
24956
+ var topPx = this._layoutY.getLaneStart(topIdx);
24957
+ var btmPx = this._layoutY.getLaneEnd(btmIdx);
24958
+
24959
+ rowBound = rbc[i];
24960
+ if(!rowBound) {
24961
+ rowBound = rbc[i] = document.createElement("div");
24962
+ rowBound.className = "selection-bound";
24963
+ }
24964
+
24776
24965
  rowBound.style.top = topPx + "px";
24777
24966
  rowBound.style.height = (btmPx - topPx) + "px";
24778
-
24779
- var boundWidth = this._grid._getViewSize();
24780
24967
  rowBound.style.width = boundWidth + "px";
24781
24968
 
24782
- var scrollLeft = 0;
24783
- var pinnedLftCount = 0;
24784
- var pinnedRgtCount = 0;
24785
- var endOfScroll = false;
24786
- if(this._hscrollbar) {
24787
- scrollLeft = this._hscrollbar.getScrollLeft();
24788
- pinnedLftCount = this._hscrollbar.getPinnedLeftColumnCount();
24789
- pinnedRgtCount = this._hscrollbar.getPinnedRightColumnCount();
24790
- endOfScroll = this._hscrollbar.isEndOfHorizontalScroll();
24791
- }
24792
- rowBound.classList.toggle("no-left-bound", !pinnedLftCount && scrollLeft > 0);
24793
- rowBound.classList.toggle("no-right-bound", !pinnedRgtCount && !endOfScroll);
24969
+ rowBound.classList.toggle("no-left-bound", noLeftBound);
24970
+ rowBound.classList.toggle("no-right-bound", noRightBound);
24794
24971
 
24795
24972
  if(this._boundLayer) {
24796
- this._boundLayer.appendChild(rowBound);
24973
+ if(!rbs[i]) {
24974
+ rbs[i] = rowBound;
24975
+ this._boundLayer.appendChild(rowBound);
24976
+ }
24797
24977
  }
24798
24978
  }
24799
24979
  };
@@ -25438,7 +25618,7 @@ Core_Core.prototype._groupDefs = null;
25438
25618
  * @return {string}
25439
25619
  */
25440
25620
  Core_Core.getVersion = function () {
25441
- return "5.1.40";
25621
+ return "5.1.42";
25442
25622
  };
25443
25623
  /** {@link ElementWrapper#dispose}
25444
25624
  * @override
@@ -25574,10 +25754,10 @@ Core_Core.prototype.getConfigObject = function (gridOptions) {
25574
25754
  }
25575
25755
  }
25576
25756
 
25577
- if(this._rowHighlighting) {
25578
- obj["rowHighlighting"] = true;
25579
- }
25580
- obj["columnVirtualization"] = this._colVirtualizer.isEnabled();
25757
+ // It will be overwrite in rt-grid or atlas-blotter
25758
+ obj["rowVirtualization"] = this.isRowVirtualizationEnabled();
25759
+ obj["columnVirtualization"] = this.isColumnVirtualizationEnabled();
25760
+ obj["rowHighlighting"] = this._rowHighlighting;
25581
25761
 
25582
25762
  if(this._fixFrozenTopSections) {
25583
25763
  obj["topFreezingCount"] = this._startVScrollbarIndex >= 0 ? (this._startVScrollbarIndex + 1) : false;
@@ -25590,7 +25770,13 @@ Core_Core.prototype.getConfigObject = function (gridOptions) {
25590
25770
  if(this._rowScrollingStep) {
25591
25771
  obj["stepScroll"] = (this._rowScrollingStep === 1) ? true : this._rowScrollingStep;
25592
25772
  }
25593
- obj["autoHideScrollbar"] = this._vscrollbar.getAutoHide(); // this._hscrollbar has the same settings
25773
+
25774
+ var val = this._vscrollbar.getAutoHide();
25775
+ if(val !== true) {
25776
+ // TODO: check this._hscrollbar and this._vscrollbar can be difference config
25777
+ obj["autoHideScrollbar"] = val; // this._hscrollbar has the same settings
25778
+ }
25779
+
25594
25780
  var wheelSpeed = this._vscrollbar.getMouseWheelSpeed();
25595
25781
  if(wheelSpeed) {
25596
25782
  obj["linearWheelScrolling"] = wheelSpeed;
@@ -28563,6 +28749,14 @@ Core_Core.prototype.enableRowVirtualization = function (opt_enabled) {
28563
28749
  this._rowVirtualizer.deactivate();
28564
28750
  }
28565
28751
  };
28752
+
28753
+ /** @public
28754
+ * @return {boolean}
28755
+ */
28756
+ Core_Core.prototype.isRowVirtualizationEnabled = function () {
28757
+ return this._rowVirtualizer.isEnabled();
28758
+ };
28759
+
28566
28760
  /** No runtime support
28567
28761
  * @public
28568
28762
  * @param {boolean=} opt_enabled
@@ -28577,6 +28771,13 @@ Core_Core.prototype.enableColumnVirtualization = function (opt_enabled) {
28577
28771
  }
28578
28772
  };
28579
28773
 
28774
+ /** @public
28775
+ * @return {boolean}
28776
+ */
28777
+ Core_Core.prototype.isColumnVirtualizationEnabled = function () {
28778
+ return this._colVirtualizer.isEnabled();
28779
+ };
28780
+
28580
28781
  /** 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>
28581
28782
  * then the actual scrolling step for vertical scrollbar will be (32 * 2) = 64 pixels
28582
28783
  * @public
@@ -28964,47 +29165,72 @@ Core_Core.prototype._updateColumnBounds = function () {
28964
29165
  return;
28965
29166
  }
28966
29167
 
29168
+ var sectCount = this._settings.length;
29169
+ if(!sectCount) {
29170
+ return;
29171
+ }
29172
+
29173
+ // Collecting column selection and selection ranges
29174
+ var selRanges = [];
29175
+ var pair = null;
28967
29176
  var colCount = this.getColumnCount();
28968
- var colIndices = [];
29177
+ var selIndices = [];
28969
29178
  var i;
28970
29179
  for(i = 0; i < colCount; i++) {
28971
29180
  if(this.isSelectedColumn(i)) {
28972
- colIndices.push(i);
29181
+ selIndices.push(i);
29182
+ if(!pair) {
29183
+ pair = [i, -1];
29184
+ }
29185
+ } else if(pair) {
29186
+ pair[1] = i - 1;
29187
+ selRanges.push(pair);
29188
+ pair = null;
28973
29189
  }
28974
29190
  }
29191
+ if(pair) {
29192
+ pair[1] = colCount - 1;
29193
+ selRanges.push(pair);
29194
+ pair = null;
29195
+ }
29196
+
28975
29197
  var arg = {
28976
- selectedColumns: colIndices
29198
+ "selectedColumns": selIndices,
29199
+ "selectionRanges": selRanges
28977
29200
  };
28978
29201
  this._dispatch("beforeColumnBoundUpdate", arg);
28979
29202
 
28980
- var len = this.getColumnCount();
28981
- var lftIdx = -1;
28982
- var rgtIdx = -1;
28983
- for(i = 0; i < len; ++i) {
28984
- if(this.isSelectedColumn(i)) {
28985
- rgtIdx = i;
28986
- if(lftIdx < 0) {
28987
- lftIdx = i;
28988
- }
28989
- }
28990
- }
28991
- var sectCount = this._settings.length;
28992
- if(sectCount) {
28993
- var sectionSetting = this._settings[0];
28994
- var section = sectionSetting.getSection();
29203
+ // Calculate position from ranges
29204
+ var rangeCount = selRanges.length;
29205
+ var posAry = [];
29206
+ var noBorderAry = [];
29207
+ var topSectionSettings = this._settings[0];
29208
+ var section = topSectionSettings.getSection();
29209
+ for(i = 0; i < rangeCount; ++i) {
29210
+ pair = selRanges[i];
28995
29211
  var positions = [0, 0];
28996
29212
  var noBorders = [false, false];
28997
- section.calculateColumnBounds(lftIdx, rgtIdx, positions, noBorders);
28998
- var topPx = 0;
28999
- if(sectionSetting.getType() === "title" && arg.topBoundRowIndex != null) {
29000
- topPx = this._layoutY.getLaneStart(arg.topBoundRowIndex);
29001
- }
29002
- section.updateColumnBounds(positions, noBorders, topPx);
29003
- for(i = 1; i < sectCount; i++) {
29004
- section = this._settings[i].getSection();
29005
- section.updateColumnBounds(positions, noBorders);
29213
+ section.calculateColumnBounds(pair[0], pair[1], positions, noBorders);
29214
+ if(positions[0] < positions[1]) {
29215
+ posAry.push(positions);
29216
+ noBorderAry.push(noBorders);
29006
29217
  }
29007
29218
  }
29219
+
29220
+ // Render column bounds
29221
+ var topPx = 0;
29222
+ var topBoundIdx = -1;
29223
+ if(arg["topBoundRowIndex"] != null) {
29224
+ topBoundIdx = +arg["topBoundRowIndex"];
29225
+ }
29226
+ if(topBoundIdx >= 0 && topSectionSettings.getType() === "title") {
29227
+ topPx = this._layoutY.getLaneStart(topBoundIdx);
29228
+ }
29229
+ section.updateColumnBounds(posAry, noBorderAry, topPx);
29230
+ for(i = 1; i < sectCount; i++) {
29231
+ section = this._settings[i].getSection();
29232
+ section.updateColumnBounds(posAry, noBorderAry);
29233
+ }
29008
29234
  };
29009
29235
 
29010
29236
  /** @public
@@ -30557,6 +30783,7 @@ Core_Core._proto = Core_Core.prototype;
30557
30783
 
30558
30784
 
30559
30785
 
30786
+
30560
30787
  /* eslint-enable */
30561
30788
 
30562
30789
  /** Fired when user click and before the sorting operation.
@@ -31016,7 +31243,10 @@ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
31016
31243
  }
31017
31244
  field = opt["field"];
31018
31245
  if (field) {
31019
- col["sortBy"] = field;
31246
+ if(col["field"] !== field) {
31247
+ col["sortBy"] = field;
31248
+ } // else The default value is an empty sortBy, which refers to the same column field by default.
31249
+
31020
31250
  if (this._sortingSequenceMap && this._sortingSequenceMap[field]) {
31021
31251
  col["sortingSequence"] = this._sortingSequenceMap[field];
31022
31252
  }
@@ -31029,16 +31259,32 @@ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
31029
31259
  extOptions = obj["sorting"] = {};
31030
31260
  }
31031
31261
 
31032
- extOptions["initialSort"] = this.getSortedColumns();
31033
- extOptions["sortableIndicator"] = this._sortableIndicator;
31262
+ var val = this.getSortedColumns();
31263
+ if(val != null) {
31264
+ extOptions["initialSort"] = val;
31265
+ }
31266
+
31267
+ val = this._sortableIndicator;
31268
+ if(val !== false) {
31269
+ extOptions["sortableIndicator"] = val;
31270
+ }
31271
+
31034
31272
  if(this._maxCount !== 1) {
31035
31273
  extOptions["multiColumn"] = this._maxCount === -1 ? true : this._maxCount;
31036
31274
  }
31037
31275
  if(this._dblClickAllowed) {
31038
31276
  extOptions["disableDoubleClickToSort"] = !this._dblClickAllowed;
31039
31277
  }
31040
- extOptions["sortableColumns"] = this._sortableColumns;
31041
- extOptions["indicatorOnly"] = !this._dataSorting;
31278
+
31279
+ val = this._sortableColumns;
31280
+ if(val !== true) {
31281
+ extOptions["sortableColumns"] = val;
31282
+ }
31283
+
31284
+ val = this._dataSorting;
31285
+ if(val !== true) {
31286
+ extOptions["indicatorOnly"] = val;
31287
+ }
31042
31288
  // extOptions["mode"] = this._mode;
31043
31289
  if(this._disabled) {
31044
31290
  extOptions["disabled"] = true;
@@ -31055,6 +31301,10 @@ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
31055
31301
  extOptions["sortingSequence"] = sortingSeq.slice();
31056
31302
  }
31057
31303
 
31304
+ if((0,es6_Util/* isEmptyObject */.Qr)(obj["sorting"])) {
31305
+ delete obj["sorting"];
31306
+ }
31307
+
31058
31308
  return obj;
31059
31309
  };
31060
31310