@refinitiv-ui/efx-grid 6.0.85 → 6.0.87

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/lib/column-format-dialog/lib/column-format-dialog.js +5 -8
  2. package/lib/column-format-dialog/lib/preview-table.d.ts +1 -1
  3. package/lib/column-format-dialog/lib/preview-table.js +15 -15
  4. package/lib/column-selection-dialog/themes/base.less +0 -1
  5. package/lib/column-selection-dialog/themes/elemental/dark/column-selection-dialog.js +1 -1
  6. package/lib/column-selection-dialog/themes/elemental/dark/es5/all-elements.js +1 -1
  7. package/lib/column-selection-dialog/themes/elemental/light/column-selection-dialog.js +1 -1
  8. package/lib/column-selection-dialog/themes/elemental/light/es5/all-elements.js +1 -1
  9. package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
  10. package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
  11. package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
  12. package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
  13. package/lib/column-selection-dialog/themes/solar/charcoal/column-selection-dialog.js +1 -1
  14. package/lib/column-selection-dialog/themes/solar/charcoal/es5/all-elements.js +1 -1
  15. package/lib/column-selection-dialog/themes/solar/pearl/column-selection-dialog.js +1 -1
  16. package/lib/column-selection-dialog/themes/solar/pearl/es5/all-elements.js +1 -1
  17. package/lib/core/dist/core.js +50 -11
  18. package/lib/core/dist/core.min.js +1 -1
  19. package/lib/core/es6/data/DataView.d.ts +4 -0
  20. package/lib/core/es6/data/DataView.js +24 -1
  21. package/lib/core/es6/grid/Core.d.ts +2 -0
  22. package/lib/core/es6/grid/Core.js +26 -10
  23. package/lib/grid/index.js +1 -1
  24. package/lib/rt-grid/dist/rt-grid.js +10 -10
  25. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  26. package/lib/rt-grid/es6/ColumnDefinition.js +2 -2
  27. package/lib/rt-grid/es6/RowDefinition.js +3 -3
  28. package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +2 -0
  29. package/lib/tr-grid-checkbox/es6/Checkbox.js +38 -0
  30. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +3 -4
  31. package/lib/tr-grid-filter-input/es6/FilterInput.js +1 -1
  32. package/lib/tr-grid-range-bar/es6/RangeBar.js +4 -1
  33. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
  34. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +3 -3
  35. package/lib/tr-grid-util/es6/Dom.d.ts +1 -1
  36. package/lib/tr-grid-util/es6/Dom.js +1 -1
  37. package/lib/tr-grid-util/es6/ExpressionParser.js +1 -1
  38. package/lib/tr-grid-util/es6/FilterBuilder.d.ts +1 -1
  39. package/lib/tr-grid-util/es6/FilterBuilder.js +1 -1
  40. package/lib/tr-grid-util/es6/PercentBar.d.ts +1 -1
  41. package/lib/tr-grid-util/es6/PercentBar.js +1 -1
  42. package/lib/tr-grid-util/es6/RangeBar.d.ts +1 -1
  43. package/lib/tr-grid-util/es6/RangeBar.js +8 -7
  44. package/lib/tr-grid-util/es6/TextHighlighter.d.ts +0 -2
  45. package/lib/tr-grid-util/es6/TextHighlighter.js +1 -6
  46. package/lib/tr-grid-util/es6/formula/Formula.js +1 -1
  47. package/lib/tr-grid-util/es6/formula/VariableToken.js +1 -1
  48. package/lib/tr-grid-util/es6/formula/functions/Excel.d.ts +1 -1
  49. package/lib/tr-grid-util/es6/formula/functions/Excel.js +1 -1
  50. package/lib/tr-grid-util/es6/index.js +1 -1
  51. package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +1 -1
  52. package/lib/tr-grid-util/es6/jet/DataGenerator.js +1 -1
  53. package/lib/types/es6/Checkbox.d.ts +2 -0
  54. package/lib/types/es6/Core/data/DataView.d.ts +4 -0
  55. package/lib/types/es6/Core/grid/Core.d.ts +2 -0
  56. package/lib/types/es6/RowFiltering.d.ts +2 -0
  57. package/lib/versions.json +8 -8
  58. package/package.json +1 -1
@@ -218,10 +218,14 @@ declare class DataView extends EventDispatcher {
218
218
 
219
219
  public getExpansionParents(from?: number|null, to?: number|null): (string)[]|null;
220
220
 
221
+ public getExpansionParentByRowId(rid: string): string;
222
+
221
223
  public isRowExpansion(rid: string): boolean;
222
224
 
223
225
  public hasRowExpansion(rid: string): boolean;
224
226
 
227
+ public getRowExpansionCount(rowId: string): number;
228
+
225
229
  public getRowExpansionId(rid: string, idx?: number|null): string;
226
230
 
227
231
  public getRowExpansionIndex(rid: string): number;
@@ -1559,7 +1559,7 @@ DataView.prototype.getGroupRowId = function () {
1559
1559
  /**
1560
1560
  * @public
1561
1561
  * @ignore
1562
- * @param {number} rid
1562
+ * @param {string} rid
1563
1563
  * @return {number}
1564
1564
  */
1565
1565
  DataView.prototype.getFooterRowIndex = function (rid) {
@@ -2094,6 +2094,17 @@ DataView.prototype.getExpansionParents = function (from, to) {
2094
2094
  return parentMapping;
2095
2095
  };
2096
2096
 
2097
+ /**
2098
+ * @public
2099
+ * @param {string} rid
2100
+ * @return {string} parent row id
2101
+ */
2102
+ DataView.prototype.getExpansionParentByRowId = function(rid) {
2103
+ if(this._expansionChildren) {
2104
+ return this._expansionChildren[rid] || "";
2105
+ }
2106
+ return "";
2107
+ };
2097
2108
  /** Check if the specified row is itself a row expansion.
2098
2109
  * @public
2099
2110
  * @param {string} rid rowId
@@ -2116,6 +2127,18 @@ DataView.prototype.hasRowExpansion = function(rid) {
2116
2127
  }
2117
2128
  return false;
2118
2129
  };
2130
+ /**
2131
+ * @public
2132
+ * @param {string} rowId
2133
+ * @return {number}
2134
+ */
2135
+ DataView.prototype.getRowExpansionCount = function(rowId) {
2136
+ if(this._expansionMap) {
2137
+ return this._expansionMap[rowId] || 0;
2138
+ }
2139
+ return 0;
2140
+ };
2141
+
2119
2142
  /** Get row Id of the row expansion by providing the row Id of the row with row expansion (not row expansion itself). This is NOT recommended for normal usage, since the row expansion contains no data in the DataView
2120
2143
  * @public
2121
2144
  * @param {string} rid rowId
@@ -245,6 +245,8 @@ declare class Core extends ElementWrapper {
245
245
 
246
246
  public freezeSection(opt_frozenSection?: (string|number|null)|null): void;
247
247
 
248
+ public resetSectionFreezing(): void;
249
+
248
250
  public freezeFooter(frozenCount: number): void;
249
251
 
250
252
  public getFooterCount(): number;
@@ -574,7 +574,7 @@ Core.prototype._hasPendingRowChange = false;
574
574
  * @return {string}
575
575
  */
576
576
  Core.getVersion = function () {
577
- return "5.1.89";
577
+ return "5.1.92";
578
578
  };
579
579
  /** {@link ElementWrapper#dispose}
580
580
  * @override
@@ -2872,6 +2872,12 @@ Core.prototype.freezeSection = function (opt_frozenSection) {
2872
2872
  this._fixFrozenTopSections = true;
2873
2873
  this._freezeTopSectionAt(opt_frozenSection);
2874
2874
  };
2875
+ /** @public
2876
+ */
2877
+ Core.prototype.resetSectionFreezing = function () {
2878
+ this._fixFrozenTopSections = false;
2879
+ this._updateFrozenTopSections();
2880
+ };
2875
2881
 
2876
2882
  /** Vertical scrollbar will automatically appear for the rest of the sections, when container of Grid does NOT have enough space for Grid's content.
2877
2883
  * @private
@@ -4881,25 +4887,35 @@ Core.prototype._dispatchRowExpansionBinding = function (e) {
4881
4887
 
4882
4888
  var fromR = /** @type{number} */(e["fromRowIndex"]);
4883
4889
  var toR = /** @type{number} */(e["toRowIndex"]);
4884
- var parents = dataView.getExpansionParents(fromR, toR);
4885
4890
  var rids = dataView.getVisibleRowIds(true);
4886
4891
  var section = /** @type{ILayoutGrid} */(e["section"]);
4887
4892
 
4888
4893
  e["rowData"] = null;
4889
4894
  e["cell"] = null;
4890
- for (var r = fromR; r < toR; ++r) {
4891
- var parentRid = parents[r];
4895
+ var lastRowIndexChanged = false;
4896
+ for (var r = toR - 1; r >= fromR; --r) {
4897
+ var rowId = dataView.getRowId(r);
4898
+ if(!lastRowIndexChanged) {
4899
+ var reCount = dataView.getRowExpansionCount(rowId);
4900
+ if(reCount > 0){
4901
+ r = r + reCount + 1; // include parent row
4902
+ lastRowIndexChanged = true;
4903
+ continue;
4904
+ }
4905
+ }
4906
+
4892
4907
  var ctxRow = section.getContextRow(r);
4893
- if(parentRid) { // Previous row is the row with expansion
4894
- e["originalRowData"] = dataView.getRowData(parentRid);
4895
- e["originalRowId"] = parentRid;
4908
+ var parentId = dataView.getExpansionParentByRowId(rowId);
4909
+ if(parentId) { // dispatch to render row expansion
4910
+ e["originalRowData"] = dataView.getRowData(parentId);
4911
+ e["originalRowId"] = parentId;
4896
4912
  e["rowExpansion"] = ctxRow["rowExpansion"] = true;
4897
- } else if(ctxRow["rowExpansion"]) {
4913
+ } else if(ctxRow["rowExpansion"] ){ // dispose cases
4898
4914
  e["originalRowData"] = null;
4899
4915
  e["originalRowId"] = null;
4900
4916
  e["rowExpansion"] = ctxRow["rowExpansion"] = false;
4901
- } else {
4902
- continue; // There is no need to dispatch the event for normal row
4917
+ } else { // normal row no need to dispatch
4918
+ continue;
4903
4919
  }
4904
4920
  e["rowId"] = rids[r];
4905
4921
  e["rowIndex"] = r;
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.85" };
3
+ window.EFX_GRID = { version: "6.0.87" };
@@ -125,7 +125,7 @@ Dom.div = function(className) {
125
125
  /** Shorthand for creating a span element with textContent
126
126
  * @public
127
127
  * @function
128
- * @param {string=} textContent
128
+ * @param {(string|number)=} textContent
129
129
  * @param {string=} className
130
130
  * @return {!Element}
131
131
  */
@@ -866,7 +866,7 @@ EventDispatcher.preventDefault = preventDefault;
866
866
  * @param {number=} index
867
867
  */
868
868
  var VariableToken = function(str, index) {
869
- str = str.replace(/^\s+|\s+$/gm, ""); // Trim white spaces -- equivalent to String.trim(), which is not support in IE8
869
+ str = str.trim();
870
870
 
871
871
  if(this._inputConverter[str]) {
872
872
  str = this._inputConverter[str];
@@ -1791,7 +1791,7 @@ Formula.prototype._parse = function(exp) {
1791
1791
  if(exp.charAt(0) === "=") { // Remove the first equal sign
1792
1792
  exp = exp.substr(1);
1793
1793
  }
1794
- exp = exp.replace(/^\s+|\s+$/gm, ""); // Trim white spaces -- equivalent to String.trim(), which is not support in IE8
1794
+ exp = exp.trim();
1795
1795
  exp = exp.replace(/<>/g, "!=");
1796
1796
  exp = exp.replace(/‛|‘|’/g, "'"); // Left and right single quote will be converted to simple single quote
1797
1797
  exp = exp.replace(/‟|“|”/g, '"'); // Left and right double quote will be converted to simple double quote
@@ -13316,7 +13316,7 @@ RowDefinition.prototype._dataId = ""; // Data id can be different from rowId for
13316
13316
  * @private
13317
13317
  */
13318
13318
  RowDefinition.prototype._dc = null;
13319
- /** @type {DataTable}
13319
+ /** @type {DataView}
13320
13320
  * @private
13321
13321
  */
13322
13322
  RowDefinition.prototype._view = null;
@@ -13594,8 +13594,8 @@ RowDefinition.prototype.getConfigObject = function(rowOptions) {
13594
13594
  }
13595
13595
 
13596
13596
  val = this._realTime;
13597
- if(val !== true) {
13598
- obj["realTime"] = val;
13597
+ if(!val) {
13598
+ obj["realTime"] = false;
13599
13599
  }
13600
13600
 
13601
13601
  val = this._permId;
@@ -15856,7 +15856,7 @@ ColumnDefinition.prototype.getConfigObject = function(colOptions) {
15856
15856
  }
15857
15857
 
15858
15858
  value = core.getMinimumColumnWidth(colIndex);
15859
- if(value !== 0) {
15859
+ if(value > 0) {
15860
15860
  obj["minWidth"] = value;
15861
15861
  }
15862
15862
 
@@ -15958,7 +15958,7 @@ ColumnDefinition.prototype.getChildren = function() {
15958
15958
  };
15959
15959
  /**
15960
15960
  * @private
15961
- * @param {string} colDef Child column definition
15961
+ * @param {ColumnDefinition} colDef Child column definition
15962
15962
  */
15963
15963
  ColumnDefinition.prototype._addChild = function(colDef) {
15964
15964
  if(this === colDef || this._children.indexOf(colDef) > -1) {
@@ -49172,7 +49172,7 @@ var randString = function(min, max, seed) {
49172
49172
  /** Convert 2D Array to Array of records
49173
49173
  * @public
49174
49174
  * @param {Array.<Array>} data2D Array of values
49175
- * @param {Array.<string>=} fields Keys to be mapped on the output records.
49175
+ * @param {Array.<string|number>=} fields Keys to be mapped on the output records.
49176
49176
  * @return {Array.<Object>} records
49177
49177
  */
49178
49178
  var toRecords = function(data2D, fields) {
@@ -51555,7 +51555,7 @@ var OperatorFunctions = {
51555
51555
  "!": function(lhs, rhs){ return !lhs; },
51556
51556
  "!!": function(lhs, rhs){ return !!lhs; }
51557
51557
  };
51558
- /** @type {Object.<string, Function>}
51558
+ /** @type {Object.<string, number>}
51559
51559
  * @private
51560
51560
  * @const
51561
51561
  */