@adaptabletools/adaptable 18.0.0-canary.0 → 18.0.0-canary.10

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 (261) hide show
  1. package/agGrid.d.ts +4 -21
  2. package/agGrid.js +9 -26
  3. package/base.css +11 -3
  4. package/base.css.map +1 -1
  5. package/index.css +88 -70
  6. package/index.css.map +1 -1
  7. package/package.json +4 -5
  8. package/src/AdaptableInterfaces/IAdaptable.d.ts +61 -108
  9. package/src/AdaptableOptions/AdaptableOptions.d.ts +12 -6
  10. package/src/AdaptableOptions/ColumnFilterOptions.d.ts +4 -4
  11. package/src/AdaptableOptions/ColumnOptions.d.ts +4 -2
  12. package/src/AdaptableOptions/{CommentsOptions.d.ts → CommentOptions.d.ts} +5 -5
  13. package/src/AdaptableOptions/MenuOptions.d.ts +1 -1
  14. package/src/AdaptableOptions/MenuOptions.js +1 -5
  15. package/src/AdaptableOptions/{NotesOptions.d.ts → NoteOptions.d.ts} +1 -1
  16. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +17 -0
  17. package/src/Api/AdaptableApi.d.ts +5 -0
  18. package/src/Api/BulkUpdateApi.d.ts +0 -5
  19. package/src/Api/ConfigApi.d.ts +1 -1
  20. package/src/Api/Events/AdaptableReady.d.ts +3 -3
  21. package/src/Api/Events/GridDataChanged.d.ts +4 -4
  22. package/src/Api/GridApi.d.ts +18 -13
  23. package/src/Api/Implementation/ActionColumnApiImpl.d.ts +2 -0
  24. package/src/Api/Implementation/ActionColumnApiImpl.js +33 -0
  25. package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -0
  26. package/src/Api/Implementation/AdaptableApiImpl.js +3 -0
  27. package/src/Api/Implementation/ApiBase.d.ts +2 -1
  28. package/src/Api/Implementation/ApiBase.js +4 -1
  29. package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +0 -1
  30. package/src/Api/Implementation/BulkUpdateApiImpl.js +0 -4
  31. package/src/Api/Implementation/CommentsApiImpl.d.ts +4 -0
  32. package/src/Api/Implementation/CommentsApiImpl.js +7 -1
  33. package/src/Api/Implementation/ConfigApiImpl.js +13 -5
  34. package/src/Api/Implementation/GridApiImpl.d.ts +4 -3
  35. package/src/Api/Implementation/GridApiImpl.js +33 -14
  36. package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
  37. package/src/Api/Implementation/LayoutApiImpl.js +15 -0
  38. package/src/Api/Implementation/NotesApiImpl.d.ts +6 -4
  39. package/src/Api/Implementation/NotesApiImpl.js +9 -8
  40. package/src/Api/Implementation/OptionsApiImpl.d.ts +2 -1
  41. package/src/Api/Implementation/OptionsApiImpl.js +12 -2
  42. package/src/Api/Implementation/ScopeApiImpl.d.ts +2 -0
  43. package/src/Api/Implementation/ScopeApiImpl.js +20 -7
  44. package/src/Api/Implementation/StatusBarApiImpl.d.ts +0 -1
  45. package/src/Api/Implementation/StatusBarApiImpl.js +0 -3
  46. package/src/Api/Implementation/ToolPanelApiImpl.js +6 -6
  47. package/src/Api/Internal/ActionRowInternalApi.d.ts +5 -1
  48. package/src/Api/Internal/ActionRowInternalApi.js +106 -0
  49. package/src/Api/Internal/AdaptableInternalApi.d.ts +3 -4
  50. package/src/Api/Internal/AdaptableInternalApi.js +10 -8
  51. package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
  52. package/src/Api/Internal/CalculatedColumnInternalApi.js +70 -0
  53. package/src/Api/Internal/ColumnFilterInternalApi.d.ts +1 -0
  54. package/src/Api/Internal/ColumnFilterInternalApi.js +11 -1
  55. package/src/Api/Internal/ColumnInternalApi.d.ts +4 -1
  56. package/src/Api/Internal/ColumnInternalApi.js +12 -0
  57. package/src/Api/Internal/CommentsInternalApi.d.ts +4 -0
  58. package/src/Api/Internal/CommentsInternalApi.js +14 -0
  59. package/src/Api/Internal/CustomSortInternalApi.d.ts +3 -2
  60. package/src/Api/Internal/CustomSortInternalApi.js +32 -1
  61. package/src/Api/Internal/DataSetInternalApi.js +1 -1
  62. package/src/Api/Internal/FormatColumnInternalApi.js +3 -2
  63. package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -0
  64. package/src/Api/Internal/FreeTextColumnInternalApi.js +59 -0
  65. package/src/Api/Internal/GridFilterInternalApi.js +1 -1
  66. package/src/Api/Internal/GridInternalApi.d.ts +21 -3
  67. package/src/Api/Internal/GridInternalApi.js +126 -7
  68. package/src/Api/Internal/NotesInternalApi.d.ts +4 -0
  69. package/src/Api/Internal/NotesInternalApi.js +14 -0
  70. package/src/Api/Internal/TeamSharingInternalApi.js +1 -1
  71. package/src/Api/InteropioPluginApi.d.ts +2 -2
  72. package/src/Api/LayoutApi.d.ts +11 -0
  73. package/src/Api/OptionsApi.d.ts +5 -1
  74. package/src/Api/ScopeApi.d.ts +10 -0
  75. package/src/EnvVars.d.ts +3 -0
  76. package/src/EnvVars.js +4 -0
  77. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
  78. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  79. package/src/PredefinedConfig/Common/AdaptableScope.d.ts +4 -1
  80. package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
  81. package/src/PredefinedConfig/Common/AggregationColumns.js +3 -0
  82. package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +8 -0
  83. package/src/PredefinedConfig/Common/RowSummary.d.ts +7 -0
  84. package/src/PredefinedConfig/Common/RowSummary.js +1 -0
  85. package/src/PredefinedConfig/LayoutState.d.ts +5 -0
  86. package/src/PredefinedConfig/NotesState.d.ts +10 -20
  87. package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -1
  88. package/src/PredefinedConfig/SystemState.d.ts +7 -0
  89. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +9 -0
  90. package/src/Redux/ActionsReducers/LayoutRedux.js +20 -0
  91. package/src/Redux/ActionsReducers/NotesRedux.d.ts +3 -4
  92. package/src/Redux/ActionsReducers/NotesRedux.js +11 -10
  93. package/src/Redux/ActionsReducers/SystemRedux.d.ts +5 -0
  94. package/src/Redux/ActionsReducers/SystemRedux.js +13 -1
  95. package/src/Redux/Store/AdaptableStore.d.ts +4 -6
  96. package/src/Redux/Store/AdaptableStore.js +33 -50
  97. package/src/Redux/Store/Interface/IAdaptableStore.d.ts +8 -2
  98. package/src/Strategy/AdaptableModuleBase.d.ts +2 -3
  99. package/src/Strategy/AdaptableModuleBase.js +4 -7
  100. package/src/Strategy/AlertModule.d.ts +1 -2
  101. package/src/Strategy/AlertModule.js +2 -55
  102. package/src/Strategy/CalculatedColumnModule.d.ts +2 -3
  103. package/src/Strategy/CalculatedColumnModule.js +5 -25
  104. package/src/Strategy/CellSummaryModule.d.ts +1 -0
  105. package/src/Strategy/CellSummaryModule.js +50 -21
  106. package/src/Strategy/ChartingModule.d.ts +0 -1
  107. package/src/Strategy/ChartingModule.js +2 -22
  108. package/src/Strategy/ColumnFilterModule.d.ts +1 -2
  109. package/src/Strategy/ColumnFilterModule.js +1 -64
  110. package/src/Strategy/CommentsModule.d.ts +1 -0
  111. package/src/Strategy/CommentsModule.js +5 -1
  112. package/src/Strategy/CustomSortModule.js +1 -1
  113. package/src/Strategy/DashboardModule.d.ts +1 -2
  114. package/src/Strategy/DashboardModule.js +1 -8
  115. package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
  116. package/src/Strategy/DataChangeHistoryModule.js +3 -1
  117. package/src/Strategy/DataSetModule.d.ts +1 -1
  118. package/src/Strategy/DataSetModule.js +1 -1
  119. package/src/Strategy/FlashingCellModule.d.ts +1 -2
  120. package/src/Strategy/FlashingCellModule.js +2 -15
  121. package/src/Strategy/FormatColumnModule.d.ts +0 -2
  122. package/src/Strategy/FormatColumnModule.js +0 -47
  123. package/src/Strategy/FreeTextColumnModule.d.ts +0 -1
  124. package/src/Strategy/FreeTextColumnModule.js +0 -30
  125. package/src/Strategy/GridFilterModule.d.ts +0 -1
  126. package/src/Strategy/GridFilterModule.js +0 -37
  127. package/src/Strategy/Interface/IModule.d.ts +0 -1
  128. package/src/Strategy/LayoutModule.d.ts +8 -3
  129. package/src/Strategy/LayoutModule.js +108 -53
  130. package/src/Strategy/NamedQueryModule.d.ts +0 -1
  131. package/src/Strategy/NamedQueryModule.js +0 -19
  132. package/src/Strategy/NotesModule.js +3 -4
  133. package/src/Strategy/PlusMinusModule.d.ts +1 -1
  134. package/src/Strategy/PlusMinusModule.js +1 -1
  135. package/src/Strategy/ScheduleModule.d.ts +1 -1
  136. package/src/Strategy/ScheduleModule.js +1 -1
  137. package/src/Strategy/ShortcutModule.d.ts +1 -1
  138. package/src/Strategy/ShortcutModule.js +1 -1
  139. package/src/Strategy/StyledColumnModule.d.ts +0 -1
  140. package/src/Strategy/StyledColumnModule.js +0 -21
  141. package/src/Strategy/TeamSharingModule.d.ts +1 -0
  142. package/src/Strategy/TeamSharingModule.js +5 -5
  143. package/src/Strategy/ToolPanelModule.d.ts +0 -1
  144. package/src/Strategy/ToolPanelModule.js +0 -23
  145. package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
  146. package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
  147. package/src/Utilities/Constants/GeneralConstants.js +1 -0
  148. package/src/Utilities/Defaults/DefaultSettingsPanel.js +5 -4
  149. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +2 -1
  150. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +294 -0
  151. package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +1 -1
  152. package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
  153. package/src/Utilities/Extensions/ArrayExtensions.js +4 -0
  154. package/src/Utilities/Helpers/AdaptableHelper.d.ts +3 -4
  155. package/src/Utilities/Helpers/AdaptableHelper.js +18 -58
  156. package/src/Utilities/Helpers/Helper.d.ts +2 -0
  157. package/src/Utilities/Helpers/Helper.js +4 -0
  158. package/src/Utilities/ObjectFactory.js +6 -6
  159. package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +3 -2
  160. package/src/Utilities/Services/AggregatedScalarLiveValue.js +14 -9
  161. package/src/Utilities/Services/CellPopupService.js +0 -1
  162. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
  163. package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
  164. package/src/Utilities/Services/LicenseService/index.js +19 -7
  165. package/src/Utilities/Services/MetamodelService.d.ts +1 -1
  166. package/src/Utilities/Services/MetamodelService.js +6 -3
  167. package/src/Utilities/Services/QueryLanguageService.d.ts +1 -1
  168. package/src/Utilities/Services/QueryLanguageService.js +2 -1
  169. package/src/Utilities/Services/RowEditService.d.ts +3 -2
  170. package/src/Utilities/Services/RowEditService.js +3 -1
  171. package/src/Utilities/Services/SummaryService.d.ts +19 -0
  172. package/src/Utilities/Services/SummaryService.js +29 -0
  173. package/src/View/AdaptableView.js +1 -3
  174. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
  175. package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
  176. package/src/View/CalculatedColumn/utils.d.ts +1 -1
  177. package/src/View/CellSummary/CellSummaryPopup.js +1 -1
  178. package/src/View/Comments/CommentsPopup.js +12 -8
  179. package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
  180. package/src/View/Components/NewScopeComponent.js +34 -1
  181. package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
  182. package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
  183. package/src/View/Components/Popups/AdaptableToaster.js +1 -1
  184. package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +1 -1
  185. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
  186. package/src/View/Components/Popups/WindowPopups/windowFactory.js +3 -0
  187. package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
  188. package/src/View/CustomSort/CustomSortSummary.js +1 -1
  189. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +8 -8
  190. package/src/View/GridFilter/GridFilterViewPanel.js +46 -8
  191. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
  192. package/src/View/Layout/TransposedPopup.d.ts +3 -0
  193. package/src/View/Layout/TransposedPopup.js +194 -0
  194. package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
  195. package/src/View/Notes/NotesPopup.js +9 -11
  196. package/src/View/SpecialColumnSettingsWizardStep.js +4 -4
  197. package/src/View/Theme/ThemeSelector.js +3 -3
  198. package/src/agGrid/ActionColumnRenderer.js +7 -6
  199. package/src/agGrid/Adaptable.d.ts +3 -455
  200. package/src/agGrid/Adaptable.js +8 -5292
  201. package/src/agGrid/AdaptableAgGrid.d.ts +351 -0
  202. package/src/agGrid/AdaptableAgGrid.js +3936 -0
  203. package/src/agGrid/AdaptableLogger.js +77 -11
  204. package/src/agGrid/AgGridAdapter.d.ts +62 -0
  205. package/src/agGrid/AgGridAdapter.js +577 -0
  206. package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
  207. package/src/agGrid/AgGridColumnAdapter.js +824 -0
  208. package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
  209. package/src/agGrid/AgGridMenuAdapter.js +271 -0
  210. package/src/agGrid/AgGridOptionsService.d.ts +12 -0
  211. package/src/agGrid/AgGridOptionsService.js +54 -0
  212. package/src/agGrid/BadgeRenderer.js +1 -1
  213. package/src/agGrid/CheckboxRenderer.js +1 -1
  214. package/src/agGrid/FilterWrapper.d.ts +2 -2
  215. package/src/agGrid/FilterWrapper.js +1 -1
  216. package/src/agGrid/attachAddaptableColumnTypes.d.ts +12 -12
  217. package/src/agGrid/defaultAdaptableOptions.d.ts +3 -0
  218. package/src/{Utilities/Defaults/DefaultAdaptableOptions.js → agGrid/defaultAdaptableOptions.js} +70 -9
  219. package/src/agGrid/editors/AdaptableDateEditor/index.js +2 -2
  220. package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
  221. package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
  222. package/src/components/Datepicker/index.d.ts +1 -1
  223. package/src/components/InfiniteTable/index.js +2 -2
  224. package/src/components/Input/index.d.ts +1 -1
  225. package/src/components/List/ListGroupItem/index.d.ts +1 -1
  226. package/src/components/Modal/index.d.ts +1 -0
  227. package/src/components/Modal/index.js +4 -3
  228. package/src/components/Select/Select.d.ts +2 -0
  229. package/src/components/Select/Select.js +2 -2
  230. package/src/components/Textarea/index.d.ts +9 -0
  231. package/src/components/Textarea/index.js +50 -2
  232. package/src/components/icons/index.js +2 -0
  233. package/src/components/icons/rows.d.ts +3 -0
  234. package/src/components/icons/rows.js +4 -0
  235. package/src/env.js +2 -2
  236. package/src/metamodel/adaptable.metamodel.d.ts +74 -11
  237. package/src/metamodel/adaptable.metamodel.js +157 -34
  238. package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
  239. package/src/migration/AdaptableUpgradeHelper.js +48 -0
  240. package/src/migration/VersionUpgrade.d.ts +8 -0
  241. package/src/migration/VersionUpgrade.js +11 -0
  242. package/src/migration/VersionUpgrade17.d.ts +18 -0
  243. package/src/migration/VersionUpgrade17.js +342 -0
  244. package/src/migration/VersionUpgrade18.d.ts +5 -0
  245. package/src/migration/VersionUpgrade18.js +6 -0
  246. package/src/parser/src/types.d.ts +5 -0
  247. package/src/types.d.ts +7 -3
  248. package/tsconfig.esm.tsbuildinfo +1 -1
  249. package/src/Utilities/Defaults/DefaultAdaptableOptions.d.ts +0 -2
  250. package/src/Utilities/Services/Interface/IRowEditService.d.ts +0 -3
  251. package/src/Utilities/Services/Interface/IRowEditService.js +0 -1
  252. package/src/View/Components/ScopeComponent.d.ts +0 -24
  253. package/src/View/Components/ScopeComponent.js +0 -133
  254. package/src/View/Export/Wizard/ReportScopeWizard.d.ts +0 -17
  255. package/src/View/Export/Wizard/ReportScopeWizard.js +0 -47
  256. package/src/agGrid/agGridHelper.d.ts +0 -57
  257. package/src/agGrid/agGridHelper.js +0 -686
  258. package/src/agGrid/agGridMenuHelper.d.ts +0 -46
  259. package/src/agGrid/agGridMenuHelper.js +0 -668
  260. /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
  261. /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
@@ -1,6 +1,7 @@
1
1
  import { extractColumnParameter, extractColumnParameters, extractParameter, getNumericValue, handleColumnFunction, validateColumnType, } from './expressionFunctionUtils';
2
2
  import { ExpressionEvaluationError } from '../../parser/src/ExpressionEvaluationError';
3
3
  import { getTypedKeys } from '../Extensions/TypeExtensions';
4
+ import { SumArray } from '../Extensions/ArrayExtensions';
4
5
  export const aggregatedExpressionFunctions = [
5
6
  'SUM',
6
7
  'PERCENTAGE',
@@ -11,6 +12,11 @@ export const aggregatedExpressionFunctions = [
11
12
  'WEIGHT',
12
13
  'COL',
13
14
  'GROUP_BY',
15
+ 'MEDIAN',
16
+ 'MODE',
17
+ 'DISTINCT',
18
+ 'ONLY',
19
+ 'STD_DEVIATION',
14
20
  ];
15
21
  export const cumulativeAggregatedExpressionFunctions = [
16
22
  'CUMUL',
@@ -77,6 +83,8 @@ export const aggregatedScalarExpressionFunctions = {
77
83
  field: sumColumnName,
78
84
  initialValue: 0,
79
85
  reducer: (totalSum, rowValue) => {
86
+ // TODO: see why error are not concole logged
87
+ // debuger = 'Adaptable:*'
80
88
  if (isUndefinedValue(rowValue)) {
81
89
  return totalSum;
82
90
  }
@@ -86,6 +94,7 @@ export const aggregatedScalarExpressionFunctions = {
86
94
  },
87
95
  },
88
96
  rowFilterFn: context.filterFn,
97
+ getRowNodes: context.getRowNodes,
89
98
  };
90
99
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
91
100
  const result = {
@@ -148,6 +157,7 @@ export const aggregatedScalarExpressionFunctions = {
148
157
  100);
149
158
  },
150
159
  rowFilterFn: context.filterFn,
160
+ getRowNodes: context.getRowNodes,
151
161
  };
152
162
  addGroupByParams(groupByColumnNames, aggregationExpressionEvaluation);
153
163
  const result = {
@@ -222,6 +232,7 @@ export const aggregatedScalarExpressionFunctions = {
222
232
  },
223
233
  },
224
234
  rowFilterFn: context.filterFn,
235
+ getRowNodes: context.getRowNodes,
225
236
  };
226
237
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
227
238
  if (weightParameter) {
@@ -246,6 +257,284 @@ export const aggregatedScalarExpressionFunctions = {
246
257
  examples: ['AVG([colA])', 'AVG([colA], GROUP_BY([colB]))', 'AVG([colA], WEIGHT([colB]))'],
247
258
  category: 'aggregation',
248
259
  },
260
+ MEDIAN: {
261
+ handler(args, context) {
262
+ const medianColumnParameter = extractColumnParameter('MEDIAN', args);
263
+ const medianColumnName = medianColumnParameter.value;
264
+ validateColumnType(medianColumnName, ['Number'], 'MEDIAN', context.adaptableApi);
265
+ const groupByParameter = extractParameter('MEDIAN', 'operand', ['GROUP_BY'], args, {
266
+ isOptional: true,
267
+ });
268
+ const getCellValue = (rowNode) => {
269
+ return context.adaptableApi.gridApi.getNormalisedValueFromRowNode(rowNode, medianColumnName);
270
+ };
271
+ const aggregationExpressionEvaluation = {
272
+ aggregationParams: {
273
+ reducers: {
274
+ MEDIAN: {
275
+ name: 'MEDIAN',
276
+ field: medianColumnName,
277
+ initialValue: [],
278
+ reducer: (aggregatedValue, value, rowNode) => {
279
+ aggregatedValue.push(rowNode);
280
+ return aggregatedValue;
281
+ },
282
+ done: (aggregatedValue) => {
283
+ if (aggregatedValue.length === 0) {
284
+ return null;
285
+ }
286
+ if (aggregatedValue.length === 1) {
287
+ return getCellValue(aggregatedValue[0]);
288
+ }
289
+ const lenght = aggregatedValue.length;
290
+ const middle = Math.floor((lenght - 1) / 2);
291
+ if (lenght % 2) {
292
+ return getCellValue(aggregatedValue[middle]);
293
+ }
294
+ else {
295
+ return ((getCellValue(aggregatedValue[middle]) +
296
+ getCellValue(aggregatedValue[middle + 1])) /
297
+ 2.0);
298
+ }
299
+ },
300
+ },
301
+ },
302
+ },
303
+ rowFilterFn: context.filterFn,
304
+ getRowNodes: context.getRowNodes,
305
+ };
306
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
307
+ const result = {
308
+ name: 'MEDIAN',
309
+ type: 'aggregationScalar',
310
+ value: aggregationExpressionEvaluation,
311
+ };
312
+ return result;
313
+ },
314
+ description: 'Aggregates a column over multiple rows by computing the median of the column values\nOptionally the aggregation may be grouped.',
315
+ signatures: [
316
+ 'MEDIAN( [colName] )',
317
+ 'MEDIAN( COL(name: string))',
318
+ 'MEDIAN( [colNameA], GROUP_BY( [colNameB] ))',
319
+ 'MEDIAN( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
320
+ ],
321
+ examples: ['MEDIAN([colA])', 'MEDIAN([colA], GROUP_BY([colB]))'],
322
+ category: 'aggregation',
323
+ },
324
+ MODE: {
325
+ handler(args, context) {
326
+ const modeColumnParameter = extractColumnParameter('mode', args);
327
+ const modeColumnName = modeColumnParameter.value;
328
+ validateColumnType(modeColumnName, ['Number'], 'mode', context.adaptableApi);
329
+ const groupByParameter = extractParameter('MODE', 'operand', ['GROUP_BY'], args, {
330
+ isOptional: true,
331
+ });
332
+ const aggregationExpressionEvaluation = {
333
+ aggregationParams: {
334
+ reducers: {
335
+ MODE: {
336
+ name: 'MODE',
337
+ field: modeColumnName,
338
+ initialValue: new Map(),
339
+ reducer: (aggregatedValue, rowValue, rowNode) => {
340
+ var _a;
341
+ if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
342
+ return;
343
+ }
344
+ aggregatedValue.set(rowValue, ((_a = aggregatedValue.get(rowValue)) !== null && _a !== void 0 ? _a : 0) + 1);
345
+ return aggregatedValue;
346
+ },
347
+ done: (aggregatedValue) => {
348
+ const sorted = [...aggregatedValue.entries()].sort(([aVal, aFreq], [bVal, bFreq]) => {
349
+ if (aFreq < bFreq) {
350
+ return 1;
351
+ }
352
+ else if (aFreq > bFreq || aVal < bVal) {
353
+ return -1;
354
+ }
355
+ else {
356
+ return aVal === bVal ? 0 : 1;
357
+ }
358
+ });
359
+ return sorted[0][0];
360
+ },
361
+ },
362
+ },
363
+ },
364
+ rowFilterFn: context.filterFn,
365
+ getRowNodes: context.getRowNodes,
366
+ };
367
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
368
+ const result = {
369
+ name: 'MODE',
370
+ type: 'aggregationScalar',
371
+ value: aggregationExpressionEvaluation,
372
+ };
373
+ return result;
374
+ },
375
+ description: 'Aggregates a column over multiple rows by computing the mode of the column values\nOptionally the aggregation may be grouped.',
376
+ signatures: [
377
+ 'MODE( [colName] )',
378
+ 'MODE( COL(name: string))',
379
+ 'MODE( [colNameA], GROUP_BY( [colNameB] ))',
380
+ 'MODE( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
381
+ ],
382
+ examples: ['MODE([colA])', 'MODE([colA], GROUP_BY([colB]))'],
383
+ category: 'aggregation',
384
+ },
385
+ DISTINCT: {
386
+ handler(args, context) {
387
+ const distinctColumnParameter = extractColumnParameter('DISTINCT', args);
388
+ const distinctColumnName = distinctColumnParameter.value;
389
+ const groupByParameter = extractParameter('MODE', 'operand', ['GROUP_BY'], args, {
390
+ isOptional: true,
391
+ });
392
+ const aggregationExpressionEvaluation = {
393
+ aggregationParams: {
394
+ reducers: {
395
+ DISTINCT: {
396
+ name: 'DISTINCT',
397
+ field: distinctColumnName,
398
+ initialValue: new Set(),
399
+ reducer: (aggregatedValue, rowValue, rowNode) => {
400
+ if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
401
+ return aggregatedValue;
402
+ }
403
+ aggregatedValue.add(rowValue);
404
+ return aggregatedValue;
405
+ },
406
+ done: (aggregatedValue) => {
407
+ return aggregatedValue.size;
408
+ },
409
+ },
410
+ },
411
+ },
412
+ getRowNodes: context.getRowNodes,
413
+ };
414
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
415
+ const result = {
416
+ name: 'DISTINCT',
417
+ type: 'aggregationScalar',
418
+ value: aggregationExpressionEvaluation,
419
+ };
420
+ return result;
421
+ },
422
+ description: 'Aggregates a column over multiple rows by computing the distinct number of the column values\nOptionally the aggregation may be grouped.',
423
+ signatures: [
424
+ 'DISTINCT( [colName] )',
425
+ 'DISTINCT( COL(name: string))',
426
+ 'DISTINCT( [colNameA], GROUP_BY( [colNameB] ))',
427
+ 'DISTINCT( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
428
+ ],
429
+ examples: ['DISTINCT([colA])', 'DISTINCT([colA], GROUP_BY([colB]))'],
430
+ category: 'aggregation',
431
+ },
432
+ ONLY: {
433
+ handler(args, context) {
434
+ const distinctColumnParameter = extractColumnParameter('ONLY', args);
435
+ const onlyColumnName = distinctColumnParameter.value;
436
+ validateColumnType(onlyColumnName, ['Number'], 'ONLY', context.adaptableApi);
437
+ const groupByParameter = extractParameter('ONLY', 'operand', ['GROUP_BY'], args, {
438
+ isOptional: true,
439
+ });
440
+ const aggregationExpressionEvaluation = {
441
+ aggregationParams: {
442
+ reducers: {
443
+ ONLY: {
444
+ name: 'ONLY',
445
+ field: onlyColumnName,
446
+ initialValue: new Set(),
447
+ reducer: (aggregatedValue, rowValue, rowNode) => {
448
+ if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
449
+ return aggregatedValue;
450
+ }
451
+ aggregatedValue.add(rowValue);
452
+ return aggregatedValue;
453
+ },
454
+ done: (aggregatedValue) => {
455
+ return aggregatedValue.size === 1 ? aggregatedValue.values().next().value : null;
456
+ },
457
+ },
458
+ },
459
+ },
460
+ rowFilterFn: context.filterFn,
461
+ getRowNodes: context.getRowNodes,
462
+ };
463
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
464
+ const result = {
465
+ name: 'ONLY',
466
+ type: 'aggregationScalar',
467
+ value: aggregationExpressionEvaluation,
468
+ };
469
+ return result;
470
+ },
471
+ description: 'Aggregates a column over multiple rows by computing to a value that is common to all rows. \nOptionally the aggregation may be grouped.',
472
+ signatures: [
473
+ 'ONLY( [colName] )',
474
+ 'ONLY( COL(name: string))',
475
+ 'ONLY( [colNameA], GROUP_BY( [colNameB] ))',
476
+ 'ONLY( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
477
+ ],
478
+ examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
479
+ category: 'aggregation',
480
+ },
481
+ STD_DEVIATION: {
482
+ handler(args, context) {
483
+ const columnParameter = extractColumnParameter('STD_DEVIATION', args);
484
+ const columnName = columnParameter.value;
485
+ validateColumnType(columnName, ['Number'], 'STD_DEVIATION', context.adaptableApi);
486
+ const groupByParameter = extractParameter('STD_DEVIATION', 'operand', ['GROUP_BY'], args, {
487
+ isOptional: true,
488
+ });
489
+ const aggregationExpressionEvaluation = {
490
+ aggregationParams: {
491
+ reducers: {
492
+ STD_DEVIATION: {
493
+ name: 'STD_DEVIATION',
494
+ field: columnName,
495
+ initialValue: { sumOfValues: 0, values: [] },
496
+ reducer: (aggregatedValue, rowValue, rowNode) => {
497
+ // TODO: getNumericValue; allow numeric strings
498
+ if (typeof rowValue !== 'number' || isNaN(rowValue)) {
499
+ return aggregatedValue;
500
+ }
501
+ aggregatedValue.sumOfValues = aggregatedValue.sumOfValues + rowValue;
502
+ aggregatedValue.values.push(rowValue);
503
+ return aggregatedValue;
504
+ },
505
+ done: (aggregatedValue) => {
506
+ const { sumOfValues, values } = aggregatedValue;
507
+ if (values.length === 0) {
508
+ return 0;
509
+ }
510
+ const mean = sumOfValues / values.length;
511
+ const variance = SumArray(values.map((value) => Math.pow(value - mean, 2))) / values.length;
512
+ return Math.sqrt(variance);
513
+ },
514
+ },
515
+ },
516
+ },
517
+ rowFilterFn: context.filterFn,
518
+ getRowNodes: context.getRowNodes,
519
+ };
520
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
521
+ const result = {
522
+ name: 'STD_DEVIATION',
523
+ type: 'aggregationScalar',
524
+ value: aggregationExpressionEvaluation,
525
+ };
526
+ return result;
527
+ },
528
+ description: 'Aggregates a column over multiple rows by computing to a value that is common to all rows. \nOptionally the aggregation may be grouped.',
529
+ signatures: [
530
+ 'ONLY( [colName] )',
531
+ 'ONLY( COL(name: string))',
532
+ 'ONLY( [colNameA], GROUP_BY( [colNameB] ))',
533
+ 'ONLY( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
534
+ ],
535
+ examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
536
+ category: 'aggregation',
537
+ },
249
538
  MIN: {
250
539
  handler(args, context) {
251
540
  const minColumnParameter = extractColumnParameter('MIN', args);
@@ -277,6 +566,7 @@ export const aggregatedScalarExpressionFunctions = {
277
566
  },
278
567
  },
279
568
  rowFilterFn: context.filterFn,
569
+ getRowNodes: context.getRowNodes,
280
570
  };
281
571
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
282
572
  const result = {
@@ -327,6 +617,7 @@ export const aggregatedScalarExpressionFunctions = {
327
617
  },
328
618
  },
329
619
  rowFilterFn: context.filterFn,
620
+ getRowNodes: context.getRowNodes,
330
621
  };
331
622
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
332
623
  const result = {
@@ -445,6 +736,7 @@ export const aggregatedScalarExpressionFunctions = {
445
736
  const rowValue = context.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, quantileColumnName);
446
737
  return isDefinedValue(rowValue);
447
738
  },
739
+ getRowNodes: context.getRowNodes,
448
740
  aggregationParams: {
449
741
  reducers: {
450
742
  QUANT: Object.assign({ name: 'QUANT', field: quantileColumnName }, quantReducer),
@@ -523,6 +815,7 @@ export const aggregatedScalarExpressionFunctions = {
523
815
  },
524
816
  },
525
817
  rowFilterFn: context.filterFn,
818
+ getRowNodes: context.getRowNodes,
526
819
  };
527
820
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
528
821
  const result = {
@@ -745,6 +1038,7 @@ const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, c
745
1038
  },
746
1039
  rowValueGetter,
747
1040
  rowFilterFn: aggregationEvaluation.rowFilterFn,
1041
+ getRowNodes: context.getRowNodes,
748
1042
  };
749
1043
  return cumulationExpressionEvaluation;
750
1044
  };
@@ -8,7 +8,7 @@ export function aggregate(aggregateParams, data) {
8
8
  const deepMap = new DeepMap();
9
9
  let currentGroupKeys = [];
10
10
  const getInitialReducerValue = () => {
11
- return JSON.parse(JSON.stringify(initReducers(reducers)));
11
+ return structuredClone(initReducers(reducers));
12
12
  };
13
13
  const globalReducerResults = getInitialReducerValue();
14
14
  for (let i = 0, len = data.length; i < len; i++) {
@@ -32,6 +32,7 @@ export declare function sortCellValueArrayNumeric(cellValues: GridCell[], sortOr
32
32
  export declare function sortCellValueArrayDates(cellValues: GridCell[], sortOrder?: SortOrder): GridCell[];
33
33
  export declare function groupArrayBy(array: Array<any>, prop: string): Array<any>;
34
34
  export declare function createCommaSeparatedString(values: any[]): string;
35
+ export declare function SumArray(array: (number | undefined)[]): number;
35
36
  export declare const ArrayExtensions: {
36
37
  GetLength: typeof GetLength;
37
38
  CorrectLength: typeof CorrectLength;
@@ -65,5 +66,6 @@ export declare const ArrayExtensions: {
65
66
  sortCellValueArrayDates: typeof sortCellValueArrayDates;
66
67
  sortArrayWithProperty: typeof sortArrayWithProperty;
67
68
  createCommaSeparatedString: typeof createCommaSeparatedString;
69
+ SumArray: typeof SumArray;
68
70
  };
69
71
  export default ArrayExtensions;
@@ -254,6 +254,9 @@ export function groupArrayBy(array, prop) {
254
254
  export function createCommaSeparatedString(values) {
255
255
  return values.join(', ');
256
256
  }
257
+ export function SumArray(array) {
258
+ return array.filter((num) => typeof num === 'number' && !isNaN(num)).reduce((a, b) => a + b, 0);
259
+ }
257
260
  export const ArrayExtensions = {
258
261
  GetLength,
259
262
  CorrectLength,
@@ -287,5 +290,6 @@ export const ArrayExtensions = {
287
290
  sortCellValueArrayDates,
288
291
  sortArrayWithProperty,
289
292
  createCommaSeparatedString,
293
+ SumArray,
290
294
  };
291
295
  export default ArrayExtensions;
@@ -1,23 +1,22 @@
1
1
  import { AdaptableObject } from '../../PredefinedConfig/Common/AdaptableObject';
2
2
  import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
3
- import { AdaptableOptions } from '../../AdaptableOptions/AdaptableOptions';
4
3
  import { AdaptableComparerFunction } from '../../PredefinedConfig/Common/AdaptableComparerFunction';
5
4
  import { PredefinedConfig } from '../../PredefinedConfig/PredefinedConfig';
6
5
  import { AccessLevel } from '../../PredefinedConfig/Common/Entitlement';
7
- export declare function assignAdaptableOptions(adaptableOptions: AdaptableOptions): AdaptableOptions;
8
6
  export declare function initPredefinedConfigWithUuids(predefinedConfig: PredefinedConfig): PredefinedConfig;
9
7
  export declare function checkValidPrimaryKey(adaptable: IAdaptable): boolean;
10
8
  export declare function AdaptableObjectExistsInState(array: AdaptableObject[], itemToCheck: AdaptableObject): boolean;
11
9
  export declare function getAppropriateAccessLevel(adaptableObject: AdaptableObject, moduleAccessLevel: AccessLevel): AccessLevel;
12
10
  export declare function runAdaptableComparerFunction(columnId: string, columnValues: any[], adaptable: IAdaptable): AdaptableComparerFunction;
13
- export declare function addUuidAndSource(adaptableObject: AdaptableObject): AdaptableObject;
11
+ export declare function addUuidAndSource<T extends AdaptableObject>(adaptableObject: T): T;
12
+ export declare function removeUuidAndSource<T extends AdaptableObject>(adaptableObject: T): T;
14
13
  export declare const AdaptableHelper: {
15
- assignAdaptableOptions: typeof assignAdaptableOptions;
16
14
  initPredefinedConfigWithUuids: typeof initPredefinedConfigWithUuids;
17
15
  checkValidPrimaryKey: typeof checkValidPrimaryKey;
18
16
  AdaptableObjectExistsInState: typeof AdaptableObjectExistsInState;
19
17
  runAdaptableComparerFunction: typeof runAdaptableComparerFunction;
20
18
  getAppropriateAccessLevel: typeof getAppropriateAccessLevel;
21
19
  addUuidAndSource: typeof addUuidAndSource;
20
+ removeUuidAndSource: typeof removeUuidAndSource;
22
21
  };
23
22
  export default AdaptableHelper;
@@ -1,63 +1,6 @@
1
1
  import cloneDeepWith from 'lodash/cloneDeepWith';
2
2
  import isPlainObject from 'lodash/isPlainObject';
3
3
  import { createUuid } from '../../PredefinedConfig/Uuid';
4
- import { DefaultAdaptableOptions } from '../Defaults/DefaultAdaptableOptions';
5
- export function assignAdaptableOptions(adaptableOptions) {
6
- var _a;
7
- const returnedAdaptableOptions = Object.assign({}, DefaultAdaptableOptions, adaptableOptions);
8
- returnedAdaptableOptions.adaptableStateKey =
9
- (_a = returnedAdaptableOptions.adaptableStateKey) !== null && _a !== void 0 ? _a : returnedAdaptableOptions.adaptableId;
10
- returnedAdaptableOptions.dataImportOptions = Object.assign({}, DefaultAdaptableOptions.dataImportOptions, adaptableOptions.dataImportOptions);
11
- returnedAdaptableOptions.expressionOptions = Object.assign({}, DefaultAdaptableOptions.expressionOptions, adaptableOptions.expressionOptions);
12
- returnedAdaptableOptions.calendarOptions = Object.assign({}, DefaultAdaptableOptions.calendarOptions, adaptableOptions.calendarOptions);
13
- returnedAdaptableOptions.columnOptions = Object.assign({}, DefaultAdaptableOptions.columnOptions, adaptableOptions.columnOptions);
14
- returnedAdaptableOptions.customSortOptions = Object.assign({}, DefaultAdaptableOptions.customSortOptions, adaptableOptions.customSortOptions);
15
- returnedAdaptableOptions.dataSetOptions = Object.assign({}, DefaultAdaptableOptions.dataSetOptions, adaptableOptions.dataSetOptions);
16
- returnedAdaptableOptions.cellSummaryOptions = Object.assign({}, DefaultAdaptableOptions.cellSummaryOptions, adaptableOptions.cellSummaryOptions);
17
- returnedAdaptableOptions.predicateOptions = Object.assign({}, DefaultAdaptableOptions.predicateOptions, returnedAdaptableOptions.predicateOptions);
18
- returnedAdaptableOptions.layoutOptions = Object.assign({}, DefaultAdaptableOptions.layoutOptions, adaptableOptions.layoutOptions);
19
- returnedAdaptableOptions.notificationsOptions = Object.assign({}, DefaultAdaptableOptions.notificationsOptions, adaptableOptions.notificationsOptions);
20
- returnedAdaptableOptions.alertOptions = Object.assign({}, DefaultAdaptableOptions.alertOptions, adaptableOptions.alertOptions);
21
- returnedAdaptableOptions.flashingCellOptions = Object.assign({}, DefaultAdaptableOptions.flashingCellOptions, adaptableOptions.flashingCellOptions);
22
- returnedAdaptableOptions.entitlementOptions = Object.assign({}, DefaultAdaptableOptions.entitlementOptions, adaptableOptions.entitlementOptions);
23
- returnedAdaptableOptions.dashboardOptions = Object.assign({}, DefaultAdaptableOptions.dashboardOptions, adaptableOptions.dashboardOptions);
24
- returnedAdaptableOptions.editOptions = Object.assign({}, DefaultAdaptableOptions.editOptions, adaptableOptions.editOptions);
25
- returnedAdaptableOptions.actionColumnOptions = Object.assign({}, DefaultAdaptableOptions.actionColumnOptions, adaptableOptions.actionColumnOptions);
26
- // to do
27
- returnedAdaptableOptions.actionRowOptions = Object.assign({}, DefaultAdaptableOptions.actionRowOptions, adaptableOptions.actionRowOptions);
28
- returnedAdaptableOptions.actionRowOptions.actionRowButtonOptions = Object.assign({}, DefaultAdaptableOptions.actionRowOptions.actionRowButtonOptions, returnedAdaptableOptions.actionRowOptions.actionRowButtonOptions);
29
- returnedAdaptableOptions.actionRowOptions.actionRowFormOptions = Object.assign({}, DefaultAdaptableOptions.actionRowOptions.actionRowFormOptions, returnedAdaptableOptions.actionRowOptions.actionRowFormOptions);
30
- returnedAdaptableOptions.containerOptions = Object.assign({}, DefaultAdaptableOptions.containerOptions, adaptableOptions.containerOptions);
31
- returnedAdaptableOptions.groupingOptions = Object.assign({}, DefaultAdaptableOptions.groupingOptions, adaptableOptions.groupingOptions);
32
- returnedAdaptableOptions.quickSearchOptions = Object.assign({}, DefaultAdaptableOptions.quickSearchOptions, adaptableOptions.quickSearchOptions);
33
- returnedAdaptableOptions.columnFilterOptions = Object.assign({}, DefaultAdaptableOptions.columnFilterOptions, adaptableOptions.columnFilterOptions);
34
- returnedAdaptableOptions.columnFilterOptions.quickFilterOptions = Object.assign({}, DefaultAdaptableOptions.columnFilterOptions.quickFilterOptions, returnedAdaptableOptions.columnFilterOptions.quickFilterOptions);
35
- returnedAdaptableOptions.columnFilterOptions.filterFormOptions = Object.assign({}, DefaultAdaptableOptions.columnFilterOptions.filterFormOptions, returnedAdaptableOptions.columnFilterOptions.filterFormOptions);
36
- returnedAdaptableOptions.columnFilterOptions.valuesFilterOptions = Object.assign({}, DefaultAdaptableOptions.columnFilterOptions.valuesFilterOptions, returnedAdaptableOptions.columnFilterOptions.valuesFilterOptions);
37
- returnedAdaptableOptions.gridFilterOptions = Object.assign({}, DefaultAdaptableOptions.gridFilterOptions, adaptableOptions.gridFilterOptions);
38
- returnedAdaptableOptions.userInterfaceOptions = Object.assign({}, DefaultAdaptableOptions.userInterfaceOptions, adaptableOptions.userInterfaceOptions);
39
- returnedAdaptableOptions.userInterfaceOptions.dateInputOptions = Object.assign({}, DefaultAdaptableOptions.userInterfaceOptions.dateInputOptions, returnedAdaptableOptions.userInterfaceOptions.dateInputOptions);
40
- returnedAdaptableOptions.menuOptions = Object.assign({}, DefaultAdaptableOptions.menuOptions, adaptableOptions.menuOptions);
41
- returnedAdaptableOptions.stateOptions = Object.assign({}, DefaultAdaptableOptions.stateOptions, adaptableOptions.stateOptions);
42
- returnedAdaptableOptions.exportOptions = Object.assign({}, DefaultAdaptableOptions.exportOptions, adaptableOptions.exportOptions);
43
- returnedAdaptableOptions.teamSharingOptions = Object.assign({}, DefaultAdaptableOptions.teamSharingOptions, adaptableOptions.teamSharingOptions);
44
- returnedAdaptableOptions.toolPanelOptions = Object.assign({}, DefaultAdaptableOptions.toolPanelOptions, adaptableOptions.toolPanelOptions);
45
- returnedAdaptableOptions.dataChangeHistoryOptions = Object.assign({}, DefaultAdaptableOptions.dataChangeHistoryOptions, adaptableOptions.dataChangeHistoryOptions);
46
- returnedAdaptableOptions.chartingOptions = Object.assign({}, DefaultAdaptableOptions.chartingOptions, adaptableOptions.chartingOptions);
47
- returnedAdaptableOptions.chartingOptions.externalChartingOptions = Object.assign({}, DefaultAdaptableOptions.chartingOptions.externalChartingOptions, returnedAdaptableOptions.chartingOptions.externalChartingOptions);
48
- returnedAdaptableOptions.settingsPanelOptions = Object.assign({}, DefaultAdaptableOptions.settingsPanelOptions, adaptableOptions.settingsPanelOptions);
49
- returnedAdaptableOptions.fdc3Options = Object.assign({}, DefaultAdaptableOptions.fdc3Options, adaptableOptions.fdc3Options);
50
- returnedAdaptableOptions.fdc3Options.actionColumnDefaultConfiguration = Object.assign({}, DefaultAdaptableOptions.fdc3Options.actionColumnDefaultConfiguration, returnedAdaptableOptions.fdc3Options.actionColumnDefaultConfiguration);
51
- returnedAdaptableOptions.fdc3Options.uiControlsDefaultConfiguration = Object.assign({}, DefaultAdaptableOptions.fdc3Options.uiControlsDefaultConfiguration, returnedAdaptableOptions.fdc3Options.uiControlsDefaultConfiguration);
52
- const { predefinedConfig } = returnedAdaptableOptions;
53
- if (predefinedConfig) {
54
- returnedAdaptableOptions.predefinedConfig =
55
- typeof predefinedConfig === 'string'
56
- ? predefinedConfig
57
- : initPredefinedConfigWithUuids(predefinedConfig);
58
- }
59
- return returnedAdaptableOptions;
60
- }
61
4
  export function initPredefinedConfigWithUuids(predefinedConfig) {
62
5
  const customizer = (value) => {
63
6
  // so whenever we clone a plain object,
@@ -143,13 +86,30 @@ export function addUuidAndSource(adaptableObject) {
143
86
  adaptableObject.Source = 'User';
144
87
  return adaptableObject;
145
88
  }
89
+ export function removeUuidAndSource(adaptableObject) {
90
+ const sanitiseObject = (object) => {
91
+ for (const key in object) {
92
+ if (key === 'Source' || key === 'Uuid') {
93
+ delete object[key];
94
+ }
95
+ else if (Array.isArray(object[key])) {
96
+ object[key].forEach((item) => sanitiseObject(item));
97
+ }
98
+ else if (typeof object[key] === 'object') {
99
+ sanitiseObject(object[key]);
100
+ }
101
+ }
102
+ };
103
+ sanitiseObject(adaptableObject);
104
+ return adaptableObject;
105
+ }
146
106
  export const AdaptableHelper = {
147
- assignAdaptableOptions,
148
107
  initPredefinedConfigWithUuids,
149
108
  checkValidPrimaryKey,
150
109
  AdaptableObjectExistsInState,
151
110
  runAdaptableComparerFunction,
152
111
  getAppropriateAccessLevel,
153
112
  addUuidAndSource,
113
+ removeUuidAndSource,
154
114
  };
155
115
  export default AdaptableHelper;
@@ -1,5 +1,6 @@
1
1
  export declare function objectExists(item: any): boolean;
2
2
  export declare function objectNotExists(item: any): boolean;
3
+ export declare function objectHasKeys(item: any): boolean;
3
4
  export declare function getStringRepresentionFromKey(event: KeyboardEvent | any): string;
4
5
  export declare function cloneObject<T extends any>(obj: T): T;
5
6
  export declare const arrayToKeyMap: <T extends string | number | symbol>(arr?: T[]) => Record<T, boolean>;
@@ -20,6 +21,7 @@ export declare function clamp(value: any, boundOne: number, boundTwo: number): n
20
21
  export declare const Helper: {
21
22
  objectExists: typeof objectExists;
22
23
  objectNotExists: typeof objectNotExists;
24
+ objectHasKeys: typeof objectHasKeys;
23
25
  getStringRepresentionFromKey: typeof getStringRepresentionFromKey;
24
26
  cloneObject: typeof cloneObject;
25
27
  convertArrayToCsv: typeof convertArrayToCsv;
@@ -6,6 +6,9 @@ export function objectExists(item) {
6
6
  export function objectNotExists(item) {
7
7
  return !objectExists(item);
8
8
  }
9
+ export function objectHasKeys(item) {
10
+ return Object.keys(item).length > 0;
11
+ }
9
12
  export function getStringRepresentionFromKey(event) {
10
13
  if (event.key == null) {
11
14
  return event.char; // IE
@@ -227,6 +230,7 @@ export function clamp(value, boundOne, boundTwo) {
227
230
  export const Helper = {
228
231
  objectExists,
229
232
  objectNotExists,
233
+ objectHasKeys,
230
234
  getStringRepresentionFromKey,
231
235
  cloneObject,
232
236
  convertArrayToCsv,
@@ -28,10 +28,10 @@ export function CreateEmptyCalculatedColumn() {
28
28
  // need to create some defaults - which we will change later
29
29
  CalculatedColumnSettings: {
30
30
  DataType: undefined,
31
- Filterable: false,
32
- Resizable: false,
31
+ Filterable: true,
32
+ Resizable: true,
33
33
  Groupable: false,
34
- Sortable: false,
34
+ Sortable: true,
35
35
  Pivotable: false,
36
36
  Aggregatable: false,
37
37
  SuppressMenu: false,
@@ -254,10 +254,10 @@ export function CreateEmptyFreeTextColumn() {
254
254
  TextEditor: 'Inline',
255
255
  FreeTextColumnSettings: {
256
256
  DataType: 'String',
257
- Filterable: false,
258
- Resizable: false,
257
+ Filterable: true,
258
+ Resizable: true,
259
259
  Groupable: false,
260
- Sortable: false,
260
+ Sortable: true,
261
261
  Pivotable: false,
262
262
  Aggregatable: false,
263
263
  SuppressMenu: false,
@@ -7,6 +7,7 @@ export declare class AggregatedScalarLiveValue {
7
7
  private source;
8
8
  private requestingModule;
9
9
  private adaptableApi;
10
+ private getRowNodes?;
10
11
  private aggregationReducerName;
11
12
  private aggregatedScalarExpression;
12
13
  private expressionEvaluation;
@@ -15,11 +16,11 @@ export declare class AggregatedScalarLiveValue {
15
16
  aggregatedScalarExpression: string;
16
17
  }, {
17
18
  aggregatedScalarExpressionEvaluation: AggregatedScalarExpressionEvaluation;
18
- }>, requestingModule: ModuleConstants, adaptableApi: AdaptableApi);
19
+ }>, requestingModule: ModuleConstants, adaptableApi: AdaptableApi, getRowNodes?: () => IRowNode[]);
19
20
  refresh(): void;
20
21
  getAggregatedValueForRow(rowNode: IRowNode): any;
21
22
  getAllAggregationValues(): number[];
22
23
  private getAggregationValue;
23
- private getGlobalAggregatedValue;
24
+ getGlobalAggregatedValue(): any;
24
25
  private computeAggregatedValue;
25
26
  }