@adaptabletools/adaptable 18.0.0-canary.16 → 18.0.0-canary.18

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 (74) hide show
  1. package/package.json +1 -1
  2. package/src/AdaptableInterfaces/IAdaptable.d.ts +0 -2
  3. package/src/AdaptableOptions/ColumnFilterOptions.d.ts +4 -3
  4. package/src/Api/GridApi.d.ts +1 -1
  5. package/src/Api/Implementation/CellSummaryApiImpl.d.ts +0 -5
  6. package/src/Api/Implementation/CellSummaryApiImpl.js +2 -23
  7. package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
  8. package/src/Api/Implementation/GridApiImpl.js +1 -1
  9. package/src/Api/Internal/AdaptableInternalApi.d.ts +0 -2
  10. package/src/Api/Internal/AdaptableInternalApi.js +0 -3
  11. package/src/Api/Internal/GridFilterInternalApi.d.ts +5 -0
  12. package/src/Api/Internal/GridFilterInternalApi.js +6 -0
  13. package/src/PredefinedConfig/Common/Enums.d.ts +2 -1
  14. package/src/PredefinedConfig/Common/Enums.js +1 -0
  15. package/src/PredefinedConfig/Common/Menu.d.ts +15 -1
  16. package/src/PredefinedConfig/Common/Menu.js +97 -1
  17. package/src/PredefinedConfig/Common/RowSummary.d.ts +3 -1
  18. package/src/PredefinedConfig/Common/RowSummary.js +16 -0
  19. package/src/Redux/Store/AdaptableStore.js +11 -6
  20. package/src/Strategy/AdaptableModuleBase.d.ts +6 -5
  21. package/src/Strategy/AdaptableModuleBase.js +9 -8
  22. package/src/Strategy/AlertModule.js +1 -1
  23. package/src/Strategy/BulkUpdateModule.js +1 -1
  24. package/src/Strategy/CalculatedColumnModule.js +1 -1
  25. package/src/Strategy/CellSummaryModule.d.ts +7 -6
  26. package/src/Strategy/CellSummaryModule.js +37 -12
  27. package/src/Strategy/ColumnFilterModule.d.ts +1 -1
  28. package/src/Strategy/ColumnFilterModule.js +43 -39
  29. package/src/Strategy/ColumnInfoModule.js +2 -0
  30. package/src/Strategy/CommentModule.js +2 -2
  31. package/src/Strategy/CustomSortModule.js +2 -1
  32. package/src/Strategy/DashboardModule.js +8 -7
  33. package/src/Strategy/DataImportModule.js +1 -1
  34. package/src/Strategy/ExportModule.d.ts +1 -0
  35. package/src/Strategy/ExportModule.js +17 -2
  36. package/src/Strategy/Fdc3Module.js +3 -0
  37. package/src/Strategy/FlashingCellModule.js +4 -4
  38. package/src/Strategy/FormatColumnModule.js +6 -4
  39. package/src/Strategy/FreeTextColumnModule.js +1 -1
  40. package/src/Strategy/GridInfoModule.js +2 -0
  41. package/src/Strategy/LayoutModule.js +32 -23
  42. package/src/Strategy/NoteModule.js +2 -2
  43. package/src/Strategy/PlusMinusModule.js +1 -1
  44. package/src/Strategy/SettingsPanelModule.js +3 -3
  45. package/src/Strategy/SmartEditModule.js +1 -1
  46. package/src/Strategy/StyledColumnModule.d.ts +1 -0
  47. package/src/Strategy/StyledColumnModule.js +26 -5
  48. package/src/Strategy/SystemStatusModule.js +2 -2
  49. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +2 -2
  50. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +124 -3
  51. package/src/Utilities/MenuItem.d.ts +7 -4
  52. package/src/Utilities/MenuItem.js +6 -3
  53. package/src/Utilities/Services/LicenseService/index.js +1 -1
  54. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +5 -2
  55. package/src/View/Components/FilterForm/QuickFilterForm.js +1 -1
  56. package/src/View/Components/ValueSelector/index.js +1 -1
  57. package/src/View/Layout/Wizard/LayoutWizard.js +26 -2
  58. package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +1 -0
  59. package/src/View/Layout/Wizard/sections/RowSummarySection.js +26 -2
  60. package/src/agGrid/AdaptableAgGrid.d.ts +0 -2
  61. package/src/agGrid/AdaptableAgGrid.js +7 -3
  62. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +1 -1
  63. package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
  64. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -2
  65. package/src/agGrid/weightedAverage.d.ts +0 -2
  66. package/src/agGrid/weightedAverage.js +0 -54
  67. package/src/components/Datepicker/index.js +3 -1
  68. package/src/env.js +2 -2
  69. package/src/metamodel/adaptable.metamodel.js +1 -1
  70. package/tsconfig.esm.tsbuildinfo +1 -1
  71. package/src/Utilities/Services/Interface/ISummaryService.d.ts +0 -17
  72. package/src/Utilities/Services/Interface/ISummaryService.js +0 -12
  73. package/src/Utilities/Services/SummaryService.d.ts +0 -10
  74. package/src/Utilities/Services/SummaryService.js +0 -17
@@ -45,6 +45,9 @@ export class StyledColumnModule extends AdaptableModuleBase {
45
45
  styledColumn = Object.assign(Object.assign({}, ObjectFactory.CreateEmptyStyledColumn()), { ColumnId: column.columnId, SparkLineStyle: {} });
46
46
  }
47
47
  let label = hasSparklineStyle ? 'Edit ' : 'Create ';
48
+ let name = hasSparklineStyle
49
+ ? 'styled-column-sparkline-edit'
50
+ : 'styled-column-sparkline-add';
48
51
  let popupParam = {
49
52
  action: sparklineColumnExists ? 'Edit' : 'New',
50
53
  source: 'ColumnMenu',
@@ -53,7 +56,7 @@ export class StyledColumnModule extends AdaptableModuleBase {
53
56
  defaultCurrentSectionName: 'Settings',
54
57
  },
55
58
  };
56
- returnColumnMenuItems.push(this.createColumnMenuItemShowPopup(label + 'Sparkline Column', this.moduleInfo.Popup, this.getGlyphForStyledColumn(styledColumn), popupParam));
59
+ returnColumnMenuItems.push(this.createMenuItemShowPopup(name, label + 'Sparkline Column', this.moduleInfo.Popup, this.getGlyphForStyledColumn(styledColumn), popupParam));
57
60
  }
58
61
  }
59
62
  // Next do non sparkline
@@ -78,7 +81,8 @@ export class StyledColumnModule extends AdaptableModuleBase {
78
81
  };
79
82
  const icon = this.getGlyphForStyledColumn(styledColumn);
80
83
  const label = `Edit ${this.getTypeLabel(styledColumn)} Style`;
81
- returnColumnMenuItems.push(this.createColumnMenuItemShowPopup(label, this.moduleInfo.Popup, icon, popupParam));
84
+ const name = this.getTypeName(styledColumn);
85
+ returnColumnMenuItems.push(this.createMenuItemShowPopup(name, label, this.moduleInfo.Popup, icon, popupParam));
82
86
  }
83
87
  }
84
88
  else {
@@ -90,7 +94,7 @@ export class StyledColumnModule extends AdaptableModuleBase {
90
94
  config: {},
91
95
  };
92
96
  const badgeLabel = column.dataType === 'Number' ? 'Badge' : 'Create Badge Style';
93
- const newBadgeButton = this.createColumnMenuItemShowPopup(badgeLabel, this.moduleInfo.Popup, 'badge', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { BadgeStyle: {
97
+ const newBadgeButton = this.createMenuItemShowPopup('styled-column-badge-add', badgeLabel, this.moduleInfo.Popup, 'badge', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { BadgeStyle: {
94
98
  Badges: [ObjectFactory.CreateDefaultStyledColumnBadge()],
95
99
  } }), config: {
96
100
  defaultCurrentSectionName: 'Badges',
@@ -102,17 +106,18 @@ export class StyledColumnModule extends AdaptableModuleBase {
102
106
  const emptyRanges = this.api.scopeApi.createCellColorRangesForScope({
103
107
  ColumnIds: [column.columnId],
104
108
  });
105
- const newGrandientButton = this.createColumnMenuItemShowPopup('Gradient', this.moduleInfo.Popup, 'gradient', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { GradientStyle: {
109
+ const newGrandientButton = this.createMenuItemShowPopup('styled-column-gradient-add', 'Gradient', this.moduleInfo.Popup, 'gradient', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { GradientStyle: {
106
110
  CellRanges: emptyRanges,
107
111
  } }), config: {
108
112
  defaultCurrentSectionName: 'Style',
109
113
  } }));
110
- const newPrecentBarButton = this.createColumnMenuItemShowPopup('Percent Bar', this.moduleInfo.Popup, 'percent', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { PercentBarStyle: {
114
+ const newPrecentBarButton = this.createMenuItemShowPopup('styled-column-percent-bar-add', 'Percent Bar', this.moduleInfo.Popup, 'percent', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { PercentBarStyle: {
111
115
  CellRanges: emptyRanges,
112
116
  } }), config: {
113
117
  defaultCurrentSectionName: 'Style',
114
118
  } }));
115
119
  returnColumnMenuItems.push({
120
+ name: 'parent',
116
121
  label: 'Create Styled Column',
117
122
  module: this.moduleInfo.ModuleName,
118
123
  isVisible: true,
@@ -230,4 +235,20 @@ export class StyledColumnModule extends AdaptableModuleBase {
230
235
  }
231
236
  return type;
232
237
  }
238
+ getTypeName(styledColumn) {
239
+ let type = null;
240
+ if (styledColumn.GradientStyle) {
241
+ type = 'styled-column-gradient-edit';
242
+ }
243
+ else if (styledColumn.PercentBarStyle) {
244
+ type = 'styled-column-percent-bar-edit';
245
+ }
246
+ else if (styledColumn.SparkLineStyle) {
247
+ type = 'styled-column-sparkline-edit';
248
+ }
249
+ else if (styledColumn.BadgeStyle) {
250
+ type = 'styled-column-badge-edit';
251
+ }
252
+ return type;
253
+ }
233
254
  }
@@ -8,7 +8,7 @@ export class SystemStatusModule extends AdaptableModuleBase {
8
8
  addColumnMenuItems(column) {
9
9
  if (this.isModuleAvailable()) {
10
10
  return [
11
- this.createColumnMenuItemShowPopup('Show System Status', this.moduleInfo.Popup, this.moduleInfo.Glyph),
11
+ this.createMenuItemShowPopup('system-status-show', 'Show System Status', this.moduleInfo.Popup, this.moduleInfo.Glyph),
12
12
  ];
13
13
  }
14
14
  }
@@ -18,7 +18,7 @@ export class SystemStatusModule extends AdaptableModuleBase {
18
18
  source: 'ContextMenu',
19
19
  };
20
20
  return [
21
- this.createMainMenuItemShowPopup({
21
+ this.createMainMenuItemShowPopup({ Name: 'system-status-show',
22
22
  Label: 'Show System Status',
23
23
  ComponentName: this.moduleInfo.Popup,
24
24
  Icon: this.moduleInfo.Glyph,
@@ -1,12 +1,12 @@
1
+ import { IRowNode } from '@ag-grid-community/core';
1
2
  import { ExpressionFunction } from '../../parser/src/types';
2
3
  import { BaseParameter } from './expressionFunctionUtils';
3
- import { IRowNode } from '@ag-grid-community/core';
4
4
  import { AggregateParams } from './scalarAggregationHelper';
5
5
  /**
6
6
  * List of all the AggregatedScalar Functions available in AdaptableQL
7
7
  */
8
8
  export type AggregatedScalarFunctionName = ScalarAggregationFunction | OperandFunction;
9
- export type ScalarAggregationFunction = 'SUM' | 'PERCENTAGE' | 'QUANT' | 'QUARTILE' | 'PERCENTILE' | 'AVG' | 'MIN' | 'MAX' | 'COUNT' | 'CUMUL' | 'MEDIAN' | 'MODE' | 'DISTINCT' | 'ONLY' | 'STD_DEVIATION';
9
+ export type ScalarAggregationFunction = 'SUM' | 'PERCENTAGE' | 'QUANT' | 'QUARTILE' | 'PERCENTILE' | 'AVG' | 'MIN' | 'MAX' | 'COUNT' | 'CUMUL' | 'MEDIAN' | 'MODE' | 'DISTINCT' | 'ONLY' | 'STD_DEVIATION' | 'OLDEST' | 'YOUNGEST';
10
10
  type OperandFunction = 'COL' | 'OVER' | 'GROUP_BY' | 'WEIGHT';
11
11
  export interface ScalarAggregationParameter extends BaseParameter<'aggregationScalar', ScalarAggregationFunction> {
12
12
  value: AggregatedScalarExpressionEvaluation;
@@ -1,7 +1,9 @@
1
- import { extractColumnParameter, extractColumnParameters, extractParameter, getNumericValue, handleColumnFunction, validateColumnType, } from './expressionFunctionUtils';
2
1
  import { ExpressionEvaluationError } from '../../parser/src/ExpressionEvaluationError';
3
- import { getTypedKeys } from '../Extensions/TypeExtensions';
4
2
  import { SumArray } from '../Extensions/ArrayExtensions';
3
+ import { getTypedKeys } from '../Extensions/TypeExtensions';
4
+ import { extractColumnParameter, extractColumnParameters, extractParameter, getNumericValue, handleColumnFunction, validateColumnType, } from './expressionFunctionUtils';
5
+ import isAfter from 'date-fns/isAfter';
6
+ import { parseDateValue } from '../Helpers/DateHelper';
5
7
  export const aggregatedExpressionFunctions = [
6
8
  'SUM',
7
9
  'PERCENTAGE',
@@ -351,6 +353,7 @@ export const aggregatedScalarExpressionFunctions = {
351
353
  return aggregatedValue;
352
354
  },
353
355
  done: (aggregatedValue) => {
356
+ var _a;
354
357
  const sorted = [...aggregatedValue.entries()].sort(([aVal, aFreq], [bVal, bFreq]) => {
355
358
  if (aFreq < bFreq) {
356
359
  return 1;
@@ -362,7 +365,7 @@ export const aggregatedScalarExpressionFunctions = {
362
365
  return aVal === bVal ? 0 : 1;
363
366
  }
364
367
  });
365
- return sorted[0][0];
368
+ return (_a = sorted === null || sorted === void 0 ? void 0 : sorted[0]) === null || _a === void 0 ? void 0 : _a[0];
366
369
  },
367
370
  },
368
371
  },
@@ -908,6 +911,124 @@ export const aggregatedScalarExpressionFunctions = {
908
911
  examples: ['[col1]', 'COL("col1")'],
909
912
  category: 'special',
910
913
  },
914
+ OLDEST: {
915
+ handler(args, context) {
916
+ const minColumnParameter = extractColumnParameter('OLDEST', args);
917
+ const minColumnName = minColumnParameter.value;
918
+ validateColumnType(minColumnName, ['Date'], 'OLDEST', context.adaptableApi);
919
+ const groupByParameter = extractParameter('OLDEST', 'operand', ['GROUP_BY'], args, {
920
+ isOptional: true,
921
+ });
922
+ const aggregationExpressionEvaluation = {
923
+ aggregationParams: {
924
+ reducers: {
925
+ OLDEST: {
926
+ name: 'OLDEST',
927
+ field: minColumnName,
928
+ initialValue: null,
929
+ reducer: (minValue, rowValue) => {
930
+ if (!minValue) {
931
+ return rowValue;
932
+ }
933
+ if (!rowValue) {
934
+ return minValue;
935
+ }
936
+ if (isAfter(parseDateValue(minValue), parseDateValue(rowValue))) {
937
+ return rowValue;
938
+ }
939
+ else {
940
+ return minValue;
941
+ }
942
+ },
943
+ done: (minValue, arr) => {
944
+ if (minValue !== null) {
945
+ return minValue;
946
+ }
947
+ },
948
+ },
949
+ },
950
+ },
951
+ rowFilterFn: context.filterFn,
952
+ getRowNodes: context.getRowNodes,
953
+ };
954
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
955
+ const result = {
956
+ name: 'OLDEST',
957
+ type: 'aggregationScalar',
958
+ value: aggregationExpressionEvaluation,
959
+ };
960
+ return result;
961
+ },
962
+ description: 'Aggregates a column over multiple rows by computing the minimum of the column values\nOptionally the aggregation may be computed within provided individual groups',
963
+ signatures: [
964
+ 'OLDEST( [colName] )',
965
+ 'OLDEST( COL(name: string))',
966
+ 'OLDEST( [colNameA], GROUP_BY( [colNameB] ))',
967
+ 'OLDEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
968
+ ],
969
+ examples: ['OLDEST([colA])', 'OLDEST([colA], GROUP_BY([colB]))'],
970
+ category: 'aggregation',
971
+ inputs: ['date'],
972
+ },
973
+ YOUNGEST: {
974
+ handler(args, context) {
975
+ const minColumnParameter = extractColumnParameter('YOUNGEST', args);
976
+ const minColumnName = minColumnParameter.value;
977
+ validateColumnType(minColumnName, ['Date'], 'YOUNGEST', context.adaptableApi);
978
+ const groupByParameter = extractParameter('YOUNGEST', 'operand', ['GROUP_BY'], args, {
979
+ isOptional: true,
980
+ });
981
+ const aggregationExpressionEvaluation = {
982
+ aggregationParams: {
983
+ reducers: {
984
+ YOUNGEST: {
985
+ name: 'YOUNGEST',
986
+ field: minColumnName,
987
+ initialValue: null,
988
+ reducer: (minValue, rowValue) => {
989
+ if (!minValue) {
990
+ return rowValue;
991
+ }
992
+ if (!rowValue) {
993
+ return minValue;
994
+ }
995
+ if (isAfter(parseDateValue(minValue), parseDateValue(rowValue))) {
996
+ return minValue;
997
+ }
998
+ else {
999
+ return rowValue;
1000
+ }
1001
+ },
1002
+ done: (minValue, arr) => {
1003
+ if (minValue !== null) {
1004
+ return minValue;
1005
+ }
1006
+ },
1007
+ },
1008
+ },
1009
+ },
1010
+ rowFilterFn: context.filterFn,
1011
+ getRowNodes: context.getRowNodes,
1012
+ };
1013
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
1014
+ const result = {
1015
+ name: 'YOUNGEST',
1016
+ type: 'aggregationScalar',
1017
+ value: aggregationExpressionEvaluation,
1018
+ };
1019
+ return result;
1020
+ },
1021
+ description: 'Aggregates a column over multiple rows by computing the minimum of the column values\nOptionally the aggregation may be computed within provided individual groups',
1022
+ signatures: [
1023
+ 'YOUNGEST( [colName] )',
1024
+ 'YOUNGEST( COL(name: string))',
1025
+ 'YOUNGEST( [colNameA], GROUP_BY( [colNameB] ))',
1026
+ 'YOUNGEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
1027
+ ],
1028
+ examples: ['YOUNGEST([colA])', 'YOUNGEST([colA], GROUP_BY([colB]))'],
1029
+ category: 'aggregation',
1030
+ inputs: ['date'],
1031
+ },
911
1032
  };
912
1033
  const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, context) => {
913
1034
  const aggregationEvaluation = aggregationParameter.value;
@@ -1,10 +1,11 @@
1
1
  import * as Redux from 'redux';
2
2
  import { ModuleParams } from '../View/Components/SharedProps/ModuleViewPopupProps';
3
- import { AdaptableMenuItem } from '../PredefinedConfig/Common/Menu';
3
+ import { AdaptableMenuItem, AdaptableContextMenuItemName, AdaptableColumnMenuItemName } from '../PredefinedConfig/Common/Menu';
4
4
  import { AdaptableModule } from '../PredefinedConfig/Common/Types';
5
5
  import { AdaptableIcon, AdaptableSystemIconName } from '../PredefinedConfig/Common/AdaptableIcon';
6
6
  export declare class MenuItemDoReduxAction implements AdaptableMenuItem {
7
- constructor(label: string, module: AdaptableModule, reduxAction: Redux.Action, icon: AdaptableSystemIconName, isVisible: boolean);
7
+ constructor(name: AdaptableColumnMenuItemName | AdaptableContextMenuItemName, label: string, module: AdaptableModule, reduxAction: Redux.Action, icon: AdaptableSystemIconName, isVisible: boolean);
8
+ name: AdaptableColumnMenuItemName | AdaptableContextMenuItemName;
8
9
  reduxAction: Redux.Action;
9
10
  label: string;
10
11
  module: AdaptableModule;
@@ -12,7 +13,8 @@ export declare class MenuItemDoReduxAction implements AdaptableMenuItem {
12
13
  icon: AdaptableIcon;
13
14
  }
14
15
  export declare class MenuItemDoClickFunction implements AdaptableMenuItem {
15
- constructor(label: string, module: AdaptableModule, clickFunction: () => void, icon: AdaptableSystemIconName, isVisible: boolean);
16
+ constructor(name: AdaptableColumnMenuItemName | AdaptableContextMenuItemName, label: string, module: AdaptableModule, clickFunction: () => void, icon: AdaptableSystemIconName, isVisible: boolean);
17
+ name: AdaptableColumnMenuItemName | AdaptableContextMenuItemName;
16
18
  onClick: () => void;
17
19
  label: string;
18
20
  module: AdaptableModule;
@@ -20,7 +22,8 @@ export declare class MenuItemDoClickFunction implements AdaptableMenuItem {
20
22
  icon: AdaptableIcon;
21
23
  }
22
24
  export declare class MenuItemShowPopup implements AdaptableMenuItem {
23
- constructor(label: string, module: AdaptableModule, componentName: string, icon: AdaptableSystemIconName, isVisible: boolean, popupParams?: ModuleParams);
25
+ constructor(name: AdaptableColumnMenuItemName | AdaptableContextMenuItemName, label: string, module: AdaptableModule, componentName: string, icon: AdaptableSystemIconName, isVisible: boolean, popupParams?: ModuleParams);
26
+ name: AdaptableColumnMenuItemName | AdaptableContextMenuItemName;
24
27
  reduxAction: Redux.Action;
25
28
  label: string;
26
29
  module: AdaptableModule;
@@ -1,7 +1,8 @@
1
1
  import * as PopupRedux from '../Redux/ActionsReducers/PopupRedux';
2
2
  // A menu item which performs a Redux Action when it is clicke
3
3
  export class MenuItemDoReduxAction {
4
- constructor(label, module, reduxAction, icon, isVisible) {
4
+ constructor(name, label, module, reduxAction, icon, isVisible) {
5
+ this.name = name;
5
6
  this.label = label;
6
7
  this.module = module;
7
8
  this.isVisible = isVisible;
@@ -12,7 +13,8 @@ export class MenuItemDoReduxAction {
12
13
  }
13
14
  }
14
15
  export class MenuItemDoClickFunction {
15
- constructor(label, module, clickFunction, icon, isVisible) {
16
+ constructor(name, label, module, clickFunction, icon, isVisible) {
17
+ this.name = name;
16
18
  this.label = label;
17
19
  this.module = module;
18
20
  this.isVisible = isVisible;
@@ -24,7 +26,8 @@ export class MenuItemDoClickFunction {
24
26
  }
25
27
  // A menu item which shows a popup screen when it is clieked
26
28
  export class MenuItemShowPopup {
27
- constructor(label, module, componentName, icon, isVisible, popupParams) {
29
+ constructor(name, label, module, componentName, icon, isVisible, popupParams) {
30
+ this.name = name;
28
31
  this.label = label;
29
32
  this.module = module;
30
33
  this.isVisible = isVisible;
@@ -1 +1 @@
1
- import{SystemLicenseDisablePersistence as e,SystemLicenseShowWatermark as a}from"../../../Redux/ActionsReducers/SystemRedux";import{PopupShowAlert as t}from"../../../Redux/ActionsReducers/PopupRedux";import s from"../../ObjectFactory";import i from"lodash/clamp";import{LicenseDocsLink as o}from"../../Constants/DocumentationLinkConstants";import{decode as n,GENERIC_APP_NAME as r}from"../../license/decode";import{shouldLogThankYouMessage as l}from"./shouldLogThankYouMessage";const c="sales@adaptabletools.com",d=10,p=864e5;export var LicenseValidityType;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(LicenseValidityType||(LicenseValidityType={}));const h=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,E=/(https):\/\/\S+(\.csb\.app)/g,I=/(https):\/\/\S+(\.adaptabletools\.com)/g,_=()=>"undefined"!=typeof window?window.location.origin:"",O=()=>{const e=_();console.log("isInsideSandpack",e);const[a,t,s]=Array.from(h.exec(e)||[]);return"https"===t&&"sandpack.codesandbox.io"===s},A=()=>{const e=_();console.log("isInsideSandbox",e);const[a,t,s]=Array.from(E.exec(e)||[]);return"https"===t&&".csb.app"===s},L=()=>{const e=_();console.log("isDemoApp",e);const[a,t,s]=Array.from(I.exec(e)||[]);return"https"===t&&".adaptabletools.com"===s};export class LicenseService{constructor(e,a,t){this.adaptable=e,this.licenseKey=a,this.packageDetails=t,this.adaptable=e,this.adaptable.api.eventApi.on("AdaptableReady",(()=>{requestAnimationFrame((()=>{this.init()}))}))}init(){let e=null;if(this.licenseKey)try{e=n(this.licenseKey)}catch(a){e=a}O()||A()||L()||this.handleLicenseValidation(e,this.getValidityType(e,this.packageDetails))}getValidityType(e,a){if(!e)return LicenseValidityType.NO_LICENSE;if(e instanceof Error)return LicenseValidityType.INVALID_LICENSE;const t=new Date(a.publishedAt),s=new Date(e.end),i=s<new Date,o=e.trial;let n=null;return n=i?s>t?o?LicenseValidityType.NON_PRODUCTION_EXPIRED_IN_SCOPE:LicenseValidityType.COMMERCIAL_EXPIRED_IN_SCOPE:o?LicenseValidityType.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:LicenseValidityType.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:o?LicenseValidityType.NON_PRODUCTION_VALID:LicenseValidityType.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){var t;const s=new Date;s.setHours(0,0,0,0);let n=0;e instanceof Error||!(null==e?void 0:e.end)||(n=Math.floor(((null===(t=null==e?void 0:e.end)||void 0===t?void 0:t.getTime())-s.getTime())/p),n=i(n,0,1/0));let h="",E="";!e||e instanceof Error||!e.appName||e.appName==r||(h=e.appName,E=" for application [APP_NAME]");const I=(e,a=o,t=c,s=n,i=h)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[APP_NAME]",i).replace("[DAYS]",`${s}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(I("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":this.adaptable.logger.consoleLogByMessageType(I("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":this.adaptable.logger.consoleLogByMessageType(I("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(I("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":if(n<=d)this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`),"Info");else try{l()&&this.adaptable.logger.consoleLogByMessageType(I(`Thank you for using a valid AdapTable license${E}. Your license will expire in [DAYS] days.`),"Info")}catch(e){}break;case"COMMERCIAL_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction(t({alertType:"generic",header:"License Error",message:e,alertDefinition:s.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction(a(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction(e())}destroy(){}}
1
+ import{SystemLicenseDisablePersistence as e,SystemLicenseShowWatermark as a}from"../../../Redux/ActionsReducers/SystemRedux";import{PopupShowAlert as t}from"../../../Redux/ActionsReducers/PopupRedux";import i from"../../ObjectFactory";import s from"lodash/clamp";import{LicenseDocsLink as o}from"../../Constants/DocumentationLinkConstants";import{decode as n,GENERIC_APP_NAME as r}from"../../license/decode";import{shouldLogThankYouMessage as l}from"./shouldLogThankYouMessage";const c="sales@adaptabletools.com",d=10,p=864e5;export var LicenseValidityType;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(LicenseValidityType||(LicenseValidityType={}));const h=()=>"undefined"!=typeof window?window.location.origin:"",E=()=>{const e=h(),[a,t,i]=Array.from(/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g.exec(e)||[]);return"https"===t&&"sandpack.codesandbox.io"===i},I=()=>{const e=h(),[a,t,i]=Array.from(/(https):\/\/\S+(\.csb\.app)/g.exec(e)||[]);return"https"===t&&".csb.app"===i},_=()=>{const e=h(),[a,t,i]=Array.from(/(https):\/\/\S+(\.adaptabletools\.com)/g.exec(e)||[]);return"https"===t&&".adaptabletools.com"===i};export class LicenseService{constructor(e,a,t){this.adaptable=e,this.licenseKey=a,this.packageDetails=t,this.adaptable=e,this.adaptable.api.eventApi.on("AdaptableReady",(()=>{requestAnimationFrame((()=>{this.init()}))}))}init(){let e=null;if(this.licenseKey)try{e=n(this.licenseKey)}catch(a){e=a}E()||I()||_()||this.handleLicenseValidation(e,this.getValidityType(e,this.packageDetails))}getValidityType(e,a){if(!e)return LicenseValidityType.NO_LICENSE;if(e instanceof Error)return LicenseValidityType.INVALID_LICENSE;const t=new Date(a.publishedAt),i=new Date(e.end),s=i<new Date,o=e.trial;let n=null;return n=s?i>t?o?LicenseValidityType.NON_PRODUCTION_EXPIRED_IN_SCOPE:LicenseValidityType.COMMERCIAL_EXPIRED_IN_SCOPE:o?LicenseValidityType.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:LicenseValidityType.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:o?LicenseValidityType.NON_PRODUCTION_VALID:LicenseValidityType.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){var t;const i=new Date;i.setHours(0,0,0,0);let n=0;e instanceof Error||!(null==e?void 0:e.end)||(n=Math.floor(((null===(t=null==e?void 0:e.end)||void 0===t?void 0:t.getTime())-i.getTime())/p),n=s(n,0,1/0));let h="",E="";!e||e instanceof Error||!e.appName||e.appName==r||(h=e.appName,E=" for application [APP_NAME]");const I=(e,a=o,t=c,i=n,s=h)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[APP_NAME]",s).replace("[DAYS]",`${i}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(I("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":this.adaptable.logger.consoleLogByMessageType(I("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":this.adaptable.logger.consoleLogByMessageType(I("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(I("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":if(n<=d)this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`),"Info");else try{l()&&this.adaptable.logger.consoleLogByMessageType(I(`Thank you for using a valid AdapTable license${E}. Your license will expire in [DAYS] days.`),"Info")}catch(e){}break;case"COMMERCIAL_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction(t({alertType:"generic",header:"License Error",message:e,alertDefinition:i.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction(a(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction(e())}destroy(){}}
@@ -39,7 +39,7 @@ export const AdaptableObjectListItemView = (props) => {
39
39
  var _a;
40
40
  let labelEl = tag.label;
41
41
  if (typeof tag.label === 'function') {
42
- labelEl = React.createElement(tag.label, { data: props.abObject });
42
+ labelEl = React.createElement(tag.label, { key: index, data: props.abObject });
43
43
  }
44
44
  labelEl = labelEl !== null && labelEl !== void 0 ? labelEl : tag.name;
45
45
  return (React.createElement(Flex, { "data-name": tag.name, key: `${index}-${tag.name}`, mb: 2, className: `${baseClassName}__row` },
@@ -129,5 +129,8 @@ export const AdaptableObjectListItem = (props) => {
129
129
  };
130
130
  export const AdaptableObjectList = (props) => {
131
131
  var _a;
132
- return (React.createElement("ul", { className: LIST_BASE_CLASS_NAME }, (_a = props === null || props === void 0 ? void 0 : props.items) === null || _a === void 0 ? void 0 : _a.map((item) => (React.createElement(AdaptableObjectListItem, Object.assign({ key: item.abObject.Uuid, data: item, module: props.module }, props.itemProps))))));
132
+ return (React.createElement("ul", { className: LIST_BASE_CLASS_NAME }, (_a = props === null || props === void 0 ? void 0 : props.items) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
133
+ var _a;
134
+ return (React.createElement(AdaptableObjectListItem, Object.assign({ key: (_a = item.abObject.Uuid) !== null && _a !== void 0 ? _a : index, data: item, module: props.module }, props.itemProps)));
135
+ })));
133
136
  };
@@ -148,7 +148,7 @@ class QuickFilterFormComponent extends React.Component {
148
148
  }
149
149
  };
150
150
  if (predicateInput.type === 'date' && !showDatePicker) {
151
- return (React.createElement(AdaptableDateInlineInput, { value: value, onKeyDownCapture: onKeyDownCapture, onChange: (value) => this.changeColumnPredicateInput(value, index) }));
151
+ return (React.createElement(AdaptableDateInlineInput, { value: value, key: index, onKeyDownCapture: onKeyDownCapture, onChange: (value) => this.changeColumnPredicateInput(value, index) }));
152
152
  }
153
153
  return (React.createElement(AdaptableInput, { disabled: this.isFilterDisabled(), key: index, type: predicateInput.type === 'number' ? 'text' : predicateInput.type,
154
154
  // autoFocus has to be FALSE because if the input receives focus in the init phase,
@@ -62,7 +62,7 @@ export function ValueSelector(props) {
62
62
  const label = !allowReorder ? preparedToLabel(option) : null;
63
63
  const reorderable = typeof allowReorder === 'function' ? allowReorder(option) : allowReorder;
64
64
  const renderNode = (props, dragHandleProps) => {
65
- return (React.createElement(Flex, Object.assign({ className: `${baseClassName}__option`, alignItems: "center", mt: index ? 1 : 0, key: identifier, backgroundColor: 'primary', padding: 2, "data-index": index, "data-id": identifier, "data-name": "option" }, props),
65
+ return (React.createElement(Flex, Object.assign({ className: `${baseClassName}__option`, alignItems: "center", mt: index ? 1 : 0, key: identifier !== null && identifier !== void 0 ? identifier : index, backgroundColor: 'primary', padding: 2, "data-index": index, "data-id": identifier, "data-name": "option" }, props),
66
66
  React.createElement(Flex, { flex: 1, flexDirection: "row", alignItems: "center" },
67
67
  reorderable ? (React.createElement(Box, Object.assign({ mr: 3 }, dragHandleProps),
68
68
  React.createElement(Icon, { name: "drag", style: { cursor: 'grab' } }))) : null,
@@ -14,7 +14,8 @@ import { AggregationsSection, AggregationsSectionSummary, isAggregationsSectionV
14
14
  import { SortSection, SortSectionSummary } from './sections/SortSection';
15
15
  import { FilterSection, FilterSectionSummary, isColumnFiltersValid, } from './sections/FilterSection';
16
16
  import { GridFilterSection, GridFilterSectionSummary, isGridFiltersValid, } from './sections/GridFilterSection';
17
- import { RowSummarySection } from './sections/RowSummarySection';
17
+ import { areSummaryRowsValid, RowSummarySection } from './sections/RowSummarySection';
18
+ import { WEIGHTED_AVERAGE_AGGREATED_FUNCTION } from '../../../PredefinedConfig/Common/RowSummary';
18
19
  export const LayoutWizard = (props) => {
19
20
  var _a, _b;
20
21
  const dispatch = useDispatch();
@@ -103,6 +104,7 @@ export const LayoutWizard = (props) => {
103
104
  {
104
105
  title: 'Row Groups',
105
106
  isVisible: () => layoutSupportedFeatures.RowGroupedColumns,
107
+ isValid: areSummaryRowsValid,
106
108
  details: 'Configure Row Grouping',
107
109
  renderSummary: () => React.createElement(RowGroupingSectionSummary, null),
108
110
  render: () => (React.createElement(Box, { p: 2, style: { height: '100%' } },
@@ -115,7 +117,29 @@ export const LayoutWizard = (props) => {
115
117
  renderSummary: () => React.createElement(AggregationsSectionSummary, null),
116
118
  isValid: (data) => isAggregationsSectionValid(data),
117
119
  render: () => (React.createElement(Box, { p: 2, style: { height: '100%' } },
118
- React.createElement(AggregationsSection, { onChange: setLayout }))),
120
+ React.createElement(AggregationsSection, { onChange: (layout) => {
121
+ let newLayout = cloneObject(layout);
122
+ // if we do not have an weighted avg col, we need to clear the row summary if one exists
123
+ if (newLayout.RowSummaries) {
124
+ newLayout.RowSummaries = newLayout.RowSummaries.map((rowSummary) => {
125
+ return Object.assign(Object.assign({}, rowSummary), { ColumnsMap: Object.entries(rowSummary.ColumnsMap).reduce((acc, [columnId, aggFunc]) => {
126
+ if (
127
+ // see if it is weighted avg
128
+ aggFunc === WEIGHTED_AVERAGE_AGGREATED_FUNCTION &&
129
+ // see if we have a weight in the agg columns
130
+ newLayout.AggregationColumns[columnId] &&
131
+ (typeof newLayout.AggregationColumns[columnId] !== 'object' ||
132
+ newLayout.AggregationColumns[columnId].weightColumnId)) {
133
+ // need to remove the row summary
134
+ return acc;
135
+ }
136
+ acc[columnId] = aggFunc;
137
+ return acc;
138
+ }, {}) });
139
+ });
140
+ }
141
+ setLayout(newLayout);
142
+ } }))),
119
143
  },
120
144
  {
121
145
  title: 'Row Summaries',
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Layout } from '../../../../../types';
3
+ export declare const areSummaryRowsValid: (layout: Layout) => true | string;
3
4
  export declare const RowGroupingSectionSummary: React.FunctionComponent;
4
5
  interface RowSummarySectionProps {
5
6
  onChange: (data: Layout) => void;
@@ -6,14 +6,30 @@ import { Select } from '../../../../components/Select';
6
6
  import SimpleButton from '../../../../components/SimpleButton';
7
7
  import { Tabs } from '../../../../components/Tabs';
8
8
  import { Tag } from '../../../../components/Tag';
9
+ import { summarySupportedExpressions, WEIGHTED_AVERAGE_AGGREATED_FUNCTION, } from '../../../../PredefinedConfig/Common/RowSummary';
9
10
  import { mapColumnDataTypeToExpressionFunctionType } from '../../../../Utilities/adaptableQlUtils';
10
11
  import { LayoutModuleId } from '../../../../Utilities/Constants/ModuleConstants';
11
- import { summarySupportedExpressions } from '../../../../Utilities/Services/Interface/ISummaryService';
12
12
  import { sortWithOrderArray } from '../../../../Utilities/sortWithOrder';
13
13
  import { useAdaptable } from '../../../AdaptableContext';
14
14
  import { ValueSelector } from '../../../Components/ValueSelector';
15
15
  import { useOnePageAdaptableWizardContext } from '../../../Wizard/OnePageAdaptableWizard';
16
16
  import { columnFilter } from './Utilities';
17
+ export const areSummaryRowsValid = (layout) => {
18
+ var _a;
19
+ if (!layout.RowSummaries)
20
+ return true;
21
+ let valid = true;
22
+ (_a = layout.RowSummaries) === null || _a === void 0 ? void 0 : _a.find((rowSummary) => {
23
+ var _a;
24
+ for (const [_, fn] of Object.entries((_a = rowSummary.ColumnsMap) !== null && _a !== void 0 ? _a : {})) {
25
+ if (!fn) {
26
+ valid = 'All row summary columns must have an aggregation function.';
27
+ return true;
28
+ }
29
+ }
30
+ });
31
+ return valid;
32
+ };
17
33
  const getAvailableExpressionsForColumnType = (columnType, availableScalarExpressions) => {
18
34
  const inputType = mapColumnDataTypeToExpressionFunctionType(columnType);
19
35
  return Object.entries(availableScalarExpressions !== null && availableScalarExpressions !== void 0 ? availableScalarExpressions : {})
@@ -53,7 +69,7 @@ const RowSummaryEditor = ({ rowSummary, onChange, availableScalarExpressions, on
53
69
  .getColumns()
54
70
  .filter((column) => {
55
71
  var _a, _b;
56
- if (!['Number', 'String'].includes(column.dataType))
72
+ if (!['Number', 'String', 'Date'].includes(column.dataType))
57
73
  return false;
58
74
  return (_b = (_a = layout.Columns) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, column.columnId);
59
75
  })
@@ -96,6 +112,14 @@ const RowSummaryEditor = ({ rowSummary, onChange, availableScalarExpressions, on
96
112
  label: expression,
97
113
  value: expression,
98
114
  }));
115
+ // check out if this layout has a aggregation with wighted column
116
+ const aggregation = layout.AggregationColumns[column.columnId];
117
+ if (aggregation && typeof aggregation === 'object' && aggregation.weightedColumnId) {
118
+ expressionOptions.push({
119
+ label: 'WEIGHTERD_AVG',
120
+ value: WEIGHTED_AVERAGE_AGGREATED_FUNCTION,
121
+ });
122
+ }
99
123
  const expression = rowSummary.ColumnsMap[column.columnId];
100
124
  return (React.createElement(Flex, null,
101
125
  React.createElement(Flex, { mr: 2, alignItems: 'center' }, label),
@@ -26,7 +26,6 @@ import { RenderReactRootFn } from '../renderReactRoot';
26
26
  import { AgGridOptionsService } from './AgGridOptionsService';
27
27
  import { AgGridColumnAdapter } from './AgGridColumnAdapter';
28
28
  import { RowEditService } from '../Utilities/Services/RowEditService';
29
- import { ISummaryService } from '../Utilities/Services/Interface/ISummaryService';
30
29
  export type AdaptableVariant = 'vanilla' | 'react' | 'angular';
31
30
  export type AdaptableLifecycleState = 'initial' | 'preprocessOptions' | 'initAdaptableState' | 'setupAgGrid' | 'initAgGrid' | 'available' | 'ready' | 'preDestroyed';
32
31
  type RenderAgGridFrameworkComponentResult = false | GridApi;
@@ -82,7 +81,6 @@ export declare class AdaptableAgGrid implements IAdaptable {
82
81
  RowEditService: RowEditService;
83
82
  Fdc3Service: Fdc3Service;
84
83
  CellPopupService: CellPopupService;
85
- SummaryService: ISummaryService;
86
84
  private LicenseService;
87
85
  private ChartingService;
88
86
  private ThemeService;
@@ -95,7 +95,6 @@ import { AdaptableUpgradeHelper } from '../migration/AdaptableUpgradeHelper';
95
95
  import { ensurePortalElement } from '../components/Modal';
96
96
  import { AdaptableLoadingScreen } from '../View/Components/Popups/AdaptableLoadingScreen';
97
97
  import { createElement } from 'react';
98
- import { SummaryService } from '../Utilities/Services/SummaryService';
99
98
  import { removeUuidAndSource } from '../Utilities/Helpers/AdaptableHelper';
100
99
  const RowNodeProto = RowNode.prototype;
101
100
  const RowNode_dispatchLocalEvent = RowNodeProto.dispatchLocalEvent;
@@ -898,7 +897,7 @@ export class AdaptableAgGrid {
898
897
  */
899
898
  // this will have to go/be heavily extended with https://github.com/AdaptableTools/adaptable/issues/2230
900
899
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'columnTypes', (original_columnTypes) => {
901
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
900
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
902
901
  const providedColumnTypes = original_columnTypes || {};
903
902
  const gridOptionsColumnTypes = gridOptions.columnTypes || {};
904
903
  const patchedColumnTypes = Object.assign(providedColumnTypes, {
@@ -915,6 +914,12 @@ export class AdaptableAgGrid {
915
914
  abColDefTupleNumberArray: (_j = gridOptionsColumnTypes.abColDefTupleNumberArray) !== null && _j !== void 0 ? _j : {},
916
915
  abColDefObjectNumberArray: (_k = gridOptionsColumnTypes.abColDefObjectNumberArray) !== null && _k !== void 0 ? _k : {},
917
916
  });
917
+ const customColumnTypes = (_l = this.api.columnApi.getColumnTypes()) !== null && _l !== void 0 ? _l : [];
918
+ for (const customColumnType of customColumnTypes) {
919
+ if (!patchedColumnTypes[customColumnType]) {
920
+ patchedColumnTypes[customColumnType] = {};
921
+ }
922
+ }
918
923
  if (patchedColumnTypes.abColDefNumber.cellEditor == undefined) {
919
924
  patchedColumnTypes.abColDefNumber.cellEditor =
920
925
  this.variant === 'react' ? ReactAdaptableNumberEditor : AdaptableNumberEditor;
@@ -1569,7 +1574,6 @@ export class AdaptableAgGrid {
1569
1574
  this.AlertService = new AlertService(this.api);
1570
1575
  this.TeamSharingService = new TeamSharingService(this.api);
1571
1576
  this.Fdc3Service = new Fdc3Service(this.api);
1572
- this.SummaryService = new SummaryService(this.api);
1573
1577
  this.CellPopupService = new CellPopupService(this.api);
1574
1578
  this.RowEditService = new RowEditService(this.api);
1575
1579
  this.MetamodelService = new MetamodelService(() => this.api.optionsApi.getAdaptableOptions(), true);
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ICellEditorParams, ICellEditorComp } from '@ag-grid-community/core';
2
+ import { ICellEditorComp, ICellEditorParams } from '@ag-grid-community/core';
3
3
  import { IAdaptable } from '../../../AdaptableInterfaces/IAdaptable';
4
4
  export declare const ReactAdaptableDateEditor: React.ForwardRefExoticComponent<ICellEditorParams<any, any, any> & {
5
5
  showClearButton?: boolean;
@@ -2,8 +2,8 @@ import * as React from 'react';
2
2
  import { renderWithAdaptableContext } from '../../../View/renderWithAdaptableContext';
3
3
  import { InternalAdaptableDateEditor, } from './InternalAdaptableDateEditor';
4
4
  import { KeyCode, } from '@ag-grid-community/core';
5
- import { DateFormatter } from '../../../Utilities/Helpers/FormatHelper';
6
5
  import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
6
+ import { DateFormatter } from '../../../Utilities/Helpers/FormatHelper';
7
7
  function shouldClearExistingValue(params) {
8
8
  return params.eventKey === KeyCode.BACKSPACE || params.eventKey === KeyCode.DELETE;
9
9
  }
@@ -6,12 +6,12 @@ import { ICellEditorComp, ICellEditorParams } from '@ag-grid-community/core';
6
6
  interface AdaptableNumberCellEditorParams extends ICellEditorParams {
7
7
  /**
8
8
  * Whether to show the clear button. If `true`, it works together with `cellEditorParams.emptyValue`
9
- * @default true
9
+ * @defaultValue true
10
10
  */
11
11
  showClearButton: boolean;
12
12
  /**
13
13
  * Value to set for the cell, when the clear button is pressed
14
- * @default '' (empty string)
14
+ * @defaultValue '' (empty string)
15
15
  */
16
16
  emptyValue: string;
17
17
  }
@@ -1,9 +1,7 @@
1
1
  import { IAggFuncParams } from '@ag-grid-community/core';
2
- import { CellSummaryOperationContext } from '../types';
3
2
  export declare const getNumericValue: (input: unknown) => number | null;
4
3
  export declare const weightedAverage: (params: IAggFuncParams, columnId: string, weightColumnId: string) => {
5
4
  [x: string]: number | (() => number | "");
6
5
  toString: () => number | "";
7
6
  valueOf: () => number;
8
7
  };
9
- export declare const cellSummaryWeightedAverage: ({ numericColumns, selectedCellInfo, adaptableApi, }: CellSummaryOperationContext) => any;