@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
@@ -72,6 +72,34 @@ SelectionList.prototype.deselect = function (at) {
72
72
  }
73
73
  return false;
74
74
  };
75
+ /** Deselect all selections starting from the specified index
76
+ * @public
77
+ * @param {number} at
78
+ * @return {boolean}
79
+ */
80
+ SelectionList.prototype.deselectFrom = function (at) {
81
+ if(this._lastIndex < at) {
82
+ return false;
83
+ }
84
+ if(this._firstIndex >= at) {
85
+ this.clearAllSelections();
86
+ return true;
87
+ }
88
+
89
+ var lastIndex = this._lastIndex;
90
+ var sels = this._selections;
91
+ for(var i = at; i <= lastIndex; ++i) {
92
+ if (sels[i]) {
93
+ sels[at] = false;
94
+ --this._count;
95
+ }
96
+ }
97
+ if (this._anchor >= at) {
98
+ this._anchor = -1; // No anchor
99
+ }
100
+ this._lastIndex = this._findPrevSelection(at);
101
+ return true;
102
+ };
75
103
  /** @public
76
104
  * @param {number} at
77
105
  */
@@ -268,14 +296,16 @@ SelectionList.prototype.getLastSelectedIndex = function() {
268
296
 
269
297
  /** WARNING: It will creates a new(EXPENSIVE) defragmented array of selected Index. The selected indices will always be sorted in ascending order
270
298
  * @public
271
- * @return {Array.<number>}
299
+ * @return {!Array.<number>}
272
300
  */
273
301
  SelectionList.prototype.getAllSelections = function() {
274
302
  if(this._count > 0) {
275
303
  var ary = new Array(this._count); // Fastest way to create an array
276
304
  var count = 0;
277
- for(var i = this._firstIndex; i <= this._lastIndex; ++i) {
278
- if(this._selections[i]) {
305
+ var sels = this._selections;
306
+ var lastIdx = this._lastIndex;
307
+ for(var i = this._firstIndex; i <= lastIdx; ++i) {
308
+ if(sels[i]) {
279
309
  ary[count++] = i;
280
310
  }
281
311
  }
@@ -283,6 +313,45 @@ SelectionList.prototype.getAllSelections = function() {
283
313
  }
284
314
  return [];
285
315
  };
316
+ /** 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.
317
+ * @public
318
+ * @param {number=} from
319
+ * @param {number=} to EXCLUSIVE
320
+ * @return {!Array.<Array.<number>>}
321
+ */
322
+ SelectionList.prototype.getConnectedRanges = function(from, to) {
323
+ if(this._count > 0) {
324
+ var ary = [];
325
+ if(from == null || from < this._firstIndex) {
326
+ from = this._firstIndex;
327
+ }
328
+ if(to == null || to > this._lastIndex) {
329
+ to = this._lastIndex + 1;
330
+ }
331
+
332
+ var pair = null;
333
+ for(var i = from; i < to; ++i) {
334
+ if(this._selections[i]) {
335
+ if(!pair) {
336
+ pair = [i, -1];
337
+ }
338
+ } else if(pair) {
339
+ pair[1] = i - 1;
340
+ ary.push(pair);
341
+ pair = null;
342
+ }
343
+ }
344
+
345
+ if(pair) {
346
+ pair[1] = this._lastIndex;
347
+ ary.push(pair);
348
+ pair = null;
349
+ }
350
+ return ary;
351
+ }
352
+ return [];
353
+ };
354
+
286
355
  /**
287
356
  * @public
288
357
  * @return {Array.<boolean>}
@@ -310,13 +379,13 @@ SelectionList.prototype.clearAllSelections = function() {
310
379
  * @public
311
380
  * @param {SelectionList} srcSelections
312
381
  * @param {number} fromSrcIndex
313
- * @param {number} offsetIndex
382
+ * @param {number} offset Offset from the source index to map to destination index of this SelectionList. Use 0 if there is no shifting.
314
383
  * @param {number} forLength Positive value only. negative valie is not allowed
315
384
  */
316
- SelectionList.prototype.copyFrom = function (srcSelections, fromSrcIndex, offsetIndex, forLength) {
385
+ SelectionList.prototype.copyFrom = function (srcSelections, fromSrcIndex, offset, forLength) {
317
386
  if (forLength <= 0) { return; }
318
387
 
319
- var toThisIndex = fromSrcIndex + offsetIndex;
388
+ var toThisIndex = fromSrcIndex + offset;
320
389
  if (srcSelections == null) {
321
390
  this.deselectRange(toThisIndex, forLength);
322
391
  return;
@@ -337,7 +406,7 @@ SelectionList.prototype.copyFrom = function (srcSelections, fromSrcIndex, offset
337
406
  this._anchor = -1;
338
407
  if (srcSelections._anchor >= 0) {
339
408
  if (srcSelections._anchor >= fromSrcIndex && srcSelections._anchor < (fromSrcIndex + forLength)) {
340
- this._anchor = srcSelections._anchor + offsetIndex;
409
+ this._anchor = srcSelections._anchor + offset;
341
410
  }
342
411
  }
343
412
  };
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.31" };
3
+ window.EFX_GRID = { version: "6.0.33" };