@refinitiv-ui/efx-grid 6.0.39 → 6.0.41

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 (50) hide show
  1. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +2 -1
  2. package/lib/column-selection-dialog/lib/column-selection-dialog.js +23 -7
  3. package/lib/core/dist/core.js +39 -28
  4. package/lib/core/dist/core.min.js +1 -1
  5. package/lib/core/es6/grid/Core.js +34 -26
  6. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +5 -2
  7. package/lib/grid/index.js +1 -1
  8. package/lib/row-segmenting/es6/RowSegmenting.js +4 -4
  9. package/lib/rt-grid/dist/rt-grid.js +2191 -1780
  10. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  11. package/lib/rt-grid/es6/ColumnDefinition.d.ts +1 -0
  12. package/lib/rt-grid/es6/ColumnDefinition.js +7 -8
  13. package/lib/rt-grid/es6/Grid.d.ts +2 -0
  14. package/lib/rt-grid/es6/Grid.js +91 -30
  15. package/lib/rt-grid/es6/RowDefinition.d.ts +4 -5
  16. package/lib/rt-grid/es6/RowDefinition.js +103 -52
  17. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +26 -40
  18. package/lib/tr-grid-contextmenu/es6/ContextMenu.d.ts +27 -27
  19. package/lib/tr-grid-contextmenu/es6/ContextMenu.js +97 -93
  20. package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +3 -3
  21. package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +2 -2
  22. package/lib/tr-grid-contextmenu/es6/PopupMenu.d.ts +5 -5
  23. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +30 -12
  24. package/lib/tr-grid-row-dragging/es6/RowDragging.js +2 -1
  25. package/lib/tr-grid-rowcoloring/es6/RowColoring.js +50 -18
  26. package/lib/tr-grid-util/es6/CellPainter.d.ts +2 -1
  27. package/lib/tr-grid-util/es6/CellPainter.js +6 -4
  28. package/lib/tr-grid-util/es6/ExpressionParser.d.ts +10 -0
  29. package/lib/tr-grid-util/es6/ExpressionParser.js +366 -0
  30. package/lib/tr-grid-util/es6/FilterBuilder.d.ts +10 -6
  31. package/lib/tr-grid-util/es6/FilterBuilder.js +264 -234
  32. package/lib/tr-grid-util/es6/FilterOperators.d.ts +3 -1
  33. package/lib/tr-grid-util/es6/FilterOperators.js +51 -2
  34. package/lib/tr-grid-util/es6/Util.d.ts +0 -3
  35. package/lib/tr-grid-util/es6/Util.js +0 -53
  36. package/lib/tr-grid-util/es6/formula/Formula.js +3 -3
  37. package/lib/types/es6/ColumnDragging.d.ts +51 -0
  38. package/lib/types/es6/ContextMenu.d.ts +27 -27
  39. package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +3 -0
  40. package/lib/types/es6/ExtensionOptions.d.ts +2 -0
  41. package/lib/types/es6/Extensions.d.ts +3 -1
  42. package/lib/types/es6/MenuEventAPI.d.ts +3 -3
  43. package/lib/types/es6/MenuItem.d.ts +2 -2
  44. package/lib/types/es6/PopupMenu.d.ts +5 -5
  45. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +1 -0
  46. package/lib/types/es6/RealtimeGrid/Grid.d.ts +2 -0
  47. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +4 -5
  48. package/lib/types/es6/index.d.ts +1 -0
  49. package/lib/versions.json +10 -10
  50. package/package.json +1 -1
@@ -31,6 +31,7 @@ import VirtualizedLayoutGrid from "./VirtualizedLayoutGrid.js";
31
31
  * @property {string} rowId
32
32
  * @property {number} rowIndex
33
33
  */
34
+ /** @event Core#beforeContentBinding */
34
35
  /** @event Core#postSectionDataBinding */
35
36
  /** @event Core#rowHighlighted */
36
37
 
@@ -193,6 +194,7 @@ var Core = function (opt_initializer) {
193
194
  "postDataSourceChanged",
194
195
  "preSectionRender",
195
196
  "postSectionRender",
197
+ "beforeContentBinding",
196
198
  "preSectionDataBinding",
197
199
  "postSectionDataBinding",
198
200
  "rowExpansionBinding",
@@ -554,7 +556,7 @@ Core.prototype._batches = null;
554
556
  * @return {string}
555
557
  */
556
558
  Core.getVersion = function () {
557
- return "5.1.55";
559
+ return "5.1.59";
558
560
  };
559
561
  /** {@link ElementWrapper#dispose}
560
562
  * @override
@@ -1356,6 +1358,7 @@ Core.prototype.getColumnCount = function () {
1356
1358
  * @fires Core#columnAdded
1357
1359
  * @fires Core#preSectionRender
1358
1360
  * @fires Core#columnRender
1361
+ * @fires Core#beforeContentBinding
1359
1362
  * @fires Core#preSectionDataBinding
1360
1363
  * @fires Core#columnDataBinding
1361
1364
  * @fires Core#postSectionDataBinding
@@ -1383,6 +1386,7 @@ Core.prototype.setColumnCount = function(num) {
1383
1386
  * @fires Core#columnAdded
1384
1387
  * @fires Core#preSectionRender
1385
1388
  * @fires Core#columnRender
1389
+ * @fires Core#beforeContentBinding
1386
1390
  * @fires Core#preSectionDataBinding
1387
1391
  * @fires Core#columnDataBinding
1388
1392
  * @fires Core#postSectionDataBinding
@@ -1499,16 +1503,12 @@ Core.prototype.removeColumnAt = function (index) {
1499
1503
 
1500
1504
  if (this._hasListener("columnRemoved")) {
1501
1505
  var e = {};
1502
- var batches = this._batches;
1503
- if(batches){
1504
- e["batches"] = batches;
1505
- }
1506
1506
  e["atTheMiddle"] = true;
1507
1507
  e["colIndex"] = index;
1508
1508
  e["columns"] = "deprecated";
1509
1509
  e["columnData"] = colDef["columnData"];
1510
1510
  e["colId"] = colDef["id"] || "";
1511
- this._dispatch("columnRemoved", e);
1511
+ this._dispatchColumnEvent("columnRemoved", e);
1512
1512
  }
1513
1513
 
1514
1514
  // Last index in view here might be different from before moving column if columns have different width.
@@ -1761,7 +1761,7 @@ Core.prototype._moveColumn = function (fromCol, destCol) {
1761
1761
  e["fromColIndex"] = fromCol;
1762
1762
  e["toColIndex"] = destCol;
1763
1763
  e["colId"] = colId; // TODO: Id may not needed
1764
- this._dispatch("columnMoved", e);
1764
+ this._dispatchColumnEvent("columnMoved", e); // add remove move
1765
1765
  }
1766
1766
 
1767
1767
  // Last index in view here might be different from before moving column if columns have different width.
@@ -1831,6 +1831,9 @@ Core.prototype.reorderColumns = function (colRefs, destCol) {
1831
1831
  destId = destCol;
1832
1832
  }
1833
1833
 
1834
+ this.startBatch("move");
1835
+
1836
+ var dirty = 0;
1834
1837
  if(Array.isArray(colRefs)) {
1835
1838
  var srcLen = colRefs.length;
1836
1839
  if(srcLen > 1) {
@@ -1873,7 +1876,6 @@ Core.prototype.reorderColumns = function (colRefs, destCol) {
1873
1876
  }
1874
1877
  }
1875
1878
 
1876
- var dirty = 0;
1877
1879
  for(i = srcLen; --i >= 0;) {
1878
1880
  srcId = srcIds[i]; // Only valid source columns are left at this point
1879
1881
  srcIdx = this.getColumnIndex(srcId);
@@ -1884,17 +1886,15 @@ Core.prototype.reorderColumns = function (colRefs, destCol) {
1884
1886
  dirty |= this._moveColumnByIndex(srcIdx, destIdx);
1885
1887
  destId = srcId;
1886
1888
  }
1887
- return dirty ? true : false;
1888
1889
  } else {
1889
- return this.moveColumnById(colRefs[0], destId);
1890
+ dirty = this.moveColumnById(colRefs[0], destId);
1890
1891
  }
1891
- }
1892
-
1893
- if(colRefs != null) {
1892
+ } else if(colRefs != null) {
1894
1893
  // colRefs will be a number or string
1895
- return this.moveColumnById(colRefs, destId);
1894
+ dirty = this.moveColumnById(colRefs, destId);
1896
1895
  }
1897
- return false;
1896
+ this.stopBatch("move");
1897
+ return dirty ? true : false;
1898
1898
  };
1899
1899
 
1900
1900
  /** @public
@@ -2001,6 +2001,7 @@ Core.prototype._deserializeColumn = function (index, jsonObj) {
2001
2001
  * @param {number=} opt_num Default is one row
2002
2002
  * @fires Core#preSectionRender
2003
2003
  * @fires Core#columnRender
2004
+ * @fires Core#beforeContentBinding
2004
2005
  * @fires Core#preSectionDataBinding
2005
2006
  * @fires Core#columnDataBinding
2006
2007
  * @fires Core#postSectionDataBinding
@@ -3804,6 +3805,7 @@ Core.prototype.synchronizeHScrollbar = function (subGrid) {
3804
3805
  * @param {number=} fromRowIndex INCLUSIVE If the value is undefined, the first row index will be used
3805
3806
  * @param {number=} lastRowIndex INCLUSIVE If the value is undefined, the last row index will be used
3806
3807
  * @param {Object=} userParam Addtional parameters to be fired with the event
3808
+ * @fires Core#beforeContentBinding
3807
3809
  * @fires Core#preSectionDataBinding
3808
3810
  * @fires Core#columnDataBinding
3809
3811
  * @fires Core#postSectionDataBinding
@@ -4446,6 +4448,17 @@ Core.prototype.stopBatch = function (batchType) {
4446
4448
 
4447
4449
  //#region Private Methods
4448
4450
  /** @private
4451
+ * @param {string} type
4452
+ * @param {!Object} eventArg
4453
+ */
4454
+ Core.prototype._dispatchColumnEvent = function (type, eventArg) {
4455
+ var batches = this._batches;
4456
+ if(batches){
4457
+ eventArg["batches"] = batches;
4458
+ }
4459
+ this._dispatch(type, eventArg);
4460
+ };
4461
+ /** @private
4449
4462
  */
4450
4463
  Core.prototype._dispatchColumnPositionChanged = function () {
4451
4464
  if(this._columnPositionConflator.conflate()) {
@@ -4685,20 +4698,16 @@ Core.prototype._dispatchColumnAddedEvent = function (at, count, atTheMiddle, ctx
4685
4698
  if (this._hasListener("columnAdded")) {
4686
4699
  var e = {};
4687
4700
  e["atTheMiddle"] = atTheMiddle;
4688
- var batches = this._batches;
4689
- if(batches){
4690
- e["batches"] = batches;
4691
- }
4692
4701
  if(count === 1) {
4693
4702
  e["colIndex"] = at;
4694
4703
  e["context"] = ctx;
4695
- this._dispatch("columnAdded", e);
4704
+ this._dispatchColumnEvent("columnAdded", e);
4696
4705
  } else {
4697
4706
  var ary = Array.isArray(ctx) ? ctx : [];
4698
4707
  for (var i = 0; i < count; ++i) {
4699
4708
  e["colIndex"] = at + i;
4700
4709
  e["context"] = ary[i];
4701
- this._dispatch("columnAdded", e);
4710
+ this._dispatchColumnEvent("columnAdded", e);
4702
4711
  }
4703
4712
  }
4704
4713
  }
@@ -4840,15 +4849,11 @@ Core.prototype._removeColumn = function (num) { // TODO: change the logic to us
4840
4849
 
4841
4850
  if (this._hasListener("columnRemoved")) {
4842
4851
  var e = {};
4843
- var batches = this._batches;
4844
- if(batches){
4845
- e["batches"] = batches;
4846
- }
4847
4852
  for (var c = colCount; --c >= newCount; ) {
4848
4853
  var colDef = removedCols[c - newCount];
4849
4854
  e["colIndex"] = c;
4850
4855
  e["columnData"] = colDef ? colDef["columnData"] : null;
4851
- this._dispatch("columnRemoved", e);
4856
+ this._dispatchColumnEvent("columnRemoved", e);
4852
4857
  }
4853
4858
  }
4854
4859
  };
@@ -4881,6 +4886,9 @@ Core.prototype._onSectionDataChanged = function (e) {
4881
4886
  rowDataCollection = dataView.getMultipleRowData(rids, fromR, toR);
4882
4887
  e["dataRows"] = rowDataCollection;
4883
4888
  }
4889
+ if(e["sectionType"] === "content"){
4890
+ this._dispatch("beforeContentBinding", e);
4891
+ }
4884
4892
  this._dispatch("preSectionDataBinding", e);
4885
4893
 
4886
4894
  var dataMap = this.getDataColumnMap();
@@ -1525,8 +1525,11 @@ SortableTitlePlugin.prototype._onColumnAdded = function (e) {
1525
1525
 
1526
1526
  var sortOrder = column["sortOrder"] || column["sort"];
1527
1527
  if(sortOrder != null) {
1528
- t.clearSortState(); // clear previous sorting state
1529
- t.sortColumn(colIndex, sortOrder);
1528
+ sortOrder = SortableTitlePlugin._toSortOrder(sortOrder); // Invalid input will return "n"
1529
+ if(sortOrder !== "n") {
1530
+ t.clearSortState(); // clear previous sorting state
1531
+ t.sortColumn(colIndex, sortOrder);
1532
+ }
1530
1533
  }
1531
1534
  };
1532
1535
 
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.39" };
3
+ window.EFX_GRID = { version: "6.0.41" };
@@ -33,7 +33,7 @@ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
33
33
  */
34
34
  var RowSegmentingPlugin = function (options) {
35
35
  var t = this;
36
- t._onPostSectionDataBinding = t._onPostSectionDataBinding.bind(t);
36
+ t._onPreSectionDataBinding = t._onPreSectionDataBinding.bind(t);
37
37
  t._updateHeader = t._updateHeader.bind(t);
38
38
  t._onArrowClick = t._onArrowClick.bind(t);
39
39
  t._rtSortingLogic = t._rtSortingLogic.bind(t);
@@ -128,7 +128,7 @@ RowSegmentingPlugin.prototype.initialize = function (host, options) {
128
128
  ExpanderIcon.injectExpanderStyles(host.getElement());
129
129
 
130
130
  this._hosts.push(host);
131
- host.listen("postSectionDataBinding", this._onPostSectionDataBinding);
131
+ host.listen("preSectionDataBinding", this._onPreSectionDataBinding);
132
132
 
133
133
  this.config(options);
134
134
 
@@ -182,7 +182,7 @@ RowSegmentingPlugin.prototype.unload = function (host) {
182
182
  if (at < 0) {
183
183
  return;
184
184
  }
185
- host.unlisten("postSectionDataBinding", this._onPostSectionDataBinding);
185
+ host.unlisten("preSectionDataBinding", this._onPreSectionDataBinding);
186
186
  this._hosts.splice(at, 1);
187
187
  this._dispose();
188
188
  };
@@ -338,7 +338,7 @@ RowSegmentingPlugin.prototype._injectStyles = function(predefinedColors) {
338
338
  /** @private
339
339
  * @param {Object} e
340
340
  */
341
- RowSegmentingPlugin.prototype._onPostSectionDataBinding = function (e) {
341
+ RowSegmentingPlugin.prototype._onPreSectionDataBinding = function (e) {
342
342
  this._updateHeader(
343
343
  e.sectionSettings,
344
344
  e.fromRowIndex,