@refinitiv-ui/efx-grid 6.0.102 → 6.0.104
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 +14 -137
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataCache.d.ts +0 -8
- package/lib/core/es6/data/DataCache.js +13 -136
- package/lib/core/es6/grid/Core.js +1 -1
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +21 -21
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/FieldDefinition.d.ts +1 -1
- package/lib/rt-grid/es6/FieldDefinition.js +21 -21
- package/lib/types/es6/Core/data/DataCache.d.ts +0 -12
- package/lib/types/es6/Core/data/WrappedView.d.ts +1 -0
- package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +1 -1
- package/package.json +3 -2
@@ -49,14 +49,6 @@ declare class DataCache extends EventDispatcher {
|
|
49
49
|
|
50
50
|
public cloneRowData(rid: string): any;
|
51
51
|
|
52
|
-
public addStaticFields(fields: (string)[]|null): void;
|
53
|
-
|
54
|
-
public removeStaticFields(fields: (string)[]|null): void;
|
55
|
-
|
56
|
-
public resetStaticFields(): void;
|
57
|
-
|
58
|
-
public getStaticFields(): { [key: string]: number }|null;
|
59
|
-
|
60
52
|
public dump(options?: any): (any)[];
|
61
53
|
|
62
54
|
public log(opt_options?: any): void;
|
@@ -24,7 +24,6 @@ let DataCache = function () {
|
|
24
24
|
|
25
25
|
_t._rows = {};
|
26
26
|
_t._subs = {};
|
27
|
-
_t._staticFields = {};
|
28
27
|
_t._onInsert = _t._onInsert.bind(_t);
|
29
28
|
_t._onUpdate = _t._onUpdate.bind(_t);
|
30
29
|
_t._onDelete = _t._onDelete.bind(_t);
|
@@ -460,64 +459,34 @@ DataCache.prototype.cloneRowData = function (rid) {
|
|
460
459
|
return values;
|
461
460
|
};
|
462
461
|
|
463
|
-
/**
|
464
|
-
* Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
462
|
+
/** Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
465
463
|
* @public
|
466
|
-
* @
|
464
|
+
* @ignore
|
467
465
|
* @suppress {checkTypes}
|
468
466
|
*/
|
469
|
-
DataCache.prototype.addStaticFields = function (
|
470
|
-
if (!Array.isArray(fields)) {
|
471
|
-
return;
|
472
|
-
}
|
473
|
-
|
474
|
-
for (let i in fields) {
|
475
|
-
if (!this._staticFields[fields[i]]) {
|
476
|
-
this._staticFields[fields[i]] = 1;
|
477
|
-
} else {
|
478
|
-
this._staticFields[fields[i]]++;
|
479
|
-
}
|
480
|
-
}
|
481
|
-
};
|
467
|
+
DataCache.prototype.addStaticFields = function () {};
|
482
468
|
|
483
469
|
/**
|
484
470
|
* Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
485
471
|
* @public
|
486
|
-
* @
|
472
|
+
* @ignore
|
487
473
|
* @suppress {checkTypes}
|
488
474
|
*/
|
489
|
-
DataCache.prototype.removeStaticFields = function (
|
490
|
-
if (!Array.isArray(fields)) {
|
491
|
-
return;
|
492
|
-
}
|
493
|
-
|
494
|
-
for (let i in fields) {
|
495
|
-
if (this._staticFields[fields[i]]) {
|
496
|
-
this._staticFields[fields[i]]--;
|
497
|
-
|
498
|
-
if (this._staticFields[fields[i]] === 0) {
|
499
|
-
delete this._staticFields[fields[i]];
|
500
|
-
}
|
501
|
-
}
|
502
|
-
}
|
503
|
-
};
|
475
|
+
DataCache.prototype.removeStaticFields = function () {};
|
504
476
|
|
505
477
|
/**
|
506
478
|
* Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
507
479
|
* @public
|
480
|
+
* @ignore
|
508
481
|
*/
|
509
|
-
DataCache.prototype.resetStaticFields = function () {
|
510
|
-
this._staticFields = {};
|
511
|
-
};
|
482
|
+
DataCache.prototype.resetStaticFields = function () {};
|
512
483
|
|
513
484
|
/**
|
514
485
|
* Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
515
486
|
* @public
|
516
|
-
* @
|
487
|
+
* @ignore
|
517
488
|
*/
|
518
|
-
DataCache.prototype.getStaticFields = function () {
|
519
|
-
return this._staticFields;
|
520
|
-
};
|
489
|
+
DataCache.prototype.getStaticFields = function () {};
|
521
490
|
|
522
491
|
/**
|
523
492
|
* Construct a JSON object that is compatible with console.table()
|
@@ -784,29 +753,15 @@ DataCache.prototype._onQ2DataChanged = function (e) {
|
|
784
753
|
*/
|
785
754
|
DataCache.prototype._onQ2SubAdded = function (e) {
|
786
755
|
let subs = e["subs"];
|
787
|
-
let duplicateSubIds = e["duplicateSubIds"];
|
788
756
|
let len = subs.length;
|
789
757
|
|
790
758
|
for (let i = 0; i < len; ++i) {
|
791
759
|
let sub = subs[i];
|
792
|
-
let ric = sub["ric"];
|
793
760
|
|
794
761
|
// chain subId fires twice, one with "_ci_" and one without "_ci_"
|
795
762
|
// the subId with "_ci_" should be ignore
|
796
|
-
if(sub["id"].indexOf("_ci_")
|
797
|
-
|
798
|
-
}
|
799
|
-
|
800
|
-
this.addSubscription(sub, ric);
|
801
|
-
|
802
|
-
if (duplicateSubIds) { // There will be no network request for duplicate subs, and hence we need to update the data from our cache
|
803
|
-
let dupSubId = duplicateSubIds[i];
|
804
|
-
|
805
|
-
if (dupSubId) {
|
806
|
-
window.setTimeout(
|
807
|
-
this._onDuplicateRic.bind(this, sub["id"], this.getRowData(dupSubId + ric)),
|
808
|
-
10);
|
809
|
-
}
|
763
|
+
if(sub["id"].indexOf("_ci_") < 0){
|
764
|
+
this.addSubscription(sub, sub["ric"]);
|
810
765
|
}
|
811
766
|
}
|
812
767
|
};
|
@@ -824,48 +779,8 @@ DataCache.prototype._onQ2SubRemoved = function (e) {
|
|
824
779
|
|
825
780
|
// chain subId fires twice, one with "_ci_" and one without "_ci_"
|
826
781
|
// the subId with "_ci_" should be ignore
|
827
|
-
if(sub["id"].indexOf("_ci_")
|
828
|
-
|
829
|
-
}
|
830
|
-
|
831
|
-
this.removeSubscription(sub);
|
832
|
-
}
|
833
|
-
};
|
834
|
-
|
835
|
-
/**
|
836
|
-
* @private
|
837
|
-
* @param {string} subId
|
838
|
-
* @param {Object.<string, *>} dupData
|
839
|
-
*/
|
840
|
-
DataCache.prototype._onDuplicateRic = function (subId, dupData) {
|
841
|
-
let sub = this._subs[subId];
|
842
|
-
|
843
|
-
if (!sub) {
|
844
|
-
return;
|
845
|
-
}
|
846
|
-
|
847
|
-
sub = sub["s"]; // Quotes2' subscription
|
848
|
-
|
849
|
-
let ric = sub["ric"];
|
850
|
-
let dupSubId = /** @type{string} */(dupData["SUB_ID"]);
|
851
|
-
let values = this._cloneRowData(dupData, ric, subId);
|
852
|
-
|
853
|
-
if (!values) {
|
854
|
-
return;
|
855
|
-
}
|
856
|
-
|
857
|
-
this._onInsert(sub, ric, values);
|
858
|
-
|
859
|
-
let children = sub["children"];
|
860
|
-
|
861
|
-
if (children) {
|
862
|
-
let childCount = children.length;
|
863
|
-
|
864
|
-
for (let i = 0; i < childCount; ++i) {
|
865
|
-
ric = children[i];
|
866
|
-
values = this._cloneRowData(dupSubId, ric, subId);
|
867
|
-
|
868
|
-
this._onInsert(sub, ric, values);
|
782
|
+
if(sub["id"].indexOf("_ci_") < 0){
|
783
|
+
this.removeSubscription(sub);
|
869
784
|
}
|
870
785
|
}
|
871
786
|
};
|
@@ -906,38 +821,6 @@ DataCache.prototype._onDelete = function (sub, ric, values/*, rowN*/) {
|
|
906
821
|
this.setRowData(sub["id"] + ric, null, {"subscription": sub, "ric": ric});
|
907
822
|
};
|
908
823
|
|
909
|
-
/**
|
910
|
-
* @private
|
911
|
-
* @param {string|Object.<string, *>} obj
|
912
|
-
* @param {string} ric
|
913
|
-
* @param {string} newSubId
|
914
|
-
* @return {Object}
|
915
|
-
*/
|
916
|
-
DataCache.prototype._cloneRowData = function (obj, ric, newSubId) {
|
917
|
-
let subId = (typeof obj === "string") ? obj : obj["SUB_ID"];
|
918
|
-
let fields = this._rows[subId + ric];
|
919
|
-
|
920
|
-
if (!fields) { // The specified row has been removed
|
921
|
-
if (typeof obj === "object") {
|
922
|
-
fields = obj;
|
923
|
-
} else {
|
924
|
-
return null;
|
925
|
-
}
|
926
|
-
}
|
927
|
-
|
928
|
-
let values = {};
|
929
|
-
|
930
|
-
for (let key in fields) {
|
931
|
-
if (this._staticFields[key] == null) { // Static field must not be cloned
|
932
|
-
values[key] = fields[key];
|
933
|
-
}
|
934
|
-
}
|
935
|
-
|
936
|
-
values["SUB_ID"] = newSubId;
|
937
|
-
|
938
|
-
return values;
|
939
|
-
};
|
940
|
-
|
941
824
|
/** @protected
|
942
825
|
* @ignore
|
943
826
|
* @type {!Object.<string, Object>}
|
@@ -956,12 +839,6 @@ DataCache.prototype._subs;
|
|
956
839
|
*/
|
957
840
|
DataCache.prototype._quotes2 = null;
|
958
841
|
|
959
|
-
/**
|
960
|
-
* @private
|
961
|
-
* @type {Object.<string, number>}
|
962
|
-
*/
|
963
|
-
DataCache.prototype._staticFields = null;
|
964
|
-
|
965
842
|
/** @protected
|
966
843
|
* @ignore
|
967
844
|
* @type {boolean}
|
package/lib/grid/index.js
CHANGED
@@ -14670,13 +14670,28 @@ RowDefinition.dispose = function(rowDef) {
|
|
14670
14670
|
|
14671
14671
|
/** @type {string}
|
14672
14672
|
* @private
|
14673
|
-
* @
|
14673
|
+
* @constant
|
14674
14674
|
*/
|
14675
14675
|
const SYNAPSE_URL =
|
14676
14676
|
"/synapse/service/suggestions/suggest/?"
|
14677
14677
|
+ "hits=1" // search only 1 result
|
14678
14678
|
+ "&profile=" + encodeURIComponent("Field Selector");
|
14679
14679
|
|
14680
|
+
/** @type {!RegExp}
|
14681
|
+
* @private
|
14682
|
+
* @constant
|
14683
|
+
* @description
|
14684
|
+
* ^TR. => start with TR.
|
14685
|
+
* [\w]+ => any field with string and value
|
14686
|
+
* [\(] => open bucket (
|
14687
|
+
* [\w\-\=\,]* => any property name and follow by = EX. SDATE=2011-11-11, PRIOD=123123
|
14688
|
+
* (?:EDATE|SDATE) => non-capturing group match EDATE or SDATE
|
14689
|
+
* [\w\-\=\,]+ => another propertie param
|
14690
|
+
* [\)]$ => end with only )
|
14691
|
+
* i => for match both upper and lower cases
|
14692
|
+
*/
|
14693
|
+
const TimeSeriesRegEx = /^TR\.[\w]+\([\w\-\=\,]*(?:EDATE|SDATE)\=+[\w\-\=\,]*[ \w]*\)$/i;
|
14694
|
+
|
14680
14695
|
/* @namespace */
|
14681
14696
|
let FieldDefinition = {};
|
14682
14697
|
|
@@ -14855,10 +14870,10 @@ FieldDefinition.hasFieldInfo = function(field) {
|
|
14855
14870
|
/** @public
|
14856
14871
|
* @function
|
14857
14872
|
* @param {string} field
|
14858
|
-
* @return {
|
14873
|
+
* @return {Array}
|
14859
14874
|
*/
|
14860
14875
|
FieldDefinition.getTimeSeriesChildren = function(field) {
|
14861
|
-
return FieldDefinition._timeSeriesChildren[field];
|
14876
|
+
return FieldDefinition._timeSeriesChildren[field] || null;
|
14862
14877
|
};
|
14863
14878
|
/** @public
|
14864
14879
|
* @function
|
@@ -14919,7 +14934,7 @@ FieldDefinition.isRealTimeField = function(field) {
|
|
14919
14934
|
return false;
|
14920
14935
|
}
|
14921
14936
|
|
14922
|
-
if(FieldDefinition.isAdc(field)) {
|
14937
|
+
if(FieldDefinition.isAdc(field)) { // Note that all TimeSeries fields are ADC field
|
14923
14938
|
return false;
|
14924
14939
|
}
|
14925
14940
|
|
@@ -14931,10 +14946,6 @@ FieldDefinition.isRealTimeField = function(field) {
|
|
14931
14946
|
return false;
|
14932
14947
|
}
|
14933
14948
|
|
14934
|
-
if(FieldDefinition.isTimeSeries(field)) {
|
14935
|
-
return false;
|
14936
|
-
}
|
14937
|
-
|
14938
14949
|
return FieldDefinition.getFieldProperty(field, "IsRealtimeField") !== false;
|
14939
14950
|
};
|
14940
14951
|
|
@@ -14963,21 +14974,10 @@ FieldDefinition.isTimeSeries = function (field) {
|
|
14963
14974
|
// We can check time series using a cache to avoid duplicating checks in regular expressions.
|
14964
14975
|
let timeSeriesField = FieldDefinition.getFieldProperty(field, "timeSeries");
|
14965
14976
|
if (timeSeriesField != null) {
|
14966
|
-
return timeSeriesField;
|
14977
|
+
return timeSeriesField ? true : false;
|
14967
14978
|
}
|
14968
14979
|
|
14969
|
-
|
14970
|
-
^TR. => start with TR.
|
14971
|
-
[\w]+ => any field with string and value
|
14972
|
-
[\(] => open bucket (
|
14973
|
-
[\w\-\=\,]* => any property name and follow by = EX. SDATE=2011-11-11, PRIOD=123123
|
14974
|
-
(?:EDATE|SDATE ) => non-capturing group match EDATE or SDATE
|
14975
|
-
[\w\-\=\,]+ => another propertie param
|
14976
|
-
[\)]$ => end with only )
|
14977
|
-
i => for match both upper and lower cases
|
14978
|
-
*/
|
14979
|
-
let timeSeriesRegex = /^TR\.[\w]+\([\w\-\=\,]*(?:EDATE|SDATE)\=+[\w\-\=\,]*[ \w]*\)$/i;
|
14980
|
-
return timeSeriesRegex.test(field);
|
14980
|
+
return TimeSeriesRegEx.test(field);
|
14981
14981
|
};
|
14982
14982
|
|
14983
14983
|
/**
|