@adaptabletools/adaptable-cjs 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 +0 -98
  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.cjs.tsbuildinfo +1 -1
@@ -14,49 +14,47 @@ class NoteModule extends AdaptableModuleBase_1.AdaptableModuleBase {
14
14
  // Note module doesn't support autogenerated primary keys
15
15
  return super.isModuleAvailable() && !this.api.optionsApi.getAutogeneratePrimaryKey();
16
16
  }
17
- addContextMenuItems(menuContext) {
18
- var _a, _b;
17
+ createContextMenuItems(menuContext) {
18
+ var _a, _b, _c;
19
19
  if (!this.isModuleAvailable()) {
20
- return undefined;
20
+ return;
21
+ }
22
+ if (!this.api.noteApi.internalApi.areNotesSupported()) {
23
+ return;
21
24
  }
22
25
  const isReadOnly = this.adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(this.moduleInfo.ModuleName) === 'ReadOnly';
23
26
  if (isReadOnly) {
24
27
  return undefined;
25
28
  }
26
- const items = [];
27
- const isCellNotable = (_b = (_a = this.adaptable.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getNoteOptions()) === null || _b === void 0 ? void 0 : _b.isCellNotable;
28
- if (!isCellNotable ||
29
- isCellNotable(Object.assign({ gridCell: menuContext.gridCell }, (0, ObjectFactory_1.createBaseContext)(this.api))))
30
- items.push(...this.getAddRemoveNoteMenuItems(menuContext));
31
- return items;
32
- }
33
- getAddRemoveNoteMenuItems(menuContext) {
34
- var _a;
35
- const items = [];
36
- if (!this.api.noteApi.internalApi.areNotesAvailable()) {
37
- return items;
29
+ 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'
30
+ ? this.adaptable.api.optionsApi.getNoteOptions().isCellNotable(Object.assign({ gridCell: menuContext.gridCell }, (0, ObjectFactory_1.createBaseContext)(this.api)))
31
+ : true;
32
+ if (!isCellNotable) {
33
+ return;
38
34
  }
39
- // does not have note
40
- const [note] = (_a = this.adaptable.api.noteApi.getNotesForCell({
35
+ const [note] = (_c = this.adaptable.api.noteApi.getNotesForCell({
41
36
  PrimaryKeyValue: menuContext.primaryKeyValue,
42
37
  ColumnId: menuContext.adaptableColumn.columnId,
43
- })) !== null && _a !== void 0 ? _a : [];
38
+ })) !== null && _c !== void 0 ? _c : [];
44
39
  if (note) {
45
- items.push(this.createMenuItemClickFunction('note-remove', 'Remove Note', this.moduleInfo.Glyph, () => {
46
- this.api.noteApi.deleteNote(note);
47
- }));
40
+ return [
41
+ this.createMenuItemClickFunction('note-remove', 'Remove Note', this.moduleInfo.Glyph, () => {
42
+ this.api.noteApi.deleteNote(note);
43
+ }),
44
+ ];
48
45
  }
49
46
  else {
50
- items.push(this.createMenuItemClickFunction('note-add', 'Add Note', this.moduleInfo.Glyph, () => {
51
- // add an empty one
52
- this.api.noteApi.addNote('', menuContext.primaryKeyValue, menuContext.adaptableColumn.columnId);
53
- this.api.internalApi.getCellPopupService().showPopup({
54
- PrimaryKeyValue: menuContext.primaryKeyValue,
55
- ColumnId: menuContext.adaptableColumn.columnId,
56
- }, true);
57
- }));
47
+ return [
48
+ this.createMenuItemClickFunction('note-add', 'Add Note', this.moduleInfo.Glyph, () => {
49
+ // add an empty one
50
+ this.api.noteApi.addNote('', menuContext.primaryKeyValue, menuContext.adaptableColumn.columnId);
51
+ this.api.internalApi.getCellPopupService().showPopup({
52
+ PrimaryKeyValue: menuContext.primaryKeyValue,
53
+ ColumnId: menuContext.adaptableColumn.columnId,
54
+ }, true);
55
+ }),
56
+ ];
58
57
  }
59
- return items;
60
58
  }
61
59
  }
62
60
  exports.NoteModule = NoteModule;
@@ -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;
@@ -56,7 +56,7 @@ class PlusMinusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
56
56
  }
57
57
  this.shouldHandleKeyDown = newShouldHandleKeyDown;
58
58
  }
59
- addColumnMenuItems(column) {
59
+ createColumnMenuItems(column) {
60
60
  if (column && this.isModuleEditable() && column.dataType == 'Number') {
61
61
  let popupParam = {
62
62
  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
  }
@@ -10,18 +10,18 @@ class SettingsPanelModule extends AdaptableModuleBase_1.AdaptableModuleBase {
10
10
  const friendlyName = api.optionsApi.getSettingsPanelOptions().title;
11
11
  super(ModuleConstants.SettingsPanelModuleId, friendlyName, 'settings', null, 'Manage all Adaptable Settings', api);
12
12
  }
13
- addColumnMenuItems(column) {
13
+ createColumnMenuItems(column) {
14
14
  return [
15
15
  // To do : get the icon and name from settings in case they have changed?
16
16
  this.createMenuItemReduxAction('settings-panel-open', 'Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen()),
17
17
  ];
18
18
  }
19
- addContextMenuItems(menuContext) {
19
+ createContextMenuItems(menuContext) {
20
20
  return [
21
21
  this.createMenuItemReduxAction('settings-panel-open', 'Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen()),
22
22
  ];
23
23
  }
24
- addModuleMenuItem(source) {
24
+ createModuleMenuItem(source) {
25
25
  if (this.isModuleAvailable()) {
26
26
  return this.createMenuItemReduxAction('settings-panel-open', 'Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen());
27
27
  }
@@ -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;
@@ -15,7 +15,7 @@ class SmartEditModule extends AdaptableModuleBase_1.AdaptableModuleBase {
15
15
  getViewAccessLevel() {
16
16
  return 'Full';
17
17
  }
18
- addContextMenuItems(menuContext) {
18
+ createContextMenuItems(menuContext) {
19
19
  // not sure if this is right but logic is that
20
20
  // if the context cell is one of a selection taht can have smart edit applied
21
21
  // then open the smart edit screen
@@ -31,7 +31,8 @@ class SmartEditModule extends AdaptableModuleBase_1.AdaptableModuleBase {
31
31
  let popUpParams = {
32
32
  source: 'ContextMenu',
33
33
  };
34
- menuItemShowPopup = this.createMainMenuItemShowPopup({ Name: 'smart-edit-apply',
34
+ menuItemShowPopup = this.createMainMenuItemShowPopup({
35
+ Name: 'smart-edit-apply',
35
36
  Label: 'Apply Smart Edit',
36
37
  ComponentName: this.moduleInfo.Popup,
37
38
  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;
@@ -29,7 +29,7 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
29
29
  hasNamedQueryReferences() {
30
30
  return false;
31
31
  }
32
- addColumnMenuItems(column) {
32
+ createColumnMenuItems(column) {
33
33
  let returnColumnMenuItems = [];
34
34
  // Need a Column and an editable Module
35
35
  if (column && this.isModuleEditable()) {
@@ -120,14 +120,15 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
120
120
  } }), config: {
121
121
  defaultCurrentSectionName: 'Style',
122
122
  } }));
123
- returnColumnMenuItems.push({
124
- name: 'styled-column-parent',
125
- label: 'Create Styled Column',
126
- module: this.moduleInfo.ModuleName,
127
- isVisible: true,
128
- icon: { name: this.moduleInfo.Glyph },
129
- subItems: [newGrandientButton, newPrecentBarButton, newBadgeButton],
130
- });
123
+ // returnColumnMenuItems.push({
124
+ // name: 'styled-column-parent',
125
+ // label: 'Create Styled Column',
126
+ // module: this.moduleInfo.ModuleName,
127
+ // isVisible: true,
128
+ // icon: { name: this.moduleInfo.Glyph },
129
+ // subItems: [newGrandientButton, newPrecentBarButton, newBadgeButton],
130
+ // });
131
+ returnColumnMenuItems.push(...[newGrandientButton, newPrecentBarButton, newBadgeButton]);
131
132
  break;
132
133
  case 'String':
133
134
  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
  }
@@ -9,20 +9,21 @@ class SystemStatusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
9
9
  constructor(api) {
10
10
  super(ModuleConstants.SystemStatusModuleId, ModuleConstants.SystemStatusFriendlyName, 'traffic-lights', 'SystemStatusPopup', 'Provide messages about the Status of your application', api);
11
11
  }
12
- addColumnMenuItems(column) {
12
+ createColumnMenuItems(column) {
13
13
  if (this.isModuleAvailable()) {
14
14
  return [
15
15
  this.createMenuItemShowPopup('system-status-show', 'Show System Status', this.moduleInfo.Popup, this.moduleInfo.Glyph),
16
16
  ];
17
17
  }
18
18
  }
19
- addContextMenuItems(menuContext) {
19
+ createContextMenuItems(menuContext) {
20
20
  if (this.isModuleAvailable()) {
21
21
  let popUpParams = {
22
22
  source: 'ContextMenu',
23
23
  };
24
24
  return [
25
- this.createMainMenuItemShowPopup({ Name: 'system-status-show',
25
+ this.createMainMenuItemShowPopup({
26
+ Name: 'system-status-show',
26
27
  Label: 'Show System Status',
27
28
  ComponentName: this.moduleInfo.Popup,
28
29
  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;
@@ -334,7 +334,7 @@ exports.aggregatedScalarExpressionFunctions = {
334
334
  handler(args, context) {
335
335
  const modeColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('mode', args);
336
336
  const modeColumnName = modeColumnParameter.value;
337
- (0, expressionFunctionUtils_1.validateColumnType)(modeColumnName, ['Number', 'String'], 'mode', context.adaptableApi);
337
+ (0, expressionFunctionUtils_1.validateColumnType)(modeColumnName, ['Number', 'String', 'Date'], 'mode', context.adaptableApi);
338
338
  const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MODE', 'operand', ['GROUP_BY'], args, {
339
339
  isOptional: true,
340
340
  });
@@ -394,7 +394,7 @@ exports.aggregatedScalarExpressionFunctions = {
394
394
  ],
395
395
  examples: ['MODE([colA])', 'MODE([colA], GROUP_BY([colB]))'],
396
396
  category: 'aggregation',
397
- inputs: [['number'], ['text']],
397
+ inputs: [['number'], ['text'], ['date']],
398
398
  },
399
399
  DISTINCT: {
400
400
  handler(args, context) {
@@ -442,7 +442,7 @@ exports.aggregatedScalarExpressionFunctions = {
442
442
  ],
443
443
  examples: ['DISTINCT([colA])', 'DISTINCT([colA], GROUP_BY([colB]))'],
444
444
  category: 'aggregation',
445
- inputs: [['number'], ['text']],
445
+ inputs: [['number'], ['text'], ['date']],
446
446
  },
447
447
  ONLY: {
448
448
  handler(args, context) {
@@ -492,7 +492,7 @@ exports.aggregatedScalarExpressionFunctions = {
492
492
  ],
493
493
  examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
494
494
  category: 'aggregation',
495
- inputs: [['number'], ['text']],
495
+ inputs: [['number'], ['text'], ['date']],
496
496
  },
497
497
  STD_DEVIATION: {
498
498
  handler(args, context) {
@@ -853,7 +853,7 @@ exports.aggregatedScalarExpressionFunctions = {
853
853
  ],
854
854
  examples: ['COUNT([colA])', 'COUNT([colA], GROUP_BY([colB]))'],
855
855
  category: 'aggregation',
856
- inputs: [['number'], ['text']],
856
+ inputs: [['number'], ['text'], ['date']],
857
857
  },
858
858
  OVER: {
859
859
  handler(args, context) {
@@ -963,7 +963,7 @@ exports.aggregatedScalarExpressionFunctions = {
963
963
  };
964
964
  return result;
965
965
  },
966
- 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',
966
+ 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',
967
967
  signatures: [
968
968
  'OLDEST( [colName] )',
969
969
  'OLDEST( COL(name: string))',
@@ -974,19 +974,19 @@ exports.aggregatedScalarExpressionFunctions = {
974
974
  category: 'aggregation',
975
975
  inputs: ['date'],
976
976
  },
977
- YOUNGEST: {
977
+ NEWEST: {
978
978
  handler(args, context) {
979
- const minColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('YOUNGEST', args);
979
+ const minColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('NEWEST', args);
980
980
  const minColumnName = minColumnParameter.value;
981
- (0, expressionFunctionUtils_1.validateColumnType)(minColumnName, ['Date'], 'YOUNGEST', context.adaptableApi);
982
- const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('YOUNGEST', 'operand', ['GROUP_BY'], args, {
981
+ (0, expressionFunctionUtils_1.validateColumnType)(minColumnName, ['Date'], 'NEWEST', context.adaptableApi);
982
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('NEWEST', 'operand', ['GROUP_BY'], args, {
983
983
  isOptional: true,
984
984
  });
985
985
  const aggregationExpressionEvaluation = {
986
986
  aggregationParams: {
987
987
  reducers: {
988
- YOUNGEST: {
989
- name: 'YOUNGEST',
988
+ NEWEST: {
989
+ name: 'NEWEST',
990
990
  field: minColumnName,
991
991
  initialValue: null,
992
992
  reducer: (minValue, rowValue) => {
@@ -1016,20 +1016,20 @@ exports.aggregatedScalarExpressionFunctions = {
1016
1016
  };
1017
1017
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
1018
1018
  const result = {
1019
- name: 'YOUNGEST',
1019
+ name: 'NEWEST',
1020
1020
  type: 'aggregationScalar',
1021
1021
  value: aggregationExpressionEvaluation,
1022
1022
  };
1023
1023
  return result;
1024
1024
  },
1025
- 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',
1025
+ 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',
1026
1026
  signatures: [
1027
- 'YOUNGEST( [colName] )',
1028
- 'YOUNGEST( COL(name: string))',
1029
- 'YOUNGEST( [colNameA], GROUP_BY( [colNameB] ))',
1030
- 'YOUNGEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
1027
+ 'NEWEST( [colName] )',
1028
+ 'NEWEST( COL(name: string))',
1029
+ 'NEWEST( [colNameA], GROUP_BY( [colNameB] ))',
1030
+ 'NEWEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
1031
1031
  ],
1032
- examples: ['YOUNGEST([colA])', 'YOUNGEST([colA], GROUP_BY([colB]))'],
1032
+ examples: ['NEWEST([colA])', 'NEWEST([colA], GROUP_BY([colB]))'],
1033
1033
  category: 'aggregation',
1034
1034
  inputs: ['date'],
1035
1035
  },
@@ -97,6 +97,7 @@ function addUuidAndSource(adaptableObject) {
97
97
  }
98
98
  exports.addUuidAndSource = addUuidAndSource;
99
99
  function removeUuidAndSource(adaptableObject) {
100
+ const clonedObject = structuredClone(adaptableObject);
100
101
  const sanitiseObject = (object) => {
101
102
  for (const key in object) {
102
103
  if (key === 'Source' || key === 'Uuid') {
@@ -110,8 +111,8 @@ function removeUuidAndSource(adaptableObject) {
110
111
  }
111
112
  }
112
113
  };
113
- sanitiseObject(adaptableObject);
114
- return adaptableObject;
114
+ sanitiseObject(clonedObject);
115
+ return clonedObject;
115
116
  }
116
117
  exports.removeUuidAndSource = removeUuidAndSource;
117
118
  exports.AdaptableHelper = {
@@ -313,6 +313,8 @@ function CreateEmptyCellSummmary() {
313
313
  Max: undefined,
314
314
  Min: undefined,
315
315
  Count: undefined,
316
+ Newest: undefined,
317
+ Oldest: undefined,
316
318
  Std_Deviation: undefined,
317
319
  Only: undefined,
318
320
  };
@@ -14,13 +14,13 @@ class ModuleService {
14
14
  const settingsPanelMenuItems = [];
15
15
  const buttonMenuItems = [];
16
16
  this.getModuleCollection().forEach((module) => {
17
- const settingsPanelMenuItem = module.addModuleMenuItem('ModuleMenu');
17
+ const settingsPanelMenuItem = module.createModuleMenuItem('ModuleMenu');
18
18
  if (Helper_1.default.objectExists(settingsPanelMenuItem)) {
19
19
  if (settingsPanelMenuItems.findIndex((m) => m.module == settingsPanelMenuItem.module) == -1) {
20
20
  settingsPanelMenuItems.push(settingsPanelMenuItem);
21
21
  }
22
22
  }
23
- const buttonMenuItem = module.addModuleMenuItem('ModuleButton');
23
+ const buttonMenuItem = module.createModuleMenuItem('ModuleButton');
24
24
  if (Helper_1.default.objectExists(buttonMenuItem)) {
25
25
  if (buttonMenuItems.findIndex((m) => m.module == buttonMenuItem.module) == -1) {
26
26
  buttonMenuItems.push(buttonMenuItem);
@@ -150,6 +150,7 @@ const LayoutWizard = (props) => {
150
150
  title: 'Row Summaries',
151
151
  details: 'Configure Row Summaries',
152
152
  renderSummary: () => React.createElement(RowGroupingSection_1.RowGroupingSectionSummary, null),
153
+ isVisible: () => layoutSupportedFeatures.RowSummaries,
153
154
  render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
154
155
  React.createElement(RowSummarySection_1.RowSummarySection, { onChange: setLayout }))),
155
156
  },
@@ -16,7 +16,23 @@ const RowGroupingSectionSummary = () => {
16
16
  var _a;
17
17
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
18
18
  const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
19
- return (React.createElement(rebass_1.Box, null, ((_a = layout.RowGroupedColumns) === null || _a === void 0 ? void 0 : _a.length) ? (layout.RowGroupedColumns.map((columnId) => (React.createElement(Tag_1.Tag, { mr: 1, key: columnId }, adaptable.api.columnApi.getFriendlyNameForColumnId(columnId))))) : (React.createElement(Tag_1.Tag, null, "No Row Grouping"))));
19
+ return (React.createElement(rebass_1.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) => {
20
+ var _a;
21
+ const columns = Object.entries((_a = rowSummary.ColumnsMap) !== null && _a !== void 0 ? _a : {})
22
+ .map(([columnId, expression]) => {
23
+ if (columnId === 'Source' || columnId === 'Uuid') {
24
+ return '';
25
+ }
26
+ return `${expression}(${adaptable.api.columnApi.getFriendlyNameForColumnId(columnId)})`;
27
+ })
28
+ .filter(Boolean)
29
+ .join(', ');
30
+ return (React.createElement(rebass_1.Box, { mb: 2 },
31
+ React.createElement(Tag_1.Tag, { key: index },
32
+ rowSummary.Position,
33
+ " ",
34
+ columns)));
35
+ })) : (React.createElement(Tag_1.Tag, null, "No Row Summaries"))));
20
36
  };
21
37
  exports.RowGroupingSectionSummary = RowGroupingSectionSummary;
22
38
  const RowGroupingSection = (props) => {
@@ -37,13 +37,13 @@ const areSummaryRowsValid = (layout) => {
37
37
  exports.areSummaryRowsValid = areSummaryRowsValid;
38
38
  const getAvailableExpressionsForColumnType = (columnType, availableScalarExpressions) => {
39
39
  const inputType = (0, adaptableQlUtils_1.mapColumnDataTypeToExpressionFunctionType)(columnType);
40
- return Object.entries(availableScalarExpressions !== null && availableScalarExpressions !== void 0 ? availableScalarExpressions : {})
41
- .map(([expression, expressionDef]) => {
40
+ // Object.entries(availableScalarExpressions ?? {})
41
+ return RowSummary_1.summarySupportedExpressions
42
+ .filter((expression) => availableScalarExpressions[expression])
43
+ .map((expression) => {
42
44
  var _a, _b;
45
+ const expressionDef = availableScalarExpressions[expression];
43
46
  let firstArg = null;
44
- if (!RowSummary_1.summarySupportedExpressions.includes(expression)) {
45
- return null;
46
- }
47
47
  if (Array.isArray((_a = expressionDef === null || expressionDef === void 0 ? void 0 : expressionDef.inputs) === null || _a === void 0 ? void 0 : _a[0])) {
48
48
  // @ts-ignore
49
49
  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;
@@ -2760,7 +2760,7 @@ class AdaptableAgGrid {
2760
2760
  setRowGroupColumns(columnIds) {
2761
2761
  this.agGridAdapter.getAgGridApi().setRowGroupColumns(columnIds);
2762
2762
  }
2763
- getAgGridAllGridColumns() {
2763
+ getAllGridColumns() {
2764
2764
  return this.agGridAdapter.getAgGridApi().getAllGridColumns();
2765
2765
  }
2766
2766
  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;
@@ -574,7 +574,7 @@ class AgGridColumnAdapter {
574
574
  if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Note')) {
575
575
  return;
576
576
  }
577
- if (!this.adaptableApi.noteApi.internalApi.areNotesAvailable()) {
577
+ if (!this.adaptableApi.noteApi.internalApi.areNotesSupported()) {
578
578
  return;
579
579
  }
580
580
  const cellPosition = {
@@ -591,7 +591,7 @@ class AgGridColumnAdapter {
591
591
  if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Comment')) {
592
592
  return;
593
593
  }
594
- if (!this.adaptableApi.commentApi.internalApi.areCommentsAvailable()) {
594
+ if (!this.adaptableApi.commentApi.internalApi.areCommentsSupported()) {
595
595
  return;
596
596
  }
597
597
  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
  }