@adaptabletools/adaptable 14.0.0-canary.1 → 14.0.0-canary.3

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 (93) hide show
  1. package/bundle.cjs.js +149 -149
  2. package/package.json +1 -1
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/Api/AdaptableApi.d.ts +17 -9
  6. package/src/Api/ColumnApi.d.ts +2 -10
  7. package/src/Api/ConfigApi.d.ts +1 -5
  8. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -1
  9. package/src/Api/Implementation/AdaptableApiImpl.js +3 -0
  10. package/src/Api/Implementation/ApiBase.d.ts +6 -1
  11. package/src/Api/Implementation/ApiBase.js +15 -0
  12. package/src/Api/Implementation/ColumnApiImpl.d.ts +0 -2
  13. package/src/Api/Implementation/ColumnApiImpl.js +0 -8
  14. package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -1
  15. package/src/Api/Implementation/ConfigApiImpl.js +3 -0
  16. package/src/Api/Implementation/OptionsApiImpl.d.ts +36 -0
  17. package/src/Api/Implementation/OptionsApiImpl.js +100 -0
  18. package/src/Api/Internal/AdaptableInternalApi.d.ts +7 -1
  19. package/src/Api/Internal/AdaptableInternalApi.js +8 -1
  20. package/src/Api/Internal/ExportInternalApi.d.ts +8 -0
  21. package/src/Api/Internal/ExportInternalApi.js +51 -0
  22. package/src/Api/Internal/FormatColumnInternalApi.d.ts +11 -0
  23. package/src/Api/Internal/FormatColumnInternalApi.js +10 -0
  24. package/src/Api/OptionsApi.d.ts +131 -0
  25. package/src/Api/OptionsApi.js +2 -0
  26. package/src/PredefinedConfig/Common/FDC3Context.d.ts +4 -0
  27. package/src/PredefinedConfig/SystemState.d.ts +3 -0
  28. package/src/Redux/ActionsReducers/SystemRedux.d.ts +8 -0
  29. package/src/Redux/ActionsReducers/SystemRedux.js +26 -2
  30. package/src/Redux/Store/AdaptableStore.js +6 -0
  31. package/src/Strategy/AdaptableModuleBase.js +1 -1
  32. package/src/Strategy/AlertModule.js +1 -2
  33. package/src/Strategy/DashboardModule.js +1 -1
  34. package/src/Strategy/DataChangeHistoryModule.js +2 -4
  35. package/src/Strategy/DataSetModule.js +1 -1
  36. package/src/Strategy/ExportModule.js +8 -1
  37. package/src/Strategy/FilterModule.js +1 -1
  38. package/src/Strategy/FlashingCellModule.js +1 -2
  39. package/src/Strategy/FreeTextColumnModule.js +1 -2
  40. package/src/Strategy/LayoutModule.js +6 -6
  41. package/src/Strategy/SettingsPanelModule.js +1 -1
  42. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -2
  43. package/src/Utilities/Services/CalculatedColumnExpressionService.js +2 -4
  44. package/src/Utilities/Services/ChartingService.js +1 -1
  45. package/src/Utilities/Services/EntitlementService.js +4 -4
  46. package/src/Utilities/Services/Interface/IReportService.d.ts +7 -1
  47. package/src/Utilities/Services/QueryLanguageService.js +3 -3
  48. package/src/Utilities/Services/ReportService.d.ts +10 -2
  49. package/src/Utilities/Services/ReportService.js +40 -31
  50. package/src/Utilities/Services/TeamSharingService.js +3 -3
  51. package/src/Utilities/Services/ValidationService.js +6 -6
  52. package/src/View/AdaptableView.js +1 -1
  53. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +11 -2
  54. package/src/View/Alert/Wizard/isValidAlertRules.js +6 -27
  55. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -1
  56. package/src/View/Components/EntityRulesEditor/Utilities.d.ts +2 -2
  57. package/src/View/Components/EntityRulesEditor/Utilities.js +19 -12
  58. package/src/View/Components/FilterForm/FilterForm.js +6 -7
  59. package/src/View/Components/FilterForm/QuickFilterForm.js +7 -9
  60. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +1 -1
  61. package/src/View/Components/Popups/AdaptablePopup/TopBar.js +1 -1
  62. package/src/View/Components/Popups/AdaptableToaster.js +1 -1
  63. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
  64. package/src/View/Components/ToolPanel/ToolPanelPopup.js +1 -2
  65. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +1 -2
  66. package/src/View/Dashboard/Dashboard.js +5 -5
  67. package/src/View/Dashboard/DashboardPopup.js +2 -3
  68. package/src/View/Dashboard/DashboardViewPanel.js +1 -1
  69. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
  70. package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +1 -2
  71. package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.js +1 -1
  72. package/src/View/Filter/FilterViewPanel.js +3 -3
  73. package/src/View/FlashingCell/Wizard/isValidFlashingCellRules.js +5 -14
  74. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +4 -2
  75. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +4 -1
  76. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
  77. package/src/View/GridInfo/GridInfoPopup.js +1 -1
  78. package/src/View/Layout/PivotDetailsPopoup.js +3 -3
  79. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -2
  80. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +9 -3
  81. package/src/View/QuickSearch/QuickSearchPopup.js +3 -3
  82. package/src/View/QuickSearch/QuickSearchStatusBarContent.js +1 -1
  83. package/src/View/QuickSearch/QuickSearchViewPanel.js +1 -1
  84. package/src/View/SpecialColumnSettingsWizardStep.js +2 -3
  85. package/src/agGrid/Adaptable.d.ts +1 -1
  86. package/src/agGrid/Adaptable.js +119 -38
  87. package/src/agGrid/PercentBarRenderer.js +1 -1
  88. package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
  89. package/src/metamodel/adaptable.metamodel.d.ts +18 -0
  90. package/src/metamodel/adaptable.metamodel.js +1 -1
  91. package/src/types.d.ts +1 -0
  92. package/version.d.ts +1 -1
  93. package/version.js +1 -1
@@ -4,22 +4,51 @@ exports.ReportService = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const groupBy_1 = tslib_1.__importDefault(require("lodash/groupBy"));
6
6
  const Enums_1 = require("../../PredefinedConfig/Common/Enums");
7
- const Uuid_1 = require("../../PredefinedConfig/Uuid");
8
7
  const GeneralConstants_1 = require("../Constants/GeneralConstants");
9
8
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../Extensions/ArrayExtensions"));
10
9
  const FormatHelper_1 = tslib_1.__importStar(require("../Helpers/FormatHelper"));
11
10
  const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/StringExtensions"));
12
11
  const ModuleConstants_1 = require("../Constants/ModuleConstants");
12
+ const uuid_1 = require("../../components/utils/uuid");
13
13
  class ReportService {
14
14
  constructor(adaptableApi) {
15
15
  this.adaptableApi = adaptableApi;
16
+ this.excelStylesCache = {};
17
+ this.cellClassKey2excelStyleIdMap = {};
18
+ this.excelStylesWithFormattedDate = {};
16
19
  this.adaptableApi = adaptableApi;
17
20
  }
21
+ resetExcelStyleMemoization() {
22
+ this.excelStylesCache = {};
23
+ this.cellClassKey2excelStyleIdMap = {};
24
+ this.excelStylesWithFormattedDate = {};
25
+ }
26
+ registerExcelStyle(excelStyle, cellClassKey) {
27
+ const excelStyleKey = JSON.stringify(excelStyle);
28
+ if (!this.excelStylesCache[excelStyleKey]) {
29
+ const excelStyleId = (0, uuid_1.createUuid)();
30
+ const excelStyleWithId = Object.assign(Object.assign({}, excelStyle), { id: excelStyleId });
31
+ this.excelStylesCache[excelStyleKey] = excelStyleWithId;
32
+ }
33
+ this.cellClassKey2excelStyleIdMap[cellClassKey] = this.excelStylesCache[excelStyleKey].id;
34
+ }
35
+ getRegisteredExcelStyles() {
36
+ return Object.values(this.excelStylesCache);
37
+ }
38
+ getExcelStyleIdForCellClassKey(cellClassKey) {
39
+ return this.cellClassKey2excelStyleIdMap[cellClassKey];
40
+ }
41
+ registerExcelStyleWithFormattedDate(cellClassId, isoFormattedValue) {
42
+ this.excelStylesWithFormattedDate[cellClassId] = isoFormattedValue;
43
+ }
44
+ getExcelStyleWithFormattedDate(cellClassId) {
45
+ return this.excelStylesWithFormattedDate[cellClassId];
46
+ }
18
47
  CreateSystemReport(systemReportName) {
19
48
  switch (systemReportName) {
20
49
  case GeneralConstants_1.VISUAL_DATA_REPORT:
21
50
  return {
22
- Uuid: (0, Uuid_1.createUuid)(),
51
+ Uuid: (0, uuid_1.createUuid)(),
23
52
  Name: GeneralConstants_1.VISUAL_DATA_REPORT,
24
53
  ReportColumnScope: 'VisibleColumns',
25
54
  ReportRowScope: 'VisibleRows',
@@ -28,7 +57,7 @@ class ReportService {
28
57
  };
29
58
  case GeneralConstants_1.ALL_DATA_REPORT:
30
59
  return {
31
- Uuid: (0, Uuid_1.createUuid)(),
60
+ Uuid: (0, uuid_1.createUuid)(),
32
61
  Name: GeneralConstants_1.ALL_DATA_REPORT,
33
62
  ReportColumnScope: 'AllColumns',
34
63
  ReportRowScope: 'AllRows',
@@ -37,7 +66,7 @@ class ReportService {
37
66
  };
38
67
  case GeneralConstants_1.CURRENT_DATA_REPORT:
39
68
  return {
40
- Uuid: (0, Uuid_1.createUuid)(),
69
+ Uuid: (0, uuid_1.createUuid)(),
41
70
  Name: GeneralConstants_1.CURRENT_DATA_REPORT,
42
71
  ReportColumnScope: 'VisibleColumns',
43
72
  ReportRowScope: 'VisibleRows',
@@ -46,7 +75,7 @@ class ReportService {
46
75
  };
47
76
  case GeneralConstants_1.SELECTED_CELLS_REPORT:
48
77
  return {
49
- Uuid: (0, Uuid_1.createUuid)(),
78
+ Uuid: (0, uuid_1.createUuid)(),
50
79
  Name: GeneralConstants_1.SELECTED_CELLS_REPORT,
51
80
  ReportColumnScope: 'SelectedColumns',
52
81
  ReportRowScope: 'SelectedCellRows',
@@ -55,7 +84,7 @@ class ReportService {
55
84
  };
56
85
  case GeneralConstants_1.SELECTED_ROWS_REPORT:
57
86
  return {
58
- Uuid: (0, Uuid_1.createUuid)(),
87
+ Uuid: (0, uuid_1.createUuid)(),
59
88
  Name: GeneralConstants_1.SELECTED_ROWS_REPORT,
60
89
  ReportColumnScope: 'VisibleColumns',
61
90
  ReportRowScope: 'SelectedRows',
@@ -188,7 +217,7 @@ class ReportService {
188
217
  break;
189
218
  }
190
219
  if (includePrimaryKey) {
191
- const pkColumn = reportColumns.find((column) => column.columnId === this.adaptableApi.internalApi.getAdaptableOptions().primaryKey);
220
+ const pkColumn = reportColumns.find((column) => column.columnId === this.adaptableApi.optionsApi.getPrimaryKey());
192
221
  // TODO simplify after we fix the IsPrimaryKey bug
193
222
  // const pkColumn = reportColumns.find(column => column.IsPrimaryKey);
194
223
  if (!pkColumn && !!this.adaptableApi.columnApi.getPrimaryKeyColumn()) {
@@ -252,8 +281,7 @@ class ReportService {
252
281
  const selectedColumnIds = columnIds.filter((columnId) => selectedRowColumnIds.includes(columnId));
253
282
  const row = this.getRowObjectForColumnIds(rowNode, selectedColumnIds);
254
283
  if (includePrimaryKey) {
255
- row[this.adaptableApi.internalApi.getAdaptableOptions().primaryKey] =
256
- rowPrimaryKeyValue;
284
+ row[this.adaptableApi.optionsApi.getPrimaryKey()] = rowPrimaryKeyValue;
257
285
  }
258
286
  data.rows.push(row);
259
287
  }
@@ -315,12 +343,12 @@ class ReportService {
315
343
  });
316
344
  }
317
345
  // otherwise check the general export format types
318
- let cellExportFormat = this.computeCellExportValueFormat(columnType);
346
+ let cellExportFormat = this.adaptableApi.exportApi.internalApi.getCellExportFormatType(columnType);
319
347
  return this.getCellExportValueFromRawValueByType(rowNode, cellRawValue, columnId, cellExportFormat);
320
348
  }
321
349
  getReportFileName(reportName) {
322
350
  let fileName = StringExtensions_1.default.ReplaceEmptySpacesWithUnderscore(reportName);
323
- if (this.adaptableApi.internalApi.getAdaptableOptions().exportOptions.appendFileTimestamp) {
351
+ if (this.adaptableApi.optionsApi.getExportOptions().appendFileTimestamp) {
324
352
  fileName = `${fileName}_${(0, FormatHelper_1.DateFormatter)(new Date(), {
325
353
  Pattern: 'yyyyMMdd_HHmmss',
326
354
  })}`;
@@ -331,7 +359,7 @@ class ReportService {
331
359
  // TO DO
332
360
  }
333
361
  getCustomExportDateFormat() {
334
- return this.adaptableApi.internalApi.getAdaptableOptions().exportOptions.exportDateFormat;
362
+ return this.adaptableApi.optionsApi.getExportOptions().exportDateFormat;
335
363
  }
336
364
  getCellExportValueFromRawValueByType(rowNode, cellRawValue, columnId,
337
365
  // default to rawValue if, for some reason, the configs provide invalid values
@@ -341,24 +369,5 @@ class ReportService {
341
369
  : // type === formattedValue
342
370
  this.adaptableApi.gridApi.getDisplayValueFromRawValue(rowNode, columnId, cellRawValue);
343
371
  }
344
- computeCellExportValueFormat(columnDataType) {
345
- const exportOptions = this.adaptableApi.internalApi.getAdaptableOptions().exportOptions;
346
- if (exportOptions.exportFormatType === 'rawValue' ||
347
- exportOptions.exportFormatType === 'formattedValue') {
348
- return exportOptions.exportFormatType;
349
- }
350
- // format is customized based on column data type
351
- switch (columnDataType) {
352
- case 'String':
353
- return exportOptions.exportFormatType.string;
354
- case 'Number':
355
- return exportOptions.exportFormatType.number;
356
- case 'Date':
357
- return exportOptions.exportFormatType.date;
358
- default:
359
- // default to rawValue for all other column types
360
- return 'rawValue';
361
- }
362
- }
363
372
  }
364
373
  exports.ReportService = ReportService;
@@ -5,7 +5,7 @@ const Uuid_1 = require("../../PredefinedConfig/Uuid");
5
5
  class TeamSharingService {
6
6
  constructor(adaptableApi) {
7
7
  this.adaptableApi = adaptableApi;
8
- const teamSharingOptions = adaptableApi.internalApi.getAdaptableOptions().teamSharingOptions;
8
+ const teamSharingOptions = adaptableApi.optionsApi.getTeamSharingOptions();
9
9
  if (teamSharingOptions.updateInterval > 0) {
10
10
  // convert minutes to millis
11
11
  const updateInterval = teamSharingOptions.updateInterval * 60000;
@@ -15,7 +15,7 @@ class TeamSharingService {
15
15
  }
16
16
  }
17
17
  buildSharedEntityWithDependencies(adaptableObject, module, configuration) {
18
- const sharingUserName = this.adaptableApi.internalApi.getAdaptableOptions().userName;
18
+ const sharingUserName = this.adaptableApi.optionsApi.getUserName();
19
19
  const sharingTimestamp = new Date().getTime();
20
20
  const createdSharedEntities = [];
21
21
  this.createSharedEntity(adaptableObject, module, configuration, sharingUserName, sharingTimestamp, createdSharedEntities);
@@ -108,7 +108,7 @@ class TeamSharingService {
108
108
  return result;
109
109
  }
110
110
  showUpdateNotifications() {
111
- const { updateNotification } = this.adaptableApi.internalApi.getAdaptableOptions().teamSharingOptions;
111
+ const { updateNotification } = this.adaptableApi.optionsApi.getTeamSharingOptions();
112
112
  if (!updateNotification) {
113
113
  return;
114
114
  }
@@ -62,19 +62,20 @@ class ValidationService {
62
62
  }
63
63
  IsAlertDefinitionTriggered(alertDefinition, dataChangedEvent) {
64
64
  var _a;
65
+ const displayValue = this.adaptableApi.gridApi.getDisplayValueFromRowNode(dataChangedEvent.rowNode, dataChangedEvent.column.columnId);
65
66
  return this.adaptableApi.predicateApi.handlePredicates((_a = alertDefinition.Rule) === null || _a === void 0 ? void 0 : _a.Predicates, {
66
67
  value: dataChangedEvent.newValue,
67
68
  oldValue: dataChangedEvent.oldValue,
68
- displayValue: this.adaptableApi.gridApi.getDisplayValueFromRowNode(dataChangedEvent.rowNode, dataChangedEvent.column.columnId),
69
+ displayValue,
69
70
  node: dataChangedEvent.rowNode,
70
71
  column: dataChangedEvent.column,
71
72
  }, false);
72
73
  }
73
74
  performServerValidation(cellDataChangedInfo, config) {
74
75
  return () => {
75
- this.adaptableApi.internalApi
76
- .getAdaptableOptions()
77
- .editOptions.validateOnServer(cellDataChangedInfo)
76
+ this.adaptableApi.optionsApi
77
+ .getEditOptions()
78
+ .validateOnServer(cellDataChangedInfo)
78
79
  .then((validationResult) => {
79
80
  var _a, _b;
80
81
  if (validationResult.NewValue === undefined) {
@@ -92,8 +93,7 @@ class ValidationService {
92
93
  row[(_b = this.adaptableApi.columnApi.internalApi.getAgGridColumnFieldForAdaptableColumn(cellDataChangedInfo.column.columnId)) !== null && _b !== void 0 ? _b : cellDataChangedInfo.column.columnId] = validationResult.NewValue;
93
94
  this.adaptableApi.gridApi.updateGridData([row]);
94
95
  if (StringExtensions_1.default.IsNotNullOrEmpty(validationResult.ValidationMessage) &&
95
- this.adaptableApi.internalApi.getAdaptableOptions().editOptions
96
- .displayServerValidationMessages) {
96
+ this.adaptableApi.optionsApi.getEditOptions().displayServerValidationMessages) {
97
97
  this.adaptableApi.alertApi.showAlertInfo('Server Validation Message', validationResult.ValidationMessage);
98
98
  }
99
99
  }
@@ -20,7 +20,7 @@ class AdaptableView extends React.Component {
20
20
  render() {
21
21
  var _a, _b, _c, _d;
22
22
  const watermark = (_d = (_c = (_b = (_a = this.props.AdaptableApi) === null || _a === void 0 ? void 0 : _a.internalApi) === null || _b === void 0 ? void 0 : _b.getSystemState()) === null || _c === void 0 ? void 0 : _c.License) === null || _d === void 0 ? void 0 : _d.watermark;
23
- const adaptableOptions = this.props.AdaptableApi.internalApi.getAdaptableOptions();
23
+ const adaptableOptions = this.props.AdaptableApi.optionsApi.getAdaptableOptions();
24
24
  return (React.createElement("div", null,
25
25
  this.props.AdaptableApi.internalApi.getModuleService().isModuleAvailable('Dashboard') && (React.createElement(Dashboard_1.Dashboard, { api: this.props.AdaptableApi })),
26
26
  React.createElement(AdaptableLoadingScreen_1.AdaptableLoadingScreen, { onClose: this.props.onCloseLoadingPopup, showLoadingScreen: this.props.PopupState.LoadingPopup.ShowLoadingPopup }),
@@ -173,6 +173,7 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
173
173
  header: () => React.createElement(HeaderCellWrapper, null, "Primary Key"),
174
174
  maxWidth: 80,
175
175
  sortable: false,
176
+ renderMenuIcon: false,
176
177
  render: (params) => {
177
178
  const { data } = params;
178
179
  const column = data;
@@ -187,6 +188,7 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
187
188
  included: {
188
189
  maxWidth: 80,
189
190
  resizable: true,
191
+ renderMenuIcon: false,
190
192
  header: () => (React.createElement(HeaderWithCheckbox, { label: "Included", checked: allIncluded ? true : allExcluded ? false : null, onChange: (allIncluded) => {
191
193
  if (allIncluded) {
192
194
  includeAllColumns();
@@ -212,6 +214,7 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
212
214
  header: React.createElement(HeaderCellWrapper, null, "Field"),
213
215
  field: 'field',
214
216
  minWidth: 150,
217
+ renderMenuIcon: false,
215
218
  render: (params) => {
216
219
  const column = params.data;
217
220
  const humanized = StringExtensions_1.default.Humanize(column.field);
@@ -224,6 +227,7 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
224
227
  type: {
225
228
  header: React.createElement(HeaderCellWrapper, null, "Type"),
226
229
  maxWidth: 140,
230
+ renderMenuIcon: false,
227
231
  render: (params) => {
228
232
  var _a;
229
233
  const column = params.data;
@@ -232,6 +236,7 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
232
236
  },
233
237
  },
234
238
  sortable: {
239
+ renderMenuIcon: false,
235
240
  header: (React.createElement(HeaderWithCheckbox, { label: "Sortable", checked: isAllSortableColumns() ? true : isNoneSortableColumns() ? false : null, onChange: (allSortable) => {
236
241
  if (allSortable) {
237
242
  setAllSortable();
@@ -248,6 +253,7 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
248
253
  },
249
254
  },
250
255
  editable: {
256
+ renderMenuIcon: false,
251
257
  header: (React.createElement(HeaderWithCheckbox, { label: "Editable", checked: isAllEditableColumns() ? true : isNoneEditableColumns() ? false : null, onChange: (allEditable) => {
252
258
  if (allEditable) {
253
259
  setAllEditable();
@@ -265,6 +271,7 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
265
271
  },
266
272
  },
267
273
  resizable: {
274
+ renderMenuIcon: false,
268
275
  header: (React.createElement(HeaderWithCheckbox, { label: "Resizable", checked: isAllResizableColumns() ? true : isNoneResizableColumns() ? false : null, onChange: (allResizable) => {
269
276
  if (allResizable) {
270
277
  setAllResizable();
@@ -282,6 +289,7 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
282
289
  },
283
290
  },
284
291
  groupable: {
292
+ renderMenuIcon: false,
285
293
  header: (React.createElement(HeaderWithCheckbox, { label: "Groupable", checked: isAllGroupableColumns() ? true : isNoneGroupableColumns() ? false : null, onChange: (allGroupable) => {
286
294
  if (allGroupable) {
287
295
  setAllGroupable();
@@ -298,8 +306,9 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
298
306
  } })));
299
307
  },
300
308
  },
301
- filtrable: {
302
- header: (React.createElement(HeaderWithCheckbox, { label: "Filtrable", checked: isAllFilterableColumns() ? true : isNoneFilterableColumns() ? false : null, onChange: (allFilterable) => {
309
+ filterable: {
310
+ renderMenuIcon: false,
311
+ header: (React.createElement(HeaderWithCheckbox, { label: "Filterable", checked: isAllFilterableColumns() ? true : isNoneFilterableColumns() ? false : null, onChange: (allFilterable) => {
303
312
  if (allFilterable) {
304
313
  setAllFilterable();
305
314
  }
@@ -1,27 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isValidAlertRules = void 0;
4
- const ModuleConstants_1 = require("../../../Utilities/Constants/ModuleConstants");
4
+ const Utilities_1 = require("../../Components/EntityRulesEditor/Utilities");
5
5
  const isValidAlertRules = (alert, api, context) => {
6
6
  var _a;
7
- let valid = true;
8
- if (!alert.Rule.Predicates &&
7
+ if (!((_a = alert.Rule.Predicates) === null || _a === void 0 ? void 0 : _a.length) &&
9
8
  !alert.Rule.BooleanExpression &&
10
9
  !alert.Rule.ObservableExpression &&
11
10
  !alert.Rule.AggregatedBooleanExpression) {
12
- return 'No condition defined for alert';
11
+ return 'No Rule defined for Alert';
13
12
  }
14
- if (valid && alert.Rule.Predicates) {
15
- valid = api.predicateApi.isEveryPredicateValid((_a = alert.Rule) === null || _a === void 0 ? void 0 : _a.Predicates);
16
- if (!valid) {
17
- return 'Predicate is not valid';
18
- }
19
- }
20
- if (valid && alert.Rule.BooleanExpression) {
21
- valid = api.queryLanguageApi.isValidBooleanExpression(alert.Rule.BooleanExpression, ModuleConstants_1.AlertModuleId);
22
- if (!valid) {
23
- return 'The Expression is not a valid Boolean Expression';
24
- }
13
+ const isRuleValid = (0, Utilities_1.isAdaptableRuleValid)(alert, api, context);
14
+ if (typeof isRuleValid === 'string') {
15
+ return isRuleValid;
25
16
  }
26
17
  // boolean expressions may also be saved as named queries
27
18
  if (context.namedQuery != false) {
@@ -30,18 +21,6 @@ const isValidAlertRules = (alert, api, context) => {
30
21
  return isValidName.message;
31
22
  }
32
23
  }
33
- if (valid && alert.Rule.ObservableExpression) {
34
- valid = api.queryLanguageApi.isValidObservableExpression(alert.Rule.ObservableExpression, ModuleConstants_1.AlertModuleId);
35
- if (!valid) {
36
- return 'The Expression is not a valid Observable Expression';
37
- }
38
- }
39
- if (valid && alert.Rule.AggregatedBooleanExpression) {
40
- valid = api.queryLanguageApi.isValidAggregatedBooleanExpression(alert.Rule.AggregatedBooleanExpression, ModuleConstants_1.AlertModuleId);
41
- if (!valid) {
42
- return 'The Expression is not a valid AggregatedBoolean Expression';
43
- }
44
- }
45
24
  return true;
46
25
  };
47
26
  exports.isValidAlertRules = isValidAlertRules;
@@ -117,7 +117,7 @@ const AdaptableObjectListItem = (props) => {
117
117
  const isEditDisabled = !Boolean(EditWizard || viewOptions.onOpenEditPopup);
118
118
  const showActions = !props.hideControls;
119
119
  const showEditButton = Boolean(EditWizard);
120
- const adaptableOpttions = adaptable.api.internalApi.getAdaptableOptions();
120
+ const adaptableOpttions = adaptable.api.optionsApi.getAdaptableOptions();
121
121
  const disableDeleteConfirmationState = (0, react_redux_1.useSelector)((adaptableState) => SystemRedux.SystemDisableDeleteConfirmationSelector(adaptableState.System));
122
122
  const disableDeleteConfirmation = disableDeleteConfirmationState || ((_h = adaptableOpttions === null || adaptableOpttions === void 0 ? void 0 : adaptableOpttions.generalOptions) === null || _h === void 0 ? void 0 : _h.disableDeleteConfirmation);
123
123
  return (React.createElement(React.Fragment, null,
@@ -1,6 +1,6 @@
1
1
  import { AdaptableApi } from '../../../types';
2
2
  import { OnePageAdaptableWizardContextType } from '../../Wizard/OnePageAdaptableWizard';
3
3
  import { RuleType } from './index';
4
- export declare const isRuleValid: (abObject: {
4
+ export declare const isAdaptableRuleValid: (abObject: {
5
5
  Rule?: RuleType;
6
- }, api: AdaptableApi, context: OnePageAdaptableWizardContextType<unknown>) => true | "The Expression is not a valid Boolean Expression" | "No valid Condition is specified" | "The Predicates are not valid";
6
+ }, api: AdaptableApi, context: OnePageAdaptableWizardContextType<unknown>) => string | true;
@@ -1,21 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isRuleValid = void 0;
4
- const isRuleValid = (abObject, api, context) => {
5
- var _a, _b, _c, _d, _e, _f, _g, _h;
6
- if (!((_b = (_a = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _a === void 0 ? void 0 : _a.Predicates) === null || _b === void 0 ? void 0 : _b.length) && !((_c = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _c === void 0 ? void 0 : _c.BooleanExpression)) {
7
- return 'No valid Condition is specified';
8
- }
9
- if ((_e = (_d = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _d === void 0 ? void 0 : _d.Predicates) === null || _e === void 0 ? void 0 : _e.length) {
10
- if (!api.predicateApi.isEveryPredicateValid((_f = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _f === void 0 ? void 0 : _f.Predicates)) {
11
- return 'The Predicates are not valid';
3
+ exports.isAdaptableRuleValid = void 0;
4
+ const isAdaptableRuleValid = (abObject, api, context) => {
5
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
6
+ if ((_b = (_a = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _a === void 0 ? void 0 : _a.Predicates) === null || _b === void 0 ? void 0 : _b.length) {
7
+ if (!api.predicateApi.isEveryPredicateValid((_c = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _c === void 0 ? void 0 : _c.Predicates)) {
8
+ return `The Predicate${((_e = (_d = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _d === void 0 ? void 0 : _d.Predicates) === null || _e === void 0 ? void 0 : _e.length) === 1 ? ' is' : 's are'} not valid`;
12
9
  }
13
10
  }
14
- if ((_g = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _g === void 0 ? void 0 : _g.BooleanExpression) {
15
- if (!api.queryLanguageApi.isValidBooleanExpression((_h = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _h === void 0 ? void 0 : _h.BooleanExpression, context.moduleInfo.ModuleName)) {
11
+ if ((_f = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _f === void 0 ? void 0 : _f.BooleanExpression) {
12
+ if (!api.queryLanguageApi.isValidBooleanExpression((_g = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _g === void 0 ? void 0 : _g.BooleanExpression, context.moduleInfo.ModuleName)) {
16
13
  return 'The Expression is not a valid Boolean Expression';
17
14
  }
18
15
  }
16
+ if ((_h = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _h === void 0 ? void 0 : _h.ObservableExpression) {
17
+ if (!api.queryLanguageApi.isValidObservableExpression((_j = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _j === void 0 ? void 0 : _j.ObservableExpression, context.moduleInfo.ModuleName)) {
18
+ return 'The Expression is not a valid Observable Expression';
19
+ }
20
+ }
21
+ if ((_k = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _k === void 0 ? void 0 : _k.AggregatedBooleanExpression) {
22
+ if (!api.queryLanguageApi.isValidAggregatedBooleanExpression((_l = abObject === null || abObject === void 0 ? void 0 : abObject.Rule) === null || _l === void 0 ? void 0 : _l.AggregatedBooleanExpression, context.moduleInfo.ModuleName)) {
23
+ return 'The Expression is not a valid Aggregated Boolean Expression';
24
+ }
25
+ }
19
26
  return true;
20
27
  };
21
- exports.isRuleValid = isRuleValid;
28
+ exports.isAdaptableRuleValid = isAdaptableRuleValid;
@@ -53,7 +53,7 @@ class FilterFormComponent extends React.Component {
53
53
  static createColumnFilterFromProps(props) {
54
54
  let existingColumnFilter = props.columnFilters.find((cf) => cf.ColumnId == props.currentColumn.columnId);
55
55
  if (!existingColumnFilter) {
56
- const filterOptions = props.api.internalApi.getAdaptableOptions().filterOptions;
56
+ const filterOptions = props.api.optionsApi.getFilterOptions();
57
57
  if (filterOptions.defaultFilterFormTab == 'Values') {
58
58
  return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, 'Values', []);
59
59
  }
@@ -83,7 +83,7 @@ class FilterFormComponent extends React.Component {
83
83
  : 'values';
84
84
  }
85
85
  static getDerivedStateFromProps(props, state) {
86
- const filterOptions = props.api.internalApi.getAdaptableOptions().filterOptions;
86
+ const filterOptions = props.api.optionsApi.getFilterOptions();
87
87
  const editedColumnFilter = filterOptions.autoApplyFilter
88
88
  ? FilterFormComponent.createColumnFilterFromProps(props)
89
89
  : state.editedColumnFilter;
@@ -110,8 +110,7 @@ class FilterFormComponent extends React.Component {
110
110
  }
111
111
  }
112
112
  async loadPermittedValues(filter = '') {
113
- const { values: distinctColumnValues, suppressClientSideFilter } = await (0, runIfNotResolvedIn_1.runIfNotResolvedIn)(this.props.api.gridApi.internalApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.columnId, filter, this.props.api.internalApi.getAdaptableOptions().filterOptions
114
- .showDistinctFilteredValuesOnly), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
113
+ const { values: distinctColumnValues, suppressClientSideFilter } = await (0, runIfNotResolvedIn_1.runIfNotResolvedIn)(this.props.api.gridApi.internalApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.columnId, filter, this.props.api.optionsApi.getFilterOptions().showDistinctFilteredValuesOnly), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
115
114
  if (!this._isMounted) {
116
115
  return;
117
116
  }
@@ -124,7 +123,7 @@ class FilterFormComponent extends React.Component {
124
123
  render() {
125
124
  var _a, _b;
126
125
  let isFilterable = this.isFilterable();
127
- const filterOptions = this.props.api.internalApi.getAdaptableOptions().filterOptions;
126
+ const filterOptions = this.props.api.optionsApi.getFilterOptions();
128
127
  const predicateDefs = this.props.api.filterApi
129
128
  .getFilterPredicateDefsForColumn(this.props.currentColumn)
130
129
  .filter((predicate) => !predicate.onlyQuickFilter);
@@ -214,7 +213,7 @@ class FilterFormComponent extends React.Component {
214
213
  this.onCloseForm();
215
214
  }
216
215
  else {
217
- if (this.props.api.internalApi.getAdaptableOptions().filterOptions.autoApplyFilter) {
216
+ if (this.props.api.optionsApi.getFilterOptions().autoApplyFilter) {
218
217
  this.props.onSetColumnFilter(editedColumnFilter);
219
218
  }
220
219
  }
@@ -257,7 +256,7 @@ class FilterFormComponent extends React.Component {
257
256
  const { editedColumnFilter } = this.state;
258
257
  editedColumnFilter.Predicate.Inputs[index] = value;
259
258
  this.setState({ editedColumnFilter });
260
- if (this.props.api.internalApi.getAdaptableOptions().filterOptions.autoApplyFilter) {
259
+ if (this.props.api.optionsApi.getFilterOptions().autoApplyFilter) {
261
260
  this.props.onSetColumnFilter(editedColumnFilter);
262
261
  }
263
262
  // this.props.onSetColumnFilter(editedColumnFilter);
@@ -32,8 +32,7 @@ class QuickFilterFormComponent extends React.Component {
32
32
  }
33
33
  };
34
34
  this.loadPermittedValues = async (filter = '') => {
35
- const { values, suppressClientSideFilter } = await (0, runIfNotResolvedIn_1.runIfNotResolvedIn)(this.props.api.gridApi.internalApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.columnId, filter, this.props.api.internalApi.getAdaptableOptions().filterOptions
36
- .showDistinctFilteredValuesOnly), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
35
+ const { values, suppressClientSideFilter } = await (0, runIfNotResolvedIn_1.runIfNotResolvedIn)(this.props.api.gridApi.internalApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.columnId, filter, this.props.api.optionsApi.getFilterOptions().showDistinctFilteredValuesOnly), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
37
36
  if (!this._isMounted) {
38
37
  return;
39
38
  }
@@ -67,7 +66,7 @@ class QuickFilterFormComponent extends React.Component {
67
66
  // there is no way to find out if the changed rows are relevant for this filter, so we have to update it every time :/
68
67
  this.handleGridValueChange();
69
68
  });
70
- if ((_c = this.props.api.internalApi.getAdaptableOptions().filterOptions) === null || _c === void 0 ? void 0 : _c.showDistinctFilteredValuesOnly) {
69
+ if ((_c = this.props.api.optionsApi.getFilterOptions()) === null || _c === void 0 ? void 0 : _c.showDistinctFilteredValuesOnly) {
71
70
  this.props.api.internalApi.getAdaptableInstance()._on('GridFiltered', () => {
72
71
  const filter = this.getFilterFromProps();
73
72
  if (this.hasValuesPredicate(filter === null || filter === void 0 ? void 0 : filter.Predicate)) {
@@ -98,7 +97,7 @@ class QuickFilterFormComponent extends React.Component {
98
97
  }
99
98
  getFilterFromProps(props = this.props) {
100
99
  const filter = props.columnFilters.find((cf) => cf.ColumnId == props.currentColumn.columnId);
101
- const filterOptions = props.api.internalApi.getAdaptableOptions().filterOptions;
100
+ const filterOptions = props.api.optionsApi.getFilterOptions();
102
101
  if (filter) {
103
102
  return filter;
104
103
  }
@@ -132,12 +131,12 @@ class QuickFilterFormComponent extends React.Component {
132
131
  hideEvent = 'blur';
133
132
  }
134
133
  let showQuickFilterDropdown = true;
135
- let hideQuickFilterDropdownFunction = this.props.api.internalApi.getAdaptableOptions().filterOptions.hideQuickFilterDropdown;
134
+ let hideQuickFilterDropdownFunction = this.props.api.optionsApi.getFilterOptions().hideQuickFilterDropdown;
136
135
  if (hideQuickFilterDropdownFunction) {
137
136
  showQuickFilterDropdown = !hideQuickFilterDropdownFunction(this.props.currentColumn);
138
137
  }
139
138
  let showQuickFilterInput = true;
140
- let hideQuickFilterInputFunction = this.props.api.internalApi.getAdaptableOptions().filterOptions.hideQuickFilterInput;
139
+ let hideQuickFilterInputFunction = this.props.api.optionsApi.getFilterOptions().hideQuickFilterInput;
141
140
  if (hideQuickFilterInputFunction) {
142
141
  showQuickFilterInput = !hideQuickFilterInputFunction(this.props.currentColumn);
143
142
  }
@@ -269,8 +268,7 @@ class QuickFilterFormComponent extends React.Component {
269
268
  } },
270
269
  React.createElement(rebass_1.Flex, { m: 2 },
271
270
  React.createElement(SimpleButton_1.default, { onClick: () => this.clearFilter() }, "Clear Filter"),
272
- ((_a = this.props.api.internalApi.getAdaptableOptions().filterOptions) === null || _a === void 0 ? void 0 : _a.autoApplyFilter) ==
273
- false && (React.createElement(SimpleButton_1.default, { ml: 2, onClick: () => this.updateFilter(this.state.filter) }, "Apply Filter"))),
271
+ ((_a = this.props.api.optionsApi.getFilterOptions()) === null || _a === void 0 ? void 0 : _a.autoApplyFilter) == false && (React.createElement(SimpleButton_1.default, { ml: 2, onClick: () => this.updateFilter(this.state.filter) }, "Apply Filter"))),
274
272
  React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { disabled: this.isFilterDisabled(), suppressClientSideFilter: this.state.suppressClientSideFilter, isLoading: this.state.isDistinctColumnValuesLoading, onFilterChange: this.handleFilterChange, currentColumn: this.props.currentColumn, columns: [], columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.dataType, uiSelectedColumnValues: this.state.filter.Predicate.Inputs.filter((input) => input !== ''), useAgGridStyle: true, onColumnValueSelectedChange: (list) => this.onColumnValuesChange(list) })));
275
273
  } },
276
274
  React.createElement(SimpleButton_1.default, { "data-name": 'Select Values', style: {
@@ -288,7 +286,7 @@ class QuickFilterFormComponent extends React.Component {
288
286
  var _a;
289
287
  const { filter } = this.state;
290
288
  filter.Predicate = { PredicateId: filter.Predicate.PredicateId, Inputs: columnValues };
291
- if ((_a = this.props.api.internalApi.getAdaptableOptions().filterOptions) === null || _a === void 0 ? void 0 : _a.autoApplyFilter) {
289
+ if ((_a = this.props.api.optionsApi.getFilterOptions()) === null || _a === void 0 ? void 0 : _a.autoApplyFilter) {
292
290
  this.updateFilter(filter);
293
291
  }
294
292
  else {
@@ -8,7 +8,7 @@ const AdaptableViewFactory_1 = require("../../../AdaptableViewFactory");
8
8
  const AdaptablePopupModuleView_1 = require("./AdaptablePopupModuleView");
9
9
  const AdaptablePopupBody = (props) => {
10
10
  var _a;
11
- const modalContainer = UIHelper_1.UIHelper.getModalContainer(props.api.internalApi.getAdaptableOptions(), document);
11
+ const modalContainer = UIHelper_1.UIHelper.getModalContainer(props.api.optionsApi.getAdaptableOptions(), document);
12
12
  const moduleName = props.module.moduleInfo.ModuleName;
13
13
  const accessLevel = props.api.internalApi
14
14
  .getEntitlementService()
@@ -11,7 +11,7 @@ const TopBar = (props) => {
11
11
  var _a;
12
12
  const baseClassName = 'ab-Adaptable-Popup__TopBar';
13
13
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
14
- const applicationIcon = (_a = adaptable.api.internalApi.getAdaptableOptions().userInterfaceOptions) === null || _a === void 0 ? void 0 : _a.applicationIcon;
14
+ const applicationIcon = (_a = adaptable.api.optionsApi.getUserInterfaceOptions()) === null || _a === void 0 ? void 0 : _a.applicationIcon;
15
15
  let icon = React.createElement(React.Fragment, null);
16
16
  const iconClassName = `${baseClassName}__Icon`;
17
17
  if (props.icon === 'ConfigurationIcon') {
@@ -14,7 +14,7 @@ const showToast = (props) => {
14
14
  Toastify_1.toast.dismiss();
15
15
  api = null;
16
16
  });
17
- const adaptableOptions = props.api.internalApi.getAdaptableOptions();
17
+ const adaptableOptions = props.api.optionsApi.getAdaptableOptions();
18
18
  const toastProps = ObjectFactory_1.default.CreateToastOptions(adaptableOptions.notificationsOptions, {
19
19
  containerId: adaptableOptions.adaptableId,
20
20
  onClose: () => {
@@ -27,7 +27,7 @@ const AdaptableToolPanelComponent = (props) => {
27
27
  const toolPanelsGlyph = React.createElement(icons_1.Icon, { name: 'align-justify' });
28
28
  const entitlementService = props.api.internalApi.getEntitlementService();
29
29
  const moduleService = props.api.internalApi.getModuleService();
30
- const adaptableOptions = props.api.internalApi.getAdaptableOptions();
30
+ const adaptableOptions = props.api.optionsApi.getAdaptableOptions();
31
31
  const toolPanelOptions = adaptableOptions.toolPanelOptions;
32
32
  const settingsPanelOptions = adaptableOptions.settingsPanelOptions;
33
33
  if (entitlementService.isModuleHiddenEntitlement('ToolPanel')) {
@@ -66,8 +66,7 @@ class ToolPanelPopupComponent extends React.Component {
66
66
  const isToolPanelReadOnly = entitlementService.isModuleReadOnlyEntitlement('ToolPanel');
67
67
  const isModuleCheckboxDisabled = (module) => {
68
68
  if (module === 'SettingsPanel') {
69
- return this.props.api.internalApi.getAdaptableOptions().settingsPanelOptions
70
- .alwaysShowInDashboard;
69
+ return this.props.api.optionsApi.getSettingsPanelOptions().alwaysShowInDashboard;
71
70
  }
72
71
  return false;
73
72
  };
@@ -25,10 +25,9 @@ exports.isValidCustomSortColumn = isValidCustomSortColumn;
25
25
  const CustomSortColumnWizardSection = (props) => {
26
26
  const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
27
27
  const sortableCols = React.useMemo(() => {
28
- var _a, _b;
29
28
  const sortableColumns = api.columnApi.getSortableColumns();
30
29
  const customSorts = api.customSortApi.getCustomSorts();
31
- const columnSortComparers = ((_b = (_a = api.internalApi.getAdaptableOptions()) === null || _a === void 0 ? void 0 : _a.generalOptions) === null || _b === void 0 ? void 0 : _b.customSortComparers) || [];
30
+ const columnSortComparers = api.optionsApi.getGeneralOptions().customSortComparers || [];
32
31
  const usedColumnIds = [
33
32
  ...customSorts.map((customSort) => customSort.ColumnId),
34
33
  ...columnSortComparers.map((comparer) => api.scopeApi.getColumnIdsInScope(comparer.scope)),