@refinitiv-ui/efx-grid 6.0.97 → 6.0.99

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.
@@ -236,7 +236,9 @@ declare class DataView extends EventDispatcher {
236
236
 
237
237
  public searchNext(rowRef: number|string|null, searchLogic: ((...params: any[]) => any)|null): number;
238
238
 
239
- public stall(opt_bool?: boolean|null): boolean;
239
+ public stall(bool?: boolean|null): boolean;
240
+
241
+ public stallSorting(bool?: boolean|null): boolean;
240
242
 
241
243
  public enableAutoGroupRemoval(opt_bool?: boolean|null): boolean;
242
244
 
@@ -302,6 +302,10 @@ DataView.prototype._wrapSize = 0;
302
302
  * @type {number}
303
303
  */
304
304
  DataView.prototype._wrapTimerId = 0;
305
+ /** @private
306
+ * @type {boolean}
307
+ */
308
+ DataView.prototype._stalledSorting = false;
305
309
 
306
310
  /** @public
307
311
  * @fires DataView#preDisposed
@@ -2344,11 +2348,11 @@ DataView.prototype._searchRow = function(rids, searchLogic, start, end, inc) {
2344
2348
 
2345
2349
  /** Blocks all row insertion and removal, but keep updating the data
2346
2350
  * @public
2347
- * @param {boolean=} opt_bool
2348
- * @return {boolean} True if there is any change
2351
+ * @param {boolean=} bool
2352
+ * @return {boolean} Returns true, if there is any change
2349
2353
  */
2350
- DataView.prototype.stall = function(opt_bool) {
2351
- let newBool = opt_bool !== false;
2354
+ DataView.prototype.stall = function(bool) {
2355
+ let newBool = bool !== false;
2352
2356
  let curBool = this._shared.stalledRids ? true : false;
2353
2357
  if(curBool === newBool) { return false; }
2354
2358
  if(newBool) {
@@ -2365,6 +2369,26 @@ DataView.prototype.stall = function(opt_bool) {
2365
2369
  }
2366
2370
  return true;
2367
2371
  };
2372
+ /** Blocks existing sorting from performing on every data change
2373
+ * @public
2374
+ * @param {boolean=} bool
2375
+ * @return {boolean} Returns true, if there is any change
2376
+ */
2377
+ DataView.prototype.stallSorting = function(bool) {
2378
+ let newBool = bool !== false;
2379
+ if(this._stalledSorting !== newBool) {
2380
+ this._stalledSorting = newBool;
2381
+
2382
+ if(!newBool && this.isSorting()) {
2383
+ if(this._sort()) {
2384
+ this._dispatchDataChange(DataTable._positionChangeArg);
2385
+ }
2386
+ }
2387
+ return true;
2388
+ }
2389
+ return false;
2390
+ };
2391
+
2368
2392
  /** Automatically and asyncronuosly remove group that has no member or no content. Predefined groups will not be removed in this way.
2369
2393
  * @public
2370
2394
  * @param {boolean=} opt_bool
@@ -2400,7 +2424,7 @@ DataView.prototype.enableAutoGroupHiding = function(opt_bool) {
2400
2424
  * @public
2401
2425
  */
2402
2426
  DataView.prototype.synchronizeRowOrder = function() {
2403
- if(this.isSorting()) {
2427
+ if(!this._stalledSorting && this.isSorting()) {
2404
2428
  this._dt._sort(this._sortingDefs);
2405
2429
  }
2406
2430
  };
@@ -3453,6 +3477,9 @@ DataView.prototype._sort = function() {
3453
3477
  if(this._groupMembers) {
3454
3478
  return false; // DataView with children should not be sorted as sort operation will be done on each child
3455
3479
  }
3480
+ if(this._stalledSorting) {
3481
+ return false;
3482
+ }
3456
3483
 
3457
3484
  if(this._dt._getSegmentSeparators() || this.isSorting()) {
3458
3485
  let rids = this._rids;
@@ -574,7 +574,7 @@ Core.prototype._hasPendingRowChange = false;
574
574
  * @return {string}
575
575
  */
576
576
  Core.getVersion = function () {
577
- return "5.1.97";
577
+ return "5.1.102";
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
 
@@ -5721,7 +5731,15 @@ Core.prototype._updateScrollbarHeight = function (paneChanged, contentChanged, n
5721
5731
  // HACK: Due to fixed layout size we need to scale view size instead of content size, when zooming
5722
5732
  // TODO: Check if zoom factor is used for virtualization correctly
5723
5733
  this._rowVirtualizer.setViewSize(viewSize / this._zoomFactor);
5724
- this._rowVirtualizer.setViewBounds(this._startVScrollbarIndex, this.getFooterCount());
5734
+
5735
+ let offsetRowCount = this._sectionStarts[this._startVScrollbarIndex];
5736
+ let footerCount = this.getFooterCount();
5737
+ let footerRowCount = 0;
5738
+ if(footerCount) {
5739
+ let sectionCount = this.getSectionCount();
5740
+ footerRowCount = this._sectionStarts[sectionCount] - this._sectionStarts[sectionCount - footerCount];
5741
+ }
5742
+ this._rowVirtualizer.setViewBounds(offsetRowCount, footerRowCount);
5725
5743
  } else {
5726
5744
  this._rowVirtualizer.validateVirtualization(); // Content height may be changed
5727
5745
  }
@@ -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.97" };
3
+ window.EFX_GRID = { version: "6.0.99" };