@datorama/core 22.15.2 → 22.15.3

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.
@@ -11576,6 +11576,32 @@
11576
11576
  }
11577
11577
  return value;
11578
11578
  }
11579
+ /** ag-grid's colId prefix for pivotRowTotals columns (PivotColDefService.PIVOT_ROW_TOTAL_PREFIX, not exported) */
11580
+ var PIVOT_ROW_TOTAL_COL_ID_PREFIX = 'PivotRowTotal_';
11581
+ /**
11582
+ * ag-grid 22 nested each pivot row total column in one group per pivot level, and the innermost group gets the "Total" header,
11583
+ * but ag-grid 27 adds the column without groups.
11584
+ * Turn the column def into those groups in place, as processSecondaryColDef can't replace it in its parent's children.
11585
+ * This relies on ag-grid checking for children before it calls processSecondaryColDef, so re-check it when moving to processPivotResultColDef.
11586
+ */
11587
+ function wrapPivotRowTotalColDef(colDef, headerName, pivotLevels) {
11588
+ if (!colDef.colId || !colDef.colId.startsWith(PIVOT_ROW_TOTAL_COL_ID_PREFIX)) {
11589
+ return;
11590
+ }
11591
+ var totalColDef = __assign({}, colDef);
11592
+ // A 'group_' prefix can't match a pivot column id, which starts with 'pivot_' or 'PivotRowTotal_'
11593
+ var groupDef = {
11594
+ groupId: "group_" + totalColDef.colId,
11595
+ headerName: headerName,
11596
+ headerClass: ['total-pivot-cell'],
11597
+ children: [totalColDef]
11598
+ };
11599
+ for (var level = 1; level < pivotLevels; level++) {
11600
+ groupDef = { groupId: "group_" + totalColDef.colId + "_" + level, children: [groupDef] };
11601
+ }
11602
+ Object.keys(colDef).forEach(function (key) { return delete colDef[key]; });
11603
+ Object.assign(colDef, groupDef);
11604
+ }
11579
11605
  function isHtmlAllowedForCol(gridOptions, colDef) {
11580
11606
  return (!gridOptions.disabledHTMLRenderingFields || !gridOptions.disabledHTMLRenderingFields.includes(getColField(colDef)));
11581
11607
  }
@@ -15321,6 +15347,7 @@
15321
15347
  return (parsedKey && parsedKey.value) || '';
15322
15348
  });
15323
15349
  }
15350
+ wrapPivotRowTotalColDef(colDef, _this.translate.transform('core.total'), _this.api ? _this.api.columns.getPivotColumns().length : 1);
15324
15351
  };
15325
15352
  /** Use processPivotResultColGroupDe from ver 28 */
15326
15353
  gridOptions.processSecondaryColGroupDef = function (colGroupDef) {
@@ -25846,7 +25873,7 @@
25846
25873
  };
25847
25874
  }
25848
25875
 
25849
- window.coreVersion = '22.15.2';
25876
+ window.coreVersion = '22.15.3';
25850
25877
 
25851
25878
  exports.APP_TRANSLATE = APP_TRANSLATE;
25852
25879
  exports.AceService = AceService;