@refinitiv-ui/efx-grid 6.0.90 → 6.0.91

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.
@@ -88,6 +88,8 @@ declare class DataTable extends DataCache {
88
88
 
89
89
  public getSegment(rid: string): Segment|null;
90
90
 
91
+ public getSegmentParent(rid: string): string;
92
+
91
93
  public getSegmentLevel(rid: string): number;
92
94
 
93
95
  public getSegmentParentRowId(rid: string): string;
@@ -1037,7 +1037,7 @@ DataTable.prototype.isSegmentSeparator = function(rid) {
1037
1037
  /** Get Segment object
1038
1038
  * @public
1039
1039
  * @param {string} rid Row id
1040
- * @return {Segment} Return 0 if the given rid is not a segment
1040
+ * @return {Segment} Returns null if a segment cannot be found
1041
1041
  */
1042
1042
  DataTable.prototype.getSegment = function(rid) {
1043
1043
  if(this._segments) {
@@ -1045,6 +1045,17 @@ DataTable.prototype.getSegment = function(rid) {
1045
1045
  }
1046
1046
  return null;
1047
1047
  };
1048
+ /**
1049
+ * @public
1050
+ * @param {string} rid Row id of a segment child
1051
+ * @return {string} Returns null if a segment cannot be found
1052
+ */
1053
+ DataTable.prototype.getSegmentParent = function(rid) {
1054
+ if(this._segments) {
1055
+ return this._segments.getSegmentParent(rid);
1056
+ }
1057
+ return null;
1058
+ };
1048
1059
  /** Segment level starts from 1
1049
1060
  * @public
1050
1061
  * @param {string} rid
@@ -254,6 +254,8 @@ declare class DataView extends EventDispatcher {
254
254
 
255
255
  public getSegment(rid: string): Segment|null;
256
256
 
257
+ public getSegmentParent(rid: string): string;
258
+
257
259
  public getSegmentLevel(rid: string): number;
258
260
 
259
261
  public getSegmentParentRowId(rid: string): string;
@@ -2453,12 +2453,20 @@ DataView.prototype.isSegmentSeparator = function(rid) {
2453
2453
 
2454
2454
  /** Get Segment object
2455
2455
  * @public
2456
- * @param {string} rid Row id
2457
- * @return {Segment} Return 0 if the given rid is not a segment
2456
+ * @param {string} rid Row id of a segment
2457
+ * @return {Segment} Returns null if a segment cannot be found
2458
2458
  */
2459
2459
  DataView.prototype.getSegment = function(rid) {
2460
2460
  return this._dt.getSegment(rid);
2461
2461
  };
2462
+ /**
2463
+ * @public
2464
+ * @param {string} rid Row id of a segment child
2465
+ * @return {string} Returns null if a segment cannot be found
2466
+ */
2467
+ DataView.prototype.getSegmentParent = function(rid) {
2468
+ return this._dt.getSegmentParent(rid);
2469
+ };
2462
2470
  /** Segment level starts from 1
2463
2471
  * @public
2464
2472
  * @param {string} rid Row id
@@ -176,10 +176,12 @@ Segment.prototype.getSubSegmentIds = function(out_ary) {
176
176
  Segment.prototype.addChild = function(rid, dataId) {
177
177
  if(rid) {
178
178
  this._shared.childToSegment[rid] = this._rid;
179
- if(this._collapsed) {
180
- this._shared.dirtyCollapsingState = true; // TODO: Check if we need to update this only when new child is added
181
- }
182
- if(!this._children[rid]) {
179
+ if(this._children[rid]) {
180
+ this._children[rid] = dataId || rid; // Update data id
181
+ } else {
182
+ if(this._collapsed) {
183
+ this._shared.dirtyCollapsingState = true; // TODO: Check if we need to update this only when new child is added
184
+ }
183
185
  this._children[rid] = dataId || rid;
184
186
  ++this._childCount;
185
187
  return true;
@@ -24,6 +24,8 @@ declare class SegmentCollection extends EventDispatcher {
24
24
 
25
25
  public getSegment(rid: string): Segment|null;
26
26
 
27
+ public getSegmentParent(rid: string): Segment|null;
28
+
27
29
  public getSegments(): { [key: string]: Segment }|null;
28
30
 
29
31
  public getSegmentIds(): (string)[];
@@ -184,6 +184,17 @@ SegmentCollection.prototype.getSegment = function(rid) {
184
184
  return this._segments[rid] || null;
185
185
  };
186
186
  /** @public
187
+ * @param {string} rid
188
+ * @return {Segment}
189
+ */
190
+ SegmentCollection.prototype.getSegmentParent = function(rid) {
191
+ var parentRowId = this.getParentRowId(rid);
192
+ if(parentRowId) {
193
+ return this.getSegment(parentRowId);
194
+ }
195
+ return null;
196
+ };
197
+ /** @public
187
198
  * @return {Object.<string, Segment>}
188
199
  */
189
200
  SegmentCollection.prototype.getSegments = function() {
@@ -574,7 +574,7 @@ Core.prototype._hasPendingRowChange = false;
574
574
  * @return {string}
575
575
  */
576
576
  Core.getVersion = function () {
577
- return "5.1.93";
577
+ return "5.1.94";
578
578
  };
579
579
  /** {@link ElementWrapper#dispose}
580
580
  * @override
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.90" };
3
+ window.EFX_GRID = { version: "6.0.91" };
package/package.json CHANGED
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "version": "6.0.90"
69
+ "version": "6.0.91"
70
70
  }