@refinitiv-ui/efx-grid 6.1.7 → 6.1.8

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.7" };
3
+ window.EFX_GRID = { version: "6.1.8" };
@@ -1,9 +1,9 @@
1
- import {Ext} from '../../tr-grid-util/es6/Ext.js';
2
- import {GridPlugin} from '../../tr-grid-util/es6/GridPlugin.js';
3
- import {extendObject, injectCss, prettifyCss} from '../../tr-grid-util/es6/Util.js';
4
- import {CellPainter} from '../../tr-grid-util/es6/CellPainter.js';
5
- import {FilterBuilder} from '../../tr-grid-util/es6/FilterBuilder.js';
6
- import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
1
+ import {Ext} from "../../tr-grid-util/es6/Ext.js";
2
+ import {GridPlugin} from "../../tr-grid-util/es6/GridPlugin.js";
3
+ import {extendObject, injectCss, prettifyCss} from "../../tr-grid-util/es6/Util.js";
4
+ import {CellPainter} from "../../tr-grid-util/es6/CellPainter.js";
5
+ import {FilterBuilder} from "../../tr-grid-util/es6/FilterBuilder.js";
6
+ import {ElfUtil} from "../../tr-grid-util/es6/ElfUtil.js";
7
7
 
8
8
  declare namespace ConditionalColoringPlugin {
9
9
 
@@ -80,6 +80,8 @@ declare class ConditionalColoringPlugin extends GridPlugin {
80
80
 
81
81
  public blinkRow(rowIndex: number, blinkSignal: number, host?: any): void;
82
82
 
83
+ public blinkCell(cell: any, colIndex: number, blinkSignal: number, rowData?: any): void;
84
+
83
85
  public setPredefinedColors(predefinedColors: any): void;
84
86
 
85
87
  public setInsertionBlinking(blinking: boolean|string|null): void;
@@ -1,9 +1,9 @@
1
- import {Ext} from '../../tr-grid-util/es6/Ext.js';
2
- import {GridPlugin} from '../../tr-grid-util/es6/GridPlugin.js';
3
- import {extendObject, injectCss, prettifyCss} from '../../tr-grid-util/es6/Util.js';
4
- import {CellPainter} from '../../tr-grid-util/es6/CellPainter.js';
5
- import {FilterBuilder} from '../../tr-grid-util/es6/FilterBuilder.js';
6
- import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
1
+ import {Ext} from "../../tr-grid-util/es6/Ext.js";
2
+ import {GridPlugin} from "../../tr-grid-util/es6/GridPlugin.js";
3
+ import {extendObject, injectCss, prettifyCss} from "../../tr-grid-util/es6/Util.js";
4
+ import {CellPainter} from "../../tr-grid-util/es6/CellPainter.js";
5
+ import {FilterBuilder} from "../../tr-grid-util/es6/FilterBuilder.js";
6
+ import {ElfUtil} from "../../tr-grid-util/es6/ElfUtil.js";
7
7
 
8
8
  /** @typedef {Object} ConditionalColoringPlugin~Options
9
9
  * @description The options can be specified by `conditionalColoring` property of the main grid's options
@@ -730,7 +730,7 @@ ConditionalColoringPlugin.prototype.setConditionalColoring = function (colIndex,
730
730
  if (this._initializedGrid) {
731
731
  let core = this._hosts[0];
732
732
  if(core){
733
- let rowColoring = core.getPlugin('RowColoringPlugin');
733
+ let rowColoring = core.getPlugin("RowColoringPlugin");
734
734
  if(rowColoring && rowColoring.forceUpdateRowColor){
735
735
  rowColoring.forceUpdateRowColor();
736
736
  }
@@ -817,7 +817,7 @@ ConditionalColoringPlugin.prototype.blinkRow = function (rowIndex, blinkSignal,
817
817
  let dv = host.getDataSource();
818
818
  if (!dv) return;
819
819
 
820
- let section = host.getSection('content');
820
+ let section = host.getSection("content");
821
821
  if (!section) return;
822
822
 
823
823
  let rowData = dv.getRowDataAt(rowIndex);
@@ -833,6 +833,22 @@ ConditionalColoringPlugin.prototype.blinkRow = function (rowIndex, blinkSignal,
833
833
  }
834
834
  };
835
835
 
836
+ /** Blink the specified cell based on the specified column's blink configuration
837
+ * @public
838
+ * @param {Object} cell Cell instance to be blinked
839
+ * @param {number} colIndex Column index of the column in which blink configuration will be used. If blinking is not enabled for the column, this method has no effect
840
+ * @param {number} blinkSignal
841
+ * @param {Object=} rowData Row data source for restoring existing conditional color of the cell
842
+ */
843
+ ConditionalColoringPlugin.prototype.blinkCell = function (cell, colIndex, blinkSignal, rowData) {
844
+ if(cell) {
845
+ let painter = this.getColumnPainter(colIndex);
846
+ if(painter) {
847
+ painter.blink(cell, blinkSignal, rowData);
848
+ }
849
+ }
850
+ };
851
+
836
852
  /** @private
837
853
  * @param {number} colIndex
838
854
  * @param {(boolean|ConditionalColoringPlugin~Blinking)=} blinkingOptions
@@ -129,6 +129,8 @@ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
129
129
  let RowGroupingPlugin = function (options) {
130
130
  let t = this;
131
131
  t._onColumnIndexChanged = t._onColumnIndexChanged.bind(t);
132
+ t._onColumnWidthChanged = t._onColumnWidthChanged.bind(t);
133
+ t._onFirstRendered = t._onFirstRendered.bind(t);
132
134
  t._getRowsForContentAsHeader = t._getRowsForContentAsHeader.bind(t);
133
135
  t._onPostSectionDataBinding = t._onPostSectionDataBinding.bind(t);
134
136
  t._onCellClicked = t._onCellClicked.bind(t);
@@ -284,11 +286,18 @@ RowGroupingPlugin._controlClass = "predefined-color-tag";
284
286
  * @private
285
287
  */
286
288
  RowGroupingPlugin.prototype._styleTag = null;
287
-
288
289
  /** @type {Function}
289
290
  * @private
290
291
  */
291
292
  RowGroupingPlugin.prototype._criteriaGetter = null;
293
+ /** @type {boolean}
294
+ * @private
295
+ */
296
+ RowGroupingPlugin.prototype._firstRendered = false;
297
+ /** @type {number}
298
+ * @private
299
+ */
300
+ RowGroupingPlugin.prototype._columnSizeLimit = -1; // Negative value means no limit
292
301
 
293
302
 
294
303
  /** @private
@@ -410,6 +419,8 @@ RowGroupingPlugin.prototype.initialize = function (host, options) {
410
419
  host.listen("columnMoved", this._onColumnIndexChanged);
411
420
  host.listen("columnAdded", this._onColumnIndexChanged);
412
421
  host.listen("columnRemoved", this._onColumnIndexChanged);
422
+ host.listen("widthChanged", this._onColumnWidthChanged);
423
+ host.listen("firstRendered", this._onFirstRendered);
413
424
  host.listen("postSectionDataBinding", this._onPostSectionDataBinding);
414
425
 
415
426
  this.config(options);
@@ -438,6 +449,8 @@ RowGroupingPlugin.prototype.unload = function (host) {
438
449
  host.unlisten("columnMoved", this._onColumnIndexChanged);
439
450
  host.unlisten("columnAdded", this._onColumnIndexChanged);
440
451
  host.unlisten("columnRemoved", this._onColumnIndexChanged);
452
+ host.unlisten("widthChanged", this._onColumnWidthChanged);
453
+ host.unlisten("firstRendered", this._onFirstRendered);
441
454
  host.unlisten("postSectionDataBinding", this._onPostSectionDataBinding);
442
455
 
443
456
  this._hosts.splice(at, 1);
@@ -1285,6 +1298,21 @@ RowGroupingPlugin.prototype._updateDisplayColumn = function () {
1285
1298
  return this._headerColumn;
1286
1299
  };
1287
1300
 
1301
+ /** Column size limit is used to determine appropriate indent size. In limited space, indents will be reduced to fit into the size
1302
+ * @private
1303
+ * @param {Object} section LayoutGrid or VirtualizedLayoutGrid
1304
+ * @returns {number}
1305
+ */
1306
+ RowGroupingPlugin.prototype._getColumnSizeLimit = function (section) {
1307
+ if (!this._headerSpanning && section) {
1308
+ let cell = section.getCell(this._headerColumn, 0, false);
1309
+ if(cell) {
1310
+ let sizeLimit = cell.getWidth() - 27; // Ensure padding will subtract icon width (25px for halo, 27px for solar)
1311
+ return sizeLimit > 0 ? sizeLimit : 0;
1312
+ }
1313
+ }
1314
+ return -1; // Negative value means no limit
1315
+ };
1288
1316
  /** TODO: Need to support when column reordered
1289
1317
  * @private
1290
1318
  * @param {Object} settings SectionSettings
@@ -1309,11 +1337,7 @@ RowGroupingPlugin.prototype._updateHeader = function (settings, firstRowIndex, l
1309
1337
  let li = (lastRowIndex != null) ? lastRowIndex : section.getLastIndexInView();
1310
1338
  let rowsForContentHeader = this._getRowsForContentAsHeader();
1311
1339
 
1312
- let maxColWidth = -1; // -1 means no limit
1313
- let colCell = section.getCell(headerColumn, 0, false);
1314
- if (!this._headerSpanning && colCell) {
1315
- maxColWidth = colCell.getWidth() - 27; // Ensure padding will subtract icon width (25px for halo, 27px for solar)
1316
- }
1340
+ let columnSizeLimit = this._columnSizeLimit = this._getColumnSizeLimit(section);
1317
1341
 
1318
1342
  let colCount = section.getColumnCount();
1319
1343
  let nonGroupListener = this.hasListener("nonGroupBinding");
@@ -1420,8 +1444,8 @@ RowGroupingPlugin.prototype._updateHeader = function (settings, firstRowIndex, l
1420
1444
  indentSize += this._arrowSize;
1421
1445
  }
1422
1446
  }
1423
- if (maxColWidth > -1 && maxColWidth < indentSize) {
1424
- indentSize = maxColWidth;
1447
+ if (columnSizeLimit > -1 && columnSizeLimit < indentSize) {
1448
+ indentSize = columnSizeLimit;
1425
1449
  }
1426
1450
 
1427
1451
  let groupColor;
@@ -1497,6 +1521,31 @@ RowGroupingPlugin.prototype._onColumnIndexChanged = function (e) {
1497
1521
  }
1498
1522
  };
1499
1523
 
1524
+ /** @private
1525
+ * @param {Object} e
1526
+ */
1527
+ RowGroupingPlugin.prototype._onColumnWidthChanged = function (e) {
1528
+ // Check if there is a need to request a row refresh
1529
+ if(this._disabled || !this._firstRendered || this._headerSpanning) {
1530
+ return;
1531
+ }
1532
+
1533
+ let host = this._hosts[0];
1534
+ if(host) {
1535
+ let columnSizeLimit = this._getColumnSizeLimit(host.getSection("content"));
1536
+ if(columnSizeLimit !== this._columnSizeLimit) {
1537
+ this._columnSizeLimit = columnSizeLimit;
1538
+ host.requestRowRefresh(); // To refresh the indentation
1539
+ }
1540
+ }
1541
+ };
1542
+ /** @private
1543
+ * @param {Object} e
1544
+ */
1545
+ RowGroupingPlugin.prototype._onFirstRendered = function (e) {
1546
+ this._firstRendered = true;
1547
+ };
1548
+
1500
1549
  /** @public */
1501
1550
  RowGroupingPlugin.prototype.updateHeaders = function () {
1502
1551
  this._timerId = 0;
@@ -1,9 +1,9 @@
1
- import {Ext} from '../../tr-grid-util/es6/Ext.js';
2
- import {GridPlugin} from '../../tr-grid-util/es6/GridPlugin.js';
3
- import {extendObject, injectCss, prettifyCss} from '../../tr-grid-util/es6/Util.js';
4
- import {CellPainter} from '../../tr-grid-util/es6/CellPainter.js';
5
- import {FilterBuilder} from '../../tr-grid-util/es6/FilterBuilder.js';
6
- import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
1
+ import {Ext} from "../../tr-grid-util/es6/Ext.js";
2
+ import {GridPlugin} from "../../tr-grid-util/es6/GridPlugin.js";
3
+ import {extendObject, injectCss, prettifyCss} from "../../tr-grid-util/es6/Util.js";
4
+ import {CellPainter} from "../../tr-grid-util/es6/CellPainter.js";
5
+ import {FilterBuilder} from "../../tr-grid-util/es6/FilterBuilder.js";
6
+ import {ElfUtil} from "../../tr-grid-util/es6/ElfUtil.js";
7
7
 
8
8
  declare namespace ConditionalColoringPlugin {
9
9
 
@@ -80,6 +80,8 @@ declare class ConditionalColoringPlugin extends GridPlugin {
80
80
 
81
81
  public blinkRow(rowIndex: number, blinkSignal: number, host?: any): void;
82
82
 
83
+ public blinkCell(cell: any, colIndex: number, blinkSignal: number, rowData?: any): void;
84
+
83
85
  public setPredefinedColors(predefinedColors: any): void;
84
86
 
85
87
  public setInsertionBlinking(blinking: boolean|string|null): void;
package/lib/versions.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "tr-grid-column-resizing": "1.0.29",
15
15
  "tr-grid-column-selection": "1.0.33",
16
16
  "tr-grid-column-stack": "1.0.76",
17
- "tr-grid-conditional-coloring": "1.0.74",
17
+ "tr-grid-conditional-coloring": "1.0.78",
18
18
  "tr-grid-content-wrap": "1.0.20",
19
19
  "tr-grid-contextmenu": "1.0.44",
20
20
  "tr-grid-filter-input": "0.9.43",
@@ -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.88",
28
+ "tr-grid-row-grouping": "1.0.89",
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.7"
80
+ "version": "6.1.8"
81
81
  }