@refinitiv-ui/efx-grid 6.0.108 → 6.0.110

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.
@@ -25217,7 +25217,6 @@ let Core_Core = function (opt_initializer) {
25217
25217
  _t._onRowHightlighted = _t._onRowHightlighted.bind(_t);
25218
25218
  _t._onGridClicked = _t._onGridClicked.bind(_t);
25219
25219
  _t._onKeyDown = _t._onKeyDown.bind(_t);
25220
- _t._onKeyUp = _t._onKeyUp.bind(_t);
25221
25220
 
25222
25221
  _t._onWindowResize = _t._onWindowResize.bind(_t);
25223
25222
  _t._onSectionDataChanged = _t._onSectionDataChanged.bind(_t);
@@ -25305,7 +25304,6 @@ let Core_Core = function (opt_initializer) {
25305
25304
 
25306
25305
 
25307
25306
  _t._element.addEventListener("keydown", _t._onKeyDown);
25308
- _t._element.addEventListener("keyup", _t._onKeyUp);
25309
25307
  if (util.isMobile || util.isTouchDevice) {
25310
25308
  _t._element.addEventListener("touchmove", _t._onMouseMove, false);
25311
25309
  } else {
@@ -25712,7 +25710,7 @@ Core_Core.prototype._hasPendingRowChange = false;
25712
25710
  * @return {string}
25713
25711
  */
25714
25712
  Core_Core.getVersion = function () {
25715
- return "5.1.110";
25713
+ return "5.1.113";
25716
25714
  };
25717
25715
  /** {@link ElementWrapper#dispose}
25718
25716
  * @override
@@ -25855,6 +25853,9 @@ Core_Core.prototype.getConfigObject = function (gridOptions) {
25855
25853
  if (columnDef["rightPinned"]) {
25856
25854
  column["rightPinned"] = columnDef["rightPinned"];
25857
25855
  }
25856
+ if (columnDef["backgroundColor"]) {
25857
+ column["backgroundColor"] = columnDef["backgroundColor"];
25858
+ }
25858
25859
  }
25859
25860
 
25860
25861
  // It will be overwrite in rt-grid or atlas-blotter
@@ -27143,6 +27144,10 @@ Core_Core.prototype._deserializeColumn = function (index, jsonObj) {
27143
27144
  if (value != null) {
27144
27145
  colDef["rightPinned"] = value ? true : false;
27145
27146
  }
27147
+ value = jsonObj["backgroundColor"];
27148
+ if (value != null) {
27149
+ this.setColumnBackgroundColor(index, value);
27150
+ }
27146
27151
 
27147
27152
  this.setColumnRenderingHandler(index, jsonObj["renderingHandler"]);
27148
27153
  this.setColumnDataBindingHandler(index, jsonObj["dataBindingHandler"]);
@@ -27402,6 +27407,56 @@ Core_Core.prototype.setColumnStyle = function (colIndex, style, value, opt_type)
27402
27407
  }
27403
27408
  };
27404
27409
 
27410
+ /** @public
27411
+ * @param {number} colIndex
27412
+ * @return {string}
27413
+ */
27414
+ Core_Core.prototype.getColumnBackgroundColor = function(colIndex) {
27415
+ let colDef = this._getColumnDef(colIndex);
27416
+ return colDef["backgroundColor"] || "";
27417
+ };
27418
+ /** @public
27419
+ * @param {number} colIndex
27420
+ * @param {string=} color
27421
+ */
27422
+ Core_Core.prototype.setColumnBackgroundColor = function(colIndex, color) {
27423
+ if(colIndex == null || typeof colIndex !== "number") {
27424
+ return;
27425
+ }
27426
+
27427
+ let colDef = this._getColumnDef(colIndex);
27428
+ if(colDef["backgroundColor"] === color) {
27429
+ return;
27430
+ }
27431
+
27432
+ colDef["backgroundColor"] = color;
27433
+ color = color != null ? color : "";
27434
+
27435
+ let sectionCount = this._settings.length;
27436
+ for(let i = 0; i < sectionCount; ++i) {
27437
+ let settings = this._settings[i];
27438
+ let section = settings.getSection();
27439
+ if(!section) {
27440
+ continue;
27441
+ }
27442
+
27443
+ if(settings.getType() !== "content") {
27444
+ let rowCount = section.getRowCount();
27445
+ for(let r = 0; r < rowCount; r++) {
27446
+ let cellSpan = section.getCellColSpan(colIndex, r);
27447
+ if(cellSpan > 1) { continue; }
27448
+ let cell = section.getCell(colIndex, r);
27449
+ if(cell) {
27450
+ cell.setStyle("backgroundColor", color);
27451
+ }
27452
+ }
27453
+ } else {
27454
+ let column = section.getColumn(colIndex);
27455
+ column.setStyle("backgroundColor", color);
27456
+ }
27457
+ }
27458
+ };
27459
+
27405
27460
  /** @public
27406
27461
  * @param {number} colIndex
27407
27462
  * @param {string} clsName
@@ -30061,6 +30116,9 @@ Core_Core.prototype._dispatchRowExpansionBinding = function (e) {
30061
30116
  }
30062
30117
 
30063
30118
  let ctxRow = section.getContextRow(r);
30119
+ if(!ctxRow) {
30120
+ continue; // The row may have been pushed out of view due to row count or height changed during the binding
30121
+ }
30064
30122
  let parentId = dataView.getExpansionParentByRowId(rowId);
30065
30123
  if(parentId) { // dispatch to render row expansion
30066
30124
  e["originalRowData"] = dataView.getRowData(parentId);
@@ -30553,31 +30611,9 @@ Core_Core.prototype._onKeyDown = function (e) {
30553
30611
 
30554
30612
  if(onTheEdge && !e.defaultPrevented) {
30555
30613
  if(onTheEdge > 0 && e.shiftKey) {
30556
- this._firstHiddenInput.focus(); // jump to the top
30557
- e.preventDefault();
30614
+ this._firstHiddenInput.focus(); // jump to the top and move out of grid
30558
30615
  } else if(onTheEdge < 0 && !e.shiftKey) {
30559
- this._lastHiddenInput.focus(); // skip to the end
30560
- e.preventDefault();
30561
- }
30562
- }
30563
- };
30564
- /** @private
30565
- * @param {Object} e
30566
- */
30567
- Core_Core.prototype._onKeyUp = function (e) {
30568
- if(!_isTabCommand(e)) {
30569
- return;
30570
- }
30571
- var activeElem = _getActiveElement(this._element);
30572
- if(e.shiftKey) {
30573
- if(activeElem === this._lastHiddenInput) {
30574
- this._firstHiddenInput.focus();
30575
- e.preventDefault();
30576
- }
30577
- } else {
30578
- if(activeElem === this._firstHiddenInput) {
30579
- this._lastHiddenInput.focus();
30580
- e.preventDefault();
30616
+ this._lastHiddenInput.focus(); // skip to the end and move out of grid
30581
30617
  }
30582
30618
  }
30583
30619
  };