@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "18.0.0-canary.25",
3
+ "version": "18.0.0-canary.27",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -243,7 +243,7 @@ export interface IAdaptable {
243
243
  getAgGridCurrentThemeName(): string;
244
244
  applyAdaptableTheme(theme: AdaptableTheme | string): void;
245
245
  setRowGroupColumns(columnIds: string[]): void;
246
- getAgGridAllGridColumns(): Column<any>[];
246
+ getAllGridColumns(): Column<any>[];
247
247
  clearRowGroupColumns(): void;
248
248
  expandAllRowGroups(): void;
249
249
  closeAllRowGroups(): void;
@@ -4,7 +4,7 @@ import { CommentThread, BaseContext, GridCell } from '../types';
4
4
  */
5
5
  export interface CommentOptions<TData = any> {
6
6
  /**
7
- * Whether a cell can contain Comments
7
+ * Function to configure if a cell can contain Comments
8
8
  */
9
9
  isCellCommentable?: (commentableCellContext: CommentableCellContext) => boolean;
10
10
  /**
@@ -17,7 +17,7 @@ export interface CommentOptions<TData = any> {
17
17
  */
18
18
  persistCommentThreads?(commentThreads: CommentThread[]): Promise<void>;
19
19
  /**
20
- * Format string for formatting in the Comments Popup
20
+ * Format string for dates in Comments Popup
21
21
  *
22
22
  * @defaultValue 'dd-MM-yyyy HH:mm:ss'
23
23
  */
@@ -1,17 +1,17 @@
1
1
  import { AdaptableMenuItem, ColumnMenuContext, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
2
- import { AdaptableColumn, AdaptableIcon, AdaptableModule, BaseContext } from '../types';
2
+ import { AdaptableColumn, AdaptableIcon, BaseContext } from '../types';
3
3
  /**
4
4
  * Options for managing menus in AdapTable – provided using 2 collections
5
5
  */
6
6
  export interface MenuOptions<TData = any> {
7
- /**
8
- * Customises Context Menu (default context menu items are available in provided context)
9
- */
10
- customContextMenu?: (menuContext: CustomContextMenuContext<TData>) => CustomContextMenuItem[];
11
7
  /**
12
8
  * Customises Column Menu (default column menu items are available in the provided context)
13
9
  */
14
10
  customColumnMenu?: (menuContext: CustomColumnMenuContext<TData>) => CustomColumnMenuItem[];
11
+ /**
12
+ * Customises Context Menu (default context menu items are available in provided context)
13
+ */
14
+ customContextMenu?: (menuContext: CustomContextMenuContext<TData>) => CustomContextMenuItem[];
15
15
  }
16
16
  /**
17
17
  * Context info provided when building Custom Context Menus
@@ -22,13 +22,13 @@ export interface CustomContextMenuContext<TData = any> extends ContextMenuContex
22
22
  */
23
23
  defaultAgGridMenuItems: AgGridMenuItem<AgGridContextMenuItemType>[];
24
24
  /**
25
- * Default AdapTable Menu Items
25
+ * Flat list of all available AdapTable Menu Items
26
26
  */
27
27
  defaultAdaptableMenuItems: AdaptableSystemMenuItem[];
28
28
  /**
29
- * All Adaptable Menu Items sorted and grouped
29
+ * Default structure of Adaptable Menu Items
30
30
  */
31
- structuredAdaptableMenuItems: AdaptableSystemMenuItem[];
31
+ defaultAdaptableMenuStructure: AdaptableSystemMenuItem[];
32
32
  }
33
33
  /**
34
34
  * Context info provided when building Custom Column Menus
@@ -39,13 +39,13 @@ export interface CustomColumnMenuContext<TData = any> extends ColumnMenuContext<
39
39
  */
40
40
  defaultAgGridMenuItems: AgGridMenuItem<AgGridColumnMenuItemType>[];
41
41
  /**
42
- * Default AdapTable Menu Items
42
+ * Flat list of all available AdapTable Menu Items
43
43
  */
44
44
  defaultAdaptableMenuItems: AdaptableSystemMenuItem[];
45
45
  /**
46
- * All Adaptable Menu Items sorted and grouped
46
+ * Default structure of Adaptable Menu Items
47
47
  */
48
- structuredAdaptableMenuItems: AdaptableSystemMenuItem[];
48
+ defaultAdaptableMenuStructure: AdaptableSystemMenuItem[];
49
49
  }
50
50
  /**
51
51
  * Custom Context Menu Item
@@ -172,15 +172,3 @@ export type AgGridContextMenuItemType = 'autoSizeAll' | 'expandAll' | 'contractA
172
172
  * Defines AG Grid Column Menu Items
173
173
  */
174
174
  export type AgGridColumnMenuItemType = 'pinSubMenu' | 'valueAggSubMenu' | 'autoSizeThis' | 'autoSizeAll' | 'rowGroup' | 'rowUnGroup' | 'resetColumns' | 'expandAll' | 'contractAll';
175
- type ModuleGroup = {
176
- modules: AdaptableModule[];
177
- icon?: AdaptableIcon;
178
- title: string;
179
- };
180
- export declare const DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE: (AdaptableModule | ModuleGroup)[];
181
- /**
182
- * Defines the order of Menu Items in the CONTEXT Menu
183
- * The items commented out do not have a Context Menu Option
184
- */
185
- export declare const DEFAULT_ADAPTABLE_CONTEXT_MENU_STRUCTURE: (AdaptableModule | ModuleGroup)[];
186
- export {};
@@ -1,96 +1 @@
1
- import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
2
- export const DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE = [
3
- ModuleConstants.CalculatedColumnModuleId,
4
- ModuleConstants.CellSummaryModuleId,
5
- ModuleConstants.ColumnFilterModuleId,
6
- ModuleConstants.ColumnInfoModuleId,
7
- ModuleConstants.CustomSortModuleId,
8
- ModuleConstants.DashboardModuleId,
9
- ModuleConstants.DataImportModuleId,
10
- ModuleConstants.FlashingCellModuleId,
11
- ModuleConstants.FormatColumnModuleId,
12
- ModuleConstants.FreeTextColumnModuleId,
13
- ModuleConstants.GridInfoModuleId,
14
- ModuleConstants.LayoutModuleId,
15
- ModuleConstants.PlusMinusModuleId,
16
- ModuleConstants.SettingsPanelModuleId,
17
- ModuleConstants.StyledColumnModuleId,
18
- ModuleConstants.SystemStatusModuleId, // Single Item - Always present
19
- /*
20
- // Modules that dont provide a Column Menu
21
- ModuleConstants.AlertModuleId,
22
- ModuleConstants.BulkUpdateModuleId,
23
- ModuleConstants.ChartingModuleId,
24
- ModuleConstants.CommentModuleId,
25
- ModuleConstants.DataChangeHistoryModuleId,
26
- ModuleConstants.DataSetModuleId,
27
- ModuleConstants.ExportModuleId,
28
- ModuleConstants.Fdc3ModuleId,
29
- ModuleConstants.GridFilterModuleId,
30
- ModuleConstants.NamedQueryModuleId,
31
- ModuleConstants.NoteModuleId,
32
- ModuleConstants.QuickSearchModuleId,
33
- ModuleConstants.ScheduleModuleId,
34
- ModuleConstants.ShortcutModuleId,
35
- ModuleConstants.SmartEditModuleId,
36
- ModuleConstants.StateManagementModuleId,
37
- ModuleConstants.StatusBarModuleId,
38
- ModuleConstants.TeamSharingModuleId,
39
- ModuleConstants.ThemeModuleId,
40
- ModuleConstants.ToolPanelModuleId,
41
- */
42
- ];
43
- /**
44
- * Defines the order of Menu Items in the CONTEXT Menu
45
- * The items commented out do not have a Context Menu Option
46
- */
47
- export const DEFAULT_ADAPTABLE_CONTEXT_MENU_STRUCTURE = [
48
- ModuleConstants.AlertModuleId,
49
- ModuleConstants.BulkUpdateModuleId,
50
- ModuleConstants.CalculatedColumnModuleId,
51
- ModuleConstants.CellSummaryModuleId,
52
- ModuleConstants.ColumnFilterModuleId,
53
- ModuleConstants.ColumnInfoModuleId,
54
- ModuleConstants.CommentModuleId,
55
- ModuleConstants.DashboardModuleId,
56
- ModuleConstants.DataImportModuleId,
57
- ModuleConstants.ExportModuleId,
58
- ModuleConstants.Fdc3ModuleId,
59
- ModuleConstants.FlashingCellModuleId,
60
- ModuleConstants.GridInfoModuleId,
61
- ModuleConstants.LayoutModuleId,
62
- ModuleConstants.NoteModuleId,
63
- ModuleConstants.SettingsPanelModuleId,
64
- ModuleConstants.SmartEditModuleId,
65
- ModuleConstants.SystemStatusModuleId, // Single Item - Always present
66
- // this currently doesnt work
67
- // {
68
- // title: 'Edit',
69
- // icon: {
70
- // name: 'edit',
71
- // },
72
- // modules: [ModuleConstants.SmartEditModuleId, ModuleConstants.BulkUpdateModuleId],
73
- // },
74
- /*
75
- // Modules that dont provide a Context Menu
76
- ModuleConstants.ChartingModuleId,
77
- ModuleConstants.CustomSortModuleId,
78
- ModuleConstants.DataChangeHistoryModuleId,
79
- ModuleConstants.DataSetModuleId,
80
- ModuleConstants.FormatColumnModuleId,
81
- ModuleConstants.FreeTextColumnModuleId,
82
- ModuleConstants.GridFilterModuleId,
83
- ModuleConstants.NamedQueryModuleId,
84
- ModuleConstants.PlusMinusModuleId,
85
- ModuleConstants.QuickSearchModuleId,
86
- ModuleConstants.ScheduleModuleId,
87
- ModuleConstants.ShortcutModuleId,
88
- ModuleConstants.StateManagementModuleId,
89
- ModuleConstants.StatusBarModuleId,
90
- ModuleConstants.StyledColumnModuleId,
91
- ModuleConstants.TeamSharingModuleId,
92
- ModuleConstants.ThemeModuleId,
93
- ModuleConstants.ToolPanelModuleId,
94
-
95
- */
96
- ];
1
+ export {};
@@ -7,7 +7,7 @@ import { DataUpdateConfig } from '../PredefinedConfig/Common/DataUpdateConfig';
7
7
  import { CellDataChangedInfo } from '../PredefinedConfig/Common/CellDataChangedInfo';
8
8
  import { CellHighlightInfo } from '../PredefinedConfig/Common/CellHighlightInfo';
9
9
  import { RowHighlightInfo } from '../PredefinedConfig/Common/RowHighlightInfo';
10
- import { IRowNode, RowModelType } from '@ag-grid-community/core';
10
+ import { Column, IRowNode, RowModelType } from '@ag-grid-community/core';
11
11
  import { GridCellRange } from '../PredefinedConfig/Selection/GridCellRange';
12
12
  import { RowsHighlightInfo } from '../PredefinedConfig/Common/RowsHighlightInfo';
13
13
  import { TransposeConfig } from '../PredefinedConfig/Common/TransposeConfig';
@@ -529,4 +529,5 @@ export interface GridApi {
529
529
  * Opens a window with a transposed view of Grid
530
530
  */
531
531
  showTransposedView(transposeConfig?: TransposeConfig): void;
532
+ getAllGridColumns(): Column<any>[];
532
533
  }
@@ -9,17 +9,13 @@ export class ActionRowApiImpl extends ApiBase {
9
9
  getActionRowButtons() {
10
10
  var actionRowButtons = this.getActionRowOptions().actionRowButtons;
11
11
  if (typeof actionRowButtons === 'function') {
12
- const context = {
13
- adaptableApi: this.getAdaptableApi(),
14
- userName: this.getOptions().userName,
15
- adaptableId: this.getOptions().adaptableId,
16
- };
12
+ const context = this.getAdaptableApi().internalApi.buildBaseContext();
17
13
  actionRowButtons = actionRowButtons(context);
18
14
  }
19
15
  return actionRowButtons !== null && actionRowButtons !== void 0 ? actionRowButtons : [];
20
16
  }
21
17
  displayEditActionRow(primaryKey) {
22
- const rowNode = this.adaptable.api.gridApi.getRowNodeForPrimaryKey(primaryKey);
18
+ const rowNode = this.getAdaptableApi().gridApi.getRowNodeForPrimaryKey(primaryKey);
23
19
  if (!rowNode) {
24
20
  this.logWarn(`Can NOT edit row: rowNode not found for primaryKey ${primaryKey}`);
25
21
  }
@@ -41,7 +37,7 @@ export class ActionRowApiImpl extends ApiBase {
41
37
  }));
42
38
  }
43
39
  displayCloneActionRow(primaryKey) {
44
- const rowNode = this.adaptable.api.gridApi.getRowNodeForPrimaryKey(primaryKey);
40
+ const rowNode = this.getAdaptableApi().gridApi.getRowNodeForPrimaryKey(primaryKey);
45
41
  if (!rowNode) {
46
42
  this.logWarn(`Can NOT clone row: rowNode not found for primaryKey ${primaryKey}`);
47
43
  }
@@ -43,13 +43,8 @@ export class AlertApiImpl extends ApiBase {
43
43
  this.addUidToAdaptableObject(alertToShow);
44
44
  this.dispatchAction(SystemRedux.SystemAlertAdd(alertToShow, this.getAlertOptions().maxAlertsInStore));
45
45
  // 2. Publish the Alert Fired Event
46
- const alertFiredInfo = {
47
- adaptableApi: this.adaptable.api,
48
- alert: alertToShow,
49
- userName: this.adaptable.api.optionsApi.getUserName(),
50
- adaptableId: this.adaptable.api.optionsApi.getAdaptableId(),
51
- };
52
- const results = await this.adaptable.api.eventApi.emit('AlertFired', alertFiredInfo);
46
+ const alertFiredInfo = Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { alert: alertToShow });
47
+ const results = await this.getAdaptableApi().eventApi.emit('AlertFired', alertFiredInfo);
53
48
  const showPopup = results.reduce((endResult, aResult) => {
54
49
  return endResult && aResult !== false;
55
50
  }, true);
@@ -106,13 +101,13 @@ export class AlertApiImpl extends ApiBase {
106
101
  }
107
102
  if (alertNode) {
108
103
  if (alertProperties.HighlightRow) {
109
- this.adaptable.api.gridApi.refreshRowNodes([alertNode]);
104
+ this.getAdaptableApi().gridApi.refreshRowNodes([alertNode]);
110
105
  setTimeout(() => {
111
106
  this.dispatchAction(SystemRedux.SystemAlertRemoveRowHighlight(alertToShow));
112
107
  }, this.adaptable.adaptableOptions.alertOptions.rowHighlightDuration);
113
108
  }
114
109
  if (alertProperties.HighlightCell) {
115
- this.adaptable.api.gridApi.refreshCells([alertNode], [alertToShow.cellDataChangedInfo.column.columnId]);
110
+ this.getAdaptableApi().gridApi.refreshCells([alertNode], [alertToShow.cellDataChangedInfo.column.columnId]);
116
111
  setTimeout(() => {
117
112
  this.dispatchAction(SystemRedux.SystemAlertRemoveCellHighlight(alertToShow));
118
113
  }, this.adaptable.adaptableOptions.alertOptions.cellHighlightDuration);
@@ -123,7 +118,7 @@ export class AlertApiImpl extends ApiBase {
123
118
  else if (alertProperties.HighlightRow &&
124
119
  isAdaptableRowChangedAlert(alertToShow) &&
125
120
  ((_b = alertToShow.gridDataChangedInfo) === null || _b === void 0 ? void 0 : _b.rowTrigger) === 'Add') {
126
- this.adaptable.api.gridApi.refreshRowNodes(alertToShow.gridDataChangedInfo.rowNodes);
121
+ this.getAdaptableApi().gridApi.refreshRowNodes(alertToShow.gridDataChangedInfo.rowNodes);
127
122
  setTimeout(() => {
128
123
  this.dispatchAction(SystemRedux.SystemAlertRemoveRowHighlight(alertToShow));
129
124
  }, this.adaptable.adaptableOptions.alertOptions.rowHighlightDuration);
@@ -42,12 +42,7 @@ export class CalendarApiImpl extends ApiBase {
42
42
  const holidays = this.getCalendarOptions().holidays;
43
43
  if (holidays) {
44
44
  if (typeof holidays === 'function') {
45
- const baseContext = {
46
- userName: this.getOptions().userName,
47
- adaptableId: this.getOptions().adaptableId,
48
- adaptableApi: this.getAdaptableApi(),
49
- };
50
- return holidays(baseContext);
45
+ return holidays(this.getAdaptableApi().internalApi.buildBaseContext());
51
46
  }
52
47
  else {
53
48
  return holidays;
@@ -56,7 +56,7 @@ export class ChartingApiImpl extends ApiBase {
56
56
  }
57
57
  showChartDefinitionOnce(chartDefinition, container) {
58
58
  var _a;
59
- const chartRef = this.adaptable.api.chartingApi.getChartRef((_a = chartDefinition === null || chartDefinition === void 0 ? void 0 : chartDefinition.Model) === null || _a === void 0 ? void 0 : _a.chartId);
59
+ const chartRef = this.getAdaptableApi().chartingApi.getChartRef((_a = chartDefinition === null || chartDefinition === void 0 ? void 0 : chartDefinition.Model) === null || _a === void 0 ? void 0 : _a.chartId);
60
60
  if (chartRef) {
61
61
  return;
62
62
  }
@@ -92,7 +92,7 @@ export class ChartingApiImpl extends ApiBase {
92
92
  }
93
93
  getOpenChartContainer(chartDefinition) {
94
94
  var _a, _b, _c;
95
- const containerOptions = (_b = (_a = this.adaptable.api.optionsApi.getAdaptableOptions()) === null || _a === void 0 ? void 0 : _a.chartingOptions) === null || _b === void 0 ? void 0 : _b.chartContainers;
95
+ const containerOptions = (_b = (_a = this.getAdaptableApi().optionsApi.getAdaptableOptions()) === null || _a === void 0 ? void 0 : _a.chartingOptions) === null || _b === void 0 ? void 0 : _b.chartContainers;
96
96
  if (!containerOptions || !containerOptions.length) {
97
97
  return null;
98
98
  }
@@ -155,7 +155,7 @@ export class ChartingApiImpl extends ApiBase {
155
155
  ],
156
156
  } }),
157
157
  };
158
- this.adaptable.api.alertApi.showAdaptableAlert(alert);
158
+ this.getAdaptableApi().alertApi.showAdaptableAlert(alert);
159
159
  }
160
160
  }
161
161
  editExternalChartDefinition(chartDefinition) {
@@ -21,10 +21,10 @@ export class ColumnApiImpl extends ApiBase {
21
21
  }
22
22
  getColumns() {
23
23
  var _a;
24
- return (_a = this.adaptable.api.gridApi.getGridState().Columns) !== null && _a !== void 0 ? _a : [];
24
+ return (_a = this.getAdaptableApi().gridApi.getGridState().Columns) !== null && _a !== void 0 ? _a : [];
25
25
  }
26
26
  getVisibleColumns() {
27
- const layout = this.adaptable.api.layoutApi.getCurrentLayout();
27
+ const layout = this.getAdaptableApi().layoutApi.getCurrentLayout();
28
28
  const visibleCols = layout.Columns.reduce((acc, colId) => {
29
29
  acc[colId] = true;
30
30
  return acc;
@@ -68,18 +68,18 @@ export class ColumnApiImpl extends ApiBase {
68
68
  return isAutoPivotColumn(columnId);
69
69
  }
70
70
  isCalculatedColumn(columnId) {
71
- return (this.adaptable.api.calculatedColumnApi
71
+ return (this.getAdaptableApi().calculatedColumnApi
72
72
  .getCalculatedColumns()
73
73
  .find((cc) => cc.ColumnId == columnId) != null);
74
74
  }
75
75
  isFreeTextColumn(columnId) {
76
- return (this.adaptable.api.freeTextColumnApi
76
+ return (this.getAdaptableApi().freeTextColumnApi
77
77
  .getFreeTextColumns()
78
78
  .find((cc) => cc.ColumnId == columnId) != null);
79
79
  }
80
80
  isActionColumn(columnId) {
81
81
  var _a;
82
- return (((_a = this.adaptable.api.actionColumnApi
82
+ return (((_a = this.getAdaptableApi().actionColumnApi
83
83
  .getActionColumns()) === null || _a === void 0 ? void 0 : _a.find((cc) => cc.columnId == columnId)) != null);
84
84
  }
85
85
  getColumnWithColumnId(columnId, logWarning) {
@@ -159,7 +159,7 @@ export class ColumnApiImpl extends ApiBase {
159
159
  }
160
160
  let result = columnId + GeneralConstants.MISSING_COLUMN;
161
161
  if (this.isAutoRowGroupColumn(columnId)) {
162
- const currentLayout = this.adaptable.api.layoutApi.getCurrentLayout();
162
+ const currentLayout = this.getAdaptableApi().layoutApi.getCurrentLayout();
163
163
  if (currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.RowGroupedColumns) {
164
164
  result = `[Grouped column: ${currentLayout.RowGroupedColumns.join(', ')}]`;
165
165
  }
@@ -14,7 +14,7 @@ export class ColumnFilterApiImpl extends ApiBase {
14
14
  };
15
15
  return this.getAdaptableApi()
16
16
  .predicateApi.internalApi.getFilterPredicateDefs(scope)
17
- .filter((predicate) => this.adaptable.api.scopeApi.isColumnInScope(column, predicate.columnScope));
17
+ .filter((predicate) => this.getAdaptableApi().scopeApi.isColumnInScope(column, predicate.columnScope));
18
18
  }
19
19
  getFilterPredicateDefsForColumnId(columnId) {
20
20
  const column = this.getAdaptableApi().columnApi.getColumnWithColumnId(columnId);
@@ -31,11 +31,11 @@ export class ColumnFilterApiImpl extends ApiBase {
31
31
  }
32
32
  isQuickFilterVisible() {
33
33
  return (this.isQuickFilterAvailable() &&
34
- this.adaptable.api.internalApi.getSystemState().IsQuickFilterVisible);
34
+ this.getAdaptableApi().internalApi.getSystemState().IsQuickFilterVisible);
35
35
  }
36
36
  getColumnFilters() {
37
37
  var _a;
38
- const currentLayout = this.adaptable.api.layoutApi.getCurrentLayout();
38
+ const currentLayout = this.getAdaptableApi().layoutApi.getCurrentLayout();
39
39
  return (_a = currentLayout.ColumnFilters) !== null && _a !== void 0 ? _a : [];
40
40
  }
41
41
  getActiveColumnFilters() {
@@ -55,7 +55,7 @@ export class ColumnFilterApiImpl extends ApiBase {
55
55
  }
56
56
  getColumnFiltersForLayout(layoutName) {
57
57
  var _a;
58
- const layout = this.adaptable.api.layoutApi.getLayoutByName(layoutName);
58
+ const layout = this.getAdaptableApi().layoutApi.getLayoutByName(layoutName);
59
59
  return (_a = layout.ColumnFilters) !== null && _a !== void 0 ? _a : [];
60
60
  }
61
61
  setColumnFilters(columnFilters) {
@@ -64,7 +64,7 @@ export class ColumnFilterApiImpl extends ApiBase {
64
64
  this.logWarn('Column Filter has no Predicate', columnFilter);
65
65
  }
66
66
  else {
67
- const isValidPredicate = this.adaptable.api.predicateApi.isValidPredicate(columnFilter.Predicate);
67
+ const isValidPredicate = this.getAdaptableApi().predicateApi.isValidPredicate(columnFilter.Predicate);
68
68
  if (!isValidPredicate) {
69
69
  this.logWarn('Column Filter Predicate is not valid', columnFilter);
70
70
  }
@@ -118,10 +118,10 @@ export class ColumnFilterApiImpl extends ApiBase {
118
118
  if (!filter || !filter.Predicate || !filter.Predicate.PredicateId) {
119
119
  return false;
120
120
  }
121
- const predicateDef = this.adaptable.api.predicateApi.getPredicateDefById(filter === null || filter === void 0 ? void 0 : filter.Predicate.PredicateId);
121
+ const predicateDef = this.getAdaptableApi().predicateApi.getPredicateDefById(filter === null || filter === void 0 ? void 0 : filter.Predicate.PredicateId);
122
122
  if (ArrayExtensions.IsNull(predicateDef.inputs) &&
123
123
  // values predicates have no inputs in the definition
124
- !this.adaptable.api.predicateApi.internalApi.hasPredicateValues(filter.Predicate)) {
124
+ !this.getAdaptableApi().predicateApi.internalApi.hasPredicateValues(filter.Predicate)) {
125
125
  return true;
126
126
  }
127
127
  const inputs = filter.Predicate.Inputs;
@@ -24,7 +24,7 @@ export class CommentsApiImpl extends ApiBase {
24
24
  addComment(commentText, address) {
25
25
  this.dispatchAction(CommentRedux.CommentsAdd({
26
26
  comment: commentText
27
- ? ObjectFactory.CreateAdaptableComment(commentText, this.adaptable.api)
27
+ ? ObjectFactory.CreateAdaptableComment(commentText, this.getAdaptableApi())
28
28
  : null,
29
29
  cellAddress: address,
30
30
  }));
@@ -62,15 +62,9 @@ export class ConfigApiImpl extends ApiBase {
62
62
  flushCurrentState: false,
63
63
  }).then(() => {
64
64
  const newState = this.getPersistedState();
65
- const stateReloadedInfo = {
66
- oldState,
67
- newState,
68
- adaptableStateKey: adaptableOptions.adaptableStateKey,
69
- adaptableId: adaptableOptions.adaptableId,
70
- adaptableApi: this.adaptable.api,
71
- userName: this.adaptable.api.optionsApi.getUserName(),
72
- };
73
- this.adaptable.api.eventApi.emit('AdaptableStateReloaded', stateReloadedInfo);
65
+ const stateReloadedInfo = Object.assign({ oldState,
66
+ newState, adaptableStateKey: adaptableOptions.adaptableStateKey }, this.getAdaptableApi().internalApi.buildBaseContext());
67
+ this.getAdaptableApi().eventApi.emit('AdaptableStateReloaded', stateReloadedInfo);
74
68
  });
75
69
  });
76
70
  });
@@ -93,21 +87,21 @@ export class ConfigApiImpl extends ApiBase {
93
87
  });
94
88
  }
95
89
  getAdaptableSearchState() {
96
- const gridFilter = this.adaptable.api.gridFilterApi.getCurrentGridFilterExpression();
90
+ const gridFilter = this.getAdaptableApi().gridFilterApi.getCurrentGridFilterExpression();
97
91
  const adaptableSearchState = {
98
- dataSet: this.adaptable.api.dataSetApi.getCurrentDataSet(),
92
+ dataSet: this.getAdaptableApi().dataSetApi.getCurrentDataSet(),
99
93
  gridFilter: gridFilter,
100
94
  gridFilterAST: gridFilter
101
- ? this.adaptable.api.expressionApi.getASTForExpression(gridFilter)
95
+ ? this.getAdaptableApi().expressionApi.getASTForExpression(gridFilter)
102
96
  : null,
103
- columnFilters: this.adaptable.api.columnFilterApi.getColumnFilters(),
97
+ columnFilters: this.getAdaptableApi().columnFilterApi.getColumnFilters(),
104
98
  };
105
99
  return adaptableSearchState;
106
100
  }
107
101
  getAdaptableSortState() {
108
102
  const adaptableSortState = {
109
- columnSorts: this.adaptable.api.gridApi.getColumnSorts(),
110
- customSorts: this.adaptable.api.customSortApi.getCustomSorts(),
103
+ columnSorts: this.getAdaptableApi().gridApi.getColumnSorts(),
104
+ customSorts: this.getAdaptableApi().customSortApi.getCustomSorts(),
111
105
  };
112
106
  return adaptableSortState;
113
107
  }
@@ -116,7 +110,7 @@ export class ConfigApiImpl extends ApiBase {
116
110
  }
117
111
  setAdaptableStateKey(adaptableStateKey, config) {
118
112
  return new Promise((resolve, reject) => {
119
- this.adaptable.api.internalApi.executeWithProgressIndicator(`Initialising...`, () => {
113
+ this.getAdaptableApi().internalApi.executeWithProgressIndicator(`Initialising...`, () => {
120
114
  const flushCurrentState = !config || config.flushCurrentState !== false;
121
115
  // make sure we persist any "pending" changes to state - since stateOptions.debounceStateDelay can cause
122
116
  // the state to be persisted with a delay, which we dont want in this case
@@ -141,7 +135,7 @@ export class ConfigApiImpl extends ApiBase {
141
135
  .then(() => {
142
136
  this.adaptable.updateColumnModelAndRefreshGrid({ skipColDefsRefresh: true });
143
137
  this.adaptable.setLayout();
144
- this.adaptable.api.userInterfaceApi.hideLoadingScreen();
138
+ this.getAdaptableApi().userInterfaceApi.hideLoadingScreen();
145
139
  })
146
140
  .then(() => {
147
141
  // resolve main(result) promise
@@ -20,12 +20,7 @@ export class DashboardApiImpl extends ApiBase {
20
20
  }
21
21
  getCustomDashboardButtonByLabel(buttonLabel) {
22
22
  const api = this.getAdaptableApi();
23
- const dashboardContext = {
24
- adaptableApi: api,
25
- userName: this.getOptions().userName,
26
- adaptableId: this.getOptions().adaptableId,
27
- dashboardState: api.dashboardApi.getDashboardState(),
28
- };
23
+ const dashboardContext = Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { dashboardState: api.dashboardApi.getDashboardState() });
29
24
  return this.getDashboardOptions().customDashboardButtons.find((cb) => {
30
25
  api.internalApi.getLabelForButton(cb, dashboardContext) == buttonLabel;
31
26
  });
@@ -44,13 +44,13 @@ export class ExportApiImpl extends ApiBase {
44
44
  return currentDestination && this.getDestinationByName(currentDestination);
45
45
  }
46
46
  getAvailableSystemReports() {
47
- return this.getExportOptions().systemReportNames.filter((s) => this.adaptable.api.internalApi.getReportService().IsSystemReportActive(s));
47
+ return this.getExportOptions().systemReportNames.filter((s) => this.getAdaptableApi().internalApi.getReportService().IsSystemReportActive(s));
48
48
  }
49
49
  getAvailableExportDestinations() {
50
50
  let systemDestinations = [];
51
51
  this.getExportOptions().systemExportDestinations.forEach((exportDestination) => {
52
- if (this.adaptable.api.internalApi
53
- .getReportService()
52
+ if (this.getAdaptableApi()
53
+ .internalApi.getReportService()
54
54
  .IsSystemExportDestinationActive(exportDestination)) {
55
55
  systemDestinations.push(exportDestination);
56
56
  }
@@ -143,17 +143,12 @@ export class ExportApiImpl extends ApiBase {
143
143
  this.logWarn(`Report '${reportName}' not found!`);
144
144
  return undefined;
145
145
  }
146
- return this.adaptable.api.internalApi.getReportService().getReportData(report);
146
+ return this.getAdaptableApi().internalApi.getReportService().getReportData(report);
147
147
  }
148
148
  isColumnExportable(adaptableColumn) {
149
149
  const isExportableFn = this.getExportOptions().isColumnExportable;
150
150
  if (typeof isExportableFn === 'function') {
151
- return isExportableFn({
152
- adaptableApi: this.adaptable.api,
153
- userName: this.getOptions().userName,
154
- adaptableId: this.getOptions().adaptableId,
155
- adaptableColumn,
156
- });
151
+ return isExportableFn(Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { adaptableColumn }));
157
152
  }
158
153
  return true;
159
154
  }
@@ -7,7 +7,7 @@ export class ExpressionApiImpl extends ApiBase {
7
7
  this.internalApi = new ExpressionInternalApi(adaptable);
8
8
  }
9
9
  isValidBooleanExpression(query, module, validationErrorMessage) {
10
- const { isValid, errorMessage } = this.adaptable.api.internalApi
10
+ const { isValid, errorMessage } = this.getAdaptableApi().internalApi
11
11
  .getQueryLanguageService()
12
12
  .validateBoolean(query, module, { force: true });
13
13
  if (!isValid && validationErrorMessage) {
@@ -16,7 +16,7 @@ export class ExpressionApiImpl extends ApiBase {
16
16
  return isValid;
17
17
  }
18
18
  isValidObservableExpression(expression, module, validationErrorMessage) {
19
- const { isValid, errorMessage } = this.adaptable.api.internalApi
19
+ const { isValid, errorMessage } = this.getAdaptableApi().internalApi
20
20
  .getQueryLanguageService()
21
21
  .validateObservable(expression, module);
22
22
  if (!isValid && validationErrorMessage) {
@@ -25,7 +25,7 @@ export class ExpressionApiImpl extends ApiBase {
25
25
  return isValid;
26
26
  }
27
27
  isValidAggregatedBooleanExpression(expression, module, validationErrorMessage) {
28
- const { isValid, errorMessage } = this.adaptable.api.internalApi
28
+ const { isValid, errorMessage } = this.getAdaptableApi().internalApi
29
29
  .getQueryLanguageService()
30
30
  .validateAggregatedBoolean(expression, module);
31
31
  if (!isValid && validationErrorMessage) {
@@ -34,7 +34,7 @@ export class ExpressionApiImpl extends ApiBase {
34
34
  return isValid;
35
35
  }
36
36
  isValidAggregatedScalarExpression(expression, module, validationErrorMessage) {
37
- const { isValid, errorMessage } = this.adaptable.api.internalApi
37
+ const { isValid, errorMessage } = this.getAdaptableApi().internalApi
38
38
  .getQueryLanguageService()
39
39
  .validateAggregatedScalar(expression, module);
40
40
  if (!isValid && validationErrorMessage) {
@@ -47,11 +47,11 @@ export class ExpressionApiImpl extends ApiBase {
47
47
  }
48
48
  getColumnsFromExpression(expression) {
49
49
  try {
50
- const columnIds = this.adaptable.api.internalApi
50
+ const columnIds = this.getAdaptableApi().internalApi
51
51
  .getQueryLanguageService()
52
52
  .getColumnsFromExpression(expression);
53
53
  columnIds.forEach((columnId) => {
54
- const calculatedColumn = this.adaptable.api.calculatedColumnApi.getCalculatedColumnForColumnId(columnId);
54
+ const calculatedColumn = this.getAdaptableApi().calculatedColumnApi.getCalculatedColumnForColumnId(columnId);
55
55
  if (calculatedColumn) {
56
56
  const transitiveColumnIds = this.getColumnsFromExpression(this.getAdaptableQueryExpression(calculatedColumn.Query));
57
57
  columnIds.push(...transitiveColumnIds);
@@ -69,12 +69,7 @@ export class ExpressionApiImpl extends ApiBase {
69
69
  isColumnQueryable(adaptableColumnBase) {
70
70
  let queryableColumnFn = this.getExpressionOptions().isColumnQueryable;
71
71
  if (queryableColumnFn) {
72
- const queryableColumnContext = {
73
- adaptableColumn: adaptableColumnBase,
74
- adaptableApi: this.getAdaptableApi(),
75
- userName: this.getOptions().userName,
76
- adaptableId: this.getOptions().adaptableId,
77
- };
72
+ const queryableColumnContext = Object.assign({ adaptableColumn: adaptableColumnBase }, this.getAdaptableApi().internalApi.buildBaseContext());
78
73
  return queryableColumnFn(queryableColumnContext);
79
74
  }
80
75
  return true;
@@ -84,7 +79,7 @@ export class ExpressionApiImpl extends ApiBase {
84
79
  return ((_d = (_c = (_b = (_a = query.BooleanExpression) !== null && _a !== void 0 ? _a : query.ScalarExpression) !== null && _b !== void 0 ? _b : query.ObservableExpression) !== null && _c !== void 0 ? _c : query.AggregatedBooleanExpression) !== null && _d !== void 0 ? _d : query.AggregatedScalarExpression);
85
80
  }
86
81
  getAdaptableQueryExpressionWithColumnFriendlyNames(query) {
87
- return this.adaptable.api.internalApi
82
+ return this.getAdaptableApi().internalApi
88
83
  .getQueryLanguageService()
89
84
  .getExpressionWithColumnFriendlyNames(this.getAdaptableQueryExpression(query));
90
85
  }
@@ -76,6 +76,6 @@ export class Fdc3ApiImpl extends ApiBase {
76
76
  return this.internalApi.isStandardIntentType(intentType);
77
77
  }
78
78
  getFdc3Service() {
79
- return this.adaptable.api.internalApi.getFdc3Service();
79
+ return this.getAdaptableApi().internalApi.getFdc3Service();
80
80
  }
81
81
  }