ag-grid-community 33.2.3 → 33.2.4

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.
@@ -856,7 +856,7 @@ function _waitUntil(condition, callback, timeout = 100, timeoutMessage) {
856
856
  }
857
857
 
858
858
  // packages/ag-grid-community/src/version.ts
859
- var VERSION = "33.2.3";
859
+ var VERSION = "33.2.4";
860
860
 
861
861
  // packages/ag-grid-community/src/validation/logging.ts
862
862
  var MAX_URL_LENGTH = 2e3;
@@ -11269,6 +11269,9 @@ var RowCtrl = class extends BeanStub {
11269
11269
  this.allRowGuis.forEach(callback);
11270
11270
  }
11271
11271
  }
11272
+ isRowRendered() {
11273
+ return this.allRowGuis.length > 0;
11274
+ }
11272
11275
  onRowHeightChanged(gui) {
11273
11276
  if (this.rowNode.rowHeight == null) {
11274
11277
  return;
@@ -27404,13 +27407,14 @@ var FocusService = class extends BeanStub {
27404
27407
  // grid cell will still be focused as far as the grid is concerned,
27405
27408
  // however the browser focus will have moved somewhere else.
27406
27409
  getFocusCellToUseAfterRefresh() {
27407
- if (this.gos.get("suppressFocusAfterRefresh") || !this.focusedCell) {
27410
+ const { gos, focusedCell } = this;
27411
+ if (gos.get("suppressFocusAfterRefresh") || gos.get("suppressCellFocus") || !focusedCell) {
27408
27412
  return null;
27409
27413
  }
27410
27414
  if (!this.doesRowOrCellHaveBrowserFocus()) {
27411
27415
  return null;
27412
27416
  }
27413
- return this.focusedCell;
27417
+ return focusedCell;
27414
27418
  }
27415
27419
  getFocusHeaderToUseAfterRefresh() {
27416
27420
  if (this.gos.get("suppressFocusAfterRefresh") || !this.focusedHeader) {
@@ -30800,33 +30804,44 @@ var RowRenderer = class extends BeanStub {
30800
30804
  this.allRowCtrls = liveList;
30801
30805
  }
30802
30806
  }
30803
- isCellRendered(rowIndex, column) {
30807
+ /**
30808
+ * Checks if the cell is rendered or not. Also returns true if row ctrl is present but has not rendered
30809
+ * cells yet.
30810
+ * @returns true if cellCtrl is present, or if the row is present but has not rendered rows yet
30811
+ */
30812
+ isCellBeingRendered(rowIndex, column) {
30804
30813
  const rowCtrl = this.rowCtrlsByRowIndex[rowIndex];
30805
- if (!column) {
30814
+ if (!column || !rowCtrl) {
30806
30815
  return !!rowCtrl;
30807
30816
  }
30808
- if (rowCtrl && rowCtrl.isFullWidth()) {
30817
+ if (rowCtrl.isFullWidth()) {
30809
30818
  return true;
30810
30819
  }
30811
30820
  const spannedCell = this.beans.spannedRowRenderer?.getCellByPosition({ rowIndex, column, rowPinned: null });
30812
- if (spannedCell) {
30813
- return true;
30814
- }
30815
- return !!rowCtrl?.getCellCtrl(column);
30821
+ return !!spannedCell || !!rowCtrl.getCellCtrl(column) || !rowCtrl.isRowRendered();
30816
30822
  }
30817
30823
  /**
30818
30824
  * Notifies all row and cell controls of any change in focused cell.
30819
30825
  * @param event cell focused event
30820
30826
  */
30827
+ updateCellFocus(event) {
30828
+ this.getAllCellCtrls().forEach((cellCtrl) => cellCtrl.onCellFocused(event));
30829
+ this.getFullWidthRowCtrls().forEach((rowCtrl) => rowCtrl.onFullWidthRowFocused(event));
30830
+ }
30831
+ /**
30832
+ * Called when a new cell is focused in the grid
30833
+ * - if the focused cell isn't rendered; re-draw rows to dry to render it
30834
+ * - subsequently updates all cell and row controls with the new focused cell
30835
+ * @param event cell focused event
30836
+ */
30821
30837
  onCellFocusChanged(event) {
30822
30838
  if (event && event.rowIndex != null && !event.rowPinned) {
30823
30839
  const col = this.beans.colModel.getCol(event.column) ?? void 0;
30824
- if (!this.isCellRendered(event.rowIndex, col)) {
30840
+ if (!this.isCellBeingRendered(event.rowIndex, col)) {
30825
30841
  this.redraw();
30826
30842
  }
30827
30843
  }
30828
- this.getAllCellCtrls().forEach((cellCtrl) => cellCtrl.onCellFocused(event));
30829
- this.getFullWidthRowCtrls().forEach((rowCtrl) => rowCtrl.onFullWidthRowFocused(event));
30844
+ this.updateCellFocus(event);
30830
30845
  }
30831
30846
  onSuppressCellFocusChanged(suppressCellFocus) {
30832
30847
  this.getAllCellCtrls().forEach((cellCtrl) => cellCtrl.onSuppressCellFocusChanged(suppressCellFocus));
@@ -30837,10 +30852,8 @@ var RowRenderer = class extends BeanStub {
30837
30852
  // all active cells.
30838
30853
  registerCellEventListeners() {
30839
30854
  this.addManagedEventListeners({
30840
- cellFocused: (event) => {
30841
- this.onCellFocusChanged(event);
30842
- },
30843
- cellFocusCleared: () => this.onCellFocusChanged(),
30855
+ cellFocused: (event) => this.onCellFocusChanged(event),
30856
+ cellFocusCleared: () => this.updateCellFocus(),
30844
30857
  flashCells: (event) => {
30845
30858
  const { cellFlashSvc } = this.beans;
30846
30859
  if (cellFlashSvc) {
@@ -31149,7 +31162,7 @@ var RowRenderer = class extends BeanStub {
31149
31162
  return;
31150
31163
  }
31151
31164
  if (!focusSvc.doesRowOrCellHaveBrowserFocus()) {
31152
- this.onCellFocusChanged(
31165
+ this.updateCellFocus(
31153
31166
  _addGridCommonParams(this.gos, {
31154
31167
  ...cellToFocus,
31155
31168
  forceBrowserFocus: true,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-grid-community",
3
- "version": "33.2.3",
3
+ "version": "33.2.4",
4
4
  "description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",
5
5
  "main": "./dist/package/main.cjs.js",
6
6
  "types": "./dist/types/src/main.d.ts",
@@ -88,7 +88,7 @@
88
88
  ],
89
89
  "homepage": "https://www.ag-grid.com/",
90
90
  "dependencies": {
91
- "ag-charts-types": "11.2.3"
91
+ "ag-charts-types": "11.2.4"
92
92
  },
93
93
  "devDependencies": {
94
94
  "source-map-loader": "^5.0.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-grid-community",
3
- "version": "33.2.3",
3
+ "version": "33.2.4",
4
4
  "description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",
5
5
  "main": "./dist/package/main.cjs.js",
6
6
  "types": "./dist/types/src/main.d.ts",
@@ -88,7 +88,7 @@
88
88
  ],
89
89
  "homepage": "https://www.ag-grid.com/",
90
90
  "dependencies": {
91
- "ag-charts-types": "11.2.3"
91
+ "ag-charts-types": "11.2.4"
92
92
  },
93
93
  "devDependencies": {
94
94
  "source-map-loader": "^5.0.0",
@@ -165,6 +165,7 @@ export declare class RowCtrl extends BeanStub<RowCtrlEvent> {
165
165
  resetHoveredStatus(el?: HTMLElement): void;
166
166
  private roundRowTopToBounds;
167
167
  forEachGui(gui: RowGui | undefined, callback: (gui: RowGui) => void): void;
168
+ isRowRendered(): boolean;
168
169
  protected onRowHeightChanged(gui?: RowGui): void;
169
170
  destroyFirstPass(suppressAnimation?: boolean): void;
170
171
  destroySecondPass(): void;
@@ -49,11 +49,23 @@ export declare class RowRenderer extends BeanStub implements NamedBean {
49
49
  getStickyTopRowCtrls(): RowCtrl[];
50
50
  getStickyBottomRowCtrls(): RowCtrl[];
51
51
  private updateAllRowCtrls;
52
- private isCellRendered;
52
+ /**
53
+ * Checks if the cell is rendered or not. Also returns true if row ctrl is present but has not rendered
54
+ * cells yet.
55
+ * @returns true if cellCtrl is present, or if the row is present but has not rendered rows yet
56
+ */
57
+ private isCellBeingRendered;
53
58
  /**
54
59
  * Notifies all row and cell controls of any change in focused cell.
55
60
  * @param event cell focused event
56
61
  */
62
+ private updateCellFocus;
63
+ /**
64
+ * Called when a new cell is focused in the grid
65
+ * - if the focused cell isn't rendered; re-draw rows to dry to render it
66
+ * - subsequently updates all cell and row controls with the new focused cell
67
+ * @param event cell focused event
68
+ */
57
69
  private onCellFocusChanged;
58
70
  private onSuppressCellFocusChanged;
59
71
  private registerCellEventListeners;
@@ -1 +1 @@
1
- export declare const VERSION = "33.2.3";
1
+ export declare const VERSION = "33.2.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-grid-community",
3
- "version": "33.2.3",
3
+ "version": "33.2.4",
4
4
  "description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",
5
5
  "main": "./dist/package/main.cjs.js",
6
6
  "types": "./dist/types/src/main.d.ts",
@@ -88,7 +88,7 @@
88
88
  ],
89
89
  "homepage": "https://www.ag-grid.com/",
90
90
  "dependencies": {
91
- "ag-charts-types": "11.2.3"
91
+ "ag-charts-types": "11.2.4"
92
92
  },
93
93
  "devDependencies": {
94
94
  "source-map-loader": "^5.0.0",