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

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 (78) 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 +4 -4
  5. package/src/Api/GridApi.d.ts +2 -1
  6. package/src/Api/Implementation/ActionRowApiImpl.js +3 -7
  7. package/src/Api/Implementation/AlertApiImpl.js +5 -10
  8. package/src/Api/Implementation/CalendarApiImpl.js +1 -6
  9. package/src/Api/Implementation/ChartingApiImpl.js +3 -3
  10. package/src/Api/Implementation/ColumnApiImpl.js +6 -6
  11. package/src/Api/Implementation/ColumnFilterApiImpl.js +7 -7
  12. package/src/Api/Implementation/CommentsApiImpl.js +1 -1
  13. package/src/Api/Implementation/ConfigApiImpl.js +11 -17
  14. package/src/Api/Implementation/DashboardApiImpl.js +1 -6
  15. package/src/Api/Implementation/ExportApiImpl.js +5 -10
  16. package/src/Api/Implementation/ExpressionApiImpl.js +8 -13
  17. package/src/Api/Implementation/Fdc3ApiImpl.js +1 -1
  18. package/src/Api/Implementation/FlashingCellApiImpl.js +3 -8
  19. package/src/Api/Implementation/FormatColumnApiImpl.js +4 -4
  20. package/src/Api/Implementation/FreeTextColumnApiImpl.js +1 -1
  21. package/src/Api/Implementation/GridApiImpl.d.ts +2 -1
  22. package/src/Api/Implementation/GridApiImpl.js +11 -8
  23. package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
  24. package/src/Api/Implementation/LayoutApiImpl.js +2 -13
  25. package/src/Api/Implementation/PredicateApiImpl.js +2 -2
  26. package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
  27. package/src/Api/Implementation/ScopeApiImpl.js +10 -10
  28. package/src/Api/Implementation/TeamSharingApiImpl.js +3 -15
  29. package/src/Api/Implementation/ThemeApiImpl.js +2 -7
  30. package/src/Api/Implementation/UserInterfaceApiImpl.js +4 -13
  31. package/src/Api/Internal/ActionRowInternalApi.js +7 -45
  32. package/src/Api/Internal/AdaptableInternalApi.js +2 -12
  33. package/src/Api/Internal/AlertInternalApi.js +4 -17
  34. package/src/Api/Internal/CalculatedColumnInternalApi.js +7 -14
  35. package/src/Api/Internal/ChartingInternalApi.js +13 -13
  36. package/src/Api/Internal/ColumnFilterInternalApi.js +18 -36
  37. package/src/Api/Internal/CustomSortInternalApi.js +1 -1
  38. package/src/Api/Internal/DashboardInternalApi.js +4 -10
  39. package/src/Api/Internal/DataImportInternalApi.js +3 -9
  40. package/src/Api/Internal/DataSetInternalApi.js +2 -7
  41. package/src/Api/Internal/ExportInternalApi.js +4 -4
  42. package/src/Api/Internal/ExpressionInternalApi.js +2 -12
  43. package/src/Api/Internal/Fdc3InternalApi.js +1 -10
  44. package/src/Api/Internal/FormatColumnInternalApi.js +11 -20
  45. package/src/Api/Internal/FreeTextColumnInternalApi.js +1 -1
  46. package/src/Api/Internal/GridFilterInternalApi.js +2 -8
  47. package/src/Api/Internal/GridInternalApi.js +13 -40
  48. package/src/Api/Internal/LayoutInternalApi.d.ts +1 -0
  49. package/src/Api/Internal/LayoutInternalApi.js +10 -19
  50. package/src/Api/Internal/PredicateInternalApi.js +5 -40
  51. package/src/Api/Internal/ScheduleInternalApi.js +1 -6
  52. package/src/Api/Internal/StyledColumnInternalApi.js +5 -5
  53. package/src/Api/Internal/SystemStatusInternalApi.js +1 -7
  54. package/src/Api/Internal/TeamSharingInternalApi.js +2 -7
  55. package/src/Api/Internal/ThemeInternalApi.js +1 -1
  56. package/src/Api/Internal/UserInterfaceInternalApi.js +1 -1
  57. package/src/Api/LayoutApi.d.ts +1 -0
  58. package/src/PredefinedConfig/Common/CellSummary.d.ts +5 -14
  59. package/src/PredefinedConfig/Common/Enums.d.ts +2 -0
  60. package/src/PredefinedConfig/Common/Enums.js +2 -0
  61. package/src/PredefinedConfig/Common/RowSummary.d.ts +1 -1
  62. package/src/PredefinedConfig/Common/RowSummary.js +4 -4
  63. package/src/Strategy/CellSummaryModule.js +54 -94
  64. package/src/Strategy/LayoutModule.js +5 -1
  65. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -1
  66. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +19 -19
  67. package/src/Utilities/Helpers/AdaptableHelper.js +3 -2
  68. package/src/Utilities/ObjectFactory.js +2 -0
  69. package/src/View/Layout/Wizard/LayoutWizard.js +1 -0
  70. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +17 -1
  71. package/src/View/Layout/Wizard/sections/RowSummarySection.js +5 -5
  72. package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
  73. package/src/agGrid/AdaptableAgGrid.js +1 -1
  74. package/src/agGrid/AgGridAdapter.d.ts +1 -2
  75. package/src/env.js +2 -2
  76. package/src/metamodel/adaptable.metamodel.d.ts +8 -2
  77. package/src/metamodel/adaptable.metamodel.js +1 -1
  78. 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.26",
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
  */
@@ -4,14 +4,14 @@ import { AdaptableColumn, AdaptableIcon, AdaptableModule, BaseContext } from '..
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
@@ -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
  }
@@ -30,13 +30,8 @@ export class FlashingCellApiImpl extends ApiBase {
30
30
  }
31
31
  showFlashingCell(flashingCellToShow) {
32
32
  this.addUidToAdaptableObject(flashingCellToShow);
33
- const flashingCellFiredInfo = {
34
- adaptableApi: this.adaptable.api,
35
- flashingCell: flashingCellToShow,
36
- userName: this.adaptable.api.optionsApi.getUserName(),
37
- adaptableId: this.adaptable.api.optionsApi.getAdaptableId(),
38
- };
39
- const results = this.adaptable.api.eventApi.emitSync('FlashingCellDisplayed', flashingCellFiredInfo);
33
+ const flashingCellFiredInfo = Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { flashingCell: flashingCellToShow });
34
+ const results = this.getAdaptableApi().eventApi.emitSync('FlashingCellDisplayed', flashingCellFiredInfo);
40
35
  const shouldShow = results.reduce((endResult, aResult) => {
41
36
  return endResult && aResult !== false;
42
37
  }, true);
@@ -84,7 +79,7 @@ export class FlashingCellApiImpl extends ApiBase {
84
79
  getFlashingCellPredicateDefsForScope(scope) {
85
80
  return this.getAdaptableApi()
86
81
  .predicateApi.internalApi.getFlashingCellPredicateDefs(scope)
87
- .filter((predicateDef) => this.adaptable.api.scopeApi.isScopeInScope(scope, predicateDef.columnScope));
82
+ .filter((predicateDef) => this.getAdaptableApi().scopeApi.isScopeInScope(scope, predicateDef.columnScope));
88
83
  }
89
84
  clearAllFlashingCells() {
90
85
  this.dispatchAction(SystemRedux.SystemFlashingCellDeleteAll());
@@ -65,7 +65,7 @@ export class FormatColumnApiImpl extends ApiBase {
65
65
  return this.internalApi.getFormatColumnWithColumnInScope(formatColumns, column);
66
66
  }
67
67
  getFormatColumnsForColumnId(columnId, config) {
68
- const abColumn = this.adaptable.api.columnApi.getColumnWithColumnId(columnId);
68
+ const abColumn = this.getAdaptableApi().columnApi.getColumnWithColumnId(columnId);
69
69
  if (!abColumn) {
70
70
  return [];
71
71
  }
@@ -75,13 +75,13 @@ export class FormatColumnApiImpl extends ApiBase {
75
75
  this.showModulePopup(ModuleConstants.FormatColumnModuleId);
76
76
  }
77
77
  getFormatColumnsWithAllScope(formatColumns) {
78
- return formatColumns.filter((fc) => this.adaptable.api.scopeApi.scopeIsAll(fc.Scope));
78
+ return formatColumns.filter((fc) => this.getAdaptableApi().scopeApi.scopeIsAll(fc.Scope));
79
79
  }
80
80
  getFormatColumnsWithDataTypeScope(formatColumns) {
81
- return formatColumns.filter((fc) => this.adaptable.api.scopeApi.scopeHasDataType(fc.Scope));
81
+ return formatColumns.filter((fc) => this.getAdaptableApi().scopeApi.scopeHasDataType(fc.Scope));
82
82
  }
83
83
  getFormatColumnsWithColumnScope(formatColumns) {
84
- return formatColumns.filter((fc) => this.adaptable.api.scopeApi.scopeHasColumns(fc.Scope));
84
+ return formatColumns.filter((fc) => this.getAdaptableApi().scopeApi.scopeHasColumns(fc.Scope));
85
85
  }
86
86
  hasCustomDisplayFormatter(formatColumn) {
87
87
  var _a;
@@ -85,7 +85,7 @@ export class FreeTextColumnApiImpl extends ApiBase {
85
85
  }
86
86
  getFreeTextColumnValueForRowNode(freeTextColumn, rowNode) {
87
87
  try {
88
- if (this.adaptable.api.gridApi.isGroupRowNode(rowNode)) {
88
+ if (this.getAdaptableApi().gridApi.isGroupRowNode(rowNode)) {
89
89
  return null;
90
90
  }
91
91
  if (ArrayExtensions.IsNotNullOrEmpty(freeTextColumn.FreeTextStoredValues)) {
@@ -8,7 +8,7 @@ import { ColumnSort } from '../../PredefinedConfig/Common/ColumnSort';
8
8
  import { DataUpdateConfig } from '../../PredefinedConfig/Common/DataUpdateConfig';
9
9
  import { CellHighlightInfo } from '../../PredefinedConfig/Common/CellHighlightInfo';
10
10
  import { RowHighlightInfo } from '../../PredefinedConfig/Common/RowHighlightInfo';
11
- import { IRowNode, RowModelType } from '@ag-grid-community/core';
11
+ import { Column, IRowNode, RowModelType } from '@ag-grid-community/core';
12
12
  import { GridCellRange } from '../../PredefinedConfig/Selection/GridCellRange';
13
13
  import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
14
14
  import { RowsHighlightInfo } from '../../PredefinedConfig/Common/RowsHighlightInfo';
@@ -134,4 +134,5 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
134
134
  getAgGridRowModelType(): RowModelType;
135
135
  getVisibleRowCount(): number;
136
136
  showTransposedView(transposeConfig?: TransposeConfig): void;
137
+ getAllGridColumns(): Column<any>[];
137
138
  }