@refinitiv-ui/efx-grid 6.0.33 → 6.0.34

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 (55) hide show
  1. package/lib/core/dist/core.js +112 -36
  2. package/lib/core/dist/core.min.js +1 -1
  3. package/lib/core/es6/data/DataTable.d.ts +1 -1
  4. package/lib/core/es6/data/DataTable.js +9 -8
  5. package/lib/core/es6/data/DataView.js +1 -1
  6. package/lib/core/es6/data/Segment.d.ts +2 -0
  7. package/lib/core/es6/data/Segment.js +16 -0
  8. package/lib/core/es6/data/SegmentCollection.d.ts +1 -3
  9. package/lib/core/es6/data/SegmentCollection.js +25 -18
  10. package/lib/core/es6/grid/Core.js +1 -1
  11. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +7 -7
  12. package/lib/grid/index.js +1 -1
  13. package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
  14. package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
  15. package/lib/grid/themes/halo/efx-grid.less +2 -0
  16. package/lib/grid/themes/halo/light/efx-grid.js +1 -1
  17. package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
  18. package/lib/rt-grid/dist/rt-grid.js +425 -153
  19. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  20. package/lib/rt-grid/es6/ColumnDefinition.js +13 -8
  21. package/lib/rt-grid/es6/DataConnector.js +3 -2
  22. package/lib/rt-grid/es6/Grid.d.ts +3 -1
  23. package/lib/rt-grid/es6/Grid.js +116 -15
  24. package/lib/rt-grid/es6/RowDefinition.d.ts +7 -2
  25. package/lib/rt-grid/es6/RowDefinition.js +48 -10
  26. package/lib/rt-grid/es6/SnapshotFiller.d.ts +1 -0
  27. package/lib/rt-grid/es6/SnapshotFiller.js +1 -11
  28. package/lib/tr-grid-column-stack/es6/ColumnStack.js +21 -10
  29. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +12 -5
  30. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +128 -42
  31. package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +3 -3
  32. package/lib/tr-grid-heat-map/es6/HeatMap.js +13 -2
  33. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +2 -1
  34. package/lib/tr-grid-row-dragging/es6/RowDragging.js +142 -17
  35. package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +20 -20
  36. package/lib/tr-grid-textformatting/es6/TextFormatting.js +37 -138
  37. package/lib/tr-grid-util/es6/CellPainter.d.ts +1 -1
  38. package/lib/tr-grid-util/es6/CellPainter.js +56 -55
  39. package/lib/tr-grid-util/es6/FieldFormatter.js +6 -2
  40. package/lib/tr-grid-util/es6/NumberFormatter.js +23 -11
  41. package/lib/tr-grid-util/es6/Util.d.ts +3 -0
  42. package/lib/tr-grid-util/es6/Util.js +53 -0
  43. package/lib/types/es6/ConditionalColoring.d.ts +12 -5
  44. package/lib/types/es6/Core/data/Segment.d.ts +2 -0
  45. package/lib/types/es6/Core/data/SegmentCollection.d.ts +1 -3
  46. package/lib/types/es6/Core/grid/Core.d.ts +4 -0
  47. package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +1 -0
  48. package/lib/types/es6/HeatMap.d.ts +3 -3
  49. package/lib/types/es6/RealtimeGrid/Grid.d.ts +3 -1
  50. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +7 -2
  51. package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +1 -0
  52. package/lib/types/es6/RowDragging.d.ts +2 -1
  53. package/lib/types/es6/TextFormatting.d.ts +20 -20
  54. package/lib/versions.json +6 -6
  55. package/package.json +1 -1
@@ -579,7 +579,7 @@ ColumnDefinition.prototype.getAllFields = function() {
579
579
  * @return {boolean}
580
580
  */
581
581
  ColumnDefinition.prototype.isRealTimeField = function() {
582
- return FieldDefinition.isRealTimeField(this.getField());
582
+ return FieldDefinition.isRealTimeField(this.getField() || this._field);
583
583
  };
584
584
  /** @public
585
585
  * @return {boolean}
@@ -770,8 +770,9 @@ ColumnDefinition.prototype.getConfigObject = function(colOptions) {
770
770
  obj["sort"] = this._initialOrder;
771
771
  }
772
772
 
773
- if(this._classes) {
774
- obj["className"] = this._classes.join(" ");
773
+ var classes = this._classes;
774
+ if(classes && classes.length > 0) {
775
+ obj["className"] = classes.join(" ");
775
776
  }
776
777
 
777
778
  if(this._textSelect) {
@@ -789,14 +790,18 @@ ColumnDefinition.prototype.getConfigObject = function(colOptions) {
789
790
  var core = this._eventArg["core"];
790
791
  var grid = this._eventArg["grid"];
791
792
  var colIndex = grid.getColumnIndex(this);
792
- value = core.getColumnScalability(colIndex);
793
- obj["scalable"] = value;
794
793
 
795
- value = core.getColumnCustomLaneSize(colIndex);
796
- obj["width"] = value;
794
+ // The scalable, width and minWidth cannot be shifted into core as getConfigObject is accessible from colDef.
795
+ var scalable = core.getColumnScalability(colIndex);
796
+ var width = core.getColumnCustomLaneSize(colIndex);
797
+
798
+ if (scalable !== true || width !== 1) {
799
+ obj["scalable"] = scalable;
800
+ obj["width"] = width;
801
+ }
797
802
 
798
803
  value = core.getMinimumColumnWidth(colIndex);
799
- if(value !== 32) {
804
+ if(value !== 0) {
800
805
  obj["minWidth"] = value;
801
806
  }
802
807
 
@@ -85,7 +85,7 @@ DataConnector.prototype.getRowDefByRic = function (ric) {
85
85
  * @return {boolean} True if new reference is added.
86
86
  */
87
87
  DataConnector.prototype.addRic = function (rowDef) {
88
- var ric = rowDef ? rowDef.getRic() : "";
88
+ var ric = rowDef ? rowDef.getSymbol() : "";
89
89
  if(!ric) {
90
90
  return false;
91
91
  }
@@ -113,7 +113,8 @@ DataConnector.prototype.addRic = function (rowDef) {
113
113
  */
114
114
  DataConnector.prototype.removeRic = function (rowDef, ric) {
115
115
  if(!ric) {
116
- ric = rowDef ? rowDef.getRic() : "";
116
+ // TODO: RIC or permId maybe change during run-time, need to check before remove RIC/permId
117
+ ric = rowDef ? rowDef.getSymbol() : "";
117
118
  }
118
119
  if(!ric) {
119
120
  return;
@@ -3,7 +3,7 @@ import { Conflator } from "../../tr-grid-util/es6/Conflator.js";
3
3
  import { Ext } from "../../tr-grid-util/es6/Ext.js";
4
4
  import { EventDispatcher } from "../../tr-grid-util/es6/EventDispatcher.js";
5
5
  import { Engine } from "../../tr-grid-util/es6/formula/Engine.js";
6
- import { cloneObject, extendObject, arrayToObject } from "../../tr-grid-util/es6/Util.js";
6
+ import { cloneObject, extendObject, arrayToObject, isEmptyObject, deepEqual } from "../../tr-grid-util/es6/Util.js";
7
7
  import { DateTime } from "../../tr-grid-util/es6/DateTime.js";
8
8
 
9
9
  import { RowDefinition, ROW_DEF } from "./RowDefinition.js";
@@ -134,6 +134,8 @@ declare class Grid extends EventDispatcher {
134
134
 
135
135
  public setColumns(columns: (any)[]|null): void;
136
136
 
137
+ public restoreColumns(columns: (any)[]|null): void;
138
+
137
139
  public setFields(ary: (string)[]|null): void;
138
140
 
139
141
  public removeColumn(colRef: Grid.ColumnReference|null): void;
@@ -4,7 +4,7 @@ import { Conflator } from "../../tr-grid-util/es6/Conflator.js";
4
4
  import { Ext } from "../../tr-grid-util/es6/Ext.js";
5
5
  import { EventDispatcher } from "../../tr-grid-util/es6/EventDispatcher.js";
6
6
  import { Engine } from "../../tr-grid-util/es6/formula/Engine.js";
7
- import { cloneObject, extendObject, arrayToObject } from "../../tr-grid-util/es6/Util.js";
7
+ import { cloneObject, extendObject, arrayToObject, isEmptyObject, deepEqual } from "../../tr-grid-util/es6/Util.js";
8
8
  import { DateTime } from "../../tr-grid-util/es6/DateTime.js";
9
9
 
10
10
  import { RowDefinition, ROW_DEF } from "./RowDefinition.js";
@@ -1062,6 +1062,28 @@ Grid.prototype.getConfigObject = function (gridOptions) {
1062
1062
  grid.getConfigObject(obj);
1063
1063
  }
1064
1064
 
1065
+ // Difference from composite grid in default config
1066
+ if(obj["columnVirtualization"] === false) {
1067
+ delete obj["columnVirtualization"];
1068
+ }
1069
+
1070
+ if(obj["rowVirtualization"] === true) {
1071
+ delete obj["rowVirtualization"];
1072
+ }
1073
+
1074
+ if(obj["rowHighlighting"] === true) {
1075
+ delete obj["rowHighlighting"];
1076
+ }
1077
+
1078
+ if(obj["contentVerticalLines"] === false) { // the default value change in wrapper (atlas-blotter)
1079
+ delete obj["contentVerticalLines"];
1080
+ }
1081
+
1082
+ if(obj["borders"] === false) { // the default value change in wrapper (atlas-blotter)
1083
+ delete obj["borders"];
1084
+ }
1085
+
1086
+
1065
1087
  var i, len;
1066
1088
  len = this.getColumnCount();
1067
1089
  for (i = 0; i < len; ++i) {
@@ -1086,12 +1108,12 @@ Grid.prototype.getConfigObject = function (gridOptions) {
1086
1108
  }
1087
1109
 
1088
1110
  val = grid.getDefaultRowHeight();
1089
- if(val !== 32) {
1111
+ if(val !== 28) { // the default value change in wrapper (atlas-blotter)
1090
1112
  obj["rowHeight"] = val;
1091
1113
  }
1092
1114
 
1093
1115
  val = grid.getSection("title").getDefaultRowHeight();
1094
- if(val !== 32) {
1116
+ if(val !== 28) { // the default value change in wrapper (atlas-blotter)
1095
1117
  obj["headerRowHeight"] = val;
1096
1118
  }
1097
1119
 
@@ -1099,7 +1121,8 @@ Grid.prototype.getConfigObject = function (gridOptions) {
1099
1121
  obj["autoLayoutUpdate"] = true;
1100
1122
  }
1101
1123
 
1102
- if (this._defaultColumnOptions) {
1124
+ val = isEmptyObject(this._defaultColumnOptions);
1125
+ if (!val) { // Currently, this variable is the object, we need to check empty array for default value
1103
1126
  obj["defaultColumnOptions"] = this._defaultColumnOptions;
1104
1127
  }
1105
1128
 
@@ -1158,10 +1181,13 @@ Grid.prototype.getConfigObject = function (gridOptions) {
1158
1181
  }
1159
1182
 
1160
1183
  // TODO: The following states need to be retrieved
1161
- // rowHighlighting
1162
- // columnVirtualization
1163
1184
  // topFreezingCount, bottomFreezingCount
1164
1185
  // scrollbarParent
1186
+ // linearWheelScrolling
1187
+ // stepScroll
1188
+ // noColumnDragging
1189
+ // columnReorder
1190
+ // topSection
1165
1191
 
1166
1192
  // NOTE: no need to export synapseApiKey, ADC and RTK
1167
1193
 
@@ -1237,7 +1263,7 @@ Grid.prototype._onRicAdded = function(e) {
1237
1263
  var jLen = rowDefs ? rowDefs.length : 0;
1238
1264
  for (var j = 0; j < jLen; ++j) {
1239
1265
  var rowDef = rowDefs[j];
1240
- if (rowDef.getRic() === ric) {
1266
+ if (rowDef.getSymbol() === ric) {
1241
1267
  this._snapshot.addRic(ric); // ADC
1242
1268
  }
1243
1269
  }
@@ -1262,7 +1288,7 @@ Grid.prototype._onFieldAdded = function(e) {
1262
1288
 
1263
1289
  // ADC
1264
1290
  for (var i in rowDefs) {
1265
- this._snapshot.addRic(rowDefs[i].getRic());
1291
+ this._snapshot.addRic(rowDefs[i].getSymbol());
1266
1292
  }
1267
1293
  this._snapshot.addFields(addedFields);
1268
1294
 
@@ -1456,7 +1482,7 @@ Grid.prototype.replaceColumn = function (columnOption, colRef) {
1456
1482
  colConfig["width"] = value;
1457
1483
 
1458
1484
  value = core.getMinimumColumnWidth(colIndex);
1459
- if(value !== 32) {
1485
+ if(value > 0) {
1460
1486
  colConfig["minWidth"] = value;
1461
1487
  }
1462
1488
 
@@ -1610,6 +1636,79 @@ Grid.prototype.setColumns = function(columns) {
1610
1636
  }
1611
1637
  }
1612
1638
  };
1639
+
1640
+
1641
+ /** Remove, add and keep column based on the given column data
1642
+ * @public
1643
+ * @param {Array.<Object>} columns Array of column options
1644
+ */
1645
+ Grid.prototype.restoreColumns = function(columns) {
1646
+ var configObj = this.getConfigObject();
1647
+ var previousColumns = configObj.columns;
1648
+
1649
+ var preColLen = previousColumns.length;
1650
+ var newColLen = columns.length;
1651
+
1652
+ var removingFields = [];
1653
+ var keepingColumns = [];
1654
+ var columnOrdering = [];
1655
+
1656
+ var i, j, found;
1657
+ // Slow, time complexity BigO(n ^ 2)
1658
+ for (i = 0; i < preColLen; i++) {
1659
+ found = false;
1660
+ for (j = 0; j < newColLen; j++) {
1661
+ if (deepEqual(previousColumns[i], columns[j])) {
1662
+ keepingColumns.push(previousColumns[i]);
1663
+ found = true;
1664
+ break;
1665
+ }
1666
+ }
1667
+ if (!found) {
1668
+ removingFields.push(previousColumns[i].field);
1669
+ }
1670
+ }
1671
+
1672
+ var sortingStates;
1673
+ var removeLen = removingFields.length;
1674
+ if(removeLen > 0 && this._stp) {
1675
+ sortingStates = this._stp.getSortingStates().slice(); // We need to clone array for avoid object reference in remove column
1676
+ }
1677
+
1678
+ this.removeColumns(removingFields);
1679
+
1680
+ var keepingLen = keepingColumns.length;
1681
+ var prevState = false;
1682
+ if(newColLen > 1) {
1683
+ prevState = this._grid.freezeLayout(true); // Insert multiple columns can be a huge time consuming
1684
+ }
1685
+ for (i = 0; i < newColLen; i++) {
1686
+ found = false;
1687
+ for (j = 0; j < keepingLen; j++) { // loop only keeping column
1688
+ if (deepEqual(columns[i], keepingColumns[j])) {
1689
+ found = true;
1690
+ var colIndex = this.getColumnIndex(columns[i].field); // We cannot use 'i' (colIndex) in this case, as it will sort the columns. Instead, we need to obtain a new column index from the field.
1691
+ columnOrdering.push(this.getColumnId(colIndex));
1692
+ break;
1693
+ }
1694
+ }
1695
+ if (!found) {
1696
+ this.insertColumn(columns[i], i);
1697
+ columnOrdering.push(this.getColumnId(i)); // Use new insertion column index
1698
+ }
1699
+ }
1700
+
1701
+ if(newColLen > 1) {
1702
+ this._grid.freezeLayout(prevState);
1703
+ }
1704
+
1705
+ if(removeLen > 0 && this._stp) {
1706
+ this._stp.sortColumns(sortingStates);
1707
+ }
1708
+
1709
+ this._grid.reorderColumns(columnOrdering);
1710
+ };
1711
+
1613
1712
  /** Remove all existing columns and add new columns based on the given texts/fields
1614
1713
  * @public
1615
1714
  * @function
@@ -1754,10 +1853,11 @@ Grid.prototype.removeColumn = function(colRef) {
1754
1853
  this._dc.removeStaticFields([colDef.getField()]);
1755
1854
  }
1756
1855
  }
1757
- colDef.dispose();
1758
- this._grid.removeColumnAt(colIndex);
1759
1856
 
1857
+ this._grid.removeColumnAt(colIndex);
1760
1858
  this._connector.removeFields(colDef);
1859
+
1860
+ colDef.dispose(); // Dispose at the last line to avoid making properties inaccessible
1761
1861
  // TODO: Remove fields that are related to the column (e.g. fields for coloring)
1762
1862
  };
1763
1863
  /** Remove multiple columns through array. To remove all columns, use removeAllColumns() instead of this method
@@ -2103,7 +2203,7 @@ Grid.prototype.setColumnSorter = function(colRef, func) {
2103
2203
  * @param {RowDefinition} rowDef
2104
2204
  */
2105
2205
  Grid.prototype._initDuplicateRicData = function(rowDef) {
2106
- var ric = rowDef.getRic();
2206
+ var ric = rowDef.getSymbol();
2107
2207
  var rowDefs = this._connector.getRowDefByRic(ric);
2108
2208
  if(rowDefs && rowDefs.length) {
2109
2209
  cloneRowData(rowDefs[0], rowDef);
@@ -2520,8 +2620,9 @@ Grid.prototype.setRic = function(rowRef, str, options) {
2520
2620
  this.insertRow(options, rowIndex);
2521
2621
  }
2522
2622
  } else {
2523
- var oldRic = rowDef.getRic();
2524
- if(rowDef.setContent(str)) { // The given string may not be a RIC
2623
+ var oldRic = rowDef.getSymbol();
2624
+ var permId = options["permId"] || "";
2625
+ if(rowDef.setContent(str, permId)) { // The given string may not be a RIC
2525
2626
  this._connector.removeRic(rowDef, oldRic);
2526
2627
  this._initDuplicateRicData(rowDef);
2527
2628
  this._connector.addRic(rowDef);
@@ -2842,7 +2943,7 @@ Grid.prototype.setRicData = function(ric, values) {
2842
2943
  var rowCount = rowDefs ? rowDefs.length : 0;
2843
2944
  for (var i = 0; i < rowCount; ++i) {
2844
2945
  var rowDef = rowDefs[i];
2845
- if (rowDef && rowDef.getRic() === ric) {
2946
+ if (rowDef && rowDef.getSymbol() === ric) {
2846
2947
  rowDef.setRowData(values); // TODO: Need conflator to improve performance
2847
2948
  }
2848
2949
  }
@@ -6,6 +6,7 @@ declare namespace RowDefinition {
6
6
 
7
7
  type Options = {
8
8
  ric?: string|null,
9
+ permId?: string|null,
9
10
  values?: (any[]|any)|null,
10
11
  fields?: (string)[]|null,
11
12
  asChain?: boolean|null,
@@ -36,7 +37,7 @@ declare class RowDefinition {
36
37
 
37
38
  public initialize(rowOptions?: RowDefinition.Options|null): void;
38
39
 
39
- public setContent(userInput: string): boolean;
40
+ public setContent(userInput: string, permId?: string|null): boolean;
40
41
 
41
42
  public getRowId(): string;
42
43
 
@@ -70,6 +71,10 @@ declare class RowDefinition {
70
71
 
71
72
  public getRic(): string;
72
73
 
74
+ public getPermId(): string;
75
+
76
+ public getSymbol(): string;
77
+
73
78
  public getDisplayText(): string;
74
79
 
75
80
  public getLabel(): string|null|null;
@@ -138,7 +143,7 @@ declare const ROW_DEF: string;
138
143
 
139
144
  declare const ROW_TYPES: RowDefinition.RowTypes;
140
145
 
141
- declare function rowData(userInput: string): boolean;
146
+ declare function rowData(userInput: string, permId?: string|null): boolean;
142
147
 
143
148
  export {RowDefinition, ROW_DEF, ROW_TYPES};
144
149
  export default RowDefinition;
@@ -7,6 +7,7 @@ import { DataTable } from "../../core/es6/data/DataTable.js";
7
7
  /** @typedef {Object} RowDefinition~Options
8
8
  * @description RowDefinition options
9
9
  * @property {string=} ric="" RIC for real-time fields. Prefixing 0# to the ric is equivalent to specifying asChain property.
10
+ * @property {string=} permId="" Organization PermId to be used instead of ric for private company.
10
11
  * @property {(Array|Object)=} values=null Values for static data
11
12
  * @property {Array.<string>=} fields=null Field that corresponds to the given static values
12
13
  * @property {boolean=} asChain=false The given ric will be treated as a chain
@@ -88,6 +89,10 @@ RowDefinition.prototype._ric = ""; // Contains no 0#
88
89
  /** @type {string}
89
90
  * @private
90
91
  */
92
+ RowDefinition.prototype._permId = "";
93
+ /** @type {string}
94
+ * @private
95
+ */
91
96
  RowDefinition.prototype._displayText = "";
92
97
  /** @type {string|null}
93
98
  * @private
@@ -213,13 +218,20 @@ RowDefinition.prototype.initialize = function(rowOptions) {
213
218
 
214
219
  var val = rowOptions["ric"];
215
220
  if(val != null) {
216
- this.setContent(/** @type{string} */(val)); // this._dataId is modified
221
+ this._ric = val;
222
+ }
223
+ val = rowOptions["permId"];
224
+ if(val != null) {
225
+ this._permId = val;
226
+ }
227
+ if(this._ric || this._permId){
228
+ this.setContent(this._ric, this._permId); // this._dataId is modified
217
229
  }
230
+
218
231
  val = rowOptions["chainRic"];
219
232
  if(val != null) {
220
233
  this._chainRic = val;
221
234
  }
222
-
223
235
  val = rowOptions["values"];
224
236
  // eslint-disable-next-line no-undefined
225
237
  if(val !== undefined) {
@@ -273,10 +285,11 @@ RowDefinition.prototype._initializeAsConstituent = function(rowOptions) {
273
285
  }
274
286
  };
275
287
  /** @public
276
- * @param {string} userInput
288
+ * @param {string} userInput RIC
289
+ * @param {string=} permId=null Organization PermId, which use for getting ADC data for private company
277
290
  * @return {boolean} True if there is any change otherwise false
278
291
  */
279
- RowDefinition.prototype.setContent = function(userInput) {
292
+ RowDefinition.prototype.setContent = function(userInput, permId) {
280
293
  if(this._autoGenerated) { // AutoGenerated RowDefinition cannot be changed by user input
281
294
  return false;
282
295
  }
@@ -287,7 +300,15 @@ RowDefinition.prototype.setContent = function(userInput) {
287
300
  userInput += "";
288
301
  }
289
302
 
290
- if(this._userInput === userInput) {
303
+ var dirty = (this._userInput !== userInput);
304
+ if(this._permId !== permId){
305
+ this._permId = permId || "";
306
+ if(!userInput){
307
+ this._displayText = this._permId;
308
+ dirty = true;
309
+ }
310
+ }
311
+ if(!dirty) {
291
312
  return false;
292
313
  }
293
314
 
@@ -314,7 +335,7 @@ RowDefinition.prototype.setContent = function(userInput) {
314
335
  this._displayText = this._ric; // No 0#
315
336
  }
316
337
 
317
- this._dataId = this._rowId + this._ric; // JET/RTK will generate data id to be rowId (given from this rowDef) + ric;
338
+ this._dataId = this._rowId + this.getSymbol(); // JET/RTK will generate data id to be rowId (given from this rowDef) + ric;
318
339
 
319
340
  // This will work for runtime ric modification, but not for first initilization.
320
341
  if(!this.subscribeForUpdates()) {
@@ -342,6 +363,11 @@ RowDefinition.prototype.getConfigObject = function(rowOptions) {
342
363
  obj["ric"] = val;
343
364
  }
344
365
 
366
+ val = this._permId;
367
+ if(val) {
368
+ obj["permId"] = val;
369
+ }
370
+
345
371
  val = this._chainRic;
346
372
  if(val) {
347
373
  obj["chainRic"] = val;
@@ -587,6 +613,18 @@ RowDefinition.prototype.getRic = function() {
587
613
  /** @public
588
614
  * @return {string}
589
615
  */
616
+ RowDefinition.prototype.getPermId = function() {
617
+ return this._permId;
618
+ };
619
+ /** @public
620
+ * @return {string}
621
+ */
622
+ RowDefinition.prototype.getSymbol = function() {
623
+ return this._ric || this._permId;
624
+ };
625
+ /** @public
626
+ * @return {string}
627
+ */
590
628
  RowDefinition.prototype.getDisplayText = function() {
591
629
  if(this._label != null) { // Empty string is allowed
592
630
  return this._label;
@@ -652,7 +690,7 @@ RowDefinition.prototype.isAutoGenerated = function() {
652
690
  * @return {boolean}
653
691
  */
654
692
  RowDefinition.prototype.isRealTimeRow = function() {
655
- if(!this._ric) { // Empty row
693
+ if(!this.getRic()) { // Empty row
656
694
  return false;
657
695
  }
658
696
  if(this.isRowHeader()) {
@@ -669,7 +707,7 @@ RowDefinition.prototype.isRealTimeRow = function() {
669
707
  * @return {boolean} If a subscription is made, return true.
670
708
  */
671
709
  RowDefinition.prototype.subscribeForUpdates = function() {
672
- if(!this.isRealTimeRow()) {
710
+ if(!this.isRealTimeRow() && !this.getPermId()) {
673
711
  return false;
674
712
  }
675
713
 
@@ -683,14 +721,14 @@ RowDefinition.prototype.subscribeForUpdates = function() {
683
721
  if(this.isChain()) {
684
722
  this._subId = subs["addChain"](this._chainRic || this._ric, this._rowId); // Some chain require 0# symbol to populate its constituents
685
723
  // TODO: Handle Dynamic chain such as .PG.PA
686
- } else {
724
+ } else if(this._ric) {
687
725
  this._subId = subs["addRic"](this._ric, this._rowId);
688
726
  }
689
727
 
690
728
  if(prevRowData) {
691
729
  this._dc.setRowData(this._dataId, prevRowData); // TODO: We may need to create a new object instead of prevRowData for data correctness
692
730
  } else {
693
- this._dc.setRowData(this._dataId, {"X_RIC_NAME": this._ric, "ROW_DEF": this}); // Trigger data update immediately
731
+ this._dc.setRowData(this._dataId, {"X_RIC_NAME": this.getSymbol(), "ROW_DEF": this}); // Trigger data update immediately
694
732
  }
695
733
  return true;
696
734
  };
@@ -2,6 +2,7 @@ import Grid from "./Grid.js";
2
2
  import {Ext} from "../../tr-grid-util/es6/Ext.js";
3
3
  import {EventDispatcher} from "../../tr-grid-util/es6/EventDispatcher.js";
4
4
  import {FieldDefinition} from "./FieldDefinition.js";
5
+ import { isEmptyObject } from "../../tr-grid-util/es6/Util.js";
5
6
 
6
7
  declare class SnapshotFiller extends EventDispatcher {
7
8
 
@@ -3,17 +3,7 @@ import Grid from "./Grid.js";
3
3
  import {Ext} from "../../tr-grid-util/es6/Ext.js";
4
4
  import {EventDispatcher} from "../../tr-grid-util/es6/EventDispatcher.js";
5
5
  import {FieldDefinition} from "./FieldDefinition.js";
6
-
7
- /** @private
8
- * @param {Object} obj
9
- * @return {boolean}
10
- */
11
- var isEmptyObject = function (obj) {
12
- for (var key in obj) {
13
- return false;
14
- }
15
- return true;
16
- };
6
+ import { isEmptyObject } from "../../tr-grid-util/es6/Util.js";
17
7
 
18
8
  /** This class make requesting ADC field easier by encapsulating JET.Data APIs and mapping data to the row
19
9
  * @constructor
@@ -1314,16 +1314,7 @@ ColumnStackPlugin.prototype._onColumnRemoved = function (e) {
1314
1314
  delete this._stacks[stackOpt.stackId];
1315
1315
  }
1316
1316
  } else {
1317
- if(stackOpt.spreading) {
1318
- stackOpt.activeColumn = stackOpt.stackRefs[stackOpt.stackRefs.length - 1];
1319
- } else {
1320
- stackOpt.activeColumn = stackOpt.stackRefs[0];
1321
- }
1322
-
1323
- // TODO: Add a proper way to set visibility to activeColumn when activeColumn is changed
1324
- var activeColIndex = this._getColumnIndex(stackOpt.activeColumn);
1325
- this._setColumnVisibility(activeColIndex, true);
1326
- this._updateUI();
1317
+ this._updateActiveColumn(stackOpt);
1327
1318
  }
1328
1319
  }
1329
1320
  }
@@ -1922,6 +1913,26 @@ ColumnStackPlugin.prototype._setStackVisibility = function(stackId, visible) {
1922
1913
  }
1923
1914
  };
1924
1915
 
1916
+ /** @private
1917
+ * @description Check for active column in a stack if it needs an update.
1918
+ * @param {Object} stackOpt
1919
+ */
1920
+ ColumnStackPlugin.prototype._updateActiveColumn = function(stackOpt) {
1921
+ if(!stackOpt) { return; }
1922
+
1923
+ var stackRefs = stackOpt["stackRefs"];
1924
+ if(!stackRefs || !stackRefs.length) { return; }
1925
+
1926
+ if(stackRefs.indexOf(stackOpt.activeColumn) === -1) {
1927
+ stackOpt.activeColumn = stackOpt["spreading"] ? stackRefs[stackRefs.length - 1] : stackRefs[0];
1928
+
1929
+ // TODO: Add a proper way to set visibility to activeColumn when activeColumn is changed
1930
+ var activeColIndex = this._getColumnIndex(stackOpt.activeColumn);
1931
+ this._setColumnVisibility(activeColIndex, true);
1932
+ this._updateUI();
1933
+ }
1934
+ };
1935
+
1925
1936
  /** @public
1926
1937
  * @description Hide specific stack from grid
1927
1938
  * @param {string} stackId
@@ -13,16 +13,16 @@ declare namespace ConditionalColoringPlugin {
13
13
 
14
14
  type ColumnOptions = {
15
15
  conditions?: (ConditionalColoringPlugin.Condition)[]|null,
16
- colorText?: (string|boolean)|null,
17
- tickColor?: (string|boolean)|null,
18
- blinking?: (ConditionalColoringPlugin.Blinking|boolean)|null,
16
+ colorText?: (string|boolean|ConditionalColoringPlugin.ColorText)|null,
17
+ tickColor?: (string|boolean|ConditionalColoringPlugin.ColorText)|null,
18
+ blinking?: (string|boolean|ConditionalColoringPlugin.Blinking)|null,
19
19
  field?: string|null
20
20
  };
21
21
 
22
22
  type ConditionalColoringOptions = {
23
23
  conditions?: (ConditionalColoringPlugin.Condition)[]|null,
24
- colorText?: (string|boolean)|null,
25
- tickColor?: (string|boolean)|null,
24
+ colorText?: (string|boolean|ConditionalColoringPlugin.ColorText)|null,
25
+ tickColor?: (string|boolean|ConditionalColoringPlugin.ColorText)|null,
26
26
  field?: string|null
27
27
  };
28
28
 
@@ -41,6 +41,13 @@ declare namespace ConditionalColoringPlugin {
41
41
  level?: (string|boolean)|null
42
42
  };
43
43
 
44
+ type ColorText = {
45
+ field?: string|null,
46
+ upClass?: string|null,
47
+ downClass?: string|null,
48
+ levelClass?: string|null
49
+ };
50
+
44
51
  }
45
52
 
46
53
  declare class ConditionalColoringPlugin extends GridPlugin {