@adaptabletools/adaptable 18.0.0-canary.25 → 18.0.0-canary.27

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 (136) hide show
  1. package/package.json +1 -1
  2. package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -1
  3. package/src/AdaptableOptions/CommentOptions.d.ts +2 -2
  4. package/src/AdaptableOptions/MenuOptions.d.ts +11 -23
  5. package/src/AdaptableOptions/MenuOptions.js +1 -96
  6. package/src/Api/GridApi.d.ts +2 -1
  7. package/src/Api/Implementation/ActionRowApiImpl.js +3 -7
  8. package/src/Api/Implementation/AlertApiImpl.js +5 -10
  9. package/src/Api/Implementation/CalendarApiImpl.js +1 -6
  10. package/src/Api/Implementation/ChartingApiImpl.js +3 -3
  11. package/src/Api/Implementation/ColumnApiImpl.js +6 -6
  12. package/src/Api/Implementation/ColumnFilterApiImpl.js +7 -7
  13. package/src/Api/Implementation/CommentsApiImpl.js +1 -1
  14. package/src/Api/Implementation/ConfigApiImpl.js +11 -17
  15. package/src/Api/Implementation/DashboardApiImpl.js +1 -6
  16. package/src/Api/Implementation/ExportApiImpl.js +5 -10
  17. package/src/Api/Implementation/ExpressionApiImpl.js +8 -13
  18. package/src/Api/Implementation/Fdc3ApiImpl.js +1 -1
  19. package/src/Api/Implementation/FlashingCellApiImpl.js +3 -8
  20. package/src/Api/Implementation/FormatColumnApiImpl.js +4 -4
  21. package/src/Api/Implementation/FreeTextColumnApiImpl.js +1 -1
  22. package/src/Api/Implementation/GridApiImpl.d.ts +2 -1
  23. package/src/Api/Implementation/GridApiImpl.js +11 -8
  24. package/src/Api/Implementation/LayoutApiImpl.d.ts +0 -7
  25. package/src/Api/Implementation/LayoutApiImpl.js +0 -15
  26. package/src/Api/Implementation/PredicateApiImpl.js +2 -2
  27. package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
  28. package/src/Api/Implementation/ScopeApiImpl.js +10 -10
  29. package/src/Api/Implementation/TeamSharingApiImpl.js +3 -15
  30. package/src/Api/Implementation/ThemeApiImpl.js +2 -7
  31. package/src/Api/Implementation/UserInterfaceApiImpl.js +4 -13
  32. package/src/Api/Internal/ActionRowInternalApi.js +7 -45
  33. package/src/Api/Internal/AdaptableInternalApi.js +2 -12
  34. package/src/Api/Internal/AlertInternalApi.js +4 -17
  35. package/src/Api/Internal/CalculatedColumnInternalApi.js +7 -14
  36. package/src/Api/Internal/ChartingInternalApi.js +13 -13
  37. package/src/Api/Internal/ColumnFilterInternalApi.js +18 -36
  38. package/src/Api/Internal/CommentsInternalApi.d.ts +1 -1
  39. package/src/Api/Internal/CommentsInternalApi.js +1 -1
  40. package/src/Api/Internal/CustomSortInternalApi.js +1 -1
  41. package/src/Api/Internal/DashboardInternalApi.js +4 -10
  42. package/src/Api/Internal/DataImportInternalApi.js +3 -9
  43. package/src/Api/Internal/DataSetInternalApi.js +2 -7
  44. package/src/Api/Internal/ExportInternalApi.js +4 -4
  45. package/src/Api/Internal/ExpressionInternalApi.js +2 -12
  46. package/src/Api/Internal/Fdc3InternalApi.js +1 -10
  47. package/src/Api/Internal/FormatColumnInternalApi.js +11 -20
  48. package/src/Api/Internal/FreeTextColumnInternalApi.js +1 -1
  49. package/src/Api/Internal/GridFilterInternalApi.js +2 -8
  50. package/src/Api/Internal/GridInternalApi.js +13 -40
  51. package/src/Api/Internal/LayoutInternalApi.d.ts +1 -0
  52. package/src/Api/Internal/LayoutInternalApi.js +10 -19
  53. package/src/Api/Internal/NoteInternalApi.d.ts +1 -1
  54. package/src/Api/Internal/NoteInternalApi.js +1 -1
  55. package/src/Api/Internal/PredicateInternalApi.js +5 -40
  56. package/src/Api/Internal/ScheduleInternalApi.js +1 -6
  57. package/src/Api/Internal/StyledColumnInternalApi.js +5 -5
  58. package/src/Api/Internal/SystemStatusInternalApi.js +1 -7
  59. package/src/Api/Internal/TeamSharingInternalApi.js +2 -7
  60. package/src/Api/Internal/ThemeInternalApi.js +1 -1
  61. package/src/Api/Internal/UserInterfaceInternalApi.js +1 -1
  62. package/src/Api/LayoutApi.d.ts +0 -11
  63. package/src/PredefinedConfig/Common/CellSummary.d.ts +5 -14
  64. package/src/PredefinedConfig/Common/Enums.d.ts +2 -0
  65. package/src/PredefinedConfig/Common/Enums.js +2 -0
  66. package/src/PredefinedConfig/Common/Menu.d.ts +4 -4
  67. package/src/PredefinedConfig/Common/Menu.js +17 -18
  68. package/src/PredefinedConfig/Common/RowSummary.d.ts +1 -1
  69. package/src/PredefinedConfig/Common/RowSummary.js +4 -4
  70. package/src/Strategy/AdaptableModuleBase.d.ts +3 -4
  71. package/src/Strategy/AdaptableModuleBase.js +5 -9
  72. package/src/Strategy/AlertModule.d.ts +1 -1
  73. package/src/Strategy/AlertModule.js +1 -1
  74. package/src/Strategy/BulkUpdateModule.d.ts +1 -1
  75. package/src/Strategy/BulkUpdateModule.js +3 -2
  76. package/src/Strategy/CalculatedColumnModule.d.ts +2 -2
  77. package/src/Strategy/CalculatedColumnModule.js +2 -2
  78. package/src/Strategy/CellSummaryModule.d.ts +2 -2
  79. package/src/Strategy/CellSummaryModule.js +56 -96
  80. package/src/Strategy/ColumnFilterModule.d.ts +2 -2
  81. package/src/Strategy/ColumnFilterModule.js +17 -42
  82. package/src/Strategy/ColumnInfoModule.d.ts +2 -2
  83. package/src/Strategy/ColumnInfoModule.js +2 -2
  84. package/src/Strategy/CommentModule.d.ts +1 -2
  85. package/src/Strategy/CommentModule.js +29 -30
  86. package/src/Strategy/CustomSortModule.d.ts +1 -1
  87. package/src/Strategy/CustomSortModule.js +1 -1
  88. package/src/Strategy/DashboardModule.d.ts +2 -2
  89. package/src/Strategy/DashboardModule.js +3 -14
  90. package/src/Strategy/DataImportModule.d.ts +3 -3
  91. package/src/Strategy/DataImportModule.js +3 -3
  92. package/src/Strategy/ExportModule.d.ts +1 -2
  93. package/src/Strategy/ExportModule.js +12 -41
  94. package/src/Strategy/Fdc3Module.d.ts +1 -1
  95. package/src/Strategy/Fdc3Module.js +1 -14
  96. package/src/Strategy/FlashingCellModule.d.ts +2 -2
  97. package/src/Strategy/FlashingCellModule.js +2 -2
  98. package/src/Strategy/FormatColumnModule.d.ts +1 -1
  99. package/src/Strategy/FormatColumnModule.js +28 -47
  100. package/src/Strategy/FreeTextColumnModule.d.ts +1 -1
  101. package/src/Strategy/FreeTextColumnModule.js +1 -1
  102. package/src/Strategy/GridInfoModule.d.ts +2 -2
  103. package/src/Strategy/GridInfoModule.js +2 -2
  104. package/src/Strategy/Interface/IModule.d.ts +3 -3
  105. package/src/Strategy/LayoutModule.d.ts +4 -4
  106. package/src/Strategy/LayoutModule.js +51 -72
  107. package/src/Strategy/NoteModule.d.ts +1 -2
  108. package/src/Strategy/NoteModule.js +28 -30
  109. package/src/Strategy/PlusMinusModule.d.ts +1 -1
  110. package/src/Strategy/PlusMinusModule.js +1 -1
  111. package/src/Strategy/SettingsPanelModule.d.ts +3 -3
  112. package/src/Strategy/SettingsPanelModule.js +3 -3
  113. package/src/Strategy/SmartEditModule.d.ts +1 -1
  114. package/src/Strategy/SmartEditModule.js +3 -2
  115. package/src/Strategy/StyledColumnModule.d.ts +1 -1
  116. package/src/Strategy/StyledColumnModule.js +10 -9
  117. package/src/Strategy/SystemStatusModule.d.ts +2 -2
  118. package/src/Strategy/SystemStatusModule.js +4 -3
  119. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -1
  120. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +19 -19
  121. package/src/Utilities/Helpers/AdaptableHelper.js +3 -2
  122. package/src/Utilities/ObjectFactory.js +2 -0
  123. package/src/Utilities/Services/ModuleService.js +2 -2
  124. package/src/View/Layout/Wizard/LayoutWizard.js +1 -0
  125. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +17 -1
  126. package/src/View/Layout/Wizard/sections/RowSummarySection.js +5 -5
  127. package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
  128. package/src/agGrid/AdaptableAgGrid.js +1 -1
  129. package/src/agGrid/AgGridAdapter.d.ts +1 -2
  130. package/src/agGrid/AgGridColumnAdapter.js +2 -2
  131. package/src/agGrid/AgGridMenuAdapter.d.ts +18 -8
  132. package/src/agGrid/AgGridMenuAdapter.js +240 -51
  133. package/src/env.js +2 -2
  134. package/src/metamodel/adaptable.metamodel.d.ts +8 -2
  135. package/src/metamodel/adaptable.metamodel.js +1 -1
  136. package/tsconfig.esm.tsbuildinfo +1 -1
@@ -10,48 +10,46 @@ export class NoteModule extends AdaptableModuleBase {
10
10
  // Note module doesn't support autogenerated primary keys
11
11
  return super.isModuleAvailable() && !this.api.optionsApi.getAutogeneratePrimaryKey();
12
12
  }
13
- addContextMenuItems(menuContext) {
14
- var _a, _b;
13
+ createContextMenuItems(menuContext) {
14
+ var _a, _b, _c;
15
15
  if (!this.isModuleAvailable()) {
16
- return undefined;
16
+ return;
17
+ }
18
+ if (!this.api.noteApi.internalApi.areNotesSupported()) {
19
+ return;
17
20
  }
18
21
  const isReadOnly = this.adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(this.moduleInfo.ModuleName) === 'ReadOnly';
19
22
  if (isReadOnly) {
20
23
  return undefined;
21
24
  }
22
- const items = [];
23
- const isCellNotable = (_b = (_a = this.adaptable.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getNoteOptions()) === null || _b === void 0 ? void 0 : _b.isCellNotable;
24
- if (!isCellNotable ||
25
- isCellNotable(Object.assign({ gridCell: menuContext.gridCell }, createBaseContext(this.api))))
26
- items.push(...this.getAddRemoveNoteMenuItems(menuContext));
27
- return items;
28
- }
29
- getAddRemoveNoteMenuItems(menuContext) {
30
- var _a;
31
- const items = [];
32
- if (!this.api.noteApi.internalApi.areNotesAvailable()) {
33
- return items;
25
+ const isCellNotable = typeof ((_b = (_a = this.adaptable.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getNoteOptions()) === null || _b === void 0 ? void 0 : _b.isCellNotable) === 'function'
26
+ ? this.adaptable.api.optionsApi.getNoteOptions().isCellNotable(Object.assign({ gridCell: menuContext.gridCell }, createBaseContext(this.api)))
27
+ : true;
28
+ if (!isCellNotable) {
29
+ return;
34
30
  }
35
- // does not have note
36
- const [note] = (_a = this.adaptable.api.noteApi.getNotesForCell({
31
+ const [note] = (_c = this.adaptable.api.noteApi.getNotesForCell({
37
32
  PrimaryKeyValue: menuContext.primaryKeyValue,
38
33
  ColumnId: menuContext.adaptableColumn.columnId,
39
- })) !== null && _a !== void 0 ? _a : [];
34
+ })) !== null && _c !== void 0 ? _c : [];
40
35
  if (note) {
41
- items.push(this.createMenuItemClickFunction('note-remove', 'Remove Note', this.moduleInfo.Glyph, () => {
42
- this.api.noteApi.deleteNote(note);
43
- }));
36
+ return [
37
+ this.createMenuItemClickFunction('note-remove', 'Remove Note', this.moduleInfo.Glyph, () => {
38
+ this.api.noteApi.deleteNote(note);
39
+ }),
40
+ ];
44
41
  }
45
42
  else {
46
- items.push(this.createMenuItemClickFunction('note-add', 'Add Note', this.moduleInfo.Glyph, () => {
47
- // add an empty one
48
- this.api.noteApi.addNote('', menuContext.primaryKeyValue, menuContext.adaptableColumn.columnId);
49
- this.api.internalApi.getCellPopupService().showPopup({
50
- PrimaryKeyValue: menuContext.primaryKeyValue,
51
- ColumnId: menuContext.adaptableColumn.columnId,
52
- }, true);
53
- }));
43
+ return [
44
+ this.createMenuItemClickFunction('note-add', 'Add Note', this.moduleInfo.Glyph, () => {
45
+ // add an empty one
46
+ this.api.noteApi.addNote('', menuContext.primaryKeyValue, menuContext.adaptableColumn.columnId);
47
+ this.api.internalApi.getCellPopupService().showPopup({
48
+ PrimaryKeyValue: menuContext.primaryKeyValue,
49
+ ColumnId: menuContext.adaptableColumn.columnId,
50
+ }, true);
51
+ }),
52
+ ];
54
53
  }
55
- return items;
56
54
  }
57
55
  }
@@ -19,7 +19,7 @@ export declare class PlusMinusModule extends AdaptableModuleBase implements IPlu
19
19
  getReferencedNamedQueryNames(plusMinusNudge: PlusMinusNudge): string[];
20
20
  onAdaptableReady(): void;
21
21
  checkListenToKeyDown(): void;
22
- addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
22
+ createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
23
23
  private handleKeyDown;
24
24
  applyPlusMinus(plusMinusNudges: PlusMinusNudge[], cellsToUpdate: GridCell[], direction: 'up' | 'down'): boolean;
25
25
  isPlusMinusNudgeApplied(plusMinusNudge: PlusMinusNudge, gridCell: GridCell): boolean;
@@ -52,7 +52,7 @@ export class PlusMinusModule extends AdaptableModuleBase {
52
52
  }
53
53
  this.shouldHandleKeyDown = newShouldHandleKeyDown;
54
54
  }
55
- addColumnMenuItems(column) {
55
+ createColumnMenuItems(column) {
56
56
  if (column && this.isModuleEditable() && column.dataType == 'Number') {
57
57
  let popupParam = {
58
58
  column: column,
@@ -5,7 +5,7 @@ import { AdaptableModuleBase } from './AdaptableModuleBase';
5
5
  import { IModule } from './Interface/IModule';
6
6
  export declare class SettingsPanelModule extends AdaptableModuleBase implements IModule {
7
7
  constructor(api: AdaptableApi);
8
- addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
9
- addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
10
- addModuleMenuItem(source: 'ModuleMenu' | 'ModuleButton'): AdaptableMenuItem | undefined;
8
+ createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
9
+ createContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
10
+ createModuleMenuItem(source: 'ModuleMenu' | 'ModuleButton'): AdaptableMenuItem | undefined;
11
11
  }
@@ -6,18 +6,18 @@ export class SettingsPanelModule extends AdaptableModuleBase {
6
6
  const friendlyName = api.optionsApi.getSettingsPanelOptions().title;
7
7
  super(ModuleConstants.SettingsPanelModuleId, friendlyName, 'settings', null, 'Manage all Adaptable Settings', api);
8
8
  }
9
- addColumnMenuItems(column) {
9
+ createColumnMenuItems(column) {
10
10
  return [
11
11
  // To do : get the icon and name from settings in case they have changed?
12
12
  this.createMenuItemReduxAction('settings-panel-open', 'Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen()),
13
13
  ];
14
14
  }
15
- addContextMenuItems(menuContext) {
15
+ createContextMenuItems(menuContext) {
16
16
  return [
17
17
  this.createMenuItemReduxAction('settings-panel-open', 'Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen()),
18
18
  ];
19
19
  }
20
- addModuleMenuItem(source) {
20
+ createModuleMenuItem(source) {
21
21
  if (this.isModuleAvailable()) {
22
22
  return this.createMenuItemReduxAction('settings-panel-open', 'Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen());
23
23
  }
@@ -10,7 +10,7 @@ import { SmartEditOperation } from '../AdaptableOptions/EditOptions';
10
10
  export declare class SmartEditModule extends AdaptableModuleBase implements ISmartEditModule {
11
11
  constructor(api: AdaptableApi);
12
12
  getViewAccessLevel(): AccessLevel;
13
- addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
13
+ createContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
14
14
  ApplySmartEdit(cellUpdateRequests: CellUpdateRequest[]): void;
15
15
  CheckCorrectCellSelection(): IModuleActionReturn<boolean>;
16
16
  BuildPreviewValues(smartEditValue: number, smartEditOperation: SmartEditOperation): PreviewInfo;
@@ -11,7 +11,7 @@ export class SmartEditModule extends AdaptableModuleBase {
11
11
  getViewAccessLevel() {
12
12
  return 'Full';
13
13
  }
14
- addContextMenuItems(menuContext) {
14
+ createContextMenuItems(menuContext) {
15
15
  // not sure if this is right but logic is that
16
16
  // if the context cell is one of a selection taht can have smart edit applied
17
17
  // then open the smart edit screen
@@ -27,7 +27,8 @@ export class SmartEditModule extends AdaptableModuleBase {
27
27
  let popUpParams = {
28
28
  source: 'ContextMenu',
29
29
  };
30
- menuItemShowPopup = this.createMainMenuItemShowPopup({ Name: 'smart-edit-apply',
30
+ menuItemShowPopup = this.createMainMenuItemShowPopup({
31
+ Name: 'smart-edit-apply',
31
32
  Label: 'Apply Smart Edit',
32
33
  ComponentName: this.moduleInfo.Popup,
33
34
  Icon: this.moduleInfo.Glyph,
@@ -14,7 +14,7 @@ export declare class StyledColumnModule extends AdaptableModuleBase implements I
14
14
  }): AdaptableObject[];
15
15
  getExplicitlyReferencedColumnIds(formatColumn: FormatColumn): string[];
16
16
  hasNamedQueryReferences(): boolean;
17
- addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
17
+ createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
18
18
  private getGlyphForStyledColumn;
19
19
  getTeamSharingAction(): TeamSharingImportInfo<StyledColumn>;
20
20
  toView(styledColumn: StyledColumn): AdaptableObjectView;
@@ -25,7 +25,7 @@ export class StyledColumnModule extends AdaptableModuleBase {
25
25
  hasNamedQueryReferences() {
26
26
  return false;
27
27
  }
28
- addColumnMenuItems(column) {
28
+ createColumnMenuItems(column) {
29
29
  let returnColumnMenuItems = [];
30
30
  // Need a Column and an editable Module
31
31
  if (column && this.isModuleEditable()) {
@@ -116,14 +116,15 @@ export class StyledColumnModule extends AdaptableModuleBase {
116
116
  } }), config: {
117
117
  defaultCurrentSectionName: 'Style',
118
118
  } }));
119
- returnColumnMenuItems.push({
120
- name: 'styled-column-parent',
121
- label: 'Create Styled Column',
122
- module: this.moduleInfo.ModuleName,
123
- isVisible: true,
124
- icon: { name: this.moduleInfo.Glyph },
125
- subItems: [newGrandientButton, newPrecentBarButton, newBadgeButton],
126
- });
119
+ // returnColumnMenuItems.push({
120
+ // name: 'styled-column-parent',
121
+ // label: 'Create Styled Column',
122
+ // module: this.moduleInfo.ModuleName,
123
+ // isVisible: true,
124
+ // icon: { name: this.moduleInfo.Glyph },
125
+ // subItems: [newGrandientButton, newPrecentBarButton, newBadgeButton],
126
+ // });
127
+ returnColumnMenuItems.push(...[newGrandientButton, newPrecentBarButton, newBadgeButton]);
127
128
  break;
128
129
  case 'String':
129
130
  returnColumnMenuItems.push(newBadgeButton);
@@ -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
- addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
9
- addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
8
+ createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
9
+ createContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
10
10
  getViewProperties(): AdaptableModuleView;
11
11
  }
@@ -5,20 +5,21 @@ export class SystemStatusModule extends AdaptableModuleBase {
5
5
  constructor(api) {
6
6
  super(ModuleConstants.SystemStatusModuleId, ModuleConstants.SystemStatusFriendlyName, 'traffic-lights', 'SystemStatusPopup', 'Provide messages about the Status of your application', api);
7
7
  }
8
- addColumnMenuItems(column) {
8
+ createColumnMenuItems(column) {
9
9
  if (this.isModuleAvailable()) {
10
10
  return [
11
11
  this.createMenuItemShowPopup('system-status-show', 'Show System Status', this.moduleInfo.Popup, this.moduleInfo.Glyph),
12
12
  ];
13
13
  }
14
14
  }
15
- addContextMenuItems(menuContext) {
15
+ createContextMenuItems(menuContext) {
16
16
  if (this.isModuleAvailable()) {
17
17
  let popUpParams = {
18
18
  source: 'ContextMenu',
19
19
  };
20
20
  return [
21
- this.createMainMenuItemShowPopup({ Name: 'system-status-show',
21
+ this.createMainMenuItemShowPopup({
22
+ Name: 'system-status-show',
22
23
  Label: 'Show System Status',
23
24
  ComponentName: this.moduleInfo.Popup,
24
25
  Icon: this.moduleInfo.Glyph,
@@ -6,7 +6,7 @@ import { AggregateParams } from './scalarAggregationHelper';
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' | 'OLDEST' | 'YOUNGEST';
9
+ export type ScalarAggregationFunction = 'SUM' | 'PERCENTAGE' | 'QUANT' | 'QUARTILE' | 'PERCENTILE' | 'AVG' | 'MIN' | 'MAX' | 'COUNT' | 'CUMUL' | 'MEDIAN' | 'MODE' | 'DISTINCT' | 'ONLY' | 'STD_DEVIATION' | 'OLDEST' | 'NEWEST';
10
10
  type OperandFunction = 'COL' | 'OVER' | 'GROUP_BY' | 'WEIGHT';
11
11
  export interface ScalarAggregationParameter extends BaseParameter<'aggregationScalar', ScalarAggregationFunction> {
12
12
  value: AggregatedScalarExpressionEvaluation;
@@ -330,7 +330,7 @@ export const aggregatedScalarExpressionFunctions = {
330
330
  handler(args, context) {
331
331
  const modeColumnParameter = extractColumnParameter('mode', args);
332
332
  const modeColumnName = modeColumnParameter.value;
333
- validateColumnType(modeColumnName, ['Number', 'String'], 'mode', context.adaptableApi);
333
+ validateColumnType(modeColumnName, ['Number', 'String', 'Date'], 'mode', context.adaptableApi);
334
334
  const groupByParameter = extractParameter('MODE', 'operand', ['GROUP_BY'], args, {
335
335
  isOptional: true,
336
336
  });
@@ -390,7 +390,7 @@ export const aggregatedScalarExpressionFunctions = {
390
390
  ],
391
391
  examples: ['MODE([colA])', 'MODE([colA], GROUP_BY([colB]))'],
392
392
  category: 'aggregation',
393
- inputs: [['number'], ['text']],
393
+ inputs: [['number'], ['text'], ['date']],
394
394
  },
395
395
  DISTINCT: {
396
396
  handler(args, context) {
@@ -438,7 +438,7 @@ export const aggregatedScalarExpressionFunctions = {
438
438
  ],
439
439
  examples: ['DISTINCT([colA])', 'DISTINCT([colA], GROUP_BY([colB]))'],
440
440
  category: 'aggregation',
441
- inputs: [['number'], ['text']],
441
+ inputs: [['number'], ['text'], ['date']],
442
442
  },
443
443
  ONLY: {
444
444
  handler(args, context) {
@@ -488,7 +488,7 @@ export const aggregatedScalarExpressionFunctions = {
488
488
  ],
489
489
  examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
490
490
  category: 'aggregation',
491
- inputs: [['number'], ['text']],
491
+ inputs: [['number'], ['text'], ['date']],
492
492
  },
493
493
  STD_DEVIATION: {
494
494
  handler(args, context) {
@@ -849,7 +849,7 @@ export const aggregatedScalarExpressionFunctions = {
849
849
  ],
850
850
  examples: ['COUNT([colA])', 'COUNT([colA], GROUP_BY([colB]))'],
851
851
  category: 'aggregation',
852
- inputs: [['number'], ['text']],
852
+ inputs: [['number'], ['text'], ['date']],
853
853
  },
854
854
  OVER: {
855
855
  handler(args, context) {
@@ -959,7 +959,7 @@ export const aggregatedScalarExpressionFunctions = {
959
959
  };
960
960
  return result;
961
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',
962
+ description: 'Aggregates a Date column over multiple rows by computing the oldest of the column values\nOptionally the aggregation may be computed within provided individual groups',
963
963
  signatures: [
964
964
  'OLDEST( [colName] )',
965
965
  'OLDEST( COL(name: string))',
@@ -970,19 +970,19 @@ export const aggregatedScalarExpressionFunctions = {
970
970
  category: 'aggregation',
971
971
  inputs: ['date'],
972
972
  },
973
- YOUNGEST: {
973
+ NEWEST: {
974
974
  handler(args, context) {
975
- const minColumnParameter = extractColumnParameter('YOUNGEST', args);
975
+ const minColumnParameter = extractColumnParameter('NEWEST', args);
976
976
  const minColumnName = minColumnParameter.value;
977
- validateColumnType(minColumnName, ['Date'], 'YOUNGEST', context.adaptableApi);
978
- const groupByParameter = extractParameter('YOUNGEST', 'operand', ['GROUP_BY'], args, {
977
+ validateColumnType(minColumnName, ['Date'], 'NEWEST', context.adaptableApi);
978
+ const groupByParameter = extractParameter('NEWEST', 'operand', ['GROUP_BY'], args, {
979
979
  isOptional: true,
980
980
  });
981
981
  const aggregationExpressionEvaluation = {
982
982
  aggregationParams: {
983
983
  reducers: {
984
- YOUNGEST: {
985
- name: 'YOUNGEST',
984
+ NEWEST: {
985
+ name: 'NEWEST',
986
986
  field: minColumnName,
987
987
  initialValue: null,
988
988
  reducer: (minValue, rowValue) => {
@@ -1012,20 +1012,20 @@ export const aggregatedScalarExpressionFunctions = {
1012
1012
  };
1013
1013
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
1014
1014
  const result = {
1015
- name: 'YOUNGEST',
1015
+ name: 'NEWEST',
1016
1016
  type: 'aggregationScalar',
1017
1017
  value: aggregationExpressionEvaluation,
1018
1018
  };
1019
1019
  return result;
1020
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',
1021
+ description: 'Aggregates a Date column over multiple rows by computing the most recent of the column values\nOptionally the aggregation may be computed within provided individual groups',
1022
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)))',
1023
+ 'NEWEST( [colName] )',
1024
+ 'NEWEST( COL(name: string))',
1025
+ 'NEWEST( [colNameA], GROUP_BY( [colNameB] ))',
1026
+ 'NEWEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
1027
1027
  ],
1028
- examples: ['YOUNGEST([colA])', 'YOUNGEST([colA], GROUP_BY([colB]))'],
1028
+ examples: ['NEWEST([colA])', 'NEWEST([colA], GROUP_BY([colB]))'],
1029
1029
  category: 'aggregation',
1030
1030
  inputs: ['date'],
1031
1031
  },
@@ -87,6 +87,7 @@ export function addUuidAndSource(adaptableObject) {
87
87
  return adaptableObject;
88
88
  }
89
89
  export function removeUuidAndSource(adaptableObject) {
90
+ const clonedObject = structuredClone(adaptableObject);
90
91
  const sanitiseObject = (object) => {
91
92
  for (const key in object) {
92
93
  if (key === 'Source' || key === 'Uuid') {
@@ -100,8 +101,8 @@ export function removeUuidAndSource(adaptableObject) {
100
101
  }
101
102
  }
102
103
  };
103
- sanitiseObject(adaptableObject);
104
- return adaptableObject;
104
+ sanitiseObject(clonedObject);
105
+ return clonedObject;
105
106
  }
106
107
  export const AdaptableHelper = {
107
108
  initPredefinedConfigWithUuids,
@@ -281,6 +281,8 @@ export function CreateEmptyCellSummmary() {
281
281
  Max: undefined,
282
282
  Min: undefined,
283
283
  Count: undefined,
284
+ Newest: undefined,
285
+ Oldest: undefined,
284
286
  Std_Deviation: undefined,
285
287
  Only: undefined,
286
288
  };
@@ -10,13 +10,13 @@ export class ModuleService {
10
10
  const settingsPanelMenuItems = [];
11
11
  const buttonMenuItems = [];
12
12
  this.getModuleCollection().forEach((module) => {
13
- const settingsPanelMenuItem = module.addModuleMenuItem('ModuleMenu');
13
+ const settingsPanelMenuItem = module.createModuleMenuItem('ModuleMenu');
14
14
  if (Helper.objectExists(settingsPanelMenuItem)) {
15
15
  if (settingsPanelMenuItems.findIndex((m) => m.module == settingsPanelMenuItem.module) == -1) {
16
16
  settingsPanelMenuItems.push(settingsPanelMenuItem);
17
17
  }
18
18
  }
19
- const buttonMenuItem = module.addModuleMenuItem('ModuleButton');
19
+ const buttonMenuItem = module.createModuleMenuItem('ModuleButton');
20
20
  if (Helper.objectExists(buttonMenuItem)) {
21
21
  if (buttonMenuItems.findIndex((m) => m.module == buttonMenuItem.module) == -1) {
22
22
  buttonMenuItems.push(buttonMenuItem);
@@ -146,6 +146,7 @@ export const LayoutWizard = (props) => {
146
146
  title: 'Row Summaries',
147
147
  details: 'Configure Row Summaries',
148
148
  renderSummary: () => React.createElement(RowGroupingSectionSummary, null),
149
+ isVisible: () => layoutSupportedFeatures.RowSummaries,
149
150
  render: () => (React.createElement(Box, { p: 2, style: { height: '100%' } },
150
151
  React.createElement(RowSummarySection, { onChange: setLayout }))),
151
152
  },
@@ -12,7 +12,23 @@ export const RowGroupingSectionSummary = () => {
12
12
  var _a;
13
13
  const adaptable = useAdaptable();
14
14
  const { data: layout } = useOnePageAdaptableWizardContext();
15
- return (React.createElement(Box, null, ((_a = layout.RowGroupedColumns) === null || _a === void 0 ? void 0 : _a.length) ? (layout.RowGroupedColumns.map((columnId) => (React.createElement(Tag, { mr: 1, key: columnId }, adaptable.api.columnApi.getFriendlyNameForColumnId(columnId))))) : (React.createElement(Tag, null, "No Row Grouping"))));
15
+ return (React.createElement(Box, null, ((_a = layout.RowSummaries) === null || _a === void 0 ? void 0 : _a.length) ? (layout === null || layout === void 0 ? void 0 : layout.RowSummaries.map((rowSummary, index) => {
16
+ var _a;
17
+ const columns = Object.entries((_a = rowSummary.ColumnsMap) !== null && _a !== void 0 ? _a : {})
18
+ .map(([columnId, expression]) => {
19
+ if (columnId === 'Source' || columnId === 'Uuid') {
20
+ return '';
21
+ }
22
+ return `${expression}(${adaptable.api.columnApi.getFriendlyNameForColumnId(columnId)})`;
23
+ })
24
+ .filter(Boolean)
25
+ .join(', ');
26
+ return (React.createElement(Box, { mb: 2 },
27
+ React.createElement(Tag, { key: index },
28
+ rowSummary.Position,
29
+ " ",
30
+ columns)));
31
+ })) : (React.createElement(Tag, null, "No Row Summaries"))));
16
32
  };
17
33
  export const RowGroupingSection = (props) => {
18
34
  var _a, _b, _c;
@@ -32,13 +32,13 @@ export const areSummaryRowsValid = (layout) => {
32
32
  };
33
33
  const getAvailableExpressionsForColumnType = (columnType, availableScalarExpressions) => {
34
34
  const inputType = mapColumnDataTypeToExpressionFunctionType(columnType);
35
- return Object.entries(availableScalarExpressions !== null && availableScalarExpressions !== void 0 ? availableScalarExpressions : {})
36
- .map(([expression, expressionDef]) => {
35
+ // Object.entries(availableScalarExpressions ?? {})
36
+ return summarySupportedExpressions
37
+ .filter((expression) => availableScalarExpressions[expression])
38
+ .map((expression) => {
37
39
  var _a, _b;
40
+ const expressionDef = availableScalarExpressions[expression];
38
41
  let firstArg = null;
39
- if (!summarySupportedExpressions.includes(expression)) {
40
- return null;
41
- }
42
42
  if (Array.isArray((_a = expressionDef === null || expressionDef === void 0 ? void 0 : expressionDef.inputs) === null || _a === void 0 ? void 0 : _a[0])) {
43
43
  // @ts-ignore
44
44
  firstArg = (_b = expressionDef.inputs.find((input) => input.includes(inputType))) === null || _b === void 0 ? void 0 : _b[0];
@@ -287,7 +287,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
287
287
  private getAgGridLightThemeName;
288
288
  applyAdaptableTheme(theme: AdaptableTheme | string): void;
289
289
  setRowGroupColumns(columnIds: string[]): void;
290
- getAgGridAllGridColumns(): Column<any>[];
290
+ getAllGridColumns(): Column<any>[];
291
291
  clearRowGroupColumns(): void;
292
292
  expandAllRowGroups(): void;
293
293
  closeAllRowGroups(): void;
@@ -2756,7 +2756,7 @@ export class AdaptableAgGrid {
2756
2756
  setRowGroupColumns(columnIds) {
2757
2757
  this.agGridAdapter.getAgGridApi().setRowGroupColumns(columnIds);
2758
2758
  }
2759
- getAgGridAllGridColumns() {
2759
+ getAllGridColumns() {
2760
2760
  return this.agGridAdapter.getAgGridApi().getAllGridColumns();
2761
2761
  }
2762
2762
  clearRowGroupColumns() {
@@ -1,9 +1,8 @@
1
- import { ColDef, Column, GridApi, GridOptions, IRowNode, ManagedGridOptionKey, ManagedGridOptions, Module, ModuleNames } from '@ag-grid-community/core';
1
+ import { ColDef, ColGroupDef, Column, GridApi, GridOptions, IRowNode, ManagedGridOptionKey, ManagedGridOptions, Module, ModuleNames } from '@ag-grid-community/core';
2
2
  import { AdaptableAgGrid } from './AdaptableAgGrid';
3
3
  import { AdaptableColumn, AdaptableColumnGroup } from '../PredefinedConfig/Common/AdaptableColumn';
4
4
  import { SelectedCellInfo } from '../PredefinedConfig/Selection/SelectedCellInfo';
5
5
  import { SelectedRowInfo } from '../PredefinedConfig/Selection/SelectedRowInfo';
6
- import { ColGroupDef } from '@ag-grid-community/core/dist/esm/es6/entities/colDef';
7
6
  export declare class AgGridAdapter {
8
7
  private adaptableInstance;
9
8
  private DANGER_USE_GETTER_gridApi;
@@ -570,7 +570,7 @@ export class AgGridColumnAdapter {
570
570
  if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Note')) {
571
571
  return;
572
572
  }
573
- if (!this.adaptableApi.noteApi.internalApi.areNotesAvailable()) {
573
+ if (!this.adaptableApi.noteApi.internalApi.areNotesSupported()) {
574
574
  return;
575
575
  }
576
576
  const cellPosition = {
@@ -587,7 +587,7 @@ export class AgGridColumnAdapter {
587
587
  if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Comment')) {
588
588
  return;
589
589
  }
590
- if (!this.adaptableApi.commentApi.internalApi.areCommentsAvailable()) {
590
+ if (!this.adaptableApi.commentApi.internalApi.areCommentsSupported()) {
591
591
  return;
592
592
  }
593
593
  const position = {
@@ -1,7 +1,7 @@
1
1
  import { AdaptableAgGrid } from './AdaptableAgGrid';
2
- import { Column, GetContextMenuItems, GetContextMenuItemsParams, GetMainMenuItems, GetMainMenuItemsParams, MenuItemDef } from '@ag-grid-community/core';
2
+ import { GetContextMenuItems, GetContextMenuItemsParams, GetMainMenuItems, GetMainMenuItemsParams, MenuItemDef } from '@ag-grid-community/core';
3
3
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
4
- import { AdaptableMenuItem, ColumnMenuContext } from '../PredefinedConfig/Common/Menu';
4
+ import { AdaptableMenuItem } from '../PredefinedConfig/Common/Menu';
5
5
  export declare class AgGridMenuAdapter {
6
6
  private adaptableInstance;
7
7
  constructor(adaptableInstance: AdaptableAgGrid);
@@ -9,20 +9,30 @@ export declare class AgGridMenuAdapter {
9
9
  private get adaptableApi();
10
10
  destroy(): void;
11
11
  buildColumnMenu(params: GetMainMenuItemsParams, originalGetMainMenuItems: GetMainMenuItems): (string | MenuItemDef)[];
12
- buildStructuredAdaptableColumnItems(menuContext: ColumnMenuContext): {
13
- adaptableMenuItems: AdaptableMenuItem[];
14
- structuredAdaptableMenuItems: AdaptableMenuItem[];
15
- };
16
12
  buildContextMenu(params: GetContextMenuItemsParams, originalGetContextMenuItems: GetContextMenuItems): (string | MenuItemDef)[];
17
- createColumnMenuContextObject(adaptableColumn: AdaptableColumn, agGridColumn: Column): ColumnMenuContext;
13
+ private createColumnMenuContextObject;
18
14
  private createAdaptableContextMenuItems;
19
15
  private createContextMenuContextObject;
20
16
  private mapAdaptableMenuItemToAgGridMenuDefinition;
21
17
  private mapCustomMenuItemToAgGridMenuDefinition;
22
18
  private mapUserMenuItemToAgGridMenuDefinition;
23
- private buildGroupedModuleItems;
19
+ private buildContextMenuDefaultStructure;
20
+ /**
21
+ * Default strategy for menu items: return as is if there is only one item, otherwise group them under a parent item
22
+ */
23
+ private getModuleSpecificStructure;
24
+ private getExportContextMenuStructure;
25
+ private getLayoutContextMenuStructure;
26
+ private buildMenuGroupParent;
27
+ private buildColumnMenuDefaultStructure;
28
+ private getLayoutColumnMenuStructure;
29
+ private getStyledColumnColumnMenuStructure;
24
30
  private mapAdaptableMenuItemToSystemMenuItems;
25
31
  private createAdaptableColumnMenuItems;
26
32
  private mapAdaptableIconToAgGridIcon;
33
+ /**
34
+ * The output of this function is used to build the column header menu if the AG Grid Menu Module is NOT present
35
+ * This is controlled by the AdaptableAgGrid.embedColumnMenu property
36
+ */
27
37
  buildStandaloneColumnHeader(adaptableColumn: AdaptableColumn): AdaptableMenuItem[];
28
38
  }