@refinitiv-ui/efx-grid 6.0.126 → 6.0.128

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.
@@ -10,7 +10,7 @@ declare namespace ConditionalColoringPlugin {
10
10
  type Options = {
11
11
  predefinedColors?: any,
12
12
  blinkingDuration?: number|null,
13
- insertionBlinking?: boolean|null
13
+ insertionBlinking?: (boolean|string)|null
14
14
  };
15
15
 
16
16
  type ColumnOptions = {
@@ -82,7 +82,7 @@ declare class ConditionalColoringPlugin extends GridPlugin {
82
82
 
83
83
  public setPredefinedColors(predefinedColors: any): void;
84
84
 
85
- public setInsertionBlinking(blinking: boolean): void;
85
+ public setInsertionBlinking(blinking: boolean|string|null): void;
86
86
 
87
87
  public getColumnPainter(colIndex: number): CellPainter|null;
88
88
 
@@ -9,7 +9,8 @@ import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
9
9
  * @description The options can be specified by `conditionalColoring` property of the main grid's options
10
10
  * @property {Object=} predefinedColors Predefined color object map for conditional coloring
11
11
  * @property {number=} blinkingDuration=250 Blinking duration in milliseconds
12
- * @property {boolean=} insertionBlinking=false Blinking when a row is added to a grid
12
+ * @property {(boolean|string)=} insertionBlinking=false When a new row is added to Grid, cell will blink.
13
+ * Specify true for blinking with theme's neutral movement color. To blink cell with a certain color, specify a string of hex color value.
13
14
  */
14
15
 
15
16
  /** @typedef {Object} ConditionalColoringPlugin~ColumnOptions
@@ -56,7 +57,7 @@ import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
56
57
 
57
58
  /** @typedef {(string|boolean|Object)} ConditionalColoringPlugin~Blinking
58
59
  * @description Available options describing `blinking` object. Additionally if specify blinking as string of field, blinking will base on the field. <br>
59
- * If specified true, field from column definition will be used.
60
+ * If specified true, field from column definition will be used. If up, down and level value are not specified, theme's movement colors will be used.
60
61
  * @property {boolean=} border=false If enabled, border will be blinked instead of background
61
62
  * @property {string=} field If not specified, field from column definition will be used
62
63
  * @property {string=} up CSS color (e.g. #00ff00, green)
@@ -170,7 +171,7 @@ ConditionalColoringPlugin.prototype._predefinedColors = null;
170
171
  * @private
171
172
  */
172
173
  ConditionalColoringPlugin.prototype._blinkingDuration = 250;
173
- /** @type {boolean}
174
+ /** @type {boolean|string}
174
175
  * @private
175
176
  */
176
177
  ConditionalColoringPlugin.prototype._insertionBlinking = false;
@@ -1114,7 +1115,8 @@ ConditionalColoringPlugin.prototype.setPredefinedColors = function(predefinedCol
1114
1115
  }
1115
1116
  };
1116
1117
  /** @public
1117
- * @param {boolean} blinking enable blinking on row insertion
1118
+ * @param {boolean|string} blinking Enable blinking on row insertion. Specify true for blinking with theme's neutral movement color.
1119
+ * To blink cell with a certain color, specify a string of hex color value.
1118
1120
  */
1119
1121
  ConditionalColoringPlugin.prototype.setInsertionBlinking = function(blinking) {
1120
1122
  if (blinking != null) {
@@ -1199,7 +1201,11 @@ ConditionalColoringPlugin.prototype._onSectionBinding = function (e) {
1199
1201
 
1200
1202
  let prevDataRow, prevDataRows = host._prevDataRows;
1201
1203
  let isPrevRowExisted = !isEmptyObject(prevDataRows);
1204
+ let api = this.getGridApi();
1202
1205
  for (r = fromR; r < toR; ++r) {
1206
+ rid = dv.getRowId(r);
1207
+ if (!rid) { continue; }
1208
+
1203
1209
  dataRow = this._rowGetter(dataRows[r]);
1204
1210
  if (!dataRow) continue; // prevent from null value access when using with RowGroupingExtension
1205
1211
 
@@ -1208,10 +1214,8 @@ ConditionalColoringPlugin.prototype._onSectionBinding = function (e) {
1208
1214
  let insertedRow = null;
1209
1215
  if (blinkingEnabled) {
1210
1216
  if (this._realTimeGrid) {
1211
- // TODO: check rid from e.rids
1212
- rowDef = /** @type{RowDefinition} */(dataRow["ROW_DEF"]);
1217
+ rowDef = api.getRowDefinition(rid);
1213
1218
  if(rowDef){
1214
- rid = rowDef.getRowId();
1215
1219
  changedCols = rowDef.getUpdates();
1216
1220
  }
1217
1221
  } else { // composite grid
@@ -1228,16 +1232,6 @@ ConditionalColoringPlugin.prototype._onSectionBinding = function (e) {
1228
1232
  }
1229
1233
  }
1230
1234
 
1231
- if (!rid) {
1232
- if (this._realTimeGrid) {
1233
- // TODO: check rid from e.rids
1234
- rowDef = /** @type{RowDefinition} */(dataRow["ROW_DEF"]);
1235
- rid = rowDef ? rowDef.getRowId() : "";
1236
- } else {
1237
- rid = dv.getRowId(r);
1238
- }
1239
- }
1240
-
1241
1235
  prevDataRow = prevDataRows[rid];
1242
1236
  cachedValues = {};
1243
1237
  updatePrev = false;
@@ -1268,7 +1262,7 @@ ConditionalColoringPlugin.prototype._onSectionBinding = function (e) {
1268
1262
  } else {
1269
1263
  if(isPrevRowExisted && insertedRow){
1270
1264
  blinking = true;
1271
- bgBlinking = painter.blink(cell, 0, dataRow);
1265
+ bgBlinking = painter.flash(cell, this._insertionBlinking, dataRow);
1272
1266
  }
1273
1267
  }
1274
1268
  }