@refinitiv-ui/efx-grid 6.0.145 → 6.0.147
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 +2 -1
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/grid/Core.js +2 -1
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +140 -119
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.js +1 -1
- package/lib/tr-grid-util/es6/jet/DataGenerator.js +7 -2
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +35 -35
- package/lib/versions.json +1 -1
- package/package.json +1 -1
package/lib/rt-grid/es6/Grid.js
CHANGED
@@ -2354,7 +2354,7 @@ Grid.prototype._cloneChain = function(newRowDef) {
|
|
2354
2354
|
"subId": subId
|
2355
2355
|
};
|
2356
2356
|
for (let i = 0; i < count; i++) {
|
2357
|
-
let childRowDef = constituents[i];
|
2357
|
+
let childRowDef = constituents[i];
|
2358
2358
|
evtArg["ric"] = childRowDef.getRic();
|
2359
2359
|
evtArg["values"] = childRowDef.cloneRowData();
|
2360
2360
|
evtArg["values"]["SUB_ID"] = subId; // Imitate real-time service responses
|
@@ -61,6 +61,7 @@ let _fieldInfo = {
|
|
61
61
|
"PRCTCK_1": {type: "set", members: ["\u21e7", "B\u21e7", "\u2191", "B\u2191", "26", "1", "\"1\"", "-1", "\u21e9", "B\u21e9", "\u2193", "B\u2193", "27", "2", "\"2\""] },
|
62
62
|
"CF_NETCHNG": {type: "number", min: -100, max: 100},
|
63
63
|
"CF_VOLUME": {type: "number", min: 0, max: 1e7},
|
64
|
+
"CHILD_ORDER": {type: "set", ignore: true, members: [undefined]}, // eslint-disable-line
|
64
65
|
"RI_FLAG": {type: "set", members: ["R", "Q", "I", "_", ""]},
|
65
66
|
"RI_CODE": {type: "number", min: 0, max: 2},
|
66
67
|
"STATUS": {type: "number", min: 0, max: 6},
|
@@ -225,8 +226,12 @@ let randBoolean = function(seed) {
|
|
225
226
|
* @return {*}
|
226
227
|
*/
|
227
228
|
let randMember = function(set, seed) {
|
228
|
-
|
229
|
-
|
229
|
+
var len = set ? (set.length || 0) : 0;
|
230
|
+
if(len) {
|
231
|
+
if(len === 1) {
|
232
|
+
return set[0];
|
233
|
+
}
|
234
|
+
let index = randIndex(len, seed);
|
230
235
|
return set[index];
|
231
236
|
}
|
232
237
|
return String.fromCharCode(randInt(65, 90, seed));
|
@@ -588,48 +588,44 @@ MockSubscriptions.prototype._onSubscriptionResponse = function() {
|
|
588
588
|
// find key to random subs (key is subId)
|
589
589
|
let key = keys[this._dataGen.randIndex(len)]; // WARNING: Same sub could be picked more than once
|
590
590
|
let subs = this._dataMap.getItems(key); // Get all subs with the same RIC
|
591
|
+
let subCount = subs.length;
|
591
592
|
|
592
|
-
let
|
593
|
-
let
|
594
|
-
let subParent =
|
593
|
+
let j;
|
594
|
+
let firstSub = subs[0]; // Only the first sub is need to generate data
|
595
|
+
let subParent = firstSub.parent;
|
595
596
|
let updatePosition = this._dataGen.randInt(0, 100) < this._percentageOrderChange * 100 ? true : false; // Random chance to change dynamic chain position (2% to change)
|
596
597
|
|
597
|
-
|
598
|
+
let values = this._generateQuoteData(firstSub, fields);
|
599
|
+
if(_isDynamicChain(key) && subParent && updatePosition) { // subParent in header of dynamic chain behaves like a normal ric
|
598
600
|
let children = subParent.children;
|
601
|
+
let childCount = children.length;
|
599
602
|
|
600
603
|
children = _shuffleArray(children); // Random swap children in array
|
601
|
-
let
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
for (let k = 0; k <
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
} else {
|
615
|
-
let currentChild = child["CHILD_ORDER"];
|
616
|
-
this._dispatchDataChanged(child, {
|
617
|
-
X_RIC_NAME: child.ric,
|
618
|
-
CHILD_ORDER: currentChild
|
604
|
+
let newOrder = children.indexOf(firstSub);
|
605
|
+
firstSub["CHILD_ORDER"] = newOrder; // This is bad
|
606
|
+
values["CHILD_ORDER"] = newOrder;
|
607
|
+
|
608
|
+
childOrderChange = true;
|
609
|
+
for(j = 0; j < subCount; ++j) { // It could be same ric and it need to dispatch with same ric number
|
610
|
+
this._dispatchDataChanged(subs[j], values);
|
611
|
+
// Update child order for all children with the same parent
|
612
|
+
for (let k = 0; k < childCount; k++) { // This is not correct, if there is a duplicate dynamic chain
|
613
|
+
if(k !== newOrder) {
|
614
|
+
this._dispatchDataChanged(children[k], {
|
615
|
+
X_RIC_NAME: children[k].ric,
|
616
|
+
CHILD_ORDER: k
|
619
617
|
});
|
620
618
|
}
|
621
619
|
}
|
622
|
-
childOrderChange = true;
|
623
620
|
}
|
624
|
-
|
625
621
|
} else {
|
626
|
-
|
627
|
-
|
628
|
-
for(j = 0; j < jLen; ++j) { // It could be same ric and it need to dispatch with same ric number
|
629
|
-
let childOrder = subs[j]["CHILD_ORDER"];
|
622
|
+
if(subCount > 1) { // Duplicate CHILD_ORDER from the first sub for other sub with the same RIC (not entirely correct)
|
623
|
+
let childOrder = firstSub["CHILD_ORDER"];
|
630
624
|
if(childOrder != null) { // Children of chain will have a CHILD_ORDER
|
631
625
|
values["CHILD_ORDER"] = childOrder;
|
632
626
|
}
|
627
|
+
}
|
628
|
+
for(j = 0; j < subCount; ++j) { // It could be same ric and it need to dispatch with same ric number
|
633
629
|
this._dispatchDataChanged(subs[j], values);
|
634
630
|
updateCount++;
|
635
631
|
}
|
@@ -672,20 +668,24 @@ MockSubscriptions.prototype._generateQuoteData = function(sub, fields) {
|
|
672
668
|
prefix: sub["parent"] ? sub["parent"]["ric"] : "" // prefix for constituents
|
673
669
|
};
|
674
670
|
for(let field in fields){
|
675
|
-
let
|
671
|
+
let fInfo = this._dataGen.generateQuoteData(field, options);
|
672
|
+
if(fInfo.ignore) {
|
673
|
+
continue;
|
674
|
+
}
|
675
|
+
|
676
676
|
let formattedField = field + "_FORMATTED";
|
677
677
|
if(prevData) {
|
678
|
-
if(
|
679
|
-
if(prevData[field] ===
|
678
|
+
if(fInfo.changeOnly) {
|
679
|
+
if(prevData[field] === fInfo.value) {
|
680
680
|
continue;
|
681
681
|
}
|
682
682
|
}
|
683
|
-
prevData[field] =
|
684
|
-
prevData[formattedField] =
|
683
|
+
prevData[field] = fInfo.value;
|
684
|
+
prevData[formattedField] = fInfo.formattedValue;
|
685
685
|
}
|
686
686
|
|
687
|
-
values[field] =
|
688
|
-
values[formattedField] =
|
687
|
+
values[field] = fInfo.value;
|
688
|
+
values[formattedField] = fInfo.formattedValue;
|
689
689
|
}
|
690
690
|
|
691
691
|
// The delay symbol for X_RIC_NAME will depend on the INDICATOR field.
|
package/lib/versions.json
CHANGED
package/package.json
CHANGED