@refinitiv-ui/efx-grid 6.0.8 → 6.0.9

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.
@@ -229,6 +229,10 @@ declare class Grid extends EventDispatcher {
229
229
 
230
230
  public setRowData(rowRef: Grid.RowReference|null, values: any): void;
231
231
 
232
+ public setStaticRowData(rowRef: Grid.RowReference|null, values: any): void;
233
+
234
+ public setStaticData(rowRef: Grid.RowReference|null, field: string, value: any): void;
235
+
232
236
  public getColumnIndex(colRef: Grid.ColumnReference|null): number;
233
237
 
234
238
  public getColumnIndices(colRefs: (Grid.ColumnReference)[]|null): (number)[];
@@ -2543,6 +2543,32 @@ Grid.prototype.setRowData = function(rowRef, values) {
2543
2543
  rowDef.setRowData(values);
2544
2544
  }
2545
2545
  };
2546
+
2547
+ /**
2548
+ * @public
2549
+ * @param {Grid~RowReference} rowRef
2550
+ * @param {Object} values
2551
+ */
2552
+ Grid.prototype.setStaticRowData = function(rowRef, values) {
2553
+ var rowDef = this._getRowDefinition(rowRef);
2554
+ if(rowDef) {
2555
+ rowDef.setStaticRowData(values);
2556
+ }
2557
+ };
2558
+
2559
+ /**
2560
+ * @public
2561
+ * @param {Grid~RowReference} rowRef
2562
+ * @param {string} field
2563
+ * @param {*} value
2564
+ */
2565
+ Grid.prototype.setStaticData = function(rowRef, field, value) {
2566
+ var rowDef = this._getRowDefinition(rowRef);
2567
+ if(rowDef) {
2568
+ rowDef.setStaticData(field, value);
2569
+ }
2570
+ };
2571
+
2546
2572
  /** @private
2547
2573
  * @param {Grid~RowReference=} rowRef
2548
2574
  * @return {string}
@@ -82,6 +82,8 @@ declare class ColumnStackPlugin extends GridPlugin {
82
82
 
83
83
  public getColumnIdsByIndex(columnIndex: number|(number)[]|null): (string)[];
84
84
 
85
+ public getColumnIndicesByColumnIds(columnId: string|(string)[]|null): (string)[];
86
+
85
87
  public addColumnToStack(colRef: number|string|null, stackId: string): void;
86
88
 
87
89
  public removeColumnFromStack(colRef: number|string|null): void;
@@ -949,6 +949,10 @@ ColumnStackPlugin.prototype.setStack = function(colRefs) {
949
949
  this._setColumnVisibility(colIndex, false);
950
950
  }
951
951
  }
952
+
953
+ // Make sure that all columns stay packed together
954
+ this._moveStackedColumns(stack.stackRefs);
955
+
952
956
  stack.activeColumn = stack.stackRefs[0]; // The first stacking (the first given columns) is the active column
953
957
  this._stacks[sid] = stack;
954
958
  var cfp = this._getPlugin("ColumnFilterPlugin");
@@ -1428,14 +1432,37 @@ ColumnStackPlugin.prototype.getColumnIdsByIndex = function(columnIndex) {
1428
1432
  return colIds;
1429
1433
  };
1430
1434
 
1435
+ /** @public
1436
+ * @description Get column indices by column ids
1437
+ * @param {string|Array<string>} columnId
1438
+ * @return {!Array.<string>} Column indices
1439
+ */
1440
+ ColumnStackPlugin.prototype.getColumnIndicesByColumnIds = function(columnId) {
1441
+ var colIndices = [];
1442
+ var colIds = [];
1443
+ if(Array.isArray(columnId)){
1444
+ colIds = columnId;
1445
+ } else {
1446
+ colIds.push(colIds);
1447
+ }
1448
+ for(var i = 0; i < colIds.length; ++i) {
1449
+ var colId = this.getColumnIndex(colIds[i]);
1450
+ colIndices.push(colId);
1451
+ }
1452
+ return colIndices;
1453
+ };
1454
+
1431
1455
  /** @public
1432
1456
  * @description Add specific column to a stack
1433
- * @param {number|string} colRef column id or column index
1457
+ * @param {number|string} colRef column field or column index
1434
1458
  * @param {string} stackId
1435
1459
  */
1436
1460
  ColumnStackPlugin.prototype.addColumnToStack = function(colRef, stackId) {
1437
1461
  if(typeof colRef === "string") {
1438
- colRef = this.getColumnIndex(colRef);
1462
+ var colIndices = this.getColumnIndices([colRef]);
1463
+ if(colIndices.length){
1464
+ colRef = colIndices[0];
1465
+ }
1439
1466
  }
1440
1467
 
1441
1468
  var stack = this._stacks[stackId];
@@ -1477,12 +1504,16 @@ ColumnStackPlugin.prototype.addColumnToStack = function(colRef, stackId) {
1477
1504
 
1478
1505
  /** @public
1479
1506
  * @description Remove specific column from a stack
1480
- * @param {number|string} colRef column id or column index
1507
+ * @param {number|string} colRef column field or column index
1481
1508
  */
1482
1509
  ColumnStackPlugin.prototype.removeColumnFromStack = function(colRef) {
1483
1510
  if(typeof colRef === "string") {
1484
- colRef = this.getColumnIndex(colRef);
1511
+ var colIndices = this.getColumnIndices([colRef]);
1512
+ if(colIndices.length){
1513
+ colRef = colIndices[0];
1514
+ }
1485
1515
  }
1516
+
1486
1517
  var stackId = this.getStackId(colRef);
1487
1518
  var stack = this._stacks[stackId];
1488
1519
  if(!stack || colRef == -1) {
@@ -1528,7 +1559,7 @@ ColumnStackPlugin.prototype.removeColumnFromStack = function(colRef) {
1528
1559
 
1529
1560
  /** @public
1530
1561
  * @description Reorder columns in a stack
1531
- * @param {Array.<number|string>} colRefs column ids or column indices
1562
+ * @param {Array.<number|string>} colRefs column fields or column indices
1532
1563
  * @param {string} stackId
1533
1564
  */
1534
1565
  ColumnStackPlugin.prototype.reorderStackColumns = function(colRefs, stackId) {
@@ -1542,9 +1573,7 @@ ColumnStackPlugin.prototype.reorderStackColumns = function(colRefs, stackId) {
1542
1573
  var len = colRefs.length;
1543
1574
  if(len) {
1544
1575
  if(typeof colRefs[0] === "string") {
1545
- for(var j = 0; j < len; j++ ){
1546
- colRefs[j] = this.getColumnIndex(colRefs[j]);
1547
- }
1576
+ colRefs = this.getColumnIndices(colRefs);
1548
1577
  }
1549
1578
  }
1550
1579
 
@@ -66,7 +66,7 @@ declare class ColumnStackPlugin extends GridPlugin {
66
66
 
67
67
  public getStackId(colIndex: number): string;
68
68
 
69
- public stackColumns(colRefs?: (number|string)[]|null, stackId?: string|null, options?: any): boolean;
69
+ public stackColumns(colRefs?: (number|string)[]|null, stackId?: string|null, options?: any, sort?: boolean|null): boolean;
70
70
 
71
71
  public setStack(colRefs?: (number|string)[]|null): boolean;
72
72
 
@@ -76,6 +76,20 @@ declare class ColumnStackPlugin extends GridPlugin {
76
76
 
77
77
  public swapColumn(colRef: number|Event|null, swappingIndex: number): boolean;
78
78
 
79
+ public getStackMemberIndices(stackId: string): (number)[];
80
+
81
+ public getStackMemberIds(stackId: string): (string)[];
82
+
83
+ public getColumnIdsByIndex(columnIndex: number|(number)[]|null): (string)[];
84
+
85
+ public getColumnIndicesByColumnIds(columnId: string|(string)[]|null): (string)[];
86
+
87
+ public addColumnToStack(colRef: number|string|null, stackId: string): void;
88
+
89
+ public removeColumnFromStack(colRef: number|string|null): void;
90
+
91
+ public reorderStackColumns(colRefs: (number|string)[]|null, stackId: string): void;
92
+
79
93
  }
80
94
 
81
95
  export default ColumnStackPlugin;
@@ -231,6 +231,10 @@ declare class Grid extends EventDispatcher {
231
231
 
232
232
  public setRowData(rowRef: Grid.RowReference|null, values: any): void;
233
233
 
234
+ public setStaticRowData(rowRef: Grid.RowReference|null, values: any): void;
235
+
236
+ public setStaticData(rowRef: Grid.RowReference|null, field: string, value: any): void;
237
+
234
238
  public getColumnIndex(colRef: Grid.ColumnReference|null): number;
235
239
 
236
240
  public getColumnIndices(colRefs: (Grid.ColumnReference)[]|null): (number)[];
package/lib/versions.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "tr-grid-column-grouping": "1.0.24",
13
13
  "tr-grid-column-resizing": "1.0.26",
14
14
  "tr-grid-column-selection": "1.0.25",
15
- "tr-grid-column-stack": "1.0.39",
15
+ "tr-grid-column-stack": "1.0.41",
16
16
  "tr-grid-conditional-coloring": "1.0.56",
17
17
  "tr-grid-content-wrap": "1.0.19",
18
18
  "tr-grid-contextmenu": "1.0.38",
package/package.json CHANGED
@@ -45,5 +45,5 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "version": "6.0.8"
48
+ "version": "6.0.9"
49
49
  }