@refinitiv-ui/efx-grid 6.0.99 → 6.0.101

Sign up to get free protection for your applications and to get access to all the features.
@@ -26028,7 +26028,7 @@ Core_Core.prototype._hasPendingRowChange = false;
26028
26028
  * @return {string}
26029
26029
  */
26030
26030
  Core_Core.getVersion = function () {
26031
- return "5.1.102";
26031
+ return "5.1.103";
26032
26032
  };
26033
26033
  /** {@link ElementWrapper#dispose}
26034
26034
  * @override
@@ -29037,33 +29037,24 @@ Core_Core.prototype.getYScrollVal = function (sectionRef, rowIndex, topOfView) {
29037
29037
  }
29038
29038
 
29039
29039
  let rowCount = this._layoutY.getLaneCount();
29040
- let rowIndexOffset = (section) ? section.getRowOffset() : this._sectionStarts[this._startVScrollbarIndex];
29041
-
29042
- if(rowIndexOffset) {
29043
- rowIndex += rowIndexOffset;
29044
- }
29045
29040
  if (rowIndex <= 0) { rowIndex = 0; }
29046
29041
  else if (rowIndex >= rowCount) { rowIndex = rowCount - 1; }
29047
29042
 
29048
- let heightOffset = this._layoutY.getLaneStart(rowIndexOffset);
29049
- let scrollTop = this._vscrollbar.getScrollTop();
29050
- let viewTop = scrollTop + heightOffset;
29051
- let viewTopIndex = section ? section.getFirstIndexInView() : this._layoutY.hitTest(viewTop); // TODO: Make it work in zooming mode
29043
+ let viewInfo = this.getVerticalViewInfo();
29044
+ let viewTopIndex = viewInfo.topRowIndex; // TODO: Make it work in zooming mode
29052
29045
 
29053
29046
  let scrollIndex = -1;
29054
29047
  if (topOfView) {
29055
29048
  scrollIndex = rowIndex;
29056
29049
  } else {
29057
- if(rowIndex <= viewTopIndex) { // Scroll up
29050
+ if(rowIndex < viewTopIndex) { // Scroll up
29058
29051
  scrollIndex = rowIndex - 3; // Have some spaces at the top for more appealing visual
29059
29052
  if(scrollIndex < 0) {
29060
29053
  scrollIndex = 0;
29061
29054
  }
29062
29055
  } else { // Scroll down
29063
- let viewHeight = this._vscrollbar.getHeight();
29064
- let viewBottom = viewTop + viewHeight;
29065
- let viewBottomIndex = section ? section.getLastIndexInView() : this._layoutY.hitTest(viewBottom - 0.1);
29066
- if (rowIndex >= viewBottomIndex) {
29056
+ let viewBottomIndex = viewInfo.bottomRowIndex;
29057
+ if (rowIndex > viewBottomIndex) {
29067
29058
  let viewIndexSize = viewBottomIndex - viewTopIndex;
29068
29059
  scrollIndex = rowIndex - viewIndexSize + 3;
29069
29060
  if(scrollIndex < 0) {
@@ -29073,7 +29064,9 @@ Core_Core.prototype.getYScrollVal = function (sectionRef, rowIndex, topOfView) {
29073
29064
  }
29074
29065
  }
29075
29066
 
29076
- return (scrollIndex >= 0) ? (this._layoutY.getLaneStart(scrollIndex) - heightOffset) : null;
29067
+ let rowIndexOffset = (section) ? section.getRowOffset() : this._sectionStarts[this._startVScrollbarIndex];
29068
+ let heightOffset = this._layoutY.getLaneStart(this._startVScrollbarIndex);
29069
+ return (scrollIndex >= 0) ? (this._layoutY.getLaneStart(scrollIndex + rowIndexOffset) - heightOffset) : null;
29077
29070
  };
29078
29071
  /** Scroll up or down to make specified row visible in the view
29079
29072
  * @public
@@ -29088,6 +29081,21 @@ Core_Core.prototype.scrollToRow = function (sectionRef, rowIndex, topOfView) {
29088
29081
  }
29089
29082
  };
29090
29083
  /** @public
29084
+ * @return {Object}
29085
+ */
29086
+ Core_Core.prototype.getVerticalViewInfo = function() {
29087
+ let rowIndexOffset = this._sectionStarts[this._startVScrollbarIndex];
29088
+ let heightOffset = this._layoutY.getLaneStart(rowIndexOffset);
29089
+ let viewHeight = this._vscrollbar.getHeight();
29090
+ let viewTop = this._vscrollbar.getScrollTop() + heightOffset;
29091
+ let viewBottom = viewTop + viewHeight;
29092
+
29093
+ return {
29094
+ topRowIndex: this._layoutY.hitTest(viewTop) - rowIndexOffset,
29095
+ bottomRowIndex: this._layoutY.hitTest(viewBottom - 0.1) - rowIndexOffset
29096
+ };
29097
+ };
29098
+ /** @public
29091
29099
  * @return {Object} Returns null if vscrollbar does not exists
29092
29100
  */
29093
29101
  Core_Core.prototype.getVScrollView = function () {