ag-grid-community 33.2.2 → 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.
@@ -254,7 +254,6 @@ function _getAriaCheckboxStateName(translate, state) {
254
254
 
255
255
  // packages/ag-grid-community/src/utils/browser.ts
256
256
  var isSafari;
257
- var isChrome;
258
257
  var isFirefox;
259
258
  var isMacOs;
260
259
  var isIOS;
@@ -267,13 +266,6 @@ function _isBrowserSafari() {
267
266
  }
268
267
  return isSafari;
269
268
  }
270
- function _isBrowserChrome() {
271
- if (isChrome === void 0) {
272
- const win = window;
273
- isChrome = !!win.chrome && (!!win.chrome.webstore || !!win.chrome.runtime) || /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
274
- }
275
- return isChrome;
276
- }
277
269
  function _isBrowserFirefox() {
278
270
  if (isFirefox === void 0) {
279
271
  isFirefox = /(firefox)/i.test(navigator.userAgent);
@@ -362,7 +354,6 @@ function _isInvisibleScrollbar() {
362
354
  }
363
355
 
364
356
  // packages/ag-grid-community/src/utils/dom.ts
365
- var rtlNegativeScroll;
366
357
  function _radioCssClass(element, elementClass, otherElementClass) {
367
358
  const parent = element.parentElement;
368
359
  let sibling = parent && parent.firstChild;
@@ -495,46 +486,16 @@ function _getElementRectWithOffset(el) {
495
486
  bottom: offsetElementRect.bottom + (borderBottomWidth || 0)
496
487
  };
497
488
  }
498
- function _isRtlNegativeScroll() {
499
- if (typeof rtlNegativeScroll === "boolean") {
500
- return rtlNegativeScroll;
501
- }
502
- const template = document.createElement("div");
503
- template.style.direction = "rtl";
504
- template.style.width = "10px";
505
- template.style.height = "5px";
506
- template.style.position = "fixed";
507
- template.style.top = "0px";
508
- template.style.overflow = "hidden";
509
- template.dir = "rtl";
510
- template.innerHTML = /* html */
511
- `<div style="width: 20px">
512
- <span style="display: inline-block; width: 1px"></span>
513
- <span style="display: inline-block; width: 1px"></span>
514
- </div>`;
515
- document.body.appendChild(template);
516
- template.scrollLeft = 1;
517
- rtlNegativeScroll = Math.floor(template.scrollLeft) === 0;
518
- document.body.removeChild(template);
519
- return rtlNegativeScroll;
520
- }
521
489
  function _getScrollLeft(element, rtl) {
522
490
  let scrollLeft = element.scrollLeft;
523
491
  if (rtl) {
524
492
  scrollLeft = Math.abs(scrollLeft);
525
- if (_isBrowserChrome() && !_isRtlNegativeScroll()) {
526
- scrollLeft = element.scrollWidth - element.getBoundingClientRect().width - scrollLeft;
527
- }
528
493
  }
529
494
  return scrollLeft;
530
495
  }
531
496
  function _setScrollLeft(element, value, rtl) {
532
497
  if (rtl) {
533
- if (_isRtlNegativeScroll()) {
534
- value *= -1;
535
- } else if (_isBrowserSafari() || _isBrowserChrome()) {
536
- value = element.scrollWidth - element.getBoundingClientRect().width - value;
537
- }
498
+ value *= -1;
538
499
  }
539
500
  element.scrollLeft = value;
540
501
  }
@@ -895,7 +856,7 @@ function _waitUntil(condition, callback, timeout = 100, timeoutMessage) {
895
856
  }
896
857
 
897
858
  // packages/ag-grid-community/src/version.ts
898
- var VERSION = "33.2.2";
859
+ var VERSION = "33.2.4";
899
860
 
900
861
  // packages/ag-grid-community/src/validation/logging.ts
901
862
  var MAX_URL_LENGTH = 2e3;
@@ -9683,7 +9644,7 @@ var GridBodyScrollFeature = class extends BeanStub {
9683
9644
  shouldBlockHorizontalScroll(scrollTo) {
9684
9645
  const clientWidth = this.centerRowsCtrl.getCenterWidth();
9685
9646
  const { scrollWidth } = this.centerRowsCtrl.eViewport;
9686
- if (this.enableRtl && _isRtlNegativeScroll()) {
9647
+ if (this.enableRtl) {
9687
9648
  if (scrollTo > 0) {
9688
9649
  return true;
9689
9650
  }
@@ -9725,7 +9686,7 @@ var GridBodyScrollFeature = class extends BeanStub {
9725
9686
  const minScrollLeft = 0;
9726
9687
  const maxScrollLeft = this.centerRowsCtrl.eViewport.scrollWidth - this.centerRowsCtrl.getCenterWidth();
9727
9688
  if (!fromAlignedGridsService && this.shouldBlockScrollUpdate(1 /* Horizontal */, hScrollPosition)) {
9728
- if (this.enableRtl && _isRtlNegativeScroll()) {
9689
+ if (this.enableRtl) {
9729
9690
  hScrollPosition = hScrollPosition > 0 ? 0 : maxScrollLeft;
9730
9691
  } else {
9731
9692
  hScrollPosition = Math.min(Math.max(hScrollPosition, minScrollLeft), maxScrollLeft);
@@ -11308,6 +11269,9 @@ var RowCtrl = class extends BeanStub {
11308
11269
  this.allRowGuis.forEach(callback);
11309
11270
  }
11310
11271
  }
11272
+ isRowRendered() {
11273
+ return this.allRowGuis.length > 0;
11274
+ }
11311
11275
  onRowHeightChanged(gui) {
11312
11276
  if (this.rowNode.rowHeight == null) {
11313
11277
  return;
@@ -27443,13 +27407,14 @@ var FocusService = class extends BeanStub {
27443
27407
  // grid cell will still be focused as far as the grid is concerned,
27444
27408
  // however the browser focus will have moved somewhere else.
27445
27409
  getFocusCellToUseAfterRefresh() {
27446
- if (this.gos.get("suppressFocusAfterRefresh") || !this.focusedCell) {
27410
+ const { gos, focusedCell } = this;
27411
+ if (gos.get("suppressFocusAfterRefresh") || gos.get("suppressCellFocus") || !focusedCell) {
27447
27412
  return null;
27448
27413
  }
27449
27414
  if (!this.doesRowOrCellHaveBrowserFocus()) {
27450
27415
  return null;
27451
27416
  }
27452
- return this.focusedCell;
27417
+ return focusedCell;
27453
27418
  }
27454
27419
  getFocusHeaderToUseAfterRefresh() {
27455
27420
  if (this.gos.get("suppressFocusAfterRefresh") || !this.focusedHeader) {
@@ -30839,33 +30804,44 @@ var RowRenderer = class extends BeanStub {
30839
30804
  this.allRowCtrls = liveList;
30840
30805
  }
30841
30806
  }
30842
- 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) {
30843
30813
  const rowCtrl = this.rowCtrlsByRowIndex[rowIndex];
30844
- if (!column) {
30814
+ if (!column || !rowCtrl) {
30845
30815
  return !!rowCtrl;
30846
30816
  }
30847
- if (rowCtrl && rowCtrl.isFullWidth()) {
30817
+ if (rowCtrl.isFullWidth()) {
30848
30818
  return true;
30849
30819
  }
30850
30820
  const spannedCell = this.beans.spannedRowRenderer?.getCellByPosition({ rowIndex, column, rowPinned: null });
30851
- if (spannedCell) {
30852
- return true;
30853
- }
30854
- return !!rowCtrl?.getCellCtrl(column);
30821
+ return !!spannedCell || !!rowCtrl.getCellCtrl(column) || !rowCtrl.isRowRendered();
30855
30822
  }
30856
30823
  /**
30857
30824
  * Notifies all row and cell controls of any change in focused cell.
30858
30825
  * @param event cell focused event
30859
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
+ */
30860
30837
  onCellFocusChanged(event) {
30861
30838
  if (event && event.rowIndex != null && !event.rowPinned) {
30862
30839
  const col = this.beans.colModel.getCol(event.column) ?? void 0;
30863
- if (!this.isCellRendered(event.rowIndex, col)) {
30840
+ if (!this.isCellBeingRendered(event.rowIndex, col)) {
30864
30841
  this.redraw();
30865
30842
  }
30866
30843
  }
30867
- this.getAllCellCtrls().forEach((cellCtrl) => cellCtrl.onCellFocused(event));
30868
- this.getFullWidthRowCtrls().forEach((rowCtrl) => rowCtrl.onFullWidthRowFocused(event));
30844
+ this.updateCellFocus(event);
30869
30845
  }
30870
30846
  onSuppressCellFocusChanged(suppressCellFocus) {
30871
30847
  this.getAllCellCtrls().forEach((cellCtrl) => cellCtrl.onSuppressCellFocusChanged(suppressCellFocus));
@@ -30876,10 +30852,8 @@ var RowRenderer = class extends BeanStub {
30876
30852
  // all active cells.
30877
30853
  registerCellEventListeners() {
30878
30854
  this.addManagedEventListeners({
30879
- cellFocused: (event) => {
30880
- this.onCellFocusChanged(event);
30881
- },
30882
- cellFocusCleared: () => this.onCellFocusChanged(),
30855
+ cellFocused: (event) => this.onCellFocusChanged(event),
30856
+ cellFocusCleared: () => this.updateCellFocus(),
30883
30857
  flashCells: (event) => {
30884
30858
  const { cellFlashSvc } = this.beans;
30885
30859
  if (cellFlashSvc) {
@@ -31188,7 +31162,7 @@ var RowRenderer = class extends BeanStub {
31188
31162
  return;
31189
31163
  }
31190
31164
  if (!focusSvc.doesRowOrCellHaveBrowserFocus()) {
31191
- this.onCellFocusChanged(
31165
+ this.updateCellFocus(
31192
31166
  _addGridCommonParams(this.gos, {
31193
31167
  ...cellToFocus,
31194
31168
  forceBrowserFocus: true,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-grid-community",
3
- "version": "33.2.2",
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.2"
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.2",
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.2"
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;
@@ -48,7 +48,6 @@ export declare function _getElementRectWithOffset(el: HTMLElement): {
48
48
  right: number;
49
49
  bottom: number;
50
50
  };
51
- export declare function _isRtlNegativeScroll(): boolean;
52
51
  export declare function _getScrollLeft(element: HTMLElement, rtl: boolean): number;
53
52
  export declare function _setScrollLeft(element: HTMLElement, value: number, rtl: boolean): void;
54
53
  export declare function _clearElement(el: HTMLElement): void;
@@ -1 +1 @@
1
- export declare const VERSION = "33.2.2";
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.2",
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.2"
91
+ "ag-charts-types": "11.2.4"
92
92
  },
93
93
  "devDependencies": {
94
94
  "source-map-loader": "^5.0.0",