@refinitiv-ui/efx-grid 6.0.98 → 6.0.100

Sign up to get free protection for your applications and to get access to all the features.
@@ -2384,8 +2384,9 @@ DataView.prototype.stallSorting = function(bool) {
2384
2384
  this._dispatchDataChange(DataTable._positionChangeArg);
2385
2385
  }
2386
2386
  }
2387
+ return true;
2387
2388
  }
2388
- return true;
2389
+ return false;
2389
2390
  };
2390
2391
 
2391
2392
  /** Automatically and asyncronuosly remove group that has no member or no content. Predefined groups will not be removed in this way.
@@ -327,6 +327,8 @@ declare class Core extends ElementWrapper {
327
327
 
328
328
  public scrollToRow(sectionRef: Core.SectionReference|null, rowIndex: number, topOfView?: boolean|null): void;
329
329
 
330
+ public getVerticalViewInfo(): any;
331
+
330
332
  public getVScrollView(): any;
331
333
 
332
334
  public getScrollTop(): number;
@@ -574,7 +574,7 @@ Core.prototype._hasPendingRowChange = false;
574
574
  * @return {string}
575
575
  */
576
576
  Core.getVersion = function () {
577
- return "5.1.98";
577
+ return "5.1.103";
578
578
  };
579
579
  /** {@link ElementWrapper#dispose}
580
580
  * @override
@@ -1775,6 +1775,16 @@ Core.prototype._moveColumn = function (fromCol, destCol) {
1775
1775
  }
1776
1776
  }
1777
1777
 
1778
+ // The deactivated column may be moved directly or indirectly to the current view. It's necessary to make all columns in view activated.
1779
+ if(!this._frozenLayout) {
1780
+ if(this._colVirtualizer.isEnabled()) {
1781
+ let vBegin = this._colVirtualizer.getFirstIndexInView();
1782
+ if(!((fromCol < vBegin && destCol < vBegin) || (fromCol > vEnd && destCol > vEnd))) { // Columns does not move between hidden columns
1783
+ this._activateColumns(vBegin, vEnd, vBegin, vEnd); // To confirm that all columns in view are activated
1784
+ }
1785
+ }
1786
+ }
1787
+
1778
1788
  // no need to invoke because moving column does not change column-width
1779
1789
  // this._syncLayoutToColumns(minColumn, this.getColumnCount());
1780
1790
 
@@ -3573,33 +3583,24 @@ Core.prototype.getYScrollVal = function (sectionRef, rowIndex, topOfView) {
3573
3583
  }
3574
3584
 
3575
3585
  let rowCount = this._layoutY.getLaneCount();
3576
- let rowIndexOffset = (section) ? section.getRowOffset() : this._sectionStarts[this._startVScrollbarIndex];
3577
-
3578
- if(rowIndexOffset) {
3579
- rowIndex += rowIndexOffset;
3580
- }
3581
3586
  if (rowIndex <= 0) { rowIndex = 0; }
3582
3587
  else if (rowIndex >= rowCount) { rowIndex = rowCount - 1; }
3583
3588
 
3584
- let heightOffset = this._layoutY.getLaneStart(rowIndexOffset);
3585
- let scrollTop = this._vscrollbar.getScrollTop();
3586
- let viewTop = scrollTop + heightOffset;
3587
- let viewTopIndex = section ? section.getFirstIndexInView() : this._layoutY.hitTest(viewTop); // TODO: Make it work in zooming mode
3589
+ let viewInfo = this.getVerticalViewInfo();
3590
+ let viewTopIndex = viewInfo.topRowIndex; // TODO: Make it work in zooming mode
3588
3591
 
3589
3592
  let scrollIndex = -1;
3590
3593
  if (topOfView) {
3591
3594
  scrollIndex = rowIndex;
3592
3595
  } else {
3593
- if(rowIndex <= viewTopIndex) { // Scroll up
3596
+ if(rowIndex < viewTopIndex) { // Scroll up
3594
3597
  scrollIndex = rowIndex - 3; // Have some spaces at the top for more appealing visual
3595
3598
  if(scrollIndex < 0) {
3596
3599
  scrollIndex = 0;
3597
3600
  }
3598
3601
  } else { // Scroll down
3599
- let viewHeight = this._vscrollbar.getHeight();
3600
- let viewBottom = viewTop + viewHeight;
3601
- let viewBottomIndex = section ? section.getLastIndexInView() : this._layoutY.hitTest(viewBottom - 0.1);
3602
- if (rowIndex >= viewBottomIndex) {
3602
+ let viewBottomIndex = viewInfo.bottomRowIndex;
3603
+ if (rowIndex > viewBottomIndex) {
3603
3604
  let viewIndexSize = viewBottomIndex - viewTopIndex;
3604
3605
  scrollIndex = rowIndex - viewIndexSize + 3;
3605
3606
  if(scrollIndex < 0) {
@@ -3609,7 +3610,9 @@ Core.prototype.getYScrollVal = function (sectionRef, rowIndex, topOfView) {
3609
3610
  }
3610
3611
  }
3611
3612
 
3612
- return (scrollIndex >= 0) ? (this._layoutY.getLaneStart(scrollIndex) - heightOffset) : null;
3613
+ let rowIndexOffset = (section) ? section.getRowOffset() : this._sectionStarts[this._startVScrollbarIndex];
3614
+ let heightOffset = this._layoutY.getLaneStart(this._startVScrollbarIndex);
3615
+ return (scrollIndex >= 0) ? (this._layoutY.getLaneStart(scrollIndex + rowIndexOffset) - heightOffset) : null;
3613
3616
  };
3614
3617
  /** Scroll up or down to make specified row visible in the view
3615
3618
  * @public
@@ -3624,6 +3627,21 @@ Core.prototype.scrollToRow = function (sectionRef, rowIndex, topOfView) {
3624
3627
  }
3625
3628
  };
3626
3629
  /** @public
3630
+ * @return {Object}
3631
+ */
3632
+ Core.prototype.getVerticalViewInfo = function() {
3633
+ let rowIndexOffset = this._sectionStarts[this._startVScrollbarIndex];
3634
+ let heightOffset = this._layoutY.getLaneStart(rowIndexOffset);
3635
+ let viewHeight = this._vscrollbar.getHeight();
3636
+ let viewTop = this._vscrollbar.getScrollTop() + heightOffset;
3637
+ let viewBottom = viewTop + viewHeight;
3638
+
3639
+ return {
3640
+ topRowIndex: this._layoutY.hitTest(viewTop) - rowIndexOffset,
3641
+ bottomRowIndex: this._layoutY.hitTest(viewBottom - 0.1) - rowIndexOffset
3642
+ };
3643
+ };
3644
+ /** @public
3627
3645
  * @return {Object} Returns null if vscrollbar does not exists
3628
3646
  */
3629
3647
  Core.prototype.getVScrollView = function () {
@@ -5721,7 +5739,15 @@ Core.prototype._updateScrollbarHeight = function (paneChanged, contentChanged, n
5721
5739
  // HACK: Due to fixed layout size we need to scale view size instead of content size, when zooming
5722
5740
  // TODO: Check if zoom factor is used for virtualization correctly
5723
5741
  this._rowVirtualizer.setViewSize(viewSize / this._zoomFactor);
5724
- this._rowVirtualizer.setViewBounds(this._startVScrollbarIndex, this.getFooterCount());
5742
+
5743
+ let offsetRowCount = this._sectionStarts[this._startVScrollbarIndex];
5744
+ let footerCount = this.getFooterCount();
5745
+ let footerRowCount = 0;
5746
+ if(footerCount) {
5747
+ let sectionCount = this.getSectionCount();
5748
+ footerRowCount = this._sectionStarts[sectionCount] - this._sectionStarts[sectionCount - footerCount];
5749
+ }
5750
+ this._rowVirtualizer.setViewBounds(offsetRowCount, footerRowCount);
5725
5751
  } else {
5726
5752
  this._rowVirtualizer.validateVirtualization(); // Content height may be changed
5727
5753
  }
@@ -1229,6 +1229,17 @@ SortableTitlePlugin.prototype._getPlugin = function(pluginName) {
1229
1229
  let host = this._hosts[0];
1230
1230
  return (host) ? host.getPlugin(pluginName) : null;
1231
1231
  };
1232
+
1233
+ /** @public
1234
+ * @description Click title to sort with mouse event. This is for testing purpose.
1235
+ * @ignore
1236
+ * @param {Core} grid
1237
+ * @param {Object=} mouseEvt
1238
+ */
1239
+ SortableTitlePlugin.prototype.clickTitleByMouse = function (grid, mouseEvt) {
1240
+ this._onClickTitle(grid, mouseEvt);
1241
+ };
1242
+
1232
1243
  /** @private
1233
1244
  * @param {Core} grid
1234
1245
  * @param {MouseEvent} e
@@ -299,12 +299,12 @@ Virtualizer.prototype.setViewOffset = function (px) {
299
299
  };
300
300
  /** @public
301
301
  * @ignore
302
- * @param {number} start
303
- * @param {number} end
302
+ * @param {number} startItemCount
303
+ * @param {number} endItemCount
304
304
  */
305
- Virtualizer.prototype.setViewBounds = function (start, end) {
306
- this._startOffsetCount = start > 0 ? start : 0;
307
- this._endOffsetCount = end > 0 ? end : 0;
305
+ Virtualizer.prototype.setViewBounds = function (startItemCount, endItemCount) {
306
+ this._startOffsetCount = startItemCount > 0 ? startItemCount : 0;
307
+ this._endOffsetCount = endItemCount > 0 ? endItemCount : 0;
308
308
  this.validateVirtualization(); // Everytime row height is changed
309
309
  };
310
310
  /** @public
package/lib/grid/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import {Grid} from "./lib/efx-grid.js";
2
2
  export {Grid}
3
- window.EFX_GRID = { version: "6.0.98" };
3
+ window.EFX_GRID = { version: "6.0.100" };