@refinitiv-ui/efx-grid 6.0.127 → 6.0.129
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 +220 -11
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataCache.js +29 -0
- package/lib/core/es6/data/DataTable.d.ts +4 -0
- package/lib/core/es6/data/DataTable.js +117 -1
- package/lib/core/es6/data/DataView.d.ts +6 -0
- package/lib/core/es6/data/DataView.js +43 -0
- package/lib/core/es6/data/SegmentCollection.d.ts +2 -0
- package/lib/core/es6/data/SegmentCollection.js +21 -0
- package/lib/core/es6/grid/Core.js +1 -1
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +9 -9
- package/lib/grid/index.js +1 -1
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +6 -0
- package/lib/row-segmenting/es6/RowSegmenting.js +62 -11
- package/lib/rt-grid/dist/rt-grid.js +275 -32
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/DataConnector.js +1 -1
- package/lib/rt-grid/es6/Grid.js +42 -16
- package/lib/rt-grid/es6/RowDefinition.js +12 -4
- package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +3 -2
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +1100 -1124
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +2 -2
- package/lib/types/es6/CellSelection.d.ts +3 -2
- package/lib/types/es6/Core/data/DataTable.d.ts +4 -0
- package/lib/types/es6/Core/data/DataView.d.ts +6 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +2 -0
- package/lib/types/es6/RowSegmenting.d.ts +6 -0
- package/lib/versions.json +3 -3
- package/package.json +1 -1
@@ -31,7 +31,7 @@ DataConnector.prototype._fieldChangedConflator = null;
|
|
31
31
|
* @private
|
32
32
|
*/
|
33
33
|
DataConnector.prototype._ricChangedConflator = null;
|
34
|
-
/** @type {Object.<string, RowDefinition
|
34
|
+
/** @type {Object.<string, Array.<RowDefinition>>}
|
35
35
|
* @private
|
36
36
|
*/
|
37
37
|
DataConnector.prototype._rowDefMap = null;
|
package/lib/rt-grid/es6/Grid.js
CHANGED
@@ -524,6 +524,10 @@ Grid.prototype._formulaConflator = null;
|
|
524
524
|
*/
|
525
525
|
Grid.prototype._chainConflator = null;
|
526
526
|
/** @private
|
527
|
+
* @type {Object}
|
528
|
+
*/
|
529
|
+
Grid.prototype._constituentMap = null;
|
530
|
+
/** @private
|
527
531
|
* @type {number}
|
528
532
|
*/
|
529
533
|
Grid.prototype._clientWidth = NaN;
|
@@ -2370,10 +2374,10 @@ Grid.prototype.insertRow = function(rowOption, rowRef) {
|
|
2370
2374
|
}
|
2371
2375
|
}
|
2372
2376
|
let rowDef = new RowDefinition(rowOption);
|
2377
|
+
rowDef.registerToView(this._dv, this._getRowId(rowRef));
|
2373
2378
|
rowDef.setDataSource(this._dc, this._subs); // This could also subscribe chain index/ric to JET/RTK
|
2374
2379
|
this._initDuplicateRicData(rowDef);
|
2375
2380
|
|
2376
|
-
rowDef.registerToView(this._dv, this._getRowId(rowRef));
|
2377
2381
|
if(rowOption && rowOption["hidden"]) {
|
2378
2382
|
this._dv.hideRow(rowDef.getRowId()); // Try to obtain rowId in rowDef since rowId is not assigned when new rows are created.
|
2379
2383
|
}
|
@@ -2694,6 +2698,7 @@ Grid.prototype.removeAllRows = function() {
|
|
2694
2698
|
this._dcConflator.reset();
|
2695
2699
|
this._formulaConflator.reset();
|
2696
2700
|
this._chainConflator.reset();
|
2701
|
+
this._constituentMap = null;
|
2697
2702
|
this._connector.removeAllRics();
|
2698
2703
|
|
2699
2704
|
// TODO: This logic should also be in the core grid
|
@@ -3593,15 +3598,15 @@ Grid.prototype._onQuote2PostUpdate = function (e) {
|
|
3593
3598
|
* @param {Object} e
|
3594
3599
|
*/
|
3595
3600
|
Grid.prototype._onQ2DataChanged = function (e) {
|
3596
|
-
let
|
3597
|
-
let rowDef = this._getRowDefinitionById(subId);
|
3601
|
+
let rowDef = this._getRowDefinitionById(e["subId"]);
|
3598
3602
|
if(!rowDef) {
|
3599
3603
|
return; // WARNING: This should not be happened because row has been removed but the data is still received
|
3600
3604
|
}
|
3601
3605
|
|
3606
|
+
let ric = e["ric"];
|
3602
3607
|
let values = e["values"];
|
3603
3608
|
if (values) {
|
3604
|
-
let
|
3609
|
+
let duplicateRics = null;
|
3605
3610
|
if(rowDef.verifyConstituent(ric)) {
|
3606
3611
|
let parentDef = rowDef;
|
3607
3612
|
let childDef = parentDef.getConstituent(ric);
|
@@ -3612,15 +3617,28 @@ Grid.prototype._onQ2DataChanged = function (e) {
|
|
3612
3617
|
if(!childDef) {
|
3613
3618
|
return; // Parent chain is not alive
|
3614
3619
|
}
|
3620
|
+
duplicateRics = this._connector.getRowDefByRic(ric);
|
3615
3621
|
this._connector.addRic(childDef); // TODO: JET/RTK should not re-subscribe this
|
3622
|
+
if(!this._constituentMap) {
|
3623
|
+
this._constituentMap = {};
|
3624
|
+
}
|
3625
|
+
this._constituentMap[childDef.getRowId()] = childDef;
|
3616
3626
|
this._registerConstituents(childDef);
|
3617
3627
|
}
|
3618
3628
|
}
|
3619
3629
|
|
3630
|
+
if(duplicateRics && duplicateRics.length) {
|
3631
|
+
let duplicateRic = duplicateRics[0];
|
3632
|
+
duplicateRic.cloneRowData(values, values);
|
3633
|
+
}
|
3634
|
+
|
3620
3635
|
rowDef.setRowData(values); // Trigger data changes
|
3621
|
-
} else
|
3622
|
-
rowDef.
|
3623
|
-
|
3636
|
+
} else { // The constituent is requested to be removed by the real-time data provider
|
3637
|
+
let childDef = rowDef.getConstituent(ric); // WARNING: normal ric and its delayed version must match with the one first given
|
3638
|
+
if(childDef) {
|
3639
|
+
childDef.setParent(null); // Manually remove child reference from its parent
|
3640
|
+
this._removeRow(childDef);
|
3641
|
+
}
|
3624
3642
|
}
|
3625
3643
|
};
|
3626
3644
|
|
@@ -3631,6 +3649,9 @@ Grid.prototype._registerConstituents = function(rowDef) {
|
|
3631
3649
|
if(this._chainConflator.conflate(rowDef)) {
|
3632
3650
|
return;
|
3633
3651
|
}
|
3652
|
+
|
3653
|
+
this._constituentMap = null;
|
3654
|
+
|
3634
3655
|
let view = this._dv;
|
3635
3656
|
let dt = view ? view.getDataSource() : null;
|
3636
3657
|
if(!dt) {
|
@@ -3940,17 +3961,21 @@ Grid.prototype._onDataComposed = function(e) {
|
|
3940
3961
|
return; // Cannot do data composition if there is no change in data
|
3941
3962
|
}
|
3942
3963
|
|
3943
|
-
|
3944
|
-
if(!rowData) {
|
3964
|
+
if(!e["rowData"]) {
|
3945
3965
|
return; // Row could already be removed or global change event is sent
|
3946
3966
|
}
|
3947
3967
|
|
3948
|
-
let
|
3968
|
+
let rowId = e["rid"];
|
3969
|
+
let rowDef = this._getRowDefinitionById(rowId);
|
3949
3970
|
if(!rowDef) {
|
3950
|
-
|
3951
|
-
|
3952
|
-
|
3953
|
-
|
3971
|
+
rowDef = this._constituentMap ? this._constituentMap[rowId] : null; // Row def could be in pending for adding to view
|
3972
|
+
if(!rowDef) {
|
3973
|
+
return; // Somehow the given row id is invalid
|
3974
|
+
}
|
3975
|
+
if(rowDef.isDisposed()) {
|
3976
|
+
this._constituentMap[rowId] = null;
|
3977
|
+
return;
|
3978
|
+
}
|
3954
3979
|
}
|
3955
3980
|
|
3956
3981
|
if(this._autoDateConversion) { // auto data conversion
|
@@ -4011,8 +4036,8 @@ Grid.prototype._onSubSegmentChanged = function(e) {
|
|
4011
4036
|
rowDef = new RowDefinition({
|
4012
4037
|
"segmentId": segmentId // WARNING: This could cause row id duplication
|
4013
4038
|
});
|
4014
|
-
rowDef.setDataSource(this._dc); // auto generated row does not require a subscription
|
4015
4039
|
rowDef.registerToView(this._dv);
|
4040
|
+
rowDef.setDataSource(this._dc); // auto generated row does not require a subscription
|
4016
4041
|
}
|
4017
4042
|
};
|
4018
4043
|
|
@@ -4524,7 +4549,8 @@ Grid.prototype._onTabNavigation = function(e) {
|
|
4524
4549
|
*/
|
4525
4550
|
Grid.prototype._getEventHandlers = function() {
|
4526
4551
|
return {
|
4527
|
-
"tabNavigation": this._onTabNavigation
|
4552
|
+
"tabNavigation": this._onTabNavigation,
|
4553
|
+
"q2DataChanged": this._onQ2DataChanged
|
4528
4554
|
};
|
4529
4555
|
};
|
4530
4556
|
|
@@ -610,7 +610,10 @@ RowDefinition.prototype.setDataSource = function(dataSource, subs) {
|
|
610
610
|
this._dc = dataSource || null;
|
611
611
|
|
612
612
|
if(this._dc) {
|
613
|
-
this.setRowData(
|
613
|
+
this.setRowData({}); // Trigger data change
|
614
|
+
if(this._staticValues) {
|
615
|
+
this.setRowData(this._staticValues); // Trigger dataComposed and add updates
|
616
|
+
}
|
614
617
|
}
|
615
618
|
|
616
619
|
this._subs = subs || null;
|
@@ -736,9 +739,14 @@ RowDefinition.prototype.setRowData = function(data) {
|
|
736
739
|
/** @public
|
737
740
|
*/
|
738
741
|
RowDefinition.prototype.resetRowData = function() {
|
739
|
-
|
740
|
-
|
741
|
-
this.
|
742
|
+
let dc = this._dc;
|
743
|
+
if(dc) {
|
744
|
+
let rowId = this._rowId;
|
745
|
+
dc.setRowData(rowId, null);
|
746
|
+
dc.setRowData(rowId, {}); // Row data is guaranteed to be existed
|
747
|
+
if(this._staticValues) {
|
748
|
+
dc.setRowData(rowId, this._staticValues); // Trigger dataComposed and add updates
|
749
|
+
}
|
742
750
|
}
|
743
751
|
};
|
744
752
|
/** @public
|
@@ -2,7 +2,7 @@ import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
|
2
2
|
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
3
3
|
import { MouseDownTrait } from "../../tr-grid-util/es6/MouseDownTrait.js";
|
4
4
|
import { EventDispatcher } from "../../tr-grid-util/es6/EventDispatcher.js";
|
5
|
-
import {
|
5
|
+
import { cloneObject, prepareTSVContent } from "../../tr-grid-util/es6/Util.js";
|
6
6
|
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
7
7
|
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
8
8
|
|
@@ -16,7 +16,8 @@ declare namespace CellSelectionPlugin {
|
|
16
16
|
selectionChanged?: ((...params: any[]) => any)|null,
|
17
17
|
copy?: ((...params: any[]) => any)|null,
|
18
18
|
beforeMouseDown?: ((...params: any[]) => any)|null,
|
19
|
-
selectableSections?: any[]|null
|
19
|
+
selectableSections?: any[]|null,
|
20
|
+
copyDisabled?: boolean|null
|
20
21
|
};
|
21
22
|
|
22
23
|
}
|