@adaptabletools/adaptable-cjs 20.0.10 → 20.0.12

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.
Files changed (51) hide show
  1. package/agGrid.d.ts +3 -3
  2. package/agGrid.js +3 -3
  3. package/base.css +1 -0
  4. package/base.css.map +1 -1
  5. package/index.css +1 -0
  6. package/index.css.map +1 -1
  7. package/package.json +1 -1
  8. package/src/AdaptableOptions/ColumnOptions.d.ts +3 -3
  9. package/src/AdaptableState/Common/AdaptableColumn.d.ts +3 -3
  10. package/src/AdaptableState/Common/AdaptableColumn.js +10 -9
  11. package/src/AdaptableState/Common/AggregationColumns.d.ts +1 -1
  12. package/src/AdaptableState/LayoutState.d.ts +2 -2
  13. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
  14. package/src/Api/Implementation/ColumnApiImpl.js +7 -7
  15. package/src/Api/Implementation/LayoutHelpers.js +17 -31
  16. package/src/Api/Internal/ColumnInternalApi.js +4 -4
  17. package/src/Strategy/CalculatedColumnModule.d.ts +1 -1
  18. package/src/Strategy/CellSummaryModule.d.ts +1 -1
  19. package/src/Strategy/ChartingModule.d.ts +1 -1
  20. package/src/Strategy/ColumnFilterModule.d.ts +1 -1
  21. package/src/Strategy/ColumnInfoModule.d.ts +1 -1
  22. package/src/Strategy/FlashingCellModule.d.ts +1 -1
  23. package/src/Strategy/FormatColumnModule.d.ts +1 -1
  24. package/src/Strategy/FreeTextColumnModule.d.ts +1 -1
  25. package/src/Strategy/GridInfoModule.d.ts +1 -1
  26. package/src/Strategy/LayoutModule.d.ts +1 -1
  27. package/src/Strategy/PlusMinusModule.d.ts +1 -1
  28. package/src/Strategy/SettingsPanelModule.d.ts +1 -1
  29. package/src/Strategy/StyledColumnModule.d.ts +1 -1
  30. package/src/Strategy/SystemStatusModule.d.ts +1 -1
  31. package/src/Utilities/Helpers/AdaptableHelper.d.ts +1 -0
  32. package/src/Utilities/Helpers/AdaptableHelper.js +29 -2
  33. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +21 -21
  34. package/src/agGrid/AdaptableAgGrid.js +15 -5
  35. package/src/agGrid/AgGridAdapter.js +3 -3
  36. package/src/env.js +2 -2
  37. package/src/layout-manager/src/LayoutManagerModel.d.ts +3 -3
  38. package/src/layout-manager/src/index.d.ts +5 -1
  39. package/src/layout-manager/src/index.js +48 -44
  40. package/src/layout-manager/src/isLayoutEqual.d.ts +8 -0
  41. package/src/layout-manager/src/isLayoutEqual.js +46 -3
  42. package/src/layout-manager/src/isPivotColumnTotal.d.ts +1 -0
  43. package/src/layout-manager/src/{isPivotGroupTotalColumn.js → isPivotColumnTotal.js} +3 -3
  44. package/src/layout-manager/src/isPivotGrandTotal.d.ts +2 -0
  45. package/src/layout-manager/src/isPivotGrandTotal.js +7 -0
  46. package/src/layout-manager/src/normalizeLayoutModel.js +24 -0
  47. package/src/layout-manager/src/simplifyLayoutModel.js +10 -1
  48. package/tsconfig.cjs.tsbuildinfo +1 -1
  49. package/src/layout-manager/src/isPivotGrandTotalColumn.d.ts +0 -2
  50. package/src/layout-manager/src/isPivotGrandTotalColumn.js +0 -7
  51. package/src/layout-manager/src/isPivotGroupTotalColumn.d.ts +0 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LayoutManager = void 0;
3
+ exports.LayoutManager = exports.PIVOT_AGGREGATION_TOTAL_COL_TYPE = exports.PIVOT_COLUMN_TOTAL_COL_TYPE = exports.PIVOT_GRAND_TOTAL_COL_TYPE = exports.PIVOT_ANY_TOTAL_COL_TYPE = void 0;
4
4
  const infinite_react_1 = require("@infinite-table/infinite-react");
5
5
  const isPivotLayoutModel_1 = require("./isPivotLayoutModel");
6
6
  const LMEmitter_1 = require("./LMEmitter");
@@ -10,8 +10,12 @@ const simplifyLayoutModel_1 = require("./simplifyLayoutModel");
10
10
  const sortColumnIdsByOrder_1 = require("./sortColumnIdsByOrder");
11
11
  const destructurePivotColumnId_1 = require("./destructurePivotColumnId");
12
12
  const isPivotAggTotalColumn_1 = require("./isPivotAggTotalColumn");
13
- const isPivotGrandTotalColumn_1 = require("./isPivotGrandTotalColumn");
14
- const isPivotGroupTotalColumn_1 = require("./isPivotGroupTotalColumn");
13
+ const isPivotGrandTotal_1 = require("./isPivotGrandTotal");
14
+ const isPivotColumnTotal_1 = require("./isPivotColumnTotal");
15
+ exports.PIVOT_ANY_TOTAL_COL_TYPE = 'pivotAnyTotal';
16
+ exports.PIVOT_GRAND_TOTAL_COL_TYPE = 'pivotGrandTotal';
17
+ exports.PIVOT_COLUMN_TOTAL_COL_TYPE = 'pivotColumnTotal';
18
+ exports.PIVOT_AGGREGATION_TOTAL_COL_TYPE = 'pivotAggregationTotal';
15
19
  function flattenColDefs(colDefs) {
16
20
  const res = [];
17
21
  const iteration = (c) => {
@@ -227,7 +231,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
227
231
  // emit an event that the layout has changed from the grid
228
232
  this.emitSync('gridLayoutChanged', layout);
229
233
  const log = this.debugger.extend('gridLayoutChanged');
230
- log('current grid layout:', JSON.stringify(layout, null, 2), '\nprev layout:\n', prevLayout ? JSON.stringify(prevLayout, null, 2) : 'no prev layout');
234
+ log('current grid layout:', JSON.stringify(layout, null, 2), '\nprev layout:\n', prevLayout ? JSON.stringify(prevLayout, null, 2) : 'no prev layout', '\nchanges from prev to current:\n', (0, isLayoutEqual_1.getChanges)(prevLayout, layout));
231
235
  }
232
236
  onChange(fn) {
233
237
  return this.on('gridLayoutChanged', fn);
@@ -267,13 +271,13 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
267
271
  if (layout.SuppressAggFuncInHeader) {
268
272
  pivotLayout.SuppressAggFuncInHeader = layout.SuppressAggFuncInHeader;
269
273
  }
270
- const grandTotalColumn = this.gridApi.getGridOption('pivotRowTotals');
271
- if (grandTotalColumn) {
272
- pivotLayout.GrandTotalColumn = grandTotalColumn;
274
+ const pivotGrandTotal = this.gridApi.getGridOption('pivotRowTotals');
275
+ if (pivotGrandTotal) {
276
+ pivotLayout.PivotGrandTotal = pivotGrandTotal;
273
277
  }
274
- const pivotGroupTotalColumn = this.gridApi.getGridOption('pivotColumnGroupTotals');
275
- if (pivotGroupTotalColumn) {
276
- pivotLayout.PivotGroupTotalColumn = pivotGroupTotalColumn;
278
+ const pivotColumnTotal = this.gridApi.getGridOption('pivotColumnGroupTotals');
279
+ if (pivotColumnTotal) {
280
+ pivotLayout.PivotColumnTotal = pivotColumnTotal;
277
281
  }
278
282
  return (0, simplifyLayoutModel_1.simplifyPivotLayoutModel)(pivotLayout);
279
283
  }
@@ -1051,29 +1055,29 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1051
1055
  */
1052
1056
  // is common to both Table and Pivot and is applied in applyLayout()
1053
1057
  /**
1054
- * GrandTotalColumn
1058
+ * PivotGrandTotal
1055
1059
  */
1056
- if (layout.GrandTotalColumn) {
1057
- const grandTotalColumn = layout.GrandTotalColumn === true || layout.GrandTotalColumn === 'before'
1060
+ if (layout.PivotGrandTotal) {
1061
+ const pivotGrandTotal = layout.PivotGrandTotal === true || layout.PivotGrandTotal === 'before'
1058
1062
  ? 'before'
1059
- : layout.GrandTotalColumn === 'after'
1063
+ : layout.PivotGrandTotal === 'after'
1060
1064
  ? 'after'
1061
1065
  : null;
1062
- this.gridApi.setGridOption('pivotRowTotals', grandTotalColumn);
1066
+ this.gridApi.setGridOption('pivotRowTotals', pivotGrandTotal);
1063
1067
  }
1064
1068
  else {
1065
1069
  this.gridApi.setGridOption('pivotRowTotals', null);
1066
1070
  }
1067
1071
  /**
1068
- * PivotGroupTotalColumn
1072
+ * PivotColumnTotal
1069
1073
  */
1070
- if (layout.PivotGroupTotalColumn) {
1071
- const pivotGroupTotalColumn = layout.PivotGroupTotalColumn === true || layout.PivotGroupTotalColumn === 'before'
1074
+ if (layout.PivotColumnTotal) {
1075
+ const pivotColumnTotal = layout.PivotColumnTotal === true || layout.PivotColumnTotal === 'before'
1072
1076
  ? 'before'
1073
- : layout.PivotGroupTotalColumn === 'after'
1077
+ : layout.PivotColumnTotal === 'after'
1074
1078
  ? 'after'
1075
1079
  : null;
1076
- this.gridApi.setGridOption('pivotColumnGroupTotals', pivotGroupTotalColumn);
1080
+ this.gridApi.setGridOption('pivotColumnGroupTotals', pivotColumnTotal);
1077
1081
  }
1078
1082
  else {
1079
1083
  this.gridApi.setGridOption('pivotColumnGroupTotals', null);
@@ -1129,11 +1133,11 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1129
1133
  if (!(0, isPivotLayoutModel_1.isPivotLayoutModel)(this.currentLayout)) {
1130
1134
  return;
1131
1135
  }
1132
- if ((0, isPivotGrandTotalColumn_1.isPivotGrandTotalColumn)(colDef)) {
1133
- this.patchColDefType(colDef, ['pivotTotalColumn', 'pivotGrandTotalColumn']);
1136
+ if ((0, isPivotGrandTotal_1.isPivotGrandTotal)(colDef)) {
1137
+ this.patchColDefType(colDef, [exports.PIVOT_ANY_TOTAL_COL_TYPE, exports.PIVOT_GRAND_TOTAL_COL_TYPE]);
1134
1138
  }
1135
- if ((0, isPivotGroupTotalColumn_1.isPivotGroupTotalColumn)(colDef.colId)) {
1136
- this.patchColDefType(colDef, ['pivotTotalColumn', 'pivotGroupTotalColumn']);
1139
+ if ((0, isPivotColumnTotal_1.isPivotColumnTotal)(colDef.colId)) {
1140
+ this.patchColDefType(colDef, [exports.PIVOT_ANY_TOTAL_COL_TYPE, exports.PIVOT_COLUMN_TOTAL_COL_TYPE]);
1137
1141
  }
1138
1142
  });
1139
1143
  const _original_processPivotResultColGroupDef = this.gridApi.getGridOption('processPivotResultColGroupDef');
@@ -1142,28 +1146,28 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1142
1146
  if (!(0, isPivotLayoutModel_1.isPivotLayoutModel)(this.currentLayout)) {
1143
1147
  return;
1144
1148
  }
1145
- this.patchPivotTotalColumn(colGroupDef);
1149
+ this.patchPivotAggregationTotal(colGroupDef);
1146
1150
  });
1147
1151
  }
1148
- patchPivotTotalColumn(colGroupDef) {
1149
- const hasPivotTotalCols = (pivotLayout) => {
1150
- return pivotLayout.PivotAggregationColumns?.some((aggCol) => !!aggCol.TotalColumn);
1152
+ patchPivotAggregationTotal(colGroupDef) {
1153
+ const hasPivotAggTotals = (pivotLayout) => {
1154
+ return pivotLayout.PivotAggregationColumns?.some((aggCol) => !!aggCol.Total);
1151
1155
  };
1152
- if (!(0, isPivotLayoutModel_1.isPivotLayoutModel)(this.currentLayout) || !hasPivotTotalCols(this.currentLayout)) {
1156
+ if (!(0, isPivotLayoutModel_1.isPivotLayoutModel)(this.currentLayout) || !hasPivotAggTotals(this.currentLayout)) {
1153
1157
  return;
1154
1158
  }
1155
- const pivotRowTotalColDefsBefore = [];
1156
- const pivotRowTotalColDefsAfter = [];
1157
- const pivotTotalColDefsBefore = [];
1158
- const pivotTotalColDefsAfter = [];
1159
+ const pivotGrandTotalsBefore = [];
1160
+ const pivotGrandTotalsAfter = [];
1161
+ const pivotAggTotalsBefore = [];
1162
+ const pivotAggTotalsAfter = [];
1159
1163
  const normalColDefs = [];
1160
1164
  colGroupDef.children.forEach((colDef) => {
1161
- if ((0, isPivotGrandTotalColumn_1.isPivotGrandTotalColumn)(colDef)) {
1165
+ if ((0, isPivotGrandTotal_1.isPivotGrandTotal)(colDef)) {
1162
1166
  if (this.gridApi.getGridOption('pivotRowTotals') === 'after') {
1163
- pivotRowTotalColDefsAfter.push(colDef);
1167
+ pivotGrandTotalsAfter.push(colDef);
1164
1168
  }
1165
1169
  else {
1166
- pivotRowTotalColDefsBefore.push(colDef);
1170
+ pivotGrandTotalsBefore.push(colDef);
1167
1171
  }
1168
1172
  return;
1169
1173
  }
@@ -1172,7 +1176,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1172
1176
  this.warn(`Pivot total column ${colDef.colId} is not prefixed with 'pivot_', skipping...`);
1173
1177
  return;
1174
1178
  }
1175
- this.patchColDefType(colDef, ['pivotTotalColumn', 'pivotAggregationTotalColumn']);
1179
+ this.patchColDefType(colDef, [exports.PIVOT_ANY_TOTAL_COL_TYPE, exports.PIVOT_AGGREGATION_TOTAL_COL_TYPE]);
1176
1180
  // we do this for all total cols, but we will hide the ones that are not visible
1177
1181
  colDef.columnGroupShow = undefined;
1178
1182
  const totalColConfig = this.getPivotTotalColumnConfig(colDef, this.currentLayout);
@@ -1181,10 +1185,10 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1181
1185
  }
1182
1186
  else {
1183
1187
  if (totalColConfig.position === 'after') {
1184
- pivotTotalColDefsAfter.push(colDef);
1188
+ pivotAggTotalsAfter.push(colDef);
1185
1189
  }
1186
1190
  else {
1187
- pivotTotalColDefsBefore.push(colDef);
1191
+ pivotAggTotalsBefore.push(colDef);
1188
1192
  }
1189
1193
  }
1190
1194
  }
@@ -1193,11 +1197,11 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1193
1197
  }
1194
1198
  });
1195
1199
  colGroupDef.children = [
1196
- ...pivotRowTotalColDefsBefore,
1197
- ...pivotTotalColDefsBefore,
1200
+ ...pivotGrandTotalsBefore,
1201
+ ...pivotAggTotalsBefore,
1198
1202
  ...normalColDefs,
1199
- ...pivotTotalColDefsAfter,
1200
- ...pivotRowTotalColDefsAfter,
1203
+ ...pivotAggTotalsAfter,
1204
+ ...pivotGrandTotalsAfter,
1201
1205
  ];
1202
1206
  }
1203
1207
  getPivotTotalColumnConfig(colDef, currentPivotLayout) {
@@ -1217,7 +1221,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1217
1221
  this.warn(`Pivot Totals: could NOT find aggregation(value) column with id ${aggregationColumnId}`);
1218
1222
  return defaultHiddenConfig;
1219
1223
  }
1220
- const layoutPivotTotalColumn = layoutAggCol.TotalColumn;
1224
+ const layoutPivotTotalColumn = layoutAggCol.Total;
1221
1225
  if (!layoutPivotTotalColumn) {
1222
1226
  return defaultHiddenConfig;
1223
1227
  }
@@ -1,4 +1,12 @@
1
1
  import { PivotLayoutModel, TableLayoutModel } from './LayoutManagerModel';
2
+ declare const logger: import("@infinite-table/infinite-react").DebugLogger;
3
+ export declare const getChanges: (l1: any, l2: any) => {
4
+ key: string;
5
+ value1: any;
6
+ value2: any;
7
+ }[];
8
+ export declare const logChanges: (l1: any, l2: any, log?: typeof logger) => void;
2
9
  export declare function isTableLayoutEqual(l1: TableLayoutModel, l2: TableLayoutModel): boolean;
3
10
  export declare function isPivotLayoutEqual(l1: PivotLayoutModel, l2: PivotLayoutModel): boolean;
4
11
  export declare function isLayoutEqual(l1: TableLayoutModel | PivotLayoutModel, l2: TableLayoutModel | PivotLayoutModel): boolean;
12
+ export {};
@@ -1,20 +1,63 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isLayoutEqual = exports.isPivotLayoutEqual = exports.isTableLayoutEqual = void 0;
3
+ exports.isLayoutEqual = exports.isPivotLayoutEqual = exports.isTableLayoutEqual = exports.logChanges = exports.getChanges = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
6
+ const infinite_react_1 = require("@infinite-table/infinite-react");
6
7
  const isPivotLayoutModel_1 = require("./isPivotLayoutModel");
7
8
  const normalizeLayoutModel_1 = require("./normalizeLayoutModel");
9
+ const logger = (0, infinite_react_1.debug)(`LayoutManager:Diffing`);
10
+ const getChanges = (l1, l2) => {
11
+ if (!l1 || typeof l1 !== 'object' || !l2 || typeof l2 !== 'object') {
12
+ return [
13
+ {
14
+ key: 'missing',
15
+ value1: l1,
16
+ value2: l2,
17
+ },
18
+ ];
19
+ }
20
+ const k1 = Object.keys(l1);
21
+ const k2 = Object.keys(l2);
22
+ const allKeys = new Set([...k1, ...k2]);
23
+ const changes = [];
24
+ for (const key of allKeys) {
25
+ if (!(0, isEqual_1.default)(l1[key], l2[key])) {
26
+ changes.push({ key, value1: l1[key], value2: l2[key] });
27
+ }
28
+ }
29
+ return changes;
30
+ };
31
+ exports.getChanges = getChanges;
32
+ const logChanges = (l1, l2, log) => {
33
+ log = log || logger;
34
+ const changes = (0, exports.getChanges)(l1, l2);
35
+ log('---');
36
+ log('Layouts are not equal.');
37
+ log('Layout 1', l1);
38
+ log('Layout 2', l2);
39
+ log('Differences:', changes);
40
+ log('---');
41
+ };
42
+ exports.logChanges = logChanges;
8
43
  function isTableLayoutEqual(l1, l2) {
9
44
  l1 = (0, normalizeLayoutModel_1.normalizeTableLayoutModel)(l1);
10
45
  l2 = (0, normalizeLayoutModel_1.normalizeTableLayoutModel)(l2);
11
- return (0, isEqual_1.default)(l1, l2);
46
+ const res = (0, isEqual_1.default)(l1, l2);
47
+ if (!res) {
48
+ (0, exports.logChanges)(l1, l2);
49
+ }
50
+ return res;
12
51
  }
13
52
  exports.isTableLayoutEqual = isTableLayoutEqual;
14
53
  function isPivotLayoutEqual(l1, l2) {
15
54
  l1 = (0, normalizeLayoutModel_1.normalizePivotLayoutModel)(l1);
16
55
  l2 = (0, normalizeLayoutModel_1.normalizePivotLayoutModel)(l2);
17
- return (0, isEqual_1.default)(l1, l2);
56
+ const res = (0, isEqual_1.default)(l1, l2);
57
+ if (!res) {
58
+ (0, exports.logChanges)(l1, l2);
59
+ }
60
+ return res;
18
61
  }
19
62
  exports.isPivotLayoutEqual = isPivotLayoutEqual;
20
63
  function isLayoutEqual(l1, l2) {
@@ -0,0 +1 @@
1
+ export declare function isPivotColumnTotal(colId: string): boolean;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isPivotGroupTotalColumn = void 0;
4
- function isPivotGroupTotalColumn(colId) {
3
+ exports.isPivotColumnTotal = void 0;
4
+ function isPivotColumnTotal(colId) {
5
5
  // pivot group total are spanning cross all aggregations
6
6
  // therefore the last part of the colId is empty (hence the "dangling" underscore)
7
7
  return colId?.startsWith('pivot_') && colId?.endsWith('_');
8
8
  }
9
- exports.isPivotGroupTotalColumn = isPivotGroupTotalColumn;
9
+ exports.isPivotColumnTotal = isPivotColumnTotal;
@@ -0,0 +1,2 @@
1
+ import { ColDef, ColGroupDef } from 'ag-grid-enterprise';
2
+ export declare function isPivotGrandTotal(colDef: ColDef | ColGroupDef): boolean;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPivotGrandTotal = void 0;
4
+ function isPivotGrandTotal(colDef) {
5
+ return colDef?.colId?.startsWith('PivotRowTotal_pivot_');
6
+ }
7
+ exports.isPivotGrandTotal = isPivotGrandTotal;
@@ -29,6 +29,14 @@ function normalizeTableLayoutModel(layout, options) {
29
29
  if (!layout.RowGroupedColumns) {
30
30
  layout.RowGroupedColumns = [];
31
31
  }
32
+ if (!('SuppressAggFuncInHeader' in layout)) {
33
+ // make it an own property
34
+ layout.SuppressAggFuncInHeader = undefined;
35
+ }
36
+ if (!('GrandTotalRow' in layout)) {
37
+ // make it an own property
38
+ layout.GrandTotalRow = undefined;
39
+ }
32
40
  const ColumnOrderSet = new Set(layout.TableColumns);
33
41
  if (layout.RowGroupedColumns && layout.RowGroupedColumns.length && layout.TableColumns) {
34
42
  // the layout.TableColumns might not include the group columns
@@ -136,6 +144,22 @@ function normalizePivotLayoutModel(layout) {
136
144
  RowGroupDisplay: 'always-collapsed',
137
145
  };
138
146
  }
147
+ if (!('SuppressAggFuncInHeader' in layout)) {
148
+ // make it an own property
149
+ layout.SuppressAggFuncInHeader = undefined;
150
+ }
151
+ if (!('GrandTotalRow' in layout)) {
152
+ // make it an own property
153
+ layout.GrandTotalRow = undefined;
154
+ }
155
+ if (!('PivotGrandTotal' in layout)) {
156
+ // make it an own property
157
+ layout.PivotGrandTotal = undefined;
158
+ }
159
+ if (!('PivotColumnTotal' in layout)) {
160
+ // make it an own property
161
+ layout.PivotColumnTotal = undefined;
162
+ }
139
163
  return layout;
140
164
  }
141
165
  exports.normalizePivotLayoutModel = normalizePivotLayoutModel;
@@ -56,7 +56,7 @@ function simplifyTableLayoutModel(layout) {
56
56
  });
57
57
  layout.RowGroupDisplayType = displayType;
58
58
  }
59
- if (!layout.GrandTotalRow) {
59
+ if (layout.GrandTotalRow === undefined) {
60
60
  delete layout.GrandTotalRow;
61
61
  }
62
62
  return layout;
@@ -79,6 +79,15 @@ function simplifyPivotLayoutModel(layout) {
79
79
  if (!layout.PivotGroupedColumns && layout.RowGroupValues) {
80
80
  delete layout.RowGroupValues;
81
81
  }
82
+ if (layout.GrandTotalRow === undefined) {
83
+ delete layout.GrandTotalRow;
84
+ }
85
+ if (layout.PivotColumnTotal === undefined) {
86
+ delete layout.PivotColumnTotal;
87
+ }
88
+ if (layout.PivotGrandTotal === undefined) {
89
+ delete layout.PivotGrandTotal;
90
+ }
82
91
  return layout;
83
92
  }
84
93
  exports.simplifyPivotLayoutModel = simplifyPivotLayoutModel;