@refinitiv-ui/efx-grid 6.0.121 → 6.0.123

Sign up to get free protection for your applications and to get access to all the features.
package/lib/grid/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import {Grid} from "./lib/efx-grid.js";
2
2
  export {Grid}
3
- window.EFX_GRID = { version: "6.0.121" };
3
+ window.EFX_GRID = { version: "6.0.123" };
@@ -13210,7 +13210,7 @@ RowDefinition.prototype.initialize = function(rowOptions) {
13210
13210
  this._asSegment = val ? true : false;
13211
13211
  }
13212
13212
 
13213
- if(this._isChain) {
13213
+ if(this._isChain || this._asSegment) {
13214
13214
  this._collapsed = extractedOptions["collapsed"]; // Temporary state
13215
13215
  }
13216
13216
 
@@ -14082,9 +14082,10 @@ RowDefinition.prototype.addConstituent = function(ric) {
14082
14082
  };
14083
14083
 
14084
14084
  /** Used to convert autogenerated row to regular real-time row
14085
- * @private
14085
+ * @public
14086
+ * @ignore
14086
14087
  */
14087
- RowDefinition.prototype._toRealTimeRow = function() {
14088
+ RowDefinition.prototype.toRealTimeRow = function() {
14088
14089
  if(!this._ric) { // Empty row
14089
14090
  return;
14090
14091
  }
@@ -14113,14 +14114,6 @@ RowDefinition.prototype.unlinkChain = function() {
14113
14114
  return;
14114
14115
  }
14115
14116
 
14116
- if(this.isChainExpanded()) {
14117
- let rowDefs = this.getDescendants();
14118
- let len = rowDefs.length;
14119
- for(let i = 0; i < len; i++) {
14120
- rowDefs[i]._toRealTimeRow();
14121
- }
14122
- }
14123
-
14124
14117
  let staticData = this._cloneStaticRowData();
14125
14118
  this.unsubscribeForUpdates();
14126
14119
 
@@ -14348,6 +14341,7 @@ RowDefinition.extractRowOptions = function(rowOptions) {
14348
14341
  let permId = rowOptions["permId"];
14349
14342
  let chainRic = rowOptions["chainRic"];
14350
14343
  let collapsed = rowOptions["collapsed"];
14344
+ let asSegment = rowOptions["asSegment"];
14351
14345
  let asChain = rowOptions["asChain"];
14352
14346
  if(asChain == null && chainRic){
14353
14347
  asChain = true;
@@ -14360,6 +14354,8 @@ RowDefinition.extractRowOptions = function(rowOptions) {
14360
14354
  expanded = true;
14361
14355
  } else if(asChain) {
14362
14356
  expanded = false;
14357
+ } else if(asSegment) {
14358
+ expanded = true;
14363
14359
  }
14364
14360
 
14365
14361
  let extractedOptions = {};
@@ -47586,21 +47582,31 @@ Grid.prototype._removeRow = function(rowDef) {
47586
47582
  }
47587
47583
  this._dispatch("beforeRowRemoved", {});
47588
47584
 
47589
- let connector = this._connector;
47590
- let dt = this._dt;
47591
47585
  let childRowDefs = rowDef.getDescendants(); // TODO: Support nested child
47592
- if(childRowDefs) { // Remove all children first
47593
- for(let i = 0; i < childRowDefs.length; i++) {
47594
- connector.removeRic(childRowDefs[i]);
47595
- }
47596
- let rowIds = childRowDefs.map(RowDefinition.toRowId);
47597
- dt.removeRows(rowIds);
47586
+ if(childRowDefs) {
47587
+ this._removeConstituentRows(childRowDefs);
47598
47588
  }
47599
- connector.removeRic(rowDef);
47600
- dt.removeRow(rowDef.getRowId()); // TODO: Merge this with the above removeRows() method
47589
+ this._connector.removeRic(rowDef);
47590
+ this._dt.removeRow(rowDef.getRowId()); // TODO: Merge this with the above removeRows() method
47601
47591
  rowDef.dispose(); // WARNING: This does not remove child reference from its parent
47602
47592
  };
47603
47593
 
47594
+ /** @private
47595
+ * @param {Array.<RowDefinition>} rowDefs
47596
+ */
47597
+ Grid.prototype._removeConstituentRows = function(rowDefs) {
47598
+ let connector = this._connector;
47599
+ let rowIds = [];
47600
+ for(let i = 0; i < rowDefs.length; i++) {
47601
+ let childRowDef = rowDefs[i];
47602
+ rowIds.push(childRowDef.getRowId());
47603
+ connector.removeRic(childRowDef);
47604
+ childRowDef.dispose();
47605
+ }
47606
+
47607
+ this._dt.removeRows(rowIds);
47608
+ };
47609
+
47604
47610
  /** @public
47605
47611
  * @param {Grid~RowReference} rowRef
47606
47612
  * @param {boolean=} hidden if false, show instead of hide
@@ -47705,7 +47711,20 @@ Grid.prototype.unlinkChain = function(rowRef) {
47705
47711
  }
47706
47712
 
47707
47713
  this._unlinking = true;
47714
+
47715
+ let childRowDefs = rowDef.getDescendants(); // TODO: Support nested child
47716
+ if(childRowDefs) {
47717
+ if(rowDef.isChainExpanded()) {
47718
+ for(let i = 0; i < childRowDefs.length; i++) {
47719
+ childRowDefs[i].toRealTimeRow();
47720
+ }
47721
+ } else {
47722
+ this._removeConstituentRows(childRowDefs);
47723
+ }
47724
+ }
47725
+
47708
47726
  rowDef.unlinkChain();
47727
+
47709
47728
  this._unlinking = false;
47710
47729
  };
47711
47730
 
@@ -48474,7 +48493,7 @@ Grid.prototype._onDataChanged = function(e) {
48474
48493
  let subId = rowData[SUB_ID]; // The constituent will share the same sub id as its parent
48475
48494
  if(subId) {
48476
48495
  let parentDef = this._getRowDefinitionById(subId);
48477
- if(parentDef && parentDef.getRic() !== rowData["RIC"]) { // TODO: Check for delayed ric
48496
+ if(parentDef && parentDef.isChain() && parentDef.getRic() !== rowData["RIC"]) { // TODO: Check for delayed ric
48478
48497
  if(!this._chainMembers) {
48479
48498
  this._chainMembers = {};
48480
48499
  }