@adaptabletools/adaptable-cjs 20.0.11 → 20.0.13

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 (52) hide show
  1. package/agGrid.d.ts +3 -3
  2. package/agGrid.js +3 -3
  3. package/package.json +1 -1
  4. package/src/AdaptableOptions/ColumnOptions.d.ts +3 -3
  5. package/src/AdaptableState/Common/AdaptableColumn.d.ts +3 -3
  6. package/src/AdaptableState/Common/AdaptableColumn.js +10 -9
  7. package/src/AdaptableState/Common/AggregationColumns.d.ts +3 -2
  8. package/src/AdaptableState/Common/AggregationColumns.js +0 -3
  9. package/src/AdaptableState/LayoutState.d.ts +6 -2
  10. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
  11. package/src/Api/Implementation/ColumnApiImpl.js +7 -7
  12. package/src/Api/Implementation/LayoutHelpers.js +17 -31
  13. package/src/Api/Internal/ColumnInternalApi.js +4 -4
  14. package/src/Strategy/CalculatedColumnModule.d.ts +1 -1
  15. package/src/Strategy/CellSummaryModule.d.ts +1 -1
  16. package/src/Strategy/ChartingModule.d.ts +1 -1
  17. package/src/Strategy/ColumnFilterModule.d.ts +1 -1
  18. package/src/Strategy/ColumnInfoModule.d.ts +1 -1
  19. package/src/Strategy/FlashingCellModule.d.ts +1 -1
  20. package/src/Strategy/FormatColumnModule.d.ts +1 -1
  21. package/src/Strategy/FreeTextColumnModule.d.ts +1 -1
  22. package/src/Strategy/GridInfoModule.d.ts +1 -1
  23. package/src/Strategy/LayoutModule.d.ts +1 -1
  24. package/src/Strategy/PlusMinusModule.d.ts +1 -1
  25. package/src/Strategy/SettingsPanelModule.d.ts +1 -1
  26. package/src/Strategy/StyledColumnModule.d.ts +1 -1
  27. package/src/Strategy/SystemStatusModule.d.ts +1 -1
  28. package/src/Utilities/Helpers/AdaptableHelper.d.ts +1 -0
  29. package/src/Utilities/Helpers/AdaptableHelper.js +29 -2
  30. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +23 -23
  31. package/src/agGrid/AdaptableAgGrid.js +7 -3
  32. package/src/agGrid/AgGridAdapter.js +3 -3
  33. package/src/agGrid/AgGridColumnAdapter.js +21 -3
  34. package/src/env.js +2 -2
  35. package/src/layout-manager/src/LayoutManagerModel.d.ts +3 -3
  36. package/src/layout-manager/src/index.d.ts +5 -1
  37. package/src/layout-manager/src/index.js +48 -44
  38. package/src/layout-manager/src/isLayoutEqual.d.ts +8 -0
  39. package/src/layout-manager/src/isLayoutEqual.js +46 -3
  40. package/src/layout-manager/src/isPivotColumnTotal.d.ts +1 -0
  41. package/src/layout-manager/src/{isPivotGroupTotalColumn.js → isPivotColumnTotal.js} +3 -3
  42. package/src/layout-manager/src/isPivotGrandTotal.d.ts +2 -0
  43. package/src/layout-manager/src/isPivotGrandTotal.js +7 -0
  44. package/src/layout-manager/src/normalizeLayoutModel.js +24 -0
  45. package/src/layout-manager/src/simplifyLayoutModel.js +10 -1
  46. package/src/metamodel/adaptable.metamodel.d.ts +4 -4
  47. package/src/metamodel/adaptable.metamodel.js +1 -1
  48. package/src/types.d.ts +1 -1
  49. package/tsconfig.cjs.tsbuildinfo +1 -1
  50. package/src/layout-manager/src/isPivotGrandTotalColumn.d.ts +0 -2
  51. package/src/layout-manager/src/isPivotGrandTotalColumn.js +0 -7
  52. package/src/layout-manager/src/isPivotGroupTotalColumn.d.ts +0 -1
@@ -13,7 +13,7 @@ export declare class StyledColumnModule extends AdaptableModuleBase implements I
13
13
  }): AdaptableObject[];
14
14
  getExplicitlyReferencedColumnIds(styledColumn: StyledColumn): string[];
15
15
  hasNamedQueryReferences(): boolean;
16
- createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem<"calculated-column-edit" | "cell-summary-show" | "chart-show" | "column-group" | "column-filter-group" | "column-filter-bar-hide" | "column-filter-bar-show" | "column-filter-clear" | "column-filter-suspend" | "column-filter-unsuspend" | "column-info-show" | "custom-sort-add" | "custom-sort-edit" | "dashboard-group" | "dashboard-collapse" | "dashboard-configure" | "dashboard-dock" | "dashboard-expand" | "dashboard-float" | "dashboard-hide" | "dashboard-show" | "data-import" | "flashing-cell-add" | "flashing-cell-delete" | "format-column-add" | "format-column-edit" | "free-text-column-edit" | "grid-group" | "grid-info-show" | "layout-column-caption-change" | "layout-column-hide" | "layout-edit" | "layout-column-select" | "layout-column-select-preserve" | "layout-column-select-reset" | "layout-grid-select" | "plus-minus-add" | "settings-panel-open" | "styling-group" | "styled-column-badge-add" | "styled-column-badge-edit" | "styled-column-gradient-add" | "styled-column-gradient-edit" | "styled-column-percent-bar-add" | "styled-column-percent-bar-edit" | "styled-column-sparkline-add" | "styled-column-sparkline-edit" | "system-status-show" | "_navbar" | "separator">[];
16
+ createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem<"separator" | "calculated-column-edit" | "cell-summary-show" | "chart-show" | "column-group" | "column-filter-group" | "column-filter-bar-hide" | "column-filter-bar-show" | "column-filter-clear" | "column-filter-suspend" | "column-filter-unsuspend" | "column-info-show" | "custom-sort-add" | "custom-sort-edit" | "dashboard-group" | "dashboard-collapse" | "dashboard-configure" | "dashboard-dock" | "dashboard-expand" | "dashboard-float" | "dashboard-hide" | "dashboard-show" | "data-import" | "flashing-cell-add" | "flashing-cell-delete" | "format-column-add" | "format-column-edit" | "free-text-column-edit" | "grid-group" | "grid-info-show" | "layout-column-caption-change" | "layout-column-hide" | "layout-edit" | "layout-column-select" | "layout-column-select-preserve" | "layout-column-select-reset" | "layout-grid-select" | "plus-minus-add" | "settings-panel-open" | "styling-group" | "styled-column-badge-add" | "styled-column-badge-edit" | "styled-column-gradient-add" | "styled-column-gradient-edit" | "styled-column-percent-bar-add" | "styled-column-percent-bar-edit" | "styled-column-sparkline-add" | "styled-column-sparkline-edit" | "system-status-show" | "_navbar">[];
17
17
  private getGlyphForStyledColumn;
18
18
  getTeamSharingAction(): TeamSharingImportInfo<StyledColumn>;
19
19
  toView(styledColumn: StyledColumn): AdaptableObjectView;
@@ -5,7 +5,7 @@ import { AdaptableModuleView, IModule } from './Interface/IModule';
5
5
  import { AdaptableApi } from '../Api/AdaptableApi';
6
6
  export declare class SystemStatusModule extends AdaptableModuleBase implements IModule {
7
7
  constructor(api: AdaptableApi);
8
- createColumnMenuItems(column: AdaptableColumn): import("../Utilities/MenuItem").MenuItemShowPopup<"calculated-column-edit" | "cell-summary-show" | "chart-show" | "column-group" | "column-filter-group" | "column-filter-bar-hide" | "column-filter-bar-show" | "column-filter-clear" | "column-filter-suspend" | "column-filter-unsuspend" | "column-info-show" | "custom-sort-add" | "custom-sort-edit" | "dashboard-group" | "dashboard-collapse" | "dashboard-configure" | "dashboard-dock" | "dashboard-expand" | "dashboard-float" | "dashboard-hide" | "dashboard-show" | "data-import" | "flashing-cell-add" | "flashing-cell-delete" | "format-column-add" | "format-column-edit" | "free-text-column-edit" | "grid-group" | "grid-info-show" | "layout-column-caption-change" | "layout-column-hide" | "layout-edit" | "layout-column-select" | "layout-column-select-preserve" | "layout-column-select-reset" | "layout-grid-select" | "plus-minus-add" | "settings-panel-open" | "styling-group" | "styled-column-badge-add" | "styled-column-badge-edit" | "styled-column-gradient-add" | "styled-column-gradient-edit" | "styled-column-percent-bar-add" | "styled-column-percent-bar-edit" | "styled-column-sparkline-add" | "styled-column-sparkline-edit" | "system-status-show" | "_navbar" | "separator">[];
8
+ createColumnMenuItems(column: AdaptableColumn): import("../Utilities/MenuItem").MenuItemShowPopup<"separator" | "calculated-column-edit" | "cell-summary-show" | "chart-show" | "column-group" | "column-filter-group" | "column-filter-bar-hide" | "column-filter-bar-show" | "column-filter-clear" | "column-filter-suspend" | "column-filter-unsuspend" | "column-info-show" | "custom-sort-add" | "custom-sort-edit" | "dashboard-group" | "dashboard-collapse" | "dashboard-configure" | "dashboard-dock" | "dashboard-expand" | "dashboard-float" | "dashboard-hide" | "dashboard-show" | "data-import" | "flashing-cell-add" | "flashing-cell-delete" | "format-column-add" | "format-column-edit" | "free-text-column-edit" | "grid-group" | "grid-info-show" | "layout-column-caption-change" | "layout-column-hide" | "layout-edit" | "layout-column-select" | "layout-column-select-preserve" | "layout-column-select-reset" | "layout-grid-select" | "plus-minus-add" | "settings-panel-open" | "styling-group" | "styled-column-badge-add" | "styled-column-badge-edit" | "styled-column-gradient-add" | "styled-column-gradient-edit" | "styled-column-percent-bar-add" | "styled-column-percent-bar-edit" | "styled-column-sparkline-add" | "styled-column-sparkline-edit" | "system-status-show" | "_navbar">[];
9
9
  createContextMenuItems(menuContext: ContextMenuContext): import("../Utilities/MenuItem").MenuItemShowPopup<"calculated-column-edit" | "cell-summary-show" | "column-group" | "column-filter-group" | "column-filter-clear" | "column-filter-suspend" | "column-filter-unsuspend" | "column-info-show" | "dashboard-group" | "dashboard-collapse" | "dashboard-configure" | "dashboard-dock" | "dashboard-expand" | "dashboard-float" | "dashboard-hide" | "dashboard-show" | "data-import" | "grid-group" | "grid-info-show" | "layout-edit" | "settings-panel-open" | "system-status-show" | "menu-group" | "alert-clear" | "bulk-update-apply" | "column-filter-on-cell-value" | "comment-add" | "comment-remove" | "edit-group" | "export-group" | "export-all-data" | "export-all-data-excel-download" | "export-all-data-visualexcel-download" | "export-all-data-csv" | "export-all-data-csv-download" | "export-all-data-csv-clipboard" | "export-all-data-json" | "export-all-data-json-download" | "export-all-data-json-clipboard" | "export-current-layout" | "export-current-layout-excel-download" | "export-current-layout-visualexcel-download" | "export-current-layout-csv" | "export-current-layout-csv-download" | "export-current-layout-csv-clipboard" | "export-current-layout-json" | "export-current-layout-json-download" | "export-current-layout-json-clipboard" | "export-selected-data" | "export-selected-data-excel-download" | "export-selected-data-visualexcel-download" | "export-selected-data-csv" | "export-selected-data-csv-download" | "export-selected-data-csv-clipboard" | "export-selected-data-json" | "export-selected-data-json-download" | "export-selected-data-json-clipboard" | "fdc3-broadcast" | "fdc3-raise-intent" | "flashing-cell-clear" | "flashing-row-clear" | "layout-aggregated-view" | "layout-auto-size" | "layout-clear-selection" | "layout-select-all" | "note-add" | "note-remove" | "smart-edit-apply">[];
10
10
  getViewProperties(): AdaptableModuleView;
11
11
  }
@@ -4,6 +4,7 @@ import { AccessLevel } from '../../AdaptableState/Common/Entitlement';
4
4
  export declare function addUuidsToInitialState(initialState: InitialState): InitialState;
5
5
  export declare function getAccessLevelForObject(adaptableObject: AdaptableObject, moduleAccessLevel: AccessLevel): AccessLevel;
6
6
  export declare function addAdaptableObjectPrimitives<T extends AdaptableObject>(adaptableObject: T): T;
7
+ export declare function removeAdaptableObjectPrimitivesInlineDeep(target: any): any;
7
8
  export declare function removeAdaptableObjectPrimitivesInline(target: any): any;
8
9
  export declare function removeAdaptableObjectPrimitives<T extends AdaptableObject>(adaptableObject: T): T;
9
10
  export declare function isAdaptableObject(object: unknown): object is AdaptableObject;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AdaptableHelper = exports.isAdaptableObject = exports.removeAdaptableObjectPrimitives = exports.removeAdaptableObjectPrimitivesInline = exports.addAdaptableObjectPrimitives = exports.getAccessLevelForObject = exports.addUuidsToInitialState = void 0;
3
+ exports.AdaptableHelper = exports.isAdaptableObject = exports.removeAdaptableObjectPrimitives = exports.removeAdaptableObjectPrimitivesInline = exports.removeAdaptableObjectPrimitivesInlineDeep = exports.addAdaptableObjectPrimitives = exports.getAccessLevelForObject = exports.addUuidsToInitialState = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const cloneDeepWith_1 = tslib_1.__importDefault(require("lodash/cloneDeepWith"));
6
6
  const isPlainObject_1 = tslib_1.__importDefault(require("lodash/isPlainObject"));
@@ -50,8 +50,35 @@ function addAdaptableObjectPrimitives(adaptableObject) {
50
50
  return adaptableObject;
51
51
  }
52
52
  exports.addAdaptableObjectPrimitives = addAdaptableObjectPrimitives;
53
+ function removeAdaptableObjectPrimitivesInlineDeep(target) {
54
+ if (!target) {
55
+ return target;
56
+ }
57
+ if (Array.isArray(target)) {
58
+ target.forEach(removeAdaptableObjectPrimitivesInlineDeep);
59
+ return target;
60
+ }
61
+ if (typeof target !== 'object') {
62
+ return target;
63
+ }
64
+ delete target.Source;
65
+ delete target.Uuid;
66
+ delete target.AdaptableVersion;
67
+ for (const key in target) {
68
+ removeAdaptableObjectPrimitivesInlineDeep(target[key]);
69
+ }
70
+ return target;
71
+ }
72
+ exports.removeAdaptableObjectPrimitivesInlineDeep = removeAdaptableObjectPrimitivesInlineDeep;
53
73
  function removeAdaptableObjectPrimitivesInline(target) {
54
- if (!target || typeof target !== 'object') {
74
+ if (!target) {
75
+ return target;
76
+ }
77
+ if (Array.isArray(target)) {
78
+ target.forEach(removeAdaptableObjectPrimitivesInline);
79
+ return target;
80
+ }
81
+ if (typeof target !== 'object') {
55
82
  return target;
56
83
  }
57
84
  delete target.Source;
@@ -128,7 +128,7 @@ const PivotColumnRow = (props) => {
128
128
  }
129
129
  return {
130
130
  ...aggCol,
131
- TotalColumn: updatedTotalColumn,
131
+ Total: updatedTotalColumn,
132
132
  };
133
133
  }
134
134
  return aggCol;
@@ -138,18 +138,18 @@ const PivotColumnRow = (props) => {
138
138
  };
139
139
  });
140
140
  const currentAggCol = props.layout.PivotAggregationColumns?.find((aggCol) => aggCol.ColumnId === props.column.columnId);
141
- const currentTotal = currentAggCol?.TotalColumn
142
- ? currentAggCol.TotalColumn === true || currentAggCol.TotalColumn === 'before'
141
+ const currentTotal = currentAggCol?.Total
142
+ ? currentAggCol.Total === true || currentAggCol.Total === 'before'
143
143
  ? 'Before'
144
- : currentAggCol.TotalColumn === 'after'
144
+ : currentAggCol.Total === 'after'
145
145
  ? 'After'
146
- : Array.isArray(currentAggCol.TotalColumn)
146
+ : Array.isArray(currentAggCol.Total)
147
147
  ? 'Pivot Specific'
148
148
  : 'Off'
149
149
  : 'Off';
150
- const hasPivotSpecificTotals = Array.isArray(currentAggCol?.TotalColumn);
151
- const pivotSpecificTotals = Array.isArray(currentAggCol?.TotalColumn)
152
- ? currentAggCol.TotalColumn
150
+ const hasPivotSpecificTotals = Array.isArray(currentAggCol?.Total);
151
+ const pivotSpecificTotals = Array.isArray(currentAggCol?.Total)
152
+ ? currentAggCol.Total
153
153
  : props.layout.PivotColumns?.map((pivotColId) => ({
154
154
  PivotColumnId: pivotColId,
155
155
  ShowTotal: false,
@@ -163,7 +163,7 @@ const PivotColumnRow = (props) => {
163
163
  }
164
164
  return total;
165
165
  });
166
- return { ...aggCol, TotalColumn: updatedTotals };
166
+ return { ...aggCol, Total: updatedTotals };
167
167
  }
168
168
  return aggCol;
169
169
  });
@@ -183,7 +183,7 @@ const PivotColumnRow = (props) => {
183
183
  ' ',
184
184
  React.createElement(DropdownButton_1.default, { columns: ['label'], items: numericColumnsOptions, ml: 2 }, weightName))),
185
185
  aggValue && (React.createElement(rebass_1.Flex, { backgroundColor: "primary", ml: 3, alignItems: "center" },
186
- React.createElement(rebass_1.Text, null, "Total Column"),
186
+ React.createElement(rebass_1.Text, null, "Total"),
187
187
  ' ',
188
188
  React.createElement(DropdownButton_1.default, { columns: ['label'], items: totalOptions, ml: 2 }, currentTotal)))),
189
189
  hasPivotSpecificTotals && (React.createElement(rebass_1.Flex, { ml: 2, pl: 2, flexWrap: "wrap", flex: "1 1 auto", alignItems: "center", style: {
@@ -257,7 +257,7 @@ const PivotAggregationsSection = (props) => {
257
257
  ColumnId: colId,
258
258
  AggFunc: currentAggColumns.find((x) => x.ColumnId === colId)?.AggFunc ??
259
259
  adaptable.api.columnApi.getDefaultAggFunc(colId),
260
- TotalColumn: currentAggColumns.find((x) => x.ColumnId === colId)?.TotalColumn,
260
+ TotalColumn: currentAggColumns.find((x) => x.ColumnId === colId)?.Total,
261
261
  };
262
262
  });
263
263
  props.onChange({
@@ -266,9 +266,9 @@ const PivotAggregationsSection = (props) => {
266
266
  });
267
267
  }, [layout]);
268
268
  const handleAggregationChange = React.useCallback((pivotAggregationColumns) => {
269
- if (pivotAggregationColumns.some((aggCol) => aggCol.TotalColumn !== false || aggCol.TotalColumn !== null)) {
269
+ if (pivotAggregationColumns.some((aggCol) => aggCol.Total !== false || aggCol.Total !== null)) {
270
270
  // if any Aggregation Column has a Total Column, we need to disable the Pivot Group Total Column
271
- delete layout['PivotGroupTotalColumn'];
271
+ delete layout['PivotColumnTotal'];
272
272
  }
273
273
  props.onChange({
274
274
  ...layout,
@@ -302,7 +302,7 @@ const PivotAggregationsSection = (props) => {
302
302
  SuppressAggFuncInHeader: checked,
303
303
  });
304
304
  };
305
- const checkIfPivotGroupTotalColumnEnabled = () => {
305
+ const checkIfPivotColumnTotalEnabled = () => {
306
306
  // check that all AggregationColumns have identical AggFuncs
307
307
  const aggregationColumns = layout.PivotAggregationColumns;
308
308
  if (!aggregationColumns || aggregationColumns.length === 0) {
@@ -313,13 +313,13 @@ const PivotAggregationsSection = (props) => {
313
313
  return 'Requires identical aggregation on all columns';
314
314
  }
315
315
  // check that no Aggregation Total Column is enabled
316
- const hasAggregationTotalColumn = aggregationColumns.some((aggCol) => aggCol.TotalColumn !== false && aggCol.TotalColumn != null);
316
+ const hasAggregationTotalColumn = aggregationColumns.some((aggCol) => aggCol.Total !== false && aggCol.Total != null);
317
317
  if (hasAggregationTotalColumn) {
318
318
  return 'Can only be enabled when no Aggregation Total Column is present';
319
319
  }
320
320
  return true;
321
321
  };
322
- const isPivotGroupTotalColumnEnabled = checkIfPivotGroupTotalColumnEnabled();
322
+ const isPivotColumnTotalEnabled = checkIfPivotColumnTotalEnabled();
323
323
  return (React.createElement(Tabs_1.Tabs, { style: { height: '100%' } },
324
324
  React.createElement(Tabs_1.Tabs.Tab, null, "Column Aggregations"),
325
325
  React.createElement(Tabs_1.Tabs.Content, null,
@@ -339,29 +339,29 @@ const PivotAggregationsSection = (props) => {
339
339
  GrandTotalRow: value,
340
340
  });
341
341
  }, isClearable: true })),
342
- React.createElement(FormLayout_1.FormRow, { label: 'Grand Total Column' },
342
+ React.createElement(FormLayout_1.FormRow, { label: 'Pivot Grand Total' },
343
343
  React.createElement(Select_1.Select, { style: { width: 120 }, options: ['before', 'after'].map((position) => {
344
344
  return {
345
345
  label: StringExtensions_1.default.CapitaliseFirstLetter(position),
346
346
  value: position,
347
347
  };
348
- }), placeholder: "Off", value: layout.GrandTotalColumn, onChange: (value) => {
348
+ }), placeholder: "Off", value: layout.PivotGrandTotal, onChange: (value) => {
349
349
  props.onChange({
350
350
  ...layout,
351
- GrandTotalColumn: value,
351
+ PivotGrandTotal: value,
352
352
  });
353
353
  }, isClearable: true })),
354
- React.createElement(FormLayout_1.FormRow, { label: 'Pivot Group Total Column' }, isPivotGroupTotalColumnEnabled === true ? (React.createElement(Select_1.Select, { style: { width: 120 }, options: ['before', 'after'].map((position) => {
354
+ React.createElement(FormLayout_1.FormRow, { label: 'Pivot Column Total' }, isPivotColumnTotalEnabled === true ? (React.createElement(Select_1.Select, { style: { width: 120 }, options: ['before', 'after'].map((position) => {
355
355
  return {
356
356
  label: StringExtensions_1.default.CapitaliseFirstLetter(position),
357
357
  value: position,
358
358
  };
359
- }), placeholder: "Off", value: layout.PivotGroupTotalColumn, onChange: (value) => {
359
+ }), placeholder: "Off", value: layout.PivotColumnTotal, onChange: (value) => {
360
360
  props.onChange({
361
361
  ...layout,
362
- PivotGroupTotalColumn: value,
362
+ PivotColumnTotal: value,
363
363
  });
364
- }, isClearable: true })) : (React.createElement(rebass_1.Text, { marginLeft: 1, style: { fontStyle: 'italic' } }, isPivotGroupTotalColumnEnabled))))),
364
+ }, isClearable: true })) : (React.createElement(rebass_1.Text, { marginLeft: 1, style: { fontStyle: 'italic' } }, isPivotColumnTotalEnabled))))),
365
365
  React.createElement(ValueSelector_1.ValueSelector, { showFilterInput: true, showSelectedOnlyPosition: "top", filter: Utilities_1.columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, toListLabel: (column) => (React.createElement(PivotColumnRow, { onChangeAggFunction: handleAggregationChange, layout: layout, column: column, aggregationColumnsMap: aggregationColumnsMap, numberColumns: numberColumns })), options: sortedAggregableColumns, value: (layout.PivotAggregationColumns || []).map((col) => col.ColumnId), allowReorder: true, xSelectedLabel: () => {
366
366
  return `Active aggregations:`;
367
367
  }, onChange: handleColumnsSelectionChange }))));
@@ -1080,6 +1080,10 @@ You need to define at least one Layout!`);
1080
1080
  [AdaptableColumn_1.FREE_TEXT_COLUMN_TYPE]: {},
1081
1081
  [AdaptableColumn_1.ACTION_COLUMN_TYPE]: {},
1082
1082
  [AdaptableColumn_1.FDC3_COLUMN_TYPE]: {},
1083
+ [AdaptableColumn_1.PIVOT_ANY_TOTAL_COLUMN_TYPE]: {},
1084
+ [AdaptableColumn_1.PIVOT_GRAND_TOTAL_COLUMN_TYPE]: {},
1085
+ [AdaptableColumn_1.PIVOT_COLUMN_TOTAL_COLUMN_TYPE]: {},
1086
+ [AdaptableColumn_1.PIVOT_AGGREGATION_TOTAL_COLUMN_TYPE]: {},
1083
1087
  };
1084
1088
  const patchedColumnTypes = Object.assign({}, providedColumnTypes, adaptableSpecialColumnTypes);
1085
1089
  const customColumnTypes = this.api.columnApi.getColumnTypes() ?? [];
@@ -3338,14 +3342,14 @@ You need to define at least one Layout!`);
3338
3342
  if (!(0, LayoutHelpers_1.isPivotLayout)(layout)) {
3339
3343
  return false;
3340
3344
  }
3341
- if (layout.GrandTotalColumn) {
3345
+ if (layout.PivotGrandTotal) {
3342
3346
  return true;
3343
3347
  }
3344
- if (layout.PivotGroupTotalColumn) {
3348
+ if (layout.PivotColumnTotal) {
3345
3349
  return true;
3346
3350
  }
3347
3351
  if (layout.PivotAggregationColumns) {
3348
- return layout.PivotAggregationColumns.some((col) => !!col.TotalColumn);
3352
+ return layout.PivotAggregationColumns.some((col) => !!col.Total);
3349
3353
  }
3350
3354
  };
3351
3355
  return hasPivotTotals(one) || hasPivotTotals(other);
@@ -11,7 +11,7 @@ const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/Mod
11
11
  const agGridModules_1 = require("./agGridModules");
12
12
  const agGridDataTypeDefinitions_1 = require("./agGridDataTypeDefinitions");
13
13
  const ColumnApiImpl_1 = require("../Api/Implementation/ColumnApiImpl");
14
- const isPivotGroupTotalColumn_1 = require("../layout-manager/src/isPivotGroupTotalColumn");
14
+ const isPivotColumnTotal_1 = require("../layout-manager/src/isPivotColumnTotal");
15
15
  const isPivotAggTotalColumn_1 = require("../layout-manager/src/isPivotAggTotalColumn");
16
16
  // AG GRID obfuscates its internals, this is (currently) the best way to get hold of its internal services
17
17
  const DANGER_AG_GRID_BEANS_MAP = {};
@@ -614,8 +614,8 @@ class AgGridAdapter {
614
614
  return this.adaptableApi.actionColumnApi.getActionColumnForColumnId(colDef.colId) != null;
615
615
  }
616
616
  isPivotTotalColumn(colDef) {
617
- return ((0, ColumnApiImpl_1.isPivotGrandTotalColumn)(colDef.colId) ||
618
- (0, isPivotGroupTotalColumn_1.isPivotGroupTotalColumn)(colDef.colId) ||
617
+ return ((0, ColumnApiImpl_1.isPivotGrandTotal)(colDef.colId) ||
618
+ (0, isPivotColumnTotal_1.isPivotColumnTotal)(colDef.colId) ||
619
619
  (0, isPivotAggTotalColumn_1.isPivotAggTotalColumn)(colDef));
620
620
  }
621
621
  isColumnFilterable(colDef) {
@@ -207,14 +207,32 @@ class AgGridColumnAdapter {
207
207
  const quickSearchStyle = this.getQuickSearchCellStyle();
208
208
  const hasQuickSearchStyle = quickSearchStyle != undefined;
209
209
  const cellStyle = (params) => {
210
- const gridCell = this.adaptableApi.gridApi.getGridCellFromRowNode(params.node, abColumn.columnId);
210
+ const columnId = params.column.getColId();
211
+ const gridCell = this.adaptableApi.gridApi.getGridCellFromRowNode(params.node, columnId);
211
212
  if (!gridCell || !gridCell.column) {
212
213
  return {};
213
214
  }
214
215
  const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(gridCell, params);
215
- const userDefined = typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle;
216
+ let baseStyles = {};
217
+ // this is required because otherwise, when AG Grid filters, it refershed the pivotResultColDef and the base styles get lost
218
+ // if pivot result col: inherit styles from base column
219
+ if (this.adaptableApi.columnApi.isPivotResultColumn(columnId)) {
220
+ const baseColumn = params.column.getColDef()?.pivotValueColumn;
221
+ if (baseColumn) {
222
+ const baseColDefCellStyle = baseColumn?.getColDef()?.cellStyle;
223
+ const baseColParams = { ...params, column: baseColumn };
224
+ baseStyles =
225
+ typeof baseColDefCellStyle === 'function'
226
+ ? baseColDefCellStyle(baseColParams)
227
+ : baseColDefCellStyle;
228
+ }
229
+ }
230
+ else {
231
+ // inherit styles from user provided colDef property
232
+ baseStyles = typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle;
233
+ }
216
234
  const result = {
217
- ...userDefined,
235
+ ...baseStyles,
218
236
  ...this.getReadOnlyCellStyle(gridCell, params),
219
237
  ...this.getEditableCellStyle(gridCell, params),
220
238
  ...this.getEditedCellStyle(gridCell, params),
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
5
- PUBLISH_TIMESTAMP: 1746021672088 || Date.now(),
6
- VERSION: "20.0.11" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1746196695957 || Date.now(),
6
+ VERSION: "20.0.13" || '--current-version--',
7
7
  };
@@ -72,7 +72,7 @@ export type AggregationColumnsModelItem = {
72
72
  };
73
73
  export type AggregationColumnsModel = AggregationColumnsModelItem[];
74
74
  export type PivotAggregationColumnsModel = (AggregationColumnsModelItem & {
75
- TotalColumn?: boolean | 'before' | 'after' | {
75
+ Total?: boolean | 'before' | 'after' | {
76
76
  PivotColumnId: string;
77
77
  ShowTotal?: boolean | 'before' | 'after';
78
78
  }[];
@@ -116,10 +116,10 @@ export interface PivotLayoutModel extends BaseLayoutModel {
116
116
  /**
117
117
  * Display Total of all Pivot Columns before or after the Pivot Columns
118
118
  */
119
- GrandTotalColumn?: 'before' | 'after' | boolean;
119
+ PivotGrandTotal?: 'before' | 'after' | boolean;
120
120
  /**
121
121
  * Display automatically calculated Totals within EACH Pivot Column Group, in the position specified
122
122
  */
123
- PivotGroupTotalColumn?: 'before' | 'after' | boolean;
123
+ PivotColumnTotal?: 'before' | 'after' | boolean;
124
124
  }
125
125
  export type LayoutModel = TableLayoutModel | PivotLayoutModel;
@@ -1,6 +1,10 @@
1
1
  import { ColumnState, GridApi, GridOptions, GridState } from 'ag-grid-enterprise';
2
2
  import { PivotLayoutModel, TableLayoutModel } from './LayoutManagerModel';
3
3
  import { LMEmitter } from './LMEmitter';
4
+ export declare const PIVOT_ANY_TOTAL_COL_TYPE = "pivotAnyTotal";
5
+ export declare const PIVOT_GRAND_TOTAL_COL_TYPE = "pivotGrandTotal";
6
+ export declare const PIVOT_COLUMN_TOTAL_COL_TYPE = "pivotColumnTotal";
7
+ export declare const PIVOT_AGGREGATION_TOTAL_COL_TYPE = "pivotAggregationTotal";
4
8
  export type LayoutManagerOptions = {
5
9
  gridApi: GridApi;
6
10
  debugId: string;
@@ -74,7 +78,7 @@ export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
74
78
  private withSuppressColumnAnimation;
75
79
  private patchColDefType;
76
80
  private setupPivotTotals;
77
- private patchPivotTotalColumn;
81
+ private patchPivotAggregationTotal;
78
82
  private getPivotTotalColumnConfig;
79
83
  }
80
84
  export {};
@@ -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 {};