@refinitiv-ui/efx-grid 6.0.103 → 6.0.105
Sign up to get free protection for your applications and to get access to all the features.
- 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 +356 -734
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/FieldDefinition.js +4 -4
- package/lib/rt-grid/es6/Grid.d.ts +1 -1
- package/lib/rt-grid/es6/Grid.js +8 -49
- package/lib/rt-grid/es6/RowDefinition.d.ts +5 -3
- package/lib/rt-grid/es6/RowDefinition.js +49 -20
- package/lib/tr-grid-column-fitter/es6/ColumnFitter.js +523 -708
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.d.ts +16 -16
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.js +131 -109
- package/lib/types/es6/ColumnResizing.d.ts +16 -16
- package/lib/types/es6/Core/data/DataCache.d.ts +0 -8
- package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +1 -1
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +1 -1
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +5 -3
- package/lib/versions.json +2 -2
- package/package.json +3 -2
@@ -8474,18 +8474,14 @@ EventDispatcher_EventDispatcher._proto = EventDispatcher_EventDispatcher.prototy
|
|
8474
8474
|
* @constructor
|
8475
8475
|
* @extends {EventDispatcher}
|
8476
8476
|
*/
|
8477
|
-
let
|
8477
|
+
let DataCache = function () {
|
8478
8478
|
let _t = this;
|
8479
8479
|
|
8480
8480
|
_t._rows = {};
|
8481
8481
|
_t._subs = {};
|
8482
|
-
_t._staticFields = {};
|
8483
8482
|
_t._onInsert = _t._onInsert.bind(_t);
|
8484
8483
|
_t._onUpdate = _t._onUpdate.bind(_t);
|
8485
8484
|
_t._onDelete = _t._onDelete.bind(_t);
|
8486
|
-
_t._onBatchRequestADCData = _t._onBatchRequestADCData.bind(_t);
|
8487
|
-
_t._onADCUpdate = _t._onADCUpdate.bind(_t);
|
8488
|
-
_t._onADCError = _t._onADCError.bind(_t);
|
8489
8485
|
_t._onQ2DataChanged = _t._onQ2DataChanged.bind(_t);
|
8490
8486
|
_t._onQ2SubAdded = _t._onQ2SubAdded.bind(_t);
|
8491
8487
|
_t._onQ2SubRemoved = _t._onQ2SubRemoved.bind(_t);
|
@@ -8493,13 +8489,13 @@ let DataCache_DataCache = function () {
|
|
8493
8489
|
_t._addEvent("dataComposed");
|
8494
8490
|
_t._addEvent("dataChanged");
|
8495
8491
|
};
|
8496
|
-
es6_Ext.inherits(
|
8492
|
+
es6_Ext.inherits(DataCache, event_EventDispatcher);
|
8497
8493
|
|
8498
8494
|
//#region Public
|
8499
8495
|
/**
|
8500
8496
|
* @public
|
8501
8497
|
*/
|
8502
|
-
|
8498
|
+
DataCache.prototype.dispose = function () {
|
8503
8499
|
this.unlistenAll();
|
8504
8500
|
this.clearAllData(true);
|
8505
8501
|
this._quotes2 = null;
|
@@ -8510,7 +8506,7 @@ DataCache_DataCache.prototype.dispose = function () {
|
|
8510
8506
|
* @public
|
8511
8507
|
* @param {Object} subs Subscriptions object from JET.Quotes2
|
8512
8508
|
*/
|
8513
|
-
|
8509
|
+
DataCache.prototype.setSubscriptions = function (subs) {
|
8514
8510
|
if (this._quotes2) {
|
8515
8511
|
this._quotes2["removeEventListener"]("dataChanged", this._onQ2DataChanged);
|
8516
8512
|
this._quotes2["removeEventListener"]("subscriptionAdded", this._onQ2SubAdded);
|
@@ -8532,7 +8528,7 @@ DataCache_DataCache.prototype.setSubscriptions = function (subs) {
|
|
8532
8528
|
* @public
|
8533
8529
|
* @return {Object} subs Subscriptions object from JET.Quotes2
|
8534
8530
|
*/
|
8535
|
-
|
8531
|
+
DataCache.prototype.getSubscriptions = function () {
|
8536
8532
|
return this._quotes2;
|
8537
8533
|
};
|
8538
8534
|
|
@@ -8544,7 +8540,7 @@ DataCache_DataCache.prototype.getSubscriptions = function () {
|
|
8544
8540
|
* object does not provide a way to access its data
|
8545
8541
|
* @param {Object=} opt_values Initial values
|
8546
8542
|
*/
|
8547
|
-
|
8543
|
+
DataCache.prototype.addSubscription = function (sub, opt_primaryRic, opt_values) {
|
8548
8544
|
if (this.getSubscription(sub["id"])) {
|
8549
8545
|
return;
|
8550
8546
|
}
|
@@ -8575,7 +8571,7 @@ DataCache_DataCache.prototype.addSubscription = function (sub, opt_primaryRic, o
|
|
8575
8571
|
* @public
|
8576
8572
|
* @param {Object} sub Subscription object from JET.Quote
|
8577
8573
|
*/
|
8578
|
-
|
8574
|
+
DataCache.prototype.removeSubscription = function (sub) { // All RICs associated to the subscription are removed
|
8579
8575
|
let subId = sub["id"];
|
8580
8576
|
|
8581
8577
|
if (!sub || !this._subs[subId]) {
|
@@ -8599,7 +8595,7 @@ DataCache_DataCache.prototype.removeSubscription = function (sub) { // All RICs
|
|
8599
8595
|
* Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
8600
8596
|
* @public
|
8601
8597
|
*/
|
8602
|
-
|
8598
|
+
DataCache.prototype.startAllSubscriptions = function () {
|
8603
8599
|
if (this._quotes2) {
|
8604
8600
|
this._quotes2["start"]();
|
8605
8601
|
} else {
|
@@ -8613,7 +8609,7 @@ DataCache_DataCache.prototype.startAllSubscriptions = function () {
|
|
8613
8609
|
* Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
8614
8610
|
* @public
|
8615
8611
|
*/
|
8616
|
-
|
8612
|
+
DataCache.prototype.stopAllSubscriptions = function () {
|
8617
8613
|
if (this._quotes2) {
|
8618
8614
|
this._quotes2["stop"]();
|
8619
8615
|
} else {
|
@@ -8628,7 +8624,7 @@ DataCache_DataCache.prototype.stopAllSubscriptions = function () {
|
|
8628
8624
|
* @param {string} sub_id
|
8629
8625
|
* @return {Object} Subscription object from JET.Quote
|
8630
8626
|
*/
|
8631
|
-
|
8627
|
+
DataCache.prototype.getSubscription = function (sub_id) {
|
8632
8628
|
return (this._subs[sub_id]) ? this._subs[sub_id]["s"] : null;
|
8633
8629
|
};
|
8634
8630
|
|
@@ -8637,7 +8633,7 @@ DataCache_DataCache.prototype.getSubscription = function (sub_id) {
|
|
8637
8633
|
* @param {string} sub_id
|
8638
8634
|
* @return {string} ric that has been input when calling addSubscription
|
8639
8635
|
*/
|
8640
|
-
|
8636
|
+
DataCache.prototype.getPrimaryRic = function (sub_id) {
|
8641
8637
|
let subDef = this._subs[sub_id];
|
8642
8638
|
if (subDef) {
|
8643
8639
|
return subDef["primary"];
|
@@ -8650,7 +8646,7 @@ DataCache_DataCache.prototype.getPrimaryRic = function (sub_id) {
|
|
8650
8646
|
* @param {boolean=} opt_suppressEvent
|
8651
8647
|
* @fires DataCache#dataChanged
|
8652
8648
|
*/
|
8653
|
-
|
8649
|
+
DataCache.prototype.clearAllData = function (opt_suppressEvent) { // All subscriptions are also removed
|
8654
8650
|
if (this._quotes2) {
|
8655
8651
|
this._quotes2["removeAllSubscriptions"]();
|
8656
8652
|
} else {
|
@@ -8660,13 +8656,6 @@ DataCache_DataCache.prototype.clearAllData = function (opt_suppressEvent) { // A
|
|
8660
8656
|
this._subs = {};
|
8661
8657
|
this._rows = {};
|
8662
8658
|
|
8663
|
-
if (this._adcTimerId >= 0) {
|
8664
|
-
clearTimeout(this._adcTimerId);
|
8665
|
-
this._adcTimerId = -1;
|
8666
|
-
}
|
8667
|
-
|
8668
|
-
this._adcRicMap = null;
|
8669
|
-
|
8670
8659
|
if (!opt_suppressEvent) {
|
8671
8660
|
this._dispatchDataChange({"globalChange": true});
|
8672
8661
|
}
|
@@ -8678,7 +8667,7 @@ DataCache_DataCache.prototype.clearAllData = function (opt_suppressEvent) { // A
|
|
8678
8667
|
* @param {boolean=} opt_suppressEvent
|
8679
8668
|
* @fires DataCache#dataChanged
|
8680
8669
|
*/
|
8681
|
-
|
8670
|
+
DataCache.prototype.clearColumnData = function (colId, opt_suppressEvent) {
|
8682
8671
|
let cids = (typeof colId === "string") ? [/** @type {string} */(colId)] : /** @type {Array.<string>} */(colId);
|
8683
8672
|
|
8684
8673
|
for (let i = cids.length; --i >= 0;) {
|
@@ -8702,7 +8691,7 @@ DataCache_DataCache.prototype.clearColumnData = function (colId, opt_suppressEve
|
|
8702
8691
|
* @param {string} cid
|
8703
8692
|
* @return {*}
|
8704
8693
|
*/
|
8705
|
-
|
8694
|
+
DataCache.prototype.getData = function (rid, cid) {
|
8706
8695
|
let row = this.getRowData(rid);
|
8707
8696
|
|
8708
8697
|
return (row) ? row[cid] : null;
|
@@ -8713,7 +8702,7 @@ DataCache_DataCache.prototype.getData = function (rid, cid) {
|
|
8713
8702
|
* @public
|
8714
8703
|
* @return {Object.<string, Array.<string>>} Map of Array of subscription object
|
8715
8704
|
*/
|
8716
|
-
|
8705
|
+
DataCache.prototype.getAllRics = function () { // Slow
|
8717
8706
|
let ricMap = {};
|
8718
8707
|
|
8719
8708
|
for (let subId in this._subs) {
|
@@ -8735,7 +8724,7 @@ DataCache_DataCache.prototype.getAllRics = function () { // Slow
|
|
8735
8724
|
* @public
|
8736
8725
|
* @return {Array.<string>}
|
8737
8726
|
*/
|
8738
|
-
|
8727
|
+
DataCache.prototype.getAllRowIds = function () {
|
8739
8728
|
let rids = [];
|
8740
8729
|
|
8741
8730
|
for (let rid in this._rows) {
|
@@ -8750,7 +8739,7 @@ DataCache_DataCache.prototype.getAllRowIds = function () {
|
|
8750
8739
|
* @param {string} rid ID of a row to be checked for its presence.
|
8751
8740
|
* @return {boolean} `true` if row was found, `false` if row was not found.
|
8752
8741
|
*/
|
8753
|
-
|
8742
|
+
DataCache.prototype.hasRowId = function (rid) {
|
8754
8743
|
return !!this._rows[rid];
|
8755
8744
|
};
|
8756
8745
|
|
@@ -8759,7 +8748,7 @@ DataCache_DataCache.prototype.hasRowId = function (rid) {
|
|
8759
8748
|
* @param {string} cid
|
8760
8749
|
* @return {!Array.<*>}
|
8761
8750
|
*/
|
8762
|
-
|
8751
|
+
DataCache.prototype.getColumnData = function (cid) {
|
8763
8752
|
let fieldRows = [];
|
8764
8753
|
|
8765
8754
|
for (let rid in this._rows) {
|
@@ -8774,7 +8763,7 @@ DataCache_DataCache.prototype.getColumnData = function (cid) {
|
|
8774
8763
|
* @param {string} rid
|
8775
8764
|
* @return {Object.<string, *>}
|
8776
8765
|
*/
|
8777
|
-
|
8766
|
+
DataCache.prototype.getRowData = function (rid) {
|
8778
8767
|
return this._rows[rid] || null;
|
8779
8768
|
};
|
8780
8769
|
|
@@ -8785,7 +8774,7 @@ DataCache_DataCache.prototype.getRowData = function (rid) {
|
|
8785
8774
|
* @param {number=} opt_to EXCLUSIVE
|
8786
8775
|
* @return {!Array.<Object>}
|
8787
8776
|
*/
|
8788
|
-
|
8777
|
+
DataCache.prototype.getMultipleRowData = function (rids, opt_from, opt_to) {
|
8789
8778
|
let len = rids.length;
|
8790
8779
|
|
8791
8780
|
if (opt_to == null) {
|
@@ -8814,7 +8803,7 @@ DataCache_DataCache.prototype.getMultipleRowData = function (rids, opt_from, opt
|
|
8814
8803
|
* @public
|
8815
8804
|
* @return {!Array.<Object.<string, *>>}
|
8816
8805
|
*/
|
8817
|
-
|
8806
|
+
DataCache.prototype.getAllRowData = function () {
|
8818
8807
|
let rows = [];
|
8819
8808
|
let rowMap = this._rows;
|
8820
8809
|
|
@@ -8833,7 +8822,7 @@ DataCache_DataCache.prototype.getAllRowData = function () {
|
|
8833
8822
|
* @return {boolean} Return true if there is any change, and false otherwise
|
8834
8823
|
* @fires DataCache#dataChanged
|
8835
8824
|
*/
|
8836
|
-
|
8825
|
+
DataCache.prototype.setData = function (rid, cid, value) { // Data changed event is always dispatched
|
8837
8826
|
let values = {};
|
8838
8827
|
|
8839
8828
|
values[cid] = value;
|
@@ -8843,30 +8832,10 @@ DataCache_DataCache.prototype.setData = function (rid, cid, value) { // Data cha
|
|
8843
8832
|
|
8844
8833
|
/**
|
8845
8834
|
* @public
|
8835
|
+
* @ignore
|
8846
8836
|
* @param {string} rid
|
8847
|
-
* @return {boolean}
|
8848
8837
|
*/
|
8849
|
-
|
8850
|
-
if (!this._adcFields) {
|
8851
|
-
return false;
|
8852
|
-
}
|
8853
|
-
|
8854
|
-
let row = this.getRowData(rid);
|
8855
|
-
|
8856
|
-
if (!row) {
|
8857
|
-
return false;
|
8858
|
-
}
|
8859
|
-
|
8860
|
-
for (let i = this._adcFields.length; --i >= 0;) {
|
8861
|
-
let data = row[this._adcFields[i]];
|
8862
|
-
|
8863
|
-
if (data != null) {
|
8864
|
-
return true;
|
8865
|
-
}
|
8866
|
-
}
|
8867
|
-
|
8868
|
-
return false;
|
8869
|
-
};
|
8838
|
+
DataCache.prototype.hasDataCloudData = function (rid) {};
|
8870
8839
|
|
8871
8840
|
/**
|
8872
8841
|
* @public
|
@@ -8876,7 +8845,7 @@ DataCache_DataCache.prototype.hasDataCloudData = function (rid) {
|
|
8876
8845
|
* @return {boolean} Return true if there is any change, and false otherwise
|
8877
8846
|
* @fires DataCache#dataChanged
|
8878
8847
|
*/
|
8879
|
-
|
8848
|
+
DataCache.prototype.setRowData = function (rid, values, opt_eventArg) { // Data changed event is always dispatched
|
8880
8849
|
let row = this.getRowData(rid);
|
8881
8850
|
let dirty = false;
|
8882
8851
|
let changes = null;
|
@@ -8925,7 +8894,7 @@ DataCache_DataCache.prototype.setRowData = function (rid, values, opt_eventArg)
|
|
8925
8894
|
* @param {string} rid
|
8926
8895
|
* @return {Object}
|
8927
8896
|
*/
|
8928
|
-
|
8897
|
+
DataCache.prototype.cloneRowData = function (rid) {
|
8929
8898
|
let fields = this._rows[rid];
|
8930
8899
|
|
8931
8900
|
if (!fields) {
|
@@ -8945,64 +8914,34 @@ DataCache_DataCache.prototype.cloneRowData = function (rid) {
|
|
8945
8914
|
return values;
|
8946
8915
|
};
|
8947
8916
|
|
8948
|
-
/**
|
8949
|
-
* Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
8917
|
+
/** Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
8950
8918
|
* @public
|
8951
|
-
* @
|
8919
|
+
* @ignore
|
8952
8920
|
* @suppress {checkTypes}
|
8953
8921
|
*/
|
8954
|
-
|
8955
|
-
if (!Array.isArray(fields)) {
|
8956
|
-
return;
|
8957
|
-
}
|
8958
|
-
|
8959
|
-
for (let i in fields) {
|
8960
|
-
if (!this._staticFields[fields[i]]) {
|
8961
|
-
this._staticFields[fields[i]] = 1;
|
8962
|
-
} else {
|
8963
|
-
this._staticFields[fields[i]]++;
|
8964
|
-
}
|
8965
|
-
}
|
8966
|
-
};
|
8922
|
+
DataCache.prototype.addStaticFields = function () {};
|
8967
8923
|
|
8968
8924
|
/**
|
8969
8925
|
* Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
8970
8926
|
* @public
|
8971
|
-
* @
|
8927
|
+
* @ignore
|
8972
8928
|
* @suppress {checkTypes}
|
8973
8929
|
*/
|
8974
|
-
|
8975
|
-
if (!Array.isArray(fields)) {
|
8976
|
-
return;
|
8977
|
-
}
|
8978
|
-
|
8979
|
-
for (let i in fields) {
|
8980
|
-
if (this._staticFields[fields[i]]) {
|
8981
|
-
this._staticFields[fields[i]]--;
|
8982
|
-
|
8983
|
-
if (this._staticFields[fields[i]] === 0) {
|
8984
|
-
delete this._staticFields[fields[i]];
|
8985
|
-
}
|
8986
|
-
}
|
8987
|
-
}
|
8988
|
-
};
|
8930
|
+
DataCache.prototype.removeStaticFields = function () {};
|
8989
8931
|
|
8990
8932
|
/**
|
8991
8933
|
* Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
8992
8934
|
* @public
|
8935
|
+
* @ignore
|
8993
8936
|
*/
|
8994
|
-
|
8995
|
-
this._staticFields = {};
|
8996
|
-
};
|
8937
|
+
DataCache.prototype.resetStaticFields = function () {};
|
8997
8938
|
|
8998
8939
|
/**
|
8999
8940
|
* Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
9000
8941
|
* @public
|
9001
|
-
* @
|
8942
|
+
* @ignore
|
9002
8943
|
*/
|
9003
|
-
|
9004
|
-
return this._staticFields;
|
9005
|
-
};
|
8944
|
+
DataCache.prototype.getStaticFields = function () {};
|
9006
8945
|
|
9007
8946
|
/**
|
9008
8947
|
* Construct a JSON object that is compatible with console.table()
|
@@ -9018,8 +8957,8 @@ DataCache_DataCache.prototype.getStaticFields = function () {
|
|
9018
8957
|
* "withRowIds": boolean
|
9019
8958
|
* };
|
9020
8959
|
*/
|
9021
|
-
|
9022
|
-
return
|
8960
|
+
DataCache.prototype.dump = function (options) {
|
8961
|
+
return DataCache.constructTable(this.getAllRowData(), options, Object.keys(this._rows));
|
9023
8962
|
};
|
9024
8963
|
|
9025
8964
|
/**
|
@@ -9035,104 +8974,43 @@ DataCache_DataCache.prototype.dump = function (options) {
|
|
9035
8974
|
* "withRowIds": boolean
|
9036
8975
|
* };
|
9037
8976
|
*/
|
9038
|
-
|
8977
|
+
DataCache.prototype.log = function (opt_options) {
|
9039
8978
|
console.table(this.dump(opt_options));
|
9040
8979
|
};
|
9041
8980
|
|
9042
8981
|
//#region ADC
|
9043
8982
|
/** Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
9044
8983
|
* @public
|
8984
|
+
* @ignore
|
9045
8985
|
* @param {string} userId
|
9046
8986
|
* @param {string} productId
|
9047
8987
|
* @param {string} url
|
9048
8988
|
* @param {string=} opt_lang
|
9049
8989
|
*/
|
9050
|
-
|
9051
|
-
if (userId != null) {
|
9052
|
-
this._userId = userId;
|
9053
|
-
}
|
9054
|
-
|
9055
|
-
if (productId != null) {
|
9056
|
-
this._productId = productId;
|
9057
|
-
}
|
9058
|
-
|
9059
|
-
if (url != null) {
|
9060
|
-
this._adcUrl = url;
|
9061
|
-
}
|
9062
|
-
|
9063
|
-
if (opt_lang) {
|
9064
|
-
this._lang = opt_lang;
|
9065
|
-
}
|
9066
|
-
};
|
8990
|
+
DataCache.prototype.setDataCloudSettings = function (userId, productId, url, opt_lang) {};
|
9067
8991
|
|
9068
8992
|
/**
|
9069
8993
|
* Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
9070
8994
|
* @public
|
9071
|
-
* @
|
8995
|
+
* @ignore
|
9072
8996
|
*/
|
9073
|
-
|
9074
|
-
return this._adcFields; // Return private members
|
9075
|
-
};
|
8997
|
+
DataCache.prototype.getDataCloudFields = function () {};
|
9076
8998
|
|
9077
8999
|
/**
|
9078
9000
|
* Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
9079
9001
|
* @public
|
9002
|
+
* @ignore
|
9080
9003
|
* @param {Array.<string>|string} fields
|
9081
|
-
* @return {boolean} Return true if success, and false otherwise
|
9082
9004
|
*/
|
9083
|
-
|
9084
|
-
if (!this._adcFields) {
|
9085
|
-
this._adcFields = [];
|
9086
|
-
this._adcRefMap = {};
|
9087
|
-
}
|
9088
|
-
|
9089
|
-
let newFields = [];
|
9090
|
-
|
9091
|
-
if (fields instanceof Array) {
|
9092
|
-
for (let i = fields.length; --i >= 0;) {
|
9093
|
-
this._addDataCloudField(fields[i], newFields);
|
9094
|
-
}
|
9095
|
-
} else {
|
9096
|
-
this._addDataCloudField(/** @type {string} */(fields), newFields);
|
9097
|
-
}
|
9098
|
-
|
9099
|
-
if (newFields.length <= 0) {
|
9100
|
-
return false;
|
9101
|
-
}
|
9102
|
-
|
9103
|
-
let ricMap = this.getAllRics();
|
9104
|
-
|
9105
|
-
this._batchRequestDataCloud(ricMap, newFields);
|
9106
|
-
|
9107
|
-
return true;
|
9108
|
-
};
|
9005
|
+
DataCache.prototype.addDataCloudFields = function (fields) {};
|
9109
9006
|
|
9110
9007
|
/**
|
9111
9008
|
* Deprecated. Built-in Data Service is deprecated due to the lack of flexibility.
|
9112
9009
|
* @public
|
9010
|
+
* @ignore
|
9113
9011
|
* @param {string} field
|
9114
|
-
* @return {boolean} Return true if success, and false otherwise
|
9115
9012
|
*/
|
9116
|
-
|
9117
|
-
if (!this._adcFields) {
|
9118
|
-
return false;
|
9119
|
-
}
|
9120
|
-
|
9121
|
-
if (!this._adcRefMap[field]) {
|
9122
|
-
return false;
|
9123
|
-
}
|
9124
|
-
|
9125
|
-
--this._adcRefMap[field];
|
9126
|
-
|
9127
|
-
if (!this._adcRefMap[field]) {
|
9128
|
-
let foundAt = this._adcFields.indexOf(field);
|
9129
|
-
|
9130
|
-
this._adcFields.splice(foundAt, 1);
|
9131
|
-
this.clearColumnData(field);
|
9132
|
-
}
|
9133
|
-
|
9134
|
-
return true;
|
9135
|
-
};
|
9013
|
+
DataCache.prototype.removeDataCloudField = function (field) {};
|
9136
9014
|
//#endregion ADC
|
9137
9015
|
//#endregion Public
|
9138
9016
|
|
@@ -9143,7 +9021,7 @@ DataCache_DataCache.prototype.removeDataCloudField = function (field) {
|
|
9143
9021
|
* @fires DataTable#dataComposed
|
9144
9022
|
* @fires DataTable#dataChanged
|
9145
9023
|
*/
|
9146
|
-
|
9024
|
+
DataCache.prototype._dispatchDataChange = function (e) {
|
9147
9025
|
if (this._composing) {
|
9148
9026
|
return;
|
9149
9027
|
}
|
@@ -9161,7 +9039,7 @@ DataCache_DataCache.prototype._dispatchDataChange = function (e) {
|
|
9161
9039
|
* @param {string} colName
|
9162
9040
|
* @return {*}
|
9163
9041
|
*/
|
9164
|
-
|
9042
|
+
DataCache._defaultPropertyGetter = function (propertyName, rowData, colName) {
|
9165
9043
|
let d = rowData[colName];
|
9166
9044
|
|
9167
9045
|
return d ? d[propertyName] : null;
|
@@ -9173,7 +9051,7 @@ DataCache_DataCache._defaultPropertyGetter = function (propertyName, rowData, co
|
|
9173
9051
|
* @param {string} colName
|
9174
9052
|
* @return {*}
|
9175
9053
|
*/
|
9176
|
-
|
9054
|
+
DataCache._defaultGetter = function (rowData, colName) {
|
9177
9055
|
return rowData[colName];
|
9178
9056
|
};
|
9179
9057
|
|
@@ -9186,13 +9064,13 @@ DataCache_DataCache._defaultGetter = function (rowData, colName) {
|
|
9186
9064
|
* @param {Array.<string>=} opt_rowIds Optional row ids corresponding to the given dataset
|
9187
9065
|
* @return {!Array.<Object>} Return a JSON object that is compatible with console.table()
|
9188
9066
|
*/
|
9189
|
-
|
9067
|
+
DataCache.constructTable = function (dataset, opt_options, opt_rowIds) {
|
9190
9068
|
let startIndex = 0;
|
9191
9069
|
let rLen = dataset.length;
|
9192
9070
|
let rowLim = rLen;
|
9193
9071
|
let colMap = null;
|
9194
9072
|
let rids = opt_rowIds || null;
|
9195
|
-
let getter =
|
9073
|
+
let getter = DataCache._defaultGetter;
|
9196
9074
|
let transformation = false;
|
9197
9075
|
|
9198
9076
|
if (opt_options) {
|
@@ -9215,7 +9093,7 @@ DataCache_DataCache.constructTable = function (dataset, opt_options, opt_rowIds)
|
|
9215
9093
|
|
9216
9094
|
if (opt_options["getter"]) {
|
9217
9095
|
if (typeof opt_options["getter"] == "string") {
|
9218
|
-
getter =
|
9096
|
+
getter = DataCache._defaultPropertyGetter.bind(null, opt_options["getter"]);
|
9219
9097
|
} else { // Function
|
9220
9098
|
getter = opt_options["getter"];
|
9221
9099
|
}
|
@@ -9278,15 +9156,12 @@ DataCache_DataCache.constructTable = function (dataset, opt_options, opt_rowIds)
|
|
9278
9156
|
* @param {string} ric
|
9279
9157
|
* @param {Object.<string, *>} values
|
9280
9158
|
*/
|
9281
|
-
|
9159
|
+
DataCache.prototype._insertRic = function (subId, ric, values) {
|
9282
9160
|
// HACK: Some chain may have 0# symbol in there chain index (e.g. 0#CL:)
|
9283
9161
|
ric = ric.replace("0#", "");
|
9284
9162
|
|
9285
9163
|
let rid = subId + ric;
|
9286
9164
|
|
9287
|
-
// We cannot cache event arguments because user may want to collect all the updates
|
9288
|
-
this._onADCForNewRic(subId, ric);
|
9289
|
-
|
9290
9165
|
let rowData = this.getRowData(rid);
|
9291
9166
|
if (!rowData) { // Ensure that we have subscription id and ric from Quotes2
|
9292
9167
|
let tmp = values;
|
@@ -9313,7 +9188,7 @@ DataCache_DataCache.prototype._insertRic = function (subId, ric, values) {
|
|
9313
9188
|
* @private
|
9314
9189
|
* @param {Object} e
|
9315
9190
|
*/
|
9316
|
-
|
9191
|
+
DataCache.prototype._onQ2DataChanged = function (e) {
|
9317
9192
|
let subId = e["subId"];
|
9318
9193
|
let ric = e["ric"];
|
9319
9194
|
let values = /** @type{Object.<string, *>} */(e["values"]);
|
@@ -9331,31 +9206,17 @@ DataCache_DataCache.prototype._onQ2DataChanged = function (e) {
|
|
9331
9206
|
* @private
|
9332
9207
|
* @param {Object} e
|
9333
9208
|
*/
|
9334
|
-
|
9209
|
+
DataCache.prototype._onQ2SubAdded = function (e) {
|
9335
9210
|
let subs = e["subs"];
|
9336
|
-
let duplicateSubIds = e["duplicateSubIds"];
|
9337
9211
|
let len = subs.length;
|
9338
9212
|
|
9339
9213
|
for (let i = 0; i < len; ++i) {
|
9340
9214
|
let sub = subs[i];
|
9341
|
-
let ric = sub["ric"];
|
9342
9215
|
|
9343
9216
|
// chain subId fires twice, one with "_ci_" and one without "_ci_"
|
9344
9217
|
// the subId with "_ci_" should be ignore
|
9345
|
-
if(sub["id"].indexOf("_ci_")
|
9346
|
-
|
9347
|
-
}
|
9348
|
-
|
9349
|
-
this.addSubscription(sub, ric);
|
9350
|
-
|
9351
|
-
if (duplicateSubIds) { // There will be no network request for duplicate subs, and hence we need to update the data from our cache
|
9352
|
-
let dupSubId = duplicateSubIds[i];
|
9353
|
-
|
9354
|
-
if (dupSubId) {
|
9355
|
-
window.setTimeout(
|
9356
|
-
this._onDuplicateRic.bind(this, sub["id"], this.getRowData(dupSubId + ric)),
|
9357
|
-
10);
|
9358
|
-
}
|
9218
|
+
if(sub["id"].indexOf("_ci_") < 0){
|
9219
|
+
this.addSubscription(sub, sub["ric"]);
|
9359
9220
|
}
|
9360
9221
|
}
|
9361
9222
|
};
|
@@ -9364,7 +9225,7 @@ DataCache_DataCache.prototype._onQ2SubAdded = function (e) {
|
|
9364
9225
|
* @private
|
9365
9226
|
* @param {Object} e
|
9366
9227
|
*/
|
9367
|
-
|
9228
|
+
DataCache.prototype._onQ2SubRemoved = function (e) {
|
9368
9229
|
let subs = e["subs"];
|
9369
9230
|
let len = subs.length;
|
9370
9231
|
|
@@ -9373,78 +9234,8 @@ DataCache_DataCache.prototype._onQ2SubRemoved = function (e) {
|
|
9373
9234
|
|
9374
9235
|
// chain subId fires twice, one with "_ci_" and one without "_ci_"
|
9375
9236
|
// the subId with "_ci_" should be ignore
|
9376
|
-
if(sub["id"].indexOf("_ci_")
|
9377
|
-
|
9378
|
-
}
|
9379
|
-
|
9380
|
-
this.removeSubscription(sub);
|
9381
|
-
}
|
9382
|
-
};
|
9383
|
-
|
9384
|
-
/**
|
9385
|
-
* @private
|
9386
|
-
* @param {string} subId Subscription id
|
9387
|
-
* @param {string} ric
|
9388
|
-
*/
|
9389
|
-
DataCache_DataCache.prototype._onADCForNewRic = function (subId, ric) {
|
9390
|
-
let sub = this._subs[subId];
|
9391
|
-
|
9392
|
-
if (!sub) {
|
9393
|
-
return;
|
9394
|
-
}
|
9395
|
-
|
9396
|
-
if (this._adcFields) {
|
9397
|
-
if (!sub["rics"][ric]) { // First time insertion
|
9398
|
-
if (this._adcTimerId < 0) {
|
9399
|
-
this._adcRicMap = {};
|
9400
|
-
this._adcTimerId = setTimeout(this._onBatchRequestADCData, 100);
|
9401
|
-
}
|
9402
|
-
|
9403
|
-
if (!this._adcRicMap[ric]) {
|
9404
|
-
this._adcRicMap[ric] = [];
|
9405
|
-
}
|
9406
|
-
|
9407
|
-
this._adcRicMap[ric].push(subId);
|
9408
|
-
}
|
9409
|
-
}
|
9410
|
-
|
9411
|
-
sub["rics"][ric] = true;
|
9412
|
-
};
|
9413
|
-
|
9414
|
-
/**
|
9415
|
-
* @private
|
9416
|
-
* @param {string} subId
|
9417
|
-
* @param {Object.<string, *>} dupData
|
9418
|
-
*/
|
9419
|
-
DataCache_DataCache.prototype._onDuplicateRic = function (subId, dupData) {
|
9420
|
-
let sub = this._subs[subId];
|
9421
|
-
|
9422
|
-
if (!sub) {
|
9423
|
-
return;
|
9424
|
-
}
|
9425
|
-
|
9426
|
-
sub = sub["s"]; // Quotes2' subscription
|
9427
|
-
|
9428
|
-
let ric = sub["ric"];
|
9429
|
-
let dupSubId = /** @type{string} */(dupData["SUB_ID"]);
|
9430
|
-
let values = this._cloneRowData(dupData, ric, subId);
|
9431
|
-
|
9432
|
-
if (!values) {
|
9433
|
-
return;
|
9434
|
-
}
|
9435
|
-
|
9436
|
-
this._onInsert(sub, ric, values);
|
9437
|
-
|
9438
|
-
let children = sub["children"];
|
9439
|
-
|
9440
|
-
if (children) {
|
9441
|
-
let childCount = children.length;
|
9442
|
-
|
9443
|
-
for (let i = 0; i < childCount; ++i) {
|
9444
|
-
ric = children[i];
|
9445
|
-
values = this._cloneRowData(dupSubId, ric, subId);
|
9446
|
-
|
9447
|
-
this._onInsert(sub, ric, values); // TODO: This makes a lot of ADC request
|
9237
|
+
if(sub["id"].indexOf("_ci_") < 0){
|
9238
|
+
this.removeSubscription(sub);
|
9448
9239
|
}
|
9449
9240
|
}
|
9450
9241
|
};
|
@@ -9455,13 +9246,12 @@ DataCache_DataCache.prototype._onDuplicateRic = function (subId, dupData) {
|
|
9455
9246
|
* @param {string} ric
|
9456
9247
|
* @param {Object.<string, *>} values
|
9457
9248
|
*/
|
9458
|
-
|
9249
|
+
DataCache.prototype._onInsert = function (sub, ric, values/*, rowN*/) {
|
9459
9250
|
let subId = sub["id"];
|
9460
9251
|
|
9461
9252
|
if (this._quotes2) {
|
9462
9253
|
this._insertRic(subId, ric, values);
|
9463
9254
|
} else {
|
9464
|
-
this._onADCForNewRic(subId, ric);
|
9465
9255
|
this.setRowData(subId + ric, values, {"subscription": sub, "ric": ric});
|
9466
9256
|
}
|
9467
9257
|
};
|
@@ -9470,7 +9260,7 @@ DataCache_DataCache.prototype._onInsert = function (sub, ric, values/*, rowN*/)
|
|
9470
9260
|
* @private
|
9471
9261
|
* @function
|
9472
9262
|
*/
|
9473
|
-
|
9263
|
+
DataCache.prototype._onUpdate = DataCache.prototype._onInsert;
|
9474
9264
|
|
9475
9265
|
/**
|
9476
9266
|
* This is a legacy code and should be deprecated
|
@@ -9479,315 +9269,42 @@ DataCache_DataCache.prototype._onUpdate = DataCache_DataCache.prototype._onInser
|
|
9479
9269
|
* @param {string} ric
|
9480
9270
|
* @param {Array.<string, *>} values
|
9481
9271
|
*/
|
9482
|
-
|
9272
|
+
DataCache.prototype._onDelete = function (sub, ric, values/*, rowN*/) {
|
9483
9273
|
delete this._subs[sub["id"]]["rics"][ric];
|
9484
9274
|
|
9485
9275
|
// We cannot cache event arguments because user may want to collect all the updates
|
9486
9276
|
this.setRowData(sub["id"] + ric, null, {"subscription": sub, "ric": ric});
|
9487
9277
|
};
|
9488
9278
|
|
9489
|
-
/**
|
9490
|
-
* @private
|
9491
|
-
* @param {string} field
|
9492
|
-
* @param {Array.<string>} ary_out
|
9493
|
-
*/
|
9494
|
-
DataCache_DataCache.prototype._addDataCloudField = function (field, ary_out) {
|
9495
|
-
if (!this._adcRefMap[field]) {
|
9496
|
-
this._adcFields.push(field);
|
9497
|
-
|
9498
|
-
ary_out.push(field);
|
9499
|
-
|
9500
|
-
this._adcRefMap[field] = 1;
|
9501
|
-
} else {
|
9502
|
-
++this._adcRefMap[field];
|
9503
|
-
}
|
9504
|
-
};
|
9505
|
-
|
9506
|
-
/**
|
9507
|
-
* @private
|
9508
|
-
* @param {Object} e
|
9509
|
-
* @suppress {missingProperties}
|
9510
|
-
*/
|
9511
|
-
DataCache_DataCache.prototype._onADCUpdate = function (e) {
|
9512
|
-
let xhr = e["currentTarget"]; // XMLHttpRequest
|
9513
|
-
let resp = null;
|
9514
|
-
|
9515
|
-
try {
|
9516
|
-
resp = JSON.parse(xhr.responseText);
|
9517
|
-
// window.console.log("Successfully parse: " + resp.rows);
|
9518
|
-
} catch (err) {
|
9519
|
-
return;
|
9520
|
-
}
|
9521
|
-
|
9522
|
-
if (resp["status"] !== "Ok") {
|
9523
|
-
return;
|
9524
|
-
}
|
9525
|
-
|
9526
|
-
let colCount = resp["cols"];
|
9527
|
-
let rows = resp["rows"];
|
9528
|
-
let colDefs = rows[0]; // The first row is always the column definition
|
9529
|
-
let ricIndex = -1;
|
9530
|
-
let fieldIndices = {};
|
9531
|
-
|
9532
|
-
for (let i = 0; i < colCount; ++i) {
|
9533
|
-
let colDef = colDefs[i];
|
9534
|
-
|
9535
|
-
if (colDef["i"] === "instrument") {
|
9536
|
-
ricIndex = i;
|
9537
|
-
} else if (colDef["r"]) {
|
9538
|
-
fieldIndices[colDef["r"]] = i;
|
9539
|
-
}
|
9540
|
-
}
|
9541
|
-
|
9542
|
-
let rowCount = rows.length;
|
9543
|
-
|
9544
|
-
for (let j = 1; j < rowCount; ++j) { // Start from 1
|
9545
|
-
let row = rows[j];
|
9546
|
-
let ric = row[ricIndex];
|
9547
|
-
let values = {};
|
9548
|
-
|
9549
|
-
for (let field in fieldIndices) {
|
9550
|
-
let value = row[fieldIndices[field]];
|
9551
|
-
|
9552
|
-
if (value != null) {
|
9553
|
-
// Data should be merged from the backend.
|
9554
|
-
// Don't override data with null value.
|
9555
|
-
// TODO: Merge all the row into one single row
|
9556
|
-
if (value !== null && value["f"] == null) {
|
9557
|
-
if (this._quotes2) {
|
9558
|
-
values[field] = value;
|
9559
|
-
values[field + "_FORMATTED"] = value;
|
9560
|
-
} else {
|
9561
|
-
values[field] = {"formatted": value + "", "raw": value};
|
9562
|
-
}
|
9563
|
-
}
|
9564
|
-
}
|
9565
|
-
}
|
9566
|
-
|
9567
|
-
let subIds = xhr.ricMap[ric];
|
9568
|
-
|
9569
|
-
if (subIds) { // Only ric within the subscription can be updated
|
9570
|
-
for (i = subIds.length; --i >= 0;) {
|
9571
|
-
let subId = subIds[i];
|
9572
|
-
|
9573
|
-
if (this._subs[subId]) { // Only update the existing subscription
|
9574
|
-
// window.console.log("ADC update " + subId + ric + " with " + JSON.stringify(values));
|
9575
|
-
this.setRowData(subId + ric, values); // Event is fired
|
9576
|
-
}
|
9577
|
-
}
|
9578
|
-
}
|
9579
|
-
}
|
9580
|
-
};
|
9581
|
-
|
9582
|
-
/**
|
9583
|
-
* @private
|
9584
|
-
* @param {Object} e
|
9585
|
-
*/
|
9586
|
-
DataCache_DataCache.prototype._onADCError = function (e) {
|
9587
|
-
window.console.log(e);
|
9588
|
-
};
|
9589
|
-
|
9590
|
-
/**
|
9591
|
-
* @private
|
9592
|
-
* @param {Object} e
|
9593
|
-
*/
|
9594
|
-
DataCache_DataCache.prototype._onBatchRequestADCData = function (e) {
|
9595
|
-
if (this._adcTimerId <= 0) {
|
9596
|
-
return;
|
9597
|
-
}
|
9598
|
-
|
9599
|
-
this._adcTimerId = -1;
|
9600
|
-
this._batchRequestDataCloud(this._adcRicMap, this._adcFields);
|
9601
|
-
this._adcRicMap = null;
|
9602
|
-
};
|
9603
|
-
|
9604
|
-
/**
|
9605
|
-
* @private
|
9606
|
-
* @param {Object.<string, Array.<string>>} ricMap of Array of subscription object
|
9607
|
-
* @param {Array.<string>} fields
|
9608
|
-
* @return {XMLHttpRequest}
|
9609
|
-
*/
|
9610
|
-
DataCache_DataCache.prototype._batchRequestDataCloud = function (ricMap, fields) {
|
9611
|
-
if (!this._adcUrl) {
|
9612
|
-
return null;
|
9613
|
-
}
|
9614
|
-
|
9615
|
-
let rics = [];
|
9616
|
-
|
9617
|
-
for (let ric in ricMap) {
|
9618
|
-
rics.push(ric);
|
9619
|
-
}
|
9620
|
-
|
9621
|
-
// Request data cloud in small multiple batches because the service cannot handle a long request
|
9622
|
-
while (rics.length > 30) {
|
9623
|
-
this._requestDataCloud(ricMap, fields, rics.splice(0, 30));
|
9624
|
-
}
|
9625
|
-
|
9626
|
-
return this._requestDataCloud(ricMap, fields, rics);
|
9627
|
-
};
|
9628
|
-
|
9629
|
-
/**
|
9630
|
-
* @private
|
9631
|
-
* @param {Object.<string, Array.<string>>} ricMap of Array of subscription object
|
9632
|
-
* @param {Array.<string>} fields
|
9633
|
-
* @param {Array.<string>} rics
|
9634
|
-
* @return {XMLHttpRequest}
|
9635
|
-
*/
|
9636
|
-
DataCache_DataCache.prototype._requestDataCloud = function (ricMap, fields, rics) { // Small batch
|
9637
|
-
if (!rics || rics.length <= 0) {
|
9638
|
-
return null;
|
9639
|
-
}
|
9640
|
-
|
9641
|
-
if (!fields || fields.length <= 0) {
|
9642
|
-
return null;
|
9643
|
-
}
|
9644
|
-
|
9645
|
-
let xhr = new XMLHttpRequest();
|
9646
|
-
|
9647
|
-
xhr.onload = this._onADCUpdate;
|
9648
|
-
xhr.onerror = this._onADCError;
|
9649
|
-
xhr.ricMap = ricMap;
|
9650
|
-
|
9651
|
-
xhr.open("POST", this._adcUrl, true);
|
9652
|
-
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
9653
|
-
|
9654
|
-
let body = 'formula=' + fields + '&identifiers=' + rics;
|
9655
|
-
|
9656
|
-
// window.console.log("ADC is requested with " + body);
|
9657
|
-
if (this._productId) {
|
9658
|
-
body += '&productid=' + this._productId;
|
9659
|
-
}
|
9660
|
-
|
9661
|
-
if (this._userId) {
|
9662
|
-
body += '&uuid=' + this._userId;
|
9663
|
-
}
|
9664
|
-
|
9665
|
-
if (this._lang) {
|
9666
|
-
body += '&lang=' + this._lang;
|
9667
|
-
}
|
9668
|
-
|
9669
|
-
xhr.send(body);
|
9670
|
-
|
9671
|
-
return xhr;
|
9672
|
-
};
|
9673
|
-
|
9674
|
-
/**
|
9675
|
-
* @private
|
9676
|
-
* @param {string|Object.<string, *>} obj
|
9677
|
-
* @param {string} ric
|
9678
|
-
* @param {string} newSubId
|
9679
|
-
* @return {Object}
|
9680
|
-
*/
|
9681
|
-
DataCache_DataCache.prototype._cloneRowData = function (obj, ric, newSubId) {
|
9682
|
-
let subId = (typeof obj === "string") ? obj : obj["SUB_ID"];
|
9683
|
-
let fields = this._rows[subId + ric];
|
9684
|
-
|
9685
|
-
if (!fields) { // The specified row has been removed
|
9686
|
-
if (typeof obj === "object") {
|
9687
|
-
fields = obj;
|
9688
|
-
} else {
|
9689
|
-
return null;
|
9690
|
-
}
|
9691
|
-
}
|
9692
|
-
|
9693
|
-
let values = {};
|
9694
|
-
|
9695
|
-
for (let key in fields) {
|
9696
|
-
if (this._staticFields[key] == null) { // Static field must not be cloned
|
9697
|
-
values[key] = fields[key];
|
9698
|
-
}
|
9699
|
-
}
|
9700
|
-
|
9701
|
-
values["SUB_ID"] = newSubId;
|
9702
|
-
|
9703
|
-
return values;
|
9704
|
-
};
|
9705
|
-
|
9706
9279
|
/** @protected
|
9707
9280
|
* @ignore
|
9708
9281
|
* @type {!Object.<string, Object>}
|
9709
9282
|
*/
|
9710
|
-
|
9283
|
+
DataCache.prototype._rows;
|
9711
9284
|
|
9712
9285
|
/**
|
9713
9286
|
* @private
|
9714
9287
|
* @type {!Object.<string, Object>}
|
9715
9288
|
*/
|
9716
|
-
|
9289
|
+
DataCache.prototype._subs;
|
9717
9290
|
|
9718
9291
|
/**
|
9719
9292
|
* @private
|
9720
9293
|
* @type {Object}
|
9721
9294
|
*/
|
9722
|
-
|
9723
|
-
|
9724
|
-
/**
|
9725
|
-
* @private
|
9726
|
-
* @type {Object.<string, number>}
|
9727
|
-
*/
|
9728
|
-
DataCache_DataCache.prototype._staticFields = null;
|
9729
|
-
|
9730
|
-
//#region ADC
|
9731
|
-
/**
|
9732
|
-
* @private
|
9733
|
-
* @type {Array.<string>}
|
9734
|
-
*/
|
9735
|
-
DataCache_DataCache.prototype._adcFields = null;
|
9736
|
-
|
9737
|
-
/**
|
9738
|
-
* @private
|
9739
|
-
* @type {Object.<string, number>}
|
9740
|
-
*/
|
9741
|
-
DataCache_DataCache.prototype._adcRefMap = null;
|
9742
|
-
|
9743
|
-
/**
|
9744
|
-
* @private
|
9745
|
-
* @type {number}
|
9746
|
-
*/
|
9747
|
-
DataCache_DataCache.prototype._adcTimerId = -1;
|
9748
|
-
|
9749
|
-
/**
|
9750
|
-
* @private
|
9751
|
-
* @description ricMap of Array of subscription object
|
9752
|
-
* @type {Object.<string, Array.<string>>}
|
9753
|
-
*/
|
9754
|
-
DataCache_DataCache.prototype._adcRicMap = null;
|
9755
|
-
|
9756
|
-
/**
|
9757
|
-
* @private
|
9758
|
-
* @type {string}
|
9759
|
-
*/
|
9760
|
-
DataCache_DataCache.prototype._adcUrl = "/datacloud/rest/select";
|
9761
|
-
|
9762
|
-
/**
|
9763
|
-
* @private
|
9764
|
-
* @type {string}
|
9765
|
-
*/
|
9766
|
-
DataCache_DataCache.prototype._userId = "";
|
9767
|
-
|
9768
|
-
/**
|
9769
|
-
* @private
|
9770
|
-
* @type {string}
|
9771
|
-
*/
|
9772
|
-
DataCache_DataCache.prototype._productId = "";
|
9295
|
+
DataCache.prototype._quotes2 = null;
|
9773
9296
|
|
9774
9297
|
/** @protected
|
9775
9298
|
* @ignore
|
9776
9299
|
* @type {boolean}
|
9777
9300
|
*/
|
9778
|
-
|
9301
|
+
DataCache.prototype._composing = false;
|
9779
9302
|
|
9780
|
-
/** @protected
|
9781
|
-
* @ignore
|
9782
|
-
* @type {string}
|
9783
|
-
*/
|
9784
|
-
DataCache_DataCache.prototype._lang = "";
|
9785
|
-
//#endregion ADC
|
9786
9303
|
//#endregion Private
|
9787
9304
|
|
9788
|
-
|
9305
|
+
DataCache._proto = DataCache.prototype;
|
9789
9306
|
|
9790
|
-
/* harmony default export */ var data_DataCache = (
|
9307
|
+
/* harmony default export */ var data_DataCache = (DataCache);
|
9791
9308
|
|
9792
9309
|
|
9793
9310
|
// CONCATENATED MODULE: ./node_modules/@grid/core/es6/data/Segment.js
|
@@ -13777,7 +13294,7 @@ RowDefinition.prototype.getConfigObject = function(rowOptions) {
|
|
13777
13294
|
obj["info"] = this._info;
|
13778
13295
|
}
|
13779
13296
|
|
13780
|
-
val = this.
|
13297
|
+
val = this._cloneStaticRowData();
|
13781
13298
|
if(val) {
|
13782
13299
|
obj["values"] = val;
|
13783
13300
|
}
|
@@ -13795,7 +13312,7 @@ RowDefinition.prototype.getConfigObject = function(rowOptions) {
|
|
13795
13312
|
let i, rowDef, staticValues;
|
13796
13313
|
for(i = 0; i < len; i++) {
|
13797
13314
|
rowDef = children[i];
|
13798
|
-
staticValues = rowDef.
|
13315
|
+
staticValues = rowDef._cloneStaticRowData();
|
13799
13316
|
if(staticValues) {
|
13800
13317
|
dirty = true;
|
13801
13318
|
childValues[rowDef.getRic()] = staticValues;
|
@@ -13898,15 +13415,16 @@ RowDefinition.prototype.getData = function(field) {
|
|
13898
13415
|
return this._dc ? this._dc.getData(this._dataId, field) : null;
|
13899
13416
|
};
|
13900
13417
|
|
13901
|
-
/**
|
13418
|
+
/** This method replaces all existing static data by the given data -- all existing static data are removed.
|
13419
|
+
* @public
|
13902
13420
|
* @param {Object.<string, *>|Array} data
|
13903
|
-
* @param {Array.<string>=}
|
13421
|
+
* @param {Array.<string>=} indexToFieldMap In case of the given data is an array, this param will be used for mapping index to field
|
13904
13422
|
*/
|
13905
|
-
RowDefinition.prototype.setStaticRowData = function(data,
|
13423
|
+
RowDefinition.prototype.setStaticRowData = function(data, indexToFieldMap) {
|
13906
13424
|
this._clearStaticData();
|
13907
13425
|
|
13908
13426
|
if(Array.isArray(data)) { // Convert array to object
|
13909
|
-
data = arrayToObject(data,
|
13427
|
+
data = arrayToObject(data, indexToFieldMap);
|
13910
13428
|
}
|
13911
13429
|
|
13912
13430
|
this._staticValues = (typeof data === "object") ? data : null;
|
@@ -13918,16 +13436,28 @@ RowDefinition.prototype.setStaticRowData = function(data, opt_fields) {
|
|
13918
13436
|
/** @private
|
13919
13437
|
* @return {Object.<string, *>}
|
13920
13438
|
*/
|
13921
|
-
RowDefinition.prototype.
|
13439
|
+
RowDefinition.prototype._cloneStaticRowData = function() {
|
13922
13440
|
return this._staticValues ? cloneObject(this._staticValues) : null;
|
13923
13441
|
};
|
13924
13442
|
/** @public
|
13443
|
+
* @param {string} field
|
13444
|
+
* @param {*} value
|
13445
|
+
*/
|
13446
|
+
RowDefinition.prototype.setStaticData = function(field, value) {
|
13447
|
+
if(!this._staticValues) {
|
13448
|
+
this._staticValues = {};
|
13449
|
+
}
|
13450
|
+
this._staticValues[field] = value;
|
13451
|
+
|
13452
|
+
this.setData(field, value);
|
13453
|
+
};
|
13454
|
+
/** @public
|
13925
13455
|
* @param {Object.<string, *>|Array} data
|
13926
|
-
* @param {Array.<string>=}
|
13456
|
+
* @param {Array.<string>=} indexToFieldMap In case of the given data is an array, this param will be used for mapping index to field
|
13927
13457
|
*/
|
13928
|
-
RowDefinition.prototype.updateRowData = function(data,
|
13458
|
+
RowDefinition.prototype.updateRowData = function(data, indexToFieldMap) {
|
13929
13459
|
if(Array.isArray(data)) { // Convert array to object
|
13930
|
-
data = arrayToObject(data,
|
13460
|
+
data = arrayToObject(data, indexToFieldMap);
|
13931
13461
|
}
|
13932
13462
|
|
13933
13463
|
if(data) {
|
@@ -13935,16 +13465,32 @@ RowDefinition.prototype.updateRowData = function(data, opt_fields) {
|
|
13935
13465
|
}
|
13936
13466
|
};
|
13937
13467
|
/** @public
|
13938
|
-
* @param {
|
13939
|
-
* @param {*} value
|
13468
|
+
* @param {RowDefinition} srcRowDef Original source of row data to be copied from
|
13940
13469
|
*/
|
13941
|
-
RowDefinition.prototype.
|
13942
|
-
if(
|
13943
|
-
|
13944
|
-
|
13945
|
-
|
13470
|
+
RowDefinition.prototype.copyRowData = function(srcRowDef) {
|
13471
|
+
if(srcRowDef && srcRowDef !== this) {
|
13472
|
+
let field;
|
13473
|
+
let uncopiable_fields = {
|
13474
|
+
"ROW_DEF": 1,
|
13475
|
+
"SUB_ID": 1
|
13476
|
+
};
|
13477
|
+
let staticValues = this._staticValues;
|
13478
|
+
for(field in staticValues) {
|
13479
|
+
uncopiable_fields[field] = 1;
|
13480
|
+
}
|
13481
|
+
staticValues = srcRowDef._staticValues;
|
13482
|
+
for(field in staticValues) {
|
13483
|
+
uncopiable_fields[field] = 1;
|
13484
|
+
}
|
13946
13485
|
|
13947
|
-
|
13486
|
+
let srcRowData = srcRowDef.getRowData();
|
13487
|
+
let rowData = this.getRowData();
|
13488
|
+
for(field in srcRowData) {
|
13489
|
+
if(!uncopiable_fields[field]) {
|
13490
|
+
rowData[field] = srcRowData[field]; // There is no dataChanged event fired
|
13491
|
+
}
|
13492
|
+
}
|
13493
|
+
}
|
13948
13494
|
};
|
13949
13495
|
/** @public
|
13950
13496
|
* @param {Object.<string, *>} data
|
@@ -14395,7 +13941,7 @@ RowDefinition.prototype.unlinkChain = function() {
|
|
14395
13941
|
}
|
14396
13942
|
}
|
14397
13943
|
|
14398
|
-
let staticData = this.
|
13944
|
+
let staticData = this._cloneStaticRowData();
|
14399
13945
|
this.unsubscribeForUpdates();
|
14400
13946
|
|
14401
13947
|
// Restore static data
|
@@ -14682,15 +14228,15 @@ const SYNAPSE_URL =
|
|
14682
14228
|
* @constant
|
14683
14229
|
* @description
|
14684
14230
|
* ^TR. => start with TR.
|
14685
|
-
*
|
14231
|
+
* \w+ => any field with string and value
|
14686
14232
|
* [\(] => open bucket (
|
14687
|
-
* [\w
|
14233
|
+
* [\w\-=,]* => any property name and follow by = EX. SDATE=2011-11-11, PRIOD=123123
|
14688
14234
|
* (?:EDATE|SDATE) => non-capturing group match EDATE or SDATE
|
14689
|
-
* [\w
|
14235
|
+
* [\w\-=,]+ => another propertie param
|
14690
14236
|
* [\)]$ => end with only )
|
14691
14237
|
* i => for match both upper and lower cases
|
14692
14238
|
*/
|
14693
|
-
const TimeSeriesRegEx = /^TR
|
14239
|
+
const TimeSeriesRegEx = /^TR\.\w+\([\w\-=,]*(?:EDATE|SDATE)=+[\w\-=,]*[ \w]*\)$/i;
|
14694
14240
|
|
14695
14241
|
/* @namespace */
|
14696
14242
|
let FieldDefinition = {};
|
@@ -24501,6 +24047,179 @@ HScrollbar._proto = HScrollbar.prototype;
|
|
24501
24047
|
/* harmony default export */ var components_HScrollbar = (HScrollbar);
|
24502
24048
|
|
24503
24049
|
|
24050
|
+
// CONCATENATED MODULE: ./node_modules/@grid/core/es6/grid/util/CellBoundPainter.js
|
24051
|
+
/** @private
|
24052
|
+
* @function
|
24053
|
+
* @param {number} idx
|
24054
|
+
* @param {number} limit
|
24055
|
+
* @return {number}
|
24056
|
+
*/
|
24057
|
+
let _validateIndex = function(idx, limit) {
|
24058
|
+
if(idx > limit) {
|
24059
|
+
return limit;
|
24060
|
+
} else if(idx < 0) {
|
24061
|
+
return 0;
|
24062
|
+
}
|
24063
|
+
return idx;
|
24064
|
+
};
|
24065
|
+
|
24066
|
+
/** @constructor
|
24067
|
+
* @param {Object} ctx
|
24068
|
+
*/
|
24069
|
+
let CellBoundPainter = function (ctx) {
|
24070
|
+
this._boundLayer = ctx.boundLayer;
|
24071
|
+
this._layoutX = ctx.layoutX;
|
24072
|
+
this._layoutY = ctx.layoutY;
|
24073
|
+
this._hscrollbar = ctx.hscrollbar;
|
24074
|
+
this._calculateColumnBounds = ctx.calculateColumnBounds;
|
24075
|
+
};
|
24076
|
+
|
24077
|
+
/** @type {Element}
|
24078
|
+
* @private
|
24079
|
+
*/
|
24080
|
+
CellBoundPainter.prototype._boundLayer = null;
|
24081
|
+
/** @type {!TrackLayout}
|
24082
|
+
* @private
|
24083
|
+
*/
|
24084
|
+
CellBoundPainter.prototype._layoutX;
|
24085
|
+
/** @type {!TrackLayout}
|
24086
|
+
* @private
|
24087
|
+
*/
|
24088
|
+
CellBoundPainter.prototype._layoutY;
|
24089
|
+
/** @type {HScrollbar}
|
24090
|
+
* @private
|
24091
|
+
*/
|
24092
|
+
CellBoundPainter.prototype._hscrollbar;
|
24093
|
+
/** @type {Function}
|
24094
|
+
* @private
|
24095
|
+
*/
|
24096
|
+
CellBoundPainter.prototype._calculateColumnBounds;
|
24097
|
+
/** @type {Element}
|
24098
|
+
* @private
|
24099
|
+
*/
|
24100
|
+
CellBoundPainter.prototype._cellBound = null;
|
24101
|
+
/** @type {number}
|
24102
|
+
* @private
|
24103
|
+
*/
|
24104
|
+
CellBoundPainter.prototype._cbLftIdx = 0;
|
24105
|
+
/** @type {number}
|
24106
|
+
* @private
|
24107
|
+
*/
|
24108
|
+
CellBoundPainter.prototype._cbRgtIdx = 0;
|
24109
|
+
/** @type {number}
|
24110
|
+
* @private
|
24111
|
+
*/
|
24112
|
+
CellBoundPainter.prototype._cbTopIdx = 0;
|
24113
|
+
/** @type {number}
|
24114
|
+
* @private
|
24115
|
+
*/
|
24116
|
+
CellBoundPainter.prototype._cbBtmIdx = 0;
|
24117
|
+
|
24118
|
+
/** @public
|
24119
|
+
*/
|
24120
|
+
CellBoundPainter.prototype.dispose = function () {
|
24121
|
+
let cellBound = this._cellBound;
|
24122
|
+
if(cellBound) {
|
24123
|
+
let pn = cellBound.parentNode;
|
24124
|
+
if(pn) {
|
24125
|
+
pn.removeChild(cellBound);
|
24126
|
+
}
|
24127
|
+
this._cellBound = null;
|
24128
|
+
}
|
24129
|
+
this._boundLayer = null;
|
24130
|
+
this._layoutX = null;
|
24131
|
+
this._layoutY = null;
|
24132
|
+
this._hscrollbar = null;
|
24133
|
+
this._calculateColumnBounds = null;
|
24134
|
+
};
|
24135
|
+
|
24136
|
+
/** @public
|
24137
|
+
* @param {number} colIndex
|
24138
|
+
* @param {number} rowIndex
|
24139
|
+
* @param {number} width
|
24140
|
+
* @param {number} height
|
24141
|
+
* @param {number} colCount
|
24142
|
+
*/
|
24143
|
+
CellBoundPainter.prototype.setCellBounds = function (colIndex, rowIndex, width, height, colCount) {
|
24144
|
+
let cellBound = this._cellBound;
|
24145
|
+
if(!cellBound) {
|
24146
|
+
cellBound = this._cellBound = document.createElement("div");
|
24147
|
+
cellBound.className = "selection-bound";
|
24148
|
+
}
|
24149
|
+
|
24150
|
+
// Validate inputs
|
24151
|
+
let rgtIndex = colIndex + width; // Exclusive
|
24152
|
+
let btmIndex = rowIndex + height; // Exclusive
|
24153
|
+
|
24154
|
+
let rowCount = this._layoutY.getLaneCount();
|
24155
|
+
|
24156
|
+
this._cbLftIdx = _validateIndex(colIndex, colCount);
|
24157
|
+
this._cbRgtIdx = _validateIndex(rgtIndex, colCount);
|
24158
|
+
this._cbTopIdx = _validateIndex(rowIndex, rowCount);
|
24159
|
+
this._cbBtmIdx = _validateIndex(btmIndex, rowCount);
|
24160
|
+
|
24161
|
+
this.updateCellBounds();
|
24162
|
+
};
|
24163
|
+
|
24164
|
+
/** @public
|
24165
|
+
*/
|
24166
|
+
CellBoundPainter.prototype.updateCellBounds = function() {
|
24167
|
+
let cellBound = this._cellBound;
|
24168
|
+
if(!cellBound) {
|
24169
|
+
return;
|
24170
|
+
}
|
24171
|
+
|
24172
|
+
let layoutX = this._layoutX;
|
24173
|
+
let layoutY = this._layoutY;
|
24174
|
+
let lftIdx = this._cbLftIdx;
|
24175
|
+
let rgtIdx = this._cbRgtIdx; // Exclusive
|
24176
|
+
let topIdx = this._cbTopIdx;
|
24177
|
+
let btmIdx = this._cbBtmIdx; // Exclusive
|
24178
|
+
let lftPx, rgtPx, topPx, btmPx;
|
24179
|
+
lftPx = rgtPx = topPx = btmPx = 0;
|
24180
|
+
if(lftIdx < rgtIdx && topIdx < btmIdx) {
|
24181
|
+
lftPx = layoutX.getLaneStart(lftIdx);
|
24182
|
+
rgtPx = layoutX.getLaneEnd(rgtIdx - 1);
|
24183
|
+
topPx = layoutY.getLaneStart(topIdx);
|
24184
|
+
btmPx = layoutY.getLaneEnd(btmIdx - 1);
|
24185
|
+
}
|
24186
|
+
|
24187
|
+
let width = rgtPx - lftPx;
|
24188
|
+
let height = btmPx - topPx;
|
24189
|
+
let noBorders = [false, false];
|
24190
|
+
if(width > 0 && height > 0 && this._hscrollbar) {
|
24191
|
+
let positions = [0, 0];
|
24192
|
+
this._calculateColumnBounds(lftIdx, rgtIdx - 1, positions, noBorders);
|
24193
|
+
lftPx = positions[0];
|
24194
|
+
rgtPx = positions[1];
|
24195
|
+
width = rgtPx - lftPx;
|
24196
|
+
}
|
24197
|
+
|
24198
|
+
if(width > 0) {
|
24199
|
+
cellBound.style.left = lftPx + "px";
|
24200
|
+
cellBound.style.top = topPx + "px";
|
24201
|
+
cellBound.style.width = width + "px";
|
24202
|
+
cellBound.style.height = height + "px";
|
24203
|
+
|
24204
|
+
cellBound.classList.toggle("no-left-bound", noBorders[0]);
|
24205
|
+
cellBound.classList.toggle("no-right-bound", noBorders[1]);
|
24206
|
+
|
24207
|
+
if(this._boundLayer) {
|
24208
|
+
this._boundLayer.appendChild(cellBound);
|
24209
|
+
}
|
24210
|
+
} else {
|
24211
|
+
let pn = cellBound.parentNode;
|
24212
|
+
if(pn) {
|
24213
|
+
pn.removeChild(cellBound);
|
24214
|
+
}
|
24215
|
+
}
|
24216
|
+
};
|
24217
|
+
|
24218
|
+
CellBoundPainter._proto = CellBoundPainter.prototype;
|
24219
|
+
|
24220
|
+
/* harmony default export */ var util_CellBoundPainter = (CellBoundPainter);
|
24221
|
+
|
24222
|
+
|
24504
24223
|
// CONCATENATED MODULE: ./node_modules/@grid/core/es6/grid/LayoutGrid.js
|
24505
24224
|
/* eslint-disable */
|
24506
24225
|
|
@@ -24516,6 +24235,7 @@ HScrollbar._proto = HScrollbar.prototype;
|
|
24516
24235
|
|
24517
24236
|
|
24518
24237
|
|
24238
|
+
|
24519
24239
|
/* eslint-enable */
|
24520
24240
|
|
24521
24241
|
//#region Events
|
@@ -24781,7 +24501,10 @@ LayoutGrid.prototype._leftColumnSeparator = null;
|
|
24781
24501
|
* @private
|
24782
24502
|
*/
|
24783
24503
|
LayoutGrid.prototype._rightColumnSeparator = null;
|
24784
|
-
|
24504
|
+
/** @type {Element}
|
24505
|
+
* @private
|
24506
|
+
*/
|
24507
|
+
LayoutGrid.prototype._cellBoundPainter = null;
|
24785
24508
|
/**
|
24786
24509
|
* {@link ElementWrapper#dispose}
|
24787
24510
|
* @override
|
@@ -24806,6 +24529,10 @@ LayoutGrid.prototype.dispose = function () {
|
|
24806
24529
|
this._ctx = null;
|
24807
24530
|
this._hscrollbar = null;
|
24808
24531
|
|
24532
|
+
if(this._cellBoundPainter) {
|
24533
|
+
this._cellBoundPainter.dispose();
|
24534
|
+
}
|
24535
|
+
|
24809
24536
|
this._dispose();
|
24810
24537
|
};
|
24811
24538
|
/**
|
@@ -26776,7 +26503,22 @@ LayoutGrid.prototype.selectCell = function (colIndex, rowIndex, selected) {
|
|
26776
26503
|
* @param {number} width
|
26777
26504
|
* @param {number} height
|
26778
26505
|
*/
|
26779
|
-
LayoutGrid.prototype.setCellBounds = function (colIndex, rowIndex, width, height) {
|
26506
|
+
LayoutGrid.prototype.setCellBounds = function (colIndex, rowIndex, width, height) {
|
26507
|
+
let boundLayer = this._initBoundLayer();
|
26508
|
+
let cellBoundPainter = this._cellBoundPainter;
|
26509
|
+
if(!cellBoundPainter) {
|
26510
|
+
cellBoundPainter = this._cellBoundPainter = new util_CellBoundPainter({
|
26511
|
+
boundLayer: boundLayer,
|
26512
|
+
layoutX: this._trackX,
|
26513
|
+
layoutY: this._trackY,
|
26514
|
+
hscrollbar: this._hscrollbar,
|
26515
|
+
calculateColumnBounds: this.calculateColumnBounds.bind(this)
|
26516
|
+
});
|
26517
|
+
}
|
26518
|
+
|
26519
|
+
let colCount = this.getColumnCount();
|
26520
|
+
cellBoundPainter.setCellBounds(colIndex, rowIndex, width, height, colCount);
|
26521
|
+
};
|
26780
26522
|
/** @public
|
26781
26523
|
* @ignore
|
26782
26524
|
* @return {!TrackLayout}
|
@@ -27889,6 +27631,7 @@ ColumnStats.prototype._refs;
|
|
27889
27631
|
// eslint-disable-line
|
27890
27632
|
// eslint-disable-line
|
27891
27633
|
// eslint-disable-line
|
27634
|
+
// eslint-disable-line
|
27892
27635
|
|
27893
27636
|
/** @event WrappedView#dataChanged
|
27894
27637
|
* @description Trigger when data within the data view has been changed. Not only actual change in data, but also position change will trigger this event.
|
@@ -29166,7 +28909,7 @@ WrappedView.prototype.wrapView = function (wrapSize) {
|
|
29166
28909
|
* @see {@link DataCache#dump}
|
29167
28910
|
*/
|
29168
28911
|
WrappedView.prototype.dump = function(opt_options) {
|
29169
|
-
return
|
28912
|
+
return data_DataCache.constructTable(this.getMultipleRowData(this._rids), opt_options, this._rids);
|
29170
28913
|
};
|
29171
28914
|
/** Print current data and structure to console panel
|
29172
28915
|
* @public
|
@@ -34652,23 +34395,9 @@ VScrollbar._proto = VScrollbar.prototype;
|
|
34652
34395
|
|
34653
34396
|
|
34654
34397
|
|
34655
|
-
/* eslint-enable */
|
34656
34398
|
|
34399
|
+
/* eslint-enable */
|
34657
34400
|
|
34658
|
-
/** @private
|
34659
|
-
* @function
|
34660
|
-
* @param {number} idx
|
34661
|
-
* @param {number} limit
|
34662
|
-
* @return {number}
|
34663
|
-
*/
|
34664
|
-
let _validateIndex = function(idx, limit) {
|
34665
|
-
if(idx > limit) {
|
34666
|
-
return limit;
|
34667
|
-
} else if(idx < 0) {
|
34668
|
-
return 0;
|
34669
|
-
}
|
34670
|
-
return idx;
|
34671
|
-
};
|
34672
34401
|
|
34673
34402
|
/** @constructor
|
34674
34403
|
* @ignore
|
@@ -34754,26 +34483,10 @@ VirtualizedLayoutGrid.prototype._rowBoundCache = null;
|
|
34754
34483
|
* @private
|
34755
34484
|
*/
|
34756
34485
|
VirtualizedLayoutGrid.prototype._rowSelDirty = false;
|
34757
|
-
/** @type {
|
34758
|
-
* @private
|
34759
|
-
*/
|
34760
|
-
VirtualizedLayoutGrid.prototype._cellBound = null;
|
34761
|
-
/** @type {number}
|
34762
|
-
* @private
|
34763
|
-
*/
|
34764
|
-
VirtualizedLayoutGrid.prototype._cbLftIdx = 0;
|
34765
|
-
/** @type {number}
|
34766
|
-
* @private
|
34767
|
-
*/
|
34768
|
-
VirtualizedLayoutGrid.prototype._cbRgtIdx = 0;
|
34769
|
-
/** @type {number}
|
34770
|
-
* @private
|
34771
|
-
*/
|
34772
|
-
VirtualizedLayoutGrid.prototype._cbTopIdx = 0;
|
34773
|
-
/** @type {number}
|
34486
|
+
/** @type {Object}
|
34774
34487
|
* @private
|
34775
34488
|
*/
|
34776
|
-
VirtualizedLayoutGrid.prototype.
|
34489
|
+
VirtualizedLayoutGrid.prototype._cellBoundPainter = null;
|
34777
34490
|
/** @type {number}
|
34778
34491
|
* @private
|
34779
34492
|
*/
|
@@ -34826,6 +34539,9 @@ VirtualizedLayoutGrid.prototype.dispose = function () {
|
|
34826
34539
|
clearTimeout(this._rowBoundTimer);
|
34827
34540
|
this._rowBoundTimer = 0;
|
34828
34541
|
}
|
34542
|
+
if(this._cellBoundPainter) {
|
34543
|
+
this._cellBoundPainter.dispose();
|
34544
|
+
}
|
34829
34545
|
};
|
34830
34546
|
/** @override */
|
34831
34547
|
VirtualizedLayoutGrid.prototype.setWidth = function (px) {
|
@@ -35653,26 +35369,20 @@ VirtualizedLayoutGrid.prototype.selectCell = function (colIndex, rowIndex, selec
|
|
35653
35369
|
* @param {number} height
|
35654
35370
|
*/
|
35655
35371
|
VirtualizedLayoutGrid.prototype.setCellBounds = function (colIndex, rowIndex, width, height) {
|
35656
|
-
let
|
35657
|
-
|
35658
|
-
|
35659
|
-
|
35372
|
+
let boundLayer = this._initBoundLayer();
|
35373
|
+
let cellBoundPainter = this._cellBoundPainter;
|
35374
|
+
if(!cellBoundPainter) {
|
35375
|
+
cellBoundPainter = this._cellBoundPainter = new util_CellBoundPainter({
|
35376
|
+
boundLayer: boundLayer,
|
35377
|
+
layoutX: this.getHorizontalLayout(),
|
35378
|
+
layoutY: this._layoutY,
|
35379
|
+
hscrollbar: this._hscrollbar,
|
35380
|
+
calculateColumnBounds: this.calculateColumnBounds.bind(this)
|
35381
|
+
});
|
35660
35382
|
}
|
35661
|
-
this._initBoundLayer();
|
35662
|
-
|
35663
|
-
// Validate inputs
|
35664
|
-
let rgtIndex = colIndex + width; // Exclusive
|
35665
|
-
let btmIndex = rowIndex + height; // Exclusive
|
35666
35383
|
|
35667
35384
|
let colCount = this.getColumnCount();
|
35668
|
-
|
35669
|
-
|
35670
|
-
this._cbLftIdx = _validateIndex(colIndex, colCount);
|
35671
|
-
this._cbRgtIdx = _validateIndex(rgtIndex, colCount);
|
35672
|
-
this._cbTopIdx = _validateIndex(rowIndex, rowCount);
|
35673
|
-
this._cbBtmIdx = _validateIndex(btmIndex, rowCount);
|
35674
|
-
|
35675
|
-
this._updateCellBounds();
|
35385
|
+
cellBoundPainter.setCellBounds(colIndex, rowIndex, width, height, colCount);
|
35676
35386
|
};
|
35677
35387
|
/** @public
|
35678
35388
|
* @ignore
|
@@ -35691,59 +35401,6 @@ VirtualizedLayoutGrid.prototype.getHorizontalLayout = function () {
|
|
35691
35401
|
VirtualizedLayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositions, outNoBorders) {
|
35692
35402
|
this._grid.calculateColumnBounds(lftIdx, rgtIdx, outPositions, outNoBorders);
|
35693
35403
|
};
|
35694
|
-
/** @private
|
35695
|
-
*/
|
35696
|
-
VirtualizedLayoutGrid.prototype._updateCellBounds = function () {
|
35697
|
-
let cellBound = this._cellBound;
|
35698
|
-
if(!cellBound) {
|
35699
|
-
return;
|
35700
|
-
}
|
35701
|
-
|
35702
|
-
let layoutX = this.getHorizontalLayout();
|
35703
|
-
let layoutY = this._layoutY;
|
35704
|
-
let lftIdx = this._cbLftIdx;
|
35705
|
-
let rgtIdx = this._cbRgtIdx; // Exclusive
|
35706
|
-
let topIdx = this._cbTopIdx;
|
35707
|
-
let btmIdx = this._cbBtmIdx; // Exclusive
|
35708
|
-
let lftPx, rgtPx, topPx, btmPx;
|
35709
|
-
lftPx = rgtPx = topPx = btmPx = 0;
|
35710
|
-
if(lftIdx < rgtIdx && topIdx < btmIdx) {
|
35711
|
-
lftPx = layoutX.getLaneStart(lftIdx);
|
35712
|
-
rgtPx = layoutX.getLaneEnd(rgtIdx - 1);
|
35713
|
-
topPx = layoutY.getLaneStart(topIdx);
|
35714
|
-
btmPx = layoutY.getLaneEnd(btmIdx - 1);
|
35715
|
-
}
|
35716
|
-
|
35717
|
-
let width = rgtPx - lftPx;
|
35718
|
-
let height = btmPx - topPx;
|
35719
|
-
let noBorders = [false, false];
|
35720
|
-
if(width > 0 && height > 0 && this._hscrollbar) {
|
35721
|
-
let positions = [0, 0];
|
35722
|
-
this.calculateColumnBounds(lftIdx, rgtIdx - 1, positions, noBorders);
|
35723
|
-
lftPx = positions[0];
|
35724
|
-
rgtPx = positions[1];
|
35725
|
-
width = rgtPx - lftPx;
|
35726
|
-
}
|
35727
|
-
|
35728
|
-
if(width > 0) {
|
35729
|
-
cellBound.style.left = lftPx + "px";
|
35730
|
-
cellBound.style.top = topPx + "px";
|
35731
|
-
cellBound.style.width = width + "px";
|
35732
|
-
cellBound.style.height = height + "px";
|
35733
|
-
|
35734
|
-
cellBound.classList.toggle("no-left-bound", noBorders[0]);
|
35735
|
-
cellBound.classList.toggle("no-right-bound", noBorders[1]);
|
35736
|
-
|
35737
|
-
if(this._boundLayer) {
|
35738
|
-
this._boundLayer.appendChild(cellBound);
|
35739
|
-
}
|
35740
|
-
} else {
|
35741
|
-
let pn = cellBound.parentNode;
|
35742
|
-
if(pn) {
|
35743
|
-
pn.removeChild(cellBound);
|
35744
|
-
}
|
35745
|
-
}
|
35746
|
-
};
|
35747
35404
|
/** @public
|
35748
35405
|
* @ignore
|
35749
35406
|
* @param {!Array.<Array>} posAry Left and right bound positions in pixel
|
@@ -35761,6 +35418,7 @@ VirtualizedLayoutGrid.prototype.updateColumnSeparators = function () {
|
|
35761
35418
|
this._grid.updateColumnSeparators();
|
35762
35419
|
};
|
35763
35420
|
/** @private
|
35421
|
+
* @return {Element}
|
35764
35422
|
*/
|
35765
35423
|
VirtualizedLayoutGrid.prototype._initBoundLayer = function () {
|
35766
35424
|
let boundLayer = this._boundLayer;
|
@@ -35769,6 +35427,7 @@ VirtualizedLayoutGrid.prototype._initBoundLayer = function () {
|
|
35769
35427
|
boundLayer.className = "cover-layer";
|
35770
35428
|
this._element.appendChild(boundLayer);
|
35771
35429
|
}
|
35430
|
+
return boundLayer;
|
35772
35431
|
};
|
35773
35432
|
/** @private
|
35774
35433
|
*/
|
@@ -35781,7 +35440,11 @@ VirtualizedLayoutGrid.prototype._requestUpdatingRowBounds = function () {
|
|
35781
35440
|
*/
|
35782
35441
|
VirtualizedLayoutGrid.prototype._updateRowBounds = function () {
|
35783
35442
|
this._rowBoundTimer = 0;
|
35784
|
-
|
35443
|
+
|
35444
|
+
let cellBoundPainter = this._cellBoundPainter;
|
35445
|
+
if(cellBoundPainter) {
|
35446
|
+
cellBoundPainter.updateCellBounds();
|
35447
|
+
}
|
35785
35448
|
|
35786
35449
|
if(!this._rowSelDirty) {
|
35787
35450
|
return;
|
@@ -36547,7 +36210,7 @@ Core.prototype._hasPendingRowChange = false;
|
|
36547
36210
|
* @return {string}
|
36548
36211
|
*/
|
36549
36212
|
Core.getVersion = function () {
|
36550
|
-
return "5.1.
|
36213
|
+
return "5.1.106";
|
36551
36214
|
};
|
36552
36215
|
/** {@link ElementWrapper#dispose}
|
36553
36216
|
* @override
|
@@ -44916,28 +44579,6 @@ let toRowData = function(rowDef) {
|
|
44916
44579
|
return rowDef ? rowDef.getRowData() : null;
|
44917
44580
|
};
|
44918
44581
|
|
44919
|
-
/** @private
|
44920
|
-
* @const
|
44921
|
-
* @type {Object.<string, number>}
|
44922
|
-
*/
|
44923
|
-
let _unclonableFields = {
|
44924
|
-
"ROW_DEF": 1,
|
44925
|
-
"SUB_ID": 1
|
44926
|
-
};
|
44927
|
-
/** @private
|
44928
|
-
* @param {RowDefinition} fromRowDef
|
44929
|
-
* @param {RowDefinition} toRowDef
|
44930
|
-
*/
|
44931
|
-
let cloneRowData = function(fromRowDef, toRowDef) {
|
44932
|
-
let from = toRowData(fromRowDef);
|
44933
|
-
let to = toRowData(toRowDef);
|
44934
|
-
for(let key in from) {
|
44935
|
-
if(!_unclonableFields[key]) {
|
44936
|
-
to[key] = from[key];
|
44937
|
-
}
|
44938
|
-
}
|
44939
|
-
};
|
44940
|
-
|
44941
44582
|
/** @private
|
44942
44583
|
* @param {RowDefinition} rowDef
|
44943
44584
|
* @return {boolean}
|
@@ -45115,10 +44756,9 @@ let Grid = function(placeholder, config) {
|
|
45115
44756
|
}
|
45116
44757
|
}
|
45117
44758
|
if(!t._sharedDataSource) {
|
45118
|
-
t._dc = new
|
44759
|
+
t._dc = new DataCache();
|
45119
44760
|
t._dc.listen("dataChanged", t._onDataChanged);
|
45120
44761
|
t._dc.listen("dataComposed", t._onDataComposed);
|
45121
|
-
t._dc.addStaticFields([ROW_DEF, SUB_ID]); // Static fields are deprecated, set fields to be ignore during clone in DataCache
|
45122
44762
|
|
45123
44763
|
t._dt = new DataTable();
|
45124
44764
|
t._dt.setSortingLogic(/** @type{Function} */(t._mainSorter));
|
@@ -46686,12 +46326,6 @@ Grid.prototype.removeColumn = function(colRef) {
|
|
46686
46326
|
|
46687
46327
|
let colDef = this.getColumnDefinition(colIndex);
|
46688
46328
|
|
46689
|
-
if(!colDef.isRealTimeField()) {
|
46690
|
-
if(this._dc) {
|
46691
|
-
this._dc.removeStaticFields([colDef.getField()]);
|
46692
|
-
}
|
46693
|
-
}
|
46694
|
-
|
46695
46329
|
this._grid.removeColumnAt(colIndex);
|
46696
46330
|
this._connector.removeFields(colDef);
|
46697
46331
|
|
@@ -46715,25 +46349,16 @@ Grid.prototype.removeColumns = function(colRefs) {
|
|
46715
46349
|
}
|
46716
46350
|
indices.sort(Grid._descendingOrder); // Removal must be done from the back
|
46717
46351
|
|
46718
|
-
let staticFields = []; // For clearing any data stored in our cache
|
46719
46352
|
let prevState = this._grid.freezeLayout(); // To prevent multiple UI updates
|
46720
46353
|
|
46721
46354
|
for(let i = 0; i < len; ++i) {
|
46722
46355
|
let colIndex = indices[i];
|
46723
46356
|
let colDef = this.getColumnDefinition(colIndex);
|
46724
|
-
if(!colDef.isRealTimeField()) {
|
46725
|
-
staticFields.push(colDef.getField());
|
46726
|
-
}
|
46727
46357
|
colDef.dispose();
|
46728
46358
|
this._grid.removeColumnAt(colIndex);
|
46729
46359
|
this._connector.removeFields(colDef);
|
46730
46360
|
}
|
46731
46361
|
|
46732
|
-
if(staticFields.length) {
|
46733
|
-
if(this._dc) {
|
46734
|
-
this._dc.removeStaticFields(staticFields);
|
46735
|
-
}
|
46736
|
-
}
|
46737
46362
|
this._grid.freezeLayout(prevState);
|
46738
46363
|
};
|
46739
46364
|
/** Sorting is also cleared.
|
@@ -46763,9 +46388,6 @@ Grid.prototype.removeAllColumns = function() {
|
|
46763
46388
|
|
46764
46389
|
this._connector.removeAllFields();
|
46765
46390
|
this._grid.setColumnCount(0);
|
46766
|
-
if(this._dc) {
|
46767
|
-
this._dc.resetStaticFields();
|
46768
|
-
}
|
46769
46391
|
};
|
46770
46392
|
|
46771
46393
|
/** Move the column at the specified index to the target index. When moving multiple columns, the original order of the source columns will be sorted by their index and the position of the columns will not be guaranteed to be exactly at the destination index.
|
@@ -47027,13 +46649,12 @@ Grid.prototype.setColumnSorter = function(colRef, func) {
|
|
47027
46649
|
|
47028
46650
|
/** Initialize data for the given rowDef from another rowDef with the same RIC
|
47029
46651
|
* @private
|
47030
|
-
* @param {RowDefinition} rowDef
|
46652
|
+
* @param {!RowDefinition} rowDef
|
47031
46653
|
*/
|
47032
46654
|
Grid.prototype._initDuplicateRicData = function(rowDef) {
|
47033
|
-
let
|
47034
|
-
|
47035
|
-
|
47036
|
-
cloneRowData(rowDefs[0], rowDef);
|
46655
|
+
let rowDefs = this._connector.getRowDefByRic(rowDef.getSymbol());
|
46656
|
+
if(rowDefs) {
|
46657
|
+
rowDef.copyRowData(rowDefs[0]);
|
47037
46658
|
}
|
47038
46659
|
};
|
47039
46660
|
/** @public
|
@@ -47466,15 +47087,15 @@ Grid.prototype.hasHiddenRow = function(){
|
|
47466
47087
|
* @param {Grid~RowReference} rowRef
|
47467
47088
|
* @param {string} str RIC to be set to a row
|
47468
47089
|
* @param {RowDefinition~Options=} options
|
47090
|
+
* @returns {RowDefinition} Returns modified Row Definition instance
|
47469
47091
|
*/
|
47470
47092
|
Grid.prototype.setRic = function(rowRef, str, options) {
|
47471
47093
|
if(this._mainGrid) {
|
47472
|
-
this._mainGrid.setRic(this._toRowId(rowRef), str, options);
|
47473
|
-
return;
|
47094
|
+
return this._mainGrid.setRic(this._toRowId(rowRef), str, options);
|
47474
47095
|
}
|
47475
47096
|
let rowDef = this._getRowDefinitionByRef(rowRef);
|
47476
47097
|
if(rowDef) {
|
47477
|
-
|
47098
|
+
let tempOpt = options || {};
|
47478
47099
|
if(typeof str === "string") {
|
47479
47100
|
tempOpt["ric"] = str;
|
47480
47101
|
} else {
|
@@ -47496,6 +47117,7 @@ Grid.prototype.setRic = function(rowRef, str, options) {
|
|
47496
47117
|
rowDef.setStaticRowData(values, tempOpt["fields"]);
|
47497
47118
|
}
|
47498
47119
|
}
|
47120
|
+
return rowDef;
|
47499
47121
|
};
|
47500
47122
|
/** Unlink the chain and its constituents. When the chain is expanded,
|
47501
47123
|
* the chain row and its members are converted from autogenerated to
|
@@ -48760,7 +48382,7 @@ Grid.prototype._logData = function(rowDefs, options) {
|
|
48760
48382
|
// TODO: Get all required fields and eliminate duplicate fields
|
48761
48383
|
options["colNames"] = this.getColumnFields();
|
48762
48384
|
}
|
48763
|
-
let tbl =
|
48385
|
+
let tbl = DataCache.constructTable(rowDefs.map(toRowData), options);
|
48764
48386
|
|
48765
48387
|
console.table(tbl); // eslint-disable-line
|
48766
48388
|
};
|