@refinitiv-ui/efx-grid 6.1.29 → 6.1.30

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/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.1.29" };
3
+ window.EFX_GRID = { version: "6.1.30" };
@@ -47,6 +47,18 @@ declare namespace RowGroupingPlugin {
47
47
  groupId?: (number|string)|null
48
48
  };
49
49
 
50
+ type GroupedRowInfo = {
51
+ rowId: string,
52
+ parentRowId: string,
53
+ header: boolean,
54
+ groupLevel: number,
55
+ collapsed: boolean,
56
+ groupId?: string|null,
57
+ groupValue?: any,
58
+ hidden: boolean,
59
+ rowData: any
60
+ };
61
+
50
62
  }
51
63
 
52
64
  declare class RowGroupingPlugin extends GridPlugin {
@@ -115,6 +127,8 @@ declare class RowGroupingPlugin extends GridPlugin {
115
127
 
116
128
  public getFooterRowCount(): number;
117
129
 
130
+ public getGroupedRows(): (RowGroupingPlugin.GroupedRowInfo)[]|null;
131
+
118
132
  }
119
133
 
120
134
  declare function isNonFunction(obj: any): boolean;
@@ -121,6 +121,19 @@ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
121
121
  * @property {(number|string)=} groupId
122
122
  */
123
123
 
124
+ /** @typedef {Object} RowGroupingPlugin~GroupedRowInfo
125
+ * @description Represents a single row within a grouped. A row may be a group header or a normal data row.
126
+ * @property {string} rowId A unique identifier for this row. Used for tracking, rendering, and updates.
127
+ * @property {string} parentRowId A unique identifier for parent row.
128
+ * @property {boolean} header Indicates whether the row is a group header (true) or a regular data row (false).
129
+ * @property {number} groupLevel The zero‑based depth of the row within the grouping hierarchy. Level 0 represents a top‑level group or row.
130
+ * @property {boolean} collapsed The local collapsed state for this row if it is a group header. For content row, this will always be false
131
+ * @property {string=} groupId Identifier for the group represented by this row.
132
+ * @property {*=} groupValue The grouping key or value associated with this row.
133
+ * @property {boolean} hidden Whether this row is currently hidden from view. Usually derived from the collapsed states of ancestor rows or filtering logic.
134
+ * @property {Object} rowData The underlying data record associated with this row. For header rows, this will always be null.
135
+ */
136
+
124
137
  /** Creates groups based on the given criteria. Group should appears in order of data in the data view. Use {@link RowGroupingPlugin#sortGroups} to re-order groups manually.
125
138
  * @constructor
126
139
  * @extends {GridPlugin}
@@ -1761,6 +1774,77 @@ RowGroupingPlugin.prototype.getFooterRowCount = function () {
1761
1774
  return this._footerRows;
1762
1775
  };
1763
1776
 
1777
+ /** @public
1778
+ * @description
1779
+ * Returns a complete list of row information objects currently managed by the
1780
+ * grid’s grouping system. The returned array includes both group header rows
1781
+ * and regular data rows, in the same order they appear within the grouped structure.
1782
+ * @return {Array.<RowGroupingPlugin~GroupedRowInfo>}
1783
+ */
1784
+ RowGroupingPlugin.prototype.getGroupedRows = function () {
1785
+ let dv = this.getDataView();
1786
+ if (!dv) {
1787
+ return null;
1788
+ }
1789
+ let ary = [];
1790
+ let groupList = dv.hasGroup() ? dv.getAllGroups() : [dv];
1791
+ let groupCount = groupList.length;
1792
+ let visibilityStack = [true];
1793
+ let rowIdStack = [''];
1794
+ for(let i = 0; i < groupCount; ++i) {
1795
+ let groupDv = groupList[i];
1796
+ let groupRowId = groupDv.getGroupRowId();
1797
+ let groupLevel = groupDv.getGroupLevel();
1798
+ let effectiveVisibility = true;
1799
+ let parentRowId = '';
1800
+ if(groupLevel > 0) { // Only non root groups are included in the output
1801
+ // visibility of a group is always derived from its parent and ancestors' collapsed states
1802
+ effectiveVisibility = visibilityStack[groupLevel - 1];
1803
+ parentRowId = rowIdStack[groupLevel - 1];
1804
+ if(groupLevel + 1 >= visibilityStack.length) {
1805
+ visibilityStack[groupLevel] = effectiveVisibility && !groupDv.isCollapsed();
1806
+ rowIdStack[groupLevel] = groupRowId;
1807
+ } else {
1808
+ do {
1809
+ visibilityStack.pop();
1810
+ rowIdStack.pop();
1811
+ } while(groupLevel + 1 < visibilityStack.length);
1812
+ }
1813
+
1814
+ ary.push({
1815
+ "rowId": groupRowId,
1816
+ "parentRowId": parentRowId,
1817
+ "header": true,
1818
+ "groupLevel": groupLevel,
1819
+ "collapsed": groupDv.isCollapsed(),
1820
+ "groupId": groupDv.getGroupId(), // Group header specific info
1821
+ "groupValue": groupDv.getGroupValue(), // Group header specific info
1822
+ "hidden": !effectiveVisibility || dv.isRowFiltered(groupRowId),
1823
+ "rowData": null
1824
+ });
1825
+ }
1826
+ if(!groupDv.hasGroup()) { // If this is a leaf group, add its row members
1827
+ let rowIds = groupDv.getSortedRowIds(true);
1828
+ let rowCount = rowIds.length;
1829
+ effectiveVisibility = visibilityStack[groupLevel];
1830
+ for(let r = 0; r < rowCount; ++r) {
1831
+ let rowId = rowIds[r];
1832
+ let rowData = this._rowGetter(dv.getRowData(rowId));
1833
+ ary.push({
1834
+ "rowId": rowId,
1835
+ "parentRowId": groupRowId,
1836
+ "header": false,
1837
+ "groupLevel": groupLevel + 1,
1838
+ "collapsed": false,
1839
+ "hidden": !effectiveVisibility || dv.isRowFiltered(rowId, rowData),
1840
+ "rowData": rowData
1841
+ });
1842
+ }
1843
+ }
1844
+ }
1845
+ return ary;
1846
+ };
1847
+
1764
1848
  /** @function
1765
1849
  * @param {Object} obj
1766
1850
  * @return {boolean}
@@ -11,8 +11,10 @@ declare namespace HeatMapPlugin {
11
11
  };
12
12
 
13
13
  type HeatMap = {
14
+ mode?: string|null,
14
15
  midPoint?: number|null,
15
- mode?: string|null
16
+ min?: number|null,
17
+ max?: number|null
16
18
  };
17
19
 
18
20
  }
@@ -35,11 +37,13 @@ declare class HeatMapPlugin extends GridPlugin {
35
37
 
36
38
  public setColumnHeatMap(colIndex: number, columnDef: any, opt_grid?: any): void;
37
39
 
40
+ public _getColumnHeatMapOptions(hm: any, options?: any): boolean;
41
+
38
42
  public getColumnHeatMapOptions(colIndex: number, options?: any): any;
39
43
 
40
44
  }
41
45
 
42
- declare function cond(colIndex: number, options?: any): any;
46
+ declare function hmMode(hm: any, options?: any): boolean;
43
47
 
44
48
  export default HeatMapPlugin;
45
49
  export { HeatMapPlugin, HeatMapPlugin as HeatMap, HeatMapPlugin as HeatMapExtension };
@@ -47,6 +47,18 @@ declare namespace RowGroupingPlugin {
47
47
  groupId?: (number|string)|null
48
48
  };
49
49
 
50
+ type GroupedRowInfo = {
51
+ rowId: string,
52
+ parentRowId: string,
53
+ header: boolean,
54
+ groupLevel: number,
55
+ collapsed: boolean,
56
+ groupId?: string|null,
57
+ groupValue?: any,
58
+ hidden: boolean,
59
+ rowData: any
60
+ };
61
+
50
62
  }
51
63
 
52
64
  declare class RowGroupingPlugin extends GridPlugin {
@@ -115,6 +127,8 @@ declare class RowGroupingPlugin extends GridPlugin {
115
127
 
116
128
  public getFooterRowCount(): number;
117
129
 
130
+ public getGroupedRows(): (RowGroupingPlugin.GroupedRowInfo)[]|null;
131
+
118
132
  }
119
133
 
120
134
  declare function isNonFunction(obj: any): boolean;
package/lib/versions.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "tr-grid-range-bar": "2.0.9",
26
26
  "tr-grid-row-dragging": "1.0.39",
27
27
  "tr-grid-row-filtering": "1.0.90",
28
- "tr-grid-row-grouping": "1.0.91",
28
+ "tr-grid-row-grouping": "1.0.93",
29
29
  "tr-grid-row-selection": "1.0.33",
30
30
  "tr-grid-rowcoloring": "1.0.26",
31
31
  "tr-grid-textformatting": "1.0.49",
package/package.json CHANGED
@@ -77,5 +77,5 @@
77
77
  "publishConfig": {
78
78
  "access": "public"
79
79
  },
80
- "version": "6.1.29"
80
+ "version": "6.1.30"
81
81
  }