@refinitiv-ui/efx-grid 6.0.32 → 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.
- package/lib/core/dist/core.js +197 -46
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataTable.d.ts +1 -1
- package/lib/core/es6/data/DataTable.js +9 -8
- package/lib/core/es6/data/DataView.js +1 -1
- package/lib/core/es6/data/Segment.d.ts +2 -0
- package/lib/core/es6/data/Segment.js +16 -0
- package/lib/core/es6/data/SegmentCollection.d.ts +1 -3
- package/lib/core/es6/data/SegmentCollection.js +25 -18
- package/lib/core/es6/grid/Core.d.ts +4 -0
- package/lib/core/es6/grid/Core.js +27 -6
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +1 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +36 -12
- package/lib/grid/index.js +1 -1
- package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
- package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/grid/themes/halo/efx-grid.less +2 -0
- package/lib/grid/themes/halo/light/efx-grid.js +1 -1
- package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +945 -331
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.js +13 -8
- package/lib/rt-grid/es6/DataConnector.js +3 -2
- package/lib/rt-grid/es6/Grid.d.ts +3 -1
- package/lib/rt-grid/es6/Grid.js +130 -28
- package/lib/rt-grid/es6/RowDefinition.d.ts +7 -2
- package/lib/rt-grid/es6/RowDefinition.js +49 -11
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +1 -0
- package/lib/rt-grid/es6/SnapshotFiller.js +1 -11
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +4 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +58 -30
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +2 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +56 -22
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +12 -5
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +128 -42
- package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +3 -3
- package/lib/tr-grid-heat-map/es6/HeatMap.js +13 -2
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +2 -1
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +142 -17
- package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +20 -20
- package/lib/tr-grid-textformatting/es6/TextFormatting.js +37 -138
- package/lib/tr-grid-util/es6/CellPainter.d.ts +1 -1
- package/lib/tr-grid-util/es6/CellPainter.js +56 -55
- package/lib/tr-grid-util/es6/FieldFormatter.js +6 -2
- package/lib/tr-grid-util/es6/GroupDefinitions.d.ts +2 -0
- package/lib/tr-grid-util/es6/GroupDefinitions.js +15 -0
- package/lib/tr-grid-util/es6/NumberFormatter.js +23 -11
- package/lib/tr-grid-util/es6/Util.d.ts +6 -0
- package/lib/tr-grid-util/es6/Util.js +68 -0
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/CollectionDict.js +12 -2
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +170 -47
- package/lib/types/es6/ColumnGrouping.d.ts +4 -0
- package/lib/types/es6/ColumnSelection.d.ts +2 -0
- package/lib/types/es6/ColumnStack.d.ts +2 -0
- package/lib/types/es6/ConditionalColoring.d.ts +12 -5
- package/lib/types/es6/Core/data/Segment.d.ts +2 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +1 -3
- package/lib/types/es6/Core/grid/Core.d.ts +4 -0
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +1 -0
- package/lib/types/es6/Core/grid/util/SelectionList.d.ts +6 -2
- package/lib/types/es6/HeatMap.d.ts +3 -3
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +3 -1
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +7 -2
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +1 -0
- package/lib/types/es6/RowDragging.d.ts +25 -2
- package/lib/types/es6/StatisticsRow.d.ts +25 -25
- package/lib/types/es6/TextFormatting.d.ts +20 -20
- package/lib/versions.json +7 -7
- 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
|
-
|
774
|
-
|
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
|
-
|
796
|
-
|
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 !==
|
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.
|
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
|
-
|
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;
|
package/lib/rt-grid/es6/Grid.js
CHANGED
@@ -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 !==
|
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 !==
|
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
|
-
|
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.
|
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].
|
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
|
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.
|
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);
|
@@ -2337,7 +2437,7 @@ Grid.prototype.removeRow = function(rowRef) {
|
|
2337
2437
|
if(this._mainGrid) {
|
2338
2438
|
return this._mainGrid.removeRow(this._getRowId(rowRef));
|
2339
2439
|
}
|
2340
|
-
var rowDef = this.
|
2440
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
2341
2441
|
if(rowDef) {
|
2342
2442
|
if(!rowDef.isAutoGenerated()) { // Users cannot remove auto-generated row by themselves
|
2343
2443
|
this._removeRow(rowDef);
|
@@ -2368,7 +2468,7 @@ Grid.prototype.removeRows = function(rowRefs) {
|
|
2368
2468
|
|
2369
2469
|
// Verify user input
|
2370
2470
|
for(i = 0; i < len; ++i) {
|
2371
|
-
rowDef = this.
|
2471
|
+
rowDef = this._getRowDefinitionByRef(rowRefs[i]);
|
2372
2472
|
if(rowDef) {
|
2373
2473
|
if(!rowDef.isAutoGenerated()) {
|
2374
2474
|
rowDefs.push(rowDef);
|
@@ -2504,7 +2604,7 @@ Grid.prototype.setRic = function(rowRef, str, options) {
|
|
2504
2604
|
this._mainGrid.setRic(this._toRowId(rowRef), str);
|
2505
2605
|
return;
|
2506
2606
|
}
|
2507
|
-
var rowDef = this.
|
2607
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
2508
2608
|
if(rowDef) {
|
2509
2609
|
options = options || {};
|
2510
2610
|
var newChain = false;
|
@@ -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.
|
2524
|
-
|
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);
|
@@ -2539,7 +2640,7 @@ Grid.prototype.setRic = function(rowRef, str, options) {
|
|
2539
2640
|
* @param {Grid~RowReference} rowRef
|
2540
2641
|
*/
|
2541
2642
|
Grid.prototype.unlinkChain = function(rowRef) {
|
2542
|
-
var rowDef = this.
|
2643
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
2543
2644
|
if(!rowDef) {
|
2544
2645
|
return;
|
2545
2646
|
}
|
@@ -2718,7 +2819,8 @@ Grid.prototype.getRowType = function(rowRef) {
|
|
2718
2819
|
var rowDef = this.getRowDefinition(rowRef);
|
2719
2820
|
return rowDef ? rowDef.getType() : "";
|
2720
2821
|
};
|
2721
|
-
/**
|
2822
|
+
/** Get RowDefinition object by either number or row id
|
2823
|
+
* @public
|
2722
2824
|
* @param {number|string} rowRef Row index as shown in the view or row id (string)
|
2723
2825
|
* @return {RowDefinition}
|
2724
2826
|
*/
|
@@ -2748,7 +2850,7 @@ Grid.prototype._getRowDefinitionById = function(rowId) {
|
|
2748
2850
|
* @param {Grid~RowReference} rowRef
|
2749
2851
|
* @return {RowDefinition}
|
2750
2852
|
*/
|
2751
|
-
Grid.prototype.
|
2853
|
+
Grid.prototype._getRowDefinitionByRef = function(rowRef) {
|
2752
2854
|
if(rowRef instanceof RowDefinition) {
|
2753
2855
|
if(rowRef.getRowId()) { // The row may have been removed from the grid
|
2754
2856
|
return /** @type{!RowDefinition} */(rowRef);
|
@@ -2841,7 +2943,7 @@ Grid.prototype.setRicData = function(ric, values) {
|
|
2841
2943
|
var rowCount = rowDefs ? rowDefs.length : 0;
|
2842
2944
|
for (var i = 0; i < rowCount; ++i) {
|
2843
2945
|
var rowDef = rowDefs[i];
|
2844
|
-
if (rowDef && rowDef.
|
2946
|
+
if (rowDef && rowDef.getSymbol() === ric) {
|
2845
2947
|
rowDef.setRowData(values); // TODO: Need conflator to improve performance
|
2846
2948
|
}
|
2847
2949
|
}
|
@@ -2852,7 +2954,7 @@ Grid.prototype.setRicData = function(ric, values) {
|
|
2852
2954
|
* @param {Object} values {"FIELD1": value1, "FIELD2": value2, ...} Use null to remove current row data (not row in the view).
|
2853
2955
|
*/
|
2854
2956
|
Grid.prototype.setRowData = function(rowRef, values) {
|
2855
|
-
var rowDef = this.
|
2957
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
2856
2958
|
if(rowDef) {
|
2857
2959
|
rowDef.setRowData(values);
|
2858
2960
|
}
|
@@ -2864,7 +2966,7 @@ Grid.prototype.setRowData = function(rowRef, values) {
|
|
2864
2966
|
* @param {Object} values
|
2865
2967
|
*/
|
2866
2968
|
Grid.prototype.setStaticRowData = function(rowRef, values) {
|
2867
|
-
var rowDef = this.
|
2969
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
2868
2970
|
if(rowDef) {
|
2869
2971
|
rowDef.setStaticRowData(values);
|
2870
2972
|
}
|
@@ -2877,7 +2979,7 @@ Grid.prototype.setStaticRowData = function(rowRef, values) {
|
|
2877
2979
|
* @param {*} value
|
2878
2980
|
*/
|
2879
2981
|
Grid.prototype.setStaticData = function(rowRef, field, value) {
|
2880
|
-
var rowDef = this.
|
2982
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
2881
2983
|
if(rowDef) {
|
2882
2984
|
rowDef.setStaticData(field, value);
|
2883
2985
|
}
|
@@ -3227,7 +3329,7 @@ Grid.prototype._onDataChanged = function(e) {
|
|
3227
3329
|
// The new data update has no row definition, meaning that we have found a new constituent from a chain.
|
3228
3330
|
var subId = rowData[SUB_ID]; // The constituent will share the same sub id as its parent
|
3229
3331
|
if(subId) {
|
3230
|
-
var parentDef = this.
|
3332
|
+
var parentDef = this._getRowDefinitionById(subId);
|
3231
3333
|
if(parentDef && parentDef.getRic() !== rowData["RIC"]) { // TODO: Check for delayed ric
|
3232
3334
|
if(!this._chainMembers) {
|
3233
3335
|
this._chainMembers = {};
|
@@ -3259,7 +3361,7 @@ Grid.prototype._addMemberOfChain = function(rowData) {
|
|
3259
3361
|
for(i = 0; i < len; ++i) {
|
3260
3362
|
rowData = /** @type{!Object} */(rows[i]);
|
3261
3363
|
var subId = rowData[SUB_ID];
|
3262
|
-
var parentDef = this.
|
3364
|
+
var parentDef = this._getRowDefinitionById(subId);
|
3263
3365
|
if(parentDef) {
|
3264
3366
|
var childDef = parentDef.addConstituent(/** @type{string} */(rowData["RIC"]), this._dt);
|
3265
3367
|
if(childDef) {
|
@@ -3405,7 +3507,7 @@ Grid.prototype.getPageCount = function() {
|
|
3405
3507
|
* @param {Grid~RowReference} rowRef
|
3406
3508
|
*/
|
3407
3509
|
Grid.prototype.toggleChain = function(rowRef) {
|
3408
|
-
var rowDef = this.
|
3510
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
3409
3511
|
if(rowDef) {
|
3410
3512
|
rowDef.toggleChain();
|
3411
3513
|
}
|
@@ -3417,7 +3519,7 @@ Grid.prototype.toggleChain = function(rowRef) {
|
|
3417
3519
|
* @return {boolean}
|
3418
3520
|
*/
|
3419
3521
|
Grid.prototype.setClassification = function(rowRef, fields) {
|
3420
|
-
var rowDef = this.
|
3522
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
3421
3523
|
if(rowDef) {
|
3422
3524
|
return this._dt.setSegmentClassification(rowDef.getRowId(), fields);
|
3423
3525
|
}
|
@@ -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
|
@@ -49,7 +50,7 @@ var ROW_TYPES = {
|
|
49
50
|
*/
|
50
51
|
var RowDefinition = function(rowOptions) {
|
51
52
|
this._changes = {};
|
52
|
-
if(rowOptions && rowOptions["segmentId"]) {
|
53
|
+
if(rowOptions && rowOptions["segmentId"]) { // This row will be classification header row
|
53
54
|
this._dataId = this._rowId = rowOptions["segmentId"];
|
54
55
|
this._autoGenerated = true;
|
55
56
|
this._subSegment = true;
|
@@ -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.
|
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
|
-
|
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.
|
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.
|
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.
|
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
|
@@ -37,6 +37,8 @@ declare class ColumnGroupingPlugin extends GridPlugin {
|
|
37
37
|
|
38
38
|
public getConfigObject(gridOptions?: any): any;
|
39
39
|
|
40
|
+
public renderGroups(): void;
|
41
|
+
|
40
42
|
public addColumnToGroup(column: any, groupId: string, colIndex: number): void;
|
41
43
|
|
42
44
|
public addGroup(groupDef: ColumnGroupingPlugin.GroupDefinition|null): string;
|
@@ -55,6 +57,8 @@ declare class ColumnGroupingPlugin extends GridPlugin {
|
|
55
57
|
|
56
58
|
public setGroupChildren(groupId: string, newChildList: (string)[]|null): boolean;
|
57
59
|
|
60
|
+
public setGroupName(groupId: string, groupName: string): void;
|
61
|
+
|
58
62
|
public getGroupChildren(groupId: string): (string)[]|null;
|
59
63
|
|
60
64
|
public getChildColumnIndices(groupId: string): (number)[]|null;
|