@adaptabletools/adaptable 11.0.0-canary.3 → 11.0.0-canary.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 (267) hide show
  1. package/agGrid.d.ts +5 -4
  2. package/agGrid.js +9 -7
  3. package/base.css +135 -69
  4. package/bundle.cjs.js +104 -99
  5. package/index.css +136 -69
  6. package/package.json +3 -3
  7. package/publishTimestamp.d.ts +1 -1
  8. package/publishTimestamp.js +1 -1
  9. package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +7 -5
  10. package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
  11. package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +1 -3
  12. package/src/AdaptableOptions/AdaptableOptions.d.ts +14 -7
  13. package/src/AdaptableOptions/{QueryLanguageOptions.d.ts → AdaptableQLOptions.d.ts} +34 -9
  14. package/src/AdaptableOptions/{QueryLanguageOptions.js → AdaptableQLOptions.js} +0 -0
  15. package/src/AdaptableOptions/AlertOptions.d.ts +82 -0
  16. package/src/AdaptableOptions/AlertOptions.js +2 -0
  17. package/src/AdaptableOptions/ContainerOptions.d.ts +2 -2
  18. package/src/AdaptableOptions/FilterOptions.d.ts +1 -1
  19. package/src/AdaptableOptions/GeneralOptions.d.ts +0 -7
  20. package/src/AdaptableOptions/NotificationsOptions.d.ts +1 -78
  21. package/src/AdaptableOptions/SearchOptions.d.ts +0 -9
  22. package/src/AdaptableOptions/StateOptions.d.ts +9 -8
  23. package/src/AdaptableOptions/TeamSharingOptions.d.ts +2 -2
  24. package/src/AdaptableOptions/ToolPanelOptions.d.ts +0 -2
  25. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +3 -3
  26. package/src/Api/AdaptableApi.d.ts +6 -0
  27. package/src/Api/AlertApi.d.ts +2 -3
  28. package/src/Api/CalculatedColumnApi.d.ts +2 -9
  29. package/src/Api/ColumnApi.d.ts +0 -4
  30. package/src/Api/EventApi.d.ts +8 -3
  31. package/src/Api/Events/GridDataChanged.d.ts +4 -2
  32. package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +1 -1
  33. package/src/Api/FreeTextColumnApi.d.ts +0 -12
  34. package/src/Api/GridApi.d.ts +13 -2
  35. package/src/Api/IPushPullApi.d.ts +1 -1
  36. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -1
  37. package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
  38. package/src/Api/Implementation/AlertApiImpl.d.ts +1 -2
  39. package/src/Api/Implementation/AlertApiImpl.js +19 -10
  40. package/src/Api/Implementation/ApiBase.d.ts +5 -2
  41. package/src/Api/Implementation/ApiBase.js +8 -2
  42. package/src/Api/Implementation/CalculatedColumnApiImpl.js +3 -4
  43. package/src/Api/Implementation/ColumnApiImpl.d.ts +0 -1
  44. package/src/Api/Implementation/ColumnApiImpl.js +0 -5
  45. package/src/Api/Implementation/FreeTextColumnApiImpl.d.ts +0 -5
  46. package/src/Api/Implementation/FreeTextColumnApiImpl.js +0 -9
  47. package/src/Api/Implementation/GridApiImpl.d.ts +4 -1
  48. package/src/Api/Implementation/GridApiImpl.js +27 -4
  49. package/src/Api/Implementation/InternalApiImpl.d.ts +2 -3
  50. package/src/Api/Implementation/InternalApiImpl.js +7 -6
  51. package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
  52. package/src/Api/Implementation/LayoutApiImpl.js +11 -0
  53. package/src/Api/Implementation/QueryApiImpl.js +4 -1
  54. package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +4 -1
  55. package/src/Api/Implementation/QueryLanguageApiImpl.js +20 -8
  56. package/src/Api/Implementation/SettingsPanelApiImpl.d.ts +7 -0
  57. package/src/Api/Implementation/SettingsPanelApiImpl.js +15 -0
  58. package/src/Api/InternalApi.d.ts +2 -3
  59. package/src/Api/LayoutApi.d.ts +7 -0
  60. package/src/Api/OpenFinApi.d.ts +5 -0
  61. package/src/Api/PluginsApi.d.ts +29 -0
  62. package/src/Api/QueryApi.d.ts +2 -2
  63. package/src/Api/QueryLanguageApi.d.ts +23 -10
  64. package/src/Api/SettingsPanelApi.d.ts +16 -0
  65. package/src/Api/SettingsPanelApi.js +2 -0
  66. package/src/Api/UserInterfaceApi.d.ts +5 -2
  67. package/src/PredefinedConfig/AlertState.d.ts +8 -6
  68. package/src/PredefinedConfig/CalculatedColumnState.d.ts +8 -4
  69. package/src/PredefinedConfig/Common/AdaptableQuery.d.ts +7 -5
  70. package/src/PredefinedConfig/Common/AdaptableQuery.js +2 -6
  71. package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +1 -12
  72. package/src/PredefinedConfig/Common/Enums.d.ts +0 -1
  73. package/src/PredefinedConfig/Common/Enums.js +0 -2
  74. package/src/PredefinedConfig/Common/FDC3Context.d.ts +4 -12
  75. package/src/PredefinedConfig/Common/RowHighlightInfo.d.ts +15 -0
  76. package/src/PredefinedConfig/Common/RowHighlightInfo.js +2 -0
  77. package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +1 -1
  78. package/src/PredefinedConfig/Common/Types.d.ts +3 -1
  79. package/src/PredefinedConfig/Common/Types.js +1 -0
  80. package/src/PredefinedConfig/CustomSortState.d.ts +0 -1
  81. package/src/PredefinedConfig/FlashingCellState.d.ts +3 -1
  82. package/src/PredefinedConfig/FreeTextColumnState.d.ts +1 -1
  83. package/src/PredefinedConfig/LayoutState.d.ts +0 -2
  84. package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -2
  85. package/src/PredefinedConfig/Selection/GridCellRange.d.ts +3 -1
  86. package/src/PredefinedConfig/SystemState.d.ts +2 -1
  87. package/src/Redux/ActionsReducers/ApplicationRedux.js +9 -3
  88. package/src/Redux/ActionsReducers/FlashingCellRedux.js +4 -8
  89. package/src/Redux/ActionsReducers/GridRedux.js +3 -1
  90. package/src/Redux/ActionsReducers/PopupRedux.js +13 -3
  91. package/src/Redux/ActionsReducers/QuickSearchRedux.js +3 -1
  92. package/src/Redux/ActionsReducers/SystemRedux.d.ts +6 -5
  93. package/src/Redux/ActionsReducers/SystemRedux.js +16 -14
  94. package/src/Redux/ActionsReducers/ThemeRedux.js +3 -1
  95. package/src/Redux/Store/AdaptableReduxMerger.js +1 -1
  96. package/src/Redux/Store/AdaptableStore.js +34 -8
  97. package/src/Strategy/AlertModule.js +16 -6
  98. package/src/Strategy/CalculatedColumnModule.js +4 -4
  99. package/src/Strategy/ChartingModule.d.ts +3 -3
  100. package/src/Strategy/ChartingModule.js +2 -2
  101. package/src/Strategy/ConditionalStyleModule.js +4 -0
  102. package/src/Strategy/FlashingCellModule.js +4 -4
  103. package/src/Strategy/FreeTextColumnModule.d.ts +2 -2
  104. package/src/Strategy/FreeTextColumnModule.js +11 -0
  105. package/src/Strategy/LayoutModule.js +1 -6
  106. package/src/Strategy/{SetingsPanelModule.d.ts → SettingsPanelModule.d.ts} +0 -0
  107. package/src/Strategy/{SetingsPanelModule.js → SettingsPanelModule.js} +0 -0
  108. package/src/Strategy/ToolPanelModule.js +5 -3
  109. package/src/Strategy/Utilities/getAlertPreviewViewItems.js +1 -1
  110. package/src/Strategy/Utilities/getExpressionViewItems.d.ts +2 -2
  111. package/src/Strategy/Utilities/getExpressionViewItems.js +2 -1
  112. package/src/Strategy/Utilities/getFormatColumnSettingsViewItems.js +1 -1
  113. package/src/Strategy/Utilities/getRuleViewItems.d.ts +0 -1
  114. package/src/Strategy/Utilities/getRuleViewItems.js +1 -3
  115. package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +2 -1
  116. package/src/Utilities/Constants/DocumentationLinkConstants.js +3 -2
  117. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +23 -17
  118. package/src/Utilities/ExpressionFunctions/{aggregationExpressionFunctions.d.ts → aggregatedBooleanExpressionFunctions.d.ts} +1 -1
  119. package/src/Utilities/ExpressionFunctions/{aggregationExpressionFunctions.js → aggregatedBooleanExpressionFunctions.js} +4 -4
  120. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +24 -0
  121. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +339 -0
  122. package/src/Utilities/ExpressionFunctions/dateUtils.d.ts +1 -0
  123. package/src/Utilities/ExpressionFunctions/dateUtils.js +13 -0
  124. package/src/Utilities/ExpressionFunctions/deepMap.d.ts +35 -0
  125. package/src/Utilities/ExpressionFunctions/deepMap.js +283 -0
  126. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +2 -2
  127. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +8 -8
  128. package/src/Utilities/ExpressionFunctions/groupingMap.d.ts +35 -0
  129. package/src/Utilities/ExpressionFunctions/groupingMap.js +105 -0
  130. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +2 -2
  131. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.d.ts +33 -0
  132. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +154 -0
  133. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +13 -4
  134. package/src/Utilities/Helpers/AdaptableHelper.js +3 -1
  135. package/src/Utilities/Helpers/CalendarHelper.js +220 -55
  136. package/src/Utilities/Interface/MessagePopups.d.ts +6 -2
  137. package/src/Utilities/ObjectFactory.js +1 -0
  138. package/src/Utilities/Services/AlertService.js +8 -4
  139. package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +7 -3
  140. package/src/Utilities/Services/CalculatedColumnExpressionService.js +143 -18
  141. package/src/Utilities/Services/DataService.js +6 -1
  142. package/src/Utilities/Services/Interface/IAdaptableService.d.ts +1 -1
  143. package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +6 -3
  144. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +9 -3
  145. package/src/Utilities/Services/LicenseService.js +1 -1
  146. package/src/Utilities/Services/QueryLanguageService.d.ts +11 -4
  147. package/src/Utilities/Services/QueryLanguageService.js +92 -28
  148. package/src/Utilities/Services/ReportService.js +6 -2
  149. package/src/Utilities/Services/TeamSharingService.js +5 -3
  150. package/src/View/AdaptablePopover/index.js +6 -1
  151. package/src/View/AdaptableView.js +1 -1
  152. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +5 -1
  153. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationForm.js +10 -5
  154. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.js +4 -1
  155. package/src/View/AdaptableWizardView/helper.js +5 -3
  156. package/src/View/Alert/Wizard/AlertButtonsEditor.d.ts +1 -1
  157. package/src/View/Alert/Wizard/AlertButtonsEditor.js +5 -1
  158. package/src/View/Alert/Wizard/AlertDisplayWizardSection.d.ts +1 -0
  159. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -2
  160. package/src/View/Alert/Wizard/AlertWizard.js +2 -2
  161. package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +2 -2
  162. package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +3 -2
  163. package/src/View/Alert/Wizard/isValidAlertRules.js +3 -3
  164. package/src/View/CalculatedColumn/CalculatedColumnSharedEntity.js +3 -3
  165. package/src/View/CalculatedColumn/CalculatedColumnSummary.js +2 -4
  166. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +43 -12
  167. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -2
  168. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +2 -2
  169. package/src/View/CellSummary/CellSummaryViewPanel.js +1 -2
  170. package/src/View/ColorPicker.d.ts +1 -1
  171. package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
  172. package/src/View/Components/AdaptableInput/index.d.ts +1 -1
  173. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +5 -2
  174. package/src/View/Components/Buttons/ButtonDelete.d.ts +1 -1
  175. package/src/View/Components/EntityRulesEditor/index.js +11 -12
  176. package/src/View/Components/FilterForm/FilterForm.js +0 -2
  177. package/src/View/Components/FilterForm/QuickFilterForm.js +6 -5
  178. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +1 -1
  179. package/src/View/Components/Forms/AdaptableFormControlTextClear.d.ts +1 -1
  180. package/src/View/Components/Panels/PanelWithImage.d.ts +2 -2
  181. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.d.ts +0 -3
  182. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +45 -88
  183. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.d.ts +11 -0
  184. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +78 -0
  185. package/src/View/Components/Popups/AdaptablePopup/Navigation.d.ts +1 -3
  186. package/src/View/Components/Popups/AdaptablePopup/Navigation.js +5 -13
  187. package/src/View/Components/Popups/AdaptablePopup/TopBar.js +5 -4
  188. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.d.ts +2 -0
  189. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +44 -0
  190. package/src/View/Components/Popups/AdaptablePopupAlert.d.ts +1 -0
  191. package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -1
  192. package/src/View/Components/Popups/AdaptablePopupConfirmation.js +3 -1
  193. package/src/View/Components/Popups/AdaptablePopupPrompt.d.ts +5 -12
  194. package/src/View/Components/Popups/AdaptablePopupPrompt.js +38 -37
  195. package/src/View/Components/Popups/AdaptablePopupTeamSharing.js +4 -1
  196. package/src/View/Components/ScopeComponent.js +4 -1
  197. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +5 -1
  198. package/src/View/Components/ToolPanel/ToolPanelPopup.js +3 -1
  199. package/src/View/Components/ToolPanel/ToolPanelWrapper.js +1 -1
  200. package/src/View/Components/ValueSelector/index.js +1 -1
  201. package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.js +2 -2
  202. package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.d.ts +8 -0
  203. package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.js +27 -0
  204. package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +7 -0
  205. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +3 -1
  206. package/src/View/CustomSort/Wizard/CustomSortWizard.js +1 -1
  207. package/src/View/Dashboard/CustomToolbarWrapper.js +5 -1
  208. package/src/View/Dashboard/Dashboard.js +2 -3
  209. package/src/View/Dashboard/DashboardPopup.js +3 -1
  210. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +2 -1
  211. package/src/View/Export/Wizard/ReportColumnTypeWizard.js +3 -1
  212. package/src/View/Export/Wizard/ReportRowTypeWizard.js +3 -1
  213. package/src/View/Filter/FilterViewPanel.d.ts +1 -4
  214. package/src/View/Filter/FilterViewPanel.js +1 -3
  215. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +2 -2
  216. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +1 -1
  217. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +1 -1
  218. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -2
  219. package/src/View/GridInfo/AdaptableOptionsComponent.js +4 -1
  220. package/src/View/Layout/Wizard/LayoutEditor/index.js +6 -2
  221. package/src/View/Layout/Wizard/LayoutEditorWizard.js +7 -1
  222. package/src/View/License/LicenseWatermark.js +1 -1
  223. package/src/View/Query/ExpandedQueryPopup.js +9 -2
  224. package/src/View/Query/QueryViewPanel.js +3 -1
  225. package/src/View/Query/Wizard/NamedQueryWizard.js +3 -3
  226. package/src/View/QuickSearch/QuickSearchPopup.js +3 -3
  227. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +12 -2
  228. package/src/View/SpecialColumnSettingsWizardStep.js +1 -2
  229. package/src/View/UIHelper.js +4 -1
  230. package/src/View/Wizard/AdaptableWizard.js +12 -3
  231. package/src/View/Wizard/OnePageAdaptableWizard.js +5 -1
  232. package/src/agGrid/Adaptable.d.ts +3 -3
  233. package/src/agGrid/Adaptable.js +117 -77
  234. package/src/agGrid/agGridHelper.js +4 -9
  235. package/src/agGrid/agGridMenuHelper.js +4 -8
  236. package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
  237. package/src/agGrid/editors/AdaptableNumberEditor/index.js +1 -1
  238. package/src/components/AdaptableFormComponent/AdaptableFormComponent.d.ts +4 -2
  239. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +4 -4
  240. package/src/components/ApplicationIcon.d.ts +1 -0
  241. package/src/components/ApplicationIcon.js +2 -2
  242. package/src/components/Dashboard/Dashboard.js +4 -1
  243. package/src/components/Datepicker/index.d.ts +1 -1
  244. package/src/components/Dropdown/index.js +8 -1
  245. package/src/components/ExpressionEditor/EditorInput.d.ts +1 -1
  246. package/src/components/ExpressionEditor/EditorInput.js +5 -2
  247. package/src/components/ExpressionEditor/EditorInputReactive.d.ts +1 -1
  248. package/src/components/ExpressionEditor/EditorInputReactive.js +4 -2
  249. package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +5 -2
  250. package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.d.ts +2 -0
  251. package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +45 -0
  252. package/src/components/ExpressionEditor/editorButtonsReactive.js +8 -13
  253. package/src/components/ExpressionEditor/index.d.ts +2 -1
  254. package/src/components/ExpressionEditor/index.js +20 -6
  255. package/src/components/Input/index.d.ts +1 -1
  256. package/src/components/List/ListGroupItem/index.d.ts +1 -1
  257. package/src/components/Logo/index.js +8 -7
  258. package/src/components/PopupWithFooter.d.ts +1 -1
  259. package/src/components/SizedContainer/index.js +7 -1
  260. package/src/components/Textarea/index.d.ts +1 -1
  261. package/src/components/WindowModal/WindowModal.js +4 -1
  262. package/src/metamodel/adaptable.metamodel.d.ts +114 -59
  263. package/src/metamodel/adaptable.metamodel.js +373 -242
  264. package/src/types.d.ts +9 -6
  265. package/themes/dark.css +4 -4
  266. package/version.d.ts +1 -1
  267. package/version.js +1 -1
@@ -4,17 +4,45 @@ exports.CalculatedColumnExpressionService = void 0;
4
4
  const Enums_1 = require("../../PredefinedConfig/Common/Enums");
5
5
  const LoggingHelper_1 = require("../Helpers/LoggingHelper");
6
6
  const ModuleConstants_1 = require("../Constants/ModuleConstants");
7
+ const scalarAggregationHelper_1 = require("../ExpressionFunctions/scalarAggregationHelper");
7
8
  class CalculatedColumnExpressionService {
8
9
  constructor(adaptable) {
9
10
  this.adaptable = adaptable;
11
+ this.aggregatedScalarCalculatedColumnsMap = new Map();
10
12
  this.adaptable = adaptable;
13
+ this.adaptable.api.internalApi
14
+ .getDataService()
15
+ .on('DataChanged', (dataChangedInfo) => {
16
+ if (dataChangedInfo.trigger === 'aggChange') {
17
+ // do NOT handle changes on group rows
18
+ return;
19
+ }
20
+ const refreshedCalculatedColumns = [];
21
+ this.aggregatedScalarCalculatedColumnsMap.forEach((aggregatedScalarCalculatedColumn) => {
22
+ if (aggregatedScalarCalculatedColumn
23
+ .getColumnDependencies()
24
+ .includes(dataChangedInfo.column.columnId)) {
25
+ aggregatedScalarCalculatedColumn.refreshAggregatedColumnValue();
26
+ refreshedCalculatedColumns.push(aggregatedScalarCalculatedColumn.getCalculatedColumnId());
27
+ }
28
+ });
29
+ if (refreshedCalculatedColumns.length) {
30
+ this.adaptable.api.gridApi.refreshCells(null, refreshedCalculatedColumns);
31
+ }
32
+ });
11
33
  }
12
- GetCalculatedColumnDataType(expression) {
34
+ getCalculatedColumnDataType(calculatedColumnQuery) {
13
35
  try {
36
+ if (calculatedColumnQuery.AggregatedScalarExpression) {
37
+ // currently AggregatedScalarExpression support only numerical values
38
+ // TODO AFL try to derive the type from the aggregatedColumn?
39
+ // we definitely don't want to aggregate everything only to get the data type
40
+ return Enums_1.DataType.Number;
41
+ }
14
42
  let firstRowNode = this.adaptable.api.gridApi.getFirstRowNode();
15
43
  let firstRowValue = this.adaptable.api.internalApi
16
44
  .getQueryLanguageService()
17
- .evaluateScalarExpression(expression, ModuleConstants_1.CalculatedColumnModuleId, firstRowNode);
45
+ .evaluateScalarExpression(calculatedColumnQuery.ScalarExpression, ModuleConstants_1.CalculatedColumnModuleId, firstRowNode);
18
46
  if (firstRowValue instanceof Date) {
19
47
  return Enums_1.DataType.Date;
20
48
  }
@@ -29,40 +57,137 @@ class CalculatedColumnExpressionService {
29
57
  }
30
58
  }
31
59
  catch (e) {
32
- LoggingHelper_1.LogAdaptableWarning(`Invalid CalculatedColumn expression ${expression} :: ${e}`);
60
+ LoggingHelper_1.LogAdaptableWarning(`Invalid CalculatedColumn expression ${this.adaptable.api.queryLanguageApi.getAdaptableQueryExpression(calculatedColumnQuery)} :: ${e}`);
33
61
  return Enums_1.DataType.Number;
34
62
  }
35
63
  }
36
- IsExpressionValid(expression) {
37
- try {
38
- let firstRowNode = this.adaptable.getFirstRowNode();
39
- this.adaptable.api.internalApi
40
- .getQueryLanguageService()
41
- .evaluateScalarExpression(expression, ModuleConstants_1.CalculatedColumnModuleId, firstRowNode);
42
- return true;
64
+ isCalculatedColumnQueryValid(calculatedColumnQuery) {
65
+ if (calculatedColumnQuery.ScalarExpression) {
66
+ try {
67
+ // TODO AFL add a cached validation for ScalarExpression, just like for all the other types
68
+ let firstRowNode = this.adaptable.getFirstRowNode();
69
+ this.adaptable.api.internalApi
70
+ .getQueryLanguageService()
71
+ .evaluateScalarExpression(calculatedColumnQuery.ScalarExpression, ModuleConstants_1.CalculatedColumnModuleId, firstRowNode);
72
+ return true;
73
+ }
74
+ catch (e) {
75
+ // no logging as this method is used only in the UI
76
+ return false;
77
+ }
43
78
  }
44
- catch (e) {
45
- // no logging as this method is used only in the UI
46
- return false;
79
+ if (calculatedColumnQuery.AggregatedScalarExpression) {
80
+ const validationResult = this.adaptable.api.internalApi
81
+ .getQueryLanguageService()
82
+ .validateAggregatedScalar(calculatedColumnQuery.AggregatedScalarExpression, ModuleConstants_1.CalculatedColumnModuleId);
83
+ return validationResult.isValid;
47
84
  }
85
+ // if query has neither a ScalarExpression nor an AggregatedScalarExpression => it can only be false
86
+ return false;
48
87
  }
49
- ComputeExpressionValue(expression, node) {
88
+ evaluateCalculatedColumnQuery(calculatedColumn, node) {
89
+ var _a, _b, _c, _d, _e;
50
90
  try {
51
91
  if (this.adaptable.api.gridApi.isGroupRowNode(node)) {
52
92
  return undefined;
53
93
  }
54
94
  // no validation here, this function has to be as performant as possible
55
- return this.adaptable.api.internalApi
56
- .getQueryLanguageService()
57
- .evaluateScalarExpression(expression, ModuleConstants_1.CalculatedColumnModuleId, node);
95
+ if ((_a = calculatedColumn === null || calculatedColumn === void 0 ? void 0 : calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression) {
96
+ return this.adaptable.api.internalApi
97
+ .getQueryLanguageService()
98
+ .evaluateScalarExpression(calculatedColumn.Query.ScalarExpression, ModuleConstants_1.CalculatedColumnModuleId, node);
99
+ }
100
+ if ((_b = calculatedColumn === null || calculatedColumn === void 0 ? void 0 : calculatedColumn.Query) === null || _b === void 0 ? void 0 : _b.AggregatedScalarExpression) {
101
+ const aggregatedScalarCalculatedColumn = this.aggregatedScalarCalculatedColumnsMap.get(calculatedColumn.Uuid);
102
+ return aggregatedScalarCalculatedColumn === null || aggregatedScalarCalculatedColumn === void 0 ? void 0 : aggregatedScalarCalculatedColumn.getAggregatedColumnValue(node);
103
+ }
58
104
  }
59
105
  catch (error) {
60
- LoggingHelper_1.LogAdaptableError(`Invalid CalculatedColumn scalar expression ${expression} :: ${error}`);
106
+ LoggingHelper_1.LogAdaptableError(`Invalid CalculatedColumn expression ${(_d = (_c = calculatedColumn === null || calculatedColumn === void 0 ? void 0 : calculatedColumn.Query) === null || _c === void 0 ? void 0 : _c.ScalarExpression) !== null && _d !== void 0 ? _d : (_e = calculatedColumn === null || calculatedColumn === void 0 ? void 0 : calculatedColumn.Query) === null || _e === void 0 ? void 0 : _e.AggregatedScalarExpression} :: ${error}`);
61
107
  return null;
62
108
  }
63
109
  }
110
+ createAggregatedScalarCalculatedColumn(calculatedColumn) {
111
+ var _a;
112
+ // if there is already an aggregated scalar, delete it (possible when editing)
113
+ this.destroyAggregatedScalarCalculatedColumn(calculatedColumn);
114
+ if ((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.AggregatedScalarExpression) {
115
+ const aggregationConfig = this.adaptable.api.internalApi
116
+ .getQueryLanguageService()
117
+ .evaluateAggregatedScalarExpression(calculatedColumn.Query.AggregatedScalarExpression, ModuleConstants_1.CalculatedColumnModuleId);
118
+ const aggregatedScalarCalculatedColumn = new AggregatedScalarCalculatedColumn(aggregationConfig.value, calculatedColumn, this.adaptable);
119
+ this.aggregatedScalarCalculatedColumnsMap.set(calculatedColumn.Uuid, aggregatedScalarCalculatedColumn);
120
+ }
121
+ }
122
+ destroyAggregatedScalarCalculatedColumn(calculatedColumn) {
123
+ this.aggregatedScalarCalculatedColumnsMap.delete(calculatedColumn.Uuid);
124
+ }
64
125
  destroy() {
65
126
  // TO DO
66
127
  }
67
128
  }
68
129
  exports.CalculatedColumnExpressionService = CalculatedColumnExpressionService;
130
+ class AggregatedScalarCalculatedColumn {
131
+ constructor(expressionEvaluation, calculatedColumn, adaptable) {
132
+ this.expressionEvaluation = expressionEvaluation;
133
+ this.calculatedColumn = calculatedColumn;
134
+ this.adaptable = adaptable;
135
+ this.aggregationResult = this.computeAggregatedValue(expressionEvaluation);
136
+ // currently we support only one reducer
137
+ this.aggregationReducerName = Object.keys(expressionEvaluation.aggregationParams.reducers)[0];
138
+ }
139
+ getAggregatedColumnValue(rowNode) {
140
+ const aggregationValue = this.getAggregationValue(rowNode);
141
+ if (this.expressionEvaluation.rowValueGetter) {
142
+ return this.expressionEvaluation.rowValueGetter(rowNode, aggregationValue);
143
+ }
144
+ return aggregationValue;
145
+ }
146
+ refreshAggregatedColumnValue() {
147
+ this.aggregationResult = this.computeAggregatedValue(this.expressionEvaluation);
148
+ }
149
+ getCalculatedColumnId() {
150
+ return this.calculatedColumn.ColumnId;
151
+ }
152
+ getColumnDependencies() {
153
+ return this.expressionEvaluation.columnDependencies;
154
+ }
155
+ computeAggregatedValue(expressionEvaluation) {
156
+ const gridData = this.adaptable.api.gridApi.getGridData();
157
+ if (!expressionEvaluation.cumulateOver) {
158
+ return scalarAggregationHelper_1.aggregate(expressionEvaluation.aggregationParams, gridData);
159
+ }
160
+ else {
161
+ // 1. sort grid data by given OVER column
162
+ const sortByColumn = expressionEvaluation.cumulateOver;
163
+ // currently we support only ascending sorting
164
+ gridData.sort((first, second) => {
165
+ if (first[sortByColumn] < second[sortByColumn]) {
166
+ return -1;
167
+ }
168
+ if (first[sortByColumn] > second[sortByColumn]) {
169
+ return 1;
170
+ }
171
+ return 0;
172
+ });
173
+ // 2. add primary key column as the most specific groupBy
174
+ if (!expressionEvaluation.aggregationParams.groupBy) {
175
+ expressionEvaluation.aggregationParams.groupBy = [];
176
+ }
177
+ const gridPrimaryKey = this.adaptable.adaptableOptions.primaryKey;
178
+ // !! aggregationParams mutated
179
+ expressionEvaluation.aggregationParams.groupBy.push({ field: gridPrimaryKey });
180
+ // 3. cumulate
181
+ return scalarAggregationHelper_1.cumulate(expressionEvaluation.aggregationParams, gridData);
182
+ }
183
+ }
184
+ getAggregationValue(rowNode) {
185
+ var _a, _b;
186
+ if ((_a = this.expressionEvaluation.aggregationParams.groupBy) === null || _a === void 0 ? void 0 : _a.length) {
187
+ const groupColumns = this.expressionEvaluation.aggregationParams.groupBy.map((groupByParam) => groupByParam.field);
188
+ const groupKeys = groupColumns.map((groupColumnName) => this.adaptable.api.gridApi.getRawValueFromRowNode(rowNode, groupColumnName));
189
+ return (_b = this.aggregationResult.deepMap.get(groupKeys)) === null || _b === void 0 ? void 0 : _b.reducerResults[this.aggregationReducerName];
190
+ }
191
+ return this.aggregationResult.reducerResults[this.aggregationReducerName];
192
+ }
193
+ }
@@ -58,7 +58,12 @@ class DataService {
58
58
  return result;
59
59
  }
60
60
  getUndoChangeKey(primaryKeyValue, columnId, previousValue, newValue) {
61
- return JSON.stringify({ primaryKeyValue, columnId, previousValue, newValue });
61
+ return JSON.stringify({
62
+ primaryKeyValue,
63
+ columnId,
64
+ previousValue,
65
+ newValue,
66
+ });
62
67
  }
63
68
  logDataChange(dataChangedInfo) {
64
69
  const dataChangeLogEntry = this.extractDataChangeLogEntry(dataChangedInfo);
@@ -1,3 +1,3 @@
1
1
  export interface IAdaptableService {
2
- destroy(): void;
2
+ destroy?(): void;
3
3
  }
@@ -1,7 +1,10 @@
1
1
  import { IAdaptableService } from './IAdaptableService';
2
2
  import { RowNode } from '@ag-grid-community/all-modules';
3
+ import { AdaptableCalculatedColumnQuery, CalculatedColumn } from '../../../PredefinedConfig/CalculatedColumnState';
3
4
  export interface ICalculatedColumnExpressionService extends IAdaptableService {
4
- IsExpressionValid(expression: string): boolean;
5
- ComputeExpressionValue(expression: string, rowNode: RowNode): any;
6
- GetCalculatedColumnDataType(expression: string): 'String' | 'Number' | 'Boolean' | 'Date';
5
+ isCalculatedColumnQueryValid(calculatedColumnQuery: AdaptableCalculatedColumnQuery): boolean;
6
+ evaluateCalculatedColumnQuery(calculatedColumn: CalculatedColumn, rowNode: RowNode): any;
7
+ getCalculatedColumnDataType(calculatedColumnQuery: AdaptableCalculatedColumnQuery): 'String' | 'Number' | 'Boolean' | 'Date';
8
+ createAggregatedScalarCalculatedColumn(calculatedColumn: CalculatedColumn): void;
9
+ destroyAggregatedScalarCalculatedColumn(calculatedColumn: CalculatedColumn): void;
7
10
  }
@@ -3,12 +3,14 @@ import { IAdaptableService } from './IAdaptableService';
3
3
  import { RowNode } from '@ag-grid-community/all-modules';
4
4
  import { DataChangedInfo } from '../../../PredefinedConfig/Common/DataChangedInfo';
5
5
  import { AdaptableModule } from '../../../PredefinedConfig/Common/Types';
6
- import { ModuleExpressionFunctions } from '../../../AdaptableOptions/QueryLanguageOptions';
6
+ import { AggregationParameter } from '../../ExpressionFunctions/aggregatedScalarExpressionFunctions';
7
+ import { ModuleExpressionFunctions } from '../../../AdaptableOptions/AdaptableQLOptions';
7
8
  export interface IQueryLanguageService extends IAdaptableService {
8
9
  evaluateBooleanExpression(expression: string, module: AdaptableModule, rowNode: RowNode): boolean;
9
10
  evaluateScalarExpression(expression: string, module: AdaptableModule, rowNode: RowNode): any;
10
11
  evaluateObservableExpression(expression: string, module: AdaptableModule): Observable<DataChangedInfo>;
11
- evaluateAggregationExpression(expression: string, module: AdaptableModule): Observable<DataChangedInfo>;
12
+ evaluateAggregatedBooleanExpression(expression: string, module: AdaptableModule): Observable<DataChangedInfo>;
13
+ evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule): AggregationParameter;
12
14
  validateBoolean(expression: string, module: AdaptableModule, config?: {
13
15
  force?: boolean;
14
16
  }): {
@@ -19,7 +21,11 @@ export interface IQueryLanguageService extends IAdaptableService {
19
21
  isValid: boolean;
20
22
  errorMessage: string;
21
23
  };
22
- validateAggregation(expression: string, module: AdaptableModule): {
24
+ validateAggregatedBoolean(expression: string, module: AdaptableModule): {
25
+ isValid: boolean;
26
+ errorMessage: string;
27
+ };
28
+ validateAggregatedScalar(expression: string, module: AdaptableModule): {
23
29
  isValid: boolean;
24
30
  errorMessage: string;
25
31
  };
@@ -23,7 +23,7 @@ var LicenseValidityType;
23
23
  LicenseValidityType["COMMERCIAL_EXPIRED_IN_SCOPE"] = "COMMERCIAL_EXPIRED_IN_SCOPE";
24
24
  LicenseValidityType["COMMERCIAL_EXPIRED_OUT_OF_SCOPE"] = "COMMERCIAL_EXPIRED_OUT_OF_SCOPE";
25
25
  })(LicenseValidityType = exports.LicenseValidityType || (exports.LicenseValidityType = {}));
26
- const SANDPACK_REGEX = /(https):\/\/\d+\-\d+\-\d\-(sandpack\.codesandbox\.io)/g;
26
+ const SANDPACK_REGEX = /(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g;
27
27
  const SANDBOX_REGEX = /(https):\/\/\S+(\.csb\.app)/g;
28
28
  const origin = typeof window !== 'undefined' ? window.location.origin : '';
29
29
  const isInsideSandpack = () => {
@@ -4,18 +4,21 @@ import { Observable } from 'rxjs';
4
4
  import { DataChangedInfo } from '../../PredefinedConfig/Common/DataChangedInfo';
5
5
  import { RowNode } from '@ag-grid-community/all-modules';
6
6
  import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
7
- import { ModuleExpressionFunctions } from '../../AdaptableOptions/QueryLanguageOptions';
7
+ import { ModuleExpressionFunctions } from '../../AdaptableOptions/AdaptableQLOptions';
8
+ import { AggregationParameter } from '../ExpressionFunctions/aggregatedScalarExpressionFunctions';
8
9
  export declare class QueryLanguageService implements IQueryLanguageService {
9
10
  private adaptable;
10
11
  private cacheBooleanValidation;
11
12
  private cacheObservableValidation;
12
- private cacheAggregationValidation;
13
+ private cacheAggregatedBooleanValidation;
14
+ private cacheAggregatedScalarValidation;
13
15
  private cacheModuleSpecificExpressionFunctions;
14
16
  constructor(adaptable: IAdaptable);
15
17
  evaluateBooleanExpression(expression: string, module: AdaptableModule, rowNode: any): any;
16
18
  evaluateScalarExpression(expression: string, module: AdaptableModule, rowNode: RowNode): any;
19
+ evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule): AggregationParameter;
17
20
  evaluateObservableExpression(reactiveExpression: string, module: AdaptableModule): Observable<DataChangedInfo>;
18
- evaluateAggregationExpression(aggregationExpression: string, module: AdaptableModule): Observable<DataChangedInfo>;
21
+ evaluateAggregatedBooleanExpression(aggregationExpression: string, module: AdaptableModule): Observable<DataChangedInfo>;
19
22
  validateBoolean(expressionInput: string, module: AdaptableModule, config?: {
20
23
  force?: boolean;
21
24
  }): {
@@ -26,7 +29,11 @@ export declare class QueryLanguageService implements IQueryLanguageService {
26
29
  isValid: boolean;
27
30
  errorMessage: string;
28
31
  };
29
- validateAggregation(expressionInput: string, module: AdaptableModule): {
32
+ validateAggregatedBoolean(expressionInput: string, module: AdaptableModule): {
33
+ isValid: boolean;
34
+ errorMessage: string;
35
+ };
36
+ validateAggregatedScalar(expressionInput: string, module: AdaptableModule): {
30
37
  isValid: boolean;
31
38
  errorMessage: string;
32
39
  };
@@ -10,7 +10,8 @@ class QueryLanguageService {
10
10
  this.adaptable = adaptable;
11
11
  this.cacheBooleanValidation = new Map();
12
12
  this.cacheObservableValidation = new Map();
13
- this.cacheAggregationValidation = new Map();
13
+ this.cacheAggregatedBooleanValidation = new Map();
14
+ this.cacheAggregatedScalarValidation = new Map();
14
15
  this.cacheModuleSpecificExpressionFunctions = new Map();
15
16
  }
16
17
  evaluateBooleanExpression(expression, module, rowNode) {
@@ -26,6 +27,14 @@ class QueryLanguageService {
26
27
  // currently scalar and boolean expressions are evaluated the same
27
28
  return this.evaluateBooleanExpression(expression, module, rowNode);
28
29
  }
30
+ evaluateAggregatedScalarExpression(expression, module) {
31
+ const aggregatedScalarFunctions = this.getModuleExpressionFunctions(module).aggregatedScalarFunctions;
32
+ return parser.evaluate(expression, {
33
+ node: null,
34
+ api: this.adaptable.api,
35
+ functions: aggregatedScalarFunctions,
36
+ });
37
+ }
29
38
  evaluateObservableExpression(reactiveExpression, module) {
30
39
  const moduleExpressionFunctions = this.getModuleExpressionFunctions(module);
31
40
  const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
@@ -37,13 +46,13 @@ class QueryLanguageService {
37
46
  });
38
47
  return reactiveExpression$;
39
48
  }
40
- evaluateAggregationExpression(aggregationExpression, module) {
49
+ evaluateAggregatedBooleanExpression(aggregationExpression, module) {
41
50
  const moduleExpressionFunctions = this.getModuleExpressionFunctions(module);
42
51
  const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
43
52
  const aggregationExpression$ = parser.evaluate(aggregationExpression, {
44
53
  node: aggregationExpression,
45
54
  api: this.adaptable.api,
46
- functions: moduleExpressionFunctions.aggregationFunctions,
55
+ functions: moduleExpressionFunctions.aggregatedBooleanFunctions,
47
56
  whereClauseFunctions: booleanAndScalarFunctions,
48
57
  });
49
58
  return aggregationExpression$;
@@ -57,13 +66,16 @@ class QueryLanguageService {
57
66
  }
58
67
  const expression = expressionInput.trim();
59
68
  if (expression === '') {
60
- const result = { isValid: false, errorMessage: 'empty boolean expression' };
69
+ const result = {
70
+ isValid: false,
71
+ errorMessage: 'empty boolean expression',
72
+ };
61
73
  this.cacheBooleanValidation.set(cacheKey, result);
62
74
  return result;
63
75
  }
64
76
  const force = (_a = config === null || config === void 0 ? void 0 : config.force) !== null && _a !== void 0 ? _a : false;
65
77
  // get searchOptions to see if validation should be performed
66
- if (!this.adaptable.api.internalApi.getAdaptableOptions().queryLanguageOptions
78
+ if (!this.adaptable.api.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
67
79
  .performExpressionValidation &&
68
80
  !force) {
69
81
  const result = { isValid: true, errorMessage: '' };
@@ -113,7 +125,10 @@ class QueryLanguageService {
113
125
  }
114
126
  const expression = expressionInput.trim();
115
127
  if (expression === '') {
116
- const result = { isValid: false, errorMessage: 'empty observable expression' };
128
+ const result = {
129
+ isValid: false,
130
+ errorMessage: 'empty observable expression',
131
+ };
117
132
  this.cacheObservableValidation.set(cacheKey, result);
118
133
  return result;
119
134
  }
@@ -140,29 +155,70 @@ class QueryLanguageService {
140
155
  return result;
141
156
  }
142
157
  }
143
- validateAggregation(expressionInput = '', module) {
158
+ validateAggregatedBoolean(expressionInput = '', module) {
144
159
  const cacheKey = this.getExpressionCacheKey(expressionInput, module);
145
- if (this.cacheAggregationValidation.has(cacheKey)) {
146
- return this.cacheAggregationValidation.get(cacheKey);
160
+ if (this.cacheAggregatedBooleanValidation.has(cacheKey)) {
161
+ return this.cacheAggregatedBooleanValidation.get(cacheKey);
147
162
  }
148
163
  const expression = expressionInput.trim();
149
164
  if (expression === '') {
150
- const result = { isValid: false, errorMessage: 'empty aggregation expression' };
151
- this.cacheAggregationValidation.set(cacheKey, result);
165
+ const result = {
166
+ isValid: false,
167
+ errorMessage: 'empty AggregatedBoolean expression',
168
+ };
169
+ this.cacheAggregatedBooleanValidation.set(cacheKey, result);
170
+ return result;
171
+ }
172
+ try {
173
+ const aggregatedBooleanExpressionEvaluation = this.evaluateAggregatedBooleanExpression(expression, module);
174
+ if (!rxjs_1.isObservable(aggregatedBooleanExpressionEvaluation)) {
175
+ const result = {
176
+ isValid: false,
177
+ errorMessage: `provided AggregatedBoolean expression does not evaluate to an Observable`,
178
+ };
179
+ this.cacheAggregatedBooleanValidation.set(cacheKey, result);
180
+ return result;
181
+ }
182
+ const result = { isValid: true, errorMessage: '' };
183
+ this.cacheAggregatedBooleanValidation.set(cacheKey, result);
184
+ return result;
185
+ }
186
+ catch (error) {
187
+ const result = {
188
+ isValid: false,
189
+ errorMessage: error,
190
+ };
191
+ this.cacheAggregatedBooleanValidation.set(cacheKey, result);
192
+ return result;
193
+ }
194
+ }
195
+ validateAggregatedScalar(expressionInput = '', module) {
196
+ const cacheKey = this.getExpressionCacheKey(expressionInput, module);
197
+ if (this.cacheAggregatedScalarValidation.has(cacheKey)) {
198
+ return this.cacheAggregatedScalarValidation.get(cacheKey);
199
+ }
200
+ const expression = expressionInput.trim();
201
+ if (expression === '') {
202
+ const result = {
203
+ isValid: false,
204
+ errorMessage: 'empty AggregatedScalar expression',
205
+ };
206
+ this.cacheAggregatedScalarValidation.set(cacheKey, result);
152
207
  return result;
153
208
  }
154
209
  try {
155
- const aggregationExpression = this.evaluateAggregationExpression(expression, module);
156
- if (!rxjs_1.isObservable(aggregationExpression)) {
210
+ const evaluationResult = this.evaluateAggregatedScalarExpression(expression, module);
211
+ if (evaluationResult.type !== 'aggregation') {
157
212
  const result = {
158
213
  isValid: false,
159
- errorMessage: `provided aggregation expression does not evaluate to an Observable`,
214
+ errorMessage: 'provided AggregatedScalar expression does not evaluate to a supported aggregation',
160
215
  };
161
- this.cacheAggregationValidation.set(cacheKey, result);
216
+ this.cacheAggregatedScalarValidation.set(cacheKey, result);
162
217
  return result;
163
218
  }
219
+ // no exception,so everything seems to be fine
164
220
  const result = { isValid: true, errorMessage: '' };
165
- this.cacheAggregationValidation.set(cacheKey, result);
221
+ this.cacheAggregatedScalarValidation.set(cacheKey, result);
166
222
  return result;
167
223
  }
168
224
  catch (error) {
@@ -170,7 +226,7 @@ class QueryLanguageService {
170
226
  isValid: false,
171
227
  errorMessage: error,
172
228
  };
173
- this.cacheAggregationValidation.set(cacheKey, result);
229
+ this.cacheAggregatedScalarValidation.set(cacheKey, result);
174
230
  return result;
175
231
  }
176
232
  }
@@ -183,30 +239,38 @@ class QueryLanguageService {
183
239
  // Returns the ExpressionFunctions available for the given Module as specified in the `QueryLanguageOptions.moduleExpressionFunctions`
184
240
  // if there are no specific functions defined, it falls back to the default values
185
241
  getModuleExpressionFunctions(module) {
186
- var _a, _b, _c, _d, _e, _f;
242
+ var _a, _b, _c, _d, _e, _f, _g;
187
243
  if (!module) {
188
244
  LoggingHelper_1.LogAdaptableInfo(`QueryLanguageService.getModuleExpressionFunctions() was called with an undefined 'module' param, this should never happen`);
189
245
  return {
190
- booleanFunctions: this.adaptable.adaptableOptions.queryLanguageOptions
246
+ booleanFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
191
247
  .defaultBooleanFunctions,
192
- scalarFunctions: this.adaptable.adaptableOptions.queryLanguageOptions
248
+ scalarFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
193
249
  .defaultScalarFunctions,
194
- observableFunctions: this.adaptable.adaptableOptions.queryLanguageOptions
250
+ observableFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
195
251
  .defaultObservableFunctions,
196
- aggregationFunctions: this.adaptable.adaptableOptions.queryLanguageOptions
197
- .defaultAggregationFunctions,
252
+ aggregatedBooleanFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
253
+ .defaultAggregatedBooleanFunctions,
254
+ aggregatedScalarFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
255
+ .defaultAggregatedScalarFunctions,
198
256
  };
199
257
  }
200
258
  let cachedResult = this.cacheModuleSpecificExpressionFunctions.get(module);
201
259
  if (cachedResult) {
202
260
  return cachedResult;
203
261
  }
204
- const moduleSpecificOptions = (_b = (_a = this.adaptable.adaptableOptions.queryLanguageOptions.moduleExpressionFunctions) === null || _a === void 0 ? void 0 : _a[module]) !== null && _b !== void 0 ? _b : {};
262
+ const moduleSpecificOptions = (_b = (_a = this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
263
+ .moduleExpressionFunctions) === null || _a === void 0 ? void 0 : _a[module]) !== null && _b !== void 0 ? _b : {};
205
264
  const moduleSpecificFunctions = {
206
- booleanFunctions: (_c = moduleSpecificOptions.booleanFunctions) !== null && _c !== void 0 ? _c : this.adaptable.adaptableOptions.queryLanguageOptions.defaultBooleanFunctions,
207
- scalarFunctions: (_d = moduleSpecificOptions.scalarFunctions) !== null && _d !== void 0 ? _d : this.adaptable.adaptableOptions.queryLanguageOptions.defaultScalarFunctions,
208
- observableFunctions: (_e = moduleSpecificOptions.observableFunctions) !== null && _e !== void 0 ? _e : this.adaptable.adaptableOptions.queryLanguageOptions.defaultObservableFunctions,
209
- aggregationFunctions: (_f = moduleSpecificOptions.aggregationFunctions) !== null && _f !== void 0 ? _f : this.adaptable.adaptableOptions.queryLanguageOptions.defaultAggregationFunctions,
265
+ booleanFunctions: (_c = moduleSpecificOptions.booleanFunctions) !== null && _c !== void 0 ? _c : this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
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
269
+ .defaultObservableFunctions,
270
+ aggregatedBooleanFunctions: (_f = moduleSpecificOptions.aggregatedBooleanFunctions) !== null && _f !== void 0 ? _f : this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
271
+ .defaultAggregatedBooleanFunctions,
272
+ aggregatedScalarFunctions: (_g = moduleSpecificOptions.aggregatedScalarFunctions) !== null && _g !== void 0 ? _g : this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
273
+ .defaultAggregatedScalarFunctions,
210
274
  };
211
275
  this.cacheModuleSpecificExpressionFunctions.set(module, moduleSpecificFunctions);
212
276
  return moduleSpecificFunctions;
@@ -305,7 +305,9 @@ class ReportService {
305
305
  // if this is a date column and there is a custom export date format provided, that will take precedence
306
306
  if (columnType === 'Date' && !!this.getCustomExportDateFormat()) {
307
307
  const exportDateFormat = this.getCustomExportDateFormat();
308
- return FormatHelper_1.default.DateFormatter(cellRawValue, { Pattern: exportDateFormat });
308
+ return FormatHelper_1.default.DateFormatter(cellRawValue, {
309
+ Pattern: exportDateFormat,
310
+ });
309
311
  }
310
312
  // otherwise check the general export format types
311
313
  let cellExportFormat = this.computeCellExportValueFormat(columnType);
@@ -314,7 +316,9 @@ class ReportService {
314
316
  getReportFileName(reportName) {
315
317
  let fileName = StringExtensions_1.default.ReplaceEmptySpacesWithUnderscore(reportName);
316
318
  if (this.adaptable.adaptableOptions.exportOptions.appendFileTimestamp) {
317
- fileName = `${fileName}_${FormatHelper_1.DateFormatter(new Date(), { Pattern: 'yyyyMMdd_HHmmss' })}`;
319
+ fileName = `${fileName}_${FormatHelper_1.DateFormatter(new Date(), {
320
+ Pattern: 'yyyyMMdd_HHmmss',
321
+ })}`;
318
322
  }
319
323
  return fileName;
320
324
  }
@@ -45,7 +45,10 @@ class TeamSharingService {
45
45
  .includes(reference.Reference.Uuid));
46
46
  const newSharedEntityDependencies = [];
47
47
  freshReferences.forEach((reference) => {
48
- this.createSharedEntity(reference.Reference, reference.Module, { description: activeSharedEntity.Description, type: activeSharedEntity.Type }, activeSharedEntity.UserName, Date.now(), newSharedEntityDependencies);
48
+ this.createSharedEntity(reference.Reference, reference.Module, {
49
+ description: activeSharedEntity.Description,
50
+ type: activeSharedEntity.Type,
51
+ }, activeSharedEntity.UserName, Date.now(), newSharedEntityDependencies);
49
52
  });
50
53
  updatedEntityDependencyIds.push(...newSharedEntityDependencies.map((sharedEntity) => sharedEntity.Uuid));
51
54
  activeSharedEntity.EntityDependencyIds = updatedEntityDependencyIds;
@@ -84,8 +87,7 @@ class TeamSharingService {
84
87
  }
85
88
  getStaleActiveSharedEntities() {
86
89
  const sharedEntities = this.adaptable.api.teamSharingApi.getSharedEntities();
87
- const activeEntities = this.adaptable.api.teamSharingApi.getTeamSharingState()
88
- .ActiveSharedEntityMap;
90
+ const activeEntities = this.adaptable.api.teamSharingApi.getTeamSharingState().ActiveSharedEntityMap;
89
91
  const result = {};
90
92
  sharedEntities
91
93
  .filter((sharedEntity) => sharedEntity.Type === 'Active')
@@ -17,7 +17,12 @@ class AdaptablePopover extends React.Component {
17
17
  const title = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.headerText)
18
18
  ? this.props.headerText
19
19
  : '';
20
- const popoverClickRootClose = (React.createElement(rebass_1.Box, { className: "ab-Popover", style: { margin: '0px', padding: '0px', minWidth: popoverMinWidth, maxWidth: 300 } },
20
+ const popoverClickRootClose = (React.createElement(rebass_1.Box, { className: "ab-Popover", style: {
21
+ margin: '0px',
22
+ padding: '0px',
23
+ minWidth: popoverMinWidth,
24
+ maxWidth: 300,
25
+ } },
21
26
  title ? (React.createElement(rebass_1.Text, { fontSize: 2, padding: 2 },
22
27
  React.createElement("b", null, title))) : null,
23
28
  React.createElement(rebass_1.Box, { padding: 2 }, this.props.bodyText.map((textOrHTML, index) => (React.createElement("span", { key: index }, textOrHTML))))));
@@ -22,7 +22,7 @@ class AdaptableView extends React.Component {
22
22
  return (React.createElement("div", null,
23
23
  this.props.AdaptableApi.internalApi.getModuleService().isModuleAvailable('Dashboard') && (React.createElement(Dashboard_1.Dashboard, { api: this.props.AdaptableApi })),
24
24
  React.createElement(AdaptableLoadingScreen_1.AdaptableLoadingScreen, { onClose: this.props.onCloseLoadingPopup, showLoadingScreen: this.props.PopupState.LoadingPopup.ShowLoadingPopup }),
25
- React.createElement(AdaptablePopupPrompt_1.AdaptablePopupPrompt, { message: this.props.PopupState.PromptPopup.Message, header: this.props.PopupState.PromptPopup.Header, onClose: this.props.onClosePromptPopup, onConfirm: this.props.onConfirmPromptPopup, showPopup: this.props.PopupState.PromptPopup.ShowPromptPopup }),
25
+ this.props.PopupState.PromptPopup.ShowPromptPopup && (React.createElement(AdaptablePopupPrompt_1.AdaptablePopupPrompt, { message: this.props.PopupState.PromptPopup.Message, header: this.props.PopupState.PromptPopup.Header, onClose: this.props.onClosePromptPopup, onConfirm: this.props.onConfirmPromptPopup, onConfirmActionCreator: this.props.PopupState.PromptPopup.ConfirmActionCreator, defaultValue: this.props.PopupState.PromptPopup.DefaultValue })),
26
26
  React.createElement(AdaptablePopupConfirmation_1.AdaptablePopupConfirmation, { header: this.props.PopupState.ConfirmationPopup.Header, messsage: this.props.PopupState.ConfirmationPopup.Msg, showPopup: this.props.PopupState.ConfirmationPopup.ShowConfirmationPopup, cancelButtonText: this.props.PopupState.ConfirmationPopup.CancelButtonText, confirmButtonText: this.props.PopupState.ConfirmationPopup.ConfirmButtonText, onCancel: this.props.onCancelConfirmationPopup, onConfirm: this.props.onConfirmConfirmationPopup, showInputBox: this.props.PopupState.ConfirmationPopup.ShowInputBox, messageType: this.props.PopupState.ConfirmationPopup.MessageType, api: this.props.AdaptableApi }),
27
27
  Boolean(this.props.PopupState.ScreenPopup.ShowScreenPopup) && (React.createElement(AdaptablePopup_1.AdaptablePopup, { componentName: this.props.PopupState.ScreenPopup.ComponentName, componentModule: this.props.PopupState.ScreenPopup.ComponentModule, onHide: this.props.onCloseScreenPopup, api: this.props.AdaptableApi, onClearParams: () => this.props.onClearPopupParams(), moduleParams: this.props.PopupState.ScreenPopup.Params, moduleProps: this.props.PopupState.ScreenPopup.PopupProps })),
28
28
  React.createElement(ExportCustomDestinationFormPopups_1.ExportCustomDestinationFormPopups, { api: this.props.AdaptableApi }),
@@ -26,7 +26,11 @@ const dataTypes = [
26
26
  label: 'Boolean',
27
27
  },
28
28
  ];
29
- const inputStyle = { width: '100%', minWidth: 50, textAlign: 'start' };
29
+ const inputStyle = {
30
+ width: '100%',
31
+ minWidth: 50,
32
+ textAlign: 'start',
33
+ };
30
34
  const useForceRender = () => {
31
35
  const [, setNow] = react_1.useState(Date.now());
32
36
  return () => {