@adaptabletools/adaptable-cjs 20.0.7-canary.0 → 20.0.7-canary.2

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 (41) hide show
  1. package/agGrid.d.ts +37 -0
  2. package/agGrid.js +39 -1
  3. package/base.css +19 -3
  4. package/base.css.map +1 -1
  5. package/index.css +17 -3
  6. package/index.css.map +1 -1
  7. package/package.json +3 -3
  8. package/src/AdaptableOptions/LayoutOptions.d.ts +3 -6
  9. package/src/AdaptableState/Common/AdaptableColumn.d.ts +10 -5
  10. package/src/AdaptableState/Common/AdaptableColumn.js +28 -1
  11. package/src/AdaptableState/Common/AggregationColumns.d.ts +10 -0
  12. package/src/AdaptableState/Common/AggregationColumns.js +13 -1
  13. package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -2
  14. package/src/Api/Implementation/ColumnApiImpl.js +30 -2
  15. package/src/Api/Internal/ColumnInternalApi.js +3 -3
  16. package/src/View/Alert/Wizard/AlertButtonsEditor.js +9 -10
  17. package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +26 -25
  18. package/src/View/Components/ColumnFilter/ColumnFilter.js +1 -1
  19. package/src/View/Components/FilterForm/ListBoxFilterForm.js +6 -3
  20. package/src/View/Components/NewScopeComponent.js +2 -1
  21. package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
  22. package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
  23. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +2 -2
  24. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +223 -47
  25. package/src/agGrid/AdaptableAgGrid.js +2 -2
  26. package/src/components/Select/Select.js +15 -3
  27. package/src/env.js +2 -2
  28. package/src/layout-manager/src/index.d.ts +1 -1
  29. package/src/layout-manager/src/index.js +26 -6
  30. package/src/layout-manager/src/isPivotAggTotalColumn.d.ts +2 -0
  31. package/src/layout-manager/src/isPivotAggTotalColumn.js +7 -0
  32. package/src/layout-manager/src/isPivotGrandTotalColumn.d.ts +2 -0
  33. package/src/layout-manager/src/isPivotGrandTotalColumn.js +7 -0
  34. package/src/layout-manager/src/isPivotGroupTotalColumn.d.ts +1 -2
  35. package/src/layout-manager/src/isPivotGroupTotalColumn.js +2 -2
  36. package/src/metamodel/adaptable.metamodel.d.ts +8 -2
  37. package/src/metamodel/adaptable.metamodel.js +1 -1
  38. package/src/types.d.ts +1 -1
  39. package/tsconfig.cjs.tsbuildinfo +1 -1
  40. package/src/layout-manager/src/isPivotTotalColumn.d.ts +0 -2
  41. package/src/layout-manager/src/isPivotTotalColumn.js +0 -7
@@ -9,7 +9,9 @@ const isLayoutEqual_1 = require("./isLayoutEqual");
9
9
  const simplifyLayoutModel_1 = require("./simplifyLayoutModel");
10
10
  const sortColumnIdsByOrder_1 = require("./sortColumnIdsByOrder");
11
11
  const destructurePivotColumnId_1 = require("./destructurePivotColumnId");
12
- const isPivotTotalColumn_1 = require("./isPivotTotalColumn");
12
+ const isPivotAggTotalColumn_1 = require("./isPivotAggTotalColumn");
13
+ const isPivotGrandTotalColumn_1 = require("./isPivotGrandTotalColumn");
14
+ const isPivotGroupTotalColumn_1 = require("./isPivotGroupTotalColumn");
13
15
  function flattenColDefs(colDefs) {
14
16
  const res = [];
15
17
  const iteration = (c) => {
@@ -1111,8 +1113,28 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1111
1113
  }
1112
1114
  return res;
1113
1115
  }
1116
+ patchColDefType(colDef, colTypes) {
1117
+ const originalTypes = colDef.type == undefined ? [] : Array.isArray(colDef.type) ? colDef.type : [colDef.type];
1118
+ const columnTypes = new Set(originalTypes);
1119
+ colTypes.forEach((colType) => {
1120
+ columnTypes.add(colType);
1121
+ });
1122
+ colDef.type = Array.from(columnTypes);
1123
+ }
1114
1124
  setupPivotTotals() {
1115
1125
  const _original_processPivotResultColDef = this.gridApi.getGridOption('processPivotResultColDef');
1126
+ this.gridApi.setGridOption('processPivotResultColDef', (colDef) => {
1127
+ _original_processPivotResultColDef?.(colDef);
1128
+ if (!(0, isPivotLayoutModel_1.isPivotLayoutModel)(this.currentLayout)) {
1129
+ return;
1130
+ }
1131
+ if ((0, isPivotGrandTotalColumn_1.isPivotGrandTotalColumn)(colDef)) {
1132
+ this.patchColDefType(colDef, ['pivotTotalColumn', 'pivotGrandTotalColumn']);
1133
+ }
1134
+ if ((0, isPivotGroupTotalColumn_1.isPivotGroupTotalColumn)(colDef.colId)) {
1135
+ this.patchColDefType(colDef, ['pivotTotalColumn', 'pivotGroupTotalColumn']);
1136
+ }
1137
+ });
1116
1138
  const _original_processPivotResultColGroupDef = this.gridApi.getGridOption('processPivotResultColGroupDef');
1117
1139
  this.gridApi.setGridOption('processPivotResultColGroupDef', (colGroupDef) => {
1118
1140
  _original_processPivotResultColGroupDef?.(colGroupDef);
@@ -1122,9 +1144,6 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1122
1144
  this.patchPivotTotalColumn(colGroupDef);
1123
1145
  });
1124
1146
  }
1125
- isPivotRowTotalColDef(colDef) {
1126
- return colDef.colId?.startsWith('PivotRowTotal_');
1127
- }
1128
1147
  patchPivotTotalColumn(colGroupDef) {
1129
1148
  const hasPivotTotalCols = (pivotLayout) => {
1130
1149
  return pivotLayout.PivotAggregationColumns?.some((aggCol) => !!aggCol.TotalColumn);
@@ -1138,7 +1157,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1138
1157
  const pivotTotalColDefsAfter = [];
1139
1158
  const normalColDefs = [];
1140
1159
  colGroupDef.children.forEach((colDef) => {
1141
- if (this.isPivotRowTotalColDef(colDef)) {
1160
+ if ((0, isPivotGrandTotalColumn_1.isPivotGrandTotalColumn)(colDef)) {
1142
1161
  if (this.gridApi.getGridOption('pivotRowTotals') === 'after') {
1143
1162
  pivotRowTotalColDefsAfter.push(colDef);
1144
1163
  }
@@ -1147,11 +1166,12 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1147
1166
  }
1148
1167
  return;
1149
1168
  }
1150
- if ((0, isPivotTotalColumn_1.isPivotTotalColumn)(colDef)) {
1169
+ if ((0, isPivotAggTotalColumn_1.isPivotAggTotalColumn)(colDef)) {
1151
1170
  if (!colDef.colId.startsWith('pivot_')) {
1152
1171
  this.warn(`Pivot total column ${colDef.colId} is not prefixed with 'pivot_', skipping...`);
1153
1172
  return;
1154
1173
  }
1174
+ this.patchColDefType(colDef, ['pivotTotalColumn', 'pivotAggregationTotalColumn']);
1155
1175
  // we do this for all total cols, but we will hide the ones that are not visible
1156
1176
  colDef.columnGroupShow = undefined;
1157
1177
  const totalColConfig = this.getPivotTotalColumnConfig(colDef, this.currentLayout);
@@ -0,0 +1,2 @@
1
+ import { ColDef } from 'ag-grid-enterprise';
2
+ export declare function isPivotAggTotalColumn(colDef: ColDef): colDef is ColDef;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPivotAggTotalColumn = void 0;
4
+ function isPivotAggTotalColumn(colDef) {
5
+ return !!colDef.pivotTotalColumnIds?.length;
6
+ }
7
+ exports.isPivotAggTotalColumn = isPivotAggTotalColumn;
@@ -0,0 +1,2 @@
1
+ import { ColDef, ColGroupDef } from 'ag-grid-enterprise';
2
+ export declare function isPivotGrandTotalColumn(colDef: ColDef | ColGroupDef): boolean;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPivotGrandTotalColumn = void 0;
4
+ function isPivotGrandTotalColumn(colDef) {
5
+ return colDef?.colId?.startsWith('PivotRowTotal_pivot_');
6
+ }
7
+ exports.isPivotGrandTotalColumn = isPivotGrandTotalColumn;
@@ -1,2 +1 @@
1
- import { ColDef } from 'ag-grid-enterprise';
2
- export declare function isPivotGroupTotalColumn(colDef: ColDef): boolean;
1
+ export declare function isPivotGroupTotalColumn(colId: string): boolean;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isPivotGroupTotalColumn = void 0;
4
- function isPivotGroupTotalColumn(colDef) {
4
+ function isPivotGroupTotalColumn(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
- return colDef.colId?.startsWith('pivot_') && colDef.colId?.endsWith('_');
7
+ return colId?.startsWith('pivot_') && colId?.endsWith('_');
8
8
  }
9
9
  exports.isPivotGroupTotalColumn = isPivotGroupTotalColumn;
@@ -4056,13 +4056,19 @@ export declare const ADAPTABLE_METAMODEL: {
4056
4056
  name: string;
4057
4057
  kind: string;
4058
4058
  desc: string;
4059
- props: {
4059
+ props: ({
4060
4060
  name: string;
4061
4061
  kind: string;
4062
4062
  desc: string;
4063
4063
  isOpt: boolean;
4064
4064
  defVal: string;
4065
- }[];
4065
+ } | {
4066
+ name: string;
4067
+ kind: string;
4068
+ desc: string;
4069
+ isOpt: boolean;
4070
+ defVal?: undefined;
4071
+ })[];
4066
4072
  };
4067
4073
  LayoutViewOptions: {
4068
4074
  name: string;