@adaptabletools/adaptable 11.1.4 → 11.1.7

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 (87) hide show
  1. package/bundle.cjs.js +129 -129
  2. package/package.json +1 -1
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/AdaptableOptions/FinancePluginOptions.d.ts +139 -9
  6. package/src/AdaptableOptions/OpenFinPluginOptions.d.ts +3 -3
  7. package/src/AdaptableOptions/SmartEdit.d.ts +2 -2
  8. package/src/Api/AdaptableApi.d.ts +4 -1
  9. package/src/Api/EventApi.d.ts +1 -1
  10. package/src/Api/Implementation/ColumnApiImpl.js +4 -1
  11. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +1 -1
  12. package/src/Api/Implementation/FormatColumnApiImpl.js +11 -7
  13. package/src/Api/Implementation/InternalApiImpl.d.ts +4 -0
  14. package/src/Api/Implementation/InternalApiImpl.js +9 -0
  15. package/src/Api/Implementation/ScopeApiImpl.d.ts +2 -0
  16. package/src/Api/Implementation/ScopeApiImpl.js +12 -0
  17. package/src/Api/Implementation/ThemeApiImpl.d.ts +1 -0
  18. package/src/Api/Implementation/ThemeApiImpl.js +3 -0
  19. package/src/Api/InternalApi.d.ts +4 -0
  20. package/src/Api/ScopeApi.d.ts +10 -0
  21. package/src/Api/ThemeApi.d.ts +4 -0
  22. package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +8 -0
  23. package/src/PredefinedConfig/Common/FDC3Context.d.ts +144 -3
  24. package/src/PredefinedConfig/Common/Menu.d.ts +4 -0
  25. package/src/Redux/Store/AdaptableStore.js +11 -1
  26. package/src/Strategy/AlertModule.js +1 -3
  27. package/src/Strategy/CalculatedColumnModule.js +1 -1
  28. package/src/Strategy/SmartEditModule.js +1 -1
  29. package/src/Strategy/Utilities/getExportColumnsViewItems.js +1 -1
  30. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +1 -1
  31. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -1
  32. package/src/Utilities/Helpers/FormatHelper.js +6 -0
  33. package/src/Utilities/Services/AlertService.d.ts +3 -3
  34. package/src/Utilities/Services/AlertService.js +6 -6
  35. package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +3 -3
  36. package/src/Utilities/Services/CalculatedColumnExpressionService.js +20 -20
  37. package/src/Utilities/Services/EntitlementService.d.ts +3 -3
  38. package/src/Utilities/Services/EntitlementService.js +12 -8
  39. package/src/Utilities/Services/Interface/IReportService.d.ts +1 -1
  40. package/src/Utilities/Services/MetamodelService.d.ts +3 -3
  41. package/src/Utilities/Services/MetamodelService.js +4 -4
  42. package/src/Utilities/Services/ModuleService.d.ts +3 -3
  43. package/src/Utilities/Services/ModuleService.js +12 -12
  44. package/src/Utilities/Services/QueryLanguageService.d.ts +3 -3
  45. package/src/Utilities/Services/QueryLanguageService.js +20 -19
  46. package/src/Utilities/Services/ReportService.d.ts +4 -4
  47. package/src/Utilities/Services/ReportService.js +50 -44
  48. package/src/Utilities/Services/TeamSharingService.d.ts +3 -3
  49. package/src/Utilities/Services/TeamSharingService.js +19 -16
  50. package/src/Utilities/Services/ValidationService.d.ts +3 -3
  51. package/src/Utilities/Services/ValidationService.js +19 -17
  52. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +46 -9
  53. package/src/View/Alert/Wizard/AlertWizard.js +22 -24
  54. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +5 -5
  55. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +3 -3
  56. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -1
  57. package/src/View/Components/Selectors/ColumnSelector.js +1 -1
  58. package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +1 -3
  59. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +5 -1
  60. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +1 -1
  61. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +15 -2
  62. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +2 -1
  63. package/src/View/GridInfo/AdaptableObjectsSummary.js +1 -1
  64. package/src/View/Wizard/OnePageAdaptableWizard.js +1 -1
  65. package/src/agGrid/Adaptable.js +12 -12
  66. package/src/agGrid/agGridMenuHelper.js +1 -0
  67. package/src/components/StylePreview.js +2 -2
  68. package/src/components/icons/analysis.d.ts +3 -0
  69. package/src/components/icons/analysis.js +8 -0
  70. package/src/components/icons/call.d.ts +3 -0
  71. package/src/components/icons/call.js +7 -0
  72. package/src/components/icons/chat.d.ts +3 -0
  73. package/src/components/icons/chat.js +8 -0
  74. package/src/components/icons/index.js +14 -0
  75. package/src/components/icons/instrument.d.ts +3 -0
  76. package/src/components/icons/instrument.js +8 -0
  77. package/src/components/icons/news.d.ts +3 -0
  78. package/src/components/icons/news.js +8 -0
  79. package/src/components/icons/person.d.ts +3 -0
  80. package/src/components/icons/person.js +7 -0
  81. package/src/components/icons/quote.d.ts +3 -0
  82. package/src/components/icons/quote.js +7 -0
  83. package/src/metamodel/adaptable.metamodel.d.ts +112 -5
  84. package/src/metamodel/adaptable.metamodel.js +218 -21
  85. package/src/types.d.ts +2 -2
  86. package/version.d.ts +1 -1
  87. package/version.js +1 -1
@@ -6,8 +6,8 @@ const parser = tslib_1.__importStar(require("../../parser/src"));
6
6
  const rxjs_1 = require("rxjs");
7
7
  const LoggingHelper_1 = require("../Helpers/LoggingHelper");
8
8
  class QueryLanguageService {
9
- constructor(adaptable) {
10
- this.adaptable = adaptable;
9
+ constructor(adaptableApi) {
10
+ this.adaptableApi = adaptableApi;
11
11
  this.cacheBooleanValidation = new Map();
12
12
  this.cacheObservableValidation = new Map();
13
13
  this.cacheAggregatedBooleanValidation = new Map();
@@ -19,7 +19,7 @@ class QueryLanguageService {
19
19
  const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
20
20
  return parser.evaluate(expression, {
21
21
  node: rowNode,
22
- api: this.adaptable.api,
22
+ api: this.adaptableApi,
23
23
  functions: booleanAndScalarFunctions,
24
24
  });
25
25
  }
@@ -31,7 +31,7 @@ class QueryLanguageService {
31
31
  const aggregatedScalarFunctions = this.getModuleExpressionFunctions(module).aggregatedScalarFunctions;
32
32
  return parser.evaluate(expression, {
33
33
  node: null,
34
- api: this.adaptable.api,
34
+ api: this.adaptableApi,
35
35
  functions: aggregatedScalarFunctions,
36
36
  });
37
37
  }
@@ -40,7 +40,7 @@ class QueryLanguageService {
40
40
  const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
41
41
  const reactiveExpression$ = parser.evaluate(reactiveExpression, {
42
42
  node: reactiveExpression,
43
- api: this.adaptable.api,
43
+ api: this.adaptableApi,
44
44
  functions: moduleExpressionFunctions.observableFunctions,
45
45
  whereClauseFunctions: booleanAndScalarFunctions,
46
46
  });
@@ -51,7 +51,7 @@ class QueryLanguageService {
51
51
  const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
52
52
  const aggregationExpression$ = parser.evaluate(aggregationExpression, {
53
53
  node: aggregationExpression,
54
- api: this.adaptable.api,
54
+ api: this.adaptableApi,
55
55
  functions: moduleExpressionFunctions.aggregatedBooleanFunctions,
56
56
  whereClauseFunctions: booleanAndScalarFunctions,
57
57
  });
@@ -75,7 +75,7 @@ class QueryLanguageService {
75
75
  }
76
76
  const force = (_a = config === null || config === void 0 ? void 0 : config.force) !== null && _a !== void 0 ? _a : false;
77
77
  // get searchOptions to see if validation should be performed
78
- if (!this.adaptable.api.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
78
+ if (!this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
79
79
  .performExpressionValidation &&
80
80
  !force) {
81
81
  const result = { isValid: true, errorMessage: '' };
@@ -103,7 +103,7 @@ class QueryLanguageService {
103
103
  return result;
104
104
  }
105
105
  // evaluating the expression is the only way to catch circular named query references
106
- let firstRowNode = this.adaptable.getFirstRowNode();
106
+ let firstRowNode = this.adaptableApi.gridApi.getFirstRowNode();
107
107
  this.evaluateBooleanExpression(expression, module, firstRowNode);
108
108
  const result = {
109
109
  isValid: true,
@@ -243,15 +243,15 @@ class QueryLanguageService {
243
243
  if (!module) {
244
244
  LoggingHelper_1.LogAdaptableInfo(`QueryLanguageService.getModuleExpressionFunctions() was called with an undefined 'module' param, this should never happen`);
245
245
  return {
246
- booleanFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
246
+ booleanFunctions: this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
247
247
  .defaultBooleanFunctions,
248
- scalarFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
248
+ scalarFunctions: this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
249
249
  .defaultScalarFunctions,
250
- observableFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
250
+ observableFunctions: this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
251
251
  .defaultObservableFunctions,
252
- aggregatedBooleanFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
252
+ aggregatedBooleanFunctions: this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
253
253
  .defaultAggregatedBooleanFunctions,
254
- aggregatedScalarFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
254
+ aggregatedScalarFunctions: this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
255
255
  .defaultAggregatedScalarFunctions,
256
256
  };
257
257
  }
@@ -259,17 +259,18 @@ class QueryLanguageService {
259
259
  if (cachedResult) {
260
260
  return cachedResult;
261
261
  }
262
- const moduleSpecificOptions = (_b = (_a = this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
262
+ const moduleSpecificOptions = (_b = (_a = this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
263
263
  .moduleExpressionFunctions) === null || _a === void 0 ? void 0 : _a[module]) !== null && _b !== void 0 ? _b : {};
264
264
  const moduleSpecificFunctions = {
265
- booleanFunctions: (_c = moduleSpecificOptions.booleanFunctions) !== null && _c !== void 0 ? _c : this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
265
+ booleanFunctions: (_c = moduleSpecificOptions.booleanFunctions) !== null && _c !== void 0 ? _c : this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
266
266
  .defaultBooleanFunctions,
267
- scalarFunctions: (_d = moduleSpecificOptions.scalarFunctions) !== null && _d !== void 0 ? _d : this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions.defaultScalarFunctions,
268
- observableFunctions: (_e = moduleSpecificOptions.observableFunctions) !== null && _e !== void 0 ? _e : this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
267
+ scalarFunctions: (_d = moduleSpecificOptions.scalarFunctions) !== null && _d !== void 0 ? _d : this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
268
+ .defaultScalarFunctions,
269
+ observableFunctions: (_e = moduleSpecificOptions.observableFunctions) !== null && _e !== void 0 ? _e : this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
269
270
  .defaultObservableFunctions,
270
- aggregatedBooleanFunctions: (_f = moduleSpecificOptions.aggregatedBooleanFunctions) !== null && _f !== void 0 ? _f : this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
271
+ aggregatedBooleanFunctions: (_f = moduleSpecificOptions.aggregatedBooleanFunctions) !== null && _f !== void 0 ? _f : this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
271
272
  .defaultAggregatedBooleanFunctions,
272
- aggregatedScalarFunctions: (_g = moduleSpecificOptions.aggregatedScalarFunctions) !== null && _g !== void 0 ? _g : this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
273
+ aggregatedScalarFunctions: (_g = moduleSpecificOptions.aggregatedScalarFunctions) !== null && _g !== void 0 ? _g : this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
273
274
  .defaultAggregatedScalarFunctions,
274
275
  };
275
276
  this.cacheModuleSpecificExpressionFunctions.set(module, moduleSpecificFunctions);
@@ -1,17 +1,17 @@
1
- import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
2
1
  import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
3
2
  import { Report, ReportData, SystemReportName } from '../../PredefinedConfig/ExportState';
4
3
  import { IReportService } from './Interface/IReportService';
5
4
  import { RowNode } from '@ag-grid-community/all-modules';
6
5
  import { SystemExportDestination } from '../../AdaptableOptions/ExportOptions';
6
+ import { AdaptableApi } from '../../../types';
7
7
  export declare class ReportService implements IReportService {
8
- private adaptable;
9
- constructor(adaptable: IAdaptable);
8
+ private adaptableApi;
9
+ constructor(adaptableApi: AdaptableApi);
10
10
  CreateSystemReport(systemReportName: SystemReportName): Report;
11
11
  IsSystemReport(reportName: string): boolean;
12
12
  IsSystemReportActive(reportName: SystemReportName): boolean;
13
13
  IsSystemExportDestinationActive(exportDestination: SystemExportDestination): boolean;
14
- GetReportColumnScopeShortDescription(report: Report): string;
14
+ GetReportColumnScopeShortDescription(report: Report): string[];
15
15
  GetReportColumnScopeLongDescription(report: Report): string;
16
16
  GetReportExpressionDescription(report: Report, cols: AdaptableColumn[]): string;
17
17
  GetReportColumnsForReport(report: Report, includePrimaryKey?: boolean): AdaptableColumn[];
@@ -11,9 +11,9 @@ const FormatHelper_1 = tslib_1.__importStar(require("../Helpers/FormatHelper"));
11
11
  const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/StringExtensions"));
12
12
  const ModuleConstants_1 = require("../Constants/ModuleConstants");
13
13
  class ReportService {
14
- constructor(adaptable) {
15
- this.adaptable = adaptable;
16
- this.adaptable = adaptable;
14
+ constructor(adaptableApi) {
15
+ this.adaptableApi = adaptableApi;
16
+ this.adaptableApi = adaptableApi;
17
17
  }
18
18
  CreateSystemReport(systemReportName) {
19
19
  switch (systemReportName) {
@@ -74,10 +74,10 @@ class ReportService {
74
74
  }
75
75
  IsSystemReportActive(reportName) {
76
76
  if (reportName == GeneralConstants_1.SELECTED_CELLS_REPORT || reportName == GeneralConstants_1.SELECTED_ROWS_REPORT) {
77
- return this.adaptable.isGridSelectable();
77
+ return this.adaptableApi.gridApi.isGridSelectable();
78
78
  }
79
79
  if (reportName === GeneralConstants_1.VISUAL_DATA_REPORT) {
80
- return this.adaptable.api.exportApi
80
+ return this.adaptableApi.exportApi
81
81
  .getAvailableExportDestinations()
82
82
  .includes(Enums_1.ExportDestination.Excel);
83
83
  }
@@ -85,22 +85,26 @@ class ReportService {
85
85
  }
86
86
  IsSystemExportDestinationActive(exportDestination) {
87
87
  if (exportDestination === Enums_1.ExportDestination.Excel) {
88
- return this.adaptable.canExportToExcel();
88
+ return this.adaptableApi.exportApi.canExportToExcel();
89
89
  }
90
90
  return true;
91
91
  }
92
92
  GetReportColumnScopeShortDescription(report) {
93
+ var _a, _b;
93
94
  switch (report.ReportColumnScope) {
94
95
  case Enums_1.ReportColumnScope.AllColumns:
95
- return '[All Columns]';
96
+ return ['[All Columns]'];
96
97
  case Enums_1.ReportColumnScope.VisibleColumns:
97
- return '[Visible Columns]';
98
+ return ['[Visible Columns]'];
98
99
  case Enums_1.ReportColumnScope.SelectedColumns:
99
- return '[Selected Columns]';
100
+ return ['[Selected Columns]'];
100
101
  case Enums_1.ReportColumnScope.ScopeColumns:
101
- return '[Bespoke Columns]';
102
+ if ('ColumnIds' in (report === null || report === void 0 ? void 0 : report.Scope)) {
103
+ return (_b = (_a = report.Scope.ColumnIds).map) === null || _b === void 0 ? void 0 : _b.call(_a, (columnId) => { var _a; return (_a = this.adaptableApi.columnApi.getFriendlyNameFromColumnId(columnId)) !== null && _a !== void 0 ? _a : columnId; });
104
+ }
105
+ return ['[Bespoke Columns]'];
102
106
  case Enums_1.ReportColumnScope.CustomColumns:
103
- return '[Custom Columns]';
107
+ return ['[Custom Columns]'];
104
108
  }
105
109
  }
106
110
  GetReportColumnScopeLongDescription(report) {
@@ -112,7 +116,7 @@ class ReportService {
112
116
  case Enums_1.ReportColumnScope.SelectedColumns:
113
117
  return '[Selected Columns]';
114
118
  case Enums_1.ReportColumnScope.ScopeColumns:
115
- return this.adaptable.api.scopeApi.getScopeDescription(report.Scope);
119
+ return this.adaptableApi.scopeApi.getScopeDescription(report.Scope);
116
120
  case Enums_1.ReportColumnScope.CustomColumns:
117
121
  return '[Custom Columns]';
118
122
  }
@@ -153,7 +157,7 @@ class ReportService {
153
157
  }
154
158
  GetReportColumnsForReport(report, includePrimaryKey = false) {
155
159
  let reportColumns = [];
156
- let gridColumns = this.adaptable.api.columnApi.getColumns();
160
+ let gridColumns = this.adaptableApi.columnApi.getColumns();
157
161
  // first get the cols depending on the Column Scope
158
162
  switch (report.ReportColumnScope) {
159
163
  case Enums_1.ReportColumnScope.AllColumns:
@@ -164,17 +168,17 @@ class ReportService {
164
168
  break;
165
169
  case Enums_1.ReportColumnScope.SelectedColumns:
166
170
  // we extract the selected columns from the grid columns to preserve the grid column order
167
- const selectedColumnIds = this.adaptable.api.gridApi
171
+ const selectedColumnIds = this.adaptableApi.gridApi
168
172
  .getSelectedCellInfo()
169
173
  .columns.map((column) => column.columnId);
170
174
  reportColumns = gridColumns.filter((gridColumn) => selectedColumnIds.includes(gridColumn.columnId));
171
175
  break;
172
176
  case Enums_1.ReportColumnScope.ScopeColumns:
173
177
  if ('ColumnIds' in report.Scope) {
174
- reportColumns = report.Scope.ColumnIds.map((columnId) => this.adaptable.api.columnApi.getColumnFromId(columnId)).filter((c) => c);
178
+ reportColumns = report.Scope.ColumnIds.map((columnId) => this.adaptableApi.columnApi.getColumnFromId(columnId)).filter((c) => c);
175
179
  }
176
180
  else {
177
- reportColumns = this.adaptable.api.scopeApi.getColumnsForScope(report.Scope);
181
+ reportColumns = this.adaptableApi.scopeApi.getColumnsForScope(report.Scope);
178
182
  }
179
183
  break;
180
184
  case Enums_1.ReportColumnScope.CustomColumns:
@@ -182,11 +186,11 @@ class ReportService {
182
186
  break;
183
187
  }
184
188
  if (includePrimaryKey) {
185
- const pkColumn = reportColumns.find((column) => column.columnId === this.adaptable.adaptableOptions.primaryKey);
189
+ const pkColumn = reportColumns.find((column) => column.columnId === this.adaptableApi.internalApi.getAdaptableOptions().primaryKey);
186
190
  // TODO simplify after we fix the IsPrimaryKey bug
187
191
  // const pkColumn = reportColumns.find(column => column.IsPrimaryKey);
188
- if (!pkColumn && !!this.adaptable.api.columnApi.getPrimaryKeyColumn()) {
189
- reportColumns.push(this.adaptable.api.columnApi.getPrimaryKeyColumn());
192
+ if (!pkColumn && !!this.adaptableApi.columnApi.getPrimaryKeyColumn()) {
193
+ reportColumns.push(this.adaptableApi.columnApi.getPrimaryKeyColumn());
190
194
  }
191
195
  }
192
196
  return reportColumns;
@@ -206,7 +210,7 @@ class ReportService {
206
210
  const columnIds = columns.map((column) => column.columnId);
207
211
  switch (report.ReportRowScope) {
208
212
  case Enums_1.ReportRowScope.AllRows:
209
- this.adaptable.forAllRowNodesDo((rowNode) => {
213
+ this.adaptableApi.internalApi.forAllRowNodesDo((rowNode) => {
210
214
  // skip row groups
211
215
  if (!rowNode.group) {
212
216
  data.rows.push(this.getRowObjectForColumnIds(rowNode, columnIds));
@@ -214,7 +218,7 @@ class ReportService {
214
218
  });
215
219
  break;
216
220
  case Enums_1.ReportRowScope.VisibleRows:
217
- this.adaptable.forAllVisibleRowNodesDo((rowNode) => {
221
+ this.adaptableApi.internalApi.forAllVisibleRowNodesDo((rowNode) => {
218
222
  // skip row groups
219
223
  if (!rowNode.group) {
220
224
  data.rows.push(this.getRowObjectForColumnIds(rowNode, columnIds));
@@ -222,9 +226,9 @@ class ReportService {
222
226
  });
223
227
  break;
224
228
  case Enums_1.ReportRowScope.ExpressionRows:
225
- this.adaptable.forAllRowNodesDo((rowNode) => {
229
+ this.adaptableApi.internalApi.forAllRowNodesDo((rowNode) => {
226
230
  var _a;
227
- if (this.adaptable.api.internalApi
231
+ if (this.adaptableApi.internalApi
228
232
  .getQueryLanguageService()
229
233
  .evaluateBooleanExpression((_a = report.Query) === null || _a === void 0 ? void 0 : _a.BooleanExpression, ModuleConstants_1.ExportModuleId, rowNode)) {
230
234
  data.rows.push(this.getRowObjectForColumnIds(rowNode, columnIds));
@@ -232,30 +236,31 @@ class ReportService {
232
236
  });
233
237
  break;
234
238
  case Enums_1.ReportRowScope.SelectedCellRows:
235
- const selectedCellInfo = this.adaptable.api.gridApi.getSelectedCellInfo();
239
+ const selectedCellInfo = this.adaptableApi.gridApi.getSelectedCellInfo();
236
240
  const { gridCells: GridCells } = selectedCellInfo;
237
241
  let selectedCellsByPrimaryKey = groupBy_1.default(GridCells, 'primaryKeyValue');
238
242
  // we iterate over all visibleRowNodes to preserve the current order
239
- this.adaptable.forAllVisibleRowNodesDo((rowNode) => {
240
- const rowPrimaryKeyValue = this.adaptable.getPrimaryKeyValueFromRowNode(rowNode);
243
+ this.adaptableApi.internalApi.forAllVisibleRowNodesDo((rowNode) => {
244
+ const rowPrimaryKeyValue = this.adaptableApi.gridApi.getPrimaryKeyValueForRowNode(rowNode);
241
245
  const selectedRowCells = selectedCellsByPrimaryKey[rowPrimaryKeyValue];
242
246
  if (selectedRowCells) {
243
247
  const selectedRowColumnIds = selectedRowCells.map((rowCell) => rowCell.column.columnId);
244
248
  const selectedColumnIds = columnIds.filter((columnId) => selectedRowColumnIds.includes(columnId));
245
249
  const row = this.getRowObjectForColumnIds(rowNode, selectedColumnIds);
246
250
  if (includePrimaryKey) {
247
- row[this.adaptable.adaptableOptions.primaryKey] = rowPrimaryKeyValue;
251
+ row[this.adaptableApi.internalApi.getAdaptableOptions().primaryKey] =
252
+ rowPrimaryKeyValue;
248
253
  }
249
254
  data.rows.push(row);
250
255
  }
251
256
  });
252
257
  break;
253
258
  case Enums_1.ReportRowScope.SelectedRows:
254
- const selectedRowInfo = this.adaptable.api.gridApi.getSelectedRowInfo();
259
+ const selectedRowInfo = this.adaptableApi.gridApi.getSelectedRowInfo();
255
260
  const selectedGridRowPrimaryKeys = (_b = (_a = selectedRowInfo === null || selectedRowInfo === void 0 ? void 0 : selectedRowInfo.gridRows) === null || _a === void 0 ? void 0 : _a.filter((gr) => gr.rowInfo.isGroup == false).map((gridRow) => gridRow.primaryKeyValue)) !== null && _b !== void 0 ? _b : [];
256
261
  if (selectedGridRowPrimaryKeys.length) {
257
- this.adaptable.forAllRowNodesDo((rowNode) => {
258
- const rowPrimaryKeyValue = this.adaptable.getPrimaryKeyValueFromRowNode(rowNode);
262
+ this.adaptableApi.internalApi.forAllRowNodesDo((rowNode) => {
263
+ const rowPrimaryKeyValue = this.adaptableApi.gridApi.getPrimaryKeyValueForRowNode(rowNode);
259
264
  if (selectedGridRowPrimaryKeys.includes(rowPrimaryKeyValue)) {
260
265
  data.rows.push(this.getRowObjectForColumnIds(rowNode, columnIds));
261
266
  }
@@ -263,7 +268,7 @@ class ReportService {
263
268
  }
264
269
  break;
265
270
  case Enums_1.ReportRowScope.CustomRows:
266
- const reportData = this.adaptable.api.exportApi.runCustomReport(report.Name);
271
+ const reportData = this.adaptableApi.exportApi.runCustomReport(report.Name);
267
272
  return reportData;
268
273
  // break;
269
274
  }
@@ -287,21 +292,21 @@ class ReportService {
287
292
  }
288
293
  PublishLiveLiveDataChangedEvent(reportDestination, liveDataTrigger, liveReport) {
289
294
  const liveDataChangedInfo = {
290
- adaptableApi: this.adaptable.api,
295
+ adaptableApi: this.adaptableApi,
291
296
  reportDestination: reportDestination,
292
297
  liveDataTrigger: liveDataTrigger,
293
298
  liveReport: liveReport,
294
299
  };
295
- this.adaptable.api.eventApi.emit('LiveDataChanged', liveDataChangedInfo);
300
+ this.adaptableApi.eventApi.emit('LiveDataChanged', liveDataChangedInfo);
296
301
  }
297
302
  getCellExportValueFromRowNode(rowNode, columnId) {
298
- return this.getCellExportValueFromRawValue(this.adaptable.getRawValueFromRowNode(rowNode, columnId), columnId);
303
+ return this.getCellExportValueFromRawValue(this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, columnId), columnId);
299
304
  }
300
305
  getCellExportValueFromRawValue(cellRawValue, columnId) {
301
306
  if (StringExtensions_1.default.IsNullOrEmpty(cellRawValue)) {
302
307
  return cellRawValue;
303
308
  }
304
- const columnType = this.adaptable.api.columnApi.getColumnDataTypeFromColumnId(columnId);
309
+ const columnType = this.adaptableApi.columnApi.getColumnDataTypeFromColumnId(columnId);
305
310
  // if this is a date column and there is a custom export date format provided, that will take precedence
306
311
  if (columnType === 'Date' && !!this.getCustomExportDateFormat()) {
307
312
  const exportDateFormat = this.getCustomExportDateFormat();
@@ -315,7 +320,7 @@ class ReportService {
315
320
  }
316
321
  getReportFileName(reportName) {
317
322
  let fileName = StringExtensions_1.default.ReplaceEmptySpacesWithUnderscore(reportName);
318
- if (this.adaptable.adaptableOptions.exportOptions.appendFileTimestamp) {
323
+ if (this.adaptableApi.internalApi.getAdaptableOptions().exportOptions.appendFileTimestamp) {
319
324
  fileName = `${fileName}_${FormatHelper_1.DateFormatter(new Date(), {
320
325
  Pattern: 'yyyyMMdd_HHmmss',
321
326
  })}`;
@@ -326,7 +331,7 @@ class ReportService {
326
331
  // TO DO
327
332
  }
328
333
  getCustomExportDateFormat() {
329
- return this.adaptable.adaptableOptions.exportOptions.exportDateFormat;
334
+ return this.adaptableApi.internalApi.getAdaptableOptions().exportOptions.exportDateFormat;
330
335
  }
331
336
  getCellExportValueFromRawValueByType(cellRawValue, columnId,
332
337
  // default to rawValue if, for some reason, the configs provide invalid values
@@ -334,22 +339,23 @@ class ReportService {
334
339
  return type === 'rawValue'
335
340
  ? cellRawValue
336
341
  : // type === formattedValue
337
- this.adaptable.getDisplayValueFromRawValue(columnId, cellRawValue);
342
+ this.adaptableApi.gridApi.getFormattedValueFromRawValue(columnId, cellRawValue);
338
343
  }
339
344
  computeCellExportValueFormat(columnType) {
340
- if (this.adaptable.adaptableOptions.exportOptions.exportFormatType === 'rawValue' ||
341
- this.adaptable.adaptableOptions.exportOptions.exportFormatType === 'formattedValue') {
342
- return this.adaptable.adaptableOptions.exportOptions.exportFormatType;
345
+ const exportOptions = this.adaptableApi.internalApi.getAdaptableOptions().exportOptions;
346
+ if (exportOptions.exportFormatType === 'rawValue' ||
347
+ exportOptions.exportFormatType === 'formattedValue') {
348
+ return exportOptions.exportFormatType;
343
349
  }
344
350
  // format is customized based on column data type
345
351
  switch (columnType) {
346
352
  case 'String':
347
- return this.adaptable.adaptableOptions.exportOptions.exportFormatType.string;
353
+ return exportOptions.exportFormatType.string;
348
354
  case 'Number':
349
355
  case 'NumberArray':
350
- return this.adaptable.adaptableOptions.exportOptions.exportFormatType.number;
356
+ return exportOptions.exportFormatType.number;
351
357
  case 'Date':
352
- return this.adaptable.adaptableOptions.exportOptions.exportFormatType.date;
358
+ return exportOptions.exportFormatType.date;
353
359
  default:
354
360
  // default to rawValue for all other column types
355
361
  return 'rawValue';
@@ -1,13 +1,13 @@
1
1
  import { ITeamSharingService } from './Interface/ITeamSharingService';
2
- import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
3
2
  import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
4
3
  import { AdaptableObject } from '../../PredefinedConfig/Common/AdaptableObject';
5
4
  import { SharedEntity, SharedEntityConfig, SharedEntityActiveStatus, TeamSharingImportStep } from '../../PredefinedConfig/TeamSharingState';
6
5
  import { TypeUuid } from '../../PredefinedConfig/Uuid';
6
+ import { AdaptableApi } from '../../../types';
7
7
  export declare class TeamSharingService implements ITeamSharingService {
8
- private adaptable;
8
+ private adaptableApi;
9
9
  private updateCheckTimerId;
10
- constructor(adaptable: IAdaptable);
10
+ constructor(adaptableApi: AdaptableApi);
11
11
  buildSharedEntityWithDependencies(adaptableObject: AdaptableObject, module: AdaptableModule, configuration: SharedEntityConfig): SharedEntity[];
12
12
  getSharedEntityDependants(sharedEntityId: TypeUuid, sharedEntities: SharedEntity[]): SharedEntity[];
13
13
  updateActiveSharedEntity(changedAdaptableObject: AdaptableObject, userName: string, sharedEntities: SharedEntity[]): [SharedEntity[], SharedEntity[]];
@@ -3,18 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TeamSharingService = void 0;
4
4
  const Uuid_1 = require("../../PredefinedConfig/Uuid");
5
5
  class TeamSharingService {
6
- constructor(adaptable) {
7
- this.adaptable = adaptable;
8
- if (adaptable.adaptableOptions.teamSharingOptions.updateInterval > 0) {
6
+ constructor(adaptableApi) {
7
+ this.adaptableApi = adaptableApi;
8
+ const teamSharingOptions = adaptableApi.internalApi.getAdaptableOptions().teamSharingOptions;
9
+ if (teamSharingOptions.updateInterval > 0) {
9
10
  // convert minutes to millis
10
- const updateInterval = adaptable.adaptableOptions.teamSharingOptions.updateInterval * 60000;
11
+ const updateInterval = teamSharingOptions.updateInterval * 60000;
11
12
  this.updateCheckTimerId = setInterval(() => {
12
- this.adaptable.api.teamSharingApi.checkForUpdates();
13
+ this.adaptableApi.teamSharingApi.checkForUpdates();
13
14
  }, updateInterval);
14
15
  }
15
16
  }
16
17
  buildSharedEntityWithDependencies(adaptableObject, module, configuration) {
17
- const sharingUserName = this.adaptable.adaptableOptions.userName;
18
+ const sharingUserName = this.adaptableApi.internalApi.getAdaptableOptions().userName;
18
19
  const sharingTimestamp = new Date().getTime();
19
20
  const createdSharedEntities = [];
20
21
  this.createSharedEntity(adaptableObject, module, configuration, sharingUserName, sharingTimestamp, createdSharedEntities);
@@ -62,7 +63,9 @@ class TeamSharingService {
62
63
  // either ADD or EDIT(in which case the user will need to confirm the overwrite)
63
64
  const getSharedEntityImportAction = (sharedEntity) => {
64
65
  const { Module, Entity } = sharedEntity;
65
- const importInfo = this.adaptable.ModuleService.getTeamSharingAction(Module);
66
+ const importInfo = this.adaptableApi.internalApi
67
+ .getModuleService()
68
+ .getTeamSharingAction(Module);
66
69
  if (importInfo === null || importInfo === void 0 ? void 0 : importInfo.ModuleEntities.some((moduleEntity) => moduleEntity.Uuid === Entity.Uuid)) {
67
70
  configOverwriteNeedsConfirmation = true;
68
71
  return importInfo === null || importInfo === void 0 ? void 0 : importInfo.EditAction(Entity);
@@ -71,7 +74,7 @@ class TeamSharingService {
71
74
  return importInfo === null || importInfo === void 0 ? void 0 : importInfo.AddAction(Entity);
72
75
  }
73
76
  };
74
- const existingSharedEntities = this.adaptable.api.teamSharingApi.getSharedEntities();
77
+ const existingSharedEntities = this.adaptableApi.teamSharingApi.getSharedEntities();
75
78
  const sharedEntityDependencyTree = this.getSharedEntityDependencyTree(importedSharedEntity, existingSharedEntities);
76
79
  const importSteps = sharedEntityDependencyTree.map((sharedEntity) => ({
77
80
  sharedEntity,
@@ -81,13 +84,13 @@ class TeamSharingService {
81
84
  }
82
85
  getSharedEntityLocalAndRemoteRevisions(changedAdaptableObjectId, remoteSharedEntities) {
83
86
  var _a, _b, _c, _d;
84
- const localRevision = (_b = (_a = this.adaptable.api.teamSharingApi.getTeamSharingState().ActiveSharedEntityMap[changedAdaptableObjectId]) === null || _a === void 0 ? void 0 : _a.Revision) !== null && _b !== void 0 ? _b : -1;
87
+ const localRevision = (_b = (_a = this.adaptableApi.teamSharingApi.getTeamSharingState().ActiveSharedEntityMap[changedAdaptableObjectId]) === null || _a === void 0 ? void 0 : _a.Revision) !== null && _b !== void 0 ? _b : -1;
85
88
  const remoteRevision = (_d = (_c = remoteSharedEntities.find((sharedEntity) => sharedEntity.Entity.Uuid === changedAdaptableObjectId)) === null || _c === void 0 ? void 0 : _c.Revision) !== null && _d !== void 0 ? _d : -1;
86
89
  return [localRevision, remoteRevision];
87
90
  }
88
91
  getStaleActiveSharedEntities() {
89
- const sharedEntities = this.adaptable.api.teamSharingApi.getSharedEntities();
90
- const activeEntities = this.adaptable.api.teamSharingApi.getTeamSharingState().ActiveSharedEntityMap;
92
+ const sharedEntities = this.adaptableApi.teamSharingApi.getSharedEntities();
93
+ const activeEntities = this.adaptableApi.teamSharingApi.getTeamSharingState().ActiveSharedEntityMap;
91
94
  const result = {};
92
95
  sharedEntities
93
96
  .filter((sharedEntity) => sharedEntity.Type === 'Active')
@@ -105,21 +108,21 @@ class TeamSharingService {
105
108
  return result;
106
109
  }
107
110
  showUpdateNotifications() {
108
- const { updateNotification } = this.adaptable.adaptableOptions.teamSharingOptions;
111
+ const { updateNotification } = this.adaptableApi.internalApi.getAdaptableOptions().teamSharingOptions;
109
112
  if (!updateNotification) {
110
113
  return;
111
114
  }
112
115
  Object.values(this.getStaleActiveSharedEntities()).forEach((sharedEntityActiveInfo) => {
113
116
  const notificationMessage = `Active share ${sharedEntityActiveInfo.sharedEntity.Module} has a new Revision: ${sharedEntityActiveInfo.sharedEntity.Revision}`;
114
117
  if (updateNotification === 'Alert' || updateNotification === 'AlertWithNotification') {
115
- this.adaptable.api.alertApi.showAlert('TeamSharing', notificationMessage, 'Info', {
118
+ this.adaptableApi.alertApi.showAlert('TeamSharing', notificationMessage, 'Info', {
116
119
  DisplayNotification: updateNotification === 'AlertWithNotification',
117
120
  });
118
121
  }
119
122
  if (updateNotification === 'SystemStatus') {
120
- this.adaptable.api.systemStatusApi.setInfoSystemStatus(`TeamSharing: ${notificationMessage}`);
123
+ this.adaptableApi.systemStatusApi.setInfoSystemStatus(`TeamSharing: ${notificationMessage}`);
121
124
  }
122
- this.adaptable.api.teamSharingApi.fireTeamSharingEntityChangedEvent(sharedEntityActiveInfo.sharedEntity);
125
+ this.adaptableApi.teamSharingApi.fireTeamSharingEntityChangedEvent(sharedEntityActiveInfo.sharedEntity);
123
126
  });
124
127
  }
125
128
  destroy() {
@@ -174,7 +177,7 @@ class TeamSharingService {
174
177
  return Array.from(result.values());
175
178
  }
176
179
  getTeamSharingReferences(adaptableObject, module) {
177
- return this.adaptable.api.internalApi
180
+ return this.adaptableApi.internalApi
178
181
  .getModuleService()
179
182
  .getModuleById(module)
180
183
  .getTeamSharingReferences(adaptableObject);
@@ -1,10 +1,10 @@
1
- import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
2
1
  import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
3
2
  import { IValidationService } from './Interface/IValidationService';
4
3
  import { AlertDefinition } from '../../PredefinedConfig/AlertState';
4
+ import { AdaptableApi } from '../../../types';
5
5
  export declare class ValidationService implements IValidationService {
6
- private adaptable;
7
- constructor(adaptable: IAdaptable);
6
+ private adaptableApi;
7
+ constructor(adaptableApi: AdaptableApi);
8
8
  getValidationRulesForDataChange(cellDataChangedInfo: CellDataChangedInfo): AlertDefinition[];
9
9
  performValidation(cellDataChangedInfo: CellDataChangedInfo): boolean;
10
10
  private IsAlertDefinitionTriggered;
@@ -6,9 +6,9 @@ const ArrayExtensions_1 = require("../Extensions/ArrayExtensions");
6
6
  const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/StringExtensions"));
7
7
  const ModuleConstants_1 = require("../Constants/ModuleConstants");
8
8
  class ValidationService {
9
- constructor(adaptable) {
10
- this.adaptable = adaptable;
11
- this.adaptable = adaptable;
9
+ constructor(adaptableApi) {
10
+ this.adaptableApi = adaptableApi;
11
+ this.adaptableApi = adaptableApi;
12
12
  }
13
13
  // Not sure where to put this: was in the Module but might be better here until I can work out a way of having an event with a callback...
14
14
  getValidationRulesForDataChange(cellDataChangedInfo) {
@@ -16,15 +16,15 @@ class ValidationService {
16
16
  if (cellDataChangedInfo.oldValue == cellDataChangedInfo.newValue) {
17
17
  return [];
18
18
  }
19
- let editingRules = this.adaptable.api.alertApi
19
+ let editingRules = this.adaptableApi.alertApi
20
20
  .getAlertDefinitionsWithPreventEdit()
21
- .filter((v) => this.adaptable.api.scopeApi.isColumnInScope(cellDataChangedInfo.column, v.Scope));
21
+ .filter((v) => this.adaptableApi.scopeApi.isColumnInScope(cellDataChangedInfo.column, v.Scope));
22
22
  let failedValidations = [];
23
23
  if (ArrayExtensions_1.ArrayExtensions.IsNotEmpty(editingRules)) {
24
24
  editingRules.forEach((alertDefinition) => {
25
25
  if (alertDefinition.Rule.BooleanExpression) {
26
26
  let isSatisfiedExpression = cellDataChangedInfo.rowNode != null &&
27
- this.adaptable.api.internalApi
27
+ this.adaptableApi.internalApi
28
28
  .getQueryLanguageService()
29
29
  .evaluateBooleanExpression(alertDefinition.Rule.BooleanExpression, ModuleConstants_1.AlertModuleId, cellDataChangedInfo.rowNode);
30
30
  if (isSatisfiedExpression) {
@@ -50,24 +50,25 @@ class ValidationService {
50
50
  alertDefinition: failedRules[0],
51
51
  cellDataChangedInfo: cellDataChangedInfo,
52
52
  };
53
- this.adaptable.api.alertApi.publishAlertFiredEvent(alert);
53
+ this.adaptableApi.alertApi.publishAlertFiredEvent(alert);
54
54
  return false;
55
55
  }
56
56
  return true;
57
57
  }
58
58
  IsAlertDefinitionTriggered(alertDefinition, dataChangedEvent) {
59
- return this.adaptable.api.predicateApi.handlePredicate(alertDefinition.Rule.Predicate, {
59
+ return this.adaptableApi.predicateApi.handlePredicate(alertDefinition.Rule.Predicate, {
60
60
  value: dataChangedEvent.newValue,
61
61
  oldValue: dataChangedEvent.oldValue,
62
- displayValue: this.adaptable.getDisplayValueFromRowNode(dataChangedEvent.rowNode, dataChangedEvent.column.columnId),
62
+ displayValue: this.adaptableApi.gridApi.getDisplayValueFromRowNode(dataChangedEvent.rowNode, dataChangedEvent.column.columnId),
63
63
  node: dataChangedEvent.rowNode,
64
64
  column: dataChangedEvent.column,
65
65
  }, false);
66
66
  }
67
67
  performServerValidation(cellDataChangedInfo, config) {
68
68
  return () => {
69
- this.adaptable.adaptableOptions.editOptions
70
- .validateOnServer(cellDataChangedInfo)
69
+ this.adaptableApi.internalApi
70
+ .getAdaptableOptions()
71
+ .editOptions.validateOnServer(cellDataChangedInfo)
71
72
  .then((validationResult) => {
72
73
  var _a, _b;
73
74
  if (validationResult.NewValue === undefined) {
@@ -82,11 +83,12 @@ class ValidationService {
82
83
  if (!row) {
83
84
  return;
84
85
  }
85
- row[(_b = this.adaptable.api.columnApi.getAgGridColumnFieldForAdaptableColumn(cellDataChangedInfo.column.columnId)) !== null && _b !== void 0 ? _b : cellDataChangedInfo.column.columnId] = validationResult.NewValue;
86
- this.adaptable.api.gridApi.updateGridData([row]);
86
+ row[(_b = this.adaptableApi.columnApi.getAgGridColumnFieldForAdaptableColumn(cellDataChangedInfo.column.columnId)) !== null && _b !== void 0 ? _b : cellDataChangedInfo.column.columnId] = validationResult.NewValue;
87
+ this.adaptableApi.gridApi.updateGridData([row]);
87
88
  if (StringExtensions_1.default.IsNotNullOrEmpty(validationResult.ValidationMessage) &&
88
- this.adaptable.adaptableOptions.editOptions.displayServerValidationMessages) {
89
- this.adaptable.api.alertApi.showAlertInfo('Server Validation Message', validationResult.ValidationMessage);
89
+ this.adaptableApi.internalApi.getAdaptableOptions().editOptions
90
+ .displayServerValidationMessages) {
91
+ this.adaptableApi.alertApi.showAlertInfo('Server Validation Message', validationResult.ValidationMessage);
90
92
  }
91
93
  }
92
94
  config.onServerValidationCompleted();
@@ -95,9 +97,9 @@ class ValidationService {
95
97
  };
96
98
  }
97
99
  createValidationDescription(alertDefinition) {
98
- return (this.adaptable.api.scopeApi.getScopeDescription(alertDefinition.Scope) +
100
+ return (this.adaptableApi.scopeApi.getScopeDescription(alertDefinition.Scope) +
99
101
  ' ' +
100
- this.adaptable.api.predicateApi.predicateToString(alertDefinition.Rule.Predicate));
102
+ this.adaptableApi.predicateApi.predicateToString(alertDefinition.Rule.Predicate));
101
103
  }
102
104
  createValidationMessage(alertDefinition) {
103
105
  let returnMessage = this.createValidationDescription(alertDefinition);