ag-grid-community 32.3.3 → 32.3.5

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.
@@ -1929,7 +1929,7 @@ var SortStage = class extends import_core8.BeanStub {
1929
1929
  };
1930
1930
 
1931
1931
  // community-modules/client-side-row-model/src/version.ts
1932
- var VERSION = "32.3.3";
1932
+ var VERSION = "32.3.5";
1933
1933
 
1934
1934
  // community-modules/client-side-row-model/src/clientSideRowModelModule.ts
1935
1935
  var ClientSideRowModelCoreModule = (0, import_core9._defineModule)({
@@ -9409,14 +9409,14 @@ function _isRtlNegativeScroll() {
9409
9409
  }
9410
9410
  const template = document.createElement("div");
9411
9411
  template.style.direction = "rtl";
9412
- template.style.width = "1px";
9413
- template.style.height = "1px";
9412
+ template.style.width = "10px";
9413
+ template.style.height = "5px";
9414
9414
  template.style.position = "fixed";
9415
9415
  template.style.top = "0px";
9416
9416
  template.style.overflow = "hidden";
9417
9417
  template.dir = "rtl";
9418
9418
  template.innerHTML = /* html */
9419
- `<div style="width: 2px">
9419
+ `<div style="width: 20px">
9420
9420
  <span style="display: inline-block; width: 1px"></span>
9421
9421
  <span style="display: inline-block; width: 1px"></span>
9422
9422
  </div>`;
@@ -9476,16 +9476,16 @@ function _ensureDomOrder(eContainer, eChild, eChildBefore) {
9476
9476
  if (eChildBefore && eChildBefore.nextSibling === eChild) {
9477
9477
  return;
9478
9478
  }
9479
- if (eChildBefore) {
9479
+ if (!eContainer.firstChild) {
9480
+ eContainer.appendChild(eChild);
9481
+ } else if (eChildBefore) {
9480
9482
  if (eChildBefore.nextSibling) {
9481
9483
  eContainer.insertBefore(eChild, eChildBefore.nextSibling);
9482
9484
  } else {
9483
9485
  eContainer.appendChild(eChild);
9484
9486
  }
9485
- } else {
9486
- if (eContainer.firstChild && eContainer.firstChild !== eChild) {
9487
- eContainer.insertAdjacentElement("afterbegin", eChild);
9488
- }
9487
+ } else if (eContainer.firstChild && eContainer.firstChild !== eChild) {
9488
+ eContainer.insertAdjacentElement("afterbegin", eChild);
9489
9489
  }
9490
9490
  }
9491
9491
  function _setDomChildOrder(eContainer, orderedChildren) {
@@ -9497,17 +9497,6 @@ function _setDomChildOrder(eContainer, orderedChildren) {
9497
9497
  }
9498
9498
  }
9499
9499
  }
9500
- function _insertWithDomOrder(eContainer, eToInsert, eChildBefore) {
9501
- if (eChildBefore) {
9502
- eChildBefore.insertAdjacentElement("afterend", eToInsert);
9503
- } else {
9504
- if (eContainer.firstChild) {
9505
- eContainer.insertAdjacentElement("afterbegin", eToInsert);
9506
- } else {
9507
- eContainer.appendChild(eToInsert);
9508
- }
9509
- }
9510
- }
9511
9500
  function _addStylesToElement(eElement, styles) {
9512
9501
  if (!styles) {
9513
9502
  return;
@@ -19864,7 +19853,7 @@ function _defineModule(definition) {
19864
19853
  }
19865
19854
 
19866
19855
  // community-modules/core/src/version.ts
19867
- var VERSION = "32.3.3";
19856
+ var VERSION = "32.3.5";
19868
19857
 
19869
19858
  // community-modules/core/src/filter/columnFilterApi.ts
19870
19859
  function isColumnFilterPresent(beans) {
@@ -28507,31 +28496,45 @@ var _RowCtrl = class _RowCtrl extends BeanStub {
28507
28496
  list: [],
28508
28497
  map: {}
28509
28498
  };
28510
- const addCell = (colInstanceId, cellCtrl) => {
28511
- res.list.push(cellCtrl);
28499
+ const addCell = (colInstanceId, cellCtrl, index) => {
28500
+ if (index != null) {
28501
+ res.list.splice(index, 0, cellCtrl);
28502
+ } else {
28503
+ res.list.push(cellCtrl);
28504
+ }
28512
28505
  res.map[colInstanceId] = cellCtrl;
28513
28506
  };
28514
- cols.forEach((col) => {
28507
+ const colsFromPrev = [];
28508
+ for (const col of cols) {
28515
28509
  const colInstanceId = col.getInstanceId();
28516
28510
  let cellCtrl = prev.map[colInstanceId];
28517
28511
  if (!cellCtrl) {
28518
28512
  cellCtrl = new CellCtrl(col, this.rowNode, this.beans, this);
28519
28513
  }
28520
28514
  addCell(colInstanceId, cellCtrl);
28521
- });
28522
- prev.list.forEach((prevCellCtrl) => {
28515
+ }
28516
+ for (const prevCellCtrl of prev.list) {
28523
28517
  const colInstanceId = prevCellCtrl.getColumn().getInstanceId();
28524
28518
  const cellInResult = res.map[colInstanceId] != null;
28525
28519
  if (cellInResult) {
28526
- return;
28520
+ continue;
28527
28521
  }
28528
28522
  const keepCell = !this.isCellEligibleToBeRemoved(prevCellCtrl, pinned);
28529
28523
  if (keepCell) {
28530
- addCell(colInstanceId, prevCellCtrl);
28531
- return;
28524
+ colsFromPrev.push([colInstanceId, prevCellCtrl]);
28525
+ } else {
28526
+ prevCellCtrl.destroy();
28532
28527
  }
28533
- prevCellCtrl.destroy();
28534
- });
28528
+ }
28529
+ if (colsFromPrev.length) {
28530
+ for (const [colInstanceId, cellCtrl] of colsFromPrev) {
28531
+ const index = res.list.findIndex(
28532
+ (ctrl) => ctrl.getColumn().getLeft() > cellCtrl.getColumn().getLeft()
28533
+ );
28534
+ const normalisedIndex = index === -1 ? void 0 : Math.max(index - 1, 0);
28535
+ addCell(colInstanceId, cellCtrl, normalisedIndex);
28536
+ }
28537
+ }
28535
28538
  return res;
28536
28539
  }
28537
28540
  updateColumnListsImpl(useFlushSync) {
@@ -30970,7 +30973,7 @@ var RowComp = class extends Component {
30970
30973
  this.rowCtrl = ctrl;
30971
30974
  const rowDiv = document.createElement("div");
30972
30975
  rowDiv.setAttribute("comp-id", `${this.getCompId()}`);
30973
- rowDiv.setAttribute("style", this.getInitialStyle(containerType));
30976
+ this.setInitialStyle(rowDiv, containerType);
30974
30977
  this.setTemplateFromElement(rowDiv);
30975
30978
  const eGui = this.getGui();
30976
30979
  const style = eGui.style;
@@ -30995,9 +30998,16 @@ var RowComp = class extends Component {
30995
30998
  ctrl.unsetComp(containerType);
30996
30999
  });
30997
31000
  }
30998
- getInitialStyle(containerType) {
31001
+ setInitialStyle(container, containerType) {
30999
31002
  const transform = this.rowCtrl.getInitialTransform(containerType);
31000
- return transform ? `transform: ${transform}` : `top: ${this.rowCtrl.getInitialRowTop(containerType)}`;
31003
+ if (transform) {
31004
+ container.style.setProperty("transform", transform);
31005
+ } else {
31006
+ const top = this.rowCtrl.getInitialRowTop(containerType);
31007
+ if (top) {
31008
+ container.style.setProperty("top", top);
31009
+ }
31010
+ }
31001
31011
  }
31002
31012
  showFullWidth(compDetails) {
31003
31013
  const callback = (cellRenderer) => {
@@ -31094,11 +31104,11 @@ function templateFactory(options) {
31094
31104
  if (options.type === "center") {
31095
31105
  res = /* html */
31096
31106
  `<div class="${options.viewport}" data-ref="eViewport" role="presentation">
31097
- <div class="${options.container}" data-ref="eContainer"></div>
31107
+ <div class="${options.container}" data-ref="eContainer" role="rowgroup"></div>
31098
31108
  </div>`;
31099
31109
  } else {
31100
31110
  res = /* html */
31101
- `<div class="${options.container}" data-ref="eContainer"></div>`;
31111
+ `<div class="${options.container}" data-ref="eContainer" role="rowgroup"></div>`;
31102
31112
  }
31103
31113
  return res;
31104
31114
  }
@@ -31132,47 +31142,59 @@ var RowContainerComp = class extends Component {
31132
31142
  destroy() {
31133
31143
  this.setRowCtrls([]);
31134
31144
  super.destroy();
31145
+ this.lastPlacedElement = null;
31135
31146
  }
31136
31147
  setRowCtrls(rowCtrls) {
31137
- const oldRows = { ...this.rowComps };
31148
+ const { rowComps, beans, options } = this;
31149
+ const oldRows = { ...rowComps };
31138
31150
  this.rowComps = {};
31139
31151
  this.lastPlacedElement = null;
31140
- const processRow = (rowCon) => {
31141
- const instanceId = rowCon.instanceId;
31152
+ const orderedRows = [];
31153
+ for (const rowCtrl of rowCtrls) {
31154
+ const instanceId = rowCtrl.instanceId;
31142
31155
  const existingRowComp = oldRows[instanceId];
31156
+ let rowComp;
31143
31157
  if (existingRowComp) {
31144
- this.rowComps[instanceId] = existingRowComp;
31158
+ rowComp = existingRowComp;
31145
31159
  delete oldRows[instanceId];
31146
- this.ensureDomOrder(existingRowComp.getGui());
31147
31160
  } else {
31148
- if (!rowCon.getRowNode().displayed) {
31149
- return;
31161
+ if (!rowCtrl.getRowNode().displayed) {
31162
+ continue;
31150
31163
  }
31151
- const rowComp = new RowComp(rowCon, this.beans, this.options.type);
31152
- this.rowComps[instanceId] = rowComp;
31153
- this.appendRow(rowComp.getGui());
31164
+ rowComp = new RowComp(rowCtrl, beans, options.type);
31154
31165
  }
31155
- };
31156
- rowCtrls.forEach(processRow);
31157
- _getAllValuesInObject(oldRows).forEach((oldRowComp) => {
31158
- this.eContainer.removeChild(oldRowComp.getGui());
31159
- oldRowComp.destroy();
31160
- });
31161
- _setAriaRole(this.eContainer, "rowgroup");
31166
+ this.rowComps[instanceId] = rowComp;
31167
+ orderedRows.push([rowComp, !existingRowComp]);
31168
+ }
31169
+ this.removeOldRows(Object.values(oldRows));
31170
+ this.addRowNodes(orderedRows);
31162
31171
  }
31163
- appendRow(element) {
31164
- if (this.domOrder) {
31165
- _insertWithDomOrder(this.eContainer, element, this.lastPlacedElement);
31166
- } else {
31167
- this.eContainer.appendChild(element);
31172
+ addRowNodes(rows) {
31173
+ const { domOrder, eContainer } = this;
31174
+ for (const [rowComp, isNew] of rows) {
31175
+ const eGui = rowComp.getGui();
31176
+ if (!domOrder) {
31177
+ if (isNew) {
31178
+ eContainer.appendChild(eGui);
31179
+ }
31180
+ } else {
31181
+ this.ensureDomOrder(eGui);
31182
+ }
31183
+ }
31184
+ }
31185
+ removeOldRows(rowComps) {
31186
+ const { eContainer } = this;
31187
+ for (const oldRowComp of rowComps) {
31188
+ eContainer.removeChild(oldRowComp.getGui());
31189
+ oldRowComp.destroy();
31168
31190
  }
31169
- this.lastPlacedElement = element;
31170
31191
  }
31171
31192
  ensureDomOrder(eRow) {
31172
- if (this.domOrder) {
31173
- _ensureDomOrder(this.eContainer, eRow, this.lastPlacedElement);
31174
- this.lastPlacedElement = eRow;
31193
+ if (!this.domOrder) {
31194
+ return;
31175
31195
  }
31196
+ _ensureDomOrder(this.eContainer, eRow, this.lastPlacedElement);
31197
+ this.lastPlacedElement = eRow;
31176
31198
  }
31177
31199
  };
31178
31200
  var RowContainerSelector = {
@@ -47925,7 +47947,7 @@ var GridSerializer = class extends import_core6.BeanStub {
47925
47947
  }
47926
47948
  if (skipRowGroups && !isTreeData) {
47927
47949
  columnsToExport = columnsToExport.filter(
47928
- (column) => (0, import_core6.isColumnGroupAutoCol)(column) || (0, import_core6.isColumnControlsCol)(column)
47950
+ (column) => !(0, import_core6.isColumnGroupAutoCol)(column) && !(0, import_core6.isColumnControlsCol)(column)
47929
47951
  );
47930
47952
  }
47931
47953
  return columnsToExport;
@@ -47993,7 +48015,7 @@ var GridSerializer = class extends import_core6.BeanStub {
47993
48015
  };
47994
48016
 
47995
48017
  // community-modules/csv-export/src/version.ts
47996
- var VERSION = "32.3.3";
48018
+ var VERSION = "32.3.5";
47997
48019
 
47998
48020
  // community-modules/csv-export/src/csvExportModule.ts
47999
48021
  var CsvExportCoreModule = (0, import_core7._defineModule)({
@@ -49250,7 +49272,7 @@ function getInfiniteRowCount(beans) {
49250
49272
  }
49251
49273
 
49252
49274
  // community-modules/infinite-row-model/src/version.ts
49253
- var VERSION = "32.3.3";
49275
+ var VERSION = "32.3.5";
49254
49276
 
49255
49277
  // community-modules/infinite-row-model/src/infiniteRowModelModule.ts
49256
49278
  var InfiniteRowModelCoreModule = (0, import_core4._defineModule)({